All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-06  9:40 ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-06  9:40 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot
  Cc: Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Jon Hunter

Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.

Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm64/boot/dts/nvidia/Makefile           |  1 +
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts

diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
index a7e865da1005..0f7cdf3e05c1 100644
--- a/arch/arm64/boot/dts/nvidia/Makefile
+++ b/arch/arm64/boot/dts/nvidia/Makefile
@@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
+dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
 
 always		:= $(dtb-y)
 clean-files	:= *.dtb
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
new file mode 100644
index 000000000000..a7474f5fcbcc
--- /dev/null
+++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
@@ -0,0 +1,42 @@
+/dts-v1/;
+
+#include "tegra210.dtsi"
+
+/ {
+	model = "Google Pixel C";
+	compatible = "google,smaug-rev8", "google,smaug-rev7",
+		     "google,smaug-rev6", "google,smaug-rev5",
+		     "google,smaug-rev4", "google,smaug-rev3",
+		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0xc0000000>;
+	};
+
+	serial@0,70006000 {
+		status = "okay";
+	};
+
+	pmc@0,7000e400 {
+		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <0>;
+		nvidia,cpu-pwr-good-time = <0>;
+		nvidia,cpu-pwr-off-time = <0>;
+		nvidia,core-pwr-good-time = <12000 6000>;
+		nvidia,core-pwr-off-time = <39053>;
+		nvidia,core-power-req-active-high;
+		nvidia,sys-clock-req-active-high;
+		status = "okay";
+	};
+
+	sdhci@0,700b0600 {
+		bus-width = <8>;
+		non-removable;
+		status = "okay";
+	};
+};
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-06  9:40 ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-06  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 arch/arm64/boot/dts/nvidia/Makefile           |  1 +
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts

diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
index a7e865da1005..0f7cdf3e05c1 100644
--- a/arch/arm64/boot/dts/nvidia/Makefile
+++ b/arch/arm64/boot/dts/nvidia/Makefile
@@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
+dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
 
 always		:= $(dtb-y)
 clean-files	:= *.dtb
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
new file mode 100644
index 000000000000..a7474f5fcbcc
--- /dev/null
+++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
@@ -0,0 +1,42 @@
+/dts-v1/;
+
+#include "tegra210.dtsi"
+
+/ {
+	model = "Google Pixel C";
+	compatible = "google,smaug-rev8", "google,smaug-rev7",
+		     "google,smaug-rev6", "google,smaug-rev5",
+		     "google,smaug-rev4", "google,smaug-rev3",
+		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0xc0000000>;
+	};
+
+	serial at 0,70006000 {
+		status = "okay";
+	};
+
+	pmc at 0,7000e400 {
+		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <0>;
+		nvidia,cpu-pwr-good-time = <0>;
+		nvidia,cpu-pwr-off-time = <0>;
+		nvidia,core-pwr-good-time = <12000 6000>;
+		nvidia,core-pwr-off-time = <39053>;
+		nvidia,core-power-req-active-high;
+		nvidia,sys-clock-req-active-high;
+		status = "okay";
+	};
+
+	sdhci at 0,700b0600 {
+		bus-width = <8>;
+		non-removable;
+		status = "okay";
+	};
+};
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-06  9:40 ` Jon Hunter
@ 2016-01-06  9:46     ` Mark Rutland
  -1 siblings, 0 replies; 16+ messages in thread
From: Mark Rutland @ 2016-01-06  9:46 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Rob Herring, Pawel Moll, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Hi,

On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
> 
> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> 
> diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
> index a7e865da1005..0f7cdf3e05c1 100644
> --- a/arch/arm64/boot/dts/nvidia/Makefile
> +++ b/arch/arm64/boot/dts/nvidia/Makefile
> @@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
> +dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
>  
>  always		:= $(dtb-y)
>  clean-files	:= *.dtb
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> new file mode 100644
> index 000000000000..a7474f5fcbcc
> --- /dev/null
> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> @@ -0,0 +1,42 @@
> +/dts-v1/;
> +
> +#include "tegra210.dtsi"
> +
> +/ {
> +	model = "Google Pixel C";
> +	compatible = "google,smaug-rev8", "google,smaug-rev7",
> +		     "google,smaug-rev6", "google,smaug-rev5",
> +		     "google,smaug-rev4", "google,smaug-rev3",
> +		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";

This looks a little funky. Is each revision a strict superset of the
previous version?

> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
> +	};

