From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [v2, 1/3] mmc: fsl_esdhc: add esdhc_imx flag
Date: Tue, 19 Feb 2019 07:39:15 +0100 [thread overview]
Message-ID: <20190219073915.089fd4ab@jawa> (raw)
In-Reply-To: <VI1PR0401MB2237566CD6CE1A66D64D77B2F87C0@VI1PR0401MB2237.eurprd04.prod.outlook.com>
Hi "Y.b. Lu",
> Hi Lukasz,
>
> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: Monday, February 18, 2019 7:12 AM
> > To: Y.b. Lu <yangbo.lu@nxp.com>
> > Cc: u-boot at lists.denx.de
> > Subject: Re: [U-Boot] [v2, 1/3] mmc: fsl_esdhc: add esdhc_imx flag
> >
> > Dear "Y.b. Lu",
> >
> > > The fsl_esdhc driver was for Freescale eSDHC on MPC83XX/MPC85XX
> > > initially. The later QoriQ series processors (which were
> > > evolutions of MPC83XX/MPC85XX) and i.MX series processors were
> > > using this driver for their eSDHCs too.
> > >
> > > So there are two evolution directions for eSDHC now. For the two
> > > series processors, the eSDHCs are becoming more and more
> > > different. We should have split it into two drivers, like them
> > > (sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel.
> >
> > Why we cannot do it right just from the very beginning?
> >
> > In the end of the day we will try to mimic Linux kernel anyway,
> > IMHO it is better to start the split now and save some effort on a
> > half-step solution.
>
> [Y.b. Lu] I understand. The perfect way is to split them.
> However, if you grep 'CONFIG_FSL_ESDHC' in the whole u-boot source,
> you would find there are 607 results.
Those are boards, which use the driver. The modification would be done
in one or two files (fsl_esdhc.c|h).
> There will be so many companies
> boards affected.
I guess that the task of your patch set is to separate imx6q and ppc
specific code for those IP blocks.
> I just don't know who could make all of these boards
> tested.
Your patch set also makes some changes in the generic driver depending
on the priv->esdhc_imx flag. Those changes also need to be tested on
all before mentioned boards.
In the end you logically split the driver,
having it in a single file, which IMHO is not proper long-term solution.
>
> My current patch-set is also to cleaning up the driver waiting for
> splitting them someday on the other hand. After you check
> CONFIG_FSL_ESDHC in u-boot source, if you think it's better we should
> split them right now, I could work on the driver splitting.
You can think about having common part (in one file - fsl_esdhc.c) and
then separate files with code specific to imx and ppc. This would
reduce the number of changes needed.
>
> Thanks a lot.
>
> > > But it seemed
> > > to be a lot of work now. So let's keep as it is. Be very careful
> > > to change the driver if the changes are not common for all
> > > eSDHCs, and clarify i.MX eSDHC specific things to distingush them
> > > with QorIQ eSDHC.
> > >
> > > This patch is to added an esdhc_imx flag for the development of
> > > i.MX eSDHC, to distinguish it with QoriQ eSDHC.
> > >
> > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > > ---
> > > Changes for v2:
> > > - Converted to use device_is_compatible().
> > > ---
> > > drivers/mmc/fsl_esdhc.c | 11 +++++++++++
> > > 1 file changed, 11 insertions(+)
> > >
> > > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> > > index 21fa2ab1d4..a647bc7f1c 100644
> > > --- a/drivers/mmc/fsl_esdhc.c
> > > +++ b/drivers/mmc/fsl_esdhc.c
> > > @@ -147,6 +147,7 @@ struct fsl_esdhc_priv {
> > > struct gpio_desc cd_gpio;
> > > struct gpio_desc wp_gpio;
> > > #endif
> > > + bool esdhc_imx;
> > > };
> > >
> > > /* Return the XFERTYP flags for a given command and data packet
> > > */ @@ -1462,6 +1463,16 @@ static int fsl_esdhc_probe(struct
> > > udevice *dev) priv->caps = data->caps;
> > > }
> > >
> > > + /*
> > > + * This is to specify whether current eSDHC is an i.MX
> > > eSDHC,
> > > + * since the i.MX eSDHC has been becoming more and more
> > > different
> > > + * with QorIQ eSDHC and initial MPC83XX/MPC85XX.
> > > + */
> > > + if (!device_is_compatible(dev, "fsl,esdhc"))
> > > + priv->esdhc_imx = true;
> > > + else
> > > + priv->esdhc_imx = false;
> > > +
> > > val = dev_read_u32_default(dev, "bus-width", -1);
> > > if (val == 8)
> > > priv->bus_width = 8;
> >
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH, Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma at denx.de
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190219/4cb801b8/attachment.sig>
next prev parent reply other threads:[~2019-02-19 6:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 2:25 [U-Boot] [v2, 1/3] mmc: fsl_esdhc: add esdhc_imx flag Y.b. Lu
2019-02-15 2:25 ` [U-Boot] [v2, 2/3] mmc: fsl_esdhc: clean up register definition Y.b. Lu
2019-02-15 2:25 ` [U-Boot] [v2, 3/3] mmc: fsl_esdhc: clarify i.MX eSDHC specific functions Y.b. Lu
2019-02-15 5:14 ` [U-Boot] [v2, 1/3] mmc: fsl_esdhc: add esdhc_imx flag Peng Fan
2019-02-17 23:12 ` Lukasz Majewski
2019-02-19 4:02 ` Y.b. Lu
2019-02-19 6:39 ` Lukasz Majewski [this message]
2019-02-21 7:54 ` Y.b. Lu
2019-02-26 3:39 ` Y.b. Lu
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=20190219073915.089fd4ab@jawa \
--to=lukma@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.