pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils fix reboot on pinebook-pro.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bc6b49c592e2
branches:  trunk
changeset: 423622:bc6b49c592e2
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Sat Feb 22 11:55:36 2020 +0000

description:
fix reboot on pinebook-pro.

pull in https://github.com/ARM-software/arm-trusted-firmware/commit/b4899041e5f0b8e8b388c6511b5233516b8785ec
from upstream, and also force this code path to be used.

bump version of both the rk3399 ATF and the pbp u-boot, and adjust
the buildlink version to require the updated ATF.

fix MESSAGE for u-boot-pinebook-pro to not refer to rockpro64.

diffstat:

 sysutils/arm-trusted-firmware-rk3399/Makefile                                             |   3 +-
 sysutils/arm-trusted-firmware-rk3399/buildlink3.mk                                        |   4 +-
 sysutils/arm-trusted-firmware-rk3399/distinfo                                             |   5 +-
 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.c |  52 ++++++++++
 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.h |  24 ++++
 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_soc_soc.c |  33 ++++++
 sysutils/u-boot-pinebook-pro/MESSAGE                                                      |   4 +-
 sysutils/u-boot-pinebook-pro/Makefile                                                     |   4 +-
 8 files changed, 121 insertions(+), 8 deletions(-)

diffs (196 lines):

diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/Makefile
--- a/sysutils/arm-trusted-firmware-rk3399/Makefile     Sat Feb 22 09:25:22 2020 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/Makefile     Sat Feb 22 11:55:36 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2020/01/06 08:37:01 mrg Exp $
+# $NetBSD: Makefile,v 1.2 2020/02/22 11:55:36 mrg Exp $
 
 VERSION=       2.2
+PKGREVISION=   1
 GITHUB_PROJECT=        arm-trusted-firmware
 GITHUB_TAG=    v2.2
 #GITHUB_TAG=   ab3d22473df279c61ed4d4873d26b072dcf887e8
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/buildlink3.mk
--- a/sysutils/arm-trusted-firmware-rk3399/buildlink3.mk        Sat Feb 22 09:25:22 2020 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/buildlink3.mk        Sat Feb 22 11:55:36 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.2 2020/01/23 18:31:05 jakllsch Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2020/02/22 11:55:36 mrg Exp $
 
 BUILDLINK_DEPMETHOD.arm-trusted-firmware-rk3399?=      build
 
@@ -7,7 +7,7 @@
 .if !defined(ARM_TRUSTED_FIRMWARE_RK3399_BUILDLINK3_MK)
 ARM_TRUSTED_FIRMWARE_RK3399_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.arm-trusted-firmware-rk3399+=    arm-trusted-firmware-rk3399>2.0
+BUILDLINK_API_DEPENDS.arm-trusted-firmware-rk3399+=    arm-trusted-firmware-rk3399>=2.2nb1
 BUILDLINK_PKGSRCDIR.arm-trusted-firmware-rk3399?=      ../../sysutils/arm-trusted-firmware-rk3399
 .endif # ARM_TRUSTED_FIRMWARE_RK3399_BUILDLINK3_MK
 
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/distinfo
--- a/sysutils/arm-trusted-firmware-rk3399/distinfo     Sat Feb 22 09:25:22 2020 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/distinfo     Sat Feb 22 11:55:36 2020 +0000
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.1 2020/01/06 08:37:01 mrg Exp $
+$NetBSD: distinfo,v 1.2 2020/02/22 11:55:36 mrg Exp $
 
 SHA1 (arm-trusted-firmware-2.2.zip) = 95bd4fc50b233ffffef87fe209756811a813f284
 RMD160 (arm-trusted-firmware-2.2.zip) = 615b7a60e3293dee8686cfca8bca3a83fea5ff88
 SHA512 (arm-trusted-firmware-2.2.zip) = 84fd95b14b5363b1a98482b71bde6915e8e36e832260371343fd576245124abfeb017ee5898996c373efcc46d03210b86ab665446aa1f7a3c9e4f290d2137f37
 Size (arm-trusted-firmware-2.2.zip) = 5205813 bytes
