ARM: dts: imx28.dtsi: Add auart support
Subsystems (4)
Fabio Estevam
reviewerPATCH 1/5 ARM: dts: imx28.dtsi: Add auart support
From: Fabio Estevam <[email protected]>
Add auart support.
--- arch/arm/boot/dts/imx28.dtsi | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28.dtsi +26 -0
@@ -22,6 +22,11 @@ gpio4 = &gpio4; saif0 = &saif0; saif1 = &saif1; + serial0 = &auart0; + serial1 = &auart1; + serial2 = &auart2; + serial3 = &auart3; + serial4 = &auart4; }; cpus {
@@ -167,6 +172,22 @@ fsl,pull-up = <0>; }; + auart0_pins_a: auart0 at 0 { + reg = <0>; + fsl,pinmux-ids = <0x3000 0x3010 0x3020 0x3030>; + fsl,drive-strength = <0>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + auart3_pins_a: auart3 at 0 { + reg = <0>; + fsl,pinmux-ids = <0x30c0 0x30d0 0x30e0 0x30f0>; + fsl,drive-strength = <0>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + mac0_pins_a: mac0 at 0 { reg = <0>; fsl,pinmux-ids = <0x4000 0x4010 0x4020
@@ -404,30 +425,35 @@ }; auart0: serial@8006a000 { + compatible = "fsl,mxs-auart"; reg = <0x8006a000 0x2000>; interrupts = <112 70 71>; status = "disabled"; }; auart1: serial at 8006c000 { + compatible = "fsl,mxs-auart"; reg = <0x8006c000 0x2000>; interrupts = <113 72 73>; status = "disabled"; }; auart2: serial at 8006e000 { + compatible = "fsl,mxs-auart"; reg = <0x8006e000 0x2000>; interrupts = <114 74 75>; status = "disabled"; }; auart3: serial at 80070000 { + compatible = "fsl,mxs-auart"; reg = <0x80070000 0x2000>; interrupts = <115 76 77>; status = "disabled"; }; auart4: serial at 80072000 { + compatible = "fsl,mxs-auart"; reg = <0x80072000 0x2000>; interrupts = <116 78 79>; status = "disabled";
Signature · 1 line
1.7.1
Fabio Estevam
reviewerPATCH 2/5 ARM: dts: mx28evk: Add auart0 and auart3 support
From: Fabio Estevam <[email protected]>
Add auart0 and auart3 support.
--- arch/arm/boot/dts/imx28-evk.dts | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28-evk.dts +12 -0
@@ -73,6 +73,18 @@ pinctrl-0 = <&duart_pins_a>; status = "okay"; }; + + auart0: serial at 8006a000 { + pinctrl-names = "default"; + pinctrl-0 = <&auart0_pins_a>; + status = "okay"; + }; + + auart3: serial at 80070000 { + pinctrl-names = "default"; + pinctrl-0 = <&auart3_pins_a>; + status = "okay"; + }; }; };
Signature · 1 line
1.7.1
Fabio Estevam
reviewerPATCH 3/5 serial: mxs-auart: Allow device tree probing
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
Allow device tree probing.
--- drivers/tty/serial/mxs-auart.c | 55 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 54 insertions(+), 1 deletions(-)
drivers/tty/serial/mxs-auart.c +54 -1
@@ -33,6 +33,7 @@#include <linux/delay.h> #include <linux/io.h> #include <linux/pinctrl/consumer.h> +#include <linux/of_device.h> #include <asm/cacheflush.h>
@@ -675,6 +676,44 @@ static struct uart_driver auart_driver = {#endif }; +#ifdef CONFIG_OF +/* +* This function returns 1 if pdev isn't a device instatiated by dt, 0 if it +* could successfully get all information from dt or a negative errno. +*/ +static int serial_mxs_probe_dt (struct mxs_auart_port *s, +struct platform_device *pdev) +{ +struct device_node *np = pdev->dev.of_node; +int ret; + +if (!np) +/* no device tree device */ +return 1 ; + + ret =of_alias_get_id (np,"serial" ); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to get alias id: %d\n" , ret); +return ret; + } + s->port.line = ret; + +return 0 ; +} +#else +static inline int serial_mxs_probe_dt (struct mxs_auart_port *s, +struct platform_device *pdev) +{ +return 1 ; +} +#endif + +static void mxs_auart_probe_pdev (struct mxs_auart_port *s, +struct platform_device *pdev) +{ + s->port.line = pdev->id <0 ?0 : pdev->id; +} +static int __devinit mxs_auart_probe (struct platform_device *pdev) {struct mxs_auart_port *s;
@@ -689,6 +728,14 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev) goto out; } + ret =serial_mxs_probe_dt (s, pdev); +if (ret >0 ) +mxs_auart_probe_pdev (s, pdev); +else if (ret <0 ) { + ret = -EINVAL ; + goto out_free; + } + pinctrl =devm_pinctrl_get_select_default (&pdev->dev);if (IS_ERR (pinctrl)) { ret =PTR_ERR (pinctrl);
@@ -711,7 +758,6 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev) s->port.membase =ioremap (r->start,resource_size (r)); s->port.ops = &mxs_auart_ops; s->port.iotype =UPIO_MEM ; - s->port.line = pdev->id <0 ?0 : pdev->id; s->port.fifosize =16 ; s->port.uartclk =clk_get_rate (s->clk); s->port.type =PORT_IMX ;
@@ -769,12 +815,19 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)return 0 ; } +static struct of_device_id mxs_auart_dt_ids[] = { + {.compatible ="fsl,mxs-auart" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, mxs_auart_dt_ids); +static struct platform_driver mxs_auart_driver = { .probe = mxs_auart_probe, .remove =__devexit_p (mxs_auart_remove), .driver = { .name ="mxs-auart" , .owner =THIS_MODULE , + .of_match_table =of_match_ptr (mxs_auart_dt_ids), }, };
Signature · 1 line
1.7.1
Fabio Estevam
reviewerPATCH 4/5 ARM: mxs_defconfig: Let AUART driver be built by default
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
Let AUART driver be built by default.
--- arch/arm/configs/mxs_defconfig | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/configs/mxs_defconfig +1 -0
@@ -77,6 +77,7 @@ CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # CONFIG_DEVKMEM is not set CONFIG_SERIAL_AMBA_PL011=y CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_MXS_AUART=y # CONFIG_HW_RANDOM is not set CONFIG_I2C=y # CONFIG_I2C_COMPAT is not set
Signature · 1 line
1.7.1
Fabio Estevam
reviewerPATCH 5/5 dt: fsl-mxs-auart.txt: Add documentation for mxs-auart binding
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
Add documentation for mxs-auart binding.
--- .../bindings/tty/serial/fsl-mxs-auart.txt | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt new file +14 -0
@@ -0,0 +1,14 @@ +* Freescale MXS Application UART (AUART) + +Required properties: +- compatible : Should be "fsl,mxs-uart" +- reg : Address and length of the register set for the device +- interrupts : Should contain the auart interrupt + +Example: +auart0: serial at 8006a000 { + compatible = "fsl,mxs-auart"; + reg = <0x8006a000 0x2000>; + interrupts = <112 70 71>; +}; +
Signature · 1 line
1.7.1
PATCH 1/5 ARM: dts: imx28.dtsi: Add auart support
In reply to Fabio EstevamQuoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Add auart support.
Signed-off-by Fabio Estevam <[email protected]>
Merge 1+2 and 3+5?
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120615/4e4755e8/attachment.sig>
PATCH 1/5 ARM: dts: imx28.dtsi: Add auart support
Quoted 9 lines · Wolfram Sang
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Add auart support.
Signed-off-by Fabio Estevam <[email protected]>Merge 1+2 and 3+5?
+1
Signature · 2 lines
Regards, Shawn
PATCH 1/5 ARM: dts: imx28.dtsi: Add auart support
Dear Shawn Guo,
Quoted 11 lines · Wolfram Sang
Quoted 8 lines · Fabio Estevam
Quoted 5 lines
From: Fabio Estevam <[email protected]>
Add auart support.
Signed-off-by Fabio Estevam <[email protected]>Merge 1+2 and 3+5?
+1
This seems pretty odd thing to do since they're unrelated, but ... oh well.
Best regards,
Marek Vasut