summaryrefslogtreecommitdiff
path: root/arch/arm/plat-spear
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-spear')
-rw-r--r--arch/arm/plat-spear/Kconfig47
-rw-r--r--arch/arm/plat-spear/Makefile9
-rw-r--r--arch/arm/plat-spear/include/plat/debug-macro.S36
-rw-r--r--arch/arm/plat-spear/include/plat/pl080.h21
-rw-r--r--arch/arm/plat-spear/include/plat/timex.h19
-rw-r--r--arch/arm/plat-spear/include/plat/uncompress.h42
-rw-r--r--arch/arm/plat-spear/pl080.c78
-rw-r--r--arch/arm/plat-spear/restart.c33
-rw-r--r--arch/arm/plat-spear/time.c245
9 files changed, 0 insertions, 530 deletions
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
deleted file mode 100644
index 8a08c31b5e20..000000000000
--- a/arch/arm/plat-spear/Kconfig
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# SPEAr Platform configuration file
-#
-
-if PLAT_SPEAR
-
-choice
- prompt "ST SPEAr Family"
- default ARCH_SPEAR3XX
-
-config ARCH_SPEAR13XX
- bool "ST SPEAr13xx with Device Tree"
- select ARCH_HAS_CPUFREQ
- select ARM_GIC
- select CPU_V7
- select GPIO_SPEAR_SPICS
- select HAVE_SMP
- select MIGHT_HAVE_CACHE_L2X0
- select PINCTRL
- select USE_OF
- help
- Supports for ARM's SPEAR13XX family
-
-config ARCH_SPEAR3XX
- bool "ST SPEAr3xx with Device Tree"
- select ARM_VIC
- select CPU_ARM926T
- select PINCTRL
- select USE_OF
- help
- Supports for ARM's SPEAR3XX family
-
-config ARCH_SPEAR6XX
- bool "SPEAr6XX"
- select ARM_VIC
- select CPU_ARM926T
- help
- Supports for ARM's SPEAR6XX family
-
-endchoice
-
-# Adding SPEAr machine specific configuration files
-source "arch/arm/mach-spear13xx/Kconfig"
-source "arch/arm/mach-spear3xx/Kconfig"
-source "arch/arm/mach-spear6xx/Kconfig"
-
-endif
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile
deleted file mode 100644
index 01e88532a5db..000000000000
--- a/arch/arm/plat-spear/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# SPEAr Platform specific Makefile
-#
-
-# Common support
-obj-y := restart.o time.o
-
-obj-$(CONFIG_ARCH_SPEAR3XX) += pl080.o
-obj-$(CONFIG_ARCH_SPEAR6XX) += pl080.o
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S
deleted file mode 100644
index 75b05ad0fbad..000000000000
--- a/arch/arm/plat-spear/include/plat/debug-macro.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/debug-macro.S
- *
- * Debugging macro include header for spear platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/amba/serial.h>
-#include <mach/spear.h>
-
- .macro addruart, rp, rv, tmp
- mov \rp, #SPEAR_DBG_UART_BASE @ Physical base
- mov \rv, #VA_SPEAR_DBG_UART_BASE @ Virtual base
- .endm
-
- .macro senduart, rd, rx
- strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER
- .endm
-
- .macro waituart, rd, rx
-1001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
- tst \rd, #UART01x_FR_TXFF @ TX_FULL
- bne 1001b
- .endm
-
- .macro busyuart, rd, rx
-1002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
- tst \rd, #UART011_FR_TXFE @ TX_EMPTY
- beq 1002b
- .endm
diff --git a/arch/arm/plat-spear/include/plat/pl080.h b/arch/arm/plat-spear/include/plat/pl080.h
deleted file mode 100644
index eb6590ded40d..000000000000
--- a/arch/arm/plat-spear/include/plat/pl080.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/pl080.h
- *
- * DMAC pl080 definitions for SPEAr platform
- *
- * Copyright (C) 2012 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_PL080_H
-#define __PLAT_PL080_H
-
-struct pl08x_channel_data;
-int pl080_get_signal(const struct pl08x_channel_data *cd);
-void pl080_put_signal(const struct pl08x_channel_data *cd, int signal);
-
-#endif /* __PLAT_PL080_H */
diff --git a/arch/arm/plat-spear/include/plat/timex.h b/arch/arm/plat-spear/include/plat/timex.h
deleted file mode 100644
index ef95e5b780bd..000000000000
--- a/arch/arm/plat-spear/include/plat/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/timex.h
- *
- * SPEAr platform specific timex definitions
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_TIMEX_H
-#define __PLAT_TIMEX_H
-
-#define CLOCK_TICK_RATE 48000000
-
-#endif /* __PLAT_TIMEX_H */
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
deleted file mode 100644
index 51b2dc93e4da..000000000000
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/uncompress.h
- *
- * Serial port stubs for kernel decompress status messages
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/io.h>
-#include <linux/amba/serial.h>
-#include <mach/spear.h>
-
-#ifndef __PLAT_UNCOMPRESS_H
-#define __PLAT_UNCOMPRESS_H
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
- void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE;
-
- while (readl_relaxed(base + UART01x_FR) & UART01x_FR_TXFF)
- barrier();
-
- writel_relaxed(c, base + UART01x_DR);
-}
-
-static inline void flush(void)
-{
-}
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-
-#endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-spear/pl080.c b/arch/arm/plat-spear/pl080.c
deleted file mode 100644
index cfa1199d0f4a..000000000000
--- a/arch/arm/plat-spear/pl080.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * arch/arm/plat-spear/pl080.c
- *
- * DMAC pl080 definitions for SPEAr platform
- *
- * Copyright (C) 2012 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/amba/pl08x.h>
-#include <linux/amba/bus.h>
-#include <linux/bug.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/spinlock_types.h>
-#include <mach/spear.h>
-#include <mach/misc_regs.h>
-
-static spinlock_t lock = __SPIN_LOCK_UNLOCKED(x);
-
-struct {
- unsigned char busy;
- unsigned char val;
-} signals[16] = {{0, 0}, };
-
-int pl080_get_signal(const struct pl08x_channel_data *cd)
-{
- unsigned int signal = cd->min_signal, val;
- unsigned long flags;
-
- spin_lock_irqsave(&lock, flags);
-
- /* Return if signal is already acquired by somebody else */
- if (signals[signal].busy &&
- (signals[signal].val != cd->muxval)) {
- spin_unlock_irqrestore(&lock, flags);
- return -EBUSY;
- }
-
- /* If acquiring for the first time, configure it */
- if (!signals[signal].busy) {
- val = readl(DMA_CHN_CFG);
-
- /*
- * Each request line has two bits in DMA_CHN_CFG register. To
- * goto the bits of current request line, do left shift of
- * value by 2 * signal number.
- */
- val &= ~(0x3 << (signal * 2));
- val |= cd->muxval << (signal * 2);
- writel(val, DMA_CHN_CFG);
- }
-
- signals[signal].busy++;
- signals[signal].val = cd->muxval;
- spin_unlock_irqrestore(&lock, flags);
-
- return signal;
-}
-
-void pl080_put_signal(const struct pl08x_channel_data *cd, int signal)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&lock, flags);
-
- /* if signal is not used */
- if (!signals[signal].busy)
- BUG();
-
- signals[signal].busy--;
-
- spin_unlock_irqrestore(&lock, flags);
-}
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
deleted file mode 100644
index 7d4616d5df11..000000000000
--- a/arch/arm/plat-spear/restart.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * arch/arm/plat-spear/restart.c
- *
- * SPEAr platform specific restart functions
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <viresh.linux@gmail.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-#include <linux/io.h>
-#include <linux/amba/sp810.h>
-#include <asm/system_misc.h>
-#include <mach/spear.h>
-#include <mach/generic.h>
-
-#define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204)
-void spear_restart(char mode, const char *cmd)
-{
- if (mode == 's') {
- /* software reset, Jump into ROM at address 0 */
- soft_restart(0);
- } else {
- /* hardware reset, Use on-chip reset capability */
-#ifdef CONFIG_ARCH_SPEAR13XX
- writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES);
-#else
- sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
-#endif
- }
-}
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
deleted file mode 100644
index bd5c53cd6962..000000000000
--- a/arch/arm/plat-spear/time.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * arch/arm/plat-spear/time.c
- *
- * Copyright (C) 2010 ST Microelectronics
- * Shiraz Hashim<shiraz.hashim@st.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/clk.h>
-#include <linux/clockchips.h>
-#include <linux/clocksource.h>
-#include <linux/err.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/of_irq.h>
-#include <linux/of_address.h>
-#include <linux/time.h>
-#include <linux/irq.h>
-#include <asm/mach/time.h>
-#include <mach/generic.h>
-
-/*
- * We would use TIMER0 and TIMER1 as clockevent and clocksource.
- * Timer0 and Timer1 both belong to same gpt block in cpu subbsystem. Further
- * they share same functional clock. Any change in one's functional clock will
- * also affect other timer.
- */
-
-#define CLKEVT 0 /* gpt0, channel0 as clockevent */
-#define CLKSRC 1 /* gpt0, channel1 as clocksource */
-
-/* Register offsets, x is channel number */
-#define CR(x) ((x) * 0x80 + 0x80)
-#define IR(x) ((x) * 0x80 + 0x84)
-#define LOAD(x) ((x) * 0x80 + 0x88)
-#define COUNT(x) ((x) * 0x80 + 0x8C)
-
-/* Reg bit definitions */
-#define CTRL_INT_ENABLE 0x0100
-#define CTRL_ENABLE 0x0020
-#define CTRL_ONE_SHOT 0x0010
-
-#define CTRL_PRESCALER1 0x0
-#define CTRL_PRESCALER2 0x1
-#define CTRL_PRESCALER4 0x2
-#define CTRL_PRESCALER8 0x3
-#define CTRL_PRESCALER16 0x4
-#define CTRL_PRESCALER32 0x5
-#define CTRL_PRESCALER64 0x6
-#define CTRL_PRESCALER128 0x7
-#define CTRL_PRESCALER256 0x8
-
-#define INT_STATUS 0x1
-
-/*
- * Minimum clocksource/clockevent timer range in seconds
- */
-#define SPEAR_MIN_RANGE 4
-
-static __iomem void *gpt_base;
-static struct clk *gpt_clk;
-
-static void clockevent_set_mode(enum clock_event_mode mode,
- struct clock_event_device *clk_event_dev);
-static int clockevent_next_event(unsigned long evt,
- struct clock_event_device *clk_event_dev);
-
-static void spear_clocksource_init(void)
-{
- u32 tick_rate;
- u16 val;
-
- /* program the prescaler (/256)*/
- writew(CTRL_PRESCALER256, gpt_base + CR(CLKSRC));
-
- /* find out actual clock driving Timer */
- tick_rate = clk_get_rate(gpt_clk);
- tick_rate >>= CTRL_PRESCALER256;
-
- writew(0xFFFF, gpt_base + LOAD(CLKSRC));
-
- val = readw(gpt_base + CR(CLKSRC));
- val &= ~CTRL_ONE_SHOT; /* autoreload mode */
- val |= CTRL_ENABLE ;
- writew(val, gpt_base + CR(CLKSRC));
-
- /* register the clocksource */
- clocksource_mmio_init(gpt_base + COUNT(CLKSRC), "tmr1", tick_rate,
- 200, 16, clocksource_mmio_readw_up);
-}
-
-static struct clock_event_device clkevt = {
- .name = "tmr0",
- .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
- .set_mode = clockevent_set_mode,
- .set_next_event = clockevent_next_event,
- .shift = 0, /* to be computed */
-};
-
-static void clockevent_set_mode(enum clock_event_mode mode,
- struct clock_event_device *clk_event_dev)
-{
- u32 period;
- u16 val;
-
- /* stop the timer */
- val = readw(gpt_base + CR(CLKEVT));
- val &= ~CTRL_ENABLE;
- writew(val, gpt_base + CR(CLKEVT));
-
- switch (mode) {
- case CLOCK_EVT_MODE_PERIODIC:
- period = clk_get_rate(gpt_clk) / HZ;
- period >>= CTRL_PRESCALER16;
- writew(period, gpt_base + LOAD(CLKEVT));
-
- val = readw(gpt_base + CR(CLKEVT));
- val &= ~CTRL_ONE_SHOT;
- val |= CTRL_ENABLE | CTRL_INT_ENABLE;
- writew(val, gpt_base + CR(CLKEVT));
-
- break;
- case CLOCK_EVT_MODE_ONESHOT:
- val = readw(gpt_base + CR(CLKEVT));
- val |= CTRL_ONE_SHOT;
- writew(val, gpt_base + CR(CLKEVT));
-
- break;
- case CLOCK_EVT_MODE_UNUSED:
- case CLOCK_EVT_MODE_SHUTDOWN:
- case CLOCK_EVT_MODE_RESUME:
-
- break;
- default:
- pr_err("Invalid mode requested\n");
- break;
- }
-}
-
-static int clockevent_next_event(unsigned long cycles,
- struct clock_event_device *clk_event_dev)
-{
- u16 val = readw(gpt_base + CR(CLKEVT));
-
- if (val & CTRL_ENABLE)
- writew(val & ~CTRL_ENABLE, gpt_base + CR(CLKEVT));
-
- writew(cycles, gpt_base + LOAD(CLKEVT));
-
- val |= CTRL_ENABLE | CTRL_INT_ENABLE;
- writew(val, gpt_base + CR(CLKEVT));
-
- return 0;
-}
-
-static irqreturn_t spear_timer_interrupt(int irq, void *dev_id)
-{
- struct clock_event_device *evt = &clkevt;
-
- writew(INT_STATUS, gpt_base + IR(CLKEVT));
-
- evt->event_handler(evt);
-
- return IRQ_HANDLED;
-}
-
-static struct irqaction spear_timer_irq = {
- .name = "timer",
- .flags = IRQF_DISABLED | IRQF_TIMER,
- .handler = spear_timer_interrupt
-};
-
-static void __init spear_clockevent_init(int irq)
-{
- u32 tick_rate;
-
- /* program the prescaler */
- writew(CTRL_PRESCALER16, gpt_base + CR(CLKEVT));
-
- tick_rate = clk_get_rate(gpt_clk);
- tick_rate >>= CTRL_PRESCALER16;
-
- clkevt.cpumask = cpumask_of(0);
-
- clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0);
-
- setup_irq(irq, &spear_timer_irq);
-}
-
-const static struct of_device_id timer_of_match[] __initconst = {
- { .compatible = "st,spear-timer", },
- { },
-};
-
-void __init spear_setup_of_timer(void)
-{
- struct device_node *np;
- int irq, ret;
-
- np = of_find_matching_node(NULL, timer_of_match);
- if (!np) {
- pr_err("%s: No timer passed via DT\n", __func__);
- return;
- }
-
- irq = irq_of_parse_and_map(np, 0);
- if (!irq) {
- pr_err("%s: No irq passed for timer via DT\n", __func__);
- return;
- }
-
- gpt_base = of_iomap(np, 0);
- if (!gpt_base) {
- pr_err("%s: of iomap failed\n", __func__);
- return;
- }
-
- gpt_clk = clk_get_sys("gpt0", NULL);
- if (!gpt_clk) {
- pr_err("%s:couldn't get clk for gpt\n", __func__);
- goto err_iomap;
- }
-
- ret = clk_prepare_enable(gpt_clk);
- if (ret < 0) {
- pr_err("%s:couldn't prepare-enable gpt clock\n", __func__);
- goto err_prepare_enable_clk;
- }
-
- spear_clockevent_init(irq);
- spear_clocksource_init();
-
- return;
-
-err_prepare_enable_clk:
- clk_put(gpt_clk);
-err_iomap:
- iounmap(gpt_base);
-}