Open junwushi opened 4 years ago
i think "nand" should be change to "mtd", but what's is the value of WITH_YAFFS_OOB?
I'm not seeing any error using following steps:
I opened two define in uboot nuc970_evb.h
if don't need open it ,forget this
when i finished do that { make nuc970_defconfig eable yaffs2 support in menuconfig->file systems->yaffs2 filesystem support mak}
when load rootfs, it show "devtmpfs: error mounting -2" that means uboot has issue for nand read or wirte function?
U-Boot 2016.11 (Jul 04 2020 - 14:06:41 +0800)
CC cmd/nand.o CC common/flash.o cmd/nand.c: 在函数‘do_nand’中: cmd/nand.c:642:4: 错误:‘nand’未声明(在此函数内第一次使用) nand->rw_oob = 1; ^ cmd/nand.c:642:4: 附注:每个未声明的标识符在其出现的函数内只报告一次 cmd/nand.c:646:7: 错误:‘WITH_YAFFS_OOB’未声明(在此函数内第一次使用) WITH_YAFFS_OOB); ^ cmd/nand.c:645:7: 警告:传递‘nand_write_skip_bad’的第 4 个参数时在不兼容的指针类型间转换 (u_char )addr, ^ In file included from cmd/nand.c:30:0: include/nand.h:107:5: 附注:需要类型‘size_t ’,但实参的类型为‘u_char ’ int nand_write_skip_bad(struct mtd_info mtd, loff_t offset, size_t length, ^ cmd/nand.c:644:10: 错误:提供给函数‘nand_write_skip_bad’的实参太少 ret = nand_write_skip_bad(nand, off, &rwsize, ^ In file included from cmd/nand.c:30:0: include/nand.h:107:5: 附注:在此声明 int nand_write_skip_bad(struct mtd_info mtd, loff_t offset, size_t *length, ^ make[3]: [scripts/Makefile.build:280:cmd/nand.o] 错误 1 make[2]: [Makefile:1233:cmd] 错误 2
//include/configs/nuc970-evb.h /*
ifndef __CONFIG_H
define __CONFIG_H
define EXT_CLK 12000000 / 12 MHz crystal /
define CONFIG_SYS_TEXT_BASE 0xE00000
define CONFIG_SYS_LOAD_ADDR 0x8000
define CONFIG_SYS_MEMTEST_START 0xA00000
define CONFIG_SYS_MEMTEST_END 0xB00000
define CONFIG_ARCH_CPU_INIT
undef CONFIG_USE_IRQ
define CONFIG_CMDLINE_TAG 1 / enable passing of ATAGs /
define CONFIG_SETUP_MEMORY_TAGS 1
define CONFIG_INITRD_TAG 1
/#define CONFIG_NUC970_HW_CHECKSUM /
/#define CONFIG_SYS_USE_SPIFLASH /
define CONFIG_SYS_USE_NANDFLASH
define CONFIG_ENV_IS_IN_NAND
//add by jwshi
if defined(CONFIG_SYS_USE_NANDFLASH)
define CONFIG_BOOTCOMMAND "nboot 0x7fc0 0 0x200000;bootm 0x7c0"
endif
//end by jwshi
/#define CONFIG_ENV_IS_IN_SPI_FLASH / /#define CONFIG_ENV_IS_IN_MMC /
define CONFIG_BOARD_EARLY_INIT_F
define CONFIG_BOARD_LATE_INIT
define CONFIG_HW_WATCHDOG
define CONFIG_SYS_BOOTM_LEN 0x1000000 / 16MB max kernel size /
/#define CONFIG_BOOTDELAY 3/
define CONFIG_SYS_SDRAM_BASE 0
define CONFIG_NR_DRAM_BANKS 2 / there are 2 sdram banks for nuc970 /
define CONFIG_SYS_INIT_SP_ADDR 0xBC008000
define CONFIG_BAUDRATE 115200
define CONFIG_SYS_BAUDRATE_TABLE {115200, 57600, 38400}
/#define CONFIG_NUC970_EMAC1/ /#define CONFIG_CMD_NET /
define CONFIG_ETHADDR 00:00:00:11:66:88
define CONFIG_SYS_RX_ETH_BUFFER 16 // default is 4, set to 16 here.
/#define CONFIG_KPI_NUC970/
/#undef CONFIG_SYS_ICACHE_OFF / /#undef CONFIG_SYS_DCACHE_OFF / /#define CONFIG_SYS_ICACHE_OFF/
define CONFIG_SYS_DCACHE_OFF
/*
if 1
define CONFIG_BOOTP_BOOTFILESIZE 1
define CONFIG_BOOTP_BOOTPATH 1
define CONFIG_BOOTP_GATEWAY 1
define CONFIG_BOOTP_HOSTNAME 1
define CONFIG_BOOTP_SERVERIP / tftp serverip not overruled by dhcp server /
endif
/*
if 0
include
undef CONFIG_CMD_LOADS
undef CONFIG_CMD_SOURCE
endif
ifdef CONFIG_SYS_USE_SPIFLASH
undef CONFIG_CMD_IMLS /====================> SPI only /
undef CONFIG_CMD_JFFS2
endif
ifdef CONFIG_KPI_NUC970
/#define CONFIG_KPI_PA_PORT 1 / / KPI select PA port /
define CONFIG_KPI_PH_PORT 1 / KPI select PH port /
define CONFIG_KPI_ROW_NUM 3 / row number is 1~4 /
define CONFIG_KPI_COL_NUM 3 / col number is 1~8 /
define CONFIG_KPI_DEBOUNCE 8 / debounce length setting: 0~13 /
endif
ifdef CONFIG_SYS_USE_NANDFLASH
define CONFIG_CMD_NAND 1
define CONFIG_CMD_UBI 1
define CONFIG_CMD_UBIFS 1
define CONFIG_MTD_UBI_WL_THRESHOLD 4096 / CWWeng 2017.2.13 /
define CONFIG_MTD_UBI_BEB_LIMIT 20 / CWWeng 2017.2.13 /
define CONFIG_CMD_MTDPARTS 1
define CONFIG_MTD_DEVICE 1
define CONFIG_MTD_PARTITIONS 1
define CONFIG_RBTREE 1
define CONFIG_LZO 1
define CONFIG_SYS_NAND_ONFI_DETECTION 1
define MTDIDS_DEFAULT "nand0=nand0"
define MTDPARTS_DEFAULT "mtdparts=nand0:0x200000@0x0(u-boot),0x1400000@0x200000(kernel),-(user)"
define MTD_ACTIVE_PART "nand0,2"
define CONFIG_CMD_NAND_YAFFS2 1
define CONFIG_YAFFS2 1
define CONFIG_SYS_MAX_NAND_DEVICE 1
define CONFIG_SYS_NAND_BASE 0xB000D000
define CONFIG_SYS_NAND_ECCBYTES 12
ifdef CONFIG_ENV_IS_IN_NAND
define CONFIG_ENV_OFFSET 0x80000
define CONFIG_ENV_SIZE 0x10000
define CONFIG_ENV_SECT_SIZE 0x20000
define CONFIG_ENV_RANGE (4 CONFIG_ENV_SECT_SIZE) / Env range : 0x80000 ~ 0x100000 */
define CONFIG_ENV_OVERWRITE
endif
endif
define CONFIG_SYS_NAND_U_BOOT_OFFS 0x100000 / Offset to RAM U-Boot image /
define CONFIG_SPL_TEXT_BASE 0x200
define CONFIG_SPL_STACK 0xBC008000
define CONFIG_SPL_NAND_SIMPLE
define CONFIG_SPL_NAND_LOAD
define CONFIG_SPL_NAND_BASE
define CONFIG_SPL_NAND_DRIVERS
define CONFIG_SPL_NAND_ECC
ifdef CONFIG_SPL_BUILD / CONFIG_NAND_SPL /
/ base address for uboot /
define CONFIG_SYS_PHY_UBOOT_BASE (CONFIG_SYS_SDRAM_BASE + 0xE00000)
define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_PHY_UBOOT_BASE / NUB load-addr /
define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST / NUB start-addr /
define CONFIG_SYS_NAND_U_BOOT_SIZE (500 1024) / Size of RAM U-Boot image */
endif
/ SPI flash /
ifdef CONFIG_SYS_USE_SPIFLASH
define CONFIG_SPI 1
ifdef CONFIG_ENV_IS_IN_SPI_FLASH
define CONFIG_ENV_OFFSET 0x80000
define CONFIG_ENV_SIZE 0x10000
define CONFIG_ENV_SECT_SIZE 0x10000
define CONFIG_ENV_OVERWRITE
endif
endif
/#define CONFIG_SYS_PROMPT "U-Boot> " /
define CONFIG_SYS_CBSIZE 256
define CONFIG_SYS_MAXARGS 16
define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
define CONFIG_SYS_LONGHELP 1
define CONFIG_CMDLINE_EDITING 1
define CONFIG_AUTO_COMPLETE
define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
/ Following block is for LCD support /
ifdef CONFIG_LCD
/#define CONFIG_NUC977_LCD/
define LCD_BPP LCD_COLOR16
define CONFIG_LCD_LOGO
define CONFIG_LCD_INFO
define CONFIG_LCD_INFO_BELOW_LOGO
/#define CONFIG_SYS_CONSOLE_IS_IN_ENV/ /#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE/
define CONFIG_CONSOLE_SCROLL_LINES 1
endif
/ Following block is for MMC support /
ifdef CONFIG_NUC970_MMC
define CONFIG_CMD_MMC
define CONFIG_CMD_FAT
/#define CONFIG_MMC / /#define CONFIG_GENERIC_MMC /
define CONFIG_DOS_PARTITION
/#define CONFIG_MMC_TRACE / /#define CONFIG_NUC970_SD_PORT0 / /#define CONFIG_NUC970_SD_PORT1 / /#define CONFIG_NUC970_EMMC / / Don't enable eMMC(CONFIG_NUC970_EMMC) and NAND(CONFIG_NAND_NUC970) at the same time! /
ifdef CONFIG_ENV_IS_IN_MMC
define CONFIG_SYS_MMC_ENV_DEV 1
define CONFIG_ENV_OFFSET 0x80000
define CONFIG_ENV_SIZE /2048/0x10000
define CONFIG_ENV_SECT_SIZE 512
define CONFIG_ENV_OVERWRITE
endif
endif
/ Following block is for EHCI support/
if 1
/#define CONFIG_CMD_USB/ /#define CONFIG_CMD_FAT/ /#define CONFIG_USB_STORAGE/ /#define CONFIG_USB_EHCI/ /#define CONFIG_USB_EHCI_NUC970/
define CONFIG_EHCI_HCD_INIT_AFTER_RESET
define CONFIG_DOS_PARTITION
endif
/#define CONFIG_OF_LIBFDT / /#define CONFIG_FIT /
/*
define CONFIG_SYS_MALLOC_LEN (10241024) /ROUND(3 CONFIG_ENV_SIZE + 1281024, 0x1000) */
define CONFIG_STACKSIZE (321024) / regular stack */
endif