Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2019 16:48:16 +0000 (UTC)
From:      Emmanuel Vadot <manu@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: r350593 - in stable/12: release/arm64 sys/arm64/conf sys/dev/extres/clk sys/dev/extres/regulator sys/dts/arm64/overlays
Message-ID:  <201908051648.x75GmGdd062605@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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>;



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