aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2013-12-11 23:22:24 +0100
committerAndrea Adami <andrea.adami@gmail.com>2013-12-15 17:08:17 +0100
commitbea72972a1ae05e91743ac2cfafbbc0e3ab326e2 (patch)
treeef054f99ef8e2864393336717bd1710d4bf3e1be /recipes-kernel
parent7f74807f5db27c221fde762034cc0495878c6805 (diff)
downloadmeta-handheld-bea72972a1ae05e91743ac2cfafbbc0e3ab326e2.tar.gz
linux-yocto*: collie: put device back to one single partition
Initial hack intended as workaround for the CFI code which seems not liking these Dual Work / 4 planes chips (one Status Register for each partition, 2 partitions on boot). Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-yocto-3.10/collie/collie.scc1
-rw-r--r--recipes-kernel/linux/linux-yocto-3.10/patches/patches-mtd/collie-PCR.patch59
-rw-r--r--recipes-kernel/linux/linux-yocto-dev/collie/collie.scc1
-rw-r--r--recipes-kernel/linux/linux-yocto-dev/patches/patches-mtd/collie-PCR.patch59
-rw-r--r--recipes-kernel/linux/linux-yocto-tiny-kexecboot-3.10/patches/patches-mtd/collie-PCR.patch59
-rw-r--r--recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bbappend1
6 files changed, 180 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-yocto-3.10/collie/collie.scc b/recipes-kernel/linux/linux-yocto-3.10/collie/collie.scc
index 5ef7c56..274fdb6 100644
--- a/recipes-kernel/linux/linux-yocto-3.10/collie/collie.scc
+++ b/recipes-kernel/linux/linux-yocto-3.10/collie/collie.scc
@@ -14,6 +14,7 @@ patch ../patches/patches-mtd/collie-force-cfi.patch
patch ../patches/patches-mtd/collie-mtd-resize.patch
patch ../patches/patches-mtd/collie-force-unlock.patch
patch ../patches/patches-mtd/collie-fixup-strataflash.patch
+patch ../patches/patches-mtd/collie-PCR.patch
patch ../patches/patches-sa1100/collie-irda.patch
patch ../patches/patches-sa1100/collie-add-bootblock.patch
patch ../patches/patches-sa1100/arm-sa1100-add-cpu-clock.patch
diff --git a/recipes-kernel/linux/linux-yocto-3.10/patches/patches-mtd/collie-PCR.patch b/recipes-kernel/linux/linux-yocto-3.10/patches/patches-mtd/collie-PCR.patch
new file mode 100644
index 0000000..ce7681a
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto-3.10/patches/patches-mtd/collie-PCR.patch
@@ -0,0 +1,59 @@
+From e5ca5b21330a683329e2912786f6b7cecbc5d5c9 Mon Sep 17 00:00:00 2001
+From: Andrea Adami <andrea.adami@gmail.com>
+Date: Wed, 11 Dec 2013 00:27:34 +0100
+Subject: [PATCH] cfi_probe.c: hack to reset Partition Control Register
+ on collie
+
+Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
+---
+ drivers/mtd/chips/cfi_probe.c | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+
+diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
+index d255352..e2e80db 100644
+--- a/drivers/mtd/chips/cfi_probe.c
++++ b/drivers/mtd/chips/cfi_probe.c
+@@ -228,6 +228,40 @@ static int __xipram cfi_chip_setup(struct map_info *map,
+ cfi->mfr = cfi_read_query16(map, base);
+ cfi->id = cfi_read_query16(map, base + ofs_factor);
+
++
++
++
++ /* read PCR */
++ unsigned long PCR, SR;
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register was:%lx\n", PCR);
++
++ /* Set PCR two-cycle command sequence.
++ * After executing this command, the device
++ * returns to read array mode and status registers are cleared
++ */
++ cfi_send_gen_cmd(0x60, 0x0000, base, map, cfi, cfi->device_type, NULL);
++ cfi_send_gen_cmd(0x04, 0x0000, base, map, cfi, cfi->device_type, NULL);
++
++ /* chech Status Register */
++ cfi_send_gen_cmd(0x70, 0, base, map, cfi, cfi->device_type, NULL);
++ SR = cfi_read_query16(map, base + 6 * ofs_factor);
++
++ /* Check SR.4, 5
++ * Both 1 = Command Sequence Error
++ */
++ printk ("Status Register is:%lx\n", SR);
++
++
++ /* read again PCR */
++ cfi_send_gen_cmd(0x90, addr_unlock1, 0, map, cfi, cfi->device_type, NULL);
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register is now:%lx\n", PCR);
++
++
++
++
++
+ /* Get AMD/Spansion extended JEDEC ID */
+ if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e)
+ cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
+--
+1.8.1.5
+
diff --git a/recipes-kernel/linux/linux-yocto-dev/collie/collie.scc b/recipes-kernel/linux/linux-yocto-dev/collie/collie.scc
index 15986bf..f93d9ec 100644
--- a/recipes-kernel/linux/linux-yocto-dev/collie/collie.scc
+++ b/recipes-kernel/linux/linux-yocto-dev/collie/collie.scc
@@ -8,6 +8,7 @@ patch ../patches/patches-mtd/collie-force-cfi.patch
patch ../patches/patches-mtd/collie-mtd-resize.patch
patch ../patches/patches-mtd/collie-force-unlock.patch
patch ../patches/patches-mtd/collie-fixup-strataflash.patch
+patch ../patches/patches-mtd/collie-PCR.patch
patch ../patches/patches-sa1100/collie-irda.patch
patch ../patches/patches-sa1100/collie-add-bootblock.patch
patch ../patches/patches-sa1100/arm-sa1100-add-cpu-clock.patch
diff --git a/recipes-kernel/linux/linux-yocto-dev/patches/patches-mtd/collie-PCR.patch b/recipes-kernel/linux/linux-yocto-dev/patches/patches-mtd/collie-PCR.patch
new file mode 100644
index 0000000..ce7681a
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto-dev/patches/patches-mtd/collie-PCR.patch
@@ -0,0 +1,59 @@
+From e5ca5b21330a683329e2912786f6b7cecbc5d5c9 Mon Sep 17 00:00:00 2001
+From: Andrea Adami <andrea.adami@gmail.com>
+Date: Wed, 11 Dec 2013 00:27:34 +0100
+Subject: [PATCH] cfi_probe.c: hack to reset Partition Control Register
+ on collie
+
+Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
+---
+ drivers/mtd/chips/cfi_probe.c | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+
+diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
+index d255352..e2e80db 100644
+--- a/drivers/mtd/chips/cfi_probe.c
++++ b/drivers/mtd/chips/cfi_probe.c
+@@ -228,6 +228,40 @@ static int __xipram cfi_chip_setup(struct map_info *map,
+ cfi->mfr = cfi_read_query16(map, base);
+ cfi->id = cfi_read_query16(map, base + ofs_factor);
+
++
++
++
++ /* read PCR */
++ unsigned long PCR, SR;
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register was:%lx\n", PCR);
++
++ /* Set PCR two-cycle command sequence.
++ * After executing this command, the device
++ * returns to read array mode and status registers are cleared
++ */
++ cfi_send_gen_cmd(0x60, 0x0000, base, map, cfi, cfi->device_type, NULL);
++ cfi_send_gen_cmd(0x04, 0x0000, base, map, cfi, cfi->device_type, NULL);
++
++ /* chech Status Register */
++ cfi_send_gen_cmd(0x70, 0, base, map, cfi, cfi->device_type, NULL);
++ SR = cfi_read_query16(map, base + 6 * ofs_factor);
++
++ /* Check SR.4, 5
++ * Both 1 = Command Sequence Error
++ */
++ printk ("Status Register is:%lx\n", SR);
++
++
++ /* read again PCR */
++ cfi_send_gen_cmd(0x90, addr_unlock1, 0, map, cfi, cfi->device_type, NULL);
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register is now:%lx\n", PCR);
++
++
++
++
++
+ /* Get AMD/Spansion extended JEDEC ID */
+ if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e)
+ cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
+--
+1.8.1.5
+
diff --git a/recipes-kernel/linux/linux-yocto-tiny-kexecboot-3.10/patches/patches-mtd/collie-PCR.patch b/recipes-kernel/linux/linux-yocto-tiny-kexecboot-3.10/patches/patches-mtd/collie-PCR.patch
new file mode 100644
index 0000000..ce7681a
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto-tiny-kexecboot-3.10/patches/patches-mtd/collie-PCR.patch
@@ -0,0 +1,59 @@
+From e5ca5b21330a683329e2912786f6b7cecbc5d5c9 Mon Sep 17 00:00:00 2001
+From: Andrea Adami <andrea.adami@gmail.com>
+Date: Wed, 11 Dec 2013 00:27:34 +0100
+Subject: [PATCH] cfi_probe.c: hack to reset Partition Control Register
+ on collie
+
+Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
+---
+ drivers/mtd/chips/cfi_probe.c | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+
+diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
+index d255352..e2e80db 100644
+--- a/drivers/mtd/chips/cfi_probe.c
++++ b/drivers/mtd/chips/cfi_probe.c
+@@ -228,6 +228,40 @@ static int __xipram cfi_chip_setup(struct map_info *map,
+ cfi->mfr = cfi_read_query16(map, base);
+ cfi->id = cfi_read_query16(map, base + ofs_factor);
+
++
++
++
++ /* read PCR */
++ unsigned long PCR, SR;
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register was:%lx\n", PCR);
++
++ /* Set PCR two-cycle command sequence.
++ * After executing this command, the device
++ * returns to read array mode and status registers are cleared
++ */
++ cfi_send_gen_cmd(0x60, 0x0000, base, map, cfi, cfi->device_type, NULL);
++ cfi_send_gen_cmd(0x04, 0x0000, base, map, cfi, cfi->device_type, NULL);
++
++ /* chech Status Register */
++ cfi_send_gen_cmd(0x70, 0, base, map, cfi, cfi->device_type, NULL);
++ SR = cfi_read_query16(map, base + 6 * ofs_factor);
++
++ /* Check SR.4, 5
++ * Both 1 = Command Sequence Error
++ */
++ printk ("Status Register is:%lx\n", SR);
++
++
++ /* read again PCR */
++ cfi_send_gen_cmd(0x90, addr_unlock1, 0, map, cfi, cfi->device_type, NULL);
++ PCR = cfi_read_query16(map, base + 6 * ofs_factor);
++ printk ("Partition Configuration Register is now:%lx\n", PCR);
++
++
++
++
++
+ /* Get AMD/Spansion extended JEDEC ID */
+ if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e)
+ cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
+--
+1.8.1.5
+
diff --git a/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bbappend b/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bbappend
index f6659b0..992b2cb 100644
--- a/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bbappend
+++ b/recipes-kernel/linux/linux-yocto-tiny-kexecboot_3.10.bbappend
@@ -47,6 +47,7 @@ SRC_URI_append_collie = " \
file://patches/patches-mtd/collie-mtd-resize.patch \
file://patches/patches-mtd/collie-force-unlock.patch \
file://patches/patches-mtd/collie-fixup-strataflash.patch \
+ file://patches/patches-mtd/collie-PCR.patch \
file://patches/patches-sa1100/collie-irda.patch \
file://patches/patches-sa1100/collie-add-bootblock.patch \
file://patches/patches-sa1100/arm-sa1100-add-cpu-clock.patch \