Skip to contentSkip to conversation

mx23_olinuxino: Add default environment

PATCH New Otavio Salvador 4 participants 10 messages Jan 23, 2013 – Jan 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

This adds a default environment with support for MMC booting.

---
Changes in v6:
- Remove 'saveenv' command as it is not need
- Move environment settings to environment section

Changes in v5:
- Remove duplicate environment setting
- Improve commit log

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/mx23_olinuxino.h | 77 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 70 insertions(+), 7 deletions(-)
include/configs/mx23_olinuxino.h +70 -7
index bc63481..4658aea 100644
@@ -127,21 +127,84 @@
 #define CONFIG_APBH_DMA
 
 /*
- * ENV -- nowhere so far
- */
-#define	CONFIG_ENV_SIZE			(16 * 1024)
-#define	CONFIG_ENV_IS_NOWHERE
-
-/*
  * Boot Linux
  */
 #define	CONFIG_CMDLINE_TAG
 #define	CONFIG_SETUP_MEMORY_TAGS
 #define	CONFIG_BOOTDELAY	3
 #define	CONFIG_BOOTFILE		"uImage"
-#define	CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "
 #define	CONFIG_LOADADDR		0x42000000
 #define	CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 #define	CONFIG_OF_LIBFDT
 
+/*
+ * Environment
+ */
+#define	CONFIG_ENV_IS_IN_MMC
+#define	CONFIG_ENV_OVERWRITE
+#ifdef	CONFIG_ENV_IS_IN_MMC
+#define	CONFIG_ENV_OFFSET	(256 * 1024)
+#define	CONFIG_ENV_SIZE	(16 * 1024)
+#define	CONFIG_SYS_MMC_ENV_DEV 0
+#endif
+
+/*
+ * Extra Environments
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"update_sd_firmware_filename=u-boot.sd\0" \
+	"update_sd_firmware="		/* Update the SD firmware partition */ \
+		"if mmc rescan ; then "	\
+		"if tftp ${update_sd_firmware_filename} ; then " \
+		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
+		"setexpr fw_sz ${fw_sz} + 1 ; "	\
+		"mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
+		"fi ; "	\
+		"fi\0" \
+	"script=boot.scr\0"	\
+	"uimage=uImage\0" \
+	"console=ttyAMA0\0" \
+	"fdt_file=imx23-olinuxino.dtb\0" \
+	"fdt_addr=0x41000000\0" \
+	"boot_fdt=try\0" \
+	"mmcdev=0\0" \
+	"mmcpart=2\0" \
+	"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
+	"mmcargs=setenv bootargs console=${console},${baudrate} " \
+		"root=${mmcroot}\0" \
+	"loadbootscript="  \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+	"bootscript=echo Running bootscript from mmc ...; "	\
+		"source\0" \
+	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+			"if run loadfdt; then " \
+				"bootm ${loadaddr} - ${fdt_addr}; " \
+			"else " \
+				"if test ${boot_fdt} = try; then " \
+					"bootm; " \
+				"else " \
+					"echo WARN: Cannot load the DT; " \
+				"fi; " \
+			"fi; " \
+		"else " \
+			"bootm; " \
+		"fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else " \
+				"echo ERR: Fail to boot from MMC; " \
+			"fi; " \
+		"fi; " \
+	"else exit; fi"
+
 #endif /* __MX23_OLINUXINO_CONFIG_H__ */
Signature · 1 line
1.8.1
#1 lore raw

PATCH v6 2/2 mx23evk: Add initial board support

The following features are supported:
* 128 MB DDR1 SDRAM
* DUART
* SD/MMC Card Socket

---
Changes in v6:
- Remove 'saveenv' command as it is not need
- Move environment settings to environment section
- Use 1s boot delay

Changes in v5:
- Use 4bit bus for mmc

Changes in v4:
- Fix build warnings

Changes in v3:
- Removed unused macro for GPMI setting in spl_boot.c

Changes in v2:
- Add DUART in commitlog
- Remove AUART MUX setup as it is unused
- Remove wrong comment in mx23evk.h board config
- Use single line comments in mx23evk.h board config
- Use '=>' as prompt
- Remove SPI, RTC and USB support as those where not tested yet

 MAINTAINERS                        |   4 +
 board/freescale/mx23evk/Makefile   |  47 +++++++++
 board/freescale/mx23evk/mx23evk.c  |  83 +++++++++++++++
 board/freescale/mx23evk/spl_boot.c | 104 +++++++++++++++++++
 boards.cfg                         |   1 +
 include/configs/mx23evk.h          | 202 +++++++++++++++++++++++++++++++++++++
 6 files changed, 441 insertions(+)
 create mode 100644 board/freescale/mx23evk/Makefile
 create mode 100644 board/freescale/mx23evk/mx23evk.c
 create mode 100644 board/freescale/mx23evk/spl_boot.c
 create mode 100644 include/configs/mx23evk.h
MAINTAINERS +4 -0
index dfa3c8b..faa9b5e 100644
@@ -947,6 +947,10 @@ Matt Waddel <[email protected]>
 
 	ca9x4_ct_vxp	ARM ARMV7 (Quad Core)
 
+Otavio Salvador <[email protected]>
+
+	mx23evk		i.MX23
+
 Prafulla Wadaskar <[email protected]>
 
 	aspenite	ARM926EJS (ARMADA100 88AP168 SoC)
board/freescale/mx23evk/Makefile new file +47 -0

