Index: u-boot/board/neo1973/gta02/Makefile =================================================================== --- u-boot.orig/board/neo1973/gta02/Makefile +++ u-boot/board/neo1973/gta02/Makefile @@ -25,7 +25,7 @@ LIB = lib$(BOARD).a -OBJS := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \ +OBJS := gta02.o pcf50633.o nand.o nor.o ../common/cmd_neo1973.o \ ../common/gsmver.o \ ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o SOBJS := ../common/lowlevel_init.o Index: u-boot/board/neo1973/gta02/nor.c =================================================================== --- /dev/null +++ u-boot/board/neo1973/gta02/nor.c @@ -0,0 +1,30 @@ +#include + + +flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; + + +ulong flash_init (void) +{ + flash_info[0].sector_count = 1; + flash_info[0].start[0] = 0x18000000; + memset(flash_info[0].protect, 0, CFG_MAX_FLASH_SECT); + return flash_info[0].size = 0x200000; +} + + +void flash_print_info (flash_info_t * info) +{ +} + + +int flash_erase (flash_info_t * info, int s_first, int s_last) +{ + return ERR_PROG_ERROR; +} + + +int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) +{ + return ERR_PROG_ERROR; +} Index: u-boot/include/configs/neo1973_gta02.h =================================================================== --- u-boot.orig/include/configs/neo1973_gta02.h +++ u-boot/include/configs/neo1973_gta02.h @@ -100,6 +100,7 @@ /* CFG_CMD_HWFLOW | */ \ #define CONFIG_CMD_SAVES #define CONFIG_CMD_NAND +#define CONFIG_CMD_FLASH #define CONFIG_CMD_PORTIO #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT @@ -188,7 +189,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ - "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock5 console=ttySAC2,115200 console=tty0 loglevel=8\0" \ + "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8\0" \ "" /*----------------------------------------------------------------------- @@ -203,9 +204,6 @@ * FLASH and environment organization */ -/* No NOR flash in this device */ -#define CFG_NO_FLASH 1 - #define CFG_ENV_IS_IN_NAND 1 #define CFG_ENV_SIZE 0x40000 /* 128k Total Size of Environment Sector */ #define CFG_ENV_OFFSET_OOB 1 /* Location of ENV stored in block 0 OOB */ @@ -277,11 +275,15 @@ #define CONFIG_DRIVER_PCF50633 1 #define CONFIG_RTC_PCF50633 1 -#define MTDIDS_DEFAULT "nand0=neo1973-nand" +#define MTDIDS_DEFAULT "nor0=physmap-flash,nand0=neo1973-nand" //#define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),128k(u-boot_env),8M(kernel),640k(splash),256k(factory),-(rootfs)" +#define CFG_MTDPARTS_PREFIX "physmap-flash:-(nor);" #define CFG_NAND_DYNPART_MTD_KERNEL_NAME "neo1973-nand" #define CONFIG_NAND_DYNPART +#define CFG_MAX_FLASH_BANKS 1 +#define CFG_MAX_FLASH_SECT 1 + #define DFU_NUM_ALTERNATES 7 #endif /* __CONFIG_H */ Index: u-boot/drivers/mtd/nand/nand_bbt.c =================================================================== --- u-boot.orig/drivers/mtd/nand/nand_bbt.c +++ u-boot/drivers/mtd/nand/nand_bbt.c @@ -1071,7 +1071,11 @@ if (!mtdparts) return -ENOMEM; - sprintf(mtdparts, "mtdparts=" CFG_NAND_DYNPART_MTD_KERNEL_NAME ":"); + sprintf(mtdparts, "mtdparts=" +#ifdef CFG_MTDPARTS_PREFIX + CFG_MTDPARTS_PREFIX +#endif + CFG_NAND_DYNPART_MTD_KERNEL_NAME ":"); for (part = 0; dynpart_size[part] != 0; part++) { unsigned int bb_delta = 0; Index: u-boot/drivers/usb/usbdfu.c =================================================================== --- u-boot.orig/drivers/usb/usbdfu.c +++ u-boot/drivers/usb/usbdfu.c @@ -112,25 +112,28 @@ { struct mtd_device *dev; struct part_info *part; + struct list_head *dentry; struct list_head *pentry; int i; if (mtdparts_init()) return NULL; - if (list_empty(&devices)) - return NULL; - dev = list_entry(devices.next, struct mtd_device, link); - i = 0; - list_for_each(pentry, &dev->parts) { - if (i == idx) { - part = list_entry(pentry, struct part_info, link); - return part; + list_for_each(dentry, &devices) { + dev = list_entry(dentry, struct mtd_device, link); + if (dev->id->type == MTD_DEV_TYPE_NAND) { + i = 0; + list_for_each(pentry, &dev->parts) { + if (i == idx) { + part = list_entry(pentry, + struct part_info, link); + return part; + } + i++; + } + return NULL; } - i++; } - - return NULL; } #define LOAD_ADDR ((unsigned char *)0x32000000)