Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/controller/pci_n1sdp.c
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | n1sdp_init(struct generic_pcie_n1sdp_softc *sc) | ||||
| int error, i; | int error, i; | ||||
| paddr = AP_NS_SHARED_MEM_BASE + sc->acpi.segment * BDF_TABLE_SIZE; | paddr = AP_NS_SHARED_MEM_BASE + sc->acpi.segment * BDF_TABLE_SIZE; | ||||
| vaddr = kva_alloc((vm_size_t)BDF_TABLE_SIZE); | vaddr = kva_alloc((vm_size_t)BDF_TABLE_SIZE); | ||||
| if (vaddr == 0) { | if (vaddr == 0) { | ||||
| printf("%s: Can't allocate KVA memory.", __func__); | printf("%s: Can't allocate KVA memory.", __func__); | ||||
| return (ENXIO); | return (ENXIO); | ||||
| } | } | ||||
| pmap_kenter(vaddr, (vm_size_t)BDF_TABLE_SIZE, paddr, | pmap_kenter_arm64(vaddr, (vm_size_t)BDF_TABLE_SIZE, paddr, | ||||
| VM_MEMATTR_UNCACHEABLE); | VM_MEMATTR_UNCACHEABLE); | ||||
| shared_data = (struct pcie_discovery_data *)vaddr; | shared_data = (struct pcie_discovery_data *)vaddr; | ||||
| bdfs_size = sizeof(struct pcie_discovery_data) + | bdfs_size = sizeof(struct pcie_discovery_data) + | ||||
| sizeof(uint32_t) * shared_data->nr_bdfs; | sizeof(uint32_t) * shared_data->nr_bdfs; | ||||
| sc->n1_discovery_data = malloc(bdfs_size, M_DEVBUF, M_WAITOK | M_ZERO); | sc->n1_discovery_data = malloc(bdfs_size, M_DEVBUF, M_WAITOK | M_ZERO); | ||||
| memcpy(sc->n1_discovery_data, shared_data, bdfs_size); | memcpy(sc->n1_discovery_data, shared_data, bdfs_size); | ||||
| ▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines | |||||