Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ntb/ntb_hw/ntb_hw_plx.c
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | if (sc->conf_res == NULL) { | ||||
device_printf(dev, "Can't allocate configuration BAR.\n"); | device_printf(dev, "Can't allocate configuration BAR.\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
/* | /* | ||||
* The device occupies whole bus. In translated TLP slot field | * The device occupies whole bus. In translated TLP slot field | ||||
* keeps LUT index (original bus/slot), function is passed through. | * keeps LUT index (original bus/slot), function is passed through. | ||||
*/ | */ | ||||
bus_dma_dmar_set_buswide(dev); | bus_dma_iommu_set_buswide(dev); | ||||
/* Identify chip port we are connected to. */ | /* Identify chip port we are connected to. */ | ||||
val = bus_read_4(sc->conf_res, 0x360); | val = bus_read_4(sc->conf_res, 0x360); | ||||
sc->port = (val >> ((sc->ntx == 0) ? 8 : 16)) & 0x1f; | sc->port = (val >> ((sc->ntx == 0) ? 8 : 16)) & 0x1f; | ||||
/* Detect A-LUT enable and size. */ | /* Detect A-LUT enable and size. */ | ||||
val >>= 30; | val >>= 30; | ||||
sc->alut = (val == 0x3) ? 1 : ((val & (1 << sc->ntx)) ? 2 : 0); | sc->alut = (val == 0x3) ? 1 : ((val & (1 << sc->ntx)) ? 2 : 0); | ||||
▲ Show 20 Lines • Show All 739 Lines • Show Last 20 Lines |