Skip to contentSkip to conversation

rk3288: Falcon mode support

PATCH New Chakra Divi 2 participants 16 messages Sep 27, 2017 – Sep 29, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover rk3288: Falcon mode support

From: Jagan Teki <[email protected]>

Updated with fixing previous version changes.

Hi Philipp,
TPL working fine but Falcon mode is not working in latest master
- hang at mmc read [1] with CMD 12, hoping that Debug uart not printing further on console.

Let me know if you find any, same patches work fine on previous version with sha1 [2]

[1] https://paste.ubuntu.com/25625484/
[2] ef8452f871afd8cb116fa96c8db2fe6260538319

Jagan Teki (5):
armv7: Move L2CTLR read/write to common
armv7: rk3288: Move configure_l2ctlr to common
rk3288: vyasa: Add TPL support
rk3288: vyasa: Add falcon mode support
rk3288: spl: Add dram_init_banksize

 arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++++++
 arch/arm/include/asm/armv7.h                   | 21 +++++++
 arch/arm/mach-rockchip/Makefile                |  1 +
 arch/arm/mach-rockchip/rk3288-board-spl.c      | 61 +++++++------------
 arch/arm/mach-rockchip/rk3288-board-tpl.c      | 84 ++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288/Kconfig          | 16 +++++
 arch/arm/mach-tegra/cache.c                    |  5 +-
 board/amarula/vyasa-rk3288/vyasa-rk3288.c      | 13 ++++
 configs/vyasa-rk3288_defconfig                 |  3 +
 doc/README.rockchip                            | 18 ++++++
 include/configs/rk3288_common.h                |  6 +-
 include/configs/vyasa-rk3288.h                 | 17 ++++++
 12 files changed, 225 insertions(+), 43 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3288-board-tpl.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/5 armv7: Move L2CTLR read/write to common

From: Jagan Teki <[email protected]>

L2CTLR read/write functions are common to armv7 so, move them in to include/asm/armv7.h and use them where ever it need.

---
Changes for v2:
- New patch

 arch/arm/include/asm/armv7.h              | 21 +++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +---------------------
 arch/arm/mach-tegra/cache.c               |  5 +++--
 3 files changed, 25 insertions(+), 23 deletions(-)
arch/arm/include/asm/armv7.h +21 -0
index a20702e..efc515e 100644
@@ -61,6 +61,27 @@
 #include <asm/io.h>
 #include <asm/barriers.h>
 
+/* read L2 control register (L2CTLR) */
+static inline uint32_t read_l2ctlr(void)
+{
+	uint32_t val = 0;
+
+	asm volatile ("mrc p15, 1, %0, c9, c0, 2" : "=r" (val));
+
+	return val;
+}
+
+/* write L2 control register (L2CTLR) */
+static inline void write_l2ctlr(uint32_t val)
+{
+	/*
+	 * Note: L2CTLR can only be written when the L2 memory system
+	 * is idle, ie before the MMU is enabled.
+	 */
+	asm volatile("mcr p15, 1, %0, c9, c0, 2" : : "r" (val) : "memory");
+	isb();
+}
+
 /*
  * Workaround for ARM errata # 798870
  * Set L2ACTLR[7] to reissue any memory transaction in the L2 that has been
arch/arm/mach-rockchip/rk3288-board-spl.c +1 -21
index 6b7bf85..8a1066c 100644
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <ram.h>
 #include <spl.h>
+#include <asm/armv7.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/bootrom.h>
@@ -80,27 +81,6 @@ u32 spl_boot_mode(const u32 boot_device)
 	return MMCSD_MODE_RAW;
 }
 
-/* read L2 control register (L2CTLR) */
-static inline uint32_t read_l2ctlr(void)
-{
-	uint32_t val = 0;
-
-	asm volatile ("mrc p15, 1, %0, c9, c0, 2" : "=r" (val));
-
-	return val;
-}
-
-/* write L2 control register (L2CTLR) */
-static inline void write_l2ctlr(uint32_t val)
-{
-	/*
-	 * Note: L2CTLR can only be written when the L2 memory system
-	 * is idle, ie before the MMU is enabled.
-	 */
-	asm volatile("mcr p15, 1, %0, c9, c0, 2" : : "r" (val) : "memory");
-	isb();
-}
-
 static void configure_l2ctlr(void)
 {
 	uint32_t l2ctlr;
arch/arm/mach-tegra/cache.c +3 -2
index 6dad403..2f3f822 100644
@@ -7,6 +7,7 @@
 /* Tegra cache routines */
 
 #include <common.h>
+#include <asm/armv7.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/ap.h>
 #include <asm/arch/gp_padctrl.h>
@@ -30,9 +31,9 @@ void config_cache(void)
 	 * Systems with an architectural L2 cache must not use the PL310.
 	 * Config L2CTLR here for a data RAM latency of 3 cycles.
 	 */
-	asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	reg = read_l2ctlr();
 	reg &= ~7;
 	reg |= 2;
-	asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	write_l2ctlr(reg);
 }
 #endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/5 armv7: Move L2CTLR read/write to common

