All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@dowhile0.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] ARM: IGEP0033: Add support to boot from NAND.
Date: Wed, 7 Aug 2013 18:03:47 +0200	[thread overview]
Message-ID: <CABxcv=kvDJ6nTEsB4X_zeoARR8TMwMMWUUcWzzbit3WE2SkgDA@mail.gmail.com> (raw)
In-Reply-To: <1374737260-4268-5-git-send-email-eballetbo@gmail.com>

On Thu, Jul 25, 2013 at 9:27 AM, Enric Balletbo i Serra
<eballetbo@gmail.com> wrote:
> From: Enric Balletbo i Serra <eballetbo@iseebcn.com>
>
> 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 <eballetbo@iseebcn.com>
> ---
>  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
> --
> 1.8.1.2
>

Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>

  reply	other threads:[~2013-08-07 16:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  7:27 [U-Boot] [PATCH 0/5] ARM: IGEP0033: Updates for next release Enric Balletbo i Serra
2013-07-25  7:27 ` [U-Boot] [PATCH 1/5] ARM: IGEP0033: Remove undef of CONFIG_CMD_MEMTEST Enric Balletbo i Serra
2013-08-07 15:59   ` Javier Martinez Canillas
2013-07-25  7:27 ` [U-Boot] [PATCH 2/5] ARM: IGEP0033: Add support for Flattened Device Tree Enric Balletbo i Serra
2013-08-07 16:01   ` Javier Martinez Canillas
2013-07-25  7:27 ` [U-Boot] [PATCH 3/5] ARM: IGEP0033: Remove CYGNUS name from header Enric Balletbo i Serra
2013-08-07 16:01   ` Javier Martinez Canillas
2013-07-25  7:27 ` [U-Boot] [PATCH 4/5] ARM: IGEP0033: Add support to boot from NAND Enric Balletbo i Serra
2013-08-07 16:03   ` Javier Martinez Canillas [this message]
2013-07-25  7:27 ` [U-Boot] [PATCH 5/5] ARM: IGEP0033: Remove duplicate / unused #defines Enric Balletbo i Serra
2013-08-07 16:14   ` Javier Martinez Canillas
2013-08-16 13:35 ` [U-Boot] [PATCH 0/5] ARM: IGEP0033: Updates for next release Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABxcv=kvDJ6nTEsB4X_zeoARR8TMwMMWUUcWzzbit3WE2SkgDA@mail.gmail.com' \
    --to=javier@dowhile0.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.