unsigned short generic_inw_p(unsigned long port) { unsigned long v = *(volatile unsigned short*)PORT2ADDR(port); delay(); return v; }
unsigned int generic_inl_p(unsigned long port) { unsigned long v = *(volatile unsigned long*)PORT2ADDR(port); delay(); return v; }
unsigned char generic_inb_p(unsigned long port) { unsigned long v = *(volatile unsigned char*)PORT2ADDR(port); delay(); return v; }
unsigned int microdev_inl(unsigned long port) { #ifdef CONFIG_PCI if (port >= PCIBIOS_MIN_IO) return microdev_pci_inl(port); #endif return *(volatile unsigned int*)PORT2ADDR(port); }
void microdev_outl(unsigned int b, unsigned long port) { #ifdef CONFIG_PCI if (port >= PCIBIOS_MIN_IO) { microdev_pci_outl(b, port); return; } #endif *(volatile unsigned int*)PORT2ADDR(port) = b; }
void microdev_outsl(unsigned long port, const void *buffer, unsigned long count) { volatile unsigned long *port_addr; const unsigned int *buf = buffer; port_addr = (volatile unsigned long *)PORT2ADDR(port); while (count--) *port_addr = *buf++; }
void generic_insb(unsigned long port, void *buffer, unsigned long count) { volatile unsigned char *port_addr; unsigned char *buf=buffer; port_addr = (volatile unsigned char *)PORT2ADDR(port); while(count--) *buf++ = *port_addr; }
void generic_outsb(unsigned long port, const void *buffer, unsigned long count) { volatile unsigned char *port_addr; const unsigned char *buf=buffer; port_addr = (volatile unsigned char *)PORT2ADDR(port); while(count--) *port_addr = *buf++; }
void microdev_insl(unsigned long port, void *buffer, unsigned long count) { volatile unsigned long *port_addr; unsigned int *buf = buffer; port_addr = (volatile unsigned long *)PORT2ADDR(port); while (count--) *buf++ = *port_addr; }
void generic_insw(unsigned long port, void *buffer, unsigned long count) { volatile unsigned short *port_addr; unsigned short *buf=buffer; port_addr = (volatile unsigned short *)PORT2ADDR(port); while(count--) *buf++ = *port_addr; #ifdef SH3_PCMCIA_BUG_WORKAROUND ctrl_inb (DUMMY_READ_AREA6); #endif }
void generic_outsl(unsigned long port, const void *buffer, unsigned long count) { volatile unsigned long *port_addr; const unsigned long *buf=buffer; port_addr = (volatile unsigned long *)PORT2ADDR(port); while(count--) *port_addr = *buf++; #ifdef SH3_PCMCIA_BUG_WORKAROUND ctrl_inb (DUMMY_READ_AREA6); #endif }
void hd64461_outw(unsigned short b, unsigned long port) { *(volatile unsigned short*)PORT2ADDR(port) = b; }
void hd64461_outl(unsigned int b, unsigned long port) { *(volatile unsigned long*)PORT2ADDR(port) = b; }
unsigned char hd64461_inb(unsigned long port) { return *(volatile unsigned char*)PORT2ADDR(port); }
unsigned short hd64461_inw(unsigned long port) { return *(volatile unsigned short*)PORT2ADDR(port); }
void hd64461_outb(unsigned char b, unsigned long port) { *(volatile unsigned char*)PORT2ADDR(port) = b; }
unsigned short generic_inw(unsigned long port) { return *(volatile unsigned short*)PORT2ADDR(port); }
void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count) { volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port); const unsigned long *buf=buffer; while(count--) *addr=*buf++; }
void generic_outl_p(unsigned int b, unsigned long port) { *(volatile unsigned long*)PORT2ADDR(port) = b; delay(); }
void generic_outw_p(unsigned short b, unsigned long port) { *(volatile unsigned short*)PORT2ADDR(port) = b; delay(); }
void generic_outb_p(unsigned char b, unsigned long port) { *(volatile unsigned char*)PORT2ADDR(port) = b; delay(); }
void microdev_outb(unsigned char b, unsigned long port) { #ifdef CONFIG_PCI if (port >= PCIBIOS_MIN_IO) { microdev_pci_outb(b, port); return; } #endif /* * There is a board feature with the current SH4-202 MicroDev in * that the 2 byte enables (nBE0 and nBE1) are tied together (and * to the Chip Select Line (Ethernet_CS)). Due to this conectivity, * it is not possible to safely perform 8-bit writes to the * Ethernet registers, as 16-bits will be consumed from the Data * lines (corrupting the other byte). Hence, this function is * written to impliment 16-bit read/modify/write for all byte-wide * acceses. * * Note: there is no problem with byte READS (even or odd). * * Sean McGoogan - 16th June 2003. */ if ((port >= IO_LAN91C111_BASE) && (port < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) { /* * Then are trying to perform a byte-write to the * LAN91C111. This needs special care. */ if (port % 2 == 1) { /* is the port odd ? */ /* unset bit-0, i.e. make even */ const unsigned long evenPort = port-1; unsigned short word; /* * do a 16-bit read/write to write to 'port', * preserving even byte. * * Even addresses are bits 0-7 * Odd addresses are bits 8-15 */ word = microdev_inw(evenPort); word = (word & 0xffu) | (b << 8); microdev_outw(word, evenPort); } else { /* else, we are trying to do an even byte write */ unsigned short word; /* * do a 16-bit read/write to write to 'port', * preserving odd byte. * * Even addresses are bits 0-7 * Odd addresses are bits 8-15 */ word = microdev_inw(port); word = (word & 0xff00u) | (b); microdev_outw(word, port); } } else { *(volatile unsigned char*)PORT2ADDR(port) = b; } }
unsigned int generic_inl(unsigned long port) { return *(volatile unsigned long*)PORT2ADDR(port); }
unsigned int hd64461_inl(unsigned long port) { return *(volatile unsigned long*)PORT2ADDR(port); }
unsigned char generic_inb(unsigned long port) { return *(volatile unsigned char*)PORT2ADDR(port); }
void hd64461_insl(unsigned long port, void *buffer, unsigned long count) { volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port); unsigned long *buf=buffer; while(count--) *buf++=*addr; }