I believe that some sunxis (ncat2?) lack a SRAMC block, as accessing this region results in a data abort. Checking that it's non-null before accessing it allows this to be set to NULL for SoCs where it's not present.
Signed-off-by: Sam Edwards <cfswo...@gmail.com> --- drivers/usb/musb-new/sunxi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index dc4cfc2194..6e60dd47e0 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -174,13 +174,15 @@ static void USBC_ForceVbusValidToHigh(__iomem void *base) static void USBC_ConfigFIFO_Base(void) { - u32 reg_value; - - /* config usb fifo, 8kb mode */ - reg_value = readl(SUNXI_SRAMC_BASE + 0x04); - reg_value &= ~(0x03 << 0); - reg_value |= BIT(0); - writel(reg_value, SUNXI_SRAMC_BASE + 0x04); + if (SUNXI_SRAMC_BASE) { + u32 reg_value; + + /* config usb fifo, 8kb mode */ + reg_value = readl(SUNXI_SRAMC_BASE + 0x04); + reg_value &= ~(0x03 << 0); + reg_value |= BIT(0); + writel(reg_value, SUNXI_SRAMC_BASE + 0x04); + } } /****************************************************************************** -- 2.39.2