Hello, I want to integrate mender to our custom ls1021a board.
Now I have u-boot with all patches and I need to make wright config_mender_defines.h file. I will have 8 mb (now 128 mb) spi nor flash as a u-boot source and 128 mb nand flash as a rootfs+data storage.
mtd list
=> mtd list
List of MTD devices:
* nand0
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 64 bytes
- OOB available: 30 bytes
- ECC strength: 4 bits
- ECC step size: 512 bytes
- bitflip threshold: 3 bits
- 0x000000000000-0x000008000000 : "nand0"
- 0x000000000000-0x000008000000 : "ubi"
* nor0
- type: NOR flash
- block size: 0x40000 bytes
- min I/O: 0x1 bytes
- 0x000000000000-0x000004000000 : "nor0"
- 0x000000000000-0x000000100000 : "rcw"
- 0x000000100000-0x000000300000 : "u-boot"
- 0x000000300000-0x000000380000 : "u-boot-env-1"
- 0x000000380000-0x000000400000 : "u-boot-env-2"
I need to set environment variables according to this scheme. Basic config_mender_defines.h was compiled for the sd boot.
config_mender_defines
#define MENDER_UBI
#define MENDER_MTD_UBI_DEVICE_NAME "nand0"
/* Shell variables */
#define MENDER_BOOT_PART_NUMBER ??
#define MENDER_BOOT_PART_NUMBER_HEX ??
#define MENDER_ROOTFS_PART_A_NUMBER 0
#define MENDER_ROOTFS_PART_A_NUMBER_HEX 0
#define MENDER_ROOTFS_PART_B_NUMBER 1
#define MENDER_ROOTFS_PART_B_NUMBER_HEX 1
#define MENDER_UBOOT_STORAGE_INTERFACE "ubi"
#define MENDER_UBOOT_STORAGE_DEVICE 0
/* BB variables. */
#define MENDER_STORAGE_DEVICE_BASE "??"
#define MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 0x300000
#define MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 0x380000
#define MENDER_ROOTFS_PART_A_NAME "/dev/ubi0"
#define MENDER_ROOTFS_PART_B_NAME "/dev/ubi1"
/* For sanity checks. */
#define MENDER_BOOTENV_SIZE 0x80000
#define MENDER_BOOT_KERNEL_TYPE "bootm"
#define MENDER_KERNEL_NAME "uImage"
#define MENDER_DTB_NAME "ls1021a-custom.dtb"
#define MENDER_UBOOT_PRE_SETUP_COMMANDS ""
#define MENDER_UBOOT_POST_SETUP_COMMANDS ""
I wrote ?? where I can’t understand what should I st there.
And other problem is that I can’t find how to make ubimg with openwrt builder, maybe somebody know how to do it or even have rite script?
Or maybe you can help me with only nand memory uboot? When uboot, uboot-env will be written to the nand.