diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:40:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:40:55 -0400 |
commit | 85b375a613085b78531ec86369a51c2f3b922f95 (patch) | |
tree | 716437d598de92bbd7acaf24622e9a7d74fc209a /include/asm-arm/arch-ns9xxx | |
parent | ec965350bb98bd291eb34f6ecddfdcfc36da1e6e (diff) | |
parent | cf816ecb533ab96b883dfdc0db174598b5b5c4d2 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (212 commits)
[ARM] pxa: Phycore pcm-990-specific code for the PXA270 Quick Capture driver
[ARM] pxa: V4L2 soc_camera driver for PXA270
[ARM] pxa: restrict availability of pxa2xx PCMCIA drivers
[ARM] 5005/1: BAST: Fix kset_name initialiser
[ARM] 4967/1: Adds functions to set clkout rate for Samsung S3C2410
[ARM] 4988/1: Add GPIO lib support to the EP93xx
[ARM] Add initial sparsemem support
[ARM] pxa: initialise PXA devices before platform init code
[ARM] 5002/1: tosa: add two more leds
[ARM] 5004/1: Tosa: make several unreferenced structures static.
[ARM] 5003/1: Shut up sparse warnings
[ARM] 4977/2: soc - pxa2xx-ac97 - Add missing clk_enable()
[ARM] 4976/1: zylonite: Configure GPIO for WM9713 IRQ line
[ARM] 4974/1: Drop unused leds-tosa.
[ARM] 4973/1: Tosa: use leds-gpio driver.
[ARM] 4972/1: Tosa: convert scoop GPIOs usage to generic gpio code
[ARM] 4971/1: pxaficp_ir: provide startup and shutdown hooks
[ARM] pxa: lubbock: move mis-placed SPI info
[ARM] 4970/1: tosa: correct gpio used for wake up.
[ARM] 4966/1: magician: add MFP pin configuration
...
Diffstat (limited to 'include/asm-arm/arch-ns9xxx')
-rw-r--r-- | include/asm-arm/arch-ns9xxx/board.h | 28 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/clock.h | 71 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/entry-macro.S | 6 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/irqs.h | 67 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/module.h | 60 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/processor-ns9360.h | 32 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/processor.h | 31 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/regs-sys-common.h | 31 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h (renamed from include/asm-arm/arch-ns9xxx/regs-sys.h) | 25 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/system.h | 17 | ||||
-rw-r--r-- | include/asm-arm/arch-ns9xxx/uncompress.h | 143 |
11 files changed, 362 insertions, 149 deletions
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h index 716f34fdb716..e57443bdbbd9 100644 --- a/include/asm-arm/arch-ns9xxx/board.h +++ b/include/asm-arm/arch-ns9xxx/board.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/board.h | 2 | * include/asm-arm/arch-ns9xxx/board.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -13,8 +13,30 @@ | |||
13 | 13 | ||
14 | #include <asm/mach-types.h> | 14 | #include <asm/mach-types.h> |
15 | 15 | ||
16 | #define board_is_a9m9750dev() (machine_is_cc9p9360dev()) | 16 | #define board_is_a9m9750dev() (0 \ |
17 | || machine_is_cc9p9360dev() \ | ||
18 | || machine_is_cc9p9750dev() \ | ||
19 | ) | ||
17 | 20 | ||
18 | #define board_is_jscc9p9360() (machine_is_cc9p9360js()) | 21 | #define board_is_a9mvali() (0 \ |
22 | || machine_is_cc9p9360val() \ | ||
23 | || machine_is_cc9p9750val() \ | ||
24 | ) | ||
25 | |||
26 | #define board_is_jscc9p9210() (0 \ | ||
27 | || machine_is_cc9p9210js() \ | ||
28 | ) | ||
29 | |||
30 | #define board_is_jscc9p9215() (0 \ | ||
31 | || machine_is_cc9p9215js() \ | ||
32 | ) | ||
33 | |||
34 | #define board_is_jscc9p9360() (0 \ | ||
35 | || machine_is_cc9p9360js() \ | ||
36 | ) | ||
37 | |||
38 | #define board_is_uncbas() (0 \ | ||
39 | || machine_is_cc7ucamry() \ | ||
40 | ) | ||
19 | 41 | ||
20 | #endif /* ifndef __ASM_ARCH_BOARD_H */ | 42 | #endif /* ifndef __ASM_ARCH_BOARD_H */ |
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h deleted file mode 100644 index b943d3a92a1d..000000000000 --- a/include/asm-arm/arch-ns9xxx/clock.h +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/clock.h | ||
3 | * | ||
4 | * Copyright (C) 2007 by Digi International Inc. | ||
5 | * All rights reserved. | ||
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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_CLOCK_H | ||
12 | #define __ASM_ARCH_CLOCK_H | ||
13 | |||
14 | #include <asm/arch-ns9xxx/regs-sys.h> | ||
15 | |||
16 | #define CRYSTAL 29491200 /* Hz */ | ||
17 | |||
18 | /* The HRM calls this value f_vco */ | ||
19 | static inline u32 ns9xxx_systemclock(void) __attribute__((const)); | ||
20 | static inline u32 ns9xxx_systemclock(void) | ||
21 | { | ||
22 | u32 pll = __raw_readl(SYS_PLL); | ||
23 | |||
24 | /* | ||
25 | * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in | ||
26 | * time.c). | ||
27 | * | ||
28 | * The following values are given: | ||
29 | * - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6} | ||
30 | * - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2 | ||
31 | * - ND in {0 .. 31} | ||
32 | * - FS in {0 .. 3} | ||
33 | * | ||
34 | * Assuming the worst, we consider: | ||
35 | * - TIMERCLOCKSELECT == 64 | ||
36 | * - ND == 0 | ||
37 | * - FS == 3 | ||
38 | * | ||
39 | * So HZ should be a divisor of: | ||
40 | * (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT | ||
41 | * == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64 | ||
42 | * == 2^8 * 3^2 * 5^2 | ||
43 | * == 57600 | ||
44 | * | ||
45 | * Currently HZ is defined to be 100 for this platform. | ||
46 | * | ||
47 | * Fine. | ||
48 | */ | ||
49 | return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1) | ||
50 | >> REGGETIM(pll, SYS_PLL, FS); | ||
51 | } | ||
52 | |||
53 | static inline u32 ns9xxx_cpuclock(void) __attribute__((const)); | ||
54 | static inline u32 ns9xxx_cpuclock(void) | ||
55 | { | ||
56 | return ns9xxx_systemclock() / 2; | ||
57 | } | ||
58 | |||
59 | static inline u32 ns9xxx_ahbclock(void) __attribute__((const)); | ||
60 | static inline u32 ns9xxx_ahbclock(void) | ||
61 | { | ||
62 | return ns9xxx_systemclock() / 4; | ||
63 | } | ||
64 | |||
65 | static inline u32 ns9xxx_bbusclock(void) __attribute__((const)); | ||
66 | static inline u32 ns9xxx_bbusclock(void) | ||
67 | { | ||
68 | return ns9xxx_systemclock() / 8; | ||
69 | } | ||
70 | |||
71 | #endif /* ifndef __ASM_ARCH_CLOCK_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S index 86aec87303e4..89a21c530468 100644 --- a/include/asm-arm/arch-ns9xxx/entry-macro.S +++ b/include/asm-arm/arch-ns9xxx/entry-macro.S | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/entry-macro.S | 2 | * include/asm-arm/arch-ns9xxx/entry-macro.S |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -9,16 +9,16 @@ | |||
9 | * the Free Software Foundation. | 9 | * the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #include <asm/hardware.h> | 11 | #include <asm/hardware.h> |
12 | #include <asm/arch-ns9xxx/regs-sys.h> | 12 | #include <asm/arch-ns9xxx/regs-sys-common.h> |
13 | 13 | ||
14 | .macro get_irqnr_preamble, base, tmp | 14 | .macro get_irqnr_preamble, base, tmp |
15 | ldr \base, =SYS_ISRADDR | ||
15 | .endm | 16 | .endm |
16 | 17 | ||
17 | .macro arch_ret_to_user, tmp1, tmp2 | 18 | .macro arch_ret_to_user, tmp1, tmp2 |
18 | .endm | 19 | .endm |
19 | 20 | ||
20 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 21 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
21 | ldr \base, =SYS_ISRADDR | ||
22 | ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] | 22 | ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] |
23 | cmp \irqstat, #0 | 23 | cmp \irqstat, #0 |
24 | ldrne \irqnr, [\base] | 24 | ldrne \irqnr, [\base] |
diff --git a/include/asm-arm/arch-ns9xxx/irqs.h b/include/asm-arm/arch-ns9xxx/irqs.h index 25d8d28b27f3..e83d48ec42c9 100644 --- a/include/asm-arm/arch-ns9xxx/irqs.h +++ b/include/asm-arm/arch-ns9xxx/irqs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/irqs.h | 2 | * include/asm-arm/arch-ns9xxx/irqs.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -11,38 +11,39 @@ | |||
11 | #ifndef __ASM_ARCH_IRQS_H | 11 | #ifndef __ASM_ARCH_IRQS_H |
12 | #define __ASM_ARCH_IRQS_H | 12 | #define __ASM_ARCH_IRQS_H |
13 | 13 | ||
14 | #define IRQ_WATCHDOG 0 | 14 | /* NetSilicon 9360 */ |
15 | #define IRQ_AHBBUSERR 1 | 15 | #define IRQ_NS9XXX_WATCHDOG 0 |
16 | #define IRQ_BBUSAGG 2 | 16 | #define IRQ_NS9XXX_AHBBUSERR 1 |
17 | #define IRQ_NS9360_BBUSAGG 2 | ||
17 | /* irq 3 is reserved for NS9360 */ | 18 | /* irq 3 is reserved for NS9360 */ |
18 | #define IRQ_ETHRX 4 | 19 | #define IRQ_NS9XXX_ETHRX 4 |
19 | #define IRQ_ETHTX 5 | 20 | #define IRQ_NS9XXX_ETHTX 5 |
20 | #define IRQ_ETHPHY 6 | 21 | #define IRQ_NS9XXX_ETHPHY 6 |
21 | #define IRQ_LCD 7 | 22 | #define IRQ_NS9360_LCD 7 |
22 | #define IRQ_SERBRX 8 | 23 | #define IRQ_NS9360_SERBRX 8 |
23 | #define IRQ_SERBTX 9 | 24 | #define IRQ_NS9360_SERBTX 9 |
24 | #define IRQ_SERARX 10 | 25 | #define IRQ_NS9360_SERARX 10 |
25 | #define IRQ_SERATX 11 | 26 | #define IRQ_NS9360_SERATX 11 |
26 | #define IRQ_SERCRX 12 | 27 | #define IRQ_NS9360_SERCRX 12 |
27 | #define IRQ_SERCTX 13 | 28 | #define IRQ_NS9360_SERCTX 13 |
28 | #define IRQ_I2C 14 | 29 | #define IRQ_NS9360_I2C 14 |
29 | #define IRQ_BBUSDMA 15 | 30 | #define IRQ_NS9360_BBUSDMA 15 |
30 | #define IRQ_TIMER0 16 | 31 | #define IRQ_NS9360_TIMER0 16 |
31 | #define IRQ_TIMER1 17 | 32 | #define IRQ_NS9360_TIMER1 17 |
32 | #define IRQ_TIMER2 18 | 33 | #define IRQ_NS9360_TIMER2 18 |
33 | #define IRQ_TIMER3 19 | 34 | #define IRQ_NS9360_TIMER3 19 |
34 | #define IRQ_TIMER4 20 | 35 | #define IRQ_NS9360_TIMER4 20 |
35 | #define IRQ_TIMER5 21 | 36 | #define IRQ_NS9360_TIMER5 21 |
36 | #define IRQ_TIMER6 22 | 37 | #define IRQ_NS9360_TIMER6 22 |
37 | #define IRQ_TIMER7 23 | 38 | #define IRQ_NS9360_TIMER7 23 |
38 | #define IRQ_RTC 24 | 39 | #define IRQ_NS9360_RTC 24 |
39 | #define IRQ_USBHOST 25 | 40 | #define IRQ_NS9360_USBHOST 25 |
40 | #define IRQ_USBDEVICE 26 | 41 | #define IRQ_NS9360_USBDEVICE 26 |
41 | #define IRQ_IEEE1284 27 | 42 | #define IRQ_NS9360_IEEE1284 27 |
42 | #define IRQ_EXT0 28 | 43 | #define IRQ_NS9XXX_EXT0 28 |
43 | #define IRQ_EXT1 29 | 44 | #define IRQ_NS9XXX_EXT1 29 |
44 | #define IRQ_EXT2 30 | 45 | #define IRQ_NS9XXX_EXT2 30 |
45 | #define IRQ_EXT3 31 | 46 | #define IRQ_NS9XXX_EXT3 31 |
46 | 47 | ||
47 | #define BBUS_IRQ(irq) (32 + irq) | 48 | #define BBUS_IRQ(irq) (32 + irq) |
48 | 49 | ||
@@ -67,7 +68,7 @@ | |||
67 | /* | 68 | /* |
68 | * these Interrupts are specific for the a9m9750dev board. | 69 | * these Interrupts are specific for the a9m9750dev board. |
69 | * They are generated by an FPGA that interrupts the CPU on | 70 | * They are generated by an FPGA that interrupts the CPU on |
70 | * IRQ_EXT2 | 71 | * IRQ_NS9360_EXT2 |
71 | */ | 72 | */ |
72 | #define FPGA_IRQ(irq) (64 + irq) | 73 | #define FPGA_IRQ(irq) (64 + irq) |
73 | 74 | ||
diff --git a/include/asm-arm/arch-ns9xxx/module.h b/include/asm-arm/arch-ns9xxx/module.h new file mode 100644 index 000000000000..ac08a31111e4 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/module.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/module.h | ||
3 | * | ||
4 | * Copyright (C) 2007 by Digi International Inc. | ||
5 | * All rights reserved. | ||
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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_MODULE_H | ||
12 | #define __ASM_ARCH_MODULE_H | ||
13 | |||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | #define module_is_cc7ucamry() (0 \ | ||
17 | || machine_is_cc7ucamry() \ | ||
18 | ) | ||
19 | |||
20 | #define module_is_cc9c() (0 \ | ||
21 | || machine_is_cc9c() \ | ||
22 | ) | ||
23 | |||
24 | #define module_is_cc9p9210() (0 \ | ||
25 | || machine_is_cc9p9210() \ | ||
26 | || machine_is_cc9p9210js() \ | ||
27 | ) | ||
28 | |||
29 | #define module_is_cc9p9215() (0 \ | ||
30 | || machine_is_cc9p9215() \ | ||
31 | || machine_is_cc9p9215js() \ | ||
32 | ) | ||
33 | |||
34 | #define module_is_cc9p9360() (0 \ | ||
35 | || machine_is_a9m9360() \ | ||
36 | || machine_is_cc9p9360dev() \ | ||
37 | || machine_is_cc9p9360js() \ | ||
38 | || machine_is_cc9p9360val() \ | ||
39 | ) | ||
40 | |||
41 | #define module_is_cc9p9750() (0 \ | ||
42 | || machine_is_a9m9750() \ | ||
43 | || machine_is_cc9p9750dev() \ | ||
44 | || machine_is_cc9p9750js() \ | ||
45 | || machine_is_cc9p9750val() \ | ||
46 | ) | ||
47 | |||
48 | #define module_is_ccw9c() (0 \ | ||
49 | || machine_is_ccw9c() \ | ||
50 | ) | ||
51 | |||
52 | #define module_is_inc20otter() (0 \ | ||
53 | || machine_is_inc20otter() \ | ||
54 | ) | ||
55 | |||
56 | #define module_is_otter() (0 \ | ||
57 | || machine_is_otter() \ | ||
58 | ) | ||
59 | |||
60 | #endif /* ifndef __ASM_ARCH_MODULE_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/processor-ns9360.h b/include/asm-arm/arch-ns9xxx/processor-ns9360.h new file mode 100644 index 000000000000..f3aa6c50dbe5 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/processor-ns9360.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/processor-ns9360.h | ||
3 | * | ||
4 | * Copyright (C) 2007 by Digi International Inc. | ||
5 | * All rights reserved. | ||
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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_PROCESSORNS9360_H | ||
12 | #define __ASM_ARCH_PROCESSORNS9360_H | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | |||
16 | void ns9360_reset(char mode); | ||
17 | |||
18 | unsigned long ns9360_systemclock(void) __attribute__((const)); | ||
19 | |||
20 | static inline unsigned long ns9360_cpuclock(void) __attribute__((const)); | ||
21 | static inline unsigned long ns9360_cpuclock(void) | ||
22 | { | ||
23 | return ns9360_systemclock() / 2; | ||
24 | } | ||
25 | |||
26 | void __init ns9360_map_io(void); | ||
27 | |||
28 | extern struct sys_timer ns9360_timer; | ||
29 | |||
30 | int ns9360_gpio_configure(unsigned gpio, int inv, int func); | ||
31 | |||
32 | #endif /* ifndef __ASM_ARCH_PROCESSORNS9360_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h index 223e51b8e104..f7b53b65de81 100644 --- a/include/asm-arm/arch-ns9xxx/processor.h +++ b/include/asm-arm/arch-ns9xxx/processor.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/processor.h | 2 | * include/asm-arm/arch-ns9xxx/processor.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -11,9 +11,32 @@ | |||
11 | #ifndef __ASM_ARCH_PROCESSOR_H | 11 | #ifndef __ASM_ARCH_PROCESSOR_H |
12 | #define __ASM_ARCH_PROCESSOR_H | 12 | #define __ASM_ARCH_PROCESSOR_H |
13 | 13 | ||
14 | #include <asm/mach-types.h> | 14 | #include <asm/arch-ns9xxx/module.h> |
15 | 15 | ||
16 | #define processor_is_ns9360() (machine_is_cc9p9360dev() \ | 16 | #define processor_is_ns9210() (0 \ |
17 | || machine_is_cc9p9360js()) | 17 | || module_is_cc7ucamry() \ |
18 | || module_is_cc9p9210() \ | ||
19 | || module_is_inc20otter() \ | ||
20 | || module_is_otter() \ | ||
21 | ) | ||
22 | |||
23 | #define processor_is_ns9215() (0 \ | ||
24 | || module_is_cc9p9215() \ | ||
25 | ) | ||
26 | |||
27 | #define processor_is_ns9360() (0 \ | ||
28 | || module_is_cc9p9360() \ | ||
29 | || module_is_cc9c() \ | ||
30 | || module_is_ccw9c() \ | ||
31 | ) | ||
32 | |||
33 | #define processor_is_ns9750() (0 \ | ||
34 | || module_is_cc9p9750() \ | ||
35 | ) | ||
36 | |||
37 | #define processor_is_ns921x() (0 \ | ||
38 | || processor_is_ns9210() \ | ||
39 | || processor_is_ns9215() \ | ||
40 | ) | ||
18 | 41 | ||
19 | #endif /* ifndef __ASM_ARCH_PROCESSOR_H */ | 42 | #endif /* ifndef __ASM_ARCH_PROCESSOR_H */ |
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys-common.h b/include/asm-arm/arch-ns9xxx/regs-sys-common.h new file mode 100644 index 000000000000..956c57cb781f --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/regs-sys-common.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/regs-sys-common.h | ||
3 | * | ||
4 | * Copyright (C) 2007 by Digi International Inc. | ||
5 | * All rights reserved. | ||
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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_REGSSYSCOMMON_H | ||
13 | #define __ASM_ARCH_REGSSYSCOMMON_H | ||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | /* Interrupt Vector Address Register Level x */ | ||
17 | #define SYS_IVA(x) __REG2(0xa09000c4, (x)) | ||
18 | |||
19 | /* Interrupt Configuration registers */ | ||
20 | #define SYS_IC(x) __REG2(0xa0900144, (x)) | ||
21 | |||
22 | /* ISRADDR */ | ||
23 | #define SYS_ISRADDR __REG(0xa0900164) | ||
24 | |||
25 | /* Interrupt Status Active */ | ||
26 | #define SYS_ISA __REG(0xa0900168) | ||
27 | |||
28 | /* Interrupt Status Raw */ | ||
29 | #define SYS_ISR __REG(0xa090016c) | ||
30 | |||
31 | #endif /* ifndef __ASM_ARCH_REGSSYSCOMMON_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h index 749262f86204..318b6945afb6 100644 --- a/include/asm-arm/arch-ns9xxx/regs-sys.h +++ b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h | |||
@@ -1,15 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/regs-sys.h | 2 | * include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
8 | * under the terms of the GNU General Public License version 2 as published by | 8 | * under the terms of the GNU General Public License version 2 as published by |
9 | * the Free Software Foundation. | 9 | * the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #ifndef __ASM_ARCH_REGSSYS_H | 11 | #ifndef __ASM_ARCH_REGSSYSNS9360_H |
12 | #define __ASM_ARCH_REGSSYS_H | 12 | #define __ASM_ARCH_REGSSYSNS9360_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | 14 | #include <asm/hardware.h> |
15 | 15 | ||
@@ -27,21 +27,6 @@ | |||
27 | /* Timer x Read register */ | 27 | /* Timer x Read register */ |
28 | #define SYS_TR(x) __REG2(0xa0900084, (x)) | 28 | #define SYS_TR(x) __REG2(0xa0900084, (x)) |
29 | 29 | ||
30 | /* Interrupt Vector Address Register Level x */ | ||
31 | #define SYS_IVA(x) __REG2(0xa09000c4, (x)) | ||
32 | |||
33 | /* Interrupt Configuration registers */ | ||
34 | #define SYS_IC(x) __REG2(0xa0900144, (x)) | ||
35 | |||
36 | /* ISRADDR */ | ||
37 | #define SYS_ISRADDR __REG(0xa0900164) | ||
38 | |||
39 | /* Interrupt Status Active */ | ||
40 | #define SYS_ISA __REG(0xa0900168) | ||
41 | |||
42 | /* Interrupt Status Raw */ | ||
43 | #define SYS_ISR __REG(0xa090016c) | ||
44 | |||
45 | /* Timer Interrupt Status register */ | 30 | /* Timer Interrupt Status register */ |
46 | #define SYS_TIS __REG(0xa0900170) | 31 | #define SYS_TIS __REG(0xa0900170) |
47 | 32 | ||
@@ -160,4 +145,4 @@ | |||
160 | #define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0) | 145 | #define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0) |
161 | #define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1) | 146 | #define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1) |
162 | 147 | ||
163 | #endif /* ifndef __ASM_ARCH_REGSSYS_H */ | 148 | #endif /* ifndef __ASM_ARCH_REGSSYSNS9360_H */ |
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h index c1082bd8977c..1348073afe48 100644 --- a/include/asm-arm/arch-ns9xxx/system.h +++ b/include/asm-arm/arch-ns9xxx/system.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-ns9xxx/system.h | 2 | * include/asm-arm/arch-ns9xxx/system.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 by Digi International Inc. | 4 | * Copyright (C) 2006,2007 by Digi International Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -12,8 +12,8 @@ | |||
12 | #define __ASM_ARCH_SYSTEM_H | 12 | #define __ASM_ARCH_SYSTEM_H |
13 | 13 | ||
14 | #include <asm/proc-fns.h> | 14 | #include <asm/proc-fns.h> |
15 | #include <asm/arch-ns9xxx/regs-sys.h> | 15 | #include <asm/arch-ns9xxx/processor.h> |
16 | #include <asm/mach-types.h> | 16 | #include <asm/arch-ns9xxx/processor-ns9360.h> |
17 | 17 | ||
18 | static inline void arch_idle(void) | 18 | static inline void arch_idle(void) |
19 | { | 19 | { |
@@ -22,11 +22,12 @@ static inline void arch_idle(void) | |||
22 | 22 | ||
23 | static inline void arch_reset(char mode) | 23 | static inline void arch_reset(char mode) |
24 | { | 24 | { |
25 | u32 reg; | 25 | #ifdef CONFIG_PROCESSOR_NS9360 |
26 | 26 | if (processor_is_ns9360()) | |
27 | reg = __raw_readl(SYS_PLL) >> 16; | 27 | ns9360_reset(mode); |
28 | REGSET(reg, SYS_PLL, SWC, YES); | 28 | else |
29 | __raw_writel(reg, SYS_PLL); | 29 | #endif |
30 | BUG(); | ||
30 | 31 | ||
31 | BUG(); | 32 | BUG(); |
32 | } | 33 | } |
diff --git a/include/asm-arm/arch-ns9xxx/uncompress.h b/include/asm-arm/arch-ns9xxx/uncompress.h index 961ca7dc9954..71066baceab7 100644 --- a/include/asm-arm/arch-ns9xxx/uncompress.h +++ b/include/asm-arm/arch-ns9xxx/uncompress.h | |||
@@ -11,20 +11,149 @@ | |||
11 | #ifndef __ASM_ARCH_UNCOMPRESS_H | 11 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
12 | #define __ASM_ARCH_UNCOMPRESS_H | 12 | #define __ASM_ARCH_UNCOMPRESS_H |
13 | 13 | ||
14 | static void putc(char c) | 14 | #include <asm/io.h> |
15 | |||
16 | #define __REG(x) ((void __iomem __force *)(x)) | ||
17 | |||
18 | static void putc_dummy(char c, void __iomem *base) | ||
15 | { | 19 | { |
16 | volatile u8 *base = (volatile u8 *)0x40000000; | 20 | /* nothing */ |
17 | int t = 0x10000; | 21 | } |
18 | 22 | ||
23 | static void putc_ns9360(char c, void __iomem *base) | ||
24 | { | ||
25 | static int t = 0x10000; | ||
26 | do { | ||
27 | if (t) | ||
28 | --t; | ||
29 | |||
30 | if (__raw_readl(base + 8) & (1 << 3)) { | ||
31 | __raw_writeb(c, base + 16); | ||
32 | t = 0x10000; | ||
33 | break; | ||
34 | } | ||
35 | } while (t); | ||
36 | } | ||
37 | |||
38 | static void putc_a9m9750dev(char c, void __iomem *base) | ||
39 | { | ||
40 | static int t = 0x10000; | ||
41 | do { | ||
42 | if (t) | ||
43 | --t; | ||
44 | |||
45 | if (__raw_readb(base + 5) & (1 << 5)) { | ||
46 | __raw_writeb(c, base); | ||
47 | t = 0x10000; | ||
48 | break; | ||
49 | } | ||
50 | } while (t); | ||
51 | |||
52 | } | ||
53 | |||
54 | static void putc_ns921x(char c, void __iomem *base) | ||
55 | { | ||
56 | static int t = 0x10000; | ||
19 | do { | 57 | do { |
20 | if (base[5] & 0x20) { | 58 | if (t) |
21 | base[0] = c; | 59 | --t; |
60 | |||
61 | if (!(__raw_readl(base) & (1 << 11))) { | ||
62 | __raw_writeb(c, base + 0x0028); | ||
63 | t = 0x10000; | ||
22 | break; | 64 | break; |
23 | } | 65 | } |
24 | } while (--t); | 66 | } while (t); |
25 | } | 67 | } |
26 | 68 | ||
27 | #define arch_decomp_setup() | 69 | #define MSCS __REG(0xA0900184) |
70 | |||
71 | #define NS9360_UARTA __REG(0x90200040) | ||
72 | #define NS9360_UARTB __REG(0x90200000) | ||
73 | #define NS9360_UARTC __REG(0x90300000) | ||
74 | #define NS9360_UARTD __REG(0x90300040) | ||
75 | |||
76 | #define NS9360_UART_ENABLED(base) \ | ||
77 | (__raw_readl(NS9360_UARTA) & (1 << 31)) | ||
78 | |||
79 | #define A9M9750DEV_UARTA __REG(0x40000000) | ||
80 | |||
81 | #define NS921XSYS_CLOCK __REG(0xa090017c) | ||
82 | #define NS921X_UARTA __REG(0x90010000) | ||
83 | #define NS921X_UARTB __REG(0x90018000) | ||
84 | #define NS921X_UARTC __REG(0x90020000) | ||
85 | #define NS921X_UARTD __REG(0x90028000) | ||
86 | |||
87 | #define NS921X_UART_ENABLED(base) \ | ||
88 | (__raw_readl((base) + 0x1000) & (1 << 29)) | ||
89 | |||
90 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) | ||
91 | { | ||
92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { | ||
93 | /* ns9360 or ns9750 */ | ||
94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { | ||
95 | *putc = putc_ns9360; | ||
96 | *base = NS9360_UARTA; | ||
97 | return; | ||
98 | } else if (NS9360_UART_ENABLED(NS9360_UARTB)) { | ||
99 | *putc = putc_ns9360; | ||
100 | *base = NS9360_UARTB; | ||
101 | return; | ||
102 | } else if (NS9360_UART_ENABLED(NS9360_UARTC)) { | ||
103 | *putc = putc_ns9360; | ||
104 | *base = NS9360_UARTC; | ||
105 | return; | ||
106 | } else if (NS9360_UART_ENABLED(NS9360_UARTD)) { | ||
107 | *putc = putc_ns9360; | ||
108 | *base = NS9360_UARTD; | ||
109 | return; | ||
110 | } else if (__raw_readl(__REG(0xa09001f4)) == 0xfffff001) { | ||
111 | *putc = putc_a9m9750dev; | ||
112 | *base = A9M9750DEV_UARTA; | ||
113 | return; | ||
114 | } | ||
115 | } else if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x02) { | ||
116 | /* ns921x */ | ||
117 | u32 clock = __raw_readl(NS921XSYS_CLOCK); | ||
118 | |||
119 | if ((clock & (1 << 1)) && | ||
120 | NS921X_UART_ENABLED(NS921X_UARTA)) { | ||
121 | *putc = putc_ns921x; | ||
122 | *base = NS921X_UARTA; | ||
123 | return; | ||
124 | } else if ((clock & (1 << 2)) && | ||
125 | NS921X_UART_ENABLED(NS921X_UARTB)) { | ||
126 | *putc = putc_ns921x; | ||
127 | *base = NS921X_UARTB; | ||
128 | return; | ||
129 | } else if ((clock & (1 << 3)) && | ||
130 | NS921X_UART_ENABLED(NS921X_UARTC)) { | ||
131 | *putc = putc_ns921x; | ||
132 | *base = NS921X_UARTC; | ||
133 | return; | ||
134 | } else if ((clock & (1 << 4)) && | ||
135 | NS921X_UART_ENABLED(NS921X_UARTD)) { | ||
136 | *putc = putc_ns921x; | ||
137 | *base = NS921X_UARTD; | ||
138 | return; | ||
139 | } | ||
140 | } | ||
141 | |||
142 | *putc = putc_dummy; | ||
143 | } | ||
144 | |||
145 | void (*myputc)(char, void __iomem *); | ||
146 | void __iomem *base; | ||
147 | |||
148 | static void putc(char c) | ||
149 | { | ||
150 | myputc(c, base); | ||
151 | } | ||
152 | |||
153 | static void arch_decomp_setup(void) | ||
154 | { | ||
155 | autodetect(&myputc, &base); | ||
156 | } | ||
28 | #define arch_decomp_wdog() | 157 | #define arch_decomp_wdog() |
29 | 158 | ||
30 | static void flush(void) | 159 | static void flush(void) |