diff mbox

[3/5] ARM: DT: tegra114:add aliases and DMA requestor for serial controller

Message ID 1362750782-15174-4-git-send-email-ldewangan@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laxman Dewangan March 8, 2013, 1:53 p.m. UTC
Add APB DMA requestor and serial aliases for serial controller.
There will be two serial driver i.e. 8250 based simple serial driver
and APB DMA based serial driver for higher baudrate and performace.

The simple serial driver get enabled with compatible nvidia,tegra20-uart
and APB DMA based driver will get enabled with compatible
nvidia,tegra30-hsuart.

Also Fix the clock id for the UARTB.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 arch/arm/boot/dts/tegra114.dtsi |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

Comments

Stephen Warren March 8, 2013, 5:54 p.m. UTC | #1
On 03/08/2013 06:53 AM, Laxman Dewangan wrote:
> Add APB DMA requestor and serial aliases for serial controller.
> There will be two serial driver i.e. 8250 based simple serial driver
> and APB DMA based serial driver for higher baudrate and performace.
> 
> The simple serial driver get enabled with compatible nvidia,tegra20-uart
> and APB DMA based driver will get enabled with compatible
> nvidia,tegra30-hsuart.
> 
> Also Fix the clock id for the UARTB.

If you feel like saying "also", that should probably be a separate patch!

In this case, if the UARTB clock ID actually should be changed, then the
fix should be rolled into Peter's Tegra114 clock series, since it adds
the property you're changing here, and his series hasn't yet been applied.

But, as I mentioned in my previous email, I don't believe the UARTB
clock ID change is correct.

> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi

> +	/*
> +	 * There are two serial driver i.e. 8250 based simple serial
> +	 * driver and APB DMA based serial driver for higher baudrate
> +	 * and performace. To enable the 8250 based driver, the compatible
> +	 * is "nvidia,tegra30-uart", "nvidia,tegra20-uart" and to enable
> +	 * the APB DMA based serial driver, the comptible is
> +	 * "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
> +	 */

Any references to Tegra30 there should be changed to Tegra114 I think.
Laxman Dewangan March 8, 2013, 6:04 p.m. UTC | #2
On Friday 08 March 2013 11:24 PM, Stephen Warren wrote:
> On 03/08/2013 06:53 AM, Laxman Dewangan wrote:
>> Add APB DMA requestor and serial aliases for serial controller.
>> There will be two serial driver i.e. 8250 based simple serial driver
>> and APB DMA based serial driver for higher baudrate and performace.
>>
>> The simple serial driver get enabled with compatible nvidia,tegra20-uart
>> and APB DMA based driver will get enabled with compatible
>> nvidia,tegra30-hsuart.
>>
>> Also Fix the clock id for the UARTB.
> If you feel like saying "also", that should probably be a separate patch!

I will remove "also ..." as I did not see the Documetation part. I think 
it is correct as per Dcoument.

>> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
>> +	/*
>> +	 * There are two serial driver i.e. 8250 based simple serial
>> +	 * driver and APB DMA based serial driver for higher baudrate
>> +	 * and performace. To enable the 8250 based driver, the compatible
>> +	 * is "nvidia,tegra30-uart", "nvidia,tegra20-uart" and to enable
>> +	 * the APB DMA based serial driver, the comptible is
>> +	 * "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
>> +	 */
> Any references to Tegra30 there should be changed to Tegra114 I think.

Ok, there is not change on tegra30 and Tegra114, also we have not added 
the tegra114 compatible in driver file.
Stephen Warren March 8, 2013, 6:40 p.m. UTC | #3
On 03/08/2013 11:04 AM, Laxman Dewangan wrote:
> On Friday 08 March 2013 11:24 PM, Stephen Warren wrote:
>> On 03/08/2013 06:53 AM, Laxman Dewangan wrote:
>>> Add APB DMA requestor and serial aliases for serial controller.
>>> There will be two serial driver i.e. 8250 based simple serial driver
>>> and APB DMA based serial driver for higher baudrate and performace.
>>>
>>> The simple serial driver get enabled with compatible nvidia,tegra20-uart
>>> and APB DMA based driver will get enabled with compatible
>>> nvidia,tegra30-hsuart.

>>> diff --git a/arch/arm/boot/dts/tegra114.dtsi
>>> b/arch/arm/boot/dts/tegra114.dtsi
>>> +    /*
>>> +     * There are two serial driver i.e. 8250 based simple serial
>>> +     * driver and APB DMA based serial driver for higher baudrate
>>> +     * and performace. To enable the 8250 based driver, the compatible
>>> +     * is "nvidia,tegra30-uart", "nvidia,tegra20-uart" and to enable
>>> +     * the APB DMA based serial driver, the comptible is
>>> +     * "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
>>> +     */
>> Any references to Tegra30 there should be changed to Tegra114 I think.
> 
> Ok, there is not change on tegra30 and Tegra114, also we have not added
> the tegra114 compatible in driver file.

As I mentioned elsewhere, compatible must always include the most
specific value; nvidia,tegra114-uart in this case. If the HW is
backwards-compatible, then also include entries for the HW it's
compatible with.

Hence here, you want:

compatible = "nvidia,tegra114-uart", "nvdia,tegra20-uart";

Since the compatible value here shouldn't include any Tegra30-related
value, the comment shouldn't say that it should.

Note that when there are multiple values in the compatible property,
even if the driver doesn't know about the first value, it will still get
matched based upon the 2nd/3rd/... value, so even though the driver
doesn't explicitly know about nvidia,tegra114-uart, it will still get
instantiated, because it does support nvdia,tegra20-uart.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 14afbc8..686e33f 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -4,6 +4,13 @@ 
 	compatible = "nvidia,tegra114";
 	interrupt-parent = <&gic>;
 
+	aliases {
+		serial0 = &uarta;
+		serial1 = &uartb;
+		serial2 = &uartc;
+		serial3 = &uartd;
+	};
+
 	gic: interrupt-controller {
 		compatible = "arm,cortex-a15-gic";
 		#interrupt-cells = <3>;
@@ -99,38 +106,50 @@ 
 		       0x70003000 0x40c>;	/* Mux registers */
 	};
 
-	serial@70006000 {
+	/*
+	 * There are two serial driver i.e. 8250 based simple serial
+	 * driver and APB DMA based serial driver for higher baudrate
+	 * and performace. To enable the 8250 based driver, the compatible
+	 * is "nvidia,tegra30-uart", "nvidia,tegra20-uart" and to enable
+	 * the APB DMA based serial driver, the comptible is
+	 * "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
+	 */
+	uarta: serial@70006000 {
 		compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
 		reg = <0x70006000 0x40>;
 		reg-shift = <2>;
 		interrupts = <0 36 0x04>;
+		nvidia,dma-request-selector = <&apbdma 8>;
 		status = "disabled";
 		clocks = <&tegra_car 6>;
 	};
 
-	serial@70006040 {
+	uartb: serial@70006040 {
 		compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
 		reg = <0x70006040 0x40>;
 		reg-shift = <2>;
 		interrupts = <0 37 0x04>;
+		nvidia,dma-request-selector = <&apbdma 9>;
 		status = "disabled";
-		clocks = <&tegra_car 192>;
+		clocks = <&tegra_car 7>;
 	};
 
-	serial@70006200 {
+	uartc: serial@70006200 {
 		compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
 		reg = <0x70006200 0x100>;
 		reg-shift = <2>;
 		interrupts = <0 46 0x04>;
+		nvidia,dma-request-selector = <&apbdma 10>;
 		status = "disabled";
 		clocks = <&tegra_car 55>;
 	};
 
-	serial@70006300 {
+	uartd: serial@70006300 {
 		compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
 		reg = <0x70006300 0x100>;
 		reg-shift = <2>;
 		interrupts = <0 90 0x04>;
+		nvidia,dma-request-selector = <&apbdma 19>;
 		status = "disabled";
 		clocks = <&tegra_car 65>;
 	};