diff mbox series

[26/41] ARM: omap1: relocate static I/O mapping

Message ID 20220419133723.1394715-27-arnd@kernel.org
State New
Headers show
Series OMAP1 full multiplatform conversion | expand

Commit Message

Arnd Bergmann April 19, 2022, 1:37 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The address range 0xfee00000-0xfeffffff is used for PCI and
PCMCIA I/O port mappings, but OMAP1 has its static mappings
there as well.

Move the OMAP1 addresses a little higher to avoid crashing
at boot.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig.debug                      | 6 +++---
 arch/arm/mach-omap1/include/mach/hardware.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Aaro Koskinen April 20, 2022, 1:46 p.m. UTC | #1
Hi,

On Tue, Apr 19, 2022 at 03:37:08PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The address range 0xfee00000-0xfeffffff is used for PCI and
> PCMCIA I/O port mappings, but OMAP1 has its static mappings
> there as well.
> 
> Move the OMAP1 addresses a little higher to avoid crashing
> at boot.

This has the same problem I reported in 2019, with earlyprintk the
system no longer boots:

	https://marc.info/?t=156530014200005&r=1&w=2

Tested on OSK and SX1/qemu.

A.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/Kconfig.debug                      | 6 +++---
>  arch/arm/mach-omap1/include/mach/hardware.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 0c9497d549e3..f57b449000f7 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -1837,9 +1837,9 @@ config DEBUG_UART_VIRT
>  	default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
>  	default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
>  	default 0xfef36000 if DEBUG_HIGHBANK_UART
> -	default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
> -	default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
> -	default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
> +	default 0xff000000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
> +	default 0xff000800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
> +	default 0xff009800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
>  	default 0xffd01000 if DEBUG_HIP01_UART
>  	default DEBUG_UART_PHYS if !MMU
>  	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
> diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
> index 05c5cd3e95f4..e3522e601ccd 100644
> --- a/arch/arm/mach-omap1/include/mach/hardware.h
> +++ b/arch/arm/mach-omap1/include/mach/hardware.h
> @@ -63,7 +63,7 @@ static inline u32 omap_cs3_phys(void)
>  
>  #endif	/* ifndef __ASSEMBLER__ */
>  
> -#define OMAP1_IO_OFFSET		0x01000000	/* Virtual IO = 0xfefb0000 */
> +#define OMAP1_IO_OFFSET		0x00fb0000	/* Virtual IO = 0xff000000 */
>  #define OMAP1_IO_ADDRESS(pa)	IOMEM((pa) - OMAP1_IO_OFFSET)
>  
>  #include <mach/serial.h>
> -- 
> 2.29.2
>
Tony Lindgren April 21, 2022, 5:19 a.m. UTC | #2
* Arnd Bergmann <arnd@kernel.org> [220420 19:18]:
> On Wed, Apr 20, 2022 at 3:46 PM Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> >
> > Hi,
> >
> > On Tue, Apr 19, 2022 at 03:37:08PM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > The address range 0xfee00000-0xfeffffff is used for PCI and
> > > PCMCIA I/O port mappings, but OMAP1 has its static mappings
> > > there as well.
> > >
> > > Move the OMAP1 addresses a little higher to avoid crashing
> > > at boot.
> >
> > This has the same problem I reported in 2019, with earlyprintk the
> > system no longer boots:
> >
> >         https://marc.info/?t=156530014200005&r=1&w=2
> >
> > Tested on OSK and SX1/qemu.
> 
> Thanks a lot for testing!
> 
> I managed to get to the bottom of this after just a few hours, and
> it turned out to be a simple math error on my end, as I got
> the alignment wrong, the offset has to be 0x00f00000
> instead of 0x00fb0000 be section aligned. I made sure the
> kernel boots up (to the point of missing a rootfs) and uploaded
> the fixed branch.

Good to hear this got sorted out :)

Regards,

Tony
diff mbox series

Patch

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 0c9497d549e3..f57b449000f7 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1837,9 +1837,9 @@  config DEBUG_UART_VIRT
 	default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
 	default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
 	default 0xfef36000 if DEBUG_HIGHBANK_UART
-	default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
-	default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
-	default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
+	default 0xff000000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
+	default 0xff000800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
+	default 0xff009800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
 	default 0xffd01000 if DEBUG_HIP01_UART
 	default DEBUG_UART_PHYS if !MMU
 	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
index 05c5cd3e95f4..e3522e601ccd 100644
--- a/arch/arm/mach-omap1/include/mach/hardware.h
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -63,7 +63,7 @@  static inline u32 omap_cs3_phys(void)
 
 #endif	/* ifndef __ASSEMBLER__ */
 
-#define OMAP1_IO_OFFSET		0x01000000	/* Virtual IO = 0xfefb0000 */
+#define OMAP1_IO_OFFSET		0x00fb0000	/* Virtual IO = 0xff000000 */
 #define OMAP1_IO_ADDRESS(pa)	IOMEM((pa) - OMAP1_IO_OFFSET)
 
 #include <mach/serial.h>