188d59b7d1665d55beb977162290be3cc16f2d12
[openwrt/staging/981213.git] /
1 From: Florian Fainelli <f.fainelli@gmail.com>
2 Subject: [PATCH v3 8/9] mtd: rawnand: brcmnand: BCMA controller uses command shift of 0
3 Date: Fri, 07 Jan 2022 10:46:13 -0800
4 Content-Type: text/plain; charset="utf-8"
5
6 For some odd and unexplained reason the BCMA NAND controller, albeit
7 revision 3.4 uses a command shift of 0 instead of 24 as it should be,
8 quirk that.
9
10 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
11 ---
12 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 ++++++
13 1 file changed, 6 insertions(+)
14
15 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
16 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
17 @@ -916,6 +916,12 @@ static void brcmnand_wr_corr_thresh(stru
18
19 static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl)
20 {
21 + /* Kludge for the BCMA-based NAND controller which does not actually
22 + * shift the command
23 + */
24 + if (ctrl->nand_version == 0x0304 && brcmnand_non_mmio_ops(ctrl))
25 + return 0;
26 +
27 if (ctrl->nand_version < 0x0602)
28 return 24;
29 return 0;