From owner-svn-src-all@freebsd.org Thu May 23 15:47:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51AFE15AE46E; Thu, 23 May 2019 15:47:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC87871D58; Thu, 23 May 2019 15:47:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C70FE7206; Thu, 23 May 2019 15:47:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NFlUjS078743; Thu, 23 May 2019 15:47:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NFlUfE078741; Thu, 23 May 2019 15:47:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231547.x4NFlUfE078741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 15:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348169 - in head/sys/dev: iicbus ofw X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/dev: iicbus ofw X-SVN-Commit-Revision: 348169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC87871D58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:47:31 -0000 Author: ian Date: Thu May 23 15:47:30 2019 New Revision: 348169 URL: https://svnweb.freebsd.org/changeset/base/348169 Log: 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 Modified: head/sys/dev/iicbus/iicbus.h head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Thu May 23 15:00:15 2019 (r348168) +++ head/sys/dev/iicbus/iicbus.h Thu May 23 15:47:30 2019 (r348169) @@ -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); Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Thu May 23 15:00:15 2019 (r348168) +++ head/sys/dev/ofw/ofw_bus_subr.h Thu May 23 15:47:30 2019 (r348169) @@ -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);