All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: Simon Glass <sjg@chromium.org>
Cc: kettenis@openbsd.org, u-boot@lists.denx.de,
Subject: Re: [PATCH v2 4/7] serial: s5p: Add Apple M1 support
Date: Thu, 14 Oct 2021 21:57:01 +0200 (CEST)	[thread overview]
Message-ID: <d3ca5ef1a5532a65@bloch.sibelius.xs4all.nl> (raw)
In-Reply-To: <CAPnjgZ1O+2dUMs=2uvqO8Pkz01dZV2Z4QZKGc9H+jmb7otNAkA@mail.gmail.com> (message from Simon Glass on Mon, 11 Oct 2021 11:00:39 -0600)

> From: Simon Glass <sjg@chromium.org>
> Date: Mon, 11 Oct 2021 11:00:39 -0600
> 
> Hi Mark,
> 
> On Sun, 3 Oct 2021 at 12:33, Mark Kettenis <kettenis@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@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@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

The problem really is that I'm trying to avoid having to define
get_uart_clock() for the new platform.  So I need an #if of some sorts
to avoid that code.  I really think the current diff is the cleanest I
can come up.
 
> >         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
> 

  reply	other threads:[~2021-10-14 19:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 18:30 [PATCH v2 0/7] Apple M1 Support Mark Kettenis
2021-10-03 18:30 ` [PATCH v2 1/7] iommu: Add IOMMU uclass Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-14 19:34     ` Mark Kettenis
2021-10-14 20:20       ` Simon Glass
2021-10-14 20:51         ` Mark Kettenis
2021-10-14 20:55           ` Simon Glass
2021-10-14 21:11             ` Mark Kettenis
2021-10-15  0:40               ` Simon Glass
2021-10-03 18:30 ` [PATCH v2 2/7] test: Add tests for " Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-14 19:50     ` Mark Kettenis
2021-10-14 20:43       ` Simon Glass
2021-10-03 18:30 ` [PATCH v2 3/7] arm: apple: Add initial support for Apple's M1 SoC Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-03 18:30 ` [PATCH v2 4/7] serial: s5p: Add Apple M1 support Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-14 19:57     ` Mark Kettenis [this message]
2021-10-03 18:30 ` [PATCH v2 5/7] iommu: Add Apple DART driver Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-03 18:30 ` [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-11 18:36   ` Rob Herring
2021-10-11 18:55     ` Simon Glass
2021-10-11 19:00     ` Mark Kettenis
2021-10-11 19:48       ` Rob Herring
2021-10-11 20:00         ` Simon Glass
2021-10-11 20:30           ` Tom Rini
2021-10-14 20:33         ` Mark Kettenis
2021-10-03 18:30 ` [PATCH v2 7/7] doc: board: apple: Add Apple M1 documentation Mark Kettenis
2021-10-11 17:00   ` Simon Glass
2021-10-11 17:00 ` [PATCH v2 0/7] Apple M1 Support 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=d3ca5ef1a5532a65@bloch.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=kettenis@openbsd.org \
    --cc=sjg@chromium.org \
    --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.