Skip to contentSkip to conversation

imx-kobs: Allow kobs-ng to flash the SPL on the 4.x kernel

PATCH New Fabio Berton 1 participant 1 message Jul 19, 2016 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx-kobs: Allow kobs-ng to flash the SPL on the 4.x kernel

Add function to check if kernel support raw_mode and fix function that calculates the geometry based on known info from the mtd partitionmtd geometry.

These patches were copied from:
https://github.com/Gateworks/openwrt/commit/379e87df4fb67198fe900ffe2a394e69fbd47801

---
 .../imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch   | 31 ++++++++++++++
 recipes-bsp/imx-kobs/imx-kobs/raw-mode.patch       | 48 ++++++++++++++++++++++
 recipes-bsp/imx-kobs/imx-kobs_5.4.bb               |  2 +
 3 files changed, 81 insertions(+)
 create mode 100644 recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch
 create mode 100644 recipes-bsp/imx-kobs/imx-kobs/raw-mode.patch
recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch new file +31 -0
new file mode 100644
index 0000000..dddb49a
@@ -0,0 +1,31 @@
+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.
+
+Upstream-Status: Pending
+
+--- 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);
+ 		}
+
recipes-bsp/imx-kobs/imx-kobs/raw-mode.patch new file +48 -0

48 lines not on this page · raw message

recipes-bsp/imx-kobs/imx-kobs_5.4.bb +2 -0
index 1d33d40..de396a1 100644
@@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
 
 SRC_URI = "${FSL_MIRROR}/imx-kobs-${PV}.tar.gz \
            file://fix-compile.patch \
+           file://raw-mode.patch \
+           file://fix-cal_nfc_geometry.patch \
 "
 
 SRC_URI[md5sum] = "77467d834f858c2ec216841583e5f437"
Signature · 1 line
2.1.4