[PATCH v2 4/7] serial: s5p: Add Apple M1 support

Simon Glass sjg at chromium.org
Mon Oct 11 19:00:39 CEST 2021


Hi Mark,

On Sun, 3 Oct 2021 at 12:33, Mark Kettenis <kettenis at openbsd.org> wrote:
>
> Apple M1 SoCs include an S5L UART which is a variant of the S5P
> UART.  Add support for this variant and enable it by default
> on Apple SoCs.
>
> Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> ---
>  arch/arm/Kconfig                    |   1 +
>  arch/arm/include/asm/arch-m1/uart.h |  41 +++++++++++
>  configs/apple_m1_defconfig          |   4 ++
>  drivers/serial/Kconfig              |   4 +-
>  drivers/serial/serial_s5p.c         | 104 ++++++++++++++++++++++------
>  5 files changed, 130 insertions(+), 24 deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-m1/uart.h
>

Reviewed-by: Simon Glass <sjg at chromium.org>
[..]

> diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
> index 6d09952a5d..53a7b0bd1b 100644
> --- a/drivers/serial/serial_s5p.c
> +++ b/drivers/serial/serial_s5p.c
[..]
> @@ -93,7 +116,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate)
>         struct s5p_uart *const uart = plat->reg;
>         u32 uclk;
>
> -#ifdef CONFIG_CLK_EXYNOS
> +#if CONFIG_IS_ENABLED(CLK_EXYNOS) || CONFIG_IS_ENABLED(ARCH_APPLE)

I really don't like making this any worse.

Does this work?

ret = clk_get_by_index(...)
if (ret && ret != -ENOSYS)
   return ret

>         struct clk clk;
>         u32 ret;
>
> @@ -105,7 +128,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate)
>         uclk = get_uart_clk(plat->port_id);
>  #endif
>
> -       s5p_serial_baud(uart, uclk, baudrate);
> +       s5p_serial_baud(uart, plat->reg_width, uclk, baudrate);
>
>         return 0;
>  }
[..]

Regards,
Simon


More information about the U-Boot mailing list