From 65a407ecf80ebe93284a3f482643514018ff3e3f Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Wed, 6 Jun 2018 18:14:21 +0530 Subject: [PATCH] bootqca: Avoiding SPI NOR being read as psudo-NAND When SPI NOR is treated as psudo-nand, SPI-NOR gets stuck in 3-byte mode causing reads at incorrect offssets. Change-Id: I062bce4755ee1b7be0d8dcc88ae9d5412143b6e1 Signed-off-by: Gokul Sriram Palanisamy --- board/qca/arm/common/cmd_bootqca.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index 80caaef19d..94ecbcdad9 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -444,10 +444,6 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a if (debug) { printf("Using nand device %d\n", CONFIG_SPI_FLASH_INFO_IDX); } - snprintf(runcmd, sizeof(runcmd), - "nand device %d", CONFIG_SPI_FLASH_INFO_IDX); - run_command(runcmd, 0); - } else if (sfi->flash_type == SMEM_BOOT_NAND_FLASH) { if (debug) { printf("Using nand device 0\n"); @@ -527,9 +523,10 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a * Kernel is in a separate partition */ snprintf(runcmd, sizeof(runcmd), - /* NOR is treated as psuedo NAND */ - "nand read 0x%x 0x%llx 0x%llx && ", - request, sfi->hlos.offset, sfi->hlos.size); + "sf probe &&" + "sf read 0x%x 0x%x 0x%x && ", + CONFIG_SYS_LOAD_ADDR, + (uint)sfi->hlos.offset, (uint)sfi->hlos.size); if (debug) printf("%s", runcmd);