public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] README.mx28: add
@ 2012-03-20 20:54 Otavio Salvador
  2012-03-20 23:14 ` Fabio Estevam
  2012-03-21 19:21 ` Marek Vasut
  0 siblings, 2 replies; 5+ messages in thread
From: Otavio Salvador @ 2012-03-20 20:54 UTC (permalink / raw)
  To: u-boot

This is mainline a copy of README.m28 changing the references to the
mx28 counterpart but it makes easy for people looking for information
about mx28 based boards.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 doc/README.mx28 |  224 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 224 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.mx28

diff --git a/doc/README.mx28 b/doc/README.mx28
new file mode 100644
index 0000000..0e6114c
--- /dev/null
+++ b/doc/README.mx28
@@ -0,0 +1,224 @@
+Freescale MX28EVK
+================
+
+This document describes the Freescale MX28/MX28EVK U-Boot port. This document mostly
+covers topics related to making the module/board bootable.
+
+Terminology
+-----------
+
+The dollar symbol ($) introduces a snipped of shell code. This shall be typed
+into the unix command prompt in U-Boot source code root directory.
+
+The (=>) introduces a snipped of code that should by typed into U-Boot command
+prompt.
+
+Contents
+--------
+
+0) Files of the MX28/MX28EVK port
+1) Prerequisites
+2) Compiling U-Boot for MX28
+3) Installation of U-Boot for MX28EVK to SD card
+4) Installation of U-Boot for MX28 to NAND flash
+
+0) Files of the MX28/MX28EVK port
+---------------------------------
+
+arch/arm/cpu/arm926ejs/mx28/	- The CPU support code for the Freescale i.MX28
+arch/arm/include/asm/arch-mx28/	- Header files for the Freescale i.MX28
+board/denx/mx28evk/		- MX28EVK board specific files
+include/configs/mx28evk.h	- MX28EVK configuration file
+
+1) Prerequisites
+----------------
+
+To make the MX28 module or the MX28 module or MX28EVK board bootable, some tools
+are necessary. The first one is the "elftosb" tool distributed by Freescale
+Semiconductor. The other tool is the "mxsboot" tool found in U-Boot source tree.
+
+Firstly, obtain the elftosb archive from the following location:
+
+	http://foss.doredevelopment.dk/mirrors/imx/elftosb-10.12.01.tar.gz
+
+We use a $VER variable here to denote the current version. At the time of
+writing of this document, that is "10.12.01". To obtain the file from command
+line, use:
+
+	$ VER="10.12.01"
+	$ wget http://foss.doredevelopment.dk/mirrors/imx/elftosb-${VER}.tar.gz
+
+Extract the file:
+
+	$ tar xzf elftosb-${VER}.tar.gz
+
+Compile the file. We need to manually tell the linker to use also libm:
+
+	$ cd elftosb-${VER}/
+	$ make LIBS="-lstdc++ -lm" elftosb
+
+Optionally, remove debugging symbols from elftosb:
+
+	$ strip bld/linux/elftosb
+
+Finally, install the "elftosb" binary. The "install" target is missing, so just
+copy the binary by hand:
+
+	$ sudo cp bld/linux/elftosb /usr/local/bin/
+
+Make sure the "elftosb" binary can be found in your $PATH, in this case this
+means "/usr/local/bin/" has to be in your $PATH.
+
+2) Compiling U-Boot for MX28
+----------------------------
+
+Compiling the U-Boot for MX28 is straightforward and done as compiling U-Boot
+for any other ARM device. For cross-compiler setup, please refer to ELDK5.0
+documentation. First, clean up the source code:
+
+	$ make mrproper
+
+Next, configure U-Boot for MX28EVK:
+
+	$ make mx28evk_config
+
+Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special
+type of file, which the i.MX28 CPU can boot. This is handled by the following
+command:
+
+	$ make u-boot.sb
+
+HINT: To speed-up the build process, you can add -j<N>, where N is number of
+      compiler instances that'll run in parallel.
+
+The code produces "u-boot.sb" file. This file needs to be augmented with a
+proper header to allow successful boot from SD or NAND. Adding the header is
+discussed in the following chapters.
+
+3) Installation of U-Boot for MX28EVK to SD card
+------------------------------------------------
+
+To boot an MX28 from SD, set the boot mode DIP switches according to i.MX28
+manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on SSP0, 3.3V.
+
+An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition
+table, which in turn carries a partition of special type and which contains a
+special header. The rest of partitions in the DOS partition table can be used
+by the user.
+
+To prepare such partition, use your favourite partitioning tool. The partition
+must have the following parameters:
+
+	* Start sector .......... sector 2048
+	* Partition size ........ at least 1024 kb
+	* Partition type ........ 0x53 (sometimes "OnTrack DM6 Aux3")
+
+For example in Linux fdisk, the sequence for a clear card follows. Be sure to
+run fdisk with the option "-u=sectors" to set units to sectors:
+
+	* o ..................... create a clear partition table
+	* n ..................... create new partition
+		* p ............. primary partition
+		* 1 ............. first partition
+		* 2048 .......... first sector is 2048
+		* +1M ........... make the partition 1Mb big
+	* t 1 ................... change first partition ID
+		* 53 ............ change the ID to 0x53 (OnTrack DM6 Aux3)
+	* <create other partitions>
+	* w ..................... write partition table to disk
+
+The partition layout is ready, next the special partition must be filled with
+proper contents. The contents is generated by running the following command (see
+chapter 2)):
+
+	$ ./tools/mxsboot sd u-boot.sb u-boot.sd
+
+The resulting file, "u-boot.sd", shall then be written to the partition. In this
+case, we assume the first partition of the SD card is /dev/mmcblk0p1:
+
+	$ dd if=u-boot.sd of=/dev/mmcblk0p1
+
+Last step is to insert the card into MX28EVK and boot.
+
+NOTE: If the user needs to adjust the start sector, the "mxsboot" tool contains
+      a "-p" switch for that purpose. The "-p" switch takes the sector number as
+      an argument.
+
+4) Installation of U-Boot for MX28 to NAND flash
+-----------------------------------------------
+
+To boot an MX28 from NAND, set the boot mode DIP switches according to i.MX28
+manual chapter 12.2.1 (Table 12-2), PORT=GPMI, NAND 1.8 V.
+
+There are two possibilities when preparing an image writable to NAND flash.
+
+	I) The NAND wasn't written at all yet or the BCB is broken
+	----------------------------------------------------------
+	   In this case, both BCB (FCB and DBBT) and firmware needs to be
+	   written to NAND. To generate NAND image containing all these,
+	   there is a tool called "mxsboot" in the "tools/" directory. The tool
+	   is invoked on "u-boot.sb" file from chapter 2):
+
+		 $ ./tools/mxsboot nand u-boot.sb u-boot.nand
+
+	   NOTE: The above invokation works for NAND flash with geometry of
+		 2048b per page, 64b OOB data, 128kb erase size. If your chip
+		 has a different geometry, please use:
+
+		 -w <size>	change page size (default 2048 b)
+		 -o <size>	change oob size (default 64 b)
+		 -e <size>	change erase size (default 131072 b)
+
+		 The geometry information can be obtained from running U-Boot
+		 on MX28 by issuing the "nand info" command.
+
+	   The resulting file, "u-boot.nand" can be written directly to NAND
+	   from the U-Boot prompt. To simplify the process, the U-Boot default
+	   environment contains script "update_nand_full" to update the system.
+
+	   This script expects a working TFTP server containing the file
+	   "u-boot.nand" in it's root directory. This can be changed by
+	   adjusting the "update_nand_full_filename" varible.
+
+	   To update the system, run the following in U-Boot prompt:
+
+		 => run update_nand_full
+
+	   In case you would only need to update the bootloader in future,
+	   see II) below.
+
+	II) The NAND was already written with a good BCB
+	------------------------------------------------
+	   This part applies after the part I) above was done at least once.
+
+	   If part I) above was done correctly already, there is no need to
+	   write the FCB and DBBT parts of NAND again. It's possible to upgrade
+	   only the bootloader image.
+
+	   To simplify the process of firmware update, the U-Boot default
+	   environment contains script "update_nand_firmware" to update only
+	   the firmware, without rewriting FCB and DBBT.
+
+	   This script expects a working TFTP server containing the file
+	   "u-boot.sb" in it's root directory. This can be changed by
+	   adjusting the "update_nand_firmware_filename" varible.
+
+	   To update the system, run the following in U-Boot prompt:
+
+		 => run update_nand_firmware
+
+	III) Special settings for the update scripts
+	--------------------------------------------
+	   There is a slight possibility of the user wanting to adjust the
+	   STRIDE and COUNT options of the NAND boot. For description of these,
+	   see i.MX28 manual section 12.12.1.2 and 12.12.1.3.
+
+	   The update scripts take this possibility into account. In case the
+	   user changes STRIDE by blowing fuses, the user also has to change
+	   "update_nand_stride" variable. In case the user changes COUNT by
+	   blowing fuses, the user also has to change "update_nand_count"
+	   variable for the update scripts to work correctly.
+
+	   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.
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] README.mx28: add
  2012-03-20 20:54 [U-Boot] [PATCH] README.mx28: add Otavio Salvador
@ 2012-03-20 23:14 ` Fabio Estevam
  2012-03-21 19:21 ` Marek Vasut
  1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-03-20 23:14 UTC (permalink / raw)
  To: u-boot

Hi Otavio,

On Tue, Mar 20, 2012 at 5:54 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> This is mainline a copy of README.m28 changing the references to the
> mx28 counterpart but it makes easy for people looking for information
> about mx28 based boards.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> ?doc/README.mx28 | ?224 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ?1 files changed, 224 insertions(+), 0 deletions(-)
> ?create mode 100644 doc/README.mx28

Thanks for working on this. This README is an item that has been for a
long time on my todo list.

> diff --git a/doc/README.mx28 b/doc/README.mx28
> new file mode 100644
> index 0000000..0e6114c
> --- /dev/null
> +++ b/doc/README.mx28
> @@ -0,0 +1,224 @@
> +Freescale MX28EVK
> +================
> +
> +This document describes the Freescale MX28/MX28EVK U-Boot port. This document mostly

Only "MX28EVK" is enough. I would also add "Only the latest revision
of MX28EVK (rev D) is supported"

...
> +
> +0) Files of the MX28/MX28EVK port

Keep only "MX28EVK"

> +1) Prerequisites
> +2) Compiling U-Boot for MX28

for "MX28EVK"

> +3) Installation of U-Boot for MX28EVK to SD card
> +4) Installation of U-Boot for MX28 to NAND flash

Please remove item 4). We have not added NAND support to mx28evk yet.

This can be added later after we add NAND support.

> +
> +0) Files of the MX28/MX28EVK port

Keep only "MX28EVK

...

> +2) Compiling U-Boot for MX28

for "MX28EVK"

...

> +3) Installation of U-Boot for MX28EVK to SD card
> +------------------------------------------------
> +
> +To boot an MX28 from SD, set the boot mode DIP switches according to i.MX28
> +manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on SSP0, 3.3V.

Please add the jumper settings below for the mx28evk:

"- Boot Mode Select: 1 0 0 1 (Boot from SD card Slot 0 - U42)

- JTAG PSWITCH RESET: To the left (reset enabled)

- Battery Source: Down

- Wall 5V: Up

- VDD 5V: To the left (off)

- Hold Button: Down (off)"

> +
> +An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition

"An SD card that can be used to boot U-Boot on a i.MX28 CPU must contain"

...

> +4) Installation of U-Boot for MX28 to NAND flash

Please remove this section for now.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] README.mx28: add
  2012-03-20 20:54 [U-Boot] [PATCH] README.mx28: add Otavio Salvador
  2012-03-20 23:14 ` Fabio Estevam
@ 2012-03-21 19:21 ` Marek Vasut
  2012-03-21 19:24   ` Otavio Salvador
  1 sibling, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2012-03-21 19:21 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> This is mainline a copy of README.m28 changing the references to the
> mx28 counterpart but it makes easy for people looking for information
> about mx28 based boards.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>

This is copy-paste schizzle, can you please separate the CPU specific parts into 
one file and put only the different parts into their particular readmes?

Thanks!

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] README.mx28: add
  2012-03-21 19:21 ` Marek Vasut
@ 2012-03-21 19:24   ` Otavio Salvador
  2012-03-21 19:27     ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Otavio Salvador @ 2012-03-21 19:24 UTC (permalink / raw)
  To: u-boot

On Wed, Mar 21, 2012 at 16:21, Marek Vasut <marek.vasut@gmail.com> wrote:
> This is copy-paste schizzle, can you please separate the CPU specific parts into
> one file and put only the different parts into their particular readmes?

If you compare the v3 against the m28 one it is not a copy-paste
anymore; it does has specific information and remove the
not-applicable one. The v3 seems fine to me as is and makes easier to
new users to find the desired information.

-- 
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] README.mx28: add
  2012-03-21 19:24   ` Otavio Salvador
@ 2012-03-21 19:27     ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2012-03-21 19:27 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Wed, Mar 21, 2012 at 16:21, Marek Vasut <marek.vasut@gmail.com> wrote:
> > This is copy-paste schizzle, can you please separate the CPU specific
> > parts into one file and put only the different parts into their
> > particular readmes?
> 
> If you compare the v3 against the m28 one it is not a copy-paste
> anymore; it does has specific information and remove the
> not-applicable one. The v3 seems fine to me as is and makes easier to
> new users to find the desired information.

See my response, also next time please bother to Cc me, your chances of review 
of the patch rise a lot by doing so ... thanks ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-21 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 20:54 [U-Boot] [PATCH] README.mx28: add Otavio Salvador
2012-03-20 23:14 ` Fabio Estevam
2012-03-21 19:21 ` Marek Vasut
2012-03-21 19:24   ` Otavio Salvador
2012-03-21 19:27     ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox