Hi Joe, > Hi, > > I have problems with fw_env.config in NOR flash. > Would anyone please help me solve it? Thanks. > > In my board config: > > ifdef CONFIG_NAND > #define CFG_NO_FLASH > #define CONFIG_ENV_IS_IN_NAND 1 > #define CONFIG_ENV_OFFSET 0x400000 /* add for 2008.10 */ > #define CONFIG_ENV_OFFSET_REDUND 0x404000 > #define CONFIG_ENV_SIZE 0x4000 > #else > #define CONFIG_ENV_IS_IN_FLASH 1 > #define CONFIG_ENV_ADDR (CFG_FLASH_BASE + 0x000c0000) > #define PHYS_FLASH_SIZE 0x1000000 /* 16 MB */ > #define CONFIG_ENV_SIZE 0x20000 > #define CONFIG_ENV_SECT_SIZE 0x20000 > #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + > CONFIG_ENV_SECT_SIZE) > #endif
Maybe you want to reconsider these settings after fixing your current problem. The idea that we have an CONFIG_ENV_SIZE additionally to CONFIG_ENV_SECT_SIZE is so that we can define an environment _smaller_ than a whole sector. This speeds up U-Boot when calculating the CRC over the environment. With your settings, U-Boot will need to read the whole 128k for this calculation. > # cat /proc/mtd > dev: size erasesize name > mtd0: 00dc0000 00020000 "Linux" > mtd1: 00100000 00020000 "User" > mtd2: 00100000 00020000 "Boot" Are you sure these partitions are correct? The sizes add to 15.75 MiB whereas above a comment says 16 MiB nor flash. Also the header above says that the first environment is at the FLASH_BASE + 768k and the second at FLASH_BASE + 896k. If the partitions here are all on nor in linear order, the environments would be somewhere in mtd0... > My fw_env.config setting: > /dev/mtd2 0x400000 0x20000 0x20000 How did you arrive at these settings? The second column is the offset into the mtd device. So you put 4 MiB there although mtd2 is only 1 MiB. > but it doesn't work :( > #fw_printenv > Read error on /dev/mtd2: Success >From what I write above, I'm not surprised. All I can suggest to you is to write down your flash layout somewhere and check all your settings - including the linux mtd partitioning - again, then do some basic calculations to arrive at the correct parameters. It is not _that_ hard. Cheers Detlev -- System going down at 1:45 this afternoon for disk crashing. -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot