Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
authorWolfgang Denk <wd@denx.de>
Mon, 13 Feb 2012 22:15:25 +0000 (23:15 +0100)
committerWolfgang Denk <wd@denx.de>
Mon, 13 Feb 2012 22:15:25 +0000 (23:15 +0100)
* 'sf' of git://git.denx.de/u-boot-blackfin:
  README: Add description of SPI Flash (SF) command configuration
  sf command: allow default bus and chip selects
  sf: eeprom_m95xxx: set a sane default timeout
  sf: eeprom_m95xxx: fix up style

226 files changed:
MAINTAINERS
Makefile
README
arch/arm/cpu/arm1136/mx31/generic.c
arch/arm/cpu/arm926ejs/armada100/timer.c
arch/arm/cpu/arm926ejs/cache.c
arch/arm/cpu/arm926ejs/cpu.c
arch/arm/cpu/arm926ejs/davinci/cpu.c
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c
arch/arm/cpu/arm926ejs/davinci/lowlevel_init.S
arch/arm/cpu/arm926ejs/davinci/spl.c
arch/arm/cpu/arm926ejs/kirkwood/Makefile
arch/arm/cpu/arm926ejs/kirkwood/cache.c [new file with mode: 0644]
arch/arm/cpu/arm926ejs/kirkwood/timer.c
arch/arm/cpu/arm926ejs/mx27/generic.c
arch/arm/cpu/arm926ejs/mx28/mx28.c
arch/arm/cpu/arm926ejs/orion5x/timer.c
arch/arm/cpu/arm926ejs/pantheon/timer.c
arch/arm/cpu/arm926ejs/start.S
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/mx5/soc.c
arch/arm/cpu/armv7/omap-common/clocks-common.c
arch/arm/cpu/armv7/omap-common/hwinit-common.c
arch/arm/cpu/armv7/omap3/board.c
arch/arm/cpu/armv7/omap3/clock.c
arch/arm/cpu/armv7/omap3/lowlevel_init.S
arch/arm/cpu/armv7/omap3/sdrc.c
arch/arm/cpu/armv7/omap4/clocks.c
arch/arm/cpu/armv7/s5p-common/Makefile
arch/arm/cpu/armv7/s5p-common/wdt.c [new file with mode: 0644]
arch/arm/cpu/armv7/tegra2/board.c
arch/arm/cpu/armv7/tegra2/funcmux.c
arch/arm/include/asm/arch-davinci/da850_lowlevel.h
arch/arm/include/asm/arch-davinci/dm365_lowlevel.h
arch/arm/include/asm/arch-davinci/hardware.h
arch/arm/include/asm/arch-davinci/pll_defs.h
arch/arm/include/asm/arch-davinci/timer_defs.h
arch/arm/include/asm/arch-exynos/clock.h
arch/arm/include/asm/arch-exynos/cpu.h
arch/arm/include/asm/arch-exynos/dmc.h [new file with mode: 0644]
arch/arm/include/asm/arch-exynos/gpio.h
arch/arm/include/asm/arch-exynos/power.h [new file with mode: 0644]
arch/arm/include/asm/arch-exynos/pwm.h
arch/arm/include/asm/arch-exynos/tzpc.h [new file with mode: 0644]
arch/arm/include/asm/arch-exynos/watchdog.h [new file with mode: 0644]
arch/arm/include/asm/arch-kirkwood/config.h
arch/arm/include/asm/arch-kirkwood/kirkwood.h
arch/arm/include/asm/arch-mx27/clock.h
arch/arm/include/asm/arch-mx31/clock.h
arch/arm/include/asm/arch-mx31/imx-regs.h
arch/arm/include/asm/arch-mx31/sys_proto.h
arch/arm/include/asm/arch-mx6/mx6x_pins.h
arch/arm/include/asm/arch-omap3/clocks_omap3.h
arch/arm/include/asm/arch-omap3/ehci.h [new file with mode: 0644]
arch/arm/include/asm/arch-omap3/ehci_omap3.h [deleted file]
arch/arm/include/asm/arch-omap3/mem.h
arch/arm/include/asm/arch-omap3/sys_proto.h
arch/arm/include/asm/arch-omap4/ehci.h [new file with mode: 0644]
arch/arm/include/asm/arch-orion5x/orion5x.h
arch/arm/include/asm/arch-s5pc1xx/cpu.h
arch/arm/include/asm/arch-s5pc1xx/watchdog.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra2/funcmux.h
arch/arm/include/asm/ehci-omap.h [new file with mode: 0644]
arch/arm/include/asm/u-boot.h
arch/arm/lib/board.c
arch/blackfin/cpu/cache.S
arch/blackfin/include/asm/blackfin_local.h
arch/blackfin/include/asm/cache.h
arch/blackfin/include/asm/io.h
arch/blackfin/include/asm/linkage.h
arch/blackfin/lib/__kgdb.S
arch/blackfin/lib/outs.S
board/ait/cam_enc_4xx/cam_enc_4xx.c
board/ait/cam_enc_4xx/ublimage.cfg
board/avionic-design/common/tamonten.c
board/bf537-stamp/bf537-stamp.c
board/br4/Makefile [new file with mode: 0644]
board/br4/br4.c [new file with mode: 0644]
board/br4/config.mk [new file with mode: 0644]
board/compal/paz00/Makefile [new file with mode: 0644]
board/compal/paz00/paz00.c [new file with mode: 0644]
board/corscience/tricorder/Makefile [new file with mode: 0644]
board/corscience/tricorder/tricorder.c [new file with mode: 0644]
board/corscience/tricorder/tricorder.h [new file with mode: 0644]
board/d-link/dns325/Makefile [new file with mode: 0644]
board/d-link/dns325/dns325.c [new file with mode: 0644]
board/d-link/dns325/dns325.h [new file with mode: 0644]
board/d-link/dns325/kwbimage.cfg [new file with mode: 0644]
board/davinci/da8xxevm/da850evm.c
board/davinci/da8xxevm/hawkboard.c
board/davinci/da8xxevm/hawkboard_nand_spl.c [deleted file]
board/davinci/da8xxevm/u-boot-spl-da850evm.lds [new file with mode: 0644]
board/davinci/da8xxevm/u-boot-spl-hawk.lds [new file with mode: 0644]
board/davinci/da8xxevm/u-boot-spl.lds [deleted file]
board/efikamx/efikamx-usb.c
board/enbw/enbw_cmc/enbw_cmc.c
board/freescale/common/Makefile
board/freescale/mx6qarm2/mx6qarm2.c
board/freescale/mx6qsabrelite/mx6qsabrelite.c
board/hale/tt01/tt01.c
board/htkw/mcx/Makefile [new file with mode: 0644]
board/htkw/mcx/mcx.c [new file with mode: 0644]
board/htkw/mcx/mcx.h [new file with mode: 0644]
board/keymile/km_arm/km_arm.c
board/logicpd/omap3som/omap3logic.c
board/nvidia/harmony/harmony.c
board/nvidia/seaboard/seaboard.c
board/omicron/calimain/Makefile [new file with mode: 0644]
board/omicron/calimain/calimain.c [new file with mode: 0644]
board/pr1/Makefile [new file with mode: 0644]
board/pr1/config.mk [new file with mode: 0644]
board/pr1/pr1.c [new file with mode: 0644]
board/samsung/origen/lowlevel_init.S
board/samsung/origen/origen_setup.h
board/samsung/smdk5250/Makefile [new file with mode: 0644]
board/samsung/smdk5250/clock_init.c [new file with mode: 0644]
board/samsung/smdk5250/dmc_init.c [new file with mode: 0644]
board/samsung/smdk5250/lowlevel_init.S [new file with mode: 0644]
board/samsung/smdk5250/mmc_boot.c [new file with mode: 0644]
board/samsung/smdk5250/setup.h [new file with mode: 0644]
board/samsung/smdk5250/smdk5250.c [new file with mode: 0644]
board/samsung/smdk5250/tzpc_init.c [new file with mode: 0644]
board/samsung/trats/Makefile [new file with mode: 0644]
board/samsung/trats/setup.h [new file with mode: 0644]
board/samsung/trats/trats.c [new file with mode: 0644]
board/technexion/twister/twister.c
board/teejet/mt_ventoux/Makefile [new file with mode: 0644]
board/teejet/mt_ventoux/mt_ventoux.c [new file with mode: 0644]
board/teejet/mt_ventoux/mt_ventoux.h [new file with mode: 0644]
board/ti/beagle/beagle.c
board/ti/beagle/beagle.h
board/ti/panda/panda.c
board/ti/panda/panda_mux_data.h
boards.cfg
common/cmd_bdinfo.c
common/cmd_nvedit.c
common/main.c
common/menu.c
doc/README.SPL
doc/README.hawkboard
doc/README.imximage
doc/README.menu
doc/README.omap-ulpi-viewport [new file with mode: 0644]
drivers/block/pata_bfin.c
drivers/mmc/mxcmmc.c
drivers/mmc/tegra2_mmc.c
drivers/mtd/nand/bfin_nand.c
drivers/spi/kirkwood_spi.c
drivers/spi/mxs_spi.c
drivers/usb/host/Makefile
drivers/usb/host/ehci-kirkwood.c [deleted file]
drivers/usb/host/ehci-marvell.c [new file with mode: 0644]
drivers/usb/host/ehci-omap.c [new file with mode: 0644]
drivers/usb/ulpi/Makefile
drivers/usb/ulpi/omap-ulpi-viewport.c [new file with mode: 0644]
drivers/usb/ulpi/ulpi-viewport.c
drivers/usb/ulpi/ulpi.c
include/common.h
include/configs/MPC8536DS.h
include/configs/P1010RDB.h
include/configs/P1_P2_RDB.h
include/configs/P2020COME.h
include/configs/P2020DS.h
include/configs/P2041RDB.h
include/configs/PM826.h
include/configs/PM828.h
include/configs/VCMA9.h
include/configs/am3517_evm.h
include/configs/br4.h [new file with mode: 0644]
include/configs/calimain.h [new file with mode: 0644]
include/configs/cam_enc_4xx.h
include/configs/coreboot.h
include/configs/corenet_ds.h
include/configs/da830evm.h
include/configs/da850evm.h
include/configs/davinci_dm355evm.h
include/configs/davinci_dm355leopard.h
include/configs/davinci_dm365evm.h
include/configs/davinci_dm6467Tevm.h
include/configs/davinci_dm6467evm.h
include/configs/davinci_dvevm.h
include/configs/davinci_schmoogie.h
include/configs/davinci_sffsdr.h
include/configs/davinci_sonata.h
include/configs/dns325.h [new file with mode: 0644]
include/configs/ea20.h
include/configs/ecovec.h
include/configs/edminiv2.h
include/configs/efikamx.h
include/configs/enbw_cmc.h
include/configs/ethernut5.h
include/configs/flea3.h
include/configs/hawkboard.h
include/configs/km/km_arm.h
include/configs/m28evk.h
include/configs/mcx.h [new file with mode: 0644]
include/configs/mt_ventoux.h [new file with mode: 0644]
include/configs/mx6qarm2.h
include/configs/mx6qsabrelite.h
include/configs/omap3_beagle.h
include/configs/omap3_evm_common.h
include/configs/omap3_mvblx.h
include/configs/omap4_panda.h
include/configs/origen.h
include/configs/p1_p2_rdb_pc.h
include/configs/paz00.h [new file with mode: 0644]
include/configs/pr1.h [new file with mode: 0644]
include/configs/s5pc210_universal.h
include/configs/smdk2410.h
include/configs/smdk5250.h [new file with mode: 0644]
include/configs/tam3517-common.h
include/configs/trats.h [new file with mode: 0644]
include/configs/tricorder.h [new file with mode: 0644]
include/configs/tt01.h
include/linux/linkage.h [new file with mode: 0644]
include/mc13783.h [new file with mode: 0644]
include/menu.h
include/usb/ulpi.h
nand_spl/board/davinci/da8xxevm/Makefile [deleted file]
nand_spl/board/davinci/da8xxevm/u-boot.lds [deleted file]
post/post.c
tools/Makefile
tools/imximage.c
tools/imximage.h
tools/mkexynosspl.c [new file with mode: 0644]

index 8c4fe2df8de531e36d09d9e428ca9376572590df..1e40af2c8c5e2d850cdbce33ee2c3ba0340b405e 100644 (file)
@@ -574,6 +574,7 @@ Stefano Babic <sbabic@denx.de>
 
        ea20            davinci
        flea3           i.MX35
+       mt_ventoux      omap3
        mx35pdk         i.MX35
        mx51evk         i.MX51
        polaris         xscale/pxa
@@ -677,6 +678,10 @@ Kshitij Gupta <kshitij@ti.com>
        omap1510inn     ARM925T
        omap1610inn     ARM926EJS
 
+Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+
+       dns325          ARM926EJS (Kirkwood SoC)
+
 Vaibhav Hiremath <hvaibhav@ti.com>
 
        am3517_evm      ARM ARMV7 (AM35x SoC)
@@ -713,6 +718,11 @@ Chander Kashyap <k.chander@samsung.com>
 
        origen                  ARM ARMV7 (EXYNOS4210 SoC)
        SMDKV310                ARM ARMV7 (EXYNOS4210 SoC)
+       SMDK5250                ARM ARMV7 (EXYNOS5250 SoC)
+
+Heungjun Kim <riverful.kim@samsung.com>
+
+       trats                   ARM ARMV7 (EXYNOS4210 SoC)
 
 Torsten Koschorrek <koschorrek@synertronixx.de>
        scb9328         ARM920T (i.MXL)
@@ -796,6 +806,11 @@ Thierry Reding <thierry.reding@avionic-design.de>
        plutux          Tegra2 (ARM7 & A9 Dual Core)
        medcom          Tegra2 (ARM7 & A9 Dual Core)
 
+Christian Riesch <christian.riesch@omicron.at>
+Manfred Rudigier <manfred.rudigier@omicron.at>
+
+       calimain        ARM926EJS (AM1808 SoC)
+
 Tom Rini <trini@ti.com>
 
        omap3_evm       ARM ARMV7 (OMAP3xx SoC)
@@ -899,10 +914,12 @@ Tom Warren <twarren@nvidia.com>
 Stephen Warren <swarren@nvidia.com>
 
        ventana         Tegra2 (ARM7 & A9 Dual Core)
+       paz00           Tegra2 (ARM7 & A9 Dual Core)
 
 Thomas Weber <weber@corscience.de>
 
        devkit8000      ARM ARMV7 (OMAP3530 SoC)
+       tricorder       ARM ARMV7 (OMAP3503 SoC)
 
 Lei Wen <leiwen@marvell.com>
 
@@ -917,6 +934,10 @@ Richard Woodruff <r-woodruff2@ti.com>
 
        omap2420h4      ARM1136EJS
 
+Ilya Yanok <yanok@emcraft.com>
+
+       mcx             ARM ARMV7 (AM35x SoC)
+
 Syed Mohammed Khasim <sm.khasim@gmail.com>
 Sughosh Ganu <urwithsughosh@gmail.com>
 
@@ -1162,6 +1183,11 @@ Chong Huang <chuang@ucrobotics.com>
 
        bf525-ucr2      BF525
 
+Dimitar Penev <dpn@switchfin.org>
+
+       BR4 Appliance   BF537
+       PR1 Appliance   BF537
+
 #########################################################################
 # NDS32 Systems:                                                       #
 #                                                                      #
index 36246b653e2336a84fd64ad9b210dc4037154a88..11aac21ea9b722b6d03273e9e1853d90689c7263 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -667,14 +667,6 @@ ucname     = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
 # ARM
 #========================================================================
 
-spear300_config \
-spear310_config \
-spear320_config :      unconfig
-       @$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :      unconfig
-       @$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
-
 SX1_stdout_serial_config \
 SX1_config:            unconfig
        @mkdir -p $(obj)include
@@ -735,6 +727,7 @@ clean:
               $(obj)tools/gdb/{astest,gdbcont,gdbsend}                   \
               $(obj)tools/gen_eth_addr    $(obj)tools/img2srec           \
               $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk         \
+              $(obj)tools/mk{smdk5250,}spl                               \
               $(obj)tools/ncb             $(obj)tools/ubsha1
        @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}        \
               $(obj)board/matrix_vision/*/bootscript.img                 \
diff --git a/README b/README
index 52cf37c1f80315969ef50b8ee6f10e95013778c6..eba6378536858da57d307e6f7d9721930b00f782 100644 (file)
--- a/README
+++ b/README
@@ -420,6 +420,12 @@ The following options need to be configured:
                XWAY SoCs for booting from NOR flash. The U-Boot image needs to
                be swapped if a flash programmer is used.
 
+- ARM options:
+               CONFIG_SYS_EXCEPTION_VECTORS_HIGH
+
+               Select high exception vectors of the ARM core, e.g., do not
+               clear the V bit of the c1 register of CP15.
+
 - Linux Kernel Interface:
                CONFIG_CLOCKS_IN_MHZ
 
index f45828141e6013ecdcc67de2382ebb54716dcd0d..d60afc9a33f57bee8efc17b16782ea1cf388bbd9 100644 (file)
@@ -101,6 +101,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
        case MXC_IPG_PERCLK:
        case MXC_CSPI_CLK:
        case MXC_UART_CLK:
+       case MXC_ESDHC_CLK:
                return mx31_get_ipg_clk();
        case MXC_IPU_CLK:
                return mx31_get_hsp_clk();
index fbade4b45961515c1fdc1ef06629016d1b80dfae..355cd6d1d8200e055b639698273b7fc70a12f9b2 100644 (file)
@@ -190,3 +190,21 @@ void reset_cpu (unsigned long ignored)
 
        while(1);
 }
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+       return (ulong)CONFIG_SYS_HZ;
+}
index ee90ab71958792f5257a304d6db5be589f21d510..504f604684d5098b8048338a63ab5dae7d573b55 100644 (file)
@@ -68,3 +68,12 @@ void  flush_cache(unsigned long start, unsigned long size)
 {
 }
 #endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
+
+/*
+ * Stub implementations for l2 cache operations
+ */
+void __l2_cache_disable(void)
+{
+}
+void l2_cache_disable(void)
+        __attribute__((weak, alias("__l2_cache_disable")));
index 5c902dfc133dea358d1e81a4a37e552d7603ee6b..626384c3fc1e3d4156dded9141b55d95987c1216 100644 (file)
@@ -50,6 +50,8 @@ int cleanup_before_linux (void)
        /* turn off I/D-cache */
        icache_disable();
        dcache_disable();
+       l2_cache_disable();
+
        /* flush I/D-cache */
        cache_flush();
 
index 9ea97853c7652ff6178b404326ac81b041843a33..b3c9fb7b6991da12818f0aa6e8311b6684d2fb1a 100644 (file)
@@ -25,6 +25,8 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* offsets from PLL controller base */
 #define PLLC_PLLCTL    0x100
 #define PLLC_PLLM      0x110
@@ -115,21 +117,8 @@ int clk_get(enum davinci_clk_ids id)
 out:
        return pll_out;
 }
-#ifdef CONFIG_DISPLAY_CPUINFO
-int print_cpuinfo(void)
-{
-       printf("Cores: ARM %d MHz",
-                       clk_get(DAVINCI_ARM_CLKID) / 1000000);
-       printf("\nDDR:   %d MHz\n",
-                       /* DDR PHY uses an x2 input clock */
-                       clk_get(0x10001) / 1000000);
-       return 0;
-}
-#endif
 #else /* CONFIG_SOC_DA8XX */
 
-#ifdef CONFIG_DISPLAY_CPUINFO
-
 static unsigned pll_div(volatile void *pllbase, unsigned offset)
 {
        u32     div;
@@ -185,36 +174,6 @@ static unsigned pll_sysclk_mhz(unsigned pll_addr, unsigned div)
        return DIV_ROUND_UP(base, 1000 * pll_div(pllbase, div));
 }
 
-int print_cpuinfo(void)
-{
-       /* REVISIT fetch and display CPU ID and revision information
-        * too ... that will matter as more revisions appear.
-        */
-#if defined(CONFIG_SOC_DM365)
-       printf("Cores: ARM %d MHz",
-                       pll_sysclk_mhz(DAVINCI_PLL_CNTRL1_BASE, ARM_PLLDIV));
-#else
-       printf("Cores: ARM %d MHz",
-                       pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, ARM_PLLDIV));
-#endif
-
-#ifdef DSP_PLLDIV
-       printf(", DSP %d MHz",
-                       pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, DSP_PLLDIV));
-#endif
-
-       printf("\nDDR:   %d MHz\n",
-                       /* DDR PHY uses an x2 input clock */
-#if defined(CONFIG_SOC_DM365)
-                       pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, DDR_PLLDIV)
-                               / 2);
-#else
-                       pll_sysclk_mhz(DAVINCI_PLL_CNTRL1_BASE, DDR_PLLDIV)
-                               / 2);
-#endif
-       return 0;
-}
-
 #ifdef DAVINCI_DM6467EVM
 unsigned int davinci_arm_clk_get()
 {
@@ -228,9 +187,38 @@ unsigned int davinci_clk_get(unsigned int div)
        return pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, div) * 1000000;
 }
 #endif
-#endif /* CONFIG_DISPLAY_CPUINFO */
 #endif /* !CONFIG_SOC_DA8XX */
 
+int set_cpu_clk_info(void)
+{
+#ifdef CONFIG_SOC_DA8XX
+       gd->bd->bi_arm_freq = clk_get(DAVINCI_ARM_CLKID) / 1000000;
+       /* DDR PHY uses an x2 input clock */
+       gd->bd->bi_ddr_freq = clk_get(0x10001) / 1000000;
+#else
+
+       unsigned int pllbase = DAVINCI_PLL_CNTRL0_BASE;
+#if defined(CONFIG_SOC_DM365)
+       pllbase = DAVINCI_PLL_CNTRL1_BASE;
+#endif
+       gd->bd->bi_arm_freq = pll_sysclk_mhz(pllbase, ARM_PLLDIV);
+
+#ifdef DSP_PLLDIV
+       gd->bd->bi_dsp_freq =
+               pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, DSP_PLLDIV);
+#else
+       gd->bd->bi_dsp_freq = 0;
+#endif
+
+       pllbase = DAVINCI_PLL_CNTRL1_BASE;
+#if defined(CONFIG_SOC_DM365)
+       pllbase = DAVINCI_PLL_CNTRL0_BASE;
+#endif
+       gd->bd->bi_ddr_freq = pll_sysclk_mhz(pllbase, DDR_PLLDIV) / 2;
+#endif
+       return 0;
+}
+
 /*
  * Initializes on-chip ethernet controllers.
  * to override, implement board_eth_init()
index a532f8ab6063270c16aed1504b14fc5c94319159..df7d6a24ba2b2fc68e34ee74c5d5a0ba88d55e42 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
 
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
 void da850_waitloop(unsigned long loopcnt)
 {
        unsigned long   i;
@@ -85,6 +86,13 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
        /* Enable the PLL from Disable Mode PLLDIS bit to 0 */
        clrbits_le32(&reg->pllctl, PLLCTL_PLLDIS);
 
+#if defined(CONFIG_SYS_DA850_PLL0_PREDIV)
+       /* program the prediv */
+       if (reg == davinci_pllc0_regs && CONFIG_SYS_DA850_PLL0_PREDIV)
+               writel((PLL_DIVEN | CONFIG_SYS_DA850_PLL0_PREDIV),
+                       &reg->prediv);
+#endif
+
        /* Program the required multiplier value in PLLM */
        writel(pllmult, &reg->pllm);
 
@@ -156,7 +164,9 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
 
        return 0;
 }
+#endif /* CONFIG_SYS_DA850_PLL_INIT */
 
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
 int da850_ddr_setup(void)
 {
        unsigned long   tmp;
@@ -235,6 +245,7 @@ int da850_ddr_setup(void)
 
        return 0;
 }
+#endif /* CONFIG_SYS_DA850_DDR_INIT */
 
 __attribute__((weak))
 void board_gpio_init(void)
@@ -242,10 +253,6 @@ void board_gpio_init(void)
        return;
 }
 
-/* pinmux_resource[] vector is defined in the board specific file */
-extern const struct pinmux_resource pinmuxes[];
-extern const int pinmuxes_size;
-
 int arch_cpu_init(void)
 {
        /* Unlock kick registers */
@@ -259,13 +266,11 @@ int arch_cpu_init(void)
        if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
                return 1;
 
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
        /* PLL setup */
        da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
        da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
-
-       /* GPIO setup */
-       board_gpio_init();
-
+#endif
        /* setup CSn config */
 #if defined(CONFIG_SYS_DA850_CS2CFG)
        writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
@@ -274,7 +279,12 @@ int arch_cpu_init(void)
        writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
 #endif
 
-       lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
+       da8xx_configure_lpsc_items(lpsc, lpsc_size);
+
+       /* GPIO setup */
+       board_gpio_init();
+
+
        NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
                        CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
 
@@ -286,6 +296,9 @@ int arch_cpu_init(void)
                DAVINCI_UART_PWREMU_MGMT_UTRST),
               &davinci_uart2_ctrl_regs->pwremu_mgmt);
 
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
        da850_ddr_setup();
+#endif
+
        return 0;
 }
index 6e998ded99e7cf7609d2a841f178b81d4cf723a4..c9936fd0de9e92c94ac545c6e6b69c8cc0bd9591 100644 (file)
@@ -254,7 +254,7 @@ int dm365_ddr_setup(void)
        return 0;
 }
 
-void dm365_vpss_sync_reset(void)
+static void dm365_vpss_sync_reset(void)
 {
        unsigned int PdNum = 0;
 
@@ -276,11 +276,52 @@ void dm365_vpss_sync_reset(void)
                ;
 }
 
-void dm365_por_reset(void)
+static void dm365_por_reset(void)
 {
+       struct davinci_timer *wdog =
+               (struct davinci_timer *)DAVINCI_WDOG_BASE;
+
        if (readl(&dv_pll0_regs->rstype) &
-               (PLL_RSTYPE_POR | PLL_RSTYPE_XWRST))
+               (PLL_RSTYPE_POR | PLL_RSTYPE_XWRST)) {
+               dm365_vpss_sync_reset();
+
+               writel(DV_TMPBUF_VAL, TMPBUF);
+               setbits_le32(TMPSTATUS, FLAG_PORRST);
+               writel(DV_WDT_ENABLE_SYS_RESET, &wdog->na1);
+               writel(DV_WDT_TRIGGER_SYS_RESET, &wdog->na2);
+
+               while (1);
+       }
+}
+
+static void dm365_wdt_reset(void)
+{
+       struct davinci_timer *wdog =
+               (struct davinci_timer *)DAVINCI_WDOG_BASE;
+
+       if (readl(TMPBUF) != DV_TMPBUF_VAL) {
+               writel(DV_TMPBUF_VAL, TMPBUF);
+               setbits_le32(TMPSTATUS, FLAG_PORRST);
+               setbits_le32(TMPSTATUS, FLAG_FLGOFF);
+
+               dm365_waitloop(100);
+
                dm365_vpss_sync_reset();
+
+               writel(DV_WDT_ENABLE_SYS_RESET, &wdog->na1);
+               writel(DV_WDT_TRIGGER_SYS_RESET, &wdog->na2);
+
+               while (1);
+       }
+}
+
+static void dm365_wdt_flag_on(void)
+{
+       /* VPSS_CLKMD 1:2 */
+       clrbits_le32(&dv_sys_module_regs->vpss_clkctl,
+               VPSS_CLK_CTL_VPSS_CLKMD);
+       writel(0, TMPBUF);
+       setbits_le32(TMPSTATUS, FLAG_FLGON);
 }
 
 void dm365_psc_init(void)
@@ -382,6 +423,9 @@ void dm36x_lowlevel_init(ulong bootflag)
        writel(0xffffffff, &dv_aintc_regs->irq0);
        writel(0xffffffff, &dv_aintc_regs->irq1);
 
+       dm365_por_reset();
+       dm365_wdt_reset();
+
        /* System PSC setup - enable all */
        dm365_psc_init();
 
@@ -418,6 +462,8 @@ void dm36x_lowlevel_init(ulong bootflag)
        puts("emif init\n");
        dm365_emif_init();
 
+       dm365_wdt_flag_on();
+
 #if defined(CONFIG_POST)
        /*
         * Do memory tests, calls arch_memory_failure_handle()
index 7a169b107677e58edc59fc2f4ef81ea3417ab7a8..5b39484501c1d8805931c42c1fa9f93bda40e7f6 100644 (file)
@@ -49,6 +49,7 @@
 
 .globl lowlevel_init
 lowlevel_init:
+#ifdef CONFIG_SOC_DM644X
 
        /*-------------------------------------------------------*
         * Mask all IRQs by setting all bits in the EINT default *
@@ -707,3 +708,6 @@ DDR2_START_ADDR:
        .word   0x80000000
 DUMMY_VAL:
        .word   0xa55aa55a
+#else /* CONFIG_SOC_DM644X */
+       mov pc, lr
+#endif
index f475f9ba75fa72c3988e44b88f8bfc73163e7c33..74632e516192e2ddcbf9956d4b76ce49ed7f3ac3 100644 (file)
@@ -74,12 +74,12 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SOC_DM365
+#ifdef CONFIG_SPL_NAND_LOAD
        nand_init();
        puts("Nand boot...\n");
        nand_boot();
 #endif
-#ifdef CONFIG_SOC_DA8XX
+#ifdef CONFIG_SPL_SPI_LOAD
        mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
                        CONFIG_SYS_MALLOC_LEN);
 
index 07542975e68b8a259a8caef81a575eef81f4fdaf..777006c4fd905e296fcbbafe51eb14ff13b780a0 100644 (file)
@@ -30,6 +30,7 @@ COBJS-y       = cpu.o
 COBJS-y        += dram.o
 COBJS-y        += mpp.o
 COBJS-y        += timer.o
+COBJS-y        += cache.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cache.c b/arch/arm/cpu/arm926ejs/kirkwood/cache.c
new file mode 100644 (file)
index 0000000..645d962
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012 Michael Walle
+ * Michael Walle <michael@walle.cc>
+ *
+ * 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.
+ */
+#include <common.h>
+#include <asm/arch/cpu.h>
+
+#define FEROCEON_EXTRA_FEATURE_L2C_EN (1<<22)
+
+void l2_cache_disable()
+{
+       u32 ctrl;
+
+       ctrl = readfr_extra_feature_reg();
+       ctrl &= ~FEROCEON_EXTRA_FEATURE_L2C_EN;
+       writefr_extra_feature_reg(ctrl);
+}
index a98f54c05bff1e0bc7430e1a1655a4962b479a89..f5d01603977a01affebaacfc87dd67da986d3109 100644 (file)
@@ -153,3 +153,21 @@ int timer_init(void)
 
        return 0;
 }
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+       return (ulong)CONFIG_SYS_HZ;
+}
index 34c20e1bae5a1d2e97132e4489d304f7ee5fe5b6..65c481378418eca6341d350ef176a5583ea01f81 100644 (file)
@@ -23,6 +23,7 @@
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
 #ifdef CONFIG_MXC_MMC
 #include <asm/arch/mxcmmc.h>
 #endif
@@ -34,7 +35,7 @@
  *  f = 2 * f_ref * --------------------
  *                        pd + 1
  */
-unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref)
+static unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref)
 {
        unsigned int mfi = (pll >> 10) & 0xf;
        unsigned int mfn = pll & 0x3ff;
@@ -64,7 +65,7 @@ static ulong clk_in_26m(void)
        }
 }
 
-ulong imx_get_mpllclk(void)
+static ulong imx_get_mpllclk(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
        ulong cscr = readl(&pll->cscr);
@@ -78,7 +79,7 @@ ulong imx_get_mpllclk(void)
        return imx_decode_pll(readl(&pll->mpctl0), fref);
 }
 
-ulong imx_get_armclk(void)
+static ulong imx_get_armclk(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
        ulong cscr = readl(&pll->cscr);
@@ -93,7 +94,7 @@ ulong imx_get_armclk(void)
        return lldiv(fref, div);
 }
 
-ulong imx_get_ahbclk(void)
+static ulong imx_get_ahbclk(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
        ulong cscr = readl(&pll->cscr);
@@ -105,7 +106,7 @@ ulong imx_get_ahbclk(void)
        return lldiv(fref * 2, 3 * div);
 }
 
-ulong imx_get_spllclk(void)
+static __attribute__((unused)) ulong imx_get_spllclk(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
        ulong cscr = readl(&pll->cscr);
@@ -124,34 +125,50 @@ static ulong imx_decode_perclk(ulong div)
        return lldiv((imx_get_mpllclk() * 2), (div * 3));
 }
 
-ulong imx_get_perclk1(void)
+static ulong imx_get_perclk1(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
 
        return imx_decode_perclk((readl(&pll->pcdr1) & 0x3f) + 1);
 }
 
-ulong imx_get_perclk2(void)
+static ulong imx_get_perclk2(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
 
        return imx_decode_perclk(((readl(&pll->pcdr1) >> 8) & 0x3f) + 1);
 }
 
-ulong imx_get_perclk3(void)
+static __attribute__((unused)) ulong imx_get_perclk3(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
 
        return imx_decode_perclk(((readl(&pll->pcdr1) >> 16) & 0x3f) + 1);
 }
 
-ulong imx_get_perclk4(void)
+static __attribute__((unused)) ulong imx_get_perclk4(void)
 {
        struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
 
        return imx_decode_perclk(((readl(&pll->pcdr1) >> 24) & 0x3f) + 1);
 }
 
+unsigned int mxc_get_clock(enum mxc_clock clk)
+{
+       switch (clk) {
+       case MXC_ARM_CLK:
+               return imx_get_armclk();
+       case MXC_UART_CLK:
+               return imx_get_perclk1();
+       case MXC_FEC_CLK:
+               return imx_get_ahbclk();
+       case MXC_ESDHC_CLK:
+               return imx_get_perclk2();
+       }
+       return -1;
+}
+
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo (void)
 {
index da903605a2ba5ca5e49d5955ce7de8526535e748..683777f50cf6e4612cf24da532469063494f52ac 100644 (file)
@@ -169,7 +169,8 @@ int arch_cpu_init(void)
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {
-       printf("Freescale i.MX28 family\n");
+       printf("Freescale i.MX28 family at %d MHz\n",
+                       mxc_get_clock(MXC_ARM_CLK) / 1000000);
        return 0;
 }
 #endif
index e39ecc245b476fd25ea4a030e9580af179570b43..8a8aaf15d901b440f4437afa56efb68233586866 100644 (file)
@@ -167,3 +167,21 @@ void timer_init_r(void)
        lastdec = read_timer();
        timestamp = 0;
 }
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+       return (ulong)CONFIG_SYS_HZ;
+}
index 17045b1c2f688e423e39254125a4032e89f652fa..28aadada7033bad0e82a9a4b7a2e2e34198b4935 100644 (file)
@@ -197,3 +197,21 @@ void reset_cpu (unsigned long ignored)
        /*enable functional WDT clock */
        writel(APBC_APBCLK | APBC_FNCLK, &mpmu->wdtpcr);
 }
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+       return (ulong)CONFIG_SYS_HZ;
+}
index 6a09c028e45357f68cbac3aa3502c3a5af9a737a..6f05f1ac49c0e2c1d19a1eafb4bfdc418b214c35 100644 (file)
@@ -194,7 +194,9 @@ reset:
         * we do sys-critical inits only at reboot,
         * not when booting from ram!
         */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
        bl      cpu_init_crit
+#endif
 
 /* Set stackpointer in internal RAM to call board_init_f */
 call_board_init_f:
@@ -353,33 +355,45 @@ _dynsym_start_ofs:
  *
  *************************************************************************
  */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 cpu_init_crit:
        /*
-        * flush v4 I/D caches
+        * flush D cache before disabling it
         */
        mov     r0, #0
-       mcr     p15, 0, r0, c7, c7, 0   /* flush v3/v4 cache */
-       mcr     p15, 0, r0, c8, c7, 0   /* flush v4 TLB */
+flush_dcache:
+       mrc     p15, 0, r15, c7, c10, 3
+       bne     flush_dcache
+
+       mcr     p15, 0, r0, c8, c7, 0   /* invalidate TLB */
+       mcr     p15, 0, r0, c7, c5, 0   /* invalidate I Cache */
 
        /*
-        * disable MMU stuff and caches
+        * disable MMU and D cache
+        * enable I cache if CONFIG_SYS_ICACHE_OFF is not defined
         */
        mrc     p15, 0, r0, c1, c0, 0
-       bic     r0, r0, #0x00002300     /* clear bits 13, 9:8 (--V- --RS) */
+       bic     r0, r0, #0x00000300     /* clear bits 9:8 (---- --RS) */
        bic     r0, r0, #0x00000087     /* clear bits 7, 2:0 (B--- -CAM) */
+#ifdef CONFIG_SYS_EXCEPTION_VECTORS_HIGH
+       orr     r0, r0, #0x00002000     /* set bit 13 (--V- ----) */
+#else
+       bic     r0, r0, #0x00002000     /* clear bit 13 (--V- ----) */
+#endif
        orr     r0, r0, #0x00000002     /* set bit 2 (A) Align */
+#ifndef CONFIG_SYS_ICACHE_OFF
        orr     r0, r0, #0x00001000     /* set bit 12 (I) I-Cache */
+#endif
        mcr     p15, 0, r0, c1, c0, 0
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
        /*
         * Go setup Memory and board specific bits prior to relocation.
         */
        mov     ip, lr          /* perserve link reg across call */
        bl      lowlevel_init   /* go setup pll,mux,memory */
        mov     lr, ip          /* restore link */
-#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
        mov     pc, lr          /* back to my caller */
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
 #ifndef CONFIG_SPL_BUILD
 /*
index 64de262737e06531081e536727938bf13b1d7830..2f7048b6a33e39540d4a68e38e99522854f981de 100644 (file)
 #include <asm/arch/clock.h>
 #include <asm/arch/clk.h>
 
-#ifndef CONFIG_SYS_CLK_FREQ_C210
-#define CONFIG_SYS_CLK_FREQ_C210       24000000
-#endif
-
 /* exynos4: return pll clock frequency */
 static unsigned long exynos4_get_pll_clk(int pllreg)
 {
@@ -76,7 +72,73 @@ static unsigned long exynos4_get_pll_clk(int pllreg)
        /* SDIV [2:0] */
        s = r & 0x7;
 
-       freq = CONFIG_SYS_CLK_FREQ_C210;
+       freq = CONFIG_SYS_CLK_FREQ;
+
+       if (pllreg == EPLL) {
+               k = k & 0xffff;
+               /* FOUT = (MDIV + K / 65536) * FIN / (PDIV * 2^SDIV) */
+               fout = (m + k / 65536) * (freq / (p * (1 << s)));
+       } else if (pllreg == VPLL) {
+               k = k & 0xfff;
+               /* FOUT = (MDIV + K / 1024) * FIN / (PDIV * 2^SDIV) */
+               fout = (m + k / 1024) * (freq / (p * (1 << s)));
+       } else {
+               if (s < 1)
+                       s = 1;
+               /* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
+               fout = m * (freq / (p * (1 << (s - 1))));
+       }
+
+       return fout;
+}
+
+/* exynos5: return pll clock frequency */
+static unsigned long exynos5_get_pll_clk(int pllreg)
+{
+       struct exynos5_clock *clk =
+               (struct exynos5_clock *)samsung_get_base_clock();
+       unsigned long r, m, p, s, k = 0, mask, fout;
+       unsigned int freq;
+
+       switch (pllreg) {
+       case APLL:
+               r = readl(&clk->apll_con0);
+               break;
+       case MPLL:
+               r = readl(&clk->mpll_con0);
+               break;
+       case EPLL:
+               r = readl(&clk->epll_con0);
+               k = readl(&clk->epll_con1);
+               break;
+       case VPLL:
+               r = readl(&clk->vpll_con0);
+               k = readl(&clk->vpll_con1);
+               break;
+       default:
+               printf("Unsupported PLL (%d)\n", pllreg);
+               return 0;
+       }
+
+       /*
+        * APLL_CON: MIDV [25:16]
+        * MPLL_CON: MIDV [25:16]
+        * EPLL_CON: MIDV [24:16]
+        * VPLL_CON: MIDV [24:16]
+        */
+       if (pllreg == APLL || pllreg == MPLL)
+               mask = 0x3ff;
+       else
+               mask = 0x1ff;
+
+       m = (r >> 16) & mask;
+
+       /* PDIV [13:8] */
+       p = (r >> 8) & 0x3f;
+       /* SDIV [2:0] */
+       s = r & 0x7;
+
+       freq = CONFIG_SYS_CLK_FREQ;
 
        if (pllreg == EPLL) {
                k = k & 0xffff;
@@ -102,17 +164,42 @@ static unsigned long exynos4_get_arm_clk(void)
        struct exynos4_clock *clk =
                (struct exynos4_clock *)samsung_get_base_clock();
        unsigned long div;
-       unsigned long dout_apll;
-       unsigned int apll_ratio;
+       unsigned long armclk;
+       unsigned int core_ratio;
+       unsigned int core2_ratio;
+
+       div = readl(&clk->div_cpu0);
+
+       /* CORE_RATIO: [2:0], CORE2_RATIO: [30:28] */
+       core_ratio = (div >> 0) & 0x7;
+       core2_ratio = (div >> 28) & 0x7;
+
+       armclk = get_pll_clk(APLL) / (core_ratio + 1);
+       armclk /= (core2_ratio + 1);
+
+       return armclk;
+}
+
+/* exynos5: return ARM clock frequency */
+static unsigned long exynos5_get_arm_clk(void)
+{
+       struct exynos5_clock *clk =
+               (struct exynos5_clock *)samsung_get_base_clock();
+       unsigned long div;
+       unsigned long armclk;
+       unsigned int arm_ratio;
+       unsigned int arm2_ratio;
 
        div = readl(&clk->div_cpu0);
 
-       /* APLL_RATIO: [26:24] */
-       apll_ratio = (div >> 24) & 0x7;
+       /* ARM_RATIO: [2:0], ARM2_RATIO: [30:28] */
+       arm_ratio = (div >> 0) & 0x7;
+       arm2_ratio = (div >> 28) & 0x7;
 
-       dout_apll = get_pll_clk(APLL) / (apll_ratio + 1);
+       armclk = get_pll_clk(APLL) / (arm_ratio + 1);
+       armclk /= (arm2_ratio + 1);
 
-       return dout_apll;
+       return armclk;
 }
 
 /* exynos4: return pwm clock frequency */
@@ -158,6 +245,27 @@ static unsigned long exynos4_get_pwm_clk(void)
        return pclk;
 }
 
+/* exynos5: return pwm clock frequency */
+static unsigned long exynos5_get_pwm_clk(void)
+{
+       struct exynos5_clock *clk =
+               (struct exynos5_clock *)samsung_get_base_clock();
+       unsigned long pclk, sclk;
+       unsigned int ratio;
+
+       /*
+        * CLK_DIV_PERIC3
+        * PWM_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_peric3);
+       ratio = ratio & 0xf;
+       sclk = get_pll_clk(MPLL);
+
+       pclk = sclk / (ratio + 1);
+
+       return pclk;
+}
+
 /* exynos4: return uart clock frequency */
 static unsigned long exynos4_get_uart_clk(int dev_index)
 {
@@ -205,6 +313,53 @@ static unsigned long exynos4_get_uart_clk(int dev_index)
        return uclk;
 }
 
+/* exynos5: return uart clock frequency */
+static unsigned long exynos5_get_uart_clk(int dev_index)
+{
+       struct exynos5_clock *clk =
+               (struct exynos5_clock *)samsung_get_base_clock();
+       unsigned long uclk, sclk;
+       unsigned int sel;
+       unsigned int ratio;
+
+       /*
+        * CLK_SRC_PERIC0
+        * UART0_SEL [3:0]
+        * UART1_SEL [7:4]
+        * UART2_SEL [8:11]
+        * UART3_SEL [12:15]
+        * UART4_SEL [16:19]
+        * UART5_SEL [23:20]
+        */
+       sel = readl(&clk->src_peric0);
+       sel = (sel >> (dev_index << 2)) & 0xf;
+
+       if (sel == 0x6)
+               sclk = get_pll_clk(MPLL);
+       else if (sel == 0x7)
+               sclk = get_pll_clk(EPLL);
+       else if (sel == 0x8)
+               sclk = get_pll_clk(VPLL);
+       else
+               return 0;
+
+       /*
+        * CLK_DIV_PERIC0
+        * UART0_RATIO [3:0]
+        * UART1_RATIO [7:4]
+        * UART2_RATIO [8:11]
+        * UART3_RATIO [12:15]
+        * UART4_RATIO [16:19]
+        * UART5_RATIO [23:20]
+        */
+       ratio = readl(&clk->div_peric0);
+       ratio = (ratio >> (dev_index << 2)) & 0xf;
+
+       uclk = sclk / (ratio + 1);
+
+       return uclk;
+}
+
 /* exynos4: set the mmc clock */
 static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
 {
@@ -232,27 +387,69 @@ static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
        writel(val, addr);
 }
 
+/* exynos5: set the mmc clock */
+static void exynos5_set_mmc_clk(int dev_index, unsigned int div)
+{
+       struct exynos5_clock *clk =
+               (struct exynos5_clock *)samsung_get_base_clock();
+       unsigned int addr;
+       unsigned int val;
+
+       /*
+        * CLK_DIV_FSYS1
+        * MMC0_PRE_RATIO [15:8], MMC1_PRE_RATIO [31:24]
+        * CLK_DIV_FSYS2
+        * MMC2_PRE_RATIO [15:8], MMC3_PRE_RATIO [31:24]
+        */
+       if (dev_index < 2) {
+               addr = (unsigned int)&clk->div_fsys1;
+       } else {
+               addr = (unsigned int)&clk->div_fsys2;
+               dev_index -= 2;
+       }
+
+       val = readl(addr);
+       val &= ~(0xff << ((dev_index << 4) + 8));
+       val |= (div & 0xff) << ((dev_index << 4) + 8);
+       writel(val, addr);
+}
+
 unsigned long get_pll_clk(int pllreg)
 {
-       return exynos4_get_pll_clk(pllreg);
+       if (cpu_is_exynos5())
+               return exynos5_get_pll_clk(pllreg);
+       else
+               return exynos4_get_pll_clk(pllreg);
 }
 
 unsigned long get_arm_clk(void)
 {
-       return exynos4_get_arm_clk();
+       if (cpu_is_exynos5())
+               return exynos5_get_arm_clk();
+       else
+               return exynos4_get_arm_clk();
 }
 
 unsigned long get_pwm_clk(void)
 {
-       return exynos4_get_pwm_clk();
+       if (cpu_is_exynos5())
+               return exynos5_get_pwm_clk();
+       else
+               return exynos4_get_pwm_clk();
 }
 
 unsigned long get_uart_clk(int dev_index)
 {
-       return exynos4_get_uart_clk(dev_index);
+       if (cpu_is_exynos5())
+               return exynos5_get_uart_clk(dev_index);
+       else
+               return exynos4_get_uart_clk(dev_index);
 }
 
 void set_mmc_clk(int dev_index, unsigned int div)
 {
-       exynos4_set_mmc_clk(dev_index, div);
+       if (cpu_is_exynos5())
+               exynos5_set_mmc_clk(dev_index, div);
+       else
+               exynos4_set_mmc_clk(dev_index, div);
 }
index 1533dd872258380fe04f193d84ff186e8f7b23c4..3f5a4f726c70910bcbda382f8c34bed6c1f6d358 100644 (file)
@@ -72,7 +72,7 @@ u32 get_cpu_rev(void)
 }
 
 #if defined(CONFIG_FEC_MXC)
-void imx_get_mac_from_fuse(unsigned char *mac)
+void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
 {
        int i;
        struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
index 1da90a4d9333b4286384b4a7ae8689585fdc5665..4cfe11991ab84afdcc48125c2c19d8cdc28ff09f 100644 (file)
@@ -251,6 +251,35 @@ void configure_mpu_dpll(void)
        debug("MPU DPLL locked\n");
 }
 
+#ifdef CONFIG_USB_EHCI_OMAP
+static void setup_usb_dpll(void)
+{
+       const struct dpll_params *params;
+       u32 sys_clk_khz, sd_div, num, den;
+
+       sys_clk_khz = get_sys_clk_freq() / 1000;
+       /*
+        * USB:
+        * USB dpll is J-type. Need to set DPLL_SD_DIV for jitter correction
+        * DPLL_SD_DIV = CEILING ([DPLL_MULT/(DPLL_DIV+1)]* CLKINP / 250)
+        *      - where CLKINP is sys_clk in MHz
+        * Use CLKINP in KHz and adjust the denominator accordingly so
+        * that we have enough accuracy and at the same time no overflow
+        */
+       params = get_usb_dpll_params();
+       num = params->m * sys_clk_khz;
+       den = (params->n + 1) * 250 * 1000;
+       num += den - 1;
+       sd_div = num / den;
+       clrsetbits_le32(&prcm->cm_clksel_dpll_usb,
+                       CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK,
+                       sd_div << CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT);
+
+       /* Now setup the dpll with the regular function */
+       do_setup_dpll(&prcm->cm_clkmode_dpll_usb, params, DPLL_LOCK, "usb");
+}
+#endif
+
 static void setup_dplls(void)
 {
        u32 temp;
@@ -282,13 +311,16 @@ static void setup_dplls(void)
 
        /* MPU dpll */
        configure_mpu_dpll();
+
+#ifdef CONFIG_USB_EHCI_OMAP
+       setup_usb_dpll();
+#endif
 }
 
 #ifdef CONFIG_SYS_CLOCKS_ENABLE_ALL
 static void setup_non_essential_dplls(void)
 {
        u32 sys_clk_khz, abe_ref_clk;
-       u32 sd_div, num, den;
        const struct dpll_params *params;
 
        sys_clk_khz = get_sys_clk_freq() / 1000;
@@ -300,26 +332,6 @@ static void setup_non_essential_dplls(void)
        params = get_iva_dpll_params();
        do_setup_dpll(&prcm->cm_clkmode_dpll_iva, params, DPLL_LOCK, "iva");
 
-       /*
-        * USB:
-        * USB dpll is J-type. Need to set DPLL_SD_DIV for jitter correction
-        * DPLL_SD_DIV = CEILING ([DPLL_MULT/(DPLL_DIV+1)]* CLKINP / 250)
-        *      - where CLKINP is sys_clk in MHz
-        * Use CLKINP in KHz and adjust the denominator accordingly so
-        * that we have enough accuracy and at the same time no overflow
-        */
-       params = get_usb_dpll_params();
-       num = params->m * sys_clk_khz;
-       den = (params->n + 1) * 250 * 1000;
-       num += den - 1;
-       sd_div = num / den;
-       clrsetbits_le32(&prcm->cm_clksel_dpll_usb,
-                       CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK,
-                       sd_div << CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT);
-
-       /* Now setup the dpll with the regular function */
-       do_setup_dpll(&prcm->cm_clkmode_dpll_usb, params, DPLL_LOCK, "usb");
-
        /* Configure ABE dpll */
        params = get_abe_dpll_params();
 #ifdef CONFIG_SYS_OMAP_ABE_SYSCK
index 49cdc3936e6829a91b98d2c081b0a3bc1387fa85..ab46bff5af7ab32b62e9fbb243e0896737c2a1aa 100644 (file)
@@ -120,6 +120,8 @@ void s_init(void)
 #endif
        prcm_init();
 #ifdef CONFIG_SPL_BUILD
+       timer_init();
+
        /* For regular u-boot sdram_init() is called from dram_init() */
        sdram_init();
        init_boot_params();
index 871aa37df8d4d6de7d935d42cc02135b10dc4775..637ab7b6bf07334a1b5e5c8afc45ae1c38da0a18 100644 (file)
@@ -144,7 +144,7 @@ void secureworld_exit()
 {
        unsigned long i;
 
-       /* configrue non-secure access control register */
+       /* configure non-secure access control register */
        __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2":"=r"(i));
        /* enabling co-processor CP10 and CP11 accesses in NS world */
        __asm__ __volatile__("orr %0, %0, #0xC00":"=r"(i));
@@ -228,6 +228,10 @@ void s_init(void)
 
        per_clocks_enable();
 
+#ifdef CONFIG_USB_EHCI_OMAP
+       ehci_clocks_enable();
+#endif
+
 #ifdef CONFIG_SPL_BUILD
        preloader_console_init();
 
@@ -389,7 +393,7 @@ static void omap3_setup_aux_cr(void)
 {
        /* Workaround for Cortex-A8 errata: #454179 #430973
         *      Set "IBE" bit
-        *      Set "Disable Brach Size Mispredicts" bit
+        *      Set "Disable Branch Size Mispredicts" bit
         * Workaround for erratum #621766
         *      Enable L1NEON bit
         * ACR |= (IBE | DBSM | L1NEON) => ACR |= 0xE0
index e0d65c7a4abca53006f58ca679fa6e657f82579e..567817e0ec3b062c3ee2a66c901b14ab1b44a8b2 100644 (file)
@@ -626,6 +626,26 @@ void prcm_init(void)
        sdelay(5000);
 }
 
+/*
+ * Enable usb ehci uhh, tll clocks
+ */
+void ehci_clocks_enable(void)
+{
+       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+
+       /* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
+       sr32(&prcm_base->iclken_usbhost, 0, 1, 1);
+       /*
+        * Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
+        * and USBHOST_120M_FCLK (USBHOST_FCLK2)
+        */
+       sr32(&prcm_base->fclken_usbhost, 0, 2, 3);
+       /* Enable USBTTL_ICLK */
+       sr32(&prcm_base->iclken3_core, 2, 1, 1);
+       /* Enable USBTTL_FCLK */
+       sr32(&prcm_base->fclken3_core, 2, 1, 1);
+}
+
 /******************************************************************************
  * peripheral_enable() - Enable the clks & power for perifs (GPT2, UART1,...)
  *****************************************************************************/
index 2f6930b22d1bed85e40bed1407a07952c2b631b3..c42c5ddcc9ffac518e4bf064e0934cd57ad82448 100644 (file)
 _TEXT_BASE:
        .word   CONFIG_SYS_TEXT_BASE    /* sdram load addr from config.mk */
 
+#ifdef CONFIG_SPL_BUILD
 .global save_boot_params
 save_boot_params:
-#ifdef CONFIG_SPL_BUILD
        ldr     r4, =omap3_boot_device
        ldr     r5, [r0, #0x4]
        and     r5, r5, #0xff
        str     r5, [r4]
-#endif
        bx      lr
+#endif
 
 .global omap3_gp_romcode_call
 omap3_gp_romcode_call:
index a27b4b124e7c4c1726d28c3eca3e051921e9e9da..91f42c0e2cd1dc9df1d7a30633f30e6137ef6cdf 100644 (file)
@@ -102,7 +102,7 @@ u32 get_sdr_cs_offset(u32 cs)
                return 0;
 
        offset = readl(&sdrc_base->cs_cfg);
-       offset = (offset & 15) << 27 | (offset & 0x30) << 17;
+       offset = (offset & 15) << 27 | (offset & 0x300) << 17;
 
        return offset;
 }
index 0886f92431ad87ace2cd2823196580b8cd3693e7..e2189f729f9e446bb56ed142e1dc884ee6b743c7 100644 (file)
@@ -67,15 +67,15 @@ const u32 sys_clk_array[8] = {
  * Please use this tool for creating the table for any new frequency.
  */
 
-/* dpll locked at 1840 MHz MPU clk at 920 MHz(OPP Turbo 4460) - DCC OFF */
-static const struct dpll_params mpu_dpll_params_1840mhz[NUM_SYS_CLKS] = {
-       {230, 2, 1, -1, -1, -1, -1, -1},        /* 12 MHz   */
-       {920, 12, 1, -1, -1, -1, -1, -1},       /* 13 MHz   */
-       {219, 3, 1, -1, -1, -1, -1, -1},        /* 16.8 MHz */
-       {575, 11, 1, -1, -1, -1, -1, -1},       /* 19.2 MHz */
-       {460, 12, 1, -1, -1, -1, -1, -1},       /* 26 MHz   */
-       {920, 26, 1, -1, -1, -1, -1, -1},       /* 27 MHz   */
-       {575, 23, 1, -1, -1, -1, -1, -1}        /* 38.4 MHz */
+/* dpll locked at 1400 MHz MPU clk at 700 MHz(OPP100) - DCC OFF */
+static const struct dpll_params mpu_dpll_params_1400mhz[NUM_SYS_CLKS] = {
+       {175, 2, 1, -1, -1, -1, -1, -1},        /* 12 MHz   */
+       {700, 12, 1, -1, -1, -1, -1, -1},       /* 13 MHz   */
+       {125, 2, 1, -1, -1, -1, -1, -1},        /* 16.8 MHz */
+       {401, 10, 1, -1, -1, -1, -1, -1},       /* 19.2 MHz */
+       {350, 12, 1, -1, -1, -1, -1, -1},       /* 26 MHz   */
+       {700, 26, 1, -1, -1, -1, -1, -1},       /* 27 MHz   */
+       {638, 34, 1, -1, -1, -1, -1, -1}        /* 38.4 MHz */
 };
 
 /* dpll locked at 1584 MHz - MPU clk at 792 MHz(OPP Turbo 4430) */
@@ -217,7 +217,7 @@ const struct dpll_params *get_mpu_dpll_params(void)
        else if (omap_rev < OMAP4460_ES1_0)
                return &mpu_dpll_params_1600mhz[sysclk_ind];
        else
-               return &mpu_dpll_params_1840mhz[sysclk_ind];
+               return &mpu_dpll_params_1400mhz[sysclk_ind];
 }
 
 const struct dpll_params *get_core_dpll_params(void)
@@ -280,7 +280,7 @@ void scale_vcores(void)
        omap_rev = omap_revision();
        /* TPS - supplies vdd_mpu on 4460 */
        if (omap_rev >= OMAP4460_ES1_0) {
-               volt = 1313;
+               volt = 1203;
                do_scale_tps62361(TPS62361_REG_ADDR_SET1, volt);
        }
 
@@ -342,6 +342,9 @@ void enable_basic_clocks(void)
                &prcm->cm_l4per_gpio4_clkctrl,
                &prcm->cm_l4per_gpio5_clkctrl,
                &prcm->cm_l4per_gpio6_clkctrl,
+               &prcm->cm_l3init_usbphy_clkctrl,
+               &prcm->cm_clksel_usb_60mhz,
+               &prcm->cm_l3init_hsusbtll_clkctrl,
                0
        };
 
@@ -352,6 +355,8 @@ void enable_basic_clocks(void)
                &prcm->cm_l4per_gptimer2_clkctrl,
                &prcm->cm_wkup_wdtimer2_clkctrl,
                &prcm->cm_l4per_uart3_clkctrl,
+               &prcm->cm_l3init_fsusb_clkctrl,
+               &prcm->cm_l3init_hsusbhost_clkctrl,
                0
        };
 
index 17053995bd61aa21e26ee20b8917528b09400c41..f975f3f06c9fbca7f1fe904eae34d5f57f2dde4a 100644 (file)
@@ -28,6 +28,7 @@ LIB   = $(obj)libs5p-common.o
 COBJS-y                += cpu_info.o
 COBJS-y                += timer.o
 COBJS-y                += sromc.o
+COBJS-y                += wdt.o
 COBJS-$(CONFIG_PWM)    += pwm.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/arch/arm/cpu/armv7/s5p-common/wdt.c b/arch/arm/cpu/armv7/s5p-common/wdt.c
new file mode 100644 (file)
index 0000000..94acc1e
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Minkyu Kang <mk7.kang@samsung.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/watchdog.h>
+
+#define PRESCALER_VAL 255
+
+void wdt_stop(void)
+{
+       struct s5p_watchdog *wdt =
+               (struct s5p_watchdog *)samsung_get_base_watchdog();
+       unsigned int wtcon;
+
+       wtcon = readl(&wdt->wtcon);
+       wtcon &= ~(WTCON_EN | WTCON_INT | WTCON_RESET);
+
+       writel(wtcon, &wdt->wtcon);
+}
+
+void wdt_start(unsigned int timeout)
+{
+       struct s5p_watchdog *wdt =
+               (struct s5p_watchdog *)samsung_get_base_watchdog();
+       unsigned int wtcon;
+
+       wdt_stop();
+
+       wtcon = readl(&wdt->wtcon);
+       wtcon |= (WTCON_EN | WTCON_CLK(WTCON_CLK_128));
+       wtcon &= ~WTCON_INT;
+       wtcon |= WTCON_RESET;
+       wtcon |= WTCON_PRESCALER(PRESCALER_VAL);
+
+       writel(timeout, &wdt->wtdat);
+       writel(timeout, &wdt->wtcnt);
+       writel(wtcon, &wdt->wtcon);
+}
index ea06570bfaf71ed0f4d2cb5ef950b8cd2259d4fe..349d50e1ac4adbc1b509d0d5a7302d384a42c663 100644 (file)
@@ -58,9 +58,9 @@ unsigned int query_sdram_size(void)
        case 1:
                return 0x10000000;      /* 256 MB */
        case 2:
+       default:
                return 0x20000000;      /* 512 MB */
        case 3:
-       default:
                return 0x40000000;      /* 1GB */
        }
 }
@@ -120,7 +120,7 @@ static void setup_uarts(int uart_ids)
                if (uart_ids & (1 << i)) {
                        enum periph_id id = id_for_uart[i];
 
-                       funcmux_select(id, 0);
+                       funcmux_select(id, FUNCMUX_DEFAULT);
                        clock_ll_start_uart(id);
                }
        }
@@ -141,3 +141,11 @@ void board_init_uart_f(void)
 #endif
        setup_uarts(uart_ids);
 }
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+       /* Enable D-cache. I-cache is already enabled in start.S */
+       dcache_enable();
+}
+#endif
index 0878f511104f0dedfde820a76ea663d5823c75f6..c1d2dfec5f02dea5c8631ca9222c3d7be13cb486 100644 (file)
 /* Tegra2 high-level function multiplexing */
 #include <common.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 
 int funcmux_select(enum periph_id id, int config)
 {
-       if (config != 0) {
-               debug("%s: invalid config %d for periph_id %d", __func__,
-                     config, id);
-               return -1;
-       }
+       int bad_config = config != FUNCMUX_DEFAULT;
+
        switch (id) {
        case PERIPH_ID_UART1:
-               pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
-               pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
-               pinmux_tristate_disable(PINGRP_IRRX);
-               pinmux_tristate_disable(PINGRP_IRTX);
+               if (config == FUNCMUX_UART1_IRRX_IRTX) {
+                       pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
+                       pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
+                       pinmux_tristate_disable(PINGRP_IRRX);
+                       pinmux_tristate_disable(PINGRP_IRTX);
+                       /*
+                        * Tegra appears to boot with function UARTA pre-
+                        * selected on mux group SDB. If two mux groups are
+                        * both set to the same function, it's unclear which
+                        * group's pins drive the RX signals into the HW.
+                        * For UARTA, SDB certainly overrides group IRTX in
+                        * practice. To solve this, configure some alternative
+                        * function on SDB to avoid the conflict. Also, tri-
+                        * state the group to avoid driving any signal onto it
+                        * until we know what's connected.
+                        */
+                       pinmux_tristate_enable(PINGRP_SDB);
+                       pinmux_set_func(PINGRP_SDB,  PMUX_FUNC_SDIO3);
+               }
                break;
 
        case PERIPH_ID_UART2:
-               pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
-               pinmux_tristate_disable(PINGRP_UAD);
+               if (config == FUNCMUX_UART2_IRDA) {
+                       pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
+                       pinmux_tristate_disable(PINGRP_UAD);
+               }
                break;
 
        case PERIPH_ID_UART4:
-               pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
-               pinmux_tristate_disable(PINGRP_GMC);
+               if (config == FUNCMUX_UART4_GMC) {
+                       pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
+                       pinmux_tristate_disable(PINGRP_GMC);
+               }
+               break;
+
+       case PERIPH_ID_DVC_I2C:
+               /* there is only one selection, pinmux_config is ignored */
+               if (config == FUNCMUX_DVC_I2CP) {
+                       pinmux_set_func(PINGRP_I2CP, PMUX_FUNC_I2C);
+                       pinmux_tristate_disable(PINGRP_I2CP);
+               }
+               break;
+
+       case PERIPH_ID_I2C1:
+               /* support pinmux_config of 0 for now, */
+               if (config == FUNCMUX_I2C1_RM) {
+                       pinmux_set_func(PINGRP_RM, PMUX_FUNC_I2C);
+                       pinmux_tristate_disable(PINGRP_RM);
+               }
+               break;
+       case PERIPH_ID_I2C2: /* I2C2 */
+               switch (config) {
+               case FUNCMUX_I2C2_DDC:  /* DDC pin group, select I2C2 */
+                       pinmux_set_func(PINGRP_DDC, PMUX_FUNC_I2C2);
+                       /* PTA to HDMI */
+                       pinmux_set_func(PINGRP_PTA, PMUX_FUNC_HDMI);
+                       pinmux_tristate_disable(PINGRP_DDC);
+                       break;
+               case FUNCMUX_I2C2_PTA:  /* PTA pin group, select I2C2 */
+                       pinmux_set_func(PINGRP_PTA, PMUX_FUNC_I2C2);
+                       /* set DDC_SEL to RSVDx (RSVD2 works for now) */
+                       pinmux_set_func(PINGRP_DDC, PMUX_FUNC_RSVD2);
+                       pinmux_tristate_disable(PINGRP_PTA);
+                       bad_config = 0;
+                       break;
+               }
+               break;
+       case PERIPH_ID_I2C3: /* I2C3 */
+               /* support pinmux_config of 0 for now */
+               if (config == FUNCMUX_I2C3_DTF) {
+                       pinmux_set_func(PINGRP_DTF, PMUX_FUNC_I2C3);
+                       pinmux_tristate_disable(PINGRP_DTF);
+               }
+               break;
+
+       case PERIPH_ID_SDMMC2:
+               if (config == FUNCMUX_SDMMC2_DTA_DTD_8BIT) {
+                       pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
+                       pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
+
+                       pinmux_tristate_disable(PINGRP_DTA);
+                       pinmux_tristate_disable(PINGRP_DTD);
+               }
+               break;
+
+       case PERIPH_ID_SDMMC3:
+               switch (config) {
+               case FUNCMUX_SDMMC3_SDB_SLXA_8BIT:
+                       pinmux_set_func(PINGRP_SLXA, PMUX_FUNC_SDIO3);
+                       pinmux_set_func(PINGRP_SLXC, PMUX_FUNC_SDIO3);
+                       pinmux_set_func(PINGRP_SLXD, PMUX_FUNC_SDIO3);
+                       pinmux_set_func(PINGRP_SLXK, PMUX_FUNC_SDIO3);
+
+                       pinmux_tristate_disable(PINGRP_SLXA);
+                       pinmux_tristate_disable(PINGRP_SLXC);
+                       pinmux_tristate_disable(PINGRP_SLXD);
+                       pinmux_tristate_disable(PINGRP_SLXK);
+                       /* fall through */
+
+               case FUNCMUX_SDMMC3_SDB_4BIT:
+                       pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
+                       pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
+                       pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
+
+                       pinmux_tristate_disable(PINGRP_SDB);
+                       pinmux_tristate_disable(PINGRP_SDC);
+                       pinmux_tristate_disable(PINGRP_SDD);
+                       bad_config = 0;
+                       break;
+               }
+               break;
+
+       case PERIPH_ID_SDMMC4:
+               switch (config) {
+               case FUNCMUX_SDMMC4_ATC_ATD_8BIT:
+                       pinmux_set_func(PINGRP_ATC, PMUX_FUNC_SDIO4);
+                       pinmux_set_func(PINGRP_ATD, PMUX_FUNC_SDIO4);
+
+                       pinmux_tristate_disable(PINGRP_ATC);
+                       pinmux_tristate_disable(PINGRP_ATD);
+                       break;
+
+               case FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT:
+                       pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+                       pinmux_tristate_disable(PINGRP_GME);
+                       /* fall through */
+
+               case FUNCMUX_SDMMC4_ATB_GMA_4_BIT:
+                       pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+                       pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+
+                       pinmux_tristate_disable(PINGRP_ATB);
+                       pinmux_tristate_disable(PINGRP_GMA);
+                       bad_config = 0;
+                       break;
+               }
                break;
 
        default:
@@ -54,5 +174,11 @@ int funcmux_select(enum periph_id id, int config)
                return -1;
        }
 
+       if (bad_config) {
+               debug("%s: invalid config %d for periph_id %d", __func__,
+                     config, id);
+               return -1;
+       }
+
        return 0;
 }
index e489c474754cd581c65921b4f1aaa26f7669fc8c..11ed91d0595ca17d15128028b72aaf11b9d2caed 100644 (file)
 #ifndef __DA850_LOWLEVEL_H
 #define __DA850_LOWLEVEL_H
 
+#include <asm/arch/pinmux_defs.h>
+
+/* pinmux_resource[] vector is defined in the board specific file */
+extern const struct pinmux_resource pinmuxes[];
+extern const int pinmuxes_size;
+
+extern const struct lpsc_resource lpsc[];
+extern const int lpsc_size;
+
 /* NOR Boot Configuration Word Field Descriptions */
 #define DA850_NORBOOT_COPY_XK(X)       ((X - 1) << 8)
 #define DA850_NORBOOT_METHOD_DIRECT    (1 << 4)
index 4986e829833cc048a088109c88fff90058ef246e..c70930d8d3ab9c417a3295a23efea5beb820255b 100644 (file)
@@ -32,7 +32,6 @@ void dm365_waitloop(unsigned long loopcnt);
 int dm365_pll1_init(unsigned long pllmult, unsigned long prediv);
 int dm365_pll2_init(unsigned long pllm, unsigned long prediv);
 int dm365_ddr_setup(void);
-void dm365_por_reset(void);
 void dm365_psc_init(void);
 void dm365_pinmux_ctl(unsigned long offset, unsigned long mask,
        unsigned long value);
index 1c71540e481fb249879ab0d1c455e673d17cb9d3..b145c6e7f163b1e9992839b058d5425349320ea3 100644 (file)
@@ -587,6 +587,15 @@ static inline int get_async3_src(void)
 #include <asm/arch/psc_defs.h>
 #include <asm/arch/syscfg_defs.h>
 #include <asm/arch/timer_defs.h>
+
+#define TMPBUF                 0x00017ff8
+#define TMPSTATUS              0x00017ff0
+#define DV_TMPBUF_VAL          0x591b3ed7
+#define FLAG_PORRST            0x00000001
+#define FLAG_WDTRST            0x00000002
+#define FLAG_FLGON             0x00000004
+#define FLAG_FLGOFF            0x00000010
+
 #endif
 
 struct davinci_rtc {
index f1396e31942430e8cf9348620993d8d69b5a1bdb..1c8d83fb5b5a1d06d91750ed1740429dbf65b699 100644 (file)
@@ -68,7 +68,8 @@ struct dv_pll_regs {
 #define PLLCTL_RES_9   (1 << 8)
 #define PLLCTL_EXTCLKSRC       (1 << 9)
 
-#define PLL_POSTDEN    (1 << 15)
+#define PLL_DIVEN      (1 << 15)
+#define PLL_POSTDEN    PLL_DIVEN
 
 #define PLL_SCSCFG3_DIV45PENA  (1 << 2)
 #define PLL_SCSCFG3_EMA_CLKSRC (1 << 1)
index 53c961e8da1573f7068dce2a19bcef5b284abd12..914ae07dca30dd30d9c8b8d0c4da54800eac10d9 100644 (file)
@@ -37,6 +37,22 @@ struct davinci_timer {
        u_int32_t       wdtcr;
 };
 
+#define DV_TIMER_TCR_ENAMODE_MASK              3
+
+#define DV_TIMER_TCR_ENAMODE12_SHIFT           6
+#define DV_TIMER_TCR_CLKSRC12_SHIFT            8
+#define DV_TIMER_TCR_READRSTMODE12_SHIFT       10
+#define DV_TIMER_TCR_CAPMODE12_SHIFT           11
+#define DV_TIMER_TCR_CAPVTMODE12_SHIFT         12
+#define DV_TIMER_TCR_ENAMODE34_SHIFT           22
+#define DV_TIMER_TCR_CLKSRC34_SHIFT            24
+#define DV_TIMER_TCR_READRSTMODE34_SHIFT       26
+#define DV_TIMER_TCR_CAPMODE34_SHIFT           27
+#define DV_TIMER_TCR_CAPEVTMODE12_SHIFT                28
+
+#define DV_WDT_ENABLE_SYS_RESET                0x00020000
+#define DV_WDT_TRIGGER_SYS_RESET       0x00020002
+
 #ifdef CONFIG_HW_WATCHDOG
 void davinci_hw_watchdog_enable(void);
 void davinci_hw_watchdog_reset(void);
index 483c91154b4533b9195ccf7c48da88757d1f4dda..50da958034229b84e30fc390f635735b618d33cc 100644 (file)
@@ -250,6 +250,332 @@ struct exynos4_clock {
        unsigned int    div_iem_l2;
        unsigned int    div_iem_l1;
 };
+
+struct exynos5_clock {
+       unsigned int    apll_lock;
+       unsigned char   res1[0xfc];
+       unsigned int    apll_con0;
+       unsigned int    apll_con1;
+       unsigned char   res2[0xf8];
+       unsigned int    src_cpu;
+       unsigned char   res3[0x1fc];
+       unsigned int    mux_stat_cpu;
+       unsigned char   res4[0xfc];
+       unsigned int    div_cpu0;
+       unsigned int    div_cpu1;
+       unsigned char   res5[0xf8];
+       unsigned int    div_stat_cpu0;
+       unsigned int    div_stat_cpu1;
+       unsigned char   res6[0x1f8];
+       unsigned int    gate_sclk_cpu;
+       unsigned char   res7[0x1fc];
+       unsigned int    clkout_cmu_cpu;
+       unsigned int    clkout_cmu_cpu_div_stat;
+       unsigned char   res8[0x5f8];
+       unsigned int    armclk_stopctrl;
+       unsigned int    atclk_stopctrl;
+       unsigned char   res9[0x8];
+       unsigned int    parityfail_status;
+       unsigned int    parityfail_clear;
+       unsigned char   res10[0x8];
+       unsigned int    pwr_ctrl;
+       unsigned int    pwr_ctr2;
+       unsigned char   res11[0xd8];
+       unsigned int    apll_con0_l8;
+       unsigned int    apll_con0_l7;
+       unsigned int    apll_con0_l6;
+       unsigned int    apll_con0_l5;
+       unsigned int    apll_con0_l4;
+       unsigned int    apll_con0_l3;
+       unsigned int    apll_con0_l2;
+       unsigned int    apll_con0_l1;
+       unsigned int    iem_control;
+       unsigned char   res12[0xdc];
+       unsigned int    apll_con1_l8;
+       unsigned int    apll_con1_l7;
+       unsigned int    apll_con1_l6;
+       unsigned int    apll_con1_l5;
+       unsigned int    apll_con1_l4;
+       unsigned int    apll_con1_l3;
+       unsigned int    apll_con1_l2;
+       unsigned int    apll_con1_l1;
+       unsigned char   res13[0xe0];
+       unsigned int    div_iem_l8;
+       unsigned int    div_iem_l7;
+       unsigned int    div_iem_l6;
+       unsigned int    div_iem_l5;
+       unsigned int    div_iem_l4;
+       unsigned int    div_iem_l3;
+       unsigned int    div_iem_l2;
+       unsigned int    div_iem_l1;
+       unsigned char   res14[0x2ce0];
+       unsigned int    mpll_lock;
+       unsigned char   res15[0xfc];
+       unsigned int    mpll_con0;
+       unsigned int    mpll_con1;
+       unsigned char   res16[0xf8];
+       unsigned int    src_core0;
+       unsigned int    src_core1;
+       unsigned char   res17[0xf8];
+       unsigned int    src_mask_core;
+       unsigned char   res18[0x100];
+       unsigned int    mux_stat_core1;
+       unsigned char   res19[0xf8];
+       unsigned int    div_core0;
+       unsigned int    div_core1;
+       unsigned char   res20[0xf8];
+       unsigned int    div_stat_core0;
+       unsigned int    div_stat_core1;
+       unsigned char   res21[0x2f8];
+       unsigned int    gate_ip_core;
+       unsigned char   res22[0xfc];
+       unsigned int    clkout_cmu_core;
+       unsigned int    clkout_cmu_core_div_stat;
+       unsigned char   res23[0x5f8];
+       unsigned int    dcgidx_map0;
+       unsigned int    dcgidx_map1;
+       unsigned int    dcgidx_map2;
+       unsigned char   res24[0x14];
+       unsigned int    dcgperf_map0;
+       unsigned int    dcgperf_map1;
+       unsigned char   res25[0x18];
+       unsigned int    dvcidx_map;
+       unsigned char   res26[0x1c];
+       unsigned int    freq_cpu;
+       unsigned int    freq_dpm;
+       unsigned char   res27[0x18];
+       unsigned int    dvsemclk_en;
+       unsigned int    maxperf;
+       unsigned char   res28[0x3478];
+       unsigned int    div_acp;
+       unsigned char   res29[0xfc];
+       unsigned int    div_stat_acp;
+       unsigned char   res30[0x1fc];
+       unsigned int    gate_ip_acp;
+       unsigned char   res31[0x1fc];
+       unsigned int    clkout_cmu_acp;
+       unsigned int    clkout_cmu_acp_div_stat;
+       unsigned char   res32[0x38f8];
+       unsigned int    div_isp0;
+       unsigned int    div_isp1;
+       unsigned int    div_isp2;
+       unsigned char   res33[0xf4];
+       unsigned int    div_stat_isp0;
+       unsigned int    div_stat_isp1;
+       unsigned int    div_stat_isp2;
+       unsigned char   res34[0x3f4];
+       unsigned int    gate_ip_isp0;
+       unsigned int    gate_ip_isp1;
+       unsigned char   res35[0xf8];
+       unsigned int    gate_sclk_isp;
+       unsigned char   res36[0xc];
+       unsigned int    mcuisp_pwr_ctrl;
+       unsigned char   res37[0xec];
+       unsigned int    clkout_cmu_isp;
+       unsigned int    clkout_cmu_isp_div_stat;
+       unsigned char   res38[0x3618];
+       unsigned int    cpll_lock;
+       unsigned char   res39[0xc];
+       unsigned int    epll_lock;
+       unsigned char   res40[0xc];
+       unsigned int    vpll_lock;
+       unsigned char   res41[0xdc];
+       unsigned int    cpll_con0;
+       unsigned int    cpll_con1;
+       unsigned char   res42[0x8];
+       unsigned int    epll_con0;
+       unsigned int    epll_con1;
+       unsigned int    epll_con2;
+       unsigned char   res43[0x4];
+       unsigned int    vpll_con0;
+       unsigned int    vpll_con1;
+       unsigned int    vpll_con2;
+       unsigned char   res44[0xc4];
+       unsigned int    src_top0;
+       unsigned int    src_top1;
+       unsigned int    src_top2;
+       unsigned int    src_top3;
+       unsigned int    src_gscl;
+       unsigned int    src_disp0_0;
+       unsigned int    src_disp0_1;
+       unsigned int    src_disp1_0;
+       unsigned int    src_disp1_1;
+       unsigned char   res46[0xc];
+       unsigned int    src_mau;
+       unsigned int    src_fsys;
+       unsigned char   res47[0x8];
+       unsigned int    src_peric0;
+       unsigned int    src_peric1;
+       unsigned char   res48[0x18];
+       unsigned int    sclk_src_isp;
+       unsigned char   res49[0x9c];
+       unsigned int    src_mask_top;
+       unsigned char   res50[0xc];
+       unsigned int    src_mask_gscl;
+       unsigned int    src_mask_disp0_0;
+       unsigned int    src_mask_disp0_1;
+       unsigned int    src_mask_disp1_0;
+       unsigned int    src_mask_disp1_1;
+       unsigned int    src_mask_maudio;
+       unsigned char   res52[0x8];
+       unsigned int    src_mask_fsys;
+       unsigned char   res53[0xc];
+       unsigned int    src_mask_peric0;
+       unsigned int    src_mask_peric1;
+       unsigned char   res54[0x18];
+       unsigned int    src_mask_isp;
+       unsigned char   res55[0x9c];
+       unsigned int    mux_stat_top0;
+       unsigned int    mux_stat_top1;
+       unsigned int    mux_stat_top2;
+       unsigned int    mux_stat_top3;
+       unsigned char   res56[0xf0];
+       unsigned int    div_top0;
+       unsigned int    div_top1;
+       unsigned char   res57[0x8];
+       unsigned int    div_gscl;
+       unsigned int    div_disp0_0;
+       unsigned int    div_disp0_1;
+       unsigned int    div_disp1_0;
+       unsigned int    div_disp1_1;
+       unsigned char   res59[0x8];
+       unsigned int    div_gen;
+       unsigned char   res60[0x4];
+       unsigned int    div_mau;
+       unsigned int    div_fsys0;
+       unsigned int    div_fsys1;
+       unsigned int    div_fsys2;
+       unsigned int    div_fsys3;
+       unsigned int    div_peric0;
+       unsigned int    div_peric1;
+       unsigned int    div_peric2;
+       unsigned int    div_peric3;
+       unsigned int    div_peric4;
+       unsigned int    div_peric5;
+       unsigned char   res61[0x10];
+       unsigned int    sclk_div_isp;
+       unsigned char   res62[0xc];
+       unsigned int    div2_ratio0;
+       unsigned int    div2_ratio1;
+       unsigned char   res63[0x8];
+       unsigned int    div4_ratio;
+       unsigned char   res64[0x6c];
+       unsigned int    div_stat_top0;
+       unsigned int    div_stat_top1;
+       unsigned char   res65[0x8];
+       unsigned int    div_stat_gscl;
+       unsigned int    div_stat_disp0_0;
+       unsigned int    div_stat_disp0_1;
+       unsigned int    div_stat_disp1_0;
+       unsigned int    div_stat_disp1_1;
+       unsigned char   res67[0x8];
+       unsigned int    div_stat_gen;
+       unsigned char   res68[0x4];
+       unsigned int    div_stat_maudio;
+       unsigned int    div_stat_fsys0;
+       unsigned int    div_stat_fsys1;
+       unsigned int    div_stat_fsys2;
+       unsigned int    div_stat_fsys3;
+       unsigned int    div_stat_peric0;
+       unsigned int    div_stat_peric1;
+       unsigned int    div_stat_peric2;
+       unsigned int    div_stat_peric3;
+       unsigned int    div_stat_peric4;
+       unsigned int    div_stat_peric5;
+       unsigned char   res69[0x10];
+       unsigned int    sclk_div_stat_isp;
+       unsigned char   res70[0xc];
+       unsigned int    div2_stat0;
+       unsigned int    div2_stat1;
+       unsigned char   res71[0x8];
+       unsigned int    div4_stat;
+       unsigned char   res72[0x180];
+       unsigned int    gate_top_sclk_disp0;
+       unsigned int    gate_top_sclk_disp1;
+       unsigned int    gate_top_sclk_gen;
+       unsigned char   res74[0xc];
+       unsigned int    gate_top_sclk_mau;
+       unsigned int    gate_top_sclk_fsys;
+       unsigned char   res75[0xc];
+       unsigned int    gate_top_sclk_peric;
+       unsigned char   res76[0x1c];
+       unsigned int    gate_top_sclk_isp;
+       unsigned char   res77[0xac];
+       unsigned int    gate_ip_gscl;
+       unsigned int    gate_ip_disp0;
+       unsigned int    gate_ip_disp1;
+       unsigned int    gate_ip_mfc;
+       unsigned int    gate_ip_g3d;
+       unsigned int    gate_ip_gen;
+       unsigned char   res79[0xc];
+       unsigned int    gate_ip_fsys;
+       unsigned char   res80[0x4];
+       unsigned int    gate_ip_gps;
+       unsigned int    gate_ip_peric;
+       unsigned char   res81[0xc];
+       unsigned int    gate_ip_peris;
+       unsigned char   res82[0x1c];
+       unsigned int    gate_block;
+       unsigned char   res83[0x7c];
+       unsigned int    clkout_cmu_top;
+       unsigned int    clkout_cmu_top_div_stat;
+       unsigned char   res84[0x37f8];
+       unsigned int    src_lex;
+       unsigned char   res85[0x2fc];
+       unsigned int    div_lex;
+       unsigned char   res86[0xfc];
+       unsigned int    div_stat_lex;
+       unsigned char   res87[0x1fc];
+       unsigned int    gate_ip_lex;
+       unsigned char   res88[0x1fc];
+       unsigned int    clkout_cmu_lex;
+       unsigned int    clkout_cmu_lex_div_stat;
+       unsigned char   res89[0x3af8];
+       unsigned int    div_r0x;
+       unsigned char   res90[0xfc];
+       unsigned int    div_stat_r0x;
+       unsigned char   res91[0x1fc];
+       unsigned int    gate_ip_r0x;
+       unsigned char   res92[0x1fc];
+       unsigned int    clkout_cmu_r0x;
+       unsigned int    clkout_cmu_r0x_div_stat;
+       unsigned char   res94[0x3af8];
+       unsigned int    div_r1x;
+       unsigned char   res95[0xfc];
+       unsigned int    div_stat_r1x;
+       unsigned char   res96[0x1fc];
+       unsigned int    gate_ip_r1x;
+       unsigned char   res97[0x1fc];
+       unsigned int    clkout_cmu_r1x;
+       unsigned int    clkout_cmu_r1x_div_stat;
+       unsigned char   res98[0x3608];
+       unsigned int    bpll_lock;
+       unsigned char   res99[0xfc];
+       unsigned int    bpll_con0;
+       unsigned int    bpll_con1;
+       unsigned char   res100[0xe8];
+       unsigned int    src_cdrex;
+       unsigned char   res101[0x1fc];
+       unsigned int    mux_stat_cdrex;
+       unsigned char   res102[0xfc];
+       unsigned int    div_cdrex;
+       unsigned int    div_cdrex2;
+       unsigned char   res103[0xf8];
+       unsigned int    div_stat_cdrex;
+       unsigned char   res104[0x2fc];
+       unsigned int    gate_ip_cdrex;
+       unsigned char   res105[0xc];
+       unsigned int    c2c_monitor;
+       unsigned int    dmc_pwr_ctrl;
+       unsigned char   res106[0x4];
+       unsigned int    drex2_pause;
+       unsigned char   res107[0xe0];
+       unsigned int    clkout_cmu_cdrex;
+       unsigned int    clkout_cmu_cdrex_div_stat;
+       unsigned char   res108[0x8];
+       unsigned int    lpddr3phy_ctrl;
+       unsigned char   res109[0xf5f8];
+};
 #endif
 
 #endif
index 6d97b99548b50ae0c8f41a4dcfc29494b33964bb..89f2c2e3e904380b508b44e25d6fa7744a008b12 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _EXYNOS4_CPU_H
 #define _EXYNOS4_CPU_H
 
+#define DEVICE_NOT_AVAILABLE           0
+
 #define EXYNOS4_ADDR_BASE              0x10000000
 
 /* EXYNOS4 */
 #define EXYNOS4_ADC_BASE               0x13910000
 #define EXYNOS4_PWMTIMER_BASE          0x139D0000
 #define EXYNOS4_MODEM_BASE             0x13A00000
-#define EXYNOS4_USBPHY_CONTROL          0x10020704
+#define EXYNOS4_USBPHY_CONTROL         0x10020704
+
+#define EXYNOS4_GPIO_PART4_BASE                DEVICE_NOT_AVAILABLE
+
+/* EXYNOS5 */
+#define EXYNOS5_GPIO_PART4_BASE                0x03860000
+#define EXYNOS5_PRO_ID                 0x10000000
+#define EXYNOS5_CLOCK_BASE             0x10010000
+#define EXYNOS5_POWER_BASE             0x10040000
+#define EXYNOS5_SWRESET                        0x10040400
+#define EXYNOS5_SYSREG_BASE            0x10050000
+#define EXYNOS5_WATCHDOG_BASE          0x101D0000
+#define EXYNOS5_DMC_PHY0_BASE          0x10C00000
+#define EXYNOS5_DMC_PHY1_BASE          0x10C10000
+#define EXYNOS5_GPIO_PART3_BASE                0x10D10000
+#define EXYNOS5_DMC_CTRL_BASE          0x10DD0000
+#define EXYNOS5_GPIO_PART1_BASE                0x11400000
+#define EXYNOS5_MMC_BASE               0x12200000
+#define EXYNOS5_SROMC_BASE             0x12250000
+#define EXYNOS5_USBOTG_BASE            0x12480000
+#define EXYNOS5_USBPHY_BASE            0x12480000
+#define EXYNOS5_UART_BASE              0x12C00000
+#define EXYNOS5_PWMTIMER_BASE          0x12DD0000
+#define EXYNOS5_GPIO_PART2_BASE                0x13400000
+#define EXYNOS5_FIMD_BASE              0x14400000
+
+#define EXYNOS5_ADC_BASE               DEVICE_NOT_AVAILABLE
+#define EXYNOS5_MODEM_BASE             DEVICE_NOT_AVAILABLE
 
 #ifndef __ASSEMBLY__
 #include <asm/io.h>
@@ -83,12 +112,15 @@ static inline int cpu_is_##type(void)                      \
 }
 
 IS_SAMSUNG_TYPE(exynos4, 0xc210)
+IS_SAMSUNG_TYPE(exynos5, 0xc520)
 
 #define SAMSUNG_BASE(device, base)                             \
 static inline unsigned int samsung_get_base_##device(void)     \
 {                                                              \
        if (cpu_is_exynos4())                                   \
                return EXYNOS4_##base;                          \
+       else if (cpu_is_exynos5())                              \
+               return EXYNOS5_##base;                          \
        else                                                    \
                return 0;                                       \
 }
@@ -99,6 +131,7 @@ SAMSUNG_BASE(fimd, FIMD_BASE)
 SAMSUNG_BASE(gpio_part1, GPIO_PART1_BASE)
 SAMSUNG_BASE(gpio_part2, GPIO_PART2_BASE)
 SAMSUNG_BASE(gpio_part3, GPIO_PART3_BASE)
+SAMSUNG_BASE(gpio_part4, GPIO_PART4_BASE)
 SAMSUNG_BASE(pro_id, PRO_ID)
 SAMSUNG_BASE(mmc, MMC_BASE)
 SAMSUNG_BASE(modem, MODEM_BASE)
@@ -109,6 +142,7 @@ SAMSUNG_BASE(uart, UART_BASE)
 SAMSUNG_BASE(usb_phy, USBPHY_BASE)
 SAMSUNG_BASE(usb_otg, USBOTG_BASE)
 SAMSUNG_BASE(watchdog, WATCHDOG_BASE)
+SAMSUNG_BASE(power, POWER_BASE)
 #endif
 
 #endif /* _EXYNOS4_CPU_H */
diff --git a/arch/arm/include/asm/arch-exynos/dmc.h b/arch/arm/include/asm/arch-exynos/dmc.h
new file mode 100644 (file)
index 0000000..debbe50
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef __DMC_H__
+#define __DMC_H__
+
+#ifndef __ASSEMBLY__
+struct exynos5_dmc {
+       unsigned int concontrol;
+       unsigned int memcontrol;
+       unsigned int memconfig0;
+       unsigned int memconfig1;
+       unsigned int directcmd;
+       unsigned int prechconfig;
+       unsigned int phycontrol0;
+       unsigned char res1[0xc];
+       unsigned int pwrdnconfig;
+       unsigned int timingpzq;
+       unsigned int timingref;
+       unsigned int timingrow;
+       unsigned int timingdata;
+       unsigned int timingpower;
+       unsigned int phystatus;
+       unsigned char res2[0x4];
+       unsigned int chipstatus_ch0;
+       unsigned int chipstatus_ch1;
+       unsigned char res3[0x4];
+       unsigned int mrstatus;
+       unsigned char res4[0x8];
+       unsigned int qoscontrol0;
+       unsigned char resr5[0x4];
+       unsigned int qoscontrol1;
+       unsigned char res6[0x4];
+       unsigned int qoscontrol2;
+       unsigned char res7[0x4];
+       unsigned int qoscontrol3;
+       unsigned char res8[0x4];
+       unsigned int qoscontrol4;
+       unsigned char res9[0x4];
+       unsigned int qoscontrol5;
+       unsigned char res10[0x4];
+       unsigned int qoscontrol6;
+       unsigned char res11[0x4];
+       unsigned int qoscontrol7;
+       unsigned char res12[0x4];
+       unsigned int qoscontrol8;
+       unsigned char res13[0x4];
+       unsigned int qoscontrol9;
+       unsigned char res14[0x4];
+       unsigned int qoscontrol10;
+       unsigned char res15[0x4];
+       unsigned int qoscontrol11;
+       unsigned char res16[0x4];
+       unsigned int qoscontrol12;
+       unsigned char res17[0x4];
+       unsigned int qoscontrol13;
+       unsigned char res18[0x4];
+       unsigned int qoscontrol14;
+       unsigned char res19[0x4];
+       unsigned int qoscontrol15;
+       unsigned char res20[0x14];
+       unsigned int ivcontrol;
+       unsigned int wrtra_config;
+       unsigned int rdlvl_config;
+       unsigned char res21[0x8];
+       unsigned int brbrsvconfig;
+       unsigned int brbqosconfig;
+       unsigned int membaseconfig0;
+       unsigned int membaseconfig1;
+       unsigned char res22[0xc];
+       unsigned int wrlvl_config;
+       unsigned char res23[0xc];
+       unsigned int perevcontrol;
+       unsigned int perev0config;
+       unsigned int perev1config;
+       unsigned int perev2config;
+       unsigned int perev3config;
+       unsigned char res24[0xdebc];
+       unsigned int pmnc_ppc_a;
+       unsigned char res25[0xc];
+       unsigned int cntens_ppc_a;
+       unsigned char res26[0xc];
+       unsigned int cntenc_ppc_a;
+       unsigned char res27[0xc];
+       unsigned int intens_ppc_a;
+       unsigned char res28[0xc];
+       unsigned int intenc_ppc_a;
+       unsigned char res29[0xc];
+       unsigned int flag_ppc_a;
+       unsigned char res30[0xac];
+       unsigned int ccnt_ppc_a;
+       unsigned char res31[0xc];
+       unsigned int pmcnt0_ppc_a;
+       unsigned char res32[0xc];
+       unsigned int pmcnt1_ppc_a;
+       unsigned char res33[0xc];
+       unsigned int pmcnt2_ppc_a;
+       unsigned char res34[0xc];
+       unsigned int pmcnt3_ppc_a;
+};
+
+struct exynos5_phy_control {
+       unsigned int phy_con0;
+       unsigned int phy_con1;
+       unsigned int phy_con2;
+       unsigned int phy_con3;
+       unsigned int phy_con4;
+       unsigned char res1[4];
+       unsigned int phy_con6;
+       unsigned char res2[4];
+       unsigned int phy_con8;
+       unsigned int phy_con9;
+       unsigned int phy_con10;
+       unsigned char res3[4];
+       unsigned int phy_con12;
+       unsigned int phy_con13;
+       unsigned int phy_con14;
+       unsigned int phy_con15;
+       unsigned int phy_con16;
+       unsigned char res4[4];
+       unsigned int phy_con17;
+       unsigned int phy_con18;
+       unsigned int phy_con19;
+       unsigned int phy_con20;
+       unsigned int phy_con21;
+       unsigned int phy_con22;
+       unsigned int phy_con23;
+       unsigned int phy_con24;
+       unsigned int phy_con25;
+       unsigned int phy_con26;
+       unsigned int phy_con27;
+       unsigned int phy_con28;
+       unsigned int phy_con29;
+       unsigned int phy_con30;
+       unsigned int phy_con31;
+       unsigned int phy_con32;
+       unsigned int phy_con33;
+       unsigned int phy_con34;
+       unsigned int phy_con35;
+       unsigned int phy_con36;
+       unsigned int phy_con37;
+       unsigned int phy_con38;
+       unsigned int phy_con39;
+       unsigned int phy_con40;
+       unsigned int phy_con41;
+       unsigned int phy_con42;
+};
+#endif
+#endif
index 9863a122459ef5074b0665fde3fbf9d6322ebf40..7a9bb90a0ca715e151c06438e58f087208adde23 100644 (file)
@@ -79,6 +79,59 @@ struct exynos4_gpio_part3 {
        struct s5p_gpio_bank z;
 };
 
+struct exynos5_gpio_part1 {
+       struct s5p_gpio_bank a0;
+       struct s5p_gpio_bank a1;
+       struct s5p_gpio_bank a2;
+       struct s5p_gpio_bank b0;
+       struct s5p_gpio_bank b1;
+       struct s5p_gpio_bank b2;
+       struct s5p_gpio_bank b3;
+       struct s5p_gpio_bank c0;
+       struct s5p_gpio_bank c1;
+       struct s5p_gpio_bank c2;
+       struct s5p_gpio_bank c3;
+       struct s5p_gpio_bank d0;
+       struct s5p_gpio_bank d1;
+       struct s5p_gpio_bank y0;
+       struct s5p_gpio_bank y1;
+       struct s5p_gpio_bank y2;
+       struct s5p_gpio_bank y3;
+       struct s5p_gpio_bank y4;
+       struct s5p_gpio_bank y5;
+       struct s5p_gpio_bank y6;
+       struct s5p_gpio_bank res1[0x980];
+       struct s5p_gpio_bank x0;
+       struct s5p_gpio_bank x1;
+       struct s5p_gpio_bank x2;
+       struct s5p_gpio_bank x3;
+};
+
+struct exynos5_gpio_part2 {
+       struct s5p_gpio_bank e0;
+       struct s5p_gpio_bank e1;
+       struct s5p_gpio_bank f0;
+       struct s5p_gpio_bank f1;
+       struct s5p_gpio_bank g0;
+       struct s5p_gpio_bank g1;
+       struct s5p_gpio_bank g2;
+       struct s5p_gpio_bank h0;
+       struct s5p_gpio_bank h1;
+};
+
+struct exynos5_gpio_part3 {
+       struct s5p_gpio_bank v0;
+       struct s5p_gpio_bank v1;
+       struct s5p_gpio_bank v2;
+       struct s5p_gpio_bank v3;
+       struct s5p_gpio_bank res1[0x20];
+       struct s5p_gpio_bank v4;
+};
+
+struct exynos5_gpio_part4 {
+       struct s5p_gpio_bank z;
+};
+
 /* functions */
 void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg);
 void s5p_gpio_direction_output(struct s5p_gpio_bank *bank, int gpio, int en);
@@ -98,21 +151,55 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode);
            - EXYNOS4_GPIO_PART1_BASE) / sizeof(struct s5p_gpio_bank)) \
          * GPIO_PER_BANK) + pin)
 
-#define GPIO_PART1_MAX ((sizeof(struct exynos4_gpio_part1) \
+#define EXYNOS4_GPIO_PART1_MAX ((sizeof(struct exynos4_gpio_part1) \
                            / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
 
 #define exynos4_gpio_part2_get_nr(bank, pin) \
        (((((((unsigned int) &(((struct exynos4_gpio_part2 *) \
                                EXYNOS4_GPIO_PART2_BASE)->bank)) \
            - EXYNOS4_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
-         * GPIO_PER_BANK) + pin) + GPIO_PART1_MAX)
+         * GPIO_PER_BANK) + pin) + EXYNOS4_GPIO_PART1_MAX)
+
+#define exynos5_gpio_part1_get_nr(bank, pin) \
+       ((((((unsigned int) &(((struct exynos5_gpio_part1 *) \
+                              EXYNOS5_GPIO_PART1_BASE)->bank)) \
+           - EXYNOS5_GPIO_PART1_BASE) / sizeof(struct s5p_gpio_bank)) \
+         * GPIO_PER_BANK) + pin)
+
+#define EXYNOS5_GPIO_PART1_MAX ((sizeof(struct exynos5_gpio_part1) \
+                           / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
+
+#define exynos5_gpio_part2_get_nr(bank, pin) \
+       (((((((unsigned int) &(((struct exynos5_gpio_part2 *) \
+                               EXYNOS5_GPIO_PART2_BASE)->bank)) \
+           - EXYNOS5_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
+         * GPIO_PER_BANK) + pin) + EXYNOS5_GPIO_PART1_MAX)
+
+#define EXYNOS5_GPIO_PART2_MAX ((sizeof(struct exynos5_gpio_part2) \
+                           / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
+
+#define exynos5_gpio_part3_get_nr(bank, pin) \
+       (((((((unsigned int) &(((struct exynos5_gpio_part3 *) \
+                               EXYNOS5_GPIO_PART3_BASE)->bank)) \
+           - EXYNOS5_GPIO_PART3_BASE) / sizeof(struct s5p_gpio_bank)) \
+         * GPIO_PER_BANK) + pin) + EXYNOS5_GPIO_PART2_MAX)
 
 static inline unsigned int s5p_gpio_base(int nr)
 {
-       if (nr < GPIO_PART1_MAX)
-               return EXYNOS4_GPIO_PART1_BASE;
-       else
-               return EXYNOS4_GPIO_PART2_BASE;
+       if (cpu_is_exynos5()) {
+               if (nr < EXYNOS5_GPIO_PART1_MAX)
+                       return EXYNOS5_GPIO_PART1_BASE;
+               else if (nr < EXYNOS5_GPIO_PART2_MAX)
+                       return EXYNOS5_GPIO_PART2_BASE;
+               else
+                       return EXYNOS5_GPIO_PART3_BASE;
+
+       } else if (cpu_is_exynos4()) {
+               if (nr < EXYNOS4_GPIO_PART1_MAX)
+                       return EXYNOS4_GPIO_PART1_BASE;
+               else
+                       return EXYNOS4_GPIO_PART2_BASE;
+       }
 
        return 0;
 }
diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
new file mode 100644 (file)
index 0000000..fb442f7
--- /dev/null
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.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 __ASM_ARM_ARCH_POWER_H_
+#define __ASM_ARM_ARCH_POWER_H_
+
+#ifndef __ASSEMBLY__
+struct exynos4_power {
+       unsigned int    om_stat;
+       unsigned char   res1[0x8];
+       unsigned int    rtc_clko_sel;
+       unsigned int    gnss_rtc_out_ctrl;
+       unsigned char   res2[0x1ec];
+       unsigned int    system_power_down_ctrl;
+       unsigned char   res3[0x1];
+       unsigned int    system_power_down_option;
+       unsigned char   res4[0x1f4];
+       unsigned int    swreset;
+       unsigned int    rst_stat;
+       unsigned char   res5[0x1f8];
+       unsigned int    wakeup_stat;
+       unsigned int    eint_wakeup_mask;
+       unsigned int    wakeup_mask;
+       unsigned char   res6[0xf4];
+       unsigned int    hdmi_phy_control;
+       unsigned int    usbdevice_phy_control;
+       unsigned int    usbhost_phy_control;
+       unsigned int    dac_phy_control;
+       unsigned int    mipi_phy0_control;
+       unsigned int    mipi_phy1_control;
+       unsigned int    adc_phy_control;
+       unsigned int    pcie_phy_control;
+       unsigned int    sata_phy_control;
+       unsigned char   res7[0xdc];
+       unsigned int    inform0;
+       unsigned int    inform1;
+       unsigned int    inform2;
+       unsigned int    inform3;
+       unsigned int    inform4;
+       unsigned int    inform5;
+       unsigned int    inform6;
+       unsigned int    inform7;
+       unsigned char   res8[0x1e0];
+       unsigned int    pmu_debug;
+       unsigned char   res9[0x5fc];
+       unsigned int    arm_core0_sys_pwr_reg;
+       unsigned char   res10[0xc];
+       unsigned int    arm_core1_sys_pwr_reg;
+       unsigned char   res11[0x6c];
+       unsigned int    arm_common_sys_pwr_reg;
+       unsigned char   res12[0x3c];
+       unsigned int    arm_cpu_l2_0_sys_pwr_reg;
+       unsigned int    arm_cpu_l2_1_sys_pwr_reg;
+       unsigned char   res13[0x38];
+       unsigned int    cmu_aclkstop_sys_pwr_reg;
+       unsigned int    cmu_sclkstop_sys_pwr_reg;
+       unsigned char   res14[0x4];
+       unsigned int    cmu_reset_sys_pwr_reg;
+       unsigned char   res15[0x10];
+       unsigned int    apll_sysclk_sys_pwr_reg;
+       unsigned int    mpll_sysclk_sys_pwr_reg;
+       unsigned int    vpll_sysclk_sys_pwr_reg;
+       unsigned int    epll_sysclk_sys_pwr_reg;
+       unsigned char   res16[0x8];
+       unsigned int    cmu_clkstop_gps_alive_sys_pwr_reg;
+       unsigned int    cmu_reset_gps_alive_sys_pwr_reg;
+       unsigned int    cmu_clkstop_cam_sys_pwr_reg;
+       unsigned int    cmu_clkstop_tv_sys_pwr_reg;
+       unsigned int    cmu_clkstop_mfc_sys_pwr_reg;
+       unsigned int    cmu_clkstop_g3d_sys_pwr_reg;
+       unsigned int    cmu_clkstop_lcd0_sys_pwr_reg;
+       unsigned int    cmu_clkstop_lcd1_sys_pwr_reg;
+       unsigned int    cmu_clkstop_maudio_sys_pwr_reg;
+       unsigned int    cmu_clkstop_gps_sys_pwr_reg;
+       unsigned int    cmu_reset_cam_sys_pwr_reg;
+       unsigned int    cmu_reset_tv_sys_pwr_reg;
+       unsigned int    cmu_reset_mfc_sys_pwr_reg;
+       unsigned int    cmu_reset_g3d_sys_pwr_reg;
+       unsigned int    cmu_reset_lcd0_sys_pwr_reg;
+       unsigned int    cmu_reset_lcd1_sys_pwr_reg;
+       unsigned int    cmu_reset_maudio_sys_pwr_reg;
+       unsigned int    cmu_reset_gps_sys_pwr_reg;
+       unsigned int    top_bus_sys_pwr_reg;
+       unsigned int    top_retention_sys_pwr_reg;
+       unsigned int    top_pwr_sys_pwr_reg;
+       unsigned char   res17[0x1c];
+       unsigned int    logic_reset_sys_pwr_reg;
+       unsigned char   res18[0x14];
+       unsigned int    onenandxl_mem_sys_pwr_reg;
+       unsigned int    modemif_mem_sys_pwr_reg;
+       unsigned char   res19[0x4];
+       unsigned int    usbdevice_mem_sys_pwr_reg;
+       unsigned int    sdmmc_mem_sys_pwr_reg;
+       unsigned int    cssys_mem_sys_pwr_reg;
+       unsigned int    secss_mem_sys_pwr_reg;
+       unsigned char   res20[0x4];
+       unsigned int    pcie_mem_sys_pwr_reg;
+       unsigned int    sata_mem_sys_pwr_reg;
+       unsigned char   res21[0x18];
+       unsigned int    pad_retention_dram_sys_pwr_reg;
+       unsigned int    pad_retention_maudio_sys_pwr_reg;
+       unsigned char   res22[0x18];
+       unsigned int    pad_retention_gpio_sys_pwr_reg;
+       unsigned int    pad_retention_uart_sys_pwr_reg;
+       unsigned int    pad_retention_mmca_sys_pwr_reg;
+       unsigned int    pad_retention_mmcb_sys_pwr_reg;
+       unsigned int    pad_retention_ebia_sys_pwr_reg;
+       unsigned int    pad_retention_ebib_sys_pwr_reg;
+       unsigned char   res23[0x8];
+       unsigned int    pad_isolation_sys_pwr_reg;
+       unsigned char   res24[0x1c];
+       unsigned int    pad_alv_sel_sys_pwr_reg;
+       unsigned char   res25[0x1c];
+       unsigned int    xusbxti_sys_pwr_reg;
+       unsigned int    xxti_sys_pwr_reg;
+       unsigned char   res26[0x38];
+       unsigned int    ext_regulator_sys_pwr_reg;
+       unsigned char   res27[0x3c];
+       unsigned int    gpio_mode_sys_pwr_reg;
+       unsigned char   res28[0x3c];
+       unsigned int    gpio_mode_maudio_sys_pwr_reg;
+       unsigned char   res29[0x3c];
+       unsigned int    cam_sys_pwr_reg;
+       unsigned int    tv_sys_pwr_reg;
+       unsigned int    mfc_sys_pwr_reg;
+       unsigned int    g3d_sys_pwr_reg;
+       unsigned int    lcd0_sys_pwr_reg;
+       unsigned int    lcd1_sys_pwr_reg;
+       unsigned int    maudio_sys_pwr_reg;
+       unsigned int    gps_sys_pwr_reg;
+       unsigned int    gps_alive_sys_pwr_reg;
+       unsigned char   res30[0xc5c];
+       unsigned int    arm_core0_configuration;
+       unsigned int    arm_core0_status;
+       unsigned int    arm_core0_option;
+       unsigned char   res31[0x74];
+       unsigned int    arm_core1_configuration;
+       unsigned int    arm_core1_status;
+       unsigned int    arm_core1_option;
+       unsigned char   res32[0x37c];
+       unsigned int    arm_common_option;
+       unsigned char   res33[0x1f4];
+       unsigned int    arm_cpu_l2_0_configuration;
+       unsigned int    arm_cpu_l2_0_status;
+       unsigned char   res34[0x18];
+       unsigned int    arm_cpu_l2_1_configuration;
+       unsigned int    arm_cpu_l2_1_status;
+       unsigned char   res35[0xa00];
+       unsigned int    pad_retention_maudio_option;
+       unsigned char   res36[0xdc];
+       unsigned int    pad_retention_gpio_option;
+       unsigned char   res37[0x1c];
+       unsigned int    pad_retention_uart_option;
+       unsigned char   res38[0x1c];
+       unsigned int    pad_retention_mmca_option;
+       unsigned char   res39[0x1c];
+       unsigned int    pad_retention_mmcb_option;
+       unsigned char   res40[0x1c];
+       unsigned int    pad_retention_ebia_option;
+       unsigned char   res41[0x1c];
+       unsigned int    pad_retention_ebib_option;
+       unsigned char   res42[0x160];
+       unsigned int    ps_hold_control;
+       unsigned char   res43[0xf0];
+       unsigned int    xusbxti_configuration;
+       unsigned int    xusbxti_status;
+       unsigned char   res44[0x14];
+       unsigned int    xusbxti_duration;
+       unsigned int    xxti_configuration;
+       unsigned int    xxti_status;
+       unsigned char   res45[0x14];
+       unsigned int    xxti_duration;
+       unsigned char   res46[0x1dc];
+       unsigned int    ext_regulator_duration;
+       unsigned char   res47[0x5e0];
+       unsigned int    cam_configuration;
+       unsigned int    cam_status;
+       unsigned int    cam_option;
+       unsigned char   res48[0x14];
+       unsigned int    tv_configuration;
+       unsigned int    tv_status;
+       unsigned int    tv_option;
+       unsigned char   res49[0x14];
+       unsigned int    mfc_configuration;
+       unsigned int    mfc_status;
+       unsigned int    mfc_option;
+       unsigned char   res50[0x14];
+       unsigned int    g3d_configuration;
+       unsigned int    g3d_status;
+       unsigned int    g3d_option;
+       unsigned char   res51[0x14];
+       unsigned int    lcd0_configuration;
+       unsigned int    lcd0_status;
+       unsigned int    lcd0_option;
+       unsigned char   res52[0x14];
+       unsigned int    lcd1_configuration;
+       unsigned int    lcd1_status;
+       unsigned int    lcd1_option;
+       unsigned char   res53[0x34];
+       unsigned int    gps_configuration;
+       unsigned int    gps_status;
+       unsigned int    gps_option;
+       unsigned char   res54[0x14];
+       unsigned int    gps_alive_configuration;
+       unsigned int    gps_alive_status;
+       unsigned int    gps_alive_option;
+};
+#endif /* __ASSEMBLY__ */
+
+#endif
index d0cf3cb853b84b4fab122752fad43ac8c53f2605..3e951601cdcbcd7e6083c4add83497ab79c53fe0 100644 (file)
@@ -57,7 +57,7 @@ struct s5p_timer {
        unsigned int    tcmpb2;
        unsigned int    tcnto2;
        unsigned int    tcntb3;
-       unsigned int    res1;
+       unsigned int    tcmpb3;
        unsigned int    tcnto3;
        unsigned int    tcntb4;
        unsigned int    tcnto4;
diff --git a/arch/arm/include/asm/arch-exynos/tzpc.h b/arch/arm/include/asm/arch-exynos/tzpc.h
new file mode 100644 (file)
index 0000000..2c9a07b
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * (C) Copyright 2012 Samsung Electronics
+ *
+ * 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 __TZPC_H_
+#define __TZPC_H_
+
+#ifndef __ASSEMBLY__
+struct exynos5_tzpc {
+       unsigned int r0size;
+       char res1[0x7FC];
+       unsigned int decprot0stat;
+       unsigned int decprot0set;
+       unsigned int decprot0clr;
+       unsigned int decprot1stat;
+       unsigned int decprot1set;
+       unsigned int decprot1clr;
+       unsigned int decprot2stat;
+       unsigned int decprot2set;
+       unsigned int decprot2clr;
+       unsigned int decprot3stat;
+       unsigned int decprot3set;
+       unsigned int decprot3clr;
+       char res2[0x7B0];
+       unsigned int periphid0;
+       unsigned int periphid1;
+       unsigned int periphid2;
+       unsigned int periphid3;
+       unsigned int pcellid0;
+       unsigned int pcellid1;
+       unsigned int pcellid2;
+       unsigned int pcellid3;
+};
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/arch-exynos/watchdog.h b/arch/arm/include/asm/arch-exynos/watchdog.h
new file mode 100644 (file)
index 0000000..ee0c9c9
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.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 __ASM_ARM_ARCH_WATCHDOG_H_
+#define __ASM_ARM_ARCH_WATCHDOG_H_
+
+#define WTCON_RESET_OFFSET     0
+#define WTCON_INTEN_OFFSET     2
+#define WTCON_CLKSEL_OFFSET    3
+#define WTCON_EN_OFFSET                5
+#define WTCON_PRE_OFFSET       8
+
+#define WTCON_CLK_16           0x0
+#define WTCON_CLK_32           0x1
+#define WTCON_CLK_64           0x2
+#define WTCON_CLK_128          0x3
+
+#define WTCON_CLK(x)           ((x & 0x3) << WTCON_CLKSEL_OFFSET)
+#define WTCON_PRESCALER(x)     ((x) << WTCON_PRE_OFFSET)
+#define WTCON_EN               (0x1 << WTCON_EN_OFFSET)
+#define WTCON_RESET            (0x1 << WTCON_RESET_OFFSET)
+#define WTCON_INT              (0x1 << WTCON_INTEN_OFFSET)
+
+#ifndef __ASSEMBLY__
+struct s5p_watchdog {
+       unsigned int wtcon;
+       unsigned int wtdat;
+       unsigned int wtcnt;
+       unsigned int wtclrint;
+};
+
+/* functions */
+void wdt_stop(void);
+void wdt_start(unsigned int timeout);
+#endif /* __ASSEMBLY__ */
+
+#endif
index d1c199825fd36a6415168b32d00a314a7482c2be..91164eb4021a10f9f77a0e97c8de8b0e3c2bbaf0 100644 (file)
  * USB/EHCI
  */
 #ifdef CONFIG_CMD_USB
-#define CONFIG_USB_EHCI_KIRKWOOD
+#define CONFIG_USB_EHCI_MARVELL
 #define CONFIG_EHCI_IS_TDI
 #endif /* CONFIG_CMD_USB */
 
index 0035ed50a25902985c6b9bdd96343d31df9bdc4f..47771d5d70777f183533a0087835f9b166e3bfce 100644 (file)
 #define MVGBE0_BASE    KW_EGIGA0_BASE
 #define MVGBE1_BASE    KW_EGIGA1_BASE
 
+/* Kirkwood USB Host controller */
+#define MVUSB0_BASE                    KW_USB20_BASE
+#define MVUSB0_CPU_ATTR_DRAM_CS0       KWCPU_ATTR_DRAM_CS0
+#define MVUSB0_CPU_ATTR_DRAM_CS1       KWCPU_ATTR_DRAM_CS1
+#define MVUSB0_CPU_ATTR_DRAM_CS2       KWCPU_ATTR_DRAM_CS2
+#define MVUSB0_CPU_ATTR_DRAM_CS3       KWCPU_ATTR_DRAM_CS3
+
+/* Kirkwood CPU memory windows */
+#define MVCPU_WIN_CTRL_DATA    KWCPU_WIN_CTRL_DATA
+#define MVCPU_WIN_ENABLE       KWCPU_WIN_ENABLE
+#define MVCPU_WIN_DISABLE      KWCPU_WIN_DISABLE
+
 #if defined (CONFIG_KW88F6281)
 #include <asm/arch/kw88f6281.h>
 #elif defined (CONFIG_KW88F6192)
index 7e9c7aabb00cc71554eeb40a91e068d058886b21..fd062d3e896ac687798b5c8418bf383e6dc1dc93 100644 (file)
 
 #ifndef __ASM_ARCH_CLOCK_H
 #define __ASM_ARCH_CLOCK_H
-unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref);
 
-ulong imx_get_mpllclk(void);
-ulong imx_get_armclk(void);
-ulong imx_get_spllclk(void);
-ulong imx_get_fclk(void);
-ulong imx_get_hclk(void);
-ulong imx_get_bclk(void);
-ulong imx_get_perclk1(void);
-ulong imx_get_perclk2(void);
-ulong imx_get_perclk3(void);
-ulong imx_get_ahbclk(void);
+enum mxc_clock {
+       MXC_ARM_CLK,
+       MXC_UART_CLK,
+       MXC_ESDHC_CLK,
+       MXC_FEC_CLK,
+};
 
-#define imx_get_uartclk imx_get_perclk1
-#define imx_get_fecclk imx_get_ahbclk
+unsigned int mxc_get_clock(enum mxc_clock clk);
+#define imx_get_uartclk() mxc_get_clock(MXC_UART_CLK)
+#define imx_get_fecclk() mxc_get_clock(MXC_FEC_CLK)
 
 #endif /* __ASM_ARCH_CLOCK_H */
index 253a0e158481ef6338aa4c3d8472e0ce19b28959..852c19c1a74c45acd296001aa5749cc0f0351c45 100644 (file)
@@ -30,7 +30,8 @@ enum mxc_clock {
        MXC_IPG_PERCLK,
        MXC_CSPI_CLK,
        MXC_UART_CLK,
-       MXC_IPU_CLK
+       MXC_IPU_CLK,
+       MXC_ESDHC_CLK,
 };
 
 unsigned int mxc_get_clock(enum mxc_clock clk);
index 6a517ddd931ca0d1e598bd7456c4c611741602eb..798cc746722a0eec31f4b74d2554bb0d00a8c122 100644 (file)
@@ -709,6 +709,13 @@ struct esdc_regs {
 #define MUX_CTL_CSPI3_SPI_RDY  0x0e
 #define MUX_CTL_CSPI3_MOSI             0x13
 
+#define MUX_CTL_SD1_DATA1      0x18
+#define MUX_CTL_SD1_DATA2      0x19
+#define MUX_CTL_SD1_DATA3      0x1a
+#define MUX_CTL_SD1_CMD                0x1d
+#define MUX_CTL_SD1_CLK                0x1e
+#define MUX_CTL_SD1_DATA0      0x1f
+
 #define MUX_CTL_USBH2_DATA1    0x40
 #define MUX_CTL_USBH2_DIR      0x44
 #define MUX_CTL_USBH2_STP      0x45
@@ -855,6 +862,10 @@ struct esdc_regs {
  */
 #define NFC_BASE_ADDR  0xB8000000
 
+/* SD card controller */
+#define SDHC1_BASE_ADDR        0x50004000
+#define SDHC2_BASE_ADDR        0x50008000
+
 /*
  * Internal RAM (16KB)
  */
index 76003030d77815849956bf00f402151f684c485e..ded481c4339e77d3aafd69cf84ae5f915104e492 100644 (file)
@@ -31,5 +31,5 @@ struct mxc_weimcs {
 };
 
 void mxc_setup_weimcs(int cs, const struct mxc_weimcs *weimcs);
-
+int mxc_mmc_init(bd_t *bis);
 #endif
index b3f613c52aa29ddb9a82bbb6538d541df34f25e9..afaa068bb93ba3c4278bb255235ce3f60768ad07 100644 (file)
@@ -220,7 +220,7 @@ enum {
        MX6Q_PAD_EIM_D24__WEIM_WEIM_D_24        = IOMUX_PAD(0x03C8, 0x00B4, 0, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D24__ECSPI4_SS2            = IOMUX_PAD(0x03C8, 0x00B4, 1, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D24__UART3_TXD             = IOMUX_PAD(0x03C8, 0x00B4, 2, 0x0000, 0, 0),
-       MX6Q_PAD_EIM_D24__UART3_RXD             = IOMUX_PAD(0x03C8, 0x00B4, 2, 0x0930, 0, 0),
+       MX6Q_PAD_EIM_D24__UART3_TXD_RXD         = IOMUX_PAD(0x03C8, 0x00B4, 2, 0x0930, 0, 0),
        MX6Q_PAD_EIM_D24__ECSPI1_SS2            = IOMUX_PAD(0x03C8, 0x00B4, 3, 0x0808, 0, 0),
        MX6Q_PAD_EIM_D24__ECSPI2_SS2            = IOMUX_PAD(0x03C8, 0x00B4, 4, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D24__GPIO_3_24             = IOMUX_PAD(0x03C8, 0x00B4, 5, 0x0000, 0, 0),
@@ -228,7 +228,6 @@ enum {
        MX6Q_PAD_EIM_D24__UART1_DTR             = IOMUX_PAD(0x03C8, 0x00B4, 7, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D25__WEIM_WEIM_D_25        = IOMUX_PAD(0x03CC, 0x00B8, 0, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D25__ECSPI4_SS3            = IOMUX_PAD(0x03CC, 0x00B8, 1, 0x0000, 0, 0),
-       MX6Q_PAD_EIM_D25__UART3_TXD             = IOMUX_PAD(0x03CC, 0x00B8, 2, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D25__UART3_RXD             = IOMUX_PAD(0x03CC, 0x00B8, 2, 0x0930, 1, 0),
        MX6Q_PAD_EIM_D25__ECSPI1_SS3            = IOMUX_PAD(0x03CC, 0x00B8, 3, 0x080C, 0, 0),
        MX6Q_PAD_EIM_D25__ECSPI2_SS3            = IOMUX_PAD(0x03CC, 0x00B8, 4, 0x0000, 0, 0),
@@ -240,7 +239,7 @@ enum {
        MX6Q_PAD_EIM_D26__IPU1_CSI0_D_1         = IOMUX_PAD(0x03D0, 0x00BC, 2, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D26__IPU2_CSI1_D_14        = IOMUX_PAD(0x03D0, 0x00BC, 3, 0x08C0, 0, 0),
        MX6Q_PAD_EIM_D26__UART2_TXD             = IOMUX_PAD(0x03D0, 0x00BC, 4, 0x0000, 0, 0),
-       MX6Q_PAD_EIM_D26__UART2_RXD             = IOMUX_PAD(0x03D0, 0x00BC, 4, 0x0928, 0, 0),
+       MX6Q_PAD_EIM_D26__UART2_TXD_RXD         = IOMUX_PAD(0x03D0, 0x00BC, 4, 0x0928, 0, 0),
        MX6Q_PAD_EIM_D26__GPIO_3_26             = IOMUX_PAD(0x03D0, 0x00BC, 5, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D26__IPU1_SISG_2           = IOMUX_PAD(0x03D0, 0x00BC, 6, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D26__IPU1_DISP1_DAT_22     = IOMUX_PAD(0x03D0, 0x00BC, 7, 0x0000, 0, 0),
@@ -248,7 +247,6 @@ enum {
        MX6Q_PAD_EIM_D27__IPU1_DI1_PIN13        = IOMUX_PAD(0x03D4, 0x00C0, 1, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D27__IPU1_CSI0_D_0         = IOMUX_PAD(0x03D4, 0x00C0, 2, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D27__IPU2_CSI1_D_13        = IOMUX_PAD(0x03D4, 0x00C0, 3, 0x08BC, 0, 0),
-       MX6Q_PAD_EIM_D27__UART2_TXD             = IOMUX_PAD(0x03D4, 0x00C0, 4, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D27__UART2_RXD             = IOMUX_PAD(0x03D4, 0x00C0, 4, 0x0928, 1, 0),
        MX6Q_PAD_EIM_D27__GPIO_3_27             = IOMUX_PAD(0x03D4, 0x00C0, 5, 0x0000, 0, 0),
        MX6Q_PAD_EIM_D27__IPU1_SISG_3           = IOMUX_PAD(0x03D4, 0x00C0, 6, 0x0000, 0, 0),
@@ -938,7 +936,7 @@ enum {
        MX6Q_PAD_KEY_COL0__AUDMUX_AUD5_TXC      = IOMUX_PAD(0x05C8, 0x01F8, 2, 0x07DC, 1, 0),
        MX6Q_PAD_KEY_COL0__KPP_COL_0            = IOMUX_PAD(0x05C8, 0x01F8, 3, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL0__UART4_TXD            = IOMUX_PAD(0x05C8, 0x01F8, 4, 0x0000, 0, 0),
-       MX6Q_PAD_KEY_COL0__UART4_RXD            = IOMUX_PAD(0x05C8, 0x01F8, 4, 0x0938, 0, 0),
+       MX6Q_PAD_KEY_COL0__UART4_TXD_RXD        = IOMUX_PAD(0x05C8, 0x01F8, 4, 0x0938, 0, 0),
        MX6Q_PAD_KEY_COL0__GPIO_4_6             = IOMUX_PAD(0x05C8, 0x01F8, 5, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL0__DCIC1_DCIC_OUT       = IOMUX_PAD(0x05C8, 0x01F8, 6, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL0__SRC_ANY_PU_RST       = IOMUX_PAD(0x05C8, 0x01F8, 7, 0x0000, 0, 0),
@@ -946,7 +944,6 @@ enum {
        MX6Q_PAD_KEY_ROW0__ENET_TDATA_3         = IOMUX_PAD(0x05CC, 0x01FC, 1, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW0__AUDMUX_AUD5_TXD      = IOMUX_PAD(0x05CC, 0x01FC, 2, 0x07D0, 1, 0),
        MX6Q_PAD_KEY_ROW0__KPP_ROW_0            = IOMUX_PAD(0x05CC, 0x01FC, 3, 0x0000, 0, 0),
-       MX6Q_PAD_KEY_ROW0__UART4_TXD            = IOMUX_PAD(0x05CC, 0x01FC, 4, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW0__UART4_RXD            = IOMUX_PAD(0x05CC, 0x01FC, 4, 0x0938, 1, 0),
        MX6Q_PAD_KEY_ROW0__GPIO_4_7             = IOMUX_PAD(0x05CC, 0x01FC, 5, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW0__DCIC2_DCIC_OUT       = IOMUX_PAD(0x05CC, 0x01FC, 6, 0x0000, 0, 0),
@@ -956,7 +953,7 @@ enum {
        MX6Q_PAD_KEY_COL1__AUDMUX_AUD5_TXFS     = IOMUX_PAD(0x05D0, 0x0200, 2, 0x07E0, 1, 0),
        MX6Q_PAD_KEY_COL1__KPP_COL_1            = IOMUX_PAD(0x05D0, 0x0200, 3, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL1__UART5_TXD            = IOMUX_PAD(0x05D0, 0x0200, 4, 0x0000, 0, 0),
-       MX6Q_PAD_KEY_COL1__UART5_RXD            = IOMUX_PAD(0x05D0, 0x0200, 4, 0x0940, 0, 0),
+       MX6Q_PAD_KEY_COL1__UART5_TXD_RXD        = IOMUX_PAD(0x05D0, 0x0200, 4, 0x0940, 0, 0),
        MX6Q_PAD_KEY_COL1__GPIO_4_8             = IOMUX_PAD(0x05D0, 0x0200, 5, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL1__USDHC1_VSELECT       = IOMUX_PAD(0x05D0, 0x0200, 6, 0x0000, 0, 0),
        MX6Q_PAD_KEY_COL1__PL301MX_PER1_HADR_1  = IOMUX_PAD(0x05D0, 0x0200, 7, 0x0000, 0, 0),
@@ -964,7 +961,6 @@ enum {
        MX6Q_PAD_KEY_ROW1__ENET_COL             = IOMUX_PAD(0x05D4, 0x0204, 1, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW1__AUDMUX_AUD5_RXD      = IOMUX_PAD(0x05D4, 0x0204, 2, 0x07CC, 1, 0),
        MX6Q_PAD_KEY_ROW1__KPP_ROW_1            = IOMUX_PAD(0x05D4, 0x0204, 3, 0x0000, 0, 0),
-       MX6Q_PAD_KEY_ROW1__UART5_TXD            = IOMUX_PAD(0x05D4, 0x0204, 4, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW1__UART5_RXD            = IOMUX_PAD(0x05D4, 0x0204, 4, 0x0940, 1, 0),
        MX6Q_PAD_KEY_ROW1__GPIO_4_9             = IOMUX_PAD(0x05D4, 0x0204, 5, 0x0000, 0, 0),
        MX6Q_PAD_KEY_ROW1__USDHC2_VSELECT       = IOMUX_PAD(0x05D4, 0x0204, 6, 0x0000, 0, 0),
@@ -1085,7 +1081,7 @@ enum {
        MX6Q_PAD_GPIO_7__EPIT1_EPITO            = IOMUX_PAD(0x0610, 0x0240, 2, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_7__CAN1_TXCAN             = IOMUX_PAD(0x0610, 0x0240, 3, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_7__UART2_TXD              = IOMUX_PAD(0x0610, 0x0240, 4, 0x0000, 0, 0),
-       MX6Q_PAD_GPIO_7__UART2_RXD              = IOMUX_PAD(0x0610, 0x0240, 4, 0x0928, 2, 0),
+       MX6Q_PAD_GPIO_7__UART2_TXD_RXD          = IOMUX_PAD(0x0610, 0x0240, 4, 0x0928, 2, 0),
        MX6Q_PAD_GPIO_7__GPIO_1_7               = IOMUX_PAD(0x0610, 0x0240, 5, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_7__SPDIF_PLOCK            = IOMUX_PAD(0x0610, 0x0240, 6, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_7__USBOH3_OTGUSB_HST_MODE = IOMUX_PAD(0x0610, 0x0240, 7, 0x0000, 0, 0),
@@ -1093,7 +1089,6 @@ enum {
        MX6Q_PAD_GPIO_8__ANATOP_ANATOP_32K_OUT  = IOMUX_PAD(0x0614, 0x0244, 1, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_8__EPIT2_EPITO            = IOMUX_PAD(0x0614, 0x0244, 2, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_8__CAN1_RXCAN             = IOMUX_PAD(0x0614, 0x0244, 3, 0x07E4, 1, 0),
-       MX6Q_PAD_GPIO_8__UART2_TXD              = IOMUX_PAD(0x0614, 0x0244, 4, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_8__UART2_RXD              = IOMUX_PAD(0x0614, 0x0244, 4, 0x0928, 3, 0),
        MX6Q_PAD_GPIO_8__GPIO_1_8               = IOMUX_PAD(0x0614, 0x0244, 5, 0x0000, 0, 0),
        MX6Q_PAD_GPIO_8__SPDIF_SRCLK            = IOMUX_PAD(0x0614, 0x0244, 6, 0x0000, 0, 0),
@@ -1208,7 +1203,7 @@ enum {
        MX6Q_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC    = IOMUX_PAD(0x0650, 0x0280, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT10__ECSPI2_MISO        = IOMUX_PAD(0x0650, 0x0280, 2, 0x0814, 2, 0),
        MX6Q_PAD_CSI0_DAT10__UART1_TXD          = IOMUX_PAD(0x0650, 0x0280, 3, 0x0000, 0, 0),
-       MX6Q_PAD_CSI0_DAT10__UART1_RXD          = IOMUX_PAD(0x0650, 0x0280, 3, 0x0920, 0, 0),
+       MX6Q_PAD_CSI0_DAT10__UART1_TXD_RXD      = IOMUX_PAD(0x0650, 0x0280, 3, 0x0920, 0, 0),
        MX6Q_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4    = IOMUX_PAD(0x0650, 0x0280, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT10__GPIO_5_28          = IOMUX_PAD(0x0650, 0x0280, 5, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT10__MMDC_MMDC_DEBUG_33 = IOMUX_PAD(0x0650, 0x0280, 6, 0x0000, 0, 0),
@@ -1216,7 +1211,6 @@ enum {
        MX6Q_PAD_CSI0_DAT11__IPU1_CSI0_D_11     = IOMUX_PAD(0x0654, 0x0284, 0, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT11__AUDMUX_AUD3_RXFS   = IOMUX_PAD(0x0654, 0x0284, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT11__ECSPI2_SS0         = IOMUX_PAD(0x0654, 0x0284, 2, 0x081C, 2, 0),
-       MX6Q_PAD_CSI0_DAT11__UART1_TXD          = IOMUX_PAD(0x0654, 0x0284, 3, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT11__UART1_RXD          = IOMUX_PAD(0x0654, 0x0284, 3, 0x0920, 1, 0),
        MX6Q_PAD_CSI0_DAT11__SDMA_DEBUG_PC_5    = IOMUX_PAD(0x0654, 0x0284, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT11__GPIO_5_29          = IOMUX_PAD(0x0654, 0x0284, 5, 0x0000, 0, 0),
@@ -1226,7 +1220,7 @@ enum {
        MX6Q_PAD_CSI0_DAT12__WEIM_WEIM_D_8      = IOMUX_PAD(0x0658, 0x0288, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT12__PCIE_CTRL_MUX_16   = IOMUX_PAD(0x0658, 0x0288, 2, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT12__UART4_TXD          = IOMUX_PAD(0x0658, 0x0288, 3, 0x0000, 0, 0),
-       MX6Q_PAD_CSI0_DAT12__UART4_RXD          = IOMUX_PAD(0x0658, 0x0288, 3, 0x0938, 2, 0),
+       MX6Q_PAD_CSI0_DAT12__UART4_TXD_RXD      = IOMUX_PAD(0x0658, 0x0288, 3, 0x0938, 2, 0),
        MX6Q_PAD_CSI0_DAT12__SDMA_DEBUG_PC_6    = IOMUX_PAD(0x0658, 0x0288, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT12__GPIO_5_30          = IOMUX_PAD(0x0658, 0x0288, 5, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT12__MMDC_MMDC_DEBUG_35 = IOMUX_PAD(0x0658, 0x0288, 6, 0x0000, 0, 0),
@@ -1234,7 +1228,6 @@ enum {
        MX6Q_PAD_CSI0_DAT13__IPU1_CSI0_D_13     = IOMUX_PAD(0x065C, 0x028C, 0, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT13__WEIM_WEIM_D_9      = IOMUX_PAD(0x065C, 0x028C, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT13__PCIE_CTRL_MUX_17   = IOMUX_PAD(0x065C, 0x028C, 2, 0x0000, 0, 0),
-       MX6Q_PAD_CSI0_DAT13__UART4_TXD          = IOMUX_PAD(0x065C, 0x028C, 3, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT13__UART4_RXD          = IOMUX_PAD(0x065C, 0x028C, 3, 0x0938, 3, 0),
        MX6Q_PAD_CSI0_DAT13__SDMA_DEBUG_PC_7    = IOMUX_PAD(0x065C, 0x028C, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT13__GPIO_5_31          = IOMUX_PAD(0x065C, 0x028C, 5, 0x0000, 0, 0),
@@ -1244,7 +1237,7 @@ enum {
        MX6Q_PAD_CSI0_DAT14__WEIM_WEIM_D_10     = IOMUX_PAD(0x0660, 0x0290, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT14__PCIE_CTRL_MUX_18   = IOMUX_PAD(0x0660, 0x0290, 2, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT14__UART5_TXD          = IOMUX_PAD(0x0660, 0x0290, 3, 0x0000, 0, 0),
-       MX6Q_PAD_CSI0_DAT14__UART5_RXD          = IOMUX_PAD(0x0660, 0x0290, 3, 0x0940, 2, 0),
+       MX6Q_PAD_CSI0_DAT14__UART5_TXD_RXD      = IOMUX_PAD(0x0660, 0x0290, 3, 0x0940, 2, 0),
        MX6Q_PAD_CSI0_DAT14__SDMA_DEBUG_PC_8    = IOMUX_PAD(0x0660, 0x0290, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT14__GPIO_6_0           = IOMUX_PAD(0x0660, 0x0290, 5, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT14__MMDC_MMDC_DEBUG_37 = IOMUX_PAD(0x0660, 0x0290, 6, 0x0000, 0, 0),
@@ -1252,7 +1245,6 @@ enum {
        MX6Q_PAD_CSI0_DAT15__IPU1_CSI0_D_15     = IOMUX_PAD(0x0664, 0x0294, 0, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT15__WEIM_WEIM_D_11     = IOMUX_PAD(0x0664, 0x0294, 1, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT15__PCIE_CTRL_MUX_19   = IOMUX_PAD(0x0664, 0x0294, 2, 0x0000, 0, 0),
-       MX6Q_PAD_CSI0_DAT15__UART5_TXD          = IOMUX_PAD(0x0664, 0x0294, 3, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT15__UART5_RXD          = IOMUX_PAD(0x0664, 0x0294, 3, 0x0940, 3, 0),
        MX6Q_PAD_CSI0_DAT15__SDMA_DEBUG_PC_9    = IOMUX_PAD(0x0664, 0x0294, 4, 0x0000, 0, 0),
        MX6Q_PAD_CSI0_DAT15__GPIO_6_1           = IOMUX_PAD(0x0664, 0x0294, 5, 0x0000, 0, 0),
@@ -1318,7 +1310,7 @@ enum {
        MX6Q_PAD_TEST_MODE__TCU_TEST_MODE       = IOMUX_PAD(NO_PAD_I, NO_MUX_I, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT7__USDHC3_DAT7          = IOMUX_PAD(0x0690, 0x02A8, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT7__UART1_TXD            = IOMUX_PAD(0x0690, 0x02A8, 1, 0x0000, 0, 0),
-       MX6Q_PAD_SD3_DAT7__UART1_RXD            = IOMUX_PAD(0x0690, 0x02A8, 1, 0x0920, 2, 0),
+       MX6Q_PAD_SD3_DAT7__UART1_TXD_RXD        = IOMUX_PAD(0x0690, 0x02A8, 1, 0x0920, 2, 0),
        MX6Q_PAD_SD3_DAT7__PCIE_CTRL_MUX_24     = IOMUX_PAD(0x0690, 0x02A8, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT7__USBOH3_UH3_DFD_OUT_0 = IOMUX_PAD(0x0690, 0x02A8, 3, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT7__USBOH3_UH2_DFD_OUT_0 = IOMUX_PAD(0x0690, 0x02A8, 4, 0x0000, 0, 0),
@@ -1326,7 +1318,6 @@ enum {
        MX6Q_PAD_SD3_DAT7__MIPI_CORE_DPHY_IN_12 = IOMUX_PAD(0x0690, 0x02A8, 6, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT7__USBPHY2_CLK20DIV     = IOMUX_PAD(0x0690, 0x02A8, 7, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT6__USDHC3_DAT6          = IOMUX_PAD(0x0694, 0x02AC, 0, 0x0000, 0, 0),
-       MX6Q_PAD_SD3_DAT6__UART1_TXD            = IOMUX_PAD(0x0694, 0x02AC, 1, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT6__UART1_RXD            = IOMUX_PAD(0x0694, 0x02AC, 1, 0x0920, 3, 0),
        MX6Q_PAD_SD3_DAT6__PCIE_CTRL_MUX_25     = IOMUX_PAD(0x0694, 0x02AC, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT6__USBOH3_UH3_DFD_OUT_1 = IOMUX_PAD(0x0694, 0x02AC, 3, 0x0000, 0, 0),
@@ -1336,7 +1327,7 @@ enum {
        MX6Q_PAD_SD3_DAT6__ANATOP_TESTO_10      = IOMUX_PAD(0x0694, 0x02AC, 7, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT5__USDHC3_DAT5          = IOMUX_PAD(0x0698, 0x02B0, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT5__UART2_TXD            = IOMUX_PAD(0x0698, 0x02B0, 1, 0x0000, 0, 0),
-       MX6Q_PAD_SD3_DAT5__UART2_RXD            = IOMUX_PAD(0x0698, 0x02B0, 1, 0x0928, 4, 0),
+       MX6Q_PAD_SD3_DAT5__UART2_TXD_RXD        = IOMUX_PAD(0x0698, 0x02B0, 1, 0x0928, 4, 0),
        MX6Q_PAD_SD3_DAT5__PCIE_CTRL_MUX_26     = IOMUX_PAD(0x0698, 0x02B0, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT5__USBOH3_UH3_DFD_OUT_2 = IOMUX_PAD(0x0698, 0x02B0, 3, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT5__USBOH3_UH2_DFD_OUT_2 = IOMUX_PAD(0x0698, 0x02B0, 4, 0x0000, 0, 0),
@@ -1344,7 +1335,6 @@ enum {
        MX6Q_PAD_SD3_DAT5__MIPI_CORE_DPHY_IN_14 = IOMUX_PAD(0x0698, 0x02B0, 6, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT5__ANATOP_TESTO_11      = IOMUX_PAD(0x0698, 0x02B0, 7, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT4__USDHC3_DAT4          = IOMUX_PAD(0x069C, 0x02B4, 0, 0x0000, 0, 0),
-       MX6Q_PAD_SD3_DAT4__UART2_TXD            = IOMUX_PAD(0x069C, 0x02B4, 1, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT4__UART2_RXD            = IOMUX_PAD(0x069C, 0x02B4, 1, 0x0928, 5, 0),
        MX6Q_PAD_SD3_DAT4__PCIE_CTRL_MUX_27     = IOMUX_PAD(0x069C, 0x02B4, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD3_DAT4__USBOH3_UH3_DFD_OUT_3 = IOMUX_PAD(0x069C, 0x02B4, 3, 0x0000, 0, 0),
@@ -1471,13 +1461,12 @@ enum {
        MX6Q_PAD_SD4_CMD__USDHC4_CMD            = IOMUX_PAD(0x06DC, 0x02F4, 16, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CMD__RAWNAND_RDN           = IOMUX_PAD(0x06DC, 0x02F4, 1, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CMD__UART3_TXD             = IOMUX_PAD(0x06DC, 0x02F4, 2, 0x0000, 0, 0),
-       MX6Q_PAD_SD4_CMD__UART3_RXD             = IOMUX_PAD(0x06DC, 0x02F4, 2, 0x0930, 2, 0),
+       MX6Q_PAD_SD4_CMD__UART3_TXD_RXD         = IOMUX_PAD(0x06DC, 0x02F4, 2, 0x0930, 2, 0),
        MX6Q_PAD_SD4_CMD__PCIE_CTRL_MUX_5       = IOMUX_PAD(0x06DC, 0x02F4, 4, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CMD__GPIO_7_9              = IOMUX_PAD(0x06DC, 0x02F4, 5, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CMD__TPSMP_HDATA_DIR       = IOMUX_PAD(0x06DC, 0x02F4, 7, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CLK__USDHC4_CLK            = IOMUX_PAD(0x06E0, 0x02F8, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CLK__RAWNAND_WRN           = IOMUX_PAD(0x06E0, 0x02F8, 1, 0x0000, 0, 0),
-       MX6Q_PAD_SD4_CLK__UART3_TXD             = IOMUX_PAD(0x06E0, 0x02F8, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CLK__UART3_RXD             = IOMUX_PAD(0x06E0, 0x02F8, 2, 0x0930, 3, 0),
        MX6Q_PAD_SD4_CLK__PCIE_CTRL_MUX_6       = IOMUX_PAD(0x06E0, 0x02F8, 4, 0x0000, 0, 0),
        MX6Q_PAD_SD4_CLK__GPIO_7_10             = IOMUX_PAD(0x06E0, 0x02F8, 5, 0x0000, 0, 0),
@@ -1578,7 +1567,6 @@ enum {
        MX6Q_PAD_SD4_DAT3__IPU2_IPU_DIAG_BUS_11 = IOMUX_PAD(0x0710, 0x0328, 7, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT4__RAWNAND_D12          = IOMUX_PAD(0x0714, 0x032C, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT4__USDHC4_DAT4          = IOMUX_PAD(0x0714, 0x032C, 1, 0x0000, 0, 0),
-       MX6Q_PAD_SD4_DAT4__UART2_TXD            = IOMUX_PAD(0x0714, 0x032C, 2, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT4__UART2_RXD            = IOMUX_PAD(0x0714, 0x032C, 2, 0x0928, 6, 0),
        MX6Q_PAD_SD4_DAT4__USBOH3_UH2_DFD_OUT28 = IOMUX_PAD(0x0714, 0x032C, 3, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT4__USBOH3_UH3_DFD_OUT28 = IOMUX_PAD(0x0714, 0x032C, 4, 0x0000, 0, 0),
@@ -1605,7 +1593,7 @@ enum {
        MX6Q_PAD_SD4_DAT7__RAWNAND_D15          = IOMUX_PAD(0x0720, 0x0338, 0, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT7__USDHC4_DAT7          = IOMUX_PAD(0x0720, 0x0338, 1, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT7__UART2_TXD            = IOMUX_PAD(0x0720, 0x0338, 2, 0x0000, 0, 0),
-       MX6Q_PAD_SD4_DAT7__UART2_RXD            = IOMUX_PAD(0x0720, 0x0338, 2, 0x0928, 7, 0),
+       MX6Q_PAD_SD4_DAT7__UART2_TXD_RXD        = IOMUX_PAD(0x0720, 0x0338, 2, 0x0928, 7, 0),
        MX6Q_PAD_SD4_DAT7__USBOH3_UH2_DFD_OUT31 = IOMUX_PAD(0x0720, 0x0338, 3, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT7__USBOH3_UH3_DFD_OUT31 = IOMUX_PAD(0x0720, 0x0338, 4, 0x0000, 0, 0),
        MX6Q_PAD_SD4_DAT7__GPIO_2_15            = IOMUX_PAD(0x0720, 0x0338, 5, 0x0000, 0, 0),
index db29b7c6df55e9cb9b901cae185f0be87a166cad..5925ac4e1eb76021741fc908c5a9b1baf0f7be8e 100644 (file)
@@ -72,7 +72,7 @@
 #define MPU_FSEL_13_ES1                0x03
 #define MPU_M2_13_ES1          0x01
 
-#define MPU_M_13_ES2           0x1F4
+#define MPU_M_13_ES2           0x258
 #define MPU_N_13_ES2           0x0C
 #define MPU_FSEL_13_ES2                0x03
 #define MPU_M2_13_ES2          0x01
diff --git a/arch/arm/include/asm/arch-omap3/ehci.h b/arch/arm/include/asm/arch-omap3/ehci.h
new file mode 100644 (file)
index 0000000..0f73d20
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2011
+ * Alexander Holler <holler@ahsoftware.de>
+ *
+ * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37
+ *
+ * See there for additional Copyrights.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+#ifndef _OMAP3_EHCI_H_
+#define _OMAP3_EHCI_H_
+
+/* USB/EHCI registers */
+#define OMAP_USBTLL_BASE                               0x48062000UL
+#define OMAP_UHH_BASE                                  0x48064000UL
+#define OMAP_EHCI_BASE                                 0x48064800UL
+
+/* TLL Register Set */
+#define OMAP_USBTLL_SYSCONFIG_SOFTRESET                        (1 << 1)
+#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP                        (1 << 2)
+#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE                        (1 << 3)
+#define OMAP_USBTLL_SYSCONFIG_CACTIVITY                        (1 << 8)
+#define OMAP_USBTLL_SYSSTATUS_RESETDONE                        1
+
+/* UHH Register Set */
+#define OMAP_UHH_SYSCONFIG_SOFTRESET                   (1 << 1)
+#define OMAP_UHH_SYSCONFIG_CACTIVITY                   (1 << 8)
+#define OMAP_UHH_SYSCONFIG_SIDLEMODE                   (1 << 3)
+#define OMAP_UHH_SYSCONFIG_ENAWAKEUP                   (1 << 2)
+#define OMAP_UHH_SYSCONFIG_MIDLEMODE                   (1 << 12)
+#define OMAP_UHH_SYSSTATUS_EHCI_RESETDONE              (1 << 2)
+
+#define OMAP_UHH_SYSCONFIG_VAL         (OMAP_UHH_SYSCONFIG_CACTIVITY | \
+                                       OMAP_UHH_SYSCONFIG_SIDLEMODE | \
+                                       OMAP_UHH_SYSCONFIG_ENAWAKEUP | \
+                                       OMAP_UHH_SYSCONFIG_MIDLEMODE)
+
+#endif /* _OMAP3_EHCI_H_ */
diff --git a/arch/arm/include/asm/arch-omap3/ehci_omap3.h b/arch/arm/include/asm/arch-omap3/ehci_omap3.h
deleted file mode 100644 (file)
index cd01f50..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (C) Copyright 2011
- * Alexander Holler <holler@ahsoftware.de>
- *
- * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37
- *
- * See there for additional Copyrights.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-#ifndef _EHCI_OMAP3_H_
-#define _EHCI_OMAP3_H_
-
-/* USB/EHCI registers */
-#define OMAP3_USBTLL_BASE                              0x48062000UL
-#define OMAP3_UHH_BASE                                 0x48064000UL
-#define OMAP3_EHCI_BASE                                        0x48064800UL
-
-/* TLL Register Set */
-#define        OMAP_USBTLL_SYSCONFIG                           (0x10)
-#define        OMAP_USBTLL_SYSCONFIG_SOFTRESET                 (1 << 1)
-#define        OMAP_USBTLL_SYSCONFIG_ENAWAKEUP                 (1 << 2)
-#define        OMAP_USBTLL_SYSCONFIG_SIDLEMODE                 (1 << 3)
-#define        OMAP_USBTLL_SYSCONFIG_CACTIVITY                 (1 << 8)
-
-#define        OMAP_USBTLL_SYSSTATUS                           (0x14)
-#define        OMAP_USBTLL_SYSSTATUS_RESETDONE                 (1 << 0)
-
-/* UHH Register Set */
-#define        OMAP_UHH_SYSCONFIG                              (0x10)
-#define        OMAP_UHH_SYSCONFIG_SOFTRESET                    (1 << 1)
-#define        OMAP_UHH_SYSCONFIG_CACTIVITY                    (1 << 8)
-#define        OMAP_UHH_SYSCONFIG_SIDLEMODE                    (1 << 3)
-#define        OMAP_UHH_SYSCONFIG_ENAWAKEUP                    (1 << 2)
-#define        OMAP_UHH_SYSCONFIG_MIDLEMODE                    (1 << 12)
-
-#define        OMAP_UHH_HOSTCONFIG                             (0x40)
-#define OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN             (1 << 2)
-#define OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN             (1 << 3)
-#define OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN            (1 << 4)
-
-#endif /* _EHCI_OMAP3_H_ */
index 4ca929edeafa422b11cca8808ae4e485c8571cbf..9f6992a12101803ed0fe6816d99d9754aa5aa45c 100644 (file)
@@ -80,15 +80,15 @@ enum {
 #define ACTIM_CTRLA_TDPL(v)    (((v) & 0x07) << 6)     /*  8:6  */
 #define ACTIM_CTRLA_TDAL(v)    (v & 0x1F)              /*  4:0  */
 
-#define ACTIM_CTRLA(a,b,c,d,e,f,g,h)           \
-               ACTIM_CTRLA_TRFC(a)     |       \
-               ACTIM_CTRLA_TRC(b)      |       \
-               ACTIM_CTRLA_TRAS(b)     |       \
-               ACTIM_CTRLA_TRP(d)      |       \
-               ACTIM_CTRLA_TRCD(e)     |       \
-               ACTIM_CTRLA_TRRD(f)     |       \
-               ACTIM_CTRLA_TDPL(g)     |       \
-               ACTIM_CTRLA_TDAL(h)
+#define ACTIM_CTRLA(trfc, trc, tras, trp, trcd, trrd, tdpl, tdal)      \
+               ACTIM_CTRLA_TRFC(trfc)  |       \
+               ACTIM_CTRLA_TRC(trc)    |       \
+               ACTIM_CTRLA_TRAS(tras)  |       \
+               ACTIM_CTRLA_TRP(trp)    |       \
+               ACTIM_CTRLA_TRCD(trcd)  |       \
+               ACTIM_CTRLA_TRRD(trrd)  |       \
+               ACTIM_CTRLA_TDPL(tdpl)  |       \
+               ACTIM_CTRLA_TDAL(tdal)
 
 /* Helper macros to arrive at value of the SDRC_ACTIM_CTRLB register. */
 #define ACTIM_CTRLB_TWTR(v)    (((v) & 0x03) << 16)    /* 17:16 */
@@ -96,11 +96,11 @@ enum {
 #define ACTIM_CTRLB_TXP(v)     (((v) & 0x07) << 8)     /* 10:8  */
 #define ACTIM_CTRLB_TXSR(v)    (v & 0xFF)              /*  7:0  */
 
-#define ACTIM_CTRLB(a,b,c,d)                   \
-               ACTIM_CTRLB_TWTR(a)     |       \
-               ACTIM_CTRLB_TCKE(b)     |       \
-               ACTIM_CTRLB_TXP(b)      |       \
-               ACTIM_CTRLB_TXSR(d)
+#define ACTIM_CTRLB(twtr, tcke, txp, txsr)             \
+               ACTIM_CTRLB_TWTR(twtr)  |       \
+               ACTIM_CTRLB_TCKE(tcke)  |       \
+               ACTIM_CTRLB_TXP(txp)    |       \
+               ACTIM_CTRLB_TXSR(txsr)
 
 /*
  * Values used in the MCFG register.  Only values we use today
@@ -110,18 +110,19 @@ enum {
 #define V_MCFG_RAMTYPE_DDR             (0x1)
 #define V_MCFG_DEEPPD_EN               (0x1 << 3)
 #define V_MCFG_B32NOT16_32             (0x1 << 4)
-#define V_MCFG_BANKALLOCATION_RBC      (0x2 << 6)      /* 6:7 */
-#define V_MCFG_RAMSIZE(a)              ((((a)/(1024*1024))/2) << 8) /* 8:17 */
+#define V_MCFG_BANKALLOCATION_RBC      (0x2 << 6)              /* 6:7 */
+#define V_MCFG_RAMSIZE(ramsize)                ((((ramsize) >> 20)/2) << 8) /* 8:17 */
 #define V_MCFG_ADDRMUXLEGACY_FLEX      (0x1 << 19)
-#define V_MCFG_CASWIDTH_10B            (0x5 << 20)     /* 20:22 */
-#define V_MCFG_RASWIDTH(a)             ((a) << 24)     /* 24:26 */
+#define V_MCFG_CASWIDTH(caswidth)      (((caswidth)-5) << 20)  /* 20:22 */
+#define V_MCFG_CASWIDTH_10B            V_MCFG_CASWIDTH(10)
+#define V_MCFG_RASWIDTH(raswidth)      (((raswidth)-11) << 24) /* 24:26 */
 
 /* Macro to construct MCFG */
-#define MCFG(a, b)                                             \
-               V_MCFG_RASWIDTH(b) | V_MCFG_CASWIDTH_10B |      \
-               V_MCFG_ADDRMUXLEGACY_FLEX | V_MCFG_RAMSIZE(a) | \
-               V_MCFG_BANKALLOCATION_RBC |                     \
-               V_MCFG_B32NOT16_32 | V_MCFG_DEEPPD_EN | V_MCFG_RAMTYPE_DDR
+#define MCFG(ramsize, raswidth)                                                \
+               V_MCFG_RASWIDTH(raswidth) | V_MCFG_CASWIDTH_10B |       \
+               V_MCFG_ADDRMUXLEGACY_FLEX | V_MCFG_RAMSIZE(ramsize) |   \
+               V_MCFG_BANKALLOCATION_RBC | V_MCFG_B32NOT16_32 |        \
+               V_MCFG_DEEPPD_EN | V_MCFG_RAMTYPE_DDR
 
 /* Hynix part of Overo (165MHz optimized) 6.06ns */
 #define HYNIX_TDAL_165   6
@@ -146,7 +147,7 @@ enum {
                ACTIM_CTRLB(HYNIX_TWTR_165, HYNIX_TCKE_165,     \
                                HYNIX_TXP_165, HYNIX_XSR_165)
 
-#define HYNIX_RASWIDTH_165     0x2
+#define HYNIX_RASWIDTH_165     13
 #define HYNIX_V_MCFG_165(size) MCFG((size), HYNIX_RASWIDTH_165)
 
 /* Hynix part of AM/DM37xEVM (200MHz optimized) */
@@ -172,7 +173,7 @@ enum {
                ACTIM_CTRLB(HYNIX_TWTR_200, HYNIX_TCKE_200,     \
                                HYNIX_TXP_200, HYNIX_XSR_200)
 
-#define HYNIX_RASWIDTH_200     0x3
+#define HYNIX_RASWIDTH_200     14
 #define HYNIX_V_MCFG_200(size) MCFG((size), HYNIX_RASWIDTH_200)
 
 /* Infineon part of 3430SDP (165MHz optimized) 6.06ns */
@@ -227,7 +228,7 @@ enum {
                ACTIM_CTRLB(MICRON_TWTR_165, MICRON_TCKE_165,   \
                                MICRON_TXP_165, MICRON_XSR_165)
 
-#define MICRON_RASWIDTH_165    0x2
+#define MICRON_RASWIDTH_165    13
 #define MICRON_V_MCFG_165(size)        MCFG((size), MICRON_RASWIDTH_165)
 
 #define MICRON_BL_165                  0x2
@@ -261,7 +262,7 @@ enum {
                ACTIM_CTRLB(MICRON_TWTR_200, MICRON_TCKE_200,   \
                                MICRON_TXP_200, MICRON_XSR_200)
 
-#define MICRON_RASWIDTH_200    0x3
+#define MICRON_RASWIDTH_200    14
 #define MICRON_V_MCFG_200(size)        MCFG((size), MICRON_RASWIDTH_200)
 
 /* NUMONYX part of IGEP v2 (165MHz optimized) 6.06ns */
@@ -290,7 +291,7 @@ enum {
                ACTIM_CTRLB(NUMONYX_TWTR_165, NUMONYX_TCKE_165, \
                                NUMONYX_TXP_165, NUMONYX_XSR_165)
 
-#define NUMONYX_RASWIDTH_165           0x4
+#define NUMONYX_RASWIDTH_165           15
 #define NUMONYX_V_MCFG_165(size)       MCFG((size), NUMONYX_RASWIDTH_165)
 
 /*
index e5031d5022ba3f07d919278c68166bf7e9f31ec1..2a89e56534073ff7d65a63e9d89e4e866e88266f 100644 (file)
@@ -34,6 +34,7 @@ struct emu_hal_params {
 
 void prcm_init(void);
 void per_clocks_enable(void);
+void ehci_clocks_enable(void);
 
 void memif_init(void);
 void sdrc_init(void);
diff --git a/arch/arm/include/asm/arch-omap4/ehci.h b/arch/arm/include/asm/arch-omap4/ehci.h
new file mode 100644 (file)
index 0000000..984c8b9
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * OMAP EHCI port support
+ * Based on LINUX KERNEL
+ * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * Author: Govindraj R <govindraj.raja@ti.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _OMAP4_EHCI_H_
+#define _OMAP4_EHCI_H_
+
+#define OMAP_EHCI_BASE                         (OMAP44XX_L4_CORE_BASE + 0x64C00)
+#define OMAP_UHH_BASE                          (OMAP44XX_L4_CORE_BASE + 0x64000)
+#define OMAP_USBTLL_BASE                       (OMAP44XX_L4_CORE_BASE + 0x62000)
+
+/* UHH, TLL and opt clocks */
+#define CM_L3INIT_HSUSBHOST_CLKCTRL            0x4A009358UL
+
+#define HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK  (1 << 24)
+
+/* TLL Register Set */
+#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE                (1 << 3)
+#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP                (1 << 2)
+#define OMAP_USBTLL_SYSCONFIG_SOFTRESET                (1 << 1)
+#define OMAP_USBTLL_SYSCONFIG_CACTIVITY                (1 << 8)
+#define OMAP_USBTLL_SYSSTATUS_RESETDONE                1
+
+#define OMAP_UHH_SYSCONFIG_SOFTRESET           1
+#define OMAP_UHH_SYSSTATUS_EHCI_RESETDONE      (1 << 2)
+#define OMAP_UHH_SYSCONFIG_NOIDLE              (1 << 2)
+#define OMAP_UHH_SYSCONFIG_NOSTDBY             (1 << 4)
+
+#define OMAP_UHH_SYSCONFIG_VAL (OMAP_UHH_SYSCONFIG_NOIDLE | \
+                                       OMAP_UHH_SYSCONFIG_NOSTDBY)
+
+#endif /* _OMAP4_EHCI_H_ */
index 18225b9b49624fa144cfd15f81858fab8720dd2d..b0d3368b6e6732d1c794b49d5585d7e62d6c04fb 100644 (file)
 #define MAX_MVGBE_DEVS 1
 #define MVGBE0_BASE    ORION5X_EGIGA_BASE
 
+/* Orion5x USB Host controller is port 1 */
+#define MVUSB0_BASE                    ORION5X_USB20_HOST_PORT_BASE
+#define MVUSB0_CPU_ATTR_DRAM_CS0       ORION5X_ATTR_DRAM_CS0
+#define MVUSB0_CPU_ATTR_DRAM_CS1       ORION5X_ATTR_DRAM_CS1
+#define MVUSB0_CPU_ATTR_DRAM_CS2       ORION5X_ATTR_DRAM_CS2
+#define MVUSB0_CPU_ATTR_DRAM_CS3       ORION5X_ATTR_DRAM_CS3
+
+/* Kirkwood CPU memory windows */
+#define MVCPU_WIN_CTRL_DATA    ORION5X_CPU_WIN_CTRL_DATA
+#define MVCPU_WIN_ENABLE       ORION5X_WIN_ENABLE
+#define MVCPU_WIN_DISABLE      ORION5X_WIN_DISABLE
+
 #define CONFIG_MAX_RAM_BANK_SIZE               (64*1024*1024)
 
 /* include here SoC variants. 5181, 5281, 6183 should go here when
index e699fc47c04391de5f0df1255b4581bbe9627d5b..510ead4d993c6b14523f4ffd975cf6596a7ad19f 100644 (file)
@@ -98,6 +98,7 @@ SAMSUNG_BASE(mmc, MMC_BASE)
 SAMSUNG_BASE(sromc, SROMC_BASE)
 SAMSUNG_BASE(timer, PWMTIMER_BASE)
 SAMSUNG_BASE(uart, UART_BASE)
+SAMSUNG_BASE(watchdog, WATCHDOG_BASE)
 #endif
 
 #endif /* _S5PC1XX_CPU_H */
diff --git a/arch/arm/include/asm/arch-s5pc1xx/watchdog.h b/arch/arm/include/asm/arch-s5pc1xx/watchdog.h
new file mode 100644 (file)
index 0000000..0f80ca5
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.com>
+ * Minkyu Kang <mk7.kang@samsung.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 __ASM_ARM_ARCH_WATCHDOG_H_
+#define __ASM_ARM_ARCH_WATCHDOG_H_
+
+#define WTCON_RESET_OFFSET     0
+#define WTCON_INTEN_OFFSET     2
+#define WTCON_CLKSEL_OFFSET    3
+#define WTCON_EN_OFFSET                5
+#define WTCON_PRE_OFFSET       8
+
+#define WTCON_CLK_16           0x0
+#define WTCON_CLK_32           0x1
+#define WTCON_CLK_64           0x2
+#define WTCON_CLK_128          0x3
+
+#define WTCON_CLK(x)           ((x & 0x3) << WTCON_CLKSEL_OFFSET)
+#define WTCON_PRESCALER(x)     ((x) << WTCON_PRE_OFFSET)
+#define WTCON_EN               (0x1 << WTCON_EN_OFFSET)
+#define WTCON_RESET            (0x1 << WTCON_RESET_OFFSET)
+#define WTCON_INT              (0x1 << WTCON_INTEN_OFFSET)
+
+#ifndef __ASSEMBLY__
+struct s5p_watchdog {
+       unsigned int wtcon;
+       unsigned int wtdat;
+       unsigned int wtcnt;
+       unsigned int wtclrint;
+};
+
+/* functions */
+void wdt_stop(void);
+void wdt_start(unsigned int timeout);
+#endif /* __ASSEMBLY__ */
+
+#endif
index 2d724a2872f8073302c4af07ebe3550d9d83b690..ae73c72ebe20c317f2951f740c5d621f54af492e 100644 (file)
 #ifndef __FUNCMUX_H
 #define __FUNCMUX_H
 
+/* Configs supported by the func mux */
+enum {
+       FUNCMUX_DEFAULT = 0,    /* default config */
+
+       /* UART configs */
+       FUNCMUX_UART1_IRRX_IRTX = 0,
+       FUNCMUX_UART2_IRDA = 0,
+       FUNCMUX_UART4_GMC = 0,
+
+       /* I2C configs */
+       FUNCMUX_DVC_I2CP = 0,
+       FUNCMUX_I2C1_RM = 0,
+       FUNCMUX_I2C2_DDC = 0,
+       FUNCMUX_I2C2_PTA,
+       FUNCMUX_I2C3_DTF = 0,
+
+       /* SDMMC configs */
+       FUNCMUX_SDMMC2_DTA_DTD_8BIT = 0,
+       FUNCMUX_SDMMC3_SDB_4BIT = 0,
+       FUNCMUX_SDMMC3_SDB_SLXA_8BIT,
+       FUNCMUX_SDMMC4_ATC_ATD_8BIT = 0,
+       FUNCMUX_SDMMC4_ATB_GMA_4_BIT,
+       FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT,
+};
+
 /**
  * Select a config for a particular peripheral.
  *
  * The basic config is 0, and higher numbers indicate different
  * pinmux settings to bring the peripheral out on other pins,
  *
+ * This function also disables tristate for the function's pins,
+ * so that they operate in normal mode.
+ *
  * @param id           Peripheral id
- * @param config       Configuration to use (generally 0)
+ * @param config       Configuration to use (FUNCMUX_...), 0 for default
  * @return 0 if ok, -1 on error (e.g. incorrect id or config)
  */
 int funcmux_select(enum periph_id id, int config);
diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h
new file mode 100644 (file)
index 0000000..e72c5df
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * OMAP EHCI port support
+ * Based on LINUX KERNEL
+ * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com*
+ * Author: Govindraj R <govindraj.raja@ti.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _OMAP_COMMON_EHCI_H_
+#define _OMAP_COMMON_EHCI_H_
+
+enum usbhs_omap_port_mode {
+       OMAP_USBHS_PORT_MODE_UNUSED,
+       OMAP_EHCI_PORT_MODE_PHY,
+       OMAP_EHCI_PORT_MODE_TLL,
+       OMAP_EHCI_PORT_MODE_HSIC,
+};
+
+#ifdef CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS
+#define OMAP_HS_USB_PORTS      CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS
+#else
+#define OMAP_HS_USB_PORTS      3
+#endif
+
+#define is_ehci_phy_mode(x)    ((x) == OMAP_EHCI_PORT_MODE_PHY)
+#define is_ehci_tll_mode(x)    ((x) == OMAP_EHCI_PORT_MODE_TLL)
+#define is_ehci_hsic_mode(x)   ((x) == OMAP_EHCI_PORT_MODE_HSIC)
+
+/* Values of UHH_REVISION - Note: these are not given in the TRM */
+#define OMAP_USBHS_REV1                                        0x00000010 /* OMAP3 */
+#define OMAP_USBHS_REV2                                        0x50700100 /* OMAP4 */
+
+/* UHH Register Set */
+#define OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN             (1 << 2)
+#define OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN             (1 << 3)
+#define OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN            (1 << 4)
+#define OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN             (1 << 5)
+
+#define OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS             1
+#define OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS             (1 << 11)
+#define OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS             (1 << 12)
+#define OMAP4_UHH_HOSTCONFIG_APP_START_CLK             (1 << 31)
+
+#define OMAP_P1_MODE_CLEAR                             (3 << 16)
+#define OMAP_P1_MODE_TLL                               (1 << 16)
+#define OMAP_P1_MODE_HSIC                              (3 << 16)
+#define OMAP_P2_MODE_CLEAR                             (3 << 18)
+#define OMAP_P2_MODE_TLL                               (1 << 18)
+#define OMAP_P2_MODE_HSIC                              (3 << 18)
+#define OMAP_P3_MODE_HSIC                              (3 << 20)
+
+/* EHCI Register Set */
+#define EHCI_INSNREG04_DISABLE_UNSUSPEND               (1 << 5)
+#define EHCI_INSNREG05_ULPI_CONTROL_SHIFT              31
+#define EHCI_INSNREG05_ULPI_PORTSEL_SHIFT              24
+#define EHCI_INSNREG05_ULPI_OPSEL_SHIFT                        22
+#define EHCI_INSNREG05_ULPI_REGADD_SHIFT               16
+
+#define OMAP_REV1_TLL_CHANNEL_COUNT                    3
+#define OMAP_REV2_TLL_CHANNEL_COUNT                    2
+
+/* TLL Register Set */
+#define OMAP_TLL_CHANNEL_CONF(num)                     (0x004 * num)
+#define OMAP_TLL_CHANNEL_CONF_DRVVBUS                  (1 << 16)
+#define OMAP_TLL_CHANNEL_CONF_CHRGVBUS                 (1 << 15)
+#define OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF           (1 << 11)
+#define OMAP_TLL_CHANNEL_CONF_CHANMODE_TRANSPARENT_UTMI        (2 << 1)
+#define OMAP_TLL_CHANNEL_CONF_CHANEN                   1
+
+struct omap_usbhs_board_data {
+       enum usbhs_omap_port_mode port_mode[OMAP_HS_USB_PORTS];
+};
+
+struct omap_usbtll {
+       u32 rev;                /* 0x00 */
+       u32 hwinfo;             /* 0x04 */
+       u8 reserved1[0x8];
+       u32 sysc;               /* 0x10 */
+       u32 syss;               /* 0x14 */
+       u32 irqst;              /* 0x18 */
+       u32 irqen;              /* 0x1c */
+       u8 reserved2[0x10];
+       u32 shared_conf;        /* 0x30 */
+       u8 reserved3[0xc];
+       u32 channel_conf;       /* 0x40 */
+};
+
+struct omap_uhh {
+       u32 rev;        /* 0x00 */
+       u32 hwinfo;     /* 0x04 */
+       u8 reserved1[0x8];
+       u32 sysc;       /* 0x10 */
+       u32 syss;       /* 0x14 */
+       u8 reserved2[0x28];
+       u32 hostconfig; /* 0x40 */
+       u32 debugcsr;   /* 0x44 */
+};
+
+struct omap_ehci {
+       u32 hccapbase;          /* 0x00 */
+       u32 hcsparams;          /* 0x04 */
+       u32 hccparams;          /* 0x08 */
+       u8 reserved1[0x04];
+       u32 usbcmd;             /* 0x10 */
+       u32 usbsts;             /* 0x14 */
+       u32 usbintr;            /* 0x18 */
+       u32 frindex;            /* 0x1c */
+       u32 ctrldssegment;      /* 0x20 */
+       u32 periodiclistbase;   /* 0x24 */
+       u32 asysnclistaddr;     /* 0x28 */
+       u8 reserved2[0x24];
+       u32 configflag;         /* 0x50 */
+       u32 portsc_i;           /* 0x54 */
+       u8 reserved3[0x38];
+       u32 insreg00;           /* 0x90 */
+       u32 insreg01;           /* 0x94 */
+       u32 insreg02;           /* 0x98 */
+       u32 insreg03;           /* 0x9c */
+       u32 insreg04;           /* 0xa0 */
+       u32 insreg05_utmi_ulpi; /* 0xa4 */
+       u32 insreg06;           /* 0xa8 */
+       u32 insreg07;           /* 0xac */
+       u32 insreg08;           /* 0xb0 */
+};
+
+int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata);
+int omap_ehci_hcd_stop(void);
+
+#endif /* _OMAP_COMMON_EHCI_H_ */
index f30b9fc96f0be9a1d6328bd6206cc3cf988b4c84..20e165393020e91625168638fbea8c005bebf698 100644 (file)
@@ -41,6 +41,9 @@ typedef struct bd_info {
     unsigned long      bi_ip_addr;     /* IP Address */
     ulong              bi_arch_number; /* unique id for this board */
     ulong              bi_boot_params; /* where this board expects params */
+       unsigned long   bi_arm_freq; /* arm frequency */
+       unsigned long   bi_dsp_freq; /* dsp core frequency */
+       unsigned long   bi_ddr_freq; /* ddr frequency */
     struct                             /* RAM configuration */
     {
        ulong start;
index 3d7827407206b86b02542b72d076737abf66869d..500e2164ce4b85d2606b26a596c195ab7216fed4 100644 (file)
@@ -463,7 +463,15 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        debug("monitor flash len: %08lX\n", monitor_flash_len);
        board_init();   /* Setup chipselects */
-
+       /*
+        * TODO: printing of the clock inforamtion of the board is now
+        * implemented as part of bdinfo command. Currently only support for
+        * davinci SOC's is added. Remove this check once all the board
+        * implement this.
+        */
+#ifdef CONFIG_CLOCKS
+       set_cpu_clk_info(); /* Setup clock information */
+#endif
 #ifdef CONFIG_SERIAL_MULTI
        serial_initialize();
 #endif
index 6ed655a674f52c8c3297c9cbb7db21c02c3d3f9c..5ca9e91d3f12ed015ca2cd12a5ce87b34c9d2b3f 100644 (file)
@@ -8,8 +8,8 @@
  * Licensed under the GPL-2 or later.
  */
 
-#include <asm/linkage.h>
 #include <config.h>
+#include <linux/linkage.h>
 #include <asm/blackfin.h>
 
 .text
index 71207b697ac62e8bca3026a8f9aa66c3ea409a32..49d0c9ec3aabc2a2ccc480da356a37c000ae061d 100644 (file)
@@ -48,7 +48,7 @@
 #define L1_CACHE_SHIFT 5
 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
 
-#include <asm/linkage.h>
+#include <linux/linkage.h>
 #include <asm/cache.h>
 
 #ifndef __ASSEMBLY__
index 482e4b52b63cebf3904fe41d59166c6bf83e5d86..568885a2c2862bc12699207515650d5342ddb6fd 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef __ARCH_BLACKFIN_CACHE_H
 #define __ARCH_BLACKFIN_CACHE_H
 
-#include <asm/linkage.h>       /* for asmlinkage */
+#include <linux/linkage.h>     /* for asmlinkage */
 
 /*
  * Bytes per L1 cache line
index 75244a0731d9b741aab9528e19d9fc9b32a8d5d3..69f08bc7efb526a85f3edeab3a184944d178cb72 100644 (file)
@@ -134,9 +134,11 @@ static inline unsigned int readl(const volatile void __iomem *addr)
 #define inb(port)    readb(__io(port))
 #define inw(port)    readw(__io(port))
 #define inl(port)    readl(__io(port))
+#define in_le32(port) inl(port)
 #define outb(x, port) writeb(x, __io(port))
 #define outw(x, port) writew(x, __io(port))
 #define outl(x, port) writel(x, __io(port))
+#define out_le32(x, port) outl(x, port)
 
 #define inb_p(port)    inb(__io(port))
 #define inw_p(port)    inw(__io(port))
index fbb497c7bdcf60031af1c861418289547ba92560..6d4493a6c529a14fc7a4e084662e51018d868151 100644 (file)
  * MA 02110-1301 USA
  */
 
-#ifndef _LINUX_LINKAGE_H
-#define _LINUX_LINKAGE_H
-
-#include <linux/config.h>
-
-#ifdef __cplusplus
-#define CPP_ASMLINKAGE         extern "C"
-#else
-#define CPP_ASMLINKAGE
-#endif
-
-#define asmlinkage CPP_ASMLINKAGE
-
-#define SYMBOL_NAME_STR(X)     #X
-#define SYMBOL_NAME(X)         X
-#ifdef __STDC__
-#define SYMBOL_NAME_LABEL(X)   X##:
-#else
-#define SYMBOL_NAME_LABEL(X)   X:
-#endif
-
-#define __ALIGN .align         4
-#define __ALIGN_STR            ".align 4"
-
-#ifdef __ASSEMBLY__
-
-#define ALIGN                  __ALIGN
-#define ALIGN_STR              __ALIGN_STR
-
-#define LENTRY(name) \
-       ALIGN; \
-       SYMBOL_NAME_LABEL(name)
-
-#define ENTRY(name) \
-       .globl SYMBOL_NAME(name); \
-       LENTRY(name)
-#endif
-
-#ifndef END
-#define END(name) \
-       .size name, .-name
-#endif
-
-#ifndef ENDPROC
-#define ENDPROC(name) \
-       .type name, @function; \
-       END(name)
-#endif
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
 
 #endif
index cba4179d3efbf350661c4033f7be4063506dee38..4ccde8f104e1118cfab413a0c5f6f5bb5a2ce205 100644 (file)
@@ -1,5 +1,5 @@
 
-#include <asm/linkage.h>
+#include <linux/linkage.h>
 
 /* save stack context for non-local goto
  * int kgdb_setjmp(long *buf)
index 253d4c3e417b47a2a92e503bec896b0d4a9d9457..39d5332615ab333b35a61c3c2f6c5e45d6d96959 100644 (file)
@@ -8,7 +8,7 @@
  * Licensed under the GPL-2.
  */
 
-#include <asm/linkage.h>
+#include <linux/linkage.h>
 
 .align 2
 
index f438c150a38d2f352d3a1dfb2fddb6d69851e567..55865760173558e928a44d4dedb14c75e96ad46f 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <errno.h>
 #include <linux/mtd/nand.h>
 #include <nand.h>
 #include <miiphy.h>
@@ -46,6 +47,12 @@ static unsigned long get_timer_val(void)
        return now;
 }
 
+static int timer_running(void)
+{
+       return readl(&timer->tcr) &
+               (DV_TIMER_TCR_ENAMODE_MASK << DV_TIMER_TCR_ENAMODE34_SHIFT);
+}
+
 static void stop_timer(void)
 {
        writel(0x0, &timer->tcr);
@@ -66,8 +73,43 @@ int board_init(void)
 }
 
 #ifdef CONFIG_DRIVER_TI_EMAC
+static int cam_enc_4xx_check_network(void)
+{
+       char *s;
+
+       s = getenv("ethaddr");
+       if (!s)
+               return -EINVAL;
+
+       if (!is_valid_ether_addr((const u8 *)s))
+               return -EINVAL;
+
+       s = getenv("ipaddr");
+       if (!s)
+               return -EINVAL;
+
+       s = getenv("netmask");
+       if (!s)
+               return -EINVAL;
+
+       s = getenv("serverip");
+       if (!s)
+               return -EINVAL;
+
+       s = getenv("gatewayip");
+       if (!s)
+               return -EINVAL;
+
+       return 0;
+}
 int board_eth_init(bd_t *bis)
 {
+       int ret;
+
+       ret = cam_enc_4xx_check_network();
+       if (ret)
+               return ret;
+
        davinci_emac_initialize();
 
        return 0;
@@ -254,8 +296,11 @@ static int nand_switch_hw_func(int mode)
        nand = mtd->priv;
 
        if (mode == 0) {
-               printf("switching to uboot hw functions.\n");
-               memcpy(&nand->ecc, &org_ecc, sizeof(struct nand_ecc_ctrl));
+               if (notsaved == 0) {
+                       printf("switching to uboot hw functions.\n");
+                       memcpy(&nand->ecc, &org_ecc,
+                               sizeof(struct nand_ecc_ctrl));
+               }
        } else {
                /* RBL */
                printf("switching to RBL hw functions.\n");
@@ -329,7 +374,8 @@ int board_late_init(void)
        struct davinci_gpio *gpio = davinci_gpio_bank45;
 
        /* 24MHz InputClock / 15 prediv -> 1.6 MHz timer running */
-       while (get_timer_val() < 0x186a00)
+       while ((get_timer_val() < CONFIG_AIT_TIMER_TIMEOUT) &&
+               timer_running())
                ;
 
        /* 1 sec reached -> stop timer, clear all LED */
@@ -429,3 +475,618 @@ void arch_memory_failure_handle(void)
                ;
 }
 #endif
+#if defined(CONFIG_MENU)
+#include "menu.h"
+
+#define MENU_EXIT              -1
+#define MENU_EXIT_BOOTCMD      -2
+#define MENU_STAY              0
+#define MENU_MAIN              1
+#define MENU_UPDATE            2
+#define MENU_NETWORK           3
+#define MENU_LOAD              4
+
+static int menu_start;
+
+#define FIT_SUBTYPE_UNKNOWN            0
+#define FIT_SUBTYPE_UBL_HEADER         1
+#define FIT_SUBTYPE_SPL_IMAGE          2
+#define FIT_SUBTYPE_UBOOT_IMAGE                3
+#define FIT_SUBTYPE_DF_ENV_IMAGE       4
+#define FIT_SUBTYPE_RAMDISK_IMAGE      5
+
+struct fit_images_info {
+       u_int8_t type;
+       int subtype;
+       char desc[200];
+       const void *data;
+       size_t size;
+};
+
+static struct fit_images_info images[10];
+
+struct menu_display {
+       char    title[50];
+       int     timeout; /* in sec */
+       int     id; /* MENU_* */
+       char    **menulist;
+       int (*menu_evaluate)(char *choice);
+};
+
+char *menu_main[] = {
+       "(1) Boot",
+       "(2) Update Software",
+       "(3) Reset to default setting and boot",
+       "(4) Enter U-Boot console",
+       NULL
+};
+
+char *menu_update[] = {
+       "(1) Network settings",
+       "(2) load image",
+       "(3) back to main",
+       NULL
+};
+
+char *menu_load[] = {
+       "(1) install image",
+       "(2) cancel",
+       NULL
+};
+
+char *menu_network[] = {
+       "(1) ipaddr   ",
+       "(2) netmask  ",
+       "(3) serverip ",
+       "(4) gatewayip",
+       "(5) tftp image name",
+       "(6) back to update software",
+       NULL
+};
+
+static void ait_menu_print(void *data)
+{
+       printf("%s\n", (char *)data);
+       return;
+}
+
+static char *menu_handle(struct menu_display *display)
+{
+       struct menu *m;
+       int i;
+       char *choice = NULL;
+       char key[2];
+       int ret;
+       char *s;
+       char temp[6][200];
+
+       m = menu_create(display->title, display->timeout, 1, ait_menu_print);
+
+       for (i = 0; display->menulist[i]; i++) {
+               sprintf(key, "%d", i + 1);
+               if (display->id == MENU_NETWORK) {
+                       switch (i) {
+                       case 0:
+                               s = getenv("ipaddr");
+                               break;
+                       case 1:
+                               s = getenv("netmask");
+                               break;
+                       case 2:
+                               s = getenv("serverip");
+                               break;
+                       case 3:
+                               s = getenv("gatewayip");
+                               break;
+                       case 4:
+                               s = getenv("img_file");
+                               break;
+                       default:
+                               s = NULL;
+                               break;
+                       }
+                       if (s) {
+                               sprintf(temp[i], "%s: %s",
+                                       display->menulist[i], s);
+                               ret = menu_item_add(m, key, temp[i]);
+                       } else {
+                               ret = menu_item_add(m, key,
+                                       display->menulist[i]);
+                       }
+               } else {
+                       ret = menu_item_add(m, key, display->menulist[i]);
+               }
+
+               if (ret != 1) {
+                       printf("failed to add item!");
+                       menu_destroy(m);
+                       return NULL;
+               }
+       }
+       sprintf(key, "%d", 1);
+       menu_default_set(m, key);
+
+       if (menu_get_choice(m, (void **)&choice) != 1)
+               debug("Problem picking a choice!\n");
+
+       menu_destroy(m);
+
+       return choice;
+}
+
+static int ait_menu_show(struct menu_display *display, int bootdelay)
+{
+       int end = MENU_STAY;
+       char *choice;
+
+       if ((menu_start == 0) && (display->id == MENU_MAIN))
+               display->timeout = bootdelay;
+       else
+               display->timeout = 0;
+
+       while (end == MENU_STAY) {
+               choice = menu_handle(display);
+               if (choice)
+                       end = display->menu_evaluate(choice);
+
+               if (end == display->id)
+                       end = MENU_STAY;
+               if (display->id == MENU_MAIN) {
+                       if (menu_start == 0)
+                               end = MENU_EXIT_BOOTCMD;
+                       else
+                               display->timeout = 0;
+               }
+       }
+       return end;
+}
+
+static int ait_writeublheader(void)
+{
+       char s[20];
+       unsigned long i;
+       int ret;
+
+       for (i = CONFIG_SYS_NAND_BLOCK_SIZE;
+               i < CONFIG_SYS_NAND_U_BOOT_OFFS;
+               i += CONFIG_SYS_NAND_BLOCK_SIZE) {
+               sprintf(s, "%lx", i);
+               ret = setenv("header_addr", s);
+               if (ret == 0)
+                       ret = run_command2("run img_writeheader", 0);
+               if (ret != 0)
+                       break;
+       }
+       return ret;
+}
+
+static int ait_menu_install_images(void)
+{
+       int ret = 0;
+       int count = 0;
+       char s[100];
+       char *t;
+
+       /*
+        * possible image types:
+        * FIT_SUBTYPE_UNKNOWN
+        * FIT_SUBTYPE_UBL_HEADER
+        * FIT_SUBTYPE_SPL_IMAGE
+        * FIT_SUBTYPE_UBOOT_IMAGE
+        * FIT_SUBTYPE_DF_ENV_IMAGE
+        * FIT_SUBTYPE_RAMDISK_IMAGE
+        *
+        * use Envvariables:
+        * img_addr_r: image start addr
+        * header_addr: addr where to write to UBL header
+        * img_writeheader: write ubl header to nand
+        * img_writespl: write spl to nand
+        * img_writeuboot: write uboot to nand
+        * img_writedfenv: write default environment to ubi volume
+        * img_volume: which ubi volume should be updated with img_writeramdisk
+        * filesize: size of data for updating ubi volume
+        * img_writeramdisk: write ramdisk to ubi volume
+        */
+
+       while (images[count].type != IH_TYPE_INVALID) {
+               printf("Installing %s\n",
+                       genimg_get_type_name(images[count].type));
+               sprintf(s, "%p", images[count].data);
+               setenv("img_addr_r", s);
+               sprintf(s, "%lx", (unsigned long)images[count].size);
+               setenv("filesize", s);
+               switch (images[count].subtype) {
+               case FIT_SUBTYPE_DF_ENV_IMAGE:
+                       ret = run_command2("run img_writedfenv", 0);
+                       break;
+               case FIT_SUBTYPE_RAMDISK_IMAGE:
+                       t = getenv("img_volume");
+                       if (!t) {
+                               ret = setenv("img_volume", "rootfs1");
+                       } else {
+                               /* switch to other volume */
+                               if (strncmp(t, "rootfs1", 7) == 0)
+                                       ret = setenv("img_volume", "rootfs2");
+                               else
+                                       ret = setenv("img_volume", "rootfs1");
+                       }
+                       if (ret != 0)
+                               break;
+
+                       ret = run_command2("run img_writeramdisk", 0);
+                       break;
+               case FIT_SUBTYPE_SPL_IMAGE:
+                       ret = run_command2("run img_writespl", 0);
+                       break;
+               case FIT_SUBTYPE_UBL_HEADER:
+                       ret = ait_writeublheader();
+                       break;
+               case FIT_SUBTYPE_UBOOT_IMAGE:
+                       ret = run_command2("run img_writeuboot", 0);
+                       break;
+               default:
+                       /* not supported type */
+                       break;
+               }
+               count++;
+       }
+       /* now save dvn_* and img_volume env vars to new values */
+       if (ret == 0)
+               ret = run_command2("run savenewvers", 0);
+
+       return ret;
+}
+
+static int ait_menu_evaluate_load(char *choice)
+{
+       if (!choice)
+               return -1;
+
+       switch (choice[1]) {
+       case '1':
+               /* install image */
+               ait_menu_install_images();
+               break;
+       case '2':
+               /* cancel, back to main */
+               break;
+       }
+
+       return MENU_MAIN;
+}
+
+struct menu_display ait_load = {
+       .title = "AIT load image",
+       .timeout = 0,
+       .id = MENU_LOAD,
+       .menulist = menu_load,
+       .menu_evaluate = ait_menu_evaluate_load,
+};
+
+static void ait_menu_read_env(char *name)
+{
+       char output[CONFIG_SYS_CBSIZE];
+       char cbuf[CONFIG_SYS_CBSIZE];
+       int readret;
+       int ret;
+
+       sprintf(output, "%s old: %s value: ", name, getenv(name));
+       memset(cbuf, 0, CONFIG_SYS_CBSIZE);
+       readret = readline_into_buffer(output, cbuf, 0);
+
+       if (readret >= 0) {
+               ret = setenv(name, cbuf);
+               if (ret) {
+                       printf("Error setting %s\n", name);
+                       return;
+               }
+       }
+       return;
+}
+
+static int ait_menu_evaluate_network(char *choice)
+{
+       if (!choice)
+               return MENU_MAIN;
+
+       switch (choice[1]) {
+       case '1':
+               ait_menu_read_env("ipaddr");
+               break;
+       case '2':
+               ait_menu_read_env("netmask");
+               break;
+       case '3':
+               ait_menu_read_env("serverip");
+               break;
+       case '4':
+               ait_menu_read_env("gatewayip");
+               break;
+       case '5':
+               ait_menu_read_env("img_file");
+               break;
+       case '6':
+               return MENU_UPDATE;
+               break;
+       }
+
+       return MENU_STAY;
+}
+
+struct menu_display ait_network = {
+       .title = "AIT network settings",
+       .timeout = 0,
+       .id = MENU_NETWORK,
+       .menulist = menu_network,
+       .menu_evaluate = ait_menu_evaluate_network,
+};
+
+static int fit_get_subtype(const void *fit, int noffset, char **subtype)
+{
+       int len;
+
+       *subtype = (char *)fdt_getprop(fit, noffset, "subtype", &len);
+       if (*subtype == NULL)
+               return -1;
+
+       return 0;
+}
+
+static int ait_subtype_nr(char *subtype)
+{
+       int ret = FIT_SUBTYPE_UNKNOWN;
+
+       if (!strncmp("ublheader", subtype, strlen("ublheader")))
+               return FIT_SUBTYPE_UBL_HEADER;
+       if (!strncmp("splimage", subtype, strlen("splimage")))
+               return FIT_SUBTYPE_SPL_IMAGE;
+       if (!strncmp("ubootimage", subtype, strlen("ubootimage")))
+               return FIT_SUBTYPE_UBOOT_IMAGE;
+       if (!strncmp("dfenvimage", subtype, strlen("dfenvimage")))
+               return FIT_SUBTYPE_DF_ENV_IMAGE;
+
+       return ret;
+}
+
+static int ait_menu_check_image(void)
+{
+       char *s;
+       unsigned long fit_addr;
+       void *addr;
+       int format;
+       char *desc;
+       char *subtype;
+       int images_noffset;
+       int noffset;
+       int ndepth;
+       int count = 0;
+       int ret;
+       int i;
+       int found_uboot = -1;
+       int found_ramdisk = -1;
+
+       memset(images, 0, sizeof(images));
+       s = getenv("fit_addr_r");
+       fit_addr = s ? (unsigned long)simple_strtol(s, NULL, 16) : \
+                       CONFIG_BOARD_IMG_ADDR_R;
+
+       addr = (void *)fit_addr;
+       /* check if it is a FIT image */
+       format = genimg_get_format(addr);
+       if (format != IMAGE_FORMAT_FIT)
+               return -EINVAL;
+
+       if (!fit_check_format(addr))
+               return -EINVAL;
+
+       /* print the FIT description */
+       ret = fit_get_desc(addr, 0, &desc);
+       printf("FIT description: ");
+       if (ret)
+               printf("unavailable\n");
+       else
+               printf("%s\n", desc);
+
+       /* find images */
+       images_noffset = fdt_path_offset(addr, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               printf("Can't find images parent node '%s' (%s)\n",
+                       FIT_IMAGES_PATH, fdt_strerror(images_noffset));
+               return -EINVAL;
+       }
+
+       /* Process its subnodes, print out component images details */
+       for (ndepth = 0, count = 0,
+               noffset = fdt_next_node(addr, images_noffset, &ndepth);
+               (noffset >= 0) && (ndepth > 0);
+               noffset = fdt_next_node(addr, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /*
+                        * Direct child node of the images parent node,
+                        * i.e. component image node.
+                        */
+                       printf("Image %u (%s)\n", count,
+                                       fit_get_name(addr, noffset, NULL));
+
+                       fit_image_print(addr, noffset, "");
+
+                       fit_image_get_type(addr, noffset,
+                               &images[count].type);
+                       /* Mandatory properties */
+                       ret = fit_get_desc(addr, noffset, &desc);
+                       printf("Description:  ");
+                       if (ret)
+                               printf("unavailable\n");
+                       else
+                               printf("%s\n", desc);
+
+                       ret = fit_get_subtype(addr, noffset, &subtype);
+                       printf("Subtype:  ");
+                       if (ret) {
+                               printf("unavailable\n");
+                       } else {
+                               images[count].subtype = ait_subtype_nr(subtype);
+                               printf("%s %d\n", subtype,
+                                       images[count].subtype);
+                       }
+
+                       sprintf(images[count].desc, "%s", desc);
+
+                       ret = fit_image_get_data(addr, noffset,
+                               &images[count].data,
+                               &images[count].size);
+
+                       printf("Data Size:    ");
+                       if (ret)
+                               printf("unavailable\n");
+                       else
+                               genimg_print_size(images[count].size);
+                       printf("Data @ %p\n", images[count].data);
+                       count++;
+               }
+       }
+
+       for (i = 0; i < count; i++) {
+               if (images[i].subtype == FIT_SUBTYPE_UBOOT_IMAGE)
+                       found_uboot = i;
+               if (images[i].type == IH_TYPE_RAMDISK) {
+                       found_ramdisk = i;
+                       images[i].subtype = FIT_SUBTYPE_RAMDISK_IMAGE;
+               }
+       }
+
+       /* dvn_* env var update, if the FIT descriptors are different */
+       if (found_uboot >= 0) {
+               s = getenv("dvn_boot_vers");
+               if (s) {
+                       ret = strcmp(s, images[found_uboot].desc);
+                       if (ret != 0) {
+                               setenv("dvn_boot_vers",
+                                       images[found_uboot].desc);
+                       } else {
+                               found_uboot = -1;
+                               printf("no new uboot version\n");
+                       }
+               } else {
+                       setenv("dvn_boot_vers", images[found_uboot].desc);
+               }
+       }
+       if (found_ramdisk >= 0) {
+               s = getenv("dvn_app_vers");
+               if (s) {
+                       ret = strcmp(s, images[found_ramdisk].desc);
+                       if (ret != 0) {
+                               setenv("dvn_app_vers",
+                                       images[found_ramdisk].desc);
+                       } else {
+                               found_ramdisk = -1;
+                               printf("no new ramdisk version\n");
+                       }
+               } else {
+                       setenv("dvn_app_vers", images[found_ramdisk].desc);
+               }
+       }
+       if ((found_uboot == -1) && (found_ramdisk == -1))
+               return -EINVAL;
+
+       return 0;
+}
+
+static int ait_menu_evaluate_update(char *choice)
+{
+       int ret;
+
+       if (!choice)
+               return MENU_MAIN;
+
+       switch (choice[1]) {
+       case '1':
+               return ait_menu_show(&ait_network, 0);
+               break;
+       case '2':
+               /* load image */
+               ret = run_command2("run load_img", 0);
+               printf("ret: %d\n", ret);
+               if (ret)
+                       return MENU_UPDATE;
+
+               ret = ait_menu_check_image();
+               if (ret)
+                       return MENU_UPDATE;
+
+               return ait_menu_show(&ait_load, 0);
+               break;
+       case '3':
+               return MENU_MAIN;
+               break;
+
+       }
+
+       return MENU_MAIN;
+}
+
+struct menu_display ait_update = {
+       .title = "AIT Update Software",
+       .timeout = 0,
+       .id = MENU_UPDATE,
+       .menulist = menu_update,
+       .menu_evaluate = ait_menu_evaluate_update,
+};
+
+static int ait_menu_evaluate_main(char *choice)
+{
+       if (!choice)
+               return MENU_STAY;
+
+       menu_start = 1;
+       switch (choice[1]) {
+       case '1':
+               /* run bootcmd */
+               return MENU_EXIT_BOOTCMD;
+               break;
+       case '2':
+               return ait_menu_show(&ait_update, 0);
+               break;
+       case '3':
+               /* reset to default settings */
+               setenv("app_reset", "yes");
+               return MENU_EXIT_BOOTCMD;
+               break;
+       case '4':
+               /* u-boot shell */
+               return MENU_EXIT;
+               break;
+       }
+
+       return MENU_EXIT;
+}
+
+struct menu_display ait_main = {
+       .title = "AIT Main",
+       .timeout = CONFIG_BOOTDELAY,
+       .id = MENU_MAIN,
+       .menulist = menu_main,
+       .menu_evaluate = ait_menu_evaluate_main,
+};
+
+int menu_show(int bootdelay)
+{
+       int ret;
+
+       run_command2("run saveparms", 0);
+       ret = ait_menu_show(&ait_main, bootdelay);
+       run_command2("run restoreparms", 0);
+
+       if (ret == MENU_EXIT_BOOTCMD)
+               return 0;
+
+       return MENU_EXIT;
+}
+
+void menu_display_statusline(struct menu *m)
+{
+       printf("State: dvn_boot_vers: %s dvn_app_vers: %s\n",
+               getenv("dvn_boot_vers"), getenv("dvn_app_vers"));
+       return;
+}
+#endif
index 95182cab00eb16bcd288a6968aee9ecfae8cb796..deef7576e1bf5461b55a5f383f356c4b843bd433 100644 (file)
@@ -38,8 +38,7 @@ ENTRY 0x00000020
 PAGES  6
 
 # Block number where user bootloader is present
-# RBL starts always with block 1
-START_BLOCK    5
+START_BLOCK    0
 
 # Page number where user bootloader is present
 # Page 0 is always UBL header
index 97e59fb324a15aa044a37da611f106ac3c836c5a..f23b657041c5dffe44f0e359fb8e37b4c74ddde3 100644 (file)
@@ -32,6 +32,7 @@
 #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>
@@ -63,14 +64,7 @@ int timer_init(void)
  */
 static void pin_mux_mmc(void)
 {
-       /* SDMMC4: config 3, x8 on 2nd set of pins */
-       pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-       pinmux_tristate_disable(PINGRP_ATB);
-       pinmux_tristate_disable(PINGRP_GMA);
-       pinmux_tristate_disable(PINGRP_GME);
+       funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
 }
 #endif
 
index ec888d44d9a4a80994fbaa0d843abb8d1c582b72..92dfffa8ca12a6be6a1c447d6b5ebee7027c9bce 100644 (file)
@@ -43,13 +43,6 @@ int checkboard(void)
        return 0;
 }
 
-void board_reset(void)
-{
-       /* workaround for weak pull ups on ssel */
-       if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
-               bfin_reset_boot_spi_cs(GPIO_PF10);
-}
-
 #ifdef CONFIG_BFIN_MAC
 static void board_init_enetaddr(uchar *mac_addr)
 {
diff --git a/board/br4/Makefile b/board/br4/Makefile
new file mode 100644 (file)
index 0000000..6ae998f
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) Switchfin Org. <dpn@switchfin.org>
+#
+# Copyright (c) 2005-2007 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        := $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/br4/br4.c b/board/br4/br4.c
new file mode 100644 (file)
index 0000000..bc034e3
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * U-boot - main board file
+ *
+ * Copyright (c) Switchfin Org. <dpn@switchfin.org>
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <net.h>
+#include <netdev.h>
+
+int checkboard(void)
+{
+       printf("Board: Switchvoice BR4 Appliance\n");
+       printf("       Support: http://www.switchvoice.com/\n");
+       return 0;
+}
+
+#ifdef CONFIG_BFIN_MAC
+int board_eth_init(bd_t *bis)
+{
+       return bfin_EMAC_initialize(bis);
+}
+#endif
diff --git a/board/br4/config.mk b/board/br4/config.mk
new file mode 100644 (file)
index 0000000..fac20c5
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# Copyright (c) Switchfin Org. <dpn@switchfin.org>
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2001
+# 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
+#
+
+CFLAGS_lib += -O2
+CFLAGS_lib/lzma += -O2
+CFLAGS_lib/zlib += -O2
diff --git a/board/compal/paz00/Makefile b/board/compal/paz00/Makefile
new file mode 100644 (file)
index 0000000..488e381
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  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 and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope 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.
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../../nvidia/common)
+endif
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+COBJS  += ../../nvidia/common/board.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c
new file mode 100644 (file)
index 0000000..3b48917
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  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 and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/tegra2.h>
+#include <asm/arch/pinmux.h>
+#include <asm/arch/mmc.h>
+#include <asm/gpio.h>
+#ifdef CONFIG_TEGRA2_MMC
+#include <mmc.h>
+#endif
+
+/*
+ * Routine: gpio_config_uart
+ * Description: Does nothing on Paz00 - no conflict w/SPI.
+ */
+void gpio_config_uart(void)
+{
+}
+
+#ifdef CONFIG_TEGRA2_MMC
+/*
+ * Routine: pin_mux_mmc
+ * Description: setup the pin muxes/tristate values for the SDMMC(s)
+ */
+static void pin_mux_mmc(void)
+{
+       /* SDMMC4: config 3, x8 on 2nd set of pins */
+       pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+       pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+       pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+
+       pinmux_tristate_disable(PINGRP_ATB);
+       pinmux_tristate_disable(PINGRP_GMA);
+       pinmux_tristate_disable(PINGRP_GME);
+
+       /* SDMMC1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
+       pinmux_set_func(PINGRP_SDMMC1, PMUX_FUNC_SDIO1);
+
+       pinmux_tristate_disable(PINGRP_SDMMC1);
+
+       /* For power GPIO PV1 */
+       pinmux_tristate_disable(PINGRP_UAC);
+       /* For CD GPIO PI5 */
+       pinmux_tristate_disable(PINGRP_ATC);
+}
+
+/* this is a weak define that we are overriding */
+int board_mmc_init(bd_t *bd)
+{
+       debug("board_mmc_init called\n");
+
+       /* Enable muxes, etc. for SDMMC controllers */
+       pin_mux_mmc();
+
+       debug("board_mmc_init: init eMMC\n");
+       /* init dev 0, eMMC chip, with 4-bit bus */
+       /* The board has an 8-bit bus, but 8-bit doesn't work yet */
+       tegra2_mmc_init(0, 4, -1, -1);
+
+       debug("board_mmc_init: init SD slot\n");
+       /* init dev 3, SD slot, with 4-bit bus */
+       tegra2_mmc_init(3, 4, GPIO_PV1, GPIO_PI5);
+
+       return 0;
+}
+#endif
diff --git a/board/corscience/tricorder/Makefile b/board/corscience/tricorder/Makefile
new file mode 100644 (file)
index 0000000..16ef3a3
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# (C) Copyright 2012
+# Thomas Weber <weber@corscience.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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := tricorder.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/corscience/tricorder/tricorder.c b/board/corscience/tricorder/tricorder.c
new file mode 100644 (file)
index 0000000..435711a
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * (C) Copyright 2012
+ * Corscience GmbH & Co. KG, <www.corscience.de>
+ * Thomas Weber <weber@corscience.de>
+ * Sunil Kumar <sunilsaini05@gmail.com>
+ * Shashi Ranjan <shashiranjanmca05@gmail.com>
+ *
+ * Derived from Devkit8000 code by
+ * Frederik Kriewitz <frederik@kriewitz.eu>
+ *
+ * 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 <twl4030.h>
+#include <asm/io.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/mem.h>
+#include "tricorder.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+       gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+       return 0;
+}
+
+/*
+ * Routine: misc_init_r
+ * Description: Configure board specific parts
+ */
+int misc_init_r(void)
+{
+       twl4030_power_init();
+#ifdef CONFIG_TWL4030_LED
+       twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
+#endif
+
+       dieid_num_r();
+
+       return 0;
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *             hardware. Many pins need to be moved from protect to primary
+ *             mode.
+ */
+void set_muxconf_regs(void)
+{
+       MUX_TRICORDER();
+}
+
+#if defined(CONFIG_GENERIC_MMC) && !(defined(CONFIG_SPL_BUILD))
+int board_mmc_init(bd_t *bis)
+{
+       return omap_mmc_init(0);
+}
+#endif
+
+/*
+ * Routine: get_board_mem_timings
+ * Description: If we use SPL then there is no x-loader nor config header
+ * so we have to setup the DDR timings ourself on the first bank.  This
+ * provides the timing values back to the function that configures
+ * the memory.  We have either one or two banks of 128MB DDR.
+ */
+void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
+                               u32 *mr)
+{
+       /* General SDRC config */
+       *mcfg = MICRON_V_MCFG_165(128 << 20);
+       *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
+
+       /* AC timings */
+       *ctrla = MICRON_V_ACTIMA_165;
+       *ctrlb = MICRON_V_ACTIMB_165;
+       *mr = MICRON_V_MR_165;
+}
diff --git a/board/corscience/tricorder/tricorder.h b/board/corscience/tricorder/tricorder.h
new file mode 100644 (file)
index 0000000..cae8c75
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * (C) Copyright 2008
+ * Dirk Behme <dirk.behme@gmail.com>
+ *
+ * (C) Copyright 2012
+ * Corscience GmbH & Co. KG, <www.corscience.de>
+ * Thomas Weber <weber@corscience.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
+ */
+#ifndef _TRICORDER_H_
+#define _TRICORDER_H_
+
+const omap3_sysinfo sysinfo = {
+       DDR_STACKED,
+       "OMAP3 Tricorder",
+       "NAND",
+};
+
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN   - Pull type selection is active
+ * M0   - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */
+#define MUX_TRICORDER() \
+       /* SDRC */\
+       MUX_VAL(CP(SDRC_D0),            (IEN  | PTD | DIS | M0)) /*SDRC_D0*/\
+       MUX_VAL(CP(SDRC_D1),            (IEN  | PTD | DIS | M0)) /*SDRC_D1*/\
+       MUX_VAL(CP(SDRC_D2),            (IEN  | PTD | DIS | M0)) /*SDRC_D2*/\
+       MUX_VAL(CP(SDRC_D3),            (IEN  | PTD | DIS | M0)) /*SDRC_D3*/\
+       MUX_VAL(CP(SDRC_D4),            (IEN  | PTD | DIS | M0)) /*SDRC_D4*/\
+       MUX_VAL(CP(SDRC_D5),            (IEN  | PTD | DIS | M0)) /*SDRC_D5*/\
+       MUX_VAL(CP(SDRC_D6),            (IEN  | PTD | DIS | M0)) /*SDRC_D6*/\
+       MUX_VAL(CP(SDRC_D7),            (IEN  | PTD | DIS | M0)) /*SDRC_D7*/\
+       MUX_VAL(CP(SDRC_D8),            (IEN  | PTD | DIS | M0)) /*SDRC_D8*/\
+       MUX_VAL(CP(SDRC_D9),            (IEN  | PTD | DIS | M0)) /*SDRC_D9*/\
+       MUX_VAL(CP(SDRC_D10),           (IEN  | PTD | DIS | M0)) /*SDRC_D10*/\
+       MUX_VAL(CP(SDRC_D11),           (IEN  | PTD | DIS | M0)) /*SDRC_D11*/\
+       MUX_VAL(CP(SDRC_D12),           (IEN  | PTD | DIS | M0)) /*SDRC_D12*/\
+       MUX_VAL(CP(SDRC_D13),           (IEN  | PTD | DIS | M0)) /*SDRC_D13*/\
+       MUX_VAL(CP(SDRC_D14),           (IEN  | PTD | DIS | M0)) /*SDRC_D14*/\
+       MUX_VAL(CP(SDRC_D15),           (IEN  | PTD | DIS | M0)) /*SDRC_D15*/\
+       MUX_VAL(CP(SDRC_D16),           (IEN  | PTD | DIS | M0)) /*SDRC_D16*/\
+       MUX_VAL(CP(SDRC_D17),           (IEN  | PTD | DIS | M0)) /*SDRC_D17*/\
+       MUX_VAL(CP(SDRC_D18),           (IEN  | PTD | DIS | M0)) /*SDRC_D18*/\
+       MUX_VAL(CP(SDRC_D19),           (IEN  | PTD | DIS | M0)) /*SDRC_D19*/\
+       MUX_VAL(CP(SDRC_D20),           (IEN  | PTD | DIS | M0)) /*SDRC_D20*/\
+       MUX_VAL(CP(SDRC_D21),           (IEN  | PTD | DIS | M0)) /*SDRC_D21*/\
+       MUX_VAL(CP(SDRC_D22),           (IEN  | PTD | DIS | M0)) /*SDRC_D22*/\
+       MUX_VAL(CP(SDRC_D23),           (IEN  | PTD | DIS | M0)) /*SDRC_D23*/\
+       MUX_VAL(CP(SDRC_D24),           (IEN  | PTD | DIS | M0)) /*SDRC_D24*/\
+       MUX_VAL(CP(SDRC_D25),           (IEN  | PTD | DIS | M0)) /*SDRC_D25*/\
+       MUX_VAL(CP(SDRC_D26),           (IEN  | PTD | DIS | M0)) /*SDRC_D26*/\
+       MUX_VAL(CP(SDRC_D27),           (IEN  | PTD | DIS | M0)) /*SDRC_D27*/\
+       MUX_VAL(CP(SDRC_D28),           (IEN  | PTD | DIS | M0)) /*SDRC_D28*/\
+       MUX_VAL(CP(SDRC_D29),           (IEN  | PTD | DIS | M0)) /*SDRC_D29*/\
+       MUX_VAL(CP(SDRC_D30),           (IEN  | PTD | DIS | M0)) /*SDRC_D30*/\
+       MUX_VAL(CP(SDRC_D31),           (IEN  | PTD | DIS | M0)) /*SDRC_D31*/\
+       MUX_VAL(CP(SDRC_CLK),           (IEN  | PTD | DIS | M0)) /*SDRC_CLK*/\
+       MUX_VAL(CP(SDRC_DQS0),          (IEN  | PTD | DIS | M0)) /*SDRC_DQS0*/\
+       MUX_VAL(CP(SDRC_DQS1),          (IEN  | PTD | DIS | M0)) /*SDRC_DQS1*/\
+       MUX_VAL(CP(SDRC_DQS2),          (IEN  | PTD | DIS | M0)) /*SDRC_DQS2*/\
+       MUX_VAL(CP(SDRC_DQS3),          (IEN  | PTD | DIS | M0)) /*SDRC_DQS3*/\
+       /* GPMC */\
+       MUX_VAL(CP(GPMC_A1),            (IDIS | PTD | DIS | M0)) /*GPMC_A1*/\
+       MUX_VAL(CP(GPMC_A2),            (IDIS | PTD | DIS | M0)) /*GPMC_A2*/\
+       MUX_VAL(CP(GPMC_A3),            (IDIS | PTD | DIS | M0)) /*GPMC_A3*/\
+       MUX_VAL(CP(GPMC_A4),            (IDIS | PTD | DIS | M0)) /*GPMC_A4*/\
+       MUX_VAL(CP(GPMC_A5),            (IDIS | PTD | DIS | M0)) /*GPMC_A5*/\
+       MUX_VAL(CP(GPMC_A6),            (IDIS | PTD | DIS | M0)) /*GPMC_A6*/\
+       MUX_VAL(CP(GPMC_A7),            (IDIS | PTD | DIS | M0)) /*GPMC_A7*/\
+       MUX_VAL(CP(GPMC_A8),            (IDIS | PTD | DIS | M0)) /*GPMC_A8*/\
+       MUX_VAL(CP(GPMC_A9),            (IDIS | PTD | DIS | M0)) /*GPMC_A9*/\
+       MUX_VAL(CP(GPMC_A10),           (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\
+       MUX_VAL(CP(GPMC_D0),            (IEN  | PTD | DIS | M0)) /*GPMC_D0*/\
+       MUX_VAL(CP(GPMC_D1),            (IEN  | PTD | DIS | M0)) /*GPMC_D1*/\
+       MUX_VAL(CP(GPMC_D2),            (IEN  | PTD | DIS | M0)) /*GPMC_D2*/\
+       MUX_VAL(CP(GPMC_D3),            (IEN  | PTD | DIS | M0)) /*GPMC_D3*/\
+       MUX_VAL(CP(GPMC_D4),            (IEN  | PTD | DIS | M0)) /*GPMC_D4*/\
+       MUX_VAL(CP(GPMC_D5),            (IEN  | PTD | DIS | M0)) /*GPMC_D5*/\
+       MUX_VAL(CP(GPMC_D6),            (IEN  | PTD | DIS | M0)) /*GPMC_D6*/\
+       MUX_VAL(CP(GPMC_D7),            (IEN  | PTD | DIS | M0)) /*GPMC_D7*/\
+       MUX_VAL(CP(GPMC_D8),            (IEN  | PTD | DIS | M0)) /*GPMC_D8*/\
+       MUX_VAL(CP(GPMC_D9),            (IEN  | PTD | DIS | M0)) /*GPMC_D9*/\
+       MUX_VAL(CP(GPMC_D10),           (IEN  | PTD | DIS | M0)) /*GPMC_D10*/\
+       MUX_VAL(CP(GPMC_D11),           (IEN  | PTD | DIS | M0)) /*GPMC_D11*/\
+       MUX_VAL(CP(GPMC_D12),           (IEN  | PTD | DIS | M0)) /*GPMC_D12*/\
+       MUX_VAL(CP(GPMC_D13),           (IEN  | PTD | DIS | M0)) /*GPMC_D13*/\
+       MUX_VAL(CP(GPMC_D14),           (IEN  | PTD | DIS | M0)) /*GPMC_D14*/\
+       MUX_VAL(CP(GPMC_D15),           (IEN  | PTD | DIS | M0)) /*GPMC_D15*/\
+       MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS0 NAND*/\
+       MUX_VAL(CP(GPMC_NCS1),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS1*/\
+       MUX_VAL(CP(GPMC_NCS2),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS2*/\
+       MUX_VAL(CP(GPMC_NCS3),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS3*/\
+       MUX_VAL(CP(GPMC_NCS4),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS4*/\
+       MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+       MUX_VAL(CP(GPMC_NCS6),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS6*/\
+       MUX_VAL(CP(GPMC_NCS7),          (IDIS | PTU | EN  | M0)) /*GPMC_nCS7*/\
+       MUX_VAL(CP(GPMC_NBE1),          (IEN  | PTD | DIS | M0)) /*GPMC_nBE1*/\
+       MUX_VAL(CP(GPMC_WAIT2),         (IEN  | PTU | EN  | M0)) /*GPMC_WAIT2*/\
+       MUX_VAL(CP(GPMC_WAIT3),         (IEN  | PTU | EN  | M0)) /*GPMC_WAIT3*/\
+       MUX_VAL(CP(GPMC_CLK),           (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
+       MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
+       MUX_VAL(CP(GPMC_NOE),           (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
+       MUX_VAL(CP(GPMC_NWE),           (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
+       MUX_VAL(CP(GPMC_NBE0_CLE),      (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\
+       MUX_VAL(CP(GPMC_NWP),           (IEN  | PTD | DIS | M0)) /*GPMC_nWP*/\
+       MUX_VAL(CP(GPMC_WAIT0),         (IEN  | PTU | EN  | M0)) /*GPMC_WAIT0*/\
+       MUX_VAL(CP(GPMC_WAIT1),         (IEN  | PTU | EN  | M0)) /*GPMC_WAIT1*/\
+       /* DSS */\
+       MUX_VAL(CP(DSS_PCLK),           (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\
+       MUX_VAL(CP(DSS_HSYNC),          (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\
+       MUX_VAL(CP(DSS_VSYNC),          (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\
+       MUX_VAL(CP(DSS_ACBIAS),         (IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\
+       MUX_VAL(CP(DSS_DATA0),          (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\
+       MUX_VAL(CP(DSS_DATA1),          (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\
+       MUX_VAL(CP(DSS_DATA2),          (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\
+       MUX_VAL(CP(DSS_DATA3),          (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\
+       MUX_VAL(CP(DSS_DATA4),          (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\
+       MUX_VAL(CP(DSS_DATA5),          (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\
+       MUX_VAL(CP(DSS_DATA6),          (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\
+       MUX_VAL(CP(DSS_DATA7),          (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\
+       MUX_VAL(CP(DSS_DATA8),          (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\
+       MUX_VAL(CP(DSS_DATA9),          (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\
+       MUX_VAL(CP(DSS_DATA10),         (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\
+       MUX_VAL(CP(DSS_DATA11),         (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\
+       MUX_VAL(CP(DSS_DATA12),         (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\
+       MUX_VAL(CP(DSS_DATA13),         (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\
+       MUX_VAL(CP(DSS_DATA14),         (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\
+       MUX_VAL(CP(DSS_DATA15),         (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\
+       MUX_VAL(CP(DSS_DATA16),         (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\
+       MUX_VAL(CP(DSS_DATA17),         (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\
+       MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\
+       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\
+       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\
+       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\
+       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
+       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
+       /* CAMERA */\
+       MUX_VAL(CP(CAM_HS),             (IEN  | PTU | EN  | M0)) /*CAM_HS */\
+       MUX_VAL(CP(CAM_VS),             (IEN  | PTU | EN  | M0)) /*CAM_VS */\
+       MUX_VAL(CP(CAM_XCLKA),          (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
+       MUX_VAL(CP(CAM_PCLK),           (IEN  | PTU | EN  | M0)) /*CAM_PCLK*/\
+       MUX_VAL(CP(CAM_FLD),            (IDIS | PTD | DIS | M4)) /*GPIO_98*/\
+       MUX_VAL(CP(CAM_D0),             (IEN  | PTD | DIS | M0)) /*CAM_D0*/\
+       MUX_VAL(CP(CAM_D1),             (IEN  | PTD | DIS | M0)) /*CAM_D1*/\
+       MUX_VAL(CP(CAM_D2),             (IEN  | PTD | DIS | M0)) /*CAM_D2*/\
+       MUX_VAL(CP(CAM_D3),             (IEN  | PTD | DIS | M0)) /*CAM_D3*/\
+       MUX_VAL(CP(CAM_D4),             (IEN  | PTD | DIS | M0)) /*CAM_D4*/\
+       MUX_VAL(CP(CAM_D5),             (IEN  | PTD | DIS | M0)) /*CAM_D5*/\
+       MUX_VAL(CP(CAM_D6),             (IEN  | PTD | DIS | M0)) /*CAM_D6*/\
+       MUX_VAL(CP(CAM_D7),             (IEN  | PTD | DIS | M0)) /*CAM_D7*/\
+       MUX_VAL(CP(CAM_D8),             (IEN  | PTD | DIS | M0)) /*CAM_D8*/\
+       MUX_VAL(CP(CAM_D9),             (IEN  | PTD | DIS | M0)) /*CAM_D9*/\
+       MUX_VAL(CP(CAM_D10),            (IEN  | PTD | DIS | M0)) /*CAM_D10*/\
+       MUX_VAL(CP(CAM_D11),            (IEN  | PTD | DIS | M0)) /*CAM_D11*/\
+       MUX_VAL(CP(CAM_XCLKB),          (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\
+       MUX_VAL(CP(CAM_WEN),            (IEN  | PTD | DIS | M4)) /*GPIO_167*/\
+       MUX_VAL(CP(CAM_STROBE),         (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\
+       MUX_VAL(CP(CSI2_DX0),           (IEN  | PTD | DIS | M0)) /*CSI2_DX0*/\
+       MUX_VAL(CP(CSI2_DY0),           (IEN  | PTD | DIS | M0)) /*CSI2_DY0*/\
+       MUX_VAL(CP(CSI2_DX1),           (IEN  | PTD | DIS | M0)) /*CSI2_DX1*/\
+       MUX_VAL(CP(CSI2_DY1),           (IEN  | PTD | DIS | M0)) /*CSI2_DY1*/\
+       /* Audio Interface */\
+       MUX_VAL(CP(MCBSP2_FSX),         (IEN  | PTD | DIS | M0)) /*McBSP2_FSX*/\
+       MUX_VAL(CP(MCBSP2_CLKX),        (IEN  | PTD | DIS | M0)) /*McBSP2_CLKX*/\
+       MUX_VAL(CP(MCBSP2_DR),          (IEN  | PTD | DIS | M0)) /*McBSP2_DR*/\
+       MUX_VAL(CP(MCBSP2_DX),          (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\
+       /* MMC Slot */\
+       MUX_VAL(CP(MMC1_CLK),           (IDIS | PTU | EN  | M0)) /*MMC1_CLK*/\
+       MUX_VAL(CP(MMC1_CMD),           (IEN  | PTU | EN  | M0)) /*MMC1_CMD*/\
+       MUX_VAL(CP(MMC1_DAT0),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT0*/\
+       MUX_VAL(CP(MMC1_DAT1),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT1*/\
+       MUX_VAL(CP(MMC1_DAT2),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT2*/\
+       MUX_VAL(CP(MMC1_DAT3),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT3*/\
+       MUX_VAL(CP(MMC1_DAT4),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT4*/\
+       MUX_VAL(CP(MMC1_DAT5),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT5*/\
+       MUX_VAL(CP(MMC1_DAT6),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT6*/\
+       MUX_VAL(CP(MMC1_DAT7),          (IEN  | PTU | EN  | M0)) /*MMC1_DAT7*/\
+       /* Expansion Header */\
+       MUX_VAL(CP(MMC2_CLK),           (IEN  | PTU | EN  | M4)) /*GPIO_130*/\
+       MUX_VAL(CP(MMC2_CMD),           (IEN  | PTU | EN  | M4)) /*GPIO_131*/\
+       MUX_VAL(CP(MMC2_DAT0),          (IEN  | PTU | EN  | M4)) /*GPIO_132*/\
+       MUX_VAL(CP(MMC2_DAT1),          (IEN  | PTU | EN  | M4)) /*GPIO_133*/\
+       MUX_VAL(CP(MMC2_DAT2),          (IEN  | PTU | EN  | M4)) /*GPIO_134*/\
+       MUX_VAL(CP(MMC2_DAT3),          (IEN  | PTU | EN  | M4)) /*GPIO_135*/\
+       MUX_VAL(CP(MMC2_DAT4),          (IEN  | PTU | EN  | M4)) /*GPIO_136*/\
+       MUX_VAL(CP(MMC2_DAT5),          (IEN  | PTU | EN  | M4)) /*GPIO_137*/\
+       MUX_VAL(CP(MMC2_DAT6),          (IEN  | PTU | EN  | M4)) /*GPIO_138*/\
+       MUX_VAL(CP(MMC2_DAT7),          (IEN  | PTU | EN  | M4)) /*GPIO_139*/\
+       MUX_VAL(CP(MCBSP3_DX),          (IDIS | PTD | DIS | M4)) /*GPIO_140*/\
+       MUX_VAL(CP(MCBSP3_DR),          (IDIS | PTD | DIS | M4)) /*GPIO_141*/\
+       MUX_VAL(CP(MCBSP3_CLKX),        (IDIS | PTD | DIS | M4)) /*GPIO_142*/\
+       MUX_VAL(CP(MCBSP3_FSX),         (IDIS | PTD | DIS | M4)) /*GPIO_143*/\
+       MUX_VAL(CP(UART2_CTS),          (IDIS | PTD | DIS | M4)) /*GPIO_144*/\
+       MUX_VAL(CP(UART2_RTS),          (IDIS | PTD | DIS | M4)) /*GPIO_145*/\
+       MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M4)) /*GPIO_146*/\
+       MUX_VAL(CP(UART2_RX),           (IDIS | PTD | DIS | M4)) /*GPIO_147*/\
+       MUX_VAL(CP(UART1_TX),           (IDIS | PTD | DIS | M0)) /*GPIO_148*/\
+       MUX_VAL(CP(UART1_RTS),          (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \
+       MUX_VAL(CP(UART1_CTS),          (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \
+       MUX_VAL(CP(UART1_RX),           (IEN  | PTD | DIS | M0)) /*GPIO_151*/\
+       MUX_VAL(CP(MCBSP4_CLKX),        (IEN  | PTD | DIS | M1)) /*GPIO_152*/\
+       MUX_VAL(CP(MCBSP4_DR),          (IEN  | PTD | DIS | M1)) /*GPIO_153*/\
+       MUX_VAL(CP(MCBSP4_DX),          (IEN  | PTD | DIS | M1)) /*GPIO_154*/\
+       MUX_VAL(CP(MCBSP4_FSX),         (IEN  | PTD | DIS | M1)) /*GPIO_155*/\
+       MUX_VAL(CP(MCBSP1_CLKR),        (IDIS | PTD | DIS | M4)) /*GPIO_156*/\
+       MUX_VAL(CP(MCBSP1_FSR),         (IDIS | PTU | EN  | M4)) /*GPIO_157*/\
+       MUX_VAL(CP(MCBSP1_DX),          (IDIS | PTD | DIS | M4)) /*GPIO_158*/\
+       MUX_VAL(CP(MCBSP1_DR),          (IDIS | PTD | DIS | M4)) /*GPIO_159*/\
+       MUX_VAL(CP(MCBSP_CLKS),         (IEN  | PTU | DIS | M0)) /*GPIO_160*/\
+       MUX_VAL(CP(MCBSP1_FSX),         (IDIS | PTD | DIS | M4)) /*GPIO_161*/\
+       MUX_VAL(CP(MCBSP1_CLKX),        (IDIS | PTD | DIS | M4)) /*GPIO_162*/\
+       /* Serial Interface */\
+       MUX_VAL(CP(UART3_CTS_RCTX),     (IDIS | PTD | EN  | M4)) /*GPIO_163 - LED2*/\
+       MUX_VAL(CP(UART3_RTS_SD),       (IDIS | PTU | EN  | M4)) /*GPIO_164 - LED3*/\
+       MUX_VAL(CP(UART3_RX_IRRX),      (IEN  | PTD | DIS | M0)) /*UART3_RX_IRRX*/\
+       MUX_VAL(CP(UART3_TX_IRTX),      (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\
+       /* Host USB0 */\
+       MUX_VAL(CP(HSUSB0_CLK),         (IEN  | PTD | DIS | M0)) /*HSUSB0_CLK*/\
+       MUX_VAL(CP(HSUSB0_STP),         (IDIS | PTU | EN  | M0)) /*HSUSB0_STP*/\
+       MUX_VAL(CP(HSUSB0_DIR),         (IEN  | PTD | DIS | M0)) /*HSUSB0_DIR*/\
+       MUX_VAL(CP(HSUSB0_NXT),         (IEN  | PTD | DIS | M0)) /*HSUSB0_NXT*/\
+       MUX_VAL(CP(HSUSB0_DATA0),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA0*/\
+       MUX_VAL(CP(HSUSB0_DATA1),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA1*/\
+       MUX_VAL(CP(HSUSB0_DATA2),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA2*/\
+       MUX_VAL(CP(HSUSB0_DATA3),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA3*/\
+       MUX_VAL(CP(HSUSB0_DATA4),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA4*/\
+       MUX_VAL(CP(HSUSB0_DATA5),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA5*/\
+       MUX_VAL(CP(HSUSB0_DATA6),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA6*/\
+       MUX_VAL(CP(HSUSB0_DATA7),       (IEN  | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
+       MUX_VAL(CP(I2C1_SCL),           (IEN  | PTU | EN  | M0)) /*I2C1_SCL*/\
+       MUX_VAL(CP(I2C1_SDA),           (IEN  | PTU | EN  | M0)) /*I2C1_SDA*/\
+       MUX_VAL(CP(I2C2_SCL),           (IEN  | PTU | EN  | M0)) /*I2C2_SCL*/\
+       MUX_VAL(CP(I2C2_SDA),           (IEN  | PTU | EN  | M0)) /*I2C2_SDA*/\
+       MUX_VAL(CP(I2C3_SCL),           (IEN  | PTU | EN  | M0)) /*I2C3_SCL*/\
+       MUX_VAL(CP(I2C3_SDA),           (IEN  | PTU | EN  | M0)) /*I2C3_SDA*/\
+       MUX_VAL(CP(I2C4_SCL),           (IEN  | PTU | EN  | M0)) /*I2C4_SCL*/\
+       MUX_VAL(CP(I2C4_SDA),           (IEN  | PTU | EN  | M0)) /*I2C4_SDA*/\
+       MUX_VAL(CP(HDQ_SIO),            (IEN  | PTU | EN  | M0)) /*HDQ_SIO*/\
+       MUX_VAL(CP(MCSPI1_CLK),         (IEN  | PTD | DIS | M4)) /*GPIO_171*/\
+       MUX_VAL(CP(MCSPI1_SIMO),        (IEN  | PTD | DIS | M4)) /*GPIO_172*/\
+       MUX_VAL(CP(MCSPI1_SOMI),        (IEN  | PTD | DIS | M0)) /*MCSPI1_SOMI*/\
+       MUX_VAL(CP(MCSPI1_CS0),         (IEN  | PTD | DIS | M0)) /*MCSPI1_CS0*/\
+       MUX_VAL(CP(MCSPI1_CS1),         (IDIS | PTD | DIS | M0)) /*MCSPI1_CS1*/\
+       MUX_VAL(CP(MCSPI1_CS2),         (IDIS | PTD | DIS | M4)) /*GPIO_176*/\
+       /* USB EHCI (port 2) */\
+       MUX_VAL(CP(MCSPI1_CS3),         (IEN  | PTD | EN  | M0)) /*HSUSB2_DATA2*/\
+       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTD | DIS | M0)) /*HSUSB2_DATA7*/\
+       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTD | DIS | M0)) /*HSUSB2_DATA4*/\
+       MUX_VAL(CP(MCSPI2_SOMI),        (IEN  | PTD | DIS | M0)) /*HSUSB2_DATA5*/\
+       MUX_VAL(CP(MCSPI2_CS0),         (IEN  | PTD | EN  | M0)) /*HSUSB2_DATA6*/\
+       MUX_VAL(CP(MCSPI2_CS1),         (IEN  | PTD | EN  | M0)) /*HSUSB2_DATA3*/\
+       /*Control and debug */\
+       MUX_VAL(CP(SYS_32K),            (IEN  | PTD | DIS | M0)) /*SYS_32K*/\
+       MUX_VAL(CP(SYS_CLKREQ),         (IEN  | PTD | DIS | M0)) /*SYS_CLKREQ*/\
+       MUX_VAL(CP(SYS_NIRQ),           (IEN  | PTU | EN  | M0)) /*SYS_nIRQ*/\
+       MUX_VAL(CP(SYS_BOOT0),          (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
+       MUX_VAL(CP(SYS_BOOT1),          (IEN  | PTD | DIS | M4)) /*GPIO_3*/\
+       MUX_VAL(CP(SYS_BOOT2),          (IEN  | PTD | DIS | M4)) /*GPIO_4*/\
+       MUX_VAL(CP(SYS_BOOT3),          (IEN  | PTD | DIS | M4)) /*GPIO_5*/\
+       MUX_VAL(CP(SYS_BOOT4),          (IEN  | PTD | DIS | M4)) /*GPIO_6*/\
+       MUX_VAL(CP(SYS_BOOT5),          (IEN  | PTD | DIS | M4)) /*GPIO_7 - BOOTMODE*/\
+       MUX_VAL(CP(SYS_BOOT6),          (IDIS | PTD | DIS | M4)) /*GPIO_8*/ \
+       MUX_VAL(CP(SYS_OFF_MODE),       (IEN  | PTD | DIS | M0)) /*SYS_OFF_MODE*/\
+       MUX_VAL(CP(SYS_CLKOUT1),        (IDIS | PTD | EN  | M0)) /*SYS_CLKOUT1*/\
+       MUX_VAL(CP(SYS_CLKOUT2),        (IDIS | PTU | EN  | M4)) /*GPIO_186 - LED1*/\
+       MUX_VAL(CP(ETK_CLK_ES2),        (IDIS | PTD | DIS | M4)) /*GPIO_12*/\
+       MUX_VAL(CP(ETK_CTL_ES2),        (IDIS | PTD | EN  | M4)) /*GPIO_13*/\
+       MUX_VAL(CP(ETK_D0_ES2),         (IDIS | PTU | EN  | M1)) /*SPI3_SIMO*/\
+       MUX_VAL(CP(ETK_D1_ES2),         (IDIS | PTU | EN  | M1)) /*SPI3_SOMI*/\
+       MUX_VAL(CP(ETK_D2_ES2),         (IDIS | PTU | EN  | M1)) /*SPI3_CS0*/\
+       MUX_VAL(CP(ETK_D3_ES2),         (IDIS | PTU | EN  | M1)) /*SPI3_CLK*/\
+       MUX_VAL(CP(ETK_D4_ES2),         (IDIS | PTU | EN  | M4)) /*GPIO_18*/\
+       MUX_VAL(CP(ETK_D5_ES2),         (IDIS | PTU | EN  | M4)) /*GPIO_19*/\
+       MUX_VAL(CP(ETK_D6_ES2),         (IDIS | PTU | EN  | M4)) /*GPIO_20*/\
+       MUX_VAL(CP(ETK_D7_ES2),         (IDIS | PTU | EN  | M1)) /*SPI3_CS1*/\
+       MUX_VAL(CP(ETK_D8_ES2),         (IEN  | PTU | DIS | M4)) /*MSECURE*/\
+       MUX_VAL(CP(ETK_D9_ES2),         (IEN  | PTU | EN  | M4)) /*GPIO_23*/\
+       /*HSUSB2 */\
+       MUX_VAL(CP(ETK_D10_ES2),        (IDIS | PTU | EN  | M4)) /*GPIO_24*/\
+       MUX_VAL(CP(ETK_D11_ES2),        (IEN  | PTU | EN  | M4)) /*GPIO_25*/\
+       MUX_VAL(CP(ETK_D12_ES2),        (IEN  | PTU | EN  | M4)) /*GPIO_26*/\
+       MUX_VAL(CP(ETK_D13_ES2),        (IEN  | PTU | EN  | M4)) /*GPIO_27*/\
+       MUX_VAL(CP(ETK_D14_ES2),        (IEN  | PTU | EN  | M4)) /*GPIO_28*/\
+       MUX_VAL(CP(ETK_D15_ES2),        (IEN  | PTU | EN  | M4)) /*GPIO_29*/\
+       /* */\
+       MUX_VAL(CP(D2D_MCAD1),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD1*/\
+       MUX_VAL(CP(D2D_MCAD2),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD2*/\
+       MUX_VAL(CP(D2D_MCAD3),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD3*/\
+       MUX_VAL(CP(D2D_MCAD4),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD4*/\
+       MUX_VAL(CP(D2D_MCAD5),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD5*/\
+       MUX_VAL(CP(D2D_MCAD6),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD6*/\
+       MUX_VAL(CP(D2D_MCAD7),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD7*/\
+       MUX_VAL(CP(D2D_MCAD8),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD8*/\
+       MUX_VAL(CP(D2D_MCAD9),          (IEN  | PTD | EN  | M0)) /*D2D_MCAD9*/\
+       MUX_VAL(CP(D2D_MCAD10),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD10*/\
+       MUX_VAL(CP(D2D_MCAD11),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD11*/\
+       MUX_VAL(CP(D2D_MCAD12),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD12*/\
+       MUX_VAL(CP(D2D_MCAD13),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD13*/\
+       MUX_VAL(CP(D2D_MCAD14),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD14*/\
+       MUX_VAL(CP(D2D_MCAD15),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD15*/\
+       MUX_VAL(CP(D2D_MCAD16),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD16*/\
+       MUX_VAL(CP(D2D_MCAD17),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD17*/\
+       MUX_VAL(CP(D2D_MCAD18),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD18*/\
+       MUX_VAL(CP(D2D_MCAD19),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD19*/\
+       MUX_VAL(CP(D2D_MCAD20),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD20*/\
+       MUX_VAL(CP(D2D_MCAD21),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD21*/\
+       MUX_VAL(CP(D2D_MCAD22),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD22*/\
+       MUX_VAL(CP(D2D_MCAD23),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD23*/\
+       MUX_VAL(CP(D2D_MCAD24),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD24*/\
+       MUX_VAL(CP(D2D_MCAD25),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD25*/\
+       MUX_VAL(CP(D2D_MCAD26),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD26*/\
+       MUX_VAL(CP(D2D_MCAD27),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD27*/\
+       MUX_VAL(CP(D2D_MCAD28),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD28*/\
+       MUX_VAL(CP(D2D_MCAD29),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD29*/\
+       MUX_VAL(CP(D2D_MCAD30),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD30*/\
+       MUX_VAL(CP(D2D_MCAD31),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD31*/\
+       MUX_VAL(CP(D2D_MCAD32),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD32*/\
+       MUX_VAL(CP(D2D_MCAD33),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD33*/\
+       MUX_VAL(CP(D2D_MCAD34),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD34*/\
+       MUX_VAL(CP(D2D_MCAD35),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD35*/\
+       MUX_VAL(CP(D2D_MCAD36),         (IEN  | PTD | EN  | M0)) /*D2D_MCAD36*/\
+       MUX_VAL(CP(D2D_CLK26MI),        (IEN  | PTD | DIS | M0)) /*D2D_clk26mi*/\
+       MUX_VAL(CP(D2D_NRESPWRON),      (IEN  | PTD | EN  | M0)) /*D2D_nrespwron*/\
+       MUX_VAL(CP(D2D_NRESWARM),       (IEN  | PTU | EN  | M0)) /*D2D_nreswarm */\
+       MUX_VAL(CP(D2D_ARM9NIRQ),       (IEN  | PTD | DIS | M0)) /*D2D_arm9nirq */\
+       MUX_VAL(CP(D2D_UMA2P6FIQ),      (IEN  | PTD | DIS | M0)) /*D2D_uma2p6fiq*/\
+       MUX_VAL(CP(D2D_SPINT),          (IEN  | PTD | EN  | M0)) /*D2D_spint*/\
+       MUX_VAL(CP(D2D_FRINT),          (IEN  | PTD | EN  | M0)) /*D2D_frint*/\
+       MUX_VAL(CP(D2D_DMAREQ0),        (IEN  | PTD | DIS | M0)) /*D2D_dmareq0*/\
+       MUX_VAL(CP(D2D_DMAREQ1),        (IEN  | PTD | DIS | M0)) /*D2D_dmareq1*/\
+       MUX_VAL(CP(D2D_DMAREQ2),        (IEN  | PTD | DIS | M0)) /*D2D_dmareq2*/\
+       MUX_VAL(CP(D2D_DMAREQ3),        (IEN  | PTD | DIS | M0)) /*D2D_dmareq3*/\
+       MUX_VAL(CP(D2D_N3GTRST),        (IEN  | PTD | DIS | M0)) /*D2D_n3gtrst*/\
+       MUX_VAL(CP(D2D_N3GTDI),         (IEN  | PTD | DIS | M0)) /*D2D_n3gtdi*/\
+       MUX_VAL(CP(D2D_N3GTDO),         (IEN  | PTD | DIS | M0)) /*D2D_n3gtdo*/\
+       MUX_VAL(CP(D2D_N3GTMS),         (IEN  | PTD | DIS | M0)) /*D2D_n3gtms*/\
+       MUX_VAL(CP(D2D_N3GTCK),         (IEN  | PTD | DIS | M0)) /*D2D_n3gtck*/\
+       MUX_VAL(CP(D2D_N3GRTCK),        (IEN  | PTD | DIS | M0)) /*D2D_n3grtck*/\
+       MUX_VAL(CP(D2D_MSTDBY),         (IEN  | PTU | EN  | M0)) /*D2D_mstdby*/\
+       MUX_VAL(CP(D2D_SWAKEUP),        (IEN  | PTD | EN  | M0)) /*D2D_swakeup*/\
+       MUX_VAL(CP(D2D_IDLEREQ),        (IEN  | PTD | DIS | M0)) /*D2D_idlereq*/\
+       MUX_VAL(CP(D2D_IDLEACK),        (IEN  | PTU | EN  | M0)) /*D2D_idleack*/\
+       MUX_VAL(CP(D2D_MWRITE),         (IEN  | PTD | DIS | M0)) /*D2D_mwrite*/\
+       MUX_VAL(CP(D2D_SWRITE),         (IEN  | PTD | DIS | M0)) /*D2D_swrite*/\
+       MUX_VAL(CP(D2D_MREAD),          (IEN  | PTD | DIS | M0)) /*D2D_mread*/\
+       MUX_VAL(CP(D2D_SREAD),          (IEN  | PTD | DIS | M0)) /*D2D_sread*/\
+       MUX_VAL(CP(D2D_MBUSFLAG),       (IEN  | PTD | DIS | M0)) /*D2D_mbusflag*/\
+       MUX_VAL(CP(D2D_SBUSFLAG),       (IEN  | PTD | DIS | M0)) /*D2D_sbusflag*/\
+       MUX_VAL(CP(SDRC_CKE0),          (IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
+       MUX_VAL(CP(SDRC_CKE1),          (IDIS | PTD | DIS | M7)) /*sdrc_cke1*/
+
+#endif
diff --git a/board/d-link/dns325/Makefile b/board/d-link/dns325/Makefile
new file mode 100644 (file)
index 0000000..35da21a
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2011
+# Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+#
+# Based on Kirkwood support:
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := dns325.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/d-link/dns325/dns325.c b/board/d-link/dns325/dns325.c
new file mode 100644 (file)
index 0000000..990d79f
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2011
+ * Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <netdev.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+#include <asm/arch/gpio.h>
+#include "dns325.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+       /* Gpio configuration */
+       kw_config_gpio(DNS325_OE_VAL_LOW, DNS325_OE_VAL_HIGH,
+                       DNS325_OE_LOW, DNS325_OE_HIGH);
+
+       /* Multi-Purpose Pins Functionality configuration */
+       u32 kwmpp_config[] = {
+               MPP0_NF_IO2,
+               MPP1_NF_IO3,
+               MPP2_NF_IO4,
+               MPP3_NF_IO5,
+               MPP4_NF_IO6,
+               MPP5_NF_IO7,
+               MPP6_SYSRST_OUTn,
+               MPP7_GPO,
+               MPP8_TW_SDA,
+               MPP9_TW_SCK,
+               MPP10_UART0_TXD,
+               MPP11_UART0_RXD,
+               MPP12_SD_CLK,
+               MPP13_SD_CMD,
+               MPP14_SD_D0,
+               MPP15_SD_D1,
+               MPP16_SD_D2,
+               MPP17_SD_D3,
+               MPP18_NF_IO0,
+               MPP19_NF_IO1,
+               MPP20_SATA1_ACTn,       /* sata1(left) status led */
+               MPP21_SATA0_ACTn,       /* sata0(right) status led */
+               MPP22_GPIO,
+               MPP23_GPIO,
+               MPP24_GPIO,             /* power off out */
+               MPP25_GPIO,
+               MPP26_GPIO,             /* power led */
+               MPP27_GPIO,             /* sata0(right) error led */
+               MPP28_GPIO,             /* sata1(left) error led */
+               MPP29_GPIO,             /* usb error led */
+               MPP30_GPIO,
+               MPP31_GPIO,
+               MPP32_GPIO,
+               MPP33_GPIO,
+               MPP34_GPIO,             /* power key */
+               MPP35_GPIO,
+               MPP36_GPIO,
+               MPP37_GPIO,
+               MPP38_GPIO,
+               MPP39_GPIO,             /* enable sata 0 */
+               MPP40_GPIO,             /* enable sata 1 */
+               MPP41_GPIO,             /* hdd0 present */
+               MPP42_GPIO,             /* hdd1 present */
+               MPP43_GPIO,             /* usb status led */
+               MPP44_GPIO,             /* fan status */
+               MPP45_GPIO,             /* fan high speed */
+               MPP46_GPIO,             /* fan low speed */
+               MPP47_GPIO,             /* usb umount */
+               MPP48_GPIO,             /* factory reset */
+               MPP49_GPIO,             /* thermal sensor */
+               0
+       };
+       kirkwood_mpp_conf(kwmpp_config);
+
+       kw_gpio_set_blink(DNS325_GPIO_LED_POWER , 1);
+
+       kw_gpio_set_value(DNS325_GPIO_SATA0_EN , 1);
+       return 0;
+}
+
+int board_init(void)
+{
+       /* Boot parameters address */
+       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+       return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and initialize PHY */
+void reset_phy(void)
+{
+       u16 reg;
+       u16 devadr;
+       char *name = "egiga0";
+
+       if (miiphy_set_current_dev(name))
+               return;
+
+       /* command to read PHY dev address */
+       if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+               printf("Err..(%s) could not read PHY dev address\n", __func__);
+               return;
+       }
+
+       /*
+        * Enable RGMII delay on Tx and Rx for CPU port
+        * Ref: sec 4.7.2 of chip datasheet
+        */
+       miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
+       miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, &reg);
+       reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
+       miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
+       miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
+
+       /* reset the phy */
+       miiphy_reset(name, devadr);
+
+       debug("88E1116 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
diff --git a/board/d-link/dns325/dns325.h b/board/d-link/dns325/dns325.h
new file mode 100644 (file)
index 0000000..7859cea
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011
+ * Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __DNS325_H
+#define __DNS325_H
+
+/* GPIO configuration */
+#define DNS325_OE_LOW                  0x00000000
+#define DNS325_OE_HIGH                 0x00039604
+#define DNS325_OE_VAL_LOW              0x38000000      /* disable leds */
+#define DNS325_OE_VAL_HIGH             0x00000800      /* disable leds */
+
+#define DNS325_GPIO_LED_POWER          26
+#define DNS325_GPIO_SATA0_EN           39
+#define DNS325_GPIO_SATA1_EN           40
+
+/* PHY related */
+#define MV88E1116_MAC_CTRL_REG         21
+#define MV88E1116_PGADR_REG            22
+#define MV88E1116_RGMII_TXTM_CTRL      (1 << 4)
+#define MV88E1116_RGMII_RXTM_CTRL      (1 << 5)
+
+#endif /* __DNS325_H */
diff --git a/board/d-link/dns325/kwbimage.cfg b/board/d-link/dns325/kwbimage.cfg
new file mode 100644 (file)
index 0000000..97cb090
--- /dev/null
@@ -0,0 +1,208 @@
+#
+# Copyright (C) 2011
+# Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+#
+# Based on Kirkwood support:
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM      nand
+NAND_ECC_MODE  default
+NAND_PAGE_SIZE 0x0800
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Configure RGMII-0 interface pad voltage to 1.8V
+DATA 0xFFD100e0 0x1b1b1b9b
+
+#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+DATA 0xFFD01400 0x43000c30     # DDR Configuration register
+# bit13-0:  0xc30, 3120 DDR2 clks refresh rate
+# bit23-14: 0 required
+# bit24:    1, enable exit self refresh mode on DDR access
+# bit25:    1 required
+# bit29-26: 0 required
+# bit31-30: 0b01 required
+
+DATA 0xFFD01404 0x39543000     # DDR Controller Control Low
+# bit3-0:   0 required
+# bit4:     0, addr/cmd in smame cycle
+# bit5:     0, clk is driven during self refresh, we don't care for APX
+# bit6:     0, use recommended falling edge of clk for addr/cmd
+# bit11-7:  0 required
+# bit12:    1 required
+# bit13:    1 required
+# bit14:    0, input buffer always powered up
+# bit17-15: 0 required
+# bit18:    1, cpu lock transaction enabled
+# bit19:    0 required
+# bit23-20: 5, recommended value for CL=5 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 9, CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM
+# bit30-28: 3 required
+# bit31:    0, no additional STARTBURST delay
+
+DATA 0xFFD01408 0x22125451     # DDR Timing (Low)
+# bit3-0:   1, 18 cycle tRAS (tRAS[3-0])
+# bit7-4:   5, 6 cycle tRCD
+# bit11-8:  4, 5 cyle tRP
+# bit15-12: 5, 6 cyle tWR
+# bit19-16: 2, 3 cyle tWTR
+# bit20:    1, 18 cycle tRAS (tRAS[4])
+# bit23-21: 0 required
+# bit27-24: 2, 3 cycle tRRD
+# bit31-28: 2, 3 cyle tRTP
+
+DATA 0xFFD0140C 0x00000833     #  DDR Timing (High)
+# bit6-0:   0x33, 33 cycle tRFC
+# bit8-7:   0, 1 cycle tR2R
+# bit10-9:  0, 1 cyle tR2W
+# bit12-11: 1, 2 cylce tW2W
+# bit31-13: 0 required
+
+DATA 0xFFD01410 0x0000000c     #  DDR Address Control
+# bit1-0:   0, Cs0width=x8
+# bit3-2:   3, Cs0size=1Gb
+# bit5-4:   0, Cs1width=nonexistent
+# bit7-6:   0, Cs1size=nonexistent
+# bit9-8:   0, Cs2width=nonexistent
+# bit11-10: 0, Cs2size=nonexistent
+# bit13-12: 0, Cs3width=nonexistent
+# bit15-14: 0, Cs3size=nonexistent
+# bit16:    0, Cs0AddrSel
+# bit17:    0, Cs1AddrSel
+# bit18:    0, Cs2AddrSel
+# bit19:    0, Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x00000000     #  DDR Open Pages Control
+# bit0:    0, OPEn=OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x00000000     #  DDR Operation
+# bit3-0:   0, Cmd=Normal SDRAM Mode
+# bit31-4:  0 required
+
+DATA 0xFFD0141C 0x00000C52     #  DDR Mode
+# bit2-0:   2, Burst Length (2 required)
+# bit3:     0, Burst Type (0 required)
+# bit6-4:   5, CAS Latency (CL) 5
+# bit7:     0, (Test Mode) Normal operation
+# bit8:     0, (Reset DLL) Normal operation
+# bit11-9:  0, Write recovery for auto-precharge (3 required ??)
+# bit12:    0, Fast Active power down exit time (0 required)
+# bit31-13: 0 required
+
+DATA 0xFFD01420 0x00000040     #  DDR Extended Mode
+# bit0:     0, DRAM DLL enabled
+# bit1:     0, DRAM drive strength normal
+# bit2:     0, ODT control Rtt[0] (Rtt=2, 150 ohm termination)
+# bit5-3:   0 required
+# bit6:     1, ODT control Rtt[1] (Rtt=2, 150 ohm termination)
+# bit9-7:   0 required
+# bit10:    0, differential DQS enabled
+# bit11:    0 required
+# bit12:    0, DRAM output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F17F     #  DDR Controller Control High
+# bit2-0:   0x7 required
+# bit3:     1, MBUS Burst Chop disabled
+# bit6-4:   0x7 required
+# bit7:     0 required
+# bit8:     1, add writepath sample stage, must be 1 for DDR freq >= 300MHz
+# bit9:     0, no half clock cycle addition to dataout
+# bit10:    0, 1/4 clock cycle skew enabled for addr/ctl signals
+# bit11:    0, 1/4 clock cycle skew disabled for write mesh
+# bit15-12: 0xf required
+# bit31-16: 0 required
+
+DATA 0xFFD01428 0x00085520     # DDR2 ODT Read Timing
+# bit3-0:   0 required
+# bit7-4:   2, 2 cycles from read command to assertion of M_ODT signal
+# bit11-8:  5, 5 cycles from read command to de-assertion of M_ODT signal
+# bit15-12: 5, 5 cycles from read command to assertion of internal ODT signal
+# bit19-16: 8, 8 cycles from read command to de-assertion of internal ODT signal
+# bit31-20: 0 required
+
+DATA 0xFFD0147C 0x00008552     # DDR2 ODT Write Timing
+# bit3-0:   2, 2 cycles from write comand to assertion of M_ODT signal
+# bit7-4:   5, 5 cycles from write command to de-assertion of M_ODT signal
+# bit15-12: 5, 5 cycles from write command to assertion of internal ODT signal
+# bit19-16: 8, 8 cycles from write command to de-assertion of internal ODT signal
+# bit31-16: 0 required
+
+DATA 0xFFD01500 0x00000000     # CS[0]n Base address to 0x0
+DATA 0xFFD01504 0x0FFFFFF1     # CS[0]n Size
+# bit0:     1, Window enabled
+# bit1:     0, Write Protect disabled
+# bit3-2:   0x0, CS0 hit selected
+# bit23-4:  0xfffff required
+# bit31-24: 0x0f, Size (i.e. 256MB)
+
+DATA 0xFFD01508 0x10000000     # CS[1]n Base address to 256Mb
+DATA 0xFFD0150C 0x0FFFFFF5     # CS[1]n Size 256Mb Window enabled for CS1
+# bit0:     1, Window enabled
+# bit1:     0, Write Protect disabled
+# bit3-2:   1, CS1 hit selected
+# bit23-4:  0xfffff required
+# bit31-24: 0x0f, Size (i.e. 256MB)
+
+DATA 0xFFD01514 0x00000000     # CS[2]n Size, window disabled
+DATA 0xFFD0151C 0x00000000     # CS[3]n Size, window disabled
+
+DATA 0xFFD01494 0x00030000     #  DDR ODT Control (Low)
+# bit3-0:   0b0000, (read) M_ODT[0] is not asserted during read from DRAM
+# bit7-4:   0b0000, (read) M_ODT[1] is not asserted during read from DRAM
+# bit15-8:  0 required
+# bit19-16: 0b0011, (write) M_ODT[0] is asserted during write to DRAM CS0 and CS1
+# bit23-20: 0b0000, (write) M_ODT[1] is not asserted during write to DRAM
+# bit31-24: 0 required
+
+DATA 0xFFD01498 0x00000000     #  DDR ODT Control (High)
+# bit1-0:   0, M_ODT[0] assertion is controlled by ODT Control Low register
+# bit3-2:   0, M_ODT[1] assertion is controlled by ODT Control Low register
+# bit31-4   0 required
+
+DATA 0xFFD0149C 0x0000E803     # CPU ODT Control
+# bit3-0:   0b0011, internal ODT is asserted during read from DRAM bank 0-1
+# bit7-4:   0b0000, internal ODT is not asserted during write to DRAM bank 0-4
+# bit9-8:   0, Internal ODT assertion is controlled by fiels
+# bit11-10: 2, M_DQ, M_DM, and M_DQS I/O buffer ODT 75 ohm
+# bit13-12: 2, M_STARTBURST_IN I/O buffer ODT 75 ohm
+# bit14:    1, M_STARTBURST_IN ODT enabled
+# bit15:    1, DDR IO ODT Unit: Drive ODT calibration values
+# bit20-16: 0, Pad N channel driving strength for ODT
+# bit25-21: 0, Pad P channel driving strength for ODT
+# bit31-26: 0 required
+
+DATA 0xFFD01480 0x00000001     # DDR Initialization Control
+# bit0:     1, enable DDR init upon this register write
+# bit31-1:  0, required
+
+# End of Header extension
+DATA 0x0 0x0
index 9bd3e7146c435e884ed7ce4ed4f26cd50cb3506f..34ef53df2bca699c375852d0504bbd5750ad0322 100644 (file)
@@ -137,7 +137,7 @@ const struct pinmux_resource pinmuxes[] = {
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
        { DAVINCI_LPSC_SPI1 },  /* Serial Flash */
        { DAVINCI_LPSC_EMAC },  /* image download */
@@ -145,6 +145,8 @@ static const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_GPIO },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 #ifndef CONFIG_DA850_EVM_MAX_CPU_CLK
 #define CONFIG_DA850_EVM_MAX_CPU_CLK   300000000
 #endif
index 9d4e238bfc9ae288dbc47c81e37c19ab8ba17897..b6942589f474a3925ef40f32e6031004ee06ea49 100644 (file)
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 #include <asm/arch/davinci_misc.h>
+#include <asm/arch/pinmux_defs.h>
 #include <ns16550.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const struct pinmux_resource pinmuxes[] = {
+       PINMUX_ITEM(emac_pins_mii),
+       PINMUX_ITEM(emac_pins_mdio),
+       PINMUX_ITEM(emifa_pins_cs3),
+       PINMUX_ITEM(emifa_pins_cs4),
+       PINMUX_ITEM(emifa_pins_nand),
+       PINMUX_ITEM(uart2_pins_txrx),
+       PINMUX_ITEM(uart2_pins_rtscts),
+};
+
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
+const struct lpsc_resource lpsc[] = {
+       { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
+       { DAVINCI_LPSC_SPI1 },  /* Serial Flash */
+       { DAVINCI_LPSC_EMAC },  /* image download */
+       { DAVINCI_LPSC_UART2 }, /* console */
+       { DAVINCI_LPSC_GPIO },
+};
+
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 int board_init(void)
 {
        /* arch number of the board */
diff --git a/board/davinci/da8xxevm/hawkboard_nand_spl.c b/board/davinci/da8xxevm/hawkboard_nand_spl.c
deleted file mode 100644 (file)
index df97963..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org>
- *
- * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.  <nsekhar@ti.com>
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- * Copyright (C) 2004 Texas Instruments.
- *
- * ----------------------------------------------------------------------------
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- * ----------------------------------------------------------------------------
- */
-
-#include <common.h>
-#include <asm/errno.h>
-#include <asm/arch/hardware.h>
-#include <asm/io.h>
-#include <asm/arch/davinci_misc.h>
-#include <asm/arch/pinmux_defs.h>
-#include <ns16550.h>
-#include <nand.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static const struct pinmux_resource pinmuxes[] = {
-       PINMUX_ITEM(emac_pins_mii),
-       PINMUX_ITEM(emac_pins_mdio),
-       PINMUX_ITEM(emifa_pins_cs3),
-       PINMUX_ITEM(emifa_pins_cs4),
-       PINMUX_ITEM(emifa_pins_nand),
-       PINMUX_ITEM(uart2_pins_txrx),
-       PINMUX_ITEM(uart2_pins_rtscts),
-};
-
-static const struct lpsc_resource lpsc[] = {
-       { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
-       { DAVINCI_LPSC_SPI1 },  /* Serial Flash */
-       { DAVINCI_LPSC_EMAC },  /* image download */
-       { DAVINCI_LPSC_UART2 }, /* console */
-       { DAVINCI_LPSC_GPIO },
-};
-
-void board_init_f(ulong bootflag)
-{
-       /*
-        * Kick Registers need to be set to allow access to Pin Mux registers
-        */
-       writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0);
-       writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1);
-
-       /* setup the SUSPSRC for ARM to control emulation suspend */
-       writel(readl(&davinci_syscfg_regs->suspsrc) &
-              ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
-                DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
-                DAVINCI_SYSCFG_SUSPSRC_UART2), &davinci_syscfg_regs->suspsrc);
-
-       /* Power on required peripherals
-        * ARM does not have acess by default to PSC0 and PSC1
-        * assuming here that the DSP bootloader has set the IOPU
-        * such that PSC access is available to ARM
-        */
-       da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc));
-
-       /* configure pinmux settings */
-       davinci_configure_pin_mux_items(pinmuxes,
-                                       ARRAY_SIZE(pinmuxes));
-
-       writel(readl(&davinci_uart2_ctrl_regs->pwremu_mgmt) |
-              (DAVINCI_UART_PWREMU_MGMT_FREE) |
-              (DAVINCI_UART_PWREMU_MGMT_URRST) |
-              (DAVINCI_UART_PWREMU_MGMT_UTRST),
-              &davinci_uart2_ctrl_regs->pwremu_mgmt);
-
-       NS16550_init((NS16550_t)(DAVINCI_UART2_BASE),
-                       CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
-
-       puts("Nand boot...\n");
-
-       nand_boot();
-}
-
-void puts(const char *str)
-{
-       while (*str)
-               putc(*str++);
-}
-
-void putc(char c)
-{
-       if (gd->flags & GD_FLG_SILENT)
-               return;
-
-       if (c == '\n')
-               NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), '\r');
-
-       NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), c);
-}
-
-void hang(void)
-{
-       puts("### ERROR ### Please RESET the board ###\n");
-       for (;;)
-               ;
-}
diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
new file mode 100644 (file)
index 0000000..6f6e065
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * (C) Copyright 2008
+ * Guennadi Liakhovetki, DENX Software Engineering, <lg@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
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+               LENGTH = CONFIG_SPL_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+       __start = .;
+         arch/arm/cpu/arm926ejs/start.o        (.text)
+         *(.text*)
+       } >.sram
+
+       . = ALIGN(4);
+       .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+       . = ALIGN(4);
+       .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+       . = ALIGN(4);
+       .rel.dyn : {
+               __rel_dyn_start = .;
+               *(.rel*)
+               __rel_dyn_end = .;
+       } >.sram
+
+       .dynsym : {
+               __dynsym_start = .;
+               *(.dynsym)
+       } >.sram
+
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.bss*)
+               . = ALIGN(4);
+               __bss_end__ = .;
+       } >.sram
+
+       __image_copy_end = .;
+       _end = .;
+}
diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
new file mode 100644 (file)
index 0000000..b3a41af
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * (C) Copyright 2008
+ * Guennadi Liakhovetki, DENX Software Engineering, <lg@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
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0xc1080000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+         arch/arm/cpu/arm926ejs/start.o                (.text)
+         arch/arm/cpu/arm926ejs/davinci/libdavinci.o   (.text)
+         drivers/mtd/nand/libnand.o                    (.text)
+
+         *(.text*)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : {
+               *(.data)
+       __datarel_start = .;
+               *(.data.rel)
+       __datarelrolocal_start = .;
+               *(.data.rel.ro.local)
+       __datarellocal_start = .;
+               *(.data.rel.local)
+       __datarelro_start = .;
+               *(.data.rel.ro)
+       }
+
+       . = ALIGN(4);
+       __rel_dyn_start = .;
+       __rel_dyn_end = .;
+       __dynsym_start = .;
+
+       __got_start = .;
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       __got_end = .;
+
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.bss*)
+               . = ALIGN(4);
+               __bss_end__ = .;
+       }
+
+       _end = .;
+}
diff --git a/board/davinci/da8xxevm/u-boot-spl.lds b/board/davinci/da8xxevm/u-boot-spl.lds
deleted file mode 100644 (file)
index 6f6e065..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
- *
- * (C) Copyright 2008
- * Guennadi Liakhovetki, DENX Software Engineering, <lg@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
- */
-
-MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
-               LENGTH = CONFIG_SPL_MAX_SIZE }
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-       . = 0x00000000;
-
-       . = ALIGN(4);
-       .text      :
-       {
-       __start = .;
-         arch/arm/cpu/arm926ejs/start.o        (.text)
-         *(.text*)
-       } >.sram
-
-       . = ALIGN(4);
-       .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
-
-       . = ALIGN(4);
-       .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
-       . = ALIGN(4);
-       .rel.dyn : {
-               __rel_dyn_start = .;
-               *(.rel*)
-               __rel_dyn_end = .;
-       } >.sram
-
-       .dynsym : {
-               __dynsym_start = .;
-               *(.dynsym)
-       } >.sram
-
-       .bss :
-       {
-               . = ALIGN(4);
-               __bss_start = .;
-               *(.bss*)
-               . = ALIGN(4);
-               __bss_end__ = .;
-       } >.sram
-
-       __image_copy_end = .;
-       _end = .;
-}
index 840bd9aaa38b372f7b6003c7a4d12d7d5977fe25..ac2d2e966f41d40d7cba4eec67943f63510d76e4 100644 (file)
@@ -120,6 +120,7 @@ static void efika_ehci_init(struct usb_ehci *ehci, uint32_t stp_gpio,
 {
        int ret;
        struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
+       struct ulpi_viewport ulpi_vp;
 
        mxc_request_iomux(stp_gpio, alt0);
        mxc_iomux_set_pad(stp_gpio, PAD_CTL_DRV_HIGH |
@@ -133,23 +134,26 @@ static void efika_ehci_init(struct usb_ehci *ehci, uint32_t stp_gpio,
        mxc_iomux_set_pad(stp_gpio, USB_PAD_CONFIG);
        udelay(10000);
 
-       ret = ulpi_init((u32)&ehci->ulpi_viewpoint);
+       ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
+       ulpi_vp.port_num = 0;
+
+       ret = ulpi_init(&ulpi_vp);
        if (ret) {
                printf("Efika USB ULPI initialization failed\n");
                return;
        }
 
        /* ULPI set flags */
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl,
+       ulpi_write(&ulpi_vp, &ulpi->otg_ctrl,
                        ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN |
                        ULPI_OTG_EXTVBUSIND);
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->function_ctrl,
+       ulpi_write(&ulpi_vp, &ulpi->function_ctrl,
                        ULPI_FC_FULL_SPEED | ULPI_FC_OPMODE_NORMAL |
                        ULPI_FC_SUSPENDM);
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->iface_ctrl, 0);
+       ulpi_write(&ulpi_vp, &ulpi->iface_ctrl, 0);
 
        /* Set VBus */
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
+       ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set,
                        ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
 
        /*
@@ -158,8 +162,7 @@ static void efika_ehci_init(struct usb_ehci *ehci, uint32_t stp_gpio,
         * NOTE: This violates USB specification, but otherwise, USB on Efika
         * doesn't work.
         */
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
-                       ULPI_OTG_CHRGVBUS);
+       ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
 }
 
 int board_ehci_hcd_init(int port)
@@ -177,9 +180,12 @@ void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
        uint32_t port = OTG_BASE_ADDR + (0x200 * CONFIG_MXC_USB_PORT);
        struct usb_ehci *ehci = (struct usb_ehci *)port;
        struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
+       struct ulpi_viewport ulpi_vp;
+
+       ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
+       ulpi_vp.port_num = 0;
 
-       ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
-                       ULPI_OTG_CHRGVBUS);
+       ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
 
        wait_ms(50);
 
index 98dda1eada77d70f5131aaec7e16e085774079a9..16d1b08675a2da662b581325d371ed31ce493398 100644 (file)
@@ -49,7 +49,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_AEMIF },
        { DAVINCI_LPSC_SPI1 },
        { DAVINCI_LPSC_ARM_RAM_ROM },
@@ -65,6 +65,8 @@ static const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_USB11 },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 static const struct pinmux_config enbw_pins[] = {
        { pinmux(0), 8, 0 },
        { pinmux(0), 8, 1 },
@@ -548,15 +550,6 @@ void board_gpio_init(void)
 {
        struct davinci_gpio *gpio = davinci_gpio_bank01;
 
-       /*
-        * Power on required peripherals
-        * ARM does not have access by default to PSC0 and PSC1
-        * assuming here that the DSP bootloader has set the IOPU
-        * such that PSC access is available to ARM
-        */
-       if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
-               return;
-
        /*
         * set LED (gpio Interface not usable here)
         * set LED pins to output and state 0
index 9077aaf106cd4c8c59b96443b6dc5635636f7bb6..0b40dc7bf72d008f86ba89e7790d11f269e048b4 100644 (file)
@@ -39,7 +39,7 @@ COBJS-$(CONFIG_PQ_MDS_PIB)    += pq-mds-pib.o
 COBJS-$(CONFIG_ID_EEPROM)      += sys_eeprom.o
 COBJS-$(CONFIG_FSL_SGMII_RISER)        += sgmii_riser.o
 ifndef CONFIG_RAMBOOT_PBL
-COBJS-$(CONFIG_ENV_IS_IN_MMC)  += sdhc_boot.o
+COBJS-$(CONFIG_FSL_FIXED_MMC_LOCATION) += sdhc_boot.o
 endif
 
 COBJS-$(CONFIG_MPC8541CDS)     += cds_pci_ft.o
index 98942454a0671846d3d69c58fab0bd5edd32ac9c..1367b8802850156b226a6ec520f4826d1f07a4d1 100644 (file)
@@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
        {USDHC4_BASE_ADDR, 1},
 };
 
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
 {
        struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+       int ret;
 
        if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
                gpio_direction_input(171); /*GPIO6_11*/
-               *cd = gpio_get_value(171);
+               ret = !gpio_get_value(171);
        } else /* Don't have the CD GPIO pin on board */
-               *cd = 0;
+               ret = 1;
 
-       return 0;
+       return ret;
 }
 
 int board_mmc_init(bd_t *bis)
index 4028789f4e1fd02676d4a1fc64832a04288cb215..a53b01f35c63156f6e73100751c24f4116fe74ec 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/gpio.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
+#include <miiphy.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -40,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR;
        PAD_CTL_PUS_47K_UP  | PAD_CTL_SPEED_LOW |               \
        PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
 
+#define ENET_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |            \
+       PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   |             \
+       PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
+
 int dram_init(void)
 {
        gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
@@ -47,6 +53,11 @@ int dram_init(void)
        return 0;
 }
 
+iomux_v3_cfg_t uart1_pads[] = {
+       MX6Q_PAD_SD3_DAT6__UART1_RXD | MUX_PAD_CTRL(UART_PAD_CTRL),
+       MX6Q_PAD_SD3_DAT7__UART1_TXD | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
 iomux_v3_cfg_t uart2_pads[] = {
        MX6Q_PAD_EIM_D26__UART2_TXD | MUX_PAD_CTRL(UART_PAD_CTRL),
        MX6Q_PAD_EIM_D27__UART2_RXD | MUX_PAD_CTRL(UART_PAD_CTRL),
@@ -72,8 +83,62 @@ iomux_v3_cfg_t usdhc4_pads[] = {
        MX6Q_PAD_NANDF_D6__GPIO_2_6    | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */
 };
 
+iomux_v3_cfg_t enet_pads1[] = {
+       MX6Q_PAD_ENET_MDIO__ENET_MDIO           | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_ENET_MDC__ENET_MDC             | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL     | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       /* pin 35 - 1 (PHY_AD2) on reset */
+       MX6Q_PAD_RGMII_RXC__GPIO_6_30           | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 32 - 1 - (MODE0) all */
+       MX6Q_PAD_RGMII_RD0__GPIO_6_25           | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 31 - 1 - (MODE1) all */
+       MX6Q_PAD_RGMII_RD1__GPIO_6_27           | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 28 - 1 - (MODE2) all */
+       MX6Q_PAD_RGMII_RD2__GPIO_6_28           | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 27 - 1 - (MODE3) all */
+       MX6Q_PAD_RGMII_RD3__GPIO_6_29           | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 33 - 1 - (CLK125_EN) 125Mhz clockout enabled */
+       MX6Q_PAD_RGMII_RX_CTL__GPIO_6_24        | MUX_PAD_CTRL(NO_PAD_CTRL),
+       /* pin 42 PHY nRST */
+       MX6Q_PAD_EIM_D23__GPIO_3_23             | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+iomux_v3_cfg_t enet_pads2[] = {
+       MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3      | MUX_PAD_CTRL(ENET_PAD_CTRL),
+       MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL     | MUX_PAD_CTRL(ENET_PAD_CTRL),
+};
+
+static void setup_iomux_enet(void)
+{
+       gpio_direction_output(87, 0);  /* GPIO 3-23 */
+       gpio_direction_output(190, 1); /* GPIO 6-30 */
+       gpio_direction_output(185, 1); /* GPIO 6-25 */
+       gpio_direction_output(187, 1); /* GPIO 6-27 */
+       gpio_direction_output(188, 1); /* GPIO 6-28*/
+       gpio_direction_output(189, 1); /* GPIO 6-29 */
+       imx_iomux_v3_setup_multiple_pads(enet_pads1, ARRAY_SIZE(enet_pads1));
+       gpio_direction_output(184, 1); /* GPIO 6-24 */
+
+       /* Need delay 10ms according to KSZ9021 spec */
+       udelay(1000 * 10);
+       gpio_direction_output(87, 1);  /* GPIO 3-23 */
+
+       imx_iomux_v3_setup_multiple_pads(enet_pads2, ARRAY_SIZE(enet_pads2));
+}
+
 static void setup_iomux_uart(void)
 {
+       imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
        imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
 }
 
@@ -128,6 +193,55 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#define MII_1000BASET_CTRL             0x9
+#define MII_EXTENDED_CTRL              0xb
+#define MII_EXTENDED_DATAW             0xc
+
+int fecmxc_mii_postcall(int phy)
+{
+       /* prefer master mode */
+       miiphy_write("FEC", phy, MII_1000BASET_CTRL, 0x0f00);
+
+       /* min rx data delay */
+       miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8105);
+       miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0x0000);
+
+       /* max rx/tx clock delay, min rx/tx control delay */
+       miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8104);
+       miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0xf0f0);
+       miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x104);
+
+       return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+       struct eth_device *dev;
+       int ret;
+
+       setup_iomux_enet();
+
+       ret = cpu_eth_init(bis);
+       if (ret) {
+               printf("FEC MXC: %s:failed\n", __func__);
+               return ret;
+       }
+
+       dev = eth_get_dev_by_name("FEC");
+       if (!dev) {
+               printf("FEC MXC: Unable to get FEC device entry\n");
+               return -EINVAL;
+       }
+
+       ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall);
+       if (ret) {
+               printf("FEC MXC: Unable to register FEC mii postcall\n");
+               return ret;
+       }
+
+       return 0;
+}
+
 int board_early_init_f(void)
 {
        setup_iomux_uart();
index 2995c8f105054edae5ed822e026bf029b61ef1bb..ed3fa6ef9a760fda700bb5b68d3e067ad0a5fc86 100644 (file)
@@ -26,6 +26,8 @@
 #include <netdev.h>
 #include <command.h>
 #include <pmic.h>
+#include <fsl_pmic.h>
+#include <mc13783.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
@@ -175,8 +177,6 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       pmic_init();
-
 #ifdef CONFIG_HW_WATCHDOG
        mxc_hw_watchdog_enable();
 #endif
@@ -190,6 +190,36 @@ int checkboard(void)
        return 0;
 }
 
+#ifdef CONFIG_MXC_MMC
+int board_mmc_init(bd_t *bis)
+{
+       u32 val;
+       struct pmic *p;
+
+       /*
+       * this is the first driver to use the pmic, so call
+       * pmic_init() here. board_late_init() is too late for
+       * the MMC driver.
+       */
+       pmic_init();
+       p = get_pmic();
+
+       /* configure pins for SDHC1 only */
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_CLK, MUX_CTL_FUNC));
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_CMD, MUX_CTL_FUNC));
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA0, MUX_CTL_FUNC));
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA1, MUX_CTL_FUNC));
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA2, MUX_CTL_FUNC));
+       mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA3, MUX_CTL_FUNC));
+
+       /* turn on power V_MMC1 */
+       if (pmic_reg_read(p, REG_MODE_1, &val) < 0)
+               pmic_reg_write(p, REG_MODE_1, val | VMMC1EN);
+
+       return mxc_mmc_init(bis);
+}
+#endif
+
 int board_eth_init(bd_t *bis)
 {
        int rc = 0;
diff --git a/board/htkw/mcx/Makefile b/board/htkw/mcx/Makefile
new file mode 100644 (file)
index 0000000..4c8db10
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+#
+# Based on ti/evm/Makefile
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c
new file mode 100644 (file)
index 0000000..e593b43
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+ *
+ * Based on ti/evm/evm.c
+ *
+ * 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.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/mach-types.h>
+#include <asm/gpio.h>
+#include <asm/omap_gpio.h>
+#include "errno.h"
+#include <i2c.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/ehci-omap.h>
+#endif
+#include "mcx.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+       return omap_ehci_hcd_init(&usbhs_bdata);
+}
+
+int ehci_hcd_stop(void)
+{
+       return omap_ehci_hcd_stop();
+}
+#endif
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+       gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+       return 0;
+}
+
+/*
+ * Routine: misc_init_r
+ * Description: late init.
+ */
+int misc_init_r(void)
+{
+       dieid_num_r();
+
+       return 0;
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *             hardware. Many pins need to be moved from protect to primary
+ *             mode.
+ */
+void set_muxconf_regs(void)
+{
+       MUX_MCX();
+}
+
+#if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
+int board_mmc_init(bd_t *bis)
+{
+       return omap_mmc_init(0);
+}
+#endif
+
+#ifdef CONFIG_USB_EHCI_OMAP
+#define USB_HOST_PWR_EN                132
+int board_usb_init(void)
+{
+       if (gpio_request(USB_HOST_PWR_EN, "USB_HOST_PWR_EN") < 0) {
+               puts("Failed to get USB_HOST_PWR_EN pin\n");
+               return -ENODEV;
+       }
+       gpio_direction_output(USB_HOST_PWR_EN, 1);
+
+       return 0;
+}
+#endif
diff --git a/board/htkw/mcx/mcx.h b/board/htkw/mcx/mcx.h
new file mode 100644 (file)
index 0000000..d675a48
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+ *
+ * Based on ti/evm/evm.h
+ *
+ * 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.
+ */
+
+#ifndef _AM3517EVM_H_
+#define _AM3517EVM_H_
+
+const omap3_sysinfo sysinfo = {
+       DDR_DISCRETE,
+       "HTKW mcx Board",
+       "NAND",
+};
+
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN   - Pull type selection is active
+ * M0   - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */
+#define MUX_MCX() \
+       /* SDRC */\
+       MUX_VAL(CP(SDRC_D0),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D1),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D2),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D3),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D4),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D5),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D6),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D7),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D8),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D9),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D10),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D11),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D12),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D13),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D14),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D15),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D16),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D17),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D18),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D19),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D20),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D21),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D22),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D23),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D24),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D25),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D26),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D27),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D28),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D29),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D30),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D31),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_CLK),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS0),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS1),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS2),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS3),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS0N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS1N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS2N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS3N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_CKE0),          (M0)) \
+       MUX_VAL(CP(SDRC_CKE1),          (M0)) \
+       MUX_VAL(CP(STRBEN_DLY0),        (IEN  | PTD | EN  | M0)) \
+                                       /*sdrc_strben_dly0*/\
+       MUX_VAL(CP(STRBEN_DLY1),        (IEN  | PTD | EN  | M0)) \
+                                       /*sdrc_strben_dly1*/\
+       /* GPMC */\
+       MUX_VAL(CP(GPMC_A1),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A2),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A3),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A4),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A5),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A6),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A7),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A8),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A9),            (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_A10),           (IDIS | PTU | DIS | M4)) \
+                                       /* GPIO_43 LCD buffer enable */ \
+       MUX_VAL(CP(GPMC_D0),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D1),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D2),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D3),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D4),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D5),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D6),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D7),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D8),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D9),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D10),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D11),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D12),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D13),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D14),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D15),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NCS1),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NCS2),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NCS3),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NCS4),          (IEN | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_NCS5),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NCS6),          (IEN | PTU | EN  | M4)) \
+                                       /* GPIO_57 TS_PenIRQn */\
+       MUX_VAL(CP(GPMC_NCS7),          (IEN | PTU | EN  | M4)) \
+                                       /* GPIO_58 ETHERNET RESET */\
+       MUX_VAL(CP(GPMC_CLK),           (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NOE),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NWE),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NBE0_CLE),      (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NBE1),          (IEN  | PTU | DIS  | M4)) \
+                                       /* GPIO_61 SD-CARD CD */ \
+       MUX_VAL(CP(GPMC_NWP),           (IDIS  | PTU | EN | M4)) \
+                       /* GPIO_62 Nand write protect, keep enabled */ \
+       MUX_VAL(CP(GPMC_WAIT0),         (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_WAIT1),         (IEN | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_WAIT2),         (IEN  | PTU | EN  | M4))\
+       MUX_VAL(CP(GPMC_WAIT3),         (IEN | PTU | EN  | M4)) \
+                                       /* GPIO_65 SD-CARD WP */\
+       /* DSS */\
+       MUX_VAL(CP(DSS_PCLK),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_HSYNC),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_VSYNC),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_ACBIAS),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA0),          (IEN | PTU | EN  | M4))\
+       MUX_VAL(CP(DSS_DATA1),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA2),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA3),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA4),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA5),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA6),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA7),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA8),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA9),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA10),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA11),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA12),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA13),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA14),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA15),         (IDIS | PTD | DIS | M0))\
+       MUX_VAL(CP(DSS_DATA16),         (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA17),         (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA18),         (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0))  \
+       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0)) \
+       /* CAMERA */\
+       MUX_VAL(CP(CAM_HS),             (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(CAM_VS),             (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(CAM_XCLKA),          (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_PCLK),           (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(CAM_FLD),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D0),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D1),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D2),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D3),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D4),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D5),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D6),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D7),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D8),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D9),             (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D10),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_D11),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_XCLKB),          (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_WEN),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CAM_STROBE),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CSI2_DX0),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CSI2_DY0),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CSI2_DX1),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CSI2_DY1),           (IEN  | PTD | EN  | M4)) \
+       /* MMC */\
+       MUX_VAL(CP(MMC1_CLK),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(MMC1_CMD),           (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT0),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT1),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT2),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT3),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT4),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC1_DAT5),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC1_DAT6),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC1_DAT7),          (IEN  | PTU | EN  | M4)) \
+       \
+       MUX_VAL(CP(MMC2_CLK),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(MMC2_CMD),           (IDIS | PTD | DIS | M4)) \
+                                       /* GPIO_131 LCD Enable */ \
+       MUX_VAL(CP(MMC2_DAT0),          (IDIS | PTD | DIS  | M4)) \
+                                       /* GPIO_132 USB host Enable */\
+       MUX_VAL(CP(MMC2_DAT1),          (IDIS  | PTD | DIS  | M4)) \
+                                       /* GPIO_133 HDMI PD */\
+       MUX_VAL(CP(MMC2_DAT2),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC2_DAT3),          (IEN  | PTU | EN  | M4))\
+       /* McBSP */\
+       MUX_VAL(CP(MCBSP_CLKS),         (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_CLKR),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_FSR),         (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(MCBSP1_DX),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_DR),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_FSX),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_CLKX),        (IEN  | PTD | DIS | M0)) \
+       \
+       MUX_VAL(CP(MCBSP2_FSX),         (IEN  | PTU | EN  | M4))\
+       MUX_VAL(CP(MCBSP2_CLKX),        (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCBSP2_DR),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCBSP2_DX),          (IEN  | PTU | EN  | M4))\
+       \
+       MUX_VAL(CP(MCBSP3_DX),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCBSP3_DR),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCBSP3_CLKX),        (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCBSP3_FSX),         (IEN  | PTU | EN  | M4))\
+       \
+       MUX_VAL(CP(MCBSP4_CLKX),        (IDIS | PTD | DIS | M4)) \
+                                       /* GPIO_152 USB phy2 reset */\
+       MUX_VAL(CP(MCBSP4_DR),          (IEN | PTU | EN | M4)) \
+                                       /* GPIO_153 */\
+       MUX_VAL(CP(MCBSP4_DX),          (IDIS | PTD | DIS | M4)) \
+                                       /* GPIO_154 USB phy1 reset */\
+       MUX_VAL(CP(MCBSP4_FSX),         (IEN | PTU | EN | M4)) \
+                                       /* GPIO_155 TS_BUSY */\
+       /* UART */\
+       MUX_VAL(CP(UART1_TX),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART1_RTS),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART1_CTS),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(UART1_RX),           (IEN  | PTD | DIS | M0)) \
+       \
+       MUX_VAL(CP(UART2_CTS),          (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(UART2_RTS),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART2_RX),           (IEN  | PTD | DIS | M0)) \
+       \
+       MUX_VAL(CP(UART3_CTS_RCTX),     (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(UART3_RTS_SD),       (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART3_RX_IRRX),      (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART3_TX_IRTX),      (IDIS | PTD | DIS | M0)) \
+       /* I2C */\
+       MUX_VAL(CP(I2C1_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C1_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C2_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C2_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C3_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C3_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C4_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C4_SDA),           (IEN  | PTU | EN  | M0)) \
+       /* McSPI */\
+       MUX_VAL(CP(MCSPI1_CLK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_SIMO),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_SOMI),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_CS0),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(MCSPI1_CS1),         (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCSPI1_CS2),         (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCSPI1_CS3),         (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTD | DIS | M3)) \
+                                       /* HSUSB2_dat7 */\
+       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTD | DIS | M3)) \
+                                       /* HSUSB2_dat4 */\
+       MUX_VAL(CP(MCSPI2_SOMI),        (IEN  | PTD | DIS | M3)) \
+                                       /* HSUSB2_dat5 */\
+       MUX_VAL(CP(MCSPI2_CS0),         (IEN  | PTD | DIS | M3)) \
+                                       /* HSUSB2_dat6 */\
+       MUX_VAL(CP(MCSPI2_CS1),         (IEN  | PTD | DIS | M3)) \
+                                       /* HSUSB2_dat3 */\
+       /* CCDC */\
+       MUX_VAL(CP(CCDC_PCLK),          (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_FIELD),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_HD),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_VD),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_WEN),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA0),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA1),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA2),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA3),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA4),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA5),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA6),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(CCDC_DATA7),         (IEN  | PTD | EN  | M4)) \
+       /* RMII */\
+       MUX_VAL(CP(RMII_MDIO_DATA),     (IEN  |  M0)) \
+       MUX_VAL(CP(RMII_MDIO_CLK),      (M0)) \
+       MUX_VAL(CP(RMII_RXD0),          (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_RXD1),          (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_CRS_DV),        (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_RXER),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXD0),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXD1),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXEN),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_50MHZ_CLK),     (IEN  | PTD | EN  | M0)) \
+       /* HECC */\
+       MUX_VAL(CP(HECC1_TXD),          (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(HECC1_RXD),          (IEN  | PTD | EN  | M4)) \
+       /* HSUSB */\
+       MUX_VAL(CP(HSUSB0_CLK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_STP),         (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(HSUSB0_DIR),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_NXT),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA0),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA1),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA2),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA3),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA4),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA5),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA6),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA7),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(USB0_DRVBUS),        (IEN  | PTD | EN  | M0)) \
+       /* HDQ */\
+       MUX_VAL(CP(HDQ_SIO),            (IEN  | PTD | EN  | M4)) \
+       /* Control and debug */\
+       MUX_VAL(CP(SYS_32K),            (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(SYS_CLKREQ),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_NIRQ),           (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(SYS_NRESWARM),       (IEN | PTU | DIS | M4)) \
+                                       /* SYS_nRESWARM */\
+       MUX_VAL(CP(SYS_BOOT0),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT1),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT2),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT3),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT4),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT5),          (IEN  | PTD | DIS | M4))\
+       MUX_VAL(CP(SYS_BOOT6),          (IEN  | PTD | DIS | M4))\
+       MUX_VAL(CP(SYS_BOOT7),          (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(SYS_BOOT8),          (IEN  | PTD | DIS | M4)) \
+       \
+       MUX_VAL(CP(SYS_OFF_MODE),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_CLKOUT1),        (IEN  | PTD | DIS | M4))\
+       MUX_VAL(CP(SYS_CLKOUT2),        (IDIS | PTU | DIS | M4))\
+       /* JTAG */\
+       MUX_VAL(CP(JTAG_nTRST),         (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(JTAG_TCK),           (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(JTAG_TMS),           (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(JTAG_TDI),           (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(JTAG_EMU0),          (IEN | PTU | EN  | M4)) \
+       MUX_VAL(CP(JTAG_EMU1),          (IEN | PTU | EN  | M4))\
+       /* ETK (ES2 onwards) */\
+       MUX_VAL(CP(ETK_CLK_ES2),        (IDIS  | PTD | DIS | M3)) \
+                                       /* hsusb1_stp */ \
+       MUX_VAL(CP(ETK_CTL_ES2),        (IDIS  | PTD | DIS | M3)) \
+                                       /* hsusb1_clk */\
+       MUX_VAL(CP(ETK_D0_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D1_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D2_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D3_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D4_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D5_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D6_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D7_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D8_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D9_ES2),         (IEN  | PTD | EN | M3)) \
+       MUX_VAL(CP(ETK_D10_ES2),        (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D11_ES2),        (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D12_ES2),        (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D13_ES2),        (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D14_ES2),        (IEN  | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D15_ES2),        (IEN  | PTD | DIS | M4)) \
+       /* Die to Die */\
+       MUX_VAL(CP(D2D_MCAD34),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_MCAD35),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_MCAD36),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_CLK26MI),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_NRESPWRON),      (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_NRESWARM),       (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_ARM9NIRQ),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_UMA2P6FIQ),      (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SPINT),          (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_FRINT),          (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ0),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ1),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ2),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ3),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTRST),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTDI),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTDO),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTMS),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTCK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GRTCK),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MSTDBY),         (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_SWAKEUP),        (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_IDLEREQ),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_IDLEACK),        (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_MWRITE),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SWRITE),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MREAD),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SREAD),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MBUSFLAG),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SBUSFLAG),       (IEN  | PTD | DIS | M0)) \
+
+#endif
index ca33aaec534935bc2357652816a8532a73210055..9e9940c51f0bbd584780ec8376fec13481680045 100644 (file)
@@ -416,13 +416,13 @@ const ulong REPEAT_PATTERN  = 1000;
 
 void bootcount_store(ulong a)
 {
-       volatile ulong *save_addr;
-       volatile ulong size = 0;
+       ulong *save_addr;
+       ulong size = 0;
        int i;
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+
+       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
                size += gd->bd->bi_dram[i].size;
-       }
-       save_addr = (ulong*)(size - BOOTCOUNT_ADDR);
+       save_addr = (ulong *)(size - BOOTCOUNT_ADDR);
        writel(a, save_addr);
        writel(BOOTCOUNT_MAGIC, &save_addr[1]);
 
@@ -434,15 +434,14 @@ void bootcount_store(ulong a)
 
 ulong bootcount_load(void)
 {
-       volatile ulong *save_addr;
-       volatile ulong size = 0;
+       ulong *save_addr;
+       ulong size = 0;
        ulong counter = 0;
        int i, tmp;
 
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
                size += gd->bd->bi_dram[i].size;
-       }
-       save_addr = (ulong*)(size - BOOTCOUNT_ADDR);
+       save_addr = (ulong *)(size - BOOTCOUNT_ADDR);
 
        counter = readl(&save_addr[0]);
 
@@ -492,13 +491,13 @@ int post_hotkeys_pressed(void)
 
 ulong post_word_load(void)
 {
-       volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+       void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
        return in_le32(addr);
 
 }
 void post_word_store(ulong value)
 {
-       volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+       void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
        out_le32(addr, value);
 }
 
index 4f5fa8d25f4dae07c45eae5c8b437c196a527d1a..bc7ec68f141f994b4a52663b86585f38e7cfa7e1 100644 (file)
@@ -200,6 +200,19 @@ void set_muxconf_regs(void)
        MUX_VAL(CP(GPMC_A3),            (IDIS | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_A4),            (IDIS | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_A5),            (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_A6),            (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_A7),            (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_A8),            (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_A9),            (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_A10),           (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D0),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D1),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D2),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D3),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D4),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D5),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D6),            (IEN  | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_D7),            (IEN  | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_D8),            (IEN  | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_D9),            (IEN  | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_D10),           (IEN  | PTU | EN  | M0));
@@ -209,6 +222,8 @@ void set_muxconf_regs(void)
        MUX_VAL(CP(GPMC_D14),           (IEN  | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_D15),           (IEN  | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_NCS1),          (IDIS | PTU | EN  | M0));
+       MUX_VAL(CP(GPMC_NCS2),          (IDIS | PTU | EN  | M0));
        MUX_VAL(CP(GPMC_NCS3),          (IDIS | PTD | DIS | M0));
        MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTU | DIS | M4));
        MUX_VAL(CP(GPMC_NCS7),          (IDIS | PTD | DIS | M1)); /*GPMC_IO_DIR*/
index d5e147d269450af7307cf19f9c6540af767ea871..8f8e7bf3fe54310151d3e24468f0bc3dc483e193 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra2.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/mmc.h>
 #include <asm/gpio.h>
@@ -46,27 +48,14 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-       /* SDMMC4: config 3, x8 on 2nd set of pins */
-       pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-       pinmux_tristate_disable(PINGRP_ATB);
-       pinmux_tristate_disable(PINGRP_GMA);
-       pinmux_tristate_disable(PINGRP_GME);
+       funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+       funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
 
        /* For power GPIO PI6 */
        pinmux_tristate_disable(PINGRP_ATA);
        /* For CD GPIO PH2 */
        pinmux_tristate_disable(PINGRP_ATD);
 
-       /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
-       pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
-       pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
-
-       pinmux_tristate_disable(PINGRP_DTA);
-       pinmux_tristate_disable(PINGRP_DTD);
-
        /* For power GPIO PT3 */
        pinmux_tristate_disable(PINGRP_DTB);
        /* For CD GPIO PI5 */
index 56acd6156f9818dc4ff5b05b920fb6dd3ca19a88..9ab6825bb8fed3f5978c09ae9fd7a22231372944 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra2.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/mmc.h>
 #include <asm/gpio.h>
@@ -59,23 +61,8 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-       /* SDMMC4: config 3, x8 on 2nd set of pins */
-       pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-       pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-       pinmux_tristate_disable(PINGRP_ATB);
-       pinmux_tristate_disable(PINGRP_GMA);
-       pinmux_tristate_disable(PINGRP_GME);
-
-       /* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
-       pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
-       pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
-       pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
-
-       pinmux_tristate_disable(PINGRP_SDC);
-       pinmux_tristate_disable(PINGRP_SDD);
-       pinmux_tristate_disable(PINGRP_SDB);
+       funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+       funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_4BIT);
 
        /* For power GPIO PI6 */
        pinmux_tristate_disable(PINGRP_ATA);
diff --git a/board/omicron/calimain/Makefile b/board/omicron/calimain/Makefile
new file mode 100644 (file)
index 0000000..cd1f0d4
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+#
+# 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
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS   := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#########################################################################
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/omicron/calimain/calimain.c b/board/omicron/calimain/calimain.c
new file mode 100644 (file)
index 0000000..97ba74a
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2011 OMICRON electronics GmbH
+ *
+ * Based on da850evm.c. Original Copyrights follow:
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. <nick.thompson@gefanuc.com>
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <net.h>
+#include <netdev.h>
+#include <watchdog.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/emif_defs.h>
+#include <asm/arch/emac_defs.h>
+#include <asm/arch/pinmux_defs.h>
+#include <asm/arch/davinci_misc.h>
+#include <asm/arch/timer_defs.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define CALIMAIN_HWVERSION_MASK    0x7f000000
+#define CALIMAIN_HWVERSION_SHIFT   24
+
+/* Hardware version pinmux settings */
+const struct pinmux_config hwversion_pins[] = {
+       { pinmux(16), 8, 2 }, /* GP7[15] */
+       { pinmux(16), 8, 3 }, /* GP7[14] */
+       { pinmux(16), 8, 4 }, /* GP7[13] */
+       { pinmux(16), 8, 5 }, /* GP7[12] */
+       { pinmux(16), 8, 6 }, /* GP7[11] */
+       { pinmux(16), 8, 7 }, /* GP7[10] */
+       { pinmux(17), 8, 0 }, /* GP7[9] */
+       { pinmux(17), 8, 1 }  /* GP7[8] */
+};
+
+const struct pinmux_resource pinmuxes[] = {
+       PINMUX_ITEM(uart2_pins_txrx),
+       PINMUX_ITEM(emac_pins_mii),
+       PINMUX_ITEM(emac_pins_mdio),
+       PINMUX_ITEM(emifa_pins_nor),
+       PINMUX_ITEM(emifa_pins_cs2),
+       PINMUX_ITEM(emifa_pins_cs3),
+};
+
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
+const struct lpsc_resource lpsc[] = {
+       { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
+       { DAVINCI_LPSC_EMAC },  /* image download */
+       { DAVINCI_LPSC_UART2 }, /* console */
+       { DAVINCI_LPSC_GPIO },
+};
+
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
+/* read board revision from GPIO7[8..14] */
+u32 get_board_rev(void)
+{
+       lpsc_on(DAVINCI_LPSC_GPIO);
+       if (davinci_configure_pin_mux(hwversion_pins,
+                                     ARRAY_SIZE(hwversion_pins)) != 0)
+               return 0xffffffff;
+
+       return (davinci_gpio_bank67->in_data & CALIMAIN_HWVERSION_MASK)
+               >> CALIMAIN_HWVERSION_SHIFT;
+}
+
+/*
+ * determine the oscillator frequency depending on the board revision
+ *
+ * rev 0x00  ... 25 MHz oscillator
+ * rev 0x01  ... 24 MHz oscillator
+ */
+int calimain_get_osc_freq(void)
+{
+       u32 rev;
+       int freq;
+
+       rev = get_board_rev();
+       switch (rev) {
+       case 0x00:
+               freq = 25000000;
+               break;
+       default:
+               freq = 24000000;
+               break;
+       }
+       return freq;
+}
+
+int board_init(void)
+{
+       int val;
+
+#ifndef CONFIG_USE_IRQ
+       irq_init();
+#endif
+
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
+
+#ifdef CONFIG_DRIVER_TI_EMAC
+       /* select emac MII mode */
+       val = readl(&davinci_syscfg_regs->cfgchip3);
+       val &= ~(1 << 8);
+       writel(val, &davinci_syscfg_regs->cfgchip3);
+#endif /* CONFIG_DRIVER_TI_EMAC */
+
+#ifdef CONFIG_HW_WATCHDOG
+       davinci_hw_watchdog_enable();
+#endif
+
+       printf("Input clock frequency: %d Hz\n", calimain_get_osc_freq());
+       printf("Board revision:        %d\n", get_board_rev());
+
+       return 0;
+}
+
+#ifdef CONFIG_DRIVER_TI_EMAC
+/*
+ * Initializes on-board ethernet controllers.
+ */
+int board_eth_init(bd_t *bis)
+{
+       if (!davinci_emac_initialize()) {
+               printf("Error: Ethernet init failed!\n");
+               return -1;
+       }
+
+       return 0;
+}
+#endif /* CONFIG_DRIVER_TI_EMAC */
+
+#ifdef CONFIG_HW_WATCHDOG
+void hw_watchdog_reset(void)
+{
+       davinci_hw_watchdog_reset();
+}
+#endif
+
+#if defined(CONFIG_BOOTCOUNT_LIMIT)
+void bootcount_store(ulong a)
+{
+       struct davinci_rtc *reg =
+               (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
+
+       /*
+        * write RTC kick register to enable write
+        * for RTC Scratch registers. Cratch0 and 1 are
+        * used for bootcount values.
+        */
+       writel(RTC_KICK0R_WE, &reg->kick0r);
+       writel(RTC_KICK1R_WE, &reg->kick1r);
+       writel(a, &reg->scratch0);
+       writel(BOOTCOUNT_MAGIC, &reg->scratch1);
+}
+
+ulong bootcount_load(void)
+{
+       struct davinci_rtc *reg =
+               (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
+
+       if (readl(&reg->scratch1) != BOOTCOUNT_MAGIC)
+               return 0;
+       else
+               return readl(&reg->scratch0);
+}
+#endif
diff --git a/board/pr1/Makefile b/board/pr1/Makefile
new file mode 100644 (file)
index 0000000..6ae998f
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) Switchfin Org. <dpn@switchfin.org>
+#
+# Copyright (c) 2005-2007 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        := $(BOARD).o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/pr1/config.mk b/board/pr1/config.mk
new file mode 100644 (file)
index 0000000..fac20c5
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# Copyright (c) Switchfin Org. <dpn@switchfin.org>
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2001
+# 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
+#
+
+CFLAGS_lib += -O2
+CFLAGS_lib/lzma += -O2
+CFLAGS_lib/zlib += -O2
diff --git a/board/pr1/pr1.c b/board/pr1/pr1.c
new file mode 100644 (file)
index 0000000..bb907f3
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * U-boot - main board file
+ *
+ * Copyright (c) Switchfin Org. <dpn@switchfin.org>
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <net.h>
+#include <netdev.h>
+
+int checkboard(void)
+{
+       printf("Board: Switchvoice PR1 Appliance\n");
+       printf("       Support: http://www.switchvoice.com/\n");
+       return 0;
+}
+
+#ifdef CONFIG_BFIN_MAC
+int board_eth_init(bd_t *bis)
+{
+       return bfin_EMAC_initialize(bis);
+}
+#endif
index 0eebbfc24487e349e22a035aa8fe9b3ff6adf914..928320120160a63fc1e18e7cdf0888ad000a1e48 100644 (file)
@@ -158,6 +158,11 @@ system_clock_init:
        ldr     r2, =CLK_SRC_PERIL0_OFFSET
        str     r1, [r0, r2]
 
+       /* FIMD0 */
+       ldr     r1, =CLK_SRC_LCD0_VAL
+       ldr     r2, =CLK_SRC_LCD0_OFFSET
+       str     r1, [r0, r2]
+
        /* wait ?us */
        mov     r1, #0x10000
 3:     subs    r1, r1, #1
index d949ad27b848220b341f3c39430eaf7a189e967f..94cccca52c1b0e855f8fe08ea9d14e77b4f14b33 100644 (file)
@@ -56,6 +56,8 @@
 #define CLK_SRC_PERIL0_OFFSET  0xC250
 #define CLK_DIV_PERIL0_OFFSET  0xC550
 
+#define CLK_SRC_LCD0_OFFSET    0xC234
+
 #define APLL_LOCK_OFFSET       0x14000
 #define MPLL_LOCK_OFFSET       0x14008
 #define APLL_CON0_OFFSET       0x14100
                                | (UART1_RATIO << 4) \
                                | (UART0_RATIO << 0))
 
+/* CLK_SRC_LCD0 */
+#define FIMD_SEL_SCLKMPLL      6
+#define MDNIE0_SEL_XUSBXTI     1
+#define MDNIE_PWM0_SEL_XUSBXTI 1
+#define MIPI0_SEL_XUSBXTI      1
+#define CLK_SRC_LCD0_VAL       ((MIPI0_SEL_XUSBXTI << 12) \
+                               | (MDNIE_PWM0_SEL_XUSBXTI << 8) \
+                               | (MDNIE0_SEL_XUSBXTI << 4) \
+                               | (FIMD_SEL_SCLKMPLL << 0))
+
 /* Required period to generate a stable clock output */
 /* PLL_LOCK_TIME */
 #define PLL_LOCKTIME           0x1C20
diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
new file mode 100644 (file)
index 0000000..226db1f
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2012 Samsung Electronics
+#
+# 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
+
+LIB    = $(obj)lib$(BOARD).o
+
+SOBJS  := lowlevel_init.o
+
+COBJS  := clock_init.o
+COBJS  += dmc_init.o
+COBJS  += tzpc_init.o
+
+ifndef CONFIG_SPL_BUILD
+COBJS  += smdk5250.o
+endif
+
+ifdef CONFIG_SPL_BUILD
+COBJS  += mmc_boot.o
+endif
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+ALL    :=       $(obj).depend $(LIB)
+
+all:   $(ALL)
+
+$(LIB):        $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/samsung/smdk5250/clock_init.c b/board/samsung/smdk5250/clock_init.c
new file mode 100644 (file)
index 0000000..305842d
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * Clock setup for SMDK5250 board based on EXYNOS5
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 <config.h>
+#include <version.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/gpio.h>
+#include "setup.h"
+
+void system_clock_init()
+{
+       struct exynos5_clock *clk = (struct exynos5_clock *)EXYNOS5_CLOCK_BASE;
+
+       /*
+        * MUX_APLL_SEL[0]: FINPLL = 0
+        * MUX_CPU_SEL[6]: MOUTAPLL = 0
+        * MUX_HPM_SEL[20]: MOUTAPLL = 0
+        */
+       writel(0x0, &clk->src_cpu);
+
+       /* MUX_MPLL_SEL[8]: FINPLL = 0 */
+       writel(0x0, &clk->src_core1);
+
+       /*
+        * VPLLSRC_SEL[0]: FINPLL = 0
+        * MUX_{CPLL[8]}|{EPLL[12]}|{VPLL[16]}_SEL: FINPLL = 0
+        */
+       writel(0x0, &clk->src_top2);
+
+       /* MUX_BPLL_SEL[0]: FINPLL = 0 */
+       writel(0x0, &clk->src_cdrex);
+
+       /* MUX_ACLK_* Clock Selection */
+       writel(CLK_SRC_TOP0_VAL, &clk->src_top0);
+
+       /* MUX_ACLK_* Clock Selection */
+       writel(CLK_SRC_TOP1_VAL, &clk->src_top1);
+
+       /* MUX_ACLK_* Clock Selection */
+       writel(CLK_SRC_TOP3_VAL, &clk->src_top3);
+
+       /* MUX_PWI_SEL[19:16]: SCLKMPLL = 6 */
+       writel(CLK_SRC_CORE0_VAL, &clk->src_core0);
+
+       /* MUX_ATCLK_LEX[0]: ACLK_200 = 0 */
+       writel(CLK_SRC_LEX_VAL, &clk->src_lex);
+
+       /* UART [0-5]: SCLKMPLL = 6 */
+       writel(CLK_SRC_PERIC0_VAL, &clk->src_peric0);
+
+       /* Set Clock Ratios */
+       writel(CLK_DIV_CPU0_VAL, &clk->div_cpu0);
+
+       /* Set COPY and HPM Ratio */
+       writel(CLK_DIV_CPU1_VAL, &clk->div_cpu1);
+
+       /* CORED_RATIO, COREP_RATIO */
+       writel(CLK_DIV_CORE0_VAL, &clk->div_core0);
+
+       /* PWI_RATIO[11:8], DVSEM_RATIO[22:16], DPM_RATIO[24:20] */
+       writel(CLK_DIV_CORE1_VAL, &clk->div_core1);
+
+       /* ACLK_*_RATIO */
+       writel(CLK_DIV_TOP0_VAL, &clk->div_top0);
+
+       /* ACLK_*_RATIO */
+       writel(CLK_DIV_TOP1_VAL, &clk->div_top1);
+
+       /* CDREX Ratio */
+       writel(CLK_DIV_CDREX_INIT_VAL, &clk->div_cdrex);
+
+       /* MCLK_EFPHY_RATIO[3:0] */
+       writel(CLK_DIV_CDREX2_VAL, &clk->div_cdrex2);
+
+       /* {PCLK[4:6]|ATCLK[10:8]}_RATIO */
+       writel(CLK_DIV_LEX_VAL, &clk->div_lex);
+
+       /* PCLK_R0X_RATIO[3:0] */
+       writel(CLK_DIV_R0X_VAL, &clk->div_r0x);
+
+       /* PCLK_R1X_RATIO[3:0] */
+       writel(CLK_DIV_R1X_VAL, &clk->div_r1x);
+
+       /* SATA[24]: SCLKMPLL=0, MMC[0-4]: SCLKMPLL = 6 */
+       writel(CLK_SRC_FSYS_VAL, &clk->src_fsys);
+
+       /* UART[0-4] */
+       writel(CLK_DIV_PERIC0_VAL, &clk->div_peric0);
+
+       /* PWM_RATIO[3:0] */
+       writel(CLK_DIV_PERIC3_VAL, &clk->div_peric3);
+
+       /* SATA_RATIO, USB_DRD_RATIO */
+       writel(CLK_DIV_FSYS0_VAL, &clk->div_fsys0);
+
+       /* MMC[0-1] */
+       writel(CLK_DIV_FSYS1_VAL, &clk->div_fsys1);
+
+       /* MMC[2-3] */
+       writel(CLK_DIV_FSYS2_VAL, &clk->div_fsys2);
+
+       /* MMC[4] */
+       writel(CLK_DIV_FSYS3_VAL, &clk->div_fsys3);
+
+       /* ACLK|PLCK_ACP_RATIO */
+       writel(CLK_DIV_ACP_VAL, &clk->div_acp);
+
+       /* ISPDIV0_RATIO, ISPDIV1_RATIO */
+       writel(CLK_DIV_ISP0_VAL, &clk->div_isp0);
+
+       /* MCUISPDIV0_RATIO, MCUISPDIV1_RATIO */
+       writel(CLK_DIV_ISP1_VAL, &clk->div_isp1);
+
+       /* MPWMDIV_RATIO */
+       writel(CLK_DIV_ISP2_VAL, &clk->div_isp2);
+
+       /* PLL locktime */
+       writel(APLL_LOCK_VAL, &clk->apll_lock);
+
+       writel(MPLL_LOCK_VAL, &clk->mpll_lock);
+
+       writel(BPLL_LOCK_VAL, &clk->bpll_lock);
+
+       writel(CPLL_LOCK_VAL, &clk->cpll_lock);
+
+       writel(EPLL_LOCK_VAL, &clk->epll_lock);
+
+       writel(VPLL_LOCK_VAL, &clk->vpll_lock);
+
+       sdelay(0x10000);
+
+       /* Set APLL */
+       writel(APLL_CON1_VAL, &clk->apll_con1);
+       writel(APLL_CON0_VAL, &clk->apll_con0);
+       sdelay(0x30000);
+
+       /* Set MPLL */
+       writel(MPLL_CON1_VAL, &clk->mpll_con1);
+       writel(MPLL_CON0_VAL, &clk->mpll_con0);
+       sdelay(0x30000);
+       writel(BPLL_CON1_VAL, &clk->bpll_con1);
+       writel(BPLL_CON0_VAL, &clk->bpll_con0);
+       sdelay(0x30000);
+
+       /* Set CPLL */
+       writel(CPLL_CON1_VAL, &clk->cpll_con1);
+       writel(CPLL_CON0_VAL, &clk->cpll_con0);
+       sdelay(0x30000);
+
+       /* Set EPLL */
+       writel(EPLL_CON2_VAL, &clk->epll_con2);
+       writel(EPLL_CON1_VAL, &clk->epll_con1);
+       writel(EPLL_CON0_VAL, &clk->epll_con0);
+       sdelay(0x30000);
+
+       /* Set VPLL */
+       writel(VPLL_CON2_VAL, &clk->vpll_con2);
+       writel(VPLL_CON1_VAL, &clk->vpll_con1);
+       writel(VPLL_CON0_VAL, &clk->vpll_con0);
+       sdelay(0x30000);
+
+       /* Set MPLL */
+       /* After Initiallising th PLL select the sources accordingly */
+       /* MUX_APLL_SEL[0]: MOUTAPLLFOUT = 1 */
+       writel(CLK_SRC_CPU_VAL, &clk->src_cpu);
+
+       /* MUX_MPLL_SEL[8]: MOUTMPLLFOUT = 1 */
+       writel(CLK_SRC_CORE1_VAL, &clk->src_core1);
+
+       /* MUX_BPLL_SEL[0]: FOUTBPLL = 1*/
+       writel(CLK_SRC_CDREX_INIT_VAL, &clk->src_cdrex);
+
+       /*
+        * VPLLSRC_SEL[0]: FINPLL = 0
+        * MUX_{CPLL[8]}|{EPLL[12]}|{VPLL[16]}_SEL: MOUT{CPLL|EPLL|VPLL} = 1
+        * MUX_{MPLL[20]}|{BPLL[24]}_USER_SEL: FOUT{MPLL|BPLL} = 1
+        */
+       writel(CLK_SRC_TOP2_VAL, &clk->src_top2);
+}
diff --git a/board/samsung/smdk5250/dmc_init.c b/board/samsung/smdk5250/dmc_init.c
new file mode 100644 (file)
index 0000000..7881074
--- /dev/null
@@ -0,0 +1,462 @@
+/*
+ * Memory setup for SMDK5250 board based on EXYNOS5
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 <config.h>
+#include <asm/io.h>
+#include <asm/arch/dmc.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cpu.h>
+#include "setup.h"
+
+/* APLL : 1GHz */
+/* MCLK_CDREX: MCLK_CDREX_533*/
+/* LPDDR support: LPDDR2 */
+static void reset_phy_ctrl(void);
+static void config_zq(struct exynos5_phy_control *,
+                       struct exynos5_phy_control *);
+static void update_reset_dll(struct exynos5_dmc *);
+static void config_cdrex(void);
+static void config_mrs(struct exynos5_dmc *);
+static void sec_sdram_phy_init(struct exynos5_dmc *);
+static void config_prech(struct exynos5_dmc *);
+static void config_rdlvl(struct exynos5_dmc *,
+                       struct exynos5_phy_control *,
+                       struct exynos5_phy_control *);
+static void config_memory(struct exynos5_dmc *);
+
+static void config_offsets(unsigned int,
+                               struct exynos5_phy_control *,
+                               struct exynos5_phy_control *);
+
+static void reset_phy_ctrl(void)
+{
+       struct exynos5_clock *clk = (struct exynos5_clock *)EXYNOS5_CLOCK_BASE;
+
+       writel(PHY_RESET_VAL, &clk->lpddr3phy_ctrl);
+       sdelay(0x10000);
+}
+
+static void config_zq(struct exynos5_phy_control *phy0_ctrl,
+                       struct exynos5_phy_control *phy1_ctrl)
+{
+       unsigned long val = 0;
+       /*
+        * ZQ Calibration:
+        * Select Driver Strength,
+        * long calibration for manual calibration
+        */
+       val = PHY_CON16_RESET_VAL;
+       SET_ZQ_MODE_DDS_VAL(val);
+       SET_ZQ_MODE_TERM_VAL(val);
+       val |= ZQ_CLK_DIV_EN;
+       writel(val, &phy0_ctrl->phy_con16);
+       writel(val, &phy1_ctrl->phy_con16);
+
+       /* Disable termination */
+       val |= ZQ_MODE_NOTERM;
+       writel(val, &phy0_ctrl->phy_con16);
+       writel(val, &phy1_ctrl->phy_con16);
+
+       /* ZQ_MANUAL_START: Enable */
+       val |= ZQ_MANUAL_STR;
+       writel(val, &phy0_ctrl->phy_con16);
+       writel(val, &phy1_ctrl->phy_con16);
+       sdelay(0x10000);
+
+       /* ZQ_MANUAL_START: Disable */
+       val &= ~ZQ_MANUAL_STR;
+       writel(val, &phy0_ctrl->phy_con16);
+       writel(val, &phy1_ctrl->phy_con16);
+}
+
+static void update_reset_dll(struct exynos5_dmc *dmc)
+{
+       unsigned long val;
+       /*
+        * Update DLL Information:
+        * Force DLL Resyncronization
+        */
+       val = readl(&dmc->phycontrol0);
+       val |= FP_RSYNC;
+       writel(val, &dmc->phycontrol0);
+
+       /* Reset Force DLL Resyncronization */
+       val = readl(&dmc->phycontrol0);
+       val &= ~FP_RSYNC;
+       writel(val, &dmc->phycontrol0);
+}
+
+static void config_mrs(struct exynos5_dmc *dmc)
+{
+       unsigned long channel, chip, mask = 0, val;
+
+       for (channel = 0; channel < CONFIG_DMC_CHANNELS; channel++) {
+               SET_CMD_CHANNEL(mask, channel);
+               for (chip = 0; chip < CONFIG_CHIPS_PER_CHANNEL; chip++) {
+                       /*
+                        * NOP CMD:
+                        * Assert and hold CKE to logic high level
+                        */
+                       SET_CMD_CHIP(mask, chip);
+                       val = DIRECT_CMD_NOP | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+
+                       /* EMRS, MRS Cmds(Mode Reg Settings) Using Direct Cmd */
+                       val = DIRECT_CMD_MRS1 | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+
+                       val = DIRECT_CMD_MRS2 | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+
+                       /* MCLK_CDREX_533 */
+                       val = DIRECT_CMD_MRS3 | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+
+                       val = DIRECT_CMD_MRS4 | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+               }
+       }
+}
+
+static void config_prech(struct exynos5_dmc *dmc)
+{
+       unsigned long channel, chip, mask = 0, val;
+
+       for (channel = 0; channel < CONFIG_DMC_CHANNELS; channel++) {
+               SET_CMD_CHANNEL(mask, channel);
+               for (chip = 0; chip < CONFIG_CHIPS_PER_CHANNEL; chip++) {
+                       SET_CMD_CHIP(mask, chip);
+                       /* PALL (all banks precharge) CMD */
+                       val = DIRECT_CMD_PALL | mask;
+                       writel(val, &dmc->directcmd);
+                       sdelay(0x10000);
+               }
+       }
+}
+
+static void sec_sdram_phy_init(struct exynos5_dmc *dmc)
+{
+       unsigned long val;
+       val = readl(&dmc->concontrol);
+       val |= DFI_INIT_START;
+       writel(val, &dmc->concontrol);
+       sdelay(0x10000);
+
+       val = readl(&dmc->concontrol);
+       val &= ~DFI_INIT_START;
+       writel(val, &dmc->concontrol);
+}
+
+static void config_offsets(unsigned int state,
+                               struct exynos5_phy_control *phy0_ctrl,
+                               struct exynos5_phy_control *phy1_ctrl)
+{
+       unsigned long val;
+       /* Set Offsets to read DQS */
+       val = (state == SET) ? SET_DQS_OFFSET_VAL : RESET_DQS_OFFSET_VAL;
+       writel(val, &phy0_ctrl->phy_con4);
+       writel(val, &phy1_ctrl->phy_con4);
+
+       /* Set Offsets to read DQ */
+       val = (state == SET) ? SET_DQ_OFFSET_VAL : RESET_DQ_OFFSET_VAL;
+       writel(val, &phy0_ctrl->phy_con6);
+       writel(val, &phy1_ctrl->phy_con6);
+
+       /* Debug Offset */
+       val = (state == SET) ? SET_DEBUG_OFFSET_VAL : RESET_DEBUG_OFFSET_VAL;
+       writel(val, &phy0_ctrl->phy_con10);
+       writel(val, &phy1_ctrl->phy_con10);
+}
+
+static void config_cdrex(void)
+{
+       struct exynos5_clock *clk = (struct exynos5_clock *)EXYNOS5_CLOCK_BASE;
+       writel(CLK_DIV_CDREX_VAL, &clk->div_cdrex);
+       writel(CLK_SRC_CDREX_VAL, &clk->src_cdrex);
+       sdelay(0x30000);
+}
+
+static void config_ctrl_dll_on(unsigned int state,
+                       unsigned int ctrl_force_val,
+                       struct exynos5_phy_control *phy0_ctrl,
+                       struct exynos5_phy_control *phy1_ctrl)
+{
+       unsigned long val;
+       val = readl(&phy0_ctrl->phy_con12);
+       CONFIG_CTRL_DLL_ON(val, state);
+       SET_CTRL_FORCE_VAL(val, ctrl_force_val);
+       writel(val, &phy0_ctrl->phy_con12);
+
+       val = readl(&phy1_ctrl->phy_con12);
+       CONFIG_CTRL_DLL_ON(val, state);
+       SET_CTRL_FORCE_VAL(val, ctrl_force_val);
+       writel(val, &phy1_ctrl->phy_con12);
+}
+
+static void config_ctrl_start(unsigned int state,
+                       struct exynos5_phy_control *phy0_ctrl,
+                       struct exynos5_phy_control *phy1_ctrl)
+{
+       unsigned long val;
+       val = readl(&phy0_ctrl->phy_con12);
+       CONFIG_CTRL_START(val, state);
+       writel(val, &phy0_ctrl->phy_con12);
+
+       val = readl(&phy1_ctrl->phy_con12);
+       CONFIG_CTRL_START(val, state);
+       writel(val, &phy1_ctrl->phy_con12);
+}
+
+#if defined(CONFIG_RD_LVL)
+static void config_rdlvl(struct exynos5_dmc *dmc,
+                       struct exynos5_phy_control *phy0_ctrl,
+                       struct exynos5_phy_control *phy1_ctrl)
+{
+       unsigned long val;
+
+       /* Disable CTRL_DLL_ON and set ctrl_force */
+       config_ctrl_dll_on(RESET, 0x2D, phy0_ctrl, phy1_ctrl);
+
+       /*
+        * Set ctrl_gateadj, ctrl_readadj
+        * ctrl_gateduradj, rdlvl_pass_adj
+        * rdlvl_rddataPadj
+        */
+       val = SET_RDLVL_RDDATAPADJ;
+       writel(val, &phy0_ctrl->phy_con1);
+       writel(val, &phy1_ctrl->phy_con1);
+
+       /* LPDDR2 Address */
+       writel(LPDDR2_ADDR, &phy0_ctrl->phy_con22);
+       writel(LPDDR2_ADDR, &phy1_ctrl->phy_con22);
+
+       /* Enable Byte Read Leveling set ctrl_ddr_mode */
+       val = readl(&phy0_ctrl->phy_con0);
+       val |= BYTE_RDLVL_EN;
+       writel(val, &phy0_ctrl->phy_con0);
+       val = readl(&phy1_ctrl->phy_con0);
+       val |= BYTE_RDLVL_EN;
+       writel(val, &phy1_ctrl->phy_con0);
+
+       /* rdlvl_en: Use levelling offset instead ctrl_shiftc */
+       val = PHY_CON2_RESET_VAL | RDLVL_EN;
+       writel(val, &phy0_ctrl->phy_con2);
+       writel(val, &phy1_ctrl->phy_con2);
+       sdelay(0x10000);
+
+       /* Enable Data Eye Training */
+       val = readl(&dmc->rdlvl_config);
+       val |= CTRL_RDLVL_DATA_EN;
+       writel(val, &dmc->rdlvl_config);
+       sdelay(0x10000);
+
+       /* Disable Data Eye Training */
+       val = readl(&dmc->rdlvl_config);
+       val &= ~CTRL_RDLVL_DATA_EN;
+       writel(val, &dmc->rdlvl_config);
+
+       /* RdDeSkew_clear: Clear */
+       val = readl(&phy0_ctrl->phy_con2);
+       val |= RDDSKEW_CLEAR;
+       writel(val, &phy0_ctrl->phy_con2);
+       val = readl(&phy1_ctrl->phy_con2);
+       val |= RDDSKEW_CLEAR;
+       writel(val, &phy1_ctrl->phy_con2);
+
+       /* Enable CTRL_DLL_ON */
+       config_ctrl_dll_on(SET, 0x0, phy0_ctrl, phy1_ctrl);
+
+       update_reset_dll(dmc);
+       sdelay(0x10000);
+
+       /* ctrl_atgte: ctrl_gate_p*, ctrl_read_p* generated by PHY */
+       val = readl(&phy0_ctrl->phy_con0);
+       val &= ~CTRL_ATGATE;
+       writel(val, &phy0_ctrl->phy_con0);
+       val = readl(&phy1_ctrl->phy_con0);
+       val &= ~CTRL_ATGATE;
+       writel(val, &phy1_ctrl->phy_con0);
+}
+#endif
+
+static void config_memory(struct exynos5_dmc *dmc)
+{
+       /*
+        * Memory Configuration Chip 0
+        * Address Mapping: Interleaved
+        * Number of Column address Bits: 10 bits
+        * Number of Rows Address Bits: 14
+        * Number of Banks: 8
+        */
+       writel(DMC_MEMCONFIG0_VAL, &dmc->memconfig0);
+
+       /*
+        * Memory Configuration Chip 1
+        * Address Mapping: Interleaved
+        * Number of Column address Bits: 10 bits
+        * Number of Rows Address Bits: 14
+        * Number of Banks: 8
+        */
+       writel(DMC_MEMCONFIG1_VAL, &dmc->memconfig1);
+
+       /*
+        * Chip0: AXI
+        * AXI Base Address: 0x40000000
+        * AXI Base Address Mask: 0x780
+        */
+       writel(DMC_MEMBASECONFIG0_VAL, &dmc->membaseconfig0);
+
+       /*
+        * Chip1: AXI
+        * AXI Base Address: 0x80000000
+        * AXI Base Address Mask: 0x780
+        */
+       writel(DMC_MEMBASECONFIG1_VAL, &dmc->membaseconfig1);
+}
+
+void mem_ctrl_init()
+{
+       struct exynos5_phy_control *phy0_ctrl, *phy1_ctrl;
+       struct exynos5_dmc *dmc;
+       unsigned long val;
+
+       phy0_ctrl = (struct exynos5_phy_control *)EXYNOS5_DMC_PHY0_BASE;
+       phy1_ctrl = (struct exynos5_phy_control *)EXYNOS5_DMC_PHY1_BASE;
+       dmc = (struct exynos5_dmc *)EXYNOS5_DMC_CTRL_BASE;
+
+       /* Reset PHY Controllor: PHY_RESET[0] */
+       reset_phy_ctrl();
+
+       /*set Read Latancy and Burst Length for PHY0 and PHY1 */
+       writel(PHY_CON42_VAL, &phy0_ctrl->phy_con42);
+       writel(PHY_CON42_VAL, &phy1_ctrl->phy_con42);
+
+       /* ZQ Cofiguration */
+       config_zq(phy0_ctrl, phy1_ctrl);
+
+       /* Operation Mode : LPDDR2 */
+       val = PHY_CON0_RESET_VAL;
+       SET_CTRL_DDR_MODE(val, DDR_MODE_LPDDR2);
+       writel(val, &phy0_ctrl->phy_con0);
+       writel(val, &phy1_ctrl->phy_con0);
+
+       /* DQS, DQ: Signal, for LPDDR2: Always Set */
+       val = CTRL_PULLD_DQ | CTRL_PULLD_DQS;
+       writel(val, &phy0_ctrl->phy_con14);
+       writel(val, &phy1_ctrl->phy_con14);
+
+       /* Init SEC SDRAM PHY */
+       sec_sdram_phy_init(dmc);
+       sdelay(0x10000);
+
+       update_reset_dll(dmc);
+
+       /*
+        * Dynamic Clock: Always Running
+        * Memory Burst length: 4
+        * Number of chips: 2
+        * Memory Bus width: 32 bit
+        * Memory Type: LPDDR2-S4
+        * Additional Latancy for PLL: 1 Cycle
+        */
+       writel(DMC_MEMCONTROL_VAL, &dmc->memcontrol);
+
+       config_memory(dmc);
+
+       /* Precharge Configuration */
+       writel(DMC_PRECHCONFIG_VAL, &dmc->prechconfig);
+
+       /* Power Down mode Configuration */
+       writel(DMC_PWRDNCONFIG_VAL, &dmc->pwrdnconfig);
+
+       /* Periodic Refrese Interval */
+       writel(DMC_TIMINGREF_VAL, &dmc->timingref);
+
+       /*
+        * TimingRow, TimingData, TimingPower Setting:
+        * Values as per Memory AC Parameters
+        */
+       writel(DMC_TIMINGROW_VAL, &dmc->timingrow);
+
+       writel(DMC_TIMINGDATA_VAL, &dmc->timingdata);
+
+       writel(DMC_TIMINGPOWER_VAL, &dmc->timingpower);
+
+       /* Memory Channel Inteleaving Size: 128 Bytes */
+       writel(CONFIG_IV_SIZE, &dmc->ivcontrol);
+
+       /* Set DQS, DQ and DEBUG offsets */
+       config_offsets(SET, phy0_ctrl, phy1_ctrl);
+
+       /* Disable CTRL_DLL_ON and set ctrl_force */
+       config_ctrl_dll_on(RESET, 0x7F, phy0_ctrl, phy1_ctrl);
+       sdelay(0x10000);
+
+       update_reset_dll(dmc);
+
+       /* Config MRS(Mode Register Settingg) */
+       config_mrs(dmc);
+
+       config_cdrex();
+
+       /* Reset DQS DQ and DEBUG offsets */
+       config_offsets(RESET, phy0_ctrl, phy1_ctrl);
+
+       /* Enable CTRL_DLL_ON */
+       config_ctrl_dll_on(SET, 0x0, phy0_ctrl, phy1_ctrl);
+
+       /* Stop DLL Locking */
+       config_ctrl_start(RESET, phy0_ctrl, phy1_ctrl);
+       sdelay(0x10000);
+
+       /* Start DLL Locking */
+       config_ctrl_start(SET, phy0_ctrl, phy1_ctrl);
+       sdelay(0x10000);
+
+       update_reset_dll(dmc);
+
+#if defined(CONFIG_RD_LVL)
+       config_rdlvl(dmc, phy0_ctrl, phy1_ctrl);
+#endif
+       config_prech(dmc);
+
+       /*
+        * Dynamic Clock: Stops During Idle Period
+        * Dynamic Power Down: Enable
+        * Dynamic Self refresh: Enable
+        */
+       val = readl(&dmc->memcontrol);
+       val |= CLK_STOP_EN | DPWRDN_EN | DSREF_EN;
+       writel(val, &dmc->memcontrol);
+
+       /* Start Auto refresh */
+       val = readl(&dmc->concontrol);
+       val |= AREF_EN;
+       writel(val, &dmc->concontrol);
+}
diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S
new file mode 100644 (file)
index 0000000..bc6cb6f
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Lowlevel setup for SMDK5250 board based on S5PC520
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 <config.h>
+#include <version.h>
+#include <asm/arch/cpu.h>
+
+_TEXT_BASE:
+       .word   CONFIG_SYS_TEXT_BASE
+
+       .globl lowlevel_init
+lowlevel_init:
+
+       /* use iRAM stack in bl2 */
+       ldr     sp, =CONFIG_IRAM_STACK
+       stmdb   r13!, {ip,lr}
+
+       /* check reset status */
+       ldr     r0, =(EXYNOS5_POWER_BASE + INFORM1_OFFSET)
+       ldr     r1, [r0]
+
+       /* AFTR wakeup reset */
+       ldr     r2, =S5P_CHECK_DIDLE
+       cmp     r1, r2
+       beq     exit_wakeup
+
+       /* LPA wakeup reset */
+       ldr     r2, =S5P_CHECK_LPA
+       cmp     r1, r2
+       beq     exit_wakeup
+
+       /* Sleep wakeup reset */
+       ldr     r2, =S5P_CHECK_SLEEP
+       cmp     r1, r2
+       beq     wakeup_reset
+
+       /*
+        * If U-boot is already running in RAM, no need to relocate U-Boot.
+        * Memory controller must be configured before relocating U-Boot
+        * in ram.
+        */
+       ldr     r0, =0x0ffffff          /* r0 <- Mask Bits*/
+       bic     r1, pc, r0              /* pc <- current addr of code */
+                                       /* r1 <- unmasked bits of pc */
+       ldr     r2, _TEXT_BASE          /* r2 <- original base addr in ram */
+       bic     r2, r2, r0              /* r2 <- unmasked bits of r2*/
+       cmp     r1, r2                  /* compare r1, r2 */
+       beq     1f                      /* r0 == r1 then skip sdram init */
+
+       /* init system clock */
+       bl      system_clock_init
+
+       /* Memory initialize */
+       bl      mem_ctrl_init
+
+1:
+       bl      tzpc_init
+       ldmia   r13!, {ip,pc}
+
+wakeup_reset:
+       bl      system_clock_init
+       bl      mem_ctrl_init
+       bl      tzpc_init
+
+exit_wakeup:
+       /* Load return address and jump to kernel */
+       ldr     r0, =(EXYNOS5_POWER_BASE + INFORM0_OFFSET)
+
+       /* r1 = physical address of exynos5_cpu_resume function*/
+       ldr     r1, [r0]
+
+       /* Jump to kernel */
+       mov     pc, r1
+       nop
+       nop
diff --git a/board/samsung/smdk5250/mmc_boot.c b/board/samsung/smdk5250/mmc_boot.c
new file mode 100644 (file)
index 0000000..449a919
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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<config.h>
+
+/*
+* Copy U-boot from mmc to RAM:
+* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
+* Pointer to API (Data transfer from mmc to ram)
+*/
+void copy_uboot_to_ram(void)
+{
+       u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+
+       copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+}
+
+void board_init_f(unsigned long bootflag)
+{
+       __attribute__((noreturn)) void (*uboot)(void);
+       copy_uboot_to_ram();
+
+       /* Jump to U-Boot image */
+       uboot = (void *)CONFIG_SYS_TEXT_BASE;
+       (*uboot)();
+       /* Never returns Here */
+}
+
+/* Place Holders */
+void board_init_r(gd_t *id, ulong dest_addr)
+{
+       /* Function attribute is no-return */
+       /* This Function never executes */
+       while (1)
+               ;
+}
+
+void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
diff --git a/board/samsung/smdk5250/setup.h b/board/samsung/smdk5250/setup.h
new file mode 100644 (file)
index 0000000..1276fd3
--- /dev/null
@@ -0,0 +1,451 @@
+/*
+ * Machine Specific Values for SMDK5250 board based on S5PC520
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 _SMDK5250_SETUP_H
+#define _SMDK5250_SETUP_H
+
+#include <config.h>
+#include <version.h>
+#include <asm/arch/cpu.h>
+
+/* GPIO Offsets for UART: GPIO Contol Register */
+#define EXYNOS5_GPIO_A0_CON_OFFSET     0x0
+#define EXYNOS5_GPIO_A1_CON_OFFSET     0x20
+
+/* TZPC : Register Offsets */
+#define TZPC0_BASE             0x10100000
+#define TZPC1_BASE             0x10110000
+#define TZPC2_BASE             0x10120000
+#define TZPC3_BASE             0x10130000
+#define TZPC4_BASE             0x10140000
+#define TZPC5_BASE             0x10150000
+#define TZPC6_BASE             0x10160000
+#define TZPC7_BASE             0x10170000
+#define TZPC8_BASE             0x10180000
+#define TZPC9_BASE             0x10190000
+
+/* CLK_SRC_CPU */
+/* 0 = MOUTAPLL, 1 = SCLKMPLL */
+#define MUX_HPM_SEL            0
+#define MUX_CPU_SEL            0
+#define MUX_APLL_SEL           1
+#define CLK_SRC_CPU_VAL                ((MUX_HPM_SEL << 20) \
+                               | (MUX_CPU_SEL << 16) \
+                               | (MUX_APLL_SEL))
+
+/* CLK_DIV_CPU0 */
+#define ARM2_RATIO             0x0
+#define APLL_RATIO             0x1
+#define PCLK_DBG_RATIO         0x1
+#define ATB_RATIO              0x4
+#define PERIPH_RATIO           0x7
+#define ACP_RATIO              0x7
+#define CPUD_RATIO             0x2
+#define ARM_RATIO              0x0
+#define CLK_DIV_CPU0_VAL       ((ARM2_RATIO << 28) \
+                               | (APLL_RATIO << 24) \
+                               | (PCLK_DBG_RATIO << 20) \
+                               | (ATB_RATIO << 16) \
+                               | (PERIPH_RATIO << 12) \
+                               | (ACP_RATIO << 8) \
+                               | (CPUD_RATIO << 4) \
+                               | (ARM_RATIO))
+
+/* CLK_DIV_CPU1 */
+#define HPM_RATIO              0x4
+#define COPY_RATIO             0x0
+#define CLK_DIV_CPU1_VAL       ((HPM_RATIO << 4) \
+                               | (COPY_RATIO))
+
+#define APLL_MDIV              0x7D
+#define APLL_PDIV              0x3
+#define APLL_SDIV              0x0
+
+#define MPLL_MDIV              0x64
+#define MPLL_PDIV              0x3
+#define MPLL_SDIV              0x0
+
+#define CPLL_MDIV              0x96
+#define CPLL_PDIV              0x4
+#define CPLL_SDIV              0x0
+
+/* APLL_CON1 */
+#define APLL_CON1_VAL  (0x00203800)
+
+/* MPLL_CON1 */
+#define MPLL_CON1_VAL  (0x00203800)
+
+/* CPLL_CON1 */
+#define CPLL_CON1_VAL  (0x00203800)
+
+#define EPLL_MDIV      0x60
+#define EPLL_PDIV      0x3
+#define EPLL_SDIV      0x3
+
+#define EPLL_CON1_VAL  0x00000000
+#define EPLL_CON2_VAL  0x00000080
+
+#define VPLL_MDIV      0x96
+#define VPLL_PDIV      0x3
+#define VPLL_SDIV      0x2
+
+#define VPLL_CON1_VAL  0x00000000
+#define VPLL_CON2_VAL  0x00000080
+
+#define BPLL_MDIV      0x215
+#define BPLL_PDIV      0xC
+#define BPLL_SDIV      0x1
+
+#define BPLL_CON1_VAL  0x00203800
+
+/* Set PLL */
+#define set_pll(mdiv, pdiv, sdiv)      (1<<31 | mdiv<<16 | pdiv<<8 | sdiv)
+
+#define APLL_CON0_VAL  set_pll(APLL_MDIV, APLL_PDIV, APLL_SDIV)
+#define MPLL_CON0_VAL  set_pll(MPLL_MDIV, MPLL_PDIV, MPLL_SDIV)
+#define CPLL_CON0_VAL  set_pll(CPLL_MDIV, CPLL_PDIV, CPLL_SDIV)
+#define EPLL_CON0_VAL  set_pll(EPLL_MDIV, EPLL_PDIV, EPLL_SDIV)
+#define VPLL_CON0_VAL  set_pll(VPLL_MDIV, VPLL_PDIV, VPLL_SDIV)
+#define BPLL_CON0_VAL  set_pll(BPLL_MDIV, BPLL_PDIV, BPLL_SDIV)
+
+/* CLK_SRC_CORE0 */
+#define CLK_SRC_CORE0_VAL      0x00060000
+
+/* CLK_SRC_CORE1 */
+#define CLK_SRC_CORE1_VAL      0x100
+
+/* CLK_DIV_CORE0 */
+#define CLK_DIV_CORE0_VAL      0x120000
+
+/* CLK_DIV_CORE1 */
+#define CLK_DIV_CORE1_VAL      0x07070700
+
+/* CLK_SRC_CDREX */
+#define CLK_SRC_CDREX_INIT_VAL 0x1
+#define CLK_SRC_CDREX_VAL      0x111
+
+/* CLK_DIV_CDREX */
+#define CLK_DIV_CDREX_INIT_VAL 0x71771111
+
+#define MCLK_CDREX2_RATIO      0x0
+#define ACLK_EFCON_RATIO       0x1
+#define MCLK_DPHY_RATIO                0x0
+#define MCLK_CDREX_RATIO       0x0
+#define ACLK_C2C_200_RATIO     0x1
+#define C2C_CLK_400_RATIO      0x1
+#define PCLK_CDREX_RATIO       0x3
+#define ACLK_CDREX_RATIO       0x1
+#define CLK_DIV_CDREX_VAL      ((MCLK_DPHY_RATIO << 20) \
+                               | (MCLK_CDREX_RATIO << 16) \
+                               | (ACLK_C2C_200_RATIO << 12) \
+                               | (C2C_CLK_400_RATIO << 8) \
+                               | (PCLK_CDREX_RATIO << 4) \
+                               | (ACLK_CDREX_RATIO))
+
+#define MCLK_EFPHY_RATIO       0x4
+#define CLK_DIV_CDREX2_VAL     MCLK_EFPHY_RATIO
+
+/* CLK_DIV_ACP */
+#define CLK_DIV_ACP_VAL        0x12
+
+/* CLK_SRC_TOP0 */
+#define MUX_ACLK_300_GSCL_SEL          0x1
+#define MUX_ACLK_300_GSCL_MID_SEL      0x0
+#define MUX_ACLK_400_SEL               0x0
+#define MUX_ACLK_333_SEL               0x0
+#define MUX_ACLK_300_DISP1_SEL         0x1
+#define MUX_ACLK_300_DISP1_MID_SEL     0x0
+#define MUX_ACLK_200_SEL               0x0
+#define MUX_ACLK_166_SEL               0x0
+#define CLK_SRC_TOP0_VAL       ((MUX_ACLK_300_GSCL_SEL << 25) \
+                               | (MUX_ACLK_300_GSCL_MID_SEL << 24) \
+                               | (MUX_ACLK_400_SEL << 20) \
+                               | (MUX_ACLK_333_SEL << 16) \
+                               | (MUX_ACLK_300_DISP1_SEL << 15) \
+                               | (MUX_ACLK_300_DISP1_MID_SEL << 14)    \
+                               | (MUX_ACLK_200_SEL << 12) \
+                               | (MUX_ACLK_166_SEL << 8))
+
+/* CLK_SRC_TOP1 */
+#define MUX_ACLK_400_ISP_SEL           0x0
+#define MUX_ACLK_400_IOP_SEL           0x0
+#define MUX_ACLK_MIPI_HSI_TXBASE_SEL   0x0
+#define CLK_SRC_TOP1_VAL               ((MUX_ACLK_400_ISP_SEL << 24) \
+                                       |(MUX_ACLK_400_IOP_SEL << 20) \
+                                       |(MUX_ACLK_MIPI_HSI_TXBASE_SEL << 16))
+
+/* CLK_SRC_TOP2 */
+#define MUX_BPLL_USER_SEL      0x1
+#define MUX_MPLL_USER_SEL      0x1
+#define MUX_VPLL_SEL           0x0
+#define MUX_EPLL_SEL           0x0
+#define MUX_CPLL_SEL           0x0
+#define VPLLSRC_SEL            0x0
+#define CLK_SRC_TOP2_VAL       ((MUX_BPLL_USER_SEL << 24) \
+                               | (MUX_MPLL_USER_SEL << 20) \
+                               | (MUX_VPLL_SEL << 16) \
+                               | (MUX_EPLL_SEL << 12) \
+                               | (MUX_CPLL_SEL << 8) \
+                               | (VPLLSRC_SEL))
+/* CLK_SRC_TOP3 */
+#define MUX_ACLK_333_SUB_SEL           0x1
+#define MUX_ACLK_400_SUB_SEL           0x1
+#define MUX_ACLK_266_ISP_SUB_SEL       0x1
+#define MUX_ACLK_266_GPS_SUB_SEL       0x1
+#define MUX_ACLK_300_GSCL_SUB_SEL      0x1
+#define MUX_ACLK_266_GSCL_SUB_SEL      0x1
+#define MUX_ACLK_300_DISP1_SUB_SEL     0x1
+#define MUX_ACLK_200_DISP1_SUB_SEL     0x1
+#define CLK_SRC_TOP3_VAL               ((MUX_ACLK_333_SUB_SEL << 24) \
+                                       | (MUX_ACLK_400_SUB_SEL << 20) \
+                                       | (MUX_ACLK_266_ISP_SUB_SEL << 16) \
+                                       | (MUX_ACLK_266_GPS_SUB_SEL << 12) \
+                                       | (MUX_ACLK_300_GSCL_SUB_SEL << 10) \
+                                       | (MUX_ACLK_266_GSCL_SUB_SEL << 8) \
+                                       | (MUX_ACLK_300_DISP1_SUB_SEL << 6) \
+                                       | (MUX_ACLK_200_DISP1_SUB_SEL << 4))
+
+/* CLK_DIV_TOP0 */
+#define ACLK_300_RATIO         0x0
+#define ACLK_400_RATIO         0x3
+#define ACLK_333_RATIO         0x2
+#define ACLK_266_RATIO         0x2
+#define ACLK_200_RATIO         0x3
+#define ACLK_166_RATIO         0x5
+#define ACLK_133_RATIO         0x1
+#define ACLK_66_RATIO          0x5
+#define CLK_DIV_TOP0_VAL       ((ACLK_300_RATIO << 28) \
+                               | (ACLK_400_RATIO << 24) \
+                               | (ACLK_333_RATIO << 20) \
+                               | (ACLK_266_RATIO << 16) \
+                               | (ACLK_200_RATIO << 12) \
+                               | (ACLK_166_RATIO << 8) \
+                               | (ACLK_133_RATIO << 4) \
+                               | (ACLK_66_RATIO))
+
+/* CLK_DIV_TOP1 */
+#define ACLK_MIPI_HSI_TX_BASE_RATIO    0x3
+#define ACLK_66_PRE_RATIO      0x1
+#define ACLK_400_ISP_RATIO     0x1
+#define ACLK_400_IOP_RATIO     0x1
+#define ACLK_300_GSCL_RATIO    0x0
+#define ACLK_266_GPS_RATIO     0x7
+
+#define CLK_DIV_TOP1_VAL       ((ACLK_MIPI_HSI_TX_BASE_RATIO << 28) \
+                               | (ACLK_66_PRE_RATIO << 24) \
+                               | (ACLK_400_ISP_RATIO << 20) \
+                               | (ACLK_400_IOP_RATIO << 16) \
+                               | (ACLK_300_GSCL_RATIO << 12) \
+                               | (ACLK_266_GPS_RATIO << 8))
+
+/* APLL_LOCK */
+#define APLL_LOCK_VAL          (0x3E8)
+/* MPLL_LOCK */
+#define MPLL_LOCK_VAL          (0x2F1)
+/* CPLL_LOCK */
+#define CPLL_LOCK_VAL          (0x3E8)
+/* EPLL_LOCK */
+#define EPLL_LOCK_VAL          (0x2321)
+/* VPLL_LOCK */
+#define VPLL_LOCK_VAL          (0x2321)
+/* BPLL_LOCK */
+#define BPLL_LOCK_VAL          (0x3E8)
+
+/* CLK_SRC_PERIC0 */
+/* SRC_CLOCK = SCLK_MPLL */
+#define PWM_SEL                        0
+#define UART4_SEL              6
+#define UART3_SEL              6
+#define UART2_SEL              6
+#define UART1_SEL              6
+#define UART0_SEL              6
+#define CLK_SRC_PERIC0_VAL     ((PWM_SEL << 24) \
+                               | (UART4_SEL << 16) \
+                               | (UART3_SEL << 12) \
+                               | (UART2_SEL << 8) \
+                               | (UART1_SEL << 4) \
+                               | (UART0_SEL << 0))
+
+#define CLK_SRC_FSYS_VAL       0x66666
+#define CLK_DIV_FSYS0_VAL      0x0BB00000
+#define CLK_DIV_FSYS1_VAL      0x000f000f
+#define CLK_DIV_FSYS2_VAL      0x020f020f
+#define CLK_DIV_FSYS3_VAL      0x000f
+
+/* CLK_DIV_PERIC0 */
+#define UART5_RATIO            8
+#define UART4_RATIO            8
+#define UART3_RATIO            8
+#define UART2_RATIO            8
+#define UART1_RATIO            8
+#define UART0_RATIO            8
+#define CLK_DIV_PERIC0_VAL     ((UART4_RATIO << 16) \
+                               | (UART3_RATIO << 12) \
+                               | (UART2_RATIO << 8) \
+                               | (UART1_RATIO << 4) \
+                               | (UART0_RATIO << 0))
+
+/* CLK_DIV_PERIC3 */
+#define PWM_RATIO              8
+#define CLK_DIV_PERIC3_VAL     (PWM_RATIO << 0)
+
+/* CLK_SRC_LEX */
+#define CLK_SRC_LEX_VAL                0x0
+
+/* CLK_DIV_LEX */
+#define CLK_DIV_LEX_VAL                0x10
+
+/* CLK_DIV_R0X */
+#define CLK_DIV_R0X_VAL                0x10
+
+/* CLK_DIV_L0X */
+#define CLK_DIV_R1X_VAL                0x10
+
+/* SCLK_SRC_ISP */
+#define SCLK_SRC_ISP_VAL       0x600
+/* CLK_DIV_ISP0 */
+#define CLK_DIV_ISP0_VAL       0x31
+
+/* CLK_DIV_ISP1 */
+#define CLK_DIV_ISP1_VAL       0x0
+
+/* CLK_DIV_ISP2 */
+#define CLK_DIV_ISP2_VAL       0x1
+
+#define MPLL_DEC       (MPLL_MDIV * MPLL_MDIV / (MPLL_PDIV * 2^(MPLL_SDIV-1)))
+
+/*
+ * TZPC Register Value :
+ * R0SIZE: 0x0 : Size of secured ram
+ */
+#define R0SIZE                 0x0
+
+/*
+ * TZPC Decode Protection Register Value :
+ * DECPROTXSET: 0xFF : Set Decode region to non-secure
+ */
+#define DECPROTXSET            0xFF
+
+/* DMC Init */
+#define SET                    1
+#define RESET                  0
+/* (Memory Interleaving Size = 1 << IV_SIZE) */
+#define CONFIG_IV_SIZE         0x07
+
+#define PHY_RESET_VAL  (0 << 0)
+
+/*ZQ Configurations */
+#define PHY_CON16_RESET_VAL    0x08000304
+
+#define ZQ_MODE_DDS_VAL                (0x5 << 24)
+#define ZQ_MODE_TERM_VAL       (0x5 << 21)
+#define SET_ZQ_MODE_DDS_VAL(x) (x = (x & ~(0x7 << 24)) | ZQ_MODE_DDS_VAL)
+#define SET_ZQ_MODE_TERM_VAL(x)        (x = (x & ~(0x7 << 21)) | ZQ_MODE_TERM_VAL)
+
+#define ZQ_MODE_NOTERM         (1 << 19)
+#define ZQ_CLK_DIV_EN          (1 << 18)
+#define ZQ_MANUAL_STR          (1 << 1)
+
+/* Channel and Chip Selection */
+#define CONFIG_DMC_CHANNELS            2
+#define CONFIG_CHIPS_PER_CHANNEL       2
+
+#define SET_CMD_CHANNEL(x, y)  (x = (x & ~(1 << 28)) | y << 28)
+#define SET_CMD_CHIP(x, y)     (x = (x & ~(1 << 20)) | y << 20)
+
+/* Diret Command */
+#define        DIRECT_CMD_NOP          0x07000000
+#define DIRECT_CMD_MRS1                0x00071C00
+#define DIRECT_CMD_MRS2                0x00010BFC
+#define DIRECT_CMD_MRS3                0x00000708
+#define DIRECT_CMD_MRS4                0x00000818
+#define        DIRECT_CMD_PALL         0x01000000
+
+/* DLL Resync */
+#define FP_RSYNC               (1 << 3)
+
+#define CONFIG_CTRL_DLL_ON(x, y)       (x = (x & ~(1 << 5)) | y << 5)
+#define CONFIG_CTRL_START(x, y)                (x = (x & ~(1 << 6)) | y << 6)
+#define SET_CTRL_FORCE_VAL(x, y)       (x = (x & ~(0x7F << 8)) | y << 8)
+
+/* RDLVL */
+#define PHY_CON0_RESET_VAL     0x17023240
+#define DDR_MODE_LPDDR2                0x2
+#define BYTE_RDLVL_EN          (1 << 13)
+#define CTRL_ATGATE            (1 << 6)
+#define SET_CTRL_DDR_MODE(x, y)        (x = (x & ~(0x3 << 11)) | y << 11)
+
+#define PHY_CON1_RESET_VAL     0x9210100
+#define RDLVL_RDDATAPADJ       0x1
+#define SET_RDLVL_RDDATAPADJ   ((PHY_CON1_RESET_VAL & ~(0xFFFF << 0))\
+                                       | RDLVL_RDDATAPADJ << 0)
+
+#define PHY_CON2_RESET_VAL     0x00010004
+#define RDLVL_EN               (1 << 25)
+#define RDDSKEW_CLEAR          (1 << 13)
+
+#define CTRL_RDLVL_DATA_EN     (1 << 1)
+#define LPDDR2_ADDR            0x00000208
+
+#define DMC_MEMCONFIG0_VAL     0x00001323
+#define DMC_MEMCONFIG1_VAL     0x00001323
+#define DMC_MEMBASECONFIG0_VAL 0x00400780
+#define DMC_MEMBASECONFIG1_VAL 0x00800780
+#define DMC_MEMCONTROL_VAL     0x00212500
+#define DMC_PRECHCONFIG_VAL            0xFF000000
+#define DMC_PWRDNCONFIG_VAL            0xFFFF00FF
+#define DMC_TIMINGREF_VAL              0x0000005D
+#define DMC_TIMINGROW_VAL              0x2336544C
+#define DMC_TIMINGDATA_VAL             0x24202408
+#define DMC_TIMINGPOWER_VAL            0x38260235
+
+#define CTRL_BSTLEN            0x04
+#define CTRL_RDLAT             0x08
+#define PHY_CON42_VAL          (CTRL_BSTLEN << 8 | CTRL_RDLAT << 0)
+
+/* DQS, DQ, DEBUG offsets */
+#define        SET_DQS_OFFSET_VAL      0x7F7F7F7F
+#define        SET_DQ_OFFSET_VAL       0x7F7F7F7F
+#define        SET_DEBUG_OFFSET_VAL    0x7F
+
+#define        RESET_DQS_OFFSET_VAL    0x08080808
+#define        RESET_DQ_OFFSET_VAL     0x08080808
+#define        RESET_DEBUG_OFFSET_VAL  0x8
+
+#define CTRL_PULLD_DQ          (0x0F << 8)
+#define CTRL_PULLD_DQS         (0x0F << 0)
+
+#define DFI_INIT_START         (1 << 28)
+
+#define CLK_STOP_EN    (1 << 0)
+#define DPWRDN_EN      (1 << 1)
+#define DSREF_EN       (1 << 5)
+
+#define AREF_EN                        (1 << 5)
+void sdelay(unsigned long);
+void mem_ctrl_init(void);
+void system_clock_init(void);
+void tzpc_init(void);
+
+#endif
diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
new file mode 100644 (file)
index 0000000..928c08f
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 <netdev.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/sromc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+struct exynos5_gpio_part1 *gpio1;
+
+#ifdef CONFIG_SMC911X
+static void smc9115_pre_init(void)
+{
+       u32 smc_bw_conf, smc_bc_conf;
+       int i;
+
+       /*
+        * SROM:CS1 and EBI
+        *
+        * GPY0[0]      SROM_CSn[0]
+        * GPY0[1]      SROM_CSn[1](2)
+        * GPY0[2]      SROM_CSn[2]
+        * GPY0[3]      SROM_CSn[3]
+        * GPY0[4]      EBI_OEn(2)
+        * GPY0[5]      EBI_EEn(2)
+        *
+        * GPY1[0]      EBI_BEn[0](2)
+        * GPY1[1]      EBI_BEn[1](2)
+        * GPY1[2]      SROM_WAIT(2)
+        * GPY1[3]      EBI_DATA_RDn(2)
+        */
+       s5p_gpio_cfg_pin(&gpio1->y0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
+       s5p_gpio_cfg_pin(&gpio1->y0, 4, GPIO_FUNC(2));
+       s5p_gpio_cfg_pin(&gpio1->y0, 5, GPIO_FUNC(2));
+
+       for (i = 0; i < 4; i++)
+               s5p_gpio_cfg_pin(&gpio1->y1, i, GPIO_FUNC(2));
+
+       /*
+        * EBI: 8 Addrss Lines
+        *
+        * GPY3[0]      EBI_ADDR[0](2)
+        * GPY3[1]      EBI_ADDR[1](2)
+        * GPY3[2]      EBI_ADDR[2](2)
+        * GPY3[3]      EBI_ADDR[3](2)
+        * GPY3[4]      EBI_ADDR[4](2)
+        * GPY3[5]      EBI_ADDR[5](2)
+        * GPY3[6]      EBI_ADDR[6](2)
+        * GPY3[7]      EBI_ADDR[7](2)
+        *
+        * EBI: 16 Data Lines
+        *
+        * GPY5[0]      EBI_DATA[0](2)
+        * GPY5[1]      EBI_DATA[1](2)
+        * GPY5[2]      EBI_DATA[2](2)
+        * GPY5[3]      EBI_DATA[3](2)
+        * GPY5[4]      EBI_DATA[4](2)
+        * GPY5[5]      EBI_DATA[5](2)
+        * GPY5[6]      EBI_DATA[6](2)
+        * GPY5[7]      EBI_DATA[7](2)
+        *
+        * GPY6[0]      EBI_DATA[8](2)
+        * GPY6[1]      EBI_DATA[9](2)
+        * GPY6[2]      EBI_DATA[10](2)
+        * GPY6[3]      EBI_DATA[11](2)
+        * GPY6[4]      EBI_DATA[12](2)
+        * GPY6[5]      EBI_DATA[13](2)
+        * GPY6[6]      EBI_DATA[14](2)
+        * GPY6[7]      EBI_DATA[15](2)
+        */
+       for (i = 0; i < 8; i++) {
+               s5p_gpio_cfg_pin(&gpio1->y3, i, GPIO_FUNC(2));
+               s5p_gpio_set_pull(&gpio1->y3, i, GPIO_PULL_UP);
+
+               s5p_gpio_cfg_pin(&gpio1->y5, i, GPIO_FUNC(2));
+               s5p_gpio_set_pull(&gpio1->y5, i, GPIO_PULL_UP);
+
+               s5p_gpio_cfg_pin(&gpio1->y6, i, GPIO_FUNC(2));
+               s5p_gpio_set_pull(&gpio1->y6, i, GPIO_PULL_UP);
+       }
+
+       /* Ethernet needs data bus width of 16 bits */
+       smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
+                       | SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);
+
+       smc_bc_conf = SROMC_BC_TACS(0x01) | SROMC_BC_TCOS(0x01)
+                       | SROMC_BC_TACC(0x06) | SROMC_BC_TCOH(0x01)
+                       | SROMC_BC_TAH(0x0C)  | SROMC_BC_TACP(0x09)
+                       | SROMC_BC_PMC(0x01);
+
+       /* Select and configure the SROMC bank */
+       s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
+}
+#endif
+
+int board_init(void)
+{
+       gpio1 = (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+       gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size    = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_5, PHYS_SDRAM_7_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_6, PHYS_SDRAM_7_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_7, PHYS_SDRAM_7_SIZE)
+                       + get_ram_size((long *)PHYS_SDRAM_8, PHYS_SDRAM_8_SIZE);
+       return 0;
+}
+
+void dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
+                                                       PHYS_SDRAM_1_SIZE);
+       gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+       gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2,
+                                                       PHYS_SDRAM_2_SIZE);
+       gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
+       gd->bd->bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3,
+                                                       PHYS_SDRAM_3_SIZE);
+       gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
+       gd->bd->bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4,
+                                                       PHYS_SDRAM_4_SIZE);
+       gd->bd->bi_dram[4].start = PHYS_SDRAM_5;
+       gd->bd->bi_dram[4].size = get_ram_size((long *)PHYS_SDRAM_5,
+                                                       PHYS_SDRAM_5_SIZE);
+       gd->bd->bi_dram[5].start = PHYS_SDRAM_6;
+       gd->bd->bi_dram[5].size = get_ram_size((long *)PHYS_SDRAM_6,
+                                                       PHYS_SDRAM_6_SIZE);
+       gd->bd->bi_dram[6].start = PHYS_SDRAM_7;
+       gd->bd->bi_dram[6].size = get_ram_size((long *)PHYS_SDRAM_7,
+                                                       PHYS_SDRAM_7_SIZE);
+       gd->bd->bi_dram[7].start = PHYS_SDRAM_8;
+       gd->bd->bi_dram[7].size = get_ram_size((long *)PHYS_SDRAM_8,
+                                                       PHYS_SDRAM_8_SIZE);
+}
+
+int board_eth_init(bd_t *bis)
+{
+#ifdef CONFIG_SMC911X
+       smc9115_pre_init();
+       return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+       return 0;
+}
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+       printf("\nBoard: SMDK5250\n");
+
+       return 0;
+}
+#endif
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+       int i, err;
+
+       /*
+        * MMC2 SD card GPIO:
+        *
+        * GPC2[0]      SD_2_CLK(2)
+        * GPC2[1]      SD_2_CMD(2)
+        * GPC2[2]      SD_2_CDn
+        * GPC2[3:6]    SD_2_DATA[0:3](2)
+        */
+       for (i = 0; i < 7; i++) {
+               /* GPC2[0:6] special function 2 */
+               s5p_gpio_cfg_pin(&gpio1->c2, i, GPIO_FUNC(0x2));
+
+               /* GPK2[0:6] drv 4x */
+               s5p_gpio_set_drv(&gpio1->c2, i, GPIO_DRV_4X);
+
+               /* GPK2[0:1] pull disable */
+               if (i == 0 || i == 1) {
+                       s5p_gpio_set_pull(&gpio1->c2, i, GPIO_PULL_NONE);
+                       continue;
+               }
+
+               /* GPK2[2:6] pull up */
+               s5p_gpio_set_pull(&gpio1->c2, i, GPIO_PULL_UP);
+       }
+
+       err = s5p_mmc_init(2, 4);
+       return err;
+}
+#endif
+
+static void board_uart_init(void)
+{
+       struct exynos5_gpio_part1 *gpio1 =
+               (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+       int i;
+
+       /* UART1 GPIOs (part1) : GPA0CON[7:4] 0x2222 */
+       for (i = 4; i < 8; i++) {
+               s5p_gpio_set_pull(&gpio1->a0, i, GPIO_PULL_NONE);
+               s5p_gpio_cfg_pin(&gpio1->a0, i, GPIO_FUNC(0x2));
+       }
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+       board_uart_init();
+       return 0;
+}
+#endif
diff --git a/board/samsung/smdk5250/tzpc_init.c b/board/samsung/smdk5250/tzpc_init.c
new file mode 100644 (file)
index 0000000..c2ccef3
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Lowlevel setup for SMDK5250 board based on S5PC520
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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/tzpc.h>
+#include"setup.h"
+
+/* Setting TZPC[TrustZone Protection Controller] */
+void tzpc_init(void)
+{
+       struct exynos5_tzpc *tzpc;
+       unsigned int addr;
+
+       for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
+               tzpc = (struct exynos5_tzpc *)addr;
+
+               if (addr == TZPC0_BASE)
+                       writel(R0SIZE, &tzpc->r0size);
+
+               writel(DECPROTXSET, &tzpc->decprot0set);
+               writel(DECPROTXSET, &tzpc->decprot1set);
+
+               if (addr != TZPC9_BASE) {
+                       writel(DECPROTXSET, &tzpc->decprot2set);
+                       writel(DECPROTXSET, &tzpc->decprot3set);
+               }
+       }
+}
diff --git a/board/samsung/trats/Makefile b/board/samsung/trats/Makefile
new file mode 100644 (file)
index 0000000..d21883f
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2011 Samsung Electronics
+# Heungjun Kim <riverful.kim@samsung.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
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS-y        += trats.o
+
+SRCS    := $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/samsung/trats/setup.h b/board/samsung/trats/setup.h
new file mode 100644 (file)
index 0000000..a479b5c
--- /dev/null
@@ -0,0 +1,637 @@
+/*
+ * Machine Specific Values for TRATS board based on EXYNOS4210
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.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 _TRATS_SETUP_H
+#define _TRATS_SETUP_H
+
+#include <config.h>
+#include <version.h>
+#include <asm/arch/cpu.h>
+
+/* CLK_SRC_CPU: APLL(1), MPLL(1), CORE(0), HPM(0) */
+#define MUX_HPM_SEL_MOUTAPLL           0x0
+#define MUX_HPM_SEL_SCLKMPLL           0x1
+#define MUX_CORE_SEL_MOUTAPLL          0x0
+#define MUX_CORE_SEL_SCLKMPLL          0x1
+#define MUX_MPLL_SEL_FILPLL            0x0
+#define MUX_MPLL_SEL_MOUTMPLLFOUT      0x1
+#define MUX_APLL_SEL_FILPLL            0x0
+#define MUX_APLL_SEL_MOUTMPLLFOUT      0x1
+#define CLK_SRC_CPU_VAL                        ((MUX_HPM_SEL_MOUTAPLL << 20) \
+                                       | (MUX_CORE_SEL_MOUTAPLL << 16) \
+                                       | (MUX_MPLL_SEL_MOUTMPLLFOUT << 8)\
+                                       | (MUX_APLL_SEL_MOUTMPLLFOUT << 0))
+
+/* CLK_DIV_CPU0 */
+#define APLL_RATIO                     0x0
+#define PCLK_DBG_RATIO                 0x1
+#define ATB_RATIO                      0x3
+#define PERIPH_RATIO                   0x3
+#define COREM1_RATIO                   0x7
+#define COREM0_RATIO                   0x3
+#define CORE_RATIO                     0x0
+#define CLK_DIV_CPU0_VAL               ((APLL_RATIO << 24) \
+                                       | (PCLK_DBG_RATIO << 20) \
+                                       | (ATB_RATIO << 16) \
+                                       | (PERIPH_RATIO << 12) \
+                                       | (COREM1_RATIO << 8) \
+                                       | (COREM0_RATIO << 4) \
+                                       | (CORE_RATIO << 0))
+
+/* CLK_DIV_CPU1 */
+#define HPM_RATIO                      0x0
+#define COPY_RATIO                     0x3
+#define CLK_DIV_CPU1_VAL               ((HPM_RATIO << 4) | (COPY_RATIO))
+
+/* CLK_DIV_DMC0 */
+#define CORE_TIMERS_RATIO              0x1
+#define COPY2_RATIO                    0x3
+#define DMCP_RATIO                     0x1
+#define DMCD_RATIO                     0x1
+#define DMC_RATIO                      0x1
+#define DPHY_RATIO                     0x1
+#define ACP_PCLK_RATIO                 0x1
+#define ACP_RATIO                      0x3
+#define CLK_DIV_DMC0_VAL               ((CORE_TIMERS_RATIO << 28) \
+                                       | (COPY2_RATIO << 24) \
+                                       | (DMCP_RATIO << 20) \
+                                       | (DMCD_RATIO << 16) \
+                                       | (DMC_RATIO << 12) \
+                                       | (DPHY_RATIO << 8) \
+                                       | (ACP_PCLK_RATIO << 4) \
+                                       | (ACP_RATIO << 0))
+
+/* CLK_DIV_DMC1 */
+#define DPM_RATIO                      0x1
+#define DVSEM_RATIO                    0x1
+#define PWI_RATIO                      0x1
+#define CLK_DIV_DMC1_VAL               ((DPM_RATIO << 24) \
+                                       | (DVSEM_RATIO << 16) \
+                                       | (PWI_RATIO << 8))
+
+/* CLK_SRC_TOP0 */
+#define MUX_ONENAND_SEL_ACLK_133       0x0
+#define MUX_ONENAND_SEL_ACLK_160       0x1
+#define MUX_ACLK_133_SEL_SCLKMPLL      0x0
+#define MUX_ACLK_133_SEL_SCLKAPLL      0x1
+#define MUX_ACLK_160_SEL_SCLKMPLL      0x0
+#define MUX_ACLK_160_SEL_SCLKAPLL      0x1
+#define MUX_ACLK_100_SEL_SCLKMPLL      0x0
+#define MUX_ACLK_100_SEL_SCLKAPLL      0x1
+#define MUX_ACLK_200_SEL_SCLKMPLL      0x0
+#define MUX_ACLK_200_SEL_SCLKAPLL      0x1
+#define MUX_VPLL_SEL_FINPLL            0x0
+#define MUX_VPLL_SEL_FOUTVPLL          0x1
+#define MUX_EPLL_SEL_FINPLL            0x0
+#define MUX_EPLL_SEL_FOUTEPLL          0x1
+#define MUX_ONENAND_1_SEL_MOUTONENAND  0x0
+#define MUX_ONENAND_1_SEL_SCLKVPLL     0x1
+#define CLK_SRC_TOP0_VAL               ((MUX_ONENAND_SEL_ACLK_160 << 28) \
+                                       | (MUX_ACLK_133_SEL_SCLKMPLL << 24) \
+                                       | (MUX_ACLK_160_SEL_SCLKMPLL << 20) \
+                                       | (MUX_ACLK_100_SEL_SCLKMPLL << 16) \
+                                       | (MUX_ACLK_200_SEL_SCLKMPLL << 12) \
+                                       | (MUX_VPLL_SEL_FOUTVPLL << 8) \
+                                       | (MUX_EPLL_SEL_FOUTEPLL << 4) \
+                                       | (MUX_ONENAND_1_SEL_MOUTONENAND << 0))
+
+/* CLK_DIV_TOP */
+#define ONENAND_RATIO                  0x0
+#define ACLK_133_RATIO                 0x5
+#define ACLK_160_RATIO                 0x4
+#define ACLK_100_RATIO                 0x7
+#define ACLK_200_RATIO                 0x3
+#define CLK_DIV_TOP_VAL                        ((ONENAND_RATIO << 16)  \
+                                       | (ACLK_133_RATIO << 12)\
+                                       | (ACLK_160_RATIO << 8) \
+                                       | (ACLK_100_RATIO << 4) \
+                                       | (ACLK_200_RATIO << 0))
+
+/* CLK_DIV_LEFTBUS */
+#define GPL_RATIO                      0x1
+#define GDL_RATIO                      0x3
+#define CLK_DIV_LEFTBUS_VAL            ((GPL_RATIO << 4) | (GDL_RATIO))
+
+/* CLK_DIV_RIGHTBUS */
+#define GPR_RATIO                      0x1
+#define GDR_RATIO                      0x3
+#define CLK_DIV_RIGHTBUS_VAL           ((GPR_RATIO << 4) | (GDR_RATIO))
+
+/* CLK_SRS_FSYS: 6 = SCLKMPLL */
+#define SATA_SEL_SCLKMPLL              0
+#define SATA_SEL_SCLKAPLL              1
+
+#define MMC_SEL_XXTI                   0
+#define MMC_SEL_XUSBXTI                        1
+#define MMC_SEL_SCLK_HDMI24M           2
+#define MMC_SEL_SCLK_USBPHY0           3
+#define MMC_SEL_SCLK_USBPHY1           4
+#define MMC_SEL_SCLK_HDMIPHY           5
+#define MMC_SEL_SCLKMPLL               6
+#define MMC_SEL_SCLKEPLL               7
+#define MMC_SEL_SCLKVPLL               8
+
+#define MMCC0_SEL                      MMC_SEL_SCLKMPLL
+#define MMCC1_SEL                      MMC_SEL_SCLKMPLL
+#define MMCC2_SEL                      MMC_SEL_SCLKMPLL
+#define MMCC3_SEL                      MMC_SEL_SCLKMPLL
+#define MMCC4_SEL                      MMC_SEL_SCLKMPLL
+#define CLK_SRC_FSYS_VAL               ((SATA_SEL_SCLKMPLL << 24) \
+                                       | (MMCC4_SEL << 16) \
+                                       | (MMCC3_SEL << 12) \
+                                       | (MMCC2_SEL << 8) \
+                                       | (MMCC1_SEL << 4) \
+                                       | (MMCC0_SEL << 0))
+
+/* SCLK_MMC[0-4] = MOUTMMC[0-4]/(MMC[0-4]_RATIO + 1)/(MMC[0-4]_PRE_RATIO +1) */
+/* CLK_DIV_FSYS1: 800(MPLL) / (15 + 1) */
+#define MMC0_RATIO                     0xF
+#define MMC0_PRE_RATIO                 0x0
+#define MMC1_RATIO                     0xF
+#define MMC1_PRE_RATIO                 0x0
+#define CLK_DIV_FSYS1_VAL              ((MMC1_PRE_RATIO << 24) \
+                                       | (MMC1_RATIO << 16) \
+                                       | (MMC0_PRE_RATIO << 8) \
+                                       | (MMC0_RATIO << 0))
+
+/* CLK_DIV_FSYS2: 800(MPLL) / (15 + 1) */
+#define MMC2_RATIO                     0xF
+#define MMC2_PRE_RATIO                 0x0
+#define MMC3_RATIO                     0xF
+#define MMC3_PRE_RATIO                 0x0
+#define CLK_DIV_FSYS2_VAL              ((MMC3_PRE_RATIO << 24) \
+                                       | (MMC3_RATIO << 16) \
+                                       | (MMC2_PRE_RATIO << 8) \
+                                       | (MMC2_RATIO << 0))
+
+/* CLK_DIV_FSYS3: 800(MPLL) / (15 + 1) */
+#define MMC4_RATIO                     0xF
+#define MMC4_PRE_RATIO                 0x0
+#define CLK_DIV_FSYS3_VAL              ((MMC4_PRE_RATIO << 8) \
+                                       | (MMC4_RATIO << 0))
+
+/* CLK_SRC_PERIL0 */
+#define UART_SEL_XXTI                  0
+#define UART_SEL_XUSBXTI               1
+#define UART_SEL_SCLK_HDMI24M          2
+#define UART_SEL_SCLK_USBPHY0          3
+#define UART_SEL_SCLK_USBPHY1          4
+#define UART_SEL_SCLK_HDMIPHY          5
+#define UART_SEL_SCLKMPLL              6
+#define UART_SEL_SCLKEPLL              7
+#define UART_SEL_SCLKVPLL              8
+
+#define UART0_SEL                      UART_SEL_SCLKMPLL
+#define UART1_SEL                      UART_SEL_SCLKMPLL
+#define UART2_SEL                      UART_SEL_SCLKMPLL
+#define UART3_SEL                      UART_SEL_SCLKMPLL
+#define UART4_SEL                      UART_SEL_SCLKMPLL
+#define UART5_SEL                      UART_SEL_SCLKMPLL
+#define CLK_SRC_PERIL0_VAL             ((UART5_SEL << 16) \
+                                       | (UART4_SEL << 12) \
+                                       | (UART3_SEL << 12) \
+                                       | (UART2_SEL << 8) \
+                                       | (UART1_SEL << 4) \
+                                       | (UART0_SEL << 0))
+
+/* SCLK_UART[0-4] = MOUTUART[0-4] / (UART[0-4]_RATIO + 1) */
+/* CLK_DIV_PERIL0 */
+#define UART0_RATIO                    7
+#define UART1_RATIO                    7
+#define UART2_RATIO                    7
+#define UART3_RATIO                    4
+#define UART4_RATIO                    7
+#define UART5_RATIO                    7
+#define CLK_DIV_PERIL0_VAL             ((UART5_RATIO << 16) \
+                                       | (UART4_RATIO << 12) \
+                                       | (UART3_RATIO << 12) \
+                                       | (UART2_RATIO << 8) \
+                                       | (UART1_RATIO << 4) \
+                                       | (UART0_RATIO << 0))
+
+/* CLK_DIV_PERIL3 */
+#define SLIMBUS_RATIO                  0x0
+#define PWM_RATIO                      0x8
+#define CLK_DIV_PERIL3_VAL             ((SLIMBUS_RATIO << 4) \
+                                       | (PWM_RATIO << 0))
+
+/* Required period to generate a stable clock output */
+/* PLL_LOCK_TIME */
+#define PLL_LOCKTIME                   0x1C20
+
+/* PLL Values */
+#define DISABLE                                0
+#define ENABLE                         1
+#define SET_PLL(mdiv, pdiv, sdiv)      ((ENABLE << 31)\
+                                       | (mdiv << 16) \
+                                       | (pdiv << 8) \
+                                       | (sdiv << 0))
+
+/* APLL_CON0: 800MHz */
+#define APLL_MDIV                      0xC8
+#define APLL_PDIV                      0x6
+#define APLL_SDIV                      0x1
+#define APLL_CON0_VAL                  SET_PLL(APLL_MDIV, APLL_PDIV, APLL_SDIV)
+
+/* APLL_CON1 */
+#define APLL_AFC_ENB                   0x1
+#define APLL_AFC                       0x1C
+#define APLL_CON1_VAL                  ((APLL_AFC_ENB << 31) | (APLL_AFC << 0))
+
+/* MPLL_CON0: 800MHz */
+#define MPLL_MDIV                      0xC8
+#define MPLL_PDIV                      0x6
+#define MPLL_SDIV                      0x1
+#define MPLL_CON0_VAL                  SET_PLL(MPLL_MDIV, MPLL_PDIV, MPLL_SDIV)
+
+/* MPLL_CON1 */
+#define MPLL_AFC_ENB                   0x1
+#define MPLL_AFC                       0x1C
+#define MPLL_CON1_VAL                  ((MPLL_AFC_ENB << 31) | (MPLL_AFC << 0))
+
+/* EPLL_CON0: 96MHz */
+#define EPLL_MDIV                      0x30
+#define EPLL_PDIV                      0x3
+#define EPLL_SDIV                      0x2
+#define EPLL_CON0_VAL                  SET_PLL(EPLL_MDIV, EPLL_PDIV, EPLL_SDIV)
+
+/* EPLL_CON1 */
+#define EPLL_K                         0x0
+#define EPLL_CON1_VAL                  (EPLL_K >> 0)
+
+/* VPLL_CON0: 108MHz */
+#define VPLL_MDIV                      0x35
+#define VPLL_PDIV                      0x3
+#define VPLL_SDIV                      0x2
+#define VPLL_CON0_VAL                  SET_PLL(VPLL_MDIV, VPLL_PDIV, VPLL_SDIV)
+
+/* VPLL_CON1 */
+#define VPLL_SSCG_EN                   DISABLE
+#define VPLL_SEL_PF_DN_SPREAD          0x0
+#define VPLL_MRR                       0x11
+#define VPLL_MFR                       0x0
+#define VPLL_K                         0x400
+#define VPLL_CON1_VAL                  ((VPLL_SSCG_EN << 31)\
+                                       | (VPLL_SEL_PF_DN_SPREAD << 29) \
+                                       | (VPLL_MRR << 24) \
+                                       | (VPLL_MFR << 16) \
+                                       | (VPLL_K << 0))
+
+/* CLOCK GATE */
+#define CLK_DIS                                0x0
+#define CLK_EN                         0x1
+
+#define BIT_CAM_CLK_PIXELASYNCM1       18
+#define BIT_CAM_CLK_PIXELASYNCM0       17
+#define BIT_CAM_CLK_PPMUCAMIF          16
+#define BIT_CAM_CLK_QEFIMC3            15
+#define BIT_CAM_CLK_QEFIMC2            14
+#define BIT_CAM_CLK_QEFIMC1            13
+#define BIT_CAM_CLK_QEFIMC0            12
+#define BIT_CAM_CLK_SMMUJPEG           11
+#define BIT_CAM_CLK_SMMUFIMC3          10
+#define BIT_CAM_CLK_SMMUFIMC2          9
+#define BIT_CAM_CLK_SMMUFIMC1          8
+#define BIT_CAM_CLK_SMMUFIMC0          7
+#define BIT_CAM_CLK_JPEG               6
+#define BIT_CAM_CLK_CSIS1              5
+#define BIT_CAM_CLK_CSIS0              4
+#define BIT_CAM_CLK_FIMC3              3
+#define BIT_CAM_CLK_FIMC2              2
+#define BIT_CAM_CLK_FIMC1              1
+#define BIT_CAM_CLK_FIMC0              0
+#define CLK_GATE_IP_CAM_ALL_EN         ((CLK_EN << BIT_CAM_CLK_PIXELASYNCM1)\
+                                       | (CLK_EN << BIT_CAM_CLK_PIXELASYNCM0)\
+                                       | (CLK_EN << BIT_CAM_CLK_PPMUCAMIF)\
+                                       | (CLK_EN << BIT_CAM_CLK_QEFIMC3)\
+                                       | (CLK_EN << BIT_CAM_CLK_QEFIMC2)\
+                                       | (CLK_EN << BIT_CAM_CLK_QEFIMC1)\
+                                       | (CLK_EN << BIT_CAM_CLK_QEFIMC0)\
+                                       | (CLK_EN << BIT_CAM_CLK_SMMUJPEG)\
+                                       | (CLK_EN << BIT_CAM_CLK_SMMUFIMC3)\
+                                       | (CLK_EN << BIT_CAM_CLK_SMMUFIMC2)\
+                                       | (CLK_EN << BIT_CAM_CLK_SMMUFIMC1)\
+                                       | (CLK_EN << BIT_CAM_CLK_SMMUFIMC0)\
+                                       | (CLK_EN << BIT_CAM_CLK_JPEG)\
+                                       | (CLK_EN << BIT_CAM_CLK_CSIS1)\
+                                       | (CLK_EN << BIT_CAM_CLK_CSIS0)\
+                                       | (CLK_EN << BIT_CAM_CLK_FIMC3)\
+                                       | (CLK_EN << BIT_CAM_CLK_FIMC2)\
+                                       | (CLK_EN << BIT_CAM_CLK_FIMC1)\
+                                       | (CLK_EN << BIT_CAM_CLK_FIMC0))
+#define CLK_GATE_IP_CAM_ALL_DIS                ~CLK_GATE_IP_CAM_ALL_EN
+
+#define BIT_VP_CLK_PPMUTV              5
+#define BIT_VP_CLK_SMMUTV              4
+#define BIT_VP_CLK_HDMI                        3
+#define BIT_VP_CLK_TVENC               2
+#define BIT_VP_CLK_MIXER               1
+#define BIT_VP_CLK_VP                  0
+#define CLK_GATE_IP_VP_ALL_EN          ((CLK_EN << BIT_VP_CLK_PPMUTV)\
+                                       | (CLK_EN << BIT_VP_CLK_SMMUTV)\
+                                       | (CLK_EN << BIT_VP_CLK_HDMI)\
+                                       | (CLK_EN << BIT_VP_CLK_TVENC)\
+                                       | (CLK_EN << BIT_VP_CLK_MIXER)\
+                                       | (CLK_EN << BIT_VP_CLK_VP))
+#define CLK_GATE_IP_VP_ALL_DIS         ~CLK_GATE_IP_VP_ALL_EN
+
+#define BIT_MFC_CLK_PPMUMFC_R          4
+#define BIT_MFC_CLK_PPMUMFC_L          3
+#define BIT_MFC_CLK_SMMUMFC_R          2
+#define BIT_MFC_CLK_SMMUMFC_L          1
+#define BIT_MFC_CLK_MFC                        0
+#define CLK_GATE_IP_MFC_ALL_EN         ((CLK_EN << BIT_MFC_CLK_PPMUMFC_R)\
+                                       | (CLK_EN << BIT_MFC_CLK_PPMUMFC_L)\
+                                       | (CLK_EN << BIT_MFC_CLK_SMMUMFC_R)\
+                                       | (CLK_EN << BIT_MFC_CLK_SMMUMFC_L)\
+                                       | (CLK_EN << BIT_MFC_CLK_MFC))
+#define CLK_GATE_IP_MFC_ALL_DIS                ~CLK_GATE_IP_MFC_ALL_EN
+
+#define BIT_G3D_CLK_QEG3D              2
+#define BIT_G3D_CLK_PPMUG3D            1
+#define BIT_G3D_CLK_G3D                        0
+#define CLK_GATE_IP_G3D_ALL_EN         ((CLK_EN << BIT_G3D_CLK_QEG3D)\
+                                       | (CLK_EN << BIT_G3D_CLK_PPMUG3D)\
+                                       | (CLK_EN << BIT_G3D_CLK_G3D))
+#define CLK_GATE_IP_G3D_ALL_DIS                ~CLK_GATE_IP_G3D_ALL_EN
+
+#define BIT_IMAGE_CLK_PPMUIMAGE                9
+#define BIT_IMAGE_CLK_QEMDMA           8
+#define BIT_IMAGE_CLK_QEROTATOR                7
+#define BIT_IMAGE_CLK_QEG2D            6
+#define BIT_IMAGE_CLK_SMMUMDMA         5
+#define BIT_IMAGE_CLK_SMMUROTATOR      4
+#define BIT_IMAGE_CLK_SMMUG2D          3
+#define BIT_IMAGE_CLK_MDMA             2
+#define BIT_IMAGE_CLK_ROTATOR          1
+#define BIT_IMAGE_CLK_G2D              0
+#define CLK_GATE_IP_IMAGE_ALL_EN       ((CLK_EN << BIT_IMAGE_CLK_PPMUIMAGE)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_QEMDMA)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_QEROTATOR)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_QEG2D)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_SMMUMDMA)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_SMMUROTATOR)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_SMMUG2D)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_MDMA)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_ROTATOR)\
+                                       | (CLK_EN << BIT_IMAGE_CLK_G2D))
+#define CLK_GATE_IP_IMAGE_ALL_DIS      ~CLK_GATE_IP_IMAGE_ALL_EN
+
+#define BIT_LCD0_CLK_PPMULCD0          5
+#define BIT_LCD0_CLK_SMMUFIMD0         4
+#define BIT_LCD0_CLK_DSIM0             3
+#define BIT_LCD0_CLK_MDNIE0            2
+#define BIT_LCD0_CLK_MIE0              1
+#define BIT_LCD0_CLK_FIMD0             0
+#define CLK_GATE_IP_LCD0_ALL_EN                ((CLK_EN << BIT_LCD0_CLK_PPMULCD0)\
+                                       | (CLK_EN << BIT_LCD0_CLK_SMMUFIMD0)\
+                                       | (CLK_EN << BIT_LCD0_CLK_DSIM0)\
+                                       | (CLK_EN << BIT_LCD0_CLK_MDNIE0)\
+                                       | (CLK_EN << BIT_LCD0_CLK_MIE0)\
+                                       | (CLK_EN << BIT_LCD0_CLK_FIMD0))
+#define CLK_GATE_IP_LCD0_ALL_DIS       ~CLK_GATE_IP_LCD0_ALL_EN
+
+#define BIT_LCD1_CLK_PPMULCD1          5
+#define BIT_LCD1_CLK_SMMUFIMD1         4
+#define BIT_LCD1_CLK_DSIM1             3
+#define BIT_LCD1_CLK_MDNIE1            2
+#define BIT_LCD1_CLK_MIE1              1
+#define BIT_LCD1_CLK_FIMD1             0
+#define CLK_GATE_IP_LCD1_ALL_EN                ((CLK_EN << BIT_LCD1_CLK_PPMULCD1)\
+                                       | (CLK_EN << BIT_LCD1_CLK_SMMUFIMD1)\
+                                       | (CLK_EN << BIT_LCD1_CLK_DSIM1)\
+                                       | (CLK_EN << BIT_LCD1_CLK_MDNIE1)\
+                                       | (CLK_EN << BIT_LCD1_CLK_MIE1)\
+                                       | (CLK_EN << BIT_LCD1_CLK_FIMD1))
+#define CLK_GATE_IP_LCD1_ALL_DIS       ~CLK_GATE_IP_LCD1_ALL_EN
+
+#define BIT_FSYS_CLK_SMMUPCIE          18
+#define BIT_FSYS_CLK_PPMUFILE          17
+#define BIT_FSYS_CLK_NFCON             16
+#define BIT_FSYS_CLK_ONENAND           15
+#define BIT_FSYS_CLK_PCIE              14
+#define BIT_FSYS_CLK_USBDEVICE         13
+#define BIT_FSYS_CLK_USBHOST           12
+#define BIT_FSYS_CLK_SROMC             11
+#define BIT_FSYS_CLK_SATA              10
+#define BIT_FSYS_CLK_SDMMC4            9
+#define BIT_FSYS_CLK_SDMMC3            8
+#define BIT_FSYS_CLK_SDMMC2            7
+#define BIT_FSYS_CLK_SDMMC1            6
+#define BIT_FSYS_CLK_SDMMC0            5
+#define BIT_FSYS_CLK_TSI               4
+#define BIT_FSYS_CLK_SATAPHY           3
+#define BIT_FSYS_CLK_PCIEPHY           2
+#define BIT_FSYS_CLK_PDMA1             1
+#define BIT_FSYS_CLK_PDMA0             0
+#define CLK_GATE_IP_FSYS_ALL_EN                ((CLK_EN << BIT_FSYS_CLK_SMMUPCIE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PPMUFILE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_NFCON)\
+                                       | (CLK_EN << BIT_FSYS_CLK_ONENAND)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PCIE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_USBDEVICE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_USBHOST)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SROMC)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SATA)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC4)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC3)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC2)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC1)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC0)\
+                                       | (CLK_EN << BIT_FSYS_CLK_TSI)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SATAPHY)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PCIEPHY)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PDMA1)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PDMA0))
+#define CLK_GATE_IP_FSYS_ALL_DIS       ~CLK_GATE_IP_FSYS_ALL_EN
+
+#define BIT_GPS_CLK_SMMUGPS            1
+#define BIT_GPS_CLK_GPS                        0
+#define CLK_GATE_IP_GPS_ALL_EN         ((CLK_EN << BIT_GPS_CLK_SMMUGPS)\
+                                       | (CLK_EN << BIT_GPS_CLK_GPS))
+#define CLK_GATE_IP_GPS_ALL_DIS                ~CLK_GATE_IP_GPS_ALL_EN
+
+#define BIT_PERIL_CLK_MODEMIF          28
+#define BIT_PERIL_CLK_AC97             27
+#define BIT_PERIL_CLK_SPDIF            26
+#define BIT_PERIL_CLK_SLIMBUS          25
+#define BIT_PERIL_CLK_PWM              24
+#define BIT_PERIL_CLK_PCM2             23
+#define BIT_PERIL_CLK_PCM1             22
+#define BIT_PERIL_CLK_I2S2             21
+#define BIT_PERIL_CLK_I2S1             20
+#define BIT_PERIL_CLK_RESERVED0                19
+#define BIT_PERIL_CLK_SPI2             18
+#define BIT_PERIL_CLK_SPI1             17
+#define BIT_PERIL_CLK_SPI0             16
+#define BIT_PERIL_CLK_TSADC            15
+#define BIT_PERIL_CLK_I2CHDMI          14
+#define BIT_PERIL_CLK_I2C7             13
+#define BIT_PERIL_CLK_I2C6             12
+#define BIT_PERIL_CLK_I2C5             11
+#define BIT_PERIL_CLK_I2C4             10
+#define BIT_PERIL_CLK_I2C3             9
+#define BIT_PERIL_CLK_I2C2             8
+#define BIT_PERIL_CLK_I2C1             7
+#define BIT_PERIL_CLK_I2C0             6
+#define BIT_PERIL_CLK_RESERVED1                5
+#define BIT_PERIL_CLK_UART4            4
+#define BIT_PERIL_CLK_UART3            3
+#define BIT_PERIL_CLK_UART2            2
+#define BIT_PERIL_CLK_UART1            1
+#define BIT_PERIL_CLK_UART0            0
+#define CLK_GATE_IP_PERIL_ALL_EN       ((CLK_EN << BIT_PERIL_CLK_MODEMIF)\
+                                       | (CLK_EN << BIT_PERIL_CLK_AC97)\
+                                       | (CLK_EN << BIT_PERIL_CLK_SPDIF)\
+                                       | (CLK_EN << BIT_PERIL_CLK_SLIMBUS)\
+                                       | (CLK_EN << BIT_PERIL_CLK_PWM)\
+                                       | (CLK_EN << BIT_PERIL_CLK_PCM2)\
+                                       | (CLK_EN << BIT_PERIL_CLK_PCM1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2S2)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2S1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_RESERVED0)\
+                                       | (CLK_EN << BIT_PERIL_CLK_SPI2)\
+                                       | (CLK_EN << BIT_PERIL_CLK_SPI1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_SPI0)\
+                                       | (CLK_EN << BIT_PERIL_CLK_TSADC)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2CHDMI)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C7)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C6)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C5)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C4)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C3)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C2)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_I2C0)\
+                                       | (CLK_EN << BIT_PERIL_CLK_RESERVED1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_UART4)\
+                                       | (CLK_EN << BIT_PERIL_CLK_UART3)\
+                                       | (CLK_EN << BIT_PERIL_CLK_UART2)\
+                                       | (CLK_EN << BIT_PERIL_CLK_UART1)\
+                                       | (CLK_EN << BIT_PERIL_CLK_UART0))
+#define CLK_GATE_IP_PERIL_ALL_DIS      ~CLK_GATE_IP_PERIL_ALL_EN
+
+#define BIT_PERIR_CLK_TMU_APBIF                17
+#define BIT_PERIR_CLK_KEYIF            16
+#define BIT_PERIR_CLK_RTC              15
+#define BIT_PERIR_CLK_WDT              14
+#define BIT_PERIR_CLK_MCT              13
+#define BIT_PERIR_CLK_SECKEY           12
+#define BIT_PERIR_CLK_HDMI_CEC         11
+#define BIT_PERIR_CLK_TZPC5            10
+#define BIT_PERIR_CLK_TZPC4            9
+#define BIT_PERIR_CLK_TZPC3            8
+#define BIT_PERIR_CLK_TZPC2            7
+#define BIT_PERIR_CLK_TZPC1            6
+#define BIT_PERIR_CLK_TZPC0            5
+#define BIT_PERIR_CLK_CMU_DMCPART      4
+#define BIT_PERIR_CLK_RESERVED         3
+#define BIT_PERIR_CLK_CMU_APBIF                2
+#define BIT_PERIR_CLK_SYSREG           1
+#define BIT_PERIR_CLK_CHIP_ID          0
+#define CLK_GATE_IP_PERIR_ALL_EN       ((CLK_EN << BIT_PERIR_CLK_TMU_APBIF)\
+                                       | (CLK_EN << BIT_PERIR_CLK_KEYIF)\
+                                       | (CLK_EN << BIT_PERIR_CLK_RTC)\
+                                       | (CLK_EN << BIT_PERIR_CLK_WDT)\
+                                       | (CLK_EN << BIT_PERIR_CLK_MCT)\
+                                       | (CLK_EN << BIT_PERIR_CLK_SECKEY)\
+                                       | (CLK_EN << BIT_PERIR_CLK_HDMI_CEC)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC5)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC4)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC3)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC2)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC1)\
+                                       | (CLK_EN << BIT_PERIR_CLK_TZPC0)\
+                                       | (CLK_EN << BIT_PERIR_CLK_CMU_DMCPART)\
+                                       | (CLK_EN << BIT_PERIR_CLK_RESERVED)\
+                                       | (CLK_EN << BIT_PERIR_CLK_CMU_APBIF)\
+                                       | (CLK_EN << BIT_PERIR_CLK_SYSREG)\
+                                       | (CLK_EN << BIT_PERIR_CLK_CHIP_ID))
+#define CLK_GATE_IP_PERIR_ALL_DIS      ~CLK_GATE_IP_PERIR_ALL_EN
+
+#define BIT_BLOCK_CLK_GPS              7
+#define BIT_BLOCK_CLK_RESERVED         6
+#define BIT_BLOCK_CLK_LCD1             5
+#define BIT_BLOCK_CLK_LCD0             4
+#define BIT_BLOCK_CLK_G3D              3
+#define BIT_BLOCK_CLK_MFC              2
+#define BIT_BLOCK_CLK_TV               1
+#define BIT_BLOCK_CLK_CAM              0
+#define CLK_GATE_BLOCK_ALL_EN          ((CLK_EN << BIT_BLOCK_CLK_GPS)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_RESERVED)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_LCD1)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_LCD0)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_G3D)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_MFC)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_TV)\
+                                       | (CLK_EN << BIT_BLOCK_CLK_CAM))
+#define CLK_GATE_BLOCK_ALL_DIS         ~CLK_GATE_BLOCK_ALL_EN
+
+/*
+ * GATE CAM    : All block
+ * GATE VP     : All block
+ * GATE MFC    : All block
+ * GATE G3D    : All block
+ * GATE IMAGE  : All block
+ * GATE LCD0   : All block
+ * GATE LCD1   : All block
+ * GATE FSYS   : Enable - PDMA0,1, SDMMC0,2, USBHOST, USBDEVICE, PPMUFILE
+ * GATE GPS    : All block
+ * GATE PERI Left      : All Enable, Block - SLIMBUS, SPDIF, AC97
+ * GATE PERI Right     : All Enable, Block - KEYIF
+ * GATE Block  : All block
+ */
+#define CLK_GATE_IP_CAM_VAL            CLK_GATE_IP_CAM_ALL_DIS
+#define CLK_GATE_IP_VP_VAL             CLK_GATE_IP_VP_ALL_DIS
+#define CLK_GATE_IP_MFC_VAL            CLK_GATE_IP_MFC_ALL_DIS
+#define CLK_GATE_IP_G3D_VAL            CLK_GATE_IP_G3D_ALL_DIS
+#define CLK_GATE_IP_IMAGE_VAL          CLK_GATE_IP_IMAGE_ALL_DIS
+#define CLK_GATE_IP_LCD0_VAL           CLK_GATE_IP_LCD0_ALL_DIS
+#define CLK_GATE_IP_LCD1_VAL           CLK_GATE_IP_LCD1_ALL_DIS
+#define CLK_GATE_IP_FSYS_VAL           (CLK_GATE_IP_FSYS_ALL_DIS \
+                                       | (CLK_EN << BIT_FSYS_CLK_PPMUFILE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_USBDEVICE)\
+                                       | (CLK_EN << BIT_FSYS_CLK_USBHOST)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SROMC)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC2)\
+                                       | (CLK_EN << BIT_FSYS_CLK_SDMMC0)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PDMA1)\
+                                       | (CLK_EN << BIT_FSYS_CLK_PDMA0))
+#define CLK_GATE_IP_GPS_VAL            CLK_GATE_IP_GPS_ALL_DIS
+#define CLK_GATE_IP_PERIL_VAL          (CLK_GATE_IP_PERIL_ALL_DIS \
+                                       | ~((CLK_EN << BIT_PERIL_CLK_AC97)\
+                                         | (CLK_EN << BIT_PERIL_CLK_SPDIF)\
+                                         | (CLK_EN << BIT_PERIL_CLK_I2C2)\
+                                         | (CLK_EN << BIT_PERIL_CLK_SLIMBUS)))
+#define CLK_GATE_IP_PERIR_VAL          (CLK_GATE_IP_PERIR_ALL_DIS \
+                                       | ~((CLK_EN << BIT_PERIR_CLK_KEYIF)))
+#define CLK_GATE_BLOCK_VAL             CLK_GATE_BLOCK_ALL_DIS
+
+/* PS_HOLD: Data Hight, Output En */
+#define BIT_DAT                                8
+#define BIT_EN                         9
+#define EXYNOS4_PS_HOLD_CON_VAL                (0x1 << BIT_DAT | 0x1 << BIT_EN)
+
+#endif
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
new file mode 100644 (file)
index 0000000..aa4291d
--- /dev/null
@@ -0,0 +1,366 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.com>
+ * Kyungmin Park <kyungmin.park@samsung.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/cpu.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/watchdog.h>
+#include <asm/arch/power.h>
+#include <pmic.h>
+#include <usb/s3c_udc.h>
+#include <max8998_pmic.h>
+
+#include "setup.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int board_rev;
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+       return board_rev;
+}
+#endif
+
+static void check_hw_revision(void);
+
+int board_init(void)
+{
+       gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+
+       check_hw_revision();
+       printf("HW Revision:\t0x%x\n", board_rev);
+
+#if defined(CONFIG_PMIC)
+       pmic_init();
+#endif
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
+               get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
+
+       return 0;
+}
+
+void dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+       gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+       gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+}
+
+static unsigned int get_hw_revision(void)
+{
+       struct exynos4_gpio_part1 *gpio =
+               (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
+       int hwrev = 0;
+       int i;
+
+       /* hw_rev[3:0] == GPE1[3:0] */
+       for (i = 0; i < 4; i++) {
+               s5p_gpio_cfg_pin(&gpio->e1, i, GPIO_INPUT);
+               s5p_gpio_set_pull(&gpio->e1, i, GPIO_PULL_NONE);
+       }
+
+       udelay(1);
+
+       for (i = 0; i < 4; i++)
+               hwrev |= (s5p_gpio_get_value(&gpio->e1, i) << i);
+
+       debug("hwrev 0x%x\n", hwrev);
+
+       return hwrev;
+}
+
+static void check_hw_revision(void)
+{
+       int hwrev;
+
+       hwrev = get_hw_revision();
+
+       board_rev |= hwrev;
+}
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+       puts("Board:\tTRATS\n");
+       return 0;
+}
+#endif
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+       struct exynos4_gpio_part2 *gpio =
+               (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
+       int i, err;
+
+       /* eMMC_EN: SD_0_CDn: GPK0[2] Output High */
+       s5p_gpio_direction_output(&gpio->k0, 2, 1);
+       s5p_gpio_set_pull(&gpio->k0, 2, GPIO_PULL_NONE);
+
+       /*
+        * eMMC GPIO:
+        * SDR 8-bit@48MHz at MMC0
+        * GPK0[0]      SD_0_CLK(2)
+        * GPK0[1]      SD_0_CMD(2)
+        * GPK0[2]      SD_0_CDn        -> Not used
+        * GPK0[3:6]    SD_0_DATA[0:3](2)
+        * GPK1[3:6]    SD_0_DATA[0:3](3)
+        *
+        * DDR 4-bit@26MHz at MMC4
+        * GPK0[0]      SD_4_CLK(3)
+        * GPK0[1]      SD_4_CMD(3)
+        * GPK0[2]      SD_4_CDn        -> Not used
+        * GPK0[3:6]    SD_4_DATA[0:3](3)
+        * GPK1[3:6]    SD_4_DATA[4:7](4)
+        */
+       for (i = 0; i < 7; i++) {
+               if (i == 2)
+                       continue;
+               /* GPK0[0:6] special function 2 */
+               s5p_gpio_cfg_pin(&gpio->k0, i, 0x2);
+               /* GPK0[0:6] pull disable */
+               s5p_gpio_set_pull(&gpio->k0, i, GPIO_PULL_NONE);
+               /* GPK0[0:6] drv 4x */
+               s5p_gpio_set_drv(&gpio->k0, i, GPIO_DRV_4X);
+       }
+
+       for (i = 3; i < 7; i++) {
+               /* GPK1[3:6] special function 3 */
+               s5p_gpio_cfg_pin(&gpio->k1, i, 0x3);
+               /* GPK1[3:6] pull disable */
+               s5p_gpio_set_pull(&gpio->k1, i, GPIO_PULL_NONE);
+               /* GPK1[3:6] drv 4x */
+               s5p_gpio_set_drv(&gpio->k1, i, GPIO_DRV_4X);
+       }
+
+       /*
+        * MMC device init
+        * mmc0  : eMMC (8-bit buswidth)
+        * mmc2  : SD card (4-bit buswidth)
+        */
+       err = s5p_mmc_init(0, 8);
+
+       /* T-flash detect */
+       s5p_gpio_cfg_pin(&gpio->x3, 4, 0xf);
+       s5p_gpio_set_pull(&gpio->x3, 4, GPIO_PULL_UP);
+
+       /*
+        * Check the T-flash  detect pin
+        * GPX3[4] T-flash detect pin
+        */
+       if (!s5p_gpio_get_value(&gpio->x3, 4)) {
+               /*
+                * SD card GPIO:
+                * GPK2[0]      SD_2_CLK(2)
+                * GPK2[1]      SD_2_CMD(2)
+                * GPK2[2]      SD_2_CDn        -> Not used
+                * GPK2[3:6]    SD_2_DATA[0:3](2)
+                */
+               for (i = 0; i < 7; i++) {
+                       if (i == 2)
+                               continue;
+                       /* GPK2[0:6] special function 2 */
+                       s5p_gpio_cfg_pin(&gpio->k2, i, 0x2);
+                       /* GPK2[0:6] pull disable */
+                       s5p_gpio_set_pull(&gpio->k2, i, GPIO_PULL_NONE);
+                       /* GPK2[0:6] drv 4x */
+                       s5p_gpio_set_drv(&gpio->k2, i, GPIO_DRV_4X);
+               }
+               err = s5p_mmc_init(2, 4);
+       }
+
+       return err;
+}
+#endif
+
+#ifdef CONFIG_USB_GADGET
+static int s5pc210_phy_control(int on)
+{
+       int ret = 0;
+       struct pmic *p = get_pmic();
+
+       if (pmic_probe(p))
+               return -1;
+
+       if (on) {
+               ret |= pmic_set_output(p,
+                                      MAX8998_REG_BUCK_ACTIVE_DISCHARGE3,
+                                      MAX8998_SAFEOUT1, LDO_ON);
+               ret |= pmic_set_output(p, MAX8998_REG_ONOFF1,
+                                     MAX8998_LDO3, LDO_ON);
+               ret |= pmic_set_output(p, MAX8998_REG_ONOFF2,
+                                     MAX8998_LDO8, LDO_ON);
+
+       } else {
+               ret |= pmic_set_output(p, MAX8998_REG_ONOFF2,
+                                     MAX8998_LDO8, LDO_OFF);
+               ret |= pmic_set_output(p, MAX8998_REG_ONOFF1,
+                                     MAX8998_LDO3, LDO_OFF);
+               ret |= pmic_set_output(p,
+                                      MAX8998_REG_BUCK_ACTIVE_DISCHARGE3,
+                                      MAX8998_SAFEOUT1, LDO_OFF);
+       }
+
+       if (ret) {
+               puts("MAX8998 LDO setting error!\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct s3c_plat_otg_data s5pc210_otg_data = {
+       .phy_control    = s5pc210_phy_control,
+       .regs_phy       = EXYNOS4_USBPHY_BASE,
+       .regs_otg       = EXYNOS4_USBOTG_BASE,
+       .usb_phy_ctrl   = EXYNOS4_USBPHY_CONTROL,
+       .usb_flags      = PHY0_SLEEP,
+};
+#endif
+
+static void pmic_reset(void)
+{
+       struct exynos4_gpio_part2 *gpio =
+               (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
+
+       s5p_gpio_direction_output(&gpio->x0, 7, 1);
+       s5p_gpio_set_pull(&gpio->x2, 7, GPIO_PULL_NONE);
+}
+
+static void board_clock_init(void)
+{
+       struct exynos4_clock *clk =
+               (struct exynos4_clock *)samsung_get_base_clock();
+
+       writel(CLK_SRC_CPU_VAL, (unsigned int)&clk->src_cpu);
+       writel(CLK_SRC_TOP0_VAL, (unsigned int)&clk->src_top0);
+       writel(CLK_SRC_FSYS_VAL, (unsigned int)&clk->src_fsys);
+       writel(CLK_SRC_PERIL0_VAL, (unsigned int)&clk->src_peril0);
+
+       writel(CLK_DIV_CPU0_VAL, (unsigned int)&clk->div_cpu0);
+       writel(CLK_DIV_CPU1_VAL, (unsigned int)&clk->div_cpu1);
+       writel(CLK_DIV_DMC0_VAL, (unsigned int)&clk->div_dmc0);
+       writel(CLK_DIV_DMC1_VAL, (unsigned int)&clk->div_dmc1);
+       writel(CLK_DIV_LEFTBUS_VAL, (unsigned int)&clk->div_leftbus);
+       writel(CLK_DIV_RIGHTBUS_VAL, (unsigned int)&clk->div_rightbus);
+       writel(CLK_DIV_TOP_VAL, (unsigned int)&clk->div_top);
+       writel(CLK_DIV_FSYS1_VAL, (unsigned int)&clk->div_fsys1);
+       writel(CLK_DIV_FSYS2_VAL, (unsigned int)&clk->div_fsys2);
+       writel(CLK_DIV_FSYS3_VAL, (unsigned int)&clk->div_fsys3);
+       writel(CLK_DIV_PERIL0_VAL, (unsigned int)&clk->div_peril0);
+       writel(CLK_DIV_PERIL3_VAL, (unsigned int)&clk->div_peril3);
+
+       writel(PLL_LOCKTIME, (unsigned int)&clk->apll_lock);
+       writel(PLL_LOCKTIME, (unsigned int)&clk->mpll_lock);
+       writel(PLL_LOCKTIME, (unsigned int)&clk->epll_lock);
+       writel(PLL_LOCKTIME, (unsigned int)&clk->vpll_lock);
+       writel(APLL_CON1_VAL, (unsigned int)&clk->apll_con1);
+       writel(APLL_CON0_VAL, (unsigned int)&clk->apll_con0);
+       writel(MPLL_CON1_VAL, (unsigned int)&clk->mpll_con1);
+       writel(MPLL_CON0_VAL, (unsigned int)&clk->mpll_con0);
+       writel(EPLL_CON1_VAL, (unsigned int)&clk->epll_con1);
+       writel(EPLL_CON0_VAL, (unsigned int)&clk->epll_con0);
+       writel(VPLL_CON1_VAL, (unsigned int)&clk->vpll_con1);
+       writel(VPLL_CON0_VAL, (unsigned int)&clk->vpll_con0);
+
+       writel(CLK_GATE_IP_CAM_VAL, (unsigned int)&clk->gate_ip_cam);
+       writel(CLK_GATE_IP_VP_VAL, (unsigned int)&clk->gate_ip_tv);
+       writel(CLK_GATE_IP_MFC_VAL, (unsigned int)&clk->gate_ip_mfc);
+       writel(CLK_GATE_IP_G3D_VAL, (unsigned int)&clk->gate_ip_g3d);
+       writel(CLK_GATE_IP_IMAGE_VAL, (unsigned int)&clk->gate_ip_image);
+       writel(CLK_GATE_IP_LCD0_VAL, (unsigned int)&clk->gate_ip_lcd0);
+       writel(CLK_GATE_IP_LCD1_VAL, (unsigned int)&clk->gate_ip_lcd1);
+       writel(CLK_GATE_IP_FSYS_VAL, (unsigned int)&clk->gate_ip_fsys);
+       writel(CLK_GATE_IP_GPS_VAL, (unsigned int)&clk->gate_ip_gps);
+       writel(CLK_GATE_IP_PERIL_VAL, (unsigned int)&clk->gate_ip_peril);
+       writel(CLK_GATE_IP_PERIR_VAL, (unsigned int)&clk->gate_ip_perir);
+       writel(CLK_GATE_BLOCK_VAL, (unsigned int)&clk->gate_block);
+}
+
+static void board_power_init(void)
+{
+       struct exynos4_power *pwr =
+               (struct exynos4_power *)samsung_get_base_power();
+
+       /* PS HOLD */
+       writel(EXYNOS4_PS_HOLD_CON_VAL, (unsigned int)&pwr->ps_hold_control);
+
+       /* Set power down */
+       writel(0, (unsigned int)&pwr->cam_configuration);
+       writel(0, (unsigned int)&pwr->tv_configuration);
+       writel(0, (unsigned int)&pwr->mfc_configuration);
+       writel(0, (unsigned int)&pwr->g3d_configuration);
+       writel(0, (unsigned int)&pwr->lcd1_configuration);
+       writel(0, (unsigned int)&pwr->gps_configuration);
+       writel(0, (unsigned int)&pwr->gps_alive_configuration);
+}
+
+static void board_uart_init(void)
+{
+       struct exynos4_gpio_part1 *gpio1 =
+               (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
+       struct exynos4_gpio_part2 *gpio2 =
+               (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
+       int i;
+
+       /*
+        * UART2 GPIOs
+        * GPA1CON[0] = UART_2_RXD(2)
+        * GPA1CON[1] = UART_2_TXD(2)
+        * GPA1CON[2] = I2C_3_SDA (3)
+        * GPA1CON[3] = I2C_3_SCL (3)
+        */
+
+       for (i = 0; i < 4; i++) {
+               s5p_gpio_set_pull(&gpio1->a1, i, GPIO_PULL_NONE);
+               s5p_gpio_cfg_pin(&gpio1->a1, i, GPIO_FUNC((i > 1) ? 0x3 : 0x2));
+       }
+
+       /* UART_SEL GPY4[7] (part2) at EXYNOS4 */
+       s5p_gpio_set_pull(&gpio2->y4, 7, GPIO_PULL_UP);
+       s5p_gpio_direction_output(&gpio2->y4, 7, 1);
+}
+
+int board_early_init_f(void)
+{
+       wdt_stop();
+       pmic_reset();
+       board_clock_init();
+       board_uart_init();
+       board_power_init();
+
+       return 0;
+}
index 06fac7b583625e13d5e36599870fb82977f607b8..50c70ab60312c50cb614858dee392d22b26f2f20 100644 (file)
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <asm/gpio.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/ehci-omap.h>
+#endif
 #include "twister.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -56,6 +60,24 @@ static const u32 gpmc_XR16L2751[] = {
        XR16L2751_GPMC_CONFIG6,
 };
 
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+       return omap_ehci_hcd_init(&usbhs_bdata);
+}
+
+int ehci_hcd_stop(void)
+{
+       return omap_ehci_hcd_stop();
+}
+#endif
+
 int board_init(void)
 {
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
diff --git a/board/teejet/mt_ventoux/Makefile b/board/teejet/mt_ventoux/Makefile
new file mode 100644 (file)
index 0000000..4c8db10
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+#
+# Based on ti/evm/Makefile
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c
new file mode 100644 (file)
index 0000000..c5eb42c
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ *
+ * Copyright (C) 2009 TechNexion Ltd.
+ *
+ * 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.
+ */
+
+#include <common.h>
+#include <netdev.h>
+#include <fpga.h>
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/omap_gpio.h>
+#include <asm/arch/mmc_host_def.h>
+#include <i2c.h>
+#include <spartan3.h>
+#include <asm/gpio.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/ehci-omap.h>
+#endif
+#include "mt_ventoux.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_FPGA
+#error "The Teejet mt_ventoux must have CONFIG_FPGA enabled"
+#endif
+
+#define FPGA_RESET     62
+#define FPGA_PROG      116
+#define FPGA_CCLK      117
+#define FPGA_DIN       118
+#define FPGA_INIT      119
+#define FPGA_DONE      154
+
+/* Timing definitions for FPGA */
+static const u32 gpmc_fpga[] = {
+       FPGA_GPMC_CONFIG1,
+       FPGA_GPMC_CONFIG2,
+       FPGA_GPMC_CONFIG3,
+       FPGA_GPMC_CONFIG4,
+       FPGA_GPMC_CONFIG5,
+       FPGA_GPMC_CONFIG6,
+};
+
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+       return omap_ehci_hcd_init(&usbhs_bdata);
+}
+
+int ehci_hcd_stop(void)
+{
+       return omap_ehci_hcd_stop();
+}
+#endif
+
+
+static inline void fpga_reset(int nassert)
+{
+       gpio_set_value(FPGA_RESET, !nassert);
+}
+
+int fpga_pgm_fn(int nassert, int nflush, int cookie)
+{
+       debug("%s:%d: FPGA PROGRAM ", __func__, __LINE__);
+
+       gpio_set_value(FPGA_PROG, !nassert);
+
+       return nassert;
+}
+
+int fpga_init_fn(int cookie)
+{
+       return !gpio_get_value(FPGA_INIT);
+}
+
+int fpga_done_fn(int cookie)
+{
+       return gpio_get_value(FPGA_DONE);
+}
+
+int fpga_pre_config_fn(int cookie)
+{
+       debug("%s:%d: FPGA pre-configuration\n", __func__, __LINE__);
+
+       /* Setting GPIOs for programming Mode */
+       gpio_request(FPGA_RESET, "FPGA_RESET");
+       gpio_direction_output(FPGA_RESET, 1);
+       gpio_request(FPGA_PROG, "FPGA_PROG");
+       gpio_direction_output(FPGA_PROG, 1);
+       gpio_request(FPGA_CCLK, "FPGA_CCLK");
+       gpio_direction_output(FPGA_CCLK, 1);
+       gpio_request(FPGA_DIN, "FPGA_DIN");
+       gpio_direction_output(FPGA_DIN, 0);
+       gpio_request(FPGA_INIT, "FPGA_INIT");
+       gpio_direction_input(FPGA_INIT);
+       gpio_request(FPGA_DONE, "FPGA_DONE");
+       gpio_direction_input(FPGA_DONE);
+
+       /* Be sure that signal are deasserted */
+       gpio_set_value(FPGA_RESET, 1);
+       gpio_set_value(FPGA_PROG, 1);
+
+       return 0;
+}
+
+int fpga_post_config_fn(int cookie)
+{
+       debug("%s:%d: FPGA post-configuration\n", __func__, __LINE__);
+
+       fpga_reset(TRUE);
+       udelay(100);
+       fpga_reset(FALSE);
+
+       return 0;
+}
+
+/* Write program to the FPGA */
+int fpga_wr_fn(int nassert_write, int flush, int cookie)
+{
+       gpio_set_value(FPGA_DIN, nassert_write);
+
+       return nassert_write;
+}
+
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+       gpio_set_value(FPGA_CCLK, assert_clk);
+
+       return assert_clk;
+}
+
+Xilinx_Spartan3_Slave_Serial_fns mt_ventoux_fpga_fns = {
+       fpga_pre_config_fn,
+       fpga_pgm_fn,
+       fpga_clk_fn,
+       fpga_init_fn,
+       fpga_done_fn,
+       fpga_wr_fn,
+       fpga_post_config_fn,
+};
+
+Xilinx_desc fpga = XILINX_XC6SLX4_DESC(slave_serial,
+                       (void *)&mt_ventoux_fpga_fns, 0);
+
+/* Initialize the FPGA */
+static void mt_ventoux_init_fpga(void)
+{
+       fpga_pre_config_fn(0);
+
+       /* Setting CS1 for FPGA access */
+       enable_gpmc_cs_config(gpmc_fpga, &gpmc_cfg->cs[1],
+               FPGA_BASE_ADDR, GPMC_SIZE_128M);
+
+       fpga_init();
+       fpga_add(fpga_xilinx, &fpga);
+}
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+       gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+       mt_ventoux_init_fpga();
+
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       dieid_num_r();
+
+       return 0;
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *             hardware. Many pins need to be moved from protect to primary
+ *             mode.
+ */
+void set_muxconf_regs(void)
+{
+       MUX_MT_VENTOUX();
+}
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int board_eth_init(bd_t *bis)
+{
+       davinci_emac_initialize();
+       return 0;
+}
+
+#if defined(CONFIG_OMAP_HSMMC) && \
+       !defined(CONFIG_SPL_BUILD)
+int board_mmc_init(bd_t *bis)
+{
+       return omap_mmc_init(0);
+}
+#endif
diff --git a/board/teejet/mt_ventoux/mt_ventoux.h b/board/teejet/mt_ventoux/mt_ventoux.h
new file mode 100644 (file)
index 0000000..34c1ec5
--- /dev/null
@@ -0,0 +1,429 @@
+/*
+ * Copyright (C) 2011 Stefano Babic <sbabic@denx.de>
+ *
+ * Author: Hardy Weng <hardy.weng@technexion.com>
+ *
+ * Copyright (C) 2010 TechNexion Ltd.
+ *
+ * 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.
+ */
+
+#ifndef _MT_VENTOUX_H_
+#define _MT_VENTOUX_H_
+
+const omap3_sysinfo sysinfo = {
+       DDR_DISCRETE,
+       "Teejet MT_VENTOUX Board",
+       "NAND",
+};
+
+/* FPGA CS1 configuration */
+#define FPGA_GPMC_CONFIG1      0x00001200
+#define FPGA_GPMC_CONFIG2      0x00111a00
+#define FPGA_GPMC_CONFIG3      0x00010100
+#define FPGA_GPMC_CONFIG4      0x06041a04
+#define FPGA_GPMC_CONFIG5      0x0019101a
+#define FPGA_GPMC_CONFIG6      0x890503c0
+#define FPGA_GPMC_CONFIG7      0x00000860
+
+#define FPGA_BASE_ADDR         0x20000000
+
+/*
+ * IEN  - Input Enable
+ * IDIS - Input Disable
+ * PTD  - Pull type Down
+ * PTU  - Pull type Up
+ * DIS  - Pull type selection is inactive
+ * EN  - Pull type selection is active
+ * M0  - Mode 0
+ * The commented string gives the final mux configuration for that pin
+ */
+#define MUX_MT_VENTOUX() \
+       /* SDRC */\
+       MUX_VAL(CP(SDRC_D0),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D1),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D2),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D3),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D4),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D5),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D6),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D7),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D8),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D9),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D10),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D11),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D12),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D13),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D14),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D15),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D16),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D17),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D18),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D19),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D20),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D21),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D22),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D23),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D24),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D25),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D26),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D27),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D28),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D29),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D30),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_D31),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_CLK),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS0),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS1),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS2),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS3),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SDRC_DQS0N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS1N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS2N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_DQS3N),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SDRC_CKE0),          (M0)) \
+       MUX_VAL(CP(SDRC_CKE1),          (M0)) \
+       MUX_VAL(CP(STRBEN_DLY0),        (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(STRBEN_DLY1),        (IEN  | PTD | EN  | M0)) \
+       /* GPMC */\
+       MUX_VAL(CP(GPMC_A1),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A2),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A3),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A4),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A5),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A6),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A7),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A8),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A9),            (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_A10),           (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D0),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D1),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D2),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D3),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D4),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D5),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D6),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D7),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D8),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D9),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D10),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D11),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D12),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D13),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D14),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_D15),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NCS1),          (IEN | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NCS2),          (IDIS | PTD | EN  | M4))/* GPIO 53 */\
+       MUX_VAL(CP(GPMC_NCS3),          (IEN | PTU | EN | M4))  /* GPIO 54 */\
+       MUX_VAL(CP(GPMC_NCS4),          (IEN | PTD | EN | M4)) \
+                       /* GPIO 55 : NFS */\
+       MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_NCS6),          (IDIS  | PTD | EN | M3)) /*PWM11*/ \
+       MUX_VAL(CP(GPMC_NCS7),          (IDIS  | PTD | EN | M4)) /*GPIO_58*/ \
+       MUX_VAL(CP(GPMC_CLK),           (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NOE),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NWE),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(GPMC_NBE0_CLE),      (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NBE1),          (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(GPMC_NWP),           (IEN  | PTD | DIS | M4)) \
+                       /*GPIO_62: FPGA_RESET */ \
+       MUX_VAL(CP(GPMC_WAIT0),         (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_WAIT1),         (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(GPMC_WAIT2),         (IEN  | PTU | EN  | M4)) /*GPIO_64*/ \
+       MUX_VAL(CP(GPMC_WAIT3),         (IEN  | PTU | EN  | M4)) \
+       /* DSS */\
+       MUX_VAL(CP(DSS_PCLK),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_HSYNC),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_VSYNC),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_ACBIAS),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA0),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA1),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA2),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA3),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA4),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA5),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA6),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA7),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA8),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA9),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA10),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA11),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA12),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA13),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA14),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA15),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA16),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA17),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0)) \
+       /* CAMERA */\
+       MUX_VAL(CP(CAM_HS),             (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CAM_VS),             (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CAM_XCLKA),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_PCLK),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CAM_FLD),            (IDIS | PTD | DIS | M4)) /*GPIO_98*/\
+       MUX_VAL(CP(CAM_D0),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D1),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D2),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D3),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D4),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D5),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D6),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D7),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D8),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D9),             (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D10),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_D11),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_XCLKB),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(CAM_WEN),            (IEN  | PTD | DIS | M4)) /*GPIO_167*/\
+       MUX_VAL(CP(CAM_STROBE),         (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(CSI2_DX0),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CSI2_DY0),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CSI2_DX1),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CSI2_DY1),           (IEN  | PTD | DIS | M0)) \
+       /* MMC */\
+       MUX_VAL(CP(MMC1_CLK),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(MMC1_CMD),           (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT0),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT1),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT2),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT3),          (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MMC1_DAT4),          (IEN  | PTU | EN  | M4)) \
+                       /* GPIO_126: CardDetect */\
+       MUX_VAL(CP(MMC1_DAT5),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC1_DAT6),          (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC1_DAT7),          (IEN  | PTU | EN  | M4)) \
+       \
+       MUX_VAL(CP(MMC2_CLK),           (IEN  | PTU | EN | M0)) /*MMC2_CLK*/\
+       MUX_VAL(CP(MMC2_CMD),           (IEN  | PTU | DIS  | M0)) /*MMC2_CMD*/\
+       MUX_VAL(CP(MMC2_DAT0),          (IEN  | PTU | DIS  | M0)) /*MMC2_DAT0*/\
+       MUX_VAL(CP(MMC2_DAT1),          (IEN  | PTU | DIS  | M0)) /*MMC2_DAT1*/\
+       MUX_VAL(CP(MMC2_DAT2),          (IEN  | PTU | DIS  | M0)) /*MMC2_DAT2*/\
+       MUX_VAL(CP(MMC2_DAT3),          (IEN  | PTU | DIS  | M0)) /*MMC2_DAT3*/\
+       MUX_VAL(CP(MMC2_DAT4),          (IDIS  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC2_DAT5),          (IDIS  | PTU | EN  | M4)) \
+       MUX_VAL(CP(MMC2_DAT6),          (IDIS  | PTU | EN  | M4)) \
+                       /* GPIO_138: LCD_ENVD */\
+       MUX_VAL(CP(MMC2_DAT7),          (IDIS  | PTU | EN  | M4)) \
+                       /* GPIO_139: LCD_PON */\
+       /* McBSP */\
+       MUX_VAL(CP(MCBSP_CLKS),         (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_CLKR),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_FSR),         (IDIS | PTU | EN  | M0)) \
+       MUX_VAL(CP(MCBSP1_DX),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_DR),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_FSX),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCBSP1_CLKX),        (IEN  | PTD | DIS | M0)) \
+       \
+       MUX_VAL(CP(MCBSP2_FSX),         (IEN | PTD | EN | M4)) \
+                       /* GPIO_116: FPGA_PROG */ \
+       MUX_VAL(CP(MCBSP2_CLKX),        (IEN | PTD | EN | M4)) \
+                       /* GPIO_117: FPGA_CCLK */ \
+       MUX_VAL(CP(MCBSP2_DR),          (IEN | PTD | EN | M4)) \
+                       /* GPIO_118: FPGA_DIN */ \
+       MUX_VAL(CP(MCBSP2_DX),          (IEN | PTD | EN | M4)) \
+                       /* GPIO_119: FPGA_INIT */ \
+       \
+       MUX_VAL(CP(MCBSP3_DX),          (IEN | PTU | EN | M4)) \
+                       /* GPIO_140: speaker #mute */\
+       MUX_VAL(CP(MCBSP3_DR),          (IEN  | PTU | EN | M4)) \
+                       /* GPIO_141: Buzz Hi */\
+       MUX_VAL(CP(MCBSP3_CLKX),        (IEN  | PTU | EN | M4)) \
+       MUX_VAL(CP(MCBSP3_FSX),         (IEN  | PTU | EN | M4)) \
+       \
+       MUX_VAL(CP(MCBSP4_CLKX),        (IEN | PTD | DIS | M4)) \
+                       /*GPIO_152: Ignition Sense */ \
+       MUX_VAL(CP(MCBSP4_DR),          (IDIS | PTD | DIS | M4)) \
+                       /*GPIO_153: Power Button Sense */ \
+       MUX_VAL(CP(MCBSP4_DX),          (IEN | PTU | DIS | M4)) \
+                       /* GPIO_154: FPGA_DONE */ \
+       MUX_VAL(CP(MCBSP4_FSX),         (IEN | PTD | DIS | M4)) \
+                       /* GPIO_155: CA8_irq */ \
+       /* UART */\
+       MUX_VAL(CP(UART1_TX),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART1_RTS),          (IEN | PTU | EN | M4)) \
+                       /* GPIO_149: USB status 2 */\
+       MUX_VAL(CP(UART1_CTS),          (IEN | PTU | EN | M4)) \
+                       /* GPIO_150: USB status 1 */\
+       \
+       MUX_VAL(CP(UART1_RX),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART2_CTS),          (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(UART2_RTS),          (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART2_TX),           (IDIS | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART2_RX),           (IEN  | PTD | DIS | M0)) \
+       \
+       MUX_VAL(CP(UART3_CTS_RCTX),     (IDIS  | PTD | DIS | M4)) \
+                       /*GPIO_163 : TS_PENIRQ*/ \
+       MUX_VAL(CP(UART3_RTS_SD),       (IEN | PTD | DIS | M4)) \
+                       /*GPIO_164 : MMC */\
+       MUX_VAL(CP(UART3_RX_IRRX),      (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(UART3_TX_IRTX),      (IDIS | PTD | DIS | M0)) \
+       /* I2C */\
+       MUX_VAL(CP(I2C1_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C1_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C2_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C2_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C3_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C3_SDA),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C4_SCL),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(I2C4_SDA),           (IEN  | PTU | EN  | M0)) \
+       /* McSPI */\
+       MUX_VAL(CP(MCSPI1_CLK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_SIMO),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_SOMI),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI1_CS0),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(MCSPI1_CS1),         (IEN | PTD | EN | M4)) /*GPIO_175*/\
+       MUX_VAL(CP(MCSPI1_CS2),         (IEN | PTD | EN | M4)) /*GPIO_176*/\
+       MUX_VAL(CP(MCSPI1_CS3),         (IEN | PTD | EN | M4)) \
+       \
+       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI2_SOMI),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(MCSPI2_CS0),         (IEN  | PTD | EN  | M4)) \
+       MUX_VAL(CP(MCSPI2_CS1),         (IEN  | PTD | EN  | M0)) \
+       /* CCDC */\
+       MUX_VAL(CP(CCDC_PCLK),          (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CCDC_FIELD),         (IEN  | PTD | DIS | M4)) \
+                       /* GPIO95: #Enable Output */\
+       MUX_VAL(CP(CCDC_HD),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CCDC_VD),            (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(CCDC_WEN),           (IEN  | PTD | DIS | M4)) \
+                       /* GPIO 99: #SOM_PWR_OFF */\
+       MUX_VAL(CP(CCDC_DATA0),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA1),         (IEN  | PTD | DIS | M4)) \
+                       /* GPIO_100: #power out */\
+       MUX_VAL(CP(CCDC_DATA2),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA3),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA4),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA5),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA6),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(CCDC_DATA7),         (IEN  | PTD | DIS | M0)) \
+       /* RMII */\
+       MUX_VAL(CP(RMII_MDIO_DATA),     (IEN  |  M0)) \
+       MUX_VAL(CP(RMII_MDIO_CLK),      (M0)) \
+       MUX_VAL(CP(RMII_RXD0)   ,       (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_RXD1),          (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_CRS_DV),        (IEN  | PTD | M0)) \
+       MUX_VAL(CP(RMII_RXER),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXD0),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXD1),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_TXEN),          (PTD | M0)) \
+       MUX_VAL(CP(RMII_50MHZ_CLK),     (IEN  | PTD | EN  | M0)) \
+       /* HECC */\
+       MUX_VAL(CP(HECC1_TXD),          (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(HECC1_RXD),          (IEN  | PTU | EN  | M0)) \
+       /* HSUSB */\
+       MUX_VAL(CP(HSUSB0_CLK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_STP),         (IEN  | PTU | DIS  | M0)) \
+       MUX_VAL(CP(HSUSB0_DIR),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_NXT),         (IEN  | PTU | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA0),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA1),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA2),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA3),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA4),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA5),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA6),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(HSUSB0_DATA7),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(USB0_DRVBUS),        (IEN  | PTD | EN  | M0)) \
+       /* HDQ */\
+       MUX_VAL(CP(HDQ_SIO),            (IEN | PTD | EN | M4)) \
+                       /* GPIO_170: auto update */\
+       /* Control and debug */\
+       MUX_VAL(CP(SYS_32K),            (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_CLKREQ),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_NIRQ),           (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(SYS_NRESWARM),       (IDIS | PTU | DIS | M4)) \
+                       /* - GPIO30 */\
+       MUX_VAL(CP(SYS_BOOT0),          (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
+       MUX_VAL(CP(SYS_BOOT1),          (IEN  | PTD | DIS | M4)) /*GPIO_3 */\
+       MUX_VAL(CP(SYS_BOOT2),          (IEN  | PTD | DIS | M4)) /*GPIO_4*/\
+       MUX_VAL(CP(SYS_BOOT3),          (IEN  | PTD | DIS | M4)) /*GPIO_5*/\
+       MUX_VAL(CP(SYS_BOOT4),          (IEN  | PTD | DIS | M4)) /*GPIO_6*/\
+       MUX_VAL(CP(SYS_BOOT5),          (IEN  | PTD | DIS | M4)) /*GPIO_7*/\
+       MUX_VAL(CP(SYS_BOOT6),          (IDIS | PTD | DIS | M4)) /*GPIO_8*/\
+       MUX_VAL(CP(SYS_BOOT7),          (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(SYS_BOOT8),          (IEN  | PTD | EN  | M0)) \
+       \
+       MUX_VAL(CP(SYS_OFF_MODE),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_CLKOUT1),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(SYS_CLKOUT2),        (IEN  | PTU | EN  | M0)) \
+       /* JTAG */\
+       MUX_VAL(CP(JTAG_nTRST),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(JTAG_TCK),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(JTAG_TMS),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(JTAG_TDI),           (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(JTAG_EMU0),          (IDIS  | PTD | EN | M4)) /*GPIO_11*/ \
+       MUX_VAL(CP(JTAG_EMU1),          (IDIS  | PTD | EN | M4)) /*GPIO_31*/ \
+       /* ETK (ES2 onwards) */\
+       MUX_VAL(CP(ETK_CLK_ES2),        (IDIS | PTD | DIS  | M3)) \
+                                       /* hsusb1_stp */ \
+       MUX_VAL(CP(ETK_CTL_ES2),        (IDIS | PTD | DIS | M3)) \
+                                       /* hsusb1_clk */\
+       MUX_VAL(CP(ETK_D0_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D1_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D2_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D3_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D4_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D5_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D6_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D7_ES2),         (IEN  | PTU | EN  | M3)) \
+       MUX_VAL(CP(ETK_D8_ES2),         (IEN  | PTD | EN  | M3)) \
+       MUX_VAL(CP(ETK_D9_ES2),         (IEN  | PTD | EN  | M3)) \
+       MUX_VAL(CP(ETK_D10_ES2),        (IEN  | PTU | EN  | M4)) \
+       MUX_VAL(CP(ETK_D11_ES2),        (IDIS | PTD | DIS | M4)) \
+       MUX_VAL(CP(ETK_D12_ES2),        (IEN  | PTD | DIS | M3)) \
+       MUX_VAL(CP(ETK_D13_ES2),        (IEN  | PTD | DIS | M3)) \
+       MUX_VAL(CP(ETK_D14_ES2),        (IEN  | PTD | DIS | M3)) \
+       MUX_VAL(CP(ETK_D15_ES2),        (IEN  | PTD | DIS | M3)) \
+       /* Die to Die */\
+       MUX_VAL(CP(D2D_MCAD34),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_MCAD35),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_MCAD36),         (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_CLK26MI),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_NRESPWRON),      (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_NRESWARM),       (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_ARM9NIRQ),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_UMA2P6FIQ),      (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SPINT),          (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_FRINT),          (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ0),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ1),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ2),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_DMAREQ3),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTRST),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTDI),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTDO),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTMS),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GTCK),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_N3GRTCK),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MSTDBY),         (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_SWAKEUP),        (IEN  | PTD | EN  | M0)) \
+       MUX_VAL(CP(D2D_IDLEREQ),        (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_IDLEACK),        (IEN  | PTU | EN  | M0)) \
+       MUX_VAL(CP(D2D_MWRITE),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SWRITE),         (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MREAD),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SREAD),          (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_MBUSFLAG),       (IEN  | PTD | DIS | M0)) \
+       MUX_VAL(CP(D2D_SBUSFLAG),       (IEN  | PTD | DIS | M0)) \
+
+#endif
index 5c04b34e1ab0140aca93e7752c8672ce7aebc0b9..87578763bb737eaf656370fd3dfa18a7eace9146 100644 (file)
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/mach-types.h>
+#include "beagle.h"
+#include <command.h>
+
 #ifdef CONFIG_USB_EHCI
 #include <usb.h>
-#include <asm/arch/clocks.h>
-#include <asm/arch/clocks_omap3.h>
-#include <asm/arch/ehci_omap3.h>
-/* from drivers/usb/host/ehci-core.h */
-extern struct ehci_hccr *hccr;
-extern volatile struct ehci_hcor *hcor;
+#include <asm/ehci-omap.h>
 #endif
-#include "beagle.h"
-#include <command.h>
 
 #define pr_debug(fmt, args...) debug(fmt, ##args)
 
@@ -166,6 +162,13 @@ void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
                        *ctrlb = NUMONYX_V_ACTIMB_165;
                        *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
                        break;
+               } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
+                       /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
+                       *mcfg = MICRON_V_MCFG_165(128 << 20);
+                       *ctrla = MICRON_V_ACTIMA_165;
+                       *ctrlb = MICRON_V_ACTIMB_165;
+                       *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
+                       break;
                } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
                        /* Beagleboard Rev C5, 256MB DDR */
                        *mcfg = MICRON_V_MCFG_200(256 << 20);
@@ -445,24 +448,6 @@ int board_mmc_init(bd_t *bis)
 #endif
 
 #ifdef CONFIG_USB_EHCI
-
-#define GPIO_PHY_RESET 147
-
-/* Reset is needed otherwise the kernel-driver will throw an error. */
-int ehci_hcd_stop(void)
-{
-       pr_debug("Resetting OMAP3 EHCI\n");
-       gpio_set_value(GPIO_PHY_RESET, 0);
-       writel(OMAP_UHH_SYSCONFIG_SOFTRESET, OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG);
-       /* disable USB clocks */
-       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
-       sr32(&prcm_base->iclken_usbhost, 0, 1, 0);
-       sr32(&prcm_base->fclken_usbhost, 0, 2, 0);
-       sr32(&prcm_base->iclken3_core, 2, 1, 0);
-       sr32(&prcm_base->fclken3_core, 2, 1, 0);
-       return 0;
-}
-
 /* Call usb_stop() before starting the kernel */
 void show_boot_progress(int val)
 {
@@ -470,77 +455,20 @@ void show_boot_progress(int val)
                usb_stop();
 }
 
-/*
- * Initialize the OMAP3 EHCI controller and PHY on the BeagleBoard.
- * Based on "drivers/usb/host/ehci-omap.c" from Linux 2.6.37.
- * See there for additional Copyrights.
- */
+static struct omap_usbhs_board_data usbhs_bdata = {
+       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
+};
+
 int ehci_hcd_init(void)
 {
-       pr_debug("Initializing OMAP3 ECHI\n");
-
-       /* Put the PHY in RESET */
-       gpio_request(GPIO_PHY_RESET, "");
-       gpio_direction_output(GPIO_PHY_RESET, 0);
-       gpio_set_value(GPIO_PHY_RESET, 0);
-
-       /* Hold the PHY in RESET for enough time till DIR is high */
-       /* Refer: ISSUE1 */
-       udelay(10);
-
-       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
-       /* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
-       sr32(&prcm_base->iclken_usbhost, 0, 1, 1);
-       /*
-        * Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
-        * and USBHOST_120M_FCLK (USBHOST_FCLK2)
-        */
-       sr32(&prcm_base->fclken_usbhost, 0, 2, 3);
-       /* Enable USBTTL_ICLK */
-       sr32(&prcm_base->iclken3_core, 2, 1, 1);
-       /* Enable USBTTL_FCLK */
-       sr32(&prcm_base->fclken3_core, 2, 1, 1);
-       pr_debug("USB clocks enabled\n");
-
-       /* perform TLL soft reset, and wait until reset is complete */
-       writel(OMAP_USBTLL_SYSCONFIG_SOFTRESET,
-               OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSCONFIG);
-       /* Wait for TLL reset to complete */
-       while (!(readl(OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSSTATUS)
-                       & OMAP_USBTLL_SYSSTATUS_RESETDONE));
-       pr_debug("TLL reset done\n");
-
-       writel(OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
-               OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
-               OMAP_USBTLL_SYSCONFIG_CACTIVITY,
-               OMAP3_USBTLL_BASE + OMAP_USBTLL_SYSCONFIG);
-
-       /* Put UHH in NoIdle/NoStandby mode */
-       writel(OMAP_UHH_SYSCONFIG_ENAWAKEUP
-               | OMAP_UHH_SYSCONFIG_SIDLEMODE
-               | OMAP_UHH_SYSCONFIG_CACTIVITY
-               | OMAP_UHH_SYSCONFIG_MIDLEMODE,
-               OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG);
-
-       /* setup burst configurations */
-       writel(OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
-               | OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN
-               | OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN,
-               OMAP3_UHH_BASE + OMAP_UHH_HOSTCONFIG);
-
-       /*
-        * Refer ISSUE1:
-        * Hold the PHY in RESET for enough time till
-        * PHY is settled and ready
-        */
-       udelay(10);
-       gpio_set_value(GPIO_PHY_RESET, 1);
-
-       hccr = (struct ehci_hccr *)(OMAP3_EHCI_BASE);
-       hcor = (struct ehci_hcor *)(OMAP3_EHCI_BASE + 0x10);
+       return omap_ehci_hcd_init(&usbhs_bdata);
+}
 
-       pr_debug("OMAP3 EHCI init done\n");
-       return 0;
+int ehci_hcd_stop(void)
+{
+       return omap_ehci_hcd_stop();
 }
 
 #endif /* CONFIG_USB_EHCI */
index 18bfaa8deccecaa39d9ec104786772c87bbf31a1..c0a94a92c168ad72195dbd3fbffa7aac738f4b8c 100644 (file)
@@ -536,7 +536,7 @@ static const struct venc_regs venc_config_std_tv = {
  * Configure Timings for DVI D
  */
 static const struct panel_config dvid_cfg = {
-       .timing_h       = 0x0ff03f31, /* Horizantal timing */
+       .timing_h       = 0x0ff03f31, /* Horizontal timing */
        .timing_v       = 0x01400504, /* Vertical timing */
        .pol_freq       = 0x00007028, /* Pol Freq */
        .divisor        = 0x00010006, /* 72Mhz Pixel Clock */
@@ -548,7 +548,7 @@ static const struct panel_config dvid_cfg = {
 };
 
 static const struct panel_config dvid_cfg_xm = {
-       .timing_h       = 0x1a4024c9, /* Horizantal timing */
+       .timing_h       = 0x1a4024c9, /* Horizontal timing */
        .timing_v       = 0x02c00509, /* Vertical timing */
        .pol_freq       = 0x00007028, /* Pol Freq */
        .divisor        = 0x00010001, /* 96MHz Pixel Clock */
index fc8c0b4bc603f23e6ab9bf9bfd3eba717e713691..ca4b8b35ebdb51ab1d630a8c719046ef9693f0d2 100644 (file)
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/clocks.h>
 #include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 
 #include "panda_mux_data.h"
 
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/arch/ehci.h>
+#include <asm/ehci-omap.h>
+#endif
+
 #define PANDA_ULPI_PHY_TYPE_GPIO       182
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -177,6 +184,37 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_USB_EHCI
+
+static struct omap_usbhs_board_data usbhs_bdata = {
+       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+       .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
+       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+       int ret;
+       unsigned int utmi_clk;
+
+       /* Now we can enable our port clocks */
+       utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL);
+       utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK;
+       sr32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, 0, 32, utmi_clk);
+
+       ret = omap_ehci_hcd_init(&usbhs_bdata);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+       return omap_ehci_hcd_stop();
+}
+#endif
+
 /*
  * get_board_rev() - get board revision
  */
index 2970ccd60922b6b7d093643cc42291994a9edf65..5b66a14242cde701e1694664b9f2ac7b383ff293 100644 (file)
@@ -136,14 +136,14 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
        {CAM_SHUTTER, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)},            /* cam_shutter */
        {CAM_STROBE, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)},             /* cam_strobe */
        {CAM_GLOBALRESET, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)},  /* gpio_83 */
-       {USBB1_ULPITLL_CLK, (IEN | OFF_EN | OFF_IN | M1)},              /* hsi1_cawake */
-       {USBB1_ULPITLL_STP, (IEN | OFF_EN | OFF_IN | M1)},              /* hsi1_cadata */
-       {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_IN | M1)},              /* hsi1_caflag */
-       {USBB1_ULPITLL_NXT, (OFF_EN | M1)},                             /* hsi1_acready */
-       {USBB1_ULPITLL_DAT0, (OFF_EN | M1)},                            /* hsi1_acwake */
-       {USBB1_ULPITLL_DAT1, (OFF_EN | M1)},                            /* hsi1_acdata */
-       {USBB1_ULPITLL_DAT2, (OFF_EN | M1)},                            /* hsi1_acflag */
-       {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_IN | M1)},             /* hsi1_caready */
+       {USBB1_ULPITLL_CLK, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* usbb1_ulpiphy_clk */
+       {USBB1_ULPITLL_STP, (OFF_EN | OFF_OUT_PTD | M4)},               /* usbb1_ulpiphy_stp */
+       {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},     /* usbb1_ulpiphy_dir */
+       {USBB1_ULPITLL_NXT, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},     /* usbb1_ulpiphy_nxt */
+       {USBB1_ULPITLL_DAT0, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat0 */
+       {USBB1_ULPITLL_DAT1, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat1 */
+       {USBB1_ULPITLL_DAT2, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat2 */
+       {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat3 */
        {USBB1_ULPITLL_DAT4, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat4 */
        {USBB1_ULPITLL_DAT5, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat5 */
        {USBB1_ULPITLL_DAT6, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},    /* usbb1_ulpiphy_dat6 */
index 2f90dbf928fbc4b8237085401125f5bce9daa09b..05ce1ae06fa37caf1832f13f9d0c9069b12bff05 100644 (file)
@@ -133,9 +133,10 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 ea20                        arm         arm926ejs   ea20                davinci        davinci
 hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
-hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
+calimain                     arm         arm926ejs   calimain            omicron        davinci
+dns325                       arm         arm926ejs   -                   d-link         kirkwood
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood       km_kirkwood:KM_DISABLE_PCI
 km_kirkwood_pci              arm         arm926ejs   km_arm              keymile        kirkwood       km_kirkwood:KM_RECONFIG_XLX
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
@@ -177,6 +178,10 @@ omap730p2_cs0boot       arm         arm926ejs   omap730p2           ti             omap
 omap730p2_cs3boot           arm         arm926ejs   omap730p2           ti             omap        omap730p2:CS3_BOOT
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 dkb                         arm         arm926ejs   -                   Marvell        pantheon
+spear300                     arm         arm926ejs   spear300            spear          spear       spear3xx:spear300
+spear310                     arm         arm926ejs   spear310            spear          spear       spear3xx:spear310
+spear320                     arm         arm926ejs   spear320            spear          spear       spear3xx:spear320
+spear600                     arm         arm926ejs   spear600            spear          spear       spear6xx:spear600
 versatileab                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_AB
 versatilepb                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_PB
 versatileqemu                arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_QEMU,ARCH_VERSATILE_PB
@@ -202,6 +207,7 @@ dig297                       arm         armv7       dig297              comelit
 igep0020                     arm         armv7       igep0020            isee           omap3
 igep0030                     arm         armv7       igep0030            isee           omap3
 am3517_evm                   arm         armv7       am3517evm           logicpd        omap3
+mt_ventoux                   arm         armv7       mt_ventoux          teejet         omap3
 omap3_zoom1                  arm         armv7       zoom1               logicpd        omap3
 omap3_zoom2                  arm         armv7       zoom2               logicpd        omap3
 omap3_logic                  arm         armv7       omap3som            logicpd        omap3
@@ -213,6 +219,8 @@ omap3_evm_quick_mmc          arm         armv7       evm                 ti
 omap3_evm_quick_nand         arm         armv7       evm                 ti             omap3
 omap3_sdp3430                arm         armv7       sdp3430             ti             omap3
 devkit8000                   arm         armv7       devkit8000          timll          omap3
+mcx                          arm         armv7       mcx                 htkw           omap3
+tricorder                    arm         armv7       tricorder           corscience     omap3
 twister                      arm         armv7       twister             technexion     omap3
 omap4_panda                  arm         armv7       panda               ti             omap4
 omap4_sdp4430                arm         armv7       sdp4430             ti             omap4
@@ -221,7 +229,9 @@ s5p_goni                     arm         armv7       goni                samsung
 smdkc100                     arm         armv7       smdkc100            samsung        s5pc1xx
 origen                      arm         armv7       origen              samsung        exynos
 s5pc210_universal            arm         armv7       universal_c210      samsung        exynos
+smdk5250                    arm         armv7       smdk5250            samsung        exynos
 smdkv310                    arm         armv7       smdkv310            samsung        exynos
+trats                        arm         armv7       trats               samsung        exynos
 harmony                      arm         armv7       harmony             nvidia         tegra2
 seaboard                     arm         armv7       seaboard            nvidia         tegra2
 ventana                      arm         armv7       ventana             nvidia         tegra2
@@ -250,6 +260,7 @@ colibri_pxa270               arm         pxa         -                   toradex
 jornada                      arm         sa1100
 plutux                       arm         armv7       plutux              avionic-design tegra2
 medcom                       arm         armv7       medcom              avionic-design tegra2
+paz00                        arm         armv7       paz00               compal         tegra2
 atngw100                     avr32       at32ap      -                   atmel          at32ap700x
 atstk1002                    avr32       at32ap      atstk1000           atmel          at32ap700x
 atstk1003                    avr32       at32ap      atstk1000           atmel          at32ap700x
@@ -280,6 +291,7 @@ bf561-acvilon                blackfin    blackfin
 bf561-ezkit                  blackfin    blackfin
 blackstamp                   blackfin    blackfin
 blackvme                     blackfin    blackfin
+br4                          blackfin    blackfin
 cm-bf527                     blackfin    blackfin
 cm-bf533                     blackfin    blackfin
 cm-bf537e                    blackfin    blackfin
@@ -289,6 +301,7 @@ cm-bf561                     blackfin    blackfin
 dnp5370                      blackfin    blackfin
 ibf-dsp561                   blackfin    blackfin
 ip04                         blackfin    blackfin
+pr1                          blackfin    blackfin
 tcm-bf518                    blackfin    blackfin
 tcm-bf537                    blackfin    blackfin
 M52277EVB                    m68k        mcf5227x    m52277evb           freescale      -           M52277EVB:SYS_SPANSION_BOOT,SYS_TEXT_BASE=0x00000000
index 97f29456f97e7454813e88e84096d5ee4cd3dd32..5359a47859b98fb431e3d99a9a3c36a6f10ff404 100644 (file)
@@ -370,6 +370,15 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_num("irq_sp", gd->irq_sp);        /* irq stack pointer */
        print_num("sp start ", gd->start_addr_sp);
        print_num("FB base  ", gd->fb_base);
+       /*
+        * TODO: Currently only support for davinci SOC's is added.
+        * Remove this check once all the board implement this.
+        */
+#ifdef CONFIG_CLOCKS
+       printf("ARM frequency = %ld MHz\n", gd->bd->bi_arm_freq);
+       printf("DSP frequency = %ld MHz\n", gd->bd->bi_dsp_freq);
+       printf("DDR frequency = %ld MHz\n", gd->bd->bi_ddr_freq);
+#endif
        return 0;
 }
 
index 63afc82fe2078b56809cbdc8156044d95f7aefc9..20080dc0011c4035804ab4c93d4360490ded11ca 100644 (file)
@@ -502,7 +502,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        else
                buffer[0] = '\0';
 
-       readline_into_buffer("edit: ", buffer);
+       readline_into_buffer("edit: ", buffer, 0);
 
        return setenv(argv[1], buffer);
 }
index e96c95a038c29be5f7aa5dfa57fa6c9209710e7b..91e888fd3ce0a3ef54c1996d153538e76e78707c 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <post.h>
 #include <linux/ctype.h>
+#include <menu.h>
 
 #if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
 DECLARE_GLOBAL_DATA_PTR;
@@ -372,6 +373,9 @@ void main_loop (void)
 
        debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
 
+#if defined(CONFIG_MENU_SHOW)
+       bootdelay = menu_show(bootdelay);
+#endif
 # ifdef CONFIG_BOOT_RETRY_TIME
        init_cmd_timeout ();
 # endif        /* CONFIG_BOOT_RETRY_TIME */
@@ -685,7 +689,8 @@ static void cread_add_str(char *str, int strsize, int insert, unsigned long *num
        }
 }
 
-static int cread_line(const char *const prompt, char *buf, unsigned int *len)
+static int cread_line(const char *const prompt, char *buf, unsigned int *len,
+               int timeout)
 {
        unsigned long num = 0;
        unsigned long eol_num = 0;
@@ -695,6 +700,7 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len)
        int esc_len = 0;
        char esc_save[8];
        int init_len = strlen(buf);
+       int first = 1;
 
        if (init_len)
                cread_add_str(buf, init_len, 1, &num, &eol_num, buf, *len);
@@ -707,6 +713,16 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len)
                        WATCHDOG_RESET();
                }
 #endif
+               if (first && timeout) {
+                       uint64_t etime = endtick(timeout);
+
+                       while (!tstc()) {       /* while no incoming data */
+                               if (get_ticks() >= etime)
+                                       return -2;      /* timed out */
+                               WATCHDOG_RESET();
+                       }
+                       first = 0;
+               }
 
                ichar = getcmd_getch();
 
@@ -922,11 +938,11 @@ int readline (const char *const prompt)
         */
        console_buffer[0] = '\0';
 
-       return readline_into_buffer(prompt, console_buffer);
+       return readline_into_buffer(prompt, console_buffer, 0);
 }
 
 
-int readline_into_buffer (const char *const prompt, char * buffer)
+int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 {
        char *p = buffer;
 #ifdef CONFIG_CMDLINE_EDITING
@@ -949,7 +965,7 @@ int readline_into_buffer (const char *const prompt, char * buffer)
                if (prompt)
                        puts (prompt);
 
-               rc = cread_line(prompt, p, &len);
+               rc = cread_line(prompt, p, &len, timeout);
                return rc < 0 ? rc : len;
 
        } else {
index 5e0817c454bdd128390114dacf315066cba43140..aa16c9a199d772f7bd9971e401efdb883bf06895 100644 (file)
@@ -113,6 +113,13 @@ static inline void *menu_item_destroy(struct menu *m,
        return NULL;
 }
 
+void __menu_display_statusline(struct menu *m)
+{
+       return;
+}
+void menu_display_statusline(struct menu *m)
+       __attribute__ ((weak, alias("__menu_display_statusline")));
+
 /*
  * Display a menu so the user can make a choice of an item. First display its
  * title, if any, and then each item in the menu.
@@ -123,6 +130,7 @@ static inline void menu_display(struct menu *m)
                puts(m->title);
                putc('\n');
        }
+       menu_display_statusline(m);
 
        menu_items_iter(m, menu_item_print, NULL);
 }
@@ -222,13 +230,16 @@ static inline int menu_interactive_choice(struct menu *m, void **choice)
 
                menu_display(m);
 
-               readret = readline_into_buffer("Enter choice: ", cbuf);
+               readret = readline_into_buffer("Enter choice: ", cbuf,
+                               m->timeout);
 
                if (readret >= 0) {
                        choice_item = menu_item_by_key(m, cbuf);
 
-                       if (!choice_item)
+                       if (!choice_item) {
                                printf("%s not found\n", cbuf);
+                               m->timeout = 0;
+                       }
                } else {
                        puts("^C\n");
                        return -EINTR;
index f01a8bd91187547e1b0ded577b414e951ae2c6d5..0276953db634159e417c55e93b17b1738886f30c 100644 (file)
@@ -42,8 +42,8 @@ The building of SPL images can be with:
 
 #define CONFIG_SPL
 
-Because SPL images normally have a different text base, one have to be
-configured by defining CONFIG_SPL_TEXT_BASE. The linker script have to be
+Because SPL images normally have a different text base, one has to be
+configured by defining CONFIG_SPL_TEXT_BASE. The linker script has to be
 defined with CONFIG_SPL_LDSCRIPT.
 
 To support generic U-Boot libraries and drivers in the SPL binary one can
index b7afec444c751d7e358512711e41fa9e2e552b81..d6ae02ec0281f08b2bc6b4e4c5a0f0b8ad324cb0 100644 (file)
@@ -9,8 +9,8 @@ executes upon reset is the Rom Boot Loader(RBL) which sits in the
 internal ROM of the omap. The RBL initialises the memory and the nand
 controller, and copies the image stored at a predefined location(block
 1) of the nand flash. The image loaded by the RBL to the memory is the
-AIS signed nand_spl image. This, in turns copies the u-boot binary
-from the nand flash to the memory and jumps to the u-boot entry point.
+AIS signed spl image. This, in turns copies the u-boot binary from the
+nand flash to the memory and jumps to the u-boot entry point.
 
 AIS is an image format defined by TI for the images that are to be
 loaded to memory by the RBL. The image is divided into a series of
@@ -20,14 +20,14 @@ and the size of the section, which is used by the RBL to load the
 image. At the end of the image the RBL jumps to the image entry
 point.
 
-The secondary stage bootloader(nand_spl) which is loaded by the RBL
-then loads the u-boot from a predefined location in the nand to the
-memory and jumps to the u-boot entry point.
+The secondary stage bootloader(spl) which is loaded by the RBL then
+loads the u-boot from a predefined location in the nand to the memory
+and jumps to the u-boot entry point.
 
 The reason a secondary stage bootloader is used is because the ECC
 layout expected by the RBL is not the same as that used by
-u-boot/linux. This also implies that for flashing the nand_spl image,
-we need to use the u-boot which uses the ECC layout expected by the
+u-boot/linux. This also implies that for flashing the spl image,we
+need to use the u-boot which uses the ECC layout expected by the
 RBL[1]. Booting u-boot over UART(UART boot) is explained here[2].
 
 
@@ -35,20 +35,19 @@ Compilation
 ===========
 Three images might be needed
 
-* nand_spl - This is the secondary bootloader which boots the u-boot
+* spl - This is the secondary bootloader which boots the u-boot
   binary.
 
-  hawkboard_nand_config
-
-  The nand_spl ELF gets generated under nand_spl/u-boot-spl. This
-  needs to be processed with the AISGen tool for generating the AIS
-  signed image to be flashed. Steps for generating the AIS image are
-  explained here[3].
-
 * u-boot binary - This is the image flashed to the nand and copied to
-  the memory by the nand_spl.
+  the memory by the spl.
+
+  Both the images get compiled with hawkboard_config, with the TOPDIR
+  containing the u-boot images, and the spl image under the spl
+  directory.
 
-  hawkboard_config
+  The spl image needs to be processed with the AISGen tool for
+  generating the AIS signed image to be flashed. Steps for generating
+  the AIS image are explained here[3].
 
 * u-boot for uart boot - This is same as the u-boot binary generated
   above, with the sole difference of the CONFIG_SYS_TEXT_BASE being
@@ -59,17 +58,17 @@ Three images might be needed
 
 Flashing the images to Nand
 ===========================
-The nand_spl AIS image needs to be flashed to the block 1 of the
-Nand flash, as that is the location the RBL expects the image[4]. For
-flashing the nand_spl, boot over the u-boot specified in [1], and
-flash the image
+The spl AIS image needs to be flashed to the block 1 of the Nand
+flash, as that is the location the RBL expects the image[4]. For
+flashing the spl, boot over the u-boot specified in [1], and flash the
+image
 
 => tftpboot 0xc0700000 <nand_spl_ais.bin>
 => nand erase 0x20000 0x20000
 => nand write.e 0xc0700000 0x20000 <nand_spl_size>
 
 The u-boot binary is flashed at location 0xe0000(block 6) of the nand
-flash. The nand_spl loader expects the u-boot at this location. For
+flash. The spl loader expects the u-boot at this location. For
 flashing the u-boot binary
 
 => tftpboot 0xc0700000 u-boot.bin
index c74239d2ade911b76269b386caeac849a2c878d5..073e3fcb3c6ecc9a7dfa8af468c76f96b16bd4d5 100644 (file)
@@ -2,12 +2,13 @@
 Imximage Boot Image generation using mkimage
 ---------------------------------------------
 
-This document describes how to set up a U-Boot image
-that can be booted by Freescale MX25, MX35 and MX51
-processors via internal boot mode.
+This document describes how to set up a U-Boot image that can be booted
+by Freescale MX25, MX35, MX51, MX53 and MX6 processors via internal boot
+mode.
 
 These processors can boot directly from NAND, SPI flash and SD card flash
-using its internal boot ROM support. They can boot from an internal
+using its internal boot ROM support. MX6 processors additionally support
+boot from NOR flash and SATA disks. All processors can boot from an internal
 UART, if booting from device media fails.
 Booting from NOR flash does not require to use this image type.
 
@@ -59,12 +60,12 @@ Configuration command line syntax:
        --------------          -----------
        IMXIMAGE_VERSION        1/2
                                1 is for mx25/mx35/mx51 compatible,
-                               2 is for mx53 compatible,
+                               2 is for mx53/mx6 compatible,
                                others is invalid and error is generated.
                                This command need appear the fist before
                                other valid commands in configuration file.
 
-       BOOT_FROM               nand/spi/sd/onenand
+       BOOT_FROM               nand/spi/sd/onenand/nor/sata
                                Example:
                                BOOT_FROM spi
        DATA                    type address value
index 0dad6a2cb8968b4035c86ff8dabbe6e45d45f354..6ce6bbab80728db810d75196e0c5615b4e9efb0a 100644 (file)
@@ -25,6 +25,11 @@ the interfaces should be available.
 Menus are composed of items. Each item has a key used to identify it in
 the menu, and an opaque pointer to data controlled by the consumer.
 
+If you want to show a menu, instead starting the shell, define
+CONFIG_MENU_SHOW. You have to code the int menu_show(int bootdelay)
+function, which handle your menu. This function returns the remaining
+bootdelay.
+
 Interfaces
 ----------
 #include "menu.h"
@@ -69,6 +74,11 @@ int menu_get_choice(struct menu *m, void **choice);
  */
 int menu_destroy(struct menu *m);
 
+/*
+ * menu_display_statusline(struct menu *m);
+ * shows a statusline for every menu_display call.
+ */
+void menu_display_statusline(struct menu *m);
 
 Example Code
 ------------
diff --git a/doc/README.omap-ulpi-viewport b/doc/README.omap-ulpi-viewport
new file mode 100644 (file)
index 0000000..a5240b9
--- /dev/null
@@ -0,0 +1,27 @@
+Reference code ""drivers/usb/ulpi/omap-ulpi-viewport.c"
+
+Contains the ulpi read write api's to perform
+any ulpi phy port access on omap platform.
+
+On omap ehci reg map contains INSNREG05_ULPI
+register which offers the ulpi phy access so
+any ulpi phy commands should be passsed using this
+register.
+
+omap-ulpi-viewport.c is a low level function
+implementation of "drivers/usb/ulpi/ulpi.c"
+
+To enable and use omap-ulpi-viewport.c
+we require CONFIG_USB_ULPI_VIEWPORT_OMAP and
+CONFIG_USB_ULPI be enabled in config file.
+
+Any ulpi ops request can be done with ulpi.c
+and soc specific binding and usage is done with
+omap-ulpi-viewport implementation.
+
+Ex: scenario:
+omap-ehci driver code requests for ulpi phy reset if
+ehci is used in phy mode, which will call ulpi phy reset
+the ulpi phy reset does ulpi_read/write from viewport
+implementation which will do ulpi reset using the
+INSNREG05_ULPI register.
index 847c03226a6d161556084c2de9fff9397da6e6bf..cce21fbc5409bc9b0f206c3bb2b72e0f282c52c9 100644 (file)
@@ -884,7 +884,7 @@ static void bfin_ata_identify(struct ata_port *ap, int dev)
                sata_dev_desc[ap->port_no].removable = 0;
 
        sata_dev_desc[ap->port_no].lba = (u32) n_sectors;
-       debug("lba=0x%x\n", sata_dev_desc[ap->port_no].lba);
+       debug("lba=0x%lx\n", sata_dev_desc[ap->port_no].lba);
 
 #ifdef CONFIG_LBA48
        if (iop->command_set_2 & 0x0400)
index 8afb22159ab518e5ea3ed9acbba769220523c943..d58c18bc2a5b9ff05671172cab1d261efd15b781 100644 (file)
@@ -25,9 +25,7 @@
 #include <mmc.h>
 #include <asm/errno.h>
 #include <asm/io.h>
-#ifdef CONFIG_MX27
 #include <asm/arch/clock.h>
-#endif
 
 #define DRIVER_NAME "mxc-mmc"
 
@@ -422,7 +420,7 @@ static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios)
 {
        unsigned int divider;
        int prescaler = 0;
-       unsigned long clk_in = imx_get_perclk2();
+       unsigned long clk_in = mxc_get_clock(MXC_ESDHC_CLK);
 
        while (prescaler <= 0x800) {
                for (divider = 1; divider <= 0xF; divider++) {
@@ -509,8 +507,8 @@ static int mxcmci_initialize(bd_t *bis)
 
        mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
 
-       mmc->f_min = imx_get_perclk2() >> 7;
-       mmc->f_max = imx_get_perclk2() >> 1;
+       mmc->f_min = mxc_get_clock(MXC_ESDHC_CLK) >> 7;
+       mmc->f_max = mxc_get_clock(MXC_ESDHC_CLK) >> 1;
 
        mmc->b_max = 0;
 
index 5b4c9f69a18fe34b7f0033ce8799225e60045ad4..3191557c5be62e08304444149ea0983884516abe 100644 (file)
@@ -114,6 +114,14 @@ static void mmc_set_transfer_mode(struct mmc_host *host, struct mmc_data *data)
        if (data->flags & MMC_DATA_READ)
                mode |= TEGRA_MMC_TRNMOD_DATA_XFER_DIR_SEL_READ;
 
+       if (data->flags & MMC_DATA_WRITE) {
+               if ((uintptr_t)data->src & (ARCH_DMA_MINALIGN - 1))
+                       printf("Warning: unaligned write to %p may fail\n",
+                              data->src);
+               flush_dcache_range((ulong)data->src, (ulong)data->src +
+                       data->blocks * data->blocksize);
+       }
+
        writew(mode, &host->reg->trnmod);
 }
 
@@ -310,6 +318,14 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                        }
                }
                writel(mask, &host->reg->norintsts);
+               if (data->flags & MMC_DATA_READ) {
+                       if ((uintptr_t)data->dest & (ARCH_DMA_MINALIGN - 1))
+                               printf("Warning: unaligned read from %p "
+                                       "may fail\n", data->dest);
+                       invalidate_dcache_range((ulong)data->dest,
+                               (ulong)data->dest +
+                                       data->blocks * data->blocksize);
+               }
        }
 
        udelay(1000);
index 3ee060f859fc9646d27a61e271a2bc08253a8541..c7ddbb21d8ed95edd8463cbe69349df3e0d03b1a 100644 (file)
@@ -73,7 +73,7 @@ static void bfin_nfc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
        SSYNC();
 }
 
-int bfin_nfc_devready(struct mtd_info *mtd)
+static int bfin_nfc_devready(struct mtd_info *mtd)
 {
        pr_stamp();
        return (bfin_read_NFC_STAT() & NBUSY) ? 1 : 0;
index dfe542db64ef8371532af52029e4770dd9d04172..db8ba8bdacbe746129237a74f0488554530e019a 100644 (file)
@@ -66,7 +66,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        debug("data = 0x%08x \n", data);
 
        writel(KWSPI_SMEMRDIRQ, &spireg->irq_cause);
-       writel(KWSPI_IRQMASK, spireg->irq_mask);
+       writel(KWSPI_IRQMASK, &spireg->irq_mask);
 
        /* program mpp registers to select  SPI_CSn */
        if (cs) {
index 4c27fef3d183bc9a34ca0dc995cc6d662681bbee..adb9ca8ec8f92e7adc7c924aa8e5bba7bc2e4dad 100644 (file)
@@ -129,9 +129,15 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
        int len = bitlen / 8;
        const char *tx = dout;
        char *rx = din;
-
-       if (bitlen == 0)
-               return 0;
+       char dummy;
+
+       if (bitlen == 0) {
+               if (flags & SPI_XFER_END) {
+                       rx = &dummy;
+                       len = 1;
+               } else
+                       return 0;
+       }
 
        if (!rx && !tx)
                return 0;
index 77e217f34fa3712b80c74f0a3941bb72a426cb7c..7c4df534bf2bfd4c1ab69c70d265ce2297a42db8 100644 (file)
@@ -43,9 +43,10 @@ endif
 COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 COBJS-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
 COBJS-$(CONFIG_USB_EHCI_MX5) += ehci-mx5.o
+COBJS-$(CONFIG_USB_EHCI_OMAP) += ehci-omap.o
 COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o
 COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
-COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o
+COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
 COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 
diff --git a/drivers/usb/host/ehci-kirkwood.c b/drivers/usb/host/ehci-kirkwood.c
deleted file mode 100644 (file)
index 6300587..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * (C) Copyright 2009
- * Marvell Semiconductor <www.marvell.com>
- * Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <usb.h>
-#include "ehci.h"
-#include "ehci-core.h"
-#include <asm/arch/cpu.h>
-#include <asm/arch/kirkwood.h>
-
-#define rdl(off)       readl(KW_USB20_BASE + (off))
-#define wrl(off, val)  writel((val), KW_USB20_BASE + (off))
-
-#define USB_WINDOW_CTRL(i)     (0x320 + ((i) << 4))
-#define USB_WINDOW_BASE(i)     (0x324 + ((i) << 4))
-#define USB_TARGET_DRAM                0x0
-
-/*
- * USB 2.0 Bridge Address Decoding registers setup
- */
-static void usb_brg_adrdec_setup(void)
-{
-       int i;
-       u32 size, attrib;
-
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
-
-               /* Enable DRAM bank */
-               switch (i) {
-               case 0:
-                       attrib = KWCPU_ATTR_DRAM_CS0;
-                       break;
-               case 1:
-                       attrib = KWCPU_ATTR_DRAM_CS1;
-                       break;
-               case 2:
-                       attrib = KWCPU_ATTR_DRAM_CS2;
-                       break;
-               case 3:
-                       attrib = KWCPU_ATTR_DRAM_CS3;
-                       break;
-               default:
-                       /* invalide bank, disable access */
-                       attrib = 0;
-                       break;
-               }
-
-               size = kw_sdram_bs(i);
-               if ((size) && (attrib))
-                       wrl(USB_WINDOW_CTRL(i),
-                               KWCPU_WIN_CTRL_DATA(size, USB_TARGET_DRAM,
-                                       attrib, KWCPU_WIN_ENABLE));
-               else
-                       wrl(USB_WINDOW_CTRL(i), KWCPU_WIN_DISABLE);
-
-               wrl(USB_WINDOW_BASE(i), kw_sdram_bar(i));
-       }
-}
-
-/*
- * Create the appropriate control structures to manage
- * a new EHCI host controller.
- */
-int ehci_hcd_init(void)
-{
-       usb_brg_adrdec_setup();
-
-       hccr = (struct ehci_hccr *)(KW_USB20_BASE + 0x100);
-       hcor = (struct ehci_hcor *)((uint32_t) hccr
-                       + HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
-
-       debug("Kirkwood-ehci: init hccr %x and hcor %x hc_length %d\n",
-               (uint32_t)hccr, (uint32_t)hcor,
-               (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
-
-       return 0;
-}
-
-/*
- * Destroy the appropriate control structures corresponding
- * the the EHCI host controller.
- */
-int ehci_hcd_stop(void)
-{
-       return 0;
-}
diff --git a/drivers/usb/host/ehci-marvell.c b/drivers/usb/host/ehci-marvell.c
new file mode 100644 (file)
index 0000000..89c8af7
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <usb.h>
+#include "ehci.h"
+#include "ehci-core.h"
+#include <asm/arch/cpu.h>
+
+#if defined(CONFIG_KIRKWOOD)
+#include <asm/arch/kirkwood.h>
+#elif defined(CONFIG_ORION5X)
+#include <asm/arch/orion5x.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define rdl(off)       readl(MVUSB0_BASE + (off))
+#define wrl(off, val)  writel((val), MVUSB0_BASE + (off))
+
+#define USB_WINDOW_CTRL(i)     (0x320 + ((i) << 4))
+#define USB_WINDOW_BASE(i)     (0x324 + ((i) << 4))
+#define USB_TARGET_DRAM                0x0
+
+/*
+ * USB 2.0 Bridge Address Decoding registers setup
+ */
+static void usb_brg_adrdec_setup(void)
+{
+       int i;
+       u32 size, base, attrib;
+
+       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+
+               /* Enable DRAM bank */
+               switch (i) {
+               case 0:
+                       attrib = MVUSB0_CPU_ATTR_DRAM_CS0;
+                       break;
+               case 1:
+                       attrib = MVUSB0_CPU_ATTR_DRAM_CS1;
+                       break;
+               case 2:
+                       attrib = MVUSB0_CPU_ATTR_DRAM_CS2;
+                       break;
+               case 3:
+                       attrib = MVUSB0_CPU_ATTR_DRAM_CS3;
+                       break;
+               default:
+                       /* invalide bank, disable access */
+                       attrib = 0;
+                       break;
+               }
+
+               size = gd->bd->bi_dram[i].size;
+               base = gd->bd->bi_dram[i].start;
+               if ((size) && (attrib))
+                       wrl(USB_WINDOW_CTRL(i),
+                               MVCPU_WIN_CTRL_DATA(size, USB_TARGET_DRAM,
+                                       attrib, MVCPU_WIN_ENABLE));
+               else
+                       wrl(USB_WINDOW_CTRL(i), MVCPU_WIN_DISABLE);
+
+               wrl(USB_WINDOW_BASE(i), base);
+       }
+}
+
+/*
+ * Create the appropriate control structures to manage
+ * a new EHCI host controller.
+ */
+int ehci_hcd_init(void)
+{
+       usb_brg_adrdec_setup();
+
+       hccr = (struct ehci_hccr *)(MVUSB0_BASE + 0x100);
+       hcor = (struct ehci_hcor *)((uint32_t) hccr
+                       + HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
+
+       debug("ehci-marvell: init hccr %x and hcor %x hc_length %d\n",
+               (uint32_t)hccr, (uint32_t)hcor,
+               (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
+
+       return 0;
+}
+
+/*
+ * Destroy the appropriate control structures corresponding
+ * the the EHCI host controller.
+ */
+int ehci_hcd_stop(void)
+{
+       return 0;
+}
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
new file mode 100644 (file)
index 0000000..00f787f
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * (C) Copyright 2011 Ilya Yanok, Emcraft Systems
+ * (C) Copyright 2004-2008
+ * Texas Instruments, <www.ti.com>
+ *
+ * Derived from Beagle Board code by
+ *     Sunil Kumar <sunilsaini05@gmail.com>
+ *     Shashi Ranjan <shashiranjanmca05@gmail.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.
+ */
+#include <common.h>
+#include <usb.h>
+#include <usb/ulpi.h>
+#include <errno.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+#include <asm/arch/ehci.h>
+#include <asm/ehci-omap.h>
+#include "ehci-core.h"
+
+static struct omap_uhh *const uhh = (struct omap_uhh *)OMAP_UHH_BASE;
+static struct omap_usbtll *const usbtll = (struct omap_usbtll *)OMAP_USBTLL_BASE;
+static struct omap_ehci *const ehci = (struct omap_ehci *)OMAP_EHCI_BASE;
+
+static int omap_uhh_reset(void)
+{
+       unsigned long init = get_timer(0);
+
+       /* perform UHH soft reset, and wait until reset is complete */
+       writel(OMAP_UHH_SYSCONFIG_SOFTRESET, &uhh->sysc);
+
+       /* Wait for UHH reset to complete */
+       while (!(readl(&uhh->syss) & OMAP_UHH_SYSSTATUS_EHCI_RESETDONE))
+               if (get_timer(init) > CONFIG_SYS_HZ) {
+                       debug("OMAP UHH error: timeout resetting ehci\n");
+                       return -EL3RST;
+               }
+
+       return 0;
+}
+
+static int omap_ehci_tll_reset(void)
+{
+       unsigned long init = get_timer(0);
+
+       /* perform TLL soft reset, and wait until reset is complete */
+       writel(OMAP_USBTLL_SYSCONFIG_SOFTRESET, &usbtll->sysc);
+
+       /* Wait for TLL reset to complete */
+       while (!(readl(&usbtll->syss) & OMAP_USBTLL_SYSSTATUS_RESETDONE))
+               if (get_timer(init) > CONFIG_SYS_HZ) {
+                       debug("OMAP EHCI error: timeout resetting TLL\n");
+                       return -EL3RST;
+       }
+
+       return 0;
+}
+
+static void omap_usbhs_hsic_init(int port)
+{
+       unsigned int reg;
+
+       /* Enable channels now */
+       reg = readl(&usbtll->channel_conf + port);
+
+       setbits_le32(&reg, (OMAP_TLL_CHANNEL_CONF_CHANMODE_TRANSPARENT_UTMI
+               | OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
+               | OMAP_TLL_CHANNEL_CONF_DRVVBUS
+               | OMAP_TLL_CHANNEL_CONF_CHRGVBUS
+               | OMAP_TLL_CHANNEL_CONF_CHANEN));
+
+       writel(reg, &usbtll->channel_conf + port);
+}
+
+static void omap_ehci_soft_phy_reset(int port)
+{
+       struct ulpi_viewport ulpi_vp;
+
+       ulpi_vp.viewport_addr = (u32)&ehci->insreg05_utmi_ulpi;
+       ulpi_vp.port_num = port;
+
+       ulpi_reset(&ulpi_vp);
+}
+
+inline int __board_usb_init(void)
+{
+       return 0;
+}
+int board_usb_init(void) __attribute__((weak, alias("__board_usb_init")));
+
+#if defined(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO) || \
+       defined(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO)
+/* controls PHY(s) reset signal(s) */
+static inline void omap_ehci_phy_reset(int on, int delay)
+{
+       /*
+        * Refer ISSUE1:
+        * Hold the PHY in RESET for enough time till
+        * PHY is settled and ready
+        */
+       if (delay && !on)
+               udelay(delay);
+#ifdef CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
+       gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB PHY1 reset");
+       gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, !on);
+#endif
+#ifdef CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
+       gpio_request(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, "USB PHY2 reset");
+       gpio_direction_output(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, !on);
+#endif
+
+       /* Hold the PHY in RESET for enough time till DIR is high */
+       /* Refer: ISSUE1 */
+       if (delay && on)
+               udelay(delay);
+}
+#else
+#define omap_ehci_phy_reset(on, delay) do {} while (0)
+#endif
+
+/* Reset is needed otherwise the kernel-driver will throw an error. */
+int omap_ehci_hcd_stop(void)
+{
+       debug("Resetting OMAP EHCI\n");
+       omap_ehci_phy_reset(1, 0);
+
+       if (omap_uhh_reset() < 0)
+               return -1;
+
+       if (omap_ehci_tll_reset() < 0)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * Initialize the OMAP EHCI controller and PHY.
+ * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1
+ * See there for additional Copyrights.
+ */
+int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata)
+{
+       int ret;
+       unsigned int i, reg = 0, rev = 0;
+
+       debug("Initializing OMAP EHCI\n");
+
+       ret = board_usb_init();
+       if (ret < 0)
+               return ret;
+
+       /* Put the PHY in RESET */
+       omap_ehci_phy_reset(1, 10);
+
+       ret = omap_uhh_reset();
+       if (ret < 0)
+               return ret;
+
+       ret = omap_ehci_tll_reset();
+       if (ret)
+               return ret;
+
+       writel(OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
+               OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
+               OMAP_USBTLL_SYSCONFIG_CACTIVITY, &usbtll->sysc);
+
+       /* Put UHH in NoIdle/NoStandby mode */
+       writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+
+       /* setup ULPI bypass and burst configurations */
+       clrsetbits_le32(&reg, OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN,
+               (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN |
+               OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN |
+               OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN));
+
+       rev = readl(&uhh->rev);
+       if (rev == OMAP_USBHS_REV1) {
+               if (is_ehci_phy_mode(usbhs_pdata->port_mode[0]))
+                       clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
+               else
+                       setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
+
+               if (is_ehci_phy_mode(usbhs_pdata->port_mode[1]))
+                       clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS);
+               else
+                       setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
+
+               if (is_ehci_phy_mode(usbhs_pdata->port_mode[2]))
+                       clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS);
+               else
+                       setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
+       } else if (rev == OMAP_USBHS_REV2) {
+               clrsetbits_le32(&reg, (OMAP_P1_MODE_CLEAR | OMAP_P2_MODE_CLEAR),
+                                       OMAP4_UHH_HOSTCONFIG_APP_START_CLK);
+
+               /* Clear port mode fields for PHY mode*/
+
+               if (is_ehci_hsic_mode(usbhs_pdata->port_mode[0]))
+                       setbits_le32(&reg, OMAP_P1_MODE_HSIC);
+
+               if (is_ehci_hsic_mode(usbhs_pdata->port_mode[1]))
+                       setbits_le32(&reg, OMAP_P2_MODE_HSIC);
+
+               if (is_ehci_hsic_mode(usbhs_pdata->port_mode[2]))
+                       setbits_le32(&reg, OMAP_P3_MODE_HSIC);
+       }
+
+       debug("OMAP UHH_REVISION 0x%x\n", rev);
+       writel(reg, &uhh->hostconfig);
+
+       for (i = 0; i < OMAP_HS_USB_PORTS; i++)
+               if (is_ehci_hsic_mode(usbhs_pdata->port_mode[i]))
+                       omap_usbhs_hsic_init(i);
+
+       omap_ehci_phy_reset(0, 10);
+
+       /*
+        * An undocumented "feature" in the OMAP3 EHCI controller,
+        * causes suspended ports to be taken out of suspend when
+        * the USBCMD.Run/Stop bit is cleared (for example when
+        * we do ehci_bus_suspend).
+        * This breaks suspend-resume if the root-hub is allowed
+        * to suspend. Writing 1 to this undocumented register bit
+        * disables this feature and restores normal behavior.
+        */
+       writel(EHCI_INSNREG04_DISABLE_UNSUSPEND, &ehci->insreg04);
+
+       for (i = 0; i < OMAP_HS_USB_PORTS; i++)
+               if (is_ehci_phy_mode(usbhs_pdata->port_mode[i]))
+                       omap_ehci_soft_phy_reset(i);
+
+       dcache_disable();
+       hccr = (struct ehci_hccr *)(OMAP_EHCI_BASE);
+       hcor = (struct ehci_hcor *)(OMAP_EHCI_BASE + 0x10);
+
+       debug("OMAP EHCI init done\n");
+       return 0;
+}
index d43b2293e1f0badb0db008a25017b53df253b823..281eb1c5c12cb8876935e31e28c2e1c7d5ee673e 100644 (file)
@@ -24,6 +24,7 @@ LIB   := $(obj)libusb_ulpi.o
 
 COBJS-$(CONFIG_USB_ULPI)               += ulpi.o
 COBJS-$(CONFIG_USB_ULPI_VIEWPORT)      += ulpi-viewport.o
+COBJS-$(CONFIG_USB_ULPI_VIEWPORT_OMAP) += omap-ulpi-viewport.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/ulpi/omap-ulpi-viewport.c b/drivers/usb/ulpi/omap-ulpi-viewport.c
new file mode 100644 (file)
index 0000000..3c1ea1a
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * OMAP ulpi viewport support
+ * Based on drivers/usb/ulpi/ulpi-viewport.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * Author: Govindraj R <govindraj.raja@ti.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <usb/ulpi.h>
+
+#define OMAP_ULPI_WR_OPSEL     (3 << 21)
+#define OMAP_ULPI_ACCESS       (1 << 31)
+
+/*
+ * Wait for the ULPI Access to complete
+ */
+static int ulpi_wait(struct ulpi_viewport *ulpi_vp, u32 mask)
+{
+       int timeout = CONFIG_USB_ULPI_TIMEOUT;
+
+       while (--timeout) {
+               if ((readl(ulpi_vp->viewport_addr) & mask))
+                       return 0;
+
+               udelay(1);
+       }
+
+       return ULPI_ERROR;
+}
+
+/*
+ * Wake the ULPI PHY up for communication
+ *
+ * returns 0 on success.
+ */
+static int ulpi_wakeup(struct ulpi_viewport *ulpi_vp)
+{
+       int err;
+
+       if (readl(ulpi_vp->viewport_addr) & OMAP_ULPI_ACCESS)
+               return 0; /* already awake */
+
+       writel(OMAP_ULPI_ACCESS, ulpi_vp->viewport_addr);
+
+       err = ulpi_wait(ulpi_vp, OMAP_ULPI_ACCESS);
+       if (err)
+               debug("ULPI wakeup timed out\n");
+
+       return err;
+}
+
+/*
+ * Issue a ULPI read/write request
+ */
+static int ulpi_request(struct ulpi_viewport *ulpi_vp, u32 value)
+{
+       int err;
+
+       err = ulpi_wakeup(ulpi_vp);
+       if (err)
+               return err;
+
+       writel(value, ulpi_vp->viewport_addr);
+
+       err = ulpi_wait(ulpi_vp, OMAP_ULPI_ACCESS);
+       if (err)
+               debug("ULPI request timed out\n");
+
+       return err;
+}
+
+int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value)
+{
+       u32 val = ((ulpi_vp->port_num & 0xf) << 24) |
+                       OMAP_ULPI_WR_OPSEL | ((u32)reg << 16) | (value & 0xff);
+
+       return ulpi_request(ulpi_vp, val);
+}
+
+u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg)
+{
+       int err;
+       u32 val = ((ulpi_vp->port_num & 0xf) << 24) |
+                        OMAP_ULPI_WR_OPSEL | ((u32)reg << 16);
+
+       err = ulpi_request(ulpi_vp, val);
+       if (err)
+               return err;
+
+       return readl(ulpi_vp->viewport_addr) & 0xff;
+}
index 490fb0e25d8ca4c5c80ff5fd40ba3e0cd9d6247e..b4974ed2a6cd8e418235bf37e1cdc5bed3d77351 100644 (file)
  *
  * returns 0 on mask match, ULPI_ERROR on time out.
  */
-static int ulpi_wait(u32 ulpi_viewport, u32 mask)
+static int ulpi_wait(struct ulpi_viewport *ulpi_vp, u32 mask)
 {
        int timeout = CONFIG_USB_ULPI_TIMEOUT;
 
        /* Wait for the bits in mask to become zero. */
        while (--timeout) {
-               if ((readl(ulpi_viewport) & mask) == 0)
+               if ((readl(ulpi_vp->viewport_addr) & mask) == 0)
                        return 0;
 
                udelay(1);
@@ -60,16 +60,16 @@ static int ulpi_wait(u32 ulpi_viewport, u32 mask)
  *
  * returns 0 on success.
  */
-static int ulpi_wakeup(u32 ulpi_viewport)
+static int ulpi_wakeup(struct ulpi_viewport *ulpi_vp)
 {
        int err;
 
-       if (readl(ulpi_viewport) & ULPI_SS)
+       if (readl(ulpi_vp->viewport_addr) & ULPI_SS)
                return 0; /* already awake */
 
-       writel(ULPI_WU, ulpi_viewport);
+       writel(ULPI_WU, ulpi_vp->viewport_addr);
 
-       err = ulpi_wait(ulpi_viewport, ULPI_WU);
+       err = ulpi_wait(ulpi_vp, ULPI_WU);
        if (err)
                printf("ULPI wakeup timed out\n");
 
@@ -81,38 +81,40 @@ static int ulpi_wakeup(u32 ulpi_viewport)
  *
  * @value - the ULPI request
  */
-static int ulpi_request(u32 ulpi_viewport, u32 value)
+static int ulpi_request(struct ulpi_viewport *ulpi_vp, u32 value)
 {
        int err;
 
-       err = ulpi_wakeup(ulpi_viewport);
+       err = ulpi_wakeup(ulpi_vp);
        if (err)
                return err;
 
-       writel(value, ulpi_viewport);
+       writel(value, ulpi_vp->viewport_addr);
 
-       err = ulpi_wait(ulpi_viewport, ULPI_RWRUN);
+       err = ulpi_wait(ulpi_vp, ULPI_RWRUN);
        if (err)
                printf("ULPI request timed out\n");
 
        return err;
 }
 
-int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value)
+int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value)
 {
        u32 val = ULPI_RWRUN | ULPI_RWCTRL | ((u32)reg << 16) | (value & 0xff);
 
-       return ulpi_request(ulpi_viewport, val);
+       val |= (ulpi_vp->port_num & 0x7) << 24;
+       return ulpi_request(ulpi_vp, val);
 }
 
-u32 ulpi_read(u32 ulpi_viewport, u8 *reg)
+u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg)
 {
        int err;
        u32 val = ULPI_RWRUN | ((u32)reg << 16);
 
-       err = ulpi_request(ulpi_viewport, val);
+       val |= (ulpi_vp->port_num & 0x7) << 24;
+       err = ulpi_request(ulpi_vp, val);
        if (err)
                return err;
 
-       return (readl(ulpi_viewport) >> 8) & 0xff;
+       return (readl(ulpi_vp->viewport_addr) >> 8) & 0xff;
 }
index 6202227992233fdda2cd2f40a6301d1671e9049e..dde2585c58b8419465278701b925de8858a9430b 100644 (file)
 
 static struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
 
-static int ulpi_integrity_check(u32 ulpi_viewport)
+static int ulpi_integrity_check(struct ulpi_viewport *ulpi_vp)
 {
        u32 val, tval = ULPI_TEST_VALUE;
        int err, i;
 
        /* Use the 'special' test value to check all bits */
        for (i = 0; i < 2; i++, tval <<= 1) {
-               err = ulpi_write(ulpi_viewport, &ulpi->scratch, tval);
+               err = ulpi_write(ulpi_vp, &ulpi->scratch, tval);
                if (err)
                        return err;
 
-               val = ulpi_read(ulpi_viewport, &ulpi->scratch);
+               val = ulpi_read(ulpi_vp, &ulpi->scratch);
                if (val != tval) {
                        printf("ULPI integrity check failed\n");
                        return val;
@@ -58,7 +58,7 @@ static int ulpi_integrity_check(u32 ulpi_viewport)
        return 0;
 }
 
-int ulpi_init(u32 ulpi_viewport)
+int ulpi_init(struct ulpi_viewport *ulpi_vp)
 {
        u32 val, id = 0;
        u8 *reg = &ulpi->product_id_high;
@@ -66,7 +66,7 @@ int ulpi_init(u32 ulpi_viewport)
 
        /* Assemble ID from four ULPI ID registers (8 bits each). */
        for (i = 0; i < ULPI_ID_REGS_COUNT; i++) {
-               val = ulpi_read(ulpi_viewport, reg - i);
+               val = ulpi_read(ulpi_vp, reg - i);
                if (val == ULPI_ERROR)
                        return val;
 
@@ -76,10 +76,10 @@ int ulpi_init(u32 ulpi_viewport)
        /* Split ID into vendor and product ID. */
        debug("ULPI transceiver ID 0x%04x:0x%04x\n", id >> 16, id & 0xffff);
 
-       return ulpi_integrity_check(ulpi_viewport);
+       return ulpi_integrity_check(ulpi_vp);
 }
 
-int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed)
+int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed)
 {
        u32 tspeed = ULPI_FC_FULL_SPEED;
        u32 val;
@@ -96,17 +96,18 @@ int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed)
                        "falling back to full speed\n", __func__, speed);
        }
 
-       val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
+       val = ulpi_read(ulpi_vp, &ulpi->function_ctrl);
        if (val == ULPI_ERROR)
                return val;
 
        /* clear the previous speed setting */
        val = (val & ~ULPI_FC_XCVRSEL_MASK) | tspeed;
 
-       return ulpi_write(ulpi_viewport, &ulpi->function_ctrl, val);
+       return ulpi_write(ulpi_vp, &ulpi->function_ctrl, val);
 }
 
-int ulpi_set_vbus(u32 ulpi_viewport, int on, int ext_power, int ext_ind)
+int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power,
+                       int ext_ind)
 {
        u32 flags = ULPI_OTG_DRVVBUS;
        u8 *reg = on ? &ulpi->otg_ctrl_set : &ulpi->otg_ctrl_clear;
@@ -116,18 +117,18 @@ int ulpi_set_vbus(u32 ulpi_viewport, int on, int ext_power, int ext_ind)
        if (ext_ind)
                flags |= ULPI_OTG_EXTVBUSIND;
 
-       return ulpi_write(ulpi_viewport, reg, flags);
+       return ulpi_write(ulpi_vp, reg, flags);
 }
 
-int ulpi_set_pd(u32 ulpi_viewport, int enable)
+int ulpi_set_pd(struct ulpi_viewport *ulpi_vp, int enable)
 {
        u32 val = ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN;
        u8 *reg = enable ? &ulpi->otg_ctrl_set : &ulpi->otg_ctrl_clear;
 
-       return ulpi_write(ulpi_viewport, reg, val);
+       return ulpi_write(ulpi_vp, reg, val);
 }
 
-int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode)
+int ulpi_opmode_sel(struct ulpi_viewport *ulpi_vp, unsigned opmode)
 {
        u32 topmode = ULPI_FC_OPMODE_NORMAL;
        u32 val;
@@ -144,17 +145,17 @@ int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode)
                        "falling back to OpMode Normal\n", __func__, opmode);
        }
 
-       val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
+       val = ulpi_read(ulpi_vp, &ulpi->function_ctrl);
        if (val == ULPI_ERROR)
                return val;
 
        /* clear the previous opmode setting */
        val = (val & ~ULPI_FC_OPMODE_MASK) | topmode;
 
-       return ulpi_write(ulpi_viewport, &ulpi->function_ctrl, val);
+       return ulpi_write(ulpi_vp, &ulpi->function_ctrl, val);
 }
 
-int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode)
+int ulpi_serial_mode_enable(struct ulpi_viewport *ulpi_vp, unsigned smode)
 {
        switch (smode) {
        case ULPI_IFACE_6_PIN_SERIAL_MODE:
@@ -166,14 +167,14 @@ int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode)
                return ULPI_ERROR;
        }
 
-       return ulpi_write(ulpi_viewport, &ulpi->iface_ctrl_set, smode);
+       return ulpi_write(ulpi_vp, &ulpi->iface_ctrl_set, smode);
 }
 
-int ulpi_suspend(u32 ulpi_viewport)
+int ulpi_suspend(struct ulpi_viewport *ulpi_vp)
 {
        int err;
 
-       err = ulpi_write(ulpi_viewport, &ulpi->function_ctrl_clear,
+       err = ulpi_write(ulpi_vp, &ulpi->function_ctrl_clear,
                        ULPI_FC_SUSPENDM);
        if (err)
                printf("ULPI: %s: failed writing the suspend bit\n", __func__);
@@ -186,7 +187,7 @@ int ulpi_suspend(u32 ulpi_viewport)
  * Actual wait for reset must be done in a view port specific way,
  * because it involves checking the DIR line.
  */
-static int __ulpi_reset_wait(u32 ulpi_viewport)
+static int __ulpi_reset_wait(struct ulpi_viewport *ulpi_vp)
 {
        u32 val;
        int timeout = CONFIG_USB_ULPI_TIMEOUT;
@@ -199,7 +200,7 @@ static int __ulpi_reset_wait(u32 ulpi_viewport)
                 * for the error of ulpi_read(), if there is one, then
                 * there will be a timeout.
                 */
-               val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
+               val = ulpi_read(ulpi_vp, &ulpi->function_ctrl);
                if (!(val & ULPI_FC_RESET))
                        return 0;
 
@@ -210,18 +211,19 @@ static int __ulpi_reset_wait(u32 ulpi_viewport)
 
        return ULPI_ERROR;
 }
-int ulpi_reset_wait(u32) __attribute__((weak, alias("__ulpi_reset_wait")));
+int ulpi_reset_wait(struct ulpi_viewport *ulpi_vp)
+       __attribute__((weak, alias("__ulpi_reset_wait")));
 
-int ulpi_reset(u32 ulpi_viewport)
+int ulpi_reset(struct ulpi_viewport *ulpi_vp)
 {
        int err;
 
-       err = ulpi_write(ulpi_viewport,
+       err = ulpi_write(ulpi_vp,
                        &ulpi->function_ctrl_set, ULPI_FC_RESET);
        if (err) {
                printf("ULPI: %s: failed writing reset bit\n", __func__);
                return err;
        }
 
-       return ulpi_reset_wait(ulpi_viewport);
+       return ulpi_reset_wait(ulpi_vp);
 }
index 3df1defab16f3f690b7d6880b96046e48f46ed95..a2c6b27d43cce33d1a00a033e4b33c895c4e1d8d 100644 (file)
@@ -265,7 +265,8 @@ int run_command     (const char *cmd, int flag);
 int run_command2(const char *cmd, int flag);
 #endif
 int    readline        (const char *const prompt);
-int    readline_into_buffer    (const char *const prompt, char * buffer);
+int    readline_into_buffer(const char *const prompt, char *buffer,
+                       int timeout);
 int    parse_line (char *, char *[]);
 void   init_cmd_timeout(void);
 void   reset_cmd_timeout(void);
@@ -284,6 +285,7 @@ int last_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
 extern u8 _binary_dt_dtb_start[];      /* embedded device tree blob */
+int set_cpu_clk_info(void);
 
 /*
  * Called when console output is requested before the console is available.
index 16db98fe57cc09ade05355328ed085d32922d0f6..c26cb639b3ec2aac4b1c36ad96f9801e7c3338d6 100644 (file)
 #define CONFIG_ENV_SECT_SIZE   0x10000
 #elif defined(CONFIG_RAMBOOT_SDCARD)
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_SYS_MMC_ENV_DEV  0
 #else
index af4609f841393a407287885232811108f239e24e..f2d33668d8d363497312ca6203e63f03ce36d7be 100644 (file)
@@ -519,10 +519,6 @@ extern unsigned long get_sdram_size(void);
 #endif
 
 #if defined(CONFIG_TSEC_ENET)
-#ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI
-#endif
-
 #define CONFIG_MII                     /* MII PHY management */
 #define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
 #define CONFIG_TSEC1   1
@@ -609,6 +605,7 @@ extern unsigned long get_sdram_size(void);
 #if defined(CONFIG_SYS_RAMBOOT)
 #if defined(CONFIG_RAMBOOT_SDCARD)
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_SYS_MMC_ENV_DEV         0
 #define CONFIG_ENV_SIZE                        0x2000
 #elif defined(CONFIG_RAMBOOT_SPIFLASH)
index cee788ab1310c4f070d7f4524f34e99c9670b275..2ac93be4ec59c277dfa3bdf62dd1dde01eb42cc3 100644 (file)
@@ -518,6 +518,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
        #define CONFIG_ENV_OFFSET       ((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE)
 #elif defined(CONFIG_RAMBOOT_SDCARD)
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_ENV_SIZE                        0x2000
 #define CONFIG_SYS_MMC_ENV_DEV         0
 #elif defined(CONFIG_RAMBOOT_SPIFLASH)
index cf20d2b2eee2bf5444da0b9ea1db3ba50b8e4d4c..365322c6a59788bffaa4cfc3e3a8cdeae74057f8 100644 (file)
@@ -350,6 +350,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  */
 #if defined(CONFIG_RAMBOOT_SDCARD)
        #define CONFIG_ENV_IS_IN_MMC    1
+       #define CONFIG_FSL_FIXED_MMC_LOCATION
        #define CONFIG_ENV_SIZE         0x2000
        #define CONFIG_SYS_MMC_ENV_DEV  0
 #elif defined(CONFIG_RAMBOOT_SPIFLASH)
index 2d9657a15347d5c038bc38ebf80a8cea2ead245b..f0eb0294aa72568740ce4bd5180a351c41b79ef6 100644 (file)
  */
 #if defined(CONFIG_SDCARD)
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_ENV_SIZE                        0x2000
 #define CONFIG_SYS_MMC_ENV_DEV         0
 #elif defined(CONFIG_SPIFLASH)
index a48055e2c5e9d19b1bd4d242775a54be8f18831f..da98f8f027481cda6336239580031c2df693ff31 100644 (file)
@@ -92,6 +92,7 @@
 #elif defined(CONFIG_SDCARD)
        #define CONFIG_SYS_EXTRA_ENV_RELOC
        #define CONFIG_ENV_IS_IN_MMC
+       #define CONFIG_FSL_FIXED_MMC_LOCATION
        #define CONFIG_SYS_MMC_ENV_DEV          0
        #define CONFIG_ENV_SIZE                 0x2000
        #define CONFIG_ENV_OFFSET               (512 * 1097)
index f4f93059fac24c6cb9047c77c97aa1506b173433..cde0fd67abff2e783611bfbefb1f18a84d9f914e 100644 (file)
  *
  * if CONFIG_ETHER_ON_SCC is selected, then
  *   - CONFIG_ETHER_INDEX must be set to the channel number (1-4)
- *   - CONFIG_NET_MULTI must not be defined
  *
  * if CONFIG_ETHER_ON_FCC is selected, then
  *   - one or more CONFIG_ETHER_ON_FCCx (x=1,2,3) must also be selected
- *   - CONFIG_NET_MULTI must be defined
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
index 28666d646b32e8c8e5fa8d60855b0b4413ee65d5..74ced5ae22f06505520530cd6bb1d17b347afe44 100644 (file)
  *
  * if CONFIG_ETHER_ON_SCC is selected, then
  *   - CONFIG_ETHER_INDEX must be set to the channel number (1-4)
- *   - CONFIG_NET_MULTI must not be defined
  *
  * if CONFIG_ETHER_ON_FCC is selected, then
  *   - one or more CONFIG_ETHER_ON_FCCx (x=1,2,3) must also be selected
- *   - CONFIG_NET_MULTI must be defined
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
index 5cc8ece7de6672d6142697c3c400bee434b6ae34..76cd394db220b002fe15153aa6f1389f2b3cc362 100644 (file)
 /* Boot Argument Buffer Size */
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
 
-/* to be activated as soon as s3c24x0 has print_cpuinfo support */
-/*#define CONFIG_DISPLAY_CPUINFO*/                     /* Display cpu info */
+#define CONFIG_DISPLAY_CPUINFO                         /* Display cpu info */
 #define CONFIG_DISPLAY_BOARDINFO                       /* Display board info */
 
 #define CONFIG_SYS_MEMTEST_START       0x30000000      /* memtest works on */
index f797f3ffd97f0425614404e4b78ef0a980495e18..b5f75d1e8da7a39704ebef21409479792f28633c 100644 (file)
        "console=ttyO2,115200n8\0" \
        "mmcdev=0\0" \
        "mmcargs=setenv bootargs console=${console} " \
-               "root=/dev/mmcblk0p2 rw " \
-               "rootfstype=ext3 rootwait\0" \
+               "root=/dev/mmcblk0p2 rw rootwait\0" \
        "nandargs=setenv bootargs console=${console} " \
                "root=/dev/mtdblock4 rw " \
                "rootfstype=jffs2\0" \
diff --git a/include/configs/br4.h b/include/configs/br4.h
new file mode 100644 (file)
index 0000000..ef3752d
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * U-boot - Configuration file for BR4 Appliance
+ *
+ * based on bf537-stamp.h
+ * Copyright (c) Switchfin Org. <dpn@switchfin.org>
+ */
+
+#ifndef __CONFIG_BR4_H__
+#define __CONFIG_BR4_H__
+
+#include <asm/config-pre.h>
+
+
+/*
+ * Processor Settings
+ */
+#define CONFIG_BFIN_CPU             bf537-0.3
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
+
+
+/*
+ * Clock Settings
+ *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
+ *     SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
+ */
+/* CONFIG_CLKIN_HZ is any value in Hz                                  */
+#define CONFIG_CLKIN_HZ                        25000000
+/* CLKIN_HALF controls the DF bit in PLL_CTL      0 = CLKIN            */
+/*                                                1 = CLKIN / 2                */
+#define CONFIG_CLKIN_HALF              0
+/* PLL_BYPASS controls the BYPASS bit in PLL_CTL  0 = do not bypass    */
+/*                                                1 = bypass PLL       */
+#define CONFIG_PLL_BYPASS              0
+/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL             */
+/* Values can range from 0-63 (where 0 means 64)                       */
+#define CONFIG_VCO_MULT                        24
+/* CCLK_DIV controls the core clock divider                            */
+/* Values can be 1, 2, 4, or 8 ONLY                                    */
+#define CONFIG_CCLK_DIV                        1
+/* SCLK_DIV controls the system clock divider                          */
+/* Values can range from 1-15                                          */
+#define CONFIG_SCLK_DIV                        5
+
+
+/*
+ * Memory Settings
+ */
+#define CONFIG_MEM_ADD_WDTH    10
+#define CONFIG_MEM_SIZE                64
+
+#define CONFIG_EBIU_SDRRC_VAL  0x306
+#define CONFIG_EBIU_SDGCTL_VAL 0x8091998d
+
+#define CONFIG_EBIU_AMGCTL_VAL 0xFF
+#define CONFIG_EBIU_AMBCTL0_VAL        0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL        0xFFC27BB0
+
+#define CONFIG_SYS_MONITOR_LEN         (512 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (384 * 1024)
+
+
+/*
+ * Network Settings
+ */
+#ifndef __ADSPBF534__
+#define ADI_CMDS_NETWORK       1
+#define CONFIG_BFIN_MAC
+#define CONFIG_NETCONSOLE
+#endif
+#define CONFIG_HOSTNAME                br4
+#define CONFIG_TFTP_BLOCKSIZE  4404
+/* Uncomment next line to use fixed MAC address */
+/* #define CONFIG_ETHADDR      5c:38:1a:80:a7:00 */
+
+
+/*
+ * Flash Settings
+ */
+#define CONFIG_SYS_NO_FLASH    /* We have no parallel FLASH */
+
+
+/*
+ * SPI Settings
+ */
+#define CONFIG_BFIN_SPI
+#define CONFIG_ENV_SPI_MAX_HZ  30000000
+#define CONFIG_SF_DEFAULT_SPEED        30000000
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+
+
+/*
+ * Env Storage Settings
+ */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET      0x10000
+#define CONFIG_ENV_SIZE                0x2000
+#define CONFIG_ENV_SECT_SIZE   0x10000
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
+
+
+/*
+ * I2C Settings
+ */
+#define CONFIG_BFIN_TWI_I2C
+#define CONFIG_HARD_I2C
+
+
+/*
+ * NAND Settings
+ */
+#define CONFIG_NAND_PLAT
+#define CONFIG_SYS_NAND_BASE           0x20000000
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+
+#define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
+#define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
+#define BFIN_NAND_WRITE(addr, cmd) \
+       do { \
+               bfin_write8(addr, cmd); \
+               SSYNC(); \
+       } while (0)
+
+#define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
+#define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
+#define NAND_PLAT_GPIO_DEV_READY       GPIO_PF9
+
+/*
+ * Misc Settings
+ */
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_RTC_BFIN
+#define CONFIG_UART_CONSOLE    0
+#define CONFIG_SYS_PROMPT      "br4>"
+#define CONFIG_BOOTCOMMAND     "run nandboot"
+#define CONFIG_BOOTDELAY       2
+#define CONFIG_LOADADDR                0x2000000
+
+
+/*
+ * Pull in common ADI header for remaining command/environment setup
+ */
+#include <configs/bfin_adi_common.h>
+
+/*
+ * Overwrite some settings defined in bfin_adi_common.h
+ */
+#undef NAND_ENV_SETTINGS
+#define NAND_ENV_SETTINGS \
+       "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
+       "nandboot=" \
+               "nand read $(loadaddr) 0x0 0x900000;" \
+               "run nandargs;" \
+               "bootm" \
+               "\0"
+
+#endif
diff --git a/include/configs/calimain.h b/include/configs/calimain.h
new file mode 100644 (file)
index 0000000..6b68f10
--- /dev/null
@@ -0,0 +1,363 @@
+/*
+ * Copyright (C) 2011 OMICRON electronics GmbH
+ *
+ * Based on da850evm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define MACH_TYPE_CALIMAIN     3528
+#define CONFIG_MACH_TYPE       MACH_TYPE_CALIMAIN
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_CALIMAIN
+#define CONFIG_ARM926EJS               /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
+#define CONFIG_SOC_DA850               /* TI DA850 SoC */
+#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
+#define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ          calimain_get_osc_freq()
+#define CONFIG_SYS_TIMERBASE           DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCK            clk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ                  1000
+#define CONFIG_SYS_TEXT_BASE           0x60000000
+#define CONFIG_DA850_LOWLEVEL
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DA8XX_GPIO
+#define CONFIG_HW_WATCHDOG
+#define CONFIG_SYS_WDTTIMERBASE        DAVINCI_TIMER1_BASE
+#define CONFIG_SYS_WDT_PERIOD_LOW \
+       (60 * CONFIG_SYS_OSCIN_FREQ) /* 60 s heartbeat */
+#define CONFIG_SYS_WDT_PERIOD_HIGH     0x0
+#define CONFIG_SYS_DV_NOR_BOOT_CFG     (0x11)
+
+/*
+ * PLL configuration
+ */
+#define CONFIG_SYS_DV_CLKMODE          0
+#define CONFIG_SYS_DA850_PLL0_POSTDIV  1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV1  0x8000
+#define CONFIG_SYS_DA850_PLL0_PLLDIV2  0x8001
+#define CONFIG_SYS_DA850_PLL0_PLLDIV3  0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV4  0x8003
+#define CONFIG_SYS_DA850_PLL0_PLLDIV5  0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV6  CONFIG_SYS_DA850_PLL0_PLLDIV1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV7  0x8005
+
+#define CONFIG_SYS_DA850_PLL1_POSTDIV  1
+#define CONFIG_SYS_DA850_PLL1_PLLDIV1  0x8000
+#define CONFIG_SYS_DA850_PLL1_PLLDIV2  0x8001
+#define CONFIG_SYS_DA850_PLL1_PLLDIV3  0x8002
+
+#define CONFIG_SYS_DA850_PLL0_PLLM \
+       ((calimain_get_osc_freq() == 25000000) ? 23 : 24)
+#define CONFIG_SYS_DA850_PLL1_PLLM \
+       ((calimain_get_osc_freq() == 25000000) ? 20 : 21)
+
+/*
+ * DDR2 memory configuration
+ */
+#define CONFIG_SYS_DA850_DDR2_DDRPHYCR (DV_DDR_PHY_PWRDNEN | \
+                                       DV_DDR_PHY_EXT_STRBEN | \
+                                       (0x4 << DV_DDR_PHY_RD_LATENCY_SHIFT))
+
+#define CONFIG_SYS_DA850_DDR2_SDBCR (          \
+       (1 << DV_DDR_SDCR_DDR2EN_SHIFT) |       \
+       (1 << DV_DDR_SDCR_DDRDRIVE0_SHIFT) |    \
+       (1 << DV_DDR_SDCR_DDREN_SHIFT) |        \
+       (1 << DV_DDR_SDCR_SDRAMEN_SHIFT) |      \
+       (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) |    \
+       (0x3 << DV_DDR_SDCR_CL_SHIFT) |         \
+       (0x3 << DV_DDR_SDCR_IBANK_SHIFT) |      \
+       (0x2 << DV_DDR_SDCR_PAGESIZE_SHIFT))
+
+/* SDBCR2 is only used if IBANK_POS bit in SDBCR is set */
+#define CONFIG_SYS_DA850_DDR2_SDBCR2   0
+
+#define CONFIG_SYS_DA850_DDR2_SDTIMR (         \
+       (16 << DV_DDR_SDTMR1_RFC_SHIFT) |       \
+       (1 << DV_DDR_SDTMR1_RP_SHIFT) |         \
+       (1 << DV_DDR_SDTMR1_RCD_SHIFT) |        \
+       (1 << DV_DDR_SDTMR1_WR_SHIFT) |         \
+       (5 << DV_DDR_SDTMR1_RAS_SHIFT) |        \
+       (7 << DV_DDR_SDTMR1_RC_SHIFT) |         \
+       (1 << DV_DDR_SDTMR1_RRD_SHIFT) |        \
+       (1 << DV_DDR_SDTMR1_WTR_SHIFT))
+
+#define CONFIG_SYS_DA850_DDR2_SDTIMR2 (                \
+       (7 << DV_DDR_SDTMR2_RASMAX_SHIFT) |     \
+       (2 << DV_DDR_SDTMR2_XP_SHIFT) |         \
+       (0 << DV_DDR_SDTMR2_ODT_SHIFT) |        \
+       (18 << DV_DDR_SDTMR2_XSNR_SHIFT) |      \
+       (199 << DV_DDR_SDTMR2_XSRD_SHIFT) |     \
+       (0 << DV_DDR_SDTMR2_RTP_SHIFT) |        \
+       (2 << DV_DDR_SDTMR2_CKE_SHIFT))
+
+#define CONFIG_SYS_DA850_DDR2_SDRCR    0x000003FF
+#define CONFIG_SYS_DA850_DDR2_PBBPR    0x30
+
+/*
+ * Flash memory timing
+ */
+
+#define CONFIG_SYS_DA850_CS2CFG        (       \
+       DAVINCI_ABCR_WSETUP(2) |        \
+       DAVINCI_ABCR_WSTROBE(5) |       \
+       DAVINCI_ABCR_WHOLD(3) |         \
+       DAVINCI_ABCR_RSETUP(1) |        \
+       DAVINCI_ABCR_RSTROBE(14) |      \
+       DAVINCI_ABCR_RHOLD(0) |         \
+       DAVINCI_ABCR_TA(3) |            \
+       DAVINCI_ABCR_ASIZE_16BIT)
+
+/* single 64 MB NOR flash device connected to CS2 and CS3 */
+#define CONFIG_SYS_DA850_CS3CFG CONFIG_SYS_DA850_CS2CFG
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x10000 + 1*1024*1024) /* malloc() len */
+#define PHYS_SDRAM_1           DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE      (128 << 20) /* SDRAM size 128MB */
+#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
+
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (      \
+       DAVINCI_SYSCFG_SUSPSRC_TIMER0 |         \
+       DAVINCI_SYSCFG_SUSPSRC_SPI1 |           \
+       DAVINCI_SYSCFG_SUSPSRC_UART2 |          \
+       DAVINCI_SYSCFG_SUSPSRC_EMAC |           \
+       DAVINCI_SYSCFG_SUSPSRC_I2C)
+
+/* memtest start addr */
+#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
+
+/* memtest will be run on 16MB */
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + (16 << 20))
+
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE       (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    -4      /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1        DAVINCI_UART2_BASE /* Base address of UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX      1               /* use UART0 for console */
+#define CONFIG_BAUDRATE                115200          /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_MAX_FLASH_BANKS  1 /* max number of flash banks */
+#define CONFIG_SYS_FLASH_SECT_SZ    (128 << 10) /* 128KB */
+#define CONFIG_SYS_FLASH_BASE       DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
+#define CONFIG_ENV_SECT_SIZE        CONFIG_SYS_FLASH_SECT_SZ
+#define CONFIG_ENV_ADDR \
+       (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SECT_SZ * 2)
+#define CONFIG_ENV_SIZE             (128 << 10)
+#define CONFIG_ENV_ADDR_REDUND      (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND      CONFIG_ENV_SIZE
+#define PHYS_FLASH_SIZE             (64 << 20) /* Flash size 64MB */
+#define CONFIG_SYS_MAX_FLASH_SECT \
+       ((PHYS_FLASH_SIZE/CONFIG_SYS_FLASH_SECT_SZ) + 3)
+
+/*
+ * Network & Ethernet Configuration
+ */
+#ifdef CONFIG_DRIVER_TI_EMAC
+#define CONFIG_EMAC_MDIO_PHY_NUM       1
+#define CONFIG_MII
+#define CONFIG_BOOTP_DEFAULT
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_NET_RETRY_COUNT 10
+#endif
+
+/*
+ * U-Boot general configuration
+ */
+#define CONFIG_BOOTFILE        "uImage" /* Boot file name */
+#define CONFIG_SYS_PROMPT      "Calimain > " /* Command Prompt */
+#define CONFIG_SYS_CBSIZE      1024 /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE      (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
+#define CONFIG_SYS_MAXARGS     16 /* max number of command args */
+#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */
+#define CONFIG_SYS_LOAD_ADDR   (PHYS_SDRAM_1 + 0x700000)
+#define CONFIG_LOADADDR        0xc0700000
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CRC32_VERIFY
+#define CONFIG_MX_CYCLIC
+
+/*
+ * Linux Information
+ */
+#define LINUX_BOOT_PARAM_ADDR     (PHYS_SDRAM_1 + 0x100)
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_REVISION_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_BOOTARGS           ""
+#define CONFIG_BOOTCOMMAND        "run checkupdate; run checkbutton;"
+#define CONFIG_BOOTDELAY          0
+#define CONFIG_ZERO_BOOTDELAY_CHECK   /* check for keypress on bootdelay==0 */
+#define CONFIG_BOOT_RETRY_TIME    60  /* continue boot after 60 s inactivity */
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_DELAY_STR "\x0d" /* press ENTER to interrupt BOOT */
+#define CONFIG_RESET_TO_RETRY
+
+/*
+ * Default environment settings
+ * gpio0 = button, gpio1 = led green, gpio2 = led red
+ * verify = n ... disable kernel checksum verification for faster booting
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       "tftpdir=calimero\0"                                            \
+       "flashkernel=tftpboot $loadaddr $tftpdir/uImage; "              \
+               "erase 0x60800000 +0x400000; "                          \
+               "cp.b $loadaddr 0x60800000 $filesize\0"                 \
+       "flashrootfs="                                                  \
+               "tftpboot $loadaddr $tftpdir/rootfs.jffs2; "            \
+               "erase 0x60c00000 +0x2e00000; "                         \
+               "cp.b $loadaddr 0x60c00000 $filesize\0"                 \
+       "flashuboot=tftpboot $loadaddr $tftpdir/u-boot.bin; "           \
+               "protect off all; "                                     \
+               "erase 0x60000000 +0x80000; "                           \
+               "cp.b $loadaddr 0x60000000 $filesize\0"                 \
+       "flashrlk=tftpboot $loadaddr $tftpdir/uImage-rlk; "             \
+               "erase 0x60080000 +0x780000; "                          \
+               "cp.b $loadaddr 0x60080000 $filesize\0"                 \
+       "erase_persistent=erase 0x63a00000 +0x600000;\0"                \
+       "bootnor=setenv bootargs console=ttyS2,115200n8 "               \
+               "root=/dev/mtdblock3 rw rootfstype=jffs2 "              \
+               "rootwait ethaddr=$ethaddr; "                           \
+               "gpio c 1; gpio s 2; bootm 0x60800000\0"                \
+       "bootrlk=gpio s 1; gpio s 2;"                                   \
+               "setenv bootargs console=ttyS2,115200n8 "               \
+               "ethaddr=$ethaddr; bootm 0x60080000\0"                  \
+       "boottftp=setenv bootargs console=ttyS2,115200n8 "              \
+               "root=/dev/mtdblock3 rw rootfstype=jffs2 "              \
+               "rootwait ethaddr=$ethaddr; "                           \
+               "tftpboot $loadaddr $tftpdir/uImage;"                   \
+               "gpio c 1; gpio s 2; bootm $loadaddr\0"                 \
+       "checkupdate=if test -n $update_flag; then "                    \
+               "echo Previous update failed - starting RLK; "          \
+               "run bootrlk; fi; "                                     \
+               "if test -n $initial_setup; then "                      \
+               "echo Running initial setup procedure; "                \
+               "sleep 1; run flashall; fi\0"                           \
+       "product=accessory\0"                                           \
+       "serial=XX12345\0"                                              \
+       "checknor="                                                     \
+               "if gpio i 0; then run bootnor; fi;\0"                  \
+       "checkrlk="                                                     \
+               "if gpio i 0; then run bootrlk; fi;\0"                  \
+       "checkbutton="                                                  \
+               "run checknor; sleep 1;"                                \
+               "run checknor; sleep 1;"                                \
+               "run checknor; sleep 1;"                                \
+               "run checknor; sleep 1;"                                \
+               "run checknor;"                                         \
+               "gpio s 1; gpio s 2;"                                   \
+               "echo ---- Release button to boot RLK ----;"            \
+               "run checkrlk; sleep 1;"                                \
+               "run checkrlk; sleep 1;"                                \
+               "run checkrlk; sleep 1;"                                \
+               "run checkrlk; sleep 1;"                                \
+               "run checkrlk; sleep 1;"                                \
+               "run checkrlk;"                                         \
+               "echo ---- Factory reset requested ----;"               \
+               "gpio c 1;"                                             \
+               "setenv factory_reset true;"                            \
+               "saveenv;"                                              \
+               "run bootnor;\0"                                        \
+       "flashall=run flashrlk;"                                        \
+               "run flashkernel;"                                      \
+               "run flashrootfs;"                                      \
+               "setenv erase_datafs true;"                             \
+               "setenv initial_setup;"                                 \
+               "saveenv;"                                              \
+               "run bootnor;\0"                                        \
+       "verify=n\0"                                                    \
+       "clearenv=protect off all;"                                     \
+               "erase 0x60040000 +0x40000;\0"                          \
+       "bootlimit=3\0"                                                 \
+       "altbootcmd=run bootrlk\0"
+
+#define CONFIG_PREBOOT                 \
+       "echo Version: $ver; "          \
+       "echo Serial: $serial; "        \
+       "echo MAC: $ethaddr; "          \
+       "echo Product: $product; "      \
+       "gpio c 1; gpio c 2;"
+
+/*
+ * U-Boot commands
+ */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_GPIO
+
+#ifndef CONFIG_DRIVER_TI_EMAC
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_PING
+#endif
+
+/* additions for new relocation code, must added to all boards */
+#define CONFIG_SYS_SDRAM_BASE          0xc0000000
+/* initial stack pointer in internal SRAM */
+#define CONFIG_SYS_INIT_SP_ADDR                (0x8001ff00)
+
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_SYS_BOOTCOUNT_ADDR      DAVINCI_RTC_BASE
+
+#ifndef __ASSEMBLY__
+int calimain_get_osc_freq(void);
+#endif
+
+#endif /* __CONFIG_H */
index 5d9672fbc812d1c13331f9a3250f5360aec1329d..0fee53f750c58c84279830431fde3c412660e7ad 100644 (file)
@@ -68,7 +68,6 @@
 #define CONFIG_BOOTP_DNS2
 #define CONFIG_BOOTP_SEND_HOSTNAME
 #define CONFIG_NET_RETRY_COUNT 10
-#define CONFIG_NET_MULTI
 #define CONFIG_CMD_MII
 #define CONFIG_SYS_DCACHE_OFF
 #define CONFIG_RESET_PHY_R
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SAVES
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifdef CONFIG_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_EXT2
 #define CONFIG_MTD_DEVICE
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
 #define CONFIG_RBTREE
+#define CONFIG_LZO
 #endif
 
 #define CONFIG_CRC32_VERIFY
 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
 #define CONFIG_SYS_LONGHELP
 
+#define CONFIG_MENU
+#define CONFIG_MENU_SHOW
+#define CONFIG_FIT
+#define CONFIG_CMD_PXE
+#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
+
 #ifdef CONFIG_NAND_DAVINCI
-#define CONFIG_ENV_SIZE                (256 << 10)     /* 256 KiB */
+#define CONFIG_ENV_SIZE                        (16 << 10)
 #define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET      0x0
+#define CONFIG_ENV_OFFSET              0x180000
+#define CONFIG_ENV_OFFSET_REDUND       0x1c0000
+#define CONFIG_ENV_RANGE               0x020000
 #undef CONFIG_ENV_IS_IN_FLASH
 #endif
 
 #if defined(CONFIG_MMC) && !defined(CONFIG_ENV_IS_IN_NAND)
 #define CONFIG_CMD_ENV
+#define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_ENV_SIZE                (16 << 10)      /* 16 KiB */
 #define CONFIG_ENV_OFFSET      (51 << 9)       /* Sector 51 */
 #define CONFIG_ENV_IS_IN_MMC
 #endif
 
 #define CONFIG_BOOTDELAY       3
+/*
+ * 24MHz InputClock / 15 prediv -> 1.6 MHz timer running
+ * Timeout 1 second.
+ */
+#define CONFIG_AIT_TIMER_TIMEOUT       0x186a00
 
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_VERSION_VARIABLE
 #define CONFIG_SYS_LOAD_ADDR   0x80700000              /* kernel address */
 
 #define MTDIDS_DEFAULT         "nand0=davinci_nand.0"
-
-#ifdef CONFIG_SYS_NAND_LARGEPAGE
-/*  Use same layout for 128K/256K blocks; allow some bad blocks */
-#define PART_BOOT              "2m(bootloader)ro,"
-#endif
-
-#define PART_KERNEL            "4m(kernel),"   /* kernel + initramfs */
-#define PART_REST              "-(filesystem)"
-
-#define MTDPARTS_DEFAULT       \
-       "mtdparts=davinci_nand.0:" PART_BOOT PART_KERNEL PART_REST
-
-#define CONFIG_SYS_NAND_PAGE_SIZE      (0x800)
-#define CONFIG_SYS_NAND_BLOCK_SIZE     (0x20000)
+#define MTDPARTS_DEFAULT                       \
+       "mtdparts="                             \
+               "davinci_nand.0:"               \
+                       "128k(spl),"            \
+                       "384k(UBLheader),"      \
+                       "1m(u-boot),"           \
+                       "512k(env),"            \
+                       "-(ubi)"
+
+#define CONFIG_SYS_NAND_PAGE_SIZE      0x800
+#define CONFIG_SYS_NAND_BLOCK_SIZE     0x20000
 
 /* Defines for SPL */
 #define CONFIG_SPL
  * so we can define, how many UBL Headers
  * we can write before the real spl code
  */
-#define CONFIG_SYS_NROF_UBL_HEADER     5
 #define CONFIG_SYS_NROF_PAGES_NAND_SPL 6
 
 #define CONFIG_SYS_NAND_U_BOOT_DST     0x81080000 /* u-boot TEXT_BASE */
 #define CONFIG_POST    CONFIG_SYS_POST_MEMORY
 #define _POST_WORD_ADDR        0x0
 
-#define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
 #define CONFIG_SYS_INIT_SP_ADDR                CONFIG_SPL_STACK
 
-#define CONFIG_SYS_NAND_U_BOOT_OFFS    0xc0000
-#define CONFIG_SYS_NAND_U_BOOT_SIZE    0x60000
-
-/*
- * U-Boot is a 3rd stage loader and if booting with spl, cpu setup is
- * done in board_init_f from c code.
- */
-#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE    0xa0000
 
 /* for UBL header */
 #define CONFIG_SYS_UBL_BLOCK           (CONFIG_SYS_NAND_PAGE_SIZE)
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        "u_boot_addr_r=" xstr(DVN4XX_UBOOT_ADDR_R_RAM) "\0"             \
        "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.ubl\0"                 \
-       "load=tftp ${u_boot_addr_r} ${uboot}\0"                         \
+       "load=tftp ${u_boot_addr_r} ${u-boot}\0"                        \
        "pagesz=" xstr(CONFIG_SYS_NAND_PAGE_SIZE) "\0"                  \
-       "writeheader=nandrbl rbl;nand erase 80000 ${pagesz};"           \
-               "nand write ${u_boot_addr_r} 80000 ${pagesz};"          \
+       "writeheader=nandrbl rbl;nand erase 20000 ${pagesz};"           \
+               "nand write ${u_boot_addr_r} 20000 ${pagesz};"          \
                "nandrbl uboot\0"                                       \
-       "writenand_spl=nandrbl rbl;nand erase a0000 3000;"              \
+       "writenand_spl=nandrbl rbl;nand erase 0 3000;"                  \
                "nand write " xstr(DVN4XX_UBOOT_ADDR_R_NAND_SPL)        \
-               " a0000 3000;nandrbl uboot\0"                           \
+               " 0 3000;nandrbl uboot\0"                               \
        "writeuboot=nandrbl uboot;"                                     \
                "nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "     \
                 xstr(CONFIG_SYS_NAND_U_BOOT_SIZE)                      \
                " " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "               \
                xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0"                  \
        "update=run load writenand_spl writeuboot\0"                    \
-       "bootcmd=run bootcmd\0"                                         \
+       "bootcmd=run net_nfs\0"                                         \
+       "rootpath=/opt/eldk-arm/arm\0"                                  \
+       "mtdids=" MTDIDS_DEFAULT "\0"                                   \
+       "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
+       "netdev=eth0\0"                                                 \
+       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
+       "addmisc=setenv bootargs ${bootargs} app_reset=${app_reset}\0"  \
+       "addcon=setenv bootargs ${bootargs} console=ttyS0,"             \
+               "${baudrate}n8\0"                                       \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off eth=${ethaddr} panic=1\0"   \
        "rootpath=/opt/eldk-arm/arm\0"                                  \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage \0"                  \
+       "kernel_addr_r=80600000\0"                                      \
+       "load_kernel=tftp ${kernel_addr_r} ${bootfile}\0"               \
+       "ubi_load_kernel=ubi part ubi 2048;ubifsmount ${img_volume};"   \
+               "ubifsload ${kernel_addr_r} boot/uImage\0"              \
+       "fit_addr_r=" xstr(CONFIG_BOARD_IMG_ADDR_R) "\0"                \
+       "img_addr_r=" xstr(CONFIG_BOARD_IMG_ADDR_R) "\0"                \
+       "img_file=" xstr(CONFIG_HOSTNAME) "/ait.itb\0"                  \
+       "header_addr=20000\0"                                           \
+       "img_writeheader=nandrbl rbl;"                                  \
+               "nand erase ${header_addr} ${pagesz};"                  \
+               "nand write ${img_addr_r} ${header_addr} ${pagesz};"    \
+               "nandrbl uboot\0"                                       \
+       "img_writespl=nandrbl rbl;nand erase 0 3000;"                   \
+               "nand write ${img_addr_r} 0 3000;nandrbl uboot\0"       \
+       "img_writeuboot=nandrbl uboot;"                                 \
+               "nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "     \
+                xstr(CONFIG_SYS_NAND_U_BOOT_SIZE)                      \
+               ";nand write ${img_addr_r} "                            \
+               xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "                   \
+               xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0"                  \
+       "img_writedfenv=ubi part ubi 2048;"                             \
+               "ubi write ${img_addr_r} default ${filesize}\0"         \
+       "img_volume=rootfs1\0"                                          \
+       "img_writeramdisk=ubi part ubi 2048;ubifsmount ${img_volume};"  \
+               "ubi write ${img_addr_r} ${img_volume} ${filesize}\0"   \
+       "load_img=tftp ${fit_addr_r} ${img_file}\0"                     \
+       "net_nfs=run load_kernel; "                                     \
+               "run nfsargs addip addcon addmtd addmisc;"              \
+               "bootm ${kernel_addr_r}\0"                              \
+       "ubi_ubi=run ubi_load_kernel; "                                 \
+               "run ubiargs addip addcon addmtd addmisc;"              \
+               "bootm ${kernel_addr_r}\0"                              \
+       "ubiargs=setenv bootargs ubi.mtd=4,2048"                        \
+               " root=ubi0:${img_volume} rw rootfstype=ubifs\0"        \
+       "app_reset=no\0"                                                \
+       "dvn_app_vers=void\0"                                           \
+       "dvn_boot_vers=void\0"                                          \
+       "savenewvers=run savetmpparms restoreparms; saveenv;"           \
+               "run restoretmpparms\0"                                 \
+       "savetmpparms=setenv y_ipaddr ${ipaddr};"                       \
+               "setenv y_netmask ${netmask};"                          \
+               "setenv y_serverip ${serverip};"                        \
+               "setenv y_gatewayip ${gatewayip}\0"                     \
+       "saveparms=setenv x_ipaddr ${ipaddr};"                          \
+               "setenv x_netmask ${netmask};"                          \
+               "setenv x_serverip ${serverip};"                        \
+               "setenv x_gatewayip ${gatewayip}\0"                     \
+       "restoreparms=setenv ipaddr ${x_ipaddr};"                       \
+               "setenv netmask ${x_netmask};"                          \
+               "setenv serverip ${x_serverip};"                        \
+               "setenv gatewayip ${x_gatewayip}\0"                     \
+       "restoretmpparms=setenv ipaddr ${y_ipaddr};"                    \
+               "setenv netmask ${y_netmask};"                          \
+               "setenv serverip ${y_serverip};"                        \
+               "setenv gatewayip ${y_gatewayip}\0"                     \
        "\0"
 
 /* USB Configuration */
index 348a25bd1f245e74ab45d8039ff9489874408ac4..2c65d74496d7b782e75053b34bcd9c043b1ffffd 100644 (file)
  */
 #define CONFIG_PCI
 
-/*-----------------------------------------------------------------------
- * Network device support
- */
-#define CONFIG_NET_MULTI
-
-
 #endif /* __CONFIG_H */
index 7925b9583890e865a7ee5039739570ca4c1a7691..77dd0a2d1e199a9b0a561a99071fcec89a898189 100644 (file)
@@ -88,6 +88,7 @@
 #elif defined(CONFIG_SDCARD)
 #define CONFIG_SYS_EXTRA_ENV_RELOC
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_SYS_MMC_ENV_DEV          0
 #define CONFIG_ENV_SIZE                        0x2000
 #define CONFIG_ENV_OFFSET              (512 * 1097)
index e8c021262ac4b747363cc6a013df7d4f89316203..4532e4f4fdd18fe6b2322654a65cb3a87ddb295a 100644 (file)
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_SETGETDCR
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifndef CONFIG_DRIVER_TI_EMAC
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_DHCP
index 220890dfd9750c6633360a802a4c60798f4fd072..989472b1813756fd05e8151a034b37cca23f6b7f 100644 (file)
 #define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
+#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ          24000000
 #define CONFIG_SYS_TIMERBASE           DAVINCI_TIMER0_BASE
 #define CONFIG_SYS_HZ_CLOCK            clk_get(DAVINCI_AUXCLK_CLKID)
 #define CONFIG_SYS_HZ                  1000
-#define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE           0xc1080000
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 
 /*
  * Memory Info
 #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
 #define CONFIG_BAUDRATE                115200          /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
-#define CONFIG_SYS_DA850_LPSC_UART DAVINCI_LPSC_UART2
 
 #define CONFIG_SPI
 #define CONFIG_SPI_FLASH
 #define CONFIG_CMD_SAVES
 #define CONFIG_CMD_MEMORY
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifndef CONFIG_DRIVER_TI_EMAC
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_DHCP
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LDSCRIPT    "$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT    "board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK       0x8001ff00
 #define CONFIG_SPL_TEXT_BASE   0x80000000
 #define CONFIG_SPL_MAX_SIZE    32768
index ddf673c846d9e108235d562c227c2e7cffbe964d..42caf1e42a467d32e7358a32b8036036ea4a6350 100644 (file)
@@ -26,7 +26,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT      /* U-Boot is a 3rd stage loader */
 #define CONFIG_SYS_NO_FLASH            /* that is, no *NOR* flash */
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
-#define CONFIG_DISPLAY_CPUINFO
 
 /* SoC Configuration */
 #define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SAVES
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifdef CONFIG_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_EXT2
index dc5b408a618e542797694ba03f35993813f7dbf9..b05cfbaa8e8b122b3e0380ea42d2f7d45cea5344 100644 (file)
@@ -25,7 +25,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT      /* U-Boot is a 3rd stage loader */
 #define CONFIG_SYS_NO_FLASH            /* that is, no *NOR* flash */
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
-#define CONFIG_DISPLAY_CPUINFO
 
 /* SoC Configuration */
 #define CONFIG_ARM926EJS                               /* arm926ejs CPU */
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SAVES
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifdef CONFIG_NAND_DAVINCI
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_MTD_PARTITIONS
index cb6ed24a80015dc5d6d4962cc0cbd78d5d613ba8..a75bce675b48a3924027f79119f28073f445b1cc 100644 (file)
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SAVES
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifdef CONFIG_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_EXT2
index b3a4e4434420e177516de39ce55f68c91176f278..0cbdec86813ecceede0545af8e1c970faf180156 100644 (file)
@@ -23,7 +23,6 @@
 /* Spectrum Digital TMS320DM6467T EVM board */
 #define DAVINCI_DM6467EVM
 #define DAVINCI_DM6467TEVM
-#define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_SYS_USE_NAND
 #define CONFIG_SYS_NAND_SMALLPAGE
 
@@ -153,6 +152,10 @@ extern unsigned int davinci_arm_clk_get(void);
 #define CONFIG_CMD_NAND
 #endif
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE       (256 << 20)     /* 256 MB */
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
index c9a0cd1daa3234ed916fe3bcb7274a0130e45287..e0fe6b5c248ec618744744dd62b9b40dde5c280c 100644 (file)
@@ -22,7 +22,6 @@
 
 /* Spectrum Digital TMS320DM6467 EVM board */
 #define DAVINCI_DM6467EVM
-#define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_SYS_USE_NAND
 #define CONFIG_SYS_NAND_SMALLPAGE
 
@@ -151,6 +150,10 @@ extern unsigned int davinci_arm_clk_get(void);
 #define CONFIG_CMD_NAND
 #endif
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE       (256 << 20)     /* 256 MB */
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
index c0525173e6806841e91108eab4fb526eaa33b2f5..310d5770dec4889c81389e4765ae21312e109e9c 100644 (file)
@@ -51,7 +51,6 @@
 #define DV_EVM
 #define CONFIG_SYS_NAND_SMALLPAGE
 #define CONFIG_SYS_USE_NAND
-#define CONFIG_DISPLAY_CPUINFO
 /*===================*/
 /* SoC Configuration */
 /*===================*/
 #define CONFIG_CMD_SAVES
 #define CONFIG_CMD_EEPROM
 #undef CONFIG_CMD_BDI
+
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_SETGETDCR
 #ifdef CONFIG_SYS_USE_NAND
index f4ddbeacc3b00038807707f699c6492e15e69aff..949174a1637193504bd36607395b4a7d0c4afdbe 100644 (file)
@@ -26,7 +26,6 @@
 #define SCHMOOGIE
 #define CONFIG_SYS_NAND_LARGEPAGE
 #define CONFIG_SYS_USE_NAND
-#define CONFIG_DISPLAY_CPUINFO
 #define MACH_TYPE_SCHMOOGIE 1255
 #define CONFIG_MACH_TYPE MACH_TYPE_SCHMOOGIE
 
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE       (256 << 20)     /* 256 MB */
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
index 0c653915bdf83d95e76fff1a4c2c1a1441603720..c931ede85cfd7d79851fc6f0b03248ac421f526d 100644 (file)
@@ -28,7 +28,6 @@
 #define CONFIG_SYS_NAND_LARGEPAGE
 #define CONFIG_SYS_USE_NAND
 #define CONFIG_SYS_USE_DSPLINK         /* don't power up the DSP. */
-#define CONFIG_DISPLAY_CPUINFO
 /* SoC Configuration */
 #define CONFIG_ARM926EJS                       /* arm926ejs CPU core */
 #define CONFIG_SYS_TIMERBASE           0x01c21400      /* use timer 0 */
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE       (256 << 20)     /* 256 MB */
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
index fc4d8eceac388eaa8ded2a1595bdf35360fc4642..854099b2a26f500b353eb4fac961e0a96a1b564c 100644 (file)
@@ -51,7 +51,6 @@
 #define SONATA_BOARD
 #define CONFIG_SYS_NAND_SMALLPAGE
 #define CONFIG_SYS_USE_NOR
-#define CONFIG_DISPLAY_CPUINFO
 #define MACH_TYPE_SONATA 1254
 #define CONFIG_MACH_TYPE MACH_TYPE_SONATA
 /*===================*/
 #error "Either CONFIG_SYS_USE_NAND or CONFIG_SYS_USE_NOR _MUST_ be defined !!!"
 #endif
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE       (256 << 20)     /* 256 MB */
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
diff --git a/include/configs/dns325.h b/include/configs/dns325.h
new file mode 100644 (file)
index 0000000..b7a89d3
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2011
+ * Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_DNS325_H
+#define _CONFIG_DNS325_H
+
+/*
+ * Machine number definition
+ */
+#define MACH_TYPE_DNS325               3800
+#define CONFIG_MACH_TYPE               MACH_TYPE_DNS325
+#define CONFIG_IDENT_STRING            "\nD-Link DNS-325"
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131                /* CPU Core subversion */
+#define CONFIG_KIRKWOOD                        /* SOC Family Name */
+#define CONFIG_KW88F6281               /* SOC Name */
+#define CONFIG_SKIP_LOWLEVEL_INIT      /* disable board lowlevel_init */
+
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_NO_FLASH            /* Declare no flash (NOR/SPI) */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DATE
+#define CONFIG_SYS_MVFS
+
+#define CONFIG_NR_DRAM_BANKS           1
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+/* Remove or override few declarations from mv-common.h */
+#undef CONFIG_SYS_PROMPT
+#define CONFIG_SYS_PROMPT              "=> "
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_MVGBE_PORTS             {1, 0} /* enable port 0 only */
+#define CONFIG_NETCONSOLE
+#endif
+
+/*
+ * SATA Driver configuration
+ */
+#ifdef CONFIG_MVSATA_IDE
+#define CONFIG_SYS_ATA_IDE0_OFFSET      MV_SATA_PORT0_OFFSET
+#define CONFIG_SYS_ATA_IDE1_OFFSET      MV_SATA_PORT1_OFFSET
+#endif
+
+/*
+ * RTC driver configuration
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MV
+#endif
+
+/*
+ * Enable GPI0 support
+ */
+#define CONFIG_KIRKWOOD_GPIO
+
+/*
+ * Use the HUSH parser
+ */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+
+/*
+ * Console configuration
+ */
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+
+/*
+ * Enable device tree support
+ */
+#define CONFIG_OF_LIBFDT
+
+/*
+ * Display cpu info at boot
+ */
+#define CONFIG_DISPLAY_CPUINFO
+
+/*
+ * Environment variables configurations
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_SECT_SIZE           0x20000 /* 128KB */
+#else
+#define CONFIG_ENV_IS_NOWHERE
+#endif
+
+#define CONFIG_ENV_SIZE                        0x20000 /* 128KB */
+#define CONFIG_ENV_ADDR                        0xe0000
+#define CONFIG_ENV_OFFSET              0xe0000 /* env starts here */
+
+/*
+ * Default environment variables
+ */
+#define MTDIDS_DEFAULT                 "nand0=orion_nand"
+
+#define MTDPARTS_DEFAULT               "mtdparts=orion_nand:" \
+       "896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "stdin=serial\0" \
+       "stdout=serial\0" \
+       "stderr=serial\0" \
+       "loadaddr=0x800000\0" \
+       "autoload=no\0" \
+       "console=ttyS0,115200\0" \
+       "mtdparts="MTDPARTS_DEFAULT \
+       "optargs=\0" \
+       "bootenv=uEnv.txt\0" \
+       "importbootenv=echo Importing environment ...; " \
+               "env import -t ${loadaddr} ${filesize}\0" \
+       "loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \
+       "setbootargs=setenv bootargs console=${console} " \
+               "${optargs} " \
+               "${mtdparts} " \
+               "root=${bootenvroot} " \
+               "rootfstype=${bootenvrootfstype}\0" \
+       "subbootcmd=run setbootargs; " \
+               "if run bootenvloadimage; then " \
+                       "bootm ${loadaddr};" \
+               "fi;\0" \
+       "nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \
+       "nandrootfstype=ubifs\0" \
+       "nandloadimage=nand read ${loadaddr} kernel\0" \
+       "setnandbootenv=echo Booting from nand ...; " \
+               "setenv bootenvroot ${nandroot}; " \
+               "setenv bootenvrootfstype ${nandrootfstype}; " \
+               "setenv bootenvloadimage ${nandloadimage}\0"
+
+#define CONFIG_BOOTCOMMAND \
+       "if test -n ${bootenv} && usb start; then " \
+               "if run loadbootenv; then " \
+                       "echo Loaded environment ${bootenv} from usb;" \
+                       "run importbootenv;" \
+               "fi;" \
+               "if test -n ${bootenvcmd}; then " \
+                       "echo Running bootenvcmd ...;" \
+                       "run bootenvcmd;" \
+               "fi;" \
+       "fi;" \
+       "run setnandbootenv subbootcmd;"
+
+#endif /* _CONFIG_DNS325_H */
index cc0f5b05cd63538eaebef8533b04d7f029dc15c1..b4610d9474faf2d6c2eb5a3806f24eff9c6df464 100644 (file)
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_I2C
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifndef CONFIG_DRIVER_TI_EMAC
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_DHCP
index 2e2a9a7a99a32b3e4dd33cbc7462517d81438913..4549a4c15ea949b82feaa21d43fa3bd3f856bc7f 100644 (file)
@@ -88,7 +88,6 @@
 #define CONFIG_SH_I2C_BASE1            0xA4750000
 
 /* Ether */
-#define CONFIG_NET_MULTI 1
 #define CONFIG_SH_ETHER 1
 #define CONFIG_SH_ETHER_USE_PORT (0)
 #define CONFIG_SH_ETHER_PHY_ADDR (0x1f)
index 88d32b27d6aa84e492b64763a0e5f328337117aa..9b7cc66c658a07ca776c64eaa26c0544359f10e4 100644 (file)
 #include <config_cmd_default.h>
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_I2C
+#define CONFIG_CMD_USB
 
 /*
  * Network
 /* end of IDE defines */
 #endif /* CMD_IDE */
 
+/*
+ * Common USB/EHCI configuration
+ */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_EHCI                /* Enable EHCI USB support */
+#define CONFIG_USB_EHCI_MARVELL
+#define ORION5X_USB20_HOST_PORT_BASE ORION5X_USB20_PORT0_BASE
+#define CONFIG_USB_STORAGE
+#define CONFIG_DOS_PARTITION
+#define CONFIG_ISO_PARTITION
+#define CONFIG_SUPPORT_VFAT
+#endif /* CONFIG_CMD_USB */
+
 /*
  * I2C related stuff
  */
 #define CONFIG_SYS_RESET_ADDRESS       0xffff0000
 #define CONFIG_SYS_MAXARGS             16
 
+/* Use the HUSH parser */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+
+/* Enable command line editing */
+#define CONFIG_CMDLINE_EDITING
+
+/* provide extensive help */
+#define CONFIG_SYS_LONGHELP
+
 /* additions for new relocation code, must be added to all boards */
 #define CONFIG_SYS_SDRAM_BASE          0
 #define CONFIG_SYS_INIT_SP_ADDR        \
index 522487b3955ca236c47aee9723d2e2edac124fe6..e2f0f7465d80f882ee68842b8a754265e2424ea0 100644 (file)
 /* USB NET */
 #ifdef CONFIG_CMD_NET
 #define        CONFIG_USB_ETHER_ASIX
-#define        CONFIG_NET_MULTI
 #define        CONFIG_CMD_PING
 #define        CONFIG_CMD_DHCP
 #endif
index 83aec790e6fefde9e7614f807894da8d67b3b09b..29b0d339912718109dc6f7f3f64874f6d14a2073 100644 (file)
 #define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
+#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ          24000000
 #define CONFIG_SYS_TIMERBASE           DAVINCI_TIMER0_BASE
 #define CONFIG_SYS_HZ_CLOCK            clk_get(DAVINCI_AUXCLK_CLKID)
 #define CONFIG_SYS_HZ                  1000
-#define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_DA850_LOWLEVEL
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_HOSTNAME                enbw_cmc
-#define CONFIG_DISPLAY_CPUINFO
 
 #define MACH_TYPE_ENBW_CMC     3585
 #define CONFIG_MACH_TYPE       MACH_TYPE_ENBW_CMC
@@ -83,7 +84,7 @@
 #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
 #define CONFIG_BAUDRATE                115200          /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
-#define CONFIG_SYS_DA850_LPSC_UART     DAVINCI_LPSC_UART2
+
 /*
  * I2C Configuration
  */
 #define CONFIG_BOOTP_DNS2
 #define CONFIG_BOOTP_SEND_HOSTNAME
 #define CONFIG_NET_RETRY_COUNT 10
-#define CONFIG_NET_MULTI
 #endif
 
 /*
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_CACHE
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifndef CONFIG_DRIVER_TI_EMAC
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_DHCP
index f878665b296d7c006ad612b5708d577bcd115d8a..604d2dd5f53ceddcb22f1003278607c93ed7c4a5 100644 (file)
 #endif
 
 /* Ethernet */
-#define CONFIG_NET_MULTI
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_MACB
 #define CONFIG_RMII
index aac3930f0a9af5435ab28b2f7d1ae07a08a96137..649e27214c7030b9c6091695e31b938fa88c962a 100644 (file)
 /*
  * Ethernet on SOC (FEC)
  */
-#define CONFIG_NET_MULTI
 #define CONFIG_FEC_MXC
 #define IMX_FEC_BASE   FEC_BASE_ADDR
 #define CONFIG_PHYLIB
index fa214941afbf8f52438e0fc02483b522a1d6e7ed..50a1c171b66e2289546ae47b25baba533b57eeb7 100644 (file)
@@ -35,6 +35,7 @@
 #define CONFIG_ARM926EJS               /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX               /* TI DA8xx SoC */
 #define CONFIG_SOC_DA850               /* TI DA850 SoC */
+#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ            clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ          24000000
 #define CONFIG_SYS_TIMERBASE           DAVINCI_TIMER0_BASE
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (      \
+       DAVINCI_SYSCFG_SUSPSRC_EMAC |           \
+       DAVINCI_SYSCFG_SUSPSRC_I2C  |           \
+       DAVINCI_SYSCFG_SUSPSRC_SPI1 |           \
+       DAVINCI_SYSCFG_SUSPSRC_TIMER0 |         \
+       DAVINCI_SYSCFG_SUSPSRC_UART2)
+
+#if defined(CONFIG_UART_U_BOOT)
 #define CONFIG_SYS_TEXT_BASE           0xc1080000
-#else
+#elif !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_TEXT_BASE           0xc1180000
 #endif
 
+/* Spl */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LDSCRIPT            "board/$(BOARDDIR)/u-boot-spl-hawk.lds"
+#define CONFIG_SPL_TEXT_BASE           0xc1080000
+#define CONFIG_SPL_STACK               CONFIG_SYS_INIT_SP_ADDR
+
 /*
  * Memory Info
  */
 /*
  * Network & Ethernet Configuration
  */
-#if !defined(CONFIG_NAND_SPL)
 #define CONFIG_DRIVER_TI_EMAC
-#endif
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
 #define CONFIG_CMD_SAVES
 #define CONFIG_CMD_MEMORY
 
+#ifdef CONFIG_CMD_BDI
+#define CONFIG_CLOCKS
+#endif
+
 #ifdef CONFIG_SYS_USE_NAND
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
index 9c8d222c2fe28bbd52f144f362b52cc3410329dd..c73a10c667d0cbd95c47db4d9dfc1c803bd36aa8 100644 (file)
@@ -194,7 +194,7 @@ int get_scl(void);
 #define I2C_SCL(bit)   kw_gpio_set_value(KM_KIRKWOOD_SCL_PIN, bit)
 #endif
 
-#define I2C_DELAY      udelay(3)       /* 1/4 I2C clock duration */
+#define I2C_DELAY      udelay(1)
 #define I2C_SOFT_DECLARATIONS
 
 #endif
index 4efff0992b8e1c80fb859a0b44939f3d73b5f36a..4d59153706eafb45ff9d652f226b7ce093cbf229 100644 (file)
  * Ethernet on SOC (FEC)
  */
 #ifdef CONFIG_CMD_NET
-#define        CONFIG_NET_MULTI
 #define        CONFIG_ETHPRIME                 "FEC0"
 #define        CONFIG_FEC_MXC
 #define        CONFIG_FEC_MXC_MULTI
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
new file mode 100644 (file)
index 0000000..0940e86
--- /dev/null
@@ -0,0 +1,378 @@
+/*
+ * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+ *
+ * Based on omap3_evm_config.h
+ *
+ * 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.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_OMAP                    /* in a TI OMAP core */
+#define CONFIG_OMAP34XX                        /* which is a 34XX */
+#define CONFIG_OMAP3_MCX               /* working with mcx */
+
+#define MACH_TYPE_MCX                  3656
+#define CONFIG_MACH_TYPE       MACH_TYPE_MCX
+
+#define CONFIG_SYS_CACHELINE_SIZE      64
+
+#define CONFIG_EMIF4   /* The chip has EMIF4 controller */
+
+#include <asm/arch/cpu.h>              /* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+#define CONFIG_OF_LIBFDT
+#define CONFIG_FIT
+
+/*
+ * Leave it at 0x80008000 to allow booting new u-boot.bin with X-loader
+ * and older u-boot.bin with the new U-Boot SPL.
+ */
+#define CONFIG_SYS_TEXT_BASE           0x80008000
+
+/*
+ * Display CPU and Board information
+ */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Clock Defines */
+#define V_OSCK                 26000000        /* Clock output from T2 */
+#define V_SCLK                 (V_OSCK >> 1)
+
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG                     /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB sector */
+#define CONFIG_SYS_MALLOC_LEN          (1024 << 10)
+/*
+ * DDR related
+ */
+#define CONFIG_SYS_CS0_SIZE            (256 * 1024 * 1024)
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define V_NS16550_CLK                  48000000        /* 48MHz (APLL96/2) */
+
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
+#define CONFIG_SYS_NS16550_CLK         V_NS16550_CLK
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX              3
+#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
+#define CONFIG_SERIAL3                 3       /* UART3 */
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE                        115200
+#define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
+                                       115200}
+#define CONFIG_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DOS_PARTITION
+
+/* EHCI */
+#define CONFIG_USB_STORAGE
+#define CONFIG_OMAP3_GPIO_5
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
+/*#define CONFIG_EHCI_DCACHE*/ /* leave it disabled for now */
+#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO       154
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO       152
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EXT2                /* EXT2 Support                 */
+#define CONFIG_CMD_FAT         /* FAT support                  */
+#define CONFIG_CMD_JFFS2       /* JFFS2 Support                */
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C         /* I2C serial bus support       */
+#define CONFIG_CMD_MMC         /* MMC support                  */
+#define CONFIG_CMD_FAT         /* FAT support                  */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_NAND                /* NAND support                 */
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_RBTREE
+#define CONFIG_LZO
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_CMD_MTDPARTS
+
+#undef CONFIG_CMD_FLASH                /* flinfo, erase, protect       */
+#undef CONFIG_CMD_FPGA         /* FPGA configuration Support   */
+#undef CONFIG_CMD_IMI          /* iminfo                       */
+#undef CONFIG_CMD_IMLS         /* List all found images        */
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_SLAVE           1
+#define CONFIG_SYS_I2C_BUS             0
+#define CONFIG_DRIVER_OMAP34XX_I2C
+
+/* RTC */
+#define CONFIG_RTC_DS1337
+#define CONFIG_SYS_I2C_RTC_ADDR                0x68
+
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+/*
+ * Board NAND Info.
+ */
+#define CONFIG_SYS_NAND_ADDR           NAND_BASE       /* physical address */
+                                                       /* to access nand */
+#define CONFIG_SYS_NAND_BASE           NAND_BASE       /* physical address */
+                                                       /* to access */
+                                                       /* nand at CS0 */
+
+#define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of */
+                                                       /* NAND devices */
+#define CONFIG_SYS_64BIT_VSPRINTF              /* needed for nand_util.c */
+
+#define CONFIG_JFFS2_NAND
+/* nand device jffs2 lives on */
+#define CONFIG_JFFS2_DEV               "nand0"
+/* start of jffs2 partition */
+#define CONFIG_JFFS2_PART_OFFSET       0x680000
+#define CONFIG_JFFS2_PART_SIZE         0xf980000       /* sz of jffs2 part */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY       10
+
+#define CONFIG_BOOTFILE                "uImage"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=0x82000000\0" \
+       "console=ttyO2,115200n8\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "root=/dev/mmcblk0p2 rw " \
+               "rootfstype=ext3 rootwait\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "root=/dev/mtdblock4 rw " \
+               "rootfstype=jffs2\0" \
+       "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+       "if mmc init; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+                               "run mmcboot; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
+
+#define CONFIG_AUTO_COMPLETE
+/*
+ * Miscellaneous configurable options
+ */
+#define V_PROMPT                       "mcx # "
+
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              V_PROMPT
+#define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                       sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS             16      /* max number of command */
+                                               /* args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
+/* memtest works on */
+#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
+#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
+                                       0x01F00000) /* 31MB */
+
+#define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
+                                                               /* address */
+
+/*
+ * AM3517 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE           OMAP34XX_GPT2
+#define CONFIG_SYS_PTV                 2       /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ                  1000
+
+/*
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 << 10)     /* regular stack 128 KiB */
+
+/*
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   2       /* CS1 may or may not be populated */
+#define PHYS_SDRAM_1           OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE      (32 << 20)      /* at least 32 MiB */
+#define PHYS_SDRAM_2           OMAP34XX_SDRC_CS1
+
+/*
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+
+/* Configure the PISMO */
+#define PISMO1_NAND_SIZE               GPMC_SIZE_128M
+
+#define CONFIG_NAND_OMAP_GPMC
+#define GPMC_NAND_ECC_LP_x16_LAYOUT
+#define CONFIG_ENV_IS_IN_NAND
+#define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
+
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR                        SMNAND_ENV_OFFSET
+
+/*
+ * CFI FLASH driver setup
+ */
+/* timeout values are in ticks */
+#define CONFIG_SYS_FLASH_ERASE_TOUT    (100 * CONFIG_SYS_HZ)
+#define CONFIG_SYS_FLASH_WRITE_TOUT    (100 * CONFIG_SYS_HZ)
+
+/* Flash banks JFFS2 should use */
+#define CONFIG_SYS_MAX_MTD_BANKS       (CONFIG_SYS_MAX_FLASH_BANKS + \
+                                       CONFIG_SYS_MAX_NAND_DEVICE)
+#define CONFIG_SYS_JFFS2_MEM_NAND
+/* use flash_info[2] */
+#define CONFIG_SYS_JFFS2_FIRST_BANK    CONFIG_SYS_MAX_FLASH_BANKS
+#define CONFIG_SYS_JFFS2_NUM_BANKS     1
+
+#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE       0x800
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR + \
+                                        CONFIG_SYS_INIT_RAM_SIZE - \
+                                        GENERATED_GBL_DATA_SIZE)
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_SOFTECC
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+
+#define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
+#define CONFIG_SPL_MAX_SIZE            (45 << 10)
+#define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
+
+/* move malloc and bss high to prevent clashing with the main image */
+#define CONFIG_SYS_SPL_MALLOC_START    0x8f000000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x80000
+#define CONFIG_SPL_BSS_START_ADDR      0x8f080000 /* end of RAM */
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION   1
+#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME       "u-boot.img"
+
+/* NAND boot config */
+#define CONFIG_SYS_NAND_PAGE_COUNT     64
+#define CONFIG_SYS_NAND_PAGE_SIZE      2048
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_BLOCK_SIZE     (128*1024)
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  0
+#define CONFIG_SYS_NAND_ECCPOS         {40, 41, 42, 43, 44, 45, 46, 47,\
+                                        48, 49, 50, 51, 52, 53, 54, 55,\
+                                        56, 57, 58, 59, 60, 61, 62, 63}
+#define CONFIG_SYS_NAND_ECCSIZE                256
+#define CONFIG_SYS_NAND_ECCBYTES       3
+
+#define CONFIG_SYS_NAND_ECCSTEPS       (CONFIG_SYS_NAND_PAGE_SIZE / \
+                                               CONFIG_SYS_NAND_ECCSIZE)
+#define CONFIG_SYS_NAND_ECCTOTAL       (CONFIG_SYS_NAND_ECCBYTES * \
+                                               CONFIG_SYS_NAND_ECCSTEPS)
+
+#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_TEXT_BASE
+
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
+
+/*
+ * ethernet support
+ *
+ */
+#if defined(CONFIG_CMD_NET)
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_DRIVER_TI_EMAC_USE_RMII
+#define CONFIG_MII
+#define CONFIG_BOOTP_DEFAULT
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_NET_RETRY_COUNT 10
+#endif
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/mt_ventoux.h b/include/configs/mt_ventoux.h
new file mode 100644 (file)
index 0000000..2034b59
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ *
+ * Copyright (C) 2009 TechNexion Ltd.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include "tam3517-common.h"
+
+#define MACH_TYPE_AM3517_MT_VENTOUX    3832
+#define CONFIG_MACH_TYPE       MACH_TYPE_AM3517_MT_VENTOUX
+
+#define CONFIG_BOOTDELAY       10
+#define CONFIG_BOOTFILE                "uImage"
+#define CONFIG_AUTO_COMPLETE
+
+#define CONFIG_HOSTNAME mt_ventoux
+
+/*
+ * Miscellaneous configurable options
+ */
+#define V_PROMPT                       "mt_ventoux => "
+#define CONFIG_SYS_PROMPT              V_PROMPT
+
+/*
+ * FPGA
+ */
+#define CONFIG_CMD_FPGA
+#define CONFIG_FPGA
+#define CONFIG_FPGA_XILINX
+#define CONFIG_FPGA_SPARTAN3
+#define CONFIG_SYS_FPGA_PROG_FEEDBACK
+#define CONFIG_SYS_FPGA_WAIT   10000
+#define CONFIG_MAX_FPGA_DEVICES        1
+#define CONFIG_FPGA_DELAY() udelay(1)
+#define CONFIG_SYS_FPGA_PROG_FEEDBACK
+
+#define        CONFIG_EXTRA_ENV_SETTINGS       CONFIG_TAM3517_SETTINGS \
+       "bootcmd=run net_nfs\0"
+
+#endif /* __CONFIG_H */
index 124a7a63ae807a07d01208ec47389a5520adaade..0962d3c8c46d3af4f076962ac75aa8f04f2d41e9 100644 (file)
@@ -86,6 +86,8 @@
        "script=boot.scr\0" \
        "uimage=uImage\0" \
        "console=ttymxc3\0" \
+       "fdt_high=0xffffffff\0" \
+       "initrd_high=0xffffffff\0" \
        "mmcdev=1\0" \
        "mmcpart=2\0" \
        "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
index 464f0ec65042ffb13373ed58d448c96d1f88c97d..d650ee340ab25c629b5808d0e770c11b47a1ad82 100644 (file)
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define        CONFIG_FEC_MXC
+#define        CONFIG_MII
+#define IMX_FEC_BASE                   ENET_BASE_ADDR
+#define        CONFIG_FEC_XCV_TYPE             RGMII
+#define CONFIG_ETHPRIME                        "FEC"
+#define CONFIG_FEC_MXC_PHYADDR         6
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX              1
@@ -66,8 +77,6 @@
 #include <config_cmd_default.h>
 
 #undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_NET
-#undef CONFIG_CMD_NFS
 
 #define CONFIG_BOOTDELAY               3
 
@@ -78,6 +87,8 @@
        "script=boot.scr\0" \
        "uimage=uImage\0" \
        "console=ttymxc3\0" \
+       "fdt_high=0xffffffff\0"   \
+       "initrd_high=0xffffffff\0" \
        "mmcdev=0\0" \
        "mmcpart=2\0" \
        "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
index 4c7a686d390b713be73d930b51f34c93dac0581b..d3a0122a09a6a613604434a4f137a21e44d0621a 100644 (file)
 /* USB EHCI */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_EHCI
+
+#define CONFIG_USB_EHCI_OMAP
+/*#define CONFIG_EHCI_DCACHE*/ /* leave it disabled for now */
+#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO       147
+
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
+
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
index b25631790551941864dcb0454c3c19c7bea69545..4910ddaa83b14c9e966aa78d8323440137f779b0 100644 (file)
 #if defined(CONFIG_CMD_NET)
 
 /* Ethernet (SMSC9115 from SMSC9118 family) */
-#define CONFIG_NET_MULTI
 #define CONFIG_SMC911X
 #define CONFIG_SMC911X_32_BIT
 #define CONFIG_SMC911X_BASE            0x2C000000
index a5746d160c423c41ad57b2bbb044bd5464df8d7d..b819d213408e7ac1ca1f14a937d707cebb359bfe 100644 (file)
  *----------------------------------------------------------------------------
  */
 #if defined(CONFIG_CMD_NET)
-  #define CONFIG_NET_MULTI
   #define CONFIG_SMC911X               1
   #define CONFIG_SMC911X_32_BIT
   #define CONFIG_SMC911X_BASE     0x2C000000
index e9ef2a3782b159b30bdf7f77e93b7dcbefc1ef84..b4756be5287accabf3fe30e47832bc7b7d20c65d 100644 (file)
 /*
  * High Level Configuration Options
  */
-#define CONFIG_PANDA           1       /* working with Panda */
+#define CONFIG_PANDA   /* working with Panda */
+
+/* USB UHH support options */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+
+#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 1
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 62
+
+/* USB Networking options */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+
+#define CONFIG_UBOOT_ENABLE_PADS_ALL
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 
 #include <configs/omap4_common.h>
+#define CONFIG_CMD_NET
 
 /* GPIO */
 #define CONFIG_CMD_GPIO
index cd502d10d8331b4042e546fc8c09643fe89078f2..8ede82575c74136ccbb54f1b254135d04c24eb82 100644 (file)
@@ -52,8 +52,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_CMDLINE_EDITING
 
-/* MACH_TYPE_ORIGEN macro will be removed once added to mach-types */
-#define MACH_TYPE_ORIGEN               3455
 #define CONFIG_MACH_TYPE               MACH_TYPE_ORIGEN
 
 /* Power Down Modes */
index 8e8fa163b8acd84e2bc7f3b5f7a6aa4ec9902406..3098c5acfe59c71b9afb7262b3d1295aaba8cbc6 100644 (file)
 #endif
 #define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
 
-#define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP /* do pci plug-and-play */
 #define CONFIG_E1000   /* Defind e1000 pci Ethernet card*/
 #define CONFIG_CMD_PCI
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_TSEC_ENET)
-
-#ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI
-#endif
-
 #define CONFIG_MII             /* MII PHY management */
 #define CONFIG_TSEC1
 #define CONFIG_TSEC1_NAME      "eTSEC1"
 #define CONFIG_ENV_SECT_SIZE   0x10000
 #elif defined(CONFIG_RAMBOOT_SDCARD)
 #define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
 #define CONFIG_ENV_SIZE                0x2000
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #elif defined(CONFIG_NAND_U_BOOT)
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
new file mode 100644 (file)
index 0000000..f53f20e
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010,2011, NVIDIA CORPORATION.  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 and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/sizes.h>
+#include "tegra2-common.h"
+
+/* High-level configuration options */
+#define TEGRA2_SYSMEM          "mem=512M@0M"
+#define V_PROMPT               "Tegra2 (Paz00) MOD # "
+#define CONFIG_TEGRA2_BOARD_STRING     "Compal Paz00"
+
+/* Board-specific serial config */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_TEGRA2_ENABLE_UARTA
+#define CONFIG_SYS_NS16550_COM1                NV_PA_APB_UARTA_BASE
+
+#define CONFIG_MACH_TYPE               MACH_TYPE_PAZ00
+#define CONFIG_SYS_BOARD_ODMDATA       0x800c0085 /* lp1, 512MB */
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* SD/MMC */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_TEGRA2_MMC
+#define CONFIG_CMD_MMC
+
+#define CONFIG_DOS_PARTITION
+#define CONFIG_EFI_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+
+/* Environment not stored */
+#define CONFIG_ENV_IS_NOWHERE
+#endif /* __CONFIG_H */
diff --git a/include/configs/pr1.h b/include/configs/pr1.h
new file mode 100644 (file)
index 0000000..03d4269
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * U-boot - Configuration file for PR1 Appliance
+ *
+ * based on bf537-stamp.h
+ * Copyright (c) Switchfin Org. <dpn@switchfin.org>
+ */
+
+#ifndef __CONFIG_PR1_H__
+#define __CONFIG_PR1_H__
+
+#include <asm/config-pre.h>
+
+
+/*
+ * Processor Settings
+ */
+#define CONFIG_BFIN_CPU             bf537-0.3
+#define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER
+
+
+/*
+ * Clock Settings
+ *     CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
+ *     SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
+ */
+/* CONFIG_CLKIN_HZ is any value in Hz                                  */
+#define CONFIG_CLKIN_HZ                        25000000
+/* CLKIN_HALF controls the DF bit in PLL_CTL      0 = CLKIN            */
+/*                                                1 = CLKIN / 2                */
+#define CONFIG_CLKIN_HALF              0
+/* PLL_BYPASS controls the BYPASS bit in PLL_CTL  0 = do not bypass    */
+/*                                                1 = bypass PLL       */
+#define CONFIG_PLL_BYPASS              0
+/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL             */
+/* Values can range from 0-63 (where 0 means 64)                       */
+#define CONFIG_VCO_MULT                        24
+/* CCLK_DIV controls the core clock divider                            */
+/* Values can be 1, 2, 4, or 8 ONLY                                    */
+#define CONFIG_CCLK_DIV                        1
+/* SCLK_DIV controls the system clock divider                          */
+/* Values can range from 1-15                                          */
+#define CONFIG_SCLK_DIV                        5
+
+
+/*
+ * Memory Settings
+ */
+#define CONFIG_MEM_ADD_WDTH    11
+#define CONFIG_MEM_SIZE                128
+
+#define CONFIG_EBIU_SDRRC_VAL  0x306
+#define CONFIG_EBIU_SDGCTL_VAL 0x8091998d
+
+#define CONFIG_EBIU_AMGCTL_VAL 0xFF
+#define CONFIG_EBIU_AMBCTL0_VAL        0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL        0xFFC27BB0
+
+#define CONFIG_SYS_MONITOR_LEN         (512 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (384 * 1024)
+
+
+/*
+ * Network Settings
+ */
+#ifndef __ADSPBF534__
+#define ADI_CMDS_NETWORK       1
+#define CONFIG_BFIN_MAC
+#define CONFIG_NETCONSOLE
+#endif
+#define CONFIG_HOSTNAME                pr1
+#define CONFIG_TFTP_BLOCKSIZE  4404
+/* Uncomment next line to use fixed MAC address */
+/* #define CONFIG_ETHADDR      02:80:ad:20:31:e8 */
+
+
+/*
+ * Flash Settings
+ */
+#define CONFIG_SYS_NO_FLASH    /* We have no parallel FLASH */
+
+
+/*
+ * SPI Settings
+ */
+#define CONFIG_BFIN_SPI
+#define CONFIG_ENV_SPI_MAX_HZ  30000000
+#define CONFIG_SF_DEFAULT_SPEED        30000000
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+
+
+/*
+ * Env Storage Settings
+ */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET      0x10000
+#define CONFIG_ENV_SIZE                0x2000
+#define CONFIG_ENV_SECT_SIZE   0x10000
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
+
+
+/*
+ * I2C Settings
+ */
+#define CONFIG_BFIN_TWI_I2C
+#define CONFIG_HARD_I2C
+
+
+/*
+ * NAND Settings
+ */
+#define CONFIG_NAND_PLAT
+#define CONFIG_SYS_NAND_BASE           0x20000000
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+
+#define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
+#define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
+#define BFIN_NAND_WRITE(addr, cmd) \
+       do { \
+               bfin_write8(addr, cmd); \
+               SSYNC(); \
+       } while (0)
+
+#define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
+#define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
+#define NAND_PLAT_GPIO_DEV_READY       GPIO_PF9
+
+/*
+ * Misc Settings
+ */
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_RTC_BFIN
+#define CONFIG_UART_CONSOLE    0
+#define CONFIG_SYS_PROMPT      "pr1>"
+#define CONFIG_BOOTCOMMAND     "run nandboot"
+#define CONFIG_BOOTDELAY       2
+#define CONFIG_LOADADDR                0x2000000
+
+
+/*
+ * Pull in common ADI header for remaining command/environment setup
+ */
+#include <configs/bfin_adi_common.h>
+
+/*
+ * Overwrite some settings defined in bfin_adi_common.h
+ */
+#undef NAND_ENV_SETTINGS
+#define NAND_ENV_SETTINGS \
+       "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
+       "nandboot=" \
+               "nand read $(loadaddr) 0x0 0x900000;" \
+               "run nandargs;" \
+               "bootm" \
+               "\0"
+
+#endif
index be000cbafe5c7e36f29d2525478fdcb648429e7d..8286680f26c14446bc42d7ab84bad78cf9931457 100644 (file)
@@ -49,6 +49,7 @@
 
 /* input clock of PLL: Universal has 24MHz input clock at EXYNOS4210 */
 #define CONFIG_SYS_CLK_FREQ_C210       24000000
+#define CONFIG_SYS_CLK_FREQ            CONFIG_SYS_CLK_FREQ_C210
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
index 73159846ef895801c34ccfe46f9c8a1e5baa539f..7d163201e32b3e677b9da95df5f7862e41d44a2c 100644 (file)
 #define CONFIG_SYS_MAXARGS     16
 #define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE
 
-/* may be activated as soon as s3c24x0 has print_cpuinfo support */
-/*#define CONFIG_DISPLAY_CPUINFO*/             /* Display cpu info */
+#define CONFIG_DISPLAY_CPUINFO                         /* Display cpu info */
 
 #define CONFIG_SYS_MEMTEST_START       0x30000000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END         0x33F00000      /* 63 MB in DRAM */
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
new file mode 100644 (file)
index 0000000..9659f9e
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * Configuration settings for the SAMSUNG SMDK5250 (EXYNOS5250) board.
+ *
+ * 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 __CONFIG_H
+#define __CONFIG_H
+
+/* High Level Configuration Options */
+#define CONFIG_SAMSUNG                 /* in a SAMSUNG core */
+#define CONFIG_S5P                     /* S5P Family */
+#define CONFIG_EXYNOS5                 /* which is in a Exynos5 Family */
+#define CONFIG_SMDK5250                        /* which is in a SMDK5250 */
+
+#include <asm/arch/cpu.h>              /* get chip and board defs */
+
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Keep L2 Cache Disabled */
+#define CONFIG_SYS_DCACHE_OFF
+
+#define CONFIG_SYS_SDRAM_BASE          0x40000000
+#define CONFIG_SYS_TEXT_BASE           0x43E00000
+
+/* input clock of PLL: SMDK5250 has 24MHz input clock */
+#define CONFIG_SYS_CLK_FREQ            24000000
+
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
+#define CONFIG_CMDLINE_EDITING
+
+/* MACH_TYPE_SMDK5250 macro will be removed once added to mach-types */
+#define MACH_TYPE_SMDK5250             3774
+#define CONFIG_MACH_TYPE               MACH_TYPE_SMDK5250
+
+/* Power Down Modes */
+#define S5P_CHECK_SLEEP                        0x00000BAD
+#define S5P_CHECK_DIDLE                        0xBAD00000
+#define S5P_CHECK_LPA                  0xABAD0000
+
+/* Offset for inform registers */
+#define INFORM0_OFFSET                 0x800
+#define INFORM1_OFFSET                 0x804
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (1 << 20))
+
+/* select serial console configuration */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_SERIAL1                 /* use SERIAL 1 */
+#define CONFIG_BAUDRATE                        115200
+#define EXYNOS5_DEFAULT_UART_OFFSET    0x010000
+
+#define TZPC_BASE_OFFSET               0x10000
+
+/* SD/MMC configuration */
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_S5P_MMC
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* PWM */
+#define CONFIG_PWM
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+
+/* Command definition*/
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_NET
+
+#define CONFIG_BOOTDELAY               3
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+
+/* MMC SPL */
+#define CONFIG_SPL
+#define COPY_BL2_FNPTR_ADDR    0x02020030
+
+#define CONFIG_BOOTCOMMAND     "mmc read 40007000 451 2000; bootm 40007000"
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser    */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              "SMDK5250 # "
+#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE              384     /* Print Buffer Size */
+#define CONFIG_SYS_MAXARGS             16      /* max number of command args */
+#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+/* memtest works on */
+#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
+#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
+
+#define CONFIG_SYS_HZ                  1000
+
+/* valid baudrates */
+#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_RD_LVL
+
+/* Stack sizes */
+#define CONFIG_STACKSIZE               (256 << 10)     /* 256KB */
+
+#define CONFIG_NR_DRAM_BANKS   8
+#define SDRAM_BANK_SIZE                (256UL << 20UL) /* 256 MB */
+#define PHYS_SDRAM_1           CONFIG_SYS_SDRAM_BASE
+#define PHYS_SDRAM_1_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_2           (CONFIG_SYS_SDRAM_BASE + SDRAM_BANK_SIZE)
+#define PHYS_SDRAM_2_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_3           (CONFIG_SYS_SDRAM_BASE + (2 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_3_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_4           (CONFIG_SYS_SDRAM_BASE + (3 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_4_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_5           (CONFIG_SYS_SDRAM_BASE + (4 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_5_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_6           (CONFIG_SYS_SDRAM_BASE + (5 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_6_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_7           (CONFIG_SYS_SDRAM_BASE + (6 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_7_SIZE      SDRAM_BANK_SIZE
+#define PHYS_SDRAM_8           (CONFIG_SYS_SDRAM_BASE + (7 * SDRAM_BANK_SIZE))
+#define PHYS_SDRAM_8_SIZE      SDRAM_BANK_SIZE
+
+#define CONFIG_SYS_MONITOR_BASE        0x00000000
+
+/* FLASH and environment organization */
+#define CONFIG_SYS_NO_FLASH
+#undef CONFIG_CMD_IMLS
+#define CONFIG_IDENT_STRING            " for SMDK5250"
+
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV         0
+
+#define CONFIG_SECURE_BL1_ONLY
+
+/* Secure FW size configuration */
+#ifdef CONFIG_SECURE_BL1_ONLY
+#define        CONFIG_SEC_FW_SIZE              (8 << 10)       /* 8KB */
+#else
+#define        CONFIG_SEC_FW_SIZE              0
+#endif
+
+/* Configuration of BL1, BL2, ENV Blocks on mmc */
+#define CONFIG_RES_BLOCK_SIZE  (512)
+#define CONFIG_BL1_SIZE                (16 << 10) /*16 K reserved for BL1*/
+#define        CONFIG_BL2_SIZE         (512UL << 10UL) /* 512 KB */
+#define CONFIG_ENV_SIZE                (16 << 10)      /* 16 KB */
+
+#define CONFIG_BL1_OFFSET      (CONFIG_RES_BLOCK_SIZE + CONFIG_SEC_FW_SIZE)
+#define CONFIG_BL2_OFFSET      (CONFIG_BL1_OFFSET + CONFIG_BL1_SIZE)
+#define CONFIG_ENV_OFFSET      (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE)
+
+/* U-boot copy size from boot Media to DRAM.*/
+#define BL2_START_OFFSET       (CONFIG_BL2_OFFSET/512)
+#define BL2_SIZE_BLOC_COUNT    (CONFIG_BL2_SIZE/512)
+#define CONFIG_DOS_PARTITION
+
+#define CONFIG_IRAM_STACK      0x02050000
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
+
+/* Ethernet Controllor Driver */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_BASE            0x5000000
+#define CONFIG_SMC911X_16_BIT
+#define CONFIG_ENV_SROM_BANK           1
+#endif /*CONFIG_CMD_NET*/
+
+/* Enable devicetree support */
+#define CONFIG_OF_LIBFDT
+
+#endif /* __CONFIG_H */
index f4963ac07e88854a8c6ebef953a95fdf5fa7de68..4c4321d2ff3606d700445648eed2dbe9d67a33ff 100644 (file)
 #define CONFIG_OMAP3_GPIO_5
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO       25
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_STORAGE
 #define CONFIG_BOOTP_DNS2
 #define CONFIG_BOOTP_SEND_HOSTNAME
 #define CONFIG_NET_RETRY_COUNT 10
-#define CONFIG_NET_MULTI
 
 /* Defines for SPL */
 #define CONFIG_SPL
 /* Setup MTD for NAND on the SOM */
 #define MTDIDS_DEFAULT         "nand0=omap2-nand.0"
 #define MTDPARTS_DEFAULT       "mtdparts=omap2-nand.0:512k(MLO)," \
-                               "512k(u-boot),128k(env1)," \
-                               "128k(env2),6m(kernel),-(rootfs)"
+                               "1m(u-boot),256k(env1)," \
+                               "256k(env2),6m(kernel),-(rootfs)"
 
 #define xstr(s)        str(s)
 #define str(s) #s
diff --git a/include/configs/trats.h b/include/configs/trats.h
new file mode 100644 (file)
index 0000000..10f11d9
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim <riverful.kim@samsung.com>
+ *
+ * Configuation settings for the SAMSUNG TRATS (EXYNOS4210) board.
+ *
+ * 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 __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+#define CONFIG_SAMSUNG         /* in a SAMSUNG core */
+#define CONFIG_S5P             /* which is in a S5P Family */
+#define CONFIG_EXYNOS4210      /* which is in a EXYNOS4210 */
+#define CONFIG_TRATS           /* working with TRATS */
+
+#include <asm/arch/cpu.h>      /* get chip and board defs */
+
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Keep L2 Cache Disabled */
+#define CONFIG_SYS_L2CACHE_OFF
+
+#define CONFIG_SYS_SDRAM_BASE          0x40000000
+#define CONFIG_SYS_TEXT_BASE           0x63300000
+
+/* input clock of PLL: TRATS has 24MHz input clock at EXYNOS4210 */
+#define CONFIG_SYS_CLK_FREQ_C210       24000000
+#define CONFIG_SYS_CLK_FREQ            CONFIG_SYS_CLK_FREQ_C210
+
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* MACH_TYPE_TRATS macro will be removed once added to mach-types */
+#define MACH_TYPE_TRATS                        3928
+#define CONFIG_MACH_TYPE               MACH_TYPE_TRATS
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (1 << 20))
+
+/* select serial console configuration */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_SERIAL2                 /* use SERIAL 2 */
+#define CONFIG_BAUDRATE                        115200
+
+/* MMC */
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_S5P_MMC
+
+/* PWM */
+#define CONFIG_PWM
+
+/* It should define before config_cmd_default.h */
+#define CONFIG_SYS_NO_FLASH
+
+/* Command definition */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MISC
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_XIMG
+#undef CONFIG_CMD_CACHE
+#undef CONFIG_CMD_ONENAND
+#undef CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_MMC
+
+#define CONFIG_BOOTDELAY               1
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_BOOTARGS                        "Please use defined boot"
+#define CONFIG_BOOTCOMMAND             "run mmcboot"
+
+#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"
+#define CONFIG_BOOTBLOCK               "10"
+#define CONFIG_ENV_COMMON_BOOT         "${console} ${meminfo}"
+
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_SYS_CONSOLE_INFO_QUIET
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "bootk=" \
+               "run loaduimage; bootm 0x40007FC0\0" \
+       "updatemmc=" \
+               "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \
+               "mmc boot 0 1 1 0\0" \
+       "updatebackup=" \
+               "mmc boot 0 1 1 2; mmc write 0 0x42100000 0 0x200;" \
+               "mmc boot 0 1 1 0\0" \
+       "updatebootb=" \
+               "mmc read 0 0x42100000 0x80 0x200; run updatebackup\0" \
+       "lpj=lpj=3981312\0" \
+       "nfsboot=" \
+               "set bootargs root=/dev/nfs rw " \
+               "nfsroot=${nfsroot},nolock,tcp " \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:" \
+               "${netmask}:generic:usb0:off " CONFIG_ENV_COMMON_BOOT \
+               "; run bootk\0" \
+       "ramfsboot=" \
+               "set bootargs root=/dev/ram0 rw rootfstype=ext2 " \
+               "${console} ${meminfo} " \
+               "initrd=0x43000000,8M ramdisk=8192\0" \
+       "mmcboot=" \
+               "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
+               "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \
+               "run loaduimage; bootm 0x40007FC0\0" \
+       "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
+       "boottrace=setenv opts initcall_debug; run bootcmd\0" \
+       "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \
+       "verify=n\0" \
+       "rootfstype=ext4\0" \
+       "console=" CONFIG_DEFAULT_CONSOLE \
+       "meminfo=crashkernel=32M@0x50000000\0" \
+       "nfsroot=/nfsroot/arm\0" \
+       "bootblock=" CONFIG_BOOTBLOCK "\0" \
+       "mmcdev=0\0" \
+       "mmcbootpart=2\0" \
+       "mmcrootpart=3\0" \
+       "opts=always_resume=1"
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              "TRATS # "
+#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE              384     /* Print Buffer Size */
+#define CONFIG_SYS_MAXARGS             16      /* max number of command args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+/* memtest works on */
+#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5000000)
+#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x4800000)
+
+#define CONFIG_SYS_HZ                  1000
+
+/* valid baudrates */
+#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
+
+/* Stack sizes */
+#define CONFIG_STACKSIZE               (256 << 10) /* regular stack 256KB */
+
+/* TRATS has 2 banks of DRAM */
+#define CONFIG_NR_DRAM_BANKS   2
+#define PHYS_SDRAM_1           CONFIG_SYS_SDRAM_BASE   /* LDDDR2 DMC 0 */
+#define PHYS_SDRAM_1_SIZE      (256 << 20)             /* 256 MB in CS 0 */
+#define PHYS_SDRAM_2           0x50000000              /* LPDDR2 DMC 1 */
+#define PHYS_SDRAM_2_SIZE      (256 << 20)             /* 256 MB in CS 0 */
+
+#define CONFIG_SYS_MEM_TOP_HIDE                (1 << 20)       /* ram console */
+
+#define CONFIG_SYS_MONITOR_BASE                0x00000000
+#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
+
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV         0
+#define CONFIG_ENV_SIZE                        4096
+#define CONFIG_ENV_OFFSET              ((32 - 4) << 10) /* 32KiB - 4KiB */
+
+#define CONFIG_DOS_PARTITION
+
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_CACHELINE_SIZE       32
+
+#include <asm/arch/gpio.h>
+/*
+ * I2C Settings
+ */
+#define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_part1_get_nr(b, 7)
+#define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_part1_get_nr(b, 6)
+
+#define CONFIG_SOFT_I2C
+#define CONFIG_SOFT_I2C_READ_REPEATED_START
+#define CONFIG_SYS_I2C_SPEED   50000
+#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_MAX_I2C_BUS 7
+
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_MAX8998
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_S3C_UDC_OTG
+#define CONFIG_USB_GADGET_DUALSPEED
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
new file mode 100644 (file)
index 0000000..f87696b
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments.
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Syed Mohammed Khasim <x0khasim@ti.com>
+ *
+ * (C) Copyright 2012
+ * Corscience GmbH & Co. KG
+ * Thomas Weber <weber@corscience.de>
+ *
+ * Configuration settings for the Tricorder board.
+ *
+ * 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 __CONFIG_H
+#define __CONFIG_H
+
+/* High Level Configuration Options */
+#define CONFIG_OMAP                    /* in a TI OMAP core */
+#define CONFIG_OMAP34XX                        /* which is a 34XX */
+
+#define CONFIG_MACH_TYPE               MACH_TYPE_TRICORDER
+/*
+ * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
+ * 64 bytes before this address should be set aside for u-boot.img's
+ * header. That is 0x800FFFC0--0x80100000 should not be used for any
+ * other needs.
+ */
+#define CONFIG_SYS_TEXT_BASE           0x80100000
+
+#define CONFIG_SDRC                    /* The chip has SDRC controller */
+
+#include <asm/arch/cpu.h>              /* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/* Display CPU and Board information */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Clock Defines */
+#define V_OSCK                         26000000 /* Clock output from T2 */
+#define V_SCLK                         (V_OSCK >> 1)
+
+#undef CONFIG_USE_IRQ                  /* no support for IRQs */
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+
+#define CONFIG_OF_LIBFDT
+
+/* Size of malloc() pool */
+#define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
+                                               /* Sector */
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (512 << 10))
+
+/* Hardware drivers */
+
+/* NS16550 Configuration */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
+#define CONFIG_SYS_NS16550_CLK         48000000 /* 48MHz (APLL96/2) */
+
+/* select serial console configuration */
+#define CONFIG_CONS_INDEX              3
+#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
+#define CONFIG_SERIAL3                 3
+#define CONFIG_BAUDRATE                        115200
+#define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
+                                       115200}
+
+/* MMC */
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_DOS_PARTITION
+
+/* I2C */
+#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_SLAVE           1
+#define CONFIG_SYS_I2C_BUS             0
+#define CONFIG_SYS_I2C_BUS_SELECT      1
+#define CONFIG_DRIVER_OMAP34XX_I2C     1
+
+/* TWL4030 */
+#define CONFIG_TWL4030_POWER
+#define CONFIG_TWL4030_LED
+
+/* Board NAND Info */
+#define CONFIG_SYS_NO_FLASH            /* no NOR flash */
+#define CONFIG_MTD_DEVICE              /* needed for mtdparts commands */
+#define MTDIDS_DEFAULT                 "nand0=nand"
+#define MTDPARTS_DEFAULT               "mtdparts=nand:" \
+                                               "512k(u-boot-spl)," \
+                                               "1920k(u-boot)," \
+                                               "128k(u-boot-env)," \
+                                               "4m(kernel)," \
+                                               "-(fs)"
+
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR           NAND_BASE       /* physical address */
+                                                       /* to access nand */
+#define CONFIG_SYS_NAND_BASE           NAND_BASE       /* physical address */
+                                                       /* to access nand at */
+                                                       /* CS0 */
+#define GPMC_NAND_ECC_LP_x16_LAYOUT    1
+
+#define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of NAND */
+                                                       /* devices */
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EXT2                        /* EXT2 Support */
+#define CONFIG_CMD_FAT                 /* FAT support */
+#define CONFIG_CMD_I2C                 /* I2C serial bus support */
+#define CONFIG_CMD_MMC                 /* MMC support */
+#define CONFIG_CMD_MTDPARTS            /* Enable MTD parts commands */
+#define CONFIG_CMD_NAND                        /* NAND support */
+#define CONFIG_CMD_NAND_LOCK_UNLOCK    /* nand (un)lock commands */
+#define CONFIG_CMD_UBI                 /* UBIFS commands */
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_FPGA                 /* FPGA configuration Support */
+#undef CONFIG_CMD_IMI                  /* iminfo */
+#undef CONFIG_CMD_JFFS2                        /* JFFS2 Support */
+
+/* needed for ubi */
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE       /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+
+/* Environment information */
+#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
+
+#define CONFIG_BOOTDELAY               3
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=0x82000000\0" \
+       "console=ttyO2,115200n8\0" \
+       "vram=12M\0" \
+       "lcdmode=800x600\0" \
+       "defaultdisplay=lcd\0" \
+       "kernelopts=rw rootwait\0" \
+       "commonargs=" \
+               "setenv bootargs console=${console} " \
+               "vram=${vram} " \
+               "omapfb.mode=lcd:${lcdmode} " \
+               "omapdss.def_disp=${defaultdisplay}\0" \
+       "mmcargs=" \
+               "run commonargs; " \
+               "setenv bootargs ${bootargs} " \
+               "root=/dev/mmcblk0p2 " \
+               "${kernelopts}\0" \
+       "nandargs=" \
+               "run commonargs; " \
+               "setenv bootargs ${bootargs} " \
+               "omapfb.mode=lcd:${lcdmode} " \
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=ubi0:rootfs " \
+               "rootfstype=ubifs " \
+               "${kernelopts}\0" \
+       "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+       "eraseenv=nand unlock 0x260000 0x20000; nand erase 0x260000 0x20000\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
+       "autoboot=if mmc init 0; then " \
+                       "if run loadbootscript; then " \
+                               "run bootscript; " \
+                       "else " \
+                               "if run loaduimage; then " \
+                                       "run mmcboot; " \
+                               "else run nandboot; " \
+                               "fi; " \
+                       "fi; " \
+               "else run nandboot; fi\0"
+
+
+#define CONFIG_BOOTCOMMAND "run autoboot"
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_SYS_PROMPT              "OMAP3 Tricorder # "
+#define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                       sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS             16      /* max number of command args */
+
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
+
+#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0 + 0x07000000)
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
+                                       0x01000000) /* 16MB */
+
+#define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0 + 0x02000000)
+
+/*
+ * OMAP3 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
+#define CONFIG_SYS_PTV                 2 /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ                  1000
+
+/* The stack sizes are set up in start.S using the settings below */
+#define CONFIG_STACKSIZE               (128 << 10) /* regular stack 128 KiB */
+
+/*  Physical Memory Map  */
+#define CONFIG_NR_DRAM_BANKS           2 /* CS1 may or may not be populated */
+#define PHYS_SDRAM_1                   OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE              (128 << 20)     /* at least 128 MiB */
+#define PHYS_SDRAM_2                   OMAP34XX_SDRC_CS1
+
+/* NAND and environment organization  */
+#define PISMO1_NAND_SIZE               GPMC_SIZE_128M
+
+#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
+
+#define CONFIG_ENV_IS_IN_NAND          1
+#define CONFIG_ENV_OFFSET              0x260000 /* environment starts here */
+
+#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR       0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE       0x800
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_INIT_RAM_ADDR + \
+                                               CONFIG_SYS_INIT_RAM_SIZE - \
+                                               GENERATED_GBL_DATA_SIZE)
+
+/* SRAM config */
+#define CONFIG_SYS_SRAM_START          0x40200000
+#define CONFIG_SYS_SRAM_SIZE           0x10000
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SIMPLE
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME        "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION    1
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
+
+#define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
+#define CONFIG_SPL_MAX_SIZE            0xB400  /* 45 K */
+#define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SPL_BSS_START_ADDR      0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+
+/* NAND boot config */
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT     64
+#define CONFIG_SYS_NAND_PAGE_SIZE      2048
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_BLOCK_SIZE     (128*1024)
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS         {2, 3, 4, 5, 6, 7, 8, 9,\
+                                               10, 11, 12, 13}
+
+#define CONFIG_SYS_NAND_ECCSIZE                512
+#define CONFIG_SYS_NAND_ECCBYTES       3
+
+#define CONFIG_SYS_NAND_ECCSTEPS       (CONFIG_SYS_NAND_PAGE_SIZE / \
+                                               CONFIG_SYS_NAND_ECCSIZE)
+#define CONFIG_SYS_NAND_ECCTOTAL       (CONFIG_SYS_NAND_ECCBYTES * \
+                                               CONFIG_SYS_NAND_ECCSTEPS)
+
+#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_TEXT_BASE
+
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE    0x200000
+
+#define CONFIG_SYS_SPL_MALLOC_START    0x80208000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000        /* 1 MB */
+
+#endif /* __CONFIG_H */
index 7e293c676c238dbcc9675c5e7d1bc6d6712ca717..35d2bd820f6fd46e927bb65a647bd8ecb960dda9 100644 (file)
 #define CONFIG_SMC911X_BASE            (CS4_BASE+0x200000)
 #define CONFIG_SMC911X_16_BIT
 
+/* mmc driver */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MXC_MMC
+#define CONFIG_MXC_MCI_REGS_BASE       SDHC1_BASE_ADDR
 /*
  * Command definition
  */
 
 #define CONFIG_CMDLINE_EDITING
 
+/* MMC boot support */
+#define CONFIG_CMD_MMC
+#define CONFIG_DOS_PARTITION
+#define CONFIG_EFI_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+
 #define CONFIG_NAND_MXC
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
new file mode 100644 (file)
index 0000000..ed4cf6c
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * U-boot - linkage.h
+ *
+ * Copyright (c) 2005-2007 Analog Devices Inc.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _LINUX_LINKAGE_H
+#define _LINUX_LINKAGE_H
+
+#include <asm/linkage.h>
+#include <linux/config.h>
+
+#ifdef __cplusplus
+#define CPP_ASMLINKAGE         extern "C"
+#else
+#define CPP_ASMLINKAGE
+#endif
+
+#define asmlinkage CPP_ASMLINKAGE
+
+#define SYMBOL_NAME_STR(X)     #X
+#define SYMBOL_NAME(X)         X
+#ifdef __STDC__
+#define SYMBOL_NAME_LABEL(X)   X##:
+#else
+#define SYMBOL_NAME_LABEL(X)   X:
+#endif
+
+#define __ALIGN .align         4
+#define __ALIGN_STR            ".align 4"
+
+#ifdef __ASSEMBLY__
+
+#define ALIGN                  __ALIGN
+#define ALIGN_STR              __ALIGN_STR
+
+#define LENTRY(name) \
+       ALIGN; \
+       SYMBOL_NAME_LABEL(name)
+
+#define ENTRY(name) \
+       .globl SYMBOL_NAME(name); \
+       LENTRY(name)
+
+#ifndef END
+#define END(name) \
+       .size name, .-name
+#endif
+
+#ifndef ENDPROC
+#define ENDPROC(name) \
+       .type name, @function; \
+       END(name)
+#endif
+
+#endif
+
+#endif
diff --git a/include/mc13783.h b/include/mc13783.h
new file mode 100644 (file)
index 0000000..5e41c3e
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * (C) Copyright 2011
+ * Helmut Raiger, HALE electronic GmbH, helmut.raiger@hale.at
+ *
+ * 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 __MC13783_H__
+#define __MC13783_H__
+
+/* REG_MODE_0 */
+#define VAUDIOEN       (1 << 0)
+#define VAUDIOSTBY     (1 << 1)
+#define VAUDIOMODE     (1 << 2)
+#define VIOHIEN                (1 << 3)
+#define VIOHISTBY      (1 << 4)
+#define VIOHIMODE      (1 << 5)
+#define VIOLOEN                (1 << 6)
+#define VIOLOSTBY      (1 << 7)
+#define VIOLOMODE      (1 << 8)
+#define VDIGEN                 (1 << 9)
+#define VDIGSTBY       (1 << 10)
+#define VDIGMODE       (1 << 11)
+#define VGENEN         (1 << 12)
+#define VGENSTBY       (1 << 13)
+#define VGENMODE       (1 << 14)
+#define VRFDIGEN       (1 << 15)
+#define VRFDIGSTBY     (1 << 16)
+#define VRFDIGMODE     (1 << 17)
+#define VRFREFEN       (1 << 18)
+#define VRFREFSTBY     (1 << 19)
+#define VRFREFMODE     (1 << 20)
+#define VRFCPEN                (1 << 21)
+#define VRFCPSTBY      (1 << 22)
+#define VRFCPMODE      (1 << 23)
+
+/* REG_MODE_1 */
+#define VSIMEN         (1 << 0)
+#define VSIMSTBY       (1 << 1)
+#define VSIMMODE       (1 << 2)
+#define VESIMEN                (1 << 3)
+#define VESIMSTBY      (1 << 4)
+#define VESIMMODE      (1 << 5)
+#define VCAMEN         (1 << 6)
+#define VCAMSTBY       (1 << 7)
+#define VCAMMODE       (1 << 8)
+#define VRFBGEN                (1 << 9)
+#define VRFBGSTBY      (1 << 10)
+#define VVIBEN         (1 << 11)
+#define VRF1EN         (1 << 12)
+#define VRF1STBY       (1 << 13)
+#define VRF1MODE       (1 << 14)
+#define VRF2EN         (1 << 15)
+#define VRF2STBY       (1 << 16)
+#define VRF2MODE       (1 << 17)
+#define VMMC1EN                (1 << 18)
+#define VMMC1STBY      (1 << 19)
+#define VMMC1MODE      (1 << 20)
+#define VMMC2EN                (1 << 21)
+#define VMMC2STBY      (1 << 22)
+#define VMMC2MODE      (1 << 23)
+
+#endif
index cf14a9cca356c4279f40854d4c25a311e562edb2..7af5fdb0edfa4302b3162f75518d02c63921ddb3 100644 (file)
@@ -26,5 +26,9 @@ int menu_default_set(struct menu *m, char *item_key);
 int menu_get_choice(struct menu *m, void **choice);
 int menu_item_add(struct menu *m, char *item_key, void *item_data);
 int menu_destroy(struct menu *m);
+void menu_display_statusline(struct menu *m);
 
+#if defined(CONFIG_MENU_SHOW)
+int menu_show(int bootdelay);
+#endif
 #endif /* __MENU_H__ */
index 802f077be4d76add59fc0c85404c0962902ada00..4a23fd2af23cf0439b92f0c7f00e5d609c7ac676 100644 (file)
 #define CONFIG_USB_ULPI_TIMEOUT 1000   /* timeout in us */
 #endif
 
+/*
+ * ulpi view port address and
+ * Port_number that can be passed.
+ * Any additional data to be passed can
+ * be extended from this structure
+ */
+struct ulpi_viewport {
+       u32 viewport_addr;
+       u32 port_num;
+};
+
 /*
  * Initialize the ULPI transciever and check the interface integrity.
- * @ulpi_viewport -  the address of the ULPI viewport register.
+ * @ulpi_vp -  structure containing ULPI viewport data
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_init(u32 ulpi_viewport);
+int ulpi_init(struct ulpi_viewport *ulpi_vp);
 
 /*
  * Select transceiver speed.
@@ -41,7 +52,7 @@ int ulpi_init(u32 ulpi_viewport);
  *                ULPI_FC_LOW_SPEED,  ULPI_FC_FS4LS
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed);
+int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed);
 
 /*
  * Enable/disable VBUS.
@@ -50,14 +61,15 @@ int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed);
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_enable_vbus(u32 ulpi_viewport, int on, int ext_power, int ext_ind);
+int ulpi_enable_vbus(struct ulpi_viewport *ulpi_vp,
+                       int on, int ext_power, int ext_ind);
 
 /*
  * Enable/disable pull-down resistors on D+ and D- USB lines.
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_set_pd(u32 ulpi_viewport, int enable);
+int ulpi_set_pd(struct ulpi_viewport *ulpi_vp, int enable);
 
 /*
  * Select OpMode.
@@ -66,7 +78,7 @@ int ulpi_set_pd(u32 ulpi_viewport, int enable);
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode);
+int ulpi_opmode_sel(struct ulpi_viewport *ulpi_vp, unsigned opmode);
 
 /*
  * Switch to Serial Mode.
@@ -78,7 +90,7 @@ int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode);
  * Switches immediately to Serial Mode.
  * To return from Serial Mode, STP line needs to be asserted.
  */
-int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode);
+int ulpi_serial_mode_enable(struct ulpi_viewport *ulpi_vp, unsigned smode);
 
 /*
  * Put PHY into low power mode.
@@ -89,14 +101,14 @@ int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode);
  * STP line must be driven low to keep the PHY in suspend.
  * To resume the PHY, STP line needs to be asserted.
  */
-int ulpi_suspend(u32 ulpi_viewport);
+int ulpi_suspend(struct ulpi_viewport *ulpi_vp);
 
 /*
  * Reset the transceiver. ULPI interface and registers are not affected.
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_reset(u32 ulpi_viewport);
+int ulpi_reset(struct ulpi_viewport *ulpi_vp);
 
 
 /* ULPI access methods below must be implemented for each ULPI viewport. */
@@ -108,7 +120,7 @@ int ulpi_reset(u32 ulpi_viewport);
  *
  * returns 0 on success, ULPI_ERROR on failure.
  */
-int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value);
+int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value);
 
 /*
  * Read the ULPI PHY register content via the viewport.
@@ -116,14 +128,14 @@ int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value);
  *
  * returns register content on success, ULPI_ERROR on failure.
  */
-u32 ulpi_read(u32 ulpi_viewport, u8 *reg);
+u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg);
 
 /*
  * Wait for the reset to complete.
  * The Link must not attempt to access the PHY until the reset has
  * completed and DIR line is de-asserted.
  */
-int ulpi_reset_wait(u32 ulpi_viewport);
+int ulpi_reset_wait(struct ulpi_viewport *ulpi_vp);
 
 /* Access Extended Register Set (indicator) */
 #define ACCESS_EXT_REGS_OFFSET 0x2f    /* read-write */
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
deleted file mode 100644 (file)
index 7746e41..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# (C) Copyright 2006-2007
-# Stefan Roese, DENX Software Engineering, sr@denx.de.
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <lg@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
-#
-
-CONFIG_NAND_SPL        = y
-
-include $(TOPDIR)/config.mk
-
-nandobj        := $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-          $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS  = _divsi3.o \
-       _udivsi3.o \
-       start.o
-
-COBJS  = cpu.o \
-       davinci_nand.o \
-       pinmux.o \
-       da850_pinmux.o \
-       div0.o \
-       hawkboard_nand_spl.o \
-       misc.o \
-       nand_boot.o \
-       ns16550.o \
-       psc.o
-
-SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS := $(SOBJS) $(COBJS)
-LNDIR  := $(nandobj)board/$(BOARDDIR)
-
-ALL    = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin \
-       $(nandobj)u-boot-spl-16k.bin
-
-all:   $(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-       $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:      $(nandobj)u-boot-spl
-       $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:  $(OBJS) $(nandobj)u-boot.lds
-       cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-               -Map $(nandobj)u-boot-spl.map \
-               -o $(nandobj)u-boot-spl
-
-$(nandobj)u-boot.lds: $(LDSCRIPT)
-       $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
-
-# create symbolic links for common files
-
-# from board directory
-$(obj)pinmux.c:
-       @rm -f $@
-       @ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
-
-$(obj)da850_pinmux.c:
-       @rm -f $@
-       @ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c $@
-
-# from drivers/mtd/nand directory
-$(obj)davinci_nand.c:
-       @rm -f $@
-       @ln -s $(TOPDIR)/drivers/mtd/nand/davinci_nand.c $@
-
-# from nand_spl directory
-$(obj)nand_boot.c:
-       @rm -f $@
-       @ln -s $(TOPDIR)/nand_spl/nand_boot.c $@
-
-# from drivers/serial directory
-$(obj)ns16550.c:
-       @rm -f $@
-       @ln -sf $(TOPDIR)/drivers/serial/ns16550.c $@
-
-# from cpu directory
-$(obj)start.S:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/start.S $@
-
-# from lib directory
-$(obj)_udivsi3.S:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/lib/_udivsi3.S $@
-
-# from lib directory
-$(obj)_divsi3.S:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/lib/_divsi3.S $@
-
-# from lib directory
-$(obj)div0.c:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/lib/div0.c $@
-
-# from SoC directory
-$(obj)cpu.c:
-       @rm -f $@
-       @ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/cpu.c $@
-
-$(obj)misc.c:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/misc.c $@
-
-# from board directory
-$(obj)hawkboard_nand_spl.c:
-       @rm -f $@
-       ln -s $(TOPDIR)/board/davinci/da8xxevm/hawkboard_nand_spl.c $@
-
-$(obj)psc.c:
-       @rm -f $@
-       ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/psc.c $@
-
-#########################################################################
-
-$(obj)%.o:     $(obj)%.S
-       $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:     $(obj)%.c
-       $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/davinci/da8xxevm/u-boot.lds b/nand_spl/board/davinci/da8xxevm/u-boot.lds
deleted file mode 100644 (file)
index 638ffd9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
- *
- * (C) Copyright 2008
- * Guennadi Liakhovetki, DENX Software Engineering, <lg@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
- */
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-       . = 0xc1080000;
-
-       . = ALIGN(4);
-       .text      :
-       {
-         start.o       (.text)
-         cpu.o         (.text)
-         nand_boot.o   (.text)
-
-         *(.text)
-       }
-
-       . = ALIGN(4);
-       .rodata : { *(.rodata) }
-
-       . = ALIGN(4);
-       .data : {
-               *(.data)
-       __datarel_start = .;
-               *(.data.rel)
-       __datarelrolocal_start = .;
-               *(.data.rel.ro.local)
-       __datarellocal_start = .;
-               *(.data.rel.local)
-       __datarelro_start = .;
-               *(.data.rel.ro)
-       }
-
-       . = ALIGN(4);
-       __rel_dyn_start = .;
-       __rel_dyn_end = .;
-       __dynsym_start = .;
-
-       __got_start = .;
-       . = ALIGN(4);
-       .got : { *(.got) }
-
-       __got_end = .;
-
-       _end = .;
-
-       . = ALIGN(4);
-       __bss_start = .;
-       .bss : { *(.bss) }
-       __bss_end__ = .;
-}
index d62f10aa539eb0f3ce49b207aa0059f076892fc3..8705b12f03833405643d72d70e6ee4204627c1b8 100644 (file)
@@ -495,7 +495,8 @@ void post_reloc(void)
  */
 unsigned long post_time_ms(unsigned long base)
 {
-#if defined(CONFIG_PPC) || defined(CONFIG_ARM) && !defined(CONFIG_KIRKWOOD)
+#if defined(CONFIG_PPC) || defined(CONFIG_BLACKFIN) || \
+    (defined(CONFIG_ARM) && !defined(CONFIG_KIRKWOOD))
        return (unsigned long)lldiv(get_ticks(), get_tbclk() / CONFIG_SYS_HZ)
                - base;
 #else
index 64bcc4db4727c17471c39769f2de967d5da9f751..8993fdd7b2d40363ecffffb53316605dc688a669 100644 (file)
@@ -68,6 +68,7 @@ BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
 BIN_FILES-y += mkenvimage$(SFX)
 BIN_FILES-y += mkimage$(SFX)
+BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
 BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -94,6 +95,7 @@ NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
+OBJ_FILES-$(CONFIG_SMDK5250) += mkexynosspl.o
 OBJ_FILES-$(CONFIG_MX28) += mxsboot.o
 OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
@@ -213,6 +215,10 @@ $(obj)mkimage$(SFX):       $(obj)aisimage.o \
        $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
        $(HOSTSTRIP) $@
 
+$(obj)mk$(BOARD)spl$(SFX):     $(obj)mkexynosspl.o
+       $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+       $(HOSTSTRIP) $@
+
 $(obj)mpc86x_clk$(SFX):        $(obj)mpc86x_clk.o
        $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
        $(HOSTSTRIP) $@
index 8e81bdb9c4624ef4028367967e533a9c33c70199..1e0f5d4e55eb10f78acbcf9fa4ef177851b7a2a8 100644 (file)
@@ -47,10 +47,12 @@ static table_entry_t imximage_cmds[] = {
  * this is needed to set the correct flash offset
  */
 static table_entry_t imximage_bootops[] = {
-       {FLASH_OFFSET_SPI,      "spi",          "SPI Flash",    },
+       {FLASH_OFFSET_ONENAND,  "onenand",      "OneNAND Flash",},
        {FLASH_OFFSET_NAND,     "nand",         "NAND Flash",   },
+       {FLASH_OFFSET_NOR,      "nor",          "NOR Flash",    },
+       {FLASH_OFFSET_SATA,     "sata",         "SATA Disk",    },
        {FLASH_OFFSET_SD,       "sd",           "SD Card",      },
-       {FLASH_OFFSET_ONENAND,  "onenand",      "OneNAND Flash",},
+       {FLASH_OFFSET_SPI,      "spi",          "SPI Flash",    },
        {-1,                    "",             "Invalid",      },
 };
 
@@ -59,7 +61,7 @@ static table_entry_t imximage_bootops[] = {
  */
 static table_entry_t imximage_versions[] = {
        {IMXIMAGE_V1,   "",     " (i.MX25/35/51 compatible)", },
-       {IMXIMAGE_V2,   "",     " (i.MX53 compatible)",       },
+       {IMXIMAGE_V2,   "",     " (i.MX53/6 compatible)",     },
        {-1,            "",     " (Invalid)",                 },
 };
 
index d126a46a73c032766e53d24f787db64118e72921..d784a8d2ec1e5a30ec6600e87d7716ec0d3373ea 100644 (file)
@@ -37,6 +37,8 @@
 #define FLASH_OFFSET_SD                FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_SPI       FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_ONENAND   0x100
+#define FLASH_OFFSET_NOR       0x1000
+#define FLASH_OFFSET_SATA      FLASH_OFFSET_STANDARD
 
 #define IVT_HEADER_TAG 0xD1
 #define IVT_VERSION 0x40
diff --git a/tools/mkexynosspl.c b/tools/mkexynosspl.c
new file mode 100644 (file)
index 0000000..6a8dd93
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <compiler.h>
+
+#define CHECKSUM_OFFSET                (14*1024-4)
+#define BUFSIZE                        (14*1024)
+#define FILE_PERM              (S_IRUSR | S_IWUSR | S_IRGRP \
+                               | S_IWGRP | S_IROTH | S_IWOTH)
+/*
+* Requirement:
+* IROM code reads first 14K bytes from boot device.
+* It then calculates the checksum of 14K-4 bytes and compare with data at
+* 14K-4 offset.
+*
+* This function takes two filenames:
+* IN  "u-boot-spl.bin" and
+* OUT "$(BOARD)-spl.bin as filenames.
+* It reads the "u-boot-spl.bin" in 16K buffer.
+* It calculates checksum of 14K-4 Bytes and stores at 14K-4 offset in buffer.
+* It writes the buffer to "$(BOARD)-spl.bin" file.
+*/
+
+int main(int argc, char **argv)
+{
+       unsigned char buffer[BUFSIZE];
+       int i, ifd, ofd;
+       uint32_t checksum = 0;
+       off_t   len;
+       ssize_t count;
+       struct stat stat;
+
+       if (argc != 3) {
+               fprintf(stderr, "Usage: %s <infile> <outfile>\n", argv[0]);
+               exit(EXIT_FAILURE);
+       }
+
+       ifd = open(argv[1], O_RDONLY);
+       if (ifd < 0) {
+               fprintf(stderr, "%s: Can't open %s: %s\n",
+                       argv[0], argv[1], strerror(errno));
+               exit(EXIT_FAILURE);
+       }
+
+       ofd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, FILE_PERM);
+       if (ifd < 0) {
+               fprintf(stderr, "%s: Can't open %s: %s\n",
+                       argv[0], argv[2], strerror(errno));
+               close(ifd);
+               exit(EXIT_FAILURE);
+       }
+
+       if (fstat(ifd, &stat)) {
+               fprintf(stderr, "%s: Unable to get size of %s: %s\n",
+                       argv[0], argv[1], strerror(errno));
+               close(ifd);
+               close(ofd);
+               exit(EXIT_FAILURE);
+       }
+
+       len = stat.st_size;
+
+       count = (len < CHECKSUM_OFFSET) ? len : CHECKSUM_OFFSET;
+
+       if (read(ifd, buffer, count) != count) {
+               fprintf(stderr, "%s: Can't read %s: %s\n",
+                       argv[0], argv[1], strerror(errno));
+
+               close(ifd);
+               close(ofd);
+
+               exit(EXIT_FAILURE);
+       }
+
+       for (i = 0, checksum = 0; i < CHECKSUM_OFFSET; i++)
+               checksum += buffer[i];
+
+       checksum = cpu_to_le32(checksum);
+
+       memcpy(&buffer[CHECKSUM_OFFSET], &checksum, sizeof(checksum));
+
+       if (write(ofd, buffer, BUFSIZE) != BUFSIZE) {
+               fprintf(stderr, "%s: Can't write %s: %s\n",
+                       argv[0], argv[2], strerror(errno));
+
+               close(ifd);
+               close(ofd);
+
+               exit(EXIT_FAILURE);
+       }
+
+       close(ifd);
+       close(ofd);
+
+       return EXIT_SUCCESS;
+}