aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/conf/files.powerpc4
-rw-r--r--sys/powerpc/powernv/opal_i2c.c6
-rw-r--r--sys/powerpc/powernv/opal_i2cm.c12
-rw-r--r--sys/powerpc/powernv/powernv_centaur.c13
-rw-r--r--sys/powerpc/powernv/powernv_xscom.c12
5 files changed, 44 insertions, 3 deletions
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 3b2e1589c4ed..81c5d93a4389 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -186,8 +186,8 @@ powerpc/powermac/vcoregpio.c optional powermac
powerpc/powernv/opal.c optional powernv
powerpc/powernv/opal_console.c optional powernv
powerpc/powernv/opal_dev.c optional powernv
-powerpc/powernv/opal_i2c.c optional iicbus fdt powernv
-powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv
+powerpc/powernv/opal_i2c.c optional iicbus powernv
+powerpc/powernv/opal_i2cm.c optional iicbus powernv
powerpc/powernv/opal_pci.c optional powernv pci
powerpc/powernv/opalcall.S optional powernv
powerpc/powernv/platform_powernv.c optional powernv
diff --git a/sys/powerpc/powernv/opal_i2c.c b/sys/powerpc/powernv/opal_i2c.c
index a5d51d451c9c..e50c0dca921b 100644
--- a/sys/powerpc/powernv/opal_i2c.c
+++ b/sys/powerpc/powernv/opal_i2c.c
@@ -120,7 +120,9 @@ static int
opal_i2c_probe(device_t dev)
{
+#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c")))
+#endif
return (ENXIO);
device_set_desc(dev, "opal-i2c");
@@ -131,6 +133,7 @@ opal_i2c_probe(device_t dev)
static int
opal_i2c_attach(device_t dev)
{
+#ifdef FDT
struct opal_i2c_softc *sc;
int len;
@@ -150,6 +153,9 @@ opal_i2c_attach(device_t dev)
I2C_LOCK_INIT(sc);
return (bus_generic_attach(dev));
+#else
+ return (ENXIO);
+#endif
}
static int
diff --git a/sys/powerpc/powernv/opal_i2cm.c b/sys/powerpc/powernv/opal_i2cm.c
index 57d9e7ebbff0..55b0f8d1c766 100644
--- a/sys/powerpc/powernv/opal_i2cm.c
+++ b/sys/powerpc/powernv/opal_i2cm.c
@@ -57,14 +57,17 @@ struct opal_i2cm_softc
static int opal_i2cm_attach(device_t);
static int opal_i2cm_probe(device_t);
+#ifdef FDT
static const struct ofw_bus_devinfo *
opal_i2cm_get_devinfo(device_t, device_t);
+#endif
static device_method_t opal_i2cm_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, opal_i2cm_probe),
DEVMETHOD(device_attach, opal_i2cm_attach),
+#ifdef FDT
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, opal_i2cm_get_devinfo),
DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat),
@@ -72,6 +75,7 @@ static device_method_t opal_i2cm_methods[] = {
DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
+#endif
DEVMETHOD_END
};
@@ -82,8 +86,10 @@ static int
opal_i2cm_probe(device_t dev)
{
+#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") ||
ofw_bus_is_compatible(dev, "ibm,power8-i2cm")))
+#endif
return (ENXIO);
device_set_desc(dev, "centaur-i2cm");
@@ -93,6 +99,7 @@ opal_i2cm_probe(device_t dev)
static int
opal_i2cm_attach(device_t dev)
{
+#ifdef FDT
phandle_t child;
device_t cdev;
struct ofw_bus_devinfo *dinfo;
@@ -116,13 +123,18 @@ opal_i2cm_attach(device_t dev)
}
return (bus_generic_attach(dev));
+#else
+ return (ENXIO);
+#endif
}
+#ifdef FDT
static const struct ofw_bus_devinfo *
opal_i2cm_get_devinfo(device_t dev, device_t child)
{
return (device_get_ivars(child));
}
+#endif
DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods,
sizeof(struct opal_i2cm_softc));
diff --git a/sys/powerpc/powernv/powernv_centaur.c b/sys/powerpc/powernv/powernv_centaur.c
index 9053c491ff44..c43646b39a16 100644
--- a/sys/powerpc/powernv/powernv_centaur.c
+++ b/sys/powerpc/powernv/powernv_centaur.c
@@ -57,14 +57,17 @@ struct powernv_centaur_softc
static int powernv_centaur_attach(device_t);
static int powernv_centaur_probe(device_t);
+#ifdef FDT
static const struct ofw_bus_devinfo *
powernv_centaur_get_devinfo(device_t, device_t);
+#endif
static device_method_t powernv_centaur_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, powernv_centaur_probe),
DEVMETHOD(device_attach, powernv_centaur_attach),
+#ifdef FDT
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, powernv_centaur_get_devinfo),
DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat),
@@ -72,7 +75,7 @@ static device_method_t powernv_centaur_methods[] = {
DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
-
+#endif
DEVMETHOD_END
};
@@ -82,7 +85,9 @@ static int
powernv_centaur_probe(device_t dev)
{
+#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,centaur")))
+#endif
return (ENXIO);
device_set_desc(dev, "centaur");
@@ -92,6 +97,7 @@ powernv_centaur_probe(device_t dev)
static int
powernv_centaur_attach(device_t dev)
{
+#ifdef FDT
phandle_t child;
device_t cdev;
struct ofw_bus_devinfo *dinfo;
@@ -115,13 +121,18 @@ powernv_centaur_attach(device_t dev)
}
return (bus_generic_attach(dev));
+#else
+ return (ENXIO);
+#endif
}
+#ifdef FDT
static const struct ofw_bus_devinfo *
powernv_centaur_get_devinfo(device_t dev, device_t child)
{
return (device_get_ivars(child));
}
+#endif
DEFINE_CLASS_0(powernv_centaur, powernv_centaur_driver, powernv_centaur_methods,
sizeof(struct powernv_centaur_softc));
diff --git a/sys/powerpc/powernv/powernv_xscom.c b/sys/powerpc/powernv/powernv_xscom.c
index 669599e3a547..7a40429cc81d 100644
--- a/sys/powerpc/powernv/powernv_xscom.c
+++ b/sys/powerpc/powernv/powernv_xscom.c
@@ -57,14 +57,17 @@ struct powernv_xscom_softc
static int powernv_xscom_attach(device_t);
static int powernv_xscom_probe(device_t);
+#ifdef FDT
static const struct ofw_bus_devinfo *
powernv_xscom_get_devinfo(device_t, device_t);
+#endif
static device_method_t powernv_xscom_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, powernv_xscom_probe),
DEVMETHOD(device_attach, powernv_xscom_attach),
+#ifdef FDT
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo, powernv_xscom_get_devinfo),
DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat),
@@ -72,6 +75,7 @@ static device_method_t powernv_xscom_methods[] = {
DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
+#endif
DEVMETHOD_END
};
@@ -82,7 +86,9 @@ static int
powernv_xscom_probe(device_t dev)
{
+#ifdef FDT
if (!(ofw_bus_is_compatible(dev, "ibm,xscom")))
+#endif
return (ENXIO);
device_set_desc(dev, "xscom");
@@ -92,6 +98,7 @@ powernv_xscom_probe(device_t dev)
static int
powernv_xscom_attach(device_t dev)
{
+#ifdef FDT
phandle_t child;
device_t cdev;
struct ofw_bus_devinfo *dinfo;
@@ -115,13 +122,18 @@ powernv_xscom_attach(device_t dev)
}
return (bus_generic_attach(dev));
+#else
+ return (ENXIO);
+#endif
}
+#ifdef FDT
static const struct ofw_bus_devinfo *
powernv_xscom_get_devinfo(device_t dev, device_t child)
{
return (device_get_ivars(child));
}
+#endif
DEFINE_CLASS_0(powernv_xscom, powernv_xscom_driver, powernv_xscom_methods,
sizeof(struct powernv_xscom_softc));