[U-Boot] [PATCH] Tegra: Change Tegra20 to Tegra in common code, prep for T30
Tom Warren
twarren.nvidia at gmail.com
Fri Sep 7 18:39:25 CEST 2012
Stephen,
On Thu, Sep 6, 2012 at 7:49 PM, Stephen Warren <swarren at nvidia.com> wrote:
> On 09/06/2012 03:27 PM, Tom Warren wrote:
>> Convert TEGRA20_ defines to either TEGRA_ or NV_PA_ where appropriate.
>> Convert tegra20_ source file and function names to tegra_, also.
>>
>> Upcoming Tegra30 port will use common code/defines/names where possible.
>>
>> Signed-off-by: Tom Warren <twarren at nvidia.com>
>
> I think this is basically OK so,
> Acked-by: Stephen Warren <swarren at nvidia.com>
>
> Just a few small comments/thoughts below...
>
>> diff --git a/arch/arm/cpu/tegra20-common/board.c b/arch/arm/cpu/tegra20-common/board.c
>
>> static int uart_configs[] = {
>> -#if defined(CONFIG_TEGRA20_UARTA_UAA_UAB)
>> +#if defined(CONFIG_TEGRA_UARTA_UAA_UAB)
>> FUNCMUX_UART1_UAA_UAB,
>> -#elif defined(CONFIG_TEGRA20_UARTA_GPU)
>> +#elif defined(CONFIG_TEGRA_UARTA_GPU)
>> FUNCMUX_UART1_GPU,
>> -#elif defined(CONFIG_TEGRA20_UARTA_SDIO1)
>> +#elif defined(CONFIG_TEGRA_UARTA_SDIO1)
>> FUNCMUX_UART1_SDIO1,
>> #else
>> FUNCMUX_UART1_IRRX_IRTX,
>
> All those options probably are Tegra20-specific, because the set of
> pin-/group-names isn't the same on Tegra20 and Tegra30, so the same
> options won't be available. Still, this probably won't actually cause
> any name collisions, so it's probably OK to rename these.
This is in tegra20-common/. The T30 pinmux names, etc. will be in
tegra30-common/. Once T30 is fully realized upstream, we can look at
common-izing the code as we did in our internal repo(s).
>
>> diff --git a/arch/arm/include/asm/arch-tegra20/tegra20.h b/arch/arm/include/asm/arch-tegra20/tegra20.h
>
>> #define NV_PA_GPIO_BASE 0x6000D000
>> #define NV_PA_EVP_BASE 0x6000F000
>> #define NV_PA_APB_MISC_BASE 0x70000000
>> -#define TEGRA20_APB_MISC_GP_BASE (NV_PA_APB_MISC_BASE + 0x0800)
>> +#define NV_PA_APB_MISC_GP_BASE (NV_PA_APB_MISC_BASE + 0x0800)
>> #define NV_PA_APB_UARTA_BASE (NV_PA_APB_MISC_BASE + 0x6000)
>> #define NV_PA_APB_UARTB_BASE (NV_PA_APB_MISC_BASE + 0x6040)
>> #define NV_PA_APB_UARTC_BASE (NV_PA_APB_MISC_BASE + 0x6200)
>> #define NV_PA_APB_UARTD_BASE (NV_PA_APB_MISC_BASE + 0x6300)
>> #define NV_PA_APB_UARTE_BASE (NV_PA_APB_MISC_BASE + 0x6400)
>> -#define TEGRA20_NAND_BASE (NV_PA_APB_MISC_BASE + 0x8000)
>> -#define TEGRA20_SPI_BASE (NV_PA_APB_MISC_BASE + 0xC380)
>> -#define TEGRA20_PMC_BASE (NV_PA_APB_MISC_BASE + 0xE400)
>> -#define TEGRA20_FUSE_BASE (NV_PA_APB_MISC_BASE + 0xF800)
>> +#define NV_PA_NAND_BASE (NV_PA_APB_MISC_BASE + 0x8000)
>> +#define NV_PA_SPI_BASE (NV_PA_APB_MISC_BASE + 0xC380)
>> +#define NV_PA_PMC_BASE (NV_PA_APB_MISC_BASE + 0xE400)
>> +#define NV_PA_FUSE_BASE (NV_PA_APB_MISC_BASE + 0xF800)
>> #define NV_PA_CSITE_BASE 0x70040000
>> #define TEGRA_USB1_BASE 0xC5000000
>> #define TEGRA_USB3_BASE 0xC5008000
>> #define TEGRA_USB_ADDR_MASK 0xFFFFC000
>
> Many of these values will be different between Tegra20 and Tegra30.
> Hence, the values are all SoC-specific. I suppose you're planning on
> having both tegra20.h and tegra30.h define the same set of names, just
> with different values? I guess that's fine. It's plausible that
> different SoCs might have a different number of instances of some
> controllers. I suppose most of these defines should eventually be
> replaced by device tree anyway though.
Yep, I plan on separate tegra20.h and tegra30.h, since quite a few
peripheral base addresses have moved. Again, I'll look at combining as
many files & as much common code as possible on a 2nd, refining pass
once T30 U-Boot is fully functional.
Thanks for the review,
Applied to u-boot-tegra/next. I'll push it later today, minus Lucas'
USB ULPI stuff that's going to go in via Marek's tree.
Tom
More information about the U-Boot
mailing list