Skip to contentSkip to conversation

support enter download mode on rockchip platform

PATCH Superseded Andy Yan 3 participants 7 messages Sep 14, 2017 – Sep 15, 2017

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Andy Yan

author
#0 lore raw

v2 cover support enter download mode on rockchip platform

Most rockchip platform based boards use a key to instruct the board enter download firmware mode, some boards use a adc to detect the key status, and some use a gpio.

This series try to implement all the download mode related functions.

Changes in v2:
- correct the rk322x boot mode register address
- make the help text more clear
- implement the back to bootrom download mode check in c, thanks for Dr. Philipp Tomsich's suggestion.
- more document
- move adc key detect as the defaut

Andy Yan (3):
rockchip: make boot_mode related codes reused across all platforms
rockchip: add support for enter to bootrom download mode
rockchip: check download key before bootup

 arch/arm/include/asm/arch-rockchip/boot_mode.h |  7 +++
 arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++-
 arch/arm/mach-rockchip/Kconfig                 | 15 +++++
 arch/arm/mach-rockchip/Makefile                |  4 ++
 arch/arm/mach-rockchip/boot_mode.c             | 76 ++++++++++++++++++++++++++
 arch/arm/mach-rockchip/bootrom.c               | 31 ++++++++++-
 arch/arm/mach-rockchip/rk3036-board.c          | 24 --------
 arch/arm/mach-rockchip/rk322x-board.c          | 24 --------
 arch/arm/mach-rockchip/rk3288-board.c          | 25 ---------
 arch/arm/mach-rockchip/rk3399-board.c          | 14 +++++
 arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++---
 11 files changed, 177 insertions(+), 83 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/boot_mode.c
 create mode 100644 arch/arm/mach-rockchip/rk3399-board.c
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/3 rockchip: make boot_mode related codes reused across all platforms

setup_boot_mode function use the same logic but different mode register address across all the rockchip platforms, so it's better to make this function reused across all the platforms, and let the mode register address setting from the config file.

---

Changes in v2:
- correct the rk322x boot mode register address
- make the help text more clear

 arch/arm/include/asm/arch-rockchip/boot_mode.h |  2 ++
 arch/arm/mach-rockchip/Kconfig                 | 14 +++++++++++
 arch/arm/mach-rockchip/Makefile                |  4 ++++
 arch/arm/mach-rockchip/boot_mode.c             | 33 ++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3036-board.c          | 24 -------------------
 arch/arm/mach-rockchip/rk322x-board.c          | 24 -------------------
 arch/arm/mach-rockchip/rk3288-board.c          | 25 -------------------
 arch/arm/mach-rockchip/rk3399-board.c          | 14 +++++++++++
 8 files changed, 67 insertions(+), 73 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/boot_mode.c
 create mode 100644 arch/arm/mach-rockchip/rk3399-board.c
arch/arm/include/asm/arch-rockchip/boot_mode.h +2 -0
index bd65f60..163b2e7 100644
@@ -16,4 +16,6 @@
 /* enter usb mass storage mode */
 #define BOOT_UMS		(REBOOT_FLAG + 12)
 
+int setup_boot_mode(void);
+
 #endif
arch/arm/mach-rockchip/Kconfig +14 -0
index 5064ba5..bf01395 100644
@@ -114,6 +114,7 @@ config ROCKCHIP_RK3399
 	select SPL_DRIVERS_MISC_SUPPORT
 	select ENABLE_ARM_SOC_BOOT0_HOOK
 	select DEBUG_UART_BOARD_INIT
+	select BOARD_LATE_INIT
 	help
 	  The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
 	  and quad-core Cortex-A53.
@@ -149,6 +150,19 @@ config TPL_ROCKCHIP_BACK_TO_BROM
           SPL will return to the boot rom, which will then load the U-Boot
           binary to keep going on.
 
+config ROCKCHIP_BOOT_MODE_REG
+	hex "Rockchip boot mode flag register address"
+	default 0x200081c8 if ROCKCHIP_RK3036
+	default 0x110005c8 if ROCKCHIP_RK322X
+	default 0xff730094 if ROCKCHIP_RK3288
+	default 0xff738200 if ROCKCHIP_RK3368
+	default 0xff320300 if ROCKCHIP_RK3399
+	default 0x10300580 if ROCKCHIP_RV1108
+	default 0
+	help
+	  The Soc will enter to different boot mode(defined in asm/arch/boot_mode.h)
+	  according to different value of this register.
+
 config ROCKCHIP_SPL_RESERVE_IRAM
 	hex "Size of IRAM reserved in SPL"
 	default 0x4000
arch/arm/mach-rockchip/Makefile +4 -0
index b83f2c0..86ec0e0 100644
@@ -24,10 +24,14 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 obj-$(CONFIG_ROCKCHIP_RESOURCE_IMAGE) += resource_img.o
 obj-$(CONFIG_ROCKCHIP_PARTITION_BOOT) += bootrkp.o
+ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0)
+obj-y += boot_mode.o
+endif
 obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board.o
 obj-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board.o
 obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o
 obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o
+obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board.o
 endif
 
 obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o
arch/arm/mach-rockchip/boot_mode.c new file +33 -0
new file mode 100644
index 0000000..4652490
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/boot_mode.h>
+
+int setup_boot_mode(void)
+{
+	void *reg = (void *)CONFIG_ROCKCHIP_BOOT_MODE_REG;
+	int boot_mode = readl(reg);
+
+	debug("boot mode %x.\n", boot_mode);
+
+	/* Clear boot mode */
+	writel(BOOT_NORMAL, reg);
+
+	switch (boot_mode) {
+	case BOOT_FASTBOOT:
+		printf("enter fastboot!\n");
+		env_set("preboot", "setenv preboot; fastboot usb0");
+		break;
+	case BOOT_UMS:
+		printf("enter UMS!\n");
+		env_set("preboot", "setenv preboot; ums mmc 0");
+		break;
+	}
+
+	return 0;
+}
arch/arm/mach-rockchip/rk3036-board.c +0 -24
index a3457f3..a5d2571 100644
@@ -19,30 +19,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GRF_BASE	0x20008000
-
-static void setup_boot_mode(void)
-{
-	struct rk3036_grf *const grf = (void *)GRF_BASE;
-	int boot_mode = readl(&grf->os_reg[4]);
-
-	debug("boot mode %x.\n", boot_mode);
-
-	/* Clear boot mode */
-	writel(BOOT_NORMAL, &grf->os_reg[4]);
-
-	switch (boot_mode) {
-	case BOOT_FASTBOOT:
-		printf("enter fastboot!\n");
-		env_set("preboot", "setenv preboot; fastboot usb0");
-		break;
-	case BOOT_UMS:
-		printf("enter UMS!\n");
-		env_set("preboot", "setenv preboot; ums mmc 0");
-		break;
-	}
-}
-
 __weak int rk_board_late_init(void)
 {
 	return 0;
arch/arm/mach-rockchip/rk322x-board.c +0 -24
index c0ac2e9..3af137e 100644
@@ -15,30 +15,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GRF_BASE	0x11000000
-
-static void setup_boot_mode(void)
-{
-	struct rk322x_grf *const grf = (void *)GRF_BASE;
-	int boot_mode = readl(&grf->os_reg[4]);
-
-	debug("boot mode %x.\n", boot_mode);
-
-	/* Clear boot mode */
-	writel(BOOT_NORMAL, &grf->os_reg[4]);
-
-	switch (boot_mode) {
-	case BOOT_FASTBOOT:
-		printf("enter fastboot!\n");
-		env_set("preboot", "setenv preboot; fastboot usb0");
-		break;
-	case BOOT_UMS:
-		printf("enter UMS!\n");
-		env_set("preboot", "setenv preboot; ums mmc 0");
-		break;
-	}
-}
-
 __weak int rk_board_late_init(void)
 {
 	return 0;
arch/arm/mach-rockchip/rk3288-board.c +0 -25
index 278bb40..1c53cca 100644
@@ -23,31 +23,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define PMU_BASE	0xff730000
-
-static void setup_boot_mode(void)
-{
-	struct rk3288_pmu *const pmu = (void *)PMU_BASE;
-	int boot_mode = readl(&pmu->sys_reg[0]);
-
-	debug("boot mode %x.\n", boot_mode);
-
-	/* Clear boot mode */
-	writel(BOOT_NORMAL, &pmu->sys_reg[0]);
-
-	switch (boot_mode) {
-	case BOOT_FASTBOOT:
-		printf("enter fastboot!\n");
-		env_set("preboot", "setenv preboot; fastboot usb0");
-		break;
-	case BOOT_UMS:
-		printf("enter UMS!\n");
-		env_set("preboot", "setenv preboot; if mmc dev 0;"
-		       "then ums mmc 0; else ums mmc 1;fi");
-		break;
-	}
-}
-
 __weak int rk_board_late_init(void)
 {
 	return 0;
arch/arm/mach-rockchip/rk3399-board.c new file +14 -0
new file mode 100644
index 0000000..9293843
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2017 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/boot_mode.h>
+
+int board_late_init(void)
+{
+	setup_boot_mode();
+	return 0;
+}
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v2 2/3 rockchip: add support for enter to bootrom download mode

In reply to Andy Yan

Rockchip bootrom will enter download mode if it returns from spl/tpl with a non-zero value and couldn't find a valid image in the backup partition.
This patch provide a method to instruct the system to back to bootrom download mode by checking the BROM_DOWNLOAD_FLAG register. As the bootrom download function relys on some modules such as interrupts, so we need to back to bootrom as early as possbile before the tpl/tps code override the interrupt configurations.

---

Changes in v2:
- implement the back to bootrom download mode check in c, thanks for Dr. Philipp Tomsich's suggestion.

 arch/arm/include/asm/arch-rockchip/boot_mode.h |  5 +++++
 arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++++++++++-
 arch/arm/mach-rockchip/Kconfig                 |  1 +
 arch/arm/mach-rockchip/bootrom.c               | 31 +++++++++++++++++++++++++-
 arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++++++++++-------
 5 files changed, 67 insertions(+), 10 deletions(-)
arch/arm/include/asm/arch-rockchip/boot_mode.h +5 -0
index 163b2e7..c2cf6fd 100644
@@ -15,7 +15,12 @@
 #define BOOT_CHARGING		(REBOOT_FLAG + 11)
 /* enter usb mass storage mode */
 #define BOOT_UMS		(REBOOT_FLAG + 12)
+/* enter bootrom download mode */
+#define BOOT_BROM_DOWNLOAD	0xEF08A53C
 
+#ifndef __ASSEMBLY__
 int setup_boot_mode(void);
+void check_back_to_brom_dnl_flag(void);
+#endif
 
 #endif
arch/arm/include/asm/arch-rockchip/bootrom.h +14 -1
index 92eb878..0bdea14 100644
@@ -8,6 +8,16 @@
 #define _ASM_ARCH_BOOTROM_H
 
 /*
+ *@BOOT_CONTINUE: bootrom continue load next stage image and boot.
+ *@BOOT_BROM_DNL, bootrom enter download mode if no valid image
+ *		  found in backup partition.
+ */
+enum {
+	BOOT_BROM_CONTINUE = 0,
+	BOOT_BROM_DNL = 1
+};
+
+/*
  * Saved Stack pointer address.
  * Access might be needed in some special cases.
  */
@@ -21,7 +31,10 @@ void back_to_bootrom(void);
 
 /**
  * Assembler component for the above (do not call this directly)
+ * @mode: BOOT_BROM_CONTINUE, bootrom continue load next stage image and boot;
+ *        BOOT_BROM_DNL, bootrom enter download mode if no valid image
+ *        found in packup partition.
  */
-void _back_to_bootrom_s(void);
+void _back_to_bootrom_s(int mode);
 
 #endif
arch/arm/mach-rockchip/Kconfig +1 -0
index bf01395..2fd9eb2 100644
@@ -113,6 +113,7 @@ config ROCKCHIP_RK3399
 	select SPL_SERIAL_SUPPORT
 	select SPL_DRIVERS_MISC_SUPPORT
 	select ENABLE_ARM_SOC_BOOT0_HOOK
+	select ROCKCHIP_BROM_HELPER
 	select DEBUG_UART_BOARD_INIT
 	select BOARD_LATE_INIT
 	help
arch/arm/mach-rockchip/bootrom.c +30 -1
index 8380e4e..463462c 100644
@@ -5,12 +5,41 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/bootrom.h>
+#include <asm/arch/boot_mode.h>
 
 void back_to_bootrom(void)
 {
 #if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 	puts("Returning to boot ROM...\n");
 #endif
-	_back_to_bootrom_s();
+	_back_to_bootrom_s(BOOT_BROM_CONTINUE);
+}
+
+/*
+ * we back to bootrom download mode if get a
+ * BOOT_BROM_DOWNLOAD flag in boot mode register
+ *
+ * note: (a)the boot mode register is configured by
+ * application(next stage bootloader, kernel, etc),
+ * the bootrom never check this register, so we need
+ * to check it and back at very early bootstage(before
+ * some basic configurations such as interrupts been
+ * changed by TPL/TPL), as the bootrom download operation
+ * relys on many default settings(such as interrupts) by
+ * it's self.
+ *       (b)this function share the sampe SP with bootrom code.
+ */
+void check_back_to_brom_dnl_flag(void)
+{
+	u32 boot_mode;
+
+	if (CONFIG_ROCKCHIP_BOOT_MODE_REG) {
+		boot_mode = readl(CONFIG_ROCKCHIP_BOOT_MODE_REG);
+		if (boot_mode == BOOT_BROM_DOWNLOAD) {
+			writel(0, CONFIG_ROCKCHIP_BOOT_MODE_REG);
+			_back_to_bootrom_s(BOOT_BROM_DNL);
+		}
+	}
 }
arch/arm/mach-rockchip/save_boot_param.S +17 -8
index 50fce20..e8fa10b 100644
@@ -23,14 +23,19 @@ ENTRY(save_boot_params)
 	ldr	x8, =SAVE_SP_ADDR
 	mov	x9, sp
 	str	x9, [x8]
+	bl	check_back_to_brom_dnl_flag
 	b	save_boot_params_ret  /* back to my caller */
 ENDPROC(save_boot_params)
 
+/*
+ * x0: return value for bootrom, non-zero for bootrom download
+ *     mode and zero for normal boot mode
+ */
 .globl _back_to_bootrom_s
 ENTRY(_back_to_bootrom_s)
-	ldr	x0, =SAVE_SP_ADDR
-	ldr	x0, [x0]
-	mov	sp, x0
+	ldr	x1, =SAVE_SP_ADDR
+	ldr	x1, [x1]
+	mov	sp, x1
 	ldp	x29, x30, [sp, #0x50]
 	ldp	x27, x28, [sp, #0x40]
 	ldp	x25, x26, [sp, #0x30]
@@ -38,7 +43,6 @@ ENTRY(_back_to_bootrom_s)
 	ldp	x21, x22, [sp, #0x10]
 	ldp	x19, x20, [sp]
 	add	sp, sp, #0x60
-	mov	x0, xzr
 	ret
 ENDPROC(_back_to_bootrom_s)
 #else
@@ -55,15 +59,20 @@ ENTRY(save_boot_params)
 	push	{r1-r12, lr}
 	ldr	r0, =SAVE_SP_ADDR
 	str	sp, [r0]
-	b	save_boot_params_ret		@ back to my caller
+	bl	check_back_to_brom_dnl_flag
+	b       save_boot_params_ret            @ back to my caller
 ENDPROC(save_boot_params)
 
 
+/*
+ * r0: return value for bootrom, non-zero for
+ *     bootrom download mode and zero for normal
+ *     boot mode
+ */
 .globl _back_to_bootrom_s
 ENTRY(_back_to_bootrom_s)
-	ldr	r0, =SAVE_SP_ADDR
-	ldr	sp, [r0]
-	mov	r0, #0
+	ldr	r1, =SAVE_SP_ADDR
+	ldr	sp, [r1]
 	pop	{r1-r12, pc}
 ENDPROC(_back_to_bootrom_s)
 #endif
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH v2 3/3 rockchip: check download key before bootup

In reply to Andy Yan

Enter download mode if the download key pressed.

---

Changes in v2:
- more document
- move adc key detect as the defaut

 arch/arm/mach-rockchip/boot_mode.c | 43 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/mach-rockchip/boot_mode.c +43 -0
index 4652490..bf0a410 100644
@@ -5,14 +5,57 @@
  */
 
 #include <common.h>
+#include <adc.h>
 #include <asm/io.h>
 #include <asm/arch/boot_mode.h>
 
+void set_back_to_bootrom_dnl_flag(void)
+{
+	writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG);
+}
+
+/*
+ * detect download key status by adc, most rockchip
+ * based boards use adc sample the download key status,
+ * but there are also some use gpio. So it's better to
+ * make this a weak function that can be override by
+ * some special boards.
+ */
+#define KEY_DOWN_MIN_VAL	0
+#define KEY_DOWN_MAX_VAL	30
+
+__weak int rockchip_dnl_key_pressed(void)
+{
+	unsigned int val;
+
+	if (adc_channel_single_shot("saradc", 1, &val)) {
+		printf("%s adc_channel_single_shot fail!\n", __func__);
+		return false;
+	}
+
+	if ((val >= KEY_DOWN_MIN_VAL) && (val <= KEY_DOWN_MAX_VAL))
+		return true;
+	else
+		return false;
+}
+
+void rockchip_dnl_mode_check(void)
+{
+	if (rockchip_dnl_key_pressed()) {
+		printf("download key pressed, entering download mode...");
+		set_back_to_bootrom_dnl_flag();
+		do_reset(NULL, 0, 0, NULL);
+	}
+}
+
 int setup_boot_mode(void)
 {
 	void *reg = (void *)CONFIG_ROCKCHIP_BOOT_MODE_REG;
 	int boot_mode = readl(reg);
 
+	rockchip_dnl_mode_check();
+
+	boot_mode = readl(reg);
 	debug("boot mode %x.\n", boot_mode);
 
 	/* Clear boot mode */
Signature · 1 line
2.7.4
#4 lore raw

v2 cover support enter download mode on rockchip platform

In reply to Andy Yan

Andy,

Quoted 6 lines · Andy Yan

Most rockchip platform based boards use a key to instruct the board enter download firmware mode, some boards use a adc to detect the key status, and some use a gpio.

I just sent out a series that updates the back-to-bootrom to be written entirely as C-code.

I’d appreciate if you could review and also modify your changes to apply cleanly on top of that one (e.g. save_boot_params.S is gone, so you will be able to add your call to check for the download key in bootrom.c).

The plan would be to apply first the “rewrite in C” changes and then your “download mode” changes on-top.
If possible, I’d like to get this into next week’s changes and put a PR with both out by the end of next week…

Regards,
Philipp.

Quoted 35 lines

This series try to implement all the download mode related functions.

Changes in v2:
- correct the rk322x boot mode register address
- make the help text more clear
- implement the back to bootrom download mode check in c, thanks for Dr. Philipp Tomsich's suggestion.
- more document
- move adc key detect as the defaut

Andy Yan (3):
rockchip: make boot_mode related codes reused across all platforms
rockchip: add support for enter to bootrom download mode
rockchip: check download key before bootup

arch/arm/include/asm/arch-rockchip/boot_mode.h |  7 +++
arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++-
arch/arm/mach-rockchip/Kconfig                 | 15 +++++
arch/arm/mach-rockchip/Makefile                |  4 ++
arch/arm/mach-rockchip/boot_mode.c             | 76 ++++++++++++++++++++++++++
arch/arm/mach-rockchip/bootrom.c               | 31 ++++++++++-
arch/arm/mach-rockchip/rk3036-board.c          | 24 --------
arch/arm/mach-rockchip/rk322x-board.c          | 24 --------
arch/arm/mach-rockchip/rk3288-board.c          | 25 ---------
arch/arm/mach-rockchip/rk3399-board.c          | 14 +++++
arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++---
11 files changed, 177 insertions(+), 83 deletions(-)

create mode 100644 arch/arm/mach-rockchip/boot_mode.c create mode 100644 arch/arm/mach-rockchip/rk3399-board.c

Signature · 1 line
2.7.4
#5 lore raw

v2 cover support enter download mode on rockchip platform

Hi Philipp:

2017-09-15 20:07 GMT+08:00 Dr. Philipp Tomsich <
[email protected]>:

Quoted 9 lines

Andy,

Quoted 6 lines · Andy Yan

Most rockchip platform based boards use a key to instruct the board enter download firmware mode, some boards use a adc to detect the key status, and some use a gpio.

Quoted 8 lines

I just sent out a series that updates the back-to-bootrom to be written entirely as C-code.

I’d appreciate if you could review and also modify your changes to apply cleanly on top of that one (e.g. save_boot_params.S is gone, so you will be able to add your call to check for the download key in bootrom.c).

Thanks very much for the excellent work, I just need a little time to understand - review and test your patch on more platforms. And I will send a new version on the top of your patch next Monday.

Quoted 52 lines

The plan would be to apply first the “rewrite in C” changes and then your “download mode” changes on-top.
If possible, I’d like to get this into next week’s changes and put a PR with both out by the end of next week…

Regards,
Philipp.

Quoted 8 lines

This series try to implement all the download mode related functions.

Changes in v2:
- correct the rk322x boot mode register address
- make the help text more clear
- implement the back to bootrom download mode check in c, thanks for Dr.

Philipp Tomsich's suggestion.

Quoted 8 lines

- more document
- move adc key detect as the defaut

Andy Yan (3):
rockchip: make boot_mode related codes reused across all platforms
rockchip: add support for enter to bootrom download mode
rockchip: check download key before bootup

Quoted 5 lines
arch/arm/include/asm/arch-rockchip/boot_mode.h |  7 +++
arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++-
arch/arm/mach-rockchip/Kconfig                 | 15 +++++
arch/arm/mach-rockchip/Makefile                |  4 ++
arch/arm/mach-rockchip/boot_mode.c             | 76

++++++++++++++++++++++++++

Quoted 7 lines
arch/arm/mach-rockchip/bootrom.c               | 31 ++++++++++-
arch/arm/mach-rockchip/rk3036-board.c          | 24 --------
arch/arm/mach-rockchip/rk322x-board.c          | 24 --------
arch/arm/mach-rockchip/rk3288-board.c          | 25 ---------
arch/arm/mach-rockchip/rk3399-board.c          | 14 +++++
arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++---
11 files changed, 177 insertions(+), 83 deletions(-)
Quoted 7 lines

create mode 100644 arch/arm/mach-rockchip/boot_mode.c create mode 100644 arch/arm/mach-rockchip/rk3399-board.c

--
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#6 lore raw

v2 cover support enter download mode on rockchip platform

Andy,

Quoted 17 lines · Andy Yan

Hi Philipp:

2017-09-15 20:07 GMT+08:00 Dr. Philipp Tomsich <philipp.tomsich at theobroma-systems.com <mailto:[email protected]>>:
Andy,

Quoted 6 lines · On 14 Sep 2017, at 10:51, Andy Yan <andy.yan at rock-chips.com…

Most rockchip platform based boards use a key to instruct the board enter download firmware mode, some boards use a adc to detect the key status, and some use a gpio.

I just sent out a series that updates the back-to-bootrom to be written entirely as C-code.

Quoted 8 lines

I’d appreciate if you could review and also modify your changes to apply cleanly on top of that one (e.g. save_boot_params.S is gone, so you will be able to add your call to check for the download key in bootrom.c).

Thanks very much for the excellent work, I just need a little time to understand - review and test your patch on more platforms. And I will send a new version on the top of your patch next Monday.

Take your time: I’d rather have this fully tested and merge it a week (or even a few weeks) later to allow for the testing.

If there’s a problem with my series, let me know and I’ll take another look.

Quoted 49 lines

The plan would be to apply first the “rewrite in C” changes and then your “download mode” changes on-top.
If possible, I’d like to get this into next week’s changes and put a PR with both out by the end of next week…

Regards,
Philipp.

Quoted 28 lines

This series try to implement all the download mode related functions.

Changes in v2:
- correct the rk322x boot mode register address
- make the help text more clear
- implement the back to bootrom download mode check in c, thanks for Dr. Philipp Tomsich's suggestion.
- more document
- move adc key detect as the defaut

Andy Yan (3):
rockchip: make boot_mode related codes reused across all platforms
rockchip: add support for enter to bootrom download mode
rockchip: check download key before bootup

arch/arm/include/asm/arch-rockchip/boot_mode.h |  7 +++
arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++-
arch/arm/mach-rockchip/Kconfig                 | 15 +++++
arch/arm/mach-rockchip/Makefile                |  4 ++
arch/arm/mach-rockchip/boot_mode.c             | 76 ++++++++++++++++++++++++++
arch/arm/mach-rockchip/bootrom.c               | 31 ++++++++++-
arch/arm/mach-rockchip/rk3036-board.c          | 24 --------
arch/arm/mach-rockchip/rk322x-board.c          | 24 --------
arch/arm/mach-rockchip/rk3288-board.c          | 25 ---------
arch/arm/mach-rockchip/rk3399-board.c          | 14 +++++
arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++---
11 files changed, 177 insertions(+), 83 deletions(-)
Quoted 7 lines

create mode 100644 arch/arm/mach-rockchip/boot_mode.c create mode 100644 arch/arm/mach-rockchip/rk3399-board.c

--
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de <mailto:[email protected]>
https://lists.denx.de/listinfo/u-boot <https://lists.denx.de/listinfo/u-boot>