![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <stdint.h>
#include <console/console.h>
#include <console/usb.h>
#include <arch/io.h>
#include <device/mmio.h>
#include <arch/symbols.h>
#include <string.h>
#include <cbmem.h>
#include "ehci_debug.h"
#include "usb_ch9.h"
#include "ehci.h"
Go to the source code of this file.
Data Structures | |
struct | ehci_debug_info |
Macros | |
#define | dprintk(LEVEL, args...) do {} while (0) |
#define | DBGP_LEN_UPDATE(x, len) (((x) & ~0x0f) | ((len) & 0x0f)) |
#define | DBGP_CLAIM (DBGP_OWNER | DBGP_ENABLED | DBGP_INUSE) |
#define | HUB_ROOT_RESET_TIME 50 /* times are in msec */ |
#define | HUB_SHORT_RESET_TIME 10 |
#define | HUB_LONG_RESET_TIME 200 |
#define | HUB_RESET_TIMEOUT 500 |
#define | DBGP_MICROFRAME_TIMEOUT_LOOPS 1000 |
#define | DBGP_MICROFRAME_RETRIES 10 |
#define | DBGP_MAX_PACKET 8 |
Variables | |
struct ehci_debug_info | __packed |
static struct ehci_debug_info | glob_dbg_info |
static struct ehci_debug_info * | glob_dbg_info_p |
#define DBGP_CLAIM (DBGP_OWNER | DBGP_ENABLED | DBGP_INUSE) |
Definition at line 36 of file ehci_debug.c.
Definition at line 34 of file ehci_debug.c.
#define DBGP_MAX_PACKET 8 |
Definition at line 45 of file ehci_debug.c.
#define DBGP_MICROFRAME_RETRIES 10 |
Definition at line 44 of file ehci_debug.c.
#define DBGP_MICROFRAME_TIMEOUT_LOOPS 1000 |
Definition at line 43 of file ehci_debug.c.
#define dprintk | ( | LEVEL, | |
args... | |||
) | do {} while (0) |
Definition at line 31 of file ehci_debug.c.
#define HUB_LONG_RESET_TIME 200 |
Definition at line 40 of file ehci_debug.c.
#define HUB_RESET_TIMEOUT 500 |
Definition at line 41 of file ehci_debug.c.
#define HUB_ROOT_RESET_TIME 50 /* times are in msec */ |
Definition at line 38 of file ehci_debug.c.
#define HUB_SHORT_RESET_TIME 10 |
Definition at line 39 of file ehci_debug.c.
Definition at line 94 of file ehci_debug.c.
Referenced by dbgp_wait_until_done().
|
static |
Definition at line 257 of file ehci_debug.c.
References addr, ehci_dbg_port::address, ehci_dbg_port::control, DBGP_EPADDR, dbgp_get_data(), DBGP_LEN_UPDATE, DBGP_MAX_PACKET, DBGP_OUT, DBGP_PID_SET, dbgp_wait_until_done(), ehci_dbg_port::pids, read32(), USB_PID_IN, and write32().
Referenced by dbgp_bulk_read_x(), and dbgp_control_msg().
Definition at line 285 of file ehci_debug.c.
References dbgp_bulk_read(), dbgp_ehci_info(), and ehci_debug_info::ehci_debug.
Referenced by usbdebug_rx_byte().
|
static |
Definition at line 224 of file ehci_debug.c.
References addr, DBGP_EPADDR, DBGP_LEN_UPDATE, DBGP_MAX_PACKET, DBGP_OUT, DBGP_PID_SET, dbgp_set_data(), dbgp_wait_until_done(), ehci_debug_info::ehci_debug, read32(), USB_PID_OUT, and write32().
Referenced by dbgp_bulk_write_x(), and dbgp_control_msg().
int dbgp_bulk_write_x | ( | struct dbgp_pipe * | pipe, |
const char * | bytes, | ||
int | size | ||
) |
Definition at line 249 of file ehci_debug.c.
References dbgp_bulk_write(), dbgp_ehci_info(), and ehci_debug_info::ehci_debug.
Referenced by probe_for_debug_descriptor(), probe_for_ftdi(), usbdebug_tx_byte(), and usbdebug_tx_flush().
Definition at line 724 of file ehci_debug.c.
References DBGP_CONSOLE_EPIN, dbgp_ehci_info(), and ehci_debug_info::ep_pipe.
Referenced by usb_can_rx_byte(), and usb_rx_byte().
Definition at line 719 of file ehci_debug.c.
References DBGP_CONSOLE_EPOUT, dbgp_ehci_info(), and ehci_debug_info::ep_pipe.
Referenced by usb_tx_byte(), and usb_tx_flush().
int dbgp_control_msg | ( | struct ehci_dbg_port * | ehci_debug, |
unsigned int | devnum, | ||
int | requesttype, | ||
int | request, | ||
int | value, | ||
int | index, | ||
void * | data, | ||
int | size | ||
) |
Definition at line 303 of file ehci_debug.c.
References addr, ehci_dbg_port::address, usb_ctrlrequest::bRequest, usb_ctrlrequest::bRequestType, ehci_dbg_port::control, dbgp_bulk_read(), dbgp_bulk_write(), dbgp_ehci_info(), DBGP_EPADDR, DBGP_LEN_UPDATE, DBGP_MAX_PACKET, DBGP_OUT, DBGP_PID_SET, dbgp_set_data(), DBGP_SETUP_EP0, dbgp_wait_until_done(), info, ehci_dbg_port::pids, read32(), USB_DIR_IN, USB_PID_DATA0, USB_PID_DATA1, USB_PID_IN, USB_PID_OUT, USB_PID_SETUP, value, usb_ctrlrequest::wIndex, usb_ctrlrequest::wLength, write32(), and usb_ctrlrequest::wValue.
Referenced by dbgp_hub_enable(), probe_for_debug_descriptor(), and probe_for_ftdi().
|
inlinestatic |
Definition at line 53 of file ehci_debug.c.
References _car_ehci_dbg_info, _car_ehci_dbg_info_size, die(), ENV_BOOTBLOCK, ENV_ROMSTAGE, ENV_SEPARATE_VERSTAGE, glob_dbg_info, glob_dbg_info_p, info, and NULL.
Referenced by dbgp_bulk_read_x(), dbgp_bulk_write_x(), dbgp_console_input(), dbgp_console_output(), dbgp_control_msg(), dbgp_enabled(), dbgp_not_present(), dbgp_put(), dbgp_try_get(), migrate_ehci_debug(), and usbdebug_hw_init().
|
static |
Definition at line 603 of file ehci_debug.c.
References dbgp_ehci_info(), DBGP_EP_ENABLED, DBGP_SETUP_EP0, ehci_debug_info::ep_pipe, and dbgp_pipe::status.
Referenced by dbgp_print_data(), and usbdebug_hw_init().
int dbgp_ep_is_active | ( | struct dbgp_pipe * | pipe | ) |
Definition at line 714 of file ehci_debug.c.
References DBGP_EP_ENABLED, DBGP_EP_STATMASK, and DBGP_EP_VALID.
Referenced by dbgp_try_get(), and usb_can_rx_byte().
|
static |
Definition at line 186 of file ehci_debug.c.
References buf, ehci_debug_info::ehci_debug, and read32().
Referenced by dbgp_bulk_read().
void dbgp_mdelay | ( | int | ms | ) |
Definition at line 293 of file ehci_debug.c.
References inb().
Referenced by dbgp_hub_enable(), ehci_reset_port(), ehci_wait_for_port(), and usbdebug_init_().
|
static |
Definition at line 609 of file ehci_debug.c.
References dbgp_ehci_info(), DBGP_EP_NOT_PRESENT, DBGP_SETUP_EP0, ehci_debug_info::ep_pipe, and dbgp_pipe::status.
Referenced by usbdebug_hw_init().
|
static |
Definition at line 200 of file ehci_debug.c.
References BIOS_SPEW, CONFIG, dbgp_enabled(), DBGP_LEN, dprintk, ehci_debug_info::ehci_debug, and read32().
Referenced by dbgp_wait_until_done().
Definition at line 625 of file ehci_debug.c.
References dbgp_ehci_info(), DBGP_EP_BUSY, DBGP_SETUP_EP0, ehci_debug_info::ep_pipe, and dbgp_pipe::status.
Referenced by usbdebug_rx_byte(), usbdebug_tx_byte(), and usbdebug_tx_flush().
|
static |
Definition at line 171 of file ehci_debug.c.
References buf, ehci_debug_info::ehci_debug, and write32().
Referenced by dbgp_bulk_write(), and dbgp_control_msg().
int dbgp_try_get | ( | struct dbgp_pipe * | pipe | ) |
Definition at line 615 of file ehci_debug.c.
References dbgp_ehci_info(), DBGP_EP_BUSY, dbgp_ep_is_active(), DBGP_SETUP_EP0, ehci_debug_info::ep_pipe, and dbgp_pipe::status.
Referenced by usbdebug_rx_byte(), usbdebug_tx_byte(), and usbdebug_tx_flush().
|
static |
Definition at line 70 of file ehci_debug.c.
References BIOS_ERR, DBGP_DONE, DBGP_ERR_SIGNAL, DBGP_ERRCODE, DBGP_ERROR, DBGP_LEN, DBGP_MICROFRAME_TIMEOUT_LOOPS, dprintk, ehci_debug_info::ehci_debug, read32(), and write32().
Referenced by dbgp_wait_until_done().
|
static |
Definition at line 99 of file ehci_debug.c.
References BIOS_SPEW, dbgp_breath(), DBGP_ERR_BAD, DBGP_ERR_SIGNAL, DBGP_GO, DBGP_MICROFRAME_RETRIES, DBGP_PID_GET, dbgp_print_data(), dbgp_wait_until_complete(), dprintk, ehci_debug_info::ehci_debug, read32(), USB_PID_ACK, USB_PID_DATA_TOGGLE, USB_PID_NAK, USB_PID_NYET, USB_PID_STALL, and write32().
Referenced by dbgp_bulk_read(), dbgp_bulk_write(), and dbgp_control_msg().
|
static |
Definition at line 369 of file ehci_debug.c.
References dbgp_mdelay(), HUB_ROOT_RESET_TIME, PORT_CONNECT, PORT_CSC, PORT_PE, PORT_RESET, PORT_RWC_BITS, ehci_regs::port_status, read32(), and write32().
Referenced by ehci_wait_for_port().
|
static |
Definition at line 407 of file ehci_debug.c.
References dbgp_mdelay(), ehci_reset_port(), read32(), ehci_regs::status, and STS_PCD.
Referenced by usbdebug_init_().
|
static |
Definition at line 679 of file ehci_debug.c.
References BIOS_DEBUG, cbmem_add(), cbmem_find(), CBMEM_ID_EHCI_DEBUG, CONFIG, dbgp_ehci_info(), ENV_ROMSTAGE, ENV_STRING, glob_dbg_info_p, memcpy(), NULL, printk, and usbdebug_hw_init().
POSTCAR_CBMEM_INIT_HOOK | ( | migrate_ehci_debug | ) |
RAMSTAGE_CBMEM_INIT_HOOK | ( | migrate_ehci_debug | ) |
ROMSTAGE_CBMEM_INIT_HOOK | ( | migrate_ehci_debug | ) |
int usbdebug_hw_init | ( | bool | force | ) |
Definition at line 658 of file ehci_debug.c.
References dbgp_ehci_info(), dbgp_enabled(), dbgp_not_present(), ehci_debug_info::ehci_base, ehci_debug_hw_enable(), ENV_POSTCAR, and usbdebug_init_().
Referenced by migrate_ehci_debug(), sdram_initialize(), and usbdebug_init().
Definition at line 729 of file ehci_debug.c.
References CONFIG, ENV_BOOTBLOCK, ENV_RAMSTAGE, ENV_ROMSTAGE, and usbdebug_hw_init().
|
static |
Definition at line 424 of file ehci_debug.c.
References BIOS_INFO, CMD_ASE, CMD_IAAD, CMD_LRESET, CMD_PSE, CMD_RESET, CMD_RUN, ehci_regs::command, ehci_regs::configured_flag, ehci_dbg_port::control, DBGP_CLAIM, DBGP_ENABLED, DBGP_EP_NOT_PRESENT, DBGP_INUSE, dbgp_mdelay(), DBGP_OUT, DBGP_OWNER, dbgp_probe_gadget(), dprintk, ehci_debug_select_port(), ehci_wait_for_port(), FLAG_CF, ehci_caps::hc_capbase, HC_LENGTH, HCS_DEBUG_PORT, HCS_N_PORTS, ehci_caps::hcs_params, info, memset(), offset, ehci_regs::port_status, read32(), ehci_regs::status, STS_HALT, and write32().
Referenced by usbdebug_hw_init().
struct ehci_debug_info __packed |
|
static |
Definition at line 48 of file ehci_debug.c.
Referenced by dbgp_ehci_info().
|
static |
Definition at line 51 of file ehci_debug.c.
Referenced by dbgp_ehci_info(), and migrate_ehci_debug().