Assign memory to NAND in P2020rdb

cancel
Showing results for 
Search instead for 
Did you mean: 

Assign memory to NAND in P2020rdb

366 Views
Contributor I

HI,

My P2020 is NOR boot. How can I modify the start address and size of NAND? What should I do to u-boot source code?

Best Regards.

Min Zhao

Labels (1)
Tags (1)
0 Kudos
5 Replies

15 Views
NXP TechSupport
NXP TechSupport

NAND flash interface is different with NOR flash, NOR flash is memory mapped device, NAND device is interfaced serially via a complicated I/O interface.

If you want to change to other NAND flash device, please pay attention to the following configuration  in the header file include/configs/p1_p2_rdb_pc.h.

#define CONFIG_SYS_NAND_BASE        0xff800000

#define CONFIG_SYS_NAND_BLOCK_SIZE  (16 * 1024)

#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(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_SYS_NAND_OR_PRELIM  (OR_AM_32KB /* small page */ \

        | OR_FCM_CSCT \

        | OR_FCM_CST \

        | OR_FCM_CHT \

        | OR_FCM_SCY_1 \

        | OR_FCM_TRLX \

        | OR_FCM_EHTR)


Have a great day,
Yiping Wang

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

0 Kudos

15 Views
Contributor I

I want to change the NAND start address. If I only modify the address in #define CONFIG_SYS_NAND_BASE   0xff800000.  Can it work?


What represents the size of NAND?


Best regards

Min Zhao

0 Kudos

15 Views
NXP TechSupport
NXP TechSupport

NAND flash is not mapped into the memory space  like NOR flash, it is a block device such as hard disk, the default local bus 32 KB NAND Chip Select is used to access the internal FCM buffer which acts as a temporary storage during read/write operations with NAND flash, you could find this section in the memory map.

So no need to specify NAND size in u-boot configuration file, but you need to consider other parameters which I mentioned as the above according to NAND flash specification and P2020RM, for example NAND flash block size.

In addition, probably you also need to modify Environment section related to NAND Flash in the header file.


Have a great day,
Yiping Wang

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

15 Views
Contributor I

I can't understand the code about NAND, so I don't know how to modify it. Do you know where can I learn relevant knowledge about the configurtion about NAND?

Best regards

Min Zhao

0 Kudos

15 Views
Contributor I


I don't have a P2020 board, but you should look at the documents that came with your reference board. You'll probably need to toggle some DIP switches.


>What should I do to u-boot source code?

Depends on what version of u-boot you are using.

If you are using mainline (2014.04) there is already a P2020RDB_NAND target so you don't need to modify anything to boot the reference boards from a NAND device. The FSL SDK u-boot should have this too.


All the best,

Rommel

0 Kudos