diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 14:56:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 14:56:29 -0500 |
commit | 52fefcec97c25b15887e6a9a885ca54e7f7c0928 (patch) | |
tree | 4898112a7fb30c20a9da3aefe9fdc7fdebda57a6 /arch/xtensa/platforms | |
parent | a0e280e0f33f6c859a235fb69a875ed8f3420388 (diff) | |
parent | 5fee325e7d2bcbebf1cb38b4ff3a7aa3744c43e3 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6:
xtensa: Update platform files to reflect new location of the header files.
xtensa: switch to packed struct unaligned access implementation
xtensa: Add xt2000 support files.
xtensa: move headers files to arch/xtensa/include
xtensa: use the new byteorder headers
Diffstat (limited to 'arch/xtensa/platforms')
-rw-r--r-- | arch/xtensa/platforms/iss/console.c | 4 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/include/platform/hardware.h | 29 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/include/platform/simcall.h | 62 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/io.c | 2 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/network.c | 4 | ||||
-rw-r--r-- | arch/xtensa/platforms/xt2000/Makefile | 5 | ||||
-rw-r--r-- | arch/xtensa/platforms/xt2000/include/platform/hardware.h | 55 | ||||
-rw-r--r-- | arch/xtensa/platforms/xt2000/include/platform/serial.h | 28 | ||||
-rw-r--r-- | arch/xtensa/platforms/xt2000/setup.c | 181 |
9 files changed, 365 insertions, 5 deletions
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 9141e3690731..efed8897bef3 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/xtensa/platform-iss/console.c | 2 | * arch/xtensa/platforms/iss/console.c |
3 | * | 3 | * |
4 | * This file is subject to the terms and conditions of the GNU General Public | 4 | * This file is subject to the terms and conditions of the GNU General Public |
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | 26 | ||
27 | #include <asm/platform/simcall.h> | 27 | #include <platform/simcall.h> |
28 | 28 | ||
29 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
30 | #include <linux/tty_flip.h> | 30 | #include <linux/tty_flip.h> |
diff --git a/arch/xtensa/platforms/iss/include/platform/hardware.h b/arch/xtensa/platforms/iss/include/platform/hardware.h new file mode 100644 index 000000000000..6930c12adc16 --- /dev/null +++ b/arch/xtensa/platforms/iss/include/platform/hardware.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/platform-iss/hardware.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * This file contains the default configuration of ISS. | ||
13 | */ | ||
14 | |||
15 | #ifndef _XTENSA_PLATFORM_ISS_HARDWARE_H | ||
16 | #define _XTENSA_PLATFORM_ISS_HARDWARE_H | ||
17 | |||
18 | /* | ||
19 | * Memory configuration. | ||
20 | */ | ||
21 | |||
22 | #define PLATFORM_DEFAULT_MEM_START 0x00000000 | ||
23 | #define PLATFORM_DEFAULT_MEM_SIZE 0x08000000 | ||
24 | |||
25 | /* | ||
26 | * Interrupt configuration. | ||
27 | */ | ||
28 | |||
29 | #endif /* _XTENSA_PLATFORM_ISS_HARDWARE_H */ | ||
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h new file mode 100644 index 000000000000..b7952c06a2b7 --- /dev/null +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/platform-iss/simcall.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H | ||
12 | #define _XTENSA_PLATFORM_ISS_SIMCALL_H | ||
13 | |||
14 | |||
15 | /* | ||
16 | * System call like services offered by the simulator host. | ||
17 | */ | ||
18 | |||
19 | #define SYS_nop 0 /* unused */ | ||
20 | #define SYS_exit 1 /*x*/ | ||
21 | #define SYS_fork 2 | ||
22 | #define SYS_read 3 /*x*/ | ||
23 | #define SYS_write 4 /*x*/ | ||
24 | #define SYS_open 5 /*x*/ | ||
25 | #define SYS_close 6 /*x*/ | ||
26 | #define SYS_rename 7 /*x 38 - waitpid */ | ||
27 | #define SYS_creat 8 /*x*/ | ||
28 | #define SYS_link 9 /*x (not implemented on WIN32) */ | ||
29 | #define SYS_unlink 10 /*x*/ | ||
30 | #define SYS_execv 11 /* n/a - execve */ | ||
31 | #define SYS_execve 12 /* 11 - chdir */ | ||
32 | #define SYS_pipe 13 /* 42 - time */ | ||
33 | #define SYS_stat 14 /* 106 - mknod */ | ||
34 | #define SYS_chmod 15 | ||
35 | #define SYS_chown 16 /* 202 - lchown */ | ||
36 | #define SYS_utime 17 /* 30 - break */ | ||
37 | #define SYS_wait 18 /* n/a - oldstat */ | ||
38 | #define SYS_lseek 19 /*x*/ | ||
39 | #define SYS_getpid 20 | ||
40 | #define SYS_isatty 21 /* n/a - mount */ | ||
41 | #define SYS_fstat 22 /* 108 - oldumount */ | ||
42 | #define SYS_time 23 /* 13 - setuid */ | ||
43 | #define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */ | ||
44 | #define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */ | ||
45 | #define SYS_socket 26 | ||
46 | #define SYS_sendto 27 | ||
47 | #define SYS_recvfrom 28 | ||
48 | #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */ | ||
49 | #define SYS_bind 30 | ||
50 | #define SYS_ioctl 31 | ||
51 | |||
52 | /* | ||
53 | * SYS_select_one specifiers | ||
54 | */ | ||
55 | |||
56 | #define XTISS_SELECT_ONE_READ 1 | ||
57 | #define XTISS_SELECT_ONE_WRITE 2 | ||
58 | #define XTISS_SELECT_ONE_EXCEPT 3 | ||
59 | |||
60 | |||
61 | #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ | ||
62 | |||
diff --git a/arch/xtensa/platforms/iss/io.c b/arch/xtensa/platforms/iss/io.c index 5b161a5cb65f..571d0b24f895 100644 --- a/arch/xtensa/platforms/iss/io.c +++ b/arch/xtensa/platforms/iss/io.c | |||
@@ -3,7 +3,7 @@ | |||
3 | #if 0 | 3 | #if 0 |
4 | 4 | ||
5 | #include <asm/io.h> | 5 | #include <asm/io.h> |
6 | #include <xtensa/simcall.h> | 6 | #include <platform/platform-iss/simcall.h> |
7 | 7 | ||
8 | extern int __simc (); | 8 | extern int __simc (); |
9 | 9 | ||
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 64f057d89e73..edad4156d89a 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * arch/xtensa/platform-iss/network.c | 3 | * arch/xtensa/platforms/iss/network.c |
4 | * | 4 | * |
5 | * Platform specific initialization. | 5 | * Platform specific initialization. |
6 | * | 6 | * |
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/rtnetlink.h> | 33 | #include <linux/rtnetlink.h> |
34 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
35 | 35 | ||
36 | #include <asm/platform/simcall.h> | 36 | #include <platform/simcall.h> |
37 | 37 | ||
38 | #define DRIVER_NAME "iss-netdev" | 38 | #define DRIVER_NAME "iss-netdev" |
39 | #define ETH_MAX_PACKET 1500 | 39 | #define ETH_MAX_PACKET 1500 |
diff --git a/arch/xtensa/platforms/xt2000/Makefile b/arch/xtensa/platforms/xt2000/Makefile new file mode 100644 index 000000000000..54d018e45bfc --- /dev/null +++ b/arch/xtensa/platforms/xt2000/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the Tensilica XT2000 Emulation Board | ||
3 | # | ||
4 | |||
5 | obj-y = setup.o | ||
diff --git a/arch/xtensa/platforms/xt2000/include/platform/hardware.h b/arch/xtensa/platforms/xt2000/include/platform/hardware.h new file mode 100644 index 000000000000..41459ad07766 --- /dev/null +++ b/arch/xtensa/platforms/xt2000/include/platform/hardware.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * platform/hardware.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * This file contains the hardware configuration of the XT2000 board. | ||
13 | */ | ||
14 | |||
15 | #ifndef _XTENSA_XT2000_HARDWARE_H | ||
16 | #define _XTENSA_XT2000_HARDWARE_H | ||
17 | |||
18 | #include <variant/core.h> | ||
19 | #include <asm/io.h> | ||
20 | |||
21 | /* | ||
22 | * Memory configuration. | ||
23 | */ | ||
24 | |||
25 | #define PLATFORM_DEFAULT_MEM_START 0x00000000 | ||
26 | #define PLATFORM_DEFAULT_MEM_SIZE 0x08000000 | ||
27 | |||
28 | /* | ||
29 | * Number of platform IRQs | ||
30 | */ | ||
31 | #define PLATFORM_NR_IRQS 3 | ||
32 | /* | ||
33 | * On-board components. | ||
34 | */ | ||
35 | |||
36 | #define SONIC83934_INTNUM XCHAL_EXTINT3_NUM | ||
37 | #define SONIC83934_ADDR IOADDR(0x0d030000) | ||
38 | |||
39 | /* | ||
40 | * V3-PCI | ||
41 | */ | ||
42 | |||
43 | /* The XT2000 uses the V3 as a cascaded interrupt controller for the PCI bus */ | ||
44 | |||
45 | #define IRQ_PCI_A (XCHAL_NUM_INTERRUPTS + 0) | ||
46 | #define IRQ_PCI_B (XCHAL_NUM_INTERRUPTS + 1) | ||
47 | #define IRQ_PCI_C (XCHAL_NUM_INTERRUPTS + 2) | ||
48 | |||
49 | /* | ||
50 | * Various other components. | ||
51 | */ | ||
52 | |||
53 | #define XT2000_LED_ADDR IOADDR(0x0d040000) | ||
54 | |||
55 | #endif /* _XTENSA_XT2000_HARDWARE_H */ | ||
diff --git a/arch/xtensa/platforms/xt2000/include/platform/serial.h b/arch/xtensa/platforms/xt2000/include/platform/serial.h new file mode 100644 index 000000000000..7226cf732b47 --- /dev/null +++ b/arch/xtensa/platforms/xt2000/include/platform/serial.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * platform/serial.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_XT2000_SERIAL_H | ||
12 | #define _XTENSA_XT2000_SERIAL_H | ||
13 | |||
14 | #include <variant/core.h> | ||
15 | #include <asm/io.h> | ||
16 | |||
17 | /* National-Semi PC16552D DUART: */ | ||
18 | |||
19 | #define DUART16552_1_INTNUM XCHAL_EXTINT4_NUM | ||
20 | #define DUART16552_2_INTNUM XCHAL_EXTINT5_NUM | ||
21 | |||
22 | #define DUART16552_1_ADDR IOADDR(0x0d050020) /* channel 1 */ | ||
23 | #define DUART16552_2_ADDR IOADDR(0x0d050000) /* channel 2 */ | ||
24 | |||
25 | #define DUART16552_XTAL_FREQ 18432000 /* crystal frequency in Hz */ | ||
26 | #define BASE_BAUD ( DUART16552_XTAL_FREQ / 16 ) | ||
27 | |||
28 | #endif /* _XTENSA_XT2000_SERIAL_H */ | ||
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c new file mode 100644 index 000000000000..9e83940ac265 --- /dev/null +++ b/arch/xtensa/platforms/xt2000/setup.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * arch/xtensa/platforms/xt2000/setup.c | ||
3 | * | ||
4 | * Platform specific functions for the XT2000 board. | ||
5 | * | ||
6 | * Authors: Chris Zankel <chris@zankel.net> | ||
7 | * Joe Taylor <joe@tensilica.com> | ||
8 | * | ||
9 | * Copyright 2001 - 2004 Tensilica Inc. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | #include <linux/stddef.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/reboot.h> | ||
22 | #include <linux/kdev_t.h> | ||
23 | #include <linux/types.h> | ||
24 | #include <linux/major.h> | ||
25 | #include <linux/console.h> | ||
26 | #include <linux/delay.h> | ||
27 | #include <linux/stringify.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/serial.h> | ||
30 | #include <linux/serial_8250.h> | ||
31 | |||
32 | #include <asm/processor.h> | ||
33 | #include <asm/platform.h> | ||
34 | #include <asm/bootparam.h> | ||
35 | #include <platform/hardware.h> | ||
36 | #include <platform/serial.h> | ||
37 | |||
38 | /* Assumes s points to an 8-chr string. No checking for NULL. */ | ||
39 | |||
40 | static void led_print (int f, char *s) | ||
41 | { | ||
42 | unsigned long* led_addr = (unsigned long*) (XT2000_LED_ADDR + 0xE0) + f; | ||
43 | int i; | ||
44 | for (i = f; i < 8; i++) | ||
45 | if ((*led_addr++ = *s++) == 0) | ||
46 | break; | ||
47 | } | ||
48 | |||
49 | void platform_halt(void) | ||
50 | { | ||
51 | led_print (0, " HALT "); | ||
52 | local_irq_disable(); | ||
53 | while (1); | ||
54 | } | ||
55 | |||
56 | void platform_power_off(void) | ||
57 | { | ||
58 | led_print (0, "POWEROFF"); | ||
59 | local_irq_disable(); | ||
60 | while (1); | ||
61 | } | ||
62 | |||
63 | void platform_restart(void) | ||
64 | { | ||
65 | /* Flush and reset the mmu, simulate a processor reset, and | ||
66 | * jump to the reset vector. */ | ||
67 | |||
68 | __asm__ __volatile__ ("movi a2, 15\n\t" | ||
69 | "wsr a2, " __stringify(ICOUNTLEVEL) "\n\t" | ||
70 | "movi a2, 0\n\t" | ||
71 | "wsr a2, " __stringify(ICOUNT) "\n\t" | ||
72 | "wsr a2, " __stringify(IBREAKENABLE) "\n\t" | ||
73 | "wsr a2, " __stringify(LCOUNT) "\n\t" | ||
74 | "movi a2, 0x1f\n\t" | ||
75 | "wsr a2, " __stringify(PS) "\n\t" | ||
76 | "isync\n\t" | ||
77 | "jx %0\n\t" | ||
78 | : | ||
79 | : "a" (XCHAL_RESET_VECTOR_VADDR) | ||
80 | : "a2" | ||
81 | ); | ||
82 | |||
83 | /* control never gets here */ | ||
84 | } | ||
85 | |||
86 | void __init platform_setup(char** cmdline) | ||
87 | { | ||
88 | led_print (0, "LINUX "); | ||
89 | } | ||
90 | |||
91 | /* early initialization */ | ||
92 | |||
93 | extern sysmem_info_t __initdata sysmem; | ||
94 | |||
95 | void platform_init(bp_tag_t* first) | ||
96 | { | ||
97 | /* Set default memory block if not provided by the bootloader. */ | ||
98 | |||
99 | if (sysmem.nr_banks == 0) { | ||
100 | sysmem.nr_banks = 1; | ||
101 | sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START; | ||
102 | sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START | ||
103 | + PLATFORM_DEFAULT_MEM_SIZE; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | /* Heartbeat. Let the LED blink. */ | ||
108 | |||
109 | void platform_heartbeat(void) | ||
110 | { | ||
111 | static int i=0, t = 0; | ||
112 | |||
113 | if (--t < 0) | ||
114 | { | ||
115 | t = 59; | ||
116 | led_print(7, i ? ".": " "); | ||
117 | i ^= 1; | ||
118 | } | ||
119 | } | ||
120 | |||
121 | //#define RS_TABLE_SIZE 2 | ||
122 | //#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) | ||
123 | |||
124 | #define _SERIAL_PORT(_base,_irq) \ | ||
125 | { \ | ||
126 | .mapbase = (_base), \ | ||
127 | .membase = (void*)(_base), \ | ||
128 | .irq = (_irq), \ | ||
129 | .uartclk = DUART16552_XTAL_FREQ, \ | ||
130 | .iotype = UPIO_MEM, \ | ||
131 | .flags = UPF_BOOT_AUTOCONF, \ | ||
132 | .regshift = 2, \ | ||
133 | } | ||
134 | |||
135 | static struct plat_serial8250_port xt2000_serial_data[] = { | ||
136 | #if XCHAL_HAVE_BE | ||
137 | _SERIAL_PORT(DUART16552_1_ADDR + 3, DUART16552_1_INTNUM), | ||
138 | _SERIAL_PORT(DUART16552_2_ADDR + 3, DUART16552_2_INTNUM), | ||
139 | #else | ||
140 | _SERIAL_PORT(DUART16552_1_ADDR, DUART16552_1_INTNUM), | ||
141 | _SERIAL_PORT(DUART16552_2_ADDR, DUART16552_2_INTNUM), | ||
142 | #endif | ||
143 | { } | ||
144 | }; | ||
145 | |||
146 | static struct platform_device xt2000_serial8250_device = { | ||
147 | .name = "serial8250", | ||
148 | .id = PLAT8250_DEV_PLATFORM, | ||
149 | .dev = { | ||
150 | .platform_data = xt2000_serial_data, | ||
151 | }, | ||
152 | }; | ||
153 | |||
154 | static struct resource xt2000_sonic_res[] = { | ||
155 | { | ||
156 | .start = SONIC83934_ADDR, | ||
157 | .end = SONIC83934_ADDR + 0xff, | ||
158 | .flags = IORESOURCE_MEM, | ||
159 | }, | ||
160 | { | ||
161 | .start = SONIC83934_INTNUM, | ||
162 | .end = SONIC83934_INTNUM, | ||
163 | .flags = IORESOURCE_IRQ, | ||
164 | }, | ||
165 | }; | ||
166 | |||
167 | static struct platform_device xt2000_sonic_device = { | ||
168 | .name = "xtsonic", | ||
169 | .num_resources = ARRAY_SIZE(xt2000_sonic_res), | ||
170 | .resource = xt2000_sonic_res, | ||
171 | }; | ||
172 | |||
173 | static int __init xt2000_setup_devinit(void) | ||
174 | { | ||
175 | platform_device_register(&xt2000_serial8250_device); | ||
176 | platform_device_register(&xt2000_sonic_device); | ||
177 | |||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | device_initcall(xt2000_setup_devinit); | ||