From 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 Mon Sep 17 00:00:00 2001 From: Yunhong Jiang Date: Tue, 4 Aug 2015 12:17:53 -0700 Subject: Add the rt linux 4.1.3-rt3 as base Import the rt linux 4.1.3-rt3 as OPNFV kvm base. It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and the base is: commit 0917f823c59692d751951bf5ea699a2d1e2f26a2 Author: Sebastian Andrzej Siewior Date: Sat Jul 25 12:13:34 2015 +0200 Prepare v4.1.3-rt3 Signed-off-by: Sebastian Andrzej Siewior We lose all the git history this way and it's not good. We should apply another opnfv project repo in future. Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423 Signed-off-by: Yunhong Jiang --- kernel/arch/arm/mach-footbridge/Kconfig | 99 +++ kernel/arch/arm/mach-footbridge/Makefile | 22 + kernel/arch/arm/mach-footbridge/Makefile.boot | 4 + kernel/arch/arm/mach-footbridge/cats-hw.c | 97 +++ kernel/arch/arm/mach-footbridge/cats-pci.c | 63 ++ kernel/arch/arm/mach-footbridge/common.c | 268 +++++++ kernel/arch/arm/mach-footbridge/common.h | 14 + kernel/arch/arm/mach-footbridge/dc21285-timer.c | 142 ++++ kernel/arch/arm/mach-footbridge/dc21285.c | 376 ++++++++++ kernel/arch/arm/mach-footbridge/dma.c | 57 ++ kernel/arch/arm/mach-footbridge/ebsa285-pci.c | 47 ++ kernel/arch/arm/mach-footbridge/ebsa285.c | 123 ++++ .../arm/mach-footbridge/include/mach/debug-macro.S | 42 ++ .../arm/mach-footbridge/include/mach/entry-macro.S | 107 +++ .../arm/mach-footbridge/include/mach/hardware.h | 99 +++ kernel/arch/arm/mach-footbridge/include/mach/io.h | 23 + .../arch/arm/mach-footbridge/include/mach/irqs.h | 96 +++ .../arm/mach-footbridge/include/mach/isa-dma.h | 25 + .../arch/arm/mach-footbridge/include/mach/memory.h | 64 ++ .../arm/mach-footbridge/include/mach/uncompress.h | 37 + kernel/arch/arm/mach-footbridge/isa-irq.c | 183 +++++ kernel/arch/arm/mach-footbridge/isa-rtc.c | 57 ++ kernel/arch/arm/mach-footbridge/isa-timer.c | 40 ++ kernel/arch/arm/mach-footbridge/isa.c | 101 +++ kernel/arch/arm/mach-footbridge/netwinder-hw.c | 771 +++++++++++++++++++++ kernel/arch/arm/mach-footbridge/netwinder-pci.c | 61 ++ kernel/arch/arm/mach-footbridge/personal-pci.c | 57 ++ kernel/arch/arm/mach-footbridge/personal.c | 24 + 28 files changed, 3099 insertions(+) create mode 100644 kernel/arch/arm/mach-footbridge/Kconfig create mode 100644 kernel/arch/arm/mach-footbridge/Makefile create mode 100644 kernel/arch/arm/mach-footbridge/Makefile.boot create mode 100644 kernel/arch/arm/mach-footbridge/cats-hw.c create mode 100644 kernel/arch/arm/mach-footbridge/cats-pci.c create mode 100644 kernel/arch/arm/mach-footbridge/common.c create mode 100644 kernel/arch/arm/mach-footbridge/common.h create mode 100644 kernel/arch/arm/mach-footbridge/dc21285-timer.c create mode 100644 kernel/arch/arm/mach-footbridge/dc21285.c create mode 100644 kernel/arch/arm/mach-footbridge/dma.c create mode 100644 kernel/arch/arm/mach-footbridge/ebsa285-pci.c create mode 100644 kernel/arch/arm/mach-footbridge/ebsa285.c create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/debug-macro.S create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/entry-macro.S create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/hardware.h create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/io.h create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/irqs.h create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/isa-dma.h create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/memory.h create mode 100644 kernel/arch/arm/mach-footbridge/include/mach/uncompress.h create mode 100644 kernel/arch/arm/mach-footbridge/isa-irq.c create mode 100644 kernel/arch/arm/mach-footbridge/isa-rtc.c create mode 100644 kernel/arch/arm/mach-footbridge/isa-timer.c create mode 100644 kernel/arch/arm/mach-footbridge/isa.c create mode 100644 kernel/arch/arm/mach-footbridge/netwinder-hw.c create mode 100644 kernel/arch/arm/mach-footbridge/netwinder-pci.c create mode 100644 kernel/arch/arm/mach-footbridge/personal-pci.c create mode 100644 kernel/arch/arm/mach-footbridge/personal.c (limited to 'kernel/arch/arm/mach-footbridge') diff --git a/kernel/arch/arm/mach-footbridge/Kconfig b/kernel/arch/arm/mach-footbridge/Kconfig new file mode 100644 index 000000000..07152d00f --- /dev/null +++ b/kernel/arch/arm/mach-footbridge/Kconfig @@ -0,0 +1,99 @@ +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 + 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 + 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/kernel/arch/arm/mach-footbridge/Makefile b/kernel/arch/arm/mach-footbridge/Makefile new file mode 100644 index 000000000..e83d5c839 --- /dev/null +++ b/kernel/arch/arm/mach-footbridge/Makefile @@ -0,0 +1,22 @@ +# +# 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/kernel/arch/arm/mach-footbridge/Makefile.boot b/kernel/arch/arm/mach-footbridge/Makefile.boot new file mode 100644 index 000000000..ff0a4b5b0 --- /dev/null +++ b/kernel/arch/arm/mach-footbridge/Makefile.boot @@ -0,0 +1,4 @@ + zreladdr-y += 0x00008000 +params_phys-y := 0x00000100 +initrd_phys-y := 0x00800000 + diff --git a/kernel/arch/arm/mach-footbridge/cats-hw.c b/kernel/arch/arm/mach-footbridge/cats-hw.c new file mode 100644 index 000000000..8f0548967 --- /dev/null +++ b/kernel/arch/arm/mach-footbridge/cats-hw.c @@ -0,0 +1,97 @@ +/* + * 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/kernel/arch/arm/mach-footbridge/cats-pci.c b/kernel/arch/arm/mach-footbridge/cats-pci.c new file mode 100644 index 000000000..5cec2567c --- /dev/null +++ b/kernel/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/kernel/arch/arm/mach-footbridge/common.c b/kernel/arch/arm/mach-footbridge/common.c new file mode 100644 index 000000000..9e8220e38 --- /dev/null +++ b/kernel/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