Thread (23 messages) 23 messages, 3 authors, 2020-09-30

Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2020-09-17 07:18:12

On Wed, Sep 16, 2020 at 11:56 PM Fabio Estevam [off-list ref] wrote:
On Wed, Sep 16, 2020 at 6:35 PM Arnd Bergmann [off-list ref] wrote:
quoted
As far as I can tell, the MX27_IO_P2V() macro should be removed here as
well if MX27_IO_ADDRESS() gets removed.
The MX27_IO_P2V() macro is still used. Here is the error when I try to
remove it:

In file included from arch/arm/mach-imx/mach-imx27.c:17:0:
arch/arm/mach-imx/mach-imx27.c:30:16: error: implicit declaration of
function ‘MX27_IO_P2V’; did you mean ‘MX35_IO_P2V’?
[-Werror=implicit-function-declaration]
  imx_map_entry(MX27, AIPI, MT_DEVICE),
                ^
arch/arm/mach-imx/hardware.h:103:13: note: in definition of macro
‘imx_map_entry’
  .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \
Ah, right. My grep did not catch the static mappings:

arch/arm/mach-imx/mm-imx21.c-/* MX21 memory map definition */
arch/arm/mach-imx/mm-imx21.c-static struct map_desc imx21_io_desc[]
__initdata = {
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, AIPI, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, SAHB1, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c-};
--
arch/arm/mach-imx/mm-imx27.c-/* MX27 memory map definition */
arch/arm/mach-imx/mm-imx27.c-static struct map_desc imx27_io_desc[]
__initdata = {
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, AIPI, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, SAHB1, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c-};
--
arch/arm/mach-imx/mm-imx3.c-static struct map_desc mx31_io_desc[] __initdata = {
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c-};
--
arch/arm/mach-imx/mm-imx3.c-#ifdef CONFIG_SOC_IMX35
arch/arm/mach-imx/mm-imx3.c-static struct map_desc mx35_io_desc[] __initdata = {
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c-};

If all of the devices in here are now also mapped using of_iomap() or
ioremap(), then the iotables are not strictly needed any more, but most
of them are 1MB section sized, which helps slightly reduce TLB usage
compared to non-section ioremap() mappings, so we might want to
keep them anyway, possibly with the constants moved from the header
into the mm-imx??.c files.

Adding Linus to Cc for further thoughts, as he was looking at the early
io mappings recently.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help