P1020WLAN NAND partitioning

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

P1020WLAN NAND partitioning

632 Views
abineshselvaraj
Contributor III

Hi,

I'm using LTIB BSP to bring-up P1020 WLAN board. The u-boot is booted from NOR flash (CS0) and it is enabled with NAND configuration (CS1) to use NAND for extended storage. The BR1 and CS1 registers are configured with BR_V, FCM and the CONFIG_SYS_NAND_BASE is 0xd0000000. In u-boot, NAND flash size is displayed, but the read fails and it is showing "skipping bad block". I have tried in linux by modifying the p1020wlan_rev_d.dtb for NAND detection/partitioning as shown below

ranges = <0x0 0x0 0x0 0xee000000 0x2000000 0x1 0x0 0x0 0xd0000000 0x10000000 0x3 0x0 0x0 0xffa00000 0x1000000>;

                nand@1,0 {

                        #address-cells = <0x1>;

                        #size-cells = <0x1>;

                        compatible = "fsl,elbc-fcm-nand";

                        reg = <0x1 0x0 0x10000000>;

                        partition@0 {

                                reg = <0x0 0x6400000>;

                                label = "linux";

                        };

                        partition@6400000 {

                                reg = <0x6400000 0x20000>;

                                label = "rootfs";

                        };

                };

But, in the Linux boot log, I'm getting the error "Failed to get memory region".

What is the base address (CONFIG_SYS_NAND_BASE) for NAND that has been to be used in U-boot and DTS  for WLAN board?

0 Kudos
2 Replies

483 Views
Pavel
NXP Employee
NXP Employee

Look at attached file. It is u-boot configuration file for the P1020WLAN board. NXP LTIB Linux BSP uses this file for u-boot building.

Change NAND setting in this file for your NAND Flash.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

483 Views
abineshselvaraj
Contributor III

Hi,

Thanks for the information. I have changed the attached files for adding NAND support. The changes are tagged under /*** ARICENT ***/.

Kindly confirm whether following configurations are fine in P1020_SKU.h,

#define CONFIG_SYS_NAND_BASE            0xd0000000

#define CONFIG_SYS_NAND_BASE_PHYS       CONFIG_SYS_NAND_BASE

#define CONFIG_SYS_NAND_BASE_LIST       {CONFIG_SYS_NAND_BASE}

#define CONFIG_SYS_MAX_NAND_DEVICE      1

#define NAND_MAX_CHIPS                  1

#define CONFIG_MTD_NAND_VERIFY_WRITE

#define CONFIG_CMD_NAND                 1

#define CONFIG_NAND_FSL_ELBC            1

#define CONFIG_SYS_NAND_BLOCK_SIZE      (128 * 1024)

/* NAND flash config */

#define CONFIG_NAND_BR_PRELIM   (CONFIG_SYS_NAND_BASE_PHYS \

                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \

                                | BR_PS_8       /* Port Size = 8 bit */ \

                                | BR_MS_FCM             /* MSEL = FCM */ \

                                | BR_V)                 /* valid */

#define CONFIG_NAND_OR_PRELIM   (0xFFF80000             /* length 32K */ \

                                | OR_FCM_CSCT \

                                | OR_FCM_CST \

                                | OR_FCM_CHT \

                                | OR_FCM_SCY_1 \

                                | OR_FCM_TRLX \

                                | OR_FCM_EHTR)

#define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */

#define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */

#define CONFIG_SYS_BR1_PRELIM  CONFIG_NAND_BR_PRELIM  /* NAND Base Address */

#define CONFIG_SYS_OR1_PRELIM  CONFIG_NAND_OR_PRELIM  /* NAND Options */

cpu_init_nand.c :

  out_be32(&lbc->br1, CONFIG_NAND_BR_PRELIM);

  out_be32(&lbc->or1, CONFIG_NAND_OR_PRELIM);

With the above configurations, in "NAND info" u-boot command, NAND device ID is displayed. But in "nand read", it is displaying "skipping bad block" with error read failed.

In Linux, the probe function in freescale NAND ELBC driver  is failed in mapping the memory region. The dmesg log is "failed to get memory region".

Kindly confirm whether NAND base address is fine to map in Linux.

Thanks & Regards,

S.Abinesh.

0 Kudos