Quoted 7 lines

From: Jagan Teki <[email protected]>

L2CTLR read/write functions are common to armv7 so, move them in to include/asm/armv7.h and use them where ever it need.

Quoted 9 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/armv7.h              | 21 +++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +---------------------
 arch/arm/mach-tegra/cache.c               |  5 +++--
 3 files changed, 25 insertions(+), 23 deletions(-)
#3 lore raw

PATCH v2 1/5 armv7: Move L2CTLR read/write to common

In reply to Chakra Divi
Quoted 7 lines

From: Jagan Teki <[email protected]>

L2CTLR read/write functions are common to armv7 so, move them in to include/asm/armv7.h and use them where ever it need.

Quoted 9 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/armv7.h              | 21 +++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +---------------------
 arch/arm/mach-tegra/cache.c               |  5 +++--
 3 files changed, 25 insertions(+), 23 deletions(-)
#4 lore raw

PATCH v2 1/5 armv7: Move L2CTLR read/write to common

In reply to Chakra Divi
Quoted 9 lines

From: Jagan Teki <[email protected]>

L2CTLR read/write functions are common to armv7 so, move them in to include/asm/armv7.h and use them where ever it need.

Quoted 9 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/armv7.h              | 21 +++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +---------------------
 arch/arm/mach-tegra/cache.c               |  5 +++--
 3 files changed, 25 insertions(+), 23 deletions(-)

Applied to u-boot-rockchip, thanks!

#5 lore raw

PATCH v2 2/5 armv7: rk3288: Move configure_l2ctlr to common

In reply to Chakra Divi

From: Jagan Teki <[email protected]>

configure_l2ctlr will be shared between SPL and TPL so move them into asm/arch/sys_proto.h

---
Changes for v2:
- New patch

 arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c      | 21 +--------------------
 2 files changed, 24 insertions(+), 20 deletions(-)
arch/arm/include/asm/arch-rockchip/sys_proto.h +23 -0
index 35423e1..e428d59 100644
@@ -7,4 +7,27 @@
 #ifndef _ASM_ARCH_SYS_PROTO_H
 #define _ASM_ARCH_SYS_PROTO_H
 
+#ifdef CONFIG_ROCKCHIP_RK3288
+#include <asm/armv7.h>
+
+static void configure_l2ctlr(void)
+{
+	uint32_t l2ctlr;
+
+	l2ctlr = read_l2ctlr();
+	l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */
+
+	/*
+	* Data RAM write latency: 2 cycles
+	* Data RAM read latency: 2 cycles
+	* Data RAM setup latency: 1 cycle
+	* Tag RAM write latency: 1 cycle
+	* Tag RAM read latency: 1 cycle
+	* Tag RAM setup latency: 1 cycle
+	*/
+	l2ctlr |= (1 << 3 | 1 << 0);
+	write_l2ctlr(l2ctlr);
+}
+#endif /* CONFIG_ROCKCHIP_RK3288 */
+
 #endif /* _ASM_ARCH_SYS_PROTO_H */
