Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2019 16:16:55 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349314 - in stable/12/sys/dev: flash iicbus iicbus/twsi ofw spibus
Message-ID:  <201906231616.x5NGGtMU066157@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Jun 23 16:16:55 2019
New Revision: 349314
URL: https://svnweb.freebsd.org/changeset/base/349314

Log:
  MFC r348169-r348170, r348172-r348173, r348183-r348184
  
  r348169:
  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
  
  r348170:
  Add pnpinfo for icee(4) on fdt systems.
  
  r348172:
  Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
  Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
  other kinds of pnpinfo for other (non-fdt) bus attachments.
  
  r348173:
  Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
  existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.
  
  r348183:
  Add pnpinfo.
  
  r348184:
  Add pnpinfo to all i2c drivers that have FDT compat data.

Modified:
  stable/12/sys/dev/flash/at45d.c
  stable/12/sys/dev/flash/mx25l.c
  stable/12/sys/dev/iicbus/ds1307.c
  stable/12/sys/dev/iicbus/ds13rtc.c
  stable/12/sys/dev/iicbus/icee.c
  stable/12/sys/dev/iicbus/iicbus.h
  stable/12/sys/dev/iicbus/isl12xx.c
  stable/12/sys/dev/iicbus/nxprtc.c
  stable/12/sys/dev/iicbus/rtc8583.c
  stable/12/sys/dev/iicbus/sy8106a.c
  stable/12/sys/dev/iicbus/syr827.c
  stable/12/sys/dev/iicbus/twsi/a10_twsi.c
  stable/12/sys/dev/iicbus/twsi/mv_twsi.c
  stable/12/sys/dev/ofw/ofw_bus_subr.h
  stable/12/sys/dev/spibus/spi.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/flash/at45d.c
==============================================================================
--- stable/12/sys/dev/flash/at45d.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/flash/at45d.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -606,6 +606,6 @@ DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devcl
 MODULE_DEPEND(at45d, spibus, 1, 1, 1);
 #ifdef FDT
 MODULE_DEPEND(at45d, fdt_slicer, 1, 1, 1);
-SPIBUS_PNP_INFO(compat_data);
+SPIBUS_FDT_PNP_INFO(compat_data);
 #endif
 

Modified: stable/12/sys/dev/flash/mx25l.c
==============================================================================
--- stable/12/sys/dev/flash/mx25l.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/flash/mx25l.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -686,5 +686,5 @@ DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devcl
 MODULE_DEPEND(mx25l, spibus, 1, 1, 1);
 #ifdef	FDT
 MODULE_DEPEND(mx25l, fdt_slicer, 1, 1, 1);
-SPIBUS_PNP_INFO(compat_data);
+SPIBUS_FDT_PNP_INFO(compat_data);
 #endif

Modified: stable/12/sys/dev/iicbus/ds1307.c
==============================================================================
--- stable/12/sys/dev/iicbus/ds1307.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/ds1307.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -435,3 +435,4 @@ static devclass_t ds1307_devclass;
 DRIVER_MODULE(ds1307, iicbus, ds1307_driver, ds1307_devclass, NULL, NULL);
 MODULE_VERSION(ds1307, 1);
 MODULE_DEPEND(ds1307, iicbus, 1, 1, 1);
+IICBUS_FDT_PNP_INFO(ds1307_compat_data);

