Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

NAND patches for legacy kernel and latest u-boot

Featured Replies

Hi

 

This is my patches for using NAND + UBI + UBIFS with legacy kernel and latest u-boot

Tested on Cubieboard-1 and Cubietruck.

 

U-Boot:

- read-only support for now - i.e. all write/erase ops are locked

 

Kernel:

- pooling events - need to convert to interrupts+completions

 

ToDo:

- make led support

 

NAND layout - driver will create two MTD partitions:

mtd0 - with name "SPL" - 1024K rounded up to eraseblock size.

mtd1 - with name "UBI" - all other space excluding last 4 erseblocks - for bad block table.

 

For using with u-boot need to create ubi volume named "boot" with id=0. This volume must contain /boot/* files.

For other files I use in tests all free space with volume name "root" and id=1 but this is not critical.

 

I used this as module and include in ramdisk - add to /etc/initramfs-tools/modules next lines:

sunxi_nand
ubi mtd=1 <- this is which mtd attach at boot
ubifs

In /boot/boot.cmd should be changed:

in bootargs: root=ubi0:root rootwait rootfstype=ubifs 

boot images:

ubifsload ${fdt_addr_r} script.bin
ubifsload ${ramdisk_addr_r} uInitrd || setenv ramdisk_addr_r "-"
ubifsload ${kernel_addr_r} zImage

in /etc/fstab

ubi0:root / ubifs defaults,noatime 0 0
ubi0:boot /boot ubifs defaults,noatime 0 0

Kernel configuration:

CONFIG_MTD=m
CONFIG_MTD_CHAR=m
CONFIG_MTD_NAND_IDS=m
CONFIG_MTD_NAND_ECC=m
CONFIG_MTD_NAND=m
CONFIG_MTD_NAND_SUNXI_NAND=m
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_WL_THRESHOLD=256 <- for MLC NAND
CONFIG_MTD_UBI_BEB_RESERVE=1

In U-Boot config only need to set 

CONFIG_NAND_SUNXI_ALT=y

 All other things (MTD, UBI, UBIFS) will be included automatically.

 
PS Sorry for my English :)
 

kernel-nand.patch.gz

uboot-nand.patch.gz

So, with this patch I can boot the latest u-boot using legacy kernel 3.4.x ?

 

If it is, then it's the one that I've been searching all along.

 

Will try it if I have a chance...and post the result.

  • Author

So, with this patch I can boot the latest u-boot using legacy kernel 3.4.x ?

Yes, I tested with latest u-boot on Cubieboard-1 and Cubietruck (A20). Two my cubietruck boards have bad flash chips, but I replaced it by another one from old USB flash dongle. After this all works fine.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.