arch/arm/mach-rockchip/rk3288-board-spl.c +1 -20
index 8a1066c..23af653 100644
@@ -13,7 +13,6 @@
 #include <malloc.h>
 #include <ram.h>
 #include <spl.h>
-#include <asm/armv7.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/bootrom.h>
@@ -21,6 +20,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
 #include <asm/arch/sdram.h>
+#include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 #include <dm/pinctrl.h>
 #include <dm/root.h>
@@ -81,25 +81,6 @@ u32 spl_boot_mode(const u32 boot_device)
 	return MMCSD_MODE_RAW;
 }
 
-static void configure_l2ctlr(void)
-{
-	uint32_t l2ctlr;
-
-	l2ctlr = read_l2ctlr();
-	l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */
-
-	/*
-	* Data RAM write latency: 2 cycles
-	* Data RAM read latency: 2 cycles
-	* Data RAM setup latency: 1 cycle
-	* Tag RAM write latency: 1 cycle
-	* Tag RAM read latency: 1 cycle
-	* Tag RAM setup latency: 1 cycle
-	*/
-	l2ctlr |= (1 << 3 | 1 << 0);
-	write_l2ctlr(l2ctlr);
-}
-
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 2/5 armv7: rk3288: Move configure_l2ctlr to common

Quoted 5 lines

From: Jagan Teki <[email protected]>

configure_l2ctlr will be shared between SPL and TPL so move them into asm/arch/sys_proto.h

Quoted 9 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c      | 21 +--------------------
 2 files changed, 24 insertions(+), 20 deletions(-)
#7 lore raw

PATCH v2 2/5 armv7: rk3288: Move configure_l2ctlr to common

In reply to Chakra Divi
Quoted 5 lines

From: Jagan Teki <[email protected]>

configure_l2ctlr will be shared between SPL and TPL so move them into asm/arch/sys_proto.h

Quoted 9 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c      | 21 +--------------------
 2 files changed, 24 insertions(+), 20 deletions(-)
#8 lore raw

PATCH v2 2/5 armv7: rk3288: Move configure_l2ctlr to common

In reply to Chakra Divi
Quoted 8 lines

From: Jagan Teki <[email protected]>

configure_l2ctlr will be shared between SPL and TPL so move them into asm/arch/sys_proto.h

Quoted 8 lines

---
Changes for v2:
- New patch

 arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288-board-spl.c      | 21 +--------------------
 2 files changed, 24 insertions(+), 20 deletions(-)

Applied to u-boot-rockchip, thanks!

#9 lore raw

PATCH v2 3/5 rk3288: vyasa: Add TPL support

In reply to Chakra Divi

From: Jagan Teki <[email protected]>

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

---
Changes for v2:
- Drop console output from commit message
- Updated licence note
- Moved read/write L2CTRL and configure_l2ctlr to common
- Moved debug header in include files list
- Moved preprocessor macro to top
Note:
Idea is not to build this in SPL when TPL enabled, so CONFIG_SUPPORT_TPL work that case.

 arch/arm/mach-rockchip/Makefile           |  1 +
 arch/arm/mach-rockchip/rk3288-board-spl.c |  3 ++
 arch/arm/mach-rockchip/rk3288-board-tpl.c | 84 +++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288/Kconfig     | 16 ++++++
 configs/vyasa-rk3288_defconfig            |  3 ++
 doc/README.rockchip                       | 18 +++++++
 include/configs/rk3288_common.h           |  6 ++-
 7 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-rockchip/rk3288-board-tpl.c
arch/arm/mach-rockchip/Makefile +1 -0
index 79e9704..daafc8d 100644
@@ -12,6 +12,7 @@ obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o
 obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o
 
 obj-tpl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.o
+obj-tpl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-tpl.o
 obj-tpl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