Use stdout-path.

Otherwise this looks ok.

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-06  9:46     ` Mark Rutland
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Rutland @ 2016-01-06  9:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> 
> diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
> index a7e865da1005..0f7cdf3e05c1 100644
> --- a/arch/arm64/boot/dts/nvidia/Makefile
> +++ b/arch/arm64/boot/dts/nvidia/Makefile
> @@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
> +dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
>  
>  always		:= $(dtb-y)
>  clean-files	:= *.dtb
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> new file mode 100644
> index 000000000000..a7474f5fcbcc
> --- /dev/null
> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> @@ -0,0 +1,42 @@
> +/dts-v1/;
> +
> +#include "tegra210.dtsi"
> +
> +/ {
> +	model = "Google Pixel C";
> +	compatible = "google,smaug-rev8", "google,smaug-rev7",
> +		     "google,smaug-rev6", "google,smaug-rev5",
> +		     "google,smaug-rev4", "google,smaug-rev3",
> +		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";

This looks a little funky. Is each revision a strict superset of the
previous version?

> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
> +	};

Use stdout-path.

Otherwise this looks ok.

Thanks,
Mark.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-06  9:46     ` Mark Rutland
@ 2016-01-06 12:49       ` Jon Hunter
  -1 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-06 12:49 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Rob Herring, Pawel Moll, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


On 06/01/16 09:46, Mark Rutland wrote:
> Hi,
> 
> On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
>> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
>> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
>>
>> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>>  2 files changed, 43 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>
>> diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
>> index a7e865da1005..0f7cdf3e05c1 100644
>> --- a/arch/arm64/boot/dts/nvidia/Makefile
>> +++ b/arch/arm64/boot/dts/nvidia/Makefile
>> @@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
>> +dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
>>  
>>  always		:= $(dtb-y)
>>  clean-files	:= *.dtb
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> new file mode 100644
>> index 000000000000..a7474f5fcbcc
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> @@ -0,0 +1,42 @@
>> +/dts-v1/;
>> +
>> +#include "tegra210.dtsi"
>> +
>> +/ {
>> +	model = "Google Pixel C";
>> +	compatible = "google,smaug-rev8", "google,smaug-rev7",
>> +		     "google,smaug-rev6", "google,smaug-rev5",
>> +		     "google,smaug-rev4", "google,smaug-rev3",
>> +		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";
> 
> This looks a little funky. Is each revision a strict superset of the
> previous version?

Yes this is based upon what Google have in the chromiumos branch [0] and
I have checked with them and they were ok with this.

Olof, let me know if you have any more comments here.

>> +
>> +	chosen {
>> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
>> +	};
> 
> Use stdout-path.

Ok.

> Otherwise this looks ok.

Cheers
Jon

[0]
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18/arch/arm64/boot/dts/tegra/tegra210-smaug-p1.dts

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-06 12:49       ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-06 12:49 UTC (permalink / raw)
  To: linux-arm-kernel


On 06/01/16 09:46, Mark Rutland wrote:
> Hi,
> 
> On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
>> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
>> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>>  2 files changed, 43 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>
>> diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
>> index a7e865da1005..0f7cdf3e05c1 100644
>> --- a/arch/arm64/boot/dts/nvidia/Makefile
>> +++ b/arch/arm64/boot/dts/nvidia/Makefile
>> @@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
>>  dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
>> +dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
>>  
>>  always		:= $(dtb-y)
>>  clean-files	:= *.dtb
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> new file mode 100644
>> index 000000000000..a7474f5fcbcc
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> @@ -0,0 +1,42 @@
>> +/dts-v1/;
>> +
>> +#include "tegra210.dtsi"
>> +
>> +/ {
>> +	model = "Google Pixel C";
>> +	compatible = "google,smaug-rev8", "google,smaug-rev7",
>> +		     "google,smaug-rev6", "google,smaug-rev5",
>> +		     "google,smaug-rev4", "google,smaug-rev3",
>> +		     "google,smaug-rev1", "google,smaug", "nvidia,tegra210";
> 
> This looks a little funky. Is each revision a strict superset of the
> previous version?

Yes this is based upon what Google have in the chromiumos branch [0] and
I have checked with them and they were ok with this.

Olof, let me know if you have any more comments here.

>> +
>> +	chosen {
>> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
>> +	};
> 
> Use stdout-path.

Ok.

> Otherwise this looks ok.

Cheers
Jon

[0]
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18/arch/arm64/boot/dts/tegra/tegra210-smaug-p1.dts

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-06 12:49       ` Jon Hunter
@ 2016-01-07 13:19           ` Jon Hunter
  -1 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 13:19 UTC (permalink / raw)
  To: Mark Rutland, Arnd Bergmann
  Cc: Rob Herring, Pawel Moll, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


On 06/01/16 12:49, Jon Hunter wrote: 
> On 06/01/16 09:46, Mark Rutland wrote:
>> Hi,
>>
>> On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
>>> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
>>> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
>>>
>>> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>> ---
>>>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>>>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>>>  2 files changed, 43 insertions(+)
>>>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts

[snip]

>>> +
>>> +	chosen {
>>> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
>>> +	};
>>
>> Use stdout-path.
> 
> Ok.

Adding Arnd.

Hmmm ... well apparently stdout-path does not work for tegra and in
order to make this work I had to do the following ...


[PATCH] serial: 8250: of: Add earlycon support for Tegra

Currently, early console support only works for Tegra when the serial
port information is passed via the earlycon boot parameter. If the
serial port information is specified via device-tree using the
"stdout-path" then the early console does not work because:

1. The tegra serial ports compatibility parameter does not match any
   of the supported serial drivers for early console.
2. The of_setup_earlycon() function assumes that serial port registers
   are byte aligned and for tegra they are 32-bit aligned.

Add an early console setup function for tegra so that the early console
can be specified via the device-tree "stdout-path" variable.

Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 33021c1f7d55..98adf83e83c2 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
 		udelay(1);
 	} while (1);
 }
+
+int __init tegra_earlycon_setup(struct earlycon_device *device,
+				const char *options)
+{
+	device->port.iotype = UPIO_MEM32;
+	device->port.regshift = 2;
+
+	return early_serial8250_setup(device, options);
+}
+OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
 #else
 static inline void tegra_serial_handle_break(struct uart_port *port)
 {


Arnd, does the above look ok, or should there be a generic
early_serial8250x32_setup() somewhere?

Cheers
Jon

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-07 13:19           ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 13:19 UTC (permalink / raw)
  To: linux-arm-kernel


On 06/01/16 12:49, Jon Hunter wrote: 
> On 06/01/16 09:46, Mark Rutland wrote:
>> Hi,
>>
>> On Wed, Jan 06, 2016 at 09:40:22AM +0000, Jon Hunter wrote:
>>> Add initial device-tree support for Google Pixel C (a.k.a. Smaug) based
>>> upon Tegra210 SoC with 3 GiB of LPDDR4 RAM.
>>>
>>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>>> ---
>>>  arch/arm64/boot/dts/nvidia/Makefile           |  1 +
>>>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 42 +++++++++++++++++++++++++++
>>>  2 files changed, 43 insertions(+)
>>>  create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts

[snip]

>>> +
>>> +	chosen {
>>> +		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x70006000";
>>> +	};
>>
>> Use stdout-path.
> 
> Ok.

Adding Arnd.

Hmmm ... well apparently stdout-path does not work for tegra and in
order to make this work I had to do the following ...


[PATCH] serial: 8250: of: Add earlycon support for Tegra

Currently, early console support only works for Tegra when the serial
port information is passed via the earlycon boot parameter. If the
serial port information is specified via device-tree using the
"stdout-path" then the early console does not work because:

1. The tegra serial ports compatibility parameter does not match any
   of the supported serial drivers for early console.
2. The of_setup_earlycon() function assumes that serial port registers
   are byte aligned and for tegra they are 32-bit aligned.

Add an early console setup function for tegra so that the early console
can be specified via the device-tree "stdout-path" variable.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 33021c1f7d55..98adf83e83c2 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
 		udelay(1);
 	} while (1);
 }
+
+int __init tegra_earlycon_setup(struct earlycon_device *device,
+				const char *options)
+{
+	device->port.iotype = UPIO_MEM32;
+	device->port.regshift = 2;
+
+	return early_serial8250_setup(device, options);
+}
+OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
 #else
 static inline void tegra_serial_handle_break(struct uart_port *port)
 {


Arnd, does the above look ok, or should there be a generic
early_serial8250x32_setup() somewhere?

Cheers
Jon

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-07 13:19           ` Jon Hunter
@ 2016-01-07 14:11               ` Arnd Bergmann
  -1 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2016-01-07 14:11 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Mark Rutland, Rob Herring, Pawel Moll, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
> 
> Adding Arnd.
> 
> Hmmm ... well apparently stdout-path does not work for tegra and in
> order to make this work I had to do the following ...
> 
> 
> [PATCH] serial: 8250: of: Add earlycon support for Tegra
> 
> Currently, early console support only works for Tegra when the serial
> port information is passed via the earlycon boot parameter. If the
> serial port information is specified via device-tree using the
> "stdout-path" then the early console does not work because:
> 
> 1. The tegra serial ports compatibility parameter does not match any
>    of the supported serial drivers for early console.
> 2. The of_setup_earlycon() function assumes that serial port registers
>    are byte aligned and for tegra they are 32-bit aligned.
> 
> Add an early console setup function for tegra so that the early console
> can be specified via the device-tree "stdout-path" variable.
> 
> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
> index 33021c1f7d55..98adf83e83c2 100644
> --- a/drivers/tty/serial/8250/8250_of.c
> +++ b/drivers/tty/serial/8250/8250_of.c
> @@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
>                 udelay(1);
>         } while (1);
>  }
> +
> +int __init tegra_earlycon_setup(struct earlycon_device *device,
> +                               const char *options)
> +{
> +       device->port.iotype = UPIO_MEM32;
> +       device->port.regshift = 2;
> +
> +       return early_serial8250_setup(device, options);
> +}
> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
>  #else
>  static inline void tegra_serial_handle_break(struct uart_port *port)
>  {
> 
> 
> Arnd, does the above look ok, or should there be a generic
> early_serial8250x32_setup() somewhere?

I think it would be better to put it into 8250_early.c rather than 
8250_of.c, as there are already some other definitions in there,
and the #ifdef CONFIG_TEGRA in 8250_of.c is for some other workaround.

Would it be possible to handle the "reg-io-width" parsing in
early_serial8250_setup instead of keying it off the string?

	Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-07 14:11               ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2016-01-07 14:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
> 
> Adding Arnd.
> 
> Hmmm ... well apparently stdout-path does not work for tegra and in
> order to make this work I had to do the following ...
> 
> 
> [PATCH] serial: 8250: of: Add earlycon support for Tegra
> 
> Currently, early console support only works for Tegra when the serial
> port information is passed via the earlycon boot parameter. If the
> serial port information is specified via device-tree using the
> "stdout-path" then the early console does not work because:
> 
> 1. The tegra serial ports compatibility parameter does not match any
>    of the supported serial drivers for early console.
> 2. The of_setup_earlycon() function assumes that serial port registers
>    are byte aligned and for tegra they are 32-bit aligned.
> 
> Add an early console setup function for tegra so that the early console
> can be specified via the device-tree "stdout-path" variable.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
> index 33021c1f7d55..98adf83e83c2 100644
> --- a/drivers/tty/serial/8250/8250_of.c
> +++ b/drivers/tty/serial/8250/8250_of.c
> @@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
>                 udelay(1);
>         } while (1);
>  }
> +
> +int __init tegra_earlycon_setup(struct earlycon_device *device,
> +                               const char *options)
> +{
> +       device->port.iotype = UPIO_MEM32;
> +       device->port.regshift = 2;
> +
> +       return early_serial8250_setup(device, options);
> +}
> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
>  #else
>  static inline void tegra_serial_handle_break(struct uart_port *port)
>  {
> 
> 
> Arnd, does the above look ok, or should there be a generic
> early_serial8250x32_setup() somewhere?

I think it would be better to put it into 8250_early.c rather than 
8250_of.c, as there are already some other definitions in there,
and the #ifdef CONFIG_TEGRA in 8250_of.c is for some other workaround.

Would it be possible to handle the "reg-io-width" parsing in
early_serial8250_setup instead of keying it off the string?

	Arnd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-07 14:11               ` Arnd Bergmann
@ 2016-01-07 16:53                 ` Jon Hunter
  -1 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 16:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, Rob Herring, Pawel Moll, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


On 07/01/16 14:11, Arnd Bergmann wrote:
> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
>>
>> Adding Arnd.
>>
>> Hmmm ... well apparently stdout-path does not work for tegra and in
>> order to make this work I had to do the following ...
>>
>>
>> [PATCH] serial: 8250: of: Add earlycon support for Tegra
>>
>> Currently, early console support only works for Tegra when the serial
>> port information is passed via the earlycon boot parameter. If the
>> serial port information is specified via device-tree using the
>> "stdout-path" then the early console does not work because:
>>
>> 1. The tegra serial ports compatibility parameter does not match any
>>    of the supported serial drivers for early console.
>> 2. The of_setup_earlycon() function assumes that serial port registers
>>    are byte aligned and for tegra they are 32-bit aligned.
>>
>> Add an early console setup function for tegra so that the early console
>> can be specified via the device-tree "stdout-path" variable.
>>
>> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>>  drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
>> index 33021c1f7d55..98adf83e83c2 100644
>> --- a/drivers/tty/serial/8250/8250_of.c
>> +++ b/drivers/tty/serial/8250/8250_of.c
>> @@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
>>                 udelay(1);
>>         } while (1);
>>  }
>> +
>> +int __init tegra_earlycon_setup(struct earlycon_device *device,
>> +                               const char *options)
>> +{
>> +       device->port.iotype = UPIO_MEM32;
>> +       device->port.regshift = 2;
>> +
>> +       return early_serial8250_setup(device, options);
>> +}
>> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
>>  #else
>>  static inline void tegra_serial_handle_break(struct uart_port *port)
>>  {
>>
>>
>> Arnd, does the above look ok, or should there be a generic
>> early_serial8250x32_setup() somewhere?
> 
> I think it would be better to put it into 8250_early.c rather than 
> 8250_of.c, as there are already some other definitions in there,
> and the #ifdef CONFIG_TEGRA in 8250_of.c is for some other workaround.

Ok so something like this ...

diff --git a/drivers/tty/serial/8250/8250_early.c
b/drivers/tty/serial/8250/8250_early.c
index af62131af21e..4ce6e2b57534 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
earlycon_device *device,
        device->con->write = early_serial8250_write;
        return 0;
 }
+
+int __init early_serial8250_mem32_setup(struct earlycon_device *device,
+                                       const char *options)
+{
+       device->port.iotype = UPIO_MEM32;
+       device->port.regshift = 2;
+
+       return early_serial8250_setup(device, options);
+}
 EARLYCON_DECLARE(uart8250, early_serial8250_setup);
 EARLYCON_DECLARE(uart, early_serial8250_setup);
 OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
 OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
+OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
+                   early_serial8250_mem32_setup);

> Would it be possible to handle the "reg-io-width" parsing in
> early_serial8250_setup instead of keying it off the string?

Good point. I spent a bit of time looking at this, but I cannot see an
easy way to do this unless we check for "reg-io-width" and "reg-shift"
in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
however, I am guessing that this would not be ideal as this would happen
for non-8250 devices. May be that would be ok, but I am not sure.

Cheers
Jon

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-07 16:53                 ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 16:53 UTC (permalink / raw)
  To: linux-arm-kernel


On 07/01/16 14:11, Arnd Bergmann wrote:
> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
>>
>> Adding Arnd.
>>
>> Hmmm ... well apparently stdout-path does not work for tegra and in
>> order to make this work I had to do the following ...
>>
>>
>> [PATCH] serial: 8250: of: Add earlycon support for Tegra
>>
>> Currently, early console support only works for Tegra when the serial
>> port information is passed via the earlycon boot parameter. If the
>> serial port information is specified via device-tree using the
>> "stdout-path" then the early console does not work because:
>>
>> 1. The tegra serial ports compatibility parameter does not match any
>>    of the supported serial drivers for early console.
>> 2. The of_setup_earlycon() function assumes that serial port registers
>>    are byte aligned and for tegra they are 32-bit aligned.
>>
>> Add an early console setup function for tegra so that the early console
>> can be specified via the device-tree "stdout-path" variable.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>  drivers/tty/serial/8250/8250_of.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
>> index 33021c1f7d55..98adf83e83c2 100644
>> --- a/drivers/tty/serial/8250/8250_of.c
>> +++ b/drivers/tty/serial/8250/8250_of.c
>> @@ -44,6 +44,16 @@ void tegra_serial_handle_break(struct uart_port *p)
>>                 udelay(1);
>>         } while (1);
>>  }
>> +
>> +int __init tegra_earlycon_setup(struct earlycon_device *device,
>> +                               const char *options)
>> +{
>> +       device->port.iotype = UPIO_MEM32;
>> +       device->port.regshift = 2;
>> +
>> +       return early_serial8250_setup(device, options);
>> +}
>> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart", tegra_earlycon_setup);
>>  #else
>>  static inline void tegra_serial_handle_break(struct uart_port *port)
>>  {
>>
>>
>> Arnd, does the above look ok, or should there be a generic
>> early_serial8250x32_setup() somewhere?
> 
> I think it would be better to put it into 8250_early.c rather than 
> 8250_of.c, as there are already some other definitions in there,
> and the #ifdef CONFIG_TEGRA in 8250_of.c is for some other workaround.

Ok so something like this ...

diff --git a/drivers/tty/serial/8250/8250_early.c
b/drivers/tty/serial/8250/8250_early.c
index af62131af21e..4ce6e2b57534 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
earlycon_device *device,
        device->con->write = early_serial8250_write;
        return 0;
 }
+
+int __init early_serial8250_mem32_setup(struct earlycon_device *device,
+                                       const char *options)
+{
+       device->port.iotype = UPIO_MEM32;
+       device->port.regshift = 2;
+
+       return early_serial8250_setup(device, options);
+}
 EARLYCON_DECLARE(uart8250, early_serial8250_setup);
 EARLYCON_DECLARE(uart, early_serial8250_setup);
 OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
 OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
+OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
+                   early_serial8250_mem32_setup);

> Would it be possible to handle the "reg-io-width" parsing in
> early_serial8250_setup instead of keying it off the string?

Good point. I spent a bit of time looking at this, but I cannot see an
easy way to do this unless we check for "reg-io-width" and "reg-shift"
in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
however, I am guessing that this would not be ideal as this would happen
for non-8250 devices. May be that would be ok, but I am not sure.

Cheers
Jon

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-07 16:53                 ` Jon Hunter
@ 2016-01-07 17:20                     ` Rob Herring
  -1 siblings, 0 replies; 16+ messages in thread
From: Rob Herring @ 2016-01-07 17:20 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Arnd Bergmann, Mark Rutland, Pawel Moll, Ian Campbell,
	Kumar Gala, Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Thu, Jan 7, 2016 at 10:53 AM, Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>
> On 07/01/16 14:11, Arnd Bergmann wrote:
>> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:

[...]

> Ok so something like this ...
>
> diff --git a/drivers/tty/serial/8250/8250_early.c
> b/drivers/tty/serial/8250/8250_early.c
> index af62131af21e..4ce6e2b57534 100644
> --- a/drivers/tty/serial/8250/8250_early.c
> +++ b/drivers/tty/serial/8250/8250_early.c
> @@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
> earlycon_device *device,
>         device->con->write = early_serial8250_write;
>         return 0;
>  }
> +
> +int __init early_serial8250_mem32_setup(struct earlycon_device *device,
> +                                       const char *options)
> +{
> +       device->port.iotype = UPIO_MEM32;
> +       device->port.regshift = 2;
> +
> +       return early_serial8250_setup(device, options);
> +}
>  EARLYCON_DECLARE(uart8250, early_serial8250_setup);
>  EARLYCON_DECLARE(uart, early_serial8250_setup);
>  OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
>  OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
> +                   early_serial8250_mem32_setup);
>
>> Would it be possible to handle the "reg-io-width" parsing in
>> early_serial8250_setup instead of keying it off the string?
>
> Good point. I spent a bit of time looking at this, but I cannot see an
> easy way to do this unless we check for "reg-io-width" and "reg-shift"
> in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
> however, I am guessing that this would not be ideal as this would happen
> for non-8250 devices. May be that would be ok, but I am not sure.

There's been one attempt[1] already. It had a few issues easily
solved, but I haven't seen a follow-up.

Rob

[1] https://lkml.org/lkml/2015/11/30/513

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-07 17:20                     ` Rob Herring
  0 siblings, 0 replies; 16+ messages in thread
From: Rob Herring @ 2016-01-07 17:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 7, 2016 at 10:53 AM, Jon Hunter <jonathanh@nvidia.com> wrote:
>
> On 07/01/16 14:11, Arnd Bergmann wrote:
>> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:

[...]

> Ok so something like this ...
>
> diff --git a/drivers/tty/serial/8250/8250_early.c
> b/drivers/tty/serial/8250/8250_early.c
> index af62131af21e..4ce6e2b57534 100644
> --- a/drivers/tty/serial/8250/8250_early.c
> +++ b/drivers/tty/serial/8250/8250_early.c
> @@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
> earlycon_device *device,
>         device->con->write = early_serial8250_write;
>         return 0;
>  }
> +
> +int __init early_serial8250_mem32_setup(struct earlycon_device *device,
> +                                       const char *options)
> +{
> +       device->port.iotype = UPIO_MEM32;
> +       device->port.regshift = 2;
> +
> +       return early_serial8250_setup(device, options);
> +}
>  EARLYCON_DECLARE(uart8250, early_serial8250_setup);
>  EARLYCON_DECLARE(uart, early_serial8250_setup);
>  OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
>  OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
> +                   early_serial8250_mem32_setup);
>
>> Would it be possible to handle the "reg-io-width" parsing in
>> early_serial8250_setup instead of keying it off the string?
>
> Good point. I spent a bit of time looking at this, but I cannot see an
> easy way to do this unless we check for "reg-io-width" and "reg-shift"
> in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
> however, I am guessing that this would not be ideal as this would happen
> for non-8250 devices. May be that would be ok, but I am not sure.

There's been one attempt[1] already. It had a few issues easily
solved, but I haven't seen a follow-up.

Rob

[1] https://lkml.org/lkml/2015/11/30/513

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] ARM64: tegra: Add support for Google Pixel C
  2016-01-07 17:20                     ` Rob Herring
@ 2016-01-07 18:00                         ` Jon Hunter
  -1 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 18:00 UTC (permalink / raw)
  To: Rob Herring, paul.burton-1AXoQHu6uovQT0dZR+AlfA
  Cc: Arnd Bergmann, Mark Rutland, Pawel Moll, Ian Campbell,
	Kumar Gala, Stephen Warren, Thierry Reding, Alexandre Courbot,
	Olof Johansson,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


On 07/01/16 17:20, Rob Herring wrote:
> On Thu, Jan 7, 2016 at 10:53 AM, Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>>
>> On 07/01/16 14:11, Arnd Bergmann wrote:
>>> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
> 
> [...]
> 
>> Ok so something like this ...
>>
>> diff --git a/drivers/tty/serial/8250/8250_early.c
>> b/drivers/tty/serial/8250/8250_early.c
>> index af62131af21e..4ce6e2b57534 100644
>> --- a/drivers/tty/serial/8250/8250_early.c
>> +++ b/drivers/tty/serial/8250/8250_early.c
>> @@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
>> earlycon_device *device,
>>         device->con->write = early_serial8250_write;
>>         return 0;
>>  }
>> +
>> +int __init early_serial8250_mem32_setup(struct earlycon_device *device,
>> +                                       const char *options)
>> +{
>> +       device->port.iotype = UPIO_MEM32;
>> +       device->port.regshift = 2;
>> +
>> +       return early_serial8250_setup(device, options);
>> +}
>>  EARLYCON_DECLARE(uart8250, early_serial8250_setup);
>>  EARLYCON_DECLARE(uart, early_serial8250_setup);
>>  OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
>>  OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
>> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
>> +                   early_serial8250_mem32_setup);
>>
>>> Would it be possible to handle the "reg-io-width" parsing in
>>> early_serial8250_setup instead of keying it off the string?
>>
>> Good point. I spent a bit of time looking at this, but I cannot see an
>> easy way to do this unless we check for "reg-io-width" and "reg-shift"
>> in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
>> however, I am guessing that this would not be ideal as this would happen
>> for non-8250 devices. May be that would be ok, but I am not sure.
> 
> There's been one attempt[1] already. It had a few issues easily
> solved, but I haven't seen a follow-up.

