]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Tegra20: Move some include files to arch-tegra for sharing with Tegra30
authorTom Warren <twarren@nvidia.com>
Wed, 19 Sep 2012 22:50:56 +0000 (15:50 -0700)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:54:06 +0000 (11:54 -0700)
The move is pretty straight-forward. ap20.h and tegra20.h were renamed to ap.h and tegra.h.
Some files remain in arch-tegra20 but 'include' a file in 'arch-tegra' with #defines & structs
that will be common between T20 and T30 HW. HW-specific #defines, etc. stay in the 'arch-tegra20'
'root' file.

All boards build OK w/MAKEALL -s tegra20. Checkpatch.pl runs clean. Seaboard works OK.

Signed-off-by: Tom Warren <twarren@nvidia.com>
50 files changed:
arch/arm/cpu/arm720t/tegra-common/spl.c
arch/arm/cpu/arm720t/tegra20/cpu.c
arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c
arch/arm/cpu/armv7/tegra20/usb.c
arch/arm/cpu/tegra-common/ap.c
arch/arm/cpu/tegra-common/board.c
arch/arm/cpu/tegra-common/timer.c
arch/arm/cpu/tegra20-common/clock.c
arch/arm/cpu/tegra20-common/emc.c
arch/arm/cpu/tegra20-common/pinmux.c
arch/arm/cpu/tegra20-common/pmu.c
arch/arm/cpu/tegra20-common/warmboot.c
arch/arm/cpu/tegra20-common/warmboot_avp.c
arch/arm/include/asm/arch-tegra/ap.h [moved from arch/arm/include/asm/arch-tegra20/ap20.h with 100% similarity]
arch/arm/include/asm/arch-tegra/board.h [moved from arch/arm/include/asm/arch-tegra20/board.h with 100% similarity]
arch/arm/include/asm/arch-tegra/clk_rst.h [moved from arch/arm/include/asm/arch-tegra20/clk_rst.h with 100% similarity]
arch/arm/include/asm/arch-tegra/clock.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra/fuse.h [moved from arch/arm/include/asm/arch-tegra20/fuse.h with 100% similarity]
arch/arm/include/asm/arch-tegra/gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra/mmc.h [moved from arch/arm/include/asm/arch-tegra20/mmc.h with 100% similarity]
arch/arm/include/asm/arch-tegra/pmc.h [moved from arch/arm/include/asm/arch-tegra20/pmc.h with 100% similarity]
arch/arm/include/asm/arch-tegra/scu.h [moved from arch/arm/include/asm/arch-tegra20/scu.h with 100% similarity]
arch/arm/include/asm/arch-tegra/sys_proto.h [moved from arch/arm/include/asm/arch-tegra20/sys_proto.h with 100% similarity]
arch/arm/include/asm/arch-tegra/tegra.h [moved from arch/arm/include/asm/arch-tegra20/tegra20.h with 90% similarity]
arch/arm/include/asm/arch-tegra/tegra_i2c.h [moved from arch/arm/include/asm/arch-tegra20/tegra_i2c.h with 98% similarity]
arch/arm/include/asm/arch-tegra/tegra_mmc.h [moved from arch/arm/include/asm/arch-tegra20/tegra_mmc.h with 100% similarity]
arch/arm/include/asm/arch-tegra/tegra_spi.h [moved from arch/arm/include/asm/arch-tegra20/tegra_spi.h with 100% similarity]
arch/arm/include/asm/arch-tegra/timer.h [moved from arch/arm/include/asm/arch-tegra20/timer.h with 100% similarity]
arch/arm/include/asm/arch-tegra/uart.h [moved from arch/arm/include/asm/arch-tegra20/uart.h with 100% similarity]
arch/arm/include/asm/arch-tegra/warmboot.h [moved from arch/arm/include/asm/arch-tegra20/warmboot.h with 100% similarity]
arch/arm/include/asm/arch-tegra20/clock-tables.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra20/clock.h
arch/arm/include/asm/arch-tegra20/gpio.h
arch/arm/include/asm/arch-tegra20/tegra.h [new file with mode: 0644]
board/avionic-design/common/tamonten.c
board/compal/paz00/paz00.c
board/compulab/trimslice/trimslice.c
board/nvidia/common/board.c
board/nvidia/common/emc.c
board/nvidia/common/uart-spi-switch.c
board/nvidia/harmony/harmony.c
board/nvidia/seaboard/seaboard.c
board/nvidia/whistler/whistler.c
drivers/gpio/tegra_gpio.c
drivers/i2c/tegra_i2c.c
drivers/input/tegra-kbc.c
drivers/mmc/tegra_mmc.c
drivers/mtd/nand/tegra_nand.c
drivers/spi/tegra_spi.c
include/configs/tegra20-common.h

index 6c16dce299dd94e9e4b377534dffe4879ec08fdf..3139c65128d776b941ae283e85e9c4c8db80e82b 100644 (file)
@@ -25,8 +25,6 @@
 #include <common.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/clock.h>
 #include <nand.h>
 #include <mmc.h>
 #include <fat.h>
 #include "cpu.h"
 
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pmc.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/scu.h>
-#include <common.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/scu.h>
+#include <asm/arch-tegra/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 8b7293852c1b58567f6fe87320b414d7ab15c127..ef7f375e79de92a1336d64aed2efc8ab02157964 100644 (file)
 * MA 02111-1307 USA
 */
 
+#include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pmc.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/scu.h>
-#include <common.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/scu.h>
 #include "../tegra-common/cpu.h"
 
 /* Returns 1 if the current CPU executing is a Cortex-A9, else 0 */
index 925f8414c4df7f6cfdb4418bb9c5b81eb0a55ebb..f74ddcbb2b8e272352895f5deb98aa0ef90ece3c 100644 (file)
@@ -40,8 +40,8 @@
  */
 
 #include <common.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/pmc.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/pmc.h>
 
 static int do_enterrcm(cmd_tbl_t *cmdtp, int flag, int argc,
                       char * const argv[])
index 1b52b16e2953413fd9dd1919a3d61bf0c7b3d5b5..1bccf2b0b2c5bd82b22989f8c22f9bf96ec27757 100644 (file)
 #include <common.h>
 #include <asm/io.h>
 #include <asm-generic/gpio.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/uart.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/usb.h>
 #include <usb/ulpi.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/sys_proto.h>
+#include <asm/arch-tegra/uart.h>
 #include <libfdt.h>
 #include <fdtdec.h>
 
