Skip to contentSkip to conversation

pch_uart: Add Kontron COMe-mTT10 uart clock quirk

PATCH Superseded Michael Brunner 2 participants 7 messages Mar 22, 2012 – Mar 23, 2012 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pch_uart: Add Kontron COMe-mTT10 uart clock quirk

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.

---
 drivers/tty/serial/pch_uart.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/tty/serial/pch_uart.c +5 -0
index 332f2eb..0ab5295 100644
@@ -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))
#1 lore raw
Quoted 25 lines · Michael Brunner

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.

---
 drivers/tty/serial/pch_uart.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/tty/serial/pch_uart.c +1 -0
index 332f2eb..0ab5295 100644
@@ -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;

drivers/tty/serial/pch_uart.c static int pch_uart_get_uartclk(void) · line 386

Quoted 7 lines
drivers/tty/serial/pch_uart.c +4 -0
@@ -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.

drivers/tty/serial/pch_uart.c static int pch_uart_get_uartclk(void) · line 389

Quoted 2 lines
drivers/tty/serial/pch_uart.c +0 -0
 	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

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#2 lore raw
Quoted 5 lines

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.

Quoted 8 lines

drivers/tty/serial/pch_uart.c static int pch_uart_get_uartclk(void) · line 389

Quoted 2 lines
drivers/tty/serial/pch_uart.c +0 -0
 	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

#3 lore raw
Quoted 14 lines · Michael Brunner
Quoted 5 lines

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.

Quoted 8 lines

drivers/tty/serial/pch_uart.c static int pch_uart_get_uartclk(void) · line 389

Quoted 2 lines
drivers/tty/serial/pch_uart.c +0 -0
 	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

Quoted 6 lines

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,

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#4 lore raw
Quoted 6 lines

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.

Quoted 1 line

So what does your DMI_BIOS_VERSION report?

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

Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 7 lines

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

#5 lore raw

PATCH v2 1/1 pch_uart: Add Kontron COMe-mTT10 uart clock quirk

In reply to Darren Hart

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.

---
 drivers/tty/serial/pch_uart.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/tty/serial/pch_uart.c +7 -0
index 332f2eb..dd69c95 100644
@@ -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;
 }
 
Acked-by on v2 1/1
#6 lore raw
Quoted 30 lines · Michael Brunner

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.

---
 drivers/tty/serial/pch_uart.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/tty/serial/pch_uart.c +1 -0
index 332f2eb..dd69c95 100644
@@ -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;

drivers/tty/serial/pch_uart.c static int pch_uart_get_uartclk(void) · line 397

Quoted 9 lines
drivers/tty/serial/pch_uart.c +6 -0
@@ -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.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel