Peter De Schrijver | 17 Nov 17:19
Favicon

[PATCH v5 00/10] Add support for tegra30 and cardhu

This patchset adds support for the tegra30 SoC and the cardhu development
board.

Pathset is on top of Will Deacon's ARM reset work, my patch to convert tegra20
to GIC devicetree binding and my patch to make clk_get not fatal.

Most important changes in v5:

* use devicetree binding for GIC
* define a seperate machine for tegra30
* add documentation for tegra devicetree compatible definitions

Most important changes in v4:

* cleanup clock code to work on multiple tegra variants
* added dependencies to avoid building tegra20 only code for tegra30

Most important changes in v3:

* align with ARM restart rework. might need a bit of rework to merge with the
  latest version of this.
* minor cleanups and reformats

Most important changes in v2:

* account for arch_reset cleanup
* seperate patch for renaming pinmux-t2.h and pinmux-t2-tables.c
* fixed bug in common cache initialization
* fixed compatibility with non DT boards (boottested on harmony)
* improved commit messages
(Continue reading)

Peter De Schrijver | 17 Nov 17:19
Favicon

[PATCH 07/10] arm/tegra: add new fields to struct tegra_pingroup_desc

Add new fields to struct tegra_pingroup_desc to support new hardware features
introduced in the tegra30 SoC. The pinmux driver won't use those fields yet,
but the tegra30 pinmux tables will already provide the necessary data.

Signed-off-by: Peter De Schrijver <pdeschrijver <at> nvidia.com>
---
 arch/arm/mach-tegra/include/mach/pinmux.h   |   10 ++++++++++
 arch/arm/mach-tegra/pinmux-tegra20-tables.c |    4 ++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/pinmux.h b/arch/arm/mach-tegra/include/mach/pinmux.h
index 35999ce..988c6c5 100644
--- a/arch/arm/mach-tegra/include/mach/pinmux.h
+++ b/arch/arm/mach-tegra/include/mach/pinmux.h
@@ -2,6 +2,7 @@
  * linux/arch/arm/mach-tegra/include/mach/pinmux.h
  *
  * Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2010,2011 Nvidia, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -99,6 +100,11 @@ enum tegra_tristate {
 	TEGRA_TRI_TRISTATE = 1,
 };

+enum tegra_pin_io {
+	TEGRA_PIN_OUTPUT = 0,
+	TEGRA_PIN_INPUT = 1,
+};
(Continue reading)

Peter De Schrijver | 17 Nov 17:19
Favicon

[PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

Rework the tegra20 clock code to support multiple tegra variants :

 * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
   functionality should be in clock.c.
 * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
   be available in future variants.
 * don't export clk_measure_input_freq as its functionality is also available
   using clk_get_rate().

Signed-off-by: Peter De Schrijver <pdeschrijver@...>
---
 arch/arm/mach-tegra/clock.c         |   14 +++++++++-----
 arch/arm/mach-tegra/clock.h         |    3 ---
 arch/arm/mach-tegra/tegra2_clocks.c |   14 +-------------
 arch/arm/mach-tegra/timer.c         |   12 ++++++++----
 4 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index f8d41ff..47f6366 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -387,13 +387,15 @@ EXPORT_SYMBOL(tegra_clk_init_from_table);

 void tegra_periph_reset_deassert(struct clk *c)
 {
-	tegra2_periph_reset_deassert(c);
+	BUG_ON(!c->ops->reset);
+	c->ops->reset(c, false);
 }
 EXPORT_SYMBOL(tegra_periph_reset_deassert);
(Continue reading)

Olof Johansson | 18 Nov 20:06

Re: [PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

Hi,

A nit and two comments below.

On Thu, Nov 17, 2011 at 06:19:17PM +0200, Peter De Schrijver wrote:
> Rework the tegra20 clock code to support multiple tegra variants :
> 
>  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
>    functionality should be in clock.c.
>  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
>    be available in future variants.
>  * don't export clk_measure_input_freq as its functionality is also available
>    using clk_get_rate().
> 
> Signed-off-by: Peter De Schrijver <pdeschrijver@...>
> ---
>  arch/arm/mach-tegra/clock.c         |   14 +++++++++-----
>  arch/arm/mach-tegra/clock.h         |    3 ---
>  arch/arm/mach-tegra/tegra2_clocks.c |   14 +-------------
>  arch/arm/mach-tegra/timer.c         |   12 ++++++++----
>  4 files changed, 18 insertions(+), 25 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
> index f8d41ff..47f6366 100644
> --- a/arch/arm/mach-tegra/clock.c
> +++ b/arch/arm/mach-tegra/clock.c
> @@ -387,13 +387,15 @@ EXPORT_SYMBOL(tegra_clk_init_from_table);
>  
>  void tegra_periph_reset_deassert(struct clk *c)
>  {
(Continue reading)

Stephen Warren | 18 Nov 21:18
Favicon

RE: [PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

Olof Johansson wrote at Friday, November 18, 2011 12:07 PM:
> On Thu, Nov 17, 2011 at 06:19:17PM +0200, Peter De Schrijver wrote:
> > Rework the tegra20 clock code to support multiple tegra variants :
> >
> >  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
> >    functionality should be in clock.c.
> >  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
> >    be available in future variants.
> >  * don't export clk_measure_input_freq as its functionality is also available
> >    using clk_get_rate().
...
> > @@ -403,10 +405,11 @@ void __init tegra_init_clock(void)
> >  }
> >
> >  /*
> > - * The SDMMC controllers have extra bits in the clock source register that
> > - * adjust the delay between the clock and data to compenstate for delays
> > - * on the PCB.
> > + * The SDMMC controllers on tegra20 have extra bits in the clock source
> > + * register that adjust the delay between the clock and data to compenstate
> > + * for delays on the PCB.
> >   */
> > +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> >  void tegra_sdmmc_tap_delay(struct clk *c, int delay)
> >  {
> >  	unsigned long flags;
> > @@ -415,6 +418,7 @@ void tegra_sdmmc_tap_delay(struct clk *c, int delay)
> >  	tegra2_sdmmc_tap_delay(c, delay);
> >  	spin_unlock_irqrestore(&c->spinlock, flags);
> >  }
(Continue reading)

Olof Johansson | 18 Nov 22:25

Re: [PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

On Fri, Nov 18, 2011 at 12:18 PM, Stephen Warren <swarren <at> nvidia.com> wrote:
> Olof Johansson wrote at Friday, November 18, 2011 12:07 PM:
>> On Thu, Nov 17, 2011 at 06:19:17PM +0200, Peter De Schrijver wrote:
>> > Rework the tegra20 clock code to support multiple tegra variants :
>> >
>> >  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
>> >    functionality should be in clock.c.
>> >  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
>> >    be available in future variants.
>> >  * don't export clk_measure_input_freq as its functionality is also available
>> >    using clk_get_rate().
> ...
>> > @@ -403,10 +405,11 @@ void __init tegra_init_clock(void)
>> >  }
>> >
>> >  /*
>> > - * The SDMMC controllers have extra bits in the clock source register that
>> > - * adjust the delay between the clock and data to compenstate for delays
>> > - * on the PCB.
>> > + * The SDMMC controllers on tegra20 have extra bits in the clock source
>> > + * register that adjust the delay between the clock and data to compenstate
>> > + * for delays on the PCB.
>> >   */
>> > +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>> >  void tegra_sdmmc_tap_delay(struct clk *c, int delay)
>> >  {
>> >     unsigned long flags;
>> > @@ -415,6 +418,7 @@ void tegra_sdmmc_tap_delay(struct clk *c, int delay)
>> >     tegra2_sdmmc_tap_delay(c, delay);
>> >     spin_unlock_irqrestore(&c->spinlock, flags);
(Continue reading)

Stephen Warren | 18 Nov 22:38
Favicon

RE: [PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

Olof Johansson wrote at Friday, November 18, 2011 2:25 PM:
> On Fri, Nov 18, 2011 at 12:18 PM, Stephen Warren <swarren@...> wrote:
> > Olof Johansson wrote at Friday, November 18, 2011 12:07 PM:
> >> On Thu, Nov 17, 2011 at 06:19:17PM +0200, Peter De Schrijver wrote:
...
> >> >  void tegra_sdmmc_tap_delay(struct clk *c, int delay)
...
> > I vote just rip this function out altogether.
> >
> > It isn't used in mainline, chromeos-2.6.38, chromeos-3.0, nor our internal
> > 2.6.36 or 2.6.39 kernels.
...
> 
> Actually, it used on some of the chromeos platforms, in particular for...

Oh yes, you're right. I'd grep'd for tegra2_sdmmc_tap_delay instead of
tegra_sdmmc_tap_delay, and saw hits in the clock code so didn't figure I'd
grep'd for the wrong thing.

--

-- 
nvpublic

Peter De Schrijver | 21 Nov 13:44
Favicon

Re: [PATCH 03/10] arm/tegra: prepare clock code for multiple tegra variants

On Fri, Nov 18, 2011 at 08:06:49PM +0100, Olof Johansson wrote:
> Hi,
> 
> A nit and two comments below.
> 
> On Thu, Nov 17, 2011 at 06:19:17PM +0200, Peter De Schrijver wrote:
> > Rework the tegra20 clock code to support multiple tegra variants :
> > 
> >  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
> >    functionality should be in clock.c.
> >  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
> >    be available in future variants.
> >  * don't export clk_measure_input_freq as its functionality is also available
> >    using clk_get_rate().
> > 
> > Signed-off-by: Peter De Schrijver <pdeschrijver <at> nvidia.com>
> > ---
> >  arch/arm/mach-tegra/clock.c         |   14 +++++++++-----
> >  arch/arm/mach-tegra/clock.h         |    3 ---
> >  arch/arm/mach-tegra/tegra2_clocks.c |   14 +-------------
> >  arch/arm/mach-tegra/timer.c         |   12 ++++++++----
> >  4 files changed, 18 insertions(+), 25 deletions(-)
> > 
> > diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
> > index f8d41ff..47f6366 100644
> > --- a/arch/arm/mach-tegra/clock.c
> > +++ b/arch/arm/mach-tegra/clock.c
> > @@ -387,13 +387,15 @@ EXPORT_SYMBOL(tegra_clk_init_from_table);
> >  
> >  void tegra_periph_reset_deassert(struct clk *c)
(Continue reading)

Peter De Schrijver | 17 Nov 17:19
Favicon

[PATCH 01/10] arm/tegra: initial device tree for tegra30

This patch adds the initial device tree for tegra30

Signed-off-by: Peter De Schrijver <pdeschrijver <at> nvidia.com>
---
 Documentation/devicetree/bindings/arm/tegra.txt |   18 +++
 arch/arm/boot/dts/tegra30.dtsi                  |  128 +++++++++++++++++++++++
 2 files changed, 146 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/tegra.txt
 create mode 100644 arch/arm/boot/dts/tegra30.dtsi

diff --git a/Documentation/devicetree/bindings/arm/tegra.txt b/Documentation/devicetree/bindings/arm/tegra.txt
new file mode 100644
index 0000000..0e696d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/tegra.txt
@@ -0,0 +1,18 @@
+NVIDIA Tegra platforms device tree bindings
+-------------------------------------------
+
+* harmony: tegra20 based development board
+Required root node properties:
+ - compatible = "nvidia,harmony", "nvidia,tegra20";
+
+* seaboard: tegra20 based clamshell reference design
+Required root node properties:
+ - compatible = "nvidia,seaboard", "nvidia,tegra20";
+
+* ventana: tegra20 based tablet reference design
+Required root node properties:
+ - compatible = "nvidia,ventana", "nvidia,tegra20";
(Continue reading)

Stephen Warren | 17 Nov 20:39
Favicon

RE: [PATCH 01/10] arm/tegra: initial device tree for tegra30

Peter De Schrijver wrote at Thursday, November 17, 2011 9:19 AM:
> This patch adds the initial device tree for tegra30

> diff --git a/Documentation/devicetree/bindings/arm/tegra.txt
...
> +* harmony: tegra20 based development board
> +Required root node properties:
> + - compatible = "nvidia,harmony", "nvidia,tegra20";
> +
> +* seaboard: tegra20 based clamshell reference design
> +Required root node properties:
> + - compatible = "nvidia,seaboard", "nvidia,tegra20";

Do we really want to list all the board names here? In the future, there
could be tens or hundreds. I would argue that we should just document
nvidia,tegra20 and nvidia,tegra30.

At a later point, we should fix board-dt.c to solely look for those
compatible values, although this will have to wait until the pinmux DT
bindings are present. Then, the kernel won't care about the board names.

--

-- 
nvpublic

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Olof Johansson | 18 Nov 19:49

Re: [PATCH 01/10] arm/tegra: initial device tree for tegra30

On Thu, Nov 17, 2011 at 11:39:14AM -0800, Stephen Warren wrote:
> Peter De Schrijver wrote at Thursday, November 17, 2011 9:19 AM:
> > This patch adds the initial device tree for tegra30
> 
> > diff --git a/Documentation/devicetree/bindings/arm/tegra.txt
> ...
> > +* harmony: tegra20 based development board
> > +Required root node properties:
> > + - compatible = "nvidia,harmony", "nvidia,tegra20";
> > +
> > +* seaboard: tegra20 based clamshell reference design
> > +Required root node properties:
> > + - compatible = "nvidia,seaboard", "nvidia,tegra20";
> 
> Do we really want to list all the board names here? In the future, there
> could be tens or hundreds. I would argue that we should just document
> nvidia,tegra20 and nvidia,tegra30.

Agreed.

> At a later point, we should fix board-dt.c to solely look for those
> compatible values, although this will have to wait until the pinmux DT
> bindings are present. Then, the kernel won't care about the board names.

Exactly.

-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Rob Herring | 18 Nov 20:30
Picon

Re: [PATCH 01/10] arm/tegra: initial device tree for tegra30

On 11/18/2011 12:49 PM, Olof Johansson wrote:
> On Thu, Nov 17, 2011 at 11:39:14AM -0800, Stephen Warren wrote:
>> Peter De Schrijver wrote at Thursday, November 17, 2011 9:19 AM:
>>> This patch adds the initial device tree for tegra30
>>
>>> diff --git a/Documentation/devicetree/bindings/arm/tegra.txt
>> ...
>>> +* harmony: tegra20 based development board
>>> +Required root node properties:
>>> + - compatible = "nvidia,harmony", "nvidia,tegra20";
>>> +
>>> +* seaboard: tegra20 based clamshell reference design
>>> +Required root node properties:
>>> + - compatible = "nvidia,seaboard", "nvidia,tegra20";
>>
>> Do we really want to list all the board names here? In the future, there
>> could be tens or hundreds. I would argue that we should just document
>> nvidia,tegra20 and nvidia,tegra30.
> 
> Agreed.

It's not really any different than mach-types which does have every
board in it.

I think if a board requires a new dts, then it needs a unique name.

> 
>> At a later point, we should fix board-dt.c to solely look for those
>> compatible values, although this will have to wait until the pinmux DT
>> bindings are present. Then, the kernel won't care about the board names.
(Continue reading)

Olof Johansson | 18 Nov 22:48

Re: [PATCH 01/10] arm/tegra: initial device tree for tegra30

On Fri, Nov 18, 2011 at 11:30 AM, Rob Herring <robherring2@...> wrote:
> On 11/18/2011 12:49 PM, Olof Johansson wrote:
>> On Thu, Nov 17, 2011 at 11:39:14AM -0800, Stephen Warren wrote:
>>> Peter De Schrijver wrote at Thursday, November 17, 2011 9:19 AM:
>>>> This patch adds the initial device tree for tegra30
>>>
>>>> diff --git a/Documentation/devicetree/bindings/arm/tegra.txt
>>> ...
>>>> +* harmony: tegra20 based development board
>>>> +Required root node properties:
>>>> + - compatible = "nvidia,harmony", "nvidia,tegra20";
>>>> +
>>>> +* seaboard: tegra20 based clamshell reference design
>>>> +Required root node properties:
>>>> + - compatible = "nvidia,seaboard", "nvidia,tegra20";
>>>
>>> Do we really want to list all the board names here? In the future, there
>>> could be tens or hundreds. I would argue that we should just document
>>> nvidia,tegra20 and nvidia,tegra30.
>>
>> Agreed.
>
> It's not really any different than mach-types which does have every
> board in it.

Yeah, and the whole idea of having device trees is to not have to do
code changes when introducing a new derivative board. So enumerating
all supported boards in the documentation means we're back to an
equivalence to having to add machine ids.

(Continue reading)

Rob Herring | 18 Nov 23:03
Picon

Re: [PATCH 01/10] arm/tegra: initial device tree for tegra30

On 11/18/2011 03:48 PM, Olof Johansson wrote:
> On Fri, Nov 18, 2011 at 11:30 AM, Rob Herring <robherring2 <at> gmail.com> wrote:
>> On 11/18/2011 12:49 PM, Olof Johansson wrote:
>>> On Thu, Nov 17, 2011 at 11:39:14AM -0800, Stephen Warren wrote:
>>>> Peter De Schrijver wrote at Thursday, November 17, 2011 9:19 AM:
>>>>> This patch adds the initial device tree for tegra30
>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/arm/tegra.txt
>>>> ...
>>>>> +* harmony: tegra20 based development board
>>>>> +Required root node properties:
>>>>> + - compatible = "nvidia,harmony", "nvidia,tegra20";
>>>>> +
>>>>> +* seaboard: tegra20 based clamshell reference design
>>>>> +Required root node properties:
>>>>> + - compatible = "nvidia,seaboard", "nvidia,tegra20";
>>>>
>>>> Do we really want to list all the board names here? In the future, there
>>>> could be tens or hundreds. I would argue that we should just document
>>>> nvidia,tegra20 and nvidia,tegra30.
>>>
>>> Agreed.
>>
>> It's not really any different than mach-types which does have every
>> board in it.
> 
> Yeah, and the whole idea of having device trees is to not have to do
> code changes when introducing a new derivative board. So enumerating
> all supported boards in the documentation means we're back to an
> equivalence to having to add machine ids.
(Continue reading)

Peter De Schrijver | 17 Nov 17:19
Favicon

[PATCH 02/10] arm/tegra: cleanup tegra20 support

* add a dependency to ARCH_TEGRA_2x_SOC in Kconfig to all tegra20 based boards
  and TEGRA_PCI
* make powergating dependent on ARCH_TEGRA_2x_SOC
* remove dependency on ARCH_TEGRA_2x_SOC for clock.c

Signed-off-by: Peter De Schrijver <pdeschrijver <at> nvidia.com>
---
 arch/arm/mach-tegra/Kconfig  |    8 ++++++++
 arch/arm/mach-tegra/Makefile |    3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 91aff7c..2b1d49b 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -21,18 +21,21 @@ endchoice

 config TEGRA_PCI
 	bool "PCI Express support"
+	depends on ARCH_TEGRA_2x_SOC
 	select PCI

 comment "Tegra board type"

 config MACH_HARMONY
        bool "Harmony board"
+       depends on ARCH_TEGRA_2x_SOC
        select MACH_HAS_SND_SOC_TEGRA_WM8903 if SND_SOC
        help
          Support for nVidia Harmony development platform
(Continue reading)

Peter De Schrijver | 17 Nov 17:49
Favicon

Re: [PATCH v5 00/10] Add support for tegra30 and cardhu

On Thu, Nov 17, 2011 at 05:19:14PM +0100, Peter De Schrijver wrote:
> This patchset adds support for the tegra30 SoC and the cardhu development
> board.
> 
> Pathset is on top of Will Deacon's ARM reset work, my patch to convert tegra20
> to GIC devicetree binding and my patch to make clk_get not fatal.
> 

I just noticed the clk_get not fatal patch is already in linux-next.

Cheers,

Peter.

Gmane