arch/arm/mach-rockchip/rk3288-board-spl.c +3 -0
index 23af653..5239cbc 100644
@@ -204,12 +204,15 @@ void board_init_f(ulong dummy)
 	}
 #endif
 
+#if !defined(CONFIG_SUPPORT_TPL)
 	debug("\nspl:init dram\n");
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
 		debug("DRAM init failed: %d\n", ret);
 		return;
 	}
+#endif
+
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
 	back_to_bootrom();
 #endif
arch/arm/mach-rockchip/rk3288-board-tpl.c new file +84 -0

84 lines not on this page · raw message

arch/arm/mach-rockchip/rk3288/Kconfig +16 -0
index 4ad2940..6beb26f 100644
@@ -87,6 +87,22 @@ config TARGET_POPMETAL_RK3288
 config TARGET_VYASA_RK3288
 	bool "Vyasa-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
 	  Vyasa is a RK3288-based development board with 2 USB ports,
 	  HDMI, VGA, micro-SD card, audio, WiFi  and Gigabit Ethernet, It
configs/vyasa-rk3288_defconfig +3 -0
index 7db7b0b..7bd6068 100644
@@ -1,8 +1,11 @@
 CONFIG_ARM=y
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_VYASA_RK3288=y
+CONFIG_TPL_TEXT_BASE=0xff704004
 CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-vyasa"
 CONFIG_DEBUG_UART=y
doc/README.rockchip +18 -0
index 12fec38..4b7be0b 100644
@@ -150,6 +150,24 @@ Note: rk3036 SDMMC and debug uart use the same iomux, so if you boot from SD, th
       debug uart must be disabled
 
 
+Booting from an SD card on RK3288 with TPL
+==========================================
+
+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 introduce TPL so-that adding new features to SPL is possible because now TPL should
+run minimal with code like DDR, clock etc and rest of new features in SPL.
+
+As of now TPL is added on Vyasa-RK3288 board.
+
+To write an image that boots from an SD card (assumed to be /dev/mmcblk0):
+
+   ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out &&
+    cat ./spl/u-boot-spl-dtb.bin >> out &&
+    sudo dd if=out of=/dev/mmcblk0 seek=64 &&
+    sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=256
+
 Booting from an SD card on RK3188
 =================================
 
include/configs/rk3288_common.h +5 -1
index e9e3c40..34f2558 100644
@@ -32,7 +32,11 @@
 #define CONFIG_SYS_INIT_SP_ADDR		0x00100000
 #define CONFIG_SYS_LOAD_ADDR		0x00800800
 #define CONFIG_SPL_STACK		0xff718000
-#define CONFIG_SPL_TEXT_BASE		0xff704004
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TPL_BOOTROM_SUPPORT)
+# define CONFIG_SPL_TEXT_BASE		0x0
+#else
+# define CONFIG_SPL_TEXT_BASE		0xff704004
+#endif
 
 /* MMC/SD IP block */
 #define CONFIG_BOUNCE_BUFFER
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 3/5 rk3288: vyasa: Add TPL support

Quoted 22 lines

From: Jagan Teki <[email protected]>

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

---
Changes for v2:
- Drop console output from commit message
- Updated licence note
- Moved read/write L2CTRL and configure_l2ctlr to common
- Moved debug header in include files list
- Moved preprocessor macro to top
Note:
Idea is not to build this in SPL when TPL enabled, so CONFIG_SUPPORT_TPL work that case.

Quoted 10 lines
 arch/arm/mach-rockchip/Makefile           |  1 +
 arch/arm/mach-rockchip/rk3288-board-spl.c |  3 ++
 arch/arm/mach-rockchip/rk3288-board-tpl.c | 84 +++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288/Kconfig     | 16 ++++++
 configs/vyasa-rk3288_defconfig            |  3 ++
 doc/README.rockchip                       | 18 +++++++
 include/configs/rk3288_common.h           |  6 ++-
 7 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-rockchip/rk3288-board-tpl.c
#11 lore raw

PATCH v2 3/5 rk3288: vyasa: Add TPL support

In reply to Chakra Divi
Quoted 23 lines

