Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/sunxi Try to avoid changing hardware settings w...
details: https://anonhg.NetBSD.org/src/rev/e95fc37dc8ff
branches: trunk
changeset: 465481:e95fc37dc8ff
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Nov 24 10:27:37 2019 +0000
description:
Try to avoid changing hardware settings when the "nomodeset" kernel arg
is present.
diffstat:
sys/arch/arm/sunxi/sun50i_a64_ccu.c | 30 ++++++++++++++++++------------
sys/arch/arm/sunxi/sunxi_dwhdmi.c | 12 ++++++++++--
sys/arch/arm/sunxi/sunxi_platform.c | 12 +++++++++---
3 files changed, 37 insertions(+), 17 deletions(-)
diffs (137 lines):
diff -r 383ec2e9dcb7 -r e95fc37dc8ff sys/arch/arm/sunxi/sun50i_a64_ccu.c
--- a/sys/arch/arm/sunxi/sun50i_a64_ccu.c Sun Nov 24 09:37:05 2019 +0000
+++ b/sys/arch/arm/sunxi/sun50i_a64_ccu.c Sun Nov 24 10:27:37 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_ccu.c,v 1.19 2019/11/23 22:46:53 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_ccu.c,v 1.20 2019/11/24 10:27:37 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.19 2019/11/23 22:46:53 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.20 2019/11/24 10:27:37 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -601,6 +601,8 @@
{
struct sunxi_ccu_softc * const sc = device_private(self);
struct fdt_attach_args * const faa = aux;
+ prop_dictionary_t prop = device_properties(self);
+ bool nomodeset;
sc->sc_dev = self;
sc->sc_phandle = faa->faa_phandle;
@@ -618,19 +620,23 @@
aprint_naive("\n");
aprint_normal(": A64 CCU\n");
- /* Set DE parent to PLL_DE */
- clk_set_parent(&sc->sc_clks[A64_CLK_DE].base, &sc->sc_clks[A64_CLK_PLL_DE].base);
- clk_set_rate(&sc->sc_clks[A64_CLK_PLL_DE].base, 420000000);
+ nomodeset = false;
+ prop_dictionary_get_bool(prop, "nomodeset", &nomodeset);
+ if (!nomodeset) {
+ /* Set DE parent to PLL_DE */
+ clk_set_parent(&sc->sc_clks[A64_CLK_DE].base, &sc->sc_clks[A64_CLK_PLL_DE].base);
+ clk_set_rate(&sc->sc_clks[A64_CLK_PLL_DE].base, 420000000);
- /* Set video PLLs to 297 MHz */
- clk_set_rate(&sc->sc_clks[A64_CLK_PLL_VIDEO0].base, 297000000);
- clk_set_rate(&sc->sc_clks[A64_CLK_PLL_VIDEO1].base, 297000000);
+ /* Set video PLLs to 297 MHz */
+ clk_set_rate(&sc->sc_clks[A64_CLK_PLL_VIDEO0].base, 297000000);
+ clk_set_rate(&sc->sc_clks[A64_CLK_PLL_VIDEO1].base, 297000000);
- /* Set TCON1 parent to PLL_VIDEO1(1X) */
- clk_set_parent(&sc->sc_clks[A64_CLK_TCON1].base, &sc->sc_clks[A64_CLK_PLL_VIDEO1].base);
+ /* Set TCON1 parent to PLL_VIDEO1(1X) */
+ clk_set_parent(&sc->sc_clks[A64_CLK_TCON1].base, &sc->sc_clks[A64_CLK_PLL_VIDEO1].base);
- /* Set HDMI parent to PLL_VIDEO1(1X) */
- clk_set_parent(&sc->sc_clks[A64_CLK_HDMI].base, &sc->sc_clks[A64_CLK_PLL_VIDEO1].base);
+ /* Set HDMI parent to PLL_VIDEO1(1X) */
+ clk_set_parent(&sc->sc_clks[A64_CLK_HDMI].base, &sc->sc_clks[A64_CLK_PLL_VIDEO1].base);
+ }
sunxi_ccu_print(sc);
}
diff -r 383ec2e9dcb7 -r e95fc37dc8ff sys/arch/arm/sunxi/sunxi_dwhdmi.c
--- a/sys/arch/arm/sunxi/sunxi_dwhdmi.c Sun Nov 24 09:37:05 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_dwhdmi.c Sun Nov 24 10:27:37 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_dwhdmi.c,v 1.7 2019/11/23 18:55:08 jmcneill Exp $ */
+/* $NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.7 2019/11/23 18:55:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -228,12 +228,20 @@
{
struct sunxi_dwhdmi_softc * const sc = device_private(self);
struct fdt_attach_args * const faa = aux;
+ prop_dictionary_t prop = device_properties(self);
const int phandle = faa->faa_phandle;
struct clk *clk_iahb, *clk_isfr, *clk_tmds;
struct fdtbus_reset *rst;
+ bool is_disabled;
bus_addr_t addr;
bus_size_t size;
+ if (prop_dictionary_get_bool(prop, "disabled", &is_disabled) && is_disabled) {
+ aprint_naive("\n");
+ aprint_normal(": HDMI TX (disabled)\n");
+ return;
+ }
+
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");
return;
diff -r 383ec2e9dcb7 -r e95fc37dc8ff sys/arch/arm/sunxi/sunxi_platform.c
--- a/sys/arch/arm/sunxi/sunxi_platform.c Sun Nov 24 09:37:05 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_platform.c Sun Nov 24 10:27:37 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.37 2019/06/17 05:27:01 mrg Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.38 2019/11/24 10:27:37 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
#include "opt_console.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.37 2019/06/17 05:27:01 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.38 2019/11/24 10:27:37 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -230,11 +230,17 @@
}
}
- if (device_is_a(self, "sunxidrm")) {
+ if (device_is_a(self, "sunxidrm") || device_is_a(self, "dwhdmi")) {
if (get_bootconf_option(boot_args, "nomodeset", BOOTOPT_TYPE_BOOLEAN, &val))
if (val)
prop_dictionary_set_bool(prop, "disabled", true);
}
+
+ if (device_is_a(self, "sun50ia64ccu0")) {
+ if (get_bootconf_option(boot_args, "nomodeset", BOOTOPT_TYPE_BOOLEAN, &val))
+ if (val)
+ prop_dictionary_set_bool(prop, "nomodeset", true);
+ }
}
static u_int
Home |
Main Index |
Thread Index |
Old Index