diff options
author | Tom Warren <twarren@nvidia.com> | 2011-09-01 16:49:30 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-09-15 12:42:37 -0700 |
commit | 615217e1f756332820e3aed926a26ede9451a2be (patch) | |
tree | ab93ea89979666e020b66948937c07a1f1f22c31 | |
parent | e26a6be71dd36659af343b9f0ec14ea981d23692 (diff) |
tegra3: Add basic Tegra30 support
This adds the most basic Tegra30 support to U-Boot, by making use of
existing tegra2 code and adding what is necessary to build.
BUG=chromium-os:19004
TEST=build and boot on T30 board
Change-Id: If75599b2e76dbec3281fffb8a244b6145e9648cc
Reviewed-on: http://gerrit.chromium.org/gerrit/7130
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/arm/cpu/armv7/tegra3/Makefile | 52 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/tegra3/board.c | 36 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/tegra3/sys_info.c | 35 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra/tegra.h | 7 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra2/tegra.h | 5 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra3/clock.h | 22 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra3/fuse.h | 39 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra3/sys_proto.h | 24 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra3/tegra.h | 36 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra3/timer.h | 24 | ||||
-rw-r--r-- | board/nvidia/cardhu/Makefile | 52 | ||||
-rw-r--r-- | board/nvidia/cardhu/cardhu.c | 24 | ||||
-rw-r--r-- | board/nvidia/common/board.c | 26 | ||||
-rw-r--r-- | boards.cfg | 1 |
14 files changed, 375 insertions, 8 deletions
diff --git a/arch/arm/cpu/armv7/tegra3/Makefile b/arch/arm/cpu/armv7/tegra3/Makefile new file mode 100644 index 00000000000..98468450c88 --- /dev/null +++ b/arch/arm/cpu/armv7/tegra3/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2010,2011 Nvidia Corporation. +# +# (C) Copyright 2000-2003 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +# The AVP is ARMv4T architecture so we must use special compiler +# flags for any files it might use. + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(SOC).o + +COBJS-y := board.o sys_info.o + +COBJS := $(COBJS-y) + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/arch/arm/cpu/armv7/tegra3/board.c b/arch/arm/cpu/armv7/tegra3/board.c new file mode 100644 index 00000000000..861174e89e0 --- /dev/null +++ b/arch/arm/cpu/armv7/tegra3/board.c @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/tegra.h> +#include <asm/arch-tegra/board.h> + +DECLARE_GLOBAL_DATA_PTR; + +unsigned int board_query_sdram_size(void) +{ + /* TBD - check odmdata in PMC scratch reg */ + return 0x40000000; /* Cardhu = 1GB */ +} diff --git a/arch/arm/cpu/armv7/tegra3/sys_info.c b/arch/arm/cpu/armv7/tegra3/sys_info.c new file mode 100644 index 00000000000..a9ee6cdb2ac --- /dev/null +++ b/arch/arm/cpu/armv7/tegra3/sys_info.c @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> + +#ifdef CONFIG_DISPLAY_CPUINFO +/* Print CPU information */ +int print_cpuinfo(void) +{ + puts("TEGRA3\n"); + + /* TBD: Add printf of major/minor rev info, stepping, etc. */ + return 0; +} +#endif /* CONFIG_DISPLAY_CPUINFO */ diff --git a/arch/arm/include/asm/arch-tegra/tegra.h b/arch/arm/include/asm/arch-tegra/tegra.h index 023e441f155..28079021a75 100644 --- a/arch/arm/include/asm/arch-tegra/tegra.h +++ b/arch/arm/include/asm/arch-tegra/tegra.h @@ -51,10 +51,6 @@ #define NV_PA_USB1_BASE 0xC5000000 #define NV_PA_USB3_BASE 0xC5008000 -#define NV_PA_SDMMC1_BASE 0xC8000000 -#define NV_PA_SDMMC2_BASE 0xC8000200 -#define NV_PA_SDMMC3_BASE 0xC8000400 -#define NV_PA_SDMMC4_BASE 0xC8000600 #define TEGRA_SDRC_CS0 NV_PA_SDRAM_BASE #define LOW_LEVEL_SRAM_STACK 0x4000FFFC @@ -79,11 +75,14 @@ enum { SKU_ID_T25 = 0x18, SKU_ID_AP25E = 0x1b, SKU_ID_T25E = 0x1c, + + SKU_ID_T30 = 0x81, /* TBD use real Cardhu value */ }; enum { TEGRA_SOC_T20, TEGRA_SOC_T25, + TEGRA_SOC_T30, TEGRA_SOC_COUNT, TEGRA_SOC_UNKNOWN = -1, diff --git a/arch/arm/include/asm/arch-tegra2/tegra.h b/arch/arm/include/asm/arch-tegra2/tegra.h index 2ef29374dd3..68b424a9bf8 100644 --- a/arch/arm/include/asm/arch-tegra2/tegra.h +++ b/arch/arm/include/asm/arch-tegra2/tegra.h @@ -27,6 +27,11 @@ #define NV_PA_SDRAM_BASE 0x00000000 #define TEGRA_SPI_BASE 0x7000C380 +#define NV_PA_SDMMC1_BASE 0xC8000000 +#define NV_PA_SDMMC2_BASE 0xC8000200 +#define NV_PA_SDMMC3_BASE 0xC8000400 +#define NV_PA_SDMMC4_BASE 0xC8000600 + #include <asm/arch-tegra/tegra.h> #endif diff --git a/arch/arm/include/asm/arch-tegra3/clock.h b/arch/arm/include/asm/arch-tegra3/clock.h new file mode 100644 index 00000000000..c11066760ef --- /dev/null +++ b/arch/arm/include/asm/arch-tegra3/clock.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include "asm/arch-tegra/clock.h" diff --git a/arch/arm/include/asm/arch-tegra3/fuse.h b/arch/arm/include/asm/arch-tegra3/fuse.h new file mode 100644 index 00000000000..b7e3808a4f9 --- /dev/null +++ b/arch/arm/include/asm/arch-tegra3/fuse.h @@ -0,0 +1,39 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _FUSE_H_ +#define _FUSE_H_ + +/* FUSE registers */ +struct fuse_regs { + u32 reserved0[64]; /* 0x00 - 0xFC: */ + u32 production_mode; /* 0x100: FUSE_PRODUCTION_MODE */ + u32 reserved1[3]; /* 0x104 - 0x10c: */ + u32 sku_info; /* 0x110 */ + u32 reserved2[13]; /* 0x114 - 0x144: */ + u32 fa; /* 0x148: FUSE_FA */ + u32 reserved3[21]; /* 0x14C - 0x19C: */ + u32 security_mode; /* 0x1A0: FUSE_SECURITY_MODE */ +}; + +#endif /* ifndef _FUSE_H_ */ diff --git a/arch/arm/include/asm/arch-tegra3/sys_proto.h b/arch/arm/include/asm/arch-tegra3/sys_proto.h new file mode 100644 index 00000000000..c460762908e --- /dev/null +++ b/arch/arm/include/asm/arch-tegra3/sys_proto.h @@ -0,0 +1,24 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <asm/arch-tegra/sys_proto.h> diff --git a/arch/arm/include/asm/arch-tegra3/tegra.h b/arch/arm/include/asm/arch-tegra3/tegra.h new file mode 100644 index 00000000000..92a19703c31 --- /dev/null +++ b/arch/arm/include/asm/arch-tegra3/tegra.h @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _TEGRA3_H_ +#define _TEGRA3_H_ + +#define NV_PA_SDRAM_BASE 0x80000000 + +#define NV_PA_SDMMC1_BASE 0x78000000 +#define NV_PA_SDMMC2_BASE 0x78000200 +#define NV_PA_SDMMC3_BASE 0x78000400 +#define NV_PA_SDMMC4_BASE 0x78000600 + +#include <asm/arch-tegra/tegra.h> + +#endif diff --git a/arch/arm/include/asm/arch-tegra3/timer.h b/arch/arm/include/asm/arch-tegra3/timer.h new file mode 100644 index 00000000000..a4f3f674cba --- /dev/null +++ b/arch/arm/include/asm/arch-tegra3/timer.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* Tegra3 timer functions */ + +#include <asm/arch-tegra/timer.h> diff --git a/board/nvidia/cardhu/Makefile b/board/nvidia/cardhu/Makefile new file mode 100644 index 00000000000..fe44fffe26a --- /dev/null +++ b/board/nvidia/cardhu/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2010,2011 +# NVIDIA Corporation <www.nvidia.com> +# +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +$(shell mkdir -p $(obj)../common) + +LIB = $(obj)lib$(BOARD).o + +COBJS := $(BOARD).o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/nvidia/cardhu/cardhu.c b/board/nvidia/cardhu/cardhu.c new file mode 100644 index 00000000000..58679311f21 --- /dev/null +++ b/board/nvidia/cardhu/cardhu.c @@ -0,0 +1,24 @@ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index 2755057e957..791e900bac0 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -28,27 +28,39 @@ #include <asm/arch-tegra/fuse.h> +/* TBD: bring these over when Tegra3 is ready, then remove these #ifdefs */ +#ifdef CONFIG_TEGRA2 #include <asm/arch/bitfield.h> #include <asm/arch/clk_rst.h> +#endif #include <asm/arch/clock.h> +#ifdef CONFIG_TEGRA2 #include <asm/arch/emc.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch/pmc.h> +#endif #include <asm/arch/sys_proto.h> +#ifdef CONFIG_TEGRA2 #include <asm/arch/uart.h> #include <asm/arch/usb.h> +#include <asm/arch/warmboot.h> +#endif #include <asm/arch/tegra.h> +#ifdef CONFIG_TEGRA2_SPI #include <spi.h> -#include <fdt_decode.h> +#endif +#ifdef CONFIG_TEGRA2_I2C #include <i2c.h> +#endif #include "board.h" #ifdef CONFIG_TEGRA2_MMC #include <mmc.h> #endif #ifdef CONFIG_OF_CONTROL +#include <fdt_decode.h> #include <libfdt.h> #endif @@ -56,8 +68,6 @@ #include <chromeos/common.h> #endif -#include <asm/arch/warmboot.h> - DECLARE_GLOBAL_DATA_PTR; enum { @@ -70,7 +80,7 @@ enum { #ifndef CONFIG_OF_CONTROL const struct tegra_sysinfo sysinfo = { - CONFIG_TEGRA2_BOARD_STRING + CONFIG_TEGRA_BOARD_STRING }; #endif @@ -86,6 +96,7 @@ int timer_init(void) static void enable_uart(enum periph_id pid) { +#if defined(CONFIG_TEGRA2) /* Assert UART reset and enable clock */ reset_set_enable(pid, 1); clock_enable(pid); @@ -96,6 +107,7 @@ static void enable_uart(enum periph_id pid) /* De-assert reset to UART */ reset_set_enable(pid, 0); +#endif } /* @@ -118,6 +130,7 @@ static void clock_init_uart(int uart_ids) */ static void pin_mux_uart(int uart_ids) { +#if defined(CONFIG_TEGRA2) if (uart_ids & UARTA) { pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA); pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA); @@ -132,6 +145,7 @@ static void pin_mux_uart(int uart_ids) pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD); pinmux_tristate_disable(PINGRP_GMC); } +#endif /* CONFIG_TEGRA2 */ } /* @@ -142,12 +156,14 @@ static void pin_mux_uart(int uart_ids) */ static void pin_mux_switches(void) { +#if defined(CONFIG_TEGRA2) /* * TODO(robotboy): Move this to the FDT once there is pin mux support * there. Currently all Tegra based boards use the same GPIOs for * these switches. */ pinmux_set_pullupdown(PINGRP_ATD, PMUX_PULL_NORMAL); +#endif /* CONFIG_TEGRA2 */ } #ifdef CONFIG_TEGRA2_MMC @@ -205,11 +221,13 @@ static void gpio_init(const void *blob) */ static void power_det_init(void) { +#if defined(CONFIG_TEGRA2) struct pmc_ctlr *const pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; /* turn off power detects */ writel(0, &pmc->pmc_pwr_det_latch); writel(0, &pmc->pmc_pwr_det); +#endif } /* diff --git a/boards.cfg b/boards.cfg index 478f14957bc..38084a2544f 100644 --- a/boards.cfg +++ b/boards.cfg @@ -163,6 +163,7 @@ s5pc210_universal arm armv7 universal_c210 samsung smdkv310 arm armv7 smdkv310 samsung s5pc2xx harmony arm armv7 harmony nvidia tegra2 seaboard arm armv7 seaboard nvidia tegra2 +cardhu arm armv7 cardhu nvidia tegra3 u8500_href arm armv7 u8500 st-ericsson u8500 actux1_4_16 arm ixp actux1 - - actux1:FLASH2X2 actux1_8_16 arm ixp actux1 - - actux1:FLASH1X8 |