+SHA1 (patch-plat_rockchip_rk3399_drivers_pmu_pmu.c) = 3b14320a47c9606ce9f6c48d8c7b3e06ab9a0253
+SHA1 (patch-plat_rockchip_rk3399_drivers_pmu_pmu.h) = cfc458bd37c5467612d4d3b39bf4bfbb2f2ba27f
+SHA1 (patch-plat_rockchip_rk3399_drivers_soc_soc.c) = 06016302b793f1256a1baac46ab0a54f41332795
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.c Sat Feb 22 11:55:36 2020 +0000
@@ -0,0 +1,52 @@
+$NetBSD: patch-plat_rockchip_rk3399_drivers_pmu_pmu.c,v 1.1 2020/02/22 11:55:36 mrg Exp $
+
+pull in https://github.com/ARM-software/arm-trusted-firmware/commit/b4899041e5f0b8e8b388c6511b5233516b8785ec
+
+ plat/rockchip: enable power domains of rk3399 before reset
+
+ This patch fixes hangs that happen after soft resetting of rk3399.
+
+ Signed-off-by: Piotr Szczepanik <piter75%gmail.com@localhost>
+ Change-Id: If41b12ba1dfcb2ba937361b58eafd50bf5c483d4
+
+with one additional change to force using the soft reset path,
+as the gpio one does not seem to work.
+
+
+--- plat/rockchip/rk3399/drivers/pmu/pmu.c.orig        2019-10-22 06:36:23.000000000 -0700
++++ plat/rockchip/rk3399/drivers/pmu/pmu.c     2020-02-22 03:31:50.759523535 -0800
+@@ -400,6 +400,25 @@
+       clk_gate_con_restore();
+ }
+ 
++void pmu_power_domains_on(void)
++{
++      clk_gate_con_disable();
++      pmu_set_power_domain(PD_VDU, pmu_pd_on);
++      pmu_set_power_domain(PD_VCODEC, pmu_pd_on);
++      pmu_set_power_domain(PD_RGA, pmu_pd_on);
++      pmu_set_power_domain(PD_IEP, pmu_pd_on);
++      pmu_set_power_domain(PD_EDP, pmu_pd_on);
++      pmu_set_power_domain(PD_GMAC, pmu_pd_on);
++      pmu_set_power_domain(PD_SDIOAUDIO, pmu_pd_on);
++      pmu_set_power_domain(PD_HDCP, pmu_pd_on);
++      pmu_set_power_domain(PD_ISP1, pmu_pd_on);
++      pmu_set_power_domain(PD_ISP0, pmu_pd_on);
++      pmu_set_power_domain(PD_VO, pmu_pd_on);
++      pmu_set_power_domain(PD_TCPD1, pmu_pd_on);
++      pmu_set_power_domain(PD_TCPD0, pmu_pd_on);
++      pmu_set_power_domain(PD_GPU, pmu_pd_on);
++}
++
+ void rk3399_flush_l2_b(void)
+ {
+       uint32_t wait_cnt = 0;
+@@ -1504,7 +1523,7 @@
+ 
+       rst_gpio = plat_get_rockchip_gpio_reset();
+ 
+-      if (rst_gpio) {
++      if (rst_gpio && 0) {
+               gpio_set_direction(rst_gpio->index, GPIO_DIR_OUT);
+               gpio_set_value(rst_gpio->index, rst_gpio->polarity);
+       } else {
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_pmu_pmu.h Sat Feb 22 11:55:36 2020 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-plat_rockchip_rk3399_drivers_pmu_pmu.h,v 1.1 2020/02/22 11:55:36 mrg Exp $
+
+pull in https://github.com/ARM-software/arm-trusted-firmware/commit/b4899041e5f0b8e8b388c6511b5233516b8785ec
+
+ plat/rockchip: enable power domains of rk3399 before reset
+
+ This patch fixes hangs that happen after soft resetting of rk3399.
+
+ Signed-off-by: Piotr Szczepanik <piter75%gmail.com@localhost>
+ Change-Id: If41b12ba1dfcb2ba937361b58eafd50bf5c483d4
+
+with one additional change to force using the soft reset path,
+as the gpio one does not seem to work.
+
+
+--- plat/rockchip/rk3399/drivers/pmu/pmu.h.orig        2019-10-22 06:36:23.000000000 -0700
++++ plat/rockchip/rk3399/drivers/pmu/pmu.h     2020-02-22 02:32:31.695012124 -0800
+@@ -136,5 +136,6 @@
+ extern uint32_t clst_warmboot_data[PLATFORM_CLUSTER_COUNT];
+ 
+ extern void sram_func_set_ddrctl_pll(uint32_t pll_src);
++void pmu_power_domains_on(void);
+ 
+ #endif /* PMU_H */
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_soc_soc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/arm-trusted-firmware-rk3399/patches/patch-plat_rockchip_rk3399_drivers_soc_soc.c Sat Feb 22 11:55:36 2020 +0000
@@ -0,0 +1,33 @@
+$NetBSD: patch-plat_rockchip_rk3399_drivers_soc_soc.c,v 1.1 2020/02/22 11:55:36 mrg Exp $
+
+pull in https://github.com/ARM-software/arm-trusted-firmware/commit/b4899041e5f0b8e8b388c6511b5233516b8785ec
+
+ plat/rockchip: enable power domains of rk3399 before reset
+
+ This patch fixes hangs that happen after soft resetting of rk3399.
+
+ Signed-off-by: Piotr Szczepanik <piter75%gmail.com@localhost>
+ Change-Id: If41b12ba1dfcb2ba937361b58eafd50bf5c483d4
+
+with one additional change to force using the soft reset path,
+as the gpio one does not seem to work.
+
+
+--- plat/rockchip/rk3399/drivers/soc/soc.c.orig        2020-02-22 02:30:58.094221102 -0800
++++ plat/rockchip/rk3399/drivers/soc/soc.c     2020-02-22 02:31:04.989130511 -0800
+@@ -17,6 +17,7 @@
+ #include <dram.h>
+ #include <m0_ctl.h>
+ #include <plat_private.h>
++#include <pmu.h>
+ #include <rk3399_def.h>
+ #include <secure.h>
+ #include <soc.h>
+@@ -327,6 +328,7 @@
+ 
+ void __dead2 soc_global_soft_reset(void)
+ {
++      pmu_power_domains_on();
+       set_pll_slow_mode(VPLL_ID);
+       set_pll_slow_mode(NPLL_ID);
+       set_pll_slow_mode(GPLL_ID);
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/u-boot-pinebook-pro/MESSAGE
--- a/sysutils/u-boot-pinebook-pro/MESSAGE      Sat Feb 22 09:25:22 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/MESSAGE      Sat Feb 22 11:55:36 2020 +0000
@@ -1,5 +1,5 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.3 2020/01/14 08:44:03 mrg Exp $
+$NetBSD: MESSAGE,v 1.4 2020/02/22 11:55:36 mrg Exp $
 
 Examples command to install U-Boot to an empty SD card:
 
@@ -7,7 +7,7 @@
 
 Alternatively, to install to SPI flash:
 
-dd if=${LOCALBASE}/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0
+dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rkspi_loader.img bs=64k of=/dev/spiflash0
 
 You should make sure that the space is otherwise cleared of data, as old
 images may fool the boot loader paths.
diff -r fa6a2a16f1c0 -r bc6b49c592e2 sysutils/u-boot-pinebook-pro/Makefile
--- a/sysutils/u-boot-pinebook-pro/Makefile     Sat Feb 22 09:25:22 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/Makefile     Sat Feb 22 11:55:36 2020 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2020/01/27 08:02:29 thorpej Exp $
+# $NetBSD: Makefile,v 1.6 2020/02/22 11:55:36 mrg Exp $
 
-PKGREVISION=           3
+PKGREVISION=           4
 
 UBOOT_TARGET=          pinebook-pro
 UBOOT_CONFIG=          pinebook_pro-rk3399_defconfig



Home | Main Index | Thread Index | Old Index