Ejemplo n.º 1
0
unsigned short generic_inw_p(unsigned long port)
{
	unsigned long v = *(volatile unsigned short*)PORT2ADDR(port);

	delay();
	return v;
}
Ejemplo n.º 2
0
unsigned int generic_inl_p(unsigned long port)
{
	unsigned long v = *(volatile unsigned long*)PORT2ADDR(port);

	delay();
	return v;
}
Ejemplo n.º 3
0
unsigned char generic_inb_p(unsigned long port)
{
	unsigned long v = *(volatile unsigned char*)PORT2ADDR(port);

	delay();
	return v;
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
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++;
}
Ejemplo n.º 7
0
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;
}
Ejemplo n.º 8
0
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++;
}
Ejemplo n.º 9
0
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;
}
Ejemplo n.º 10
0
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
}
Ejemplo n.º 11
0
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
}
Ejemplo n.º 12
0
void hd64461_outw(unsigned short b, unsigned long port)
{
	*(volatile unsigned short*)PORT2ADDR(port) = b;
}
Ejemplo n.º 13
0
void hd64461_outl(unsigned int b, unsigned long port)
{
        *(volatile unsigned long*)PORT2ADDR(port) = b;
}
Ejemplo n.º 14
0
unsigned char hd64461_inb(unsigned long port)
{
	return *(volatile unsigned char*)PORT2ADDR(port);
}
Ejemplo n.º 15
0
unsigned short hd64461_inw(unsigned long port)
{
	return *(volatile unsigned short*)PORT2ADDR(port);
}
Ejemplo n.º 16
0
void hd64461_outb(unsigned char b, unsigned long port)
{
	*(volatile unsigned char*)PORT2ADDR(port) = b;
}
Ejemplo n.º 17
0
unsigned short generic_inw(unsigned long port)
{
	return *(volatile unsigned short*)PORT2ADDR(port);
}
Ejemplo n.º 18
0
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++;
}
Ejemplo n.º 19
0
void generic_outl_p(unsigned int b, unsigned long port)
{
	*(volatile unsigned long*)PORT2ADDR(port) = b;
	delay();
}
Ejemplo n.º 20
0
void generic_outw_p(unsigned short b, unsigned long port)
{
	*(volatile unsigned short*)PORT2ADDR(port) = b;
	delay();
}
Ejemplo n.º 21
0
void generic_outb_p(unsigned char b, unsigned long port)
{
	*(volatile unsigned char*)PORT2ADDR(port) = b;
	delay();
}
Ejemplo n.º 22
0
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;
	}
}
Ejemplo n.º 23
0
unsigned int generic_inl(unsigned long port)
{
	return *(volatile unsigned long*)PORT2ADDR(port);
}
Ejemplo n.º 24
0
unsigned int hd64461_inl(unsigned long port)
{
	return *(volatile unsigned long*)PORT2ADDR(port);
}
Ejemplo n.º 25
0
unsigned char generic_inb(unsigned long port)
{
	return *(volatile unsigned char*)PORT2ADDR(port);
}
Ejemplo n.º 26
0
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;
}