All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/14] serial: 16550: Add port type as driver data
Date: Wed, 30 Nov 2016 02:27:47 +0100	[thread overview]
Message-ID: <a949a675-7189-cd9a-8bef-a6b062feb519@denx.de> (raw)
In-Reply-To: <CAPnjgZ3d4d0r8n4dW-F6_=u8U41e7c-9wocXuRDd7o9vNE5HRg@mail.gmail.com>

On 11/30/2016 01:32 AM, Simon Glass wrote:
> Hi Marek,
> 
> On 27 November 2016 at 10:07, Marek Vasut <marex@denx.de> wrote:
>> On 11/27/2016 06:03 PM, Simon Glass wrote:
>>> Hi Marex,
>>>
>>> On 25 November 2016 at 15:32, Marek Vasut <marex@denx.de> wrote:
>>>> Add driver data to each compatible string to identify the type of
>>>> the port. Since all the ports in the driver are entirely compatible
>>>> with 16550 for now, all are marked with PORT_NS16550. But, there
>>>> are ports which have specific quirks, like the JZ4780 UART, which
>>>> do not have any DT property to denote the quirks. Instead, Linux
>>>> uses the compatible string to discern such ports and enable the
>>>> necessary quirks.
>>>>
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>> Cc: Tom Rini <trini@konsulko.com>
>>>> Cc: Simon Glass <sjg@chromium.org>
>>>> ---
>>>>  drivers/serial/ns16550.c | 26 ++++++++++++++++----------
>>>>  1 file changed, 16 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
>>>> index 3c9f3b0..3130a1d 100644
>>>> --- a/drivers/serial/ns16550.c
>>>> +++ b/drivers/serial/ns16550.c
>>>> @@ -360,6 +360,12 @@ int ns16550_serial_probe(struct udevice *dev)
>>>>         return 0;
>>>>  }
>>>>
>>>> +#if CONFIG_IS_ENABLED(OF_CONTROL)
>>>> +enum {
>>>> +       PORT_NS16550 = 0,
>>>> +};
>>>> +#endif
>>>> +
>>>>  #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
>>>>  int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
>>>>  {
>>>> @@ -453,16 +459,16 @@ const struct dm_serial_ops ns16550_serial_ops = {
>>>>   * compatible string to your dts.
>>>>   */
>>>>  static const struct udevice_id ns16550_serial_ids[] = {
>>>> -       { .compatible = "ns16550" },
>>>> -       { .compatible = "ns16550a" },
>>>> -       { .compatible = "nvidia,tegra20-uart" },
>>>> -       { .compatible = "snps,dw-apb-uart" },
>>>> -       { .compatible = "ti,omap2-uart" },
>>>> -       { .compatible = "ti,omap3-uart" },
>>>> -       { .compatible = "ti,omap4-uart" },
>>>> -       { .compatible = "ti,am3352-uart" },
>>>> -       { .compatible = "ti,am4372-uart" },
>>>> -       { .compatible = "ti,dra742-uart" },
>>>> +       { .compatible = "ns16550",              .data = PORT_NS16550 },
>>>> +       { .compatible = "ns16550a",             .data = PORT_NS16550 },
>>>> +       { .compatible = "nvidia,tegra20-uart",  .data = PORT_NS16550 },
>>>> +       { .compatible = "snps,dw-apb-uart",     .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,omap2-uart",        .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,omap3-uart",        .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,omap4-uart",        .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,am3352-uart",       .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,am4372-uart",       .data = PORT_NS16550 },
>>>> +       { .compatible = "ti,dra742-uart",       .data = PORT_NS16550 },
>>>
>>> But can we have 0 as the default so we don't need these values?
>>
>> PORT_NS16550 is zero anyway, it's just explicitly spelled here.
> 
> One way might be to use PORT_DEFAULT, set it to 0 and omit it here. It
> does seem odd to have PORT_NS16550 in the ns16550 driver.

I'd rather be explicit in case we grow this list, it also doesn't hurt
anything since it is implicitly set to zero. Or is this something more
than a matter of preference here ?

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-11-30  1:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 22:32 [U-Boot] [PATCH 01/14] mips: Let cache.h be included from assembly source Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 02/14] spl: mmc: Fix build without LIBCOMMON_SUPPORT Marek Vasut
2016-11-26 20:45   ` Tom Rini
2016-11-26 20:58     ` Marek Vasut
2016-11-28  2:33       ` Jaehoon Chung
2016-11-28  2:53         ` Marek Vasut
2016-12-01 10:10           ` Jaehoon Chung
2016-12-01 11:39             ` Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 03/14] mmc: Fix warning if debug() is not used Marek Vasut
2016-11-26 20:44   ` Tom Rini
2016-11-25 22:32 ` [U-Boot] [PATCH 04/14] serial: 16550: Add getfcr accessor Marek Vasut
2016-11-26 20:46   ` Tom Rini
2016-11-27 17:02   ` Simon Glass
2016-11-25 22:32 ` [U-Boot] [PATCH 05/14] serial: 16550: Add port type as driver data Marek Vasut
2016-11-27 17:03   ` Simon Glass
2016-11-27 17:07     ` Marek Vasut
2016-11-30  0:32       ` Simon Glass
2016-11-30  1:27         ` Marek Vasut [this message]
2016-11-30  2:26           ` Simon Glass
2016-11-30  3:04             ` Marek Vasut
2016-11-30  3:10               ` Simon Glass
2016-11-30  3:16                 ` Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 06/14] serial: 16550: Add Ingenic JZ4780 support Marek Vasut
2016-11-27 17:03   ` Simon Glass
2016-11-27 17:17     ` Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 07/14] mmc: Tinification of the mmc code Marek Vasut
2016-11-30  0:32   ` Simon Glass
2016-11-30  1:28     ` Marek Vasut
2016-11-30  2:26       ` Simon Glass
2016-11-30  2:44         ` Tom Rini
2016-11-25 22:32 ` [U-Boot] [PATCH 08/14] mmc: Add JZ47xx SD/MMC controller driver Marek Vasut
2016-11-28  2:58   ` Jaehoon Chung
2016-11-28 22:55     ` Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 09/14] gpio: Add JZ47xx GPIO driver Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 10/14] misc: Add JZ47xx efuse driver Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 11/14] mips: Add SPL header Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 12/14] mips: jz47xx: Add JZ4780 SoC support Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 13/14] mips: jz47xx: Add minimal JZ MMC node Marek Vasut
2016-11-25 22:32 ` [U-Boot] [PATCH 14/14] mips: jz47xx: Add Creator CI20 platform Marek Vasut
2016-11-26 20:45   ` Tom Rini
2016-11-30 15:21 ` [U-Boot] [PATCH 01/14] mips: Let cache.h be included from assembly source Daniel Schwierzeck

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=a949a675-7189-cd9a-8bef-a6b062feb519@denx.de \
    --to=marex@denx.de \
    --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.