Re: [PATCH] ARM: nitrogen6: add lowlevel UART initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux