How to initialize USB controller in LinuxBios?

riskin at 263.net riskin at 263.net
Thu Feb 20 21:12:00 CET 2003


Hi,ollie,

My kernel is "2.2.14",so I need to initialize USB controller in LinuxBios.

But,I don't know how to correctly initialize USB controller in LinuxBios 
on the sis630e chipset.

I have checked the USB pci config space on the sis630e chipset,
so I  assigned "I/0" addresses "0xd001<<12" and "0xd8001<<12".
And,the function number of the tow USB controller is 2 and 3.

So,I modified LinuxBios like following:

void pci_usb_enable(unsigned bus, unsigned slot,
	unsigned int irq)
{
	unsigned functNum;
	struct pci_dev *pdev;
	unsigned char line;
	unsigned char readback;
	u32 io[2]={0xd001<<12,0xd801<<12};

	for (functNum = 2; functNum < 4; functNum++) {
		pdev = pci_find_slot(bus, (slot << 3) + functNum);

		if (pdev) {
			pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &line);
			printk_debug("USB PIN: %d\n",line);
			pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, \
			io[functNum-2]);

			pci_write_config_byte(pdev, PCI_COMMAND, \
			PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
			if ((line >= 1) && (line <= 4)) {
				
				printk_debug("Assigning usb IRQ %d to %d:%x.%d\n", \
					irq, bus, slot, functNum);

				pci_write_config_byte(pdev, PCI_INTERRUPT_LINE,\
					irq);

				pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, \
						&readback);
				printk_debug("  Readback = %d\n", readback);

			}
		}
	}
}

...

pci_usb_enable(0,1,0xa);

...

After done this,I looked up /proc/pci:



PCI devices found:
  Bus  0, device   0, function  0:
    Host bridge: Silicon Integrated Systems Unknown device (rev 33).
      Vendor id=1039. Device id=630.
      Medium devsel.  Master Capable.  Latency=64.  
      Non-prefetchable 32 bit memory at 0xf8000000 [0xf8000000].
  Bus  0, device   0, function  1:
    IDE interface: Silicon Integrated Systems 85C5513 (rev 208).
      Fast devsel.  IRQ 14.  Master Capable.  Latency=16.  
      I/O at 0x2c00 [0x2c01].
  Bus  0, device   1, function  0:
    ISA bridge: Silicon Integrated Systems 85C503 (rev 0).
      Medium devsel.  Master Capable.  No bursts.  
  Bus  0, device   1, function  1:
    Ethernet controller: Silicon Integrated Systems Unknown device (rev 131).
      Vendor id=1039. Device id=900.
      Medium devsel.  Fast back-to-back capable.  IRQ 9.  Master Capable.  Latency=64.  Min Gnt=52.Max Lat=11.
      I/O at 0xb000 [0xb001].
      Non-prefetchable 32 bit memory at 0xfc108000 [0xfc108000].
  Bus  0, device   1, function  2:
    USB Controller: Silicon Integrated Systems 7001 USB (rev 7).
      Medium devsel.  Fast back-to-back capable.  IRQ 10.  Master Capable.  Latency=64.  Max Lat=80.
      Non-prefetchable 32 bit memory at 0xd001000 [0xd001000].
  Bus  0, device   1, function  3:
    USB Controller: Silicon Integrated Systems 7001 USB (rev 7).
      Medium devsel.  Fast back-to-back capable.  IRQ 10.  Master Capable.  Latency=64.  Max Lat=80.
      Non-prefetchable 32 bit memory at 0xd801000 [0xd801000].
  Bus  0, device   2, function  0:
    PCI bridge: Silicon Integrated Systems 5591/5592 AGP (rev 0).
      Fast devsel.  Master Capable.  No bursts.  Min Gnt=8.
  Bus  0, device   9, function  0:
    Bridge: Texas Instruments Unknown device (rev 0).
      Vendor id=104c. Device id=ac60.
      Medium devsel.  IRQ 5.  
      Non-prefetchable 32 bit memory at 0xfc10b000 [0xfc10b000].
      Non-prefetchable 32 bit memory at 0xfc100000 [0xfc100000].
      Non-prefetchable 32 bit memory at 0xfc10c000 [0xfc10c000].
  Bus  0, device  11, function  0:
    Ethernet controller: Realtek 8139 (rev 16).
      Medium devsel.  Fast back-to-back capable.  IRQ 10.  Master Capable.  Latency=64.  Min Gnt=32.Max Lat=64.
      I/O at 0x2400 [0x2401].
      Non-prefetchable 32 bit memory at 0xfc10d000 [0xfc10d000].
  Bus  0, device  13, function  0:
    Ethernet controller: Realtek 8139 (rev 16).
      Medium devsel.  Fast back-to-back capable.  IRQ 9.  Master Capable.  Latency=64.  Min Gnt=32.Max Lat=64.
      I/O at 0x2800 [0x2801].
      Non-prefetchable 32 bit memory at 0xfc10e000 [0xfc10e000].
  Bus  1, device   0, function  0:
    VGA compatible controller: Silicon Integrated Systems Unknown device (rev 33).
      Vendor id=1039. Device id=6300.
      Medium devsel.  Fast back-to-back capable.  BIST capable.  
      Prefetchable 32 bit memory at 0xf0000000 [0xf0000008].
      Non-prefetchable 32 bit memory at 0xfc000000 [0xfc000000].
      I/O at 0x1000 [0x1001].


I didn't find The "I/O" addresses of USB controller.

So,is there other things need to be done to initialize USB controller correctly?

Could you help me?

Thanks,

riskin









==========================
263电子邮件-信赖邮自专业



More information about the coreboot mailing list