Define macros making it easier to define bus-specific pnpinfo for FDT systems.

Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
macro makes it easier to define new FDT-based pnpinfo for busses other than
simplebus.

Differential Revision:	https://reviews.freebsd.org/D20382
This commit is contained in:
Ian Lepore 2019-05-23 15:47:30 +00:00
parent 537aac3c09
commit b609a55345
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348169
2 changed files with 11 additions and 3 deletions

View File

@ -72,6 +72,12 @@ IICBUS_ACCESSOR(nostop, NOSTOP, bool)
#define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock)
#define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED)
#ifdef FDT
#define IICBUS_FDT_PNPINFO(t) FDTCOMPAT_PNP_INFO(t, iicbus)
#else
#define IICBUS_FDT_PNPINFO(t)
#endif
int iicbus_generic_intr(device_t dev, int event, char *buf);
void iicbus_init_frequency(device_t dev, u_int bus_freq);

View File

@ -65,9 +65,11 @@ struct intr_map_data_fdt {
};
#endif
#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;"
#define SIMPLEBUS_PNP_INFO(t) \
MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0]));
#define FDTCOMPAT_PNP_DESCR "Z:compat;P:#;"
#define FDTCOMPAT_PNP_INFO(t, busname) \
MODULE_PNP_INFO(FDTCOMPAT_PNP_DESCR, busname, t, t, sizeof(t) / sizeof(t[0]));
#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus)
/* Generic implementation of ofw_bus_if.m methods and helper routines */
int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t);