📄 test-stage1.c
字号:
/***************************************** Copyright *****************************************/#include "../config.h"#include "../uart.h"#include "../util.h"#include "../pcicommon.h"#include "../pciem86xx.h"extern struct my_pci_op g_pciem86xx_op; static struct { int idsel; unsigned int vendor_id; unsigned int device_id;} s_pci_devices[] = { { 1, 0x10ec, 0x8139 }, { 2, 0x1106, 0x3038 }, { 3, 0x1260, 0x3890 },};static int test_pci_devices(void);void test_board_stage1(loaderconfig_t *config){ uart_puts(" Camry PCI Test\n"); test_pci_devices();}int test_pci_devices(void){ int i; struct my_pci_dev dev; pci_init(&g_pciem86xx_op, 0); for (i = 0; i < sizeof s_pci_devices / sizeof s_pci_devices[0]; ++i) { uart_printf(" IDSEL %d : ", s_pci_devices[i]); if (pci_lookup_idsel(s_pci_devices[i].idsel, &dev) == NULL) uart_puts("Not Found\n"); else { uart_printf("%04x:%04x ", dev.vendor_id, dev.device_id); if (s_pci_devices[i].vendor_id == dev.vendor_id && s_pci_devices[i].device_id == dev.device_id) uart_puts("Passed\n"); else uart_puts("Failed\n"); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -