[U-Boot-Users] NAND flash support

mitsy mitsy12 at gmail.com
Tue Aug 1 19:29:24 CEST 2006


Hi,

I've been trying to add NAND flash support to my u-boot but having
issues. I'd really appreciate if anyone could give me any
suggestions/comments on what I'm doing wrong.

The board I have is based on AMD au1550, and it has one NOR flash and
one NAND flash. NAND flash is configured in lowlevel_init.S correctly
(I believe so since it works from Linux kernel.) However, when I try
to send any command to NAND flash, it just hangs there. Here are the
command macros I have:

#define NAND_WAIT_READY(nand)   while (!(*(volatile u8
*)((ulong)MEM_STSTAT) & 0x01))
#define WRITE_NAND_COMMAND(d, adr) do { printf("weee!"); *(volatile u8
*)((ulong)adr+MEM_STNAND_CMD) = d; __asm__ volatile ("sync"); }
while(0)
#define WRITE_NAND_ADDRESS(d, adr) do {*(volatile u8
*)((ulong)adr+MEM_STNAND_ADDR) = d; __asm__ volatile ("sync");}
while(0)
#define WRITE_NAND(d, adr)      do {*(volatile u8
*)((ulong)adr+MEM_STNAND_DATA) = d; __asm__ volatile ("sync");}
while(0)
#define READ_NAND(adr)          (*(volatile u8 *)((ulong)adr+MEM_STNAND_DATA))
#define NAND_DISABLE_CE(nand)   do { *(volatile u8 *)(MEM_STNDCTL) =
0; __asm__ volatile ("sync");} while(0)
#define NAND_ENABLE_CE(nand)    do { *(volatile u8 *)(MEM_STNDCTL) =
(1<<5); __asm__ volatile ("sync");} while(0)

These are empty since the processor handles them.

#define NAND_CTL_CLRALE
#define NAND_CTL_SETALE
#define NAND_CTL_CLRCLE
#define NAND_CTL_SETCLE

Thank you for your help in advance!

Mitsy




More information about the U-Boot mailing list