From: NIIBE Y. <gn...@ch...> - 2000-05-14 08:40:15
|
Here is the change I've done this week. IDE works on SolutionEngine SH7709A now. Thanks Nozawa-san for the suggestion. And it found out that setting interrupt registers at irq_ipr.c is not good (for SolutionEngine SH7709A). I will remove this soon. Mitch, could you please import the new kernel. Now we see S390 port. -------------------------- 2000-05-14 NIIBE Yutaka <gn...@ch...> * arch/sh/lib/checksum.S (csum_partial): Improved a bit. * include/asm-sh/checksum.h (ip_fast_csum): Improved implementation for both of code size and speed. (csum_fold): Removed last line: "extu.w %0, %0". It's not needed, as it always cast to unsigned short. Caution: the result value as "unsigned int" is different. 2000-05-13 NIIBE Yutaka <gn...@ch...> * arch/sh/kernel/time.c (time_init): Bug fix for SH-3's CPG. Not full implementation yet. * include/asm-sh/smc37c93x.h (GPIO46_INDEX, GPIO47_INDEX): Added. * arch/sh/kernel/setup_se.c (init_smsc): Added setting of nIO{R,W}OP. Suggested by Toshiharu Nozawa <no...@hi...>. * include/asm-sh/unistd.h (_syscall5): Bug fix. * arch/sh/kernel/irq.c (init_irq_proc): Added. Index: arch/sh/kernel/irq.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/irq.c,v retrieving revision 1.7 diff -u -r1.7 irq.c --- arch/sh/kernel/irq.c 2000/05/03 09:05:50 1.7 +++ arch/sh/kernel/irq.c 2000/05/14 08:24:27 @@ -513,3 +513,10 @@ spin_unlock_irqrestore(&irq_controller_lock,flags); return 0; } + +#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL) + +void init_irq_proc(void) +{ +} +#endif Index: arch/sh/kernel/irq_ipr.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/irq_ipr.c,v retrieving revision 1.5 diff -u -r1.5 irq_ipr.c --- arch/sh/kernel/irq_ipr.c 2000/05/03 09:05:50 1.5 +++ arch/sh/kernel/irq_ipr.c 2000/05/14 08:24:27 @@ -134,6 +134,7 @@ * Initialize the Interrupt Controller (INTC) * registers to their power on values */ +#if 0 /* * XXX: I think that this is the job of boot loader. -- gniibe * @@ -145,7 +146,7 @@ ctrl_outb(0, INTC_IRR2); ctrl_outw(0, INTC_ICR0); - ctrl_outw(0, INTC_ICR1); + ctrl_outw(0, INTC_ICR1);/* Really? 0x4000?*/ ctrl_outw(0, INTC_ICR2); ctrl_outw(0, INTC_INTER); ctrl_outw(0, INTC_IPRA); @@ -153,6 +154,7 @@ ctrl_outw(0, INTC_IPRC); ctrl_outw(0, INTC_IPRD); ctrl_outw(0, INTC_IPRE); +#endif /* * Enable external irq (INTC IRQ mode). Index: arch/sh/kernel/setup_se.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/setup_se.c,v retrieving revision 1.5 diff -u -r1.5 setup_se.c --- arch/sh/kernel/setup_se.c 2000/05/07 23:31:58 1.5 +++ arch/sh/kernel/setup_se.c 2000/05/14 08:24:27 @@ -42,6 +42,11 @@ smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */ + /* AUXIO (GPIO): to use IDE1 */ + smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO); + smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */ + smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */ + /* COM1 */ smsc_config(CURRENT_LDN_INDEX, LDN_COM1); smsc_config(ACTIVATE_INDEX, 0x01); Index: arch/sh/kernel/time.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/time.c,v retrieving revision 1.8 diff -u -r1.8 time.c --- arch/sh/kernel/time.c 2000/05/09 00:13:58 1.8 +++ arch/sh/kernel/time.c 2000/05/14 08:24:27 @@ -389,7 +389,7 @@ #if defined(__sh3__) static int ifc_table[] = { 1, 2, 4, 1, 3, 1, 1, 1 }; static int pfc_table[] = { 1, 2, 4, 1, 3, 6, 1, 1 }; - static int sfc_table[] = { 1, 2, 3, 4, 6, 8, 1, 1 }; + static int stc_table[] = { 1, 2, 3, 4, 6, 8, 1, 1 }; #elif defined(__SH4__) static int ifc_table[] = { 1, 2, 3, 4, 6, 8, 1, 1 }; #define bfc_table ifc_table /* Same */ @@ -421,8 +421,8 @@ tmp = (frqcr & 0x2000) >> 11; tmp |= frqcr & 0x0003; pfc = pfc_table[tmp]; - master_clock = cpu_clock * ifc; - bus_clock = master_clock/sfc; + master_clock = cpu_clock; + bus_clock = master_clock/pfc; } #elif defined(__SH4__) { Index: arch/sh/lib/checksum.S =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/lib/checksum.S,v retrieving revision 1.3 diff -u -r1.3 checksum.S --- arch/sh/lib/checksum.S 2000/05/09 01:59:59 1.3 +++ arch/sh/lib/checksum.S 2000/05/14 08:24:27 @@ -49,98 +49,99 @@ * Fortunately, it is easy to convert 2-byte alignment to 4-byte * alignment for the unrolled loop. */ - mov r5,r1 - mov r4,r0 - tst #2,r0 ! Check alignment. + mov $r5, $r1 + mov $r4, $r0 + tst #2, $r0 ! Check alignment. bt 2f ! Jump if alignment is ok. ! - add #-2,r5 ! Alignment uses up two bytes. - cmp/pz r5 ! + add #-2, $r5 ! Alignment uses up two bytes. + cmp/pz $r5 ! bt/s 1f ! Jump if we had at least two bytes. clrt bra 6f - add #2,r5 ! r5 was < 2. Deal with it. + add #2, $r5 ! $r5 was < 2. Deal with it. 1: - mov.w @r4+,r0 - extu.w r0,r0 - addc r0,r6 + mov.w @$r4+, $r0 + extu.w $r0, $r0 + addc $r0, $r6 bf 2f - add #1,r6 + add #1, $r6 2: - mov #-5,r0 - shld r0,r5 - tst r5,r5 + mov #-5, $r0 + shld $r0, $r5 + tst $r5, $r5 bt/s 4f ! if it's =0, go to 4f clrt + .align 2 3: - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - mov.l @r4+,r0 - addc r0,r6 - movt r0 - dt r5 + mov.l @$r4+, $r0 + mov.l @$r4+, $r2 + mov.l @$r4+, $r3 + addc $r0, $r6 + mov.l @$r4+, $r0 + addc $r2, $r6 + mov.l @$r4+, $r2 + addc $r3, $r6 + mov.l @$r4+, $r3 + addc $r0, $r6 + mov.l @$r4+, $r0 + addc $r2, $r6 + mov.l @$r4+, $r2 + addc $r3, $r6 + addc $r0, $r6 + addc $r2, $r6 + movt $r0 + dt $r5 bf/s 3b - cmp/eq #1,r0 - mov #0,r0 - addc r0,r6 + cmp/eq #1, $r0 + ! here, we know $r5==0 + addc $r5, $r6 ! add carry to $r6 4: - mov r1,r5 - mov #0x1c,r0 - and r0,r5 - tst r5,r5 + mov $r1, $r0 + and #0x1c, $r0 + tst $r0, $r0 bt/s 6f - clrt - shlr2 r5 + mov $r0, $r5 + shlr2 $r5 + mov #0, $r2 5: - mov.l @r4+,r0 - addc r0,r6 - movt r0 - dt r5 + addc $r2, $r6 + mov.l @$r4+, $r2 + movt $r0 + dt $r5 bf/s 5b - cmp/eq #1,r0 - mov #0,r0 - addc r0,r6 + cmp/eq #1, $r0 + addc $r2, $r6 + addc $r5, $r6 ! $r5==0 here, so it means add carry-bit 6: - mov r1,r5 - mov #3,r0 - and r0,r5 - tst r5,r5 + mov $r1, $r5 + mov #3, $r0 + and $r0, $r5 + tst $r5, $r5 bt 9f ! if it's =0 go to 9f - mov #2,r1 - cmp/hs r1,r5 + mov #2, $r1 + cmp/hs $r1, $r5 bf 7f - mov.w @r4+,r0 - extu.w r0,r0 - cmp/eq r1,r5 + mov.w @r4+, $r0 + extu.w $r0, $r0 + cmp/eq $r1, $r5 bt/s 8f clrt - shll16 r0 - addc r0,r6 + shll16 $r0 + addc $r0, $r6 7: - mov.b @r4+,r0 - extu.b r0,r0 + mov.b @$r4+, $r0 + extu.b $r0, $r0 #ifndef __LITTLE_ENDIAN__ - shll8 r0 + shll8 $r0 #endif 8: - addc r0,r6 - mov #0,r0 - addc r0,r6 + addc $r0, $r6 + mov #0, $r0 + addc $r0, $r6 9: rts - mov r6,r0 + mov $r6, $r0 /* unsigned int csum_partial_copy_generic (const char *src, char *dst, int len, @@ -315,7 +316,7 @@ mov.l 8000f,r0 jmp @r0 nop - .balign 4 + .align 2 8000: .long 5000b 6002: @@ -325,7 +326,7 @@ mov.l 8001f,r0 jmp @r0 nop - .balign 4 + .align 2 8001: .long 5000b .previous Index: include/asm-sh/checksum.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/checksum.h,v retrieving revision 1.3 diff -u -r1.3 checksum.h --- include/asm-sh/checksum.h 2000/05/09 00:14:00 1.3 +++ include/asm-sh/checksum.h 2000/05/14 08:24:29 @@ -79,7 +79,6 @@ "swap.w %0, %1\n\t" "add %1, %0\n\t" "not %0, %0\n\t" - "extu.w %0, %0" : "=r" (sum), "=&r" (__dummy) : "0" (sum)); return sum; @@ -94,31 +93,26 @@ */ static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) { - unsigned int sum, __dummy; + unsigned int sum, __dummy0, __dummy1; __asm__ __volatile__( "mov.l @%1+, %0\n\t" - "add #-4, %2\n\t" - "clrt\n\t" - "mov.l @%1+, %3\n\t" - "addc %3, %0\n\t" - "mov.l @%1+, %3\n\t" - "addc %3, %0\n\t" "mov.l @%1+, %3\n\t" - "addc %3, %0\n" + "add #-2, %2\n\t" + "clrt\n\t" "1:\t" - "mov.l @%1+, %3\n\t" "addc %3, %0\n\t" - "movt %3\n\t" + "movt %4\n\t" + "mov.l @%1+, %3\n\t" "dt %2\n\t" "bf/s 1b\n\t" - " cmp/eq #1, %3\n\t" - "mov #0, %3\n\t" + " cmp/eq #1, %4\n\t" "addc %3, %0\n\t" + "addc %2, %0" /* Here %2 is 0, add carry-bit */ /* Since the input registers which are loaded with iph and ihl are modified, we must also specify them as outputs, or gcc will assume they contain their original values. */ - : "=r" (sum), "=r" (iph), "=r" (ihl), "=&z" (__dummy) + : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1) : "1" (iph), "2" (ihl)); return csum_fold(sum); Index: include/asm-sh/smc37c93x.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/smc37c93x.h,v retrieving revision 1.1 diff -u -r1.1 smc37c93x.h --- include/asm-sh/smc37c93x.h 2000/05/03 02:24:42 1.1 +++ include/asm-sh/smc37c93x.h 2000/05/14 08:24:29 @@ -47,6 +47,9 @@ #define IRQ_SELECT_INDEX 0x70 #define DMA_SELECT_INDEX 0x74 +#define GPIO46_INDEX 0xc6 +#define GPIO47_INDEX 0xc7 + /* UART stuff. Only for debugging. */ /* UART Register */ Index: include/asm-sh/unistd.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/unistd.h,v retrieving revision 1.4 diff -u -r1.4 unistd.h --- include/asm-sh/unistd.h 2000/04/24 00:25:30 1.4 +++ include/asm-sh/unistd.h 2000/05/14 08:24:29 @@ -314,16 +314,16 @@ #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ +register long __sc3 __asm__ ("$r3") = __NR_##name; \ register long __sc4 __asm__ ("$r4") = (long) arg1; \ register long __sc5 __asm__ ("$r5") = (long) arg2; \ register long __sc6 __asm__ ("$r6") = (long) arg3; \ register long __sc7 __asm__ ("$r7") = (long) arg4; \ -register long __sc2 __asm__ ("$r0") = (long) arg5; \ +register long __sc0 __asm__ ("$r0") = (long) arg5; \ __asm__ __volatile__ ("trapa #0x15" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ - "r" (__sc7), "r" (__sc2) \ + "r" (__sc3) \ : "memory" ); \ __syscall_return(type,__sc0); \ } |