All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
@ 2012-03-22 20:19 Michael Brunner
  2012-03-22 20:39 ` Darren Hart
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Brunner @ 2012-03-22 20:19 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Greg Kroah-Hartman, Alan Cox, Darren Hart, linux-serial

Add UART clock quirk for the Kontron COMe-mTT10 module.
The board has previously been called nanoETXexpress-TT, therefore this
is also checked. 

This patch follows the patchset submitted by Darren Hart at
commit a46f5533ecfc7bbdd646d84fdab8656031a715c6.

Signed-off-by: Michael Brunner <mibru@gmx.de>
---
 drivers/tty/serial/pch_uart.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 332f2eb..0ab5295 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -210,6 +210,7 @@ enum {
 #define CMITC_UARTCLK   192000000 /* 192.0000 MHz */
 #define FRI2_64_UARTCLK  64000000 /*  64.0000 MHz */
 #define FRI2_48_UARTCLK  48000000 /*  48.0000 MHz */
+#define NTC1_UARTCLK     64000000 /*  64.0000 MHz */
 
 struct pch_uart_buffer {
 	unsigned char *buf;
@@ -379,6 +380,10 @@ static int pch_uart_get_uartclk(void)
 	cmp = dmi_get_system_info(DMI_BOARD_NAME);
 	if (cmp && strstr(cmp, "CM-iTC"))
 		return CMITC_UARTCLK;
+	/* Kontron COMe-mTT10 (nanoETXexpress-TT) */
+	if (cmp && (strstr(cmp, "COMe-mTT") ||
+		    strstr(cmp, "nanoETXexpress-TT")))
+		return NTC1_UARTCLK;
 
 	cmp = dmi_get_system_info(DMI_BIOS_VERSION);
 	if (cmp && strnstr(cmp, "FRI2", 4))

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-22 20:19 [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk Michael Brunner
@ 2012-03-22 20:39 ` Darren Hart
  2012-03-22 21:31   ` Michael Brunner
  0 siblings, 1 reply; 7+ messages in thread
From: Darren Hart @ 2012-03-22 20:39 UTC (permalink / raw)
  To: Michael Brunner
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial



On 03/22/2012 01:19 PM, Michael Brunner wrote:
> Add UART clock quirk for the Kontron COMe-mTT10 module.
> The board has previously been called nanoETXexpress-TT, therefore this
> is also checked. 
> 
> This patch follows the patchset submitted by Darren Hart at
> commit a46f5533ecfc7bbdd646d84fdab8656031a715c6.
> 
> Signed-off-by: Michael Brunner <mibru@gmx.de>
> ---
>  drivers/tty/serial/pch_uart.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
> index 332f2eb..0ab5295 100644
> --- a/drivers/tty/serial/pch_uart.c
> +++ b/drivers/tty/serial/pch_uart.c
> @@ -210,6 +210,7 @@ enum {
>  #define CMITC_UARTCLK   192000000 /* 192.0000 MHz */
>  #define FRI2_64_UARTCLK  64000000 /*  64.0000 MHz */
>  #define FRI2_48_UARTCLK  48000000 /*  48.0000 MHz */
> +#define NTC1_UARTCLK     64000000 /*  64.0000 MHz */
>  
>  struct pch_uart_buffer {
>  	unsigned char *buf;
> @@ -379,6 +380,10 @@ static int pch_uart_get_uartclk(void)
>  	cmp = dmi_get_system_info(DMI_BOARD_NAME);
>  	if (cmp && strstr(cmp, "CM-iTC"))
>  		return CMITC_UARTCLK;
> +	/* Kontron COMe-mTT10 (nanoETXexpress-TT) */
> +	if (cmp && (strstr(cmp, "COMe-mTT") ||
> +		    strstr(cmp, "nanoETXexpress-TT")))
> +		return NTC1_UARTCLK;

These boards should already be supported by the following BIOS check. As
the DMI_BOARD_NAME was changing, it was Kontron's recommendation to use
the FRI2 prefix in the DMI_BIOS_VERSION.


>  	cmp = dmi_get_system_info(DMI_BIOS_VERSION);
>  	if (cmp && strnstr(cmp, "FRI2", 4))

Is this not working for you? If not, what is the DMI_BIOS_VERSION
reported by your board?

And for clarification, we are talking about this right:
http://us.kontron.com/products/systems+and+platforms/m2m/m2m+smart+services+developer+kit.html

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-22 20:39 ` Darren Hart
@ 2012-03-22 21:31   ` Michael Brunner
  2012-03-22 21:49     ` Darren Hart
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Brunner @ 2012-03-22 21:31 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial

> These boards should already be supported by the following BIOS check.
> As the DMI_BOARD_NAME was changing, it was Kontron's recommendation
> to use the FRI2 prefix in the DMI_BIOS_VERSION.
> 
> 
> >  	cmp = dmi_get_system_info(DMI_BIOS_VERSION);
> >  	if (cmp && strnstr(cmp, "FRI2", 4))
> 
> Is this not working for you? If not, what is the DMI_BIOS_VERSION
> reported by your board?
>
> And for clarification, we are talking about this right:
> http://us.kontron.com/products/systems+and+platforms/m2m/m2m+smart+services+developer+kit.html

My changes refer to the embedded module with the project code NTC1:
<http://us.kontron.com/products/computeronmodules/com+express/com+express+mini/comemtt10.html>

So unfortunately the FRI2 checks won't work for this.

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-22 21:31   ` Michael Brunner
@ 2012-03-22 21:49     ` Darren Hart
  2012-03-22 23:34       ` Michael Brunner
  2012-03-23 10:06       ` [PATCHv2] " Michael Brunner
  0 siblings, 2 replies; 7+ messages in thread
From: Darren Hart @ 2012-03-22 21:49 UTC (permalink / raw)
  To: Michael Brunner
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial



On 03/22/2012 02:31 PM, Michael Brunner wrote:
>> These boards should already be supported by the following BIOS check.
>> As the DMI_BOARD_NAME was changing, it was Kontron's recommendation
>> to use the FRI2 prefix in the DMI_BIOS_VERSION.
>>
>>
>>>  	cmp = dmi_get_system_info(DMI_BIOS_VERSION);
>>>  	if (cmp && strnstr(cmp, "FRI2", 4))
>>
>> Is this not working for you? If not, what is the DMI_BIOS_VERSION
>> reported by your board?
>>
>> And for clarification, we are talking about this right:
>> http://us.kontron.com/products/systems+and+platforms/m2m/m2m+smart+services+developer+kit.html
> 
> My changes refer to the embedded module with the project code NTC1:
> <http://us.kontron.com/products/computeronmodules/com+express/com+express+mini/comemtt10.html>
> 
> So unfortunately the FRI2 checks won't work for this.
> 
> Michael

OK, my board has DMI_BOARD_NAME as:

"nETXe-TT 1.0GHz E2 KDMS-FRI" but will also undergo a rename in the near
future. I'm concerned about colliding as I believe this kit may use the
same board you are working with. This COM Express module will be renamed
"COMe-mTT10" which will match your strstr compare.

So what does your DMI_BIOS_VERSION report?

I didn't like basing this on BIOS_VERSION, but I did so at Kontron's
preference. Now we're seeing the fallout (sooner than I expected).

So the question is, do we treat these as separate devices (the board and
the development kit which I believe includes your board) or do we lump
them together.

Since it is the firmware that ultimately decides what the initial
UARTCLK is, we can't base this on the hardware alone. The hardware in
fact should be default if a firmware match isn't found first. So, my
preference would be that you move your new comparison AFTER the FRI2
DMI_BIOS_VERSION comparison. This ensures the FRI2 doesn't match your
new comparison which might get a different UARTCLK in the future for
whatever reason.

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-22 21:49     ` Darren Hart
@ 2012-03-22 23:34       ` Michael Brunner
  2012-03-23 10:06       ` [PATCHv2] " Michael Brunner
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Brunner @ 2012-03-22 23:34 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial

> OK, my board has DMI_BOARD_NAME as:
> 
> "nETXe-TT 1.0GHz E2 KDMS-FRI" but will also undergo a rename in the
> near future. I'm concerned about colliding as I believe this kit may
> use the same board you are working with. This COM Express module will
> be renamed "COMe-mTT10" which will match your strstr compare.

You are right, the development kit uses a customized version of the
COMe-mTT10.

> So what does your DMI_BIOS_VERSION report?

The BIOS for the stock COMe-mTT10 is prefixed with NTC1.

> I didn't like basing this on BIOS_VERSION, but I did so at Kontron's
> preference. Now we're seeing the fallout (sooner than I expected).

Basically this is not a wrong decision, as the FRI2 project code is
unique for the firmware used on the development kit.

> So the question is, do we treat these as separate devices (the board
> and the development kit which I believe includes your board) or do we
> lump them together.

To be safe we should treat them as separate devices and make sure we
are able to differentiate between them.

> Since it is the firmware that ultimately decides what the initial
> UARTCLK is, we can't base this on the hardware alone. The hardware in
> fact should be default if a firmware match isn't found first. So, my
> preference would be that you move your new comparison AFTER the FRI2
> DMI_BIOS_VERSION comparison. This ensures the FRI2 doesn't match your
> new comparison which might get a different UARTCLK in the future for
> whatever reason.

I understand your concerns and agree with you that in this case the BIOS
version should be checked before the board name, same goes for the
product name. So I will prepare a new patch that puts my BOARD_NAME
comparison to the end.

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCHv2] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-22 21:49     ` Darren Hart
  2012-03-22 23:34       ` Michael Brunner
@ 2012-03-23 10:06       ` Michael Brunner
  2012-03-23 14:25         ` Darren Hart
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Brunner @ 2012-03-23 10:06 UTC (permalink / raw)
  To: Darren Hart
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial

Add UART clock quirk for the Kontron COMe-mTT10 module.

The board has previously been called nanoETXexpress-TT, therefore this
is also checked.

As suggested by Darren Hart the comparison in this patch version is
placed after the FRI2 checks to ensure it will also work with possible
upcoming changes to the FRI2 firmware.

This patch follows the patchset submitted by Darren Hart at
commit a46f5533ecfc7bbdd646d84fdab8656031a715c6.

Signed-off-by: Michael Brunner <mibru@gmx.de>
---
 drivers/tty/serial/pch_uart.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 332f2eb..dd69c95 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -210,6 +210,7 @@ enum {
 #define CMITC_UARTCLK   192000000 /* 192.0000 MHz */
 #define FRI2_64_UARTCLK  64000000 /*  64.0000 MHz */
 #define FRI2_48_UARTCLK  48000000 /*  48.0000 MHz */
+#define NTC1_UARTCLK     64000000 /*  64.0000 MHz */
 
 struct pch_uart_buffer {
 	unsigned char *buf;
@@ -388,6 +389,12 @@ static int pch_uart_get_uartclk(void)
 	if (cmp && strstr(cmp, "Fish River Island II"))
 		return FRI2_48_UARTCLK;
 
+	/* Kontron COMe-mTT10 (nanoETXexpress-TT) */
+	cmp = dmi_get_system_info(DMI_BOARD_NAME);
+	if (cmp && (strstr(cmp, "COMe-mTT") ||
+		    strstr(cmp, "nanoETXexpress-TT")))
+		return NTC1_UARTCLK;
+
 	return DEFAULT_UARTCLK;
 }
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCHv2] pch_uart: Add Kontron COMe-mTT10 uart clock quirk
  2012-03-23 10:06       ` [PATCHv2] " Michael Brunner
