public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pavel Herrmann <morpheus.ibis@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/11] DM: add block device core
Date: Fri, 21 Sep 2012 19:19:09 +0200	[thread overview]
Message-ID: <3971955.aCxuXVrhyC@bloomfield> (raw)
In-Reply-To: <201209211755.10667.marex@denx.de>

On Friday 21 of September 2012 17:55:10 Marek Vasut wrote:
> Dear Pavel Herrmann,
> 
> > On Friday 21 of September 2012 17:34:27 Marek Vasut wrote:
> > > Dear Pavel Herrmann,
> > > 
> > > [...]
> > > 
> > > > > > blockctrl = AHCI, PIIX... whichever chip you have between SATA and
> > > > > > PCI (or generally disk-bus and board-bus)
> > > > > 
> > > > > So this is for sata ? Or will it also by used for SD/USB flash
> > > > > discs?
> > > > 
> > > > no, blockctrl will be used for SATA, PATA, SCSI, and anything of the
> > > > sort (device with several ports, block devices on said ports, ability
> > > > to send read/write/query commands to devices on ports - definitely not
> > > > USB, possibly also SD, but you probably want more operations from SD)
> > > 
> > > Why not USB flash ? Why not SD, what other stuff do you need for that?
> > > Is
> > > the API not misdesigned then?
> > 
> > you should have a blockdev driver for USB flash and SD, but not blockctrl
> 
> I'm lost again. Do I also need a blockdev driver for SATA controller now
> that I need a blockdev driver for SD card controller ?

you need a blockdev for a blockctrl (see [5/11]), and you need a blockctrl 
driver for your SATA controller

you can either implement your SD as a blockctrl and use that blockdev, or 
implement a separate blockdev for your SD card (this is the original 
intention)

I have not looked at current SD API, but i do recall seeing some non-memory 
SDIO cards (wifi for example, not sure u-boot supports this though), so i dont 
think SD should be implemented as a blockctrl

> > > > > > blockdev = disk, partition, SD card
> > > > > 
> > > > > Uh, let's say I understand (even if I don't see the correlation
> > > > > between partition and SD card)
> > > > 
> > > > they are an ordered bunch of blocks with a "conventional" filesystem
> > > > on
> > > > them
> > > 
> > > You might want to do RAW reads, so why do you put filesystem into this
> > > context?
> > 
> > yes, you can do raw reads, but in most cases you are using a filesystem.
> 
> Not true, see how env is stored to these media.
> 
> > i
> > put filesystem there to differentiate from nand devices (which have a
> > special flash- based filesystems in most cases).
> 
> Not true, raw IO on flash media is often used too.
> 
> > > > > > - something that does basic checks
> > > > > > (range, possibility of operation) and submits operations to
> > > > > > correct
> > > > > > parent (blockctrl, MMC controller, whatnot).
> > > > > 
> > > > > Ascii art might help here greatly (how these pieces fall together).
> > > > > I
> > > > > think I do understand it though.
> > > > 
> > > > current code
> > > > user -> FS -> offset calculation from partition info -> drivers/disk
> > > > 
> > > > new code
> > > > user -> FS -> blockdev -> blockctrl (or USB or SD controller)
> > > 
> > > So your "blockctrl" should do the USB/SD/whatever muxing.
> > 
> > no, blockdev shoud be the last common part, for SD/USB, you should have a
> > different blockdev driver, that uses USB/SD API for the actual works
> > 
> > blockctrl is just an unified look at whatever now resides in drivers/block
> 
> Answer my question, you are contradicting yourself in your answer. So again,
> does "blockctrl" do the muxing between the downstream drivers (SD blockdev,
> USB blockdev, SATA blockdev, IDE blockdev ... ) ?

again, no

blockctrl is a common API primarily for SATA/PATA/SCSI controllers, blockdev 
is an abstraction of any block device, therefore you should have a AHCI 
blockctrl, piix blockctrl, bfin blockctrl, sil3114 blockctrl (add anything from 
drivers/block) but a USB blockdev and SD blockdev.

see the difference?

the idea is that there would be no difference when working with SATA/PATA/SCSI 
(as the commands are almost the same currently), but working with USB drives 
and SD cards would be a little different (that is from their own separate 
commands, but not through the blockdev layer)

Pavel Herrmann

  reply	other threads:[~2012-09-21 17:19 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 19:37 [U-Boot] [PATCH 00/11] Add DM blockdev subsystem Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 01/11] DM: add block device core Pavel Herrmann
2012-09-20 19:58   ` Marek Vasut
2012-09-21  7:11     ` Pavel Herrmann
2012-09-21 12:39       ` Marek Vasut
2012-09-21 13:27         ` Pavel Herrmann
2012-09-21 13:53           ` Marek Vasut
2012-09-21 14:57             ` Pavel Herrmann
2012-09-21 15:34               ` Marek Vasut
2012-09-21 15:48                 ` Pavel Herrmann
2012-09-21 15:55                   ` Marek Vasut
2012-09-21 17:19                     ` Pavel Herrmann [this message]
2012-09-21 18:00                       ` Marek Vasut
2012-09-21 18:53                         ` Pavel Herrmann
2012-09-21 19:17                           ` Marek Vasut
2012-09-21 19:29                             ` Pavel Herrmann
2012-09-21 21:11                               ` Marek Vasut
2012-09-21 23:43                                 ` Pavel Herrmann
2012-09-22  0:09                                   ` Marek Vasut
2012-09-22  9:39                                     ` Pavel Herrmann
2012-09-22 13:33                                       ` Marek Vasut
2012-09-22 13:59                                         ` Pavel Herrmann
2012-09-24 12:23                                           ` Pavel Herrmann
2012-09-20 20:49   ` [U-Boot] [U-Boot-DM] " Vikram Narayanan
2012-09-21  7:09     ` Pavel Herrmann
2012-09-21 12:39       ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 02/11] DM: add support for scanning DOS partitions to blockdev core Pavel Herrmann
2012-09-20 20:03   ` Marek Vasut
2012-09-21  7:22     ` Pavel Herrmann
2012-09-21 12:47       ` Marek Vasut
2012-09-21 13:18         ` Pavel Herrmann
2012-09-21 13:54           ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 03/11] DM: add block controller core Pavel Herrmann
2012-09-20 20:05   ` Marek Vasut
2012-09-21  7:21     ` Pavel Herrmann
2012-09-21 12:51       ` Marek Vasut
2012-09-21 13:14         ` Pavel Herrmann
2012-09-21 13:56           ` Marek Vasut
2012-09-21 15:04             ` Pavel Herrmann
2012-09-21 13:33         ` Pavel Herrmann
2012-09-21 13:58           ` Marek Vasut
2012-09-21 15:09             ` Pavel Herrmann
2012-09-21 15:39               ` Marek Vasut
2012-09-21 15:46                 ` Pavel Herrmann
2012-09-21 16:08                   ` Marek Vasut
2012-09-21 17:22                     ` Pavel Herrmann
2012-09-21 18:01                       ` Marek Vasut
2012-09-21 19:15                         ` Pavel Herrmann
2012-09-21 19:22                           ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 04/11] DM: add sata_legacy driver for blockctrl Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 05/11] DM: add ata and partition blockdev drivers Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 06/11] DM: add cmd_block command Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 07/11] DM: use new blockdev API in FAT Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 08/11] DM: use new blockdev API in ext2 Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 09/11] DM: use new blockdev API in reiserfs Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 10/11] DM: use new blockdev API in ZFS Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 11/11] DM: switch sandbox to DM blockdev Pavel Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3971955.aCxuXVrhyC@bloomfield \
    --to=morpheus.ibis@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox