mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Alexander Kurz <akurz@blala.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/4] ARM: i.MX6 Wandboard Quad: fix PBL UART MUX
Date: Thu, 8 Jun 2017 11:55:07 -0700	[thread overview]
Message-ID: <CAHQ1cqFq_W5gpe-i9mCgKoqmR0wgfkE1WWLZCjVaONy031Drhw@mail.gmail.com> (raw)
In-Reply-To: <1496947297-23502-2-git-send-email-akurz@blala.de>

On Thu, Jun 8, 2017 at 11:41 AM, Alexander Kurz <akurz@blala.de> wrote:
> Three variants of the Wandboard exist: WBSOLO, WBDUAL and WBQUAD.
> For all variants, the external serial port is connected to UART1 via
> PAD_CSI0_DATA10 (TX) and PAD_CSI0_DATA11 (RX). Unfortunately, the IOMUX
> register adresses for this mux differ between i.MX6Q (WBQUAD) and others.
> Make the UART IOMUX for PBL compatible for WBQUAD.
>
> Signed-off-by: Alexander Kurz <akurz@blala.de>
> ---
>  arch/arm/boards/technexion-wandboard/lowlevel.c | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/boards/technexion-wandboard/lowlevel.c b/arch/arm/boards/technexion-wandboard/lowlevel.c
> index ff5ae6d..9aae429 100644
> --- a/arch/arm/boards/technexion-wandboard/lowlevel.c
> +++ b/arch/arm/boards/technexion-wandboard/lowlevel.c
> @@ -285,11 +285,25 @@ static unsigned long wandboard_dram_init(void)
>
>  static void setup_uart(void)
>  {
> +       int cpu_type = __imx6_cpu_type();
>         void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
>
> -       /* mux the uart */
> -       writel(0x00000003, iomuxbase + 0x4c);
> -       writel(0x00000000, iomuxbase + 0x8fc);
> +       /* mux UART1 TX on PAD_CSI0_DATA10 */
> +       switch (cpu_type) {
> +       case IMX6_CPUTYPE_IMX6S:
> +       case IMX6_CPUTYPE_IMX6DL:
> +               writel(0x00000003, iomuxbase + 0x4c);
> +               writel(0x0001b0b1, iomuxbase + 0x360);
> +               writel(0x00000000, iomuxbase + 0x8fc);
> +               break;
> +       case IMX6_CPUTYPE_IMX6Q:
> +               writel(0x00000003, iomuxbase + 0x280);
> +               writel(0x0001b0b1, iomuxbase + 0x650);
> +               writel(0x00000001, iomuxbase + 0x920);

Just as a suggestion, you can use imx_setup_pad from
arch/arm/mach-imx/include/mach/iomux-v3.h
which would allow you to use pre-defined "pad" constants as opposed to
the magic numbers.

See arch/arm/boards/freescale-mx6-sabresd/lowlevel.c for example.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-06-08 18:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 18:41 [PATCH 1/4] ARM: i.MX6 Wandboard: dont do MMDC Write Leveling Calibration Alexander Kurz
2017-06-08 18:41 ` [PATCH 2/4] ARM: i.MX6 Wandboard Quad: fix PBL UART MUX Alexander Kurz
2017-06-08 18:55   ` Andrey Smirnov [this message]
2017-06-08 18:41 ` [PATCH 3/4] ARM: i.MX6 Wandboard: enable Wandboard Quad Alexander Kurz
2017-06-08 18:41 ` [PATCH 4/4] ARM: i.MX6 Wandboard: add Documentation Alexander Kurz
2017-06-13  7:27 ` [PATCH 1/4] ARM: i.MX6 Wandboard: dont do MMDC Write Leveling Calibration Sascha Hauer

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=CAHQ1cqFq_W5gpe-i9mCgKoqmR0wgfkE1WWLZCjVaONy031Drhw@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=akurz@blala.de \
    --cc=barebox@lists.infradead.org \
    /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