From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Wed, 30 Aug 2017 08:25:59 +0000
Subject: Initial file dump from open source release
---
arch/arm/mach-footbridge/Kconfig | 98 +++
arch/arm/mach-footbridge/Makefile | 24 +
arch/arm/mach-footbridge/Makefile.boot | 4 +
arch/arm/mach-footbridge/cats-hw.c | 95 +++
arch/arm/mach-footbridge/cats-pci.c | 63 ++
arch/arm/mach-footbridge/common.c | 273 ++++++++
arch/arm/mach-footbridge/common.h | 11 +
arch/arm/mach-footbridge/dc21285-timer.c | 107 +++
arch/arm/mach-footbridge/dc21285.c | 376 ++++++++++
arch/arm/mach-footbridge/dma.c | 57 ++
arch/arm/mach-footbridge/ebsa285-pci.c | 47 ++
arch/arm/mach-footbridge/ebsa285.c | 111 +++
.../arm/mach-footbridge/include/mach/debug-macro.S | 57 ++
.../arm/mach-footbridge/include/mach/entry-macro.S | 107 +++
arch/arm/mach-footbridge/include/mach/hardware.h | 103 +++
arch/arm/mach-footbridge/include/mach/io.h | 23 +
arch/arm/mach-footbridge/include/mach/irqs.h | 96 +++
arch/arm/mach-footbridge/include/mach/isa-dma.h | 25 +
arch/arm/mach-footbridge/include/mach/memory.h | 69 ++
arch/arm/mach-footbridge/include/mach/timex.h | 18 +
arch/arm/mach-footbridge/include/mach/uncompress.h | 37 +
arch/arm/mach-footbridge/isa-irq.c | 183 +++++
arch/arm/mach-footbridge/isa-rtc.c | 57 ++
arch/arm/mach-footbridge/isa-timer.c | 40 ++
arch/arm/mach-footbridge/isa.c | 101 +++
arch/arm/mach-footbridge/netwinder-hw.c | 771 +++++++++++++++++++++
arch/arm/mach-footbridge/netwinder-pci.c | 61 ++
arch/arm/mach-footbridge/personal-pci.c | 57 ++
arch/arm/mach-footbridge/personal.c | 24 +
29 files changed, 3095 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/debug-macro.S
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/timex.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 00000000..0f2111a1
--- /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 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
+ select VIRT_TO_BUS
+ 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
+
+# Footbridge in addin mode
+config FOOTBRIDGE_ADDIN
+ bool
+
+# EBSA285 board in either host or addin mode
+config ARCH_EBSA285
+ bool
+ select ARCH_MAY_HAVE_PC_FDC
+
+endif
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile
new file mode 100644
index 00000000..0b64dd43
--- /dev/null
+++ b/arch/arm/mach-footbridge/Makefile
@@ -0,0 +1,24 @@
+#
+# Makefile for the linux kernel.
+#
+
+# Object file lists.
+
+obj-y := common.o dc21285.o dma.o isa-irq.o
+obj-m :=
+obj-n :=
+obj- :=
+
+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 00000000..ff0a4b5b
--- /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 00000000..6987a09e
--- /dev/null
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -0,0 +1,95 @@
+/*
+ * 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, struct meminfo *mi)
+{
+ screen_info.orig_video_lines = 25;
+ screen_info.orig_video_points = 16;
+ screen_info.orig_y = 24;
+}
+
+MACHINE_START(CATS, "Chalice-CATS")
+ /* Maintainer: Philip Blundell */
+ .atag_offset = 0x100,
+ .restart_mode = 's',
+ .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 00000000..5cec2567
--- /dev/null
+++ b/arch/arm/mach-footbridge/cats-pci.c
@@ -0,0 +1,63 @@
+/*
+ * 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[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
+
+static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin)
+{
+ return 0;
+}
+
+static int __init 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 00000000..95d0b6e6
--- /dev/null
+++ b/arch/arm/mach-footbridge/common.c
@@ -0,0 +1,273 @@
+/*
+ * 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