From: NIIBE Y. <gn...@ch...> - 2000-05-06 07:31:33
|
With following change, integration of I/O handling is finished. For the type of PORT, it is intentionaly changed (from unsigned long to unsigned int) to detect the changes. I'll commit this soon. -------------------------- 2000-05-06 NIIBE Yutaka <gn...@m1...> * include/asm/io.h (outb, outb_p, outw, outl): Fix the prototype. * arch/sh/kernel/io_se.c (outb, outb_p, outw, outl): Follow the change of io.h. * arch/sh/kernel/io_generic.c (inb, inb_p, inw, inl, insb, insw, insl, outb, outb_p, outw, outl, outsb, outsw, outsl): Fix the prototype. * arch/sh/kernel/setup_se.c (init_smsc): Removed setting of POWER_CONTROL, since it is done by ACTIVATE. Index: arch/sh/kernel/io_generic.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/io_generic.c,v retrieving revision 1.2 diff -u -r1.2 io_generic.c --- arch/sh/kernel/io_generic.c 2000/05/03 08:13:34 1.2 +++ arch/sh/kernel/io_generic.c 2000/05/06 07:23:26 @@ -18,12 +18,12 @@ ctrl_inw(0xa0000000); } -unsigned long inb(unsigned long port) +unsigned long inb(unsigned int port) { return *(volatile unsigned char*)PORT2ADDR(port); } -unsigned long inb_p(unsigned long port) +unsigned long inb_p(unsigned int port) { unsigned long v = *(volatile unsigned char*)PORT2ADDR(port); @@ -31,68 +31,68 @@ return v; } -unsigned long inw(unsigned long port) +unsigned long inw(unsigned int port) { return *(volatile unsigned short*)PORT2ADDR(port); } -unsigned long inl(unsigned long port) +unsigned long inl(unsigned int port) { return *(volatile unsigned long*)PORT2ADDR(port); } -void insb(unsigned long port, void *buffer, int count) +void insb(unsigned int port, void *buffer, unsigned long count) { unsigned char *buf=buffer; while(count--) *buf++=inb(port); } -void insw(unsigned long port, void *buffer, int count) +void insw(unsigned int port, void *buffer, unsigned long count) { unsigned short *buf=buffer; while(count--) *buf++=inw(port); } -void insl(unsigned long port, void *buffer, int count) +void insl(unsigned int port, void *buffer, unsigned long count) { unsigned long *buf=buffer; while(count--) *buf++=inl(port); } -void outb(unsigned char b, unsigned long port) +void outb(unsigned long b, unsigned int port) { *(volatile unsigned char*)PORT2ADDR(port) = b; } -void outb_p(unsigned char b, unsigned long port) +void outb_p(unsigned long b, unsigned int port) { *(volatile unsigned char*)PORT2ADDR(port) = b; delay(); } -void outw(unsigned short b, unsigned long port) +void outw(unsigned long b, unsigned int port) { *(volatile unsigned short*)PORT2ADDR(port) = b; } -void outl(unsigned int b, unsigned long port) +void outl(unsigned long b, unsigned int port) { *(volatile unsigned long*)PORT2ADDR(port) = b; } -void outsb(unsigned long port, const void *buffer, int count) +void outsb(unsigned int port, const void *buffer, unsigned long count) { const unsigned char *buf=buffer; while(count--) outb(*buf++, port); } -void outsw(unsigned long port, const void *buffer, int count) +void outsw(unsigned int port, const void *buffer, unsigned long count) { const unsigned short *buf=buffer; while(count--) outw(*buf++, port); } -void outsl(unsigned long port, const void *buffer, int count) +void outsl(unsigned int port, const void *buffer, unsigned long count) { const unsigned long *buf=buffer; while(count--) outl(*buf++, port); Index: arch/sh/kernel/io_se.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/io_se.c,v retrieving revision 1.3 diff -u -r1.3 io_se.c --- arch/sh/kernel/io_se.c 2000/05/03 08:49:58 1.3 +++ arch/sh/kernel/io_se.c 2000/05/06 07:23:26 @@ -97,7 +97,7 @@ return 0; } -void outb(unsigned int value, unsigned int port) +void outb(unsigned long value, unsigned int port) { if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop) *(__u8 *)(sh_pcic_io_wbase + port) = value; @@ -107,7 +107,7 @@ *(port2adr(port)) = value; } -void outb_p(unsigned int value, unsigned int port) +void outb_p(unsigned long value, unsigned int port) { if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop) *(__u8 *)(sh_pcic_io_wbase + port) = value; @@ -118,7 +118,7 @@ delay(); } -void outw(unsigned int value, unsigned int port) +void outw(unsigned long value, unsigned int port) { if (port >= 0x2000 || (sh_pcic_io_start <= port && port <= sh_pcic_io_stop)) @@ -127,7 +127,7 @@ maybebadio(outw, port); } -void outl(unsigned int value, unsigned int port) +void outl(unsigned long value, unsigned int port) { maybebadio(outl, port); } Index: arch/sh/kernel/setup_se.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/setup_se.c,v retrieving revision 1.4 diff -u -r1.4 setup_se.c --- arch/sh/kernel/setup_se.c 2000/05/05 03:46:03 1.4 +++ arch/sh/kernel/setup_se.c 2000/05/06 07:23:26 @@ -32,22 +32,6 @@ outb_p(CONFIG_ENTER, CONFIG_PORT); outb_p(CONFIG_ENTER, CONFIG_PORT); -#if defined(__sh3__) - /* SolutionEngine SH7709A has power control feature */ - /* It reads "FDC37C935APM" */ - /* - * b0: FDC - * b1: IDE1 - * b2: IDE2 - * b3: Parallel port - * b4: Serial port 1 - * b5: Serial port 2 - * b6: ACCESS.bus - * b7: ---- - */ - smsc_config(POWER_CONTROL_INDEX, 0x13); /* Power on! */ -#endif - /* FDC */ smsc_config(CURRENT_LDN_INDEX, LDN_FDC); smsc_config(ACTIVATE_INDEX, 0x01); @@ -70,7 +54,7 @@ smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */ - /* XXX: COM2, PARPORT, KBD, and MOUSE come here... */ + /* XXX: COM2, PARPORT, KBD, and MOUSE will come here... */ outb_p(CONFIG_EXIT, CONFIG_PORT); } @@ -103,7 +87,7 @@ set_ipr_data(10, BCR_ILCRD, 1, 0x0f-10); /* LAN */ - set_ipr_data( 0, BCR_ILCRE, 3, 0x0f- 0); /* PCIRQ3 */ + set_ipr_data( 0, BCR_ILCRE, 3, 0x0f- 0); /* PCIRQ3 */ set_ipr_data(11, BCR_ILCRE, 2, 0x0f-11); /* PCIRQ2 */ set_ipr_data( 9, BCR_ILCRE, 1, 0x0f- 9); /* PCIRQ1 */ set_ipr_data( 7, BCR_ILCRE, 0, 0x0f- 7); /* PCIRQ0 */ Index: include/asm-sh/io.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/io.h,v retrieving revision 1.3 diff -u -r1.3 io.h --- include/asm-sh/io.h 2000/05/03 08:13:34 1.3 +++ include/asm-sh/io.h 2000/05/06 07:23:28 @@ -58,10 +58,10 @@ extern void insw(unsigned int port, void *addr, unsigned long count); extern void insl(unsigned int port, void *addr, unsigned long count); -extern void outb(unsigned int value, unsigned int port); -extern void outb_p(unsigned int value, unsigned int port); -extern void outw(unsigned int value, unsigned int port); -extern void outl(unsigned int value, unsigned int port); +extern void outb(unsigned long value, unsigned int port); +extern void outb_p(unsigned long value, unsigned int port); +extern void outw(unsigned long value, unsigned int port); +extern void outl(unsigned long value, unsigned int port); extern void outsb(unsigned int port, const void *addr, unsigned long count); extern void outsw(unsigned int port, const void *addr, unsigned long count); extern void outsl(unsigned int port, const void *addr, unsigned long count); |