Skip to contentSkip to conversation

rk3288: tinker: Add TPL support

PATCH New Jagan Teki 3 participants 9 messages Nov 3, 2017 – Nov 20, 2017

Subsystems (3)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/2 rk3288: tinker: Add TPL support

Since the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add new SPL features like Falcon mode or etc.

So add TPL stage so-that adding new features to SPL is possible.
- TPL: DRAM init, clocks
- SPL: MMC, falcon, etc

---
 arch/arm/mach-rockchip/rk3288/Kconfig | 16 ++++++++++++++++
 configs/tinker-rk3288_defconfig       |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/rk3288/Kconfig +16 -0
index 6beb26f..0b6df17 100644
@@ -121,6 +121,22 @@ config TARGET_ROCK2
 config TARGET_TINKER_RK3288
 	bool "Tinker-RK3288"
         select BOARD_LATE_INIT
+	select TPL
+	select SUPPORT_TPL
+	select TPL_DM
+	select TPL_REGMAP
+	select TPL_SYSCON
+	select TPL_CLK
+	select TPL_RAM
+	select TPL_OF_PLATDATA
+	select TPL_OF_CONTROL
+	select TPL_BOOTROM_SUPPORT
+	select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
+	select ROCKCHIP_BROM_HELPER
+	select TPL_DRIVERS_MISC_SUPPORT
+	select TPL_LIBCOMMON_SUPPORT
+	select TPL_LIBGENERIC_SUPPORT
+	select TPL_SERIAL_SUPPORT
 	help
 	  Tinker is a RK3288-based development board with 2 USB ports, HDMI,
 	  micro-SD card, audio, Gigabit Ethernet. It also includes on-board
configs/tinker-rk3288_defconfig +3 -1
index 1315be3..e6bd4f3 100644
@@ -1,9 +1,11 @@
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ROCKCHIP_RK3288=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_TINKER_RK3288=y
+CONFIG_TPL_TEXT_BASE=0xff704004
 CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-tinker"
 CONFIG_DEBUG_UART=y
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 rk3288: tinker: Add falcon mode support

Add Falcon mode support in tinker rk3288 board.

---
Note:
This patch[1] need to work falcon

[1] https://patchwork.ozlabs.org/patch/833821/

 board/rockchip/tinker_rk3288/tinker-rk3288.c | 13 +++++++++++++
 include/configs/tinker_rk3288.h              | 16 ++++++++++++++++
 2 files changed, 29 insertions(+)
board/rockchip/tinker_rk3288/tinker-rk3288.c +13 -0
index 790a921..48e0c41 100644
@@ -9,6 +9,19 @@
 #include <i2c_eeprom.h>
 #include <netdev.h>
 
+#ifndef CONFIG_TPL_BUILD
+#include <spl.h>
+
+int spl_start_uboot(void)
+{
+        /* break into full u-boot on 'c' */
+        if (serial_tstc() && serial_getc() == 'c')
+                return 1;
+
+        return 0;
+}
+#endif
+
 static int get_ethaddr_from_eeprom(u8 *addr)
 {
 	int ret;
include/configs/tinker_rk3288.h +16 -0
index 58eea3c..6d4f271 100644
@@ -20,4 +20,20 @@
 
 #define CONFIG_SYS_MMC_ENV_DEV 1
 
+#ifndef CONFIG_TPL_BUILD
+#define CONFIG_SPL_OS_BOOT
+
+/* Falcon Mode */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME	"args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR	0x0ffe5000
+#define CONFIG_CMD_SPL_WRITE_SIZE      (128 * SZ_1K)
+
+/* Falcon Mode - MMC support: args at 1MB kernel at 2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x1000  /* 2MB */
+#endif
+
 #endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 rk3288: tinker: Add falcon mode support

Quoted 7 lines

Add Falcon mode support in tinker rk3288 board.

---
Note:
This patch[1] need to work falcon

Quoted 6 lines

[1] https://patchwork.ozlabs.org/patch/833821/

 board/rockchip/tinker_rk3288/tinker-rk3288.c | 13 +++++++++++++
 include/configs/tinker_rk3288.h              | 16 ++++++++++++++++
 2 files changed, 29 insertions(+)
#3 lore raw

PATCH 2/2 rk3288: tinker: Add falcon mode support

In reply to Jagan Teki
Quoted 4 lines · Jagan Teki

Add Falcon mode support in tinker rk3288 board.

See below for requested changes.

Quoted 15 lines

---
Note:
This patch[1] need to work falcon

[1] https://patchwork.ozlabs.org/patch/833821/

board/rockchip/tinker_rk3288/tinker-rk3288.c | 13 +++++++++++++
include/configs/tinker_rk3288.h | 16 ++++++++++++++++

2 files changed, 29 insertions(+)
board/rockchip/tinker_rk3288/tinker-rk3288.c +0 -0
index 790a921..48e0c41 100644

board/rockchip/tinker_rk3288/tinker-rk3288.c line 13

Quoted 5 lines
board/rockchip/tinker_rk3288/tinker-rk3288.c +2 -0
@@ -9,6 +9,19 @@
 #include <i2c_eeprom.h>
 #include <netdev.h>
 
+#ifndef CONFIG_TPL_BUILD
+#include <spl.h>

Please keep this with the include statements above and make the #include unconditional.

Quoted 40 lines
board/rockchip/tinker_rk3288/tinker-rk3288.c +11 -0
+
+int spl_start_uboot(void)
+{
+        /* break into full u-boot on 'c' */
+        if (serial_tstc() && serial_getc() == 'c')
+                return 1;
+
+        return 0;
+}
+#endif
+
 static int get_ethaddr_from_eeprom(u8 *addr)
 {
 	int ret;
include/configs/tinker_rk3288.h +16 -0
index 58eea3c..6d4f271 100644
@@ -20,4 +20,20 @@
 
 #define CONFIG_SYS_MMC_ENV_DEV 1
 
+#ifndef CONFIG_TPL_BUILD
+#define CONFIG_SPL_OS_BOOT
+
+/* Falcon Mode */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME	"args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR	0x0ffe5000
+#define CONFIG_CMD_SPL_WRITE_SIZE      (128 * SZ_1K)
+
+/* Falcon Mode - MMC support: args at 1MB kernel at 2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x1000  /* 2MB */
+#endif
+
 #endif
#4 lore raw

PATCH 2/2 rk3288: tinker: Add falcon mode support

In reply to Jagan Teki
Quoted 9 lines

Add Falcon mode support in tinker rk3288 board.

---
Note:
This patch[1] need to work falcon

Quoted 6 lines

[1] https://patchwork.ozlabs.org/patch/833821/

 board/rockchip/tinker_rk3288/tinker-rk3288.c | 13 +++++++++++++
 include/configs/tinker_rk3288.h              | 16 ++++++++++++++++
 2 files changed, 29 insertions(+)
#5 lore raw

PATCH 2/2 rk3288: tinker: Add falcon mode support

In reply to Jagan Teki

Hi Jagan,

Quoted 2 lines · Jagan Teki

Add Falcon mode support in tinker rk3288 board.

This is fine, but why do you want to use this mode?

Quoted 10 lines

---
Note:
This patch[1] need to work falcon

[1] https://patchwork.ozlabs.org/patch/833821/

 board/rockchip/tinker_rk3288/tinker-rk3288.c | 13 +++++++++++++
 include/configs/tinker_rk3288.h              | 16 ++++++++++++++++
 2 files changed, 29 insertions(+)

Regards,
Simon

#6 lore raw

PATCH 1/2 rk3288: tinker: Add TPL support

In reply to Jagan Teki
Quoted 7 lines

Since the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add new SPL features like Falcon mode or etc.

So add TPL stage so-that adding new features to SPL is possible.
- TPL: DRAM init, clocks
- SPL: MMC, falcon, etc

Quoted 6 lines
---
 arch/arm/mach-rockchip/rk3288/Kconfig | 16 ++++++++++++++++
 configs/tinker-rk3288_defconfig       |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)
#7 lore raw

PATCH 1/2 rk3288: tinker: Add TPL support

In reply to Jagan Teki
Quoted 7 lines

Since the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add new SPL features like Falcon mode or etc.

So add TPL stage so-that adding new features to SPL is possible.
- TPL: DRAM init, clocks
- SPL: MMC, falcon, etc

Quoted 7 lines
---
 arch/arm/mach-rockchip/rk3288/Kconfig | 16 ++++++++++++++++
 configs/tinker-rk3288_defconfig       |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)
#8 lore raw

PATCH 1/2 rk3288: tinker: Add TPL support

In reply to Jagan Teki
Quoted 7 lines

Since the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add new SPL features like Falcon mode or etc.

So add TPL stage so-that adding new features to SPL is possible.
- TPL: DRAM init, clocks
- SPL: MMC, falcon, etc

Quoted 8 lines
---
 arch/arm/mach-rockchip/rk3288/Kconfig | 16 ++++++++++++++++
 configs/tinker-rk3288_defconfig       |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)