* [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected
@ 2014-06-10 3:03 Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 2/3] mx28evk: Add a target for SPI NOR boot Fabio Estevam
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Fabio Estevam @ 2014-06-10 3:03 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
When building a target with CONFIG_ENV_IS_IN_SPI_FLASH the following
warning is seen:
include/configs/mx28evk.h:73:0: warning: "CONFIG_ENV_SIZE" redefined [enabled by default]
Protect the definition of CONFIG_ENV_SIZE to avoid the warning.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Change since v2:
- Avoid build breakage for mx28evk and mx28evk_nand targets
include/configs/mx28evk.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 9b9124a..9daa0bf 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -48,7 +48,11 @@
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
/* Environment */
+#ifndef CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_SIZE (16 * 1024)
+#else
+#define CONFIG_ENV_SIZE (4 * 1024)
+#endif
#define CONFIG_ENV_OVERWRITE
/* Environment is in MMC */
@@ -70,7 +74,6 @@
/* Environemnt is in SPI flash */
#if defined(CONFIG_CMD_SF) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
-#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
#define CONFIG_ENV_OFFSET 0x40000 /* 256K */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
#define CONFIG_ENV_SECT_SIZE 0x1000
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3 2/3] mx28evk: Add a target for SPI NOR boot
2014-06-10 3:03 [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Fabio Estevam
@ 2014-06-10 3:03 ` Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 3/3] mx28evk: Add documentation on how to boot from SPI NOR Fabio Estevam
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2014-06-10 3:03 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
Introduce 'mx28evk_spi' target which will store the environment variables
into SPI NOR, which is useful when booting from SPI NOR.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- None
boards.cfg | 1 +
1 file changed, 1 insertion(+)
diff --git a/boards.cfg b/boards.cfg
index fd4324d..dbee7f6 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -214,6 +214,7 @@ Active arm arm926ejs mxs freescale mx23evk
Active arm arm926ejs mxs freescale mx28evk mx28evk mx28evk:ENV_IS_IN_MMC Fabio Estevam <fabio.estevam@freescale.com>
Active arm arm926ejs mxs freescale mx28evk mx28evk_auart_console mx28evk:MXS_AUART,MXS_AUART_BASE=MXS_UARTAPP3_BASE,ENV_IS_IN_MMC Fabio Estevam <fabio.estevam@freescale.com>
Active arm arm926ejs mxs freescale mx28evk mx28evk_nand mx28evk:ENV_IS_IN_NAND Fabio Estevam <fabio.estevam@freescale.com>
+Active arm arm926ejs mxs freescale mx28evk mx28evk_spi mx28evk:ENV_IS_IN_SPI_FLASH Fabio Estevam <fabio.estevam@freescale.com>
Active arm arm926ejs mxs olimex mx23_olinuxino mx23_olinuxino - Marek Vasut <marek.vasut@gmail.com>
Active arm arm926ejs mxs ppcag bg0900 bg0900 - Marek Vasut <marex@denx.de>
Active arm arm926ejs mxs sandisk sansa_fuze_plus sansa_fuze_plus - Marek Vasut <marek.vasut@gmail.com>
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3 3/3] mx28evk: Add documentation on how to boot from SPI NOR
2014-06-10 3:03 [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 2/3] mx28evk: Add a target for SPI NOR boot Fabio Estevam
@ 2014-06-10 3:03 ` Fabio Estevam
2014-06-10 8:11 ` [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Stefano Babic
2014-06-17 14:43 ` Stefano Babic
3 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2014-06-10 3:03 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
Explain the necessary steps in order to boot from SPI NOR.
Based on a earlier submission from M?rten Wikman.
Signed-off-by: M?rten Wikman <marten.wikman@novia.fi>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- None
board/freescale/mx28evk/README | 22 +++++++++++++++++++---
doc/README.mxs | 26 ++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/board/freescale/mx28evk/README b/board/freescale/mx28evk/README
index 0389a1d..958ebc6 100644
--- a/board/freescale/mx28evk/README
+++ b/board/freescale/mx28evk/README
@@ -23,11 +23,19 @@ To boot MX28EVK from an SD card, set the boot mode DIP switches as:
* VDD 5V: To the left (off)
* Hold Button: Down (off)
+To boot MX28EVK from SPI NOR flash, set the boot mode DIP switches as:
+
+ * Boot Mode Select: 0 0 1 0 (Boot from SSP2)
+ * JTAG PSWITCH RESET: To the right (reset disabled)
+ * Battery Source: Down
+ * Wall 5V: Up
+ * VDD 5V: To the left (off)
+ * Hold Button: Down (off)
Environment Storage
-------------------
-There are two targets for mx28evk:
+There are three targets for mx28evk:
"make mx28evk_config" - store environment variables into MMC
@@ -35,12 +43,20 @@ or
"make mx28evk_nand_config" - store environment variables into NAND flash
+or
+
+"make mx28evk_spi_config" - store enviroment variables into SPI NOR flash
+
Choose the target accordingly.
Note: The mx28evk board does not come with a NAND flash populated from the
factory. It comes with an empty slot (U23), which allows the insertion of a
48-pin TSOP flash device.
-Follow the instructions from doc/README.mxs to generate a bootable SD card.
+mx28evk does not come with SPI NOR flash populated from the factory either.
+It is possible to solder a SOIC memory on U49 or use a DIP8 on J89.
+To get SPI communication to work R320, R321,R322 and C178 need to be populated.
+Look in the schematics for the proper component values.
-Insert the SD card in slot 0, power up the board and U-boot will boot.
+Follow the instructions from doc/README.mxs to generate a bootable SD card or
+to generate a binary to be flashed into SPI NOR.
diff --git a/doc/README.mxs b/doc/README.mxs
index 0235a5a..ed2e568 100644
--- a/doc/README.mxs
+++ b/doc/README.mxs
@@ -23,6 +23,7 @@ Contents
2) Compiling U-Boot for a MXS based board
3) Installation of U-Boot for a MXS based board to SD card
4) Installation of U-Boot into NAND flash on a MX28 based board
+5) Installation of U-boot into SPI NOR flash on a MX28 based board
1) Prerequisites
----------------
@@ -262,3 +263,28 @@ There are two possibilities when preparing an image writable to NAND flash.
In case the user needs to boot a firmware image bigger than 1Mb, the
user has to adjust the "update_nand_firmware_maxsz" variable for the
update scripts to work properly.
+
+5) Installation of U-Boot into SPI NOR flash on a MX28 based board
+------------------------------------------------------------------
+
+The u-boot.sb file can be directly written to SPI NOR from U-boot prompt.
+
+Load u-boot.sb into RAM, this can be done in several ways and one way is to use
+tftp:
+ => tftp u-boot.sb 0x42000000
+
+Probe the SPI NOR flash:
+ => sf probe
+
+(SPI NOR should be succesfully detected in this step)
+
+Erase the blocks where U-boot binary will be written to:
+ => sf erase 0x0 0x80000
+
+Write u-boot.sb to SPI NOR:
+ => sf write 0x42000000 0 0x80000
+
+Power off the board and set the boot mode DIP switches to boot from the SPI NOR
+according to MX28 manual section 12.2.1 (Table 12-2)
+
+Last step is to power up the board and U-boot should start from SPI NOR.
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected
2014-06-10 3:03 [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 2/3] mx28evk: Add a target for SPI NOR boot Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 3/3] mx28evk: Add documentation on how to boot from SPI NOR Fabio Estevam
@ 2014-06-10 8:11 ` Stefano Babic
2014-06-17 14:43 ` Stefano Babic
3 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2014-06-10 8:11 UTC (permalink / raw)
To: u-boot
Hi Fabio,
On 10/06/2014 05:03, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> When building a target with CONFIG_ENV_IS_IN_SPI_FLASH the following
> warning is seen:
>
> include/configs/mx28evk.h:73:0: warning: "CONFIG_ENV_SIZE" redefined [enabled by default]
>
> Protect the definition of CONFIG_ENV_SIZE to avoid the warning.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Put in my queue to be merged.
Regards,
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected
2014-06-10 3:03 [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Fabio Estevam
` (2 preceding siblings ...)
2014-06-10 8:11 ` [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Stefano Babic
@ 2014-06-17 14:43 ` Stefano Babic
3 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2014-06-17 14:43 UTC (permalink / raw)
To: u-boot
On 10/06/2014 05:03, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> When building a target with CONFIG_ENV_IS_IN_SPI_FLASH the following
> warning is seen:
>
> include/configs/mx28evk.h:73:0: warning: "CONFIG_ENV_SIZE" redefined [enabled by default]
>
> Protect the definition of CONFIG_ENV_SIZE to avoid the warning.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-17 14:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 3:03 [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 2/3] mx28evk: Add a target for SPI NOR boot Fabio Estevam
2014-06-10 3:03 ` [U-Boot] [PATCH v3 3/3] mx28evk: Add documentation on how to boot from SPI NOR Fabio Estevam
2014-06-10 8:11 ` [U-Boot] [PATCH v3 1/3] mx28evk: Fix warning when CONFIG_ENV_IS_IN_SPI_FLASH is selected Stefano Babic
2014-06-17 14:43 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox