Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip rkdrm: Reset vop for 10us on attach.



details:   https://anonhg.NetBSD.org/src/rev/d2c163249a64
branches:  trunk
changeset: 1029028:d2c163249a64
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:45:12 2021 +0000

description:
rkdrm: Reset vop for 10us on attach.

This avoids creepy lines slowly appearing, and freezing themselves
semipermanently on the display, until the first successful modeset.

diffstat:

 sys/arch/arm/rockchip/rk_vop.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 583a43cdfea0 -r d2c163249a64 sys/arch/arm/rockchip/rk_vop.c
--- a/sys/arch/arm/rockchip/rk_vop.c    Sun Dec 19 12:45:04 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_vop.c    Sun Dec 19 12:45:12 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_vop.c,v 1.13 2021/12/19 12:43:37 riastradh Exp $ */
+/* $NetBSD: rk_vop.c,v 1.14 2021/12/19 12:45:12 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.13 2021/12/19 12:43:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.14 2021/12/19 12:45:12 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -624,13 +624,25 @@
 
        fdtbus_clock_assign(phandle);
 
+       /* assert all the reset signals for 20us */
+       for (n = 0; n < __arraycount(reset_names); n++) {
+               rst = fdtbus_reset_get(phandle, reset_names[n]);
+               if (rst == NULL || fdtbus_reset_assert(rst) != 0) {
+                       aprint_error(": couldn't assert reset %s\n",
+                           reset_names[n]);
+                       return;
+               }
+       }
+       DELAY(10);
        for (n = 0; n < __arraycount(reset_names); n++) {
                rst = fdtbus_reset_get(phandle, reset_names[n]);
                if (rst == NULL || fdtbus_reset_deassert(rst) != 0) {
-                       aprint_error(": couldn't de-assert reset %s\n", reset_names[n]);
+                       aprint_error(": couldn't de-assert reset %s\n",
+                           reset_names[n]);
                        return;
                }
        }
+
        for (n = 0; n < __arraycount(clock_names); n++) {
                if (fdtbus_clock_enable(phandle, clock_names[n], true) != 0) {
                        aprint_error(": couldn't enable clock %s\n", clock_names[n]);



Home | Main Index | Thread Index | Old Index