ARM: s3c24xx: remove support for ISA drivers on BAST PC/104
authorArnd Bergmann <arnd@arndb.de>
Sat, 2 Apr 2022 10:29:36 +0000 (12:29 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 7 Apr 2022 07:31:21 +0000 (09:31 +0200)
BAST is the one machine that theoretically supports unmodified ISA
drivers for hardware on its PC/104 connector, using a custom version of
the inb()/outb() and inw()/outw() macros.

This is incompatible with the generic version used in asm/io.h, and
can't easily be used in a multiplatform kernel.

Removing the special case for 16-bit I/O port access on BAST gets us
closer to multiplatform, at the expense of any PC/104 users with 16-bit
cards having to either use an older kernel or modify their ISA drivers
to manually ioremap() the area and use readw()/write() in place of
inw()/outw(). Either way is probably ok, given that there is a
recurring discussion about dropping s3c24xx altogether, and many
traditional ISA drivers are already gone.

Machines other than BAST already have no support for ISA drivers, though a
couple of them do map one of the external chip-selects into the ISA port
range, using the same address for 8-bit and 16-bit I/O. It is unlikely
that anything actually uses this mapping, but it's also easy to keep
this working by mapping it to the normal platform-independent PCI I/O
base that is otherwise unused on s3c24xx.

The mach/map-base.h file is no longer referenced in global headers and
can be moved into the platform directory.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
18 files changed:
arch/arm/Kconfig
arch/arm/mach-s3c/Kconfig.s3c24xx
arch/arm/mach-s3c/cpu.c
arch/arm/mach-s3c/include/mach/io-s3c24xx.h [deleted file]
arch/arm/mach-s3c/include/mach/io.h [deleted file]
arch/arm/mach-s3c/include/mach/map-base.h [deleted file]
arch/arm/mach-s3c/irq-pm-s3c24xx.c
arch/arm/mach-s3c/mach-anubis.c
arch/arm/mach-s3c/mach-bast.c
arch/arm/mach-s3c/mach-osiris.c
arch/arm/mach-s3c/mach-rx3715.c
arch/arm/mach-s3c/mach-smdk2416.c
arch/arm/mach-s3c/mach-smdk2440.c
arch/arm/mach-s3c/mach-smdk2443.c
arch/arm/mach-s3c/mach-vr1000.c
arch/arm/mach-s3c/map-base.h [new file with mode: 0644]
arch/arm/mach-s3c/map-s3c24xx.h
arch/arm/mach-s3c/map-s3c64xx.h

index faf696173af75fd5f7767d429baa2d8efabec2be..2242d2ae8854b1a11268589de5013d649dfa9530 100644 (file)
@@ -444,7 +444,6 @@ config ARCH_S3C24XX
        select CLKSRC_SAMSUNG_PWM
        select GPIO_SAMSUNG
        select GPIOLIB
-       select NEED_MACH_IO_H
        select S3C2410_WATCHDOG
        select SAMSUNG_ATAGS
        select USE_OF
index 000e3e234f71357c45c6e2a4df786e41a28ce647..d47df6427e892b56df661f67e659174f6ba16642 100644 (file)
@@ -181,7 +181,6 @@ config MACH_AML_M5900
 
 config ARCH_BAST
        bool "Simtec Electronics BAST (EB2410ITX)"
-       select ISA
        select MACH_BAST_IDE
        select S3C2410_COMMON_DCLK
        select S3C2410_IOTIMING if ARM_S3C2410_CPUFREQ
index 6e9772555f0d1a1ad05993693568af4a9cc5b6fb..05a6b4be1768dab72ec8c533ef99349666477306 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <mach/map-base.h>
+#include "map-base.h"
 #include "cpu.h"
 
 unsigned long samsung_cpu_id;
diff --git a/arch/arm/mach-s3c/include/mach/io-s3c24xx.h b/arch/arm/mach-s3c/include/mach/io-s3c24xx.h
deleted file mode 100644 (file)
index 738b775..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * arch/arm/mach-s3c2410/include/mach/io.h
- *  from arch/arm/mach-rpc/include/mach/io.h
- *
- * Copyright (C) 1997 Russell King
- *          (C) 2003 Simtec Electronics
-*/
-
-#ifndef __ASM_ARM_ARCH_IO_S3C24XX_H
-#define __ASM_ARM_ARCH_IO_S3C24XX_H
-
-#include <mach/map-base.h>
-
-/*
- * ISA style IO, for each machine to sort out mappings for,
- * if it implements it. We reserve two 16M regions for ISA,
- * so the PC/104 can use separate addresses for 8-bit and
- * 16-bit port I/O.
- */
-#define PCIO_BASE              S3C_ADDR(0x02000000)
-#define IO_SPACE_LIMIT         0x00ffffff
-#define S3C24XX_VA_ISA_WORD    (PCIO_BASE)
-#define S3C24XX_VA_ISA_BYTE    (PCIO_BASE + 0x01000000)
-
-#ifdef CONFIG_ISA
-
-#define inb(p)         readb(S3C24XX_VA_ISA_BYTE + (p))
-#define inw(p)         readw(S3C24XX_VA_ISA_WORD + (p))
-#define inl(p)         readl(S3C24XX_VA_ISA_WORD + (p))
-
-#define outb(v,p)      writeb((v), S3C24XX_VA_ISA_BYTE + (p))
-#define outw(v,p)      writew((v), S3C24XX_VA_ISA_WORD + (p))
-#define outl(v,p)      writel((v), S3C24XX_VA_ISA_WORD + (p))
-
-#define insb(p,d,l)    readsb(S3C24XX_VA_ISA_BYTE + (p),d,l)
-#define insw(p,d,l)    readsw(S3C24XX_VA_ISA_WORD + (p),d,l)
-#define insl(p,d,l)    readsl(S3C24XX_VA_ISA_WORD + (p),d,l)
-
-#define outsb(p,d,l)   writesb(S3C24XX_VA_ISA_BYTE + (p),d,l)
-#define outsw(p,d,l)   writesw(S3C24XX_VA_ISA_WORD + (p),d,l)
-#define outsl(p,d,l)   writesl(S3C24XX_VA_ISA_WORD + (p),d,l)
-
-#else
-
-#define __io(x) (PCIO_BASE + (x))
-
-#endif
-
-#endif
diff --git a/arch/arm/mach-s3c/include/mach/io.h b/arch/arm/mach-s3c/include/mach/io.h
deleted file mode 100644 (file)
index 30a0135..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (c) 2020 Krzysztof Kozlowski <krzk@kernel.org>
- */
-
-#ifdef CONFIG_ARCH_S3C24XX
-#include "io-s3c24xx.h"
-#endif
diff --git a/arch/arm/mach-s3c/include/mach/map-base.h b/arch/arm/mach-s3c/include/mach/map-base.h
deleted file mode 100644 (file)
index 34b39de..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright 2003, 2007 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C - Memory map definitions (virtual addresses)
- */
-
-#ifndef __ASM_PLAT_MAP_H
-#define __ASM_PLAT_MAP_H __FILE__
-
-/* Fit all our registers in at 0xF6000000 upwards, trying to use as
- * little of the VA space as possible so vmalloc and friends have a
- * better chance of getting memory.
- *
- * we try to ensure stuff like the IRQ registers are available for
- * an single MOVS instruction (ie, only 8 bits of set data)
- */
-
-#define S3C_ADDR_BASE  0xF6000000
-
-#ifndef __ASSEMBLY__
-#define S3C_ADDR(x)    ((void __iomem __force *)S3C_ADDR_BASE + (x))
-#else
-#define S3C_ADDR(x)    (S3C_ADDR_BASE + (x))
-#endif
-
-#define S3C_VA_IRQ     S3C_ADDR(0x00000000)    /* irq controller(s) */
-#define S3C_VA_SYS     S3C_ADDR(0x00100000)    /* system control */
-#define S3C_VA_MEM     S3C_ADDR(0x00200000)    /* memory control */
-#define S3C_VA_TIMER   S3C_ADDR(0x00300000)    /* timer block */
-#define S3C_VA_WATCHDOG        S3C_ADDR(0x00400000)    /* watchdog */
-#define S3C_VA_UART    S3C_ADDR(0x01000000)    /* UART */
-
-/* This is used for the CPU specific mappings that may be needed, so that
- * they do not need to directly used S3C_ADDR() and thus make it easier to
- * modify the space for mapping.
- */
-#define S3C_ADDR_CPU(x)        S3C_ADDR(0x00500000 + (x))
-
-#endif /* __ASM_PLAT_MAP_H */
index 4d5e28312d910568c9ec627780844c7fa1228562..55f41135ad70ab06a5c463ff4795a1d5e4bc9819 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "cpu.h"
 #include "pm.h"
-#include <mach/map-base.h>
+#include "map-base.h"
 #include "map-s3c.h"
 
 #include "regs-irq.h"
index 04147cc0adcc7afb03409e710f87cefabc7b6714..60df40052209cf091621cb8746fac031a72ded17 100644 (file)
@@ -57,11 +57,6 @@ static struct map_desc anubis_iodesc[] __initdata = {
        .pfn            = __phys_to_pfn(0x0),
        .length         = SZ_4M,
        .type           = MT_DEVICE,
-  }, {
-       .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-       .pfn            = __phys_to_pfn(0x0),
-       .length         = SZ_4M,
-       .type           = MT_DEVICE,
   },
 
   /* we could possibly compress the next set down into a set of smaller tables
index 27e8d595022865d590a614874fbdf5e9680cb193..5ac24e406157fd43ef1f440bf11787b5f7eae67b 100644 (file)
@@ -75,11 +75,6 @@ static struct map_desc bast_iodesc[] __initdata = {
          .pfn          = PA_CS2(BAST_PA_ISAIO),
          .length       = SZ_16M,
          .type         = MT_DEVICE,
-  }, {
-         .virtual      = (u32)S3C24XX_VA_ISA_WORD,
-         .pfn          = PA_CS3(BAST_PA_ISAIO),
-         .length       = SZ_16M,
-         .type         = MT_DEVICE,
   },
   /* bast CPLD control registers, and external interrupt controls */
   {
index 3aefb9d22340f6ebe633f7ead73fca01c7b3f85f..8387773f4fd458f2acd86ac95160f8b9d37212df 100644 (file)
@@ -58,11 +58,6 @@ static struct map_desc osiris_iodesc[] __initdata = {
          .pfn          = __phys_to_pfn(S3C2410_CS5),
          .length       = SZ_16M,
          .type         = MT_DEVICE,
-  }, {
-         .virtual      = (u32)S3C24XX_VA_ISA_WORD,
-         .pfn          = __phys_to_pfn(S3C2410_CS5),
-         .length       = SZ_16M,
-         .type         = MT_DEVICE,
   },
 
   /* CPLD control registers */
index 9fd2d9dc36896c5e7bef5fb224e4a88afb0ee92e..586cb0fdfce0412720bca561802741960be215f7 100644 (file)
 
 static struct map_desc rx3715_iodesc[] __initdata = {
        /* dump ISA space somewhere unused */
-
        {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS3),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE,
-       }, {
                .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
                .pfn            = __phys_to_pfn(S3C2410_CS3),
                .length         = SZ_1M,
index 4d883a792cc6b67ce5c45bd74513ee9b15dd5a0b..38b4a7cd417861c5563839498cbecc8aea743024 100644 (file)
@@ -53,16 +53,6 @@ static struct map_desc smdk2416_iodesc[] __initdata = {
        /* ISA IO Space map (memory space selected by A24) */
 
        {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS2),
-               .length         = 0x10000,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
-               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
-               .length         = SZ_4M,
-               .type           = MT_DEVICE,
-       }, {
                .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
                .pfn            = __phys_to_pfn(S3C2410_CS2),
                .length         = 0x10000,
index 7f6fe0db04f35490dae14844443129586c256de2..392554b1eba203c987d457cae48867e7f408b7e8 100644 (file)
@@ -43,16 +43,6 @@ static struct map_desc smdk2440_iodesc[] __initdata = {
        /* ISA IO Space map (memory space selected by A24) */
 
        {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS2),
-               .length         = 0x10000,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
-               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
-               .length         = SZ_4M,
-               .type           = MT_DEVICE,
-       }, {
                .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
                .pfn            = __phys_to_pfn(S3C2410_CS2),
                .length         = 0x10000,
index fc54c91ade56f667a6228c01240a5e462cf77cb9..4c541a03e49e0734e12322a61896349fefc06ce8 100644 (file)
@@ -40,16 +40,6 @@ static struct map_desc smdk2443_iodesc[] __initdata = {
        /* ISA IO Space map (memory space selected by A24) */
 
        {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD,
-               .pfn            = __phys_to_pfn(S3C2410_CS2),
-               .length         = 0x10000,
-               .type           = MT_DEVICE,
-       }, {
-               .virtual        = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
-               .pfn            = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
-               .length         = SZ_4M,
-               .type           = MT_DEVICE,
-       }, {
                .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
                .pfn            = __phys_to_pfn(S3C2410_CS2),
                .length         = 0x10000,
index 5c3d07cf2e7953acc946f9e128dd4b2123857611..3aa8c707f8a279f32e6048c6a820908a698338f3 100644 (file)
@@ -67,11 +67,6 @@ static struct map_desc vr1000_iodesc[] __initdata = {
          .pfn          = PA_CS2(BAST_PA_ISAIO),
          .length       = SZ_16M,
          .type         = MT_DEVICE,
-  }, {
-         .virtual      = (u32)S3C24XX_VA_ISA_WORD,
-         .pfn          = PA_CS3(BAST_PA_ISAIO),
-         .length       = SZ_16M,
-         .type         = MT_DEVICE,
   },
 
   /*  CPLD control registers, and external interrupt controls */
diff --git a/arch/arm/mach-s3c/map-base.h b/arch/arm/mach-s3c/map-base.h
new file mode 100644 (file)
index 0000000..463a995
--- /dev/null
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2003, 2007 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C - Memory map definitions (virtual addresses)
+ */
+
+#ifndef __ASM_PLAT_MAP_H
+#define __ASM_PLAT_MAP_H __FILE__
+
+/* Fit all our registers in at 0xF6000000 upwards, trying to use as
+ * little of the VA space as possible so vmalloc and friends have a
+ * better chance of getting memory.
+ *
+ * we try to ensure stuff like the IRQ registers are available for
+ * an single MOVS instruction (ie, only 8 bits of set data)
+ */
+
+#define S3C_ADDR_BASE  0xF6000000
+
+#ifndef __ASSEMBLY__
+#define S3C_ADDR(x)    ((void __iomem __force *)S3C_ADDR_BASE + (x))
+#else
+#define S3C_ADDR(x)    (S3C_ADDR_BASE + (x))
+#endif
+
+#define S3C_VA_IRQ     S3C_ADDR(0x00000000)    /* irq controller(s) */
+#define S3C_VA_SYS     S3C_ADDR(0x00100000)    /* system control */
+#define S3C_VA_MEM     S3C_ADDR(0x00200000)    /* memory control */
+#define S3C_VA_TIMER   S3C_ADDR(0x00300000)    /* timer block */
+#define S3C_VA_WATCHDOG        S3C_ADDR(0x00400000)    /* watchdog */
+#define S3C_VA_UART    S3C_ADDR(0x01000000)    /* UART */
+
+/* ISA device mapping for BAST to use with inb()/outb() on 8-bit I/O.
+ * 16-bit I/O on BAST now requires driver modifications to manually
+ * ioremap CS3.
+ */
+#define S3C24XX_VA_ISA_BYTE    PCI_IOBASE
+
+/* This is used for the CPU specific mappings that may be needed, so that
+ * they do not need to directly used S3C_ADDR() and thus make it easier to
+ * modify the space for mapping.
+ */
+#define S3C_ADDR_CPU(x)        S3C_ADDR(0x00500000 + (x))
+
+#endif /* __ASM_PLAT_MAP_H */
index b5dba78a9dd7ce8796b825b0e53aaf634f8aa462..f8d075b11d6f1d94c897a3e970d9531885942eb9 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef __ASM_ARCH_MAP_H
 #define __ASM_ARCH_MAP_H
 
-#include <mach/map-base.h>
+#include "map-base.h"
 #include "map-s3c.h"
 
 /*
index d7740d2a77c4d37b6d25a7b2d29813cb8ea45519..9de1c58bcb06e1157f013e997164cd5eb9795fc7 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __ASM_ARCH_MAP_H
 #define __ASM_ARCH_MAP_H __FILE__
 
-#include <mach/map-base.h>
+#include "map-base.h"
 #include "map-s3c.h"
 
 /*