summaryrefslogtreecommitdiffstats
path: root/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2016-09-01 07:45:37 -0700
committerFelix Fietkau <nbd@nbd.name>2016-09-04 13:36:09 +0200
commita4b86b292a0bce95b9874d6c757a709c5a5269b4 (patch)
tree7922e9c3677adc852b5812519866586fd9fb2c80 /package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
parentf8c7e935ef8060b8ab2f5ca52832ef8dfea361bc (diff)
downloadmaster-31e0f0ae-a4b86b292a0bce95b9874d6c757a709c5a5269b4.tar.gz
master-31e0f0ae-a4b86b292a0bce95b9874d6c757a709c5a5269b4.tar.bz2
master-31e0f0ae-a4b86b292a0bce95b9874d6c757a709c5a5269b4.zip
boot: kobs-ng: update kobs-ng for newer kernels
This allows kobs-ng to flash the SPL successfully on the 4.4 kernel used by the Gateworks IMX boards supporting NAND. The previous version of kobs-ng worked with the 3.14 kernel but will brick a board making its SPL unbootable for the 4.4 kernel. See http://trac.gateworks.com/wiki/ventana/bootloader#nandspl for instructions on updating the SPL from Linux. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch')
-rw-r--r--package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
new file mode 100644
index 0000000000..ebfd62345c
--- /dev/null
+++ b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
@@ -0,0 +1,27 @@
+The Freescale downstream vendor kernel has a patch that exports the bch
+flash geometry via a debugfs file. This is not available in mainline linux
+kernels so the fallback method calculates the geometry based on known info
+from the mtd partition. A bug exists in this funcion where it fails to
+assume that block0 ECC is the same as the other blocks by default.
+--- a/src/mtd.c
++++ b/src/mtd.c
+@@ -610,7 +610,7 @@ static int cal_nfc_geometry(struct mtd_d
+ /* The two are fixed, please change them when the driver changes. */
+ geo->metadata_size_in_bytes = 10;
+ geo->gf_len = 13;
+- geo->ecc_chunkn_size_in_bytes = 512;
++ geo->ecc_chunkn_size_in_bytes = geo->ecc_chunk0_size_in_bytes = 512;
+
+ if (mtd->oobsize > geo->ecc_chunkn_size_in_bytes) {
+ geo->gf_len = 14;
+@@ -700,8 +700,9 @@ int parse_nfc_geometry(struct mtd_data *
+ unsigned int value;
+
+ if (!plat_config_data->m_u32UseNfcGeo) {
++ /* fsl kernel patch provides bch_geometry via debugfs */
+ if (!(node = fopen(dbg_geometry_node_path, "r"))) {
+- fprintf(stderr, "Cannot open BCH geometry node: \"%s\"",
++ fprintf(stderr, "Cannot open BCH geometry node: \"%s\"\n",
+ dbg_geometry_node_path);
+ return cal_nfc_geometry(md);
+ }