From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hector Palacios Date: Tue, 7 Jan 2014 08:47:19 +0100 Subject: [U-Boot] Are mmc open/close subcommands needed? In-Reply-To: References: <52C5996C.4020803@digi.com> <201401030036.41329.marex@denx.de> Message-ID: <52CBB107.9050607@digi.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Otavio, On 01/03/2014 06:35 PM, Otavio Salvador wrote: > On Thu, Jan 2, 2014 at 9:36 PM, Marek Vasut wrote: >> On Thursday, January 02, 2014 at 05:53:00 PM, Hector Palacios wrote: >>> Hi, >>> >>> I saw commit 2a91c9134675140853577b565210458b5774e6cf that introduces mmc >>> subcommands 'open' and 'close' to access eMMC boot partitions and was >>> wondering if they are really needed. Can't the same be achieved with >>> already existing 'mmc dev [dev] [part]' command? >>> >>> mmc open >>> is the same as >>> mmc dev >>> where is the boot partition >>> >>> mmc close >>> is the same as >>> mmc dev 0 >>> as a 0 will switch to partition 0 (user data). >>> >>> Best regards, >>> -- >>> Hector Palacios >> >> +CC Panto > > No; this is for different use. > > The open and close are to open the Boot partitions part of eMMC 4; by > default those eMMC will be using the user partitions, not the boot > area. > > The nice, and confusing thing, is that those boot partitions also > start in address 0 as a 'virtual disk'. I don't think they are different commands that do the same by coincidence. The 'mmc dev' command, when passed a fourth argument for the partition is calling the function 'mmc_switch_part()'. This function executes the CMD6 command to write the Extended CSD register PARTITION_CONFIG field that gives you access to any MMC partition (user data area, boot partitions 1 and 2, RPMB, General Purpose 1-4 partitions). It doesn't look like specific eMMC commands are needed to access the boot partitions, but maybe I'm misinterpreting the code. Best regards, -- Hector Palacios