new file mode 100644
@@ -0,0 +1 @@
+/* no IOPORT or IOMEM suport */
@@ -8,6 +8,7 @@ source "drivers/tty/Kconfig"
config DEVMEM
bool "/dev/mem virtual device support"
+ depends on HAS_IOMEM
default y
help
Say Y here if you want to support the /dev/mem device.
@@ -17,6 +18,7 @@ config DEVMEM
config DEVKMEM
bool "/dev/kmem virtual device support"
+ depends on HAS_IOMEM
default y
help
Say Y here if you want to support the /dev/kmem device. The
@@ -94,6 +96,7 @@ config BFIN_OTP_WRITE_ENABLE
config PRINTER
tristate "Parallel printer support"
depends on PARPORT
+ depends on HAS_IOPORT
---help---
If you intend to attach a printer to the parallel port of your Linux
box (as opposed to using a serial printer; if the connector at the
@@ -91,6 +91,7 @@ void __weak unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
}
#endif
+#ifdef CONFIG_DEVMEM
/*
* This funcion reads the *physical* memory. The f_pos points directly to the
* memory location.
@@ -219,6 +220,7 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
*ppos += written;
return written;
}
+#endif
int __weak phys_mem_access_prot_allowed(struct file *file,
unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
@@ -312,6 +314,7 @@ static inline int private_mapping_ok(struct vm_area_struct *vma)
}
#endif
+#ifdef CONFIG_DEVMEM
static const struct vm_operations_struct mmap_mem_ops = {
#ifdef CONFIG_HAVE_IOREMAP_PROT
.access = generic_access_phys
@@ -351,7 +354,9 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
}
return 0;
}
+#endif
+#ifdef CONFIG_DEVKMEM
static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
{
unsigned long pfn;
@@ -552,7 +557,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
*ppos = p;
return virtr + wrote ? : err;
}
+#endif
+#ifdef CONFIG_DEVPORT
static ssize_t read_port(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
@@ -594,6 +601,7 @@ static ssize_t write_port(struct file *file, const char __user *buf,
*ppos = i;
return tmp-buf;
}
+#endif
static ssize_t read_null(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
@@ -710,10 +718,12 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
return ret;
}
+#ifdef CONFIG_DEVPORT
static int open_port(struct inode *inode, struct file *filp)
{
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
}
+#endif
#define zero_lseek null_lseek
#define full_lseek null_lseek
@@ -722,6 +732,7 @@ static int open_port(struct inode *inode, struct file *filp)
#define open_mem open_port
#define open_kmem open_mem
+#ifdef CONFIG_DEVMEM
static const struct file_operations __maybe_unused mem_fops = {
.llseek = memory_lseek,
.read = read_mem,
@@ -733,7 +744,9 @@ static const struct file_operations __maybe_unused mem_fops = {
.mmap_capabilities = memory_mmap_capabilities,
#endif
};
+#endif
+#ifdef CONFIG_DEVKMEM
static const struct file_operations __maybe_unused kmem_fops = {
.llseek = memory_lseek,
.read = read_kmem,
@@ -745,6 +758,7 @@ static const struct file_operations __maybe_unused kmem_fops = {
.mmap_capabilities = memory_mmap_capabilities,
#endif
};
+#endif
static const struct file_operations null_fops = {
.llseek = null_lseek,
@@ -755,12 +769,14 @@ static const struct file_operations null_fops = {
.splice_write = splice_write_null,
};
+#ifdef CONFIG_DEVPORT
static const struct file_operations __maybe_unused port_fops = {
.llseek = memory_lseek,
.read = read_port,
.write = write_port,
.open = open_port,
};
+#endif
static const struct file_operations zero_fops = {
.llseek = zero_lseek,
@@ -38,6 +38,7 @@ config DIGICOLOR_TIMER
config DW_APB_TIMER
bool "DW APB timer driver" if COMPILE_TEST
depends on GENERIC_CLOCKEVENTS
+ depends on HAS_IOMEM
help
Enables the support for the dw_apb timer.
@@ -64,6 +65,7 @@ config ARMADA_370_XP_TIMER
config MESON6_TIMER
bool "Meson6 timer driver" if COMPILE_TEST
depends on GENERIC_CLOCKEVENTS
+ depends on HAS_IOMEM
select CLKSRC_MMIO
help
Enables the support for the Meson6 timer driver.
@@ -114,6 +116,7 @@ config CADENCE_TTC_TIMER
config ASM9260_TIMER
bool "ASM9260 timer driver" if COMPILE_TEST
depends on GENERIC_CLOCKEVENTS
+ depends on HAS_IOMEM
select CLKSRC_MMIO
select CLKSRC_OF
help
@@ -4,6 +4,7 @@
menuconfig FMC
tristate "FMC support"
+ depends on HAS_IOMEM
help
FMC (FPGA Mezzanine Carrier) is a mechanical and electrical
@@ -21,6 +21,7 @@ config FPGA_MGR_SOCFPGA
config FPGA_MGR_ZYNQ_FPGA
tristate "Xilinx Zynq FPGA"
+ depends on HAS_IOMEM
help
FPGA manager driver support for Xilinx Zynq FPGAs.
@@ -1,5 +1,6 @@
config INTEL_TH
tristate "Intel(R) Trace Hub controller"
+ depends on HAS_IOMEM
help
Intel(R) Trace Hub (TH) is a set of hardware blocks (subdevices) that
produce, switch and output trace data from multiple hardware and
@@ -999,6 +999,7 @@ config MFD_SUN6I_PRCM
config MFD_SYSCON
bool "System Controller Register R/W Based on Regmap"
+ depends on HAS_IOMEM
select REGMAP_MMIO
help
Select this option to enable accessing system control registers
@@ -2,7 +2,7 @@ comment "Altera FPGA firmware download module"
config ALTERA_STAPL
tristate "Altera FPGA firmware download module"
- depends on I2C
+ depends on I2C && HAS_IOPORT
default n
help
An Altera FPGA module. Say Y when you want to support this tool.
@@ -3,6 +3,7 @@ menu "RAM/ROM/Flash chip drivers"
config MTD_CFI
tristate "Detect flash chips by Common Flash Interface (CFI) probe"
+ depends on HAS_IOMEM
select MTD_GEN_PROBE
select MTD_CFI_UTIL
help
@@ -15,6 +16,7 @@ config MTD_CFI
config MTD_JEDECPROBE
tristate "Detect non-CFI AMD/JEDEC-compatible flash chips"
+ depends on HAS_IOMEM
select MTD_GEN_PROBE
select MTD_CFI_UTIL
help
@@ -207,12 +209,14 @@ config MTD_CFI_UTIL
config MTD_RAM
tristate "Support for RAM chips in bus mapping"
+ depends on HAS_IOMEM
help
This option enables basic support for RAM chips accessed through
a bus mapping driver.
config MTD_ROM
tristate "Support for ROM chips in bus mapping"
+ depends on HAS_IOMEM
help
This option enables basic support for ROM chips accessed through
a bus mapping driver.
@@ -4,6 +4,7 @@ menu "LPDDR & LPDDR2 PCM memory drivers"
config MTD_LPDDR
tristate "Support for LPDDR flash chips"
select MTD_QINFO_PROBE
+ depends on HAS_IOMEM
help
This option enables support of LPDDR (Low power double data rate)
flash chips. Synonymous with Mobile-DDR. It is a new standard for
@@ -3,7 +3,8 @@ menu "Mapping drivers for chip access"
depends on HAS_IOMEM
config MTD_COMPLEX_MAPPINGS
- bool "Support non-linear mappings of flash chips"
+ bool "Support non-linear mappings of flash chips" if HAS_IOMEM
+ default !HAS_IOMEM
help
This causes the chip drivers to allow for complicated
paged mappings of flash chips.
@@ -12,7 +12,7 @@ config MTD_NAND_ECC_SMC
menuconfig MTD_NAND
tristate "NAND Device Support"
- depends on MTD
+ depends on MTD && HAS_IOMEM
select MTD_NAND_IDS
select MTD_NAND_ECC
help
@@ -9,6 +9,7 @@ if MTD_SPI_NOR
config MTD_MT81xx_NOR
tristate "Mediatek MT81xx SPI NOR flash controller"
+ depends on HAS_IOMEM
help
This enables access to SPI NOR flash, using MT81xx SPI NOR flash
controller. This controller does not support generic SPI BUS, it only
@@ -132,6 +132,7 @@ config CAN_RCAR
config CAN_SUN4I
tristate "Allwinner A10 CAN controller"
depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST
+ depends on HAS_IOMEM
---help---
Say Y here if you want to use CAN controller found on Allwinner
A10/A20 SoCs.
@@ -113,7 +113,8 @@ config SCC_TRXECHO
config BAYCOM_SER_FDX
tristate "BAYCOM ser12 fullduplex driver for AX.25"
- depends on AX25 && !S390
+ depends on AX25
+ depends on HAS_IOPORT
select CRC_CCITT
---help---
This is one of two drivers for Baycom style simple amateur radio
@@ -133,7 +134,8 @@ config BAYCOM_SER_FDX
config BAYCOM_SER_HDX
tristate "BAYCOM ser12 halfduplex driver for AX.25"
- depends on AX25 && !S390
+ depends on AX25
+ depends on HAS_IOPORT
select CRC_CCITT
---help---
This is one of two drivers for Baycom style simple amateur radio
@@ -181,7 +183,8 @@ config BAYCOM_EPP
config YAM
tristate "YAM driver for AX.25"
- depends on AX25 && !S390
+ depends on AX25
+ depends on HAS_IOPORT
help
The YAM is a modem for packet radio which connects to the serial
port and includes some of the functions of a Terminal Node
@@ -1,6 +1,7 @@
menuconfig NVMEM
tristate "NVMEM Support"
select REGMAP
+ depends on HAS_IOMEM
help
Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...
@@ -30,9 +30,10 @@ config PHY_BERLIN_SATA
Enable this to support the SATA PHY on Marvell Berlin SoCs.
config ARMADA375_USBCLUSTER_PHY
- def_bool y
- depends on MACH_ARMADA_375 || COMPILE_TEST
+ bool "ARMADA 375 USB cluster PHY driver" if COMPILE_TEST && !MACH_ARMADA_375
+ def_bool MACH_ARMADA_375
depends on OF
+ depends on HAS_IOMEM
select GENERIC_PHY
config PHY_DM816X_USB
@@ -128,6 +129,7 @@ config PHY_RCAR_GEN3_USB2
config OMAP_CONTROL_PHY
tristate "OMAP CONTROL PHY Driver"
depends on ARCH_OMAP2PLUS || COMPILE_TEST
+ depends on HAS_IOMEM
help
Enable this to add support for the PHY part present in the control
module. This driver has API to power on the USB2 PHY and to write to
@@ -224,6 +226,8 @@ config PHY_MT65XX_USB3
config PHY_HI6220_USB
tristate "hi6220 USB PHY support"
+ depends on ARM64 || COMPILE_TEST
+ depends on HAS_IOMEM
select GENERIC_PHY
select MFD_SYSCON
help
@@ -401,6 +405,7 @@ config PHY_CYGNUS_PCIE
tristate "Broadcom Cygnus PCIe PHY driver"
depends on OF && (ARCH_BCM_CYGNUS || COMPILE_TEST)
select GENERIC_PHY
+ depends on HAS_IOMEM
default ARCH_BCM_CYGNUS
help
Enable this to support the Broadcom Cygnus PCIe PHY.
@@ -41,7 +41,7 @@ config POWER_RESET_AXXIA
config POWER_RESET_BRCMSTB
bool "Broadcom STB reset driver"
depends on ARM || MIPS || COMPILE_TEST
- depends on MFD_SYSCON
+ depends on MFD_SYSCON && HAS_IOMEM
default ARCH_BRCMSTB
help
This driver provides restart support for Broadcom STB boards.
@@ -148,6 +148,7 @@ config POWER_RESET_KEYSTONE
config POWER_RESET_SYSCON
bool "Generic SYSCON regmap reset driver"
depends on OF
+ depends on HAS_IOMEM
select MFD_SYSCON
help
Reboot support for generic SYSCON mapped register reset.
@@ -155,6 +156,7 @@ config POWER_RESET_SYSCON
config POWER_RESET_SYSCON_POWEROFF
bool "Generic SYSCON regmap poweroff driver"
depends on OF
+ depends on HAS_IOMEM
select MFD_SYSCON
help
Poweroff support for generic SYSCON mapped register poweroff.
@@ -67,6 +67,7 @@ config COMEDI_TEST
config COMEDI_PARPORT
tristate "Parallel port support"
+ depends on HAS_IOPORT
---help---
Enable support for the standard parallel port.
A cheap and easy way to get a few more digital I/O lines. Steal
@@ -87,6 +88,7 @@ config COMEDI_SERIAL2002
config COMEDI_SSV_DNP
tristate "SSV Embedded Systems DIL/Net-PC support"
depends on X86_32 || COMPILE_TEST
+ depends on HAS_IOPORT
---help---
Enable support for SSV Embedded Systems DIL/Net-PC
@@ -97,6 +99,7 @@ endif # COMEDI_MISC_DRIVERS
menuconfig COMEDI_ISA_DRIVERS
bool "Comedi ISA and PC/104 drivers"
+ depends on HAS_IOPORT
---help---
Enable comedi ISA and PC/104 drivers to be built
@@ -1110,7 +1113,7 @@ endif # COMEDI_PCI_DRIVERS
menuconfig COMEDI_PCMCIA_DRIVERS
tristate "Comedi PCMCIA drivers"
- depends on PCMCIA
+ depends on PCMCIA && HAS_IOPORT
---help---
Enable support for comedi PCMCIA drivers.
@@ -1262,6 +1265,7 @@ config COMEDI_8255
config COMEDI_8255_SA
tristate "Standalone 8255 support"
select COMEDI_8255
+ depends on HAS_IOPORT
---help---
Enable support for 8255 digital I/O as a standalone driver.
@@ -178,6 +178,7 @@ config THERMAL_EMULATION
config HISI_THERMAL
tristate "Hisilicon thermal driver"
depends on (ARCH_HISI && CPU_THERMAL && OF) || COMPILE_TEST
+ depends on HAS_IOMEM
help
Enable this to plug hisilicon's thermal sensor driver into the Linux
thermal framework. cpufreq is used as the cooling device to throttle
@@ -198,6 +199,7 @@ config SPEAR_THERMAL
bool "SPEAr thermal sensor driver"
depends on PLAT_SPEAR || COMPILE_TEST
depends on OF
+ depends on HAS_IOMEM
help
Enable this to plug the SPEAr thermal sensor driver into the Linux
thermal framework.
@@ -206,6 +208,7 @@ config ROCKCHIP_THERMAL
tristate "Rockchip thermal driver"
depends on ARCH_ROCKCHIP || COMPILE_TEST
depends on RESET_CONTROLLER
+ depends on HAS_IOMEM
help
Rockchip thermal driver provides support for Temperature sensor
ADC (TS-ADC) found on Rockchip SoCs. It supports one critical
@@ -216,6 +219,7 @@ config RCAR_THERMAL
tristate "Renesas R-Car thermal driver"
depends on ARCH_SHMOBILE || COMPILE_TEST
depends on HAS_IOMEM
+ depends on HAS_IOMEM
help
Enable this to plug the R-Car thermal sensor driver into the Linux
thermal framework.
@@ -223,6 +227,7 @@ config RCAR_THERMAL
config KIRKWOOD_THERMAL
tristate "Temperature sensor on Marvell Kirkwood SoCs"
depends on MACH_KIRKWOOD || COMPILE_TEST
+ depends on HAS_IOMEM
depends on OF
help
Support for the Kirkwood thermal sensor driver into the Linux thermal
@@ -231,6 +236,7 @@ config KIRKWOOD_THERMAL
config DOVE_THERMAL
tristate "Temperature sensor on Marvell Dove SoCs"
depends on ARCH_DOVE || MACH_DOVE || COMPILE_TEST
+ depends on HAS_IOMEM
depends on OF
help
Support for the Dove thermal sensor driver in the Linux thermal
@@ -249,6 +255,7 @@ config DB8500_THERMAL
config ARMADA_THERMAL
tristate "Armada 370/XP thermal management"
depends on ARCH_MVEBU || COMPILE_TEST
+ depends on HAS_IOMEM
depends on OF
help
Enable this option if you want to have support for thermal management
@@ -366,12 +373,12 @@ config INTEL_PCH_THERMAL
programmable trip points and other information.
menu "Texas Instruments thermal drivers"
-depends on ARCH_HAS_BANDGAP || COMPILE_TEST
+depends on ARCH_HAS_BANDGAP || (COMPILE_TEST && HAS_IOMEM)
source "drivers/thermal/ti-soc-thermal/Kconfig"
endmenu
menu "Samsung thermal drivers"
-depends on ARCH_EXYNOS || COMPILE_TEST
+depends on ARCH_EXYNOS || (COMPILE_TEST && HAS_IOMEM)
source "drivers/thermal/samsung/Kconfig"
endmenu
@@ -916,6 +916,7 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
#endif
+#ifdef CONFIG_HAS_IOMEM
static inline void irq_reg_writel(struct irq_chip_generic *gc,
u32 val, int reg_offset)
{
@@ -933,5 +934,6 @@ static inline u32 irq_reg_readl(struct irq_chip_generic *gc,
else
return readl(gc->reg_base + reg_offset);
}
+#endif
#endif /* _LINUX_IRQ_H */
@@ -310,6 +310,7 @@ uint32_t cfi_send_gen_cmd(u_char cmd, uint32_t cmd_addr, uint32_t base,
struct map_info *map, struct cfi_private *cfi,
int type, map_word *prev_val);
+#ifdef CONFIG_HAS_IOMEM
static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
{
map_word val = map_read(map, addr);
@@ -341,6 +342,7 @@ static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
return cfi32_to_cpu(map, val.x[0]);
}
}
+#endif
void cfi_udelay(int us);
@@ -410,6 +410,7 @@ static inline map_word map_word_ff(struct map_info *map)
return r;
}
+#ifdef CONFIG_HAS_IOMEM
static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
{
map_word r;
@@ -463,6 +464,7 @@ static inline void inline_map_copy_to(struct map_info *map, unsigned long to, co
{
memcpy_toio(map->virt + to, from, len);
}
+#endif
#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
#define map_read(map, ofs) (map)->read(map, ofs)
@@ -29,7 +29,9 @@
struct resource ioport_resource = {
.name = "PCI IO",
.start = 0,
+#ifdef CONFIG_HAS_IOPORT
.end = IO_SPACE_LIMIT,
+#endif
.flags = IORESOURCE_IO,
};
EXPORT_SYMBOL(ioport_resource);
@@ -382,9 +382,14 @@ config HAS_IOMEM
select GENERIC_IO
default y
+config HAS_IOPORT
+ bool
+ depends on HAS_IOMEM && !NO_IOPORT
+ default y
+
config HAS_IOPORT_MAP
bool
- depends on HAS_IOMEM && !NO_IOPORT_MAP
+ depends on HAS_IOMEM && HAS_IOPORT && !NO_IOPORT_MAP
default y
config HAS_DMA
@@ -99,7 +99,7 @@ static unsigned long __init init_bootmem_core(bootmem_data_t *bdata,
unsigned long mapsize;
mminit_validate_memmodel_limits(&start, &end);
- bdata->node_bootmem_map = phys_to_virt(PFN_PHYS(mapstart));
+ bdata->node_bootmem_map = __va(PFN_PHYS(mapstart));
bdata->node_min_pfn = start;
bdata->node_low_pfn = end;
link_bootmem(bdata);
@@ -585,7 +585,7 @@ find_block:
PFN_UP(end_off), BOOTMEM_EXCLUSIVE))
BUG();
- region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
+ region = __va(PFN_PHYS(bdata->node_min_pfn) +
start_off);
memset(region, 0, size);
/*