[U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-05 Thread Tom Warren
All based off of Tegra124. As a Tegra210 board is brought
up, these may change a bit to match the HW more closely,
but probably 90% of this is identical to T124.

Signed-off-by: Tom Warren 
---
 arch/arm/include/asm/arch-tegra210/ahb.h  |   91 ++
 arch/arm/include/asm/arch-tegra210/clock-tables.h |  566 +++
 arch/arm/include/asm/arch-tegra210/clock.h|   27 +
 arch/arm/include/asm/arch-tegra210/flow.h |   45 +
 arch/arm/include/asm/arch-tegra210/funcmux.h  |   23 +
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h   |   74 ++
 arch/arm/include/asm/arch-tegra210/gpio.h |  303 ++
 arch/arm/include/asm/arch-tegra210/hardware.h |   16 +
 arch/arm/include/asm/arch-tegra210/mc.h   |   72 ++
 arch/arm/include/asm/arch-tegra210/pmu.h  |   14 +
 arch/arm/include/asm/arch-tegra210/powergate.h|   12 +
 arch/arm/include/asm/arch-tegra210/sysctr.h   |   26 +
 arch/arm/include/asm/arch-tegra210/tegra.h|   32 +
 arch/arm/mach-tegra/tegra210/Kconfig  |   11 +
 arch/arm/mach-tegra/tegra210/Makefile |   13 +
 arch/arm/mach-tegra/tegra210/clock.c  | 1086 +
 arch/arm/mach-tegra/tegra210/cpu.c|  328 +++
 arch/arm/mach-tegra/tegra210/funcmux.c|   71 ++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c|  494 ++
 include/dt-bindings/clock/tegra210-car.h  |  342 +++
 20 files changed, 3646 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-tegra210/ahb.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/hardware.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/mc.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/tegra.h
 create mode 100644 arch/arm/mach-tegra/tegra210/Kconfig
 create mode 100644 arch/arm/mach-tegra/tegra210/Makefile
 create mode 100644 arch/arm/mach-tegra/tegra210/clock.c
 create mode 100644 arch/arm/mach-tegra/tegra210/cpu.c
 create mode 100644 arch/arm/mach-tegra/tegra210/funcmux.c
 create mode 100644 arch/arm/mach-tegra/tegra210/xusb-padctl.c
 create mode 100644 include/dt-bindings/clock/tegra210-car.h

diff --git a/arch/arm/include/asm/arch-tegra210/ahb.h 
b/arch/arm/include/asm/arch-tegra210/ahb.h
new file mode 100644
index 000..3a37af4
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra210/ahb.h
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _TEGRA210_AHB_H_
+#define _TEGRA210_AHB_H_
+
+struct ahb_ctlr {
+   u32 reserved0;  /* 00h */
+   u32 arbitration_disable;/* _ARBITRATION_DISABLE_0,  04h */
+   u32 arbitration_priority_ctrl;  /* _ARBITRATION_PRIORITY_CTRL_0,08h */
+   u32 arbitration_usr_protect;/* _ARBITRATION_USR_PROTECT_0,  0ch */
+   u32 gizmo_ahb_mem;  /* _GIZMO_AHB_MEM_0,10h */
+   u32 gizmo_apb_dma;  /* _GIZMO_APB_DMA_0,14h */
+   u32 reserved6[2];   /* 18h, 1ch */
+   u32 gizmo_usb;  /* _GIZMO_USB_0,20h */
+   u32 gizmo_ahb_xbar_bridge;  /* _GIZMO_AHB_XBAR_BRIDGE_0,24h */
+   u32 gizmo_cpu_ahb_bridge;   /* _GIZMO_CPU_AHB_BRIDGE_0, 28h */
+   u32 gizmo_cop_ahb_bridge;   /* _GIZMO_COP_AHB_BRIDGE_0, 2ch */
+   u32 gizmo_xbar_apb_ctlr;/* _GIZMO_XBAR_APB_CTLR_0,  30h */
+   u32 gizmo_vcp_ahb_bridge;   /* _GIZMO_VCP_AHB_BRIDGE_0, 34h */
+   u32 reserved13[2];  /* 38h, 3ch */
+   u32 gizmo_nand; /* _GIZMO_NAND_0,   40h */
+   u32 reserved15; /* 44h */
+   u32 gizmo_sdmmc4;   /* _GIZMO_SDMMC4_0, 48h */
+   u32 reserved17; /* 4ch */
+   u32 gizmo_se;   /* _GIZMO_SE_0, 50h */
+   u32 gizmo_tzram;/* _GIZMO_TZRAM_0,  54h */
+   u32 reserved20[3];  /* 58h, 5ch, 60h */
+   u32 gizmo_bsev; /* _GIZMO_BSEV_0,   64h */
+   u32 reserved22[3];  /* 68h, 6ch, 70h */
+   u32 gizmo_bsea; /* _GIZMO_BSEA_0,   74h */
+   u32 gizmo_nor;  /* _GIZMO_NOR_0,78h */
+   u32 gizmo_usb2; /* _GIZMO_USB2_0,   

Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-15 Thread Stephen Warren

On 06/03/2015 02:35 PM, Tom Warren wrote:

All based off of Tegra124. As a Tegra210 board is brought
up, these may change a bit to match the HW more closely,
but probably 90% of this is identical to T124.


Rather than duplicating lots of headers and code, can we share the 
content with other chips?



diff --git a/arch/arm/include/asm/arch-tegra210/funcmux.h 
b/arch/arm/include/asm/arch-tegra210/funcmux.h


We should be able to drop funcmux support completely now that we're 
programming entire board pinmux tables.



diff --git a/arch/arm/include/asm/arch-tegra210/gpio.h 
b/arch/arm/include/asm/arch-tegra210/gpio.h



+enum gpio_pin {
+   GPIO_PA0 = 0,   /* pin 0 */
+   GPIO_PA1,


Given the move to DT, are any of these GPIO_xxx values actually used? I 
wonder how many other types/defines in the other files are actually 
used, rather than simply left over from times gone by.



diff --git a/arch/arm/include/asm/arch-tegra210/hardware.h 
b/arch/arm/include/asm/arch-tegra210/hardware.h


Can we drop this file? I don't see a hardware.h in any of the other 
arch-tegra*/ directories.



diff --git a/arch/arm/include/asm/arch-tegra210/tegra.h 
b/arch/arm/include/asm/arch-tegra210/tegra.h



+#define BCT_ODMDATA_OFFSET 1704/* offset to ODMDATA word */
+
+#undef NVBOOTINFOTABLE_BCTSIZE
+#undef NVBOOTINFOTABLE_BCTPTR
+#define NVBOOTINFOTABLE_BCTSIZE0x48/* BCT size in BIT in IRAM */
+#define NVBOOTINFOTABLE_BCTPTR 0x4C/* BCT pointer in BIT in IRAM */


Have you validated those? I'm pretty sure the BCT and perhaps BIT layout 
changed in T210, and those values match T124.


Have all the clock tables and IDs been updated to match T210? If not, I 
think we should do that before checking in the code, or it'll be misleading.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-15 Thread Tom Warren


> -Original Message-
> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> Sent: Monday, June 15, 2015 10:11 AM
> To: Tom Warren
> Cc: u-boot@lists.denx.de; Stephen Warren; Tom Warren
> Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files
> for T210
> 
> On 06/03/2015 02:35 PM, Tom Warren wrote:
> > All based off of Tegra124. As a Tegra210 board is brought up, these
> > may change a bit to match the HW more closely, but probably 90% of
> > this is identical to T124.
> 
> Rather than duplicating lots of headers and code, can we share the content
> with other chips?
Sure, but I wasn't looking at this patchset as a reworking of all Tegra common 
headers, but an inclusion of T210 support. We can then move to common/shared 
content after this is in, or someone (you?) can do it now before I add T210 
support, but that'll delay it.

> 
> > diff --git a/arch/arm/include/asm/arch-tegra210/funcmux.h
> > b/arch/arm/include/asm/arch-tegra210/funcmux.h
> 
> We should be able to drop funcmux support completely now that we're
> programming entire board pinmux tables.
I'll look into it, but I believe funcmux is only used to get early UART muxes 
set, which is done before the pinmux table is parsed/written.

> 
> > diff --git a/arch/arm/include/asm/arch-tegra210/gpio.h
> > b/arch/arm/include/asm/arch-tegra210/gpio.h
> 
> > +enum gpio_pin {
> > +   GPIO_PA0 = 0,   /* pin 0 */
> > +   GPIO_PA1,
> 
> Given the move to DT, are any of these GPIO_xxx values actually used? I
> wonder how many other types/defines in the other files are actually used,
> rather than simply left over from times gone by.
Again, that's more of a general Tegra cleanup phase then this patchset is 
intended for. I'll take a quick look, but I don't want to get delayed by doing 
a bunch of Tegra cleanup stuff right now.

> 
> > diff --git a/arch/arm/include/asm/arch-tegra210/hardware.h
> > b/arch/arm/include/asm/arch-tegra210/hardware.h
> 
> Can we drop this file? I don't see a hardware.h in any of the other 
> arch-tegra*/
> directories.
Sure. It's never been used AFAICT.

> 
> > diff --git a/arch/arm/include/asm/arch-tegra210/tegra.h
> > b/arch/arm/include/asm/arch-tegra210/tegra.h
> 
> > +#define BCT_ODMDATA_OFFSET 1704/* offset to ODMDATA word */
> > +
> > +#undef NVBOOTINFOTABLE_BCTSIZE
> > +#undef NVBOOTINFOTABLE_BCTPTR
> > +#define NVBOOTINFOTABLE_BCTSIZE0x48/* BCT size in BIT in
> IRAM */
> > +#define NVBOOTINFOTABLE_BCTPTR 0x4C/* BCT pointer in BIT in
> IRAM */
> 
> Have you validated those? I'm pretty sure the BCT and perhaps BIT layout
> changed in T210, and those values match T124.
Good point. They have changed, since the BCT structure has changed. I'll update 
them w/real T210 offsets.

> 
> Have all the clock tables and IDs been updated to match T210? If not, I think 
> we
> should do that before checking in the code, or it'll be misleading.
I believe so - I'm using the clock tables from my 'fully working' branch, so 
they should be accurate/jibe with the TRM, but I'll double-check.

--
nvpublic

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-15 Thread Tom Warren
Update WRT gpio.h and hardware.h, below.

> -Original Message-
> From: Tom Warren
> Sent: Monday, June 15, 2015 1:05 PM
> To: 'Stephen Warren'; Tom Warren
> Cc: u-boot@lists.denx.de; Stephen Warren
> Subject: RE: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files
> for T210
> 
> 
> 
> > -Original Message-
> > From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> > Sent: Monday, June 15, 2015 10:11 AM
> > To: Tom Warren
> > Cc: u-boot@lists.denx.de; Stephen Warren; Tom Warren
> > Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include
> > files for T210
> >
> > On 06/03/2015 02:35 PM, Tom Warren wrote:
> > > All based off of Tegra124. As a Tegra210 board is brought up, these
> > > may change a bit to match the HW more closely, but probably 90% of
> > > this is identical to T124.
> >
> > Rather than duplicating lots of headers and code, can we share the
> > content with other chips?
> Sure, but I wasn't looking at this patchset as a reworking of all Tegra common
> headers, but an inclusion of T210 support. We can then move to
> common/shared content after this is in, or someone (you?) can do it now
> before I add T210 support, but that'll delay it.
> 
> >
> > > diff --git a/arch/arm/include/asm/arch-tegra210/funcmux.h
> > > b/arch/arm/include/asm/arch-tegra210/funcmux.h
> >
> > We should be able to drop funcmux support completely now that we're
> > programming entire board pinmux tables.
> I'll look into it, but I believe funcmux is only used to get early UART muxes 
> set,
> which is done before the pinmux table is parsed/written.
> 
> >
> > > diff --git a/arch/arm/include/asm/arch-tegra210/gpio.h
> > > b/arch/arm/include/asm/arch-tegra210/gpio.h
> >
> > > +enum gpio_pin {
> > > + GPIO_PA0 = 0,   /* pin 0 */
> > > + GPIO_PA1,
> >
> > Given the move to DT, are any of these GPIO_xxx values actually used?
> > I wonder how many other types/defines in the other files are actually
> > used, rather than simply left over from times gone by.
> Again, that's more of a general Tegra cleanup phase then this patchset is
> intended for. I'll take a quick look, but I don't want to get delayed by 
> doing a
> bunch of Tegra cleanup stuff right now.
They're used in the pinmux table (pinmux-config-venice2.h, for example) and 
some board files (nyan-big.c, cardhu.c, seaboard.c). Can't remove 'em.

> 
> >
> > > diff --git a/arch/arm/include/asm/arch-tegra210/hardware.h
> > > b/arch/arm/include/asm/arch-tegra210/hardware.h
> >
> > Can we drop this file? I don't see a hardware.h in any of the other
> > arch-tegra*/ directories.
> Sure. It's never been used AFAICT.
Can't drop hardware.h. It's expected to be in every build, included from 
arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.

> 
> >
> > > diff --git a/arch/arm/include/asm/arch-tegra210/tegra.h
> > > b/arch/arm/include/asm/arch-tegra210/tegra.h
> >
> > > +#define BCT_ODMDATA_OFFSET   1704/* offset to ODMDATA word */
> > > +
> > > +#undef NVBOOTINFOTABLE_BCTSIZE
> > > +#undef NVBOOTINFOTABLE_BCTPTR
> > > +#define NVBOOTINFOTABLE_BCTSIZE  0x48/* BCT size in BIT in
> > IRAM */
> > > +#define NVBOOTINFOTABLE_BCTPTR   0x4C/* BCT pointer in BIT in
> > IRAM */
> >
> > Have you validated those? I'm pretty sure the BCT and perhaps BIT
> > layout changed in T210, and those values match T124.
> Good point. They have changed, since the BCT structure has changed. I'll
> update them w/real T210 offsets.
> 
> >
> > Have all the clock tables and IDs been updated to match T210? If not,
> > I think we should do that before checking in the code, or it'll be 
> > misleading.
> I believe so - I'm using the clock tables from my 'fully working' branch, so 
> they
> should be accurate/jibe with the TRM, but I'll double-check.
> 
> --
> nvpublic

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-16 Thread Stephen Warren

On 06/15/2015 02:04 PM, Tom Warren wrote:




-Original Message-
From: Stephen Warren [mailto:swar...@wwwdotorg.org]
Sent: Monday, June 15, 2015 10:11 AM
To: Tom Warren
Cc: u-boot@lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files
for T210

On 06/03/2015 02:35 PM, Tom Warren wrote:

All based off of Tegra124. As a Tegra210 board is brought up, these
may change a bit to match the HW more closely, but probably 90% of
this is identical to T124.


Rather than duplicating lots of headers and code, can we share the content
with other chips?

>

Sure, but I wasn't looking at this patchset as a reworking of all Tegra common 
headers, but an inclusion of T210 support. We can then move to common/shared 
content after this is in, or someone (you?) can do it now before I add T210 
support, but that'll delay it.


The problem here is that the same excuse against cleanup is made every 
time a new SoC comes along, and the cleanup never happens.



diff --git a/arch/arm/include/asm/arch-tegra210/funcmux.h
b/arch/arm/include/asm/arch-tegra210/funcmux.h


We should be able to drop funcmux support completely now that we're
programming entire board pinmux tables.

>

I'll look into it, but I believe funcmux is only used to get early UART muxes 
set, which is done before the pinmux table is parsed/written.


There's no guarantee funcmux will work in general for the UARTs. The 
best solution would be to apply the pinmux table before doing anything. 
That way, we wouldn't need anything custom to try and get the UART working.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-16 Thread Stephen Warren

On 06/15/2015 04:18 PM, Tom Warren wrote:

Update WRT gpio.h and hardware.h, below.

Tom Warren wrote at Monday, June 15, 2015 1:05 PM:

Stephen Warren wrote at Monday, June 15, 2015 10:11 AM:

On 06/03/2015 02:35 PM, Tom Warren wrote:

All based off of Tegra124. As a Tegra210 board is brought up, these
may change a bit to match the HW more closely, but probably 90% of
this is identical to T124.

...

diff --git a/arch/arm/include/asm/arch-tegra210/hardware.h
b/arch/arm/include/asm/arch-tegra210/hardware.h


Can we drop this file? I don't see a hardware.h in any of the other
arch-tegra*/ directories.

Sure. It's never been used AFAICT.

Can't drop hardware.h. It's expected to be in every build, included from 
arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.


But there is no hardware.h in any of arch/arm/include/asm/arch-tegra*.h 
in u-boot.git's master branch as of today.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

2015-06-16 Thread Tom Warren
> -Original Message-
> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> Sent: Tuesday, June 16, 2015 1:29 PM
> To: Tom Warren; Tom Warren
> Cc: u-boot@lists.denx.de; Stephen Warren
> Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files
> for T210
> 
> On 06/15/2015 04:18 PM, Tom Warren wrote:
> > Update WRT gpio.h and hardware.h, below.
> >
> >Tom Warren wrote at Monday, June 15, 2015 1:05 PM:
> >> Stephen Warren wrote at Monday, June 15, 2015 10:11 AM:
> >>> On 06/03/2015 02:35 PM, Tom Warren wrote:
> >>>> All based off of Tegra124. As a Tegra210 board is brought up, these
> >>>> may change a bit to match the HW more closely, but probably 90% of
> >>>> this is identical to T124.
> ...
> >>>> diff --git a/arch/arm/include/asm/arch-tegra210/hardware.h
> >>>> b/arch/arm/include/asm/arch-tegra210/hardware.h
> >>>
> >>> Can we drop this file? I don't see a hardware.h in any of the other
> >>> arch-tegra*/ directories.
> >> Sure. It's never been used AFAICT.
> > Can't drop hardware.h. It's expected to be in every build, included from
> arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.
> 
> But there is no hardware.h in any of arch/arm/include/asm/arch-tegra*.h
> in u-boot.git's master branch as of today.
Sorry, I must have  been looking at my u-boot-tegra/next branch, which hasn't 
been sync'd w/master (u-boot or u-boot-tegra) in a while. I'll remove 
hardware.h in the next patchset.

Thanks

--
nvpublic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot