Skip to contentSkip to conversation

serial: bcm2835: add bcm2835 auxiliar uart driver

PATCH Superseded kernel at martin.sperl.org 5 participants 14 messages Jan 9, 2016 – Jan 28, 2016

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover serial: bcm2835: add bcm2835 auxiliar uart driver

From: Martin Sperl <[email protected]>

This patch series adds the bcm2835aux uart driver, which is created as a wrapper arround the 8250 driver (based on recommendations by Stephen Warren)

The device tree patch itself is not included yet because this patch requires the clk-bcm2835aux driver, which is right now only in clk-next, but should become available with 4.5.

Martin Sperl (2):
dt/bindings: serial: bcm2835: add binding documentation for

    bcm2835-aux-uart

serial: bcm2835: add driver for bcm2835-aux-uart

 .../bindings/serial/brcm,bcm2835-aux-uart.txt      |   18 +++
 drivers/tty/serial/8250/8250_bcm2835aux.c          |  143 ++++++++++++++++++++
 drivers/tty/serial/8250/Kconfig                    |    8 ++
 drivers/tty/serial/8250/Makefile                   |    1 +
 4 files changed, 170 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
 create mode 100644 drivers/tty/serial/8250/8250_bcm2835aux.c
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

From: Martin Sperl <[email protected]>

Add binding documentation for the bcm2835-aux-uart driver.

---
 .../bindings/serial/brcm,bcm2835-aux-uart.txt        |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt new file +18 -0
new file mode 100644
index 0000000..2defe5c
@@ -0,0 +1,18 @@
+* BCM2835 AUXILIAR UART
+
+Required properties:
+
+- compatible: "brcm,bcm2835-aux-uart"
+- reg: The base address of the UART register bank.
+- interrupts: A single interrupt specifier.
+- clocks: Clock driving the hardware; used to figure out the baud rate
+  divisor.
+
+Example:
+
+	uart1: uart at 7e215040 {
+		compatible = "brcm,bcm2835-aux-uart";
+		reg = <0x7e215040 0x40>;
+		interrupts = <1 29>;
+		clocks = <&aux BCM2835_AUX_CLOCK_UART>;
+	};
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt line 18

Quoted 8 lines · On Saturday 09 January 2016 13:07:32 kernel at martin.sperl.org wrote:
Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt new file +7 -0
+
+       uart1: uart at 7e215040 {
+               compatible = "brcm,bcm2835-aux-uart";
+               reg = <0x7e215040 0x40>;
+               interrupts = <1 29>;
+               clocks = <&aux BCM2835_AUX_CLOCK_UART>;
+       };

The node name should always be "serial at ...", not "uart at ..."

Arnd

#3 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Quoted 13 lines · Arnd Bergmann

Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt line 18

Quoted 8 lines · On Saturday 09 January 2016 13:07:32 kernel at martin.sperl.org wrote:
Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt new file +7 -0
+
+       uart1: uart at 7e215040 {
+               compatible = "brcm,bcm2835-aux-uart";
+               reg = <0x7e215040 0x40>;
+               interrupts = <1 29>;
+               clocks = <&aux BCM2835_AUX_CLOCK_UART>;
+       };
Quoted 3 lines

The node name should always be "serial at ...", not "uart at ..."

Arnd

The existing dts arch/arm/boot/dts/bcm2835.dtsi already contains:

                uart0: uart at 7e201000 {
                        compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
                        reg = <0x7e201000 0x1000>;
                        interrupts = <2 25>;
                        clocks = <&clocks BCM2835_CLOCK_UART>,
                                 <&clocks BCM2835_CLOCK_VPU>;
                        clock-names = "uartclk", "apb_pclk";
                        arm,primecell-periphid = <0x00241011>;
                };

for the primary uart.

So I was just following that example and would hesitate to use a different nomenclature in the same file (even though I saw serial examples elsewhere).

I guess this is a more general thing that needs to get resolved.

If you tell me to re-spin the patch because of this then I can do that, but that would not solve the issue with uart0.

Thanks,
Martin

#4 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Quoted 12 lines · On Sunday 10 January 2016 11:49:19 Martin Sperl wrote:

The existing dts arch/arm/boot/dts/bcm2835.dtsi already contains:

                uart0: uart at 7e201000 {
                        compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
                        reg = <0x7e201000 0x1000>;
                        interrupts = <2 25>;
                        clocks = <&clocks BCM2835_CLOCK_UART>,
                                 <&clocks BCM2835_CLOCK_VPU>;
                        clock-names = "uartclk", "apb_pclk";
                        arm,primecell-periphid = <0x00241011>;
                };

for the primary uart.

Quoted 8 lines

So I was just following that example and would hesitate to use a different nomenclature in the same file (even though I saw serial examples elsewhere).

I guess this is a more general thing that needs to get resolved.

If you tell me to re-spin the patch because of this then I can do that, but that would not solve the issue with uart0.

Please just add another patch to rename the existing uarts appropriately first, then add this one on top with the correct name.

Arnd

#5 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Quoted 5 lines · Arnd Bergmann

Please just add another patch to rename the existing uarts appropriately first, then add this one on top with the correct name.

I can do that with the next incarnation of the patch.

But would that not break dt-source files, that refer to uart0? Is this not considered an API change as well or does this only apply to the binary files?

#6 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Quoted 10 lines · On Monday 11 January 2016 14:57:46 Martin Sperl wrote:
Quoted 4 lines · Arnd Bergmann

Please just add another patch to rename the existing uarts appropriately first, then add this one on top with the correct name.

I can do that with the next incarnation of the patch.

But would that not break dt-source files, that refer to uart0? Is this not considered an API change as well or does this only apply to the binary files?

To clarify: I meant you should change the node name, not the label.

The label is not part of the dtb data that gets passed to the kernel and can have any value, including "uart0".

The node name is part of the dtb and should follow common naming conventions (per ePAPR), but the kernel doesn't actually care, so it won't break anything.

There are cases where a bootloader relies on a particular node name in order to find a device node and patch its properties, but I don't think this is the case here.

Arnd

#7 lore raw

PATCH v2 1/2 dt/bindings: serial: bcm2835: add binding documentation for bcm2835-aux-uart

Quoted 17 lines · Arnd Bergmann
Quoted 10 lines · On Monday 11 January 2016 14:57:46 Martin Sperl wrote:
Quoted 4 lines · Arnd Bergmann

Please just add another patch to rename the existing uarts appropriately first, then add this one on top with the correct name.

I can do that with the next incarnation of the patch.

But would that not break dt-source files, that refer to uart0? Is this not considered an API change as well or does this only apply to the binary files?

To clarify: I meant you should change the node name, not the label.

The label is not part of the dtb data that gets passed to the kernel and can have any value, including "uart0".

Quoted 7 lines

The node name is part of the dtb and should follow common naming conventions (per ePAPR), but the kernel doesn't actually care, so it won't break anything.

There are cases where a bootloader relies on a particular node name in order to find a device node and patch its properties, but I don't think this is the case here.

Confirmed, the booloader source I have doesn't do anything with uart
nodes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160127/797abe9b/attachment.sig>

#8 lore raw

PATCH v2 2/2 serial: bcm2835: add driver for bcm2835-aux-uart

In reply to kernel at martin.sperl.org

From: Martin Sperl <[email protected]>

The bcm2835 SOC contains an auxiliary uart, which is very close to the ns16550 with some differences.

The big difference is that the uart HW is not using an internal divider of 16 but 8, which results in an effictive baud-rate being twice the requested baud-rate.

This driver handles this device correctly and handles the difference in the HW divider by scaling up the clock ba a factor of 2.

The approach to write a separate (wrapper) driver instead of using a multiplying clock and "ns16550" as compatibility in the device-tree has been recommended by Stephen Warren.

---
 drivers/tty/serial/8250/8250_bcm2835aux.c |  143 +++++++++++++++++++++++++++++
 drivers/tty/serial/8250/Kconfig           |    8 ++
 drivers/tty/serial/8250/Makefile          |    1 +
 3 files changed, 152 insertions(+)
 create mode 100644 drivers/tty/serial/8250/8250_bcm2835aux.c
