Re: [PATCH 1/4] ARM/ixp4xx: Move the UART and exp bus virtbases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 3, 2021 at 11:16 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> UART1, UART2 and the expansion bus config registers
> are the only registers mapped in a fixed location
> when using device tree.
>
> For device tree we also want to get rid of the custom
> <mach/io.h> for IXP4xx. So we need to undefine
> CONFIG_NEED_MACH_IO_H. Doing that activates the fixed
> mapping of the PCI IO space to PCI_IO_VIRT_BASE which
> is hardcoded to 0xFEE00000 and this would collide with
> the old fixed mappings.
>
> Move the UART1 and UART2 to the beginning of the fixmap
> region at 0xFFC80000-0xFFC81FFF and move the expansion
> bus base to 0xFFC82000-0xFFC81FFF in order to be able to
> accommodate for the fixed PCI virtual IO space.

This doesn't feel right to me, for multiple reasons:

- I don't think putting something into fixmap is valid unless you assign
  a fixmap constant in arch/arm/include/asm/fixmap.h for it and
  use that constant.
  We do have FIX_EARLYCON_MEM_BASE already, and we could
  in theory use the same constant for both debug_ll and earlycon
  (I think), or we could have adjacent pages for the two.

- IIRC, DEBUG_LL always uses a section map, so if you just need
  a single page, it doesn't work right.

Would it be sufficient if you just move IXP4XX_*_BASE_VIRT
from 0xFEF????? to 0xFEC????? ?

Idea I've had in the past was to treat DEBUG_UART_VIRT==0
as a special case that automatically picks a reasonable fixed
address, such as (0xfec00000 | (DEBUG_UART_PHYS & 0x1fffff)
and document that area in Documentation/arm/memory.txt as
the default place for debug_ll.

        Arnd

> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Imre Kaloz <kaloz@xxxxxxxxxxx>
> Cc: Krzysztof Halasa <khalasa@xxxxxxx>
> Cc: Zoltan HERPAI <wigyori@xxxxxxx>
> Cc: Raylynn Knight <rayknight@xxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> PCI maintainers: this patch is mostly FYI, will be
> merged through ARM SoC
> ---
>  arch/arm/Kconfig.debug                          | 4 ++--
>  arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h | 7 ++++---
>  arch/arm/mach-ixp4xx/ixp4xx-of.c                | 8 ++++++--
>  3 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 9e0b5e7f12af..bbe799f6bc03 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -1803,8 +1803,8 @@ config DEBUG_UART_VIRT
>         default 0xfedc0000 if DEBUG_EP93XX
>         default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1
>         default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
> -       default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
> -       default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
> +       default 0xffc80000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
> +       default 0xffc80003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
>         default 0xfef36000 if DEBUG_HIGHBANK_UART
>         default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1

Please keep these sorted numerically

        Arnd



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux