From owner-svn-src-all@freebsd.org Mon Aug 5 16:48:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94C32C78E6; Mon, 5 Aug 2019 16:48:18 +0000 (UTC) (envelope-from manu@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 462NxZ3Svfz3QGj; Mon, 5 Aug 2019 16:48:18 +0000 (UTC) (envelope-from manu@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 542AF1EA6F; Mon, 5 Aug 2019 16:48:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75GmIox062613; Mon, 5 Aug 2019 16:48:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75GmGdd062605; Mon, 5 Aug 2019 16:48:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051648.x75GmGdd062605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 16:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350593 - in stable/12: release/arm64 sys/arm64/conf sys/dev/extres/clk sys/dev/extres/regulator sys/dts/arm64/overlays X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: release/arm64 sys/arm64/conf sys/dev/extres/clk sys/dev/extres/regulator sys/dts/arm64/overlays X-SVN-Commit-Revision: 350593 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.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: Mon, 05 Aug 2019 16:48:18 -0000 Author: manu Date: Mon Aug 5 16:48:16 2019 New Revision: 350593 URL: https://svnweb.freebsd.org/changeset/base/350593 Log: MFC r340987, r340989, r341254, r341269, r341333 r340987: arm64: Add evdev support to GENERIC r340989: regulator_fixed: Do not disable fixed regulator at probe If the regulator is unused it will be disabled by the regulator_shutdown sysinit. Tested on pinebook where the backlight is controlled by a fixed-regulator. The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe. We later enable it but this cause the screen to go black. Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX. Differential Revision: https://reviews.freebsd.org/D17978 r341254: extres: clk: Fix clk_set_assigned ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this. While here when setting the clock to the assigned freqeuncy, allow the clock driver to round down or up the frequency as sometimes the exact frequency cannot be obtain. r341269: release: arm64: Add opp dtbo to PINE* boards r341333: arm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp This is the frequency of the cpu on the Pinebook so add it to make cpufreq find the current setting. Note that this dtbo on the Pinebook doesn't work right now as u-boot dtb doesn't have symbols and so it fails to apply. Linux 4.20 have the dts and will be imported once taggued. X-MFC with: r341268 Modified: stable/12/release/arm64/PINE64-LTS.conf stable/12/release/arm64/PINE64.conf stable/12/release/arm64/PINEBOOK.conf stable/12/sys/arm64/conf/GENERIC stable/12/sys/dev/extres/clk/clk.c stable/12/sys/dev/extres/regulator/regulator_fixed.c stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Directory Properties: stable/12/ (props changed) Modified: stable/12/release/arm64/PINE64-LTS.conf ============================================================================== --- stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64-LTS" arm_install_uboot() { Modified: stable/12/release/arm64/PINE64.conf ============================================================================== --- stable/12/release/arm64/PINE64.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINE64.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64" arm_install_uboot() { Modified: stable/12/release/arm64/PINEBOOK.conf ============================================================================== --- stable/12/release/arm64/PINEBOOK.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINEBOOK.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINEBOOK" arm_install_uboot() { Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/arm64/conf/GENERIC Mon Aug 5 16:48:16 2019 (r350593) @@ -241,6 +241,11 @@ device kbdmux device vt_efifb +# EVDEV support +device evdev # input event device support +options EVDEV_SUPPORT # evdev support in legacy drivers +device uinput # install /dev/uinput cdev + # Pseudo devices. device crypto # core crypto support device loop # Network loopback Modified: stable/12/sys/dev/extres/clk/clk.c ============================================================================== --- stable/12/sys/dev/extres/clk/clk.c Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dev/extres/clk/clk.c Mon Aug 5 16:48:16 2019 (r350593) @@ -1297,7 +1297,7 @@ clk_set_assigned_rates(device_t dev, clk_t clk, uint32 { int rv; - rv = clk_set_freq(clk, freq, 0); + rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP); if (rv != 0) { device_printf(dev, "Failed to set %s to a frequency of %u\n", clk_get_name(clk), freq); @@ -1330,9 +1330,9 @@ clk_set_assigned(device_t dev, phandle_t node) if (nrates <= 0) nrates = 0; - nparents = ofw_bus_parse_xref_list_get_length(node, - "assigned-clock-parents", "#clock-cells", &nparents); - + if (ofw_bus_parse_xref_list_get_length(node, + "assigned-clock-parents", "#clock-cells", &nparents) != 0) + nparents = -1; for (i = 0; i < nclocks; i++) { /* First get the clock we are supposed to modify */ rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", Modified: stable/12/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 5 16:48:16 2019 (r350593) @@ -145,7 +145,6 @@ regnode_fixed_init(struct regnode *regnode) struct regnode_fixed_sc *sc; struct gpiobus_pin *pin; uint32_t flags; - bool enable; int rv; sc = regnode_get_softc(regnode); @@ -158,14 +157,15 @@ regnode_fixed_init(struct regnode *regnode) flags = GPIO_PIN_OUTPUT; if (sc->gpio_open_drain) flags |= GPIO_PIN_OPENDRAIN; - enable = sc->param->boot_on || sc->param->always_on; - if (!sc->param->enable_active_high) - enable = !enable; - rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); - if (rv != 0) { - device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin); - return (rv); + if (sc->param->boot_on || sc->param->always_on) { + rv = GPIO_PIN_SET(pin->dev, pin->pin, sc->param->enable_active_high); + if (rv != 0) { + device_printf(dev, "Cannot set GPIO pin: %d\n", + pin->pin); + return (rv); + } } + rv = GPIO_PIN_SETFLAGS(pin->dev, pin->pin, flags); if (rv != 0) { device_printf(dev, "Cannot configure GPIO pin: %d\n", pin->pin); Modified: stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso ============================================================================== --- stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Mon Aug 5 16:48:16 2019 (r350593) @@ -15,6 +15,11 @@ opp-microvolt = <1040000>; clock-latency-ns = <244144>; /* 8 32k periods */ }; + opp-792000000 { + opp-hz = /bits/ 64 <792000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; opp-816000000 { opp-hz = /bits/ 64 <816000000>; opp-microvolt = <1100000>;