drivers/tty/serial/8250/8250_bcm2835aux.c new file +143 -0
new file mode 100644
index 0000000..718c357
@@ -0,0 +1,143 @@
+/*
+ * Serial port driver for BCM2835AUX UART
+ *
+ * Copyright (C) 2016 Martin Sperl <[email protected]>
+ *
+ * Based on 8250_lpc18xx.c:
+ * Copyright (C) 2015 Joachim Eastwood <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include "8250.h"
+
+struct bcm2835aux_data {
+	struct uart_8250_port uart;
+	struct clk *clk;
+};
+
+static int bcm2835aux_serial_probe(struct platform_device *pdev)
+{
+	struct bcm2835aux_data *data;
+	struct resource *res;
+	int ret;
+
+	/* allocate the custom structure */
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	/* initialize data */
+	spin_lock_init(&data->uart.port.lock);
+	data->uart.port.dev = &pdev->dev;
+	data->uart.port.regshift = 2;
+	data->uart.port.type = PORT_16550;
+	data->uart.port.iotype = UPIO_MEM;
+	data->uart.port.fifosize = 8;
+	data->uart.port.flags = UPF_SHARE_IRQ |
+				UPF_FIXED_PORT |
+				UPF_FIXED_TYPE |
+				UPF_SKIP_TEST;
+
+	/* get the clock - this also enables the HW */
+	data->clk = devm_clk_get(&pdev->dev, NULL);
+	ret = PTR_ERR_OR_ZERO(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "could not get clk: %d\n", ret);
+		return ret;
+	}
+
+	/* get the interrupt */
+	data->uart.port.irq = platform_get_irq(pdev, 0);
+	if (data->uart.port.irq < 0) {
+		dev_err(&pdev->dev, "irq not found - %i",
+			data->uart.port.irq);
+		return data->uart.port.irq;
+	}
+
+	/* map the main registers */
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "memory resource not found");
+		return -EINVAL;
+	}
+	data->uart.port.membase = devm_ioremap_resource(&pdev->dev, res);
+	ret = PTR_ERR_OR_ZERO(data->uart.port.membase);
+	if (ret)
+		return ret;
+
+	/* Check for a fixed line number */
+	ret = of_alias_get_id(pdev->dev.of_node, "serial");
+	if (ret >= 0)
+		data->uart.port.line = ret;
+
+	/* enable the clock as a last step */
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "unable to enable uart clock\n");
+		return ret;
+	}
+
+	/* the HW-clock divider for bcm2835aux is 8,
+	 * but 8250 expects a divider of 16,
+	 * so we have to multiply the actual clock by 2
+	 * to get identical baudrates.
+	 */
+	data->uart.port.uartclk = clk_get_rate(data->clk) * 2;
+
+	/* register the port */
+	ret = serial8250_register_8250_port(&data->uart);
+	if (ret < 0) {
+		dev_err(&pdev->dev,
+			"unable to register 8250 port - %d\n", ret);
+		goto dis_clk;
+	}
+	data->uart.port.line = ret;
+
+	platform_set_drvdata(pdev, data);
+
+	return 0;
+
+dis_clk:
+	clk_disable_unprepare(data->clk);
+	return ret;
+}
+
+static int bcm2835aux_serial_remove(struct platform_device *pdev)
+{
+	struct bcm2835aux_data *data = platform_get_drvdata(pdev);
+
+	serial8250_unregister_port(data->uart.port.line);
+	clk_disable_unprepare(data->clk);
+
+	return 0;
+}
+
+static const struct of_device_id bcm2835aux_serial_match[] = {
+	{ .compatible = "brcm,bcm2835-aux-uart" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, bcm2835aux_serial_match);
+
+static struct platform_driver bcm2835aux_serial_driver = {
+	.driver = {
+		.name = "bcm2835-aux-uart",
+		.of_match_table = bcm2835aux_serial_match,
+	},
+	.probe  = bcm2835aux_serial_probe,
+	.remove = bcm2835aux_serial_remove,
+};
+module_platform_driver(bcm2835aux_serial_driver);
+
+MODULE_DESCRIPTION("BCM2835 auxiliar UART driver");
+MODULE_AUTHOR("Martin Sperl <[email protected]>");
+MODULE_LICENSE("GPL v2");
drivers/tty/serial/8250/Kconfig +8 -0
index 6412f14..105aa19 100644
@@ -272,6 +272,14 @@ config SERIAL_8250_ACORN
 	  system, say Y to this option.  The driver can handle 1, 2, or 3 port
 	  cards.  If unsure, say N.
 
+config SERIAL_8250_BCM2835AUX
+	tristate "BCM2835 auxiliar uart support"
+	depends on ARCH_BCM2835 || COMPILE_TEST
+	depends on SERIAL_8250 && SERIAL_8250_SHARE_IRQ
+	help
+	  support for the BCM2835 auxiliar uart.
+	  If unsure, say N.
+
 config SERIAL_8250_FSL
 	bool
 	depends on SERIAL_8250_CONSOLE
drivers/tty/serial/8250/Makefile +1 -0
index e177f86..6327d0a 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_SERIAL_8250_PCI)		+= 8250_pci.o
 obj-$(CONFIG_SERIAL_8250_HP300)		+= 8250_hp300.o
 obj-$(CONFIG_SERIAL_8250_CS)		+= serial_cs.o
 obj-$(CONFIG_SERIAL_8250_ACORN)		+= 8250_acorn.o
+obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
 obj-$(CONFIG_SERIAL_8250_CONSOLE)	+= 8250_early.o
 obj-$(CONFIG_SERIAL_8250_FOURPORT)	+= 8250_fourport.o
 obj-$(CONFIG_SERIAL_8250_ACCENT)	+= 8250_accent.o
Signature · 1 line
1.7.10.4
#9 lore raw

PATCH v2 2/2 serial: bcm2835: add driver for bcm2835-aux-uart

Hi Martin,

Am 09.01.2016 um 14:07 schrieb kernel at martin.sperl.org:

Quoted 65 lines

From: Martin Sperl <[email protected]>

The bcm2835 SOC contains an auxiliary uart, which is very close to the ns16550 with some differences.

The big difference is that the uart HW is not using an internal divider of 16 but 8, which results in an effictive baud-rate being twice the requested baud-rate.

This driver handles this device correctly and handles the difference in the HW divider by scaling up the clock ba a factor of 2.

The approach to write a separate (wrapper) driver instead of using a multiplying clock and "ns16550" as compatibility in the device-tree has been recommended by Stephen Warren.

---
 drivers/tty/serial/8250/8250_bcm2835aux.c |  143 +++++++++++++++++++++++++++++
 drivers/tty/serial/8250/Kconfig           |    8 ++
 drivers/tty/serial/8250/Makefile          |    1 +
 3 files changed, 152 insertions(+)
 create mode 100644 drivers/tty/serial/8250/8250_bcm2835aux.c
drivers/tty/serial/8250/8250_bcm2835aux.c new file +35 -0
new file mode 100644
index 0000000..718c357
@@ -0,0 +1,143 @@
+/*
+ * Serial port driver for BCM2835AUX UART
+ *
+ * Copyright (C) 2016 Martin Sperl <[email protected]>
+ *
+ * Based on 8250_lpc18xx.c:
+ * Copyright (C) 2015 Joachim Eastwood <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include "8250.h"
+
+struct bcm2835aux_data {
+	struct uart_8250_port uart;
+	struct clk *clk;
+};
+
+static int bcm2835aux_serial_probe(struct platform_device *pdev)
+{
+	struct bcm2835aux_data *data;
+	struct resource *res;
+	int ret;
+
+	/* allocate the custom structure */
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);

drivers/tty/serial/8250/8250_bcm2835aux.c line 45

Quoted 10 lines
drivers/tty/serial/8250/8250_bcm2835aux.c new file +10 -0
+	if (!data)
+		return -ENOMEM;
+
+	/* initialize data */
+	spin_lock_init(&data->uart.port.lock);
+	data->uart.port.dev = &pdev->dev;
+	data->uart.port.regshift = 2;
+	data->uart.port.type = PORT_16550;
+	data->uart.port.iotype = UPIO_MEM;
+	data->uart.port.fifosize = 8;

data->uart.capabilities = UART_CAP_FIFO; ?

Quoted 46 lines
drivers/tty/serial/8250/8250_bcm2835aux.c new file +46 -0
+	data->uart.port.flags = UPF_SHARE_IRQ |
+				UPF_FIXED_PORT |
+				UPF_FIXED_TYPE |
+				UPF_SKIP_TEST;
+
+	/* get the clock - this also enables the HW */
+	data->clk = devm_clk_get(&pdev->dev, NULL);
+	ret = PTR_ERR_OR_ZERO(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "could not get clk: %d\n", ret);
+		return ret;
+	}
+
+	/* get the interrupt */
+	data->uart.port.irq = platform_get_irq(pdev, 0);
+	if (data->uart.port.irq < 0) {
+		dev_err(&pdev->dev, "irq not found - %i",
+			data->uart.port.irq);
+		return data->uart.port.irq;
+	}
+
+	/* map the main registers */
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "memory resource not found");
+		return -EINVAL;
+	}
+	data->uart.port.membase = devm_ioremap_resource(&pdev->dev, res);
+	ret = PTR_ERR_OR_ZERO(data->uart.port.membase);
+	if (ret)
+		return ret;
+
+	/* Check for a fixed line number */
+	ret = of_alias_get_id(pdev->dev.of_node, "serial");
+	if (ret >= 0)
+		data->uart.port.line = ret;
+
+	/* enable the clock as a last step */
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "unable to enable uart clock\n");
+		return ret;
+	}
+
+	/* the HW-clock divider for bcm2835aux is 8,
+	 * but 8250 expects a divider of 16,

drivers/tty/serial/8250/8250_bcm2835aux.c line 101

Quoted 10 lines
drivers/tty/serial/8250/8250_bcm2835aux.c new file +10 -0
+	 * so we have to multiply the actual clock by 2
+	 * to get identical baudrates.
+	 */
+	data->uart.port.uartclk = clk_get_rate(data->clk) * 2;
+
+	/* register the port */
+	ret = serial8250_register_8250_port(&data->uart);
+	if (ret < 0) {
+		dev_err(&pdev->dev,
+			"unable to register 8250 port - %d\n", ret);

This should fit in one line.

drivers/tty/serial/8250/8250_bcm2835aux.c line 104

Quoted 3 lines
drivers/tty/serial/8250/8250_bcm2835aux.c new file +3 -0
+		goto dis_clk;
+	}
+	data->uart.port.line = ret;

This looks wrong because it overwrites the result of of_alias_get_id. Either
you store it in a new member of bcm2835aux_data or drop the assignment.

Quoted 44 lines
drivers/tty/serial/8250/8250_bcm2835aux.c new file +39 -0
+
+	platform_set_drvdata(pdev, data);
+
+	return 0;
+
+dis_clk:
+	clk_disable_unprepare(data->clk);
+	return ret;
+}
+
+static int bcm2835aux_serial_remove(struct platform_device *pdev)
+{
+	struct bcm2835aux_data *data = platform_get_drvdata(pdev);
+
+	serial8250_unregister_port(data->uart.port.line);
+	clk_disable_unprepare(data->clk);
+
+	return 0;
+}
+
+static const struct of_device_id bcm2835aux_serial_match[] = {
+	{ .compatible = "brcm,bcm2835-aux-uart" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, bcm2835aux_serial_match);
+
+static struct platform_driver bcm2835aux_serial_driver = {
+	.driver = {
+		.name = "bcm2835-aux-uart",
+		.of_match_table = bcm2835aux_serial_match,
+	},
+	.probe  = bcm2835aux_serial_probe,
+	.remove = bcm2835aux_serial_remove,
+};
+module_platform_driver(bcm2835aux_serial_driver);
+
+MODULE_DESCRIPTION("BCM2835 auxiliar UART driver");
+MODULE_AUTHOR("Martin Sperl <[email protected]>");
+MODULE_LICENSE("GPL v2");
drivers/tty/serial/8250/Kconfig +0 -0
index 6412f14..105aa19 100644

drivers/tty/serial/8250/Kconfig config SERIAL_8250_ACORN · line 276

Quoted 5 lines
drivers/tty/serial/8250/Kconfig +2 -0
@@ -272,6 +272,14 @@ config SERIAL_8250_ACORN
 	  system, say Y to this option.  The driver can handle 1, 2, or 3 port
 	  cards.  If unsure, say N.
 
+config SERIAL_8250_BCM2835AUX
+	tristate "BCM2835 auxiliar uart support"

BCM2835 auxiliary mini UART support

drivers/tty/serial/8250/Kconfig config SERIAL_8250_ACORN · line 280

Quoted 4 lines
drivers/tty/serial/8250/Kconfig +4 -0
+	depends on ARCH_BCM2835 || COMPILE_TEST
+	depends on SERIAL_8250 && SERIAL_8250_SHARE_IRQ
+	help
+	  support for the BCM2835 auxiliar uart.

auxiliary UART

Since it's a mini UART it would be helpful to write down the limitiations here.

Quoted 6 lines
drivers/tty/serial/8250/Kconfig +2 -0
+	  If unsure, say N.
+
 config SERIAL_8250_FSL
 	bool
 	depends on SERIAL_8250_CONSOLE
#10 lore raw

PATCH v2 2/2 serial: bcm2835: add driver for bcm2835-aux-uart

In reply to kernel at martin.sperl.org
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"kernel" == kernel <[email protected]> writes:

From: Martin Sperl <[email protected]>
The bcm2835 SOC contains an auxiliary uart, which is very close to the ns16550 with some differences.

Quoted 6 lines

The big difference is that the uart HW is not using an internal divider of 16 but 8, which results in an effictive baud-rate being twice the requested baud-rate.

This driver handles this device correctly and handles the difference in the HW divider by scaling up the clock ba a factor of 2.

s/ba/by/

Signature · 1 line
Bye, Peter Korsgaard
#11 lore raw

v2 cover serial: bcm2835: add bcm2835 auxiliar uart driver

In reply to kernel at martin.sperl.org

Hi Martin,

Quoted 5 lines

kernel at martin.sperl.org hat am 9. Januar 2016 um 14:07 geschrieben:

From: Martin Sperl <[email protected]>

Quoted 7 lines

This patch series adds the bcm2835aux uart driver, which is created as a wrapper arround the 8250 driver (based on recommendations by Stephen Warren)

The device tree patch itself is not included yet because this patch requires the clk-bcm2835aux driver, which is right now only in clk-next, but should become available with 4.5.

it doesn't make sense without the device tree patch. IMHO it's okay as long as you point out the dependency and set the node status to disable.

Best regards
Stefan

#12 lore raw

v2 cover serial: bcm2835: add bcm2835 auxiliar uart driver

Quoted 14 lines · Stefan Wahren

Hi Martin,

Quoted 9 lines

kernel at martin.sperl.org hat am 9. Januar 2016 um 14:07 geschrieben:

From: Martin Sperl <[email protected]>

This patch series adds the bcm2835aux uart driver, which is created as a wrapper arround the 8250 driver (based on recommendations by Stephen Warren)

Quoted 6 lines
Quoted 3 lines

The device tree patch itself is not included yet because this patch requires the clk-bcm2835aux driver, which is right now only in clk-next, but should become available with 4.5.

it doesn't make sense without the device tree patch. IMHO it's okay as long as you point out the dependency and set the node status to disable.

I agree in principle, but it is the same as with the spi-bcm2835aux driver, where I had provided a patch to the dt, that still has not been applied yet, but with the driver itself already in the kernel.

Also the reorganisation of the dt to support the bcm2836 makes this another moving target.

The other concern is that we would need to use defines included from "dt-bindings/clock/bcm2835aux.h? and without those the dt will not work.

For the record: this is what would be required:

	uart1: uart at 7e215040 {
		compatible = "brcm,bcm2835-aux-uart";
		reg = <0x7e215040 0x40>;
		interrupts = <1 29>;
                        clocks = <&aux BCM2835_AUX_CLOCK_UART>;
                        status = "disabled";
                };

I can respin the whole patchset to include this as well if you tell me to.

#13 lore raw

v2 cover serial: bcm2835: add bcm2835 auxiliar uart driver

Quoted 23 lines

Martin Sperl <[email protected]> hat am 10. Januar 2016 um 16:45 geschrieben:

Quoted 17 lines · Stefan Wahren

Hi Martin,

Quoted 12 lines

kernel at martin.sperl.org hat am 9. Januar 2016 um 14:07 geschrieben:

From: Martin Sperl <[email protected]>

This patch series adds the bcm2835aux uart driver, which is created as a wrapper arround the 8250 driver (based on recommendations by Stephen Warren)

The device tree patch itself is not included yet because this patch requires the clk-bcm2835aux driver, which is right now only in clk-next, but should become available with 4.5.

Quoted 7 lines
Quoted 3 lines

it doesn't make sense without the device tree patch. IMHO it's okay as long as
you point out the dependency and set the node status to disable.

I agree in principle, but it is the same as with the spi-bcm2835aux driver, where I had provided a patch to the dt, that still has not been applied yet, but with the driver itself already in the kernel.

Please provide a new version, because it won't apply anymore. It increase the chance of more testing.

Quoted 7 lines

Also the reorganisation of the dt to support the bcm2836 makes this another moving target.

The other concern is that we would need to use defines included from "dt-bindings/clock/bcm2835aux.h? and without those the dt will not work.

AFAIK there has been a discussion about such a problem.

Quoted 11 lines

For the record: this is what would be required:
uart1: uart at 7e215040 {
compatible = "brcm,bcm2835-aux-uart";
reg = <0x7e215040 0x40>;
interrupts = <1 29>;
clocks = <&aux BCM2835_AUX_CLOCK_UART>;
status = "disabled";
};

I can respin the whole patchset to include this as well if you tell me to.

I think we should wait for a rpi maintainer's response about that. No need to hurry.

Quoted 6 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel