From patchwork Wed Dec 21 11:00:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 707727 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 3tkBZl3sZkz9t0v for ; Wed, 21 Dec 2016 22:02:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A9A90B395E; Wed, 21 Dec 2016 12:02:20 +0100 (CET) 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 OAON8z5PlzRe; Wed, 21 Dec 2016 12:02:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A1585B3936; Wed, 21 Dec 2016 12:02:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DA14B3915 for ; Wed, 21 Dec 2016 12:01:43 +0100 (CET) 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 D4tpwHPE-IcH for ; Wed, 21 Dec 2016 12:01:43 +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-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by theia.denx.de (Postfix) with ESMTPS id 07DC9B390A for ; Wed, 21 Dec 2016 12:01:37 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id g23so29835471wme.1 for ; Wed, 21 Dec 2016 03:01:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rlsMZg2eqB2AzV9u0OvTqxT8ZmQxwRAnJP6qeJLcoAM=; b=umiRgLYqtJk65EcNr2FGdjroczg3aKL6HOyYQ//s6bJeIxbRQHuy0pJWBZxONjIOcZ jx9XU4uTbMIx/6O8TDJ0rC9sZdSTHiV6MDcnJrTyYuEW+nog/uQxl47yE3J24s1hWKWY 0OEuu08q0aZsIcSJvpJuEOo1dv26y2fmbC0JJJ3cXBoff6hPjr78v2DXFCHza6kjNuZK jmk9dPC/BI9UXqJwYQIrJinv1+TPOykx1tjOB+BTEsf5XP34eA75nt/IJkdBVlON8SFI 3Q4PXU3S523RkN2ZECaHl40MPTI1lShD51UPKFWEAB+uE9nTgBHForbQIxoTp5Li0knV a5cw== X-Gm-Message-State: AIkVDXLxbkxThnsWBLjuzrJ/cPpfhdF4BbonZ8n5nm3SC78D23Z628PLE8dAu1kK5Ko5Fw== X-Received: by 10.28.48.7 with SMTP id w7mr4129299wmw.115.1482318097501; Wed, 21 Dec 2016 03:01:37 -0800 (PST) Received: from jagan-XPS-13-9350.homenet.telecomitalia.it (host47-201-static.1-79-b.business.telecomitalia.it. [79.1.201.47]) by smtp.gmail.com with ESMTPSA id l2sm30026430wji.7.2016.12.21.03.01.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Dec 2016 03:01:36 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Wed, 21 Dec 2016 12:00:25 +0100 Message-Id: <1482318029-21701-7-git-send-email-jagan@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482318029-21701-1-git-send-email-jagan@openedev.com> References: <1482318029-21701-1-git-send-email-jagan@openedev.com> Cc: u-boot@lists.denx.de, Matteo Lisi Subject: [U-Boot] [PATCH 06/10] imx6: engicam: Add nandboot env support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Jagan Teki Add config options for booting Linux from NAND in UBI format. Cc: Stefano Babic Cc: Matteo Lisi Cc: Michael Trimarchi Signed-off-by: Jagan Teki --- include/configs/imx6qdl_icore.h | 21 +++++++++++++++++++-- include/configs/imx6ul_geam.h | 21 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/include/configs/imx6qdl_icore.h b/include/configs/imx6qdl_icore.h index 55eb100..9d5951f 100644 --- a/include/configs/imx6qdl_icore.h +++ b/include/configs/imx6qdl_icore.h @@ -47,9 +47,12 @@ "mmcdev=0\0" \ "mmcpart=1\0" \ "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ + "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ "mmcautodetect=yes\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=${mmcroot}\0" \ + "ubiargs=setenv bootargs console=${console},${baudrate} " \ + "ubi.mtd=5 root=${nandroot} ${mtdparts}\0" \ "loadbootscript=" \ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ "bootscript=echo Running bootscript from mmc ...; " \ @@ -70,9 +73,22 @@ "fi; " \ "else " \ "bootm; " \ - "fi\0" + "fi\0" \ + "nandboot=echo Booting from nand ...; " \ + "if mtdparts; then " \ + "echo Starting nand boot ...; " \ + "else " \ + "mtdparts default; " \ + "fi; " \ + "run ubiargs; " \ + "nand read ${loadaddr} kernel 0x800000; " \ + "nand read ${fdt_addr} dtb 0x100000; " \ + "bootm ${loadaddr} - ${fdt_addr}\0" -#define CONFIG_BOOTCOMMAND \ +#ifdef CONFIG_NAND_MXS +# define CONFIG_BOOTCOMMAND "run nandboot" +#else +# define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev};" \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run loadbootscript; then " \ @@ -83,6 +99,7 @@ "fi; " \ "fi; " \ "fi" +#endif /* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x80000000 diff --git a/include/configs/imx6ul_geam.h b/include/configs/imx6ul_geam.h index 3e26a81..507e743 100644 --- a/include/configs/imx6ul_geam.h +++ b/include/configs/imx6ul_geam.h @@ -46,9 +46,12 @@ "mmcdev=0\0" \ "mmcpart=1\0" \ "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ + "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ "mmcautodetect=yes\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=${mmcroot}\0" \ + "ubiargs=setenv bootargs console=${console},${baudrate} " \ + "ubi.mtd=5 root=${nandroot} ${mtdparts}\0" \ "loadbootscript=" \ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ "bootscript=echo Running bootscript from mmc ...; " \ @@ -69,9 +72,22 @@ "fi; " \ "else " \ "bootm; " \ - "fi\0" + "fi\0" \ + "nandboot=echo Booting from nand ...; " \ + "if mtdparts; then " \ + "echo Starting nand boot ...; " \ + "else " \ + "mtdparts default; " \ + "fi; " \ + "run ubiargs; " \ + "nand read ${loadaddr} kernel 0x800000; " \ + "nand read ${fdt_addr} dtb 0x100000; " \ + "bootm ${loadaddr} - ${fdt_addr}\0" -#define CONFIG_BOOTCOMMAND \ +#ifdef CONFIG_NAND_MXS +# define CONFIG_BOOTCOMMAND "run nandboot" +#else +# define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev};" \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run loadbootscript; then " \ @@ -82,6 +98,7 @@ "fi; " \ "fi; " \ "fi" +#endif /* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x80000000