summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhschang <chang@dev3>2019-10-02 03:12:20 (GMT)
committerhschang <chang@dev3>2019-10-02 07:23:41 (GMT)
commit363381bc762beaafda3524e31f582de658f5da9c (patch)
treec98d72eb0919e648a1982a9711393e59d0605a2b
parent7d2e410908eadac1b8b82adc5c788b13864e484b (diff)
[linux-vuplus-zero] support new LNB chip.
-rw-r--r--meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuzero/linux_nand_bcm.patch58
-rw-r--r--meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb5
2 files changed, 61 insertions, 2 deletions
diff --git a/meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuzero/linux_nand_bcm.patch b/meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuzero/linux_nand_bcm.patch
new file mode 100644
index 0000000..0327f85
--- /dev/null
+++ b/meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuzero/linux_nand_bcm.patch
@@ -0,0 +1,58 @@
+diff --git a/drivers/mtd/nand/brcmstb_nand.c b/drivers/mtd/nand/brcmstb_nand.c
+index cd35193..9312b97 100644
+--- a/drivers/mtd/nand/brcmstb_nand.c
++++ b/drivers/mtd/nand/brcmstb_nand.c
+@@ -1260,6 +1260,37 @@ static void brcmstb_nand_print_cfg(char *buf, struct brcmstb_nand_cfg *cfg)
+ sprintf(buf, ", BCH-%u\n", cfg->ecc_level);
+ }
+
++/*
++ * Return true if the two configurations are basically identical. Note that we
++ * allow certain variations in spare area size.
++ */
++static bool brcmstb_nand_config_match(struct brcmstb_nand_cfg *orig,
++ struct brcmstb_nand_cfg *new)
++{
++ /* Negative matches */
++ if (orig->device_size != new->device_size)
++ return false;
++ if (orig->block_size != new->block_size)
++ return false;
++ if (orig->page_size != new->page_size)
++ return false;
++ if (orig->device_width != new->device_width)
++ return false;
++ if (orig->col_adr_bytes != new->col_adr_bytes)
++ return false;
++ if (orig->blk_adr_bytes != new->blk_adr_bytes)
++ return false;
++ if (orig->ful_adr_bytes != new->ful_adr_bytes)
++ return false;
++
++ /* Positive matches */
++ if (orig->spare_area_size == new->spare_area_size)
++ return true;
++ return orig->spare_area_size >= 27 &&
++ orig->spare_area_size <= new->spare_area_size;
++}
++
++
+ static int brcmstb_nand_setup_dev(struct brcmstb_nand_host *host)
+ {
+ struct mtd_info *mtd = &host->mtd;
+@@ -1303,14 +1334,7 @@ static int brcmstb_nand_setup_dev(struct brcmstb_nand_host *host)
+ mtd->oobsize = new_cfg.spare_area_size * (mtd->writesize >> FC_SHIFT);
+ }
+
+- if (orig_cfg.device_size != new_cfg.device_size ||
+- orig_cfg.block_size != new_cfg.block_size ||
+- orig_cfg.page_size != new_cfg.page_size ||
+- orig_cfg.spare_area_size != new_cfg.spare_area_size ||
+- orig_cfg.device_width != new_cfg.device_width ||
+- orig_cfg.col_adr_bytes != new_cfg.col_adr_bytes ||
+- orig_cfg.blk_adr_bytes != new_cfg.blk_adr_bytes ||
+- orig_cfg.ful_adr_bytes != new_cfg.ful_adr_bytes) {
++ if (!brcmstb_nand_config_match(&orig_cfg, &new_cfg)) {
+ #if CONTROLLER_VER >= 50
+ #ifdef CONFIG_BCM7445A0
+ /* HW7445-750: 7445A0 NAND is broken for SECTOR_SIZE = 1024B */
diff --git a/meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb b/meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb
index 74fdc25..f021209 100644
--- a/meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb
+++ b/meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb
@@ -2,9 +2,10 @@ require linux-vuplus-3.13.5.inc
COMPATIBLE_MACHINE = "^(vuzero)$"
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
SRC_URI += " \
- "
+ file://linux_nand_bcm.patch \
+"