sh: dreamcast: Fix GAPS PCI bridge addressing
authorArtur Rojek <contact@artur-rojek.eu>
Sat, 11 May 2024 19:16:14 +0000 (21:16 +0200)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Mon, 13 May 2024 07:13:26 +0000 (09:13 +0200)
The G2-to-PCI bridge chip found in SEGA Dreamcast assumes P2 area
relative addresses.

Set the appropriate IOPORT base offset.

Tested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20240511191614.68561-2-contact@artur-rojek.eu
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
arch/sh/Kconfig
arch/sh/boards/mach-dreamcast/setup.c

index 2ad3e29f0ebec416f42f28ac09c651ef9da74614..6bc60f964f96842057478569a7958c68b212c797 100644 (file)
@@ -125,7 +125,8 @@ config ARCH_HAS_ILOG2_U64
 
 config NO_IOPORT_MAP
        def_bool !PCI
-       depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE
+       depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE && \
+                  !SH_DREAMCAST
 
 config IO_TRAPPED
        bool
index 2d966c1c2cc1880c141b1d45fc2f74ff46581be5..daa8455549fad105db014d56770a37ef10ada7a2 100644 (file)
 #include <asm/irq.h>
 #include <asm/rtc.h>
 #include <asm/machvec.h>
+#include <cpu/addrspace.h>
 #include <mach/sysasic.h>
 
 static void __init dreamcast_setup(char **cmdline_p)
 {
+       /* GAPS PCI bridge assumes P2 area relative addresses. */
+       __set_io_port_base(P2SEG);
 }
 
 static struct sh_machine_vector mv_dreamcast __initmv = {