From owner-svn-src-all@freebsd.org Tue Sep 12 10:43:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 531BEE024C3; Tue, 12 Sep 2017 10:43:04 +0000 (UTC) (envelope-from cognet@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 mx1.freebsd.org (Postfix) with ESMTPS id 12A3C6C5D6; Tue, 12 Sep 2017 10:43:04 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8CAh3YL066740; Tue, 12 Sep 2017 10:43:03 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8CAh2tE066737; Tue, 12 Sep 2017 10:43:02 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201709121043.v8CAh2tE066737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 12 Sep 2017 10:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323490 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 323490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 12 Sep 2017 10:43:04 -0000 Author: cognet Date: Tue Sep 12 10:43:02 2017 New Revision: 323490 URL: https://svnweb.freebsd.org/changeset/base/323490 Log: Some devices come with the same name as TI devices, so we can't rely on the "probe" method of those drivers to mean we're on e TI SoC. Introduce a new function, ti_soc_is_supported(), and use it to be sure we're really a TI system. PR: 222250 Modified: head/sys/arm/ti/ti_cpuid.c head/sys/arm/ti/ti_cpuid.h head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Tue Sep 12 06:34:02 2017 (r323489) +++ head/sys/arm/ti/ti_cpuid.c Tue Sep 12 10:43:02 2017 (r323490) @@ -272,11 +272,7 @@ am335x_get_revision(void) static void ti_cpu_ident(void *dummy) { - phandle_t root; - - root = OF_finddevice("/"); - if (!ofw_bus_node_is_compatible(root, "ti,omap4") && - !ofw_bus_node_is_compatible(root, "ti,am33xx")) + if (!ti_soc_is_supported()) return; switch(ti_chip()) { case CHIP_OMAP_4: Modified: head/sys/arm/ti/ti_cpuid.h ============================================================================== --- head/sys/arm/ti/ti_cpuid.h Tue Sep 12 06:34:02 2017 (r323489) +++ head/sys/arm/ti/ti_cpuid.h Tue Sep 12 10:43:02 2017 (r323490) @@ -80,4 +80,10 @@ static __inline int ti_chip(void) uint32_t ti_revision(void); +static __inline bool ti_soc_is_supported(void) +{ + + return (_ti_chip != -1); +} + #endif /* _TI_CPUID_H_ */ Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Tue Sep 12 06:34:02 2017 (r323489) +++ head/sys/arm/ti/ti_scm.c Tue Sep 12 10:43:02 2017 (r323490) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include "ti_scm.h" +#include "ti_cpuid.h" static struct resource_spec ti_scm_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Control memory window */ @@ -86,6 +87,10 @@ static struct ti_scm_softc *ti_scm_sc; static int ti_scm_probe(device_t dev) { + + if (!ti_soc_is_supported()) + return (ENXIO); + if (!ofw_bus_status_okay(dev)) return (ENXIO);