From patchwork Wed Jan 23 14:54:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 214975 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 EDE712C007B for ; Thu, 24 Jan 2013 01:50:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5416A4A133; Wed, 23 Jan 2013 15:50:10 +0100 (CET) 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 lPrh4HDekuIQ; Wed, 23 Jan 2013 15:50:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A132E4A0F9; Wed, 23 Jan 2013 15:50:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 53AE54A0F9 for ; Wed, 23 Jan 2013 15:50:07 +0100 (CET) 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 PxuOdNOUUUrU for ; Wed, 23 Jan 2013 15:50:06 +0100 (CET) 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-gh0-f182.google.com (mail-gh0-f182.google.com [209.85.160.182]) by theia.denx.de (Postfix) with ESMTPS id 6DA794A0EF for ; Wed, 23 Jan 2013 15:50:04 +0100 (CET) Received: by mail-gh0-f182.google.com with SMTP id z15so1320580ghb.27 for ; Wed, 23 Jan 2013 06:50:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=/N82OHAnVBS8iRfrJBE/n6DmVz0yNDsipnNUb6vq0ys=; b=i2wR+bo6q5SmlV2kKvqCvatZViLS0VTREtPRVEfU6lkfQuwVulE1YZCA46fqFd6shb kypPkNH+B3Z/G7bTGp2VSRA8di1VQWb16wnkz8SBRz+fdIMxmfm3hlzmp7a5GAbG7fCS jFeBVLmzZ14dritav7Mzra0q2r5HonLPMDCQI9E/G9T1fR7osuqf9+TUrw7/58iMpF7F CkHAzaxd65mhhtRu8Qa0hJQ3g042Kr5dCmK33XGTYq7sShy39pxAM5sUpqE0Pzx3OGwK 24QP9og2EV7Ravd1RdQsae9/jDvs8zOh0kILW9GrjZp+6bMBfRifA6gIS6blQyaWLM65 X9Mw== X-Received: by 10.236.162.69 with SMTP id x45mr1629906yhk.111.1358952603836; Wed, 23 Jan 2013 06:50:03 -0800 (PST) Received: from nano.lab.ossystems.com.br ([177.35.66.48]) by mx.google.com with ESMTPS id l14sm17841000anm.15.2013.01.23.06.50.01 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 06:50:03 -0800 (PST) From: Otavio Salvador To: u-boot@lists.denx.de Date: Wed, 23 Jan 2013 12:54:08 -0200 Message-Id: <1358952849-3217-1-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.8.1 Cc: Fabio Estevam , Marek Vasut , Otavio Salvador Subject: [U-Boot] [PATCH v3 1/2] mx23_olinuxino: Add default environment 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 Signed-off-by: Otavio Salvador --- Changes in v3: None Changes in v2: None include/configs/mx23_olinuxino.h | 75 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h index bc63481..a97598c 100644 --- a/include/configs/mx23_olinuxino.h +++ b/include/configs/mx23_olinuxino.h @@ -114,6 +114,14 @@ /* * MMC Driver */ +#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 +#define CONFIG_CMD_SAVEENV #ifdef CONFIG_CMD_MMC #define CONFIG_MMC #define CONFIG_BOUNCE_BUFFER @@ -127,21 +135,74 @@ #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 +/* + * Extra Environments + */ +#define CONFIG_EXTRA_ENV_SETTINGS \ + "update_sd_firmware_filename=u-boot.sd\0" \ + "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__ */