linux-dreambox-3.2: update to linux-3.2-stable 3.2.68
[opendreambox.git] / meta-bsp / common / recipes / linux / linux-dreambox-3.2 / 0001-correctly-initiate-nand-flash-ecc-config-when-old-2n.patch
1 From 884356a67306acdabe932107adf498d6f91ee02c Mon Sep 17 00:00:00 2001
2 From: Andreas Monzner <andreas.monzner@dream-property.net>
3 Date: Mon, 16 Mar 2015 13:54:35 +0100
4 Subject: [PATCH 4/4] correctly initiate nand flash ecc config when old 2nd
5  stage loader is used to boot the box (maybe via
6  network)
7
8 ---
9  drivers/mtd/brcmnand/brcmnand_base.c |    9 +++++++++
10  1 file changed, 9 insertions(+)
11
12 diff --git a/drivers/mtd/brcmnand/brcmnand_base.c b/drivers/mtd/brcmnand/brcmnand_base.c
13 index e49149d..4410fe4 100644
14 --- a/drivers/mtd/brcmnand/brcmnand_base.c
15 +++ b/drivers/mtd/brcmnand/brcmnand_base.c
16 @@ -9545,6 +9545,15 @@ printk("%s: Ecc level set to %d, sectorSize=%d from ID table\n", __FUNCTION__, c
17          */
18  
19         if (foundInIdTable && brcmnand_dev_id == TOSHIBA_TC58NVG3S0ETA00 && brcmnand_maf_id == FLASHTYPE_TOSHIBA && (nand_config >> 24) == 0x48) {
20 +               /* force BCH-4 error correction
21 +                * this is needed when the 2nd stage loader has set the wrong
22 +                * ecc config (old 2nd stage loader used and bootet via network)
23 +                */
24 +               uint32_t acc = brcmnand_ctrl_read(bchp_nand_acc_control(cs));
25 +               acc &= 0xFF00FFFF;
26 +               acc |= 0x440000;
27 +               chip->ctrl_write(bchp_nand_config(chip->ctrl->CS[chip->csi]), acc);
28 +
29                 nand_config &= ~(BCHP_NAND_CONFIG_BLOCK_SIZE_MASK);
30                 nand_config |= (BCHP_NAND_CONFIG_BLOCK_SIZE_BK_SIZE_128KB << BCHP_NAND_CONFIG_BLOCK_SIZE_SHIFT);
31  
32 -- 
33 1.7.10.4
34