From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 02 Jun 2014 10:30:34 -0600 Subject: [U-Boot] [PATCH] mmc: add wrappers for MMC block_{read, write, erase} In-Reply-To: References: <1401315346-30231-1-git-send-email-srae@broadcom.com> Message-ID: <538CA6AA.4040105@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/02/2014 12:42 AM, Pantelis Antoniou wrote: > Hi Steve, > > I wanted the discussion to settle a bit before I reply to this series. > On May 29, 2014, at 1:15 AM, Steve Rae wrote: > >> Each wrapper function: >> - switches to the specified physical partition, then >> - performs the original function, and then >> - switches back to the original physical partition >> where the physical partition (aka HW partition) is >> 0=User, 1=Boot1, 2=Boot2, etc. >> >> Signed-off-by: Steve Rae >> --- > > [snip] > >> /** >> * Start device initialization and return immediately; it does not block on >> * polling OCR (operation condition register) status. Then you should call >> -- >> 1.8.5 >> > > The thing IMO should be modeled in the same way that block devices work in > Linux. > > TBH I'm not very fond of the way block devices/partitions and the block_ops > are intermixed in block_dev_t. This part of code could use some refactoring > to make it operate more like a regular linux block device (with each partition > being it's own block device), but I don't know if we have enough votes to change > it ATM. Refactoring that would make sense to me. That way, any client code could just pass the user's command-line (or whatever) parameters to some lookup function, which could return something that accesses whatever the user wants, without the code that accesses the data caring whether it's a complete block device, a complete HW partition, or a SW partition within one of those. Of course, I guess that's already the case, it's just that the information is split across block_dev_desc_t and disk_partition_t, when it doesn't really need to be.