All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 11/16] sunxi: Enable UBI and NAND support
Date: Thu, 2 Mar 2017 16:32:57 +0800	[thread overview]
Message-ID: <CAGb2v66L1-XRYtJ7DUQGRg-aG-=x9vgF7nEC_+po5-vbsX9PoA@mail.gmail.com> (raw)
In-Reply-To: <26ffbdb85f0733dd3d2908aaa3a99e0067c0857d.1488215509.git-series.maxime.ripard@free-electrons.com>

Hi,

On Tue, Feb 28, 2017 at 1:22 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> From: Hans de Goede <hdegoede@redhat.com>
>
> Enable the NAND and UBI support in the configuration header so that we can
> (finally) use it.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  cmd/Kconfig                    | 4 ++++
>  include/configs/sunxi-common.h | 3 +++
>  2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 4e7c0fbcdee5..8e2a05de82ea 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -438,12 +438,14 @@ config CMD_MMC
>
>  config CMD_NAND
>         bool "nand"
> +       default y if ARCH_SUNXI

This breaks builds for Allwinner/sunxi SoCs that don't have NAND support:

  CC      cmd/nand.o
cmd/nand.c: In function 'set_dev':
cmd/nand.c:118:24: error: 'CONFIG_SYS_MAX_NAND_DEVICE' undeclared
(first use in this function)
  if (dev < 0 || dev >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[dev]) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
cmd/nand.c:118:24: note: each undeclared identifier is reported only
once for each function it appears in
cmd/nand.c: In function 'do_nand':
cmd/nand.c:400:19: error: 'CONFIG_SYS_MAX_NAND_DEVICE' undeclared
(first use in this function)
   for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
cmd/nand.c: In function 'do_nandboot':
cmd/nand.c:994:24: error: 'CONFIG_SYS_MAX_NAND_DEVICE' undeclared
(first use in this function)
  if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx]) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:280: recipe for target 'cmd/nand.o' failed
make[1]: *** [cmd/nand.o] Error 1
Makefile:1229: recipe for target 'cmd' failed
make: *** [cmd] Error 2


And if CONFIG_SYS_MAX_NAND_DEVICE is fixed by moving it into a separate
#ifdef CONFIG_CMD_NAND, we then get:

  CC      drivers/mtd/nand/nand.o
drivers/mtd/nand/nand.c:15:37: error: 'CONFIG_SYS_NAND_BASE'
undeclared here (not in a function)
 #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
                                     ^
drivers/mtd/nand/nand.c:27:57: note: in expansion of macro
'CONFIG_SYS_NAND_BASE_LIST'
 static ulong base_address[CONFIG_SYS_MAX_NAND_DEVICE] =
CONFIG_SYS_NAND_BASE_LIST;

^~~~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:280: recipe for target 'drivers/mtd/nand/nand.o' failed
make[1]: *** [drivers/mtd/nand/nand.o] Error 1
Makefile:1229: recipe for target 'drivers/mtd/nand' failed
make: *** [drivers/mtd/nand] Error 2

I don't think we define CONFIG_SYS_NAND_BASE or
CONFIG_SYS_NAND_BASE_LIST anywhere though.

Regards
ChenYu

>         help
>           NAND support.
>
>  if CMD_NAND
>  config CMD_NAND_TRIMFFS
>         bool "nand write.trimffs"
> +       default y if ARCH_SUNXI
>         help
>           Allows one to skip empty pages when flashing something on a NAND.
>
> @@ -845,6 +847,7 @@ config CMD_UBI
>         tristate "Enable UBI - Unsorted block images commands"
>         select CRC32
>         select MTD_UBI
> +       default y if ARCH_SUNXI
>         help
>           UBI is a software layer above MTD layer which admits use of LVM-like
>           logical volumes on top of MTD devices, hides some complexities of
> @@ -858,6 +861,7 @@ config CMD_UBIFS
>         select CRC32
>         select RBTREE if ARCH_SUNXI
>         select LZO if ARCH_SUNXI
> +       default y if ARCH_SUNXI
>         help
>           UBIFS is a file system for flash devices which works on top of UBI.
>
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index b9cf315af58d..b1af756a6ac9 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -132,6 +132,9 @@
>  #define CONFIG_SYS_NAND_MAX_ECCPOS 1664
>  #define CONFIG_SYS_NAND_ONFI_DETECTION
>  #define CONFIG_SYS_MAX_NAND_DEVICE 8
> +
> +#define CONFIG_MTD_DEVICE
> +#define CONFIG_MTD_PARTITIONS
>  #endif
>
>  #ifdef CONFIG_SPL_SPI_SUNXI
> --
> git-series 0.8.11
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/listinfo/u-boot

  reply	other threads:[~2017-03-02  8:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 17:21 [U-Boot] [PATCH v5 0/16] sunxi: Add support for the CHIP Pro Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 1/16] nand: sunxi: Fix modulo by zero error Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 2/16] bch: Allow to build for the host Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 3/16] tools: sunxi: Add spl image builder Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 4/16] common: Move environment choice to Kconfig Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 5/16] cmd: Add Kconfig option for CMD_MTDPARTS and related options Maxime Ripard
2017-05-30  7:39   ` Jörg Krause
2017-05-30 21:09     ` Maxime Ripard
2017-05-31  6:27       ` Jörg Krause
2017-05-31 19:47         ` Maxime Ripard
2017-06-01  5:53           ` Jörg Krause
2017-06-01  5:57           ` Jörg Krause
2017-02-27 17:22 ` [U-Boot] [PATCH v5 6/16] mtd: ubi: Select RBTREE option from MTD_UBI Kconfig entry Maxime Ripard
2017-02-27 17:49   ` Boris Brezillon
2017-02-27 17:22 ` [U-Boot] [PATCH v5 7/16] cmd: Expose a Kconfig option to enable UBIFS commands Maxime Ripard
2017-05-30  7:42   ` Jörg Krause
2017-02-27 17:22 ` [U-Boot] [PATCH v5 8/16] cmd: nand: Expose optional suboptions in Kconfig Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 9/16] mtd: sunxi: Select the U-Boot location config option Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 10/16] mtd: sunxi: Change U-Boot offset Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 11/16] sunxi: Enable UBI and NAND support Maxime Ripard
2017-03-02  8:32   ` Chen-Yu Tsai [this message]
2017-02-27 17:22 ` [U-Boot] [PATCH v5 12/16] sunxi: Add the default mtdids and mtdparts to our env Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 13/16] nand: sunxi: Add options for the SPL NAND configuration Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 14/16] scripts: sunxi: Build an raw SPL image Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 15/16] sunxi: Sync GR8 DTS and AXP209 with the kernel Maxime Ripard
2017-02-27 17:22 ` [U-Boot] [PATCH v5 16/16] sunxi: Add support for the CHIP Pro Maxime Ripard
2017-03-01 15:58   ` Tom Rini
2017-03-03 14:48     ` Maxime Ripard
2017-03-03 15:00       ` Tom Rini
2017-02-28 14:19 ` [U-Boot] [PATCH v5 0/16] " Jagan Teki

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='CAGb2v66L1-XRYtJ7DUQGRg-aG-=x9vgF7nEC_+po5-vbsX9PoA@mail.gmail.com' \
    --to=wens@csie.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.