All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH 15/20] serial_lpuart: add support for i.MXRT
Date: Mon, 9 Dec 2019 13:56:43 +0100	[thread overview]
Message-ID: <c3e505ec-9bb4-61a5-3659-01e2e84030b9@benettiengineering.com> (raw)
In-Reply-To: <20191208155824.5d9f25c9@jawa>

Hi Lukasz,

On 12/8/19 3:58 PM, Lukasz Majewski wrote:
> On Wed,  4 Dec 2019 18:44:34 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> Add i.MXRT compatible string and cpu type support to lpuart driver,
>> to use little endian 32 bits configurations.
>>
>> Also according to RM, the Receive RX FIFO Enable (RXFE) field in
>> LPUART FIFO register is bit 3, so this definition should change to
>> 0x08 as done for i.MX8. It needs also to set baudrate the same way as
>> i.MX8 does.
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>>   drivers/serial/serial_lpuart.c | 15 +++++++++++----
>>   include/fsl_lpuart.h           |  3 ++-
>>   2 files changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/serial/serial_lpuart.c
>> b/drivers/serial/serial_lpuart.c index 52bd2baf7d..2ac4c6d56a 100644
>> --- a/drivers/serial/serial_lpuart.c
>> +++ b/drivers/serial/serial_lpuart.c
>> @@ -49,7 +49,7 @@
>>   #define FIFO_RXSIZE_MASK	0x7
>>   #define FIFO_RXSIZE_OFF	0
>>   #define FIFO_TXFE		0x80
>> -#ifdef CONFIG_ARCH_IMX8
>> +#if defined(CONFIG_ARCH_IMX8) || defined(CONFIG_ARCH_IMXRT)
>>   #define FIFO_RXFE		0x08
>>   #else
>>   #define FIFO_RXFE		0x40
>> @@ -67,7 +67,8 @@ enum lpuart_devtype {
>>   	DEV_VF610 = 1,
>>   	DEV_LS1021A,
>>   	DEV_MX7ULP,
>> -	DEV_IMX8
>> +	DEV_IMX8,
>> +	DEV_IMXRT,
>>   };
>>   
>>   struct lpuart_serial_platdata {
>> @@ -409,7 +410,8 @@ static int _lpuart32_serial_init(struct udevice
>> *dev)
>>   	lpuart_write32(plat->flags, &base->match, 0);
>>   
>> -	if (plat->devtype == DEV_MX7ULP || plat->devtype ==
>> DEV_IMX8) {
>> +	if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8
>> ||
>> +	    plat->devtype == DEV_IMXRT) {
>>   		_lpuart32_serial_setbrg_7ulp(dev, gd->baudrate);
>>   	} else {
>>   		/* provide data bits, parity, stop bit, etc */
>> @@ -426,7 +428,8 @@ static int lpuart_serial_setbrg(struct udevice
>> *dev, int baudrate) struct lpuart_serial_platdata *plat =
>> dev_get_platdata(dev);
>>   	if (is_lpuart32(dev)) {
>> -		if (plat->devtype == DEV_MX7ULP || plat->devtype ==
>> DEV_IMX8)
>> +		if (plat->devtype == DEV_MX7ULP || plat->devtype ==
>> DEV_IMX8 ||
>> +		    plat->devtype == DEV_IMXRT)
>>   			_lpuart32_serial_setbrg_7ulp(dev, baudrate);
>>   		else
>>   			_lpuart32_serial_setbrg(dev, baudrate);
>> @@ -527,6 +530,8 @@ static int
>> lpuart_serial_ofdata_to_platdata(struct udevice *dev) plat->devtype =
>> DEV_VF610; else if (!fdt_node_check_compatible(blob, node,
>> "fsl,imx8qm-lpuart")) plat->devtype = DEV_IMX8;
>> +	else if (!fdt_node_check_compatible(blob, node,
>> "fsl,imxrt-lpuart"))
>> +		plat->devtype = DEV_IMXRT;
>>   
>>   	return 0;
>>   }
>> @@ -546,6 +551,8 @@ static const struct udevice_id
>> lpuart_serial_ids[] = { { .compatible = "fsl,vf610-lpuart"},
>>   	{ .compatible = "fsl,imx8qm-lpuart",
>>   		.data = LPUART_FLAG_REGMAP_32BIT_REG },
>> +	{ .compatible = "fsl,imxrt-lpuart",
>> +		.data = LPUART_FLAG_REGMAP_32BIT_REG },
>>   	{ }
>>   };
>>   
>> diff --git a/include/fsl_lpuart.h b/include/fsl_lpuart.h
>> index fc517d4b7f..511fb84367 100644
>> --- a/include/fsl_lpuart.h
>> +++ b/include/fsl_lpuart.h
>> @@ -4,7 +4,8 @@
>>    *
>>    */
>>   
>> -#if defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8)
>> +#if defined(CONFIG_ARCH_MX7ULP) || defined(CONFIG_ARCH_IMX8) || \
>> +	defined(CONFIG_ARCH_IMXRT)
>>   struct lpuart_fsl_reg32 {
>>   	u32 verid;
>>   	u32 param;
> 
> Please also used buildman to check if this patch series is bisectable
> (i.e. if it can be build without errors for each separate commit).
> 
> For example:
> ./tools/buildman/buildman.py --branch=HEAD  odroid edison trats trats2
> --show_errors --force-build --count=4 --output-dir=../BUILD/
> 

And indeed patch[19/20] is not bisectable and need rework.
Thanks for pointing me buildman, very cool script!

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
> 

  reply	other threads:[~2019-12-09 12:56 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 17:44 [PATCH 00/20] Add i.MXRT family support Giulio Benetti
2019-12-04 17:44 ` [PATCH 01/20] armv7m: cache: add mmu_set_region_dcache_behaviour() stub for compatibility Giulio Benetti
2019-12-04 17:44 ` [PATCH 02/20] spl: fix entry_point equal to load_addr Giulio Benetti
2019-12-08 14:37   ` Lukasz Majewski
2019-12-09 10:47     ` Giulio Benetti
2019-12-04 17:44 ` [PATCH 03/20] clk: imx: pllv3: register PLLV3 GENERIC and USB as 2 different clocks Giulio Benetti
2019-12-08 14:33   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 04/20] clk: imx: pllv3: set div_mask differently if PLLV3 is GENERIC or USB Giulio Benetti
2019-12-08 14:32   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 05/20] clk: imx: pllv3: add enable() support Giulio Benetti
2019-12-04 17:44 ` [PATCH 06/20] clk: imx: pllv3: add disable() support Giulio Benetti
2019-12-08 14:27   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 07/20] clk: imx: pllv3: add set_rate() support Giulio Benetti
2019-12-08 14:27   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 08/20] clk: imx: pllv3: add PLLV3_SYS support Giulio Benetti
2019-12-08 14:28   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 09/20] clk: imx: pllv3: add support for PLLV3_AV type Giulio Benetti
2019-12-08 15:05   ` Lukasz Majewski
2019-12-09 17:13     ` Giulio Benetti
2019-12-10  0:07       ` Lukasz Majewski
2019-12-11 12:47         ` Giulio Benetti
2019-12-12 10:05           ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 10/20] clk: imx: pfd: add set_rate() Giulio Benetti
2019-12-08 14:38   ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 11/20] clk: imx: add i.IMXRT1050 clk driver Giulio Benetti
2019-12-08 14:40   ` Lukasz Majewski
2019-12-09 10:49     ` Giulio Benetti
2019-12-09 10:53       ` Giulio Benetti
2019-12-09 23:36         ` Lukasz Majewski
2019-12-11 12:30           ` Giulio Benetti
2019-12-04 17:44 ` [PATCH 12/20] pinctrl: add i.MXRT driver Giulio Benetti
2019-12-08 14:45   ` Lukasz Majewski
2019-12-09 11:54     ` Giulio Benetti
2019-12-09 23:46       ` Lukasz Majewski
2019-12-11 12:40         ` Giulio Benetti
2019-12-11 23:46           ` Lukasz Majewski
2019-12-04 17:44 ` [PATCH 13/20] ARM: dts: imxrt1050: add dtsi file Giulio Benetti
2019-12-04 23:01   ` Giulio Benetti
2019-12-08 14:46   ` Lukasz Majewski
2019-12-09 10:51     ` Giulio Benetti
2019-12-04 17:44 ` [PATCH 14/20] serial_lpuart: add clock enable if CONFIG_CLK is defined Giulio Benetti
2019-12-08 14:52   ` Lukasz Majewski
2019-12-09 15:20     ` Giulio Benetti
2019-12-09 23:48       ` Lukasz Majewski
2019-12-17 18:37         ` Giulio Benetti
2019-12-30  1:21           ` Simon Glass
2019-12-04 17:44 ` [PATCH 15/20] serial_lpuart: add support for i.MXRT Giulio Benetti
2019-12-08 14:58   ` Lukasz Majewski
2019-12-09 12:56     ` Giulio Benetti [this message]
2020-01-03 11:39 ` [PATCH 00/20] Add i.MXRT family support Stefano Babic
2020-01-03 14:14   ` Giulio Benetti
2020-01-07 17:23   ` Giulio Benetti
2020-01-08 17:39     ` Simon Glass
2020-01-08 17:53       ` Giulio Benetti
2020-01-09 20:04         ` Simon Glass
2020-01-10 14:05           ` Giulio Benetti

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=c3e505ec-9bb4-61a5-3659-01e2e84030b9@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --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.