Modified: stable/12/sys/dev/iicbus/ds13rtc.c
==============================================================================
--- stable/12/sys/dev/iicbus/ds13rtc.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/ds13rtc.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -617,3 +617,4 @@ static devclass_t ds13rtc_devclass;
 DRIVER_MODULE(ds13rtc, iicbus, ds13rtc_driver, ds13rtc_devclass, NULL, NULL);
 MODULE_VERSION(ds13rtc, 1);
 MODULE_DEPEND(ds13rtc, iicbus, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/icee.c
==============================================================================
--- stable/12/sys/dev/iicbus/icee.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/icee.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -392,3 +392,4 @@ static devclass_t icee_devclass;
 DRIVER_MODULE(icee, iicbus, icee_driver, icee_devclass, 0, 0);
 MODULE_VERSION(icee, 1);
 MODULE_DEPEND(icee, iicbus, 1, 1, 1);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/iicbus.h
==============================================================================
--- stable/12/sys/dev/iicbus/iicbus.h	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/iicbus.h	Sun Jun 23 16:16:55 2019	(r349314)
@@ -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_PNP_INFO(t)	FDTCOMPAT_PNP_INFO(t, iicbus)
+#else
+#define	IICBUS_FDT_PNP_INFO(t)
+#endif
+
 int  iicbus_generic_intr(device_t dev, int event, char *buf);
 void iicbus_init_frequency(device_t dev, u_int bus_freq);
 

Modified: stable/12/sys/dev/iicbus/isl12xx.c
==============================================================================
--- stable/12/sys/dev/iicbus/isl12xx.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/isl12xx.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -356,3 +356,4 @@ static devclass_t isl12xx_devclass;
 DRIVER_MODULE(isl12xx, iicbus, isl12xx_driver, isl12xx_devclass, NULL, NULL);
 MODULE_VERSION(isl12xx, 1);
 MODULE_DEPEND(isl12xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/nxprtc.c
==============================================================================
--- stable/12/sys/dev/iicbus/nxprtc.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/nxprtc.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -826,3 +826,4 @@ static devclass_t nxprtc_devclass;
 DRIVER_MODULE(nxprtc, iicbus, nxprtc_driver, nxprtc_devclass, NULL, NULL);
 MODULE_VERSION(nxprtc, 1);
 MODULE_DEPEND(nxprtc, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/rtc8583.c
==============================================================================
--- stable/12/sys/dev/iicbus/rtc8583.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/rtc8583.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -300,3 +300,4 @@ static devclass_t rtc8583_devclass;
 DRIVER_MODULE(rtc8583, iicbus, rtc8583_driver, rtc8583_devclass, NULL, NULL);
 MODULE_VERSION(rtc8583, 1);
 MODULE_DEPEND(rtc8583, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/sy8106a.c
==============================================================================
--- stable/12/sys/dev/iicbus/sy8106a.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/sy8106a.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -300,3 +300,4 @@ EARLY_DRIVER_MODULE(sy8106a, iicbus, sy8106a_driver, s
     BUS_PASS_RESOURCE);
 MODULE_VERSION(sy8106a, 1);
 MODULE_DEPEND(sy8106a, iicbus, 1, 1, 1);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/syr827.c
==============================================================================
--- stable/12/sys/dev/iicbus/syr827.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/syr827.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -352,3 +352,4 @@ EARLY_DRIVER_MODULE(syr827, iicbus, syr827_driver, syr
     BUS_PASS_RESOURCE);
 MODULE_VERSION(syr827, 1);
 MODULE_DEPEND(syr827, iicbus, 1, 1, 1);
+IICBUS_FDT_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/twsi/a10_twsi.c
==============================================================================
--- stable/12/sys/dev/iicbus/twsi/a10_twsi.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/twsi/a10_twsi.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -158,3 +158,4 @@ EARLY_DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driv
 EARLY_DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass,
     0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
 MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1);
+SIMPLEBUS_PNP_INFO(compat_data);

Modified: stable/12/sys/dev/iicbus/twsi/mv_twsi.c
==============================================================================
--- stable/12/sys/dev/iicbus/twsi/mv_twsi.c	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/iicbus/twsi/mv_twsi.c	Sun Jun 23 16:16:55 2019	(r349314)
@@ -120,6 +120,7 @@ static devclass_t mv_twsi_devclass;
 DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0);
 DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0);
 MODULE_DEPEND(twsi, iicbus, 1, 1, 1);
+SIMPLEBUS_PNP_INFO(compat_data);
 
 static phandle_t
 mv_twsi_get_node(device_t bus, device_t dev)

Modified: stable/12/sys/dev/ofw/ofw_bus_subr.h
==============================================================================
--- stable/12/sys/dev/ofw/ofw_bus_subr.h	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/ofw/ofw_bus_subr.h	Sun Jun 23 16:16:55 2019	(r349314)
@@ -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);

Modified: stable/12/sys/dev/spibus/spi.h
==============================================================================
--- stable/12/sys/dev/spibus/spi.h	Sun Jun 23 16:05:53 2019	(r349313)
+++ stable/12/sys/dev/spibus/spi.h	Sun Jun 23 16:16:55 2019	(r349314)
@@ -41,6 +41,8 @@ struct spi_command {
 
 #define	SPI_CHIP_SELECT_HIGH	0x1		/* Chip select high (else low) */
 
-#define SPIBUS_PNP_DESCR "Z:compat;P:#;"
-#define SPIBUS_PNP_INFO(t) \
-	MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0]));
+#ifdef FDT
+#define	SPIBUS_FDT_PNP_INFO(t)	FDTCOMPAT_PNP_INFO(t, spibus)
+#else
+#define	SPIBUS_FDT_PNP_INFO(t)
+#endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906231616.x5NGGtMU066157>