From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ziyuan Date: Tue, 14 Mar 2017 08:54:20 +0800 Subject: [U-Boot] accessing eMMC boot partitions from U-Boot In-Reply-To: <3d6cdf04-290a-3588-2e44-6dbc2f618c89@wwwdotorg.org> References: <3d6cdf04-290a-3588-2e44-6dbc2f618c89@wwwdotorg.org> Message-ID: <58C73F3C.3010601@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de hi Stephen, On 03/14/2017 05:49 AM, Stephen Warren wrote: > On 03/13/2017 03:34 PM, Tim Harvey wrote: >> Greetings, >> >> I'm working with some boards with eMMC FLASH and understand that I can >> set the fields of the PARTITION_CONFIG with the 'mmc partconf' command >> to specify what partition is used for boot. Once I do that to set the >> boot0 partition for example, how can I access that partition from >> within u-boot via mmc read/write? In Linux the kernel provides access >> to user/boot0/boot1/rpmb via different devices, but I don't see u-boot >> doing that. > > The "mmc dev" command can be used to select which MMC device to > operate on. The "typical" command "mmc dev 0" selects the main > partition on MMC device 0 for later MMC-specific commands such as "mmc > read". You can add an extra parameter to that command to request a > specific HW partition, e.g. "mmc dev 0 1" selects boo0 of MMC device 0 > and "mmc dev 0 2" selects boot1. The 4th of "mmc dev 0 1" is the *software* partition index, not the hw partition index. AKA eMMC has four partitions: user data/boot0/boot1/rpmb, I think Tim wanna to boot from other partition, like boot0, right? As the eMMC spec v5.1 said that, you can do the following steps: 1, set BOOT_PARTITION_ENABLE bit 2, send cmd0 w/ argument 0xFFFFFFFA 3,After putting a slave into transfer state, master sends CMD6 (SWITCH) to set the PARTITION_ACCESS bits in the EXT_CSD register, byte [179] I don't try to boot from boot partitions, I hope it makes sense to you. > > A similar naming scheme exists for commands that take a complete > device specification each time. For example, "part list mmc 0" to list > partitions in the main partition on MMC device 0, or "part list mmc > 0.1" to list partitions on boot0 of MMC device 0. > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot