mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: rcz@pengutronix.de, barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: nitrogen6: add lowlevel UART initialization
Date: Thu, 2 Jan 2020 11:41:31 +0100	[thread overview]
Message-ID: <70a44a2d-cf60-34e7-8ca8-1d7753f77e72@pengutronix.de> (raw)
In-Reply-To: <20200102102334.73726-1-r.czerwinski@pengutronix.de>

Hello Rouven,

On 1/2/20 11:23 AM, Rouven Czerwinski wrote:
> +static inline void setup_uart(void)
> +{
> +   void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
> +
> +   //UART 1
> +   writel(0x1, iomuxbase + 0x02a8);
> +   writel(0x1, iomuxbase + 0x02ac);
> +
> +   //UART 2
> +   writel(0x4, iomuxbase + 0x00bc);
> +   writel(0x4, iomuxbase + 0x00c0);
> +   writel(0x0, iomuxbase + 0x0928);

There's imx_setup_pad that you can use along with symbolic names for
better readability.

> +   imx6_ungate_all_peripherals();
> +   imx6_uart_setup((void *)MX6_UART2_BASE_ADDR);

There's imx6_uart_setup_ll that passes in the address of CONFIG_DEBUG_IMX_UART_PORT.
Use that one instead.

> +   pbl_set_putc(imx_uart_putc, (void *)MX6_UART2_BASE_ADDR);

DEBUG_LL is a global setting. pbl_set_putc can be used to have PBL console
output for a board, even if DEBUG_LL is off or configured for another board.
Thus having pbl_set_putc guarded by a IS_ENABLED(CONFIG_DEBUG_LL) doesn't make
sense. pbl_set_putc can also only be called after relocation, which hasn't
happened yet.

Cheers
Ahmad


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2020-01-02 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 10:23 Rouven Czerwinski
2020-01-02 10:41 ` Ahmad Fatoum [this message]
2020-01-06  9:46 ` Lucas Stach
2020-01-06 10:09   ` Rouven Czerwinski

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=70a44a2d-cf60-34e7-8ca8-1d7753f77e72@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rcz@pengutronix.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