aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/fix-spi-nor-namespace-clash.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-04-15 10:29:38 +0000
committerTimo Teräs <timo.teras@iki.fi>2015-04-15 10:31:00 +0000
commit6539f0021ef14b0d5ab38a7b19cd4fdc433a66d8 (patch)
tree4c03009197967cd8c218ff33c8c51e8cc80068e6 /main/linux-grsec/fix-spi-nor-namespace-clash.patch
parent4f1b6c85dba6bfd1331b27f5bac9d0548a0bd3b8 (diff)
downloadaports-6539f0021ef14b0d5ab38a7b19cd4fdc433a66d8.tar.bz2
aports-6539f0021ef14b0d5ab38a7b19cd4fdc433a66d8.tar.xz
main/linux-grsec: arm build fixes and changes
fix spi-nor build on arm add some more arm boards
Diffstat (limited to 'main/linux-grsec/fix-spi-nor-namespace-clash.patch')
-rw-r--r--main/linux-grsec/fix-spi-nor-namespace-clash.patch101
1 files changed, 101 insertions, 0 deletions
diff --git a/main/linux-grsec/fix-spi-nor-namespace-clash.patch b/main/linux-grsec/fix-spi-nor-namespace-clash.patch
new file mode 100644
index 0000000000..9f09238b1e
--- /dev/null
+++ b/main/linux-grsec/fix-spi-nor-namespace-clash.patch
@@ -0,0 +1,101 @@
+grsec patch includes <linux/fs.h> which defines READ and WRITE.
+Remove the macro hackery, and use the proper #define names for
+macro invocations so there's no surprises.
+
+--- linux-3.18/drivers/mtd/spi-nor/fsl-quadspi.c.orig
++++ linux-3.18/drivers/mtd/spi-nor/fsl-quadspi.c
+@@ -166,8 +166,8 @@
+
+ /* Macros for constructing the LUT register. */
+ #define LUT0(ins, pad, opr) \
+- (((opr) << OPRND0_SHIFT) | ((LUT_##pad) << PAD0_SHIFT) | \
+- ((LUT_##ins) << INSTR0_SHIFT))
++ (((opr) << OPRND0_SHIFT) | ((pad) << PAD0_SHIFT) | \
++ ((ins) << INSTR0_SHIFT))
+
+ #define LUT1(ins, pad, opr) (LUT0(ins, pad, opr) << OPRND1_SHIFT)
+
+@@ -304,14 +304,14 @@
+ dummy = 8;
+ }
+
+- writel(LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
++ writel(LUT0(LUT_CMD, LUT_PAD1, cmd) | LUT1(LUT_ADDR, LUT_PAD1, addrlen),
+ base + QUADSPI_LUT(lut_base));
+- writel(LUT0(DUMMY, PAD1, dummy) | LUT1(READ, PAD4, rxfifo),
++ writel(LUT0(LUT_DUMMY, LUT_PAD1, dummy) | LUT1(LUT_READ, LUT_PAD4, rxfifo),
+ base + QUADSPI_LUT(lut_base + 1));
+
+ /* Write enable */
+ lut_base = SEQID_WREN * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_WREN), base + QUADSPI_LUT(lut_base));
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_WREN), base + QUADSPI_LUT(lut_base));
+
+ /* Page Program */
+ lut_base = SEQID_PP * 4;
+@@ -325,13 +325,13 @@
+ addrlen = ADDR32BIT;
+ }
+
+- writel(LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
++ writel(LUT0(LUT_CMD, LUT_PAD1, cmd) | LUT1(LUT_ADDR, LUT_PAD1, addrlen),
+ base + QUADSPI_LUT(lut_base));
+- writel(LUT0(WRITE, PAD1, 0), base + QUADSPI_LUT(lut_base + 1));
++ writel(LUT0(LUT_WRITE, LUT_PAD1, 0), base + QUADSPI_LUT(lut_base + 1));
+
+ /* Read Status */
+ lut_base = SEQID_RDSR * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_RDSR) | LUT1(READ, PAD1, 0x1),
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_RDSR) | LUT1(LUT_READ, LUT_PAD1, 0x1),
+ base + QUADSPI_LUT(lut_base));
+
+ /* Erase a sector */
+@@ -346,40 +346,40 @@
+ addrlen = ADDR32BIT;
+ }
+
+- writel(LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
++ writel(LUT0(LUT_CMD, LUT_PAD1, cmd) | LUT1(LUT_ADDR, LUT_PAD1, addrlen),
+ base + QUADSPI_LUT(lut_base));
+
+ /* Erase the whole chip */
+ lut_base = SEQID_CHIP_ERASE * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_CHIP_ERASE),
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_CHIP_ERASE),
+ base + QUADSPI_LUT(lut_base));
+
+ /* READ ID */
+ lut_base = SEQID_RDID * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_RDID) | LUT1(READ, PAD1, 0x8),
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_RDID) | LUT1(LUT_READ, LUT_PAD1, 0x8),
+ base + QUADSPI_LUT(lut_base));
+
+ /* Write Register */
+ lut_base = SEQID_WRSR * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_WRSR) | LUT1(WRITE, PAD1, 0x2),
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_WRSR) | LUT1(LUT_WRITE, LUT_PAD1, 0x2),
+ base + QUADSPI_LUT(lut_base));
+
+ /* Read Configuration Register */
+ lut_base = SEQID_RDCR * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_RDCR) | LUT1(READ, PAD1, 0x1),
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_RDCR) | LUT1(LUT_READ, LUT_PAD1, 0x1),
+ base + QUADSPI_LUT(lut_base));
+
+ /* Write disable */
+ lut_base = SEQID_WRDI * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_WRDI), base + QUADSPI_LUT(lut_base));
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_WRDI), base + QUADSPI_LUT(lut_base));
+
+ /* Enter 4 Byte Mode (Micron) */
+ lut_base = SEQID_EN4B * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_EN4B), base + QUADSPI_LUT(lut_base));
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_EN4B), base + QUADSPI_LUT(lut_base));
+
+ /* Enter 4 Byte Mode (Spansion) */
+ lut_base = SEQID_BRWR * 4;
+- writel(LUT0(CMD, PAD1, SPINOR_OP_BRWR), base + QUADSPI_LUT(lut_base));
++ writel(LUT0(LUT_CMD, LUT_PAD1, SPINOR_OP_BRWR), base + QUADSPI_LUT(lut_base));
+
+ fsl_qspi_lock_lut(q);
+ }