From patchwork Fri May 3 15:51:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 241335 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AB5A92C00BE for ; Sat, 4 May 2013 01:51:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF3DC4A60C; Fri, 3 May 2013 17:51:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PKzBhEWrxrHA; Fri, 3 May 2013 17:51:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D63D4A606; Fri, 3 May 2013 17:51:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A6C914A606 for ; Fri, 3 May 2013 17:51:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QxI+sqzUaoAh for ; Fri, 3 May 2013 17:51:29 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by theia.denx.de (Postfix) with ESMTPS id 96FE24A605 for ; Fri, 3 May 2013 17:51:23 +0200 (CEST) Received: by mail-vc0-f174.google.com with SMTP id hf12so1555970vcb.33 for ; Fri, 03 May 2013 08:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=LZs+sV8Z7UXm/arW2AFByngqHfXuestjvdOem+vTnTc=; b=zowXhwHNuHxBHPKXF2n0c9PhxnjXf/9cMAvKR3r31xEple5bLlcHf4IEsNqx68UAln YyEt3llt9/zn0w39MpaYIGHjv3AvHnWvYNCtEvFnkbS03M44DQ8Pbt2dYomSDeESFq74 MGtwAhNypJdaXI6kGB7q2fE7Hmz8yFNR9DB1uLs8grZNCuYIikxY2T/CQRLXJlmQ2lwf 1JpVlXJ9PjMdcwiqYLz3ix0RYaJNcgr0lq3egiB33zaM/7HcQvt6o8dXqHIoSA5wlT3N LK8Zew5Um4kdnM3gjvV0T5bc47OL1V4C3gu/FtewDz24BI4BDtdsMqzXssOGndChKmK1 /E6w== X-Received: by 10.58.80.4 with SMTP id n4mr3822326vex.5.1367596280037; Fri, 03 May 2013 08:51:20 -0700 (PDT) Received: from localhost.localdomain ([187.106.36.101]) by mx.google.com with ESMTPSA id 6sm8819720vei.0.2013.05.03.08.51.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 08:51:19 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Date: Fri, 3 May 2013 12:51:09 -0300 Message-Id: <1367596269-20147-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 Cc: marex@denx.de, u-boot@lists.denx.de, Fabio Estevam , otavio@ossystems.com.br Subject: [U-Boot] [PATCH] mx23: Add a README file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Fabio Estevam Provide instructions on how to build U-boot and flash the binary into an SD card for a mx23 based platform. Signed-off-by: Fabio Estevam --- doc/README.mx23_common | 145 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 doc/README.mx23_common diff --git a/doc/README.mx23_common b/doc/README.mx23_common new file mode 100644 index 0000000..dcf0ba4 --- /dev/null +++ b/doc/README.mx23_common @@ -0,0 +1,145 @@ +Booting U-boot on a MX23 processor +================================== + +This document describes the MX23 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 +-------- + +1) Prerequisites +2) Compiling U-Boot for a MX23 based board +3) Installation of U-Boot for a MX23 based board to SD card + +1) Prerequisites +---------------- + +To make a MX23 based board bootable, some tools are necessary. The first one +is the "elftosb" tool distributed by Freescale Semiconductor. The other one +is the "mxsboot" tool found in U-Boot source tree. + +Firstly, obtain the elftosb archive from the following location: + + ftp://ftp.denx.de/pub/tools/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 ftp://ftp.denx.de/pub/tools/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 a MX23 based board +------------------------------------------- + +Compiling the U-Boot for a MX23 board 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 a MX23 based board + + $ make _config + +Examples: + +1. For building U-boot for Freescale MX23EVK board: + + $ make mx23evk_config + +2. For building U-boot for Olimex MX23 Olinuxino board: + + $ make mx23_olinuxino_config + +Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special +type of file, which the i.MX23 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, 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 a MX23 based board to SD card +----------------------------------------------------------- + +To boot a MX23 based board from a SD connected to SSP1 or SSP2, set the boot +mode DIP switches according to i.MX23 manual section 35.1.2 (Table 35-3). + +An SD card the i.MX23 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) + * + * 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: + + $ sudo dd if=u-boot.sd of=/dev/mmcblk0p1; sync + +Last step is to insert the card into MX23 based board 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.