sunxi: Add support for the CHIP Pro
Subsystems (8)
v5 cover sunxi: Add support for the CHIP Pro
The CHIP Pro is a SoM made by NextThing Co, and that embeds a GR8 SIP, an AXP209 PMIC, a WiFi BT chip and a 512MB SLC NAND.
Since the first Allwinner device coming whit an SLC NAND that doesn't have the shortcomings (and breakages) the MLC NAND has, we can finally enable the NAND support on a board by default.
This is the occasion to introduce a bunch of additions needed imo to be able to come up with a sane NAND support for our users.
The biggest pain point is that the BROM uses a different ECC and randomizer configuration than for the rest of the NAND. In order to lessen the number of bitflips, you also need to pad with random data the SPL image.
Since it's quite tedious to do right (and most users won't be able to figure it out) and since if it is not done right, it will eventually turn into an unusable system (which is bad UX), we think that the best solution is to generate an SPL image that already embeds all this. We'll possible have to do the same thing for the U-Boot image (at least for the random padding) on MLC NANDs.
The only drawback from that is that you need to flash it raw, instead of using the usual nand write, but it's just a different command, nothing major anyway.
In order to flash it, from a device switched in FEL, on your host:
sunxi-fel spl spl/sunxi-spl.bin
sunxi-fel write 0x4a000000 u-boot-dtb.bin
sunxi-fel write 0x43000000 spl/sunxi-spl-with-ecc.bin sunxi-fel exe 0x4a000000
And on the board, once u-boot is running (assuming the NAND is already erased):
nand write.raw.noverify 0x43000000 0 40
nand write.raw.noverify 0x43000000 0x400000 40
nand write 0x4a000000 0x800000 0xc0000
I also encountered some weird bug in the private libgcc that prevents U-Boot from loading. Disabling CONFIG_USE_PRIVATE_LIBGCC fixes that.
Let me know what you think,
Maxime
Changes from v4:
- Rebased on top of last pull request
- Removed irrelevant config options
Changes from v3:
- Bring new Kconfig patches from Boris
- Do not define Kconfig defaults in our board Kconfig but directly in the option declaration
- Sync the DT with the kernel
- Fixed build breakages
Changes from v2:
- Move CMD_NAND and CMD_UBI default to cmd/Kconfig
- Define the env Kconfig options only for ARCH_SUNXI to avoid build breakages
- Define CMD_MTDPARTS only for ARCH_SUNXI
Changes from v1:
- Allowed to build lib/bch.c for the host, and used that in the image builder
- Fixed a bug in the NAND driver
- Wrote a documentation on how to flash a NAND image on an Allwinner board
- Fixed a few compilation breakages and issues
- Moved U-boot offset out of the config header and into Kconfig
- Moved the environment into UBI
- Moved the environment selection to Kconfig
- Moved the CMD_MTDPARTS options to Kconfig
- Provide MTDIDS_DEFAULT and MTDPARTS_DEFAULT options through Kconfig
- Added the tags from everyone
Boris Brezillon (3):
mtd: ubi: Select RBTREE option from MTD_UBI Kconfig entry
cmd: Expose a Kconfig option to enable UBIFS commands
cmd: nand: Expose optional suboptions in Kconfig
Hans de Goede (1):
sunxi: Enable UBI and NAND support
Maxime Ripard (12):
nand: sunxi: Fix modulo by zero error
bch: Allow to build for the host
tools: sunxi: Add spl image builder
common: Move environment choice to Kconfig
cmd: Add Kconfig option for CMD_MTDPARTS and related options
mtd: sunxi: Select the U-Boot location config option
mtd: sunxi: Change U-Boot offset
sunxi: Add the default mtdids and mtdparts to our env
nand: sunxi: Add options for the SPL NAND configuration
scripts: sunxi: Build an raw SPL image
sunxi: Sync GR8 DTS and AXP209 with the kernel
sunxi: Add support for the CHIP Pro
Makefile | 3 +- arch/arm/dts/Makefile | 1 +- arch/arm/dts/axp209.dtsi | 6 +- arch/arm/dts/sun5i-gr8-chip-pro.dts | 266 +++++++- arch/arm/dts/sun5i-gr8.dtsi | 1132 ++++++++++++++++++++++++++++- board/sunxi/README.nand | 54 +- cmd/Kconfig | 50 +- cmd/mtdparts.c | 8 +- common/Kconfig | 69 ++- configs/CHIP_pro_defconfig | 33 +- drivers/mtd/nand/Kconfig | 19 +- drivers/mtd/nand/sunxi_nand_spl.c | 7 +- drivers/mtd/ubi/Kconfig | 1 +- include/configs/sunxi-common.h | 33 +- include/environment.h | 2 +- lib/Kconfig | 5 +- lib/bch.c | 48 +- scripts/Makefile.spl | 15 +- tools/.gitignore | 1 +- tools/Makefile | 2 +- tools/sunxi-spl-image-builder.c | 484 ++++++++++++- 21 files changed, 2224 insertions(+), 15 deletions(-) create mode 100644 arch/arm/dts/sun5i-gr8-chip-pro.dts create mode 100644 arch/arm/dts/sun5i-gr8.dtsi create mode 100644 board/sunxi/README.nand create mode 100644 configs/CHIP_pro_defconfig create mode 100644 tools/sunxi-spl-image-builder.c
base-commit: 35affe7698e95c058a1f6c7eb2e1bf35f82461c9
Signature · 1 line
git-series 0.8.11
PATCH v5 1/16 nand: sunxi: Fix modulo by zero error
When trying to autodetect the ECC and randomization configurations, the driver starts with a randomization disabled and no seeds.
In this case, the number of seeds is obviously 0, and the randomize boolean is set to false.
However, the logic that retrieves the seed for a given page offset will blindly use the number of seeds, without testing if the randomization is enabled, basically doing a modulo by 0.
As it turns out, the libgcc in the common toolchain returns 0 here, which was our expected value in such a case, and why we would not detect it. However, U-Boot's libgcc will for some reason return from the function instead, resulting in an error to load the U-Boot binary in the SPL.
--- drivers/mtd/nand/sunxi_nand_spl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mtd/nand/sunxi_nand_spl.c +4 -3
@@ -245,7 +245,7 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs, {dma_addr_t dst = (dma_addr_t )dest;int nsectors = len / conf->ecc_size; -u16 rand_seed; +u16 rand_seed =0 ;u32 val;int page;
@@ -258,8 +258,9 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs,/* clear ecc status */ writel (0 ,SUNXI_NFC_BASE +NFC_ECC_ST ); -/* Choose correct seed */ - rand_seed = random_seed[page % conf->nseeds]; +/* Choose correct seed if randomized */ +if (conf->randomize) + rand_seed = random_seed[page % conf->nseeds]; writel((rand_seed << 16) | (conf->ecc_strength << 12) | (conf->randomize ? NFC_ECC_RANDOM_EN : 0) |
Signature · 1 line
git-series 0.8.11
PATCH v5 2/16 bch: Allow to build for the host
In reply to Maxime RipardWe will need the bch functions in the tool to generate the SPL images for the Allwinner SoCs.
Do the needed adjustments so that we can use it on the host.
--- lib/bch.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+), 0 deletions(-)
lib/bch.c +48 -0
@@ -54,10 +54,27 @@* finite fields GF(2^q). In Rapport de recherche INRIA no 2829, 1996. */ +#ifndef USE_HOSTCC #include <common.h> #include <ubi_uboot.h> #include <linux/bitops.h> +#else +#include <errno.h> +#include <endian.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#undef cpu_to_be32 +#define cpu_to_be32 htobe32 +#define DIV_ROUND_UP (n,d) (((n) + (d) - 1) / (d)) +#define kmalloc (size, flags) malloc(size) +#define kzalloc (size, flags) calloc(1, size) +#define kfree free +#define ARRAY_SIZE (arr) (sizeof(arr) / sizeof((arr)[0])) +#endif +#include <asm/byteorder.h> #include <linux/bch.h>
@@ -95,6 +112,37 @@ struct gf_poly_deg1 {unsigned int c[2 ]; }; +#ifdef USE_HOSTCC +static int fls (int x) +{ +int r =32 ; + +if (!x) +return 0 ; +if (!(x &0xffff0000u )) { + x <<=16 ; + r -=16 ; + } +if (!(x &0xff000000u )) { + x <<=8 ; + r -=8 ; + } +if (!(x &0xf0000000u )) { + x <<=4 ; + r -=4 ; + } +if (!(x &0xc0000000u )) { + x <<=2 ; + r -=2 ; + } +if (!(x &0x80000000u )) { + x <<=1 ; + r -=1 ; + } +return r; +} +#endif +/* * same as encode_bch(), but process input data one byte@a time */
Signature · 1 line
git-series 0.8.11
PATCH v5 3/16 tools: sunxi: Add spl image builder
In reply to Maxime RipardThis program generates raw SPL images that can be flashed on the NAND with the ECC and randomizer properly set up.
This has been copied (and tweaked to find the right headers) from the sunxi-tools (https://github.com/linux-sunxi/sunxi-tools) upstream repository, commit 1c3a6ca5.
--- tools/.gitignore | 1 +- tools/Makefile | 2 +- tools/sunxi-spl-image-builder.c | 484 +++++++++++++++++++++++++++++++++- 3 files changed, 487 insertions(+), 0 deletions(-) create mode 100644 tools/sunxi-spl-image-builder.c
tools/.gitignore +1 -0
@@ -16,6 +16,7 @@ /mkexynosspl /mxsboot /mksunxiboot +/sunxi-spl-image-builder /ncb /proftool /relocate-rela
tools/Makefile +2 -0
@@ -179,6 +179,8 @@ hostprogs-$(CONFIG_MX28) += mxsboot HOSTCFLAGS_mxsboot.o := -pedantic hostprogs-$(CONFIG_ARCH_SUNXI) += mksunxiboot +hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder +sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o hostprogs-$(CONFIG_NETCONSOLE) += ncb hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1
tools/sunxi-spl-image-builder.c new file +484 -0
484 lines not on this page · raw message
Signature · 1 line
git-series 0.8.11
PATCH v5 4/16 common: Move environment choice to Kconfig
In reply to Maxime RipardThe environment location is something that might change per board (depending on what storage options are availaible there) or depending on the user choice (when we have several options).
Instead of hardcoding it in our configuration header, create a Kconfig choice with the options we use for now, and the symbols that depend on it.
Once done, also remove the irrelevant sunxi defines.
--- common/Kconfig | 69 +++++++++++++++++++++++++++++++++++- include/configs/sunxi-common.h | 14 +------ include/environment.h | 2 +- 3 files changed, 74 insertions(+), 11 deletions(-)
common/Kconfig +69 -0
@@ -158,6 +158,75 @@ config SPI_BOOT endmenu +menu "Environment" + +if ARCH_SUNXI + +choice + prompt "Environment Device" + default ENV_IS_IN_MMC if ARCH_SUNXI + +config ENV_IS_IN_MMC + bool "Environment in an MMC device" + depends on CMD_MMC + help + Define this if you have an MMC device which you want to use for the + environment. + +config ENV_IS_IN_NAND + bool "Environment in a NAND device" + depends on CMD_NAND + help + Define this if you have a NAND device which you want to use for the + environment. + +config ENV_IS_IN_UBI + bool "Environment in a UBI volume" + depends on CMD_UBI + depends on CMD_MTDPARTS + help + Define this if you have a UBI volume which you want to use for the + environment. + +config ENV_IS_NOWHERE + bool "Environment is not stored" + help + Define this if you don't want to or can't have an environment stored + on a storage medium + +endchoice + +config ENV_OFFSET + hex "Environment Offset" + depends on !ENV_IS_IN_UBI + depends on !ENV_IS_NOWHERE + default 0x88000 if ARCH_SUNXI + help + Offset from the start of the device (or partition) + +config ENV_SIZE + hex "Environment Size" + depends on !ENV_IS_NOWHERE + default 0x20000 if ARCH_SUNXI + help + Size of the environment storage area + +config ENV_UBI_PART + string "UBI partition name" + depends on ENV_IS_IN_UBI + help + MTD partition containing the UBI device + +config ENV_UBI_VOLUME + string "UBI volume name" + depends on ENV_IS_IN_UBI + help + Name of the volume that you want to store the environment in. + +endif + +endmenu + config BOOTDELAY int "delay in seconds before automatically booting" default 2
include/configs/sunxi-common.h +3 -11
@@ -141,7 +141,9 @@/* mmc config */ #ifdef CONFIG_MMC #define CONFIG_MMC_SUNXI_SLOT 0 -#define CONFIG_ENV_IS_IN_MMC +#endif + +#if defined(CONFIG_ENV_IS_IN_MMC )#define CONFIG_SYS_MMC_ENV_DEV 0/* first detected MMC controller */ #define CONFIG_SYS_MMC_MAX_DEVICE 4#endif
@@ -172,9 +174,6 @@#define CONFIG_SYS_MONITOR_LEN (768 << 10)/* 768 KiB */ -#define CONFIG_ENV_OFFSET (544 << 10)/* (8 + 24 + 512) KiB */ -#define CONFIG_ENV_SIZE (128 << 10)/* 128 KiB */ -#define CONFIG_FAT_WRITE /* enable write access */ #define CONFIG_SPL_FRAMEWORK
@@ -338,13 +337,6 @@ extern int soft_i2c_gpio_scl;#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE #endif -#if !definedCONFIG_ENV_IS_IN_MMC && \ - !definedCONFIG_ENV_IS_IN_NAND && \ - !definedCONFIG_ENV_IS_IN_FAT && \ - !definedCONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_ENV_IS_NOWHERE -#endif -#define CONFIG_MISC_INIT_R #ifndef CONFIG_SPL_BUILD
include/environment.h +2 -0
@@ -8,6 +8,8 @@#ifndef _ENVIRONMENT_H_#define _ENVIRONMENT_H_ +#include <linux/kconfig.h> +/************************************************************************** * * The "environment" is stored as a list of '\0' terminated
Signature · 1 line
git-series 0.8.11
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
In reply to Maxime RipardCMD_MTDPARTS is something the user might or might not want to select, and might depends on (or be selected by) other options too.
This is even truer for the MTDIDS_DEFAULT and MTDPARTS_DEFAULT options that might change from one board to another, or from one user to the other, depending on what it expects and what storage devices are available.
In order to ease that configuration, add those options to Kconfig.
--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)
cmd/Kconfig +20 -0
@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that work for multiple fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXI + bool "MTD partition support" + help + MTD partition support + +config MTDIDS_DEFAULT + string "Default MTD IDs" + depends on CMD_MTDPARTS + help + Defines a default MTD ID + +config MTDPARTS_DEFAULT + string "Default MTD partition scheme" + depends on CMD_MTDPARTS + help + Defines a default MTD partitioning scheme in the Linux MTD command + line partitions format + endmenu config CMD_UBI
cmd/mtdparts.c +8 -0
@@ -110,11 +110,19 @@ DECLARE_GLOBAL_DATA_PTR;/* default values for mtdids and mtdparts variables */ #if !defined(MTDIDS_DEFAULT ) +#ifdef CONFIG_MTDIDS_DEFAULT +#define MTDIDS_DEFAULT CONFIG_MTDIDS_DEFAULT +#else #define MTDIDS_DEFAULT NULL#endif +#endif #if !defined(MTDPARTS_DEFAULT ) +#ifdef CONFIG_MTDPARTS_DEFAULT +#define MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT +#else #define MTDPARTS_DEFAULT NULL#endif +#endif #if defined(CONFIG_SYS_MTDPARTS_RUNTIME )extern void board_mtdparts_default (const char **mtdids,const char **mtdparts);#endif
Signature · 1 line
git-series 0.8.11
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
Hi Maxime,
Quoted 27 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select, and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that work formultiple
cmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 4 lines
cmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXI
Is there any reason to limit the command for the sunxi arch only?
Best regards
Jörg Krause
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
Hi Jörg,
Quoted 20 lines · Jörg Krause
Quoted 19 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select, and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)
Quoted 14 lines
cmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 12 lines
cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that work formultiple
cmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXIIs there any reason to limit the command for the sunxi arch only?
Yes, if we don't, this will generate warnings for each architecture that has not moved that option from their header to Kconfig.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170530/92ed26eb/attachment.sig>
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
Hi Maxime,
Quoted 42 lines · Maxime Ripard
Hi Jörg,
Quoted 23 lines · Jörg Krause
Quoted 22 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select,
and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)Quoted 15 lines
cmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 13 lines
cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that workfor
multiplecmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXIIs there any reason to limit the command for the sunxi arch only?
Quoted 2 lines
Yes, if we don't, this will generate warnings for each architecture that has not moved that option from their header to
Kconfig.
I see! However, wouldn't it be best to migrate all architectures to Kconfig instead of doing it seperately?
Jörg
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
Quoted 45 lines · Jörg Krause
Hi Maxime,
Quoted 42 lines · Maxime Ripard
Hi Jörg,
Quoted 38 lines · Jörg Krause
Quoted 31 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select,
and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that workfor
multiplecmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 4 lines
cmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXIIs there any reason to limit the command for the sunxi arch only?
Quoted 5 lines
Quoted 2 lines
Yes, if we don't, this will generate warnings for each architecture that has not moved that option from their header to
Kconfig.I see! However, wouldn't it be best to migrate all architectures to
Kconfiginstead of doing it seperately?
Probably, but there was a quite significant number of Kconfig symbols introduced, used by a very significant number of boards and architectures.
This was really to unreasonable to do at the time, but we can definitely do that now.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170531/a155b597/attachment.sig>
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
Hi Maxime,
Quoted 49 lines · Maxime Ripard
Quoted 48 lines · Jörg Krause
Hi Maxime,
Quoted 44 lines · Maxime Ripard
Hi Jörg,
Quoted 23 lines · Jörg Krause
Quoted 22 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select,
and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)Quoted 15 lines
cmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 13 lines
cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that workfor
multiplecmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXIIs there any reason to limit the command for the sunxi arch only?
Yes, if we don't, this will generate warnings for each architecture that has not moved that option from their header to
Kconfig.
Quoted 6 lines
Quoted 2 lines
I see! However, wouldn't it be best to migrate all architectures to
Kconfiginstead of doing it seperately?Probably, but there was a quite significant number of
Kconfigsymbols introduced, used by a very significant number of boards and architectures.
I see!
Quoted 2 lines
This was really to unreasonable to do at the time, but we can definitely do that now.
That would be great! Many thanks!
Jörg
PATCH v5 5/16 cmd: Add Kconfig option for CMD_MTDPARTS and related options
In reply to Maxime RipardHi Maxime,
Quoted 49 lines · Maxime Ripard
Quoted 48 lines · Jörg Krause
Hi Maxime,
Quoted 44 lines · Maxime Ripard
Hi Jörg,
Quoted 23 lines · Jörg Krause
Quoted 22 lines · Maxime Ripard
CMD_MTDPARTSis something the user might or might not want to select,
and
might depends on (or be selected by) other options too.This is even truer for the
MTDIDS_DEFAULTandMTDPARTS_DEFAULToptions that
might change from one board to another, or from one user to the other,
depending on what it expects and what storage devices are available.In order to ease that configuration, add those options to
Kconfig.Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Tom Rini <[email protected]>--- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)Quoted 15 lines
cmd/Kconfig config CMD_FS_GENERIC · line 806
Quoted 13 lines
cmd/Kconfig +0
-0@@ -801,6 +801,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that workfor
multiplecmd/Kconfig +3
-0fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXIIs there any reason to limit the command for the sunxi arch only?
Yes, if we don't, this will generate warnings for each architecture that has not moved that option from their header to
Kconfig.
Quoted 6 lines
Quoted 2 lines
I see! However, wouldn't it be best to migrate all architectures to
Kconfiginstead of doing it seperately?Probably, but there was a quite significant number of
Kconfigsymbols introduced, used by a very significant number of boards and architectures.
I see!
Quoted 2 lines
This was really to unreasonable to do at the time, but we can definitely do that now.
That would be great! Many thanks!
Jörg
PATCH v5 6/16 mtd: ubi: Select RBTREE option from MTD_UBI Kconfig entry
In reply to Maxime RipardFrom: Boris Brezillon <[email protected]>
Expose the RBTREE feature through Kconfig and select this option from the MTD_UBI option.
--- drivers/mtd/ubi/Kconfig | 1 + lib/Kconfig | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/mtd/ubi/Kconfig +1 -0
@@ -3,6 +3,7 @@ menu "UBI support" config MTD_UBI bool "Enable UBI - Unsorted block images" select CRC32 + select RBTREE if ARCH_SUNXI help UBI is a software layer above MTD layer which admits of LVM-like logical volumes on top of MTD devices, hides some complexities of
lib/Kconfig +3 -0
@@ -52,6 +52,9 @@ config LIB_RAND help This library provides pseudo-random number generator functions. +config RBTREE + bool + source lib/dhry/Kconfig source lib/rsa/Kconfig
Signature · 1 line
git-series 0.8.11
PATCH v5 6/16 mtd: ubi: Select RBTREE option from MTD_UBI Kconfig entry
Quoted 17 lines · On Mon, 27 Feb 2017 18:22:05 +0100 Maxime Ripard…
From: Boris Brezillon <[email protected]>
Expose the RBTREE feature through
Kconfigand select this option from theMTD_UBIoption.Signed-off-by Boris Brezillon <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- drivers/mtd/ubi/Kconfig | 1 + lib/Kconfig | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-)drivers/mtd/ubi/Kconfig +0
-0
drivers/mtd/ubi/Kconfig menu "UBI support" · line 6
Quoted 4 lines
drivers/mtd/ubi/Kconfig +1
-0@@ -3,6 +3,7 @@ menu "UBI support" config MTD_UBI bool "Enable UBI - Unsorted block images" select CRC32 + select RBTREE if ARCH_SUNXI
I just grep-ed in the source for CONFIG_CMD_UBI and CONFIG_MTD_UBI, and it seems that all boards have been converted to select the Kconfig option instead of having it defined in their <board>.h config header.
This means you could to drop the 'if ARCH_SUNXI' and add the changes you get after executing the following command to this commit:
# git grep -l "#define CONFIG_RBTREE" | \ xargs sed -i "/#define CONFIG_RBTREE/d"
Of course, i's just a suggestion, ans we can do that after this series has been merged.
Quoted 17 lines
drivers/mtd/ubi/Kconfig +0
-0help UBI is a software layer above MTD layer which admits of LVM-like logical volumes on top of MTD devices, hides some complexities oflib/Kconfig +3
-0@@ -52,6 +52,9 @@ config LIB_RAND help This library provides pseudo-random number generator functions. +config RBTREE + bool + source lib/dhry/Kconfig source lib/rsa/Kconfig
PATCH v5 7/16 cmd: Expose a Kconfig option to enable UBIFS commands
In reply to Maxime RipardFrom: Boris Brezillon <[email protected]>
Create a new Kconfig entry to allow CMD_UBIFS selection from Kconfig and add an hidden LZO option that can be selected by CMD_UBIFS.
--- cmd/Kconfig | 8 ++++++++ lib/Kconfig | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-)
cmd/Kconfig +8 -0
@@ -835,4 +835,12 @@ config CMD_UBI (www.linux-mtd.infradead.org). Activate this option if you want to use U-Boot UBI commands. +config CMD_UBIFS + tristate "Enable UBIFS - Unsorted block images filesystem commands" + select CRC32 + select RBTREE if ARCH_SUNXI + select LZO if ARCH_SUNXI + help + UBIFS is a file system for flash devices which works on top of UBI. + endmenu
lib/Kconfig +2 -0
@@ -122,6 +122,8 @@ config LZ4 frame format currently (2015) implemented in the Linux kernel (generated by 'lz4 -l'). The two formats are incompatible. +config LZO + bool endmenu config ERRNO_STR
Signature · 1 line
git-series 0.8.11
PATCH v5 7/16 cmd: Expose a Kconfig option to enable UBIFS commands
Hi Maxime,
Quoted 25 lines · Maxime Ripard
From: Boris Brezillon <[email protected]>
Create a new
Kconfigentry to allowCMD_UBIFSselection fromKconfigand
add an hidden LZO option that can be selected byCMD_UBIFS.Signed-off-by Boris Brezillon <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- cmd/Kconfig | 8 ++++++++ lib/Kconfig | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-)cmd/Kconfig +0
-0@@ -835,4 +835,12 @@ config CMD_UBI (www.linux-mtd.infradead.org). Activate this option if youwant
cmd/Kconfig +2
-0to use U-Boot UBI commands. +config CMD_UBIFS + tristate "Enable UBIFS - Unsorted block images filesystemcommands"
cmd/Kconfig config CMD_UBI · line 842
Quoted 3 lines
cmd/Kconfig +3
-0+ select CRC32 + select RBTREE if ARCH_SUNXI + select LZO if ARCH_SUNXI
RBTREE and LZO shouldn't depend on the sunxi arch.
Best regards
Jörg Krause
PATCH v5 8/16 cmd: nand: Expose optional suboptions in Kconfig
In reply to Maxime RipardFrom: Boris Brezillon <[email protected]>
Sometime we need to enable advanced suboptions of the nand command set. Expose these suboptions in Kconfig.
--- cmd/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+), 0 deletions(-)
cmd/Kconfig +18 -0
@@ -441,6 +441,24 @@ config CMD_NAND help NAND support. +if CMD_NAND +config CMD_NAND_TRIMFFS + bool "nand write.trimffs" + help + Allows one to skip empty pages when flashing something on a NAND. + +config CMD_NAND_LOCK_UNLOCK + bool "nand lock/unlock" + help + NAND locking support. + +config CMD_NAND_TORTURE + bool "nand torture" + help + NAND torture support. + +endif # CMD_NAND + config CMD_PART bool "part" select PARTITION_UUIDS
Signature · 1 line
git-series 0.8.11
PATCH v5 9/16 mtd: sunxi: Select the U-Boot location config option
In reply to Maxime RipardWe'll need that symbol so that the default offset are defined
--- drivers/mtd/nand/Kconfig | 1 + 1 file changed, 1 insertion(+), 0 deletions(-)
drivers/mtd/nand/Kconfig +1 -0
@@ -67,6 +67,7 @@ config NAND_SUNXI bool "Support for NAND on Allwinner SoCs" depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I select SYS_NAND_SELF_INIT + select SYS_NAND_U_BOOT_LOCATIONS ---help--- Enable support for NAND. This option enables the standard and SPL drivers.
Signature · 1 line
git-series 0.8.11
PATCH v5 10/16 mtd: sunxi: Change U-Boot offset
In reply to Maxime RipardThe default U-Boot offset for the Allwinner SoCs was set to 32kB.
This was probably to try to maintain some compatibility with the current image that we build for the MMC where the U-Boot binary is also located at a 32kB offset.
However, this causes a number of issues. The first one is that it prevents us from using a backup SPL entirely, which is troublesome in case where the first would be corrupt (especially on MLC which have a higher number of bitflips).
We also cannot use the original MMC image on the NAND, because we need to prepare the SPL image to include the ECCs and randomizer settings, which reduces the interest of setting it at that particular offset.
It also prevents us from upgrading and flashing the U-Boot and SPLs independantly, since it's very likely that it will fall in the same erase block.
Since that default wasn't used by any board, change it for 8MB, which will be in an erase block of its own, all the erase blocks being multiple of two. The highest erase block size we encountered is 4MB, which means that in this particular setup, the first and second erase blocks will be for the SPL and its backup, and the third for U-Boot.
--- drivers/mtd/nand/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/Kconfig +1 -1
@@ -128,7 +128,7 @@ config SYS_NAND_U_BOOT_LOCATIONS config SYS_NAND_U_BOOT_OFFS hex "Location in NAND to read U-Boot from" - default 0x8000 if NAND_SUNXI + default 0x800000 if NAND_SUNXI depends on SYS_NAND_U_BOOT_LOCATIONS help Set the offset from the start of the nand where u-boot should be
Signature · 1 line
git-series 0.8.11
PATCH v5 11/16 sunxi: Enable UBI and NAND support
In reply to Maxime RipardFrom: Hans de Goede <[email protected]>
Enable the NAND and UBI support in the configuration header so that we can (finally) use it.
--- cmd/Kconfig | 4 ++++ include/configs/sunxi-common.h | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-)
cmd/Kconfig +4 -0
@@ -438,12 +438,14 @@ config CMD_MMC config CMD_NAND bool "nand" + default y if ARCH_SUNXI 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.
include/configs/sunxi-common.h +3 -0
@@ -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
Signature · 1 line
git-series 0.8.11
PATCH v5 11/16 sunxi: Enable UBI and NAND support
Hi,
Quoted 17 lines · Maxime Ripard
From: Hans de Goede <[email protected]>
Enable the NAND and UBI support in the configuration header so that we can (finally) use it.
Signed-off-by Hans de Goede <[email protected]>Signed-off-by Maxime Ripard <[email protected]>--- cmd/Kconfig | 4 ++++ include/configs/sunxi-common.h | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-)cmd/Kconfig +0
-0
cmd/Kconfig config CMD_MMC · line 441
Quoted 4 lines
cmd/Kconfig +1
-0@@ -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.ocmd/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 incmd/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.odrivers/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 orCONFIG_SYS_NAND_BASE_LIST anywhere though.
Regards
ChenYu
Quoted 46 lines
cmd/Kconfig +3
-0help 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.include/configs/sunxi-common.h +3
-1@@ -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
PATCH v5 12/16 sunxi: Add the default mtdids and mtdparts to our env
In reply to Maxime RipardIn order for the user to be able to see and modify them, add those variables to the default environment.
--- include/configs/sunxi-common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-)
include/configs/sunxi-common.h +16 -0
@@ -469,6 +469,20 @@ extern int soft_i2c_gpio_scl; "stderr=serial\0"#endif +#ifdef CONFIG_MTDIDS_DEFAULT +#define SUNXI_MTDIDS_DEFAULT \ + "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" +#else +#define SUNXI_MTDIDS_DEFAULT +#endif + +#ifdef CONFIG_MTDPARTS_DEFAULT +#define SUNXI_MTDPARTS_DEFAULT \ + "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" +#else +#define SUNXI_MTDPARTS_DEFAULT +#endif +#define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS
@@ -479,6 +493,8 @@ extern int soft_i2c_gpio_scl;DFU_ALT_INFO_RAM \"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \"console=ttyS0,115200\0" \ +SUNXI_MTDIDS_DEFAULT \ +SUNXI_MTDPARTS_DEFAULT \BOOTCMD_SUNXI_COMPAT \BOOTENV
Signature · 1 line
git-series 0.8.11
PATCH v5 13/16 nand: sunxi: Add options for the SPL NAND configuration
In reply to Maxime RipardThe SPL image needs to be built with a different ECC configuration than the U-Boot binary.
Add Kconfig options with defaults to provide a value that should work for anyone, but is still configurable if needs be.
--- drivers/mtd/nand/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-)
drivers/mtd/nand/Kconfig +16 -0
@@ -74,6 +74,22 @@ config NAND_SUNXI The SPL driver only supports reading from the NAND using DMA transfers. +if NAND_SUNXI + +config NAND_SUNXI_SPL_ECC_STRENGTH + int "Allwinner NAND SPL ECC Strength" + default 64 + +config NAND_SUNXI_SPL_ECC_SIZE + int "Allwinner NAND SPL ECC Step Size" + default 1024 + +config NAND_SUNXI_SPL_USABLE_PAGE_SIZE + int "Allwinner NAND SPL Usable Page Size" + default 1024 + +endif + config NAND_ARASAN bool "Configure Arasan Nand" help
Signature · 1 line
git-series 0.8.11
PATCH v5 14/16 scripts: sunxi: Build an raw SPL image
In reply to Maxime RipardIntroduce a new sunxi-spl-with-ecc.bin image with already the right header, ECC, randomizer and padding for the BROM to be able to read it.
It needs to be flashed using a raw access to the NAND so that the controller doesn't change a thing to it, since we already have all the right parameters.
--- Makefile | 3 ++- board/sunxi/README.nand | 54 ++++++++++++++++++++++++++++++++++++++++++- scripts/Makefile.spl | 15 ++++++++++++- 3 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 board/sunxi/README.nand
Makefile +3 -0
@@ -1344,6 +1344,9 @@ spl/u-boot-spl: tools prepare \ spl/sunxi-spl.bin: spl/u-boot-spl @: +spl/sunxi-spl-with-ecc.bin: spl/sunxi-spl.bin + @: + spl/u-boot-spl.sfp: spl/u-boot-spl @:
board/sunxi/README.nand new file +54 -0
55 lines not on this page · raw message
scripts/Makefile.spl +15 -0
@@ -173,6 +173,10 @@ endif ifdef CONFIG_ARCH_SUNXI ALL-y += $(obj)/sunxi-spl.bin + +ifdef CONFIG_NAND_SUNXI +ALL-y += $(obj)/sunxi-spl-with-ecc.bin +endif endif ifeq ($(CONFIG_SYS_SOC),"at91")
@@ -289,6 +293,17 @@ cmd_mksunxiboot = $(objtree)/tools/mksunxiboot $< $@ $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE $(call if_changed,mksunxiboot) +quiet_cmd_sunxi_spl_image_builder = SUNXI_SPL_IMAGE_BUILDER $@ +cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \ + -c $(CONFIG_NAND_SUNXI_SPL_ECC_STRENGTH)/$(CONFIG_NAND_SUNXI_SPL_ECC_SIZE) \ + -p $(CONFIG_SYS_NAND_PAGE_SIZE) \ + -o $(CONFIG_SYS_NAND_OOBSIZE) \ + -u $(CONFIG_NAND_SUNXI_SPL_USABLE_PAGE_SIZE) \ + -e $(CONFIG_SYS_NAND_BLOCK_SIZE) \ + -s -b $< $@ +$(obj)/sunxi-spl-with-ecc.bin: $(obj)/sunxi-spl.bin + $(call if_changed,sunxi_spl_image_builder) + # Rule to link u-boot-spl # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot-spl ?= LD $@
Signature · 1 line
git-series 0.8.11
PATCH v5 15/16 sunxi: Sync GR8 DTS and AXP209 with the kernel
In reply to Maxime RipardThose DT will be part of 4.10, sync them so we can have our own config.
--- arch/arm/dts/Makefile | 1 +- arch/arm/dts/axp209.dtsi | 6 +- arch/arm/dts/sun5i-gr8-chip-pro.dts | 266 +++++++- arch/arm/dts/sun5i-gr8.dtsi | 1132 ++++++++++++++++++++++++++++- 4 files changed, 1405 insertions(+), 0 deletions(-) create mode 100644 arch/arm/dts/sun5i-gr8-chip-pro.dts create mode 100644 arch/arm/dts/sun5i-gr8.dtsi
arch/arm/dts/Makefile +1 -0
@@ -220,6 +220,7 @@ dtb-$(CONFIG_MACH_SUN5I) += \ sun5i-a13-olinuxino-micro.dtb \ sun5i-a13-q8-tablet.dtb \ sun5i-a13-utoo-p66.dtb \ + sun5i-gr8-chip-pro.dtb \ sun5i-r8-chip.dtb dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-app4-evb1.dtb \
arch/arm/dts/axp209.dtsi +6 -0
@@ -53,6 +53,12 @@ interrupt-controller; #interrupt-cells = <1>; + axp_gpio: gpio { + compatible = "x-powers,axp209-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + regulators { /* Default work frequency for buck regulators */ x-powers,dcdc-freq = <1500>;
arch/arm/dts/sun5i-gr8-chip-pro.dts new file +266 -0
266 lines not on this page · raw message
arch/arm/dts/sun5i-gr8.dtsi new file +1132 -0
1,132 lines not on this page · raw message
Signature · 1 line
git-series 0.8.11
PATCH v5 16/16 sunxi: Add support for the CHIP Pro
In reply to Maxime RipardThe CHIP Pro is a SoM that features the GR8 SIP, an AXP209, a BT/WiFi chip and a 512MiB SLC NAND.
This it's an SLC NAND, it doesn't suffer the same drawbacks than found on the MLC NANDs, and we can enable it right away.
--- configs/CHIP_pro_defconfig | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+), 0 deletions(-) create mode 100644 configs/CHIP_pro_defconfig
configs/CHIP_pro_defconfig new file +33 -0
@@ -0,0 +1,33 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_SPL_I2C_SUPPORT=y +# CONFIG_SPL_MMC_SUPPORT is not set +CONFIG_SPL_NAND_SUPPORT=y +CONFIG_MACH_SUN5I=y +CONFIG_DRAM_TIMINGS_DDR3_800E_1066G_1333J=y +CONFIG_USB0_VBUS_PIN="PB10" +CONFIG_DEFAULT_DEVICE_TREE="sun5i-gr8-chip-pro" +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SYS_NAND_OOBSIZE=256" +CONFIG_ENV_IS_IN_UBI=y +CONFIG_ENV_UBI_PART="UBI" +CONFIG_ENV_UBI_VOLUME="uboot-env" +CONFIG_SPL=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nand0=sunxi-nand.0" +CONFIG_MTDPARTS_DEFAULT="mtdparts=sunxi-nand.0:256k(spl),256k(spl-backup),2m(uboot),2m(uboot-backup),-(UBI)" +# CONFIG_MMC is not set +CONFIG_NAND_SUNXI=y +CONFIG_AXP_ALDO3_VOLT=3300 +CONFIG_AXP_ALDO4_VOLT=3300 +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="Allwinner Technology" +CONFIG_G_DNL_VENDOR_NUM=0x1f3a +CONFIG_G_DNL_PRODUCT_NUM=0x1010
Signature · 1 line
git-series 0.8.11
PATCH v5 16/16 sunxi: Add support for the CHIP Pro
Quoted 10 lines · Maxime Ripard
The CHIP Pro is a SoM that features the GR8 SIP, an AXP209, a BT/WiFi chip and a 512MiB SLC NAND.
This it's an SLC NAND, it doesn't suffer the same drawbacks than found on the MLC NANDs, and we can enable it right away.
Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Hans de Goede <[email protected]>--- configs/CHIP_pro_defconfig | 33 +++++++++++++++++++++++++++++++++
[snip]
Quoted 1 line
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SYS_NAND_OOBSIZE=256"
Conversion itself won't be fun (I can see it'll take some regex'ing before hand to convert various values to a number) but can you please add Kconfig entires for SYS_NAND_xxx values and populate those for this baord instead of adding more SYS_EXTRA_OPTIONS? Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170301/d8ca78af/attachment.sig>
PATCH v5 16/16 sunxi: Add support for the CHIP Pro
Hi Tom,
Quoted 12 lines · Tom Rini
Quoted 10 lines · Maxime Ripard
The CHIP Pro is a SoM that features the GR8 SIP, an AXP209, a BT/WiFi chip and a 512MiB SLC NAND.
This it's an SLC NAND, it doesn't suffer the same drawbacks than found on the MLC NANDs, and we can enable it right away.
Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Hans de Goede <[email protected]>--- configs/CHIP_pro_defconfig | 33 +++++++++++++++++++++++++++++++++
Quoted 7 lines
[snip]
Quoted 1 line
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SYS_NAND_OOBSIZE=256"
Conversion itself won't be fun (I can see it'll take some regex'ing before hand to convert various values to a number) but can you please add
Kconfigentires forSYS_NAND_xxxvalues and populate those for this baord instead of adding moreSYS_EXTRA_OPTIONS? Thanks!
If you mean converting only the Allwinner boards to it, then yes, sure. If you also mean converting all the other architectures, then I'm sorry but I don't have the time to do that.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170303/af65f610/attachment.sig>
PATCH v5 16/16 sunxi: Add support for the CHIP Pro
Quoted 18 lines · Maxime Ripard
Hi Tom,
Quoted 15 lines · Tom Rini
Quoted 10 lines · Maxime Ripard
The CHIP Pro is a SoM that features the GR8 SIP, an AXP209, a BT/WiFi chip and a 512MiB SLC NAND.
This it's an SLC NAND, it doesn't suffer the same drawbacks than found on the MLC NANDs, and we can enable it right away.
Signed-off-by Maxime Ripard <[email protected]>Reviewed-by Hans de Goede <[email protected]>--- configs/CHIP_pro_defconfig | 33 +++++++++++++++++++++++++++++++++[snip]
Quoted 1 line
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SYS_NAND_OOBSIZE=256"
Quoted 8 lines
Quoted 4 lines
Conversion itself won't be fun (I can see it'll take some regex'ing before hand to convert various values to a number) but can you please add
Kconfigentires forSYS_NAND_xxxvalues and populate those for this baord instead of adding moreSYS_EXTRA_OPTIONS? Thanks!If you mean converting only the Allwinner boards to it, then yes, sure. If you also mean converting all the other architectures, then I'm sorry but I don't have the time to do that.
Yeah, if you add the Kconfig entries and make use of them here (and convert the rest of sunxi, which I guess is just CHIP) that's fine. These are non-trivial enough that moveconfig.py won't get them right I suspect. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170303/4bd518cf/attachment.sig>
v5 cover sunxi: Add support for the CHIP Pro
In reply to Maxime RipardQuoted 84 lines · Maxime Ripard
The CHIP Pro is a SoM made by NextThing Co, and that embeds a GR8 SIP, an AXP209 PMIC, a WiFi BT chip and a 512MB SLC NAND.
Since the first Allwinner device coming whit an SLC NAND that doesn't have the shortcomings (and breakages) the MLC NAND has, we can finally enable the NAND support on a board by default.
This is the occasion to introduce a bunch of additions needed imo to be able to come up with a sane NAND support for our users.
The biggest pain point is that the BROM uses a different ECC and randomizer configuration than for the rest of the NAND. In order to lessen the number of bitflips, you also need to pad with random data the SPL image.
Since it's quite tedious to do right (and most users won't be able to figure it out) and since if it is not done right, it will eventually turn into an unusable system (which is bad UX), we think that the best solution is to generate an SPL image that already embeds all this. We'll possible have to do the same thing for the U-Boot image (at least for the random padding) on MLC NANDs.
The only drawback from that is that you need to flash it raw, instead of using the usual nand write, but it's just a different command, nothing major anyway.
In order to flash it, from a device switched in FEL, on your host:
sunxi-fel spl spl/sunxi-spl.bin
sunxi-fel write0x4a000000u-boot-dtb.bin
sunxi-fel write0x43000000spl/sunxi-spl-with-ecc.bin sunxi-fel exe0x4a000000And on the board, once u-boot is running (assuming the NAND is already erased):
nand write.raw.noverify
0x430000000 40
nand write.raw.noverify0x430000000x40000040nand write
0x4a0000000x8000000xc0000I also encountered some weird bug in the private libgcc that prevents U-Boot from loading. Disabling
CONFIG_USE_PRIVATE_LIBGCCfixes that.Let me know what you think,
MaximeChanges from v4:
- Rebased on top of last pull request
- Removed irrelevant config optionsChanges from v3:
- Bring newKconfigpatches from Boris
- Do not defineKconfigdefaults in our boardKconfigbut directly in the option declaration
- Sync the DT with the kernel
- Fixed build breakagesChanges from v2:
- MoveCMD_NANDandCMD_UBIdefault to cmd/Kconfig
- Define the envKconfigoptions only forARCH_SUNXIto avoid build breakages
- DefineCMD_MTDPARTSonly forARCH_SUNXIChanges from v1:
- Allowed to buildlib/bch.cfor the host, and used that in the image builder
- Fixed a bug in the NAND driver
- Wrote a documentation on how to flash a NAND image on an Allwinner board
- Fixed a few compilation breakages and issues
- Moved U-boot offset out of the config header and intoKconfig
- Moved the environment into UBI
- Moved the environment selection toKconfig
- Moved theCMD_MTDPARTSoptions toKconfig
- ProvideMTDIDS_DEFAULTandMTDPARTS_DEFAULToptions throughKconfig
- Added the tags from everyoneBoris Brezillon (3):
mtd: ubi: Select RBTREE option fromMTD_UBIKconfigentry
cmd: Expose aKconfigoption to enable UBIFS commands
cmd: nand: Expose optional suboptions inKconfigHans de Goede (1):
sunxi: Enable UBI and NAND support
Quoted 13 lines
Maxime Ripard (12):
nand: sunxi: Fix modulo by zero error
bch: Allow to build for the host
tools: sunxi: Add spl image builder
common: Move environment choice toKconfig
cmd: AddKconfigoption forCMD_MTDPARTSand related options
mtd: sunxi: Select the U-Boot location config option
mtd: sunxi: Change U-Boot offset
sunxi: Add the default mtdids and mtdparts to our env
nand: sunxi: Add options for the SPL NAND configuration
scripts: sunxi: Build an raw SPL image
sunxi: Sync GR8 DTS and AXP209 with the kernel
sunxi: Add support for the CHIP Pro
Applied to u-boot-sunxi/master
thanks!
Signature · 4 lines
Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.