47 lines not on this page · raw message

board/freescale/mx23evk/mx23evk.c new file +83 -0

83 lines not on this page · raw message

board/freescale/mx23evk/spl_boot.c new file +104 -0

104 lines not on this page · raw message

boards.cfg +1 -0
index 9b31931..7d03620 100644
@@ -193,6 +193,7 @@ imx27lite                    arm         arm926ejs   imx27lite           logicpd
 magnesium                    arm         arm926ejs   imx27lite           logicpd        mx27
 mx23_olinuxino               arm         arm926ejs   mx23_olinuxino      olimex         mxs		mx23_olinuxino
 apx4devkit                   arm         arm926ejs   apx4devkit          bluegiga       mxs		apx4devkit
+mx23evk                      arm         arm926ejs   mx23evk             freescale      mxs		mx23evk
 m28evk                       arm         arm926ejs   m28evk              denx           mxs		m28evk
 mx28evk                      arm         arm926ejs   mx28evk             freescale      mxs		mx28evk
 sc_sps_1                     arm         arm926ejs   sc_sps_1            schulercontrol mxs
include/configs/mx23evk.h new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.8.1
#3 lore raw

PATCH v6 2/2 mx23evk: Add initial board support

In reply to Otavio Salvador
Quoted 7 lines · Otavio Salvador

The following features are supported:
* 128 MB DDR1 SDRAM
* DUART
* SD/MMC Card Socket

---

Applied (whole patchset) to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#4 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

In reply to Otavio Salvador
Quoted 4 lines · Otavio Salvador

This adds a default environment with support for MMC booting.

---

Applied (whole patchset) to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#5 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

Dear Stefano Babic,

Quoted 7 lines · Otavio Salvador
Quoted 4 lines

This adds a default environment with support for MMC booting.

---

Applied (whole patchset) to u-boot-imx, thanks.

Otavio, "u-boot.sd" is never generated for MX23, so the env is broken now. Please fix.

Best regards,
Marek Vasut

#6 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

Quoted 5 lines · Marek Vasut

Dear Stefano Babic,

Quoted 3 lines · Otavio Salvador
Quoted 2 lines

This adds a default environment with support for MMC booting.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

---

Applied (whole patchset) to u-boot-imx, thanks.

Otavio, "u-boot.sd" is never generated for MX23, so the env is broken now. Please fix.

I proposed a patch for mxsboot which fixes it. I am waiting for your alternative patch for mxsboot.

--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#7 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

Dear Otavio Salvador,

Quoted 9 lines · Marek Vasut
Quoted 8 lines

Dear Stefano Babic,

Quoted 6 lines · Otavio Salvador
Quoted 4 lines

This adds a default environment with support for MMC booting.

---

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Applied (whole patchset) to u-boot-imx, thanks.

Otavio, "u-boot.sd" is never generated for MX23, so the env is broken now. Please fix.

I proposed a patch for mxsboot which fixes it. I am waiting for your alternative patch for mxsboot.

There is no alternative patch, I'm still waiting for the resolution of the service RQ ticket. Did you hear anything from FSL already?

Best regards,
Marek Vasut

#8 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

Quoted 13 lines · Marek Vasut

Dear Otavio Salvador,

Quoted 11 lines · Marek Vasut
Quoted 10 lines

Dear Stefano Babic,

Quoted 7 lines · Otavio Salvador
Quoted 4 lines

This adds a default environment with support for MMC booting.

---

Applied (whole patchset) to u-boot-imx, thanks.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Otavio, "u-boot.sd" is never generated for MX23, so the env is broken now. Please fix.

I proposed a patch for mxsboot which fixes it. I am waiting for your alternative patch for mxsboot.

There is no alternative patch,

There're; mine solution was a small header with 4 sector offset; yours was to reuse mx28 header and move it to 4 sectors offset. Both works for MX23.

Quoted 2 lines

... I'm still waiting for the resolution of the service RQ ticket. Did you hear anything from FSL already?

Nothing yet but I think we can go with either solutions for now and depending on their feedback in future we can change it. I see no reason to hold a fix due it. We know two ways how to make it work so let's pick one and go with it for now.

--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#9 lore raw

PATCH v6 1/2 mx23_olinuxino: Add default environment

Dear Otavio Salvador,

Quoted 26 lines · Marek Vasut
Quoted 13 lines

Dear Otavio Salvador,

Quoted 11 lines · Marek Vasut
Quoted 10 lines

Dear Stefano Babic,

Quoted 7 lines · Otavio Salvador
Quoted 4 lines

This adds a default environment with support for MMC booting.

---

Applied (whole patchset) to u-boot-imx, thanks.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Otavio, "u-boot.sd" is never generated for MX23, so the env is broken now. Please fix.

I proposed a patch for mxsboot which fixes it. I am waiting for your alternative patch for mxsboot.

There is no alternative patch,

There're; mine solution was a small header with 4 sector offset; yours was to reuse mx28 header and move it to 4 sectors offset. Both works for MX23.

Quoted 6 lines
Quoted 2 lines

... I'm still waiting for the resolution of the service RQ ticket. Did you hear anything from FSL already?

Nothing yet but I think we can go with either solutions for now and depending on their feedback in future we can change it. I see no reason to hold a fix due it.

It's no fix, it's random code with no documentation backing it.

Quoted 7 lines

We know two ways how to make it work so
let's pick one and go with it for now.

--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

Best regards,
Marek Vasut