diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-05 11:14:15 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-07 04:55:48 -0400 |
commit | a09e64fbc0094e3073dbb09c3b4bfe4ab669244b (patch) | |
tree | 69689f467179891b498bd7423fcf61925173db31 /arch/arm/mach-pnx4008 | |
parent | a1b81a84fff05dbfef45b7012c26e1fee9973e5d (diff) |
[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
This just leaves include/asm-arm/plat-* to deal with.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pnx4008')
28 files changed, 1338 insertions, 22 deletions
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c index 576e9a4d21e0..24d036a24a72 100644 --- a/arch/arm/mach-pnx4008/clock.c +++ b/arch/arm/mach-pnx4008/clock.c | |||
@@ -21,10 +21,10 @@ | |||
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | 23 | ||
24 | #include <asm/arch/hardware.h> | 24 | #include <mach/hardware.h> |
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | 26 | ||
27 | #include <asm/arch/clock.h> | 27 | #include <mach/clock.h> |
28 | #include "clock.h" | 28 | #include "clock.h" |
29 | 29 | ||
30 | /*forward declaration*/ | 30 | /*forward declaration*/ |
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c index 156d8faa3560..3ba46ede9bbd 100644 --- a/arch/arm/mach-pnx4008/core.c +++ b/arch/arm/mach-pnx4008/core.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | 28 | ||
29 | #include <asm/arch/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
32 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
@@ -38,9 +38,9 @@ | |||
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
40 | 40 | ||
41 | #include <asm/arch/irq.h> | 41 | #include <mach/irq.h> |
42 | #include <asm/arch/clock.h> | 42 | #include <mach/clock.h> |
43 | #include <asm/arch/dma.h> | 43 | #include <mach/dma.h> |
44 | 44 | ||
45 | struct resource spipnx_0_resources[] = { | 45 | struct resource spipnx_0_resources[] = { |
46 | { | 46 | { |
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c index fee0d252854e..833c56be7344 100644 --- a/arch/arm/mach-pnx4008/dma.c +++ b/arch/arm/mach-pnx4008/dma.c | |||
@@ -23,12 +23,12 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | 24 | ||
25 | #include <asm/system.h> | 25 | #include <asm/system.h> |
26 | #include <asm/arch/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <asm/dma.h> | 27 | #include <asm/dma.h> |
28 | #include <asm/dma-mapping.h> | 28 | #include <asm/dma-mapping.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/mach/dma.h> | 30 | #include <asm/mach/dma.h> |
31 | #include <asm/arch/clock.h> | 31 | #include <mach/clock.h> |
32 | 32 | ||
33 | static struct dma_channel { | 33 | static struct dma_channel { |
34 | char *name; | 34 | char *name; |
diff --git a/arch/arm/mach-pnx4008/gpio.c b/arch/arm/mach-pnx4008/gpio.c index ef179cab80e2..fb51f7279e95 100644 --- a/arch/arm/mach-pnx4008/gpio.c +++ b/arch/arm/mach-pnx4008/gpio.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <asm/io.h> | 20 | #include <asm/io.h> |
21 | #include <asm/arch/platform.h> | 21 | #include <mach/platform.h> |
22 | #include <asm/arch/gpio.h> | 22 | #include <mach/gpio.h> |
23 | 23 | ||
24 | /* register definitions */ | 24 | /* register definitions */ |
25 | #define PIO_VA_BASE IO_ADDRESS(PNX4008_PIO_BASE) | 25 | #define PIO_VA_BASE IO_ADDRESS(PNX4008_PIO_BASE) |
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c index 6f308827c4fe..87c093286ff9 100644 --- a/arch/arm/mach-pnx4008/i2c.c +++ b/arch/arm/mach-pnx4008/i2c.c | |||
@@ -14,8 +14,8 @@ | |||
14 | #include <linux/i2c-pnx.h> | 14 | #include <linux/i2c-pnx.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <asm/arch/platform.h> | 17 | #include <mach/platform.h> |
18 | #include <asm/arch/i2c.h> | 18 | #include <mach/i2c.h> |
19 | 19 | ||
20 | static int set_clock_run(struct platform_device *pdev) | 20 | static int set_clock_run(struct platform_device *pdev) |
21 | { | 21 | { |
diff --git a/arch/arm/mach-pnx4008/include/mach/clock.h b/arch/arm/mach-pnx4008/include/mach/clock.h new file mode 100644 index 000000000000..8d2a5ef52c90 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/clock.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/clock.h | ||
3 | * | ||
4 | * Clock control driver for PNX4008 - header file | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef __PNX4008_CLOCK_H__ | ||
14 | #define __PNX4008_CLOCK_H__ | ||
15 | |||
16 | struct module; | ||
17 | struct clk; | ||
18 | |||
19 | #define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE) | ||
20 | #define HCLKDIVCTRL_REG (PWRMAN_VA_BASE + 0x40) | ||
21 | #define PWRCTRL_REG (PWRMAN_VA_BASE + 0x44) | ||
22 | #define PLLCTRL_REG (PWRMAN_VA_BASE + 0x48) | ||
23 | #define OSC13CTRL_REG (PWRMAN_VA_BASE + 0x4c) | ||
24 | #define SYSCLKCTRL_REG (PWRMAN_VA_BASE + 0x50) | ||
25 | #define HCLKPLLCTRL_REG (PWRMAN_VA_BASE + 0x58) | ||
26 | #define USBCTRL_REG (PWRMAN_VA_BASE + 0x64) | ||
27 | #define SDRAMCLKCTRL_REG (PWRMAN_VA_BASE + 0x68) | ||
28 | #define MSCTRL_REG (PWRMAN_VA_BASE + 0x80) | ||
29 | #define BTCLKCTRL (PWRMAN_VA_BASE + 0x84) | ||
30 | #define DUMCLKCTRL_REG (PWRMAN_VA_BASE + 0x90) | ||
31 | #define I2CCLKCTRL_REG (PWRMAN_VA_BASE + 0xac) | ||
32 | #define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0) | ||
33 | #define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4) | ||
34 | #define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8) | ||
35 | #define TIMCLKCTRL_REG (PWRMAN_VA_BASE + 0xbc) | ||
36 | #define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4) | ||
37 | #define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8) | ||
38 | #define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0) | ||
39 | #define UARTCLKCTRL_REG (PWRMAN_VA_BASE + 0xe4) | ||
40 | #define DMACLKCTRL_REG (PWRMAN_VA_BASE + 0xe8) | ||
41 | #define AUTOCLK_CTRL (PWRMAN_VA_BASE + 0xec) | ||
42 | #define JPEGCLKCTRL_REG (PWRMAN_VA_BASE + 0xfc) | ||
43 | |||
44 | #define AUDIOCONFIG_VA_BASE IO_ADDRESS(PNX4008_AUDIOCONFIG_BASE) | ||
45 | #define DSPPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x60) | ||
46 | #define DSPCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x64) | ||
47 | #define AUDIOCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x68) | ||
48 | #define AUDIOPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x6C) | ||
49 | |||
50 | #define USB_OTG_CLKCTRL_REG IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0xff4) | ||
51 | |||
52 | #define VFP9CLKCTRL_REG IO_ADDRESS(PNX4008_DEBUG_BASE) | ||
53 | |||
54 | #define CLK_RATE_13MHZ 13000 | ||
55 | #define CLK_RATE_1MHZ 1000 | ||
56 | #define CLK_RATE_208MHZ 208000 | ||
57 | #define CLK_RATE_48MHZ 48000 | ||
58 | #define CLK_RATE_32KHZ 32 | ||
59 | |||
60 | #define PNX4008_UART_CLK CLK_RATE_13MHZ * 1000 /* in MHz */ | ||
61 | |||
62 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/debug-macro.S b/arch/arm/mach-pnx4008/include/mach/debug-macro.S new file mode 100644 index 000000000000..6d1407f319f8 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/debug-macro.S | |||
@@ -0,0 +1,23 @@ | |||
1 | /* arch/arm/mach-pnx4008/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mrc p15, 0, \rx, c1, c0 | ||
16 | tst \rx, #1 @ MMU enabled? | ||
17 | mov \rx, #0x00090000 | ||
18 | addeq \rx, \rx, #0x40000000 | ||
19 | addne \rx, \rx, #0xf4000000 | ||
20 | .endm | ||
21 | |||
22 | #define UART_SHIFT 2 | ||
23 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/dma.h b/arch/arm/mach-pnx4008/include/mach/dma.h new file mode 100644 index 000000000000..5442d04fc575 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/dma.h | |||
@@ -0,0 +1,162 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/dma.h | ||
3 | * | ||
4 | * PNX4008 DMA header file | ||
5 | * | ||
6 | * Author: Vitaly Wool | ||
7 | * Copyright: MontaVista Software Inc. (c) 2005 | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_DMA_H | ||
15 | #define __ASM_ARCH_DMA_H | ||
16 | |||
17 | #include "platform.h" | ||
18 | |||
19 | #define MAX_DMA_ADDRESS 0xffffffff | ||
20 | |||
21 | #define MAX_DMA_CHANNELS 8 | ||
22 | |||
23 | #define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE) | ||
24 | #define DMAC_INT_STAT (DMAC_BASE + 0x0000) | ||
25 | #define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004) | ||
26 | #define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008) | ||
27 | #define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c) | ||
28 | #define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010) | ||
29 | #define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024) | ||
30 | #define DMAC_CONFIG (DMAC_BASE + 0x0030) | ||
31 | #define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20) | ||
32 | #define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20) | ||
33 | #define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20) | ||
34 | #define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20) | ||
35 | #define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20) | ||
36 | |||
37 | enum { | ||
38 | WIDTH_BYTE = 0, | ||
39 | WIDTH_HWORD, | ||
40 | WIDTH_WORD | ||
41 | }; | ||
42 | |||
43 | enum { | ||
44 | FC_MEM2MEM_DMA, | ||
45 | FC_MEM2PER_DMA, | ||
46 | FC_PER2MEM_DMA, | ||
47 | FC_PER2PER_DMA, | ||
48 | FC_PER2PER_DPER, | ||
49 | FC_MEM2PER_PER, | ||
50 | FC_PER2MEM_PER, | ||
51 | FC_PER2PER_SPER | ||
52 | }; | ||
53 | |||
54 | enum { | ||
55 | DMA_INT_UNKNOWN = 0, | ||
56 | DMA_ERR_INT = 1, | ||
57 | DMA_TC_INT = 2, | ||
58 | }; | ||
59 | |||
60 | enum { | ||
61 | DMA_BUFFER_ALLOCATED = 1, | ||
62 | DMA_HAS_LL = 2, | ||
63 | }; | ||
64 | |||
65 | enum { | ||
66 | PER_CAM_DMA_1 = 0, | ||
67 | PER_NDF_FLASH = 1, | ||
68 | PER_MBX_SLAVE_FIFO = 2, | ||
69 | PER_SPI2_REC_XMIT = 3, | ||
70 | PER_MS_SD_RX_XMIT = 4, | ||
71 | PER_HS_UART_1_XMIT = 5, | ||
72 | PER_HS_UART_1_RX = 6, | ||
73 | PER_HS_UART_2_XMIT = 7, | ||
74 | PER_HS_UART_2_RX = 8, | ||
75 | PER_HS_UART_7_XMIT = 9, | ||
76 | PER_HS_UART_7_RX = 10, | ||
77 | PER_SPI1_REC_XMIT = 11, | ||
78 | PER_MLC_NDF_SREC = 12, | ||
79 | PER_CAM_DMA_2 = 13, | ||
80 | PER_PRNG_INFIFO = 14, | ||
81 | PER_PRNG_OUTFIFO = 15, | ||
82 | }; | ||
83 | |||
84 | struct pnx4008_dma_ch_ctrl { | ||
85 | int tc_mask; | ||
86 | int cacheable; | ||
87 | int bufferable; | ||
88 | int priv_mode; | ||
89 | int di; | ||
90 | int si; | ||
91 | int dest_ahb1; | ||
92 | int src_ahb1; | ||
93 | int dwidth; | ||
94 | int swidth; | ||
95 | int dbsize; | ||
96 | int sbsize; | ||
97 | int tr_size; | ||
98 | }; | ||
99 | |||
100 | struct pnx4008_dma_ch_config { | ||
101 | int halt; | ||
102 | int active; | ||
103 | int lock; | ||
104 | int itc; | ||
105 | int ie; | ||
106 | int flow_cntrl; | ||
107 | int dest_per; | ||
108 | int src_per; | ||
109 | }; | ||
110 | |||
111 | struct pnx4008_dma_ll { | ||
112 | unsigned long src_addr; | ||
113 | unsigned long dest_addr; | ||
114 | u32 next_dma; | ||
115 | unsigned long ch_ctrl; | ||
116 | struct pnx4008_dma_ll *next; | ||
117 | int flags; | ||
118 | void *alloc_data; | ||
119 | int (*free) (void *); | ||
120 | }; | ||
121 | |||
122 | struct pnx4008_dma_config { | ||
123 | int is_ll; | ||
124 | unsigned long src_addr; | ||
125 | unsigned long dest_addr; | ||
126 | unsigned long ch_ctrl; | ||
127 | unsigned long ch_cfg; | ||
128 | struct pnx4008_dma_ll *ll; | ||
129 | u32 ll_dma; | ||
130 | int flags; | ||
131 | void *alloc_data; | ||
132 | int (*free) (void *); | ||
133 | }; | ||
134 | |||
135 | extern struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t *); | ||
136 | extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t); | ||
137 | extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *); | ||
138 | |||
139 | extern int pnx4008_request_channel(char *, int, | ||
140 | void (*)(int, int, void *), | ||
141 | void *); | ||
142 | extern void pnx4008_free_channel(int); | ||
143 | extern int pnx4008_config_dma(int, int, int); | ||
144 | extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl *, | ||
145 | unsigned long *); | ||
146 | extern int pnx4008_dma_parse_control(unsigned long, | ||
147 | struct pnx4008_dma_ch_ctrl *); | ||
148 | extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config *, | ||
149 | unsigned long *); | ||
150 | extern int pnx4008_dma_parse_config(unsigned long, | ||
151 | struct pnx4008_dma_ch_config *); | ||
152 | extern int pnx4008_config_channel(int, struct pnx4008_dma_config *); | ||
153 | extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config *); | ||
154 | extern int pnx4008_dma_ch_enable(int); | ||
155 | extern int pnx4008_dma_ch_disable(int); | ||
156 | extern int pnx4008_dma_ch_enabled(int); | ||
157 | extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config *, | ||
158 | struct pnx4008_dma_ch_ctrl *); | ||
159 | extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll *, | ||
160 | struct pnx4008_dma_ch_ctrl *); | ||
161 | |||
162 | #endif /* _ASM_ARCH_DMA_H */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/entry-macro.S b/arch/arm/mach-pnx4008/include/mach/entry-macro.S new file mode 100644 index 000000000000..8003037578ed --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/entry-macro.S | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for PNX4008-based platforms | ||
5 | * | ||
6 | * 2005-2006 (c) MontaVista Software, Inc. | ||
7 | * Author: Vitaly Wool <vwool@ru.mvista.com> | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include "platform.h" | ||
14 | |||
15 | #define IO_BASE 0xF0000000 | ||
16 | #define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE) | ||
17 | |||
18 | #define INTRC_MASK 0x00 | ||
19 | #define INTRC_RAW_STAT 0x04 | ||
20 | #define INTRC_STAT 0x08 | ||
21 | #define INTRC_POLAR 0x0C | ||
22 | #define INTRC_ACT_TYPE 0x10 | ||
23 | #define INTRC_TYPE 0x14 | ||
24 | |||
25 | #define SIC1_BASE_INT 32 | ||
26 | #define SIC2_BASE_INT 64 | ||
27 | |||
28 | .macro disable_fiq | ||
29 | .endm | ||
30 | |||
31 | .macro get_irqnr_preamble, base, tmp | ||
32 | .endm | ||
33 | |||
34 | .macro arch_ret_to_user, tmp1, tmp2 | ||
35 | .endm | ||
36 | |||
37 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
38 | /* decode the MIC interrupt numbers */ | ||
39 | ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) | ||
40 | ldr \irqstat, [\base, #INTRC_STAT] | ||
41 | |||
42 | cmp \irqstat,#1<<16 | ||
43 | movhs \irqnr,#16 | ||
44 | movlo \irqnr,#0 | ||
45 | movhs \irqstat,\irqstat,lsr#16 | ||
46 | cmp \irqstat,#1<<8 | ||
47 | addhs \irqnr,\irqnr,#8 | ||
48 | movhs \irqstat,\irqstat,lsr#8 | ||
49 | cmp \irqstat,#1<<4 | ||
50 | addhs \irqnr,\irqnr,#4 | ||
51 | movhs \irqstat,\irqstat,lsr#4 | ||
52 | cmp \irqstat,#1<<2 | ||
53 | addhs \irqnr,\irqnr,#2 | ||
54 | movhs \irqstat,\irqstat,lsr#2 | ||
55 | cmp \irqstat,#1<<1 | ||
56 | addhs \irqnr,\irqnr,#1 | ||
57 | |||
58 | /* was there an interrupt ? if not then drop out with EQ status */ | ||
59 | teq \irqstat,#0 | ||
60 | beq 1003f | ||
61 | |||
62 | /* and now check for extended IRQ reasons */ | ||
63 | cmp \irqnr,#1 | ||
64 | bls 1003f | ||
65 | cmp \irqnr,#30 | ||
66 | blo 1002f | ||
67 | |||
68 | /* IRQ 31,30 : High priority cascade IRQ handle */ | ||
69 | /* read the correct SIC */ | ||
70 | /* decoding status after compare : eq is 30 (SIC1) , ne is 31 (SIC2) */ | ||
71 | /* set the base IRQ number */ | ||
72 | ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
73 | moveq \irqnr,#SIC1_BASE_INT | ||
74 | ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
75 | movne \irqnr,#SIC2_BASE_INT | ||
76 | ldr \irqstat, [\base, #INTRC_STAT] | ||
77 | ldr \tmp, [\base, #INTRC_TYPE] | ||
78 | /* and with inverted mask : low priority interrupts */ | ||
79 | and \irqstat,\irqstat,\tmp | ||
80 | b 1004f | ||
81 | |||
82 | 1003: | ||
83 | /* IRQ 1,0 : Low priority cascade IRQ handle */ | ||
84 | /* read the correct SIC */ | ||
85 | /* decoding status after compare : eq is 1 (SIC2) , ne is 0 (SIC1)*/ | ||
86 | /* read the correct SIC */ | ||
87 | /* set the base IRQ number */ | ||
88 | ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
89 | movne \irqnr,#SIC1_BASE_INT | ||
90 | ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
91 | moveq \irqnr,#SIC2_BASE_INT | ||
92 | ldr \irqstat, [\base, #INTRC_STAT] | ||
93 | ldr \tmp, [\base, #INTRC_TYPE] | ||
94 | /* and with inverted mask : low priority interrupts */ | ||
95 | bic \irqstat,\irqstat,\tmp | ||
96 | |||
97 | 1004: | ||
98 | |||
99 | cmp \irqstat,#1<<16 | ||
100 | addhs \irqnr,\irqnr,#16 | ||
101 | movhs \irqstat,\irqstat,lsr#16 | ||
102 | cmp \irqstat,#1<<8 | ||
103 | addhs \irqnr,\irqnr,#8 | ||
104 | movhs \irqstat,\irqstat,lsr#8 | ||
105 | cmp \irqstat,#1<<4 | ||
106 | addhs \irqnr,\irqnr,#4 | ||
107 | movhs \irqstat,\irqstat,lsr#4 | ||
108 | cmp \irqstat,#1<<2 | ||
109 | addhs \irqnr,\irqnr,#2 | ||
110 | movhs \irqstat,\irqstat,lsr#2 | ||
111 | cmp \irqstat,#1<<1 | ||
112 | addhs \irqnr,\irqnr,#1 | ||
113 | |||
114 | |||
115 | /* is irqstat not zero */ | ||
116 | |||
117 | 1002: | ||
118 | /* we assert that irqstat is not equal to zero and return ne status if true*/ | ||
119 | teq \irqstat,#0 | ||
120 | 1003: | ||
121 | .endm | ||
122 | |||
123 | |||
124 | .macro irq_prio_table | ||
125 | .endm | ||
126 | |||
127 | |||
diff --git a/arch/arm/mach-pnx4008/include/mach/gpio.h b/arch/arm/mach-pnx4008/include/mach/gpio.h new file mode 100644 index 000000000000..9591467eb9ec --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/gpio.h | |||
@@ -0,0 +1,241 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/gpio.h | ||
3 | * | ||
4 | * PNX4008 GPIO driver - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips: | ||
9 | * Copyright (c) 2005 Koninklijke Philips Electronics N.V. | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | |||
17 | #ifndef _PNX4008_GPIO_H_ | ||
18 | #define _PNX4008_GPIO_H_ | ||
19 | |||
20 | |||
21 | /* Block numbers */ | ||
22 | #define GPIO_IN (0) | ||
23 | #define GPIO_OUT (0x100) | ||
24 | #define GPIO_BID (0x200) | ||
25 | #define GPIO_RAM (0x300) | ||
26 | #define GPIO_MUX (0x400) | ||
27 | |||
28 | #define GPIO_TYPE_MASK(K) ((K) & 0x700) | ||
29 | |||
30 | /* INPUT GPIOs */ | ||
31 | /* GPI */ | ||
32 | #define GPI_00 (GPIO_IN | 0) | ||
33 | #define GPI_01 (GPIO_IN | 1) | ||
34 | #define GPI_02 (GPIO_IN | 2) | ||
35 | #define GPI_03 (GPIO_IN | 3) | ||
36 | #define GPI_04 (GPIO_IN | 4) | ||
37 | #define GPI_05 (GPIO_IN | 5) | ||
38 | #define GPI_06 (GPIO_IN | 6) | ||
39 | #define GPI_07 (GPIO_IN | 7) | ||
40 | #define GPI_08 (GPIO_IN | 8) | ||
41 | #define GPI_09 (GPIO_IN | 9) | ||
42 | #define U1_RX (GPIO_IN | 15) | ||
43 | #define U2_HTCS (GPIO_IN | 16) | ||
44 | #define U2_RX (GPIO_IN | 17) | ||
45 | #define U3_RX (GPIO_IN | 18) | ||
46 | #define U4_RX (GPIO_IN | 19) | ||
47 | #define U5_RX (GPIO_IN | 20) | ||
48 | #define U6_IRRX (GPIO_IN | 21) | ||
49 | #define U7_HCTS (GPIO_IN | 22) | ||
50 | #define U7_RX (GPIO_IN | 23) | ||
51 | /* MISC IN */ | ||
52 | #define SPI1_DATIN (GPIO_IN | 25) | ||
53 | #define DISP_SYNC (GPIO_IN | 26) | ||
54 | #define SPI2_DATIN (GPIO_IN | 27) | ||
55 | #define GPI_11 (GPIO_IN | 28) | ||
56 | |||
57 | #define GPIO_IN_MASK 0x1eff83ff | ||
58 | |||
59 | /* OUTPUT GPIOs */ | ||
60 | /* GPO */ | ||
61 | #define GPO_00 (GPIO_OUT | 0) | ||
62 | #define GPO_01 (GPIO_OUT | 1) | ||
63 | #define GPO_02 (GPIO_OUT | 2) | ||
64 | #define GPO_03 (GPIO_OUT | 3) | ||
65 | #define GPO_04 (GPIO_OUT | 4) | ||
66 | #define GPO_05 (GPIO_OUT | 5) | ||
67 | #define GPO_06 (GPIO_OUT | 6) | ||
68 | #define GPO_07 (GPIO_OUT | 7) | ||
69 | #define GPO_08 (GPIO_OUT | 8) | ||
70 | #define GPO_09 (GPIO_OUT | 9) | ||
71 | #define GPO_10 (GPIO_OUT | 10) | ||
72 | #define GPO_11 (GPIO_OUT | 11) | ||
73 | #define GPO_12 (GPIO_OUT | 12) | ||
74 | #define GPO_13 (GPIO_OUT | 13) | ||
75 | #define GPO_14 (GPIO_OUT | 14) | ||
76 | #define GPO_15 (GPIO_OUT | 15) | ||
77 | #define GPO_16 (GPIO_OUT | 16) | ||
78 | #define GPO_17 (GPIO_OUT | 17) | ||
79 | #define GPO_18 (GPIO_OUT | 18) | ||
80 | #define GPO_19 (GPIO_OUT | 19) | ||
81 | #define GPO_20 (GPIO_OUT | 20) | ||
82 | #define GPO_21 (GPIO_OUT | 21) | ||
83 | #define GPO_22 (GPIO_OUT | 22) | ||
84 | #define GPO_23 (GPIO_OUT | 23) | ||
85 | |||
86 | #define GPIO_OUT_MASK 0xffffff | ||
87 | |||
88 | /* BIDIRECTIONAL GPIOs */ | ||
89 | /* RAM pins */ | ||
90 | #define RAM_D19 (GPIO_RAM | 0) | ||
91 | #define RAM_D20 (GPIO_RAM | 1) | ||
92 | #define RAM_D21 (GPIO_RAM | 2) | ||
93 | #define RAM_D22 (GPIO_RAM | 3) | ||
94 | #define RAM_D23 (GPIO_RAM | 4) | ||
95 | #define RAM_D24 (GPIO_RAM | 5) | ||
96 | #define RAM_D25 (GPIO_RAM | 6) | ||
97 | #define RAM_D26 (GPIO_RAM | 7) | ||
98 | #define RAM_D27 (GPIO_RAM | 8) | ||
99 | #define RAM_D28 (GPIO_RAM | 9) | ||
100 | #define RAM_D29 (GPIO_RAM | 10) | ||
101 | #define RAM_D30 (GPIO_RAM | 11) | ||
102 | #define RAM_D31 (GPIO_RAM | 12) | ||
103 | |||
104 | #define GPIO_RAM_MASK 0x1fff | ||
105 | |||
106 | /* I/O pins */ | ||
107 | #define GPIO_00 (GPIO_BID | 25) | ||
108 | #define GPIO_01 (GPIO_BID | 26) | ||
109 | #define GPIO_02 (GPIO_BID | 27) | ||
110 | #define GPIO_03 (GPIO_BID | 28) | ||
111 | #define GPIO_04 (GPIO_BID | 29) | ||
112 | #define GPIO_05 (GPIO_BID | 30) | ||
113 | |||
114 | #define GPIO_BID_MASK 0x7e000000 | ||
115 | |||
116 | /* Non-GPIO multiplexed PIOs. For multiplexing with GPIO, please use GPIO macros */ | ||
117 | #define GPIO_SDRAM_SEL (GPIO_MUX | 3) | ||
118 | |||
119 | #define GPIO_MUX_MASK 0x8 | ||
120 | |||
121 | /* Extraction/assembly macros */ | ||
122 | #define GPIO_BIT_MASK(K) ((K) & 0x1F) | ||
123 | #define GPIO_BIT(K) (1 << GPIO_BIT_MASK(K)) | ||
124 | #define GPIO_ISMUX(K) ((GPIO_TYPE_MASK(K) == GPIO_MUX) && (GPIO_BIT(K) & GPIO_MUX_MASK)) | ||
125 | #define GPIO_ISRAM(K) ((GPIO_TYPE_MASK(K) == GPIO_RAM) && (GPIO_BIT(K) & GPIO_RAM_MASK)) | ||
126 | #define GPIO_ISBID(K) ((GPIO_TYPE_MASK(K) == GPIO_BID) && (GPIO_BIT(K) & GPIO_BID_MASK)) | ||
127 | #define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK)) | ||
128 | #define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK)) | ||
129 | |||
130 | /* Start Enable Pin Interrupts - table 58 page 66 */ | ||
131 | |||
132 | #define SE_PIN_BASE_INT 32 | ||
133 | |||
134 | #define SE_U7_RX_INT 63 | ||
135 | #define SE_U7_HCTS_INT 62 | ||
136 | #define SE_BT_CLKREQ_INT 61 | ||
137 | #define SE_U6_IRRX_INT 60 | ||
138 | /*59 unused*/ | ||
139 | #define SE_U5_RX_INT 58 | ||
140 | #define SE_GPI_11_INT 57 | ||
141 | #define SE_U3_RX_INT 56 | ||
142 | #define SE_U2_HCTS_INT 55 | ||
143 | #define SE_U2_RX_INT 54 | ||
144 | #define SE_U1_RX_INT 53 | ||
145 | #define SE_DISP_SYNC_INT 52 | ||
146 | /*51 unused*/ | ||
147 | #define SE_SDIO_INT_N 50 | ||
148 | #define SE_MSDIO_START_INT 49 | ||
149 | #define SE_GPI_06_INT 48 | ||
150 | #define SE_GPI_05_INT 47 | ||
151 | #define SE_GPI_04_INT 46 | ||
152 | #define SE_GPI_03_INT 45 | ||
153 | #define SE_GPI_02_INT 44 | ||
154 | #define SE_GPI_01_INT 43 | ||
155 | #define SE_GPI_00_INT 42 | ||
156 | #define SE_SYSCLKEN_PIN_INT 41 | ||
157 | #define SE_SPI1_DATAIN_INT 40 | ||
158 | #define SE_GPI_07_INT 39 | ||
159 | #define SE_SPI2_DATAIN_INT 38 | ||
160 | #define SE_GPI_10_INT 37 | ||
161 | #define SE_GPI_09_INT 36 | ||
162 | #define SE_GPI_08_INT 35 | ||
163 | /*34-32 unused*/ | ||
164 | |||
165 | /* Start Enable Internal Interrupts - table 57 page 65 */ | ||
166 | |||
167 | #define SE_INT_BASE_INT 0 | ||
168 | |||
169 | #define SE_TS_IRQ 31 | ||
170 | #define SE_TS_P_INT 30 | ||
171 | #define SE_TS_AUX_INT 29 | ||
172 | /*27-28 unused*/ | ||
173 | #define SE_USB_AHB_NEED_CLK_INT 26 | ||
174 | #define SE_MSTIMER_INT 25 | ||
175 | #define SE_RTC_INT 24 | ||
176 | #define SE_USB_NEED_CLK_INT 23 | ||
177 | #define SE_USB_INT 22 | ||
178 | #define SE_USB_I2C_INT 21 | ||
179 | #define SE_USB_OTG_TIMER_INT 20 | ||
180 | #define SE_USB_OTG_ATX_INT_N 19 | ||
181 | /*18 unused*/ | ||
182 | #define SE_DSP_GPIO4_INT 17 | ||
183 | #define SE_KEY_IRQ 16 | ||
184 | #define SE_DSP_SLAVEPORT_INT 15 | ||
185 | #define SE_DSP_GPIO1_INT 14 | ||
186 | #define SE_DSP_GPIO0_INT 13 | ||
187 | #define SE_DSP_AHB_INT 12 | ||
188 | /*11-6 unused*/ | ||
189 | #define SE_GPIO_05_INT 5 | ||
190 | #define SE_GPIO_04_INT 4 | ||
191 | #define SE_GPIO_03_INT 3 | ||
192 | #define SE_GPIO_02_INT 2 | ||
193 | #define SE_GPIO_01_INT 1 | ||
194 | #define SE_GPIO_00_INT 0 | ||
195 | |||
196 | #define START_INT_REG_BIT(irq) (1<<((irq)&0x1F)) | ||
197 | |||
198 | #define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1))) | ||
199 | #define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1))) | ||
200 | #define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1))) | ||
201 | #define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1))) | ||
202 | |||
203 | extern int pnx4008_gpio_register_pin(unsigned short pin); | ||
204 | extern int pnx4008_gpio_unregister_pin(unsigned short pin); | ||
205 | extern unsigned long pnx4008_gpio_read_pin(unsigned short pin); | ||
206 | extern int pnx4008_gpio_write_pin(unsigned short pin, int output); | ||
207 | extern int pnx4008_gpio_set_pin_direction(unsigned short pin, int output); | ||
208 | extern int pnx4008_gpio_read_pin_direction(unsigned short pin); | ||
209 | extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output); | ||
210 | extern int pnx4008_gpio_read_pin_mux(unsigned short pin); | ||
211 | |||
212 | static inline void start_int_umask(u8 irq) | ||
213 | { | ||
214 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) | | ||
215 | START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
216 | } | ||
217 | |||
218 | static inline void start_int_mask(u8 irq) | ||
219 | { | ||
220 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) & | ||
221 | ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
222 | } | ||
223 | |||
224 | static inline void start_int_ack(u8 irq) | ||
225 | { | ||
226 | __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq)); | ||
227 | } | ||
228 | |||
229 | static inline void start_int_set_falling_edge(u8 irq) | ||
230 | { | ||
231 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) & | ||
232 | ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
233 | } | ||
234 | |||
235 | static inline void start_int_set_rising_edge(u8 irq) | ||
236 | { | ||
237 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) | | ||
238 | START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
239 | } | ||
240 | |||
241 | #endif /* _PNX4008_GPIO_H_ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/hardware.h b/arch/arm/mach-pnx4008/include/mach/hardware.h new file mode 100644 index 000000000000..7b98b828d368 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/hardware.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/hardware.h | ||
3 | * | ||
4 | * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARCH_HARDWARE_H | ||
21 | #define __ASM_ARCH_HARDWARE_H | ||
22 | |||
23 | #include <asm/sizes.h> | ||
24 | #include <mach/platform.h> | ||
25 | |||
26 | /* Start of virtual addresses for IO devices */ | ||
27 | #define IO_BASE 0xF0000000 | ||
28 | |||
29 | /* This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 */ | ||
30 | #define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE) | ||
31 | |||
32 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/i2c.h b/arch/arm/mach-pnx4008/include/mach/i2c.h new file mode 100644 index 000000000000..92e8d65006f7 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/i2c.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * PNX4008-specific tweaks for I2C IP3204 block | ||
3 | * | ||
4 | * Author: Vitaly Wool <vwool@ru.mvista.com> | ||
5 | * | ||
6 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_I2C_H__ | ||
13 | #define __ASM_ARCH_I2C_H__ | ||
14 | |||
15 | #include <linux/pm.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | enum { | ||
19 | mstatus_tdi = 0x00000001, | ||
20 | mstatus_afi = 0x00000002, | ||
21 | mstatus_nai = 0x00000004, | ||
22 | mstatus_drmi = 0x00000008, | ||
23 | mstatus_active = 0x00000020, | ||
24 | mstatus_scl = 0x00000040, | ||
25 | mstatus_sda = 0x00000080, | ||
26 | mstatus_rff = 0x00000100, | ||
27 | mstatus_rfe = 0x00000200, | ||
28 | mstatus_tff = 0x00000400, | ||
29 | mstatus_tfe = 0x00000800, | ||
30 | }; | ||
31 | |||
32 | enum { | ||
33 | mcntrl_tdie = 0x00000001, | ||
34 | mcntrl_afie = 0x00000002, | ||
35 | mcntrl_naie = 0x00000004, | ||
36 | mcntrl_drmie = 0x00000008, | ||
37 | mcntrl_daie = 0x00000020, | ||
38 | mcntrl_rffie = 0x00000040, | ||
39 | mcntrl_tffie = 0x00000080, | ||
40 | mcntrl_reset = 0x00000100, | ||
41 | mcntrl_cdbmode = 0x00000400, | ||
42 | }; | ||
43 | |||
44 | enum { | ||
45 | rw_bit = 1 << 0, | ||
46 | start_bit = 1 << 8, | ||
47 | stop_bit = 1 << 9, | ||
48 | }; | ||
49 | |||
50 | #define I2C_REG_RX(a) ((a)->ioaddr) /* Rx FIFO reg (RO) */ | ||
51 | #define I2C_REG_TX(a) ((a)->ioaddr) /* Tx FIFO reg (WO) */ | ||
52 | #define I2C_REG_STS(a) ((a)->ioaddr + 0x04) /* Status reg (RO) */ | ||
53 | #define I2C_REG_CTL(a) ((a)->ioaddr + 0x08) /* Ctl reg */ | ||
54 | #define I2C_REG_CKL(a) ((a)->ioaddr + 0x0c) /* Clock divider low */ | ||
55 | #define I2C_REG_CKH(a) ((a)->ioaddr + 0x10) /* Clock divider high */ | ||
56 | #define I2C_REG_ADR(a) ((a)->ioaddr + 0x14) /* I2C address */ | ||
57 | #define I2C_REG_RFL(a) ((a)->ioaddr + 0x18) /* Rx FIFO level (RO) */ | ||
58 | #define I2C_REG_TFL(a) ((a)->ioaddr + 0x1c) /* Tx FIFO level (RO) */ | ||
59 | #define I2C_REG_RXB(a) ((a)->ioaddr + 0x20) /* Num of bytes Rx-ed (RO) */ | ||
60 | #define I2C_REG_TXB(a) ((a)->ioaddr + 0x24) /* Num of bytes Tx-ed (RO) */ | ||
61 | #define I2C_REG_TXS(a) ((a)->ioaddr + 0x28) /* Tx slave FIFO (RO) */ | ||
62 | #define I2C_REG_STFL(a) ((a)->ioaddr + 0x2c) /* Tx slave FIFO level (RO) */ | ||
63 | |||
64 | #define HCLK_MHZ 13 | ||
65 | #define I2C_CHIP_NAME "PNX4008-I2C" | ||
66 | |||
67 | #endif /* __ASM_ARCH_I2C_H___ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/io.h b/arch/arm/mach-pnx4008/include/mach/io.h new file mode 100644 index 000000000000..c6206f25839d --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/io.h | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | /* | ||
3 | * arch/arm/mach-pnx4008/include/mach/io.h | ||
4 | * | ||
5 | * Author: Dmitry Chigirev <chigirev@ru.mvista.com> | ||
6 | * | ||
7 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
8 | * the terms of the GNU General Public License version 2. This program | ||
9 | * is licensed "as is" without any warranty of any kind, whether express | ||
10 | * or implied. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARM_ARCH_IO_H | ||
14 | #define __ASM_ARM_ARCH_IO_H | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | |||
18 | #define __io(a) ((void __iomem *)(a)) | ||
19 | #define __mem_pci(a) (a) | ||
20 | |||
21 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/irq.h b/arch/arm/mach-pnx4008/include/mach/irq.h new file mode 100644 index 000000000000..2a690ca33870 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/irq.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/irq.h | ||
3 | * | ||
4 | * PNX4008 IRQ controller driver - header file | ||
5 | * this one is used in entry-arnv.S as well so it cannot contain C code | ||
6 | * | ||
7 | * Copyright (c) 2005 Philips Semiconductors | ||
8 | * Copyright (c) 2005 MontaVista Software, Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | #ifndef __PNX4008_IRQ_H__ | ||
16 | #define __PNX4008_IRQ_H__ | ||
17 | |||
18 | #define MIC_VA_BASE IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) | ||
19 | #define SIC1_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
20 | #define SIC2_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
21 | |||
22 | /* Manual: Chapter 20, page 195 */ | ||
23 | |||
24 | #define INTC_BIT(irq) (1<< ((irq) & 0x1F)) | ||
25 | |||
26 | #define INTC_ER(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x0 + (((irq)&(0x3<<5))<<9))) | ||
27 | #define INTC_RSR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x4 + (((irq)&(0x3<<5))<<9))) | ||
28 | #define INTC_SR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x8 + (((irq)&(0x3<<5))<<9))) | ||
29 | #define INTC_APR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0xC + (((irq)&(0x3<<5))<<9))) | ||
30 | #define INTC_ATR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x10 + (((irq)&(0x3<<5))<<9))) | ||
31 | #define INTC_ITR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x14 + (((irq)&(0x3<<5))<<9))) | ||
32 | |||
33 | #define START_INT_REG_BIT(irq) (1<<((irq)&0x1F)) | ||
34 | |||
35 | #define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1))) | ||
36 | #define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1))) | ||
37 | #define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1))) | ||
38 | #define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1))) | ||
39 | |||
40 | extern void __init pnx4008_init_irq(void); | ||
41 | |||
42 | #endif /* __PNX4008_IRQ_H__ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/irqs.h b/arch/arm/mach-pnx4008/include/mach/irqs.h new file mode 100644 index 000000000000..f6b33cf23ae2 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/irqs.h | |||
@@ -0,0 +1,215 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/irqs.h | ||
3 | * | ||
4 | * PNX4008 IRQ controller driver - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef __PNX4008_IRQS_h__ | ||
14 | #define __PNX4008_IRQS_h__ | ||
15 | |||
16 | #define NR_IRQS 96 | ||
17 | |||
18 | /*Manual: table 259, page 199*/ | ||
19 | |||
20 | /*SUB2 Interrupt Routing (SIC2)*/ | ||
21 | |||
22 | #define SIC2_BASE_INT 64 | ||
23 | |||
24 | #define CLK_SWITCH_ARM_INT 95 /*manual: Clkswitch ARM */ | ||
25 | #define CLK_SWITCH_DSP_INT 94 /*manual: ClkSwitch DSP */ | ||
26 | #define CLK_SWITCH_AUD_INT 93 /*manual: Clkswitch AUD */ | ||
27 | #define GPI_06_INT 92 | ||
28 | #define GPI_05_INT 91 | ||
29 | #define GPI_04_INT 90 | ||
30 | #define GPI_03_INT 89 | ||
31 | #define GPI_02_INT 88 | ||
32 | #define GPI_01_INT 87 | ||
33 | #define GPI_00_INT 86 | ||
34 | #define BT_CLKREQ_INT 85 | ||
35 | #define SPI1_DATIN_INT 84 | ||
36 | #define U5_RX_INT 83 | ||
37 | #define SDIO_INT_N 82 | ||
38 | #define CAM_HS_INT 81 | ||
39 | #define CAM_VS_INT 80 | ||
40 | #define GPI_07_INT 79 | ||
41 | #define DISP_SYNC_INT 78 | ||
42 | #define DSP_INT8 77 | ||
43 | #define U7_HCTS_INT 76 | ||
44 | #define GPI_10_INT 75 | ||
45 | #define GPI_09_INT 74 | ||
46 | #define GPI_08_INT 73 | ||
47 | #define DSP_INT7 72 | ||
48 | #define U2_HCTS_INT 71 | ||
49 | #define SPI2_DATIN_INT 70 | ||
50 | #define GPIO_05_INT 69 | ||
51 | #define GPIO_04_INT 68 | ||
52 | #define GPIO_03_INT 67 | ||
53 | #define GPIO_02_INT 66 | ||
54 | #define GPIO_01_INT 65 | ||
55 | #define GPIO_00_INT 64 | ||
56 | |||
57 | /*Manual: table 258, page 198*/ | ||
58 | |||
59 | /*SUB1 Interrupt Routing (SIC1)*/ | ||
60 | |||
61 | #define SIC1_BASE_INT 32 | ||
62 | |||
63 | #define USB_I2C_INT 63 | ||
64 | #define USB_DEV_HP_INT 62 | ||
65 | #define USB_DEV_LP_INT 61 | ||
66 | #define USB_DEV_DMA_INT 60 | ||
67 | #define USB_HOST_INT 59 | ||
68 | #define USB_OTG_ATX_INT_N 58 | ||
69 | #define USB_OTG_TIMER_INT 57 | ||
70 | #define SW_INT 56 | ||
71 | #define SPI1_INT 55 | ||
72 | #define KEY_IRQ 54 | ||
73 | #define DSP_M_INT 53 | ||
74 | #define RTC_INT 52 | ||
75 | #define I2C_1_INT 51 | ||
76 | #define I2C_2_INT 50 | ||
77 | #define PLL1_LOCK_INT 49 | ||
78 | #define PLL2_LOCK_INT 48 | ||
79 | #define PLL3_LOCK_INT 47 | ||
80 | #define PLL4_LOCK_INT 46 | ||
81 | #define PLL5_LOCK_INT 45 | ||
82 | #define SPI2_INT 44 | ||
83 | #define DSP_INT1 43 | ||
84 | #define DSP_INT2 42 | ||
85 | #define DSP_TDM_INT2 41 | ||
86 | #define TS_AUX_INT 40 | ||
87 | #define TS_IRQ 39 | ||
88 | #define TS_P_INT 38 | ||
89 | #define UOUT1_TO_PAD_INT 37 | ||
90 | #define GPI_11_INT 36 | ||
91 | #define DSP_INT4 35 | ||
92 | #define JTAG_COMM_RX_INT 34 | ||
93 | #define JTAG_COMM_TX_INT 33 | ||
94 | #define DSP_INT3 32 | ||
95 | |||
96 | /*Manual: table 257, page 197*/ | ||
97 | |||
98 | /*MAIN Interrupt Routing*/ | ||
99 | |||
100 | #define MAIN_BASE_INT 0 | ||
101 | |||
102 | #define SUB2_FIQ_N 31 /*active low */ | ||
103 | #define SUB1_FIQ_N 30 /*active low */ | ||
104 | #define JPEG_INT 29 | ||
105 | #define DMA_INT 28 | ||
106 | #define MSTIMER_INT 27 | ||
107 | #define IIR1_INT 26 | ||
108 | #define IIR2_INT 25 | ||
109 | #define IIR7_INT 24 | ||
110 | #define DSP_TDM_INT0 23 | ||
111 | #define DSP_TDM_INT1 22 | ||
112 | #define DSP_P_INT 21 | ||
113 | #define DSP_INT0 20 | ||
114 | #define DUM_INT 19 | ||
115 | #define UOUT0_TO_PAD_INT 18 | ||
116 | #define MP4_ENC_INT 17 | ||
117 | #define MP4_DEC_INT 16 | ||
118 | #define SD0_INT 15 | ||
119 | #define MBX_INT 14 | ||
120 | #define SD1_INT 13 | ||
121 | #define MS_INT_N 12 | ||
122 | #define FLASH_INT 11 /*NAND*/ | ||
123 | #define IIR6_INT 10 | ||
124 | #define IIR5_INT 9 | ||
125 | #define IIR4_INT 8 | ||
126 | #define IIR3_INT 7 | ||
127 | #define WATCH_INT 6 | ||
128 | #define HSTIMER_INT 5 | ||
129 | #define ARCH_TIMER_IRQ HSTIMER_INT | ||
130 | #define CAM_INT 4 | ||
131 | #define PRNG_INT 3 | ||
132 | #define CRYPTO_INT 2 | ||
133 | #define SUB2_IRQ_N 1 /*active low */ | ||
134 | #define SUB1_IRQ_N 0 /*active low */ | ||
135 | |||
136 | #define PNX4008_IRQ_TYPES \ | ||
137 | { /*IRQ #'s: */ \ | ||
138 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 0, 1, 2, 3 */ \ | ||
139 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 4, 5, 6, 7 */ \ | ||
140 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 8, 9,10,11 */ \ | ||
141 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 12,13,14,15 */ \ | ||
142 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 16,17,18,19 */ \ | ||
143 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 20,21,22,23 */ \ | ||
144 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 24,25,26,27 */ \ | ||
145 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 28,29,30,31 */ \ | ||
146 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 32,33,34,35 */ \ | ||
147 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH, /* 36,37,38,39 */ \ | ||
148 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 40,41,42,43 */ \ | ||
149 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 44,45,46,47 */ \ | ||
150 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 48,49,50,51 */ \ | ||
151 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 52,53,54,55 */ \ | ||
152 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 56,57,58,59 */ \ | ||
153 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 60,61,62,63 */ \ | ||
154 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 64,65,66,67 */ \ | ||
155 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 68,69,70,71 */ \ | ||
156 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 72,73,74,75 */ \ | ||
157 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 76,77,78,79 */ \ | ||
158 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 80,81,82,83 */ \ | ||
159 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 84,85,86,87 */ \ | ||
160 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 88,89,90,91 */ \ | ||
161 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 92,93,94,95 */ \ | ||
162 | } | ||
163 | |||
164 | /* Start Enable Pin Interrupts - table 58 page 66 */ | ||
165 | |||
166 | #define SE_PIN_BASE_INT 32 | ||
167 | |||
168 | #define SE_U7_RX_INT 63 | ||
169 | #define SE_U7_HCTS_INT 62 | ||
170 | #define SE_BT_CLKREQ_INT 61 | ||
171 | #define SE_U6_IRRX_INT 60 | ||
172 | /*59 unused*/ | ||
173 | #define SE_U5_RX_INT 58 | ||
174 | #define SE_GPI_11_INT 57 | ||
175 | #define SE_U3_RX_INT 56 | ||
176 | #define SE_U2_HCTS_INT 55 | ||
177 | #define SE_U2_RX_INT 54 | ||
178 | #define SE_U1_RX_INT 53 | ||
179 | #define SE_DISP_SYNC_INT 52 | ||
180 | /*51 unused*/ | ||
181 | #define SE_SDIO_INT_N 50 | ||
182 | #define SE_MSDIO_START_INT 49 | ||
183 | #define SE_GPI_06_INT 48 | ||
184 | #define SE_GPI_05_INT 47 | ||
185 | #define SE_GPI_04_INT 46 | ||
186 | #define SE_GPI_03_INT 45 | ||
187 | #define SE_GPI_02_INT 44 | ||
188 | #define SE_GPI_01_INT 43 | ||
189 | #define SE_GPI_00_INT 42 | ||
190 | #define SE_SYSCLKEN_PIN_INT 41 | ||
191 | #define SE_SPI1_DATAIN_INT 40 | ||
192 | #define SE_GPI_07_INT 39 | ||
193 | #define SE_SPI2_DATAIN_INT 38 | ||
194 | #define SE_GPI_10_INT 37 | ||
195 | #define SE_GPI_09_INT 36 | ||
196 | #define SE_GPI_08_INT 35 | ||
197 | /*34-32 unused*/ | ||
198 | |||
199 | /* Start Enable Internal Interrupts - table 57 page 65 */ | ||
200 | |||
201 | #define SE_INT_BASE_INT 0 | ||
202 | |||
203 | #define SE_TS_IRQ 31 | ||
204 | #define SE_TS_P_INT 30 | ||
205 | #define SE_TS_AUX_INT 29 | ||
206 | /*27-28 unused*/ | ||
207 | #define SE_USB_AHB_NEED_CLK_INT 26 | ||
208 | #define SE_MSTIMER_INT 25 | ||
209 | #define SE_RTC_INT 24 | ||
210 | #define SE_USB_NEED_CLK_INT 23 | ||
211 | #define SE_USB_INT 22 | ||
212 | #define SE_USB_I2C_INT 21 | ||
213 | #define SE_USB_OTG_TIMER_INT 20 | ||
214 | |||
215 | #endif /* __PNX4008_IRQS_h__ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/memory.h b/arch/arm/mach-pnx4008/include/mach/memory.h new file mode 100644 index 000000000000..5789a2d16f5a --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/memory.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/memory.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Philips Semiconductors | ||
5 | * Copyright (c) 2005 MontaVista Software, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_MEMORY_H | ||
14 | #define __ASM_ARCH_MEMORY_H | ||
15 | |||
16 | /* | ||
17 | * Physical DRAM offset. | ||
18 | */ | ||
19 | #define PHYS_OFFSET (0x80000000) | ||
20 | |||
21 | #define __virt_to_bus(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) | ||
22 | #define __bus_to_virt(x) ((x) + PAGE_OFFSET - PHYS_OFFSET) | ||
23 | |||
24 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/param.h b/arch/arm/mach-pnx4008/include/mach/param.h new file mode 100644 index 000000000000..6ea02f2176b7 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/param.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/param.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #define HZ 100 | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/platform.h b/arch/arm/mach-pnx4008/include/mach/platform.h new file mode 100644 index 000000000000..368c2c10a308 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/platform.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/platform.h | ||
3 | * | ||
4 | * PNX4008 Base addresses - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code received from Philips: | ||
9 | * Copyright (C) 2003 Philips Semiconductors | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | |||
17 | |||
18 | #ifndef __ASM_ARCH_PLATFORM_H__ | ||
19 | #define __ASM_ARCH_PLATFORM_H__ | ||
20 | |||
21 | #define PNX4008_IRAM_BASE 0x08000000 | ||
22 | #define PNX4008_IRAM_SIZE 0x00010000 | ||
23 | #define PNX4008_YUV_SLAVE_BASE 0x10000000 | ||
24 | #define PNX4008_DUM_SLAVE_BASE 0x18000000 | ||
25 | #define PNX4008_NDF_FLASH_BASE 0x20020000 | ||
26 | #define PNX4008_SPI1_BASE 0x20088000 | ||
27 | #define PNX4008_SPI2_BASE 0x20090000 | ||
28 | #define PNX4008_SD_CONFIG_BASE 0x20098000 | ||
29 | #define PNX4008_FLASH_DATA 0x200B0000 | ||
30 | #define PNX4008_MLC_FLASH_BASE 0x200B8000 | ||
31 | #define PNX4008_JPEG_CONFIG_BASE 0x300A0000 | ||
32 | #define PNX4008_DMA_CONFIG_BASE 0x31000000 | ||
33 | #define PNX4008_USB_CONFIG_BASE 0x31020000 | ||
34 | #define PNX4008_SDRAM_CFG_BASE 0x31080000 | ||
35 | #define PNX4008_AHB2FAB_BASE 0x40000000 | ||
36 | #define PNX4008_PWRMAN_BASE 0x40004000 | ||
37 | #define PNX4008_INTCTRLMIC_BASE 0x40008000 | ||
38 | #define PNX4008_INTCTRLSIC1_BASE 0x4000C000 | ||
39 | #define PNX4008_INTCTRLSIC2_BASE 0x40010000 | ||
40 | #define PNX4008_HSUART1_BASE 0x40014000 | ||
41 | #define PNX4008_HSUART2_BASE 0x40018000 | ||
42 | #define PNX4008_HSUART7_BASE 0x4001C000 | ||
43 | #define PNX4008_RTC_BASE 0x40024000 | ||
44 | #define PNX4008_PIO_BASE 0x40028000 | ||
45 | #define PNX4008_MSTIMER_BASE 0x40034000 | ||
46 | #define PNX4008_HSTIMER_BASE 0x40038000 | ||
47 | #define PNX4008_WDOG_BASE 0x4003C000 | ||
48 | #define PNX4008_DEBUG_BASE 0x40040000 | ||
49 | #define PNX4008_TOUCH1_BASE 0x40048000 | ||
50 | #define PNX4008_KEYSCAN_BASE 0x40050000 | ||
51 | #define PNX4008_UARTCTRL_BASE 0x40054000 | ||
52 | #define PNX4008_PWM_BASE 0x4005C000 | ||
53 | #define PNX4008_UART3_BASE 0x40080000 | ||
54 | #define PNX4008_UART4_BASE 0x40088000 | ||
55 | #define PNX4008_UART5_BASE 0x40090000 | ||
56 | #define PNX4008_UART6_BASE 0x40098000 | ||
57 | #define PNX4008_I2C1_BASE 0x400A0000 | ||
58 | #define PNX4008_I2C2_BASE 0x400A8000 | ||
59 | #define PNX4008_MAGICGATE_BASE 0x400B0000 | ||
60 | #define PNX4008_DUMCONF_BASE 0x400B8000 | ||
61 | #define PNX4008_DUM_MAINCFG_BASE 0x400BC000 | ||
62 | #define PNX4008_DSP_BASE 0x400C0000 | ||
63 | #define PNX4008_PROFCOUNTER_BASE 0x400C8000 | ||
64 | #define PNX4008_CRYPTO_BASE 0x400D0000 | ||
65 | #define PNX4008_CAMIFCONF_BASE 0x400D8000 | ||
66 | #define PNX4008_YUV2RGB_BASE 0x400E0000 | ||
67 | #define PNX4008_AUDIOCONFIG_BASE 0x400E8000 | ||
68 | |||
69 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/pm.h b/arch/arm/mach-pnx4008/include/mach/pm.h new file mode 100644 index 000000000000..2fa685bff858 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/pm.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/pm.h | ||
3 | * | ||
4 | * PNX4008 Power Management Routiness - header file | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_PNX4008_PM_H | ||
15 | #define __ASM_ARCH_PNX4008_PM_H | ||
16 | |||
17 | #ifndef __ASSEMBLER__ | ||
18 | #include "irq.h" | ||
19 | #include "irqs.h" | ||
20 | #include "clock.h" | ||
21 | |||
22 | extern void pnx4008_pm_idle(void); | ||
23 | extern void pnx4008_pm_suspend(void); | ||
24 | extern unsigned int pnx4008_cpu_suspend_sz; | ||
25 | extern void pnx4008_cpu_suspend(void); | ||
26 | extern unsigned int pnx4008_cpu_standby_sz; | ||
27 | extern void pnx4008_cpu_standby(void); | ||
28 | |||
29 | extern int pnx4008_startup_pll(struct clk *); | ||
30 | extern int pnx4008_shutdown_pll(struct clk *); | ||
31 | |||
32 | #endif /* ASSEMBLER */ | ||
33 | #endif /* __ASM_ARCH_PNX4008_PM_H */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h new file mode 100644 index 000000000000..8985a4622b8c --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/system.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/system.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Philips Semiconductors | ||
5 | * Copyright (C) 2005 MontaVista Software, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | #ifndef __ASM_ARCH_SYSTEM_H | ||
22 | #define __ASM_ARCH_SYSTEM_H | ||
23 | |||
24 | #include <mach/hardware.h> | ||
25 | #include <asm/io.h> | ||
26 | #include <mach/platform.h> | ||
27 | |||
28 | static void arch_idle(void) | ||
29 | { | ||
30 | cpu_do_idle(); | ||
31 | } | ||
32 | |||
33 | static inline void arch_reset(char mode) | ||
34 | { | ||
35 | cpu_reset(0); | ||
36 | } | ||
37 | |||
38 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/timex.h b/arch/arm/mach-pnx4008/include/mach/timex.h new file mode 100644 index 000000000000..956fbd8e977c --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/timex.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/timex.h | ||
3 | * | ||
4 | * PNX4008 timers header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PNX4008_TIMEX_H | ||
15 | #define __PNX4008_TIMEX_H | ||
16 | |||
17 | #include <mach/hardware.h> | ||
18 | #include <asm/io.h> | ||
19 | |||
20 | #define CLOCK_TICK_RATE 1000000 | ||
21 | |||
22 | #define TICKS2USECS(x) (x) | ||
23 | |||
24 | /* MilliSecond Timer - Chapter 21 Page 202 */ | ||
25 | |||
26 | #define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0)) | ||
27 | #define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4)) | ||
28 | #define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8)) | ||
29 | #define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14)) | ||
30 | #define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18)) | ||
31 | #define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c)) | ||
32 | |||
33 | /* High Speed Timer - Chpater 22, Page 205 */ | ||
34 | |||
35 | #define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0)) | ||
36 | #define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4)) | ||
37 | #define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8)) | ||
38 | #define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC)) | ||
39 | #define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10)) | ||
40 | #define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14)) | ||
41 | #define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18)) | ||
42 | #define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c)) | ||
43 | #define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20)) | ||
44 | #define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28)) | ||
45 | #define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C)) | ||
46 | #define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30)) | ||
47 | |||
48 | /* IMPORTANT: both timers are UPCOUNTING */ | ||
49 | |||
50 | /* xSTIM_MCTRL bit definitions */ | ||
51 | #define MR0_INT 1 | ||
52 | #define RESET_COUNT0 (1<<1) | ||
53 | #define STOP_COUNT0 (1<<2) | ||
54 | #define MR1_INT (1<<3) | ||
55 | #define RESET_COUNT1 (1<<4) | ||
56 | #define STOP_COUNT1 (1<<5) | ||
57 | #define MR2_INT (1<<6) | ||
58 | #define RESET_COUNT2 (1<<7) | ||
59 | #define STOP_COUNT2 (1<<8) | ||
60 | |||
61 | /* xSTIM_CTRL bit definitions */ | ||
62 | #define COUNT_ENAB 1 | ||
63 | #define RESET_COUNT (1<<1) | ||
64 | #define DEBUG_EN (1<<2) | ||
65 | |||
66 | /* xSTIM_INT bit definitions */ | ||
67 | #define MATCH0_INT 1 | ||
68 | #define MATCH1_INT (1<<1) | ||
69 | #define MATCH2_INT (1<<2) | ||
70 | #define RTC_TICK0 (1<<4) | ||
71 | #define RTC_TICK1 (1<<5) | ||
72 | |||
73 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h new file mode 100644 index 000000000000..bb4751ee2539 --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * Copyright (C) 2006 MontaVista Software, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #define UART5_BASE 0x40090000 | ||
23 | |||
24 | #define UART5_DR (*(volatile unsigned char *) (UART5_BASE)) | ||
25 | #define UART5_FR (*(volatile unsigned char *) (UART5_BASE + 18)) | ||
26 | |||
27 | static __inline__ void putc(char c) | ||
28 | { | ||
29 | while (UART5_FR & (1 << 5)) | ||
30 | barrier(); | ||
31 | |||
32 | UART5_DR = c; | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * This does not append a newline | ||
37 | */ | ||
38 | static inline void flush(void) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * nothing to do | ||
44 | */ | ||
45 | #define arch_decomp_setup() | ||
46 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/vmalloc.h b/arch/arm/mach-pnx4008/include/mach/vmalloc.h new file mode 100644 index 000000000000..2ad398378aed --- /dev/null +++ b/arch/arm/mach-pnx4008/include/mach/vmalloc.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Author: Vitaly Wool <source@mvista.com> | ||
5 | * | ||
6 | * 2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * Just any arbitrary offset to the start of the vmalloc VM area: the | ||
14 | * current 8MB value just means that there will be a 8MB "hole" after the | ||
15 | * physical memory until the kernel virtual memory starts. That means that | ||
16 | * any out-of-bounds memory accesses will hopefully be caught. | ||
17 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | ||
18 | * area for the same reason. ;) | ||
19 | */ | ||
20 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | ||
diff --git a/arch/arm/mach-pnx4008/irq.c b/arch/arm/mach-pnx4008/irq.c index 7eba2929a137..5c4f55af5d4b 100644 --- a/arch/arm/mach-pnx4008/irq.c +++ b/arch/arm/mach-pnx4008/irq.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/ioport.h> | 23 | #include <linux/ioport.h> |
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <asm/arch/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <asm/io.h> | 27 | #include <asm/io.h> |
28 | #include <asm/setup.h> | 28 | #include <asm/setup.h> |
29 | #include <asm/pgtable.h> | 29 | #include <asm/pgtable.h> |
@@ -32,7 +32,7 @@ | |||
32 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/irq.h> | 33 | #include <asm/mach/irq.h> |
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | #include <asm/arch/irq.h> | 35 | #include <mach/irq.h> |
36 | 36 | ||
37 | static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; | 37 | static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; |
38 | 38 | ||
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c index 52c51f91ed8a..f970906d8848 100644 --- a/arch/arm/mach-pnx4008/pm.c +++ b/arch/arm/mach-pnx4008/pm.c | |||
@@ -21,8 +21,8 @@ | |||
21 | 21 | ||
22 | #include <asm/io.h> | 22 | #include <asm/io.h> |
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/arch/pm.h> | 24 | #include <mach/pm.h> |
25 | #include <asm/arch/clock.h> | 25 | #include <mach/clock.h> |
26 | 26 | ||
27 | #define SRAM_VA IO_ADDRESS(PNX4008_IRAM_BASE) | 27 | #define SRAM_VA IO_ADDRESS(PNX4008_IRAM_BASE) |
28 | 28 | ||
diff --git a/arch/arm/mach-pnx4008/serial.c b/arch/arm/mach-pnx4008/serial.c index a95bd19e00cb..9be84bbb30e8 100644 --- a/arch/arm/mach-pnx4008/serial.c +++ b/arch/arm/mach-pnx4008/serial.c | |||
@@ -15,14 +15,14 @@ | |||
15 | 15 | ||
16 | #include <asm/io.h> | 16 | #include <asm/io.h> |
17 | 17 | ||
18 | #include <asm/arch/platform.h> | 18 | #include <mach/platform.h> |
19 | #include <asm/arch/hardware.h> | 19 | #include <mach/hardware.h> |
20 | 20 | ||
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/serial_reg.h> | 22 | #include <linux/serial_reg.h> |
23 | #include <asm/arch/gpio.h> | 23 | #include <mach/gpio.h> |
24 | 24 | ||
25 | #include <asm/arch/clock.h> | 25 | #include <mach/clock.h> |
26 | 26 | ||
27 | #define UART_3 0 | 27 | #define UART_3 0 |
28 | #define UART_4 1 | 28 | #define UART_4 1 |
diff --git a/arch/arm/mach-pnx4008/sleep.S b/arch/arm/mach-pnx4008/sleep.S index fe6bdcdda4f3..f4eed495d295 100644 --- a/arch/arm/mach-pnx4008/sleep.S +++ b/arch/arm/mach-pnx4008/sleep.S | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
16 | #include <asm/arch/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
18 | #define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE) | 18 | #define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE) |
19 | #define PWR_CTRL_REG_OFFS 0x44 | 19 | #define PWR_CTRL_REG_OFFS 0x44 |
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c index 616cb3e96059..180975244f96 100644 --- a/arch/arm/mach-pnx4008/time.c +++ b/arch/arm/mach-pnx4008/time.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | 25 | ||
26 | #include <asm/system.h> | 26 | #include <asm/system.h> |
27 | #include <asm/arch/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | #include <asm/leds.h> | 29 | #include <asm/leds.h> |
30 | #include <asm/mach/time.h> | 30 | #include <asm/mach/time.h> |