From 6aebb64ad415c7d63ad4db5b401f960fe7b1d972 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:32 +0400 Subject: xtensa: ISS: only build networking if configured This allows building kernel in allnoconfig configuration. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/Makefile b/arch/xtensa/platforms/iss/Makefile index af96e314d71f..c61dd3961b17 100644 --- a/arch/xtensa/platforms/iss/Makefile +++ b/arch/xtensa/platforms/iss/Makefile @@ -4,5 +4,5 @@ # "prom monitor" library routines under Linux. # -obj-y = io.o console.o setup.o network.o - +obj-y = io.o console.o setup.o +obj-$(CONFIG_NET) += network.o -- cgit v1.2.3 From 717460ee3e8399eb66799cac0bb83217475b7027 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:35 +0400 Subject: xtensa: ISS: fix __simc implementation Do not rely on compiler implicitly placing function arguments into specifc registers, place them explicitly. Move __simc and related helpers to platform/simcall.h Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/console.c | 13 ------ .../platforms/iss/include/platform/simcall.h | 53 ++++++++++++++++++++++ arch/xtensa/platforms/iss/network.c | 49 -------------------- 3 files changed, 53 insertions(+), 62 deletions(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index f9726f6afdf1..daee86cdf0cc 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -41,19 +41,6 @@ static struct timer_list serial_timer; static DEFINE_SPINLOCK(timer_lock); -int errno; - -static int __simc (int a, int b, int c, int d, int e, int f) __attribute__((__noinline__)); -static int __simc (int a, int b, int c, int d, int e, int f) -{ - int ret; - __asm__ __volatile__ ("simcall\n" - "mov %0, a2\n" - "mov %1, a3\n" : "=a" (ret), "=a" (errno) - : : "a2", "a3"); - return ret; -} - static char *serial_version = "0.1"; static char *serial_name = "ISS serial driver"; diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h index b7952c06a2b7..8c43bfea05e1 100644 --- a/arch/xtensa/platforms/iss/include/platform/simcall.h +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h @@ -57,6 +57,59 @@ #define XTISS_SELECT_ONE_WRITE 2 #define XTISS_SELECT_ONE_EXCEPT 3 +static int errno; + +static inline int __simc(int a, int b, int c, int d, int e, int f) +{ + int ret; + register int a1 asm("a2") = a; + register int b1 asm("a3") = b; + register int c1 asm("a4") = c; + register int d1 asm("a5") = d; + register int e1 asm("a6") = e; + register int f1 asm("a7") = f; + __asm__ __volatile__ ( + "simcall\n" + "mov %0, a2\n" + "mov %1, a3\n" + : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1) + : "r"(c1), "r"(d1), "r"(e1), "r"(f1) + : ); + return ret; +} + +static inline int simc_open(char *file, int flags, int mode) +{ + return __simc(SYS_open, (int) file, flags, mode, 0, 0); +} + +static inline int simc_close(int fd) +{ + return __simc(SYS_close, fd, 0, 0, 0, 0); +} + +static inline int simc_ioctl(int fd, int request, void *arg) +{ + return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); +} + +static inline int simc_read(int fd, void *buf, size_t count) +{ + return __simc(SYS_read, fd, (int) buf, count, 0, 0); +} + +static inline int simc_write(int fd, void *buf, size_t count) +{ + return __simc(SYS_write, fd, (int) buf, count, 0, 0); +} + +static inline int simc_poll(int fd) +{ + struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; + + return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv, + 0, 0); +} #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */ diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 7dde24456427..7d0fea6d7f20 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c @@ -101,55 +101,6 @@ struct iss_net_private { }; -/* ======================= ISS SIMCALL INTERFACE =========================== */ - -/* Note: __simc must _not_ be declared inline! */ - -static int errno; - -static int __simc (int a, int b, int c, int d, int e, int f) __attribute__((__noinline__)); -static int __simc (int a, int b, int c, int d, int e, int f) -{ - int ret; - __asm__ __volatile__ ("simcall\n" - "mov %0, a2\n" - "mov %1, a3\n" : "=a" (ret), "=a" (errno) - : : "a2", "a3"); - return ret; -} - -static int inline simc_open(char *file, int flags, int mode) -{ - return __simc(SYS_open, (int) file, flags, mode, 0, 0); -} - -static int inline simc_close(int fd) -{ - return __simc(SYS_close, fd, 0, 0, 0, 0); -} - -static int inline simc_ioctl(int fd, int request, void *arg) -{ - return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); -} - -static int inline simc_read(int fd, void *buf, size_t count) -{ - return __simc(SYS_read, fd, (int) buf, count, 0, 0); -} - -static int inline simc_write(int fd, void *buf, size_t count) -{ - return __simc(SYS_write, fd, (int) buf, count, 0, 0); -} - -static int inline simc_poll(int fd) -{ - struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; - - return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv,0,0); -} - /* ================================ HELPERS ================================ */ -- cgit v1.2.3 From 695c617ceec7954545285f1aa065edcbfe71fcee Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:44 +0400 Subject: xtensa: ISS: add dummy serial.h for ISS platform Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/include/platform/serial.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 arch/xtensa/platforms/iss/include/platform/serial.h (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/include/platform/serial.h b/arch/xtensa/platforms/iss/include/platform/serial.h new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit v1.2.3 From 5295325fbf4d48842ca1540fa7bdc51bc19e2fa6 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:45 +0400 Subject: xtensa: ISS: add platform_pcibios_init Provide pcibios initialization function in case PCI is enabled in the kernel config. This allows building kernel in allmodconfig configuration. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/setup.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index f60c8cf6dfbe..e7ce16b24441 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c @@ -38,6 +38,12 @@ void __init platform_init(bp_tag_t* bootparam) } +#ifdef CONFIG_PCI +void platform_pcibios_init(void) +{ +} +#endif + void platform_halt(void) { printk (" ** Called platform_halt(), looping forever! **\n"); -- cgit v1.2.3 From 8bac83289a061e9b080d500533f29b5822de5b80 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:46 +0400 Subject: xtensa: ISS: change keyboard polling rate Polling rate of once per 20 seconds seems to be too low. Increase it to 10 times per second. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index daee86cdf0cc..3fc152292499 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -33,7 +33,7 @@ #endif #define SERIAL_MAX_NUM_LINES 1 -#define SERIAL_TIMER_VALUE (20 * HZ) +#define SERIAL_TIMER_VALUE (HZ / 10) static struct tty_driver *serial_driver; static struct tty_port serial_port; -- cgit v1.2.3 From 237531714fbe07b27f5b2fbf239df962adfc50d7 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:47 +0400 Subject: xtensa: ISS: exit simulator in case of halt or poweroff Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index e7ce16b24441..927acf378ea3 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c @@ -46,14 +46,14 @@ void platform_pcibios_init(void) void platform_halt(void) { - printk (" ** Called platform_halt(), looping forever! **\n"); - while (1); + pr_info(" ** Called platform_halt() **\n"); + __asm__ __volatile__("movi a2, 1\nsimcall\n"); } void platform_power_off(void) { - printk (" ** Called platform_power_off(), looping forever! **\n"); - while (1); + pr_info(" ** Called platform_power_off() **\n"); + __asm__ __volatile__("movi a2, 1\nsimcall\n"); } void platform_restart(void) { -- cgit v1.2.3 From d0fccc0446800a746d109d5c202a4a550036d923 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:48 +0400 Subject: xtensa: ISS: drop unused io.c Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/platforms/iss/Makefile | 2 +- arch/xtensa/platforms/iss/io.c | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 arch/xtensa/platforms/iss/io.c (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/Makefile b/arch/xtensa/platforms/iss/Makefile index c61dd3961b17..b7d1a5c0ff7f 100644 --- a/arch/xtensa/platforms/iss/Makefile +++ b/arch/xtensa/platforms/iss/Makefile @@ -4,5 +4,5 @@ # "prom monitor" library routines under Linux. # -obj-y = io.o console.o setup.o +obj-y = console.o setup.o obj-$(CONFIG_NET) += network.o diff --git a/arch/xtensa/platforms/iss/io.c b/arch/xtensa/platforms/iss/io.c deleted file mode 100644 index 571d0b24f895..000000000000 --- a/arch/xtensa/platforms/iss/io.c +++ /dev/null @@ -1,32 +0,0 @@ -/* This file isn't really needed right now. */ - -#if 0 - -#include -#include - -extern int __simc (); - - -char iss_serial_getc() -{ - char c; - __simc( SYS_read, 0, &c, 1 ); - return c; -} - -void iss_serial_putc( char c ) -{ - __simc( SYS_write, 1, &c, 1 ); -} - -void iss_serial_puts( char *s ) -{ - if( s != 0 && *s != 0 ) - __simc( SYS_write, 1, s, strlen(s) ); -} - -/*#error Need I/O ports to specific hardware!*/ - -#endif - -- cgit v1.2.3