This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x fw_env.config

Hi Ti

我使用 kernel 3.2 PSP6.0

想請問在 fw_env.config 裡面,該怎麼設定 u-boot 的資訊?

我有查詢 u-boot/include/configs/am335x_evm.h

                 #define CONFIG_ENV_SIZE            (128 << 10)

                 #define CONFIG_ENV_SECT_SIZE        (4 << 10) /* 4 KB sectors */
                 #define CONFIG_ENV_OFFSET        (768 << 10) /* 768 KiB in */

                 #define CONFIG_ENV_OFFSET        0x260000 /* environment starts here */

我該怎麼設定 fw_env.config??

    

  1. MTD device name ----> ?
  2. Device Offset -----> 0x260000??
  3. Environment Size -----> ?
  4. Flash sector size ------> ?

謝謝。

  • 请问您是要查找u-boot env所占用的空间的么,NAND的分区信息如下,U-boot env是0x260000开始的128KB空间(sector size是4KB):

    static struct mtd_partition am335x_nand_partitions[] = {
    /* All the partition sizes are listed in terms of NAND block size */
     {
      .name           = "SPL",
      .offset         = 0,   /* Offset = 0x0 */
      .size           = SZ_128K,
     },
     {
      .name           = "SPL.backup1",
      .offset         = MTDPART_OFS_APPEND, /* Offset = 0x20000 */
      .size           = SZ_128K,
     },
     {
      .name           = "SPL.backup2",
      .offset         = MTDPART_OFS_APPEND, /* Offset = 0x40000 */
      .size           = SZ_128K,
     },
     {
      .name           = "SPL.backup3",
      .offset         = MTDPART_OFS_APPEND, /* Offset = 0x60000 */
      .size           = SZ_128K,
     },
     {
      .name           = "U-Boot",
      .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
      .size           = 15 * SZ_128K,
     },
     {
      .name           = "U-Boot Env",
      .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
      .size           = 1 * SZ_128K,
     },
     {
      .name           = "Kernel",
      .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
      .size           = 40 * SZ_128K,
     },
     {
      .name           = "File System",
      .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
      .size           = MTDPART_SIZ_FULL,
     },
    };

  • Hi Ti

    1 請問這些分割空間是為了要將 SD 卡的 u-boot、uImage、filesystem 燒進去所配置的嗎? 就像 emmc 一樣?

    2  我的目的是想在等 kernel 開完,然後在 userspace 底下能夠看 u-boot 的 enviroment variables。我若參照了你所提到

       以上分割區的資訊來設定 fw_env.config,之後打上./fw_printenv,所看的的所有的 enviroment variables,都是要事先燒進

       NAND 裡的才能看到?

    謝謝。

  • 上面说的分割空间是给nand flash的

    您这里提到的是emmc,那么就是正常的分区工具,fat32、ext3/ext4