public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] Tegra: MMC: Add DT support to MMC driver for all T20 boards
Date: Tue, 12 Feb 2013 20:41:04 +0100	[thread overview]
Message-ID: <1360698064.1537.22.camel@tellur> (raw)
In-Reply-To: <CA+m5__JT9G_bytpVh7HbfmTcWgL=YQA--Lo+f6LsSanb0XVt8g@mail.gmail.com>

Hello Tom,

Am Dienstag, den 12.02.2013, 12:24 -0700 schrieb Tom Warren:
> Lucas,

> >>>
> >> tegra_mmc_init should not be called from every individual board file,
> >> but from the common nvidia tegra board file. Only the pinmux should stay
> >> in the individual board code, same thing as was done to all the other
> >> functions like NAND and USB.
> >
> > True. I was originally just adapting the current config-file driven
> > MMC to DT step-by-step, but you're right - it should be called just
> > once for all boards in the common board file. I'll change it in V3.
> 
> I've looked into this some more, and it appears that I can't just add
> a call to tegra_mmc_init() from board_init() in
> boards/nvidia/common/board.c.
> 
> board_init() is where the other periphs do their pin_mux and
> xxx_init() calls (USB, SPI, etc.).  board_init() is called early in
> board_init_r(), before mmc_initialize() is called. mmc_initialize() is
> needed before tegra_mmc_init() can use the mmc_device struct, etc. So
> tegra_mmc_init() needs to be called after mmc_initialize(), and right
> now that's in each board's board_mmc_init().  In board_mmc_init(),
> each board sets up any power rails needed for SD-card or eMMC access,
> sets up it's pin muxes for MMC, and then calls tegra_mmc_init() to
> parse the DT file and populate the mmc structs.
> 
> I could move the pin_mux_mmc() function calls from each board file
> into nvidia/common/board.c's board_init(), but it wouldn't really
> change much. So I'll leave it as it is for now, with pin_mux_mmc() and
> tegra_mmc_init() being called from each board's 'board' file
> (seaboard.c, colibri_t20_iris.c, etc).
> 
> Let me know if you see another way to move Tegra MMC init to a common
> board file that doesn't break the MMC driver flow.
> 

I didn't look up the flow myself, as I don't have time for that right
now, but I think I've got a pretty good picture from your description.

I think we should really try to make the Tegra MMC init flow as similar
as possible to the other peripherals, so I suggest doing the following:
1. Provide a pin_mux_mmc() (possibly with a weak define as done with
other peripherals). Boards should do pinmux and rail enabling within
this function.
2. Move board_mmc_init() into nvidia/common/board.c, this function
should call into the board specific pinmux function and then call
tegra_mmc_init().

So even while we don't get the complete same flow as for other
peripherals as the board_mmc_init() still has to be a freestanding
function, instead of those things being folded into board_init(), we at
least gain a clear distinction between the board specific parts and
Tegra common code.

Regards,
Lucas

  reply	other threads:[~2013-02-12 19:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 17:17 [U-Boot] [PATCH v2 0/2] Tegra: MMC: Add DT support for MMC to T20 boards Tom Warren
2013-02-11 17:17 ` [U-Boot] [PATCH v2 1/2] Tegra: fdt: Add/enhance sdhci (mmc) nodes for all T20 DT files Tom Warren
2013-02-11 17:28   ` Lucas Stach
2013-02-11 17:56     ` Tom Warren
2013-02-11 18:55       ` Lucas Stach
2013-02-11 19:11       ` Thierry Reding
2013-02-11 19:21         ` Tom Warren
2013-02-12  6:51           ` Thierry Reding
2013-02-12 10:41             ` Thierry Reding
2013-02-12 10:53               ` Thierry Reding
2013-02-12 17:36                 ` Tom Warren
2013-02-12 20:19               ` Stephen Warren
2013-02-12 20:47                 ` Thierry Reding
2013-02-12 20:17           ` Stephen Warren
2013-02-12 20:29   ` Stephen Warren
2013-02-12 20:52     ` Tom Warren
2013-02-11 17:17 ` [U-Boot] [PATCH v2 2/2] Tegra: MMC: Add DT support to MMC driver for all T20 boards Tom Warren
2013-02-11 17:33   ` Lucas Stach
2013-02-11 17:59     ` Tom Warren
2013-02-12 19:24       ` Tom Warren
2013-02-12 19:41         ` Lucas Stach [this message]
2013-02-12 19:50           ` Tom Warren
2013-02-12 20:38   ` Stephen Warren
2013-02-12 20:57     ` Tom Warren
2013-02-12 21:06       ` Stephen Warren
2013-02-13 19:59         ` Tom Warren
2013-02-13 20:02           ` Stephen Warren
2013-02-13 20:06             ` Tom Warren
2013-02-13 20:09               ` Stephen Warren

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=1360698064.1537.22.camel@tellur \
    --to=dev@lynxeye.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