Skip to content

Commit b82c84a

Browse files
committed
uboot-rockchip: update with 2022.07-rc2 to support RK3566/RK35688
1 parent 954990d commit b82c84a

29 files changed

Lines changed: 8206 additions & 40 deletions

package/boot/uboot-rockchip/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#
22
# This is free software, licensed under the GNU General Public License v2.
3-
# See /LICENSE for more information.
3+
# See /LICENSE for more information.
44
#
55
include $(TOPDIR)/rules.mk
66
include $(INCLUDE_DIR)/kernel.mk
77

8-
PKG_VERSION:=2021.07
8+
PKG_VERSION:=2022.07-rc2
99
PKG_RELEASE:=$(AUTORELEASE)
1010

11-
PKG_HASH:=312b7eeae44581d1362c3a3f02c28d806647756c82ba8c72241c7cdbe68ba77e
11+
PKG_HASH:=de4819a6d83c557efe3cf65ad17ec111008baa400ea2a8d13e04ddd43eca3a81
1212

1313
PKG_MAINTAINER:=Tobias Maedel <openwrt@tbspace.de>
1414

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 9b92a43a4f5acf4cba14fd9d473b3120688532dc Mon Sep 17 00:00:00 2001
2+
From: Peter Geis <pgwipeout@gmail.com>
3+
Date: Sun, 19 Dec 2021 08:10:24 -0500
4+
Subject: [PATCH 01/11] rockchip: rk3568: add boot device detection
5+
6+
Enable spl to detect which device it was booted from.
7+
8+
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
9+
---
10+
arch/arm/mach-rockchip/rk3568/rk3568.c | 8 ++++++++
11+
1 file changed, 8 insertions(+)
12+
13+
--- a/arch/arm/mach-rockchip/rk3568/rk3568.c
14+
+++ b/arch/arm/mach-rockchip/rk3568/rk3568.c
15+
@@ -7,6 +7,7 @@
16+
#include <dm.h>
17+
#include <asm/armv8/mmu.h>
18+
#include <asm/io.h>
19+
+#include <asm/arch-rockchip/bootrom.h>
20+
#include <asm/arch-rockchip/grf_rk3568.h>
21+
#include <asm/arch-rockchip/hardware.h>
22+
#include <dt-bindings/clock/rk3568-cru.h>
23+
@@ -23,6 +24,7 @@
24+
#define SGRF_SOC_CON4 0x10
25+
#define EMMC_HPROT_SECURE_CTRL 0x03
26+
#define SDMMC0_HPROT_SECURE_CTRL 0x01
27+
+
28+
/* PMU_GRF_GPIO0D_IOMUX_L */
29+
enum {
30+
GPIO0D1_SHIFT = 4,
31+
@@ -43,6 +45,12 @@ enum {
32+
UART2_IO_SEL_M0 = 0,
33+
};
34+
35+
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
36+
+ [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe310000",
37+
+ [BROM_BOOTSOURCE_SPINOR] = "/spi@fe300000/flash@0",
38+
+ [BROM_BOOTSOURCE_SD] = "/mmc@fe2b0000",
39+
+};
40+
+
41+
static struct mm_region rk3568_mem_map[] = {
42+
{
43+
.virt = 0x0UL,
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 09d877cf076cbb67c79054e12bbb7c63a91faa71 Mon Sep 17 00:00:00 2001
2+
From: Peter Geis <pgwipeout@gmail.com>
3+
Date: Sun, 19 Dec 2021 08:11:56 -0500
4+
Subject: [PATCH 02/11] rockchip: rk3568: enable automatic power savings
5+
6+
Enable automatic clock gating, solves the 7c temperature difference on
7+
SoQuartz.
8+
9+
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
10+
---
11+
arch/arm/mach-rockchip/rk3568/rk3568.c | 23 +++++++++++++++++++++++
12+
1 file changed, 23 insertions(+)
13+
14+
--- a/arch/arm/mach-rockchip/rk3568/rk3568.c
15+
+++ b/arch/arm/mach-rockchip/rk3568/rk3568.c
16+
@@ -25,6 +25,15 @@
17+
#define EMMC_HPROT_SECURE_CTRL 0x03
18+
#define SDMMC0_HPROT_SECURE_CTRL 0x01
19+
20+
+#define PMU_BASE_ADDR 0xfdd90000
21+
+#define PMU_NOC_AUTO_CON0 (0x70)
22+
+#define PMU_NOC_AUTO_CON1 (0x74)
23+
+#define EDP_PHY_GRF_BASE 0xfdcb0000
24+
+#define EDP_PHY_GRF_CON0 (EDP_PHY_GRF_BASE + 0x00)
25+
+#define EDP_PHY_GRF_CON10 (EDP_PHY_GRF_BASE + 0x28)
26+
+#define CPU_GRF_BASE 0xfdc30000
27+
+#define GRF_CORE_PVTPLL_CON0 (0x10)
28+
+
29+
/* PMU_GRF_GPIO0D_IOMUX_L */
30+
enum {
31+
GPIO0D1_SHIFT = 4,
32+
@@ -99,6 +108,20 @@ void board_debug_uart_init(void)
33+
int arch_cpu_init(void)
34+
{
35+
#ifdef CONFIG_SPL_BUILD
36+
+ /*
37+
+ * When perform idle operation, corresponding clock can
38+
+ * be opened or gated automatically.
39+
+ */
40+
+ writel(0xffffffff, PMU_BASE_ADDR + PMU_NOC_AUTO_CON0);
41+
+ writel(0x000f000f, PMU_BASE_ADDR + PMU_NOC_AUTO_CON1);
42+
+
43+
+ /* Disable eDP phy by default */
44+
+ writel(0x00070007, EDP_PHY_GRF_CON10);
45+
+ writel(0x0ff10ff1, EDP_PHY_GRF_CON0);
46+
+
47+
+ /* Set core pvtpll ring length */
48+
+ writel(0x00ff002b, CPU_GRF_BASE + GRF_CORE_PVTPLL_CON0);
49+
+
50+
/* Set the emmc sdmmc0 to secure */
51+
rk_clrreg(SGRF_BASE + SGRF_SOC_CON4, (EMMC_HPROT_SECURE_CTRL << 11
52+
| SDMMC0_HPROT_SECURE_CTRL << 4));
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From ddbcec939789d1f7264134b3628ffb649ec88168 Mon Sep 17 00:00:00 2001
2+
From: Peter Geis <pgwipeout@gmail.com>
3+
Date: Sun, 19 Dec 2021 08:20:33 -0500
4+
Subject: [PATCH 03/11] Makefile: rockchip: HACK: build rk3568 images
5+
6+
This is a hack to build rk3568 images.
7+
It seems makefile can't cope with the format mkimage expects for
8+
multiple file entries, so hack around the situation.
9+
10+
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
11+
---
12+
Makefile | 10 ++++++++++
13+
1 file changed, 10 insertions(+)
14+
15+
--- a/Makefile
16+
+++ b/Makefile
17+
@@ -1047,6 +1047,9 @@ quiet_cmd_mkimage = MKIMAGE $@
18+
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
19+
>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
20+
21+
+cmd_mkimage_combined = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $(COMBINED_FILE):$< $@ \
22+
+ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
23+
+
24+
quiet_cmd_mkfitimage = MKIMAGE $@
25+
cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) \
26+
-f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@ \
27+
@@ -1491,6 +1494,7 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_
28+
ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
29+
30+
# TPL + SPL
31+
+ifneq ($(CONFIG_SYS_SOC),$(filter $(CONFIG_SYS_SOC),"rk3568" "rk3566"))
32+
ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
33+
MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
34+
tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
35+
@@ -1502,6 +1506,12 @@ MKIMAGEFLAGS_idbloader.img = -n $(CONFIG
36+
idbloader.img: spl/u-boot-spl.bin FORCE
37+
$(call if_changed,mkimage)
38+
endif
39+
+else
40+
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
41+
+COMBINED_FILE = ram_init.bin
42+
+idbloader.img: spl/u-boot-spl.bin FORCE
43+
+ $(call if_changed,mkimage_combined)
44+
+endif
45+
46+
ifeq ($(CONFIG_ARM64),y)
47+
OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \

0 commit comments

Comments
 (0)