Changeset 230385c in mainline
- Timestamp:
- 2012-01-24T02:41:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 690d2e7
- Parents:
- 948911d
- Location:
- uspace/drv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
r948911d r230385c 650 650 got_res = true; 651 651 652 653 assert(hw_resources.count > 1); 654 assert(hw_resources.resources[0].type == IO_RANGE); 655 assert(hw_resources.resources[0].res.io_range.size >= 4); 656 657 assert(hw_resources.resources[1].type == IO_RANGE); 658 assert(hw_resources.resources[1].res.io_range.size >= 4); 659 652 660 ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".", 653 661 hw_resources.resources[0].res.io_range.address); 654 655 assert(hw_resources.count > 0); 656 assert(hw_resources.resources[0].type == IO_RANGE); 657 assert(hw_resources.resources[0].res.io_range.size == 8); 662 ddf_msg(LVL_DEBUG, "data_addr = %" PRIx64 ".", 663 hw_resources.resources[1].res.io_range.address); 658 664 659 665 bus->conf_io_addr = 660 666 (uint32_t) hw_resources.resources[0].res.io_range.address; 661 662 if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8, 667 bus->conf_io_data = 668 (uint32_t) hw_resources.resources[1].res.io_range.address; 669 670 if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 4, 663 671 &bus->conf_addr_port)) { 664 672 ddf_msg(LVL_ERROR, "Failed to enable configuration ports."); … … 666 674 goto fail; 667 675 } 668 bus->conf_data_port = (char *) bus->conf_addr_port + 4; 676 if (pio_enable((void *)(uintptr_t)bus->conf_io_data, 4, 677 &bus->conf_data_port)) { 678 ddf_msg(LVL_ERROR, "Failed to enable configuration ports."); 679 rc = EADDRNOTAVAIL; 680 goto fail; 681 } 669 682 670 683 /* Make the bus device more visible. It has no use yet. */ -
uspace/drv/bus/pci/pciintel/pci.h
r948911d r230385c 46 46 ddf_dev_t *dnode; 47 47 uint32_t conf_io_addr; 48 uint32_t conf_io_data; 48 49 void *conf_data_port; 49 50 void *conf_addr_port; -
uspace/drv/infrastructure/rootpc/rootpc.c
r948911d r230385c 77 77 }; 78 78 79 static hw_resource_t pci_conf_regs = { 80 .type = IO_RANGE, 81 .res.io_range = { 82 .address = 0xCF8, 83 .size = 8, 84 .endianness = LITTLE_ENDIAN 79 static hw_resource_t pci_conf_regs[] = { 80 { 81 .type = IO_RANGE, 82 .res.io_range = { 83 .address = 0xCF8, 84 .size = 4, 85 .endianness = LITTLE_ENDIAN 86 } 87 }, 88 { 89 .type = IO_RANGE, 90 .res.io_range = { 91 .address = 0xCFC, 92 .size = 4, 93 .endianness = LITTLE_ENDIAN 94 } 85 95 } 86 96 }; … … 88 98 static rootpc_fun_t pci_data = { 89 99 .hw_resources = { 90 1,91 &pci_conf_regs100 sizeof(pci_conf_regs)/sizeof(pci_conf_regs[0]), 101 pci_conf_regs 92 102 } 93 103 };
Note:
See TracChangeset
for help on using the changeset viewer.