From 76cb841cb886eef6b3bee341a2266c76578724ad Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:02:30 +0200 Subject: Adding upstream version 4.19.249. Signed-off-by: Daniel Baumann --- arch/arm/mach-footbridge/Kconfig | 98 +++ arch/arm/mach-footbridge/Makefile | 23 + arch/arm/mach-footbridge/Makefile.boot | 4 + arch/arm/mach-footbridge/cats-hw.c | 98 +++ arch/arm/mach-footbridge/cats-pci.c | 64 ++ arch/arm/mach-footbridge/common.c | 268 +++++++ arch/arm/mach-footbridge/common.h | 15 + arch/arm/mach-footbridge/dc21285-timer.c | 141 ++++ arch/arm/mach-footbridge/dc21285.c | 366 ++++++++++ arch/arm/mach-footbridge/dma.c | 58 ++ arch/arm/mach-footbridge/ebsa285-pci.c | 48 ++ arch/arm/mach-footbridge/ebsa285.c | 124 ++++ .../arm/mach-footbridge/include/mach/entry-macro.S | 107 +++ arch/arm/mach-footbridge/include/mach/hardware.h | 99 +++ arch/arm/mach-footbridge/include/mach/io.h | 23 + arch/arm/mach-footbridge/include/mach/irqs.h | 97 +++ arch/arm/mach-footbridge/include/mach/isa-dma.h | 26 + arch/arm/mach-footbridge/include/mach/memory.h | 64 ++ arch/arm/mach-footbridge/include/mach/uncompress.h | 37 + arch/arm/mach-footbridge/isa-irq.c | 182 +++++ arch/arm/mach-footbridge/isa-rtc.c | 58 ++ arch/arm/mach-footbridge/isa-timer.c | 41 ++ arch/arm/mach-footbridge/isa.c | 101 +++ arch/arm/mach-footbridge/netwinder-hw.c | 772 +++++++++++++++++++++ arch/arm/mach-footbridge/netwinder-pci.c | 62 ++ arch/arm/mach-footbridge/personal-pci.c | 57 ++ arch/arm/mach-footbridge/personal.c | 25 + 27 files changed, 3058 insertions(+) create mode 100644 arch/arm/mach-footbridge/Kconfig create mode 100644 arch/arm/mach-footbridge/Makefile create mode 100644 arch/arm/mach-footbridge/Makefile.boot create mode 100644 arch/arm/mach-footbridge/cats-hw.c create mode 100644 arch/arm/mach-footbridge/cats-pci.c create mode 100644 arch/arm/mach-footbridge/common.c create mode 100644 arch/arm/mach-footbridge/common.h create mode 100644 arch/arm/mach-footbridge/dc21285-timer.c create mode 100644 arch/arm/mach-footbridge/dc21285.c create mode 100644 arch/arm/mach-footbridge/dma.c create mode 100644 arch/arm/mach-footbridge/ebsa285-pci.c create mode 100644 arch/arm/mach-footbridge/ebsa285.c create mode 100644 arch/arm/mach-footbridge/include/mach/entry-macro.S create mode 100644 arch/arm/mach-footbridge/include/mach/hardware.h create mode 100644 arch/arm/mach-footbridge/include/mach/io.h create mode 100644 arch/arm/mach-footbridge/include/mach/irqs.h create mode 100644 arch/arm/mach-footbridge/include/mach/isa-dma.h create mode 100644 arch/arm/mach-footbridge/include/mach/memory.h create mode 100644 arch/arm/mach-footbridge/include/mach/uncompress.h create mode 100644 arch/arm/mach-footbridge/isa-irq.c create mode 100644 arch/arm/mach-footbridge/isa-rtc.c create mode 100644 arch/arm/mach-footbridge/isa-timer.c create mode 100644 arch/arm/mach-footbridge/isa.c create mode 100644 arch/arm/mach-footbridge/netwinder-hw.c create mode 100644 arch/arm/mach-footbridge/netwinder-pci.c create mode 100644 arch/arm/mach-footbridge/personal-pci.c create mode 100644 arch/arm/mach-footbridge/personal.c (limited to 'arch/arm/mach-footbridge') diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig new file mode 100644 index 000000000..cbbdd84cf --- /dev/null +++ b/arch/arm/mach-footbridge/Kconfig @@ -0,0 +1,98 @@ +if ARCH_FOOTBRIDGE + +menu "Footbridge Implementations" + +config ARCH_CATS + bool "CATS" + select CLKEVT_I8253 + select CLKSRC_I8253 + select FOOTBRIDGE_HOST + select ISA + select ISA_DMA + select PCI + help + Say Y here if you intend to run this kernel on the CATS. + + Saying N will reduce the size of the Footbridge kernel. + +config ARCH_PERSONAL_SERVER + bool "Compaq Personal Server" + select FOOTBRIDGE_HOST + select ISA + select ISA_DMA + select PCI + ---help--- + Say Y here if you intend to run this kernel on the Compaq + Personal Server. + + Saying N will reduce the size of the Footbridge kernel. + + The Compaq Personal Server is not available for purchase. + There are no product plans beyond the current research + prototypes at this time. Information is available at: + + + + If you have any questions or comments about the Compaq Personal + Server, send e-mail to . + +config ARCH_EBSA285_ADDIN + bool "EBSA285 (addin mode)" + select ARCH_EBSA285 + select FOOTBRIDGE_ADDIN + help + Say Y here if you intend to run this kernel on the EBSA285 card + in addin mode. + + Saying N will reduce the size of the Footbridge kernel. + +config ARCH_EBSA285_HOST + bool "EBSA285 (host mode)" + select ARCH_EBSA285 + select FOOTBRIDGE_HOST + select ISA + select ISA_DMA + select ARCH_MAY_HAVE_PC_FDC + select PCI + help + Say Y here if you intend to run this kernel on the EBSA285 card + in host ("central function") mode. + + Saying N will reduce the size of the Footbridge kernel. + +config ARCH_NETWINDER + bool "NetWinder" + select CLKEVT_I8253 + select CLKSRC_I8253 + select FOOTBRIDGE_HOST + select ISA + select ISA_DMA + select PCI + help + Say Y here if you intend to run this kernel on the Rebel.COM + NetWinder. Information about this machine can be found at: + + + + Saying N will reduce the size of the Footbridge kernel. + +endmenu + +# Footbridge support +config FOOTBRIDGE + bool + +# Footbridge in host mode +config FOOTBRIDGE_HOST + bool + select ARCH_MIGHT_HAVE_PC_SERIO + +# Footbridge in addin mode +config FOOTBRIDGE_ADDIN + bool + +# EBSA285 board in either host or addin mode +config ARCH_EBSA285 + bool + +endif diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile new file mode 100644 index 000000000..a09f1041f --- /dev/null +++ b/arch/arm/mach-footbridge/Makefile @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the linux kernel. +# + +# Object file lists. + +obj-y := common.o dma.o isa-irq.o + +pci-y += dc21285.o +pci-$(CONFIG_ARCH_CATS) += cats-pci.o +pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o +pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o +pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o + +obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o +obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o +obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o +obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o + +obj-$(CONFIG_PCI) +=$(pci-y) + +obj-$(CONFIG_ISA) += isa.o isa-rtc.o diff --git a/arch/arm/mach-footbridge/Makefile.boot b/arch/arm/mach-footbridge/Makefile.boot new file mode 100644 index 000000000..ff0a4b5b0 --- /dev/null +++ b/arch/arm/mach-footbridge/Makefile.boot @@ -0,0 +1,4 @@ + zreladdr-y += 0x00008000 +params_phys-y := 0x00000100 +initrd_phys-y := 0x00800000 + diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c new file mode 100644 index 000000000..e575dc069 --- /dev/null +++ b/arch/arm/mach-footbridge/cats-hw.c @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * linux/arch/arm/mach-footbridge/cats-hw.c + * + * CATS machine fixup + * + * Copyright (C) 1998, 1999 Russell King, Phil Blundell + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "common.h" + +#define CFG_PORT 0x370 +#define INDEX_PORT (CFG_PORT) +#define DATA_PORT (CFG_PORT + 1) + +static int __init cats_hw_init(void) +{ + if (machine_is_cats()) { + /* Set Aladdin to CONFIGURE mode */ + outb(0x51, CFG_PORT); + outb(0x23, CFG_PORT); + + /* Select logical device 3 */ + outb(0x07, INDEX_PORT); + outb(0x03, DATA_PORT); + + /* Set parallel port to DMA channel 3, ECP+EPP1.9, + enable EPP timeout */ + outb(0x74, INDEX_PORT); + outb(0x03, DATA_PORT); + + outb(0xf0, INDEX_PORT); + outb(0x0f, DATA_PORT); + + outb(0xf1, INDEX_PORT); + outb(0x07, DATA_PORT); + + /* Select logical device 4 */ + outb(0x07, INDEX_PORT); + outb(0x04, DATA_PORT); + + /* UART1 high speed mode */ + outb(0xf0, INDEX_PORT); + outb(0x02, DATA_PORT); + + /* Select logical device 5 */ + outb(0x07, INDEX_PORT); + outb(0x05, DATA_PORT); + + /* UART2 high speed mode */ + outb(0xf0, INDEX_PORT); + outb(0x02, DATA_PORT); + + /* Set Aladdin to RUN mode */ + outb(0xbb, CFG_PORT); + } + + return 0; +} + +__initcall(cats_hw_init); + +/* + * CATS uses soft-reboot by default, since + * hard reboots fail on early boards. + */ +static void __init +fixup_cats(struct tag *tags, char **cmdline) +{ +#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) + screen_info.orig_video_lines = 25; + screen_info.orig_video_points = 16; + screen_info.orig_y = 24; +#endif +} + +MACHINE_START(CATS, "Chalice-CATS") + /* Maintainer: Philip Blundell */ + .atag_offset = 0x100, + .reboot_mode = REBOOT_SOFT, + .fixup = fixup_cats, + .map_io = footbridge_map_io, + .init_irq = footbridge_init_irq, + .init_time = isa_timer_init, + .restart = footbridge_restart, +MACHINE_END diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c new file mode 100644 index 000000000..90b1e9be4 --- /dev/null +++ b/arch/arm/mach-footbridge/cats-pci.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * linux/arch/arm/mach-footbridge/cats-pci.c + * + * PCI bios-type initialisation for PCI machines + * + * Bits taken from various places. + */ +#include +#include +#include + +#include +#include +#include + +/* cats host-specific stuff */ +static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; + +static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) +{ + return 0; +} + +static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) +{ + if (dev->irq >= 255) + return -1; /* not a valid interrupt. */ + + if (dev->irq >= 128) + return dev->irq & 0x1f; + + if (dev->irq >= 1 && dev->irq <= 4) + return irqmap_cats[dev->irq - 1]; + + if (dev->irq != 0) + printk("PCI: device %02x:%02x has unknown irq line %x\n", + dev->bus->number, dev->devfn, dev->irq); + + return -1; +} + +/* + * why not the standard PCI swizzle? does this prevent 4-port tulip + * cards being used (ie, pci-pci bridge based cards)? + */ +static struct hw_pci cats_pci __initdata = { + .swizzle = cats_no_swizzle, + .map_irq = cats_map_irq, + .nr_controllers = 1, + .ops = &dc21285_ops, + .setup = dc21285_setup, + .preinit = dc21285_preinit, + .postinit = dc21285_postinit, +}; + +static int __init cats_pci_init(void) +{ + if (machine_is_cats()) + pci_common_init(&cats_pci); + return 0; +} + +subsys_initcall(cats_pci_init); diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c new file mode 100644 index 000000000..0f0c9e040 --- /dev/null +++ b/arch/arm/mach-footbridge/common.c @@ -0,0 +1,268 @@ +/* + * linux/arch/arm/mach-footbridge/common.c + * + * Copyright (C) 1998-2000 Russell King, Dave Gilbert. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include