diff options
author | viresh kumar <viresh.kumar@st.com> | 2010-04-01 07:30:42 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-04-14 06:31:58 -0400 |
commit | bf976b51a32e255523c69022c1f21bf9ad527fc5 (patch) | |
tree | bddfe6b79aa74ff81ae7d8bb09080ee3e22d6d9e | |
parent | e024c3d50c53999d15e3b8a21e0abbbf74c32140 (diff) |
ARM: 6012/1: ST SPEAr: Added basic header files for SPEAr platform
Reviewed-by: Linus Walleij <linux.walleij@stericsson.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/plat-spear/include/plat/debug-macro.S | 38 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/gpio.h | 24 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/io.h | 22 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/memory.h | 20 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/system.h | 41 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/timex.h | 19 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/uncompress.h | 43 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/vmalloc.h | 19 |
8 files changed, 226 insertions, 0 deletions
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S new file mode 100644 index 000000000000..1670734b7e51 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header for spear platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/amba/serial.h> | ||
15 | #include <mach/spear.h> | ||
16 | |||
17 | .macro addruart, rx | ||
18 | mrc p15, 0, \rx, c1, c0 | ||
19 | tst \rx, #1 @ MMU enabled? | ||
20 | moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base | ||
21 | movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base | ||
22 | .endm | ||
23 | |||
24 | .macro senduart, rd, rx | ||
25 | strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER | ||
26 | .endm | ||
27 | |||
28 | .macro waituart, rd, rx | ||
29 | 1001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER | ||
30 | tst \rd, #UART01x_FR_TXFF @ TX_FULL | ||
31 | bne 1001b | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart, rd, rx | ||
35 | 1002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER | ||
36 | tst \rd, #UART011_FR_TXFE @ TX_EMPTY | ||
37 | beq 1002b | ||
38 | .endm | ||
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h new file mode 100644 index 000000000000..b857c91257dd --- /dev/null +++ b/arch/arm/plat-spear/include/plat/gpio.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/gpio.h | ||
3 | * | ||
4 | * GPIO macros for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_GPIO_H | ||
15 | #define __PLAT_GPIO_H | ||
16 | |||
17 | #include <asm-generic/gpio.h> | ||
18 | |||
19 | #define gpio_get_value __gpio_get_value | ||
20 | #define gpio_set_value __gpio_set_value | ||
21 | #define gpio_cansleep __gpio_cansleep | ||
22 | #define gpio_to_irq __gpio_to_irq | ||
23 | |||
24 | #endif /* __PLAT_GPIO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/io.h b/arch/arm/plat-spear/include/plat/io.h new file mode 100644 index 000000000000..4d4ba822b3eb --- /dev/null +++ b/arch/arm/plat-spear/include/plat/io.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/io.h | ||
3 | * | ||
4 | * IO definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_IO_H | ||
15 | #define __PLAT_IO_H | ||
16 | |||
17 | #define IO_SPACE_LIMIT 0xFFFFFFFF | ||
18 | |||
19 | #define __io(a) __typesafe_io(a) | ||
20 | #define __mem_pci(a) (a) | ||
21 | |||
22 | #endif /* __PLAT_IO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/memory.h b/arch/arm/plat-spear/include/plat/memory.h new file mode 100644 index 000000000000..27a4aba77343 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/memory.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/memory.h | ||
3 | * | ||
4 | * Memory map for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_MEMORY_H | ||
15 | #define __PLAT_MEMORY_H | ||
16 | |||
17 | /* Physical DRAM offset */ | ||
18 | #define PHYS_OFFSET UL(0x00000000) | ||
19 | |||
20 | #endif /* __PLAT_MEMORY_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h new file mode 100644 index 000000000000..55a4e405d578 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/system.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/system.h | ||
3 | * | ||
4 | * SPEAr platform specific architecture functions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_SYSTEM_H | ||
15 | #define __PLAT_SYSTEM_H | ||
16 | |||
17 | #include <asm/hardware/sp810.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <mach/spear.h> | ||
20 | |||
21 | static inline void arch_idle(void) | ||
22 | { | ||
23 | /* | ||
24 | * This should do all the clock switching | ||
25 | * and wait for interrupt tricks | ||
26 | */ | ||
27 | cpu_do_idle(); | ||
28 | } | ||
29 | |||
30 | static inline void arch_reset(char mode, const char *cmd) | ||
31 | { | ||
32 | if (mode == 's') { | ||
33 | /* software reset, Jump into ROM at address 0 */ | ||
34 | cpu_reset(0); | ||
35 | } else { | ||
36 | /* hardware reset, Use on-chip reset capability */ | ||
37 | sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | #endif /* __PLAT_SYSTEM_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/timex.h b/arch/arm/plat-spear/include/plat/timex.h new file mode 100644 index 000000000000..914d09dd50fd --- /dev/null +++ b/arch/arm/plat-spear/include/plat/timex.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/timex.h | ||
3 | * | ||
4 | * SPEAr platform specific timex definitions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_TIMEX_H | ||
15 | #define __PLAT_TIMEX_H | ||
16 | |||
17 | #define CLOCK_TICK_RATE 48000000 | ||
18 | |||
19 | #endif /* __PLAT_TIMEX_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h new file mode 100644 index 000000000000..99ba6789cc97 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/uncompress.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/uncompress.h | ||
3 | * | ||
4 | * Serial port stubs for kernel decompress status messages | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/io.h> | ||
15 | #include <linux/amba/serial.h> | ||
16 | #include <mach/spear.h> | ||
17 | |||
18 | #ifndef __PLAT_UNCOMPRESS_H | ||
19 | #define __PLAT_UNCOMPRESS_H | ||
20 | /* | ||
21 | * This does not append a newline | ||
22 | */ | ||
23 | static inline void putc(int c) | ||
24 | { | ||
25 | void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE; | ||
26 | |||
27 | while (readl(base + UART01x_FR) & UART01x_FR_TXFF) | ||
28 | barrier(); | ||
29 | |||
30 | writel(c, base + UART01x_DR); | ||
31 | } | ||
32 | |||
33 | static inline void flush(void) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * nothing to do | ||
39 | */ | ||
40 | #define arch_decomp_setup() | ||
41 | #define arch_decomp_wdog() | ||
42 | |||
43 | #endif /* __PLAT_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h new file mode 100644 index 000000000000..09e9372aea21 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/vmalloc.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/vmalloc.h | ||
3 | * | ||
4 | * Defining Vmalloc area for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_VMALLOC_H | ||
15 | #define __PLAT_VMALLOC_H | ||
16 | |||
17 | #define VMALLOC_END 0xF0000000 | ||
18 | |||
19 | #endif /* __PLAT_VMALLOC_H */ | ||