diff options
Diffstat (limited to 'recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch')
-rw-r--r-- | recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch b/recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch new file mode 100644 index 0000000..dddb49a --- /dev/null +++ b/recipes-bsp/imx-kobs/imx-kobs/fix-cal_nfc_geometry.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | The Freescale downstream vendor kernel has a patch that exports the bch | ||
2 | flash geometry via a debugfs file. This is not available in mainline linux | ||
3 | kernels so the fallback method calculates the geometry based on known info | ||
4 | from the mtd partition. A bug exists in this funcion where it fails to | ||
5 | assume that block0 ECC is the same as the other blocks by default. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | --- a/src/mtd.c | ||
10 | +++ b/src/mtd.c | ||
11 | @@ -610,7 +610,7 @@ static int cal_nfc_geometry(struct mtd_d | ||
12 | /* The two are fixed, please change them when the driver changes. */ | ||
13 | geo->metadata_size_in_bytes = 10; | ||
14 | geo->gf_len = 13; | ||
15 | - geo->ecc_chunkn_size_in_bytes = 512; | ||
16 | + geo->ecc_chunkn_size_in_bytes = geo->ecc_chunk0_size_in_bytes = 512; | ||
17 | |||
18 | if (mtd->oobsize > geo->ecc_chunkn_size_in_bytes) { | ||
19 | geo->gf_len = 14; | ||
20 | @@ -700,8 +700,9 @@ int parse_nfc_geometry(struct mtd_data * | ||
21 | unsigned int value; | ||
22 | |||
23 | if (!plat_config_data->m_u32UseNfcGeo) { | ||
24 | + /* fsl kernel patch provides bch_geometry via debugfs */ | ||
25 | if (!(node = fopen(dbg_geometry_node_path, "r"))) { | ||
26 | - fprintf(stderr, "Cannot open BCH geometry node: \"%s\"", | ||
27 | + fprintf(stderr, "Cannot open BCH geometry node: \"%s\"\n", | ||
28 | dbg_geometry_node_path); | ||
29 | return cal_nfc_geometry(md); | ||
30 | } | ||
31 | |||