All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5 0/16] sunxi: Add support for the CHIP Pro
@ 2017-02-27 17:21 Maxime Ripard
  2017-02-27 17:22 ` [U-Boot] [PATCH v5 1/16] nand: sunxi: Fix modulo by zero error Maxime Ripard
                   ` (16 more replies)
  0 siblings, 17 replies; 30+ messages in thread
From: Maxime Ripard @ 2017-02-27 17:21 UTC (permalink / raw)
  To: u-boot

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
-- 
git-series 0.8.11

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2017-06-01  5:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.