EMMC on the BBB

From Crashcourse Wiki

Jump to: navigation, search

Contents

Overview

Discussion of eMMC on the BBB, with relation to storing U-Boot environment information in one of the eMMC "boot" partitions. This uses the current Git tree for U-Boot.

Links

eMMC partitions

From U-Boot mailing list:

eMMC devices may have hardware-level partitions: 2 boot partitions,
up to 4 general partitions, plus the user area. This change introduces
optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which
partition the environment should be stored in: 0=user, 1=boot0, 2=boot1,
4..7=general0..3. This allows the environment to be kept out of the user
area, which simplifies the management of OS-/user-level (MBR/GPT)
partitions within the user area.

U-Boot source code support

From boards.cfg:

am335x_boneblack             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT

From am335x_evm.h, defining that U-Boot environment is going to be saved in "boot1" in eMMC:

#elif defined(CONFIG_EMMC_BOOT)
#undef CONFIG_ENV_IS_NOWHERE
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV          1
#define CONFIG_SYS_MMC_ENV_PART         2
#endif

User access to eMMC partitions

From U-Boot, it doesn't appear that one has direct access to the eMMC boot partitions:

U-Boot# mmc dev 1 
mmc1(part 0) is current device
U-Boot# mmc part

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     63              144522          00000000-01     0c Boot
  2     144585          3598560         00000000-02     83
U-Boot#

However, if one boots, Linux has special device files for those eMMC boot partitions, with which you can hexdump the environment info:

# ls -1 /dev/mmc*
/dev/mmcblk0
/dev/mmcblk0boot0
/dev/mmcblk0boot1
/dev/mmcblk0p1
/dev/mmcblk0p2
#

So let's dump boot1:

# hexdump -C /dev/mmcblk0boot1 | less                                                                                                   
00000000  d2 49 f9 c0 61 72 63 68  3d 61 72 6d 00 62 61 75  |.I..arch=arm.bau|
00000010  64 72 61 74 65 3d 31 31  35 32 30 30 00 62 6f 61  |drate=115200.boa|
00000020  72 64 3d 61 6d 33 33 35  78 00 62 6f 61 72 64 5f  |rd=am335x.board_|
00000030  6e 61 6d 65 3d 41 33 33  35 42 4e 4c 54 00 62 6f  |name=A335BNLT.bo|
00000040  61 72 64 5f 72 65 76 3d  30 41 35 43 00 62 6f 6f  |ard_rev=0A5C.boo|
00000050  74 5f 66 64 74 3d 74 72  79 00 62 6f 6f 74 61 72  |t_fdt=try.bootar|
00000060  67 73 3d 63 6f 6e 73 6f  6c 65 3d 74 74 79 4f 30  |gs=console=ttyO0|
00000070  2c 31 31 35 32 30 30 6e  38 20 71 75 69 65 74 20  |,115200n8 quiet |
00000080  64 72 6d 2e 64 65 62 75  67 3d 37 20 72 6f 6f 74  |drm.debug=7 root|
00000090  3d 2f 64 65 76 2f 6d 6d  63 62 6c 6b 30 70 32 20  |=/dev/mmcblk0p2 |
000000a0  72 6f 20 72 6f 6f 74 66  73 74 79 70 65 3d 65 78  |ro rootfstype=ex|
000000b0  74 34 20 72 6f 6f 74 77  61 69 74 00 62 6f 6f 74  |t4 rootwait.boot|
000000c0  63 6d 64 3d 72 75 6e 20  66 69 6e 64 66 64 74 3b  |cmd=run findfdt;|
... snip ...


(Back to BeagleBone Black page.)

Personal tools