diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 17:38:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 17:38:16 -0400 |
commit | c61c48dfe00907007df3b87e4ed271a5c143bdda (patch) | |
tree | 6d26bd3a8b4aa3cf35cad35fa27d1e0afe715db3 /arch/xtensa/platforms/iss | |
parent | e30f4192456971623b40c97a027346b69457ef69 (diff) | |
parent | b341d84c8ac5ecbf7aa0b3ccd0745d87e881953c (diff) |
Merge tag 'xtensa-next-20130508' of git://github.com/czankel/xtensa-linux
Pull xtensa updates from Chris Zankel:
"Support for the latest MMU architecture that allows for a larger
accessible memory region, and various bug-fixes"
* tag 'xtensa-next-20130508' of git://github.com/czankel/xtensa-linux:
xtensa: Switch to asm-generic/linkage.h
xtensa: fix redboot load address
xtensa: ISS: fix timer_lock usage in rs_open
xtensa: disable IRQs while IRQ handler is running
xtensa: enable lockdep support
xtensa: fix arch_irqs_disabled_flags implementation
xtensa: add irq flags trace support
xtensa: provide custom CALLER_ADDR* implementations
xtensa: add stacktrace support
xtensa: clean up stpill_registers
xtensa: don't use a7 in simcalls
xtensa: don't attempt to use unconfigured timers
xtensa: provide default platform_pcibios_init implementation
xtensa: remove KCORE_ELF again
xtensa: document MMUv3 setup sequence
xtensa: add MMU v3 support
xtensa: fix ibreakenable register update
xtensa: fix oprofile building as module
Diffstat (limited to 'arch/xtensa/platforms/iss')
-rw-r--r-- | arch/xtensa/platforms/iss/console.c | 12 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/include/platform/simcall.h | 24 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 8 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/simdisk.c | 4 |
4 files changed, 22 insertions, 26 deletions
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index da9866f7fecf..70cb408bc20d 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c | |||
@@ -56,13 +56,13 @@ static void rs_poll(unsigned long); | |||
56 | static int rs_open(struct tty_struct *tty, struct file * filp) | 56 | static int rs_open(struct tty_struct *tty, struct file * filp) |
57 | { | 57 | { |
58 | tty->port = &serial_port; | 58 | tty->port = &serial_port; |
59 | spin_lock(&timer_lock); | 59 | spin_lock_bh(&timer_lock); |
60 | if (tty->count == 1) { | 60 | if (tty->count == 1) { |
61 | setup_timer(&serial_timer, rs_poll, | 61 | setup_timer(&serial_timer, rs_poll, |
62 | (unsigned long)&serial_port); | 62 | (unsigned long)&serial_port); |
63 | mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); | 63 | mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); |
64 | } | 64 | } |
65 | spin_unlock(&timer_lock); | 65 | spin_unlock_bh(&timer_lock); |
66 | 66 | ||
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
@@ -99,14 +99,13 @@ static int rs_write(struct tty_struct * tty, | |||
99 | static void rs_poll(unsigned long priv) | 99 | static void rs_poll(unsigned long priv) |
100 | { | 100 | { |
101 | struct tty_port *port = (struct tty_port *)priv; | 101 | struct tty_port *port = (struct tty_port *)priv; |
102 | struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; | ||
103 | int i = 0; | 102 | int i = 0; |
104 | unsigned char c; | 103 | unsigned char c; |
105 | 104 | ||
106 | spin_lock(&timer_lock); | 105 | spin_lock(&timer_lock); |
107 | 106 | ||
108 | while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){ | 107 | while (simc_poll(0)) { |
109 | __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0); | 108 | simc_read(0, &c, 1); |
110 | tty_insert_flip_char(port, c, TTY_NORMAL); | 109 | tty_insert_flip_char(port, c, TTY_NORMAL); |
111 | i++; | 110 | i++; |
112 | } | 111 | } |
@@ -244,8 +243,7 @@ static void iss_console_write(struct console *co, const char *s, unsigned count) | |||
244 | int len = strlen(s); | 243 | int len = strlen(s); |
245 | 244 | ||
246 | if (s != 0 && *s != 0) | 245 | if (s != 0 && *s != 0) |
247 | __simc (SYS_write, 1, (unsigned long)s, | 246 | simc_write(1, s, count < len ? count : len); |
248 | count < len ? count : len,0,0); | ||
249 | } | 247 | } |
250 | 248 | ||
251 | static struct tty_driver* iss_console_device(struct console *c, int *index) | 249 | static struct tty_driver* iss_console_device(struct console *c, int *index) |
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h index b5a4edf02d76..12b15ad1e586 100644 --- a/arch/xtensa/platforms/iss/include/platform/simcall.h +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h | |||
@@ -59,56 +59,58 @@ | |||
59 | 59 | ||
60 | static int errno; | 60 | static int errno; |
61 | 61 | ||
62 | static inline int __simc(int a, int b, int c, int d, int e, int f) | 62 | static inline int __simc(int a, int b, int c, int d) |
63 | { | 63 | { |
64 | int ret; | 64 | int ret; |
65 | register int a1 asm("a2") = a; | 65 | register int a1 asm("a2") = a; |
66 | register int b1 asm("a3") = b; | 66 | register int b1 asm("a3") = b; |
67 | register int c1 asm("a4") = c; | 67 | register int c1 asm("a4") = c; |
68 | register int d1 asm("a5") = d; | 68 | register int d1 asm("a5") = d; |
69 | register int e1 asm("a6") = e; | ||
70 | register int f1 asm("a7") = f; | ||
71 | __asm__ __volatile__ ( | 69 | __asm__ __volatile__ ( |
72 | "simcall\n" | 70 | "simcall\n" |
73 | "mov %0, a2\n" | 71 | "mov %0, a2\n" |
74 | "mov %1, a3\n" | 72 | "mov %1, a3\n" |
75 | : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1) | 73 | : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1) |
76 | : "r"(c1), "r"(d1), "r"(e1), "r"(f1) | 74 | : "r"(c1), "r"(d1) |
77 | : "memory"); | 75 | : "memory"); |
78 | return ret; | 76 | return ret; |
79 | } | 77 | } |
80 | 78 | ||
81 | static inline int simc_open(const char *file, int flags, int mode) | 79 | static inline int simc_open(const char *file, int flags, int mode) |
82 | { | 80 | { |
83 | return __simc(SYS_open, (int) file, flags, mode, 0, 0); | 81 | return __simc(SYS_open, (int) file, flags, mode); |
84 | } | 82 | } |
85 | 83 | ||
86 | static inline int simc_close(int fd) | 84 | static inline int simc_close(int fd) |
87 | { | 85 | { |
88 | return __simc(SYS_close, fd, 0, 0, 0, 0); | 86 | return __simc(SYS_close, fd, 0, 0); |
89 | } | 87 | } |
90 | 88 | ||
91 | static inline int simc_ioctl(int fd, int request, void *arg) | 89 | static inline int simc_ioctl(int fd, int request, void *arg) |
92 | { | 90 | { |
93 | return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); | 91 | return __simc(SYS_ioctl, fd, request, (int) arg); |
94 | } | 92 | } |
95 | 93 | ||
96 | static inline int simc_read(int fd, void *buf, size_t count) | 94 | static inline int simc_read(int fd, void *buf, size_t count) |
97 | { | 95 | { |
98 | return __simc(SYS_read, fd, (int) buf, count, 0, 0); | 96 | return __simc(SYS_read, fd, (int) buf, count); |
99 | } | 97 | } |
100 | 98 | ||
101 | static inline int simc_write(int fd, const void *buf, size_t count) | 99 | static inline int simc_write(int fd, const void *buf, size_t count) |
102 | { | 100 | { |
103 | return __simc(SYS_write, fd, (int) buf, count, 0, 0); | 101 | return __simc(SYS_write, fd, (int) buf, count); |
104 | } | 102 | } |
105 | 103 | ||
106 | static inline int simc_poll(int fd) | 104 | static inline int simc_poll(int fd) |
107 | { | 105 | { |
108 | struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; | 106 | struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; |
109 | 107 | ||
110 | return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv, | 108 | return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv); |
111 | 0, 0); | 109 | } |
110 | |||
111 | static inline int simc_lseek(int fd, uint32_t off, int whence) | ||
112 | { | ||
113 | return __simc(SYS_lseek, fd, off, whence); | ||
112 | } | 114 | } |
113 | 115 | ||
114 | #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ | 116 | #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ |
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index e1700102f35e..da7d18240866 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c | |||
@@ -38,12 +38,6 @@ void __init platform_init(bp_tag_t* bootparam) | |||
38 | 38 | ||
39 | } | 39 | } |
40 | 40 | ||
41 | #ifdef CONFIG_PCI | ||
42 | void platform_pcibios_init(void) | ||
43 | { | ||
44 | } | ||
45 | #endif | ||
46 | |||
47 | void platform_halt(void) | 41 | void platform_halt(void) |
48 | { | 42 | { |
49 | pr_info(" ** Called platform_halt() **\n"); | 43 | pr_info(" ** Called platform_halt() **\n"); |
@@ -64,7 +58,9 @@ void platform_restart(void) | |||
64 | "wsr a2, icountlevel\n\t" | 58 | "wsr a2, icountlevel\n\t" |
65 | "movi a2, 0\n\t" | 59 | "movi a2, 0\n\t" |
66 | "wsr a2, icount\n\t" | 60 | "wsr a2, icount\n\t" |
61 | #if XCHAL_NUM_IBREAK > 0 | ||
67 | "wsr a2, ibreakenable\n\t" | 62 | "wsr a2, ibreakenable\n\t" |
63 | #endif | ||
68 | "wsr a2, lcount\n\t" | 64 | "wsr a2, lcount\n\t" |
69 | "movi a2, 0x1f\n\t" | 65 | "movi a2, 0x1f\n\t" |
70 | "wsr a2, ps\n\t" | 66 | "wsr a2, ps\n\t" |
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index fc3c91fd20f7..c0edb35424ce 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c | |||
@@ -85,7 +85,7 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector, | |||
85 | while (nbytes > 0) { | 85 | while (nbytes > 0) { |
86 | unsigned long io; | 86 | unsigned long io; |
87 | 87 | ||
88 | __simc(SYS_lseek, dev->fd, offset, SEEK_SET, 0, 0); | 88 | simc_lseek(dev->fd, offset, SEEK_SET); |
89 | if (write) | 89 | if (write) |
90 | io = simc_write(dev->fd, buffer, nbytes); | 90 | io = simc_write(dev->fd, buffer, nbytes); |
91 | else | 91 | else |
@@ -176,7 +176,7 @@ static int simdisk_attach(struct simdisk *dev, const char *filename) | |||
176 | err = -ENODEV; | 176 | err = -ENODEV; |
177 | goto out; | 177 | goto out; |
178 | } | 178 | } |
179 | dev->size = __simc(SYS_lseek, dev->fd, 0, SEEK_END, 0, 0); | 179 | dev->size = simc_lseek(dev->fd, 0, SEEK_END); |
180 | set_capacity(dev->gd, dev->size >> SECTOR_SHIFT); | 180 | set_capacity(dev->gd, dev->size >> SECTOR_SHIFT); |
181 | dev->filename = filename; | 181 | dev->filename = filename; |
182 | pr_info("SIMDISK: %s=%s\n", dev->gd->disk_name, dev->filename); | 182 | pr_info("SIMDISK: %s=%s\n", dev->gd->disk_name, dev->filename); |