diff mbox series

[v3,1/2] configs: ls2080ardb: Make MC_INIT access flash memory as per spi-mem

Message ID 1584512804-16844-1-git-send-email-kuldeep.singh@nxp.com
State Accepted
Commit 6596e2e6fa4c82c02da5c7e6af50ace175226847
Headers show
Series [v3,1/2] configs: ls2080ardb: Make MC_INIT access flash memory as per spi-mem | expand

Commit Message

Kuldeep Singh March 18, 2020, 6:26 a.m. UTC
MC_INIT command currently access spi-nor flash memory directly. As per
spi-mem framework, flash memory access via absolute addresses is no more
possible. Use flash APIs to access memory instead of directly using it.

Signed-off-by: Kuldeep Singh <kuldeep.singh at nxp.com>
---
v3:
-Use complete MC size, 1M works but MC has 3M assigned space.
-Rebase to top

v2:
-Rebase to top
-reword commit message

 include/configs/ls2080ardb.h | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

Comments

Priyanka Jain (OSS) March 18, 2020, 10:29 a.m. UTC | #1
>-----Original Message-----
>From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Kuldeep Singh
>Sent: Wednesday, March 18, 2020 11:57 AM
>To: Priyanka Jain <priyanka.jain at nxp.com>; u-boot at lists.denx.de
>Cc: Kuldeep Singh <kuldeep.singh at nxp.com>
>Subject: [Patch v3 1/2] configs: ls2080ardb: Make MC_INIT access flash
>memory as per spi-mem
>
>MC_INIT command currently access spi-nor flash memory directly. As per spi-
>mem framework, flash memory access via absolute addresses is no more
>possible. Use flash APIs to access memory instead of directly using it.
>
>Signed-off-by: Kuldeep Singh <kuldeep.singh at nxp.com>
>---
>v3:
>-Use complete MC size, 1M works but MC has 3M assigned space.
>-Rebase to top
>
>v2:
>-Rebase to top
>-reword commit message
>
> include/configs/ls2080ardb.h | 28 ++++++++++++++++++----------
> 1 file changed, 18 insertions(+), 10 deletions(-)
>
>diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h index
>c1819d2..d36e928 100644
>--- a/include/configs/ls2080ardb.h
>+++ b/include/configs/ls2080ardb.h
>@@ -321,11 +321,15 @@ unsigned long get_board_sys_clk(void);  #include
><config_distro_bootcmd.h>
>
> #ifdef CONFIG_TFABOOT
>-#define QSPI_MC_INIT_CMD			\
>-	"env exists secureboot && "		\
>-	"esbc_validate 0x20640000 && "		\
>-	"esbc_validate 0x20680000;"		\
>-	"fsl_mc start mc 0x20a00000 0x20e00000 \0"
>+#define QSPI_MC_INIT_CMD				\
>+	"sf probe 0:0; "				\
>+	"sf read 0x80640000 0x640000 0x80000; "		\
>+	"env exists secureboot && "			\
>+	"esbc_validate 0x80640000 && "			\
>+	"esbc_validate 0x80680000; "			\
>+	"sf read 0x80a00000 0xa00000 0x300000; "	\
>+	"sf read 0x80e00000 0xe00000 0x100000; "	\
>+	"fsl_mc start mc 0x80a00000 0x80e00000 \0"
> #define SD_MC_INIT_CMD				\
> 	"mmcinfo;mmc read 0x80a00000 0x5000 0x1200;" \
> 	"mmc read 0x80e00000 0x7000 0x800;"	\
>@@ -342,11 +346,15 @@ unsigned long get_board_sys_clk(void);
> 	"fsl_mc start mc 0x580a00000 0x580e00000 \0"
> #else
> #ifdef CONFIG_QSPI_BOOT
>-#define MC_INIT_CMD				\
>-	"mcinitcmd=env exists secureboot && "	\
>-	"esbc_validate 0x20640000 && "		\
>-	"esbc_validate 0x20680000;"		\
>-	"fsl_mc start mc 0x20a00000 0x20e00000 \0"
>+#define MC_INIT_CMD					\
>+	"mcinitcmd=sf probe 0:0; "			\
>+	"sf read 0x80640000 0x640000 0x80000; "		\
>+	"env exists secureboot && "			\
>+	"esbc_validate 0x80640000 && "			\
>+	"esbc_validate 0x80680000; "			\
>+	"sf read 0x80a00000 0xa00000 0x300000; "	\
>+	"sf read 0x80e00000 0xe00000 0x100000; "	\
>+	"fsl_mc start mc 0x80a00000 0x80e00000 \0"
> #elif defined(CONFIG_SD_BOOT)
> #define MC_INIT_CMD                             \
> 	"mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;" \
>--
>2.7.4
Please confirm if you tested this change for both secure and non-secure boot
Regards
Priyanka
diff mbox series

Patch

diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index c1819d2..d36e928 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -321,11 +321,15 @@  unsigned long get_board_sys_clk(void);
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_TFABOOT
-#define QSPI_MC_INIT_CMD			\
-	"env exists secureboot && "		\
-	"esbc_validate 0x20640000 && "		\
-	"esbc_validate 0x20680000;"		\
-	"fsl_mc start mc 0x20a00000 0x20e00000 \0"
+#define QSPI_MC_INIT_CMD				\
+	"sf probe 0:0; "				\
+	"sf read 0x80640000 0x640000 0x80000; "		\
+	"env exists secureboot && "			\
+	"esbc_validate 0x80640000 && "			\
+	"esbc_validate 0x80680000; "			\
+	"sf read 0x80a00000 0xa00000 0x300000; "	\
+	"sf read 0x80e00000 0xe00000 0x100000; "	\
+	"fsl_mc start mc 0x80a00000 0x80e00000 \0"
 #define SD_MC_INIT_CMD				\
 	"mmcinfo;mmc read 0x80a00000 0x5000 0x1200;" \
 	"mmc read 0x80e00000 0x7000 0x800;"	\
@@ -342,11 +346,15 @@  unsigned long get_board_sys_clk(void);
 	"fsl_mc start mc 0x580a00000 0x580e00000 \0"
 #else
 #ifdef CONFIG_QSPI_BOOT
-#define MC_INIT_CMD				\
-	"mcinitcmd=env exists secureboot && "	\
-	"esbc_validate 0x20640000 && "		\
-	"esbc_validate 0x20680000;"		\
-	"fsl_mc start mc 0x20a00000 0x20e00000 \0"
+#define MC_INIT_CMD					\
+	"mcinitcmd=sf probe 0:0; "			\
+	"sf read 0x80640000 0x640000 0x80000; "		\
+	"env exists secureboot && "			\
+	"esbc_validate 0x80640000 && "			\
+	"esbc_validate 0x80680000; "			\
+	"sf read 0x80a00000 0xa00000 0x300000; "	\
+	"sf read 0x80e00000 0xe00000 0x100000; "	\
+	"fsl_mc start mc 0x80a00000 0x80e00000 \0"
 #elif defined(CONFIG_SD_BOOT)
 #define MC_INIT_CMD                             \
 	"mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;" \