mtd: rawnand: marvell: Enable NFC/DEVBUS arbiter
authorHamish Martin <hamish.martin@alliedtelesis.co.nz>
Wed, 9 Nov 2022 23:13:25 +0000 (12:13 +1300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 17 Nov 2022 21:14:08 +0000 (22:14 +0100)
The CN9130 SoC (an ARMADA 8K type) has both a NAND Flash Controller and
a generic local bus controller (Device Bus Controller) that share common
pins.
With a board design that incorporates both a NAND flash and uses
the Device Bus (in our case for an SRAM) accessing the Device Bus device
fails unless the NfArbiterEn bit is set. Setting the bit enables
arbitration between the Device Bus and the NAND flash.
Since there is no obvious downside in enabling this for designs that
don't require arbitration, we always enable it.

Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221109231325.7714-1-hamish.martin@alliedtelesis.co.nz
drivers/mtd/nand/raw/marvell_nand.c

index d9f2f1d..71e3751 100644 (file)
 #define GENCONF_SOC_DEVICE_MUX_ECC_CLK_RST BIT(20)
 #define GENCONF_SOC_DEVICE_MUX_ECC_CORE_RST BIT(21)
 #define GENCONF_SOC_DEVICE_MUX_NFC_INT_EN BIT(25)
+#define GENCONF_SOC_DEVICE_MUX_NFC_DEVBUS_ARB_EN BIT(27)
 #define GENCONF_CLK_GATING_CTRL        0x220
 #define GENCONF_CLK_GATING_CTRL_ND_GATE BIT(2)
 #define GENCONF_ND_CLK_CTRL    0x700
@@ -2880,7 +2881,8 @@ static int marvell_nfc_init(struct marvell_nfc *nfc)
                             GENCONF_SOC_DEVICE_MUX_NFC_EN |
                             GENCONF_SOC_DEVICE_MUX_ECC_CLK_RST |
                             GENCONF_SOC_DEVICE_MUX_ECC_CORE_RST |
-                            GENCONF_SOC_DEVICE_MUX_NFC_INT_EN);
+                            GENCONF_SOC_DEVICE_MUX_NFC_INT_EN |
+                            GENCONF_SOC_DEVICE_MUX_NFC_DEVBUS_ARB_EN);
 
                regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL,
                                   GENCONF_CLK_GATING_CTRL_ND_GATE,