projects/linux·commit b77d643c

Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus

b77d643c · Linus Torvalds <[email protected]> · 2010-10-29 11:13:10 -07:00

* 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: (46 commits)
  ftrace/MIPS: Enable C Version of recordmcount
  ftrace/MIPS: Add module support for C version of recordmcount
  ftrace/MIPS: Add MIPS64 support for C version of recordmcount
  MIPS: Make TASK_SIZE reflect proper size for both 32 and 64 bit processes.
  MIPS: Allow UserLocal on MIPS_R1 processors
  MIPS: Honor L2 bypass bit
  MIPS: Add BMIPS CP0 register definitions
  MIPS: Add BMIPS processor types to Kconfig
  MIPS: Decouple BMIPS CPU support from bcm47xx/bcm63xx SoC code
  MIPS: Add support for hardware performance events (mipsxx)
  MIPS: Perf-events: Add callchain support
  MIPS: add support for hardware performance events (skeleton)
  MIPS: add support for software performance events
  MIPS: define local_xchg from xchg_local to atomic_long_xchg
  MIPS: AR7: Add support for Titan (TNETV10xx) SoC variant
  MIPS: AR7: Initialize GPIO earlier
  MIPS: Add platform device and Kconfig for Octeon USB EHCI / OHCI
  USB: Add EHCI and OHCH glue for OCTEON II SOCs.
  MIPS: Octeon: Add register definitions for EHCI / OHCI USB glue logic.
  MIPS: Octeon: Apply CN63XXP1 errata workarounds.
  ...
Commit
b77d643ced576bdd1e918aebda869de74696cde9
Parents
b4020c1b · 64575f91

Merge commit. Changes below are compared with the first parent: b4020c1b.

Changes

94 files changed · +9360 −3525

