[SeaBIOS] [PATCH] xhci: allocate scratch pad buffers

Idwer Vollering vidwer at gmail.com
Sat Dec 7 00:33:50 CET 2013


=

2013/12/6 Gerd Hoffmann <kraxel at redhat.com>:
> Untested.  Anyone who tried to get xhci run on real hardware
> is welcome to test whenever this patch improves things.

With a keyboard attached to an OHCI/EHCI port, F12 will show the boot
menu.. on XHCI, not at all (yet).

Booting with CONFIG_DEBUG_LEVEL=7:

----- [ seabios log starts here ] -----
Found coreboot cbmem console @ bf11f400
Found mainboard ASUS F2A85-M
malloc preinit
Relocating init from 0x000e33e1 to 0xbf103990 (size 46504)
malloc init
Found CBFS header at 0xfffffcb0
Add romfile: cmos_layout.bin (size=1776)
Add romfile: pci1002,9904.rom (size=65536)
Add romfile: fallback/payload (size=60339)
Add romfile:  (size=3096)
Add romfile: hudson/fwm (size=16)
Add romfile: hudson/xhci (size=24986)
Add romfile: config (size=4817)
Add romfile:  (size=35416)
Add romfile: hudson/imc (size=65536)
Add romfile: fallback/romstage (size=527968)
Add romfile: fallback/coreboot_ram (size=282551)
Add romfile:  (size=7250136)
Add romfile: s3nv (size=32768)
Add romfile:  (size=31832)
init ivt
init bda
init bios32
init PMM
init PNPBIOS table
init keyboard
init mouse
init pic
math cp init
tsc calibrate start=1967554151 end=1973044262 diff=5490111
CPU Mhz=3198
init timer
PCI probe
PCI device 00:00.0 (vd=1022:1410 c=0600)
PCI device 00:01.0 (vd=1002:9904 c=0300)
PCI device 00:01.1 (vd=1002:9902 c=0403)
PCI device 00:10.0 (vd=1022:7812 c=0c03)
PCI device 00:10.1 (vd=1022:7812 c=0c03)
PCI device 00:11.0 (vd=1022:7801 c=0106)
PCI device 00:12.0 (vd=1022:7807 c=0c03)
PCI device 00:12.2 (vd=1022:7808 c=0c03)
PCI device 00:13.0 (vd=1022:7807 c=0c03)
PCI device 00:13.2 (vd=1022:7808 c=0c03)
PCI device 00:14.0 (vd=1022:780b c=0c05)
PCI device 00:14.2 (vd=1022:780d c=0403)
PCI device 00:14.3 (vd=1022:780e c=0601)
PCI device 00:14.4 (vd=1022:780f c=0604)
PCI device 00:14.5 (vd=1022:7809 c=0c03)
PCI device 00:14.7 (vd=1022:7806 c=0805)
PCI device 00:15.0 (vd=1022:43a0 c=0604)
PCI device 00:15.1 (vd=1022:43a1 c=0604)
PCI device 00:18.0 (vd=1022:1400 c=0600)
PCI device 00:18.1 (vd=1022:1401 c=0600)
PCI device 00:18.2 (vd=1022:1402 c=0600)
PCI device 00:18.3 (vd=1022:1403 c=0600)
PCI device 00:18.4 (vd=1022:1404 c=0600)
PCI device 00:18.5 (vd=1022:1405 c=0600)
PCI device 03:00.0 (vd=10ec:8168 c=0200)
Found 25 PCI devices (max PCI bus is 03)
Relocating coreboot bios tables
Copying PIR from 0xbf12f600 to 0x000f52d0
Copying MPTABLE from 0xbf130600/bf130610 to 0x000f50b0
Copying ACPI RSDP from 0xbf131600 to 0x000f5090
Copying SMBIOS entry point from 0xbf13ca00 to 0x000f5070
rsdp=0x000f5090
rsdt=0xbf131624
fadt=0xbf132fb0
pm_tmr_blk=818
Using pmtimer, ioport 0x818
Scan for VGA option rom
Attempting to init PCI bdf 00:01.0 (vd 1002:9904)
Copying data 65536 at 0xff800778 to 65536 at 0x000c0000
Checking rom 0x000c0000 (sig aa55 size 125)
Running option rom at c000:0003
Turning on vga text mode console
SeaBIOS (version rel-1.7.3-117-g31b8b4e-dirty-20131207_002137-localhost)
init usb
XHCI init on dev 00:10.0: regs @ 0xf0148000, 4 ports, 32 slots
XHCI    extcap 0x1 @ f0148500
XHCI    protocol USB  3.00, 2 ports (offset 1)
XHCI    protocol USB  2.00, 2 ports (offset 3)
/bf101000\ Start thread
|bf101000| configure_xhci: resetting
XHCI init on dev 00:10.1: regs @ 0xf014a000, 4 ports, 32 slots
XHCI    extcap 0x1 @ f014a500
XHCI    protocol USB  3.00, 2 ports (offset 1)
XHCI    protocol USB  2.00, 2 ports (offset 3)
/bf100000\ Start thread
|bf100000| configure_xhci: resetting
/bf0ff000\ Start thread
|bf0ff000| xhci_hub_detect port #1: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0ff000/ End thread
EHCI init on dev 00:12.2 (regs=0xf014f820)
/bf0ff000\ Start thread
/bf0fe000\ Start thread
/bf0fd000\ Start thread
|bf0fd000| xhci_hub_detect port #1: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0fd000/ End thread
/bf0fd000\ Start thread
|bf0fd000| xhci_hub_detect port #2: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0fd000/ End thread
EHCI init on dev 00:13.2 (regs=0xf014f920)
/bf0fd000\ Start thread
/bf0fb000\ Start thread
/bf0fa000\ Start thread
\bf0fe000/ End thread
/bf0fe000\ Start thread
|bf0fe000| xhci_hub_detect port #2: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0fe000/ End thread
/bf0fe000\ Start thread
|bf0fe000| xhci_hub_detect port #3: 0x000202e1, powered, pls 7, speed 0 [ - ]
|bf0fe000| xhci_hub_reset port #3: 0x000202e1, powered, pls 7, speed 0 [ - ]
OHCI init on dev 00:14.5 (regs=0xf014e000)
/bf0f9000\ Start thread
/bf0f8000\ Start thread
\bf0fb000/ End thread
/bf0fb000\ Start thread
/bf0f7000\ Start thread
|bf0f7000| xhci_hub_detect port #3: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0f7000/ End thread
/bf0f7000\ Start thread
|bf0f7000| xhci_hub_detect port #4: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0f7000/ End thread
init ps2port
/bf0f7000\ Start thread
|bf0f7000| i8042_flush
|bf0f7000| i8042_command cmd=1aa
|bf0f7000| i8042_wait_write
|bf0f7000| i8042_wait_read
|bf0f7000| i8042 param=55
|bf0f7000| i8042_command cmd=1ab
|bf0f7000| i8042_wait_write
|bf0f7000| i8042_wait_read
|bf0f7000| i8042 param=0
|bf0f7000| ps2_command aux=0 cmd=2ff
|bf0f7000| i8042 ctr old=30 new=30
|bf0f7000| i8042_command cmd=1060
|bf0f7000| i8042_wait_write
|bf0f7000| i8042_wait_write
/bf0f6000\ Start thread
\bf0f8000/ End thread
/bf0f8000\ Start thread
\bf0fb000/ End thread
/bf0fb000\ Start thread
|bf0fb000| xhci_hub_detect port #4: 0x000002a0, powered, pls 5, speed 0 [ - ]
\bf0fb000/ End thread
|bf0fe000| XHCI port #3: 0x00200a03, powered, enabled, pls 0, speed 2 [Low]
|bf0fe000| set_address 0x000ee0b0
|bf0fe000| xhci_alloc_pipe: usbdev 0xbf102170, ring 0xbf11e500, slotid 0, epid 1
init lpt
Found 0 lpt ports
init serial
Found 1 serial ports
init floppy drives
init hard drives
init ahci
AHCI controller at 11.0, iobase f014f000, irq 0
AHCI: cap 0xf3309f07, ports_impl 0x4
/bf0fb000\ Start thread
|bf0fb000| AHCI/2: probing
|bf0fb000| AHCI/2: link up
|bf0f7000| i8042_command cmd=1060
|bf0f7000| i8042_wait_write
|bf0f7000| i8042_wait_write
|bf0f7000| ps2_sendbyte aux=0 cmd=ff
|bf0f7000| i8042_kbd_write c=255
|bf0f7000| i8042_wait_write
/bf0f5000\ Start thread
\bf0f5000/ End thread
/bf0f5000\ Start thread
\bf0f6000/ End thread
/bf0f6000\ Start thread
\bf0f8000/ End thread
|bf0fa000| set_address 0xbf102280
|bf0fa000| ehci_alloc_async_pipe 0xbf102280 0
|bf100000| XHCI no devices found
|bf0fe000| xhci_cmd_enable_slot:
|bf0fe000| xhci_trb_queue: ring 0xbf11ed00 [nidx 1, len 0]
|bf0fe000| xhci_process_events: status change port #3
|bf0fe000| xhci_process_events: status change port #3
|bf0fe000| xhci_process_events: ring 0xbf11ed00 [trb 0xbf11ed00, evt
0xbf11ee00, type 33, eidx 1, cc 1]
|bf0fe000| xhci_control: enable slot: got slotid 1
|bf0fe000| xhci_control: root port 3, route 0x0
|bf0fe000| xhci_cmd_address_device: slotid 1
|bf0fe000| xhci_trb_queue: ring 0xbf11ed00 [nidx 2, len 0]
init megasas
|bf0fb000| AHCI/2: ... finished, status 0x51, ERROR 0x4
|bf0f7000| ps2 read fe
|bf0f7000| Got ps2 nak (status=51)
|bf0f7000| i8042_command cmd=1060
|bf0f7000| i8042_wait_write
|bf0f7000| i8042_wait_write
|bf0f7000| ps2 command 2ff failed (aux=0)
\bf0f7000/ End thread
/bf0f8000\ Start thread
\bf0f8000/ End thread
/bf0f8000\ Start thread
\bf0f5000/ End thread
\bf0f6000/ End thread
|bf0fa000| ehci_control 0xbf0fc850 (dir=0 cmd=8 data=0)
\bf100000/ End thread
|bf0fe000| xhci_process_events: ring 0xbf11ed00 [trb 0xbf11ed10, evt
0xbf11ee00, type 33, eidx 2, cc 1]
|bf0fb000| Searching bootorder for: /pci at i0cf8/*@11/drive at 2/disk at 0
|bf0f9000| ohci_free_pipes 0xbf0fceb0
\bf0f8000/ End thread
|bf0fe000| xhci_update_pipe: usbdev 0xbf102170, ring 0xbf11e500,
slotid 1, epid 1
|bf0fe000| config_usb: 0xbf11e620
|bf0fe000| xhci_trb_queue: ring 0xbf11e500 [nidx 1, len 8]
|bf0fe000| xhci_trb_queue: ring 0xbf11e500 [nidx 2, len 8]
|bf0fe000| xhci_trb_queue: ring 0xbf11e500 [nidx 3, len 0]
|bf0fe000| xhci_xfer_kick: ring 0xbf11e500, slotid 1, epid 1
|bf0fb000| AHCI/2: registering: "AHCI/2: Maxtor 6L250S0 ATA-7
Hard-Disk (233 GiBytes)"
|bf0fb000| Registering bootable: AHCI/2: Maxtor 6L250S0 ATA-7
Hard-Disk (233 GiBytes) (type:2 prio:103 data:f5000)
\bf0fb000/ End thread
\bf0f9000/ End thread
|bf0fd000| ehci_free_pipes 0xbf1020c0
|bf0fa000| ehci_alloc_async_pipe 0xbf102280 0
|bf0fa000| config_usb: 0xbf0fc850
|bf0fa000| ehci_control 0xbf0fc850 (dir=128 cmd=8 data=8)
|bf0fa000| device rev=0200 cls=00 sub=00 proto=00 size=40
|bf0fa000| ehci_alloc_async_pipe 0xbf102280 0
|bf0fa000| ehci_control 0xbf0fc850 (dir=128 cmd=8 data=9)
\bf0fd000/ End thread
|bf0fa000| ehci_control 0xbf0fc850 (dir=128 cmd=8 data=46)
\bf0fa000/ End thread
|bf0ff000| ehci_free_pipes 0xbf102280
\bf0ff000/ End thread
|bf0fe000| WARNING - Timeout at xhci_event_wait:404!
|bf0fe000| xhci_control: control xfer failed (cc -1)
|bf0fe000| xhci_cmd_disable_slot: slotid 1
|bf0fe000| xhci_trb_queue: ring 0xbf11ed00 [nidx 3, len 0]
|bf0fe000| xhci_process_events: ring 0xbf11ed00 [trb 0xbf11ed20, evt
0xbf11ee00, type 33, eidx 3, cc 1]
\bf0fe000/ End thread
|bf101000| XHCI no devices found
\bf101000/ End thread
All threads complete.
Scan for option roms
Attempting to init PCI bdf 00:00.0 (vd 1022:1410)
Attempting to map option rom on dev 00:00.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:01.1 (vd 1002:9902)
Attempting to map option rom on dev 00:01.1
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:10.0 (vd 1022:7812)
Attempting to map option rom on dev 00:10.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:10.1 (vd 1022:7812)
Attempting to map option rom on dev 00:10.1
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:11.0 (vd 1022:7801)
Attempting to map option rom on dev 00:11.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:12.0 (vd 1022:7807)
Attempting to map option rom on dev 00:12.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:12.2 (vd 1022:7808)
Attempting to map option rom on dev 00:12.2
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:13.0 (vd 1022:7807)
Attempting to map option rom on dev 00:13.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:13.2 (vd 1022:7808)
Attempting to map option rom on dev 00:13.2
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:14.0 (vd 1022:780b)
Attempting to map option rom on dev 00:14.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:14.2 (vd 1022:780d)
Attempting to map option rom on dev 00:14.2
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:14.3 (vd 1022:780e)
Attempting to map option rom on dev 00:14.3
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:14.4 (vd 1022:780f)
Attempting to map option rom on dev 00:14.4
Skipping non-normal pci device (type=81)
Attempting to init PCI bdf 00:14.5 (vd 1022:7809)
Attempting to map option rom on dev 00:14.5
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:14.7 (vd 1022:7806)
Attempting to map option rom on dev 00:14.7
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:15.0 (vd 1022:43a0)
Attempting to map option rom on dev 00:15.0
Skipping non-normal pci device (type=81)
Attempting to init PCI bdf 00:15.1 (vd 1022:43a1)
Attempting to map option rom on dev 00:15.1
Skipping non-normal pci device (type=81)
Attempting to init PCI bdf 00:18.0 (vd 1022:1400)
Attempting to map option rom on dev 00:18.0
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:18.1 (vd 1022:1401)
Attempting to map option rom on dev 00:18.1
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:18.2 (vd 1022:1402)
Attempting to map option rom on dev 00:18.2
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:18.3 (vd 1022:1403)
Attempting to map option rom on dev 00:18.3
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:18.4 (vd 1022:1404)
Attempting to map option rom on dev 00:18.4
Option rom sizing returned 0 0
Attempting to init PCI bdf 00:18.5 (vd 1022:1405)
Attempting to map option rom on dev 00:18.5
Option rom sizing returned 0 0
Attempting to init PCI bdf 03:00.0 (vd 10ec:8168)
Attempting to map option rom on dev 03:00.0
Option rom sizing returned 0 0

Press F12 for boot menu.

Checking for bootsplash
Searching bootorder for: HALT
Mapping hd drive 0x000f5000 to 0
drive 0x000f5000: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 s=490234752
finalize PMM
malloc finalize
Space available for UMB: d0000-ec800, f4b00-f5000
Returned 61440 bytes of ZoneHigh
e820 map has 7 items:
  0: 0000000000000000 - 000000000009fc00 = 1 RAM
  1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED
  2: 00000000000f0000 - 0000000000100000 = 2 RESERVED
  3: 0000000000100000 - 00000000bf11e000 = 1 RAM
  4: 00000000bf11e000 - 00000000e0000000 = 2 RESERVED
  5: 00000000f8000000 - 00000000fc000000 = 2 RESERVED
  6: 0000000100000000 - 000000021f000000 = 1 RAM
Jump to int19
enter handle_19:
  NULL
Booting from Hard Disk...
Booting from 0000:7c00

>
> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> ---
>  src/hw/usb-xhci.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c
> index 66ce3c4..6c24855 100644
> --- a/src/hw/usb-xhci.c
> +++ b/src/hw/usb-xhci.c
> @@ -710,6 +710,19 @@ configure_xhci(void *data)
>      writel(&xhci->ir->erstba_high, 0);
>      xhci->evts->cs = 1;
>
> +    reg = readl(&xhci->caps->hcsparams2);
> +    u32 spb = reg >> 27;
> +    if (spb) {
> +        dprintf(3, "%s: setup %d scratch pad buffers\n", __func__, spb);
> +        u64 *spba = memalign_high(64, sizeof(*spba) * spb);
> +        void *pad = memalign_high(4096, 4096 * spb);
> +        int i;
> +        for (i = 0; i < spb; i++)
> +            spba[i] = (u32)pad + (i * 4096);
> +        xhci->devs[0].ptr_low = (u32)spba;
> +        xhci->devs[0].ptr_high = 0;
> +    }
> +
>      reg = readl(&xhci->op->usbcmd);
>      reg |= XHCI_CMD_RS;
>      writel(&xhci->op->usbcmd, reg);
> --
> 1.8.3.1
>
>
> _______________________________________________
> SeaBIOS mailing list
> SeaBIOS at seabios.org
> http://www.seabios.org/mailman/listinfo/seabios



More information about the SeaBIOS mailing list