* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdint.h>
#include <string.h>
#include <uk/print.h>
#include <uk/plat/memory.h>
#include <uk/plat/common/cpu.h>
#include <uk/bus/platform.h>
+#include <uk/plat/common/bootinfo.h>
+
+#if CONFIG_LIBUKBUS_PLATFORM_FDT
#include <libfdt.h>
#include <uk/ofw/fdt.h>
-#include <uk/intctlr/gic.h>
-#include <uk/plat/common/bootinfo.h>
static void *dtb;
+static const char *pf_device_compatible_list[] = {
+ "virtio,mmio",
+ "pci-host-ecam-generic",
+ NULL
+};
+#endif /* CONFIG_LIBUKBUS_PLATFORM_FDT */
+
+static struct pf_bus_handler pfh;
+
struct pf_bus_handler {
struct uk_bus b;
struct uk_alloc *a;
int drv_list_initialized;
struct pf_device_list dev_list; /**< List of platform devices */
};
-static struct pf_bus_handler pfh;
-
-static const char *pf_device_compatible_list[] = {
- "virtio,mmio",
- "pci-host-ecam-generic",
- NULL
-};
static inline int pf_device_id_match(const struct pf_device_id *id0,
const struct pf_device_id *id1)
return 0;
}
-static int pf_probe(void)
+#if CONFIG_LIBUKBUS_PLATFORM_FDT
+static int pf_probe_fdt(void)
{
struct pf_driver *drv;
int idx = 0;
return ret;
}
+#endif /* CONFIG_LIBUKBUS_PLATFORM_FDT */
+static int pf_probe(void)
+{
+ int rc = -ENODEV;
+
+#if CONFIG_LIBUKBUS_PLATFORM_FDT
+ rc = pf_probe_fdt();
+#endif /* CONFIG_LIBUKBUS_PLATFORM_FDT */
+
+ return rc;
+}
static int pf_init(struct uk_alloc *a)
{
UK_TAILQ_INSERT_TAIL(&pfh.drv_list, drv, next);
}
-
/* Register this bus driver to libukbus:
*/
static struct pf_bus_handler pfh = {
.b.init = pf_init,
.b.probe = pf_probe
};
+
UK_BUS_REGISTER_PRIORITY(&pfh.b, 1);