[U-Boot] [PATCH 03/11] DM: add block controller core
Pavel Herrmann
morpheus.ibis at gmail.com
Fri Sep 21 17:09:37 CEST 2012
On Friday 21 of September 2012 15:58:55 Marek Vasut wrote:
> Dear Pavel Herrmann,
>
> > On Friday 21 of September 2012 14:51:33 Marek Vasut wrote:
> > > Dear Pavel Herrmann,
> > >
> > > > On Thursday 20 of September 2012 22:05:36 Marek Vasut wrote:
> > > > > Dear Pavel Herrmann,
> > > > >
> > > > > > This core provides unified access to different block controllers
> > > > > > (SATA,
> > > > > > SCSI).
> > > > >
> > > > > Description of the patch missing or is sub-par. You should work on
> > > > > this skill.
> > > > >
> > > > > > Signed-off-by: Pavel Herrmann <morpheus.ibis at gmail.com>
> > > > > > ---
> > > > > >
> > > > > > Makefile | 1 +
> > > > > > drivers/blockctrl/Makefile | 42 ++++++
> > > > > > drivers/blockctrl/core.c | 349
> > > > > >
> > > > > > +++++++++++++++++++++++++++++++++++++++++++++
> > > > > > include/dm/blockctrl.h
> > > > > >
> > > > > > 75 ++++++++++
> > > > > > 4 files changed, 467 insertions(+)
> > > > > > create mode 100644 drivers/blockctrl/Makefile
> > > > > > create mode 100644 drivers/blockctrl/core.c
> > > > > > create mode 100644 include/dm/blockctrl.h
> > > > > >
> > > > > > diff --git a/Makefile b/Makefile
> > > > > > index e43fd9d..4420484 100644
> > > > > > --- a/Makefile
> > > > > > +++ b/Makefile
> > > > > > @@ -304,6 +304,7 @@ LIBS-y += test/libtest.o
> > > > > >
> > > > > > LIBS-$(CONFIG_DM) += common/dm/libdm.o
> > > > > > LIBS-$(CONFIG_DM) += drivers/demo/libdemo.o
> > > > > > LIBS-${CONFIG_DM_BLOCK} += drivers/blockdev/libblockdev.o
> > > > > >
> > > > > > +LIBS-${CONFIG_DM_BLOCK} += drivers/blockctrl/libblockctrl.o
> > > > >
> > > > > ${} ? What is this ?
> > >
> > > Why not just reuse drivers/block and in drivers/block compile in the
> > > libblock.o so you don't polute the top-level makefile ? Easy as that.
> >
> > to make a distinction between drivers that are converted to new API and
> > those that are not, and to enable drivers to have the same filename for
> > original and converted versions.
>
> 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.
> How does that work? It's much cleaner.
>
> > Pavel Herrmann
>
> Best regards,
> Marek Vasut
More information about the U-Boot
mailing list