@ 2012-03-23 14:25         ` Darren Hart
  0 siblings, 0 replies; 7+ messages in thread
From: Darren Hart @ 2012-03-23 14:25 UTC (permalink / raw)
  To: Michael Brunner
  Cc: Linux Kernel Mailing List, Greg Kroah-Hartman, Alan Cox, linux-serial



On 03/23/2012 03:06 AM, Michael Brunner wrote:
> Add UART clock quirk for the Kontron COMe-mTT10 module.
>
> The board has previously been called nanoETXexpress-TT, therefore this
> is also checked.
>
> As suggested by Darren Hart the comparison in this patch version is
> placed after the FRI2 checks to ensure it will also work with possible
> upcoming changes to the FRI2 firmware.
>
> This patch follows the patchset submitted by Darren Hart at
> commit a46f5533ecfc7bbdd646d84fdab8656031a715c6.
>
> Signed-off-by: Michael Brunner <mibru@gmx.de>
> ---
>  drivers/tty/serial/pch_uart.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
> index 332f2eb..dd69c95 100644
> --- a/drivers/tty/serial/pch_uart.c
> +++ b/drivers/tty/serial/pch_uart.c
> @@ -210,6 +210,7 @@ enum {
>  #define CMITC_UARTCLK   192000000 /* 192.0000 MHz */
>  #define FRI2_64_UARTCLK  64000000 /*  64.0000 MHz */
>  #define FRI2_48_UARTCLK  48000000 /*  48.0000 MHz */
> +#define NTC1_UARTCLK     64000000 /*  64.0000 MHz */
>
>  struct pch_uart_buffer {
>  	unsigned char *buf;
> @@ -388,6 +389,12 @@ static int pch_uart_get_uartclk(void)
>  	if (cmp && strstr(cmp, "Fish River Island II"))
>  		return FRI2_48_UARTCLK;
>
> +	/* Kontron COMe-mTT10 (nanoETXexpress-TT) */
> +	cmp = dmi_get_system_info(DMI_BOARD_NAME);
> +	if (cmp && (strstr(cmp, "COMe-mTT") ||
> +		    strstr(cmp, "nanoETXexpress-TT")))
> +		return NTC1_UARTCLK;
> +

I don't know the cost of a dmi_get_system_info() call, since we already
grabbed BOARD_NAME, would it make sense to reuse that value by using a
dedicated cmp string?

...

Hrm, just appears to be an array lookup...

	return dmi_ident[field];

No real loss there.

Acked-by: Darren Hart <dvhart@linux.intel.com>

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-23 14:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 20:19 [PATCH] pch_uart: Add Kontron COMe-mTT10 uart clock quirk Michael Brunner
2012-03-22 20:39 ` Darren Hart
2012-03-22 21:31   ` Michael Brunner
2012-03-22 21:49     ` Darren Hart
2012-03-22 23:34       ` Michael Brunner
2012-03-23 10:06       ` [PATCHv2] " Michael Brunner
2012-03-23 14:25         ` Darren Hart

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.