linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawnguo@kernel.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] serial: amba-pl011: complete support to ZTE uart
Date: Fri, 8 Jul 2016 10:11:18 +0800	[thread overview]
Message-ID: <20160708021118.GB20896@tiger> (raw)
In-Reply-To: <20160707152802.GR1041@n2100.armlinux.org.uk>

On Thu, Jul 07, 2016 at 04:28:02PM +0100, Russell King - ARM Linux wrote:
> So, if I were to do this, there wouldn't be any objection?
> 
> An alternative would be to use the real hardware ID if it exists, add
> a compatible to DT, and use of_device_is_compatible() in the driver
> to discover if it's a zte device.

Comparing to this, I think the "official" pseudo-ID approach is cleaner.
I will send a patch to incorporate the suggested changes below.

Thanks, Russell.

Shawn

> 
> 8<====
> Subject: [PATCH] amba: make ZTE pseudo-ID more "official"
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/tty/serial/amba-pl011.c | 4 ++--
>  include/linux/amba/bus.h        | 5 +++++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 77b05f5bf866..2dbe5776ac56 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -2659,8 +2659,8 @@ static struct amba_id pl011_ids[] = {
>  		.data	= &vendor_st,
>  	},
>  	{
> -		.id	= 0xfefefe,
> -		.mask	= 0xffffff,
> +		.id	= AMBA_LINUX_ID(0x00, 0xf, 0xefe),
> +		.mask	= 0x00ffffff,
>  		.data	= &vendor_zte,
>  	},
>  	{ 0, 0 },
> diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
> index 3d8dcdd1aeae..dc29d504b4fc 100644
> --- a/include/linux/amba/bus.h
> +++ b/include/linux/amba/bus.h
> @@ -53,8 +53,13 @@ enum amba_vendor {
>  	AMBA_VENDOR_ST = 0x80,
>  	AMBA_VENDOR_QCOM = 0x51,
>  	AMBA_VENDOR_LSI = 0xb6,
> +	AMBA_VENDOR_LINUX = 0xef,	/* This value is not official */
>  };
>  
> +#define AMBA_LINUX_ID(conf, rev, part) \
> +	(((conf) & 0xff) << 24 | ((rev) & 0xf) << 20 | \
> +	 AMBA_VENDOR_LINUX << 12 | ((part) & 0xfff))
> +
>  extern struct bus_type amba_bustype;
>  
>  #define to_amba_device(d)	container_of(d, struct amba_device, dev)
> -- 
> 2.1.0
> 
> -- 
> RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
> according to speedtest.net.
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2016-07-08  2:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23  7:12 [PATCH v2] serial: amba-pl011: complete support to ZTE uart Jun Nie
2016-04-01  9:53 ` Jun Nie
2016-04-12 13:01   ` Jun Nie
2016-04-25  6:53     ` Jun Nie
2016-04-28 20:11       ` Greg KH
2016-05-16  2:31         ` Jun Nie
2016-07-07  9:54           ` Shawn Guo
2016-07-07 15:01             ` Shawn Guo
2016-07-07 15:28               ` Russell King - ARM Linux
2016-07-08  2:11                 ` Shawn Guo [this message]

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=20160708021118.GB20896@tiger \
    --to=shawnguo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).