From: Jagan Teki <[email protected]>

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

---
Changes for v2:
- Drop console output from commit message
- Updated licence note
- Moved read/write L2CTRL and configure_l2ctlr to common
- Moved debug header in include files list
- Moved preprocessor macro to top
Note:
Idea is not to build this in SPL when TPL enabled, so CONFIG_SUPPORT_TPL work that case.

Quoted 10 lines
 arch/arm/mach-rockchip/Makefile           |  1 +
 arch/arm/mach-rockchip/rk3288-board-spl.c |  3 ++
 arch/arm/mach-rockchip/rk3288-board-tpl.c | 84 +++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3288/Kconfig     | 16 ++++++
 configs/vyasa-rk3288_defconfig            |  3 ++
 doc/README.rockchip                       | 18 +++++++
 include/configs/rk3288_common.h           |  6 ++-
 7 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-rockchip/rk3288-board-tpl.c

Applied to u-boot-rockchip, thanks!

#12 lore raw

PATCH v2 4/5 rk3288: vyasa: Add falcon mode support

In reply to Chakra Divi

From: Jagan Teki <[email protected]>

Add Falcon mode support in vyasa rk3288 board.

---
Changes for v2:
- none

 board/amarula/vyasa-rk3288/vyasa-rk3288.c | 13 +++++++++++++
 include/configs/vyasa-rk3288.h            | 17 +++++++++++++++++
 2 files changed, 30 insertions(+)
board/amarula/vyasa-rk3288/vyasa-rk3288.c +13 -0
index ceee42c..7985671 100644
@@ -5,3 +5,16 @@
  */
 
 #include <common.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
include/configs/vyasa-rk3288.h +17 -0
index 9d6c80f..8774e42 100644
@@ -20,4 +20,21 @@
 #define CONFIG_SYS_MMC_ENV_DEV 1
 #undef CONFIG_CMD_USB_MASS_STORAGE
 
+#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
#13 lore raw

PATCH v2 4/5 rk3288: vyasa: Add falcon mode support

Quoted 7 lines

From: Jagan Teki <[email protected]>

Add Falcon mode support in vyasa rk3288 board.

Quoted 8 lines

---
Changes for v2:
- none

 board/amarula/vyasa-rk3288/vyasa-rk3288.c | 13 +++++++++++++
 include/configs/vyasa-rk3288.h            | 17 +++++++++++++++++
 2 files changed, 30 insertions(+)

Applied to u-boot-rockchip, thanks!

#14 lore raw

PATCH v2 5/5 rk3288: spl: Add dram_init_banksize

In reply to Chakra Divi

From: Jagan Teki <[email protected]>

Falcon mode, is updating DDR dt node configuration through spl_fixup_fdt() so add appropriate DDR base and size through dram_init_banksize.

---
Changes for v2:
- none

 arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/mach-rockchip/rk3288-board-spl.c +17 -0
index 5239cbc..7b7fd5a 100644
@@ -19,7 +19,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
+#include <asm/arch/pmu_rk3288.h>
 #include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 #include <dm/pinctrl.h>
@@ -290,3 +292,18 @@ err:
 	/* No way to report error here */
 	hang();
 }
+
+#ifdef CONFIG_SPL_OS_BOOT
+
+#define PMU_BASE		0xff730000
+int dram_init_banksize(void)
+{
+	struct rk3288_pmu *const pmu = (void *)PMU_BASE;
+	size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
+
+	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+	gd->bd->bi_dram[0].size = size;
+
+	return 0;
+}
+#endif
Signature · 1 line
2.7.4
#15 lore raw

PATCH v2 5/5 rk3288: spl: Add dram_init_banksize

Quoted 9 lines

From: Jagan Teki <[email protected]>

Falcon mode, is updating DDR dt node configuration through spl_fixup_fdt() so add appropriate DDR base and size through dram_init_banksize.

Quoted 7 lines

---
Changes for v2:
- none

 arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Applied to u-boot-rockchip, thanks!