Thanks. Adding Paul.

Paul, are you planning a follow-up to your patch? Otherwise, I am happy
to have crack at it. Don't we also need to read the "reg-shift"?

Cheers
Jon

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] ARM64: tegra: Add support for Google Pixel C
@ 2016-01-07 18:00                         ` Jon Hunter
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Hunter @ 2016-01-07 18:00 UTC (permalink / raw)
  To: linux-arm-kernel


On 07/01/16 17:20, Rob Herring wrote:
> On Thu, Jan 7, 2016 at 10:53 AM, Jon Hunter <jonathanh@nvidia.com> wrote:
>>
>> On 07/01/16 14:11, Arnd Bergmann wrote:
>>> On Thursday 07 January 2016 13:19:44 Jon Hunter wrote:
> 
> [...]
> 
>> Ok so something like this ...
>>
>> diff --git a/drivers/tty/serial/8250/8250_early.c
>> b/drivers/tty/serial/8250/8250_early.c
>> index af62131af21e..4ce6e2b57534 100644
>> --- a/drivers/tty/serial/8250/8250_early.c
>> +++ b/drivers/tty/serial/8250/8250_early.c
>> @@ -141,7 +141,18 @@ int __init early_serial8250_setup(struct
>> earlycon_device *device,
>>         device->con->write = early_serial8250_write;
>>         return 0;
>>  }
>> +
>> +int __init early_serial8250_mem32_setup(struct earlycon_device *device,
>> +                                       const char *options)
>> +{
>> +       device->port.iotype = UPIO_MEM32;
>> +       device->port.regshift = 2;
>> +
>> +       return early_serial8250_setup(device, options);
>> +}
>>  EARLYCON_DECLARE(uart8250, early_serial8250_setup);
>>  EARLYCON_DECLARE(uart, early_serial8250_setup);
>>  OF_EARLYCON_DECLARE(ns16550, "ns16550", early_serial8250_setup);
>>  OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
>> +OF_EARLYCON_DECLARE(tegra20_uart, "nvidia,tegra20-uart",
>> +                   early_serial8250_mem32_setup);
>>
>>> Would it be possible to handle the "reg-io-width" parsing in
>>> early_serial8250_setup instead of keying it off the string?
>>
>> Good point. I spent a bit of time looking at this, but I cannot see an
>> easy way to do this unless we check for "reg-io-width" and "reg-shift"
>> in early_init_dt_scan_chosen_serial() and pass to of_setup_earlycon(),
>> however, I am guessing that this would not be ideal as this would happen
>> for non-8250 devices. May be that would be ok, but I am not sure.
> 
> There's been one attempt[1] already. It had a few issues easily
> solved, but I haven't seen a follow-up.

Thanks. Adding Paul.

Paul, are you planning a follow-up to your patch? Otherwise, I am happy
to have crack at it. Don't we also need to read the "reg-shift"?

Cheers
Jon

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-01-07 18:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06  9:40 [PATCH] ARM64: tegra: Add support for Google Pixel C Jon Hunter
2016-01-06  9:40 ` Jon Hunter
     [not found] ` <1452073222-2956-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-06  9:46   ` Mark Rutland
2016-01-06  9:46     ` Mark Rutland
2016-01-06 12:49     ` Jon Hunter
2016-01-06 12:49       ` Jon Hunter
     [not found]       ` <568D0D70.4020309-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-07 13:19         ` Jon Hunter
2016-01-07 13:19           ` Jon Hunter
     [not found]           ` <568E65F0.2070201-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-07 14:11             ` Arnd Bergmann
2016-01-07 14:11               ` Arnd Bergmann
2016-01-07 16:53               ` Jon Hunter
2016-01-07 16:53                 ` Jon Hunter
     [not found]                 ` <568E9804.5020503-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-07 17:20                   ` Rob Herring
2016-01-07 17:20                     ` Rob Herring
     [not found]                     ` <CAL_Jsq++DkgJA--40YBqGZd5BJFkzXfKt_st1kN+ZiVY7yb8OA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-07 18:00                       ` Jon Hunter
2016-01-07 18:00                         ` Jon Hunter

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.