From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Rae Date: Fri, 30 May 2014 11:39:02 -0700 Subject: [U-Boot] [PATCH] mmc: add wrappers for MMC block_{read, write, erase} In-Reply-To: <5388BABB.9020808@wwwdotorg.org> References: <1401315346-30231-1-git-send-email-srae@broadcom.com> <53875F6D.5010708@wwwdotorg.org> <5387753E.9060106@broadcom.com> <538781B6.90703@wwwdotorg.org> <53878E10.4010609@broadcom.com> <538798E1.2040703@wwwdotorg.org> <5387AEB8.8030304@broadcom.com> <5388AA9C.8030504@wwwdotorg.org> <5388B820.7030806@broadcom.com> <5388BABB.9020808@wwwdotorg.org> Message-ID: <5388D046.8040805@broadcom.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 14-05-30 10:07 AM, Stephen Warren wrote: > On 05/30/2014 10:56 AM, Steve Rae wrote: >> On 14-05-30 08:58 AM, Stephen Warren wrote: > ... >>> What code are you >>> looking at that handles multiple devices sequentially under program >>> control rather than user command control? >> >> Cannot go into too much detail here (yet) -- but imagine the situation >> where: >> - lookup the GPT partition name (in User, Boot1, Boot2) >> - do a block_write to the desired location... > > So this is all to support some non-upstream code that you can't discuss? > That doesn't sound good... > >> So after discussing with a colleague, we would propose the following. >> Does this implement what you were proposing?: >> >> >> Usage (example): >> >> mmc->part_num_next_block_op = 1; /* specify Boot1 partition */ >> mmc->block_dev.block_read(0, 0, 1, buf); /* read first block from Boot1 >> partition */ >> mmc->part_num_next_block_op = 0; /* specify User partition */ >> mmc->block_dev.block_read(0, 0, 1, buf); /* read first block from User >> partition */ > > No. I would propose: > > get_device("mmc", "0.1", &bdev_boot1); > bdev_boot1->block_read(...); > get_device("mmc", "0.0", &bdev_user); > bdev_user->block_read(...); > > That way, nothing needs to change in block_dev_desc_t, get_device(), etc. > OK -- I can make this work... Therefore, abandoning this change. Many Thanks, Steve