FileStatusAddDelContent
arch/mips/Kconfigmodified+79−0View file
arch/mips/Kconfig.debugmodified+9−0View file
arch/mips/Makefilemodified+1−3View file
arch/mips/ar7/gpio.cmodified+231−12View file
arch/mips/ar7/platform.cmodified+56−0View file
arch/mips/ar7/prom.cmodified+2−0View file
arch/mips/ar7/setup.cmodified+14−0View file
arch/mips/bcm63xx/cpu.cmodified+15−15View file
arch/mips/cavium-octeon/Kconfigmodified+23−0View file
arch/mips/cavium-octeon/csrc-octeon.cmodified+31−3View file
arch/mips/cavium-octeon/dma-octeon.cmodified+294−287View file
arch/mips/cavium-octeon/executive/cvmx-l2c.cmodified+488−322View file
arch/mips/cavium-octeon/octeon-platform.cmodified+110−2View file
arch/mips/cavium-octeon/serial.cmodified+1−1View file
arch/mips/cavium-octeon/setup.cmodified+86−34View file
arch/mips/include/asm/atomic.hmodified+96−112View file
arch/mips/include/asm/bitops.hmodified+121−149View file
arch/mips/include/asm/bootinfo.hmodified+12−0View file
arch/mips/include/asm/cmpxchg.hmodified+2−5View file
arch/mips/include/asm/cpu.hmodified+14−12View file
arch/mips/include/asm/device.hmodified+14−1View file
arch/mips/include/asm/dma-mapping.hmodified+58−38View file
arch/mips/include/asm/dma.hmodified+3−0View file
arch/mips/include/asm/local.hmodified+1−1View file
arch/mips/include/asm/mach-ar7/ar7.hmodified+45−2View file
arch/mips/include/asm/mach-ar7/gpio.hmodified+2−1View file
arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.hmodified+7−1View file
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.hmodified+15−9View file
arch/mips/include/asm/mach-ip27/dma-coherence.hmodified+3−2View file
arch/mips/include/asm/mach-ip32/dma-coherence.hmodified+3−2View file
arch/mips/include/asm/mach-jazz/dma-coherence.hmodified+5−4View file
arch/mips/include/asm/mipsregs.hmodified+51−0View file
arch/mips/include/asm/octeon/cvmx-agl-defs.hmodified+434−182View file
arch/mips/include/asm/octeon/cvmx-asm.hmodified+11−0View file
arch/mips/include/asm/octeon/cvmx-ciu-defs.hmodified+769−88View file
arch/mips/include/asm/octeon/cvmx-gpio-defs.hmodified+50−24View file
arch/mips/include/asm/octeon/cvmx-iob-defs.hmodified+162−80View file
arch/mips/include/asm/octeon/cvmx-ipd-defs.hmodified+198−116View file
arch/mips/include/asm/octeon/cvmx-l2c-defs.hmodified+672−66View file
arch/mips/include/asm/octeon/cvmx-l2c.hmodified+130−95View file
arch/mips/include/asm/octeon/cvmx-l2d-defs.hmodified+13−25View file
arch/mips/include/asm/octeon/cvmx-l2t-defs.hmodified+2−3View file
arch/mips/include/asm/octeon/cvmx-led-defs.hmodified+14−27View file
arch/mips/include/asm/octeon/cvmx-mio-defs.hmodified+587−220View file
arch/mips/include/asm/octeon/cvmx-mixx-defs.hmodified+143−57View file
arch/mips/include/asm/octeon/cvmx-npei-defs.hmodified+300−381View file
arch/mips/include/asm/octeon/cvmx-npi-defs.hmodified+121−241View file
arch/mips/include/asm/octeon/cvmx-pci-defs.hmodified+86−179View file
arch/mips/include/asm/octeon/cvmx-pciercx-defs.hmodified+272−163View file
arch/mips/include/asm/octeon/cvmx-pescx-defs.hmodified+17−33View file
arch/mips/include/asm/octeon/cvmx-pexp-defs.hmodified+187−191View file
arch/mips/include/asm/octeon/cvmx-pow-defs.hmodified+110−47View file
arch/mips/include/asm/octeon/cvmx-rnm-defs.hmodified+54−13View file
arch/mips/include/asm/octeon/cvmx-smix-defs.hmodified+21−25View file
arch/mips/include/asm/octeon/cvmx-uctlx-defs.hadded+261−0View file
arch/mips/include/asm/octeon/octeon-model.hmodified+28−8View file
arch/mips/include/asm/octeon/octeon.hmodified+1−0View file
arch/mips/include/asm/octeon/pci-octeon.hmodified+10−0View file
arch/mips/include/asm/perf_event.hadded+25−0View file
arch/mips/include/asm/pgtable-64.hmodified+2−2View file
arch/mips/include/asm/processor.hmodified+19−21View file
arch/mips/include/asm/system.hmodified+24−28View file
arch/mips/include/asm/thread_info.hmodified+2−0View file
arch/mips/include/asm/uaccess.hmodified+3−1View file
arch/mips/kernel/Makefilemodified+2−0View file
arch/mips/kernel/cpu-probe.cmodified+53−29View file
arch/mips/kernel/irq.cmodified+24−0View file
arch/mips/kernel/perf_event.cadded+601−0View file
arch/mips/kernel/perf_event_mipsxx.cadded+1052−0View file
arch/mips/kernel/setup.cmodified+1−0View file
arch/mips/kernel/traps.cmodified+22−9View file
arch/mips/kernel/unaligned.cmodified+7−0View file
arch/mips/loongson/Kconfigmodified+0−2View file
arch/mips/math-emu/cp1emu.cmodified+3−0View file
arch/mips/mm/c-octeon.cmodified+15−1View file
arch/mips/mm/c-r4k.cmodified+10−11View file
arch/mips/mm/dma-default.cmodified+55−110View file
arch/mips/mm/fault.cmodified+9−2View file
arch/mips/mm/sc-mips.cmodified+30−4View file
arch/mips/mm/tlbex.cmodified+5−6View file
arch/mips/mm/uasm.cmodified+19−1View file
arch/mips/pci/pci-octeon.cmodified+54−6View file
arch/mips/pci/pcie-octeon.cmodified+5−0View file
drivers/ata/pata_octeon_cf.cmodified+1−1View file
drivers/usb/host/Kconfigmodified+28−2View file
drivers/usb/host/Makefilemodified+1−0View file
drivers/usb/host/ehci-hcd.cmodified+5−0View file
drivers/usb/host/ehci-octeon.cadded+207−0View file
drivers/usb/host/octeon2-common.cadded+185−0View file
drivers/usb/host/ohci-hcd.cmodified+5−0View file
drivers/usb/host/ohci-octeon.cadded+214−0View file
drivers/watchdog/octeon-wdt-main.cmodified+2−2View file
scripts/recordmcount.cmodified+44−0View file
scripts/recordmcount.hmodified+81−5View file

Only the first 600 diff lines are shown. Download the complete patch.

arch/mips/Kconfig

View file
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index cf8d094..67a2fa2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -4,16 +4,21 @@ config MIPS
select HAVE_GENERIC_DMA_COHERENT
select HAVE_IDE
select HAVE_OPROFILE
+ select HAVE_PERF_EVENTS
+ select PERF_USE_VMALLOC
select HAVE_ARCH_KGDB
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_DYNAMIC_FTRACE
select HAVE_FTRACE_MCOUNT_RECORD
+ select HAVE_C_RECORDMCOUNT
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_KPROBES
select HAVE_KRETPROBES
select RTC_LIB if !MACH_LOONGSON
select GENERIC_ATOMIC64 if !64BIT
+ select HAVE_DMA_ATTRS
+ select HAVE_DMA_API_DEBUG
menu "Machine selection"
@@ -691,6 +696,9 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
select SWAP_IO_SPACE
select HW_HAS_PCI
select ARCH_SUPPORTS_MSI
+ select ZONE_DMA32
+ select USB_ARCH_HAS_OHCI
+ select USB_ARCH_HAS_EHCI
help
This option supports all of the Octeon reference boards from Cavium
Networks. It builds a kernel that dynamically determines the Octeon
@@ -1334,6 +1342,57 @@ config CPU_CAVIUM_OCTEON
can have up to 16 Mips64v2 cores and 8 integrated gigabit ethernets.
Full details can be found at http://www.caviumnetworks.com.
+config CPU_BMIPS3300
+ bool "BMIPS3300"
+ depends on SYS_HAS_CPU_BMIPS3300
+ select DMA_NONCOHERENT
+ select IRQ_CPU
+ select SWAP_IO_SPACE
+ select SYS_SUPPORTS_32BIT_KERNEL
+ select WEAK_ORDERING
+ help
+ Broadcom BMIPS3300 processors.
+
+config CPU_BMIPS4350
+ bool "BMIPS4350"
+ depends on SYS_HAS_CPU_BMIPS4350
+ select CPU_SUPPORTS_32BIT_KERNEL
+ select DMA_NONCOHERENT
+ select IRQ_CPU
+ select SWAP_IO_SPACE
+ select SYS_SUPPORTS_SMP
+ select SYS_SUPPORTS_HOTPLUG_CPU
+ select WEAK_ORDERING
+ help
+ Broadcom BMIPS4350 ("VIPER") processors.
+
+config CPU_BMIPS4380
+ bool "BMIPS4380"
+ depends on SYS_HAS_CPU_BMIPS4380
+ select CPU_SUPPORTS_32BIT_KERNEL
+ select DMA_NONCOHERENT
+ select IRQ_CPU
+ select SWAP_IO_SPACE
+ select SYS_SUPPORTS_SMP
+ select SYS_SUPPORTS_HOTPLUG_CPU
+ select WEAK_ORDERING
+ help
+ Broadcom BMIPS4380 processors.
+
+config CPU_BMIPS5000
+ bool "BMIPS5000"
+ depends on SYS_HAS_CPU_BMIPS5000
+ select CPU_SUPPORTS_32BIT_KERNEL
+ select CPU_SUPPORTS_HIGHMEM
+ select DMA_NONCOHERENT
+ select IRQ_CPU
+ select SWAP_IO_SPACE
+ select SYS_SUPPORTS_SMP
+ select SYS_SUPPORTS_HOTPLUG_CPU
+ select WEAK_ORDERING
+ help
+ Broadcom BMIPS5000 processors.
+
endchoice
if CPU_LOONGSON2F
@@ -1452,6 +1511,18 @@ config SYS_HAS_CPU_SB1
config SYS_HAS_CPU_CAVIUM_OCTEON
bool
+config SYS_HAS_CPU_BMIPS3300
+ bool
+
+config SYS_HAS_CPU_BMIPS4350
+ bool
+
+config SYS_HAS_CPU_BMIPS4380
+ bool
+
+config SYS_HAS_CPU_BMIPS5000
+ bool
+
#
# CPU may reorder R->R, R->W, W->R, W->W
# Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC
@@ -1928,6 +1999,14 @@ config NODES_SHIFT
default "6"
depends on NEED_MULTIPLE_NODES
+config HW_PERF_EVENTS
+ bool "Enable hardware performance counter support for perf events"
+ depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && CPU_MIPS32
+ default y
+ help
+ Enable hardware performance counter support for perf events. If
+ disabled, perf events will use software events only.
+
source "mm/Kconfig"
config SMP

