mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 17/17] ARM: i.MX6: boot: Return BOOTSOURCE_SPI_NOR, not BOOTSOURCE_SPI
Date: Sat, 14 Apr 2018 10:51:03 -0700	[thread overview]
Message-ID: <20180414175103.10125-18-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180414175103.10125-1-andrew.smirnov@gmail.com>

We use BOOTSOURCE_SPI to denote, among other things, QSPI on i.MX7 and
VFxxx, whereas on i.MX6 it is used to mean SPI-NOR. To make functions
like imx_xload() work consistently across various i.MX platforms use
already existent BOOTSOURCE_SPI_NOR constant to mean booting from
SPI-NOR on i.MX6 as well.

Replace all in-tree code that relying on the old value as well.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/datamodul-edm-qmx6/board.c | 2 +-
 arch/arm/boards/dfi-fs700-m60/board.c      | 2 +-
 arch/arm/boards/phytec-som-imx6/board.c    | 2 +-
 arch/arm/boards/zii-imx6q-rdu2/lowlevel.c  | 2 +-
 arch/arm/mach-imx/boot.c                   | 2 +-
 arch/arm/mach-imx/xload.c                  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/datamodul-edm-qmx6/board.c b/arch/arm/boards/datamodul-edm-qmx6/board.c
index 043a93461..d93c940e3 100644
--- a/arch/arm/boards/datamodul-edm-qmx6/board.c
+++ b/arch/arm/boards/datamodul-edm-qmx6/board.c
@@ -132,7 +132,7 @@ static int realq7_device_init(void)
 		}
 		break;
 	default:
-	case BOOTSOURCE_SPI:
+	case BOOTSOURCE_SPI_NOR:
 		of_device_enable_path("/chosen/environment-spi");
 		break;
 	}
diff --git a/arch/arm/boards/dfi-fs700-m60/board.c b/arch/arm/boards/dfi-fs700-m60/board.c
index bef4612d9..2cb8e3106 100644
--- a/arch/arm/boards/dfi-fs700-m60/board.c
+++ b/arch/arm/boards/dfi-fs700-m60/board.c
@@ -105,7 +105,7 @@ static int dfi_fs700_m60_init(void)
 
 	phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup);
 
-	if (bootsource_get() == BOOTSOURCE_SPI)
+	if (bootsource_get() == BOOTSOURCE_SPI_NOR)
 		flag_spi |= BBU_HANDLER_FLAG_DEFAULT;
 	else
 		flag_mmc |= BBU_HANDLER_FLAG_DEFAULT;
diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c
index 717a22963..ecb22f956 100644
--- a/arch/arm/boards/phytec-som-imx6/board.c
+++ b/arch/arm/boards/phytec-som-imx6/board.c
@@ -152,7 +152,7 @@ static int physom_imx6_devices_init(void)
 		environment_path = basprintf("/chosen/environment-nand");
 		envdev = "NAND flash";
 		break;
-	case BOOTSOURCE_SPI:
+	case BOOTSOURCE_SPI_NOR:
 		environment_path = basprintf("/chosen/environment-spinor");
 		envdev = "SPI NOR flash";
 		break;
diff --git a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
index 22ffdf85e..3b4dbd212 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c
@@ -290,7 +290,7 @@ static noinline void rdu2_sram_setup(void)
 		write_regs(imx6q_dcd, ARRAY_SIZE(imx6q_dcd));
 
 	imx6_get_boot_source(&bootsrc, &instance);
-	if (bootsrc == BOOTSOURCE_SPI)
+	if (bootsrc == BOOTSOURCE_SPI_NOR)
 		imx6_spi_start_image(0);
 	else
 		imx6_esdhc_start_image(instance);
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 24e2501e9..bd2af2ef4 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -300,7 +300,7 @@ static enum bootsource imx6_bootsource_serial_rom(uint32_t sbmr)
 	const int source = __imx6_bootsource_serial_rom(sbmr);
 
 	return source < IMX6_BOOTSOURCE_SERIAL_ROM_I2C1 ?
