summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2022-03-04 01:54:36 +0300
committerDongjin Kim <tobetter@gmail.com>2022-03-04 03:04:08 +0300
commit7ee2a5ed2236055183f77c6138046440241d1ae8 (patch)
treea02102927a81aec88a1bdcf4c5634f934a13ca78
parentf158e436ae4b0ffffc6a455a9caca4afb241aa7f (diff)
downloadu-boot-7ee2a5ed2236055183f77c6138046440241d1ae8.tar.xz
ODROID-M1: add to initiate SPI flash memory on booting
This patch is to intiate SPI flash memory with default bus and cs on booting, this is only necessary when U-Boot blob is loaded from MMC device. Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: I430ad1d9669329abf4e9acaf4dd2c81fce4b5530
-rw-r--r--board/hardkernel/odroid-m1/odroid-m1.c8
-rw-r--r--configs/odroid_rk3568_defconfig25
-rw-r--r--drivers/rkflash/rksfc_base.c2
3 files changed, 33 insertions, 2 deletions
diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c
index 4f0130d54e..b0fc1088a0 100644
--- a/board/hardkernel/odroid-m1/odroid-m1.c
+++ b/board/hardkernel/odroid-m1/odroid-m1.c
@@ -14,6 +14,9 @@
#include <mapmem.h>
#include <lcd.h>
#include <fs.h>
+#if defined(CONFIG_RKSFC_NOR)
+#include <rksfc.h>
+#endif
#include "../../../drivers/video/drm/rockchip_display.h"
extern int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
@@ -70,6 +73,11 @@ int board_early_init_r(void)
char buf[16];
int n;
+#if defined(CONFIG_RKSFC_NOR)
+ if (dev_desc->if_type == IF_TYPE_MMC)
+ rksfc_scan_namespace();
+#endif
+
for (n = 1; n <= 3; n++) {
snprintf(buf, sizeof(buf), "%d:%d", dev_desc->devnum, n);
diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig
index 07d14195ab..7b885ca791 100644
--- a/configs/odroid_rk3568_defconfig
+++ b/configs/odroid_rk3568_defconfig
@@ -183,7 +183,7 @@ CONFIG_ROCKCHIP_FIT_IMAGE=y
# CONFIG_ROCKCHIP_UIMAGE is not set
# CONFIG_ROCKCHIP_EARLY_DISTRO_DTB is not set
# CONFIG_ROCKCHIP_HWID_DTB is not set
-# CONFIG_ROCKCHIP_VENDOR_PARTITION=y
+# CONFIG_ROCKCHIP_VENDOR_PARTITION is not set
CONFIG_USING_KERNEL_DTB=y
CONFIG_EMBED_KERNEL_DTB_PATH="rk3568-odroid-m1.dtb"
# CONFIG_EMBED_KERNEL_DTB_ALWAYS is not set
@@ -195,6 +195,7 @@ CONFIG_ROCKCHIP_PRELOADER_SERIAL=y
CONFIG_ROCKCHIP_FIT_IMAGE_PACK=y
CONFIG_ROCKCHIP_UART_MUX_SEL_M=0
# CONFIG_ROCKCHIP_REBOOT_TEST is not set
+# CONFIG_ROCKCHIP_NEW_IDB is not set
# CONFIG_GICV2 is not set
CONFIG_GICV3=y
CONFIG_ROCKCHIP_EMMC_IOMUX=y
@@ -349,6 +350,10 @@ CONFIG_DISPLAY_BOARDINFO=y
# CONFIG_ARCH_MISC_INIT is not set
# CONFIG_BOARD_EARLY_INIT_F is not set
CONFIG_BOARD_EARLY_INIT_R=y
+
+#
+# Android features support
+#
CONFIG_ANDROID_BOOTLOADER=y
# CONFIG_ANDROID_AB is not set
# CONFIG_ANDROID_WRITE_KEYBOX is not set
@@ -590,6 +595,7 @@ CONFIG_CMD_PART=y
# CONFIG_CMD_PCMCIA is not set
# CONFIG_CMD_READ is not set
CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_RKSFC=y
# CONFIG_CMD_RK_SECURE_STORAGE is not set
# CONFIG_CMD_SATA is not set
# CONFIG_CMD_SAVES is not set
@@ -618,6 +624,7 @@ CONFIG_CMD_NET=y
CONFIG_CMD_TFTPPUT=y
CONFIG_CMD_TFTP_BOOTM=y
CONFIG_CMD_TFTP_FLASH=y
+# CONFIG_CMD_TFTP_UPDATE is not set
# CONFIG_CMD_TFTPSRV is not set
# CONFIG_CMD_RARP is not set
CONFIG_CMD_DHCP=y
@@ -1212,6 +1219,7 @@ CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
# CONFIG_SPL_DM_REGULATOR_FIXED is not set
# CONFIG_DM_REGULATOR_GPIO is not set
+# CONFIG_REGULATOR_RK860X is not set
CONFIG_REGULATOR_RK8XX=y
# CONFIG_DM_DVFS is not set
# CONFIG_CHARGER_BQ25700 is not set
@@ -1244,7 +1252,14 @@ CONFIG_RESET_ROCKCHIP=y
CONFIG_SPL_RESET_ROCKCHIP=y
# CONFIG_RESET_SCMI is not set
# CONFIG_RKNAND is not set
-# CONFIG_RKFLASH is not set
+CONFIG_RKFLASH=y
+
+#
+# Rockchip Flash Devices
+#
+# CONFIG_RKNANDC_NAND is not set
+# CONFIG_RKSFC_NAND is not set
+CONFIG_RKSFC_NOR=y
#
# Real Time Clock
@@ -1342,6 +1357,7 @@ CONFIG_SYSRESET=y
CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_PSCI=y
# CONFIG_SYSRESET_SYSCON is not set
+CONFIG_SYSRESET_SYSCON_REBOOT=y
# CONFIG_SYSRESET_WATCHDOG is not set
# CONFIG_DM_THERMAL is not set
@@ -1532,6 +1548,11 @@ CONFIG_RSA_C_SIZE=0x20
# CONFIG_TPM is not set
#
+# Boot Configuration
+#
+# CONFIG_XBC is not set
+
+#
# Hashing Support
#
CONFIG_SHA1=y
diff --git a/drivers/rkflash/rksfc_base.c b/drivers/rkflash/rksfc_base.c
index 2120c7802c..3967f4d60e 100644
--- a/drivers/rkflash/rksfc_base.c
+++ b/drivers/rkflash/rksfc_base.c
@@ -10,6 +10,7 @@
#include <dm/device-internal.h>
#include <asm/arch/clock.h>
#include <rksfc.h>
+#include <spi_flash.h>
#include <asm/arch/vendor.h>
#include "rkflash_blk.h"
@@ -139,6 +140,7 @@ UCLASS_DRIVER(rksfc) = {
.id = UCLASS_SPI_FLASH,
.name = "rksfc",
.flags = DM_UC_FLAG_SEQ_ALIAS,
+ .per_device_auto_alloc_size = sizeof(struct spi_flash),
};
static const struct udevice_id rockchip_sfc_ids[] = {