diff mbox series

configs: lx2160a: Access flash memory as per spi-mem

Message ID 1584006180-17430-1-git-send-email-kuldeep.singh@nxp.com
State Accepted
Commit b9804c35a877b11d128262b968d0a9499584c339
Headers show
Series configs: lx2160a: Access flash memory as per spi-mem | expand

Commit Message

Kuldeep Singh March 12, 2020, 9:43 a.m. UTC
MC_INIT and BOOT 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>
---
 include/configs/lx2160a_common.h | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

Comments

Priyanka Jain (OSS) March 30, 2020, 12:33 p.m. UTC | #1
>-----Original Message-----
>From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Kuldeep Singh
>Sent: Thursday, March 12, 2020 3:13 PM
>To: u-boot at lists.denx.de; Priyanka Jain <priyanka.jain at nxp.com>
>Cc: Kuldeep Singh <kuldeep.singh at nxp.com>
>Subject: [PATCH] configs: lx2160a: Access flash memory as per spi-mem
>
>MC_INIT and BOOT 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>
>---
Applied to u-boot-fsl-qoriq. Waiting upstream

Thanks
Priyanka
diff mbox series

Patch

diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 373daeb..2a76ce5 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -187,11 +187,15 @@  unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
 
 /* Initial environment variables */
-#define XSPI_MC_INIT_CMD			\
-	"env exists secureboot && "		\
-	"esbc_validate 0x20640000 && "		\
-	"esbc_validate 0x20680000 ;"		\
-	"fsl_mc start mc 0x20a00000 0x20e00000\0"
+#define XSPI_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				\
 	"mmc read 0x80a00000 0x5000 0x1200;"	\
@@ -249,10 +253,13 @@  unsigned long get_board_ddr_clk(void);
 		"source ${scriptaddr}\0"
 
 #define XSPI_NOR_BOOTCOMMAND						\
-			"env exists mcinitcmd && env exists secureboot "\
-			"&& esbc_validate 0x206C0000; "			\
+			"sf probe 0:0; "				\
+			"sf read 0x806c0000 0x6c0000 0x40000; "		\
+			"env exists mcinitcmd && env exists secureboot"	\
+			" && esbc_validate 0x806c0000; "		\
+			"sf read 0x80d00000 0xd00000 0x100000; "	\
 			"env exists mcinitcmd && "			\
-			"fsl_mc lazyapply dpl 0x20d00000; "		\
+			"fsl_mc lazyapply dpl 0x80d00000; "		\
 			"run distro_bootcmd;run xspi_bootcmd; "		\
 			"env exists secureboot && esbc_halt;"