arch/mips/Kconfig.debug

View file
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index 43dc279..f437cd1 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -67,6 +67,15 @@ config CMDLINE_OVERRIDE
Normally, you will choose 'N' here.
+config DEBUG_STACKOVERFLOW
+ bool "Check for stack overflows"
+ depends on DEBUG_KERNEL
+ help
+ This option will cause messages to be printed if free stack space
+ drops below a certain limit(2GB on MIPS). The debugging option
+ provides another way to check stack overflow happened on kernel mode
+ stack usually caused by nested interruption.
+
config DEBUG_STACK_USAGE
bool "Enable stack utilization instrumentation"
depends on DEBUG_KERNEL

arch/mips/Makefile

View file
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index f4a4b66..7c1102e 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -48,9 +48,6 @@ ifneq ($(SUBARCH),$(ARCH))
endif
endif
-ifndef CONFIG_FUNCTION_TRACER
-cflags-y := -ffunction-sections
-endif
ifdef CONFIG_FUNCTION_GRAPH_TRACER
ifndef KBUILD_MCOUNT_RA_ADDRESS
ifeq ($(call cc-option-yn,-mmcount-ra-address), y)
@@ -159,6 +156,7 @@ cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += $(call cc-option,-march=octeon) -Wa,--trap
ifeq (,$(findstring march=octeon, $(cflags-$(CONFIG_CPU_CAVIUM_OCTEON))))
cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon
endif
+cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1
cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)
cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,)

arch/mips/ar7/gpio.c

