From cae167d3d7f22a6a54ba47e7c3623b4c45a01e2b Mon Sep 17 00:00:00 2001 From: Yutaro Ebihara Date: Tue, 11 Mar 2008 13:58:50 +0900 Subject: [PATCH 1/7] serial: sh-sci: Fix fifo stall on SH7760/SH7780/SH7785 SCIF. There was an off-by-1 in the SCRFDR calculation that caused writes over 128-bytes to hang in the FIFO. Fix it up. Signed-off-by: Yutaro Ebihara Signed-off-by: Paul Mundt --- drivers/serial/sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index a8c116b80bff..9d244d1644e1 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -414,12 +414,12 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) defined(CONFIG_CPU_SUBTYPE_SH7785) static inline int scif_txroom(struct uart_port *port) { - return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0x7f); + return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff); } static inline int scif_rxroom(struct uart_port *port) { - return sci_in(port, SCRFDR) & 0x7f; + return sci_in(port, SCRFDR) & 0xff; } #else static inline int scif_txroom(struct uart_port *port) From 6c0602b8dd4b41c078b52ed8ea97023970781744 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 13 Mar 2008 19:43:07 +0900 Subject: [PATCH 2/7] sh: Fix up the address error exception handler for SH-2. Presently the SH-2/SH-2A address error exception dispatch copies off the register state from the stack and skips over the first register, skewing the rest. Fix up the math here so that the proper register state is handed down to the exception handler itself. Signed-off-by: Kieran Bingham Signed-off-by: Paul Mundt --- arch/sh/kernel/cpu/sh2/entry.S | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/sh/kernel/cpu/sh2/entry.S b/arch/sh/kernel/cpu/sh2/entry.S index 7a26569e7956..0fc89069d8c7 100644 --- a/arch/sh/kernel/cpu/sh2/entry.S +++ b/arch/sh/kernel/cpu/sh2/entry.S @@ -267,7 +267,6 @@ ENTRY(sh_bios_handler) ENTRY(address_error_trap_handler) mov r15,r4 ! regs - add #4,r4 mov #OFF_PC,r0 mov.l @(r0,r15),r6 ! pc mov.l 1f,r0 From 2b2d4e70031d910f3ddf4d5d2b8be6724f871549 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 13 Mar 2008 19:51:06 +0900 Subject: [PATCH 3/7] sh: Fix up the timer IRQ definition for SH7203. Signed-off-by: Paul Mundt --- arch/sh/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 95b7534e9e3c..12720489e458 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -580,6 +580,7 @@ config SH_TIMER_IRQ CPU_SUBTYPE_SH7763 default "86" if CPU_SUBTYPE_SH7619 default "140" if CPU_SUBTYPE_SH7206 + default "142" if CPU_SUBTYPE_SH7203 default "16" config SH_PCLK_FREQ From 66b5bf4216631628788bc48b028c203e8538f43e Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 14 Mar 2008 17:19:38 +0900 Subject: [PATCH 4/7] sh: Fix uImage build error. The printf string was broken in the same way the zImage one was before, though the uImage managed to avoid getting fixed at that time. Do so now. Signed-off-by: Paul Mundt --- arch/sh/boot/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 59f552c13349..3dda24daa0a8 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile @@ -32,12 +32,12 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(obj)/compressed/vmlinux: FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ -KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \ +KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ $$[$(CONFIG_PAGE_OFFSET) + \ $(CONFIG_MEMORY_START) + \ $(CONFIG_ZERO_PAGE_OFFSET)]') -KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%8x" \ +KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \ $$[$(CONFIG_PAGE_OFFSET) + \ $(CONFIG_MEMORY_START) + \ $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]') From 6dba1b67601685ff00ef5d08cc4f11db00cff598 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 14 Mar 2008 17:21:09 +0900 Subject: [PATCH 5/7] sh: Fix more user header breakage from sh64 integration. posix_types.h and byteorder.h were sticking purely with the Kconfig symbols, which doesn't work when we scrub the headers for user use. Fixes a very unhelpful build error in current klibc. Signed-off-by: Paul Mundt --- include/asm-sh/byteorder.h | 15 +++++++-------- include/asm-sh/posix_types.h | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/asm-sh/byteorder.h b/include/asm-sh/byteorder.h index 0eb9904b6545..4c13e6117563 100644 --- a/include/asm-sh/byteorder.h +++ b/include/asm-sh/byteorder.h @@ -11,13 +11,13 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) { __asm__( -#ifdef CONFIG_SUPERH32 +#ifdef __SH5__ + "byterev %0, %0\n\t" + "shari %0, 32, %0" +#else "swap.b %0, %0\n\t" "swap.w %0, %0\n\t" "swap.b %0, %0" -#else - "byterev %0, %0\n\t" - "shari %0, 32, %0" #endif : "=r" (x) : "0" (x)); @@ -28,12 +28,11 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) { __asm__( -#ifdef CONFIG_SUPERH32 - "swap.b %0, %0" -#else +#ifdef __SH5__ "byterev %0, %0\n\t" "shari %0, 32, %0" - +#else + "swap.b %0, %0" #endif : "=r" (x) : "0" (x)); diff --git a/include/asm-sh/posix_types.h b/include/asm-sh/posix_types.h index 4b9d11c9fc77..4eeb723aee7e 100644 --- a/include/asm-sh/posix_types.h +++ b/include/asm-sh/posix_types.h @@ -4,4 +4,10 @@ # else # include "posix_types_64.h" # endif +#else +# ifdef __SH5__ +# include "posix_types_64.h" +# else +# include "posix_types_32.h" +# endif #endif /* __KERNEL__ */ From 40f75879a0dda7025cebc3444c9317ec9e3dcd70 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Sat, 15 Mar 2008 12:49:10 -0400 Subject: [PATCH 6/7] SH: Use newer, non-deprecated __SPIN_LOCK_UNLOCKED macro. Signed-off-by: Robert P. J. Day Signed-off-by: Paul Mundt --- arch/sh/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 94075e1a1e61..5d039d168f57 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c @@ -179,7 +179,7 @@ void smp_send_stop(void) } struct smp_fn_call_struct smp_fn_call = { - .lock = SPIN_LOCK_UNLOCKED, + .lock = __SPIN_LOCK_UNLOCKED(smp_fn_call.lock), .finished = ATOMIC_INIT(0), }; From 49a5ba46c5d1e34bcb07634157b29d7414ce13bd Mon Sep 17 00:00:00 2001 From: Franck Bui-Huu Date: Fri, 21 Mar 2008 12:22:01 +0900 Subject: [PATCH 7/7] sh: Use relative paths for mach/cpu symlinks. When building the kernel without passing the O= command line parameter there's no point to use absolute paths for them. Usually relative paths are preferred because they survive directory moves, work across networked file systems and chrooted environments. Absolute paths are still used if an output directory is given. Signed-off-by: Franck Bui-Huu Signed-off-by: Paul Mundt --- arch/sh/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/sh/Makefile b/arch/sh/Makefile index c510c225144f..cffc92b1bf2e 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -154,7 +154,11 @@ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ boot := arch/sh/boot +ifneq ($(KBUILD_SRC),) incdir-prefix := $(srctree)/include/asm-sh/ +else +incdir-prefix := +endif # Update machine arch and proc symlinks if something which affects # them changed. We use .arch and .mach to indicate when they were @@ -182,7 +186,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi $(Q)rm -f include/asm-sh/mach $(Q)for i in $(incdir-y); do \ - if [ -d $(incdir-prefix)$$i ]; then \ + if [ -d $(srctree)/include/asm-sh/$$i ]; then \ echo -n ' SYMLINK include/asm-sh/mach -> '; \ echo -e "include/asm-sh/$$i"; \ ln -fsn $(incdir-prefix)$$i \ @@ -191,7 +195,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ if [ ! -d include/asm-sh/mach ]; then \ echo -n ' SYMLINK include/asm-sh/mach -> '; \ echo -e 'include/asm-sh'; \ - ln -fsn $(incdir-prefix) include/asm-sh/mach; \ + ln -fsn $(incdir-prefix)../asm-sh include/asm-sh/mach; \ fi; \ fi; \ done