From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/11] DM: add block controller core
Date: Fri, 21 Sep 2012 21:22:33 +0200 [thread overview]
Message-ID: <201209212122.33500.marex@denx.de> (raw)
In-Reply-To: <1858518.6m1E5rVWdh@bloomfield>
Dear Pavel Herrmann,
> On Friday 21 of September 2012 20:01:27 Marek Vasut wrote:
> > Dear Pavel Herrmann,
> >
> > > On Friday 21 of September 2012 18:08:13 Marek Vasut wrote:
> > > > Dear Pavel Herrmann,
> > > >
> > > > > On Friday 21 of September 2012 17:39:21 Marek Vasut wrote:
> > > > > > Dear Pavel Herrmann,
> > > > > >
> > > > > > [...]
> > > > > >
> > > > > > > > Can't the old driver just have a compat section in them? Like
> > > > > > > > I did with serial stuff:
> > > > > > > >
> > > > > > > > 1) rename the internal functions to
> > > > > > > > ${driver}_${function_name} from pure ${function_name} and
> > > > > > > > introduce section which behaves as a wrapper (implement
> > > > > > > > ${function_name} calling
> > > > > > > > ${driver}_${function_name} ). 2) Add your DM goo, implement
> > > > > > > > #ifdef around it so either the compat section or DM section
> > > > > > > > is enabled.
> > > > > > >
> > > > > > > I actually did something of this sort, see [4/11], with less
> > > > > > > touching.
> > > > > > >
> > > > > > > the problem is that while SATA drivers are easy to convert, IDE
> > > > > > > ones are not. I would actually propose to do a ide_legacy
> > > > > > > driver (mostly out of the code currently in common/cmd_ide.c),
> > > > > > > and keep it as the only option until IDE dies completely.
> > > > > >
> > > > > > IDE will be around for a LONG time.
> > > > > >
> > > > > > You introduce that CONFIG_SYS_SATA_LEGACY for no reason, if you
> > > > > > did it as
> > > > > > said above, simple CONFIG_DM would suffice as the drivers would
> > > > > > be intacts with DM disabled. Note the compiler will opt-out
> > > > > > these proxy calls.
> > > > > >
> > > > > > Besides, with this approach of yours, you need to enable
> > > > > > SATA_LEGACY for every single board now, introducing a lot of
> > > > > > churn into the patches and if it's not defined, every board
> > > > > > using SATA is broken, right?
> > > > >
> > > > > No, if you dont define CONFIG_DM, you get the old way of
> > > > > interacting with disks. only if you define CONFIG_DM you only need
> > > > > CONFIG_SATA_LEGACY to plug old SATA drivers into DM codepaths
> > > >
> > > > So if you enable DM for a board, you also need to enable this compat
> > > > layer? My opinion is, that you either enable DM on the board and the
> > > > board is ready for it or don't enable it.
> > >
> > > if you enable DM on a board, you can either use the compat layer and
> > > the old driver, or use a ported driver and get rid of the compat layer
> > >
> > > > Would you need the compat layer at all were you to follow my advice?
> > >
> > > if i understand what you meant, i would build this compat layer into
> > > every one of the drivers currently in tree (with some cleanup). in
> > > that case, i would not need it
> >
> > That's correct. You would prepare every driver to be DM-ish and the final
> > deployment of DM would be mechanical. So would be the removal of the
> > non-DM part later on.
>
> that would lead to massive code duplication.
How?
> im not talking about the SATA
> drivers now, there its just about ready for DM already (static for all
> functions, remove dependency on static block_dev_desc array, include driver
> registration functions, done), but about IDE drivers, where the drivers
> have ~200 lines, whereas cmd_ide.c has ~2000 lines.
IDE implements some nasty hooks into cmd_ide.c, right ? I think if you managed
to clean up and analyze cmd_ide.c, it'd be possible to figure out a path to fix
the IDE drivers.
> as for the SCSI
> drivers, ahci.c is not really SCSI, more like a SATA driver with SCSI
> wrapper built in, the other one is a bit more complex, and would require
> some wrapper code addition (cmd_scsi is ~600 lines)
Might need some thinking here. Can the SCSI handling be abstracted out?
[...]
Best regards,
Marek Vasut
next prev parent reply other threads:[~2012-09-21 19:22 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
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 [this message]
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=201209212122.33500.marex@denx.de \
--to=marex@denx.de \
--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