From owner-svn-src-head@freebsd.org Sat Nov 19 00:55:47 2016 Return-Path: Delivered-To: svn-src-head@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 D119AC471E1; Sat, 19 Nov 2016 00:55:47 +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 9D2B9784; Sat, 19 Nov 2016 00:55:47 +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 uAJ0tkPh075554; Sat, 19 Nov 2016 00:55:46 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAJ0tkN8075550; Sat, 19 Nov 2016 00:55:46 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611190055.uAJ0tkN8075550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sat, 19 Nov 2016 00:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308819 - in head/sys/arm: conf ti/omap4 ti/omap4/pandaboard ti/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2016 00:55:47 -0000 Author: cognet Date: Sat Nov 19 00:55:46 2016 New Revision: 308819 URL: https://svnweb.freebsd.org/changeset/base/308819 Log: Don't assume we're running on a pandaboard if the pandaboard-specific code is compiled in, use FDT to detect it instead. Added: head/sys/arm/ti/omap4/pandaboard/pandaboard.h (contents, props changed) Deleted: head/sys/arm/ti/omap4/pandaboard/files.pandaboard head/sys/arm/ti/omap4/pandaboard/std.pandaboard Modified: head/sys/arm/conf/PANDABOARD head/sys/arm/ti/omap4/files.omap4 head/sys/arm/ti/omap4/pandaboard/pandaboard.c head/sys/arm/ti/usb/omap_ehci.c Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Fri Nov 18 23:48:20 2016 (r308818) +++ head/sys/arm/conf/PANDABOARD Sat Nov 19 00:55:46 2016 (r308819) @@ -28,7 +28,7 @@ ident PANDABOARD hints "PANDABOARD.hints" include "std.armv6" -include "../ti/omap4/pandaboard/std.pandaboard" +include "../ti/omap4/std.omap4" makeoptions MODULES_EXTRA=dtb/omap4 Modified: head/sys/arm/ti/omap4/files.omap4 ============================================================================== --- head/sys/arm/ti/omap4/files.omap4 Fri Nov 18 23:48:20 2016 (r308818) +++ head/sys/arm/ti/omap4/files.omap4 Sat Nov 19 00:55:46 2016 (r308819) @@ -14,6 +14,8 @@ arm/ti/omap4/omap4_scm_padconf.c standa arm/ti/omap4/omap4_mp.c optional smp arm/ti/omap4/omap4_wugen.c standard +arm/ti/omap4/pandaboard/pandaboard.c standard + arm/ti/twl/twl.c optional twl arm/ti/twl/twl_vreg.c optional twl twl_vreg arm/ti/twl/twl_clks.c optional twl twl_clks Modified: head/sys/arm/ti/omap4/pandaboard/pandaboard.c ============================================================================== --- head/sys/arm/ti/omap4/pandaboard/pandaboard.c Fri Nov 18 23:48:20 2016 (r308818) +++ head/sys/arm/ti/omap4/pandaboard/pandaboard.c Sat Nov 19 00:55:46 2016 (r308819) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* Registers in the SCRM that control the AUX clocks */ #define SCRM_ALTCLKSRC (0x110) @@ -111,8 +112,8 @@ __FBSDID("$FreeBSD$"); * RETURNS: * nothing. */ -static void -usb_hub_init(void) +void +pandaboard_usb_hub_init(void) { bus_space_handle_t scrm_addr, gpio1_addr, gpio2_addr, scm_addr; @@ -169,39 +170,3 @@ usb_hub_init(void) bus_space_unmap(fdtbus_bs_tag, gpio2_addr, OMAP44XX_GPIO2_SIZE); bus_space_unmap(fdtbus_bs_tag, scm_addr, OMAP44XX_SCM_PADCONF_SIZE); } - -/** - * board_init - initialises the pandaboard - * @dummy: ignored - * - * This function is called before any of the driver are initialised, which is - * annoying because it means we can't use the SCM, PRCM and GPIO modules which - * would really be useful. - * - * So we don't have: - * - any drivers - * - no interrupts - * - * What we do have: - * - virt/phys mappings from the devmap (see omap4.c) - * - - * - * - * So we are hamstrung without the useful drivers and we have to go back to - * direct register manupulation. Luckly we don't have to do to much, basically - * just setup the usb hub/ethernet. - * - */ -static void -board_init(void *dummy) -{ - /* Initialise the USB phy and hub */ - usb_hub_init(); - - /* - * XXX Board identification e.g. read out from FPGA or similar should - * go here - */ -} - -SYSINIT(board_init, SI_SUB_CPU, SI_ORDER_THIRD, board_init, NULL); Added: head/sys/arm/ti/omap4/pandaboard/pandaboard.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/omap4/pandaboard/pandaboard.h Sat Nov 19 00:55:46 2016 (r308819) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2016 Olivier Houchard + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PANDABOARD_H_ +#define _PANDABOARD_H_ +void pandaboard_usb_hub_init(void); +#endif /* _OMAP4_MP_H_ */ + Modified: head/sys/arm/ti/usb/omap_ehci.c ============================================================================== --- head/sys/arm/ti/usb/omap_ehci.c Fri Nov 18 23:48:20 2016 (r308818) +++ head/sys/arm/ti/usb/omap_ehci.c Sat Nov 19 00:55:46 2016 (r308819) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* EHCI */ #define OMAP_USBHOST_HCCAPBASE 0x0000 #define OMAP_USBHOST_HCSPARAMS 0x0004 @@ -258,6 +261,7 @@ omap_ehci_init(struct omap_ehci_softc *i static int omap_ehci_probe(device_t dev) { + phandle_t root; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -265,6 +269,16 @@ omap_ehci_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "ti,ehci-omap")) return (ENXIO); +#ifdef SOC_OMAP4 + /* + * If we're running a Pandaboard, run Pandaboard-specific + * init code. + */ + root = OF_finddevice("/"); + if (fdt_is_compatible(root, "ti,omap4-panda")) + pandaboard_usb_hub_init(); +#endif + device_set_desc(dev, OMAP_EHCI_HC_DEVSTR); return (BUS_PROBE_DEFAULT);