index c0ca6eb379e4733de3fea5fcd81b58139f4dbe2b..c4eb137480340bb660e76ae3abcaca8f6e3bb7eb 100644 (file)
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
+#include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ap20.h>
-#include <asm/arch/fuse.h>
 #include <asm/arch/gp_padctrl.h>
-#include <asm/arch/pmc.h>
-#include <asm/arch/scu.h>
-#include <asm/arch/warmboot.h>
-#include <common.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/fuse.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/scu.h>
+#include <asm/arch-tegra/warmboot.h>
 
 int tegra_get_chip_type(void)
 {
index 8a8d3384ac4b4ba51731c53552df4b8b0e170311..ff90a529f72881de221c0b4cd2a2358b15dff23e 100644 (file)
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/pmc.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/warmboot.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/sys_proto.h>
+#include <asm/arch-tegra/warmboot.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 562e41401218fd07d54bafc5d122809f0fa9e479..034ea5ad28847eb1d9fc44fd40c11585c97364f5 100644 (file)
@@ -37,8 +37,8 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/timer.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/timer.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 24038745bd915a0ef852e65e6a05a6a76e0223c9..bca777e830811c997bf3e87119a822248ef99b8d 100644 (file)
 
 /* Tegra20 Clock control functions */
 
+#include <common.h>
 #include <asm/io.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/timer.h>
-#include <asm/arch/tegra20.h>
-#include <common.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
index ffc05e453a03f60f725128e0baa6d92e649799f3..97420d70661b6af167ffa4d5d576e0b91552fe01 100644 (file)
 #include <common.h>
 #include <fdtdec.h>
 #include <asm/io.h>
-#include <asm/arch/ap20.h>
+#include <asm/arch-tegra/ap.h>
 #include <asm/arch/apb_misc.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 
 /*
  * The EMC registers have shadow registers.  When the EMC clock is updated
index 70e84dfa17804b1e3772aa22c23c2d877db8e2c5..08b83055dbb74b4e660c3865e4930a04f41049c8 100644 (file)
 
 /* Tegra20 pin multiplexing functions */
 
+#include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/pinmux.h>
-#include <common.h>
 
 
 /*
index 53505e9c50c10c8d92b342e11216a5fb8d4540c4..228295303ca69022d7d2fb39672e6fe1551500ce 100644 (file)
 #include <common.h>
 #include <tps6586x.h>
 #include <asm/io.h>
-#include <asm/arch/ap20.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/tegra_i2c.h>
-#include <asm/arch/sys_proto.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/tegra_i2c.h>
+#include <asm/arch-tegra/sys_proto.h>
 
 #define VDD_CORE_NOMINAL_T25   0x17    /* 1.3v */
 #define VDD_CPU_NOMINAL_T25    0x10    /* 1.125v */
index 6ce995ef02948fa2a5f4c99a6be5e3c36f324217..157b9abc4597b1fbaebb788dc2732e35dbfee3ef 100644 (file)
 #include <common.h>
 #include <asm/io.h>
 #include <asm/errno.h>
-#include <asm/arch/ap20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pmc.h>
-#include <asm/arch/pinmux.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/fuse.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/gp_padctrl.h>
-#include <asm/arch/warmboot.h>
+#include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/fuse.h>
+#include <asm/arch-tegra/warmboot.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -361,8 +361,8 @@ int warmboot_prepare_code(u32 seg_address, u32 seg_length)
        /* Populate the header. */
        dst_header->length_insecure = length + sizeof(struct wb_header);
        dst_header->length_secure = length + sizeof(struct wb_header);
-       dst_header->destination = AP20_WB_RUN_ADDRESS;
-       dst_header->entry_point = AP20_WB_RUN_ADDRESS;
+       dst_header->destination = NV_WB_RUN_ADDRESS;
+       dst_header->entry_point = NV_WB_RUN_ADDRESS;
        dst_header->code_length = length;
 
        if (is_encrypted) {
index 80a5a15decf6e0082d1fa109cbae006ba94b4008..bc6281d2eeb6acae55a9bafeac4c256edfb31c5f 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ap20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/pmc.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/warmboot.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/warmboot.h>
 #include "warmboot_avp.h"
 
 #define DEBUG_RESET_CORESIGHT
@@ -58,7 +58,7 @@ void wb_start(void)
                                        /* no input, no clobber list */
        );
 
-       if (reg != AP20_WB_RUN_ADDRESS)
+       if (reg != NV_WB_RUN_ADDRESS)
                goto do_reset;
 
        /* Are we running with AVP? */
diff --git a/arch/arm/include/asm/arch-tegra/clock.h b/arch/arm/include/asm/arch-tegra/clock.h
new file mode 100644 (file)
index 0000000..3eff163
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * 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
+ */
+
+/* Tegra clock control functions */
+
+#ifndef _CLOCK_H
+#define _CLOCK_H
+
+/* Set of oscillator frequencies supported in the internal API. */
+enum clock_osc_freq {
+       /* All in MHz, so 13_0 is 13.0MHz */
+       CLOCK_OSC_FREQ_13_0,
+       CLOCK_OSC_FREQ_19_2,
+       CLOCK_OSC_FREQ_12_0,
+       CLOCK_OSC_FREQ_26_0,
+
+       CLOCK_OSC_FREQ_COUNT,
+};
+
+#include <asm/arch/clock-tables.h>
+/* PLL stabilization delay in usec */
+#define CLOCK_PLL_STABLE_DELAY_US 300
+
+/* return the current oscillator clock frequency */
+enum clock_osc_freq clock_get_osc_freq(void);
+
+/**
+ * Start PLL using the provided configuration parameters.
+ *
+ * @param id   clock id
+ * @param divm input divider
+ * @param divn feedback divider
+ * @param divp post divider 2^n
+ * @param cpcon        charge pump setup control
+ * @param lfcon        loop filter setup control
+ *
+ * @returns monotonic time in us that the PLL will be stable
+ */
+unsigned long clock_start_pll(enum clock_id id, u32 divm, u32 divn,
+               u32 divp, u32 cpcon, u32 lfcon);
+
+/**
+ * Read low-level parameters of a PLL.
+ *
+ * @param id   clock id to read (note: USB is not supported)
+ * @param divm returns input divider
+ * @param divn returns feedback divider
+ * @param divp returns post divider 2^n
+ * @param cpcon        returns charge pump setup control
+ * @param lfcon        returns loop filter setup control
+ *
+ * @returns 0 if ok, -1 on error (invalid clock id)
+ */
+int clock_ll_read_pll(enum clock_id clkid, u32 *divm, u32 *divn,
+                     u32 *divp, u32 *cpcon, u32 *lfcon);
+
+/*
+ * Enable a clock
+ *
+ * @param id   clock id
+ */
+void clock_enable(enum periph_id clkid);
+
+/*
+ * Disable a clock
+ *
+ * @param id   clock id
+ */
+void clock_disable(enum periph_id clkid);
+
+/*
+ * Set whether a clock is enabled or disabled.
+ *
+ * @param id           clock id
+ * @param enable       1 to enable, 0 to disable
+ */
+void clock_set_enable(enum periph_id clkid, int enable);
+
+/**
+ * Reset a peripheral. This puts it in reset, waits for a delay, then takes
+ * it out of reset and waits for th delay again.
+ *
+ * @param periph_id    peripheral to reset
+ * @param us_delay     time to delay in microseconds
+ */
+void reset_periph(enum periph_id periph_id, int us_delay);
+
+/**
+ * Put a peripheral into or out of reset.
+ *
+ * @param periph_id    peripheral to reset
+ * @param enable       1 to put into reset, 0 to take out of reset
+ */
+void reset_set_enable(enum periph_id periph_id, int enable);
+
+
+/* CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET/CLR_0 */
+enum crc_reset_id {
+       /* Things we can hold in reset for each CPU */
+       crc_rst_cpu = 1,
+       crc_rst_de = 1 << 2,    /* What is de? */
+       crc_rst_watchdog = 1 << 3,
+       crc_rst_debug = 1 << 4,
+};
+
+/**
+ * Put parts of the CPU complex into or out of reset.\
+ *
+ * @param cpu          cpu number (0 or 1 on Tegra2)
+ * @param which                which parts of the complex to affect (OR of crc_reset_id)
+ * @param reset                1 to assert reset, 0 to de-assert
+ */
+void reset_cmplx_set_enable(int cpu, int which, int reset);
+
+/**
+ * Set the source for a peripheral clock. This plus the divisor sets the
+ * clock rate. You need to look up the datasheet to see the meaning of the
+ * source parameter as it changes for each peripheral.
+ *
+ * Warning: This function is only for use pre-relocation. Please use
+ * clock_start_periph_pll() instead.
+ *
+ * @param periph_id    peripheral to adjust
+ * @param source       source clock (0, 1, 2 or 3)
+ */
+void clock_ll_set_source(enum periph_id periph_id, unsigned source);
+
+/**
+ * Set the source and divisor for a peripheral clock. This sets the
+ * clock rate. You need to look up the datasheet to see the meaning of the
+ * source parameter as it changes for each peripheral.
+ *
+ * Warning: This function is only for use pre-relocation. Please use
+ * clock_start_periph_pll() instead.
+ *
+ * @param periph_id    peripheral to adjust
+ * @param source       source clock (0, 1, 2 or 3)
+ * @param divisor      divisor value to use
+ */
+void clock_ll_set_source_divisor(enum periph_id periph_id, unsigned source,
+               unsigned divisor);
+
+/**
+ * Start a peripheral PLL clock at the given rate. This also resets the
+ * peripheral.
+ *
+ * @param periph_id    peripheral to start
+ * @param parent       PLL id of required parent clock
+ * @param rate         Required clock rate in Hz
+ * @return rate selected in Hz, or -1U if something went wrong
+ */
+unsigned clock_start_periph_pll(enum periph_id periph_id,
+               enum clock_id parent, unsigned rate);
+
+/**
+ * Returns the rate of a peripheral clock in Hz. Since the caller almost
+ * certainly knows the parent clock (having just set it) we require that
+ * this be passed in so we don't need to work it out.
+ *
+ * @param periph_id    peripheral to start
+ * @param parent       PLL id of parent clock (used to calculate rate, you
+ *                     must know this!)
+ * @return clock rate of peripheral in Hz
+ */
+unsigned long clock_get_periph_rate(enum periph_id periph_id,
+               enum clock_id parent);
+
+/**
+ * Adjust peripheral PLL clock to the given rate. This does not reset the
+ * peripheral. If a second stage divisor is not available, pass NULL for
+ * extra_div. If it is available, then this parameter will return the
+ * divisor selected (which will be a power of 2 from 1 to 256).
+ *
+ * @param periph_id    peripheral to start
+ * @param parent       PLL id of required parent clock
+ * @param rate         Required clock rate in Hz
+ * @param extra_div    value for the second-stage divisor (NULL if one is
+                       not available)
+ * @return rate selected in Hz, or -1U if something went wrong
+ */
+unsigned clock_adjust_periph_pll_div(enum periph_id periph_id,
+               enum clock_id parent, unsigned rate, int *extra_div);
+
+/**
+ * Returns the clock rate of a specified clock, in Hz.
+ *
+ * @param parent       PLL id of clock to check
+ * @return rate of clock in Hz
+ */
+unsigned clock_get_rate(enum clock_id clkid);
+
+/**
+ * Start up a UART using low-level calls
+ *
+ * Prior to relocation clock_start_periph_pll() cannot be called. This
+ * function provides a way to set up a UART using low-level calls which
+ * do not require BSS.
+ *
+ * @param periph_id    Peripheral ID of UART to enable (e,g, PERIPH_ID_UART1)
+ */
+void clock_ll_start_uart(enum periph_id periph_id);
+
+/**
+ * Decode a peripheral ID from a device tree node.
+ *
+ * This works by looking up the peripheral's 'clocks' node and reading out
+ * the second cell, which is the clock number / peripheral ID.
+ *
+ * @param blob         FDT blob to use
+ * @param node         Node to look at
+ * @return peripheral ID, or PERIPH_ID_NONE if none
+ */
+enum periph_id clock_decode_periph_id(const void *blob, int node);
+
+/**
+ * Checks if the oscillator bypass is enabled (XOBP bit)
+ *
+ * @return 1 if bypass is enabled, 0 if not
+ */
+int clock_get_osc_bypass(void);
+
+/*
+ * Checks that clocks are valid and prints a warning if not
+ *
+ * @return 0 if ok, -1 on error
+ */
+int clock_verify(void);
+
+/* Initialize the clocks */
+void clock_init(void);
+
+/* Initialize the PLLs */
+void clock_early_init(void);
+
+#endif /* _CLOCK_H_ */
diff --git a/arch/arm/include/asm/arch-tegra/gpio.h b/arch/arm/include/asm/arch-tegra/gpio.h
new file mode 100644 (file)
index 0000000..0a972d5
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011, Google Inc. All rights reserved.
+ * 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 _TEGRA_GPIO_H_
+#define _TEGRA_GPIO_H_
+
+#define MAX_NUM_GPIOS           (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
+#define GPIO_NAME_SIZE         20      /* gpio_request max label len */
+
+#define GPIO_BANK(x)           ((x) >> 5)
+#define GPIO_PORT(x)           (((x) >> 3) & 0x3)
+#define GPIO_FULLPORT(x)       ((x) >> 3)
+#define GPIO_BIT(x)            ((x) & 0x7)
+
+/*
+ * Tegra-specific GPIO API
+ */
+
+void gpio_info(void);
+
+#define gpio_status()  gpio_info()
+#endif /* TEGRA_GPIO_H_ */
similarity index 90%
rename from arch/arm/include/asm/arch-tegra20/tegra20.h
rename to arch/arm/include/asm/arch-tegra/tegra.h
index c9485a1c8443ebb03ee926bbea1682295e8263bb..6d2e62f5594a4ae4ab72eddad8f4bdcf3196b0a7 100644 (file)
  * MA 02111-1307 USA
  */
 
-#ifndef _TEGRA20_H_
-#define _TEGRA20_H_
+#ifndef _TEGRA_H_
+#define _TEGRA_H_
 
-#define NV_PA_SDRAM_BASE       0x00000000
 #define NV_PA_ARM_PERIPHBASE   0x50040000
 #define NV_PA_PG_UP_BASE       0x60000000
 #define NV_PA_TMRUS_BASE       0x60005010
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
 #define NV_PA_NAND_BASE                (NV_PA_APB_MISC_BASE + 0x8000)
 #define NV_PA_SPI_BASE         (NV_PA_APB_MISC_BASE + 0xC380)
+#define TEGRA_DVC_BASE         (NV_PA_APB_MISC_BASE + 0xD000)
 #define NV_PA_PMC_BASE         (NV_PA_APB_MISC_BASE + 0xE400)
+#define NV_PA_EMC_BASE         (NV_PA_APB_MISC_BASE + 0xF400)
 #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
 
 #define NV_PA_SDRC_CS0         NV_PA_SDRAM_BASE
@@ -60,11 +59,10 @@ struct timerus {
 };
 
 /* Address at which WB code runs, it must not overlap Bootrom's IRAM usage */
-#define AP20_WB_RUN_ADDRESS    0x40020000
+#define NV_WB_RUN_ADDRESS      0x40020000
 
 #define NVBOOTINFOTABLE_BCTSIZE        0x38    /* BCT size in BIT in IRAM */
 #define NVBOOTINFOTABLE_BCTPTR 0x3C    /* BCT pointer in BIT in IRAM */
-#define BCT_ODMDATA_OFFSET     4068    /* 12 bytes from end of BCT */
 
 /* These are the available SKUs (product types) for Tegra */
 enum {
@@ -89,4 +87,4 @@ enum {
 #define PRM_RSTCTRL            NV_PA_PMC_BASE
 #endif
 
-#endif /* TEGRA20_H */
+#endif /* TEGRA_H */
similarity index 98%
rename from arch/arm/include/asm/arch-tegra20/tegra_i2c.h
rename to arch/arm/include/asm/arch-tegra/tegra_i2c.h
index 6abfe4e80b0406c189ee86d3ff3a31da82f71f81..26507447185f8285d61ddc56508be6f7d6a66f9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * NVIDIA Tegra20 I2C controller
+ * NVIDIA Tegra I2C controller
  *
  * Copyright 2010-2011 NVIDIA Corporation
  *
@@ -161,4 +161,4 @@ struct i2c_ctlr {
  */
 int tegra_i2c_get_dvc_bus_num(void);
 
-#endif
+#endif /* _TEGRA_I2C_H_ */
diff --git a/arch/arm/include/asm/arch-tegra20/clock-tables.h b/arch/arm/include/asm/arch-tegra20/clock-tables.h
new file mode 100644 (file)
index 0000000..089b3e7
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2010-2012 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
+ */
+
+/* Tegra20 clock PLL tables */
+
+#ifndef _CLOCK_TABLES_H_
+#define _CLOCK_TABLES_H_
+
+/* The PLLs supported by the hardware */
+enum clock_id {
+       CLOCK_ID_FIRST,
+       CLOCK_ID_CGENERAL = CLOCK_ID_FIRST,
+       CLOCK_ID_MEMORY,
+       CLOCK_ID_PERIPH,
+       CLOCK_ID_AUDIO,
+       CLOCK_ID_USB,
+       CLOCK_ID_DISPLAY,
+
+       /* now the simple ones */
+       CLOCK_ID_FIRST_SIMPLE,
+       CLOCK_ID_XCPU = CLOCK_ID_FIRST_SIMPLE,
+       CLOCK_ID_EPCI,
+       CLOCK_ID_SFROM32KHZ,
+
+       /* These are the base clocks (inputs to the Tegra SOC) */
+       CLOCK_ID_32KHZ,
+       CLOCK_ID_OSC,
+
+       CLOCK_ID_COUNT, /* number of clocks */
+       CLOCK_ID_NONE = -1,
+};
+
+/* The clocks supported by the hardware */
+enum periph_id {
+       PERIPH_ID_FIRST,
+
+       /* Low word: 31:0 */
+       PERIPH_ID_CPU = PERIPH_ID_FIRST,
+       PERIPH_ID_RESERVED1,
+       PERIPH_ID_RESERVED2,
+       PERIPH_ID_AC97,
+       PERIPH_ID_RTC,
+       PERIPH_ID_TMR,
+       PERIPH_ID_UART1,
+       PERIPH_ID_UART2,
+
+       /* 8 */
+       PERIPH_ID_GPIO,
+       PERIPH_ID_SDMMC2,
+       PERIPH_ID_SPDIF,
+       PERIPH_ID_I2S1,
+       PERIPH_ID_I2C1,
+       PERIPH_ID_NDFLASH,
+       PERIPH_ID_SDMMC1,
+       PERIPH_ID_SDMMC4,
+
+       /* 16 */
+       PERIPH_ID_TWC,
+       PERIPH_ID_PWM,
+       PERIPH_ID_I2S2,
+       PERIPH_ID_EPP,
+       PERIPH_ID_VI,
+       PERIPH_ID_2D,
+       PERIPH_ID_USBD,
+       PERIPH_ID_ISP,
+
+       /* 24 */
+       PERIPH_ID_3D,
+       PERIPH_ID_IDE,
+       PERIPH_ID_DISP2,
+       PERIPH_ID_DISP1,
+       PERIPH_ID_HOST1X,
+       PERIPH_ID_VCP,
+       PERIPH_ID_RESERVED30,
+       PERIPH_ID_CACHE2,
+
+       /* Middle word: 63:32 */
+       PERIPH_ID_MEM,
+       PERIPH_ID_AHBDMA,
+       PERIPH_ID_APBDMA,
+       PERIPH_ID_RESERVED35,
+       PERIPH_ID_KBC,
+       PERIPH_ID_STAT_MON,
+       PERIPH_ID_PMC,
+       PERIPH_ID_FUSE,
+
+       /* 40 */
+       PERIPH_ID_KFUSE,
+       PERIPH_ID_SBC1,
+       PERIPH_ID_SNOR,
+       PERIPH_ID_SPI1,
+       PERIPH_ID_SBC2,
+       PERIPH_ID_XIO,
+       PERIPH_ID_SBC3,
+       PERIPH_ID_DVC_I2C,
+
+       /* 48 */
+       PERIPH_ID_DSI,
+       PERIPH_ID_TVO,
+       PERIPH_ID_MIPI,
+       PERIPH_ID_HDMI,
+       PERIPH_ID_CSI,
+       PERIPH_ID_TVDAC,
+       PERIPH_ID_I2C2,
+       PERIPH_ID_UART3,
+
+       /* 56 */
+       PERIPH_ID_RESERVED56,
+       PERIPH_ID_EMC,
+       PERIPH_ID_USB2,
+       PERIPH_ID_USB3,
+       PERIPH_ID_MPE,
+       PERIPH_ID_VDE,
+       PERIPH_ID_BSEA,
+       PERIPH_ID_BSEV,
+
+       /* Upper word 95:64 */
+       PERIPH_ID_SPEEDO,
+       PERIPH_ID_UART4,
+       PERIPH_ID_UART5,
+       PERIPH_ID_I2C3,
+       PERIPH_ID_SBC4,
+       PERIPH_ID_SDMMC3,
+       PERIPH_ID_PCIE,
+       PERIPH_ID_OWR,
+
+       /* 72 */
+       PERIPH_ID_AFI,
+       PERIPH_ID_CORESIGHT,
+       PERIPH_ID_RESERVED74,
+       PERIPH_ID_AVPUCQ,
+       PERIPH_ID_RESERVED76,
+       PERIPH_ID_RESERVED77,
+       PERIPH_ID_RESERVED78,
+       PERIPH_ID_RESERVED79,
+
+       /* 80 */
+       PERIPH_ID_RESERVED80,
+       PERIPH_ID_RESERVED81,
+       PERIPH_ID_RESERVED82,
+       PERIPH_ID_RESERVED83,
+       PERIPH_ID_IRAMA,
+       PERIPH_ID_IRAMB,
+       PERIPH_ID_IRAMC,
+       PERIPH_ID_IRAMD,
+
+       /* 88 */
+       PERIPH_ID_CRAM2,
+
+       PERIPH_ID_COUNT,
+       PERIPH_ID_NONE = -1,
+};
+
+/* Converts a clock number to a clock register: 0=L, 1=H, 2=U */
+#define PERIPH_REG(id) ((id) >> 5)
+
+/* Mask value for a clock (within PERIPH_REG(id)) */
+#define PERIPH_MASK(id) (1 << ((id) & 0x1f))
+
+/* return 1 if a PLL ID is in range, and not a simple PLL */
+#define clock_id_is_pll(id) ((id) >= CLOCK_ID_FIRST && \
+               (id) < CLOCK_ID_FIRST_SIMPLE)
+
+#endif /* _CLOCK_TABLES_H_ */
index ff83bbf2938c6b2e2d6ebb6fcee577fc80750620..f592b9550e02c257862613834e16b78e8fd548e4 100644 (file)
  * MA 02111-1307 USA
  */
 
-/* Tegra2 clock control functions */
+/* Tegra20 clock control functions */
 
-#ifndef _CLOCK_H
-#define _CLOCK_H
+#ifndef _TEGRA20_CLOCK_H
+#define _TEGRA20_CLOCK_H
 
-/* Set of oscillator frequencies supported in the internal API. */
-enum clock_osc_freq {
-       /* All in MHz, so 13_0 is 13.0MHz */
-       CLOCK_OSC_FREQ_13_0,
-       CLOCK_OSC_FREQ_19_2,
-       CLOCK_OSC_FREQ_12_0,
-       CLOCK_OSC_FREQ_26_0,
+#include <asm/arch-tegra/clock.h>
 
-       CLOCK_OSC_FREQ_COUNT,
-};
-
-/* The PLLs supported by the hardware */
-enum clock_id {
-       CLOCK_ID_FIRST,
-       CLOCK_ID_CGENERAL = CLOCK_ID_FIRST,
-       CLOCK_ID_MEMORY,
-       CLOCK_ID_PERIPH,
-       CLOCK_ID_AUDIO,
-       CLOCK_ID_USB,
-       CLOCK_ID_DISPLAY,
-
-       /* now the simple ones */
-       CLOCK_ID_FIRST_SIMPLE,
-       CLOCK_ID_XCPU = CLOCK_ID_FIRST_SIMPLE,
-       CLOCK_ID_EPCI,
-       CLOCK_ID_SFROM32KHZ,
-
-       /* These are the base clocks (inputs to the Tegra SOC) */
-       CLOCK_ID_32KHZ,
-       CLOCK_ID_OSC,
-
-       CLOCK_ID_COUNT, /* number of clocks */
-       CLOCK_ID_NONE = -1,
-};
-
-/* The clocks supported by the hardware */
-enum periph_id {
-       PERIPH_ID_FIRST,
-
-       /* Low word: 31:0 */
-       PERIPH_ID_CPU = PERIPH_ID_FIRST,
-       PERIPH_ID_RESERVED1,
-       PERIPH_ID_RESERVED2,
-       PERIPH_ID_AC97,
-       PERIPH_ID_RTC,
-       PERIPH_ID_TMR,
-       PERIPH_ID_UART1,
-       PERIPH_ID_UART2,
-
-       /* 8 */
-       PERIPH_ID_GPIO,
-       PERIPH_ID_SDMMC2,
-       PERIPH_ID_SPDIF,
-       PERIPH_ID_I2S1,
-       PERIPH_ID_I2C1,
-       PERIPH_ID_NDFLASH,
-       PERIPH_ID_SDMMC1,
-       PERIPH_ID_SDMMC4,
-
-       /* 16 */
-       PERIPH_ID_TWC,
-       PERIPH_ID_PWM,
-       PERIPH_ID_I2S2,
-       PERIPH_ID_EPP,
-       PERIPH_ID_VI,
-       PERIPH_ID_2D,
-       PERIPH_ID_USBD,
-       PERIPH_ID_ISP,
-
-       /* 24 */
-       PERIPH_ID_3D,
-       PERIPH_ID_IDE,
-       PERIPH_ID_DISP2,
-       PERIPH_ID_DISP1,
-       PERIPH_ID_HOST1X,
-       PERIPH_ID_VCP,
-       PERIPH_ID_RESERVED30,
-       PERIPH_ID_CACHE2,
-
-       /* Middle word: 63:32 */
-       PERIPH_ID_MEM,
-       PERIPH_ID_AHBDMA,
-       PERIPH_ID_APBDMA,
-       PERIPH_ID_RESERVED35,
-       PERIPH_ID_KBC,
-       PERIPH_ID_STAT_MON,
-       PERIPH_ID_PMC,
-       PERIPH_ID_FUSE,
-
-       /* 40 */
-       PERIPH_ID_KFUSE,
-       PERIPH_ID_SBC1,
-       PERIPH_ID_SNOR,
-       PERIPH_ID_SPI1,
-       PERIPH_ID_SBC2,
-       PERIPH_ID_XIO,
-       PERIPH_ID_SBC3,
-       PERIPH_ID_DVC_I2C,
-
-       /* 48 */
-       PERIPH_ID_DSI,
-       PERIPH_ID_TVO,
-       PERIPH_ID_MIPI,
-       PERIPH_ID_HDMI,
-       PERIPH_ID_CSI,
-       PERIPH_ID_TVDAC,
-       PERIPH_ID_I2C2,
-       PERIPH_ID_UART3,
-
-       /* 56 */
-       PERIPH_ID_RESERVED56,
-       PERIPH_ID_EMC,
-       PERIPH_ID_USB2,
-       PERIPH_ID_USB3,
-       PERIPH_ID_MPE,
-       PERIPH_ID_VDE,
-       PERIPH_ID_BSEA,
-       PERIPH_ID_BSEV,
-
-       /* Upper word 95:64 */
-       PERIPH_ID_SPEEDO,
-       PERIPH_ID_UART4,
-       PERIPH_ID_UART5,
-       PERIPH_ID_I2C3,
-       PERIPH_ID_SBC4,
-       PERIPH_ID_SDMMC3,
-       PERIPH_ID_PCIE,
-       PERIPH_ID_OWR,
-
-       /* 72 */
-       PERIPH_ID_AFI,
-       PERIPH_ID_CORESIGHT,
-       PERIPH_ID_RESERVED74,
-       PERIPH_ID_AVPUCQ,
-       PERIPH_ID_RESERVED76,
-       PERIPH_ID_RESERVED77,
-       PERIPH_ID_RESERVED78,
-       PERIPH_ID_RESERVED79,
-
-       /* 80 */
-       PERIPH_ID_RESERVED80,
-       PERIPH_ID_RESERVED81,
-       PERIPH_ID_RESERVED82,
-       PERIPH_ID_RESERVED83,
-       PERIPH_ID_IRAMA,
-       PERIPH_ID_IRAMB,
-       PERIPH_ID_IRAMC,
-       PERIPH_ID_IRAMD,
-
-       /* 88 */
-       PERIPH_ID_CRAM2,
-
-       PERIPH_ID_COUNT,
-       PERIPH_ID_NONE = -1,
-};
-
-/* Converts a clock number to a clock register: 0=L, 1=H, 2=U */
-#define PERIPH_REG(id) ((id) >> 5)
-
-/* Mask value for a clock (within PERIPH_REG(id)) */
-#define PERIPH_MASK(id) (1 << ((id) & 0x1f))
-
-/* return 1 if a PLL ID is in range, and not a simple PLL */
-#define clock_id_is_pll(id) ((id) >= CLOCK_ID_FIRST && \
-               (id) < CLOCK_ID_FIRST_SIMPLE)
-
-/* PLL stabilization delay in usec */
-#define CLOCK_PLL_STABLE_DELAY_US 300
-
-/* return the current oscillator clock frequency */
-enum clock_osc_freq clock_get_osc_freq(void);
-
-/**
- * Start PLL using the provided configuration parameters.
- *
- * @param id   clock id
- * @param divm input divider
- * @param divn feedback divider
- * @param divp post divider 2^n
- * @param cpcon        charge pump setup control
- * @param lfcon        loop filter setup control
- *
- * @returns monotonic time in us that the PLL will be stable
- */
-unsigned long clock_start_pll(enum clock_id id, u32 divm, u32 divn,
-               u32 divp, u32 cpcon, u32 lfcon);
-
-/**
- * Read low-level parameters of a PLL.
- *
- * @param id   clock id to read (note: USB is not supported)
- * @param divm returns input divider
- * @param divn returns feedback divider
- * @param divp returns post divider 2^n
- * @param cpcon        returns charge pump setup control
- * @param lfcon        returns loop filter setup control
- *
- * @returns 0 if ok, -1 on error (invalid clock id)
- */
-int clock_ll_read_pll(enum clock_id clkid, u32 *divm, u32 *divn,
-                     u32 *divp, u32 *cpcon, u32 *lfcon);
-
-/*
- * Enable a clock
- *
- * @param id   clock id
- */
-void clock_enable(enum periph_id clkid);
-
-/*
- * Disable a clock
- *
- * @param id   clock id
- */
-void clock_disable(enum periph_id clkid);
-
-/*
- * Set whether a clock is enabled or disabled.
- *
- * @param id           clock id
- * @param enable       1 to enable, 0 to disable
- */
-void clock_set_enable(enum periph_id clkid, int enable);
-
-/**
- * Reset a peripheral. This puts it in reset, waits for a delay, then takes
- * it out of reset and waits for th delay again.
- *
- * @param periph_id    peripheral to reset
- * @param us_delay     time to delay in microseconds
- */
-void reset_periph(enum periph_id periph_id, int us_delay);
-
-/**
- * Put a peripheral into or out of reset.
- *
- * @param periph_id    peripheral to reset
- * @param enable       1 to put into reset, 0 to take out of reset
- */
-void reset_set_enable(enum periph_id periph_id, int enable);
-
-
-/* CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET/CLR_0 */
-enum crc_reset_id {
-       /* Things we can hold in reset for each CPU */
-       crc_rst_cpu = 1,
-       crc_rst_de = 1 << 2,    /* What is de? */
-       crc_rst_watchdog = 1 << 3,
-       crc_rst_debug = 1 << 4,
-};
-
-/**
- * Put parts of the CPU complex into or out of reset.\
- *
- * @param cpu          cpu number (0 or 1 on Tegra2)
- * @param which                which parts of the complex to affect (OR of crc_reset_id)
- * @param reset                1 to assert reset, 0 to de-assert
- */
-void reset_cmplx_set_enable(int cpu, int which, int reset);
-
-/**
- * Set the source for a peripheral clock. This plus the divisor sets the
- * clock rate. You need to look up the datasheet to see the meaning of the
- * source parameter as it changes for each peripheral.
- *
- * Warning: This function is only for use pre-relocation. Please use
- * clock_start_periph_pll() instead.
- *
- * @param periph_id    peripheral to adjust
- * @param source       source clock (0, 1, 2 or 3)
- */
-void clock_ll_set_source(enum periph_id periph_id, unsigned source);
-
-/**
- * Set the source and divisor for a peripheral clock. This sets the
- * clock rate. You need to look up the datasheet to see the meaning of the
- * source parameter as it changes for each peripheral.
- *
- * Warning: This function is only for use pre-relocation. Please use
- * clock_start_periph_pll() instead.
- *
- * @param periph_id    peripheral to adjust
- * @param source       source clock (0, 1, 2 or 3)
- * @param divisor      divisor value to use
- */
-void clock_ll_set_source_divisor(enum periph_id periph_id, unsigned source,
-               unsigned divisor);
-
-/**
- * Start a peripheral PLL clock at the given rate. This also resets the
- * peripheral.
- *
- * @param periph_id    peripheral to start
- * @param parent       PLL id of required parent clock
- * @param rate         Required clock rate in Hz
- * @return rate selected in Hz, or -1U if something went wrong
- */
-unsigned clock_start_periph_pll(enum periph_id periph_id,
-               enum clock_id parent, unsigned rate);
-
-/**
- * Returns the rate of a peripheral clock in Hz. Since the caller almost
- * certainly knows the parent clock (having just set it) we require that
- * this be passed in so we don't need to work it out.
- *
- * @param periph_id    peripheral to start
- * @param parent       PLL id of parent clock (used to calculate rate, you
- *                     must know this!)
- * @return clock rate of peripheral in Hz
- */
-unsigned long clock_get_periph_rate(enum periph_id periph_id,
-               enum clock_id parent);
-
-/**
- * Adjust peripheral PLL clock to the given rate. This does not reset the
- * peripheral. If a second stage divisor is not available, pass NULL for
- * extra_div. If it is available, then this parameter will return the
- * divisor selected (which will be a power of 2 from 1 to 256).
- *
- * @param periph_id    peripheral to start
- * @param parent       PLL id of required parent clock
- * @param rate         Required clock rate in Hz
- * @param extra_div    value for the second-stage divisor (NULL if one is
-                       not available)
- * @return rate selected in Hz, or -1U if something went wrong
- */
-unsigned clock_adjust_periph_pll_div(enum periph_id periph_id,
-               enum clock_id parent, unsigned rate, int *extra_div);
-
-/**
- * Returns the clock rate of a specified clock, in Hz.
- *
- * @param parent       PLL id of clock to check
- * @return rate of clock in Hz
- */
-unsigned clock_get_rate(enum clock_id clkid);
-
-/**
- * Start up a UART using low-level calls
- *
- * Prior to relocation clock_start_periph_pll() cannot be called. This
- * function provides a way to set up a UART using low-level calls which
- * do not require BSS.
- *
- * @param periph_id    Peripheral ID of UART to enable (e,g, PERIPH_ID_UART1)
- */
-void clock_ll_start_uart(enum periph_id periph_id);
-
-/**
- * Decode a peripheral ID from a device tree node.
- *
- * This works by looking up the peripheral's 'clocks' node and reading out
- * the second cell, which is the clock number / peripheral ID.
- *
- * @param blob         FDT blob to use
- * @param node         Node to look at
- * @return peripheral ID, or PERIPH_ID_NONE if none
- */
-enum periph_id clock_decode_periph_id(const void *blob, int node);
-
-/**
- * Checks if the oscillator bypass is enabled (XOBP bit)
- *
- * @return 1 if bypass is enabled, 0 if not
- */
-int clock_get_osc_bypass(void);
-
-/*
- * Checks that clocks are valid and prints a warning if not
- *
- * @return 0 if ok, -1 on error
- */
-int clock_verify(void);
-
-/* Initialize the clocks */
-void clock_init(void);
-
-/* Initialize the PLLs */
-void clock_early_init(void);
-
-#endif
+#endif /* _TEGRA20_CLOCK_H */
index 06be4c28be00a296dc2e4b29ebc0f7b09d96cf5b..e2848fec67ba58d038b20f8666ccf693f4beafd1 100644 (file)
@@ -20,8 +20,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef _TEGRA_GPIO_H_
-#define _TEGRA_GPIO_H_
+#ifndef _TEGRA20_GPIO_H_
+#define _TEGRA20_GPIO_H_
 
 /*
  * The Tegra 2x GPIO controller has 224 GPIOs arranged in 7 banks of 4 ports,
@@ -29,8 +29,8 @@
  */
 #define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
 #define TEGRA_GPIO_BANKS       7       /* number of banks */
-#define MAX_NUM_GPIOS          (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
-#define GPIO_NAME_SIZE         20      /* gpio_request max label len */
+
+#include <asm/arch-tegra/gpio.h>
 
 /* GPIO Controller registers for a single bank */
 struct gpio_ctlr_bank {
@@ -48,11 +48,6 @@ struct gpio_ctlr {
        struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
 };
 
-#define GPIO_BANK(x)           ((x) >> 5)
-#define GPIO_PORT(x)           (((x) >> 3) & 0x3)
-#define GPIO_FULLPORT(x)       ((x) >> 3)
-#define GPIO_BIT(x)            ((x) & 0x7)
-
 enum gpio_pin {
        GPIO_PA0 = 0,   /* pin 0 */
        GPIO_PA1,
@@ -280,11 +275,4 @@ enum gpio_pin {
        GPIO_PBB7,      /* pin 223 */
 };
 
-/*
- * Tegra20-specific GPIO API
- */
-
-void gpio_info(void);
-
-#define gpio_status()  gpio_info()
-#endif /* TEGRA_GPIO_H_ */
+#endif /* TEGRA20_GPIO_H_ */
diff --git a/arch/arm/include/asm/arch-tegra20/tegra.h b/arch/arm/include/asm/arch-tegra20/tegra.h
new file mode 100644 (file)
index 0000000..ca98733
--- /dev/null
@@ -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 _TEGRA20_H_
+#define _TEGRA20_H_
+
+#define NV_PA_SDRAM_BASE       0x00000000
+
+#include <asm/arch-tegra/tegra.h>
+
+#define TEGRA_USB1_BASE                0xC5000000
+#define TEGRA_USB3_BASE                0xC5008000
+
+#define BCT_ODMDATA_OFFSET     4068    /* 12 bytes from end of BCT */
+
+#endif /* TEGRA20_H */
index 93f12ea4f1914aade854f2dfbc3699925dcba0c9..7c05d492f4c05d5da9eb822e26b5a22b8d12e281 100644 (file)
 #include <ns16550.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
-#include <asm/arch/board.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/uart.h>
-#include <asm/arch/mmc.h>
-
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/board.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/mmc.h>
+#include <asm/arch-tegra/sys_proto.h>
+#include <asm/arch-tegra/uart.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
 #endif
index 0f8f167017267218d35ba52092123046d3b59d08..c73ac5f0f454a38247b87a9a7d6d06c9d3d54417 100644 (file)
@@ -16,9 +16,9 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/gpio.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
index 893cca8c19b202647ccbcf41db36af250af7e77c..7b22a87c46d576dc02a2066b3717f70e558b4aa9 100644 (file)
  */
 
 #include <common.h>
-#include <i2c.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/gpio.h>
+#include <i2c.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
 #endif
index afe832a5295198258ff208e4576f591737129e15..8821fdfeba31e3e371603ea24b5130857f316e3b 100644 (file)
 #include <ns16550.h>
 #include <linux/compiler.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/sys_proto.h>
-
-#include <asm/arch/board.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/pmc.h>
 #include <asm/arch/pmu.h>
-#include <asm/arch/uart.h>
-#include <asm/arch/warmboot.h>
-#include <spi.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/usb.h>
+#include <asm/arch-tegra/board.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/sys_proto.h>
+#include <asm/arch-tegra/uart.h>
+#include <asm/arch-tegra/warmboot.h>
+#include <spi.h>
 #include <i2c.h>
 #include "board.h"
 #include "emc.h"
index 739d4bd4420e6bdd8d2aa4e310761461ea20b393..26b6ec7c3b5965fc618fd43dcdd2c8eb5fe52d39 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ap20.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/pmu.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 6b2175879bac107db2adcfac26a232c21e8068a9..a0aeb7f0208d5087f66ebc42c0d8f6eba03908fb 100644 (file)
@@ -24,8 +24,8 @@
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/uart-spi-switch.h>
-#include <asm/arch/tegra20.h>
-#include <asm/arch/tegra_spi.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/tegra_spi.h>
 
 
 /* position of the UART/SPI select switch */
index b4a811dc5f9b985ba24c046794433d259859e831..c23a87ddade33de09b6d7b882d203521c0ab12d0 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/gpio.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
index 667f60a9bb940fe27422dc1f27dd24b83fe464d7..ab90a5d574f813eeeaf6f891334fa31150abf32d 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/gpio.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
index 598b2e5ce2518e646236b840629cb2d847df8720..af918c4f3678353c6db9b456084fd72e9bc65815 100644 (file)
  */
 
 #include <common.h>
-#include <i2c.h>
 #include <asm/io.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/gpio.h>
+#include <i2c.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mmc.h>
 #endif
index 747f4cf921213ffbdbbfe913de960b7f9d5319f2..2417968214d7f075db3cec79af623c21cc16f012 100644 (file)
@@ -30,7 +30,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
-#include <asm/arch/tegra20.h>
+#include <asm/arch/tegra.h>
 #include <asm/gpio.h>
 
 enum {
index e3be14e3cf3156a349bbf6abd03c520cd9b1d3aa..efc77fa910fcc7dcb969afc99d5c5822b99096f1 100644 (file)
 #include <fdtdec.h>
 #include <i2c.h>
 #include <asm/io.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/tegra_i2c.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/tegra_i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 6f1cfd81559c4c0a461bf1d9c69628fd5054c1ca..ab7a9e33ee0bf86e1539bc8e90a2b250d13c8f36 100644 (file)
@@ -30,7 +30,7 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-tegra/timer.h>
 #include <linux/input.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index ca8fad86572d9eaf3077912bbceae6d82a334907..8fea6a6bfb2cc0a9aa7c85c1b191e1972612233c 100644 (file)
  */
 
 #include <common.h>
-#include <mmc.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/tegra_mmc.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/tegra_mmc.h>
+#include <mmc.h>
 
 /* support 4 mmc hosts */
 struct mmc mmc_dev[4];
index 8c1de34455e30a0ac9c00414bbc609c32f5621dd..2c1b533bb0470cbc4f1fa9dccd7c8da2717e848c 100644 (file)
 #include <common.h>
 #include <asm/io.h>
 #include <nand.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/gpio.h>
+#include <asm/arch-tegra/clk_rst.h>
 #include <asm/errno.h>
-#include <asm-generic/gpio.h>
+#include <asm/gpio.h>
 #include <fdtdec.h>
 #include "tegra_nand.h"
 
index 18b00b2cae973d8160af54517c5806bedf378135..9bb34e29381f7a452717854b0d6dcc4edc5a879b 100644 (file)
  */
 
 #include <common.h>
-
 #include <malloc.h>
-#include <spi.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
-#include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/uart-spi-switch.h>
-#include <asm/arch/tegra_spi.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/tegra_spi.h>
+#include <spi.h>
 
 #if defined(CONFIG_SPI_CORRUPTS_UART)
  #define corrupt_delay()       udelay(CONFIG_SPI_CORRUPTS_UART_DLY);
index e213375dc5b8bd6052cba05afbec851727126e59..41fc0cbb0713a4642ff02874b73c8fe7893aba85 100644 (file)
@@ -36,7 +36,7 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE      32
 
-#include <asm/arch/tegra20.h>          /* get chip and board defs */
+#include <asm/arch/tegra.h>            /* get chip and board defs */
 
 /*
  * Display CPU and Board information