All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] rockchip: evb-rk3328: set uart2 and sdmmc io routing
Date: Sat, 27 May 2017 00:28:59 +0200	[thread overview]
Message-ID: <11873406.QdhtY6AnPM@phil> (raw)
In-Reply-To: <0e3c4ef3-f957-8c88-07be-f090d533530b@rock-chips.com>

Hi Kever,

Am Mittwoch, 24. Mai 2017, 10:35:04 CEST schrieb Kever Yang:
> On 05/20/2017 10:29 AM, Simon Glass wrote:
> > On 16 May 2017 at 21:44, Kever Yang <kever.yang@rock-chips.com> wrote:
> >> In rk3328, some function pin may have more than one choice, and muxed
> >> with more than one IO, for example, the UART2 controller IO,
> >> TX and RX, have 3 choice(setting in com_iomux):
> >> - M0 which mux with GPIO1A0/GPIO1A1
> >> - M1 which mux with GPIO2A0/GPIO2A1
> >> - usb2phy which mux with USB2.0 DP/DM pin.
> >>
> >> We should set these IO routing in board file.
> >>
> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> >> ---
> >>
> >>   board/rockchip/evb_rk3328/evb-rk3328.c | 12 ++++++++++++
> >>   1 file changed, 12 insertions(+)
> >>
> >> diff --git a/board/rockchip/evb_rk3328/evb-rk3328.c b/board/rockchip/evb_rk3328/evb-rk3328.c
> >> index a7895cb..d9dc782 100644
> >> --- a/board/rockchip/evb_rk3328/evb-rk3328.c
> >> +++ b/board/rockchip/evb_rk3328/evb-rk3328.c
> >> @@ -5,7 +5,10 @@
> >>    */
> >>
> >>   #include <common.h>
> >> +#include <asm/arch/hardware.h>
> >> +#include <asm/arch/grf_rk3328.h>
> >>   #include <asm/armv8/mmu.h>
> >> +#include <asm/io.h>
> >>   #include <dwc3-uboot.h>
> >>   #include <usb.h>
> >>
> >> @@ -13,6 +16,15 @@ DECLARE_GLOBAL_DATA_PTR;
> >>
> >>   int board_init(void)
> >>   {
> >> +#define GRF_BASE       0xff100000
> >> +       struct rk3328_grf_regs * const grf = (void *)GRF_BASE;
> >> +
> >> +       /* uart2 select m1, sdcard select m1*/
> >> +       rk_clrsetreg(&grf->com_iomux,
> >> +                    IOMUX_SEL_UART2_MASK | IOMUX_SEL_SDMMC_MASK,
> >> +                    IOMUX_SEL_UART2_M1 << IOMUX_SEL_UART2_SHIFT |
> >> +                    IOMUX_SEL_SDMMC_M1 << IOMUX_SEL_SDMMC_SHIFT);
> >> +
> >>          return 0;
> >>   }
> > This needs to be done via a call to some sort of driver. The above
> > hack is OK in SPL but not in U-Boot proper.
> 
> Yes, SPL also needs this. I thinks here should be the right place
> before there is a SPL for rk3328.
> >
> > See my comments elsewhere about using a misc driver with an IOCTL
> > interface to do this sort of thing. Although here I wonder why you
> > cannot use pinctrl?
> 
> This is different from traditional pinctrl, kernel also still not have
> final solution on this, see [0], and some people think it should be
> done in boot loader.

Just to point out that thanks to David Wu we now have a solution [1]
on the kernel side I'm pretty happy with - as part of the pinctrl driver.


Heiko


> [0] 
> http://lists.infradead.org/pipermail/linux-rockchip/2016-August/011209.html

[1] https://www.spinics.net/lists/kernel/msg2517794.html

  reply	other threads:[~2017-05-26 22:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17  3:44 [U-Boot] [PATCH 0/6] rk3328 pinctrl drvier and sdmmc power fix Kever Yang
2017-05-17  3:44 ` [U-Boot] [PATCH 1/6] rockchip: pinctrl: move rk3328 grf reg definition in header file Kever Yang
2017-05-20  2:29   ` Simon Glass
2017-05-17  3:44 ` [U-Boot] [PATCH 2/6] rockchip: pinctrl: rk3328: do not set io routing Kever Yang
2017-05-20  2:29   ` Simon Glass
2017-05-17  3:44 ` [U-Boot] [PATCH 3/6] rockchip: evb-rk3328: set uart2 and sdmmc " Kever Yang
2017-05-20  2:29   ` Simon Glass
2017-05-24  2:35     ` Kever Yang
2017-05-26 22:28       ` Heiko Stuebner [this message]
2017-06-01  3:10       ` Simon Glass
2017-06-07  3:28         ` Kever Yang
2017-06-09 12:27           ` Simon Glass
2017-05-17  3:44 ` [U-Boot] [PATCH 4/6] rockchip: pinctrl: rk3328: use gpio instead of sdmmc-pwren Kever Yang
2017-05-20  2:29   ` Simon Glass
2017-06-05 21:33     ` Simon Glass
2017-05-17  3:44 ` [U-Boot] [PATCH 5/6] rockchip: evb-rk3328: enable boot on regulator Kever Yang
2017-05-20  2:29   ` Simon Glass
2017-05-17  3:44 ` [U-Boot] [PATCH 6/6] rockchip: dts: rk3328-evb: add sdmmc-pwren regulator Kever Yang
2017-05-20  2:29   ` Simon Glass

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=11873406.QdhtY6AnPM@phil \
    --to=heiko@sntech.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.