From patchwork Thu Jul 25 07:27:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo Serra X-Patchwork-Id: 261600 X-Patchwork-Delegate: trini@ti.com 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 15D4B2C0084 for ; Thu, 25 Jul 2013 17:29:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C0494A047; Thu, 25 Jul 2013 09:29:00 +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 TrGOZ4ERnPjA; Thu, 25 Jul 2013 09:28:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5719E4A056; Thu, 25 Jul 2013 09:28:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F3C84A032 for ; Thu, 25 Jul 2013 09:28:28 +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 P3C+vVakAC2S for ; Thu, 25 Jul 2013 09:28:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by theia.denx.de (Postfix) with ESMTPS id 9CE6C4A01F for ; Thu, 25 Jul 2013 09:28:13 +0200 (CEST) Received: by mail-wg0-f48.google.com with SMTP id f12so676788wgh.3 for ; Thu, 25 Jul 2013 00:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=oA6FuAK64/w+097OJc1vVMrB5NGO/f0JZJyiYEMMjqg=; b=RGWLz9ySynSFxuQPd4ZB7/yNnmM2iJ4YvFxlh577gKb46tJSOIGvADXZDM12cpCKGc cLsUUwlGezaEfp05RsW4SXLDnfS3CoLIlx6l84GboN87WWK4PLVdi+pZtcFunyLS+G4I r/IUHo3GytUMwCGIC0k2N0Y6vqZd+oXdIPz8HUdWeaN52yEZLm+tkPV3Wvv37H7QKl9j LCuPoISl92ImT6vtTWW1zt2MRcRKNk86dSo6rPlkfxmzSHpewFezws4pO4j9R+VsHXuh YAVHbjsmdccWN2ijeIwg8nNv4Qpd+6rOTPL2cTG/xot9UeDy4Fo+bThGeGPkzf7BpDCF cWaQ== X-Received: by 10.194.237.38 with SMTP id uz6mr29700521wjc.73.1374737292739; Thu, 25 Jul 2013 00:28:12 -0700 (PDT) Received: from localhost.localdomain (43.Red-2-139-180.staticIP.rima-tde.net. [2.139.180.43]) by mx.google.com with ESMTPSA id hb2sm1647605wib.0.2013.07.25.00.28.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 00:28:12 -0700 (PDT) From: Enric Balletbo i Serra To: Date: Thu, 25 Jul 2013 09:27:39 +0200 Message-Id: <1374737260-4268-5-git-send-email-eballetbo@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374737260-4268-1-git-send-email-eballetbo@gmail.com> References: <1374737260-4268-1-git-send-email-eballetbo@gmail.com> Cc: trini@ti.com, Enric Balletbo i Serra Subject: [U-Boot] [PATCH 4/5] ARM: IGEP0033: Add support to boot from NAND. 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: Enric Balletbo i Serra Add to the default environment the possibily to boot from NAND using a ubi rootfs. Also the partition scheme is set as follows: Start Size SPL : 0x00000000 0x00080000 (512KiB) U-Boot : 0x00080000 0x00100000 (1MiB) U-Boot Env : 0x00180000 0x00020000 (128KiB) File System : 0x001C0000 - The ubiboot script gets the kernel and the dtb file from the boot directory of the File System. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Javier Martinez Canillas --- include/configs/igep0033.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/include/configs/igep0033.h b/include/configs/igep0033.h index be210a5..3d08cfa 100644 --- a/include/configs/igep0033.h +++ b/include/configs/igep0033.h @@ -62,6 +62,10 @@ #define CONFIG_CMD_UBI #define CONFIG_CMD_UBIFS +/* Make the verbose messages from UBI stop printing */ +#define CONFIG_UBI_SILENCE_MSG +#define CONFIG_UBIFS_SILENCE_MSG + #define CONFIG_BOOTDELAY 1 /* negative for no autoboot */ #define CONFIG_ENV_VARS_UBOOT_CONFIG #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG @@ -72,21 +76,34 @@ "bootfile=zImage\0" \ "dtbfile=am335x-base0033.dtb\0" \ "console=ttyO0,115200n8\0" \ + "mtdids=" MTDIDS_DEFAULT "\0" \ + "mtdparts=" MTDPARTS_DEFAULT "\0" \ "mmcdev=0\0" \ "mmcroot=/dev/mmcblk0p2 rw\0" \ + "ubiroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \ "mmcrootfstype=ext4 rootwait\0" \ + "ubirootfstype=ubifs rootwait\0" \ "mmcargs=setenv bootargs console=${console} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype}\0" \ + "ubiargs=setenv bootargs console=${console} " \ + "root=${ubiroot} " \ + "rootfstype=${ubirootfstype}\0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t ${loadaddr} ${filesize}\0" \ "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \ "load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \ + "ubiload=ubi part filesystem 2048; ubifsmount ubi0; " \ + "ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \ + "ubifsload ${dtbaddr} ${bootdir}/${dtbfile} \0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootz ${loadaddr} - ${dtbaddr}\0" \ + "ubiboot=echo Booting from nand (ubifs) ...; " \ + "run ubiargs; run ubiload; " \ + "bootz ${loadaddr} - ${dtbaddr}\0" \ #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \ @@ -102,6 +119,8 @@ "if run mmcload; then " \ "run mmcboot;" \ "fi;" \ + "else " \ + "run ubiboot;" \ "fi;" \ /* Max number of command args */ @@ -181,18 +200,21 @@ #define CONFIG_SYS_MAX_NAND_DEVICE 1 #define CONFIG_SYS_NAND_ONFI_DETECTION 1 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT #define CONFIG_ENV_IS_IN_NAND -#define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */ +#define CONFIG_ENV_OFFSET 0x180000 /* environment starts here */ +#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_OFFSET + CONFIG_SYS_ENV_SECT_SIZE) +#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE) #define CONFIG_MTD_PARTITIONS #define CONFIG_MTD_DEVICE #define CONFIG_RBTREE #define CONFIG_LZO -#define MTDIDS_DEFAULT "nand0=nand" -#define MTDPARTS_DEFAULT "mtdparts=nand:512k(SPL),"\ - "1m(U-Boot),128k(U-Boot Env),"\ - "5m(Kernel),-(File System)" +#define MTDIDS_DEFAULT "nand0=omap2-nand.0" +#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(spl),"\ + "1m(uboot),256k(environment),"\ + "-(filesystem)" /* Unsupported features */ #undef CONFIG_USE_IRQ