diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-01 15:19:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-01 15:19:43 -0700 |
commit | 634135a07b887a8ad8904da8c147407650747a38 (patch) | |
tree | 25483fe4cfa60ab4ee144742204680207fe90e93 /arch/arm/mach-ixp4xx | |
parent | 4cdc4cc2ad35f92338497d53d3e8b7876cf2a51d (diff) | |
parent | 51e321fed0ff8d64eff809a4ee0547254cdcc4a1 (diff) | |
download | linux-634135a07b887a8ad8904da8c147407650747a38.tar.bz2 |
Merge tag 'soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC updates from Arnd Bergmann:
"There are three noteworthy updates for 32-bit arm platforms this time:
- The Microchip SAMA7 family based on Cortex-A7 gets introduced, a
new cousin to the older SAM9 (ARM9xx based) and SAMA5 (Cortex-A5
based) SoCs.
- The ixp4xx platform (based on Intel XScale) is finally converted to
device tree, and all the old board files are getting removed now.
- The Cirrus Logic EP93xx platform loses support for the old
MaverickCrunch FPU. Support for compiling user space applications
was already removed in gcc-4.9, and the kernel support for old
applications could not be built with clang ias. After confirming
that there are no remaining users, removing this from the kernel
seemed better than adding support for unused features to clang.
There are minor updates to the aspeed, omap and samsung platforms"
* tag 'soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (48 commits)
soc: aspeed-lpc-ctrl: Fix clock cleanup in error path
ARM: s3c: delete unneed local variable "delay"
soc: aspeed: Re-enable FWH2AHB on AST2600
soc: aspeed: socinfo: Add AST2625 variant
soc: aspeed: p2a-ctrl: Fix boundary check for mmap
soc: aspeed: lpc-ctrl: Fix boundary check for mmap
ARM: ixp4xx: Delete the Freecom FSG-3 boardfiles
ARM: ixp4xx: Delete GTWX5715 board files
ARM: ixp4xx: Delete Coyote and IXDPG425 boardfiles
ARM: ixp4xx: Delete Intel reference design boardfiles
ARM: ixp4xx: Delete Avila boardfiles
ARM: ixp4xx: Delete the Arcom Vulcan boardfiles
ARM: ixp4xx: Delete Gateway WG302v2 boardfiles
ARM: ixp4xx: Delete Omicron boardfiles
ARM: ixp4xx: Delete the D-Link DSM-G600 boardfiles
ARM: ixp4xx: Delete NAS100D boardfiles
ARM: ixp4xx: Delete NSLU2 boardfiles
arm: omap2: Drop the unused OMAP_PACKAGE_* KConfig entries
arm: omap2: Drop obsolete MACH_OMAP3_PANDORA entry
ARM: ep93xx: remove MaverickCrunch support
...
Diffstat (limited to 'arch/arm/mach-ixp4xx')
25 files changed, 0 insertions, 3888 deletions
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 34a1c7742088..365a5853d310 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig @@ -17,39 +17,6 @@ config MACH_IXP4XX_OF help Say 'Y' here to support Device Tree-based IXP4xx platforms. -config MACH_NSLU2 - bool - prompt "Linksys NSLU2" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Linksys's - NSLU2 NAS device. For more information on this platform, - see http://www.nslu2-linux.org - -config MACH_AVILA - bool "Avila" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support the Gateworks - Avila Network Platform. For more information on this platform, - see <file:Documentation/arm/ixp4xx.rst>. - -config MACH_LOFT - bool "Loft" - depends on MACH_AVILA - help - Say 'Y' here if you want your kernel to support the Giant - Shoulder Inc Loft board (a minor variation on the standard - Gateworks Avila Network Platform). - -config ARCH_ADI_COYOTE - bool "Coyote" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support the ADI - Engineering Coyote Gateway Reference Platform. For more - information on this platform, see <file:Documentation/arm/ixp4xx.rst>. - config MACH_GATEWAY7001 bool "Gateway 7001" depends on IXP4XX_PCI_LEGACY @@ -58,37 +25,6 @@ config MACH_GATEWAY7001 7001 Access Point. For more information on this platform, see http://openwrt.org -config MACH_WG302V2 - bool "Netgear WG302 v2 / WAG302 v2" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Netgear's - WG302 v2 or WAG302 v2 Access Points. For more information - on this platform, see http://openwrt.org - -config ARCH_IXDP425 - bool "IXDP425" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Intel's - IXDP425 Development Platform (Also known as Richfield). - For more information on this platform, see <file:Documentation/arm/ixp4xx.rst>. - -config MACH_IXDPG425 - bool "IXDPG425" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Intel's - IXDPG425 Development Platform (Also known as Montajade). - For more information on this platform, see <file:Documentation/arm/ixp4xx.rst>. - -config MACH_IXDP465 - bool "IXDP465" - help - Say 'Y' here if you want your kernel to support Intel's - IXDP465 Development Platform (Also known as BMP). - For more information on this platform, see <file:Documentation/arm/ixp4xx.rst>. - config MACH_GORAMO_MLR bool "GORAMO Multi Link Router" depends on IXP4XX_PCI_LEGACY @@ -96,23 +32,6 @@ config MACH_GORAMO_MLR Say 'Y' here if you want your kernel to support GORAMO MultiLink router. -config MACH_KIXRP435 - bool "KIXRP435" - help - Say 'Y' here if you want your kernel to support Intel's - KIXRP435 Reference Platform. - For more information on this platform, see <file:Documentation/arm/ixp4xx.rst>. - -# -# IXCDP1100 is the exact same HW as IXDP425, but with a different machine -# number from the bootloader due to marketing monkeys, so we just enable it -# by default if IXDP425 is enabled. -# -config ARCH_IXCDP1100 - bool - depends on ARCH_IXDP425 - default y - config ARCH_PRPMC1100 bool "PrPMC1100" help @@ -120,46 +39,6 @@ config ARCH_PRPMC1100 PrPCM1100 Processor Mezanine Module. For more information on this platform, see <file:Documentation/arm/ixp4xx.rst>. -config MACH_NAS100D - bool - prompt "NAS100D" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Iomega's - NAS 100d device. For more information on this platform, - see http://www.nslu2-linux.org/wiki/NAS100d/HomePage - -config MACH_DSMG600 - bool - prompt "D-Link DSM-G600 RevA" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support D-Link's - DSM-G600 RevA device. For more information on this platform, - see http://www.nslu2-linux.org/wiki/DSMG600/HomePage - -config ARCH_IXDP4XX - bool - depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435 - default y - -config MACH_FSG - bool - prompt "Freecom FSG-3" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Freecom's - FSG-3 device. For more information on this platform, - see http://www.nslu2-linux.org/wiki/FSG3/HomePage - -config MACH_ARCOM_VULCAN - bool - prompt "Arcom/Eurotech Vulcan" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support Arcom's - Vulcan board. - # # Certain registers and IRQs are only enabled if supporting IXP465 CPUs # @@ -173,43 +52,6 @@ config CPU_IXP43X depends on MACH_KIXRP435 default y -config MACH_GTWX5715 - bool "Gemtek WX5715 (Linksys WRV54G)" - depends on ARCH_IXP4XX - depends on IXP4XX_PCI_LEGACY - help - This board is currently inside the Linksys WRV54G Gateways. - - IXP425 - 266mhz - 32mb SDRAM - 8mb Flash - miniPCI slot 0 does not have a card connector soldered to the board - miniPCI slot 1 has an ISL3880 802.11g card (Prism54) - npe0 is connected to a Kendin KS8995M Switch (4 ports) - npe1 is the "wan" port - "Console" UART is available on J11 as console - "High Speed" UART is n/c (as far as I can tell) - 20 Pin ARM/Xscale JTAG interface on J2 - -config MACH_DEVIXP - bool "Omicron DEVIXP" - help - Say 'Y' here if you want your kernel to support the DEVIXP - board from OMICRON electronics GmbH. - -config MACH_MICCPT - bool "Omicron MICCPT" - depends on IXP4XX_PCI_LEGACY - help - Say 'Y' here if you want your kernel to support the MICCPT - board from OMICRON electronics GmbH. - -config MACH_MIC256 - bool "Omicron MIC256" - help - Say 'Y' here if you want your kernel to support the MIC256 - board from OMICRON electronics GmbH. - comment "IXP4xx Options" config IXP4XX_PCI_LEGACY diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile index 1fa4e6605782..b241094c9649 100644 --- a/arch/arm/mach-ixp4xx/Makefile +++ b/arch/arm/mach-ixp4xx/Makefile @@ -9,37 +9,11 @@ obj-pci-n := # Device tree platform obj-pci-$(CONFIG_MACH_IXP4XX_OF) += ixp4xx-of.o -obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o -obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o -obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o -obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o -obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o -obj-pci-$(CONFIG_MACH_MICCPT) += miccpt-pci.o -obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o -obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o -obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o -obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o -obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o -obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o obj-y += common.o -obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o -obj-$(CONFIG_MACH_AVILA) += avila-setup.o -obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o -obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o -obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o -obj-$(CONFIG_MACH_DEVIXP) += omixp-setup.o -obj-$(CONFIG_MACH_MICCPT) += omixp-setup.o -obj-$(CONFIG_MACH_MIC256) += omixp-setup.o -obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o -obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o -obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o -obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o -obj-$(CONFIG_MACH_FSG) += fsg-setup.o obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o -obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o diff --git a/arch/arm/mach-ixp4xx/avila-pci.c b/arch/arm/mach-ixp4xx/avila-pci.c deleted file mode 100644 index 2e5996a96dd3..000000000000 --- a/arch/arm/mach-ixp4xx/avila-pci.c +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/avila-pci.c - * - * Gateworks Avila board-level PCI initialization - * - * Author: Michael-Luke Jones <mlj28@cam.ac.uk> - * - * Based on ixdp-pci.c - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * - * Maintainer: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/delay.h> -#include <asm/mach/pci.h> -#include <asm/irq.h> -#include <mach/hardware.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define AVILA_MAX_DEV 4 -#define LOFT_MAX_DEV 6 -#define IRQ_LINES 4 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 11 -#define INTB 10 -#define INTC 9 -#define INTD 8 - -void __init avila_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init avila_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[IRQ_LINES] = { - IXP4XX_GPIO_IRQ(INTA), - IXP4XX_GPIO_IRQ(INTB), - IXP4XX_GPIO_IRQ(INTC), - IXP4XX_GPIO_IRQ(INTD) - }; - - if (slot >= 1 && - slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && - pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[(slot + pin - 2) % 4]; - - return -1; -} - -struct hw_pci avila_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = avila_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = avila_map_irq, -}; - -int __init avila_pci_init(void) -{ - if (machine_is_avila() || machine_is_loft()) - pci_common_init(&avila_pci); - return 0; -} - -subsys_initcall(avila_pci_init); diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c deleted file mode 100644 index ec1d3029f80c..000000000000 --- a/arch/arm/mach-ixp4xx/avila-setup.c +++ /dev/null @@ -1,210 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/avila-setup.c - * - * Gateworks Avila board-setup - * - * Author: Michael-Luke Jones <mlj28@cam.ac.uk> - * - * Based on ixdp-setup.c - * Copyright (C) 2003-2005 MontaVista Software, Inc. - * - * Author: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/gpio/machine.h> -#include <linux/platform_data/pata_ixp4xx_cf.h> -#include <asm/types.h> -#include <asm/setup.h> -#include <asm/memory.h> -#include <mach/hardware.h> -#include <asm/mach-types.h> -#include <asm/irq.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -#define AVILA_SDA_PIN 7 -#define AVILA_SCL_PIN 6 - -static struct flash_platform_data avila_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource avila_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device avila_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &avila_flash_data, - }, - .num_resources = 1, - .resource = &avila_flash_resource, -}; - -static struct gpiod_lookup_table avila_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct platform_device avila_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct resource avila_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - } -}; - -static struct plat_serial8250_port avila_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { }, -}; - -static struct platform_device avila_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = avila_uart_data, - .num_resources = 2, - .resource = avila_uart_resources -}; - -static struct resource avila_pata_resources[] = { - { - .flags = IORESOURCE_MEM - }, - { - .flags = IORESOURCE_MEM, - }, - { - .name = "intrq", - .start = IRQ_IXP4XX_GPIO12, - .end = IRQ_IXP4XX_GPIO12, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct ixp4xx_pata_data avila_pata_data = { - .cs0_bits = 0xbfff0043, - .cs1_bits = 0xbfff0043, -}; - -static struct platform_device avila_pata = { - .name = "pata_ixp4xx_cf", - .id = 0, - .dev.platform_data = &avila_pata_data, - .num_resources = ARRAY_SIZE(avila_pata_resources), - .resource = avila_pata_resources, -}; - -static struct platform_device *avila_devices[] __initdata = { - &avila_i2c_gpio, - &avila_flash, - &avila_uart -}; - -static void __init avila_init(void) -{ - ixp4xx_sys_init(); - - avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - avila_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - - gpiod_add_lookup_table(&avila_i2c_gpiod_table); - - platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); - - avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); - avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); - - avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); - avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); - - avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; - avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; - - platform_device_register(&avila_pata); - -} - -MACHINE_START(AVILA, "Gateworks Avila Network Platform") - /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = avila_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END - - /* - * Loft is functionally equivalent to Avila except that it has a - * different number for the maximum PCI devices. The MACHINE - * structure below is identical to Avila except for the comment. - */ -#ifdef CONFIG_MACH_LOFT -MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") - /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = avila_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END -#endif - diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c deleted file mode 100644 index c250b59e8d47..000000000000 --- a/arch/arm/mach-ixp4xx/coyote-pci.c +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/coyote-pci.c - * - * PCI setup routines for ADI Engineering Coyote platform - * - * Copyright (C) 2002 Jungo Software Technologies. - * Copyright (C) 2003 MontaVista Softwrae, Inc. - * - * Maintainer: Deepak Saxena <dsaxena@mvista.com> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach-types.h> -#include <mach/hardware.h> -#include <asm/irq.h> -#include <asm/mach/pci.h> - -#include "irqs.h" - -#define SLOT0_DEVID 14 -#define SLOT1_DEVID 15 - -/* PCI controller GPIO to IRQ pin mappings */ -#define SLOT0_INTA 6 -#define SLOT1_INTA 11 - -void __init coyote_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init coyote_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - if (slot == SLOT0_DEVID) - return IXP4XX_GPIO_IRQ(SLOT0_INTA); - else if (slot == SLOT1_DEVID) - return IXP4XX_GPIO_IRQ(SLOT1_INTA); - else return -1; -} - -struct hw_pci coyote_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = coyote_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = coyote_map_irq, -}; - -int __init coyote_pci_init(void) -{ - if (machine_is_adi_coyote()) - pci_common_init(&coyote_pci); - return 0; -} - -subsys_initcall(coyote_pci_init); diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c deleted file mode 100644 index 7ca43ca2816d..000000000000 --- a/arch/arm/mach-ixp4xx/coyote-setup.c +++ /dev/null @@ -1,144 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/coyote-setup.c - * - * Board setup for ADI Engineering and IXDGP425 boards - * - * Copyright (C) 2003-2005 MontaVista Software, Inc. - * - * Author: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> - -#include <asm/types.h> -#include <asm/setup.h> -#include <asm/memory.h> -#include <mach/hardware.h> -#include <asm/irq.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3) -#define COYOTE_IDE_BASE_VIRT 0xFFFE1000 -#define COYOTE_IDE_REGION_SIZE 0x1000 - -#define COYOTE_IDE_DATA_PORT 0xFFFE10E0 -#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC -#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2 -#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5 - -static struct flash_platform_data coyote_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource coyote_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device coyote_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &coyote_flash_data, - }, - .num_resources = 1, - .resource = &coyote_flash_resource, -}; - -static struct resource coyote_uart_resource = { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, -}; - -static struct plat_serial8250_port coyote_uart_data[] = { - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { }, -}; - -static struct platform_device coyote_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = coyote_uart_data, - }, - .num_resources = 1, - .resource = &coyote_uart_resource, -}; - -static struct platform_device *coyote_devices[] __initdata = { - &coyote_flash, - &coyote_uart -}; - -static void __init coyote_init(void) -{ - ixp4xx_sys_init(); - - coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; - - *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; - *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; - - if (machine_is_ixdpg425()) { - coyote_uart_data[0].membase = - (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET); - coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS; - coyote_uart_data[0].irq = IRQ_IXP4XX_UART1; - } - - platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices)); -} - -#ifdef CONFIG_ARCH_ADI_COYOTE -MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = coyote_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END -#endif - -/* - * IXDPG425 is identical to Coyote except for which serial port - * is connected. - */ -#ifdef CONFIG_MACH_IXDPG425 -MACHINE_START(IXDPG425, "Intel IXDPG425") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = coyote_init, - .restart = ixp4xx_restart, -MACHINE_END -#endif - diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c b/arch/arm/mach-ixp4xx/dsmg600-pci.c deleted file mode 100644 index e997d97f619e..000000000000 --- a/arch/arm/mach-ixp4xx/dsmg600-pci.c +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * DSM-G600 board-level PCI initialization - * - * Copyright (C) 2006 Tower Technologies - * Author: Alessandro Zummo <a.zummo@towertech.it> - * - * based on ixdp425-pci.c: - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * - * Maintainer: http://www.nslu2-linux.org/ - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 4 -#define IRQ_LINES 3 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 11 -#define INTB 10 -#define INTC 9 -#define INTD 8 -#define INTE 7 -#define INTF 6 - -void __init dsmg600_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTE), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTF), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init dsmg600_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[MAX_DEV][IRQ_LINES] = { - { IXP4XX_GPIO_IRQ(INTE), -1, -1 }, - { IXP4XX_GPIO_IRQ(INTA), -1, -1 }, - { IXP4XX_GPIO_IRQ(INTB), IXP4XX_GPIO_IRQ(INTC), - IXP4XX_GPIO_IRQ(INTD) }, - { IXP4XX_GPIO_IRQ(INTF), -1, -1 }, - }; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[slot - 1][pin - 1]; - - return -1; -} - -struct hw_pci __initdata dsmg600_pci = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = dsmg600_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = dsmg600_map_irq, -}; - -int __init dsmg600_pci_init(void) -{ - if (machine_is_dsmg600()) - pci_common_init(&dsmg600_pci); - - return 0; -} - -subsys_initcall(dsmg600_pci_init); diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c deleted file mode 100644 index 4d4c62fced71..000000000000 --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c +++ /dev/null @@ -1,304 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * DSM-G600 board-setup - * - * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> - * Copyright (C) 2006 Tower Technologies - * - * based on ixdp425-setup.c: - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * based on nslu2-power.c: - * Copyright (C) 2005 Tower Technologies - * based on nslu2-io.c: - * Copyright (C) 2004 Karen Spearel - * - * Author: Alessandro Zummo <a.zummo@towertech.it> - * Author: Michael Westerhof <mwester@dls.net> - * Author: Rod Whitby <rod@whitby.id.au> - * Maintainers: http://www.nslu2-linux.org/ - */ -#include <linux/gpio.h> -#include <linux/irq.h> -#include <linux/jiffies.h> -#include <linux/timer.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/leds.h> -#include <linux/reboot.h> -#include <linux/i2c.h> -#include <linux/gpio/machine.h> - -#include <mach/hardware.h> - -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> -#include <asm/mach/time.h> - -#include "irqs.h" - -#define DSMG600_SDA_PIN 5 -#define DSMG600_SCL_PIN 4 - -/* DSM-G600 Timer Setting */ -#define DSMG600_FREQ 66000000 - -/* Buttons */ -#define DSMG600_PB_GPIO 15 /* power button */ -#define DSMG600_RB_GPIO 3 /* reset button */ - -/* Power control */ -#define DSMG600_PO_GPIO 2 /* power off */ - -/* LEDs */ -#define DSMG600_LED_PWR_GPIO 0 -#define DSMG600_LED_WLAN_GPIO 14 - -static struct flash_platform_data dsmg600_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource dsmg600_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device dsmg600_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev.platform_data = &dsmg600_flash_data, - .num_resources = 1, - .resource = &dsmg600_flash_resource, -}; - -static struct gpiod_lookup_table dsmg600_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct platform_device dsmg600_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = { - { - I2C_BOARD_INFO("pcf8563", 0x51), - }, -}; - -static struct gpio_led dsmg600_led_pins[] = { - { - .name = "dsmg600:green:power", - .gpio = DSMG600_LED_PWR_GPIO, - }, - { - .name = "dsmg600:green:wlan", - .gpio = DSMG600_LED_WLAN_GPIO, - .active_low = true, - }, -}; - -static struct gpio_led_platform_data dsmg600_led_data = { - .num_leds = ARRAY_SIZE(dsmg600_led_pins), - .leds = dsmg600_led_pins, -}; - -static struct platform_device dsmg600_leds = { - .name = "leds-gpio", - .id = -1, - .dev.platform_data = &dsmg600_led_data, -}; - -static struct resource dsmg600_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - } -}; - -static struct plat_serial8250_port dsmg600_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { } -}; - -static struct platform_device dsmg600_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = dsmg600_uart_data, - .num_resources = ARRAY_SIZE(dsmg600_uart_resources), - .resource = dsmg600_uart_resources, -}; - -static struct platform_device *dsmg600_devices[] __initdata = { - &dsmg600_i2c_gpio, - &dsmg600_flash, - &dsmg600_leds, -}; - -static void dsmg600_power_off(void) -{ - /* enable the pwr cntl and drive it high */ - gpio_direction_output(DSMG600_PO_GPIO, 1); -} - -/* This is used to make sure the power-button pusher is serious. The button - * must be held until the value of this counter reaches zero. - */ -static int power_button_countdown; - -/* Must hold the button down for at least this many counts to be processed */ -#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */ - -static void dsmg600_power_handler(struct timer_list *unused); -static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler); - -static void dsmg600_power_handler(struct timer_list *unused) -{ - /* This routine is called twice per second to check the - * state of the power button. - */ - - if (gpio_get_value(DSMG600_PB_GPIO)) { - - /* IO Pin is 1 (button pushed) */ - if (power_button_countdown > 0) - power_button_countdown--; - - } else { - - /* Done on button release, to allow for auto-power-on mods. */ - if (power_button_countdown == 0) { - /* Signal init to do the ctrlaltdel action, - * this will bypass init if it hasn't started - * and do a kernel_restart. - */ - ctrl_alt_del(); - - /* Change the state of the power LED to "blink" */ - gpio_set_value(DSMG600_LED_PWR_GPIO, 0); - } else { - power_button_countdown = PBUTTON_HOLDDOWN_COUNT; - } - } - - mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); -} - -static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id) -{ - /* This is the paper-clip reset, it shuts the machine down directly. */ - machine_power_off(); - - return IRQ_HANDLED; -} - -static void __init dsmg600_timer_init(void) -{ - /* The xtal on this machine is non-standard. */ - ixp4xx_timer_freq = DSMG600_FREQ; - - /* Call standard timer_init function. */ - ixp4xx_timer_init(); -} - -static int __init dsmg600_gpio_init(void) -{ - if (!machine_is_dsmg600()) - return 0; - - gpio_request(DSMG600_RB_GPIO, "reset button"); - if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler, - IRQF_TRIGGER_LOW, "DSM-G600 reset button", NULL) < 0) { - - printk(KERN_DEBUG "Reset Button IRQ %d not available\n", - gpio_to_irq(DSMG600_RB_GPIO)); - } - - /* - * The power button on the D-Link DSM-G600 is on GPIO 15, but - * it cannot handle interrupts on that GPIO line. So we'll - * have to poll it with a kernel timer. - */ - - /* Make sure that the power button GPIO is set up as an input */ - gpio_request(DSMG600_PB_GPIO, "power button"); - gpio_direction_input(DSMG600_PB_GPIO); - /* Request poweroff GPIO line */ - gpio_request(DSMG600_PO_GPIO, "power off button"); - - /* Set the initial value for the power button IRQ handler */ - power_button_countdown = PBUTTON_HOLDDOWN_COUNT; - - mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); - return 0; -} -device_initcall(dsmg600_gpio_init); - -static void __init dsmg600_init(void) -{ - ixp4xx_sys_init(); - - dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - dsmg600_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - - gpiod_add_lookup_table(&dsmg600_i2c_gpiod_table); - i2c_register_board_info(0, dsmg600_i2c_board_info, - ARRAY_SIZE(dsmg600_i2c_board_info)); - - /* The UART is required on the DSM-G600 (Redboot cannot use the - * NIC) -- do it here so that it does *not* get removed if - * platform_add_devices fails! - */ - (void)platform_device_register(&dsmg600_uart); - - platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); - - pm_power_off = dsmg600_power_off; -} - -MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") - /* Maintainer: www.nslu2-linux.org */ - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = dsmg600_timer_init, - .init_machine = dsmg600_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END diff --git a/arch/arm/mach-ixp4xx/fsg-pci.c b/arch/arm/mach-ixp4xx/fsg-pci.c deleted file mode 100644 index 4122a61aae70..000000000000 --- a/arch/arm/mach-ixp4xx/fsg-pci.c +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arch/mach-ixp4xx/fsg-pci.c - * - * FSG board-level PCI initialization - * - * Author: Rod Whitby <rod@whitby.id.au> - * Maintainer: http://www.nslu2-linux.org/ - * - * based on ixdp425-pci.c: - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 3 -#define IRQ_LINES 3 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 6 -#define INTB 7 -#define INTC 5 - -void __init fsg_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init fsg_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[IRQ_LINES] = { - IXP4XX_GPIO_IRQ(INTC), - IXP4XX_GPIO_IRQ(INTB), - IXP4XX_GPIO_IRQ(INTA), - }; - - int irq = -1; - slot -= 11; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - irq = pci_irq_table[slot - 1]; - printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", - __func__, slot, pin, irq); - - return irq; -} - -struct hw_pci fsg_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = fsg_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = fsg_map_irq, -}; - -int __init fsg_pci_init(void) -{ - if (machine_is_fsg()) - pci_common_init(&fsg_pci); - return 0; -} - -subsys_initcall(fsg_pci_init); diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c deleted file mode 100644 index 844329c5610d..000000000000 --- a/arch/arm/mach-ixp4xx/fsg-setup.c +++ /dev/null @@ -1,311 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/fsg-setup.c - * - * FSG board-setup - * - * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> - * - * based on ixdp425-setup.c: - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * based on nslu2-power.c - * Copyright (C) 2005 Tower Technologies - * - * Author: Rod Whitby <rod@whitby.id.au> - * Maintainers: http://www.nslu2-linux.org/ - * - */ -#include <linux/gpio.h> -#include <linux/if_ether.h> -#include <linux/irq.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/leds.h> -#include <linux/reboot.h> -#include <linux/i2c.h> -#include <linux/gpio/machine.h> -#include <linux/io.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> -#include <mach/hardware.h> - -#include "irqs.h" - -#define FSG_SDA_PIN 12 -#define FSG_SCL_PIN 13 - -#define FSG_SB_GPIO 4 /* sync button */ -#define FSG_RB_GPIO 9 /* reset button */ -#define FSG_UB_GPIO 10 /* usb button */ - -static struct flash_platform_data fsg_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource fsg_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device fsg_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &fsg_flash_data, - }, - .num_resources = 1, - .resource = &fsg_flash_resource, -}; - -static struct gpiod_lookup_table fsg_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct platform_device fsg_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct i2c_board_info __initdata fsg_i2c_board_info [] = { - { - I2C_BOARD_INFO("isl1208", 0x6f), - }, -}; - -static struct resource fsg_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - } -}; - -static struct plat_serial8250_port fsg_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { } -}; - -static struct platform_device fsg_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = fsg_uart_data, - }, - .num_resources = ARRAY_SIZE(fsg_uart_resources), - .resource = fsg_uart_resources, -}; - -static struct platform_device fsg_leds = { - .name = "fsg-led", - .id = -1, -}; - -/* Built-in 10/100 Ethernet MAC interfaces */ -static struct resource fsg_eth_npeb_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource fsg_eth_npec_resources[] = { - { - .start = IXP4XX_EthC_BASE_PHYS, - .end = IXP4XX_EthC_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info fsg_plat_eth[] = { - { - .phy = 5, - .rxq = 3, - .txreadyq = 20, - }, { - .phy = 4, - .rxq = 4, - .txreadyq = 21, - } -}; - -static struct platform_device fsg_eth[] = { - { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev = { - .platform_data = fsg_plat_eth, - }, - .num_resources = ARRAY_SIZE(fsg_eth_npeb_resources), - .resource = fsg_eth_npeb_resources, - }, { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEC, - .dev = { - .platform_data = fsg_plat_eth + 1, - }, - .num_resources = ARRAY_SIZE(fsg_eth_npec_resources), - .resource = fsg_eth_npec_resources, - } -}; - -static struct platform_device *fsg_devices[] __initdata = { - &fsg_i2c_gpio, - &fsg_flash, - &fsg_leds, - &fsg_eth[0], - &fsg_eth[1], -}; - -static irqreturn_t fsg_power_handler(int irq, void *dev_id) -{ - /* Signal init to do the ctrlaltdel action, this will bypass init if - * it hasn't started and do a kernel_restart. - */ - ctrl_alt_del(); - - return IRQ_HANDLED; -} - -static irqreturn_t fsg_reset_handler(int irq, void *dev_id) -{ - /* This is the paper-clip reset which does an emergency reboot. */ - printk(KERN_INFO "Restarting system.\n"); - machine_restart(NULL); - - /* This should never be reached. */ - return IRQ_HANDLED; -} - -static void __init fsg_init(void) -{ - uint8_t __iomem *f; - - ixp4xx_sys_init(); - - fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - fsg_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - - *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; - *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; - - /* Configure CS2 for operation, 8bit and writable */ - *IXP4XX_EXP_CS2 = 0xbfff0002; - - gpiod_add_lookup_table(&fsg_i2c_gpiod_table); - i2c_register_board_info(0, fsg_i2c_board_info, - ARRAY_SIZE(fsg_i2c_board_info)); - - /* This is only useful on a modified machine, but it is valuable - * to have it first in order to see debug messages, and so that - * it does *not* get removed if platform_add_devices fails! - */ - (void)platform_device_register(&fsg_uart); - - platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); - - if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler, - IRQF_TRIGGER_LOW, "FSG reset button", NULL) < 0) { - - printk(KERN_DEBUG "Reset Button IRQ %d not available\n", - gpio_to_irq(FSG_RB_GPIO)); - } - - if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler, - IRQF_TRIGGER_LOW, "FSG power button", NULL) < 0) { - - printk(KERN_DEBUG "Power Button IRQ %d not available\n", - gpio_to_irq(FSG_SB_GPIO)); - } - - /* - * Map in a portion of the flash and read the MAC addresses. - * Since it is stored in BE in the flash itself, we need to - * byteswap it if we're in LE mode. - */ - f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000); - if (f) { -#ifdef __ARMEB__ - int i; - for (i = 0; i < 6; i++) { - fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i); - fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i); - } -#else - - /* - Endian-swapped reads from unaligned addresses are - required to extract the two MACs from the big-endian - Redboot config area in flash. - */ - - fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0421); - fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0420); - fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0427); - fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0426); - fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0425); - fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0424); - - fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0439); - fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C043F); - fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C043E); - fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C043D); - fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C043C); - fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0443); -#endif - iounmap(f); - } - printk(KERN_INFO "FSG: Using MAC address %pM for port 0\n", - fsg_plat_eth[0].hwaddr); - printk(KERN_INFO "FSG: Using MAC address %pM for port 1\n", - fsg_plat_eth[1].hwaddr); - -} - -MACHINE_START(FSG, "Freecom FSG-3") - /* Maintainer: www.nslu2-linux.org */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = fsg_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END - diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c deleted file mode 100644 index 224328dbddb1..000000000000 --- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * arch/arm/mach-ixp4xx/gtwx5715-pci.c - * - * Gemtek GTWX5715 (Linksys WRV54G) board setup - * - * Copyright (C) 2004 George T. Joseph - * Derived from Coyote - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/delay.h> -#include <linux/irq.h> -#include <asm/mach-types.h> -#include <mach/hardware.h> -#include <asm/mach/pci.h> - -#include "irqs.h" - -#define SLOT0_DEVID 0 -#define SLOT1_DEVID 1 -#define INTA 10 /* slot 1 has INTA and INTB crossed */ -#define INTB 11 - -/* - * Slot 0 isn't actually populated with a card connector but - * we initialize it anyway in case a future version has the - * slot populated or someone with good soldering skills has - * some free time. - */ -void __init gtwx5715_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - - -static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - int rc = -1; - - if ((slot == SLOT0_DEVID && pin == 1) || - (slot == SLOT1_DEVID && pin == 2)) - rc = IXP4XX_GPIO_IRQ(INTA); - else if ((slot == SLOT0_DEVID && pin == 2) || - (slot == SLOT1_DEVID && pin == 1)) - rc = IXP4XX_GPIO_IRQ(INTB); - - printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", - __func__, slot, pin, rc); - return rc; -} - -struct hw_pci gtwx5715_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = gtwx5715_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = gtwx5715_map_irq, -}; - -int __init gtwx5715_pci_init(void) -{ - if (machine_is_gtwx5715()) - pci_common_init(>wx5715_pci); - - return 0; -} - -subsys_initcall(gtwx5715_pci_init); diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c deleted file mode 100644 index 28f0d2a8a829..000000000000 --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c +++ /dev/null @@ -1,167 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * arch/arm/mach-ixp4xx/gtwx5715-setup.c - * - * Gemtek GTWX5715 (Linksys WRV54G) board setup - * - * Copyright (C) 2004 George T. Joseph - * Derived from Coyote - */ - -#include <linux/init.h> -#include <linux/device.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <asm/types.h> -#include <asm/setup.h> -#include <asm/memory.h> -#include <mach/hardware.h> -#include <asm/irq.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -/* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch - and operate as an SPI type interface. The details of the interface - are available on Kendin/Micrel's web site. */ - -#define GTWX5715_KSSPI_SELECT 5 -#define GTWX5715_KSSPI_TXD 6 -#define GTWX5715_KSSPI_CLOCK 7 -#define GTWX5715_KSSPI_RXD 12 - -/* The "reset" button is wired to GPIO 3. - The GPIO is brought "low" when the button is pushed. */ - -#define GTWX5715_BUTTON_GPIO 3 - -/* Board Label Front Label - LED1 Power - LED2 Wireless-G - LED3 not populated but could be - LED4 Internet - LED5 - LED8 Controlled by KS8995M Switch - LED9 DMZ */ - -#define GTWX5715_LED1_GPIO 2 -#define GTWX5715_LED2_GPIO 9 -#define GTWX5715_LED3_GPIO 8 -#define GTWX5715_LED4_GPIO 1 -#define GTWX5715_LED9_GPIO 4 - -/* - * Xscale UART registers are 32 bits wide with only the least - * significant 8 bits having any meaning. From a configuration - * perspective, this means 2 things... - * - * Setting .regshift = 2 so that the standard 16550 registers - * line up on every 4th byte. - * - * Shifting the register start virtual address +3 bytes when - * compiled big-endian. Since register writes are done on a - * single byte basis, if the shift isn't done the driver will - * write the value into the most significant byte of the register, - * which is ignored, instead of the least significant. - */ - -#ifdef __ARMEB__ -#define REG_OFFSET 3 -#else -#define REG_OFFSET 0 -#endif - -/* - * Only the second or "console" uart is connected on the gtwx5715. - */ - -static struct resource gtwx5715_uart_resources[] = { - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - { - .start = IRQ_IXP4XX_UART2, - .end = IRQ_IXP4XX_UART2, - .flags = IORESOURCE_IRQ, - }, - { }, -}; - - -static struct plat_serial8250_port gtwx5715_uart_platform_data[] = { - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { }, -}; - -static struct platform_device gtwx5715_uart_device = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = gtwx5715_uart_platform_data, - }, - .num_resources = 2, - .resource = gtwx5715_uart_resources, -}; - -static struct flash_platform_data gtwx5715_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource gtwx5715_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device gtwx5715_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = >wx5715_flash_data, - }, - .num_resources = 1, - .resource = >wx5715_flash_resource, -}; - -static struct platform_device *gtwx5715_devices[] __initdata = { - >wx5715_uart_device, - >wx5715_flash, -}; - -static void __init gtwx5715_init(void) -{ - ixp4xx_sys_init(); - - gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; - - platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); -} - - -MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)") - /* Maintainer: George Joseph */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = gtwx5715_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END - - diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c deleted file mode 100644 index c77fe0d52d79..000000000000 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/ixdp425-pci.c - * - * IXDP425 board-level PCI initialization - * - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * - * Maintainer: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/delay.h> -#include <asm/mach/pci.h> -#include <asm/irq.h> -#include <mach/hardware.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 4 -#define IRQ_LINES 4 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 11 -#define INTB 10 -#define INTC 9 -#define INTD 8 - - -void __init ixdp425_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init ixdp425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[IRQ_LINES] = { - IXP4XX_GPIO_IRQ(INTA), - IXP4XX_GPIO_IRQ(INTB), - IXP4XX_GPIO_IRQ(INTC), - IXP4XX_GPIO_IRQ(INTD) - }; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[(slot + pin - 2) % 4]; - - return -1; -} - -struct hw_pci ixdp425_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = ixdp425_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = ixdp425_map_irq, -}; - -int __init ixdp425_pci_init(void) -{ - if (machine_is_ixdp425() || machine_is_ixcdp1100() || - machine_is_ixdp465() || machine_is_kixrp435()) - pci_common_init(&ixdp425_pci); - return 0; -} - -subsys_initcall(ixdp425_pci_init); diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c deleted file mode 100644 index 45d5b720ded6..000000000000 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ /dev/null @@ -1,339 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/ixdp425-setup.c - * - * IXDP425/IXCDP1100 board-setup - * - * Copyright (C) 2003-2005 MontaVista Software, Inc. - * - * Author: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/gpio/machine.h> -#include <linux/io.h> -#include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> -#include <linux/mtd/platnand.h> -#include <linux/delay.h> -#include <linux/gpio.h> -#include <asm/types.h> -#include <asm/setup.h> -#include <asm/memory.h> -#include <mach/hardware.h> -#include <asm/mach-types.h> -#include <asm/irq.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -#define IXDP425_SDA_PIN 7 -#define IXDP425_SCL_PIN 6 - -/* NAND Flash pins */ -#define IXDP425_NAND_NCE_PIN 12 - -#define IXDP425_NAND_CMD_BYTE 0x01 -#define IXDP425_NAND_ADDR_BYTE 0x02 - -static struct flash_platform_data ixdp425_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource ixdp425_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device ixdp425_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &ixdp425_flash_data, - }, - .num_resources = 1, - .resource = &ixdp425_flash_resource, -}; - -#if defined(CONFIG_MTD_NAND_PLATFORM) || \ - defined(CONFIG_MTD_NAND_PLATFORM_MODULE) - -static struct mtd_partition ixdp425_partitions[] = { - { - .name = "ixp400 NAND FS 0", - .offset = 0, - .size = SZ_8M - }, { - .name = "ixp400 NAND FS 1", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL - }, -}; - -static void -ixdp425_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) -{ - int offset = (int)nand_get_controller_data(this); - - if (ctrl & NAND_CTRL_CHANGE) { - if (ctrl & NAND_NCE) { - gpio_set_value(IXDP425_NAND_NCE_PIN, 0); - udelay(5); - } else - gpio_set_value(IXDP425_NAND_NCE_PIN, 1); - - offset = (ctrl & NAND_CLE) ? IXDP425_NAND_CMD_BYTE : 0; - offset |= (ctrl & NAND_ALE) ? IXDP425_NAND_ADDR_BYTE : 0; - nand_set_controller_data(this, (void *)offset); - } - - if (cmd != NAND_CMD_NONE) - writeb(cmd, this->legacy.IO_ADDR_W + offset); -} - -static struct platform_nand_data ixdp425_flash_nand_data = { - .chip = { - .nr_chips = 1, - .chip_delay = 30, - .partitions = ixdp425_partitions, - .nr_partitions = ARRAY_SIZE(ixdp425_partitions), - }, - .ctrl = { - .cmd_ctrl = ixdp425_flash_nand_cmd_ctrl - } -}; - -static struct resource ixdp425_flash_nand_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device ixdp425_flash_nand = { - .name = "gen_nand", - .id = -1, - .dev = { - .platform_data = &ixdp425_flash_nand_data, - }, - .num_resources = 1, - .resource = &ixdp425_flash_nand_resource, -}; -#endif /* CONFIG_MTD_NAND_PLATFORM */ - -static struct gpiod_lookup_table ixdp425_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct platform_device ixdp425_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct resource ixdp425_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM - } -}; - -static struct plat_serial8250_port ixdp425_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { }, -}; - -static struct platform_device ixdp425_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = ixdp425_uart_data, - .num_resources = 2, - .resource = ixdp425_uart_resources -}; - -/* Built-in 10/100 Ethernet MAC interfaces */ -static struct resource ixp425_npeb_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource ixp425_npec_resources[] = { - { - .start = IXP4XX_EthC_BASE_PHYS, - .end = IXP4XX_EthC_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info ixdp425_plat_eth[] = { - { - .phy = 0, - .rxq = 3, - .txreadyq = 20, - }, { - .phy = 1, - .rxq = 4, - .txreadyq = 21, - } -}; - -static struct platform_device ixdp425_eth[] = { - { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev.platform_data = ixdp425_plat_eth, - .num_resources = ARRAY_SIZE(ixp425_npeb_resources), - .resource = ixp425_npeb_resources, - }, { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEC, - .dev.platform_data = ixdp425_plat_eth + 1, - .num_resources = ARRAY_SIZE(ixp425_npec_resources), - .resource = ixp425_npec_resources, - } -}; - -static struct platform_device *ixdp425_devices[] __initdata = { - &ixdp425_i2c_gpio, - &ixdp425_flash, -#if defined(CONFIG_MTD_NAND_PLATFORM) || \ - defined(CONFIG_MTD_NAND_PLATFORM_MODULE) - &ixdp425_flash_nand, -#endif - &ixdp425_uart, - &ixdp425_eth[0], - &ixdp425_eth[1], -}; - -static void __init ixdp425_init(void) -{ - ixp4xx_sys_init(); - - ixdp425_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - ixdp425_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - -#if defined(CONFIG_MTD_NAND_PLATFORM) || \ - defined(CONFIG_MTD_NAND_PLATFORM_MODULE) - ixdp425_flash_nand_resource.start = IXP4XX_EXP_BUS_BASE(3), - ixdp425_flash_nand_resource.end = IXP4XX_EXP_BUS_BASE(3) + 0x10 - 1; - - gpio_request(IXDP425_NAND_NCE_PIN, "NAND NCE pin"); - gpio_direction_output(IXDP425_NAND_NCE_PIN, 0); - - /* Configure expansion bus for NAND Flash */ - *IXP4XX_EXP_CS3 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_STROBE_T(1) | /* extend by 1 clock */ - IXP4XX_EXP_BUS_CYCLES(0) | /* Intel cycles */ - IXP4XX_EXP_BUS_SIZE(0) | /* 512bytes addr space*/ - IXP4XX_EXP_BUS_WR_EN | - IXP4XX_EXP_BUS_BYTE_EN; /* 8 bit data bus */ -#endif - - if (cpu_is_ixp43x()) { - ixdp425_uart.num_resources = 1; - ixdp425_uart_data[1].flags = 0; - } - - gpiod_add_lookup_table(&ixdp425_i2c_gpiod_table); - platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); -} - -#ifdef CONFIG_ARCH_IXDP425 -MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = ixdp425_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END -#endif - -#ifdef CONFIG_MACH_IXDP465 -MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = ixdp425_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif -MACHINE_END -#endif - -#ifdef CONFIG_ARCH_PRPMC1100 -MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = ixdp425_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif -MACHINE_END -#endif - -#ifdef CONFIG_MACH_KIXRP435 -MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform") - /* Maintainer: MontaVista Software, Inc. */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = ixdp425_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif -MACHINE_END -#endif diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c deleted file mode 100644 index 1cbea65897b2..000000000000 --- a/arch/arm/mach-ixp4xx/ixdpg425-pci.c +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/ixdpg425-pci.c - * - * PCI setup routines for Intel IXDPG425 Platform - * - * Copyright (C) 2004 MontaVista Softwrae, Inc. - * - * Maintainer: Deepak Saxena <dsaxena@plexity.net> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> - -#include <asm/mach-types.h> -#include <mach/hardware.h> - -#include <asm/mach/pci.h> - -#include "irqs.h" - -void __init ixdpg425_pci_preinit(void) -{ - irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); - - ixp4xx_pci_preinit(); -} - -static int __init ixdpg425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - if (slot == 12 || slot == 13) - return IRQ_IXP4XX_GPIO7; - else if (slot == 14) - return IRQ_IXP4XX_GPIO6; - else return -1; -} - -struct hw_pci ixdpg425_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = ixdpg425_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = ixdpg425_map_irq, -}; - -int __init ixdpg425_pci_init(void) -{ - if (machine_is_ixdpg425()) - pci_common_init(&ixdpg425_pci); - return 0; -} - -subsys_initcall(ixdpg425_pci_init); diff --git a/arch/arm/mach-ixp4xx/miccpt-pci.c b/arch/arm/mach-ixp4xx/miccpt-pci.c deleted file mode 100644 index 55a36537ee1a..000000000000 --- a/arch/arm/mach-ixp4xx/miccpt-pci.c +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/miccpt-pci.c - * - * MICCPT board-level PCI initialization - * - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * Copyright (C) 2006 OMICRON electronics GmbH - * - * Author: Michael Jochum <michael.jochum@omicron.at> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/delay.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/irq.h> -#include <mach/hardware.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 4 -#define IRQ_LINES 4 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 1 -#define INTB 2 -#define INTC 3 -#define INTD 4 - - -void __init miccpt_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init miccpt_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[IRQ_LINES] = { - IXP4XX_GPIO_IRQ(INTA), - IXP4XX_GPIO_IRQ(INTB), - IXP4XX_GPIO_IRQ(INTC), - IXP4XX_GPIO_IRQ(INTD) - }; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[(slot + pin - 2) % 4]; - - return -1; -} - -struct hw_pci miccpt_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = miccpt_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = miccpt_map_irq, -}; - -int __init miccpt_pci_init(void) -{ - if (machine_is_miccpt()) - pci_common_init(&miccpt_pci); - return 0; -} - -subsys_initcall(miccpt_pci_init); diff --git a/arch/arm/mach-ixp4xx/nas100d-pci.c b/arch/arm/mach-ixp4xx/nas100d-pci.c deleted file mode 100644 index 1176f9cb4865..000000000000 --- a/arch/arm/mach-ixp4xx/nas100d-pci.c +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/nas100d-pci.c - * - * NAS 100d board-level PCI initialization - * - * based on ixdp425-pci.c: - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * - * Maintainer: http://www.nslu2-linux.org/ - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 3 -#define IRQ_LINES 3 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 11 -#define INTB 10 -#define INTC 9 -#define INTD 8 -#define INTE 7 - -void __init nas100d_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTE), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init nas100d_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[MAX_DEV][IRQ_LINES] = { - { IXP4XX_GPIO_IRQ(INTA), -1, -1 }, - { IXP4XX_GPIO_IRQ(INTB), -1, -1 }, - { IXP4XX_GPIO_IRQ(INTC), IXP4XX_GPIO_IRQ(INTD), - IXP4XX_GPIO_IRQ(INTE) }, - }; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[slot - 1][pin - 1]; - - return -1; -} - -struct hw_pci __initdata nas100d_pci = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = nas100d_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = nas100d_map_irq, -}; - -int __init nas100d_pci_init(void) -{ - if (machine_is_nas100d()) - pci_common_init(&nas100d_pci); - - return 0; -} - -subsys_initcall(nas100d_pci_init); diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c deleted file mode 100644 index 6133cf01cbe4..000000000000 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ /dev/null @@ -1,353 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/nas100d-setup.c - * - * NAS 100d board-setup - * - * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> - * - * based on ixdp425-setup.c: - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * based on nas100d-power.c: - * Copyright (C) 2005 Tower Technologies - * based on nas100d-io.c - * Copyright (C) 2004 Karen Spearel - * - * Author: Alessandro Zummo <a.zummo@towertech.it> - * Author: Rod Whitby <rod@whitby.id.au> - * Maintainers: http://www.nslu2-linux.org/ - * - */ -#include <linux/gpio.h> -#include <linux/if_ether.h> -#include <linux/irq.h> -#include <linux/jiffies.h> -#include <linux/timer.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/leds.h> -#include <linux/reboot.h> -#include <linux/i2c.h> -#include <linux/gpio/machine.h> -#include <linux/io.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> -#include <mach/hardware.h> - -#include "irqs.h" - -#define NAS100D_SDA_PIN 5 -#define NAS100D_SCL_PIN 6 - -/* Buttons */ -#define NAS100D_PB_GPIO 14 /* power button */ -#define NAS100D_RB_GPIO 4 /* reset button */ - -/* Power control */ -#define NAS100D_PO_GPIO 12 /* power off */ - -/* LEDs */ -#define NAS100D_LED_WLAN_GPIO 0 -#define NAS100D_LED_DISK_GPIO 3 -#define NAS100D_LED_PWR_GPIO 15 - -static struct flash_platform_data nas100d_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource nas100d_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device nas100d_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev.platform_data = &nas100d_flash_data, - .num_resources = 1, - .resource = &nas100d_flash_resource, -}; - -static struct i2c_board_info __initdata nas100d_i2c_board_info [] = { - { - I2C_BOARD_INFO("pcf8563", 0x51), - }, -}; - -static struct gpio_led nas100d_led_pins[] = { - { - .name = "nas100d:green:wlan", - .gpio = NAS100D_LED_WLAN_GPIO, - .active_low = true, - }, - { - .name = "nas100d:blue:power", /* (off=flashing) */ - .gpio = NAS100D_LED_PWR_GPIO, - .active_low = true, - }, - { - .name = "nas100d:yellow:disk", - .gpio = NAS100D_LED_DISK_GPIO, - .active_low = true, - }, -}; - -static struct gpio_led_platform_data nas100d_led_data = { - .num_leds = ARRAY_SIZE(nas100d_led_pins), - .leds = nas100d_led_pins, -}; - -static struct platform_device nas100d_leds = { - .name = "leds-gpio", - .id = -1, - .dev.platform_data = &nas100d_led_data, -}; - -static struct gpiod_lookup_table nas100d_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct platform_device nas100d_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct resource nas100d_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - } -}; - -static struct plat_serial8250_port nas100d_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { } -}; - -static struct platform_device nas100d_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = nas100d_uart_data, - .num_resources = 2, - .resource = nas100d_uart_resources, -}; - -/* Built-in 10/100 Ethernet MAC interfaces */ -static struct resource nas100d_eth_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info nas100d_plat_eth[] = { - { - .phy = 0, - .rxq = 3, - .txreadyq = 20, - } -}; - -static struct platform_device nas100d_eth[] = { - { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev.platform_data = nas100d_plat_eth, - .num_resources = ARRAY_SIZE(nas100d_eth_resources), - .resource = nas100d_eth_resources, - } -}; - -static struct platform_device *nas100d_devices[] __initdata = { - &nas100d_i2c_gpio, - &nas100d_flash, - &nas100d_leds, - &nas100d_eth[0], -}; - -static void nas100d_power_off(void) -{ - /* This causes the box to drop the power and go dead. */ - - /* enable the pwr cntl gpio and assert power off */ - gpio_direction_output(NAS100D_PO_GPIO, 1); -} - -/* This is used to make sure the power-button pusher is serious. The button - * must be held until the value of this counter reaches zero. - */ -static int power_button_countdown; - -/* Must hold the button down for at least this many counts to be processed */ -#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */ - -static void nas100d_power_handler(struct timer_list *unused); -static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler); - -static void nas100d_power_handler(struct timer_list *unused) -{ - /* This routine is called twice per second to check the - * state of the power button. - */ - - if (gpio_get_value(NAS100D_PB_GPIO)) { - - /* IO Pin is 1 (button pushed) */ - if (power_button_countdown > 0) - power_button_countdown--; - - } else { - - /* Done on button release, to allow for auto-power-on mods. */ - if (power_button_countdown == 0) { - /* Signal init to do the ctrlaltdel action, - * this will bypass init if it hasn't started - * and do a kernel_restart. - */ - ctrl_alt_del(); - - /* Change the state of the power LED to "blink" */ - gpio_set_value(NAS100D_LED_PWR_GPIO, 0); - } else { - power_button_countdown = PBUTTON_HOLDDOWN_COUNT; - } - } - - mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500)); -} - -static irqreturn_t nas100d_reset_handler(int irq, void *dev_id) -{ - /* This is the paper-clip reset, it shuts the machine down directly. */ - machine_power_off(); - - return IRQ_HANDLED; -} - -static int __init nas100d_gpio_init(void) -{ - if (!machine_is_nas100d()) - return 0; - - /* - * The power button on the Iomega NAS100d is on GPIO 14, but - * it cannot handle interrupts on that GPIO line. So we'll - * have to poll it with a kernel timer. - */ - - /* Request the power off GPIO */ - gpio_request(NAS100D_PO_GPIO, "power off"); - - /* Make sure that the power button GPIO is set up as an input */ - gpio_request(NAS100D_PB_GPIO, "power button"); - gpio_direction_input(NAS100D_PB_GPIO); - - /* Set the initial value for the power button IRQ handler */ - power_button_countdown = PBUTTON_HOLDDOWN_COUNT; - - mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500)); - - return 0; -} -device_initcall(nas100d_gpio_init); - -static void __init nas100d_init(void) -{ - uint8_t __iomem *f; - int i; - - ixp4xx_sys_init(); - - nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - nas100d_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - - gpiod_add_lookup_table(&nas100d_i2c_gpiod_table); - i2c_register_board_info(0, nas100d_i2c_board_info, - ARRAY_SIZE(nas100d_i2c_board_info)); - - /* - * This is only useful on a modified machine, but it is valuable - * to have it first in order to see debug messages, and so that - * it does *not* get removed if platform_add_devices fails! - */ - (void)platform_device_register(&nas100d_uart); - - platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices)); - - pm_power_off = nas100d_power_off; - - if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler, - IRQF_TRIGGER_LOW, "NAS100D reset button", NULL) < 0) { - - printk(KERN_DEBUG "Reset Button IRQ %d not available\n", - gpio_to_irq(NAS100D_RB_GPIO)); - } - - /* - * Map in a portion of the flash and read the MAC address. - * Since it is stored in BE in the flash itself, we need to - * byteswap it if we're in LE mode. - */ - f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); - if (f) { - for (i = 0; i < 6; i++) -#ifdef __ARMEB__ - nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i); -#else - nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + (i^3)); -#endif - iounmap(f); - } - printk(KERN_INFO "NAS100D: Using MAC address %pM for port 0\n", - nas100d_plat_eth[0].hwaddr); - -} - -MACHINE_START(NAS100D, "Iomega NAS 100d") - /* Maintainer: www.nslu2-linux.org */ - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .init_machine = nas100d_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END diff --git a/arch/arm/mach-ixp4xx/nslu2-pci.c b/arch/arm/mach-ixp4xx/nslu2-pci.c deleted file mode 100644 index c07936a1d736..000000000000 --- a/arch/arm/mach-ixp4xx/nslu2-pci.c +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/nslu2-pci.c - * - * NSLU2 board-level PCI initialization - * - * based on ixdp425-pci.c: - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * - * Maintainer: http://www.nslu2-linux.org/ - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -#define MAX_DEV 3 -#define IRQ_LINES 3 - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 11 -#define INTB 10 -#define INTC 9 -#define INTD 8 - -void __init nslu2_pci_preinit(void) -{ - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init nslu2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - static int pci_irq_table[IRQ_LINES] = { - IXP4XX_GPIO_IRQ(INTA), - IXP4XX_GPIO_IRQ(INTB), - IXP4XX_GPIO_IRQ(INTC), - }; - - if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) - return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; - - return -1; -} - -struct hw_pci __initdata nslu2_pci = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = nslu2_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = nslu2_map_irq, -}; - -int __init nslu2_pci_init(void) /* monkey see, monkey do */ -{ - if (machine_is_nslu2()) - pci_common_init(&nslu2_pci); - - return 0; -} - -subsys_initcall(nslu2_pci_init); diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c deleted file mode 100644 index 8526a70e401b..000000000000 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ /dev/null @@ -1,341 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/nslu2-setup.c - * - * NSLU2 board-setup - * - * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> - * - * based on ixdp425-setup.c: - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * based on nslu2-power.c: - * Copyright (C) 2005 Tower Technologies - * - * Author: Mark Rakes <mrakes at mac.com> - * Author: Rod Whitby <rod@whitby.id.au> - * Author: Alessandro Zummo <a.zummo@towertech.it> - * Maintainers: http://www.nslu2-linux.org/ - * - */ -#include <linux/gpio.h> -#include <linux/if_ether.h> -#include <linux/irq.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/leds.h> -#include <linux/reboot.h> -#include <linux/i2c.h> -#include <linux/gpio/machine.h> -#include <linux/io.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> -#include <asm/mach/time.h> -#include <mach/hardware.h> - -#include "irqs.h" - -#define NSLU2_SDA_PIN 7 -#define NSLU2_SCL_PIN 6 - -/* NSLU2 Timer */ -#define NSLU2_FREQ 66000000 - -/* Buttons */ -#define NSLU2_PB_GPIO 5 /* power button */ -#define NSLU2_PO_GPIO 8 /* power off */ -#define NSLU2_RB_GPIO 12 /* reset button */ - -/* Buzzer */ -#define NSLU2_GPIO_BUZZ 4 - -/* LEDs */ -#define NSLU2_LED_RED_GPIO 0 -#define NSLU2_LED_GRN_GPIO 1 -#define NSLU2_LED_DISK1_GPIO 3 -#define NSLU2_LED_DISK2_GPIO 2 - -static struct flash_platform_data nslu2_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource nslu2_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device nslu2_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev.platform_data = &nslu2_flash_data, - .num_resources = 1, - .resource = &nslu2_flash_resource, -}; - -static struct gpiod_lookup_table nslu2_i2c_gpiod_table = { - .dev_id = "i2c-gpio.0", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SDA_PIN, - NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SCL_PIN, - NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct i2c_board_info __initdata nslu2_i2c_board_info [] = { - { - I2C_BOARD_INFO("x1205", 0x6f), - }, -}; - -static struct gpio_led nslu2_led_pins[] = { - { - .name = "nslu2:green:ready", - .gpio = NSLU2_LED_GRN_GPIO, - }, - { - .name = "nslu2:red:status", - .gpio = NSLU2_LED_RED_GPIO, - }, - { - .name = "nslu2:green:disk-1", - .gpio = NSLU2_LED_DISK1_GPIO, - .active_low = true, - }, - { - .name = "nslu2:green:disk-2", - .gpio = NSLU2_LED_DISK2_GPIO, - .active_low = true, - }, -}; - -static struct gpio_led_platform_data nslu2_led_data = { - .num_leds = ARRAY_SIZE(nslu2_led_pins), - .leds = nslu2_led_pins, -}; - -static struct platform_device nslu2_leds = { - .name = "leds-gpio", - .id = -1, - .dev.platform_data = &nslu2_led_data, -}; - -static struct platform_device nslu2_i2c_gpio = { - .name = "i2c-gpio", - .id = 0, - .dev = { - .platform_data = NULL, - }, -}; - -static struct resource nslu2_beeper_resources[] = { - { - .start = IRQ_IXP4XX_TIMER2, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device nslu2_beeper = { - .name = "ixp4xx-beeper", - .id = NSLU2_GPIO_BUZZ, - .resource = nslu2_beeper_resources, - .num_resources = ARRAY_SIZE(nslu2_beeper_resources), -}; - -static struct resource nslu2_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - } -}; - -static struct plat_serial8250_port nslu2_uart_data[] = { - { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { } -}; - -static struct platform_device nslu2_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = nslu2_uart_data, - .num_resources = 2, - .resource = nslu2_uart_resources, -}; - -/* Built-in 10/100 Ethernet MAC interfaces */ -static struct resource nslu2_eth_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info nslu2_plat_eth[] = { - { - .phy = 1, - .rxq = 3, - .txreadyq = 20, - } -}; - -static struct platform_device nslu2_eth[] = { - { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev.platform_data = nslu2_plat_eth, - .num_resources = ARRAY_SIZE(nslu2_eth_resources), - .resource = nslu2_eth_resources, - } -}; - -static struct platform_device *nslu2_devices[] __initdata = { - &nslu2_i2c_gpio, - &nslu2_flash, - &nslu2_beeper, - &nslu2_leds, - &nslu2_eth[0], -}; - -static void nslu2_power_off(void) -{ - /* This causes the box to drop the power and go dead. */ - - /* enable the pwr cntl gpio and assert power off */ - gpio_direction_output(NSLU2_PO_GPIO, 1); -} - -static irqreturn_t nslu2_power_handler(int irq, void *dev_id) -{ - /* Signal init to do the ctrlaltdel action, this will bypass init if - * it hasn't started and do a kernel_restart. - */ - ctrl_alt_del(); - - return IRQ_HANDLED; -} - -static irqreturn_t nslu2_reset_handler(int irq, void *dev_id) -{ - /* This is the paper-clip reset, it shuts the machine down directly. - */ - machine_power_off(); - - return IRQ_HANDLED; -} - -static int __init nslu2_gpio_init(void) -{ - if (!machine_is_nslu2()) - return 0; - - /* Request the power off GPIO */ - return gpio_request(NSLU2_PO_GPIO, "power off"); -} -device_initcall(nslu2_gpio_init); - -static void __init nslu2_timer_init(void) -{ - /* The xtal on this machine is non-standard. */ - ixp4xx_timer_freq = NSLU2_FREQ; - - /* Call standard timer_init function. */ - ixp4xx_timer_init(); -} - -static void __init nslu2_init(void) -{ - uint8_t __iomem *f; - int i; - - ixp4xx_sys_init(); - - nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - nslu2_flash_resource.end = - IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; - - gpiod_add_lookup_table(&nslu2_i2c_gpiod_table); - i2c_register_board_info(0, nslu2_i2c_board_info, - ARRAY_SIZE(nslu2_i2c_board_info)); - - /* - * This is only useful on a modified machine, but it is valuable - * to have it first in order to see debug messages, and so that - * it does *not* get removed if platform_add_devices fails! - */ - (void)platform_device_register(&nslu2_uart); - - platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); - - pm_power_off = nslu2_power_off; - - if (request_irq(gpio_to_irq(NSLU2_RB_GPIO), &nslu2_reset_handler, - IRQF_TRIGGER_LOW, "NSLU2 reset button", NULL) < 0) { - - printk(KERN_DEBUG "Reset Button IRQ %d not available\n", - gpio_to_irq(NSLU2_RB_GPIO)); - } - - if (request_irq(gpio_to_irq(NSLU2_PB_GPIO), &nslu2_power_handler, - IRQF_TRIGGER_HIGH, "NSLU2 power button", NULL) < 0) { - - printk(KERN_DEBUG "Power Button IRQ %d not available\n", - gpio_to_irq(NSLU2_PB_GPIO)); - } - - /* - * Map in a portion of the flash and read the MAC address. - * Since it is stored in BE in the flash itself, we need to - * byteswap it if we're in LE mode. - */ - f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000); - if (f) { - for (i = 0; i < 6; i++) -#ifdef __ARMEB__ - nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i); -#else - nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + (i^3)); -#endif - iounmap(f); - } - printk(KERN_INFO "NSLU2: Using MAC address %pM for port 0\n", - nslu2_plat_eth[0].hwaddr); - -} - -MACHINE_START(NSLU2, "Linksys NSLU2") - /* Maintainer: www.nslu2-linux.org */ - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = nslu2_timer_init, - .init_machine = nslu2_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c deleted file mode 100644 index 8f2b8c473d7a..000000000000 --- a/arch/arm/mach-ixp4xx/omixp-setup.c +++ /dev/null @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arm/mach-ixp4xx/omixp-setup.c - * - * omicron ixp4xx board setup - * Copyright (C) 2009 OMICRON electronics GmbH - * - * based nslu2-setup.c, ixdp425-setup.c: - * Copyright (C) 2003-2004 MontaVista Software, Inc. - */ - -#include <linux/kernel.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/mtd/mtd.h> -#include <linux/mtd/partitions.h> -#include <linux/leds.h> - -#include <asm/setup.h> -#include <asm/memory.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include <mach/hardware.h> - -#include "irqs.h" - -static struct resource omixp_flash_resources[] = { - { - .flags = IORESOURCE_MEM, - }, { - .flags = IORESOURCE_MEM, - }, -}; - -static struct mtd_partition omixp_partitions[] = { - { - .name = "Recovery Bootloader", - .size = 0x00020000, - .offset = 0, - }, { - .name = "Calibration Data", - .size = 0x00020000, - .offset = 0x00020000, - }, { - .name = "Recovery FPGA", - .size = 0x00020000, - .offset = 0x00040000, - }, { - .name = "Release Bootloader", - .size = 0x00020000, - .offset = 0x00060000, - }, { - .name = "Release FPGA", - .size = 0x00020000, - .offset = 0x00080000, - }, { - .name = "Kernel", - .size = 0x00160000, - .offset = 0x000a0000, - }, { - .name = "Filesystem", - .size = 0x00C00000, - .offset = 0x00200000, - }, { - .name = "Persistent Storage", - .size = 0x00200000, - .offset = 0x00E00000, - }, -}; - -static struct flash_platform_data omixp_flash_data[] = { - { - .map_name = "cfi_probe", - .parts = omixp_partitions, - .nr_parts = ARRAY_SIZE(omixp_partitions), - }, { - .map_name = "cfi_probe", - .parts = NULL, - .nr_parts = 0, - }, -}; - -static struct platform_device omixp_flash_device[] = { - { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &omixp_flash_data[0], - }, - .resource = &omixp_flash_resources[0], - .num_resources = 1, - }, { - .name = "IXP4XX-Flash", - .id = 1, - .dev = { - .platform_data = &omixp_flash_data[1], - }, - .resource = &omixp_flash_resources[1], - .num_resources = 1, - }, -}; - -/* Swap UART's - These boards have the console on UART2. The following - * configuration is used: - * ttyS0 .. UART2 - * ttyS1 .. UART1 - * This way standard images can be used with the kernel that expect - * the console on ttyS0. - */ -static struct resource omixp_uart_resources[] = { - { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct plat_serial8250_port omixp_uart_data[] = { - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, { - /* list termination */ - } -}; - -static struct platform_device omixp_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev.platform_data = omixp_uart_data, - .num_resources = 2, - .resource = omixp_uart_resources, -}; - -static struct gpio_led mic256_led_pins[] = { - { - .name = "LED-A", - .gpio = 7, - }, -}; - -static struct gpio_led_platform_data mic256_led_data = { - .num_leds = ARRAY_SIZE(mic256_led_pins), - .leds = mic256_led_pins, -}; - -static struct platform_device mic256_leds = { - .name = "leds-gpio", - .id = -1, - .dev.platform_data = &mic256_led_data, -}; - -/* Built-in 10/100 Ethernet MAC interfaces */ -static struct resource ixp425_npeb_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource ixp425_npec_resources[] = { - { - .start = IXP4XX_EthC_BASE_PHYS, - .end = IXP4XX_EthC_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info ixdp425_plat_eth[] = { - { - .phy = 0, - .rxq = 3, - .txreadyq = 20, - }, { - .phy = 1, - .rxq = 4, - .txreadyq = 21, - }, -}; - -static struct platform_device ixdp425_eth[] = { - { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev.platform_data = ixdp425_plat_eth, - .num_resources = ARRAY_SIZE(ixp425_npeb_resources), - .resource = ixp425_npeb_resources, - }, { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEC, - .dev.platform_data = ixdp425_plat_eth + 1, - .num_resources = ARRAY_SIZE(ixp425_npec_resources), - .resource = ixp425_npec_resources, - }, -}; - - -static struct platform_device *devixp_pldev[] __initdata = { - &omixp_uart, - &omixp_flash_device[0], - &ixdp425_eth[0], - &ixdp425_eth[1], -}; - -static struct platform_device *mic256_pldev[] __initdata = { - &omixp_uart, - &omixp_flash_device[0], - &mic256_leds, - &ixdp425_eth[0], - &ixdp425_eth[1], -}; - -static struct platform_device *miccpt_pldev[] __initdata = { - &omixp_uart, - &omixp_flash_device[0], - &omixp_flash_device[1], - &ixdp425_eth[0], - &ixdp425_eth[1], -}; - -static void __init omixp_init(void) -{ - ixp4xx_sys_init(); - - /* 16MiB Boot Flash */ - omixp_flash_resources[0].start = IXP4XX_EXP_BUS_BASE(0); - omixp_flash_resources[0].end = IXP4XX_EXP_BUS_END(0); - - /* 32 MiB Data Flash */ - omixp_flash_resources[1].start = IXP4XX_EXP_BUS_BASE(2); - omixp_flash_resources[1].end = IXP4XX_EXP_BUS_END(2); - - if (machine_is_devixp()) - platform_add_devices(devixp_pldev, ARRAY_SIZE(devixp_pldev)); - else if (machine_is_miccpt()) - platform_add_devices(miccpt_pldev, ARRAY_SIZE(miccpt_pldev)); - else if (machine_is_mic256()) - platform_add_devices(mic256_pldev, ARRAY_SIZE(mic256_pldev)); -} - -#ifdef CONFIG_MACH_DEVIXP -MACHINE_START(DEVIXP, "Omicron DEVIXP") - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .init_machine = omixp_init, - .restart = ixp4xx_restart, -MACHINE_END -#endif - -#ifdef CONFIG_MACH_MICCPT -MACHINE_START(MICCPT, "Omicron MICCPT") - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .init_machine = omixp_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END -#endif - -#ifdef CONFIG_MACH_MIC256 -MACHINE_START(MIC256, "Omicron MIC256") - .atag_offset = 0x100, - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .init_machine = omixp_init, - .restart = ixp4xx_restart, -MACHINE_END -#endif diff --git a/arch/arm/mach-ixp4xx/vulcan-pci.c b/arch/arm/mach-ixp4xx/vulcan-pci.c deleted file mode 100644 index caf53922dd3f..000000000000 --- a/arch/arm/mach-ixp4xx/vulcan-pci.c +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arch/mach-ixp4xx/vulcan-pci.c - * - * Vulcan board-level PCI initialization - * - * Copyright (C) 2010 Marc Zyngier <maz@misterjones.org> - * - * based on ixdp425-pci.c: - * Copyright (C) 2002 Intel Corporation. - * Copyright (C) 2003-2004 MontaVista Software, Inc. - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/mach/pci.h> -#include <asm/mach-types.h> - -#include "irqs.h" - -/* PCI controller GPIO to IRQ pin mappings */ -#define INTA 2 -#define INTB 3 - -void __init vulcan_pci_preinit(void) -{ -#ifndef CONFIG_IXP4XX_INDIRECT_PCI - /* - * Cardbus bridge wants way more than the SoC can actually offer, - * and leaves the whole PCI bus in a mess. Artificially limit it - * to 8MB per region. Of course indirect mode doesn't have this - * limitation... - */ - pci_cardbus_mem_size = SZ_8M; - pr_info("Vulcan PCI: limiting CardBus memory size to %dMB\n", - (int)(pci_cardbus_mem_size >> 20)); -#endif - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); - ixp4xx_pci_preinit(); -} - -static int __init vulcan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - if (slot == 1) - return IXP4XX_GPIO_IRQ(INTA); - - if (slot == 2) - return IXP4XX_GPIO_IRQ(INTB); - - return -1; -} - -struct hw_pci vulcan_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = vulcan_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = vulcan_map_irq, -}; - -int __init vulcan_pci_init(void) -{ - if (machine_is_arcom_vulcan()) - pci_common_init(&vulcan_pci); - return 0; -} - -subsys_initcall(vulcan_pci_init); diff --git a/arch/arm/mach-ixp4xx/vulcan-setup.c b/arch/arm/mach-ixp4xx/vulcan-setup.c deleted file mode 100644 index e506d2af98ad..000000000000 --- a/arch/arm/mach-ixp4xx/vulcan-setup.c +++ /dev/null @@ -1,282 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/vulcan-setup.c - * - * Arcom/Eurotech Vulcan board-setup - * - * Copyright (C) 2010 Marc Zyngier <maz@misterjones.org> - * - * based on fsg-setup.c: - * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> - */ - -#include <linux/if_ether.h> -#include <linux/irq.h> -#include <linux/serial.h> -#include <linux/serial_8250.h> -#include <linux/io.h> -#include <linux/w1-gpio.h> -#include <linux/gpio/machine.h> -#include <linux/mtd/plat-ram.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -static struct flash_platform_data vulcan_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource vulcan_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device vulcan_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &vulcan_flash_data, - }, - .resource = &vulcan_flash_resource, - .num_resources = 1, -}; - -static struct platdata_mtd_ram vulcan_sram_data = { - .mapname = "Vulcan SRAM", - .bankwidth = 1, -}; - -static struct resource vulcan_sram_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device vulcan_sram = { - .name = "mtd-ram", - .id = 0, - .dev = { - .platform_data = &vulcan_sram_data, - }, - .resource = &vulcan_sram_resource, - .num_resources = 1, -}; - -static struct resource vulcan_uart_resources[] = { - [0] = { - .start = IXP4XX_UART1_BASE_PHYS, - .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, - [2] = { - .flags = IORESOURCE_MEM, - }, -}; - -static struct plat_serial8250_port vulcan_uart_data[] = { - [0] = { - .mapbase = IXP4XX_UART1_BASE_PHYS, - .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - [1] = { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - [2] = { - .irq = IXP4XX_GPIO_IRQ(4), - .irqflags = IRQF_TRIGGER_LOW, - .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .uartclk = 1843200, - }, - [3] = { - .irq = IXP4XX_GPIO_IRQ(4), - .irqflags = IRQF_TRIGGER_LOW, - .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .uartclk = 1843200, - }, - { } -}; - -static struct platform_device vulcan_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = vulcan_uart_data, - }, - .resource = vulcan_uart_resources, - .num_resources = ARRAY_SIZE(vulcan_uart_resources), -}; - -static struct resource vulcan_npeb_resources[] = { - { - .start = IXP4XX_EthB_BASE_PHYS, - .end = IXP4XX_EthB_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource vulcan_npec_resources[] = { - { - .start = IXP4XX_EthC_BASE_PHYS, - .end = IXP4XX_EthC_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct eth_plat_info vulcan_plat_eth[] = { - [0] = { - .phy = 0, - .rxq = 3, - .txreadyq = 20, - }, - [1] = { - .phy = 1, - .rxq = 4, - .txreadyq = 21, - }, -}; - -static struct platform_device vulcan_eth[] = { - [0] = { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEB, - .dev = { - .platform_data = &vulcan_plat_eth[0], - }, - .num_resources = ARRAY_SIZE(vulcan_npeb_resources), - .resource = vulcan_npeb_resources, - }, - [1] = { - .name = "ixp4xx_eth", - .id = IXP4XX_ETH_NPEC, - .dev = { - .platform_data = &vulcan_plat_eth[1], - }, - .num_resources = ARRAY_SIZE(vulcan_npec_resources), - .resource = vulcan_npec_resources, - }, -}; - -static struct resource vulcan_max6369_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device vulcan_max6369 = { - .name = "max6369_wdt", - .id = -1, - .resource = &vulcan_max6369_resource, - .num_resources = 1, -}; - -static struct gpiod_lookup_table vulcan_w1_gpiod_table = { - .dev_id = "w1-gpio", - .table = { - GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", 14, NULL, 0, - GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - }, -}; - -static struct w1_gpio_platform_data vulcan_w1_gpio_pdata = { - /* Intentionally left blank */ -}; - -static struct platform_device vulcan_w1_gpio = { - .name = "w1-gpio", - .id = 0, - .dev = { - .platform_data = &vulcan_w1_gpio_pdata, - }, -}; - -static struct platform_device *vulcan_devices[] __initdata = { - &vulcan_uart, - &vulcan_flash, - &vulcan_sram, - &vulcan_max6369, - &vulcan_eth[0], - &vulcan_eth[1], - &vulcan_w1_gpio, -}; - -static void __init vulcan_init(void) -{ - ixp4xx_sys_init(); - - /* Flash is spread over both CS0 and CS1 */ - vulcan_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - vulcan_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; - *IXP4XX_EXP_CS0 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_STROBE_T(3) | - IXP4XX_EXP_BUS_SIZE(0xF) | - IXP4XX_EXP_BUS_BYTE_RD16 | - IXP4XX_EXP_BUS_WR_EN; - *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; - - /* SRAM on CS2, (256kB, 8bit, writable) */ - vulcan_sram_resource.start = IXP4XX_EXP_BUS_BASE(2); - vulcan_sram_resource.end = IXP4XX_EXP_BUS_BASE(2) + SZ_256K - 1; - *IXP4XX_EXP_CS2 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_STROBE_T(1) | - IXP4XX_EXP_BUS_HOLD_T(2) | - IXP4XX_EXP_BUS_SIZE(9) | - IXP4XX_EXP_BUS_SPLT_EN | - IXP4XX_EXP_BUS_WR_EN | - IXP4XX_EXP_BUS_BYTE_EN; - - /* XR16L2551 on CS3 (Moto style, 512 bytes, 8bits, writable) */ - vulcan_uart_resources[2].start = IXP4XX_EXP_BUS_BASE(3); - vulcan_uart_resources[2].end = IXP4XX_EXP_BUS_BASE(3) + 16 - 1; - vulcan_uart_data[2].mapbase = vulcan_uart_resources[2].start; - vulcan_uart_data[3].mapbase = vulcan_uart_data[2].mapbase + 8; - *IXP4XX_EXP_CS3 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_STROBE_T(3) | - IXP4XX_EXP_BUS_CYCLES(IXP4XX_EXP_BUS_CYCLES_MOTOROLA)| - IXP4XX_EXP_BUS_WR_EN | - IXP4XX_EXP_BUS_BYTE_EN; - - /* GPIOS on CS4 (512 bytes, 8bits, writable) */ - *IXP4XX_EXP_CS4 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_WR_EN | - IXP4XX_EXP_BUS_BYTE_EN; - - /* max6369 on CS5 (512 bytes, 8bits, writable) */ - vulcan_max6369_resource.start = IXP4XX_EXP_BUS_BASE(5); - vulcan_max6369_resource.end = IXP4XX_EXP_BUS_BASE(5); - *IXP4XX_EXP_CS5 = IXP4XX_EXP_BUS_CS_EN | - IXP4XX_EXP_BUS_WR_EN | - IXP4XX_EXP_BUS_BYTE_EN; - - gpiod_add_lookup_table(&vulcan_w1_gpiod_table); - platform_add_devices(vulcan_devices, ARRAY_SIZE(vulcan_devices)); -} - -MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan") - /* Maintainer: Marc Zyngier <maz@misterjones.org> */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = vulcan_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END diff --git a/arch/arm/mach-ixp4xx/wg302v2-pci.c b/arch/arm/mach-ixp4xx/wg302v2-pci.c deleted file mode 100644 index 1247e7c67bc0..000000000000 --- a/arch/arm/mach-ixp4xx/wg302v2-pci.c +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * arch/arch/mach-ixp4xx/wg302v2-pci.c - * - * PCI setup routines for the Netgear WG302 v2 and WAG302 v2 - * - * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org> - * - * based on coyote-pci.c: - * Copyright (C) 2002 Jungo Software Technologies. - * Copyright (C) 2003 MontaVista Software, Inc. - * - * Maintainer: Imre Kaloz <kaloz@openwrt.org> - */ - -#include <linux/kernel.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/irq.h> - -#include <asm/mach-types.h> -#include <mach/hardware.h> - -#include <asm/mach/pci.h> - -#include "irqs.h" - -void __init wg302v2_pci_preinit(void) -{ - irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); - irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); - - ixp4xx_pci_preinit(); -} - -static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - if (slot == 1) - return IRQ_IXP4XX_GPIO8; - else if (slot == 2) - return IRQ_IXP4XX_GPIO9; - else return -1; -} - -struct hw_pci wg302v2_pci __initdata = { - .nr_controllers = 1, - .ops = &ixp4xx_ops, - .preinit = wg302v2_pci_preinit, - .setup = ixp4xx_setup, - .map_irq = wg302v2_map_irq, -}; - -int __init wg302v2_pci_init(void) -{ - if (machine_is_wg302v2()) - pci_common_init(&wg302v2_pci); - return 0; -} - -subsys_initcall(wg302v2_pci_init); diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c deleted file mode 100644 index 8711e299229b..000000000000 --- a/arch/arm/mach-ixp4xx/wg302v2-setup.c +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/arm/mach-ixp4xx/wg302-setup.c - * - * Board setup for the Netgear WG302 v2 and WAG302 v2 - * - * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org> - * - * based on coyote-setup.c: - * Copyright (C) 2003-2005 MontaVista Software, Inc. - * - * Author: Imre Kaloz <kaloz@openwrt.org> - * - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> - -#include <asm/types.h> -#include <asm/setup.h> -#include <asm/memory.h> -#include <mach/hardware.h> -#include <asm/irq.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/flash.h> - -#include "irqs.h" - -static struct flash_platform_data wg302v2_flash_data = { - .map_name = "cfi_probe", - .width = 2, -}; - -static struct resource wg302v2_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device wg302v2_flash = { - .name = "IXP4XX-Flash", - .id = 0, - .dev = { - .platform_data = &wg302v2_flash_data, - }, - .num_resources = 1, - .resource = &wg302v2_flash_resource, -}; - -static struct resource wg302v2_uart_resource = { - .start = IXP4XX_UART2_BASE_PHYS, - .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, - .flags = IORESOURCE_MEM, -}; - -static struct plat_serial8250_port wg302v2_uart_data[] = { - { - .mapbase = IXP4XX_UART2_BASE_PHYS, - .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = IXP4XX_UART_XTAL, - }, - { }, -}; - -static struct platform_device wg302v2_uart = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = wg302v2_uart_data, - }, - .num_resources = 1, - .resource = &wg302v2_uart_resource, -}; - -static struct platform_device *wg302v2_devices[] __initdata = { - &wg302v2_flash, - &wg302v2_uart, -}; - -static void __init wg302v2_init(void) -{ - ixp4xx_sys_init(); - - wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); - wg302v2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; - - *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; - *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; - - platform_add_devices(wg302v2_devices, ARRAY_SIZE(wg302v2_devices)); -} - -#ifdef CONFIG_MACH_WG302V2 -MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2") - /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */ - .map_io = ixp4xx_map_io, - .init_early = ixp4xx_init_early, - .init_irq = ixp4xx_init_irq, - .init_time = ixp4xx_timer_init, - .atag_offset = 0x100, - .init_machine = wg302v2_init, -#if defined(CONFIG_PCI) - .dma_zone_size = SZ_64M, -#endif - .restart = ixp4xx_restart, -MACHINE_END -#endif |