Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137702676
D7331.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7331.diff
View Options
Index: sys/arm/mv/mv_pci.c
===================================================================
--- sys/arm/mv/mv_pci.c
+++ sys/arm/mv/mv_pci.c
@@ -420,21 +420,29 @@
{
struct mv_pcib_softc *sc;
phandle_t node, parnode;
- uint32_t val, unit, reg0;
- int err, bus, devfn;
+ uint32_t val, reg0;
+ int err, bus, devfn, port_id;
sc = device_get_softc(self);
sc->sc_dev = self;
- unit = fdt_get_unit(self);
-
node = ofw_bus_get_node(self);
parnode = OF_parent(node);
+
+ if (OF_getencprop(node, "port-id", &(port_id),
+ sizeof(port_id)) <= 0) {
+ /* If port-id does not exist in FDT set value to 0 */
+ if (!OF_hasprop(node, "port-id"))
+ port_id = 0;
+ else
+ return(ENXIO);
+ }
+
if (fdt_is_compatible(node, "mrvl,pcie")) {
sc->sc_type = MV_TYPE_PCIE;
- sc->sc_win_target = MV_WIN_PCIE_TARGET(unit);
- sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(unit);
- sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(unit);
+ sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id);
+ sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id);
+ sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id);
} else if (fdt_is_compatible(node, "mrvl,pci")) {
sc->sc_type = MV_TYPE_PCI;
sc->sc_win_target = MV_WIN_PCI_TARGET;
@@ -477,7 +485,7 @@
/*
* Enable PCIE device.
*/
- mv_pcib_enable(sc, unit);
+ mv_pcib_enable(sc, port_id);
/*
* Memory management.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 26, 12:24 AM (4 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26193554
Default Alt Text
D7331.diff (1 KB)
Attached To
Mode
D7331: Add PCIe port ID verification in Marvell PCIe
Attached
Detach File
Event Timeline
Log In to Comment