View file
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index c32fbb5..425dfa5 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007 Felix Fietkau <[email protected]>
* Copyright (C) 2007 Eugene Konev <[email protected]>
- * Copyright (C) 2009 Florian Fainelli <[email protected]>
+ * Copyright (C) 2009-2010 Florian Fainelli <[email protected]>
*
* 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
@@ -37,6 +37,16 @@ static int ar7_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
return readl(gpio_in) & (1 << gpio);
}
+static int titan_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
+{
+ struct ar7_gpio_chip *gpch =
+ container_of(chip, struct ar7_gpio_chip, chip);
+ void __iomem *gpio_in0 = gpch->regs + TITAN_GPIO_INPUT_0;
+ void __iomem *gpio_in1 = gpch->regs + TITAN_GPIO_INPUT_1;
+
+ return readl(gpio >> 5 ? gpio_in1 : gpio_in0) & (1 << (gpio & 0x1f));
+}
+
static void ar7_gpio_set_value(struct gpio_chip *chip,
unsigned gpio, int value)
{
@@ -51,6 +61,21 @@ static void ar7_gpio_set_value(struct gpio_chip *chip,
writel(tmp, gpio_out);
}
+static void titan_gpio_set_value(struct gpio_chip *chip,
+ unsigned gpio, int value)
+{
+ struct ar7_gpio_chip *gpch =
+ container_of(chip, struct ar7_gpio_chip, chip);
+ void __iomem *gpio_out0 = gpch->regs + TITAN_GPIO_OUTPUT_0;
+ void __iomem *gpio_out1 = gpch->regs + TITAN_GPIO_OUTPUT_1;
+ unsigned tmp;
+
+ tmp = readl(gpio >> 5 ? gpio_out1 : gpio_out0) & ~(1 << (gpio & 0x1f));
+ if (value)
+ tmp |= 1 << (gpio & 0x1f);
+ writel(tmp, gpio >> 5 ? gpio_out1 : gpio_out0);
+}
+
static int ar7_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
{
struct ar7_gpio_chip *gpch =
@@ -62,6 +87,21 @@ static int ar7_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
return 0;
}
+static int titan_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
+{
+ struct ar7_gpio_chip *gpch =
+ container_of(chip, struct ar7_gpio_chip, chip);
+ void __iomem *gpio_dir0 = gpch->regs + TITAN_GPIO_DIR_0;
+ void __iomem *gpio_dir1 = gpch->regs + TITAN_GPIO_DIR_1;
+
+ if (gpio >= TITAN_GPIO_MAX)
+ return -EINVAL;
+
+ writel(readl(gpio >> 5 ? gpio_dir1 : gpio_dir0) | (1 << (gpio & 0x1f)),
+ gpio >> 5 ? gpio_dir1 : gpio_dir0);
+ return 0;
+}
+
static int ar7_gpio_direction_output(struct gpio_chip *chip,
unsigned gpio, int value)
{
@@ -75,6 +115,24 @@ static int ar7_gpio_direction_output(struct gpio_chip *chip,
return 0;
}
+static int titan_gpio_direction_output(struct gpio_chip *chip,
+ unsigned gpio, int value)
+{
+ struct ar7_gpio_chip *gpch =
+ container_of(chip, struct ar7_gpio_chip, chip);
+ void __iomem *gpio_dir0 = gpch->regs + TITAN_GPIO_DIR_0;
+ void __iomem *gpio_dir1 = gpch->regs + TITAN_GPIO_DIR_1;
+
+ if (gpio >= TITAN_GPIO_MAX)
+ return -EINVAL;
+
+ titan_gpio_set_value(chip, gpio, value);
+ writel(readl(gpio >> 5 ? gpio_dir1 : gpio_dir0) & ~(1 <<
+ (gpio & 0x1f)), gpio >> 5 ? gpio_dir1 : gpio_dir0);
+
+ return 0;
+}
+
static struct ar7_gpio_chip ar7_gpio_chip = {
.chip = {
.label = "ar7-gpio",
@@ -87,7 +145,19 @@ static struct ar7_gpio_chip ar7_gpio_chip = {
}
};
-int ar7_gpio_enable(unsigned gpio)
+static struct ar7_gpio_chip titan_gpio_chip = {
+ .chip = {
+ .label = "titan-gpio",
+ .direction_input = titan_gpio_direction_input,
+ .direction_output = titan_gpio_direction_output,
+ .set = titan_gpio_set_value,
+ .get = titan_gpio_get_value,
+ .base = 0,
+ .ngpio = TITAN_GPIO_MAX,
+ }
+};
+
+static inline int ar7_gpio_enable_ar7(unsigned gpio)
{
void __iomem *gpio_en = ar7_gpio_chip.regs + AR7_GPIO_ENABLE;
@@ -95,9 +165,26 @@ int ar7_gpio_enable(unsigned gpio)
return 0;
}
+
+static inline int ar7_gpio_enable_titan(unsigned gpio)
+{
+ void __iomem *gpio_en0 = titan_gpio_chip.regs + TITAN_GPIO_ENBL_0;
+ void __iomem *gpio_en1 = titan_gpio_chip.regs + TITAN_GPIO_ENBL_1;
+
+ writel(readl(gpio >> 5 ? gpio_en1 : gpio_en0) | (1 << (gpio & 0x1f)),
+ gpio >> 5 ? gpio_en1 : gpio_en0);
+
+ return 0;
+}
+
+int ar7_gpio_enable(unsigned gpio)
+{
+ return ar7_is_titan() ? ar7_gpio_enable_titan(gpio) :
+ ar7_gpio_enable_ar7(gpio);
+}
EXPORT_SYMBOL(ar7_gpio_enable);
-int ar7_gpio_disable(unsigned gpio)
+static inline int ar7_gpio_disable_ar7(unsigned gpio)
{
void __iomem *gpio_en = ar7_gpio_chip.regs + AR7_GPIO_ENABLE;
@@ -105,27 +192,159 @@ int ar7_gpio_disable(unsigned gpio)
return 0;
}
+
+static inline int ar7_gpio_disable_titan(unsigned gpio)
+{
+ void __iomem *gpio_en0 = titan_gpio_chip.regs + TITAN_GPIO_ENBL_0;
+ void __iomem *gpio_en1 = titan_gpio_chip.regs + TITAN_GPIO_ENBL_1;
+
+ writel(readl(gpio >> 5 ? gpio_en1 : gpio_en0) & ~(1 << (gpio & 0x1f)),
+ gpio >> 5 ? gpio_en1 : gpio_en0);
+
+ return 0;
+}
+
+int ar7_gpio_disable(unsigned gpio)
+{
+ return ar7_is_titan() ? ar7_gpio_disable_titan(gpio) :
+ ar7_gpio_disable_ar7(gpio);
+}
EXPORT_SYMBOL(ar7_gpio_disable);
-static int __init ar7_gpio_init(void)
+struct titan_gpio_cfg {
+ u32 reg;
+ u32 shift;
+ u32 func;
+};
+
+static struct titan_gpio_cfg titan_gpio_table[] = {
+ /* reg, start bit, mux value */
+ {4, 24, 1},
+ {4, 26, 1},
+ {4, 28, 1},
+ {4, 30, 1},
+ {5, 6, 1},
+ {5, 8, 1},
+ {5, 10, 1},
+ {5, 12, 1},
+ {7, 14, 3},
+ {7, 16, 3},
+ {7, 18, 3},
+ {7, 20, 3},
+ {7, 22, 3},
+ {7, 26, 3},
+ {7, 28, 3},
+ {7, 30, 3},
+ {8, 0, 3},
+ {8, 2, 3},
+ {8, 4, 3},
+ {8, 10, 3},
+ {8, 14, 3},
+ {8, 16, 3},
+ {8, 18, 3},
+ {8, 20, 3},
+ {9, 8, 3},
+ {9, 10, 3},
+ {9, 12, 3},
+ {9, 14, 3},
+ {9, 18, 3},
+ {9, 20, 3},
+ {9, 24, 3},
+ {9, 26, 3},
+ {9, 28, 3},
+ {9, 30, 3},
+ {10, 0, 3},
+ {10, 2, 3},
+ {10, 8, 3},
+ {10, 10, 3},
+ {10, 12, 3},
+ {10, 14, 3},
+ {13, 12, 3},
+ {13, 14, 3},
+ {13, 16, 3},
+ {13, 18, 3},
+ {13, 24, 3},
+ {13, 26, 3},
+ {13, 28, 3},
+ {13, 30, 3},
+ {14, 2, 3},
+ {14, 6, 3},
+ {14, 8, 3},
+ {14, 12, 3}
+};
+
+static int titan_gpio_pinsel(unsigned gpio)
+{
+ struct titan_gpio_cfg gpio_cfg;
+ u32 mux_status, pin_sel_reg, tmp;
+ void __iomem *pin_sel = (void __iomem *)KSEG1ADDR(AR7_REGS_PINSEL);
+
+ if (gpio >= ARRAY_SIZE(titan_gpio_table))
+ return -EINVAL;
+
+ gpio_cfg = titan_gpio_table[gpio];
+ pin_sel_reg = gpio_cfg.reg - 1;
+
+ mux_status = (readl(pin_sel + pin_sel_reg) >> gpio_cfg.shift) & 0x3;
+
+ /* Check the mux status */
+ if (!((mux_status == 0) || (mux_status == gpio_cfg.func)))
+ return 0;
+
+ /* Set the pin sel value */
+ tmp = readl(pin_sel + pin_sel_reg);
+ tmp |= ((gpio_cfg.func & 0x3) << gpio_cfg.shift);
+ writel(tmp, pin_sel + pin_sel_reg);
+
+ return 0;
+}
+
+/* Perform minimal Titan GPIO configuration */
+static void titan_gpio_init(void)
+{
+ unsigned i;
+
+ for (i = 44; i < 48; i++) {
+ titan_gpio_pinsel(i);
+ ar7_gpio_enable_titan(i);
+ titan_gpio_direction_input(&titan_gpio_chip.chip, i);
+ }
+}
+
+int __init ar7_gpio_init(void)
{
int ret;
+ struct ar7_gpio_chip *gpch;
+ unsigned size;
+
+ if (!ar7_is_titan()) {
+ gpch = &ar7_gpio_chip;
+ size = 0x10;
+ } else {
+ gpch = &titan_gpio_chip;
+ size = 0x1f;
+ }
- ar7_gpio_chip.regs = ioremap_nocache(AR7_REGS_GPIO,
+ gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
AR7_REGS_GPIO + 0x10);
- if (!ar7_gpio_chip.regs) {
- printk(KERN_ERR "ar7-gpio: failed to ioremap regs\n");
+ if (!gpch->regs) {
+ printk(KERN_ERR "%s: failed to ioremap regs\n",
+ gpch->chip.label);
return -ENOMEM;
}
- ret = gpiochip_add(&ar7_gpio_chip.chip);
+ ret = gpiochip_add(&gpch->chip);
if (ret) {
- printk(KERN_ERR "ar7-gpio: failed to add gpiochip\n");
+ printk(KERN_ERR "%s: failed to add gpiochip\n",
+ gpch->chip.label);
return ret;
}
- printk(KERN_INFO "ar7-gpio: registered %d GPIOs\n",
- ar7_gpio_chip.chip.ngpio);
+ printk(KERN_INFO "%s: registered %d GPIOs\n",
+ gpch->chip.label, gpch->chip.ngpio);
+
+ if (ar7_is_titan())
+ titan_gpio_init();
+
return ret;
}
-arch_initcall(ar7_gpio_init);

arch/mips/ar7/platform.c

View file
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index 0da5b2b..7d2fab3 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -357,6 +357,11 @@ static struct gpio_led default_leds[] = {
},
};
+static struct gpio_led titan_leds[] = {
+ { .name = "status", .gpio = 8, .active_low = 1, },
+ { .name = "wifi", .gpio = 13, .active_low = 1, },
+};
+
static struct gpio_led dsl502t_leds[] = {
{
.name = "status",
@@ -495,6 +500,9 @@ static void __init detect_leds(void)
} else if (strstr(prid, "DG834")) {
ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
ar7_led_data.leds = dg834g_leds;
+ } else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
+ ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
+ ar7_led_data.leds = titan_leds;
}
}
@@ -560,6 +568,51 @@ static int __init ar7_register_uarts(void)
return 0;
}
+static void __init titan_fixup_devices(void)
+{
+ /* Set vlynq0 data */
+ vlynq_low_data.reset_bit = 15;
+ vlynq_low_data.gpio_bit = 14;
+
+ /* Set vlynq1 data */
+ vlynq_high_data.reset_bit = 16;
+ vlynq_high_data.gpio_bit = 7;
+
+ /* Set vlynq0 resources */
+ vlynq_low_res[0].start = TITAN_REGS_VLYNQ0;
+ vlynq_low_res[0].end = TITAN_REGS_VLYNQ0 + 0xff;
+ vlynq_low_res[1].start = 33;
+ vlynq_low_res[1].end = 33;
+ vlynq_low_res[2].start = 0x0c000000;
+ vlynq_low_res[2].end = 0x0fffffff;
+ vlynq_low_res[3].start = 80;
+ vlynq_low_res[3].end = 111;
+
+ /* Set vlynq1 resources */
+ vlynq_high_res[0].start = TITAN_REGS_VLYNQ1;
+ vlynq_high_res[0].end = TITAN_REGS_VLYNQ1 + 0xff;
+ vlynq_high_res[1].start = 34;
+ vlynq_high_res[1].end = 34;
+ vlynq_high_res[2].start = 0x40000000;
+ vlynq_high_res[2].end = 0x43ffffff;
+ vlynq_high_res[3].start = 112;
+ vlynq_high_res[3].end = 143;
+
+ /* Set cpmac0 data */
+ cpmac_low_data.phy_mask = 0x40000000;
+
+ /* Set cpmac1 data */
+ cpmac_high_data.phy_mask = 0x80000000;
+
+ /* Set cpmac0 resources */
+ cpmac_low_res[0].start = TITAN_REGS_MAC0;
+ cpmac_low_res[0].end = TITAN_REGS_MAC0 + 0x7ff;
+
+ /* Set cpmac1 resources */
+ cpmac_high_res[0].start = TITAN_REGS_MAC1;
+ cpmac_high_res[0].end = TITAN_REGS_MAC1 + 0x7ff;
+}
+
static int __init ar7_register_devices(void)
{
void __iomem *bootcr;
@@ -574,6 +627,9 @@ static int __init ar7_register_devices(void)
if (res)
pr_warning("unable to register physmap-flash: %d\n", res);
+ if (ar7_is_titan())
+ titan_fixup_devices();
+
ar7_device_disable(vlynq_low_data.reset_bit);
res = platform_device_register(&vlynq_low);
if (res)

arch/mips/ar7/prom.c

View file
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index 5238579..23818d2 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -246,6 +246,8 @@ void __init prom_init(void)
ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
ar7_init_env((struct env_var *)fw_arg2);
console_config();
+
+ ar7_gpio_init();
}
#define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))

arch/mips/ar7/setup.c

View file
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
index 3a801d2..f20b53e 100644
--- a/arch/mips/ar7/setup.c
+++ b/arch/mips/ar7/setup.c
@@ -23,6 +23,7 @@
#include <asm/reboot.h>
#include <asm/mach-ar7/ar7.h>
#include <asm/mach-ar7/prom.h>
+#include <asm/mach-ar7/gpio.h>
static void ar7_machine_restart(char *command)
{

This diff is incomplete. Download the complete patch.

arch/mips/bcm63xx/cpu.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/csrc-octeon.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/dma-octeon.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/executive/cvmx-l2c.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/octeon-platform.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/serial.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/cavium-octeon/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/atomic.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/bitops.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/bootinfo.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/cmpxchg.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/cpu.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/device.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/dma-mapping.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/dma.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/local.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-ar7/ar7.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-ar7/gpio.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-ip27/dma-coherence.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-ip32/dma-coherence.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mach-jazz/dma-coherence.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/mipsregs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-agl-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-asm.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-ciu-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-gpio-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-iob-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-ipd-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-l2c-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-l2c.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-l2d-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-l2t-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-led-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-mio-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-mixx-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-npei-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-npi-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-pci-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-pciercx-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-pescx-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-pexp-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-pow-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-rnm-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-smix-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/cvmx-uctlx-defs.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/octeon-model.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/octeon.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/octeon/pci-octeon.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/perf_event.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/pgtable-64.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/system.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/thread_info.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/uaccess.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/cpu-probe.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/irq.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/perf_event.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/perf_event_mipsxx.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/traps.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/kernel/unaligned.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/loongson/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/mips/math-emu/cp1emu.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/c-octeon.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/c-r4k.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/dma-default.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/fault.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/sc-mips.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/tlbex.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/mm/uasm.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/pci/pci-octeon.c

View file

This diff is incomplete. Download the complete patch.

arch/mips/pci/pcie-octeon.c

View file

This diff is incomplete. Download the complete patch.

drivers/ata/pata_octeon_cf.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/ehci-hcd.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/ehci-octeon.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/octeon2-common.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/ohci-hcd.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/host/ohci-octeon.c

View file

This diff is incomplete. Download the complete patch.

drivers/watchdog/octeon-wdt-main.c

View file

This diff is incomplete. Download the complete patch.

scripts/recordmcount.c

View file

This diff is incomplete. Download the complete patch.

scripts/recordmcount.h

View file

This diff is incomplete. Download the complete patch.