-		BOOTSOURCE_SPI : BOOTSOURCE_I2C;
+		BOOTSOURCE_SPI_NOR : BOOTSOURCE_I2C;
 }
 
 static int imx6_boot_instance_serial_rom(uint32_t sbmr)
diff --git a/arch/arm/mach-imx/xload.c b/arch/arm/mach-imx/xload.c
index 16d56ab28..921e9ade2 100644
--- a/arch/arm/mach-imx/xload.c
+++ b/arch/arm/mach-imx/xload.c
@@ -24,7 +24,7 @@ static __noreturn int imx_xload(void)
 		pr_info("booting from MMC\n");
 		buf = bootstrap_read_disk("disk0.0", "fat");
 		break;
-	case BOOTSOURCE_SPI:
+	case BOOTSOURCE_SPI_NOR:
 		pr_info("booting from SPI\n");
 		buf = bootstrap_read_devfs("dataflash0", false,
 					   SZ_256K, SZ_1M, SZ_1M);
-- 
2.14.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2018-04-14 17:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14 17:50 [PATCH 00/17] i.MX bootsource bugfixes, refactoring and VFxxx support Andrey Smirnov
2018-04-14 17:50 ` [PATCH 01/17] ARM: i.MX: boot: Coalesce copy-pasted code Andrey Smirnov
2018-04-14 17:50 ` [PATCH 02/17] ARM: i.MX: Add function to extract BMOD value Andrey Smirnov
2018-04-16  7:37   ` Sascha Hauer
2018-04-16 13:36     ` Andrey Smirnov
2018-04-14 17:50 ` [PATCH 03/17] ARM: i.MX: Simplify serial bootsource detection for i.MX6 and 7 Andrey Smirnov
2018-04-14 17:50 ` [PATCH 04/17] ARM: i.MX: Account for unprogrammed fuses on i.MX6 and i.MX7 Andrey Smirnov
2018-04-14 17:50 ` [PATCH 05/17] ARM: i.MX7: boot: Add code to handle SD/MMC manufacture mode Andrey Smirnov
2018-04-14 17:50 ` [PATCH 06/17] ARM: i.MX7: boot: Remove incorrect NAND bootsource detection Andrey Smirnov
2018-04-14 17:50 ` [PATCH 07/17] ARM: i.MX7: boot: Fix SPI-NOR/QSPI boot source mixup Andrey Smirnov
2018-04-14 17:50 ` [PATCH 08/17] ARM: i.MX: boot: Remove unnecessary retruns Andrey Smirnov
2018-04-15  2:22   ` Marc Reilly
2018-04-16 16:34     ` Andrey Smirnov
2018-04-14 17:50 ` [PATCH 09/17] ARM: i.MX: boot: Move magic values into small functions Andrey Smirnov
2018-04-15  2:24   ` Marc Reilly
2018-04-16 16:33     ` Andrey Smirnov
2018-04-14 17:50 ` [PATCH 10/17] ARM: i.MX: boot: Share code to detect NAND as a boot source Andrey Smirnov
2018-04-14 17:50 ` [PATCH 11/17] ARM: i.MX: boot: Check for NAND boot only if necessary on i.MX53, 6 Andrey Smirnov
2018-04-14 17:50 ` [PATCH 12/17] ARM: i.MX53: boot: Move magic numbers info utility functions Andrey Smirnov
2018-04-14 17:50 ` [PATCH 13/17] ARM: i.MX6: boot: Move magic numbers into " Andrey Smirnov
2018-04-14 17:51 ` [PATCH 14/17] ARM: i.MX7: " Andrey Smirnov
2018-04-14 17:51 ` [PATCH 15/17] bootsource: Add BOOTSOURCE_CAN Andrey Smirnov
2018-04-14 17:51 ` [PATCH 16/17] ARM: VFxxx: Implement code to detect bootsource Andrey Smirnov
2018-04-14 17:51 ` Andrey Smirnov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180414175103.10125-18-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox