summaryrefslogtreecommitdiffstats
path: root/target/linux/gemini
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/gemini')
-rw-r--r--target/linux/gemini/Makefile6
-rw-r--r--target/linux/gemini/config-default (renamed from target/linux/gemini/config-3.3)38
-rw-r--r--target/linux/gemini/patches-3.3/001-gemini-fix-gpio_set_irq_type.patch11
-rw-r--r--target/linux/gemini/patches/000-ARM-gemini-get-platform-to-build-again.patch348
-rw-r--r--target/linux/gemini/patches/002-arm-gemini-fix-platform_register_rtc-prototype.patch (renamed from target/linux/gemini/patches-3.3/002-arm-gemini-fix-platform_register_rtc-prototype.patch)0
-rw-r--r--target/linux/gemini/patches/110-watchdog-add-gemini_wdt-driver.patch (renamed from target/linux/gemini/patches-3.3/110-watchdog-add-gemini_wdt-driver.patch)16
-rw-r--r--target/linux/gemini/patches/111-arm-gemini-add-watchdog-device.patch (renamed from target/linux/gemini/patches-3.3/111-arm-gemini-add-watchdog-device.patch)5
-rw-r--r--target/linux/gemini/patches/112-arm-gemini-register-watchdog-devices.patch (renamed from target/linux/gemini/patches-3.3/112-arm-gemini-register-watchdog-devices.patch)8
-rw-r--r--target/linux/gemini/patches/120-net-add-gemini-gmac-driver.patch (renamed from target/linux/gemini/patches-3.3/120-net-add-gemini-gmac-driver.patch)105
-rw-r--r--target/linux/gemini/patches/121-arm-gemini-add-ethernet-device.patch (renamed from target/linux/gemini/patches-3.3/121-arm-gemini-add-ethernet-device.patch)5
-rw-r--r--target/linux/gemini/patches/122-arm-gemini-wbd111-register-ethernet.patch (renamed from target/linux/gemini/patches-3.3/122-arm-gemini-wbd111-register-ethernet.patch)2
-rw-r--r--target/linux/gemini/patches/123-arm-gemini-wbd222-register-eth.patch (renamed from target/linux/gemini/patches-3.3/123-arm-gemini-wbd222-register-eth.patch)2
-rw-r--r--target/linux/gemini/patches/124-arm-gemini-rut100-register-ethernet.patch (renamed from target/linux/gemini/patches-3.3/124-arm-gemini-rut100-register-ethernet.patch)6
-rw-r--r--target/linux/gemini/patches/130-usb-ehci-gemini-fot2gxx-support.patch (renamed from target/linux/gemini/patches-3.3/130-usb-ehci-gemini-fot2gxx-support.patch)100
-rw-r--r--target/linux/gemini/patches/131-arm-gemini-add-usb-platform-device.patch (renamed from target/linux/gemini/patches-3.3/131-arm-gemini-add-usb-platform-device.patch)5
-rw-r--r--target/linux/gemini/patches/132-arm-gemini-wbd111-register-usb.patch (renamed from target/linux/gemini/patches-3.3/132-arm-gemini-wbd111-register-usb.patch)4
-rw-r--r--target/linux/gemini/patches/133-arm-gemini-wbd222-register-usb.patch (renamed from target/linux/gemini/patches-3.3/133-arm-gemini-wbd222-register-usb.patch)2
-rw-r--r--target/linux/gemini/patches/134-arm-gemini-rut100-register-usb.patch (renamed from target/linux/gemini/patches-3.3/134-arm-gemini-rut100-register-usb.patch)2
-rw-r--r--target/linux/gemini/patches/135-arm-gemini-nas4220-register-usb.patch (renamed from target/linux/gemini/patches-3.3/135-arm-gemini-nas4220-register-usb.patch)2
-rw-r--r--target/linux/gemini/patches/140-arm-gemini-add-pci-support.patch (renamed from target/linux/gemini/patches-3.3/140-arm-gemini-add-pci-support.patch)21
20 files changed, 528 insertions, 160 deletions
diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile
index 2f87e99ce..f26f7bfde 100644
--- a/target/linux/gemini/Makefile
+++ b/target/linux/gemini/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009-2011 OpenWrt.org
+# Copyright (C) 2009-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=gemini
BOARDNAME:=Cortina Systems CS351x
-FEATURES:=squashfs broken
+FEATURES:=squashfs pci
CFLAGS:=-Os -pipe -march=armv4 -mtune=fa526 -fno-caller-saves
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
-LINUX_VERSION:=3.3.8
+LINUX_VERSION:=3.9.3
include $(INCLUDE_DIR)/target.mk
diff --git a/target/linux/gemini/config-3.3 b/target/linux/gemini/config-default
index ce6485015..3f9d8fe8e 100644
--- a/target/linux/gemini/config-3.3
+++ b/target/linux/gemini/config-default
@@ -1,12 +1,16 @@
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_ARCH_GEMINI=y
-CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
CONFIG_ARCH_NR_GPIO=0
CONFIG_ARCH_REQUIRE_GPIOLIB=y
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
CONFIG_ARCH_USES_GETTIMEOFFSET=y
+# CONFIG_ARCH_VT8500_SINGLE is not set
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_ARM=y
# CONFIG_ARM_CPU_SUSPEND is not set
CONFIG_ARM_L1_CACHE_SHIFT=5
@@ -14,9 +18,10 @@ CONFIG_ARM_NR_BANKS=8
CONFIG_ARM_PATCH_PHYS_VIRT=y
# CONFIG_ARPD is not set
CONFIG_ATA=m
-CONFIG_BCMA_POSSIBLE=y
+CONFIG_ATAGS=y
# CONFIG_CACHE_L2X0 is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,19200 mem=32M"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_CPU_32v4=y
@@ -33,6 +38,7 @@ CONFIG_CPU_FA526=y
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_TLB_FA=y
CONFIG_CPU_USE_DOMAINS=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
# CONFIG_DEBUG_USER is not set
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DLCI=m
@@ -48,8 +54,12 @@ CONFIG_GEMINI_WATCHDOG=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_IO=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
# CONFIG_HAMRADIO is not set
@@ -58,10 +68,17 @@ CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAVE_AOUT=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_BPF_JIT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -76,11 +93,13 @@ CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_UID16=y
CONFIG_HDLC=m
CONFIG_HDLC_CISCO=m
CONFIG_HDLC_FR=m
@@ -98,22 +117,24 @@ CONFIG_IP_PIMSM_V2=y
CONFIG_KTIME_SCALAR=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
-CONFIG_MACH_NAS4220B=y
-CONFIG_MACH_RUT100=y
+# CONFIG_MACH_NAS4220B is not set
+# CONFIG_MACH_RUT100 is not set
CONFIG_MACH_WBD111=y
CONFIG_MACH_WBD222=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BOARDINFO=y
CONFIG_MDIO_GPIO=y
CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_REDBOOT_PARTS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NLS=m
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PCI=y
+CONFIG_PERCPU_RWSEM=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PHYLIB=y
# CONFIG_PREEMPT_RCU is not set
@@ -122,7 +143,9 @@ CONFIG_SCSI_MOD=m
# CONFIG_SCSI_MULTI_LUN is not set
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_UID16=y
+CONFIG_UIDGID_CONVERTED=y
CONFIG_USB=m
CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB_COMMON=m
@@ -132,7 +155,8 @@ CONFIG_USB_SUPPORT=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_WAN=y
-CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_BCJ=y
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/gemini/patches-3.3/001-gemini-fix-gpio_set_irq_type.patch b/target/linux/gemini/patches-3.3/001-gemini-fix-gpio_set_irq_type.patch
deleted file mode 100644
index 0dd9ea6bf..000000000
--- a/target/linux/gemini/patches-3.3/001-gemini-fix-gpio_set_irq_type.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm/mach-gemini/gpio.c
-+++ b/arch/arm/mach-gemini/gpio.c
-@@ -120,7 +120,7 @@ static int gpio_set_irq_type(struct irq_
- __raw_writel(reg_level, base + GPIO_INT_LEVEL);
- __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
-
-- gpio_ack_irq(d->irq);
-+ gpio_ack_irq(d);
-
- return 0;
- }
diff --git a/target/linux/gemini/patches/000-ARM-gemini-get-platform-to-build-again.patch b/target/linux/gemini/patches/000-ARM-gemini-get-platform-to-build-again.patch
new file mode 100644
index 000000000..25ed5f260
--- /dev/null
+++ b/target/linux/gemini/patches/000-ARM-gemini-get-platform-to-build-again.patch
@@ -0,0 +1,348 @@
+From patchwork Fri Jan 4 15:30:38 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [RFC,1/3] ARM: gemini: get platform to build again
+Date: Fri, 04 Jan 2013 15:30:38 -0000
+From: Arnd Bergmann <arnd@arndb.de>
+X-Patchwork-Id: 1933501
+Message-Id: <1357313440-20092-1-git-send-email-arnd@arndb.de>
+To: Hans Ulli Kroll <ulli.kroll@googlemail.com>
+Cc: Russell King <rmk+kernel@arm.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
+ Florian Fainelli <florian@openwrt.org>,
+ linux-arm-kernel@lists.infradead.org
+
+There is no defconfig file for gemini, which has lead to a lot
+of bitrot. This makes the broken board files, the gpio implementation
+and the reset logic work again, and fixes the build warnings
+that got introduced with the changes to the readl/writel prototypes.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+
+---
+(retransmitted because the original was rejected by linux-arm-kernel)
+
+ arch/arm/Kconfig | 1 +
+ arch/arm/mach-gemini/Makefile | 2 +-
+ arch/arm/mach-gemini/board-nas4220b.c | 1 +
+ arch/arm/mach-gemini/board-rut1xx.c | 2 ++
+ arch/arm/mach-gemini/board-wbd111.c | 1 +
+ arch/arm/mach-gemini/board-wbd222.c | 1 +
+ arch/arm/mach-gemini/common.h | 2 ++
+ arch/arm/mach-gemini/gpio.c | 19 ++++++++++---------
+ arch/arm/mach-gemini/include/mach/hardware.h | 2 +-
+ arch/arm/mach-gemini/include/mach/system.h | 23 -----------------------
+ arch/arm/mach-gemini/irq.c | 4 ++--
+ arch/arm/mach-gemini/mm.c | 22 +++++++++++-----------
+ arch/arm/mach-gemini/reset.c | 23 +++++++++++++++++++++++
+ 13 files changed, 56 insertions(+), 47 deletions(-)
+ delete mode 100644 arch/arm/mach-gemini/include/mach/system.h
+ create mode 100644 arch/arm/mach-gemini/reset.c
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -410,6 +410,7 @@ config ARCH_GEMINI
+ bool "Cortina Systems Gemini"
+ select ARCH_REQUIRE_GPIOLIB
+ select ARCH_USES_GETTIMEOFFSET
++ select NEED_MACH_GPIO_H
+ select CPU_FA526
+ help
+ Support for the Cortina Systems Gemini family SoCs
+--- a/arch/arm/mach-gemini/Makefile
++++ b/arch/arm/mach-gemini/Makefile
+@@ -4,7 +4,7 @@
+
+ # Object file lists.
+
+-obj-y := irq.o mm.o time.o devices.o gpio.o idle.o
++obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
+
+ # Board-specific support
+ obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o
+--- a/arch/arm/mach-gemini/board-nas4220b.c
++++ b/arch/arm/mach-gemini/board-nas4220b.c
+@@ -103,4 +103,5 @@ MACHINE_START(NAS4220B, "Raidsonic NAS I
+ .init_irq = gemini_init_irq,
+ .init_time = gemini_timer_init,
+ .init_machine = ib4220b_init,
++ .restart = gemini_restart,
+ MACHINE_END
+--- a/arch/arm/mach-gemini/board-rut1xx.c
++++ b/arch/arm/mach-gemini/board-rut1xx.c
+@@ -14,6 +14,7 @@
+ #include <linux/leds.h>
+ #include <linux/input.h>
+ #include <linux/gpio_keys.h>
++#include <linux/sizes.h>
+
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+@@ -87,4 +88,5 @@ MACHINE_START(RUT100, "Teltonika RUT100"
+ .init_irq = gemini_init_irq,
+ .init_time = gemini_timer_init,
+ .init_machine = rut1xx_init,
++ .restart = gemini_restart,
+ MACHINE_END
+--- a/arch/arm/mach-gemini/board-wbd111.c
++++ b/arch/arm/mach-gemini/board-wbd111.c
+@@ -130,4 +130,5 @@ MACHINE_START(WBD111, "Wiliboard WBD-111
+ .init_irq = gemini_init_irq,
+ .init_time = gemini_timer_init,
+ .init_machine = wbd111_init,
++ .restart = gemini_restart,
+ MACHINE_END
+--- a/arch/arm/mach-gemini/board-wbd222.c
++++ b/arch/arm/mach-gemini/board-wbd222.c
+@@ -130,4 +130,5 @@ MACHINE_START(WBD222, "Wiliboard WBD-222
+ .init_irq = gemini_init_irq,
+ .init_time = gemini_timer_init,
+ .init_machine = wbd222_init,
++ .restart = gemini_restart,
+ MACHINE_END
+--- a/arch/arm/mach-gemini/common.h
++++ b/arch/arm/mach-gemini/common.h
+@@ -26,4 +26,6 @@ extern int platform_register_pflash(unsi
+ struct mtd_partition *parts,
+ unsigned int nr_parts);
+
++extern void gemini_restart(char mode, const char *cmd);
++
+ #endif /* __GEMINI_COMMON_H__ */
+--- a/arch/arm/mach-gemini/gpio.c
++++ b/arch/arm/mach-gemini/gpio.c
+@@ -21,6 +21,7 @@
+
+ #include <mach/hardware.h>
+ #include <mach/irqs.h>
++#include <mach/gpio.h>
+
+ #define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x))
+
+@@ -44,7 +45,7 @@
+
+ #define GPIO_PORT_NUM 3
+
+-static void _set_gpio_irqenable(unsigned int base, unsigned int index,
++static void _set_gpio_irqenable(void __iomem *base, unsigned int index,
+ int enable)
+ {
+ unsigned int reg;
+@@ -57,7 +58,7 @@ static void _set_gpio_irqenable(unsigned
+ static void gpio_ack_irq(struct irq_data *d)
+ {
+ unsigned int gpio = irq_to_gpio(d->irq);
+- unsigned int base = GPIO_BASE(gpio / 32);
++ void __iomem *base = GPIO_BASE(gpio / 32);
+
+ __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR);
+ }
+@@ -65,7 +66,7 @@ static void gpio_ack_irq(struct irq_data
+ static void gpio_mask_irq(struct irq_data *d)
+ {
+ unsigned int gpio = irq_to_gpio(d->irq);
+- unsigned int base = GPIO_BASE(gpio / 32);
++ void __iomem *base = GPIO_BASE(gpio / 32);
+
+ _set_gpio_irqenable(base, gpio % 32, 0);
+ }
+@@ -73,7 +74,7 @@ static void gpio_mask_irq(struct irq_dat
+ static void gpio_unmask_irq(struct irq_data *d)
+ {
+ unsigned int gpio = irq_to_gpio(d->irq);
+- unsigned int base = GPIO_BASE(gpio / 32);
++ void __iomem *base = GPIO_BASE(gpio / 32);
+
+ _set_gpio_irqenable(base, gpio % 32, 1);
+ }
+@@ -82,7 +83,7 @@ static int gpio_set_irq_type(struct irq_
+ {
+ unsigned int gpio = irq_to_gpio(d->irq);
+ unsigned int gpio_mask = 1 << (gpio % 32);
+- unsigned int base = GPIO_BASE(gpio / 32);
++ void __iomem *base = GPIO_BASE(gpio / 32);
+ unsigned int reg_both, reg_level, reg_type;
+
+ reg_type = __raw_readl(base + GPIO_INT_TYPE);
+@@ -120,7 +121,7 @@ static int gpio_set_irq_type(struct irq_
+ __raw_writel(reg_level, base + GPIO_INT_LEVEL);
+ __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
+
+- gpio_ack_irq(d->irq);
++ gpio_ack_irq(d);
+
+ return 0;
+ }
+@@ -153,7 +154,7 @@ static struct irq_chip gpio_irq_chip = {
+ static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+ int dir)
+ {
+- unsigned int base = GPIO_BASE(offset / 32);
++ void __iomem *base = GPIO_BASE(offset / 32);
+ unsigned int reg;
+
+ reg = __raw_readl(base + GPIO_DIR);
+@@ -166,7 +167,7 @@ static void _set_gpio_direction(struct g
+
+ static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+ {
+- unsigned int base = GPIO_BASE(offset / 32);
++ void __iomem *base = GPIO_BASE(offset / 32);
+
+ if (value)
+ __raw_writel(1 << (offset % 32), base + GPIO_DATA_SET);
+@@ -176,7 +177,7 @@ static void gemini_gpio_set(struct gpio_
+
+ static int gemini_gpio_get(struct gpio_chip *chip, unsigned offset)
+ {
+- unsigned int base = GPIO_BASE(offset / 32);
++ void __iomem *base = GPIO_BASE(offset / 32);
+
+ return (__raw_readl(base + GPIO_DATA_IN) >> (offset % 32)) & 1;
+ }
+--- a/arch/arm/mach-gemini/include/mach/hardware.h
++++ b/arch/arm/mach-gemini/include/mach/hardware.h
+@@ -69,6 +69,6 @@
+ /*
+ * macro to get at IO space when running virtually
+ */
+-#define IO_ADDRESS(x) ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
++#define IO_ADDRESS(x) IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
+
+ #endif
+--- a/arch/arm/mach-gemini/include/mach/system.h
++++ /dev/null
+@@ -1,23 +0,0 @@
+-/*
+- * Copyright (C) 2001-2006 Storlink, Corp.
+- * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- */
+-#ifndef __MACH_SYSTEM_H
+-#define __MACH_SYSTEM_H
+-
+-#include <linux/io.h>
+-#include <mach/hardware.h>
+-#include <mach/global_reg.h>
+-
+-static inline void arch_reset(char mode, const char *cmd)
+-{
+- __raw_writel(RESET_GLOBAL | RESET_CPU1,
+- IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
+-}
+-
+-#endif /* __MACH_SYSTEM_H */
+--- a/arch/arm/mach-gemini/irq.c
++++ b/arch/arm/mach-gemini/irq.c
+@@ -65,8 +65,8 @@ static struct irq_chip gemini_irq_chip =
+
+ static struct resource irq_resource = {
+ .name = "irq_handler",
+- .start = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
+- .end = IO_ADDRESS(FIQ_STATUS(GEMINI_INTERRUPT_BASE)) + 4,
++ .start = GEMINI_INTERRUPT_BASE,
++ .end = FIQ_STATUS(GEMINI_INTERRUPT_BASE) + 4,
+ };
+
+ void __init gemini_init_irq(void)
+--- a/arch/arm/mach-gemini/mm.c
++++ b/arch/arm/mach-gemini/mm.c
+@@ -19,57 +19,57 @@
+ /* Page table mapping for I/O region */
+ static struct map_desc gemini_io_desc[] __initdata = {
+ {
+- .virtual = IO_ADDRESS(GEMINI_GLOBAL_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_GLOBAL_BASE),
+ .pfn =__phys_to_pfn(GEMINI_GLOBAL_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_UART_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_UART_BASE),
+ .pfn = __phys_to_pfn(GEMINI_UART_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_TIMER_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_TIMER_BASE),
+ .pfn = __phys_to_pfn(GEMINI_TIMER_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_INTERRUPT_BASE),
+ .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
+ .pfn = __phys_to_pfn(GEMINI_POWER_CTRL_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(0)),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(0)),
+ .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(0)),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(1)),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(1)),
+ .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(1)),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(2)),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(2)),
+ .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(2)),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
+ .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
+ .pfn = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
+- .virtual = IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
+ .pfn = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+--- /dev/null
++++ b/arch/arm/mach-gemini/reset.c
+@@ -0,0 +1,23 @@
++/*
++ * Copyright (C) 2001-2006 Storlink, Corp.
++ * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ */
++#ifndef __MACH_SYSTEM_H
++#define __MACH_SYSTEM_H
++
++#include <linux/io.h>
++#include <mach/hardware.h>
++#include <mach/global_reg.h>
++
++void gemini_restart(char mode, const char *cmd)
++{
++ __raw_writel(RESET_GLOBAL | RESET_CPU1,
++ IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
++}
++
++#endif /* __MACH_SYSTEM_H */
diff --git a/target/linux/gemini/patches-3.3/002-arm-gemini-fix-platform_register_rtc-prototype.patch b/target/linux/gemini/patches/002-arm-gemini-fix-platform_register_rtc-prototype.patch
index f789f77fd..f789f77fd 100644
--- a/target/linux/gemini/patches-3.3/002-arm-gemini-fix-platform_register_rtc-prototype.patch
+++ b/target/linux/gemini/patches/002-arm-gemini-fix-platform_register_rtc-prototype.patch
diff --git a/target/linux/gemini/patches-3.3/110-watchdog-add-gemini_wdt-driver.patch b/target/linux/gemini/patches/110-watchdog-add-gemini_wdt-driver.patch
index e0519e28e..31a689642 100644
--- a/target/linux/gemini/patches-3.3/110-watchdog-add-gemini_wdt-driver.patch
+++ b/target/linux/gemini/patches/110-watchdog-add-gemini_wdt-driver.patch
@@ -222,7 +222,7 @@
+ gemini_wdt_stop(gemini_wdt);
+}
+
-+static int __devinit gemini_wdt_probe(struct platform_device *pdev)
++static int gemini_wdt_probe(struct platform_device *pdev)
+{
+ int ret;
+ int res_size;
@@ -297,7 +297,7 @@
+ return ret;
+}
+
-+static int __devexit gemini_wdt_remove(struct platform_device *pdev)
++static int gemini_wdt_remove(struct platform_device *pdev)
+{
+ struct gemini_wdt_struct *gemini_wdt = platform_get_drvdata(pdev);
+
@@ -345,7 +345,7 @@
+
+static struct platform_driver gemini_wdt_driver = {
+ .probe = gemini_wdt_probe,
-+ .remove = __devexit_p(gemini_wdt_remove),
++ .remove = gemini_wdt_remove,
+ .shutdown = gemini_wdt_shutdown,
+ .suspend = gemini_wdt_suspend,
+ .resume = gemini_wdt_resume,
@@ -381,7 +381,7 @@
+MODULE_ALIAS("platform:gemini-wdt");
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
-@@ -127,6 +127,16 @@ config 977_WATCHDOG
+@@ -154,6 +154,16 @@ config 977_WATCHDOG
Not sure? It's safe to say N.
@@ -395,9 +395,9 @@
+ To compile this driver as a module, choose M here: the
+ module will be called gemini_wdt.
+
- config IXP2000_WATCHDOG
- tristate "IXP2000 Watchdog"
- depends on ARCH_IXP2000
+ config IXP4XX_WATCHDOG
+ tristate "IXP4xx Watchdog"
+ depends on ARCH_IXP4XX
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.
@@ -405,6 +405,6 @@
obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
obj-$(CONFIG_977_WATCHDOG) += wdt977.o
+obj-$(CONFIG_GEMINI_WATCHDOG) += gemini_wdt.o
- obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
+ obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
diff --git a/target/linux/gemini/patches-3.3/111-arm-gemini-add-watchdog-device.patch b/target/linux/gemini/patches/111-arm-gemini-add-watchdog-device.patch
index faedfe029..00ca35d96 100644
--- a/target/linux/gemini/patches-3.3/111-arm-gemini-add-watchdog-device.patch
+++ b/target/linux/gemini/patches/111-arm-gemini-add-watchdog-device.patch
@@ -23,10 +23,11 @@
+}
--- a/arch/arm/mach-gemini/common.h
+++ b/arch/arm/mach-gemini/common.h
-@@ -25,5 +25,6 @@ extern int platform_register_uart(void);
+@@ -25,6 +25,7 @@ extern int platform_register_uart(void);
extern int platform_register_pflash(unsigned int size,
struct mtd_partition *parts,
unsigned int nr_parts);
+extern int platform_register_watchdog(void);
- #endif /* __GEMINI_COMMON_H__ */
+ extern void gemini_restart(char mode, const char *cmd);
+
diff --git a/target/linux/gemini/patches-3.3/112-arm-gemini-register-watchdog-devices.patch b/target/linux/gemini/patches/112-arm-gemini-register-watchdog-devices.patch
index 2903caf0e..74564b199 100644
--- a/target/linux/gemini/patches-3.3/112-arm-gemini-register-watchdog-devices.patch
+++ b/target/linux/gemini/patches/112-arm-gemini-register-watchdog-devices.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/mach-gemini/board-nas4220b.c
+++ b/arch/arm/mach-gemini/board-nas4220b.c
-@@ -99,6 +99,7 @@ static void __init ib4220b_init(void)
+@@ -95,6 +95,7 @@ static void __init ib4220b_init(void)
platform_device_register(&ib4220b_led_device);
platform_device_register(&ib4220b_key_device);
platform_register_rtc();
@@ -10,7 +10,7 @@
MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
--- a/arch/arm/mach-gemini/board-wbd111.c
+++ b/arch/arm/mach-gemini/board-wbd111.c
-@@ -126,6 +126,7 @@ static void __init wbd111_init(void)
+@@ -122,6 +122,7 @@ static void __init wbd111_init(void)
platform_device_register(&wbd111_leds_device);
platform_device_register(&wbd111_keys_device);
platform_register_rtc();
@@ -20,7 +20,7 @@
MACHINE_START(WBD111, "Wiliboard WBD-111")
--- a/arch/arm/mach-gemini/board-wbd222.c
+++ b/arch/arm/mach-gemini/board-wbd222.c
-@@ -126,6 +126,7 @@ static void __init wbd222_init(void)
+@@ -122,6 +122,7 @@ static void __init wbd222_init(void)
platform_device_register(&wbd222_leds_device);
platform_device_register(&wbd222_keys_device);
platform_register_rtc();
@@ -30,7 +30,7 @@
MACHINE_START(WBD222, "Wiliboard WBD-222")
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
-@@ -83,6 +83,7 @@ static void __init rut1xx_init(void)
+@@ -80,6 +80,7 @@ static void __init rut1xx_init(void)
platform_device_register(&rut1xx_leds);
platform_device_register(&rut1xx_keys_device);
platform_register_rtc();
diff --git a/target/linux/gemini/patches-3.3/120-net-add-gemini-gmac-driver.patch b/target/linux/gemini/patches/120-net-add-gemini-gmac-driver.patch
index 67eedbfd8..8801894f7 100644
--- a/target/linux/gemini/patches-3.3/120-net-add-gemini-gmac-driver.patch
+++ b/target/linux/gemini/patches/120-net-add-gemini-gmac-driver.patch
@@ -24,7 +24,7 @@
+#endif /* __MACH_GMAC_H__ */
--- /dev/null
+++ b/drivers/net/gemini_negmac/gm_gmac.c
-@@ -0,0 +1,1351 @@
+@@ -0,0 +1,1359 @@
+/*
+ * Ethernet device driver for Gemini SoC.
+ *
@@ -175,7 +175,7 @@
+ struct gmac_private *gmac = netdev_priv(dev);
+ struct toe_private *toe = dev->ml_priv;
+ DMA_RWPTR_T rwptr_reg;
-+ unsigned int rwptr_addr;
++ void __iomem *rwptr_addr;
+ void *desc_buf;
+ unsigned int offset;
+
@@ -329,26 +329,26 @@
+ GMAC_RX_FLTR_T rx_filter;
+
+ /* set RX_FLTR register to receive all multicast packet */
-+ rx_filter.bits32 = __raw_readl(dev->base_addr + GMAC_RX_FLTR);
++ rx_filter.bits32 = __raw_readl(gmac->base_addr + GMAC_RX_FLTR);
+ rx_filter.bits.unicast = 1;
+ rx_filter.bits.multicast = 1;
+ rx_filter.bits.broadcast = 1;
-+ __raw_writel(rx_filter.bits32, dev->base_addr + GMAC_RX_FLTR);
++ __raw_writel(rx_filter.bits32, gmac->base_addr + GMAC_RX_FLTR);
+
+ /* set flow control threshold */
+ config1.bits32 = 0;
+ config1.bits.set_threshold = 32 / 2;
+ config1.bits.rel_threshold = 32 / 4 * 3;
-+ __raw_writel(config1.bits32, dev->base_addr + GMAC_CONFIG1);
++ __raw_writel(config1.bits32, gmac->base_addr + GMAC_CONFIG1);
+
+ /* set flow control threshold */
+ config2_val.bits32 = 0;
+ config2_val.bits.set_threshold = TOE_SW_FREEQ_DESC_NUM / 4;
+ config2_val.bits.rel_threshold = TOE_SW_FREEQ_DESC_NUM / 2;
-+ __raw_writel(config2_val.bits32, dev->base_addr + GMAC_CONFIG2);
++ __raw_writel(config2_val.bits32, gmac->base_addr + GMAC_CONFIG2);
+
+ /* disable TX/RX and disable internal loop back */
-+ config0.bits32 = __raw_readl(dev->base_addr + GMAC_CONFIG0);
++ config0.bits32 = __raw_readl(gmac->base_addr + GMAC_CONFIG0);
+
+ config0.bits.max_len = 2;
+
@@ -372,7 +372,7 @@
+ config0.bits.port0_chk_classq = 1;
+ config0.bits.port1_chk_classq = 1;
+
-+ __raw_writel(config0.bits32, dev->base_addr + GMAC_CONFIG0);
++ __raw_writel(config0.bits32, gmac->base_addr + GMAC_CONFIG0);
+
+ hw_weigh.bits32 = 0;
+ hw_weigh.bits.hw_tq3 = 1;
@@ -391,7 +391,7 @@
+ __raw_writel(sw_weigh.bits32, gmac->dma_base_addr + GMAC_TX_WEIGHTING_CTRL_1_REG);
+
+ /* set interface type */
-+ status.bits32 = __raw_readl(dev->base_addr + GMAC_STATUS);
++ status.bits32 = __raw_readl(gmac->base_addr + GMAC_STATUS);
+
+ switch (gmac->phydev->interface) {
+ case PHY_INTERFACE_MODE_MII:
@@ -408,7 +408,7 @@
+ return;
+ }
+
-+ __raw_writel(status.bits32, dev->base_addr + GMAC_STATUS);
++ __raw_writel(status.bits32, gmac->base_addr + GMAC_STATUS);
+}
+
+static void toe_init_gmac(struct net_device *dev)
@@ -521,24 +521,26 @@
+
+static void toe_gmac_enable_tx_rx(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
+ GMAC_CONFIG0_T config0;
+
+ /* enable TX/RX */
-+ config0.bits32 = __raw_readl(dev->base_addr + GMAC_CONFIG0);
++ config0.bits32 = __raw_readl(gmac->base_addr + GMAC_CONFIG0);
+ config0.bits.dis_rx = 0; /* enable rx */
+ config0.bits.dis_tx = 0; /* enable tx */
-+ __raw_writel(config0.bits32, dev->base_addr + GMAC_CONFIG0);
++ __raw_writel(config0.bits32, gmac->base_addr + GMAC_CONFIG0);
+}
+
+static void toe_gmac_disable_tx_rx(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
+ GMAC_CONFIG0_T config0;
+
+ /* enable TX/RX */
-+ config0.bits32 = __raw_readl(dev->base_addr + GMAC_CONFIG0);
++ config0.bits32 = __raw_readl(gmac->base_addr + GMAC_CONFIG0);
+ config0.bits.dis_rx = 1; /* disable rx */
+ config0.bits.dis_tx = 1; /* disable tx */
-+ __raw_writel(config0.bits32, dev->base_addr + GMAC_CONFIG0);
++ __raw_writel(config0.bits32, gmac->base_addr + GMAC_CONFIG0);
+}
+
+static void toe_gmac_tx_complete(struct net_device *dev, unsigned int tx_qid)
@@ -667,7 +669,7 @@
+ }
+
+ while (snd_pages) {
-+ char *pkt_datap;
++ dma_addr_t pkt_datap;
+
+ curr_desc = (GMAC_TXDESC_T *)swtxq->desc_base + wptr;
+ if (frag_id == 0) {
@@ -699,7 +701,7 @@
+#else
+ word1 = total_len | TSS_MTU_ENABLE_BIT;
+#endif
-+ word2 = pkt_datap;
++ word2 = (unsigned long)pkt_datap;
+
+ if (frag_id == 0)
+ word3 |= SOF_BIT;
@@ -742,14 +744,15 @@
+
+static void __gmac_set_mac_address(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
+ unsigned int reg_val;
+
+ reg_val = dev->dev_addr[0] + (dev->dev_addr[1] << 8) +
+ (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
-+ __raw_writel(reg_val, dev->base_addr + GMAC_STA_ADD0);
-+ reg_val = (__raw_readl(dev->base_addr + GMAC_STA_ADD1) & 0xFFFF0000) +
++ __raw_writel(reg_val, gmac->base_addr + GMAC_STA_ADD0);
++ reg_val = (__raw_readl(gmac->base_addr + GMAC_STA_ADD1) & 0xFFFF0000) +
+ dev->dev_addr[4] + (dev->dev_addr[5] << 8);
-+ __raw_writel(reg_val, dev->base_addr + GMAC_STA_ADD1);
++ __raw_writel(reg_val, gmac->base_addr + GMAC_STA_ADD1);
+}
+
+static int gmac_set_mac_address(struct net_device *dev, void *addr)
@@ -765,14 +768,15 @@
+
+static void gmac_get_mac_address(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
+ unsigned int reg_val;
+
-+ reg_val = __raw_readl(dev->base_addr + GMAC_STA_ADD0);
++ reg_val = __raw_readl(gmac->base_addr + GMAC_STA_ADD0);
+ dev->dev_addr[0] = reg_val & 0xFF;
+ dev->dev_addr[1] = (reg_val >> 8) & 0xFF;
+ dev->dev_addr[2] = (reg_val >> 16) & 0xFF;
+ dev->dev_addr[3] = (reg_val >> 24) & 0xFF;
-+ reg_val = __raw_readl(dev->base_addr + GMAC_STA_ADD1);
++ reg_val = __raw_readl(gmac->base_addr + GMAC_STA_ADD1);
+ dev->dev_addr[4] = reg_val & 0xFF;
+ dev->dev_addr[5] = (reg_val >> 8) & 0xFF;
+
@@ -784,15 +788,17 @@
+
+struct net_device_stats *gmac_get_stats(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
++
+ if (netif_running(dev)) {
+ unsigned short multicast;
+
-+ multicast = __raw_readw(dev->base_addr + GMAC_IN_MCAST) +
-+ __raw_readw(dev->base_addr + GMAC_IN_BCAST);
++ multicast = __raw_readw(gmac->base_addr + GMAC_IN_MCAST) +
++ __raw_readw(gmac->base_addr + GMAC_IN_BCAST);
+
-+ dev->stats.rx_dropped += __raw_readw(dev->base_addr + GMAC_IN_DISCARDS);
-+ dev->stats.rx_errors += __raw_readw(dev->base_addr + GMAC_IN_ERRORS);
-+ dev->stats.rx_packets += __raw_readl(dev->base_addr + GMAC_IN_MAC1) + multicast;
++ dev->stats.rx_dropped += __raw_readw(gmac->base_addr + GMAC_IN_DISCARDS);
++ dev->stats.rx_errors += __raw_readw(gmac->base_addr + GMAC_IN_ERRORS);
++ dev->stats.rx_packets += __raw_readl(gmac->base_addr + GMAC_IN_MAC1) + multicast;
+ dev->stats.multicast += multicast;
+ }
+
@@ -1073,7 +1079,7 @@
+ GMAC_STATUS_T status, old_status;
+ struct phy_device *phydev = gmac->phydev;
+
-+ old_status.bits32 = status.bits32 = __raw_readl(dev->base_addr + GMAC_STATUS);
++ old_status.bits32 = status.bits32 = __raw_readl(gmac->base_addr + GMAC_STATUS);
+
+ status.bits.link = phydev->link;
+ status.bits.duplex = phydev->duplex;
@@ -1100,19 +1106,19 @@
+
+ if (phydev->pause) {
+ if (gmac->flow_control_enable == 0) {
-+ config0.bits32 = __raw_readl(dev->base_addr + GMAC_CONFIG0);
++ config0.bits32 = __raw_readl(gmac->base_addr + GMAC_CONFIG0);
+ config0.bits.tx_fc_en = 1; /* enable tx flow control */
+ config0.bits.rx_fc_en = 1; /* enable rx flow control */
-+ __raw_writel(config0.bits32, dev->base_addr + GMAC_CONFIG0);
++ __raw_writel(config0.bits32, gmac->base_addr + GMAC_CONFIG0);
+ dev_info(&dev->dev, "MII flow control enabled\n");
+ }
+ gmac->flow_control_enable = 1;
+ } else {
+ if (gmac->flow_control_enable == 1) {
-+ config0.bits32 = __raw_readl(dev->base_addr + GMAC_CONFIG0);
++ config0.bits32 = __raw_readl(gmac->base_addr + GMAC_CONFIG0);
+ config0.bits.tx_fc_en = 0; /* disable tx flow control */
+ config0.bits.rx_fc_en = 0; /* disable rx flow control */
-+ __raw_writel(config0.bits32, dev->base_addr + GMAC_CONFIG0);
++ __raw_writel(config0.bits32, gmac->base_addr + GMAC_CONFIG0);
+ dev_info(&dev->dev, "MII flow control disabled\n");
+ }
+ gmac->flow_control_enable = 0;
@@ -1122,7 +1128,7 @@
+ toe_gmac_disable_tx_rx(dev);
+ phy_print_status(phydev);
+ mdelay(10); /* let GMAC consume packet */
-+ __raw_writel(status.bits32, dev->base_addr + GMAC_STATUS);
++ __raw_writel(status.bits32, gmac->base_addr + GMAC_STATUS);
+ if (status.bits.link)
+ toe_gmac_enable_tx_rx(dev);
+ }
@@ -1130,6 +1136,7 @@
+
+static void gmac_set_rx_mode(struct net_device *dev)
+{
++ struct gmac_private *gmac = netdev_priv(dev);
+ GMAC_RX_FLTR_T filter;
+ unsigned int mc_filter[2]; /* Multicast hash filter */
+ int bit_nr;
@@ -1163,9 +1170,9 @@
+ mc_filter[1] = mc_filter[1] | (1 << (bit_nr - 32));
+ }
+ }
-+ __raw_writel(filter.bits32, dev->base_addr + GMAC_RX_FLTR);
-+ __raw_writel(mc_filter[0], dev->base_addr + GMAC_MCAST_FIL0);
-+ __raw_writel(mc_filter[1], dev->base_addr + GMAC_MCAST_FIL1);
++ __raw_writel(filter.bits32, gmac->base_addr + GMAC_RX_FLTR);
++ __raw_writel(mc_filter[0], gmac->base_addr + GMAC_MCAST_FIL0);
++ __raw_writel(mc_filter[1], gmac->base_addr + GMAC_MCAST_FIL1);
+}
+
+static void gmac_tx_timeout(struct net_device *dev)
@@ -1186,7 +1193,7 @@
+ .ndo_tx_timeout = gmac_tx_timeout,
+};
+
-+static void __devinit mac_init_drv(struct toe_private *toe)
++static void mac_init_drv(struct toe_private *toe)
+{
+ QUEUE_THRESHOLD_T threshold;
+ DMA_SKB_SIZE_T skb_size;
@@ -1220,7 +1227,7 @@
+ toe_init_interrupt_config(toe);
+}
+
-+static int __devinit gmac_init_eth(struct platform_device *pdev,
++static int gmac_init_eth(struct platform_device *pdev,
+ unsigned int num)
+{
+ struct gmac_private *gmac;
@@ -1241,10 +1248,11 @@
+ dev->ml_priv = toe;
+ toe->net_dev[num] = dev;
+
++ gmac->base_addr = toe->global_base + TOE_GMAC_BASE(num);
+ gmac->dma_base_addr = toe->global_base + TOE_GMAC_DMA_BASE(num);
+ gmac->port_id = num;
+
-+ dev->base_addr = toe->global_base + TOE_GMAC_BASE(num);
++ dev->base_addr = (unsigned int) gmac->base_addr;
+ dev->irq = platform_get_irq(pdev, num);
+ dev->netdev_ops = &gemini_gmac_ops;
+ dev->watchdog_timeo = GMAC_DEV_TX_TIMEOUT;
@@ -1263,12 +1271,12 @@
+ gmac_get_mac_address(dev);
+
+ /* TODO: Do we need this? */
-+ __raw_writel(0x55aa55aa, dev->base_addr + GMAC_STA_ADD2);
++ __raw_writel(0x55aa55aa, gmac->base_addr + GMAC_STA_ADD2);
+
+ if (register_netdev(dev))
+ return -1;
+
-+ gmac->phydev = phy_connect(dev, pdata->bus_id[num], &gmac_get_phy_status, 0,
++ gmac->phydev = phy_connect(dev, pdata->bus_id[num], &gmac_get_phy_status,
+ pdata->interface[num]);
+ if (IS_ERR(gmac->phydev))
+ return PTR_ERR(gmac->phydev);
@@ -1279,7 +1287,7 @@
+ return 0;
+}
+
-+static int __devinit gmac_probe(struct platform_device *pdev)
++static int gmac_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ struct toe_private *toe;
@@ -1332,7 +1340,7 @@
+ return retval;
+}
+
-+static int __devexit gmac_remove(struct platform_device *pdev)
++static int gmac_remove(struct platform_device *pdev)
+{
+ struct toe_private *toe = platform_get_drvdata(pdev);
+ int i;
@@ -1352,7 +1360,7 @@
+
+static struct platform_driver gemini_gmac_driver = {
+ .probe = gmac_probe,
-+ .remove = __devexit_p(gmac_remove),
++ .remove = gmac_remove,
+ .driver = {
+ .name = "gemini-gmac",
+ .owner = THIS_MODULE,
@@ -1378,7 +1386,7 @@
+MODULE_ALIAS("platform:gemini-gmac");
--- /dev/null
+++ b/drivers/net/gemini_negmac/gm_gmac.h
-@@ -0,0 +1,1488 @@
+@@ -0,0 +1,1489 @@
+/*
+ * Register definitions for Gemini Ethernet device driver.
+ *
@@ -2818,7 +2826,7 @@
+ * GMAC private data
+ */
+typedef struct {
-+ unsigned int rwptr_reg;
++ void __iomem *rwptr_reg;
+ unsigned int desc_base;
+ unsigned int desc_base_dma;
+ unsigned short finished_idx;
@@ -2828,7 +2836,8 @@
+struct gmac_private {
+ struct phy_device *phydev;
+ unsigned int port_id;
-+ unsigned int dma_base_addr;
++ void __iomem *base_addr;
++ void __iomem *dma_base_addr;
+ unsigned int swtxq_desc_base;
+ GMAC_SWTXQ_T swtxq[TOE_SW_TXQ_NUM];
+ NONTOE_QHDR_T *default_qhdr;
@@ -2875,7 +2884,7 @@
+gemini_negmac-objs := gm_gmac.o
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
-@@ -103,6 +103,13 @@ config NET_FC
+@@ -100,6 +100,13 @@ config NET_FC
adaptor below. You also should have said Y to "SCSI support" and
"SCSI generic support".
@@ -2891,7 +2900,7 @@
help
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
-@@ -33,6 +33,7 @@ obj-$(CONFIG_ETRAX_ETHERNET) += cris/
+@@ -34,6 +34,7 @@ obj-$(CONFIG_ETRAX_ETHERNET) += cris/
obj-$(CONFIG_NET_DSA) += dsa/
obj-$(CONFIG_ETHERNET) += ethernet/
obj-$(CONFIG_FDDI) += fddi/
diff --git a/target/linux/gemini/patches-3.3/121-arm-gemini-add-ethernet-device.patch b/target/linux/gemini/patches/121-arm-gemini-add-ethernet-device.patch
index 00100c0a9..d6def9b68 100644
--- a/target/linux/gemini/patches-3.3/121-arm-gemini-add-ethernet-device.patch
+++ b/target/linux/gemini/patches/121-arm-gemini-add-ethernet-device.patch
@@ -8,13 +8,14 @@
extern void gemini_map_io(void);
extern void gemini_init_irq(void);
-@@ -26,5 +27,6 @@ extern int platform_register_pflash(unsi
+@@ -26,6 +27,7 @@ extern int platform_register_pflash(unsi
struct mtd_partition *parts,
unsigned int nr_parts);
extern int platform_register_watchdog(void);
+extern int platform_register_ethernet(struct gemini_gmac_platform_data *pdata);
- #endif /* __GEMINI_COMMON_H__ */
+ extern void gemini_restart(char mode, const char *cmd);
+
--- a/arch/arm/mach-gemini/devices.c
+++ b/arch/arm/mach-gemini/devices.c
@@ -17,6 +17,7 @@
diff --git a/target/linux/gemini/patches-3.3/122-arm-gemini-wbd111-register-ethernet.patch b/target/linux/gemini/patches/122-arm-gemini-wbd111-register-ethernet.patch
index aa54ade74..1a02b558d 100644
--- a/target/linux/gemini/patches-3.3/122-arm-gemini-wbd111-register-ethernet.patch
+++ b/target/linux/gemini/patches/122-arm-gemini-wbd111-register-ethernet.patch
@@ -30,7 +30,7 @@
static struct gpio_keys_button wbd111_keys[] = {
{
.code = KEY_SETUP,
-@@ -127,6 +147,8 @@ static void __init wbd111_init(void)
+@@ -123,6 +143,8 @@ static void __init wbd111_init(void)
platform_device_register(&wbd111_keys_device);
platform_register_rtc();
platform_register_watchdog();
diff --git a/target/linux/gemini/patches-3.3/123-arm-gemini-wbd222-register-eth.patch b/target/linux/gemini/patches/123-arm-gemini-wbd222-register-eth.patch
index 621a9ab8b..32852da28 100644
--- a/target/linux/gemini/patches-3.3/123-arm-gemini-wbd222-register-eth.patch
+++ b/target/linux/gemini/patches/123-arm-gemini-wbd222-register-eth.patch
@@ -32,7 +32,7 @@
static struct gpio_keys_button wbd222_keys[] = {
{
.code = KEY_SETUP,
-@@ -127,6 +149,8 @@ static void __init wbd222_init(void)
+@@ -123,6 +145,8 @@ static void __init wbd222_init(void)
platform_device_register(&wbd222_keys_device);
platform_register_rtc();
platform_register_watchdog();
diff --git a/target/linux/gemini/patches-3.3/124-arm-gemini-rut100-register-ethernet.patch b/target/linux/gemini/patches/124-arm-gemini-rut100-register-ethernet.patch
index e1e57ee75..e7c55d53e 100644
--- a/target/linux/gemini/patches-3.3/124-arm-gemini-rut100-register-ethernet.patch
+++ b/target/linux/gemini/patches/124-arm-gemini-rut100-register-ethernet.patch
@@ -1,9 +1,9 @@
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
-@@ -14,13 +14,35 @@
- #include <linux/leds.h>
+@@ -15,13 +15,35 @@
#include <linux/input.h>
#include <linux/gpio_keys.h>
+ #include <linux/sizes.h>
+#include <linux/mdio-gpio.h>
#include <asm/mach-types.h>
@@ -36,7 +36,7 @@
static struct gpio_keys_button rut1xx_keys[] = {
{
.code = KEY_SETUP,
-@@ -84,6 +106,8 @@ static void __init rut1xx_init(void)
+@@ -81,6 +103,8 @@ static void __init rut1xx_init(void)
platform_device_register(&rut1xx_keys_device);
platform_register_rtc();
platform_register_watchdog();
diff --git a/target/linux/gemini/patches-3.3/130-usb-ehci-gemini-fot2gxx-support.patch b/target/linux/gemini/patches/130-usb-ehci-gemini-fot2gxx-support.patch
index 50ee4ab76..e3900861f 100644
--- a/target/linux/gemini/patches-3.3/130-usb-ehci-gemini-fot2gxx-support.patch
+++ b/target/linux/gemini/patches/130-usb-ehci-gemini-fot2gxx-support.patch
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/drivers/usb/host/ehci-fotg2xx.c
-@@ -0,0 +1,465 @@
+@@ -0,0 +1,459 @@
+/*
+ * EHCI Host Controller driver
+ *
@@ -176,13 +176,7 @@
+ if (result)
+ return result;
+
-+ result = ehci_init(hcd);
-+ if (result)
-+ return result;
-+
-+ ehci_port_power(ehci, 0);
-+
-+ return result;
++ return ehci_init(hcd);
+}
+
+/*
@@ -468,7 +462,7 @@
+};
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
-@@ -581,7 +581,12 @@ static inline unsigned int
+@@ -600,7 +600,12 @@ static inline unsigned int
ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
{
if (ehci_is_TDI(ehci)) {
@@ -483,19 +477,27 @@
case 1:
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
-@@ -227,9 +227,11 @@ static int ehci_halt (struct ehci_hcd *e
- if ((temp & STS_HALT) != 0)
- return 0;
-
+@@ -204,10 +204,12 @@ static int ehci_halt (struct ehci_hcd *e
+ * This routine gets called during probe before ehci->command
+ * has been initialized, so we can't rely on its value.
+ */
+#ifndef CONFIG_ARCH_GEMINI
+ ehci->command &= ~CMD_RUN;
temp = ehci_readl(ehci, &ehci->regs->command);
- temp &= ~CMD_RUN;
+ temp &= ~(CMD_RUN | CMD_IAAD);
ehci_writel(ehci, temp, &ehci->regs->command);
+#endif
- return handshake (ehci, &ehci->regs->status,
- STS_HALT, STS_HALT, 16 * 125);
- }
-@@ -342,8 +344,10 @@ static int ehci_reset (struct ehci_hcd *
+
+ spin_unlock_irq(&ehci->lock);
+ synchronize_irq(ehci_to_hcd(ehci)->irq);
+@@ -257,13 +259,17 @@ static int ehci_reset (struct ehci_hcd *
+ if (ehci->has_hostpc) {
+ ehci_writel(ehci, USBMODE_EX_HC | USBMODE_EX_VBPS,
+ &ehci->regs->usbmode_ex);
++#ifndef CONFIG_ARCH_GEMINI
+ ehci_writel(ehci, TXFIFO_DEFAULT, &ehci->regs->txfill_tuning);
++#endif
+ }
if (retval)
return retval;
@@ -505,12 +507,11 @@
+#endif
if (ehci->debug)
- dbgp_external_startup();
-@@ -478,12 +482,13 @@ static void ehci_silence_controller(stru
- {
- ehci_halt(ehci);
+ dbgp_external_startup(ehci_to_hcd(ehci));
+@@ -341,11 +347,14 @@ static void ehci_silence_controller(stru
+ ehci->rh_state = EHCI_RH_HALTED;
ehci_turn_off_all_ports(ehci);
--
+
+#ifndef CONFIG_ARCH_GEMINI
/* make BIOS/etc use companion controller during reboot */
ehci_writel(ehci, 0, &ehci->regs->configured_flag);
@@ -518,10 +519,11 @@
/* unblock posted writes */
ehci_readl(ehci, &ehci->regs->configured_flag);
+#endif
++
+ spin_unlock_irq(&ehci->lock);
}
- /* ehci_shutdown kick in for silicon on any bus (not just pci, etc).
-@@ -764,7 +769,9 @@ static int ehci_run (struct usb_hcd *hcd
+@@ -600,7 +609,9 @@ static int ehci_run (struct usb_hcd *hcd
// Philips, Intel, and maybe others need CMD_RUN before the
// root hub will detect new devices (why?); NEC doesn't
ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
@@ -531,7 +533,7 @@
ehci_writel(ehci, ehci->command, &ehci->regs->command);
dbg_cmd (ehci, "init", ehci->command);
-@@ -784,9 +791,11 @@ static int ehci_run (struct usb_hcd *hcd
+@@ -620,9 +631,11 @@ static int ehci_run (struct usb_hcd *hcd
*/
down_write(&ehci_cf_port_reset_rwsem);
ehci->rh_state = EHCI_RH_RUNNING;
@@ -543,19 +545,9 @@
up_write(&ehci_cf_port_reset_rwsem);
ehci->last_periodic_enable = ktime_get_real();
-@@ -958,7 +967,9 @@ static irqreturn_t ehci_irq (struct usb_
- ehci_halt(ehci);
- dead:
- ehci_reset(ehci);
-+#ifndef CONFIG_ARCH_GEMINI
- ehci_writel(ehci, 0, &ehci->regs->configured_flag);
-+#endif
- usb_hc_died(hcd);
- /* generic layer kills/unlinks all urbs, then
- * uses ehci_stop to clean up the rest
-@@ -1256,6 +1267,11 @@ MODULE_LICENSE ("GPL");
- #define PCI_DRIVER ehci_pci_driver
- #endif
+@@ -1238,6 +1251,11 @@ MODULE_DESCRIPTION(DRIVER_DESC);
+ MODULE_AUTHOR (DRIVER_AUTHOR);
+ MODULE_LICENSE ("GPL");
+#ifdef CONFIG_ARCH_GEMINI
+#include "ehci-fotg2xx.c"
@@ -567,7 +559,7 @@
#define PLATFORM_DRIVER ehci_fsl_driver
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
-@@ -882,6 +882,12 @@ static int ehci_hub_control (
+@@ -912,6 +912,12 @@ static int ehci_hub_control (
/* see what we found out */
temp = check_reset_complete (ehci, wIndex, status_reg,
ehci_readl(ehci, status_reg));
@@ -579,18 +571,18 @@
+#endif
}
- if (!(temp & (PORT_RESUME|PORT_RESET)))
+ if (!(temp & (PORT_RESUME|PORT_RESET))) {
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
-@@ -76,6 +76,7 @@ config USB_ARCH_HAS_EHCI
+@@ -47,6 +47,7 @@ config USB_ARCH_HAS_EHCI
default y if MICROBLAZE
default y if SPARC_LEON
default y if ARCH_MMP
+ default y if ARCH_GEMINI
+ default y if MACH_LOONGSON1
+ default y if PLAT_ORION
default PCI
-
- # some non-PCI HCDs implement xHCI
-@@ -94,7 +95,7 @@ config USB
+@@ -96,7 +97,7 @@ config USB
traditional PC serial port. The bus supplies power to peripherals
and allows for hot swapping. Up to 127 USB peripherals can be
connected to a single USB host in a tree structure.
@@ -601,15 +593,19 @@
Most PCs now have USB host ports, used to connect peripherals
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
-@@ -110,9 +110,9 @@ struct ehci_regs {
- u32 frame_list; /* points to periodic list */
+@@ -111,6 +111,7 @@ struct ehci_regs {
/* ASYNCLISTADDR: offset 0x18 */
u32 async_next; /* address of next async queue head */
--
+
+#ifndef CONFIG_ARCH_GEMINI
- u32 reserved[9];
--
-+#endif
+ u32 reserved1[2];
+
+ /* TXFILLTUNING: offset 0x24 */
+@@ -118,6 +119,7 @@ struct ehci_regs {
+ #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */
+
+ u32 reserved2[6];
++#endif /* !CONFIG_ARCH_GEMINI */
+
/* CONFIGFLAG: offset 0x40 */
u32 configured_flag;
- #define FLAG_CF (1<<0) /* true: we'll support "high speed" */
diff --git a/target/linux/gemini/patches-3.3/131-arm-gemini-add-usb-platform-device.patch b/target/linux/gemini/patches/131-arm-gemini-add-usb-platform-device.patch
index 00990e106..d1a4fee50 100644
--- a/target/linux/gemini/patches-3.3/131-arm-gemini-add-usb-platform-device.patch
+++ b/target/linux/gemini/patches/131-arm-gemini-add-usb-platform-device.patch
@@ -65,10 +65,11 @@
+}
--- a/arch/arm/mach-gemini/common.h
+++ b/arch/arm/mach-gemini/common.h
-@@ -28,5 +28,6 @@ extern int platform_register_pflash(unsi
+@@ -28,6 +28,7 @@ extern int platform_register_pflash(unsi
unsigned int nr_parts);
extern int platform_register_watchdog(void);
extern int platform_register_ethernet(struct gemini_gmac_platform_data *pdata);
+extern int platform_register_usb(unsigned int id);
- #endif /* __GEMINI_COMMON_H__ */
+ extern void gemini_restart(char mode, const char *cmd);
+
diff --git a/target/linux/gemini/patches-3.3/132-arm-gemini-wbd111-register-usb.patch b/target/linux/gemini/patches/132-arm-gemini-wbd111-register-usb.patch
index 26339368d..44e72d17c 100644
--- a/target/linux/gemini/patches-3.3/132-arm-gemini-wbd111-register-usb.patch
+++ b/target/linux/gemini/patches/132-arm-gemini-wbd111-register-usb.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/mach-gemini/board-wbd111.c
+++ b/arch/arm/mach-gemini/board-wbd111.c
-@@ -149,6 +149,7 @@ static void __init wbd111_init(void)
+@@ -145,6 +145,7 @@ static void __init wbd111_init(void)
platform_register_watchdog();
platform_device_register(&wbd111_phy_device);
platform_register_ethernet(&gmac_data);
@@ -10,7 +10,7 @@
MACHINE_START(WBD111, "Wiliboard WBD-111")
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
-@@ -112,7 +112,11 @@ module_param (park, uint, S_IRUGO);
+@@ -99,7 +99,11 @@ module_param (park, uint, S_IRUGO);
MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
/* for flakey hardware, ignore overcurrent indicators */
diff --git a/target/linux/gemini/patches-3.3/133-arm-gemini-wbd222-register-usb.patch b/target/linux/gemini/patches/133-arm-gemini-wbd222-register-usb.patch
index a4d332bdd..2adc41092 100644
--- a/target/linux/gemini/patches-3.3/133-arm-gemini-wbd222-register-usb.patch
+++ b/target/linux/gemini/patches/133-arm-gemini-wbd222-register-usb.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/mach-gemini/board-wbd222.c
+++ b/arch/arm/mach-gemini/board-wbd222.c
-@@ -151,6 +151,7 @@ static void __init wbd222_init(void)
+@@ -147,6 +147,7 @@ static void __init wbd222_init(void)
platform_register_watchdog();
platform_device_register(&wbd222_phy_device);
platform_register_ethernet(&gmac_data);
diff --git a/target/linux/gemini/patches-3.3/134-arm-gemini-rut100-register-usb.patch b/target/linux/gemini/patches/134-arm-gemini-rut100-register-usb.patch
index 10f24d818..c3755ee7d 100644
--- a/target/linux/gemini/patches-3.3/134-arm-gemini-rut100-register-usb.patch
+++ b/target/linux/gemini/patches/134-arm-gemini-rut100-register-usb.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
-@@ -108,6 +108,7 @@ static void __init rut1xx_init(void)
+@@ -105,6 +105,7 @@ static void __init rut1xx_init(void)
platform_register_watchdog();
platform_device_register(&rut1xx_phy_device);
platform_register_ethernet(&gmac_data);
diff --git a/target/linux/gemini/patches-3.3/135-arm-gemini-nas4220-register-usb.patch b/target/linux/gemini/patches/135-arm-gemini-nas4220-register-usb.patch
index 31d776d0a..e08c889d4 100644
--- a/target/linux/gemini/patches-3.3/135-arm-gemini-nas4220-register-usb.patch
+++ b/target/linux/gemini/patches/135-arm-gemini-nas4220-register-usb.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/mach-gemini/board-nas4220b.c
+++ b/arch/arm/mach-gemini/board-nas4220b.c
-@@ -100,6 +100,8 @@ static void __init ib4220b_init(void)
+@@ -96,6 +96,8 @@ static void __init ib4220b_init(void)
platform_device_register(&ib4220b_key_device);
platform_register_rtc();
platform_register_watchdog();
diff --git a/target/linux/gemini/patches-3.3/140-arm-gemini-add-pci-support.patch b/target/linux/gemini/patches/140-arm-gemini-add-pci-support.patch
index 8cacb51b2..37ffdadba 100644
--- a/target/linux/gemini/patches-3.3/140-arm-gemini-add-pci-support.patch
+++ b/target/linux/gemini/patches/140-arm-gemini-add-pci-support.patch
@@ -1,9 +1,9 @@
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -379,6 +379,7 @@ config ARCH_GEMINI
- select CPU_FA526
- select ARCH_REQUIRE_GPIOLIB
+@@ -412,6 +412,7 @@ config ARCH_GEMINI
select ARCH_USES_GETTIMEOFFSET
+ select NEED_MACH_GPIO_H
+ select CPU_FA526
+ select MIGHT_HAVE_PCI
help
Support for the Cortina Systems Gemini family SoCs
@@ -12,7 +12,7 @@
+++ b/arch/arm/mach-gemini/include/mach/hardware.h
@@ -71,4 +71,9 @@
*/
- #define IO_ADDRESS(x) ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
+ #define IO_ADDRESS(x) IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
+/*
+ * PCI subsystem macros
@@ -43,7 +43,7 @@
+++ b/arch/arm/mach-gemini/Makefile
@@ -6,6 +6,8 @@
- obj-y := irq.o mm.o time.o devices.o gpio.o
+ obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
+obj-$(CONFIG_PCI) += pci.o
+
@@ -56,17 +56,17 @@
.length = SZ_512K,
.type = MT_DEVICE,
}, {
-+ .virtual = IO_ADDRESS(GEMINI_PCI_IO_BASE),
++ .virtual = (unsigned long)IO_ADDRESS(GEMINI_PCI_IO_BASE),
+ .pfn = __phys_to_pfn(GEMINI_PCI_IO_BASE),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ }, {
- .virtual = IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
+ .virtual = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
.pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
.length = SZ_512K,
--- /dev/null
+++ b/arch/arm/mach-gemini/pci.c
-@@ -0,0 +1,321 @@
+@@ -0,0 +1,320 @@
+/*
+ * Support for Gemini PCI Controller
+ *
@@ -204,8 +204,8 @@
+
+static struct resource gemini_pci_resource_io = {
+ .name = "PCI I/O Space",
-+ .start = IO_ADDRESS(GEMINI_PCI_IO_BASE),
-+ .end = IO_ADDRESS(GEMINI_PCI_IO_BASE) + SZ_1M - 1,
++ .start = GEMINI_PCI_IO_BASE,
++ .end = GEMINI_PCI_IO_BASE + SZ_1M - 1,
+ .flags = IORESOURCE_IO,
+};
+
@@ -292,7 +292,6 @@
+ .nr_controllers = 1,
+ .setup = gemini_pci_setup,
+ .scan = gemini_pci_scan_bus,
-+ .swizzle = pci_std_swizzle,
+ .map_irq = gemini_pci_map_irq,
+};
+