[U-Boot] [PATCH] rockchip: firefly-rk3288: Enable TPL support【请注意,邮件由u-boot-bounces at lists.denx.de代发】
Levin Du
djw at t-chip.com.cn
Thu Oct 17 08:55:22 UTC 2019
Hi all, I have difficulties with TPL in the firefly-rk3288 board.
1. Without defining DEBUG in `drivers/mmc/dw_mmc.c`, boot with TF card:
U-Boot TPL 2019.10-00017-g5b02ac7fa5dd-dirty (Oct 17 2019 - 16:36:39)
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2019.10-00017-g5b02ac7fa5dd-dirty (Oct 17 2019 - 16:36:39 +0800)
Trying to boot from MMC1
spl: mmc boot mode: raw
hdr read sector 4000, count=1
TO read 3af sectors to ffffc0
It hangs without further messages.
2. With defining DEBUG in `drivers/mmc/dw_mmc.c`, boot with TF card, emmc
being erased:
U-Boot TPL 2019.10-00017-g5b02ac7fa5dd-dirty (Oct 17 2019 - 16:42:43)
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2019.10-00017-g5b02ac7fa5dd-dirty (Oct 17 2019 - 16:42:43 +0800)
Trying to boot from MMC1
Buswidth = 0, clock: 0
Buswidth = 1, clock: 0
Buswidth = 1, clock: 400000
Sending CMD0
Sending CMD8
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD55
Sending CMD41
Sending CMD2
Sending CMD3
Sending CMD9
Sending CMD7
Sending CMD55
Sending CMD51
Sending CMD6
Sending CMD55
Sending CMD6
Buswidth = 4, clock: 400000
Sending CMD6
Buswidth = 4, clock: 50000000
spl: mmc boot mode: raw
Sending CMD16
Sending CMD17
hdr read sector 4000, count=1
TO read 3b1 sectors to ffffc0
Sending CMD16
Sending CMD18
Sending CMD12
read 3b1 sectors to ffffc0
U-Boot 2019.10-00017-g5b02ac7fa5dd-dirty (Oct 17 2019 - 16:42:43 +0800)
Model: Firefly-RK3288
DRAM: 4 GiB
MMC: dwmmc at ff0c0000: 1, dwmmc at ff0f0000: 0
Loading Environment from MMC... Buswidth = 0, clock: 0
Buswidth = 1, clock: 0
Buswidth = 1, clock: 400000
Sending CMD0
Sending CMD8
dwmci_send_cmd: Response Timeout.
Sending CMD55
dwmci_send_cmd: Response Timeout.
Sending CMD0
Sending CMD1
Sending CMD1
Sending CMD0
Sending CMD1
Sending CMD1
Sending CMD2
Sending CMD3
Sending CMD9
Sending CMD7
Sending CMD8
Buswidth = 1, clock: 25000000
Sending CMD6
Sending CMD13
Buswidth = 8, clock: 25000000
Sending CMD6
Sending CMD13
Sending CMD8
Buswidth = 8, clock: 52000000
Sending CMD8
Sending CMD16
Sending CMD17
Sending CMD16
Sending CMD18
Sending CMD12
Sending CMD16
Sending CMD18
Sending CMD12
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Model: Firefly-RK3288
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:
Warning: ethernet at ff290000 (eth0) using random MAC address - f2:26:96:9a:41:83
eth0: ethernet at ff290000
Hit any key to stop autoboot: 0
=>
Everything works. It is weird.
Have tried with the eMMC booting, with the same result.
My modification besides Kever's patch is:
diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index 057ce920809e..987b4e0d58c2 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -22,8 +22,8 @@ DECLARE_GLOBAL_DATA_PTR;
#define GRF_BASE 0xff770000
const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
- [BROM_BOOTSOURCE_EMMC] = "dwmmc at ff0f0000",
- [BROM_BOOTSOURCE_SD] = "dwmmc at ff0c0000",
+ [BROM_BOOTSOURCE_EMMC] = "/dwmmc at ff0f0000",
+ [BROM_BOOTSOURCE_SD] = "/dwmmc at ff0c0000",
};
#ifdef CONFIG_SPL_BUILD
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index b3619889f794..e7432c96752a 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -5,6 +5,7 @@
*
* Aneesh V <aneesh at ti.com>
*/
+#define DEBUG
#include <common.h>
#include <dm.h>
#include <spl.h>
@@ -31,6 +32,8 @@ static int mmc_load_legacy(struct spl_image_info *spl_image, struct mmc *mmc,
mmc->read_bl_len;
/* Read the header too to avoid extra memcpy */
+ debug("TO read %x sectors to %lx\n", image_size_sectors,
+ spl_image->load_addr);
count = blk_dread(mmc_get_blk_desc(mmc), sector, image_size_sectors,
(void *)(ulong)spl_image->load_addr);
debug("read %x sectors to %lx\n", image_size_sectors,
diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
index 4a43cb5470f1..061005453be4 100644
--- a/configs/firefly-rk3288_defconfig
+++ b/configs/firefly-rk3288_defconfig
@@ -15,6 +15,7 @@ CONFIG_SILENT_CONSOLE=y
CONFIG_DEFAULT_FDT_FILE="rk3288-firefly.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
CONFIG_SPL_STACK_R=y
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
CONFIG_CMD_GPIO=y
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index ebe7bcdd9005..2cd4092f0601 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -5,6 +5,7 @@
* Rajeshawari Shinde <rajeshwari.s at samsung.com>
*/
+#define DEBUG
#include <bouncebuf.h>
#include <common.h>
#include <errno.h>
I'm also adding Peng Fan, maintainer of MMC, to seek some advice.
Thanks for all your time.
Kever Yang <kever.yang at rock-chips.com> writes:
> This patch enable TPL support for firefly-rk3288 board, which works ths
> same way with other RK3288 board like Tinker, evb.
>
> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> ---
>
> arch/arm/mach-rockchip/rk3288/Kconfig | 1 +
> configs/firefly-rk3288_defconfig | 5 ++---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
> index 4ebc0792d5..afb62fca78 100644
> --- a/arch/arm/mach-rockchip/rk3288/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3288/Kconfig
> @@ -67,6 +67,7 @@ config TARGET_FIREFLY_RK3288
> bool "Firefly-RK3288"
> select BOARD_LATE_INIT
> select SPL_BOARD_INIT if SPL
> + select TPL
> help
> Firefly is a RK3288-based development board with 2 USB ports,
> HDMI, VGA, micro-SD card, audio, WiFi and Gigabit Ethernet, It
> diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
> index 29935d869c..64a83a17f2 100644
> --- a/configs/firefly-rk3288_defconfig
> +++ b/configs/firefly-rk3288_defconfig
> @@ -1,15 +1,14 @@
> CONFIG_ARM=y
> CONFIG_ARCH_ROCKCHIP=y
> -CONFIG_SYS_TEXT_BASE=0x00000000
> +CONFIG_SYS_TEXT_BASE=0x01000000
> CONFIG_ROCKCHIP_RK3288=y
> -CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
> CONFIG_TARGET_FIREFLY_RK3288=y
> CONFIG_NR_DRAM_BANKS=1
> +CONFIG_SPL_SIZE_LIMIT=262144
> CONFIG_SPL_STACK_R_ADDR=0x80000
> CONFIG_DEBUG_UART_BASE=0xff690000
> CONFIG_DEBUG_UART_CLOCK=24000000
> CONFIG_DEBUG_UART=y
> -CONFIG_SPL_TEXT_BASE=0xff704000
> # CONFIG_ANDROID_BOOT_IMAGE is not set
> CONFIG_USE_PREBOOT=y
> CONFIG_SILENT_CONSOLE=y
--
Levin Du
More information about the U-Boot
mailing list