summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/raw/brcmnand/brcmnand.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2022-01-07 10:46:14 -0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-01-23 16:37:19 +0100
commitfeca4cc4765a67907a97bddfa94aa6901cbbce7d (patch)
tree5e6e1d1e541d1b3a584f2728b203e98e12b17da5 /drivers/mtd/nand/raw/brcmnand/brcmnand.c
parent5abd37f6e9d653b748a1acad7e0abcbe540e896a (diff)
mtd: rawnand: brcmnand: Add BCMA shim
Add a BCMA shim to allow us to register the brcmnand driver using the BCMA bus which provides indirect memory mapped access to SoC registers. There are a number of registers that need to be byte swapped because they are natively big endian, coming directly from the NAND chip, and there is no bus interface unlike the iProc or STB platforms that performs the byte swapping for us. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220107184614.2670254-10-f.fainelli@gmail.com
Diffstat (limited to 'drivers/mtd/nand/raw/brcmnand/brcmnand.c')
-rw-r--r--drivers/mtd/nand/raw/brcmnand/brcmnand.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 4759303ece7c..c412f79b81db 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -598,7 +598,11 @@ enum {
static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl)
{
+#if IS_ENABLED(CONFIG_MTD_NAND_BRCMNAND_BCMA)
return static_branch_unlikely(&brcmnand_soc_has_ops_key);
+#else
+ return false;
+#endif
}
static inline u32 nand_readreg(struct brcmnand_controller *ctrl, u32 offs)