diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-08-09 16:40:32 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-08-15 21:33:49 +0200 |
commit | 9dc03ffd996d4103cc2a11286d61e517bce27440 (patch) | |
tree | 468e29c77d448d945d299cb0df25e84a17f39906 /arch/arm/mach-lpc32xx/common.c | |
parent | gpio: lpc32xx: allow building on non-lpc32xx targets (diff) | |
download | linux-9dc03ffd996d4103cc2a11286d61e517bce27440.tar.xz linux-9dc03ffd996d4103cc2a11286d61e517bce27440.zip |
net: lpc-enet: factor out iram access
The lpc_eth driver uses a platform specific method to find
the internal sram. This prevents building it on other machines.
Rework to only use one function call and keep the other platform
internals where they belong. Ideally this would look up the
sram location from DT, but as this is a rarely used driver,
I want to keep the modifications to a minimum.
Link: https://lore.kernel.org/r/20190809144043.476786-7-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-lpc32xx/common.c')
-rw-r--r-- | arch/arm/mach-lpc32xx/common.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index 5b71b4fab2cd..f648324d5fb4 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -8,6 +8,7 @@ */ #include <linux/init.h> +#include <linux/soc/nxp/lpc32xx-misc.h> #include <asm/mach/map.h> #include <asm/system_info.h> @@ -32,7 +33,7 @@ void lpc32xx_get_uid(u32 devid[4]) */ #define LPC32XX_IRAM_BANK_SIZE SZ_128K static u32 iram_size; -u32 lpc32xx_return_iram_size(void) +u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) { if (iram_size == 0) { u32 savedval1, savedval2; @@ -53,10 +54,14 @@ u32 lpc32xx_return_iram_size(void) } else iram_size = LPC32XX_IRAM_BANK_SIZE * 2; } + if (dmaaddr) + *dmaaddr = LPC32XX_IRAM_BASE; + if (mapbase) + *mapbase = io_p2v(LPC32XX_IRAM_BASE); return iram_size; } -EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size); +EXPORT_SYMBOL_GPL(lpc32xx_return_iram); static struct map_desc lpc32xx_io_desc[] __initdata = { { |