* [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
@ 2025-01-09 12:08 WangYuli
2025-01-09 12:40 ` Arnd Bergmann
2025-01-11 1:35 ` kernel test robot
0 siblings, 2 replies; 8+ messages in thread
From: WangYuli @ 2025-01-09 12:08 UTC (permalink / raw)
To: gregkh, jirislaby, wangyuli
Cc: linux-kernel, linux-serial, andriy.shevchenko, arnd, schnelle,
pnewman, sunilvl, paulmck, arnd, zhanjun, guanwentao, Zhuozhen He,
Guowei Chen
[ General description per its product manual: ]
The IT8768E-I is a highly integrated Super I/O using the Low Pin
Count Interface. The device’s LPC interface complies with Intel
"LPC Interface Specification Rev. 1.1”. The IT8768E-I is ACPI &
LANDesk compliant.
Integrated in the IT8768E-I are five logical devices, which can
be individually enabled or disabled via software configuration
registers, and four 16C550standard compatible enhanced UARTs
perofrmacing asynchronous communication. The devices also provide
GPIO port controlling up to 12 GPIO pins.
The IT8768E-I utilizes power-saving circuitry to reduce power
consumption, and once a logical device is disabled, the inputs
are inhibited with the clock disabled and the outputs are
tri-stated. The device requires a single 24/48 MHz clock input
and operates with +3.3V power supply. The IT8768E-I is available
in 48-pin LQFP.
It has been determined that this chip is currently employed within
YIHUA STS-320 intelligent teller terminals utilizing
PCBA F21-2401 D2000 MB VerA LF motherboards.
Add a driver to support it.
[ Kernel logs without this driver: ]
[ 1.016170] EFI Variables Facility v0.08 2004-May-17
[ 1.034039] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[ 1.035215] serial 0000:06:00.0: enabling device (0000 -> 0002)
[ 1.035649] 0000:06:00.0: ttyS0 at MMIO 0x64100000 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.035812] 0000:06:00.0: ttyS1 at MMIO 0x64100400 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.035966] 0000:06:00.0: ttyS2 at MMIO 0x64100800 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.036119] 0000:06:00.0: ttyS3 at MMIO 0x64100c00 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.036271] 0000:06:00.0: ttyS4 at MMIO 0x64101000 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.036425] 0000:06:00.0: ttyS5 at MMIO 0x64101400 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.036576] 0000:06:00.0: ttyS6 at MMIO 0x64101800 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.036727] 0000:06:00.0: ttyS7 at MMIO 0x64101c00 (irq = 31, base_baud = 7812500) is a XR17V35X
[ Kernel logs with this driver: ]
[ 1.017777] EFI Variables Facility v0.08 2004-May-17
[ 1.036036] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[ 1.037286] ITES0001:00: ttyS0 at MMIO 0x20000130 (irq = 0, base_baud = 115200) is a 16550A
[ 1.037444] ITES0001:01: ttyS1 at MMIO 0x20000138 (irq = 0, base_baud = 115200) is a 16550A
[ 1.037607] ITES0001:02: ttyS2 at MMIO 0x20000140 (irq = 0, base_baud = 115200) is a 16550A
[ 1.037759] ITES0001:03: ttyS3 at MMIO 0x20000148 (irq = 0, base_baud = 115200) is a 16550A
[ 1.037906] ITES0001:04: ttyS4 at MMIO 0x20000150 (irq = 0, base_baud = 115200) is a 16550A
[ 1.038056] serial 0000:06:00.0: enabling device (0000 -> 0002)
[ 1.038438] 0000:06:00.0: ttyS5 at MMIO 0x64100000 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.038595] 0000:06:00.0: ttyS6 at MMIO 0x64100400 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.038749] 0000:06:00.0: ttyS7 at MMIO 0x64100800 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.038907] 0000:06:00.0: ttyS8 at MMIO 0x64100c00 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.039059] 0000:06:00.0: ttyS9 at MMIO 0x64101000 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.039214] 0000:06:00.0: ttyS10 at MMIO 0x64101400 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.039367] 0000:06:00.0: ttyS11 at MMIO 0x64101800 (irq = 31, base_baud = 7812500) is a XR17V35X
[ 1.039519] 0000:06:00.0: ttyS12 at MMIO 0x64101c00 (irq = 31, base_baud = 7812500) is a XR17V35X
Reported-by: Zhuozhen He <hezhuozhen@uniontech.com>
Tested-by: Guowei Chen <chenguowei@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
drivers/tty/serial/8250/8250_it8768e.c | 138 +++++++++++++++++++++++++
drivers/tty/serial/8250/Kconfig | 6 ++
drivers/tty/serial/8250/Makefile | 1 +
3 files changed, 145 insertions(+)
create mode 100644 drivers/tty/serial/8250/8250_it8768e.c
diff --git a/drivers/tty/serial/8250/8250_it8768e.c b/drivers/tty/serial/8250/8250_it8768e.c
new file mode 100644
index 000000000000..c2c0aeed3918
--- /dev/null
+++ b/drivers/tty/serial/8250/8250_it8768e.c
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Probe for 8250/16550-type iTE IT8768E serial ports.
+ *
+ * Based on drivers/char/serial.c which is in the history, by Linus Torvalds, Theodore Ts'o.
+ *
+ * Copyright (C) 2025 Uniontech Ltd.
+ * Author: WangYuli <wangyuli@uniontech.com>
+ */
+#include <linux/bitops.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/pnp.h>
+#include <linux/serial_core.h>
+#include <linux/string.h>
+
+#include <asm/byteorder.h>
+
+#include "8250.h"
+
+struct it8768e_data {
+ struct uart_8250_port uart;
+ int line;
+};
+
+static int it8768e_probe(struct platform_device *pdev)
+{
+ struct it8768e_data *data;
+ struct resource *res;
+ void *__iomem sio_base;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "memory resource not found\n");
+ return -EINVAL;
+ }
+
+ sio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
+ if (!sio_base) {
+ dev_err(&pdev->dev, "devm_ioremap error\n");
+ return -ENOMEM;
+ }
+
+ data = devm_kcalloc(&pdev->dev, 1,
+ sizeof(struct it8768e_data),
+ GFP_KERNEL);
+ if (!data) {
+ dev_err(&pdev->dev, "Failed to alloc private mem struct.\n");
+ return -ENOMEM;
+ }
+
+ spin_lock_init(&data->uart.port.lock);
+ data->uart.port.dev = &pdev->dev;
+ data->uart.port.regshift = 0;
+ data->uart.port.iotype = UPIO_MEM;
+ data->uart.port.type = PORT_16550A;
+ data->uart.port.membase = sio_base;
+ data->uart.port.mapbase = res->start;
+ data->uart.port.uartclk = 1843200;
+ data->uart.port.flags = UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_SKIP_TEST;
+
+ data->line = serial8250_register_8250_port(&data->uart);
+ if (data->line < 0) {
+ dev_err(&pdev->dev,
+ "unable to resigter 8250 port (MEM%llx): %d\n",
+ (unsigned long long)res->start, 0);
+ return data->line;
+ }
+
+ dev_set_drvdata(&pdev->dev, data);
+ return 0;
+}
+
+static void it8768e_remove(struct platform_device *pdev)
+{
+ struct it8768e_data *data = dev_get_drvdata(&pdev->dev);
+
+ if (!data)
+ return;
+
+ del_timer(&data->uart.timer);
+ serial8250_unregister_port(data->line);
+}
+
+#ifdef CONFIG_PM
+static int it8768e_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct it8768e_data *data = dev_get_drvdata(&pdev->dev);
+
+ if (!data)
+ return -ENODEV;
+
+ serial8250_suspend_port(data->line);
+ return 0;
+}
+
+static int it8768e_resume(struct platform_device *pdev)
+{
+ struct it8768e_data *data = dev_get_drvdata(&pdev->dev);
+
+ if (!data)
+ return -ENODEV;
+
+ serial8250_resume_port(data->line);
+
+ return 0;
+}
+#else
+#define it8768e_suspend NULL
+#define it8768e_resume NULL
+#endif /* PM */
+
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id it8768e_acpi_ids[] = {
+ { .id = "ITES0001" },
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, it8768e_acpi_ids);
+#else
+#define it8768e_acpi_ids NULL
+#endif /* ACPI */
+
+static struct platform_driver it8768e_driver = {
+ .probe = it8768e_probe,
+ .remove = it8768e_remove,
+ .suspend = it8768e_suspend,
+ .resume = it8768e_resume,
+ .driver = {
+ .name = "it8768e",
+ .acpi_match_table = it8768e_acpi_ids,
+ },
+};
+module_platform_driver(it8768e_driver);
+
+MODULE_AUTHOR("WangYuli");
+MODULE_DESCRIPTION("8250 uart driver for iTE IT8768E");
+MODULE_LICENSE("GPL");
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 55d26d16df9b..72e7f33d61d6 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -569,6 +569,12 @@ config SERIAL_8250_BCM7271
including DMA support and high accuracy BAUD rates, say
Y to this option. If unsure, say N.
+config SERIAL_8250_IT8768E
+ tristate "8250 support for iTE IT8768E uart"
+ depends on SERIAL_8250
+ help
+ This option is used for iTE IT8768E serial ports.
+
config SERIAL_OF_PLATFORM
tristate "Devicetree based probing for 8250 ports"
depends on SERIAL_8250 && OF
diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
index 1516de629b61..97bbf05a49bd 100644
--- a/drivers/tty/serial/8250/Makefile
+++ b/drivers/tty/serial/8250/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
obj-$(CONFIG_SERIAL_8250_INGENIC) += 8250_ingenic.o
obj-$(CONFIG_SERIAL_8250_IOC3) += 8250_ioc3.o
+obj-$(CONFIG_SERIAL_8250_IT8768E) += 8250_it8768e.o
obj-$(CONFIG_SERIAL_8250_LPC18XX) += 8250_lpc18xx.o
obj-$(CONFIG_SERIAL_8250_LPSS) += 8250_lpss.o
obj-$(CONFIG_SERIAL_8250_MEN_MCB) += 8250_men_mcb.o
--
2.47.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-09 12:08 [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver WangYuli
@ 2025-01-09 12:40 ` Arnd Bergmann
2025-01-13 9:59 ` Andy Shevchenko
2025-01-11 1:35 ` kernel test robot
1 sibling, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2025-01-09 12:40 UTC (permalink / raw)
To: WangYuli, Greg Kroah-Hartman, Jiri Slaby
Cc: linux-kernel, linux-serial, Andy Shevchenko, Arnd Bergmann,
Niklas Schnelle, pnewman, Sunil V L, Paul E. McKenney, zhanjun,
guanwentao, Zhuozhen He, Guowei Chen
On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
> [ General description per its product manual: ]
> The IT8768E-I is a highly integrated Super I/O using the Low Pin
> Count Interface. The device’s LPC interface complies with Intel
> "LPC Interface Specification Rev. 1.1”. The IT8768E-I is ACPI &
> LANDesk compliant.
>
> Integrated in the IT8768E-I are five logical devices, which can
> be individually enabled or disabled via software configuration
> registers, and four 16C550standard compatible enhanced UARTs
> perofrmacing asynchronous communication. The devices also provide
> GPIO port controlling up to 12 GPIO pins.
>
> The IT8768E-I utilizes power-saving circuitry to reduce power
> consumption, and once a logical device is disabled, the inputs
> are inhibited with the clock disabled and the outputs are
> tri-stated. The device requires a single 24/48 MHz clock input
> and operates with +3.3V power supply. The IT8768E-I is available
> in 48-pin LQFP.
>
> It has been determined that this chip is currently employed within
> YIHUA STS-320 intelligent teller terminals utilizing
> PCBA F21-2401 D2000 MB VerA LF motherboards.
Can you explain why this isn't done as part of
drivers/tty/serial/8250/8250_pnp.c?
I see nothing unusual in here that requires a custom driver.
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-09 12:40 ` Arnd Bergmann
@ 2025-01-13 9:59 ` Andy Shevchenko
2025-01-13 10:36 ` Arnd Bergmann
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2025-01-13 9:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: WangYuli, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
linux-serial, Arnd Bergmann, Niklas Schnelle, pnewman, Sunil V L,
Paul E. McKenney, zhanjun, guanwentao, Zhuozhen He, Guowei Chen
On Thu, Jan 09, 2025 at 01:40:14PM +0100, Arnd Bergmann wrote:
> On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
> > [ General description per its product manual: ]
> > The IT8768E-I is a highly integrated Super I/O using the Low Pin
> > Count Interface. The device’s LPC interface complies with Intel
> > "LPC Interface Specification Rev. 1.1”. The IT8768E-I is ACPI &
> > LANDesk compliant.
> >
> > Integrated in the IT8768E-I are five logical devices, which can
> > be individually enabled or disabled via software configuration
> > registers, and four 16C550standard compatible enhanced UARTs
> > perofrmacing asynchronous communication. The devices also provide
> > GPIO port controlling up to 12 GPIO pins.
> >
> > The IT8768E-I utilizes power-saving circuitry to reduce power
> > consumption, and once a logical device is disabled, the inputs
> > are inhibited with the clock disabled and the outputs are
> > tri-stated. The device requires a single 24/48 MHz clock input
> > and operates with +3.3V power supply. The IT8768E-I is available
> > in 48-pin LQFP.
> >
> > It has been determined that this chip is currently employed within
> > YIHUA STS-320 intelligent teller terminals utilizing
> > PCBA F21-2401 D2000 MB VerA LF motherboards.
>
> Can you explain why this isn't done as part of
> drivers/tty/serial/8250/8250_pnp.c?
I assume you meant 8250_platform.c. PNP is for devices went through legacy PNP
enumeration, most likely having IOPORT instead of IOMEM.
Recently 8250_platform.c was expanded to cover ACPI IDs and it seems they have
proper ID allocated for their device, so that's where it seems best to fit.
> I see nothing unusual in here that requires a custom driver.
+1.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-13 9:59 ` Andy Shevchenko
@ 2025-01-13 10:36 ` Arnd Bergmann
2025-01-13 12:20 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2025-01-13 10:36 UTC (permalink / raw)
To: Andy Shevchenko
Cc: WangYuli, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
linux-serial, Arnd Bergmann, Niklas Schnelle, pnewman, Sunil V L,
Paul E. McKenney, zhanjun, guanwentao, Zhuozhen He, Guowei Chen
On Mon, Jan 13, 2025, at 10:59, Andy Shevchenko wrote:
> On Thu, Jan 09, 2025 at 01:40:14PM +0100, Arnd Bergmann wrote:
>> On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
>>
>> Can you explain why this isn't done as part of
>> drivers/tty/serial/8250/8250_pnp.c?
>
> I assume you meant 8250_platform.c. PNP is for devices went through legacy PNP
> enumeration, most likely having IOPORT instead of IOMEM.
No, I meant the 8250_pnp.c file.
> Recently 8250_platform.c was expanded to cover ACPI IDs and it seems they have
> proper ID allocated for their device, so that's where it seems best to fit.
I don't think we should expand the use of 8250_platform.c
any more than it is already used for. The ACPI device ID stuff in
there is really only for one specific platform and should probably
get moved out as well, the rest is there for hardwired
"plat_serial8250_port" devices on 25+ year old machines that
predate any type of firmware (pnpbios, acpibios, of) or hardware
(ispnp, pci, ...) autodetection for their uarts.
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-13 10:36 ` Arnd Bergmann
@ 2025-01-13 12:20 ` Andy Shevchenko
2025-01-13 13:12 ` Arnd Bergmann
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2025-01-13 12:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: WangYuli, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
linux-serial, Arnd Bergmann, Niklas Schnelle, pnewman, Sunil V L,
Paul E. McKenney, zhanjun, guanwentao, Zhuozhen He, Guowei Chen
On Mon, Jan 13, 2025 at 11:36:08AM +0100, Arnd Bergmann wrote:
> On Mon, Jan 13, 2025, at 10:59, Andy Shevchenko wrote:
> > On Thu, Jan 09, 2025 at 01:40:14PM +0100, Arnd Bergmann wrote:
> >> On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
> >>
> >> Can you explain why this isn't done as part of
> >> drivers/tty/serial/8250/8250_pnp.c?
> >
> > I assume you meant 8250_platform.c. PNP is for devices went through legacy PNP
> > enumeration, most likely having IOPORT instead of IOMEM.
>
> No, I meant the 8250_pnp.c file.
I am puzzled then. How should it work? PNP ID != ACPI HID that's provided in
this patch commit message. On top of that, PNP driver uses _legacy_ PMP bus
and infrastructure.
> > Recently 8250_platform.c was expanded to cover ACPI IDs and it seems they have
> > proper ID allocated for their device, so that's where it seems best to fit.
>
> I don't think we should expand the use of 8250_platform.c
> any more than it is already used for. The ACPI device ID stuff in
> there is really only for one specific platform and should probably
> get moved out as well, the rest is there for hardwired
> "plat_serial8250_port" devices on 25+ year old machines that
> predate any type of firmware (pnpbios, acpibios, of) or hardware
> (ispnp, pci, ...) autodetection for their uarts.
Okay, but I do not see any better fit. Again, PNP is not a fit here or
please elaborate how as I'm lost.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-13 12:20 ` Andy Shevchenko
@ 2025-01-13 13:12 ` Arnd Bergmann
2025-01-13 15:31 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2025-01-13 13:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: WangYuli, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
linux-serial, Arnd Bergmann, Niklas Schnelle, pnewman, Sunil V L,
Paul E. McKenney, zhanjun, guanwentao, Zhuozhen He, Guowei Chen
On Mon, Jan 13, 2025, at 13:20, Andy Shevchenko wrote:
> On Mon, Jan 13, 2025 at 11:36:08AM +0100, Arnd Bergmann wrote:
>> On Mon, Jan 13, 2025, at 10:59, Andy Shevchenko wrote:
>> > On Thu, Jan 09, 2025 at 01:40:14PM +0100, Arnd Bergmann wrote:
>> >> On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
>> >>
>> >> Can you explain why this isn't done as part of
>> >> drivers/tty/serial/8250/8250_pnp.c?
>> >
>> > I assume you meant 8250_platform.c. PNP is for devices went through legacy PNP
>> > enumeration, most likely having IOPORT instead of IOMEM.
>>
>> No, I meant the 8250_pnp.c file.
>
> I am puzzled then. How should it work? PNP ID != ACPI HID that's provided in
> this patch commit message. On top of that, PNP driver uses _legacy_ PMP bus
> and infrastructure.
I guess I don't understand enough about ACPI then, I always
assumed these were the same identifiers. I do see that
CONFIG_ACPI force-enables CONFIG_PNP, and I see the examples in
https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/ evice_Configuration.html
refer to _HID values in the form of "PNP####".
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-13 13:12 ` Arnd Bergmann
@ 2025-01-13 15:31 ` Andy Shevchenko
0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-01-13 15:31 UTC (permalink / raw)
To: Arnd Bergmann
Cc: WangYuli, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
linux-serial, Arnd Bergmann, Niklas Schnelle, pnewman, Sunil V L,
Paul E. McKenney, zhanjun, guanwentao, Zhuozhen He, Guowei Chen
On Mon, Jan 13, 2025 at 02:12:01PM +0100, Arnd Bergmann wrote:
> On Mon, Jan 13, 2025, at 13:20, Andy Shevchenko wrote:
> > On Mon, Jan 13, 2025 at 11:36:08AM +0100, Arnd Bergmann wrote:
> >> On Mon, Jan 13, 2025, at 10:59, Andy Shevchenko wrote:
> >> > On Thu, Jan 09, 2025 at 01:40:14PM +0100, Arnd Bergmann wrote:
> >> >> On Thu, Jan 9, 2025, at 13:08, WangYuli wrote:
> >> >>
> >> >> Can you explain why this isn't done as part of
> >> >> drivers/tty/serial/8250/8250_pnp.c?
> >> >
> >> > I assume you meant 8250_platform.c. PNP is for devices went through legacy PNP
> >> > enumeration, most likely having IOPORT instead of IOMEM.
> >>
> >> No, I meant the 8250_pnp.c file.
> >
> > I am puzzled then. How should it work? PNP ID != ACPI HID that's provided in
> > this patch commit message. On top of that, PNP driver uses _legacy_ PMP bus
> > and infrastructure.
>
> I guess I don't understand enough about ACPI then, I always
> assumed these were the same identifiers. I do see that
> CONFIG_ACPI force-enables CONFIG_PNP, and I see the examples in
> https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/ evice_Configuration.html
> refer to _HID values in the form of "PNP####".
Check the implementation of the pnp_add_id(), for example.
Besides that PNP device has only 24-bit DMA mask by default,
which is due to legacy DMA controllers.
In any case the differences between PNP IDs and ACPI IDs
are described in the specification.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
2025-01-09 12:08 [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver WangYuli
2025-01-09 12:40 ` Arnd Bergmann
@ 2025-01-11 1:35 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-01-11 1:35 UTC (permalink / raw)
To: WangYuli, gregkh, jirislaby
Cc: oe-kbuild-all, linux-kernel, linux-serial, andriy.shevchenko,
arnd, schnelle, pnewman, sunilvl, paulmck, arnd, zhanjun,
guanwentao, Zhuozhen He, Guowei Chen
Hi WangYuli,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tty/tty-testing]
[also build test WARNING on tty/tty-next tty/tty-linus usb/usb-testing usb/usb-next usb/usb-linus linus/master v6.13-rc6 next-20250110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/WangYuli/serial-8250_it8768e-Create-iTE-IT8768E-specific-8250-driver/20250109-201036
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link: https://lore.kernel.org/r/41B1320691916DE6%2B20250109120808.559950-1-wangyuli%40uniontech.com
patch subject: [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver
config: i386-randconfig-062-20250111 (https://download.01.org/0day-ci/archive/20250111/202501110920.kLUGElwx-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250111/202501110920.kLUGElwx-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501110920.kLUGElwx-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/tty/serial/8250/8250_it8768e.c:39:18: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[noderef] __iomem sio_base @@ got void [noderef] __iomem * @@
drivers/tty/serial/8250/8250_it8768e.c:39:18: sparse: expected void *[noderef] __iomem sio_base
drivers/tty/serial/8250/8250_it8768e.c:39:18: sparse: got void [noderef] __iomem *
>> drivers/tty/serial/8250/8250_it8768e.c:58:33: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __iomem *membase @@ got void *[noderef] __iomem sio_base @@
drivers/tty/serial/8250/8250_it8768e.c:58:33: sparse: expected unsigned char [noderef] __iomem *membase
drivers/tty/serial/8250/8250_it8768e.c:58:33: sparse: got void *[noderef] __iomem sio_base
>> drivers/tty/serial/8250/8250_it8768e.c:40:14: sparse: sparse: dereference of noderef expression
vim +39 drivers/tty/serial/8250/8250_it8768e.c
26
27 static int it8768e_probe(struct platform_device *pdev)
28 {
29 struct it8768e_data *data;
30 struct resource *res;
31 void *__iomem sio_base;
32
33 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
34 if (!res) {
35 dev_err(&pdev->dev, "memory resource not found\n");
36 return -EINVAL;
37 }
38
> 39 sio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> 40 if (!sio_base) {
41 dev_err(&pdev->dev, "devm_ioremap error\n");
42 return -ENOMEM;
43 }
44
45 data = devm_kcalloc(&pdev->dev, 1,
46 sizeof(struct it8768e_data),
47 GFP_KERNEL);
48 if (!data) {
49 dev_err(&pdev->dev, "Failed to alloc private mem struct.\n");
50 return -ENOMEM;
51 }
52
53 spin_lock_init(&data->uart.port.lock);
54 data->uart.port.dev = &pdev->dev;
55 data->uart.port.regshift = 0;
56 data->uart.port.iotype = UPIO_MEM;
57 data->uart.port.type = PORT_16550A;
> 58 data->uart.port.membase = sio_base;
59 data->uart.port.mapbase = res->start;
60 data->uart.port.uartclk = 1843200;
61 data->uart.port.flags = UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_SKIP_TEST;
62
63 data->line = serial8250_register_8250_port(&data->uart);
64 if (data->line < 0) {
65 dev_err(&pdev->dev,
66 "unable to resigter 8250 port (MEM%llx): %d\n",
67 (unsigned long long)res->start, 0);
68 return data->line;
69 }
70
71 dev_set_drvdata(&pdev->dev, data);
72 return 0;
73 }
74
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-01-13 15:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 12:08 [PATCH] serial: 8250_it8768e: Create iTE IT8768E specific 8250 driver WangYuli
2025-01-09 12:40 ` Arnd Bergmann
2025-01-13 9:59 ` Andy Shevchenko
2025-01-13 10:36 ` Arnd Bergmann
2025-01-13 12:20 ` Andy Shevchenko
2025-01-13 13:12 ` Arnd Bergmann
2025-01-13 15:31 ` Andy Shevchenko
2025-01-11 1:35 ` kernel test robot
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.