Merge branch 'master' of git://git.denx.de/u-boot-spi
authorTom Rini <trini@ti.com>
Fri, 21 Feb 2014 13:00:22 +0000 (08:00 -0500)
committerTom Rini <trini@ti.com>
Fri, 21 Feb 2014 13:00:22 +0000 (08:00 -0500)
719 files changed:
.gitignore
MAKEALL
Makefile
README
arch/arc/include/asm/arch-arc700/hardware.h [deleted file]
arch/arc/lib/relocate.c
arch/arm/cpu/arm1136/config.mk
arch/arm/cpu/arm1176/bcm2835/config.mk [deleted file]
arch/arm/cpu/arm720t/tegra-common/cpu.c
arch/arm/cpu/arm720t/tegra-common/cpu.h
arch/arm/cpu/arm720t/tegra114/cpu.c
arch/arm/cpu/arm720t/tegra124/Makefile [new file with mode: 0644]
arch/arm/cpu/arm720t/tegra124/config.mk [new file with mode: 0644]
arch/arm/cpu/arm720t/tegra124/cpu.c [new file with mode: 0644]
arch/arm/cpu/arm720t/tegra30/cpu.c
arch/arm/cpu/arm926ejs/config.mk
arch/arm/cpu/arm926ejs/davinci/config.mk
arch/arm/cpu/arm926ejs/omap/Makefile
arch/arm/cpu/arm926ejs/omap/cpuinfo.c
arch/arm/cpu/armv7/am33xx/config.mk
arch/arm/cpu/armv7/config.mk
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/exynos/pinmux.c
arch/arm/cpu/armv7/mx6/clock.c
arch/arm/cpu/armv7/mx6/soc.c
arch/arm/cpu/armv7/omap-common/boot-common.c
arch/arm/cpu/armv7/omap-common/clocks-common.c
arch/arm/cpu/armv7/omap-common/emif-common.c
arch/arm/cpu/armv7/omap-common/hwinit-common.c
arch/arm/cpu/armv7/omap-common/sata.c
arch/arm/cpu/armv7/omap3/config.mk
arch/arm/cpu/armv7/omap4/config.mk
arch/arm/cpu/armv7/omap4/hw_data.c
arch/arm/cpu/armv7/omap5/abb.c
arch/arm/cpu/armv7/omap5/config.mk
arch/arm/cpu/armv7/omap5/hw_data.c
arch/arm/cpu/armv7/omap5/hwinit.c
arch/arm/cpu/armv7/omap5/prcm-regs.c
arch/arm/cpu/armv7/omap5/sdram.c
arch/arm/cpu/armv7/socfpga/config.mk
arch/arm/cpu/armv7/start.S
arch/arm/cpu/armv7/tegra114/Makefile
arch/arm/cpu/armv7/tegra124/Makefile [new file with mode: 0644]
arch/arm/cpu/armv7/tegra124/config.mk [new file with mode: 0644]
arch/arm/cpu/armv7/tegra30/Makefile
arch/arm/cpu/armv7/zynq/Makefile
arch/arm/cpu/armv7/zynq/clk.c [new file with mode: 0644]
arch/arm/cpu/armv7/zynq/cpu.c
arch/arm/cpu/armv7/zynq/slcr.c
arch/arm/cpu/armv7/zynq/spl.c [new file with mode: 0644]
arch/arm/cpu/armv7/zynq/timer.c
arch/arm/cpu/armv7/zynq/u-boot-spl.lds [new file with mode: 0644]
arch/arm/cpu/armv7/zynq/u-boot.lds [moved from arch/arm/cpu/ixp/u-boot.lds with 58% similarity]
arch/arm/cpu/ixp/Makefile [deleted file]
arch/arm/cpu/ixp/config.mk [deleted file]
arch/arm/cpu/ixp/cpu.c [deleted file]
arch/arm/cpu/ixp/interrupts.c [deleted file]
arch/arm/cpu/ixp/start.S [deleted file]
arch/arm/cpu/ixp/timer.c [deleted file]
arch/arm/cpu/tegra-common/Makefile
arch/arm/cpu/tegra-common/ap.c
arch/arm/cpu/tegra-common/board.c
arch/arm/cpu/tegra-common/cache.c
arch/arm/cpu/tegra-common/clock.c
arch/arm/cpu/tegra-common/sys_info.c
arch/arm/cpu/tegra114-common/clock.c
arch/arm/cpu/tegra124-common/Makefile [new file with mode: 0644]
arch/arm/cpu/tegra124-common/clock.c [new file with mode: 0644]
arch/arm/cpu/tegra124-common/funcmux.c [new file with mode: 0644]
arch/arm/cpu/tegra124-common/pinmux.c [new file with mode: 0644]
arch/arm/cpu/tegra20-common/clock.c
arch/arm/cpu/tegra30-common/clock.c
arch/arm/dts/.gitignore [new file with mode: 0644]
arch/arm/dts/Makefile [new file with mode: 0644]
arch/arm/dts/exynos5250-arndale.dts [moved from board/samsung/dts/exynos5250-arndale.dts with 100% similarity]
arch/arm/dts/exynos5250-smdk5250.dts [moved from board/samsung/dts/exynos5250-smdk5250.dts with 98% similarity]
arch/arm/dts/exynos5250-snow.dts [moved from board/samsung/dts/exynos5250-snow.dts with 97% similarity]
arch/arm/dts/exynos5420-smdk5420.dts [moved from board/samsung/dts/exynos5420-smdk5420.dts with 100% similarity]
arch/arm/dts/tegra114-dalmore.dts [moved from board/nvidia/dts/tegra114-dalmore.dts with 100% similarity]
arch/arm/dts/tegra114.dtsi
arch/arm/dts/tegra124-venice2.dts [new file with mode: 0644]
arch/arm/dts/tegra124.dtsi [new file with mode: 0644]
arch/arm/dts/tegra20-colibri_t20_iris.dts [moved from board/toradex/dts/tegra20-colibri_t20_iris.dts with 100% similarity]
arch/arm/dts/tegra20-harmony.dts [moved from board/nvidia/dts/tegra20-harmony.dts with 100% similarity]
arch/arm/dts/tegra20-medcom-wide.dts [moved from board/avionic-design/dts/tegra20-medcom-wide.dts with 100% similarity]
arch/arm/dts/tegra20-paz00.dts [moved from board/compal/dts/tegra20-paz00.dts with 100% similarity]
arch/arm/dts/tegra20-plutux.dts [moved from board/avionic-design/dts/tegra20-plutux.dts with 100% similarity]
arch/arm/dts/tegra20-seaboard.dts [moved from board/nvidia/dts/tegra20-seaboard.dts with 100% similarity]
arch/arm/dts/tegra20-tamonten.dtsi [moved from board/avionic-design/dts/tegra20-tamonten.dtsi with 100% similarity]
arch/arm/dts/tegra20-tec.dts [moved from board/avionic-design/dts/tegra20-tec.dts with 100% similarity]
arch/arm/dts/tegra20-trimslice.dts [moved from board/compulab/dts/tegra20-trimslice.dts with 100% similarity]
arch/arm/dts/tegra20-ventana.dts [moved from board/nvidia/dts/tegra20-ventana.dts with 100% similarity]
arch/arm/dts/tegra20-whistler.dts [moved from board/nvidia/dts/tegra20-whistler.dts with 100% similarity]
arch/arm/dts/tegra30-beaver.dts [moved from board/nvidia/dts/tegra30-beaver.dts with 100% similarity]
arch/arm/dts/tegra30-cardhu.dts [moved from board/nvidia/dts/tegra30-cardhu.dts with 100% similarity]
arch/arm/dts/tegra30-tamonten.dtsi [moved from board/avionic-design/dts/tegra30-tamonten.dtsi with 100% similarity]
arch/arm/dts/tegra30-tec-ng.dts [moved from board/avionic-design/dts/tegra30-tec-ng.dts with 100% similarity]
arch/arm/dts/zynq-microzed.dts [moved from board/xilinx/dts/zynq-microzed.dts with 100% similarity]
arch/arm/dts/zynq-zc702.dts [moved from board/xilinx/dts/zynq-zc702.dts with 100% similarity]
arch/arm/dts/zynq-zc706.dts [moved from board/xilinx/dts/zynq-zc706.dts with 100% similarity]
arch/arm/dts/zynq-zc770-xm010.dts [moved from board/xilinx/dts/zynq-zc770-xm010.dts with 100% similarity]
arch/arm/dts/zynq-zc770-xm012.dts [moved from board/xilinx/dts/zynq-zc770-xm012.dts with 100% similarity]
arch/arm/dts/zynq-zc770-xm013.dts [moved from board/xilinx/dts/zynq-zc770-xm013.dts with 100% similarity]
arch/arm/dts/zynq-zed.dts [moved from board/xilinx/dts/zynq-zed.dts with 100% similarity]
arch/arm/imx-common/Makefile
arch/arm/imx-common/cpu.c
arch/arm/include/asm/arch-am33xx/ddr_defs.h
arch/arm/include/asm/arch-am33xx/sys_proto.h
arch/arm/include/asm/arch-bcm2835/mbox.h
arch/arm/include/asm/arch-exynos/cpu.h
arch/arm/include/asm/arch-exynos/dwmmc.h
arch/arm/include/asm/arch-exynos/gpio.h
arch/arm/include/asm/arch-exynos/periph.h
arch/arm/include/asm/arch-imx/cpu.h [new file with mode: 0644]
arch/arm/include/asm/arch-ixp/ixp425.h [deleted file]
arch/arm/include/asm/arch-ixp/ixp425pci.h [deleted file]
arch/arm/include/asm/arch-mx5/sys_proto.h
arch/arm/include/asm/arch-mx6/clock.h
arch/arm/include/asm/arch-mx6/imx-regs.h
arch/arm/include/asm/arch-mx6/iomux.h
arch/arm/include/asm/arch-mx6/mx6dl_pins.h
arch/arm/include/asm/arch-mx6/mx6q_pins.h
arch/arm/include/asm/arch-mx6/sys_proto.h
arch/arm/include/asm/arch-omap3/omap3.h
arch/arm/include/asm/arch-omap4/sys_proto.h
arch/arm/include/asm/arch-omap5/omap.h
arch/arm/include/asm/arch-omap5/sata.h
arch/arm/include/asm/arch-omap5/spl.h
arch/arm/include/asm/arch-omap5/sys_proto.h
arch/arm/include/asm/arch-s5pc1xx/cpu.h
arch/arm/include/asm/arch-s5pc1xx/gpio.h
arch/arm/include/asm/arch-spear/hardware.h
arch/arm/include/asm/arch-tegra/clk_rst.h
arch/arm/include/asm/arch-tegra/clock.h
arch/arm/include/asm/arch-tegra/gp_padctrl.h
arch/arm/include/asm/arch-tegra/pmc.h
arch/arm/include/asm/arch-tegra/tegra.h
arch/arm/include/asm/arch-tegra124/ahb.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/clock-tables.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/clock.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/flow.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/funcmux.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/gp_padctrl.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/hardware.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/pinmux.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/pmu.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/spl.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/sysctr.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/tegra.h [new file with mode: 0644]
arch/arm/include/asm/arch-tegra124/usb.h [new file with mode: 0644]
arch/arm/include/asm/arch-zynq/clk.h [new file with mode: 0644]
arch/arm/include/asm/arch-zynq/hardware.h
arch/arm/include/asm/arch-zynq/spl.h [new file with mode: 0644]
arch/arm/include/asm/arch-zynq/sys_proto.h
arch/arm/include/asm/global_data.h
arch/arm/include/asm/omap_common.h
arch/arm/include/asm/pl310.h
arch/arm/lib/board.c
arch/blackfin/config.mk
arch/blackfin/cpu/Makefile
arch/blackfin/include/asm/blackfin_local.h
arch/blackfin/include/asm/clock.h
arch/blackfin/include/asm/twi.h [new file with mode: 0644]
arch/blackfin/lib/Makefile
arch/blackfin/lib/board.c
arch/m68k/cpu/mcf5227x/Makefile
arch/m68k/cpu/mcf523x/Makefile
arch/m68k/cpu/mcf52x2/Makefile
arch/m68k/cpu/mcf532x/Makefile
arch/m68k/cpu/mcf5445x/Makefile
arch/m68k/cpu/mcf547x_8x/Makefile
arch/microblaze/dts/.gitignore [new file with mode: 0644]
arch/microblaze/dts/Makefile [new file with mode: 0644]
arch/microblaze/dts/microblaze-generic.dts [moved from board/xilinx/dts/microblaze-generic.dts with 100% similarity]
arch/microblaze/lib/board.c
arch/microblaze/lib/time.c [deleted file]
arch/mips/cpu/mips32/config.mk
arch/mips/cpu/mips64/config.mk
arch/mips/cpu/xburst/config.mk
arch/nds32/config.mk
arch/nds32/cpu/n1213/Makefile
arch/powerpc/cpu/mpc8xx/Makefile
arch/powerpc/lib/Makefile
arch/sandbox/cpu/Makefile
arch/sparc/config.mk
arch/x86/dts/.gitignore [new file with mode: 0644]
arch/x86/dts/Makefile [new file with mode: 0644]
arch/x86/dts/alex.dts [moved from board/chromebook-x86/dts/alex.dts with 100% similarity]
arch/x86/dts/link.dts [moved from board/chromebook-x86/dts/link.dts with 100% similarity]
arch/x86/lib/Makefile
arch/x86/lib/init_helpers.c
board/actux1/Makefile [deleted file]
board/actux1/actux1.c [deleted file]
board/actux1/actux1_hw.h [deleted file]
board/actux1/u-boot.lds [deleted file]
board/actux2/Makefile [deleted file]
board/actux2/actux2.c [deleted file]
board/actux2/actux2_hw.h [deleted file]
board/actux2/u-boot.lds [deleted file]
board/actux3/Makefile [deleted file]
board/actux3/actux3.c [deleted file]
board/actux3/actux3_hw.h [deleted file]
board/actux3/u-boot.lds [deleted file]
board/actux4/Makefile [deleted file]
board/actux4/actux4.c [deleted file]
board/actux4/actux4_hw.h [deleted file]
board/ait/cam_enc_4xx/config.mk
board/altera/socfpga/socfpga_cyclone5.c
board/armltd/versatile/versatile.c
board/avionic-design/medcom-wide/Makefile
board/avionic-design/plutux/Makefile
board/avionic-design/tec-ng/Makefile
board/avionic-design/tec/Makefile
board/bct-brettl2/config.mk
board/bf518f-ezbrd/config.mk
board/bf526-ezbrd/config.mk
board/bf527-ad7160-eval/config.mk
board/bf527-ezkit/config.mk
board/bf527-sdp/config.mk
board/bf533-ezkit/config.mk
board/bf533-stamp/config.mk
board/bf537-stamp/config.mk
board/bf538f-ezkit/config.mk
board/bf548-ezkit/config.mk
board/bf561-acvilon/config.mk
board/bf561-ezkit/config.mk
board/boundary/nitrogen6x/README
board/boundary/nitrogen6x/nitrogen6dl.cfg
board/boundary/nitrogen6x/nitrogen6dl2g.cfg
board/boundary/nitrogen6x/nitrogen6q.cfg
board/boundary/nitrogen6x/nitrogen6q2g.cfg
board/boundary/nitrogen6x/nitrogen6s.cfg
board/boundary/nitrogen6x/nitrogen6s1g.cfg
board/br4/config.mk
board/cm-bf527/config.mk
board/cm-bf533/config.mk
board/cm-bf537e/config.mk
board/cm-bf537u/config.mk
board/cm-bf548/config.mk
board/cm-bf548/video.c
board/cm-bf561/config.mk
board/compal/paz00/Makefile
board/compulab/trimslice/Makefile
board/cray/L1/Makefile
board/dvlhost/Makefile [deleted file]
board/dvlhost/dvlhost.c [deleted file]
board/dvlhost/dvlhost_hw.h [deleted file]
board/dvlhost/u-boot.lds [deleted file]
board/dvlhost/watchdog.c [deleted file]
board/fads/fads.h
board/freescale/common/Makefile
board/freescale/mx53loco/mx53loco.c
board/freescale/mx6qsabreauto/imximage.cfg
board/h2200/Makefile
board/ip04/config.mk
board/keymile/km_arm/fpga_config.c
board/keymile/km_arm/km_arm.c
board/keymile/scripts/develop-arm.txt
board/keymile/scripts/develop-common.txt
board/keymile/scripts/develop-ppc_82xx.txt
board/keymile/scripts/develop-ppc_8xx.txt
board/keymile/scripts/ramfs-arm.txt
board/keymile/scripts/ramfs-common.txt
board/keymile/scripts/ramfs-ppc_82xx.txt
board/keymile/scripts/ramfs-ppc_8xx.txt
board/matrix_vision/mvblm7/Makefile
board/matrix_vision/mvblx/Makefile
board/matrix_vision/mvsmr/Makefile
board/nokia/rx51/rx51.h
board/nvidia/common/Makefile
board/nvidia/common/board.c
board/nvidia/venice2/Makefile [new file with mode: 0644]
board/nvidia/venice2/as3722_init.c [new file with mode: 0644]
board/nvidia/venice2/as3722_init.h [new file with mode: 0644]
board/nvidia/venice2/pinmux-config-venice2.h [new file with mode: 0644]
board/nvidia/venice2/venice2.c [new file with mode: 0644]
board/pcs440ep/config.mk
board/pr1/config.mk
board/samsung/common/Makefile
board/samsung/common/dfu_sample_env.txt [new file with mode: 0644]
board/samsung/common/misc.c [new file with mode: 0644]
board/samsung/goni/goni.c
board/samsung/origen/Makefile
board/samsung/origen/tools/mkorigenspl.c [moved from board/samsung/origen/tools/mkv310_image.c with 100% similarity]
board/samsung/smdk5250/lowlevel_init.S [deleted file]
board/samsung/smdk5250/smdk5250.c
board/samsung/smdkv310/Makefile
board/samsung/smdkv310/tools/mksmdkv310spl.c [moved from board/samsung/smdkv310/tools/mkv310_image.c with 100% similarity]
board/samsung/trats/trats.c
board/samsung/trats2/trats2.c
board/samsung/universal_c210/universal.c
board/sandburst/karef/Makefile
board/sandburst/metrobox/Makefile
board/solidrun/hummingboard/hummingboard.c
board/spear/common/Makefile
board/spear/x600/Makefile
board/st-ericsson/snowball/Makefile
board/st-ericsson/u8500/Makefile
board/synopsys/axs101/axs101.c
board/tcm-bf518/config.mk
board/tcm-bf537/config.mk
board/ti/am43xx/board.c
board/ti/dra7xx/README [new file with mode: 0644]
board/ti/dra7xx/evm.c
board/ti/omap5_uevm/README [new file with mode: 0644]
board/ti/omap5_uevm/evm.c
board/ti/omap5_uevm/mux_data.h
board/ti/panda/panda.c
board/ti/panda/panda_mux_data.h
board/ti/sdp4430/sdp.c
board/ti/sdp4430/sdp4430_mux_data.h
board/xilinx/zynq/Makefile
board/xilinx/zynq/board.c
board/xilinx/zynq/ps7_init.c [new file with mode: 0644]
boards.cfg
common/Makefile
common/board_f.c
common/cmd_ext4.c
common/cmd_mmc.c
common/cmd_otp.c
common/cmd_scsi.c
common/cmd_test.c
common/image-fdt.c
common/image-fit.c
common/lcd.c
common/spl/Makefile
common/spl/spl.c
common/spl/spl_mmc.c
common/spl/spl_sata.c [new file with mode: 0644]
config.mk
disk/Makefile
doc/DocBook/.gitignore
doc/DocBook/Makefile
doc/DocBook/stylesheet.xsl
doc/README.scrapyard
doc/driver-model/UDM-pci.txt
doc/driver-model/UDM-serial.txt
doc/feature-removal-schedule.txt
drivers/bios_emulator/Makefile
drivers/block/pata_bfin.c
drivers/bootcount/Makefile
drivers/bootcount/bootcount_i2c.c [new file with mode: 0644]
drivers/dfu/dfu_mmc.c
drivers/gpio/s5p_gpio.c
drivers/hwmon/Makefile
drivers/i2c/adi_i2c.c [new file with mode: 0644]
drivers/i2c/bfin-twi_i2c.c
drivers/i2c/designware_i2c.c
drivers/i2c/mxs_i2c.c
drivers/i2c/omap24xx_i2c.c
drivers/i2c/soft_i2c.c
drivers/i2c/zynq_i2c.c
drivers/mmc/bfin_sdh.c
drivers/mmc/dw_mmc.c
drivers/mmc/exynos_dw_mmc.c
drivers/mmc/mmc.c
drivers/mmc/tegra_mmc.c
drivers/mmc/zynq_sdhci.c
drivers/net/bfin_mac.c
drivers/net/fec_mxc.c
drivers/net/npe/IxEthAcc.c [deleted file]
drivers/net/npe/IxEthAccCommon.c [deleted file]
drivers/net/npe/IxEthAccControlInterface.c [deleted file]
drivers/net/npe/IxEthAccDataPlane.c [deleted file]
drivers/net/npe/IxEthAccMac.c [deleted file]
drivers/net/npe/IxEthAccMii.c [deleted file]
drivers/net/npe/IxEthDBAPI.c [deleted file]
drivers/net/npe/IxEthDBAPISupport.c [deleted file]
drivers/net/npe/IxEthDBCore.c [deleted file]
drivers/net/npe/IxEthDBEvents.c [deleted file]
drivers/net/npe/IxEthDBFeatures.c [deleted file]
drivers/net/npe/IxEthDBFirewall.c [deleted file]
drivers/net/npe/IxEthDBHashtable.c [deleted file]
drivers/net/npe/IxEthDBLearning.c [deleted file]
drivers/net/npe/IxEthDBMem.c [deleted file]
drivers/net/npe/IxEthDBNPEAdaptor.c [deleted file]
drivers/net/npe/IxEthDBPortUpdate.c [deleted file]
drivers/net/npe/IxEthDBReports.c [deleted file]
drivers/net/npe/IxEthDBSearch.c [deleted file]
drivers/net/npe/IxEthDBSpanningTree.c [deleted file]
drivers/net/npe/IxEthDBUtil.c [deleted file]
drivers/net/npe/IxEthDBVlan.c [deleted file]
drivers/net/npe/IxEthDBWiFi.c [deleted file]
drivers/net/npe/IxEthMii.c [deleted file]
drivers/net/npe/IxFeatureCtrl.c [deleted file]
drivers/net/npe/IxNpeDl.c [deleted file]
drivers/net/npe/IxNpeDlImageMgr.c [deleted file]
drivers/net/npe/IxNpeDlNpeMgr.c [deleted file]
drivers/net/npe/IxNpeDlNpeMgrUtils.c [deleted file]
drivers/net/npe/IxNpeMh.c [deleted file]
drivers/net/npe/IxNpeMhConfig.c [deleted file]
drivers/net/npe/IxNpeMhReceive.c [deleted file]
drivers/net/npe/IxNpeMhSend.c [deleted file]
drivers/net/npe/IxNpeMhSolicitedCbMgr.c [deleted file]
drivers/net/npe/IxNpeMhUnsolicitedCbMgr.c [deleted file]
drivers/net/npe/IxOsalBufferMgt.c [deleted file]
drivers/net/npe/IxOsalIoMem.c [deleted file]
drivers/net/npe/IxOsalOsCacheMMU.c [deleted file]
drivers/net/npe/IxOsalOsMsgQ.c [deleted file]
drivers/net/npe/IxOsalOsSemaphore.c [deleted file]
drivers/net/npe/IxOsalOsServices.c [deleted file]
drivers/net/npe/IxOsalOsThread.c [deleted file]
drivers/net/npe/IxQMgrAqmIf.c [deleted file]
drivers/net/npe/IxQMgrDispatcher.c [deleted file]
drivers/net/npe/IxQMgrInit.c [deleted file]
drivers/net/npe/IxQMgrQAccess.c [deleted file]
drivers/net/npe/IxQMgrQCfg.c [deleted file]
drivers/net/npe/Makefile [deleted file]
drivers/net/npe/include/IxAssert.h [deleted file]
drivers/net/npe/include/IxAtmSch.h [deleted file]
drivers/net/npe/include/IxAtmTypes.h [deleted file]
drivers/net/npe/include/IxAtmdAcc.h [deleted file]
drivers/net/npe/include/IxAtmdAccCtrl.h [deleted file]
drivers/net/npe/include/IxAtmm.h [deleted file]
drivers/net/npe/include/IxDmaAcc.h [deleted file]
drivers/net/npe/include/IxEthAcc.h [deleted file]
drivers/net/npe/include/IxEthAccDataPlane_p.h [deleted file]
drivers/net/npe/include/IxEthAccMac_p.h [deleted file]
drivers/net/npe/include/IxEthAccMii_p.h [deleted file]
drivers/net/npe/include/IxEthAccQueueAssign_p.h [deleted file]
drivers/net/npe/include/IxEthAcc_p.h [deleted file]
drivers/net/npe/include/IxEthDB.h [deleted file]
drivers/net/npe/include/IxEthDBLocks_p.h [deleted file]
drivers/net/npe/include/IxEthDBLog_p.h [deleted file]
drivers/net/npe/include/IxEthDBMessages_p.h [deleted file]
drivers/net/npe/include/IxEthDBPortDefs.h [deleted file]
drivers/net/npe/include/IxEthDBQoS.h [deleted file]
drivers/net/npe/include/IxEthDB_p.h [deleted file]
drivers/net/npe/include/IxEthMii.h [deleted file]
drivers/net/npe/include/IxEthMii_p.h [deleted file]
drivers/net/npe/include/IxEthNpe.h [deleted file]
drivers/net/npe/include/IxFeatureCtrl.h [deleted file]
drivers/net/npe/include/IxHssAcc.h [deleted file]
drivers/net/npe/include/IxI2cDrv.h [deleted file]
drivers/net/npe/include/IxNpeA.h [deleted file]
drivers/net/npe/include/IxNpeDl.h [deleted file]
drivers/net/npe/include/IxNpeDlImageMgr_p.h [deleted file]
drivers/net/npe/include/IxNpeDlMacros_p.h [deleted file]
drivers/net/npe/include/IxNpeDlNpeMgrEcRegisters_p.h [deleted file]
drivers/net/npe/include/IxNpeDlNpeMgrUtils_p.h [deleted file]
drivers/net/npe/include/IxNpeDlNpeMgr_p.h [deleted file]
drivers/net/npe/include/IxNpeMh.h [deleted file]
drivers/net/npe/include/IxNpeMhConfig_p.h [deleted file]
drivers/net/npe/include/IxNpeMhMacros_p.h [deleted file]
drivers/net/npe/include/IxNpeMhReceive_p.h [deleted file]
drivers/net/npe/include/IxNpeMhSend_p.h [deleted file]
drivers/net/npe/include/IxNpeMhSolicitedCbMgr_p.h [deleted file]
drivers/net/npe/include/IxNpeMhUnsolicitedCbMgr_p.h [deleted file]
drivers/net/npe/include/IxNpeMicrocode.h [deleted file]
drivers/net/npe/include/IxOsBufLib.h [deleted file]
drivers/net/npe/include/IxOsBuffMgt.h [deleted file]
drivers/net/npe/include/IxOsBuffPoolMgt.h [deleted file]
drivers/net/npe/include/IxOsCacheMMU.h [deleted file]
drivers/net/npe/include/IxOsPrintf.h [deleted file]
drivers/net/npe/include/IxOsServices.h [deleted file]
drivers/net/npe/include/IxOsServicesComponents.h [deleted file]
drivers/net/npe/include/IxOsServicesEndianess.h [deleted file]
drivers/net/npe/include/IxOsServicesMemAccess.h [deleted file]
drivers/net/npe/include/IxOsServicesMemMap.h [deleted file]
drivers/net/npe/include/IxOsal.h [deleted file]
drivers/net/npe/include/IxOsalAssert.h [deleted file]
drivers/net/npe/include/IxOsalBackward.h [deleted file]
drivers/net/npe/include/IxOsalBackwardAssert.h [deleted file]
drivers/net/npe/include/IxOsalBackwardBufferMgt.h [deleted file]
drivers/net/npe/include/IxOsalBackwardCacheMMU.h [deleted file]
drivers/net/npe/include/IxOsalBackwardMemMap.h [deleted file]
drivers/net/npe/include/IxOsalBackwardOsServices.h [deleted file]
drivers/net/npe/include/IxOsalBackwardOssl.h [deleted file]
drivers/net/npe/include/IxOsalBufferMgt.h [deleted file]
drivers/net/npe/include/IxOsalBufferMgtDefault.h [deleted file]
drivers/net/npe/include/IxOsalConfig.h [deleted file]
drivers/net/npe/include/IxOsalEndianess.h [deleted file]
drivers/net/npe/include/IxOsalIoMem.h [deleted file]
drivers/net/npe/include/IxOsalMemAccess.h [deleted file]
drivers/net/npe/include/IxOsalOem.h [deleted file]
drivers/net/npe/include/IxOsalOs.h [deleted file]
drivers/net/npe/include/IxOsalOsAssert.h [deleted file]
drivers/net/npe/include/IxOsalOsBufferMgt.h [deleted file]
drivers/net/npe/include/IxOsalOsIxp400.h [deleted file]
drivers/net/npe/include/IxOsalOsIxp400CustomizedMapping.h [deleted file]
drivers/net/npe/include/IxOsalOsTypes.h [deleted file]
drivers/net/npe/include/IxOsalOsUtilitySymbols.h [deleted file]
drivers/net/npe/include/IxOsalTypes.h [deleted file]
drivers/net/npe/include/IxOsalUtilitySymbols.h [deleted file]
drivers/net/npe/include/IxParityENAcc.h [deleted file]
drivers/net/npe/include/IxPerfProfAcc.h [deleted file]
drivers/net/npe/include/IxQMgr.h [deleted file]
drivers/net/npe/include/IxQMgrAqmIf_p.h [deleted file]
drivers/net/npe/include/IxQMgrDefines_p.h [deleted file]
drivers/net/npe/include/IxQMgrDispatcher_p.h [deleted file]
drivers/net/npe/include/IxQMgrLog_p.h [deleted file]
drivers/net/npe/include/IxQMgrQAccess_p.h [deleted file]
drivers/net/npe/include/IxQMgrQCfg_p.h [deleted file]
drivers/net/npe/include/IxQueueAssignments.h [deleted file]
drivers/net/npe/include/IxSspAcc.h [deleted file]
drivers/net/npe/include/IxTimeSyncAcc.h [deleted file]
drivers/net/npe/include/IxTimerCtrl.h [deleted file]
drivers/net/npe/include/IxTypes.h [deleted file]
drivers/net/npe/include/IxUART.h [deleted file]
drivers/net/npe/include/IxVersionId.h [deleted file]
drivers/net/npe/include/ix_error.h [deleted file]
drivers/net/npe/include/ix_macros.h [deleted file]
drivers/net/npe/include/ix_os_type.h [deleted file]
drivers/net/npe/include/ix_ossl.h [deleted file]
drivers/net/npe/include/ix_symbols.h [deleted file]
drivers/net/npe/include/ix_types.h [deleted file]
drivers/net/npe/include/npe.h [deleted file]
drivers/net/npe/include/os_datatypes.h [deleted file]
drivers/net/npe/miiphy.c [deleted file]
drivers/net/npe/npe.c [deleted file]
drivers/net/phy/atheros.c
drivers/net/zynq_gem.c
drivers/pci/Makefile
drivers/pci/pci_ixp.c [deleted file]
drivers/pci/pcie_imx.c [new file with mode: 0644]
drivers/power/battery/bat_trats2.c
drivers/rtc/Makefile
drivers/serial/Makefile
drivers/serial/opencores_yanu.c
drivers/serial/serial.c
drivers/serial/serial_arc.c
drivers/serial/serial_ixp.c [deleted file]
drivers/serial/serial_s5p.c
drivers/serial/serial_zynq.c
drivers/spi/bfin_spi.c
drivers/spi/bfin_spi6xx.c
drivers/usb/host/Makefile
drivers/usb/host/ehci-ixp4xx.c [deleted file]
drivers/usb/musb-new/Makefile
drivers/usb/musb/blackfin_usb.c
drivers/video/exynos_fb.c
drivers/video/exynos_fimd.c
dts/.gitignore [new file with mode: 0644]
dts/Makefile
examples/Makefile [new file with mode: 0644]
examples/api/Makefile
examples/standalone/Makefile
fs/ext4/ext4fs.c
fs/fat/fat.c
fs/fs.c
fs/sandbox/sandboxfs.c
fs/ubifs/Makefile
fs/yaffs2/Makefile
include/.gitignore
include/common.h
include/configs/M54418TWR.h
include/configs/MERGERBOX.h
include/configs/P1023RDS.h
include/configs/T1040QDS.h
include/configs/T1040RDB.h
include/configs/T1042RDB_PI.h
include/configs/T2080QDS.h
include/configs/ac14xx.h
include/configs/actux1.h [deleted file]
include/configs/actux2.h [deleted file]
include/configs/actux3.h [deleted file]
include/configs/actux4.h [deleted file]
include/configs/adp-ag101.h
include/configs/adp-ag101p.h
include/configs/adp-ag102.h
include/configs/am43xx_evm.h
include/configs/ap_sh4a_4a.h
include/configs/apf27.h
include/configs/armadillo-800eva.h
include/configs/axs101.h
include/configs/balloon3.h
include/configs/cardhu.h
include/configs/cgtqmx6eval.h
include/configs/corvus.h
include/configs/devkit3250.h
include/configs/dlvision-10g.h
include/configs/dra7xx_evm.h
include/configs/dvlhost.h [deleted file]
include/configs/ecovec.h
include/configs/hummingboard.h
include/configs/io.h
include/configs/iocon.h
include/configs/km/keymile-common.h
include/configs/km/km-powerpc.h
include/configs/km/km83xx-common.h
include/configs/km/km_arm.h
include/configs/km/kmp204x-common.h
include/configs/km_kirkwood.h
include/configs/koelsch.h
include/configs/kzm9g.h
include/configs/lager.h
include/configs/m53evk.h
include/configs/mini2440.h [deleted file]
include/configs/mx23evk.h
include/configs/mx28evk.h
include/configs/mx51evk.h
include/configs/mx53loco.h
include/configs/mx6_common.h
include/configs/mx6qarm2.h
include/configs/mx6sabre_common.h
include/configs/mx6slevk.h
include/configs/mxs.h
include/configs/nitrogen6x.h
include/configs/o2dnt-common.h
include/configs/omap3_igep00x0.h
include/configs/omap4_panda.h
include/configs/omap4_sdp4430.h
include/configs/omap5_uevm.h
include/configs/p1_twr.h
include/configs/palmld.h
include/configs/palmtc.h
include/configs/r0p7734.h
include/configs/rpi_b.h
include/configs/s5p_goni.h
include/configs/s5pc210_universal.h
include/configs/sandbox.h
include/configs/scb9328.h
include/configs/shmin.h
include/configs/snowball.h
include/configs/spear-common.h
include/configs/taurus.h
include/configs/tegra-common-post.h
include/configs/tegra124-common.h [new file with mode: 0644]
include/configs/ti_am335x_common.h
include/configs/ti_armv7_common.h
include/configs/ti_omap3_common.h [new file with mode: 0644]
include/configs/ti_omap4_common.h [moved from include/configs/omap4_common.h with 95% similarity]
include/configs/ti_omap5_common.h [moved from include/configs/omap5_common.h with 95% similarity]
include/configs/trats.h
include/configs/trats2.h
include/configs/u8500_href.h
include/configs/udoo.h
include/configs/usb_a9263.h
include/configs/venice2.h [new file with mode: 0644]
include/configs/versatile.h
include/configs/vf610twr.h
include/configs/vl_ma2sc.h
include/configs/x600.h
include/configs/zipitz2.h
include/configs/zynq-common.h
include/configs/zynq_zc70x.h
include/configs/zynq_zed.h
include/dwmmc.h
include/ext4fs.h
include/fat.h
include/fdtdec.h
include/fs.h
include/i2c.h
include/image.h
include/lcd.h
include/linker_lists.h
include/mmc.h
include/power/max77686_pmic.h
include/power/pmic.h
include/samsung/misc.h [new file with mode: 0644]
include/sandboxfs.h
include/spl.h
lib/Makefile
lib/fdtdec.c
lib/lzma/Makefile
lib/tizen/tizen.c
lib/tizen/tizen_hd_logo.h [deleted file]
lib/tizen/tizen_hd_logo_data.h [deleted file]
lib/tizen/tizen_logo_16bpp.h [new file with mode: 0644]
lib/tizen/tizen_logo_16bpp_gzip.h [new file with mode: 0644]
mkconfig
nand_spl/board/amcc/acadia/Makefile
nand_spl/board/amcc/bamboo/Makefile
nand_spl/board/amcc/canyonlands/Makefile
nand_spl/board/amcc/kilauea/Makefile
nand_spl/board/amcc/sequoia/Makefile
nand_spl/board/freescale/mpc8315erdb/Makefile
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/mpc8572ds/Makefile
nand_spl/board/freescale/p1023rds/Makefile
nand_spl/board/freescale/p1_p2_rdb/Makefile
nand_spl/board/sheldon/simpc8313/Makefile
net/Makefile
post/lib_powerpc/fpu/Makefile
rules.mk [deleted file]
scripts/.gitignore [new file with mode: 0644]
scripts/Kbuild.include [new file with mode: 0644]
scripts/Makefile [new file with mode: 0644]
scripts/Makefile.build
scripts/Makefile.clean [new file with mode: 0644]
scripts/Makefile.host [new file with mode: 0644]
scripts/Makefile.lib [new file with mode: 0644]
scripts/basic/.gitignore [new file with mode: 0644]
scripts/basic/Makefile [new file with mode: 0644]
scripts/basic/fixdep.c [new file with mode: 0644]
scripts/docproc.c [moved from tools/kernel-doc/docproc.c with 90% similarity]
scripts/kernel-doc [moved from tools/kernel-doc/kernel-doc with 97% similarity]
scripts/mkmakefile [new file with mode: 0644]
spl/Makefile
test/command_ut.c
tools/.gitignore
tools/Makefile
tools/crc32.c [new file with mode: 0644]
tools/easylogo/Makefile
tools/env/.gitignore [new file with mode: 0644]
tools/env/Makefile
tools/env/README
tools/env/crc32.c [new file with mode: 0644]
tools/env/ctype.c [new file with mode: 0644]
tools/env/env_attr.c [new file with mode: 0644]
tools/env/env_flags.c [new file with mode: 0644]
tools/env/linux_string.c [new file with mode: 0644]
tools/env_embedded.c [new file with mode: 0644]
tools/fdt.c [new file with mode: 0644]
tools/fdt_ro.c [new file with mode: 0644]
tools/fdt_rw.c [new file with mode: 0644]
tools/fdt_strerror.c [new file with mode: 0644]
tools/fdt_wip.c [new file with mode: 0644]
tools/gdb/Makefile
tools/image-fit.c [new file with mode: 0644]
tools/image-sig.c [new file with mode: 0644]
tools/image.c [new file with mode: 0644]
tools/kernel-doc/Makefile [deleted file]
tools/md5.c [new file with mode: 0644]
tools/relocate-rela.c
tools/rsa-sign.c [new file with mode: 0644]
tools/sha1.c [new file with mode: 0644]

index d7d5538..5882ff5 100644 (file)
@@ -5,16 +5,20 @@
 #
 # Normal rules
 #
-
-*.rej
-*.orig
-*.a
+.*
 *.o
+*.o.*
+*.a
+*.s
 *.su
-*~
+*.mod.c
+*.i
+*.lst
+*.order
+*.elf
 *.swp
-*.patch
 *.bin
+*.patch
 *.cfgtmp
 *.dts.tmp
 
 #
 # Top-level generic files
 #
-
 /MLO*
 /SPL
 /System.map
 /u-boot
-/u-boot.elf
 /u-boot.hex
 /u-boot.imx
 /u-boot-with-spl.imx
 /u-boot.lds
 /u-boot.ubl
 /u-boot.ais
-/u-boot.dtb
 /u-boot.sb
 
+#
+# git files that we don't want to ignore even it they are dot-files
+#
+!.gitignore
+!.mailmap
+
 #
 # Generated files
 #
 
-*.depend*
 /LOG
 /errlog
 /reloc_off
@@ -65,7 +71,6 @@
 /include/generated/
 /include/spl-autoconf.mk
 /include/tpl-autoconf.mk
-asm-offsets.s
 
 # stgit generated dirs
 patches-*
@@ -91,3 +96,7 @@ GPATH
 GRTAGS
 GSYMS
 GTAGS
+
+*.orig
+*~
+\#*#
diff --git a/MAKEALL b/MAKEALL
index 54b0d89..705a0bb 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -398,8 +398,6 @@ LIST_at91="$(targets_by_soc at91)"
 
 LIST_pxa="$(targets_by_cpu pxa)"
 
-LIST_ixp="$(targets_by_cpu ixp)"
-
 #########################################################################
 ## SPEAr Systems
 #########################################################################
@@ -674,8 +672,6 @@ build_target() {
                output_dir="${OUTPUT_PREFIX}"
        fi
 
-       export BUILD_DIR="${output_dir}"
-
        target_arch=$(get_target_arch ${target})
        eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
        if [ "${cross_toolchain}" ] ; then
@@ -686,6 +682,10 @@ build_target() {
            MAKE=make
        fi
 
+       if [  "${output_dir}" != "." ] ; then
+               MAKE="${MAKE} O=${output_dir}"
+       fi
+
        ${MAKE} distclean >/dev/null
        ${MAKE} -s ${target}_config
 
@@ -700,7 +700,7 @@ build_target() {
        if [ $BUILD_MANY == 1 ] ; then
                trap - TERM
 
-               ${MAKE} -s tidy
+               ${MAKE} -s clean
 
                if [ -s ${LOG_DIR}/${target}.ERR ] ; then
                        cp ${LOG_DIR}/${target}.ERR ${OUTPUT_PREFIX}/ERR/${target}
index 1687e2e..9a530b3 100644 (file)
--- a/Makefile
+++ b/Makefile
 #
 
 VERSION = 2014
-PATCHLEVEL = 01
+PATCHLEVEL = 04
 SUBLEVEL =
-EXTRAVERSION =
-ifneq "$(SUBLEVEL)" ""
-U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+EXTRAVERSION = -rc1
+NAME =
+
+# *DOCUMENTATION*
+# To see a list of typical targets execute "make help"
+# More info can be located in ./README
+# Comments in this file are targeted only to the developer, do not
+# expect to learn how to build the kernel reading this file.
+
+# Do not:
+# o  use make's built-in rules and variables
+#    (this increases performance and avoids hard-to-debug behaviour);
+# o  print "Entering directory ...";
+MAKEFLAGS += -rR --no-print-directory
+
+# Avoid funny character set dependencies
+unexport LC_ALL
+LC_COLLATE=C
+LC_NUMERIC=C
+export LC_COLLATE LC_NUMERIC
+
+# We are using a recursive build, so we need to do a little thinking
+# to get the ordering right.
+#
+# Most importantly: sub-Makefiles should only ever modify files in
+# their own directory. If in some directory we have a dependency on
+# a file in another dir (which doesn't happen often, but it's often
+# unavoidable when linking the built-in.o targets which finally
+# turn into vmlinux), we will call a sub make in that other dir, and
+# after that we are sure that everything which is in that other dir
+# is now up to date.
+#
+# The only cases where we need to modify files which have global
+# effects are thus separated out and done before the recursive
+# descending is started. They are now explicitly listed as the
+# prepare rule.
+
+# To put more focus on warnings, be less verbose as default
+# Use 'make V=1' to see the full commands
+
+ifeq ("$(origin V)", "command line")
+  KBUILD_VERBOSE = $(V)
+endif
+ifndef KBUILD_VERBOSE
+  KBUILD_VERBOSE = 0
+endif
+
+# Call a source code checker (by default, "sparse") as part of the
+# C compilation.
+#
+# Use 'make C=1' to enable checking of only re-compiled files.
+# Use 'make C=2' to enable checking of *all* source files, regardless
+# of whether they are re-compiled or not.
+#
+# See the file "Documentation/sparse.txt" for more details, including
+# where to get the "sparse" utility.
+
+ifeq ("$(origin C)", "command line")
+  KBUILD_CHECKSRC = $(C)
+endif
+ifndef KBUILD_CHECKSRC
+  KBUILD_CHECKSRC = 0
+endif
+
+# Use make M=dir to specify directory of external module to build
+# Old syntax make ... SUBDIRS=$PWD is still supported
+# Setting the environment variable KBUILD_EXTMOD take precedence
+ifdef SUBDIRS
+  KBUILD_EXTMOD ?= $(SUBDIRS)
+endif
+
+ifeq ("$(origin M)", "command line")
+  KBUILD_EXTMOD := $(M)
+endif
+
+# kbuild supports saving output files in a separate directory.
+# To locate output files in a separate directory two syntaxes are supported.
+# In both cases the working directory must be the root of the kernel src.
+# 1) O=
+# Use "make O=dir/to/store/output/files/"
+#
+# 2) Set KBUILD_OUTPUT
+# Set the environment variable KBUILD_OUTPUT to point to the directory
+# where the output files shall be placed.
+# export KBUILD_OUTPUT=dir/to/store/output/files/
+# make
+#
+# The O= assignment takes precedence over the KBUILD_OUTPUT environment
+# variable.
+
+
+# KBUILD_SRC is set on invocation of make in OBJ directory
+# KBUILD_SRC is not intended to be used by the regular user (for now)
+ifeq ($(KBUILD_SRC),)
+
+# OK, Make called in directory where kernel src resides
+# Do we want to locate output files in a separate directory?
+ifeq ("$(origin O)", "command line")
+  KBUILD_OUTPUT := $(O)
+endif
+
+ifeq ("$(origin W)", "command line")
+  export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
+endif
+
+# That's our default target when none is given on the command line
+PHONY := _all
+_all:
+
+# Cancel implicit rules on top Makefile
+$(CURDIR)/Makefile Makefile: ;
+
+ifneq ($(KBUILD_OUTPUT),)
+# Invoke a second make in the output directory, passing relevant variables
+# check that the output directory actually exists
+saved-output := $(KBUILD_OUTPUT)
+KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+$(if $(KBUILD_OUTPUT),, \
+     $(error output directory "$(saved-output)" does not exist))
+
+PHONY += $(MAKECMDGOALS) sub-make
+
+$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
+       @:
+
+sub-make: FORCE
+       $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+       KBUILD_SRC=$(CURDIR) \
+       KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
+       $(filter-out _all sub-make,$(MAKECMDGOALS))
+
+# Leave processing to above invocation of make
+skip-makefile := 1
+endif # ifneq ($(KBUILD_OUTPUT),)
+endif # ifeq ($(KBUILD_SRC),)
+
+# We process the rest of the Makefile if this is the final invocation of make
+ifeq ($(skip-makefile),)
+
+# If building an external module we do not care about the all: rule
+# but instead _all depend on modules
+PHONY += all
+ifeq ($(KBUILD_EXTMOD),)
+_all: all
 else
-U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
+_all: modules
 endif
-TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
-VERSION_FILE = $(obj)include/generated/version_autogenerated.h
+
+srctree                := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
+objtree                := $(CURDIR)
+src            := $(srctree)
+obj            := $(objtree)
+
+VPATH          := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
+
+export srctree objtree VPATH
+
+OBJTREE                := $(objtree)
+SPLTREE                := $(OBJTREE)/spl
+TPLTREE                := $(OBJTREE)/tpl
+SRCTREE                := $(srctree)
+TOPDIR         := $(SRCTREE)
+export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
+
+MKCONFIG       := $(SRCTREE)/mkconfig
+export MKCONFIG
+
+# Make sure CDPATH settings don't interfere
+unexport CDPATH
+
+#########################################################################
+
+TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
+VERSION_FILE = include/generated/version_autogenerated.h
 
 HOSTARCH := $(shell uname -m | \
        sed -e s/i.86/x86/ \
@@ -36,139 +202,291 @@ export   HOSTARCH HOSTOS
 VENDOR=
 
 #########################################################################
-# Allow for silent builds
-ifeq (,$(findstring s,$(MAKEFLAGS)))
-XECHO = echo
-else
-XECHO = :
+
+# set default to nothing for native builds
+ifeq ($(HOSTARCH),$(ARCH))
+CROSS_COMPILE ?=
 endif
 
-#########################################################################
+# SHELL used by kbuild
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+         else if [ -x /bin/bash ]; then echo /bin/bash; \
+         else echo sh; fi ; fi)
+
+HOSTCC       = gcc
+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+ifeq ($(HOSTOS),cygwin)
+HOSTCFLAGS     += -ansi
+endif
+
+# Mac OS X / Darwin's C preprocessor is Apple specific.  It
+# generates numerous errors and warnings.  We want to bypass it
+# and use GNU C's cpp. To do this we pass the -traditional-cpp
+# option to the compiler.  Note that the -traditional-cpp flag
+# DOES NOT have the same semantics as GNU C's flag, all it does
+# is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
 #
-# U-boot build supports generating object files in a separate external
-# directory. Two use cases are supported:
+# Apple's linker is similar, thanks to the new 2 stage linking
+# multiple symbol definitions are treated as errors, hence the
+# -multiply_defined suppress option to turn off this error.
 #
-# 1) Add O= to the make command line
-# 'make O=/tmp/build all'
+ifeq ($(HOSTOS),darwin)
+# get major and minor product version (e.g. '10' and '6' for Snow Leopard)
+DARWIN_MAJOR_VERSION   = $(shell sw_vers -productVersion | cut -f 1 -d '.')
+DARWIN_MINOR_VERSION   = $(shell sw_vers -productVersion | cut -f 2 -d '.')
+
+os_x_before    = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
+       $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)
+
+# Snow Leopards build environment has no longer restrictions as described above
+HOSTCC       = $(call os_x_before, 10, 5, "cc", "gcc")
+HOSTCFLAGS  += $(call os_x_before, 10, 4, "-traditional-cpp")
+HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
+endif
+
+# Decide whether to build built-in, modular, or both.
+# Normally, just do built-in.
+
+KBUILD_MODULES :=
+KBUILD_BUILTIN := 1
+
+#      If we have only "make modules", don't compile built-in objects.
+#      When we're building modules with modversions, we need to consider
+#      the built-in objects during the descend as well, in order to
+#      make sure the checksums are up to date before we record them.
+
+ifeq ($(MAKECMDGOALS),modules)
+  KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
+endif
+
+#      If we have "make <whatever> modules", compile modules
+#      in addition to whatever we do anyway.
+#      Just "make" or "make all" shall build modules as well
+
+# U-Boot does not need modules
+#ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
+#  KBUILD_MODULES := 1
+#endif
+
+#ifeq ($(MAKECMDGOALS),)
+#  KBUILD_MODULES := 1
+#endif
+
+export KBUILD_MODULES KBUILD_BUILTIN
+export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
+
+# Beautify output
+# ---------------------------------------------------------------------------
+#
+# Normally, we echo the whole command before executing it. By making
+# that echo $($(quiet)$(cmd)), we now have the possibility to set
+# $(quiet) to choose other forms of output instead, e.g.
 #
-# 2) Set environment variable BUILD_DIR to point to the desired location
-# 'export BUILD_DIR=/tmp/build'
-# 'make'
+#         quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
+#         cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
 #
-# The second approach can also be used with a MAKEALL script
-# 'export BUILD_DIR=/tmp/build'
-# './MAKEALL'
+# If $(quiet) is empty, the whole command will be printed.
+# If it is set to "quiet_", only the short version will be printed. 
+# If it is set to "silent_", nothing will be printed at all, since
+# the variable $(silent_cmd_cc_o_c) doesn't exist.
 #
-# Command line 'O=' setting overrides BUILD_DIR environment variable.
+# A simple variant is to prefix commands with $(Q) - that's useful
+# for commands that shall be hidden in non-verbose mode.
 #
-# When none of the above methods is used the local build is performed and
-# the object files are placed in the source directory.
+#      $(Q)ln $@ :<
 #
+# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
+# If KBUILD_VERBOSE equals 1 then the above command is displayed.
 
-ifeq ("$(origin O)", "command line")
-BUILD_DIR := $(O)
+ifeq ($(KBUILD_VERBOSE),1)
+  quiet =
+  Q =
+else
+  quiet=quiet_
+  Q = @
 endif
 
-# Call a source code checker (by default, "sparse") as part of the
-# C compilation.
-#
-# Use 'make C=1' to enable checking of re-compiled files.
-#
-# See the linux kernel file "Documentation/sparse.txt" for more details,
-# including where to get the "sparse" utility.
+# If the user is running make -s (silent mode), suppress echoing of
+# commands
 
-ifdef C
-ifeq ("$(origin C)", "command line")
-CHECKSRC := $(C)
-endif
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+  quiet=silent_
 endif
-ifndef CHECKSRC
-  CHECKSRC = 0
-endif
-export CHECKSRC
 
-ifneq ($(BUILD_DIR),)
-saved-output := $(BUILD_DIR)
+export quiet Q KBUILD_VERBOSE
 
-# Attempt to create a output directory.
-$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
 
-# Verify if it was successful.
-BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
-$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
-endif # ifneq ($(BUILD_DIR),)
+# Look for make include files relative to root of kernel src
+MAKEFLAGS += --include-dir=$(srctree)
 
-OBJTREE                := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
-SPLTREE                := $(OBJTREE)/spl
-TPLTREE                := $(OBJTREE)/tpl
-SRCTREE                := $(CURDIR)
-TOPDIR         := $(SRCTREE)
-LNDIR          := $(OBJTREE)
-export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
+# We need some generic definitions (do not try to remake the file).
+$(srctree)/scripts/Kbuild.include: ;
+include $(srctree)/scripts/Kbuild.include
 
-MKCONFIG       := $(SRCTREE)/mkconfig
-export MKCONFIG
+# Make variables (CC, etc...)
 
-# $(obj) and (src) are defined in config.mk but here in main Makefile
-# we also need them before config.mk is included which is the case for
-# some targets like unconfig, clean, clobber, distclean, etc.
-ifneq ($(OBJTREE),$(SRCTREE))
-obj := $(OBJTREE)/
-src := $(SRCTREE)/
+AS             = $(CROSS_COMPILE)as
+# Always use GNU ld
+ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2> /dev/null),)
+LD             = $(CROSS_COMPILE)ld.bfd
 else
-obj :=
-src :=
+LD             = $(CROSS_COMPILE)ld
+endif
+CC             = $(CROSS_COMPILE)gcc
+CPP            = $(CC) -E
+AR             = $(CROSS_COMPILE)ar
+NM             = $(CROSS_COMPILE)nm
+LDR            = $(CROSS_COMPILE)ldr
+STRIP          = $(CROSS_COMPILE)strip
+OBJCOPY                = $(CROSS_COMPILE)objcopy
+OBJDUMP                = $(CROSS_COMPILE)objdump
+AWK            = awk
+RANLIB         = $(CROSS_COMPILE)RANLIB
+DTC            = dtc
+CHECK          = sparse
+
+CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
+                 -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
+
+KBUILD_CPPFLAGS := -D__KERNEL__
+
+KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
+                  -Wno-format-security \
+                  -fno-builtin -ffreestanding
+KBUILD_AFLAGS   := -D__ASSEMBLY__
+
+U_BOOT_VERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+
+export VERSION PATCHLEVEL SUBLEVEL U_BOOT_VERSION
+export ARCH CPU BOARD VENDOR SOC
+export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
+export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
+export MAKE AWK
+export DTC CHECK CHECKFLAGS
+
+export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE
+export KBUILD_CFLAGS KBUILD_AFLAGS
+
+# When compiling out-of-tree modules, put MODVERDIR in the module
+# tree rather than in the kernel tree. The kernel tree might
+# even be read-only.
+export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
+
+# Files to ignore in find ... statements
+
+RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
+                  -o -name .pc -o -name .hg -o -name .git \) -prune -o
+export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
+                        --exclude CVS --exclude .pc --exclude .hg --exclude .git
+
+# ===========================================================================
+# Rules shared between *config targets and build targets
+
+# Basic helpers built in scripts/
+PHONY += scripts_basic
+scripts_basic:
+       $(Q)$(MAKE) $(build)=scripts/basic
+       $(Q)rm -f .tmp_quiet_recordmcount
+
+# To avoid any implicit rule to kick in, define an empty command.
+scripts/basic/%: scripts_basic ;
+
+PHONY += outputmakefile
+# outputmakefile generates a Makefile in the output directory, if using a
+# separate output directory. This allows convenient use of make in the
+# output directory.
+outputmakefile:
+ifneq ($(KBUILD_SRC),)
+       $(Q)ln -fsn $(srctree) source
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
+           $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
 endif
-export obj src
 
-# Make sure CDPATH settings don't interfere
-unexport CDPATH
+# To make sure we do not include .config for any of the *config targets
+# catch them early, and hand them over to scripts/kconfig/Makefile
+# It is allowed to specify more targets when calling make, including
+# mixing *config targets and build targets.
+# For example 'make oldconfig all'.
+# Detect when mixed targets is specified, and make a second invocation
+# of make so .config is not included in this case either (for *config).
+
+no-dot-config-targets := clean clobber mrproper distclean \
+                        cscope TAGS %tags help %docs check% coccicheck \
+                        backup
+
+config-targets := 0
+mixed-targets  := 0
+dot-config     := 1
+
+ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+       ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+               dot-config := 0
+       endif
+endif
 
-#########################################################################
+ifeq ($(KBUILD_EXTMOD),)
+        ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+                config-targets := 1
+                ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+                        mixed-targets := 1
+                endif
+        endif
+endif
 
-# The "tools" are needed early, so put this first
-# Don't include stuff already done in $(LIBS)
-# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-# is "yes"), so compile examples after U-Boot is compiled.
-SUBDIR_TOOLS = tools
-SUBDIRS = $(SUBDIR_TOOLS)
+ifeq ($(mixed-targets),1)
+# ===========================================================================
+# We're called with mixed targets (*config and build targets).
+# Handle them one by one.
+
+PHONY += $(MAKECMDGOALS) build-one-by-one
 
-.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
+$(MAKECMDGOALS): build-one-by-one
+       @:
+
+build-one-by-one:
+       $(Q)set -e; \
+       for i in $(MAKECMDGOALS); do \
+               $(MAKE) -f $(srctree)/Makefile $$i; \
+       done
 
-ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
+else
+ifeq ($(config-targets),1)
+# ===========================================================================
+# *config targets only - make sure prerequisites are updated, and descend
+# in scripts/kconfig to make the *config target
 
-# Include autoconf.mk before config.mk so that the config options are available
-# to all top level build files.  We need the dummy all: target to prevent the
-# dependency target in autoconf.mk.dep from being the default.
-all:
-sinclude $(obj)include/autoconf.mk.dep
-sinclude $(obj)include/autoconf.mk
+# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
+# KBUILD_DEFCONFIG may point out an alternative default configuration
+# used for 'make defconfig'
 
-SUBDIR_EXAMPLES-y := examples/standalone
-SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
-ifndef CONFIG_SANDBOX
-SUBDIRS += $(SUBDIR_EXAMPLES-y)
-endif
+%_config:: outputmakefile
+       @$(MKCONFIG) -A $(@:_config=)
+
+else
+# ===========================================================================
+# Build targets only - this includes vmlinux, arch specific targets, clean
+# targets and others. In general all targets except *config targets.
 
 # load ARCH, BOARD, and CPU configuration
-include $(obj)include/config.mk
-export ARCH CPU BOARD VENDOR SOC
+-include include/config.mk
 
-# set default to nothing for native builds
-ifeq ($(HOSTARCH),$(ARCH))
-CROSS_COMPILE ?=
-endif
+ifeq ($(dot-config),1)
+# Read in config
+-include include/autoconf.mk
+-include include/autoconf.mk.dep
 
 # load other configuration
-include $(TOPDIR)/config.mk
+include $(srctree)/config.mk
 
-# Targets which don't build the source code
-NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig
+ifeq ($(wildcard include/config.mk),)
+$(error "System not configured - see README")
+endif
 
-# Only do the generic board check when actually building, not configuring
-ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
-ifeq ($(findstring _config,$(MAKECMDGOALS)),)
-$(CHECK_GENERIC_BOARD)
+ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
+ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
+$(error Your architecture does not support generic board. \
+Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
 endif
 endif
 
@@ -210,6 +528,60 @@ $(error could not find linker script)
        endif
 endif
 
+else
+
+
+endif # $(dot-config)
+
+KBUILD_CFLAGS += -Os #-fomit-frame-pointer
+
+ifdef BUILD_TAG
+KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
+endif
+
+KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+
+KBUILD_CFLAGS  += -g
+# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
+# option to the assembler.
+KBUILD_AFLAGS  += -g
+
+# Report stack usage if supported
+KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+
+KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+
+# turn jbsr into jsr for m68k
+ifeq ($(ARCH),m68k)
+ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
+KBUILD_AFLAGS += -Wa,-gstabs,-S
+endif
+endif
+
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
+endif
+
+export CONFIG_SYS_TEXT_BASE
+
+# Use UBOOTINCLUDE when you must reference the include/ directory.
+# Needed to be compatible with the O= option
+UBOOTINCLUDE    :=
+ifneq ($(OBJTREE),$(SRCTREE))
+UBOOTINCLUDE   += -I$(OBJTREE)/include
+endif
+UBOOTINCLUDE   += -I$(srctree)/include \
+               -I$(srctree)/arch/$(ARCH)/include
+
+NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+CHECKFLAGS     += $(NOSTDINC_FLAGS)
+
+# FIX ME
+cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
+c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
+
+.PHONY : $(VERSION_FILE) $(TIMESTAMP_FILE)
+
 #########################################################################
 # U-Boot objects....order is important (i.e. start must be first)
 
@@ -217,80 +589,85 @@ head-y := $(CPUDIR)/start.o
 head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
 head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
 
-OBJS := $(addprefix $(obj),$(head-y))
-
-HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
+HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
 
-LIBS-y += lib/
-LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
-LIBS-y += $(CPUDIR)/
+libs-y += lib/
+libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+libs-y += $(CPUDIR)/
 ifdef SOC
-LIBS-y += $(CPUDIR)/$(SOC)/
-endif
-LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
-LIBS-$(CONFIG_OF_EMBED) += dts/
-LIBS-y += arch/$(ARCH)/lib/
-LIBS-y += fs/
-LIBS-y += net/
-LIBS-y += disk/
-LIBS-y += drivers/
-LIBS-y += drivers/dma/
-LIBS-y += drivers/gpio/
-LIBS-y += drivers/i2c/
-LIBS-y += drivers/input/
-LIBS-y += drivers/mmc/
-LIBS-y += drivers/mtd/
-LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
-LIBS-y += drivers/mtd/onenand/
-LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
-LIBS-y += drivers/mtd/spi/
-LIBS-y += drivers/net/
-LIBS-y += drivers/net/phy/
-LIBS-y += drivers/pci/
-LIBS-y += drivers/power/ \
+libs-y += $(CPUDIR)/$(SOC)/
+endif
+libs-$(CONFIG_OF_EMBED) += dts/
+libs-y += arch/$(ARCH)/lib/
+libs-y += fs/
+libs-y += net/
+libs-y += disk/
+libs-y += drivers/
+libs-y += drivers/dma/
+libs-y += drivers/gpio/
+libs-y += drivers/i2c/
+libs-y += drivers/input/
+libs-y += drivers/mmc/
+libs-y += drivers/mtd/
+libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
+libs-y += drivers/mtd/onenand/
+libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
+libs-y += drivers/mtd/spi/
+libs-y += drivers/net/
+libs-y += drivers/net/phy/
+libs-y += drivers/pci/
+libs-y += drivers/power/ \
        drivers/power/fuel_gauge/ \
        drivers/power/mfd/ \
        drivers/power/pmic/ \
        drivers/power/battery/
-LIBS-y += drivers/spi/
-LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/
-LIBS-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
-LIBS-y += drivers/serial/
-LIBS-y += drivers/usb/eth/
-LIBS-y += drivers/usb/gadget/
-LIBS-y += drivers/usb/host/
-LIBS-y += drivers/usb/musb/
-LIBS-y += drivers/usb/musb-new/
-LIBS-y += drivers/usb/phy/
-LIBS-y += drivers/usb/ulpi/
-LIBS-y += common/
-LIBS-y += lib/libfdt/
-LIBS-$(CONFIG_API) += api/
-LIBS-$(CONFIG_HAS_POST) += post/
-LIBS-y += test/
+libs-y += drivers/spi/
+libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
+libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
+libs-y += drivers/serial/
+libs-y += drivers/usb/eth/
+libs-y += drivers/usb/gadget/
+libs-y += drivers/usb/host/
+libs-y += drivers/usb/musb/
+libs-y += drivers/usb/musb-new/
+libs-y += drivers/usb/phy/
+libs-y += drivers/usb/ulpi/
+libs-y += common/
+libs-y += lib/libfdt/
+libs-$(CONFIG_API) += api/
+libs-$(CONFIG_HAS_POST) += post/
+libs-y += test/
 
 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
-LIBS-y += arch/$(ARCH)/imx-common/
+libs-y += arch/$(ARCH)/imx-common/
 endif
 
-LIBS-$(CONFIG_ARM) += arch/arm/cpu/
-LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
+libs-$(CONFIG_ARM) += arch/arm/cpu/
+libs-$(CONFIG_PPC) += arch/powerpc/cpu/
+
+libs-y += board/$(BOARDDIR)/
+
+libs-y := $(sort $(libs-y))
 
-LIBS-y += board/$(BOARDDIR)/
+u-boot-dirs    := $(patsubst %/,%,$(filter %/, $(libs-y))) tools examples
+
+u-boot-alldirs := $(sort $(u-boot-dirs) $(patsubst %/,%,$(filter %/, $(libs-))))
+
+libs-y         := $(patsubst %/, %/built-in.o, $(libs-y))
+
+u-boot-init := $(head-y)
+u-boot-main := $(libs-y)
 
-LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
-LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
-.PHONY : $(LIBS)
 
 # Add GCC lib
 ifdef USE_PRIVATE_LIBGCC
 ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
-PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
+PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/lib.a
 else
 PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
 endif
 else
-PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
 endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 export PLATFORM_LIBS
@@ -304,9 +681,6 @@ LDPPFLAGS += \
        $(shell $(LD) --version | \
          sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
 
-__OBJS := $(subst $(obj),,$(OBJS))
-__LIBS := $(subst $(obj),,$(LIBS))
-
 #########################################################################
 #########################################################################
 
@@ -331,68 +705,71 @@ ifneq ($(CONFIG_STATIC_RELA),)
 DO_STATIC_RELA = \
        start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \
        end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \
-       $(obj)tools/relocate-rela $(2) $(3) $$start $$end
+       tools/relocate-rela $(2) $(3) $$start $$end
 else
 DO_STATIC_RELA =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
-
-ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
-ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
-ALL-$(CONFIG_RAMBOOT_PBL) += $(obj)u-boot.pbl
-ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
-ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img
-ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
-ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
+ALL-y += u-boot.srec u-boot.bin System.map
+
+ALL-$(CONFIG_NAND_U_BOOT) += u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
+ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
+ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
+ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
+ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
+ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.bin
 ifneq ($(CONFIG_SPL_TARGET),)
-ALL-$(CONFIG_SPL) += $(obj)$(CONFIG_SPL_TARGET:"%"=%)
+ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
 endif
-ALL-$(CONFIG_REMAKE_ELF) += $(obj)u-boot.elf
+ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
 
 # enable combined SPL/u-boot/dtb rules for tegra
 ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_SPL),y)
 ifeq ($(CONFIG_OF_SEPARATE),y)
-ALL-y += $(obj)u-boot-dtb-tegra.bin
+ALL-y += u-boot-dtb-tegra.bin
 else
-ALL-y += $(obj)u-boot-nodtb-tegra.bin
+ALL-y += u-boot-nodtb-tegra.bin
 endif
 endif
 endif
 
-build := -f $(TOPDIR)/scripts/Makefile.build -C
+LDFLAGS_u-boot += -T u-boot.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
+endif
 
-all:           $(ALL-y) $(SUBDIR_EXAMPLES-y)
+all:           $(ALL-y)
 
-$(obj)u-boot.dtb:      checkdtc $(obj)u-boot
-               $(MAKE) $(build) dts binary
-               mv $(obj)dts/dt.dtb $@
+PHONY += dtbs
+dtbs dts/dt.dtb: checkdtc u-boot
+       $(Q)$(MAKE) $(build)=dts dtbs
 
-$(obj)u-boot-dtb.bin:  $(obj)u-boot.bin $(obj)u-boot.dtb
+u-boot-dtb.bin: u-boot.bin dts/dt.dtb
                cat $^ >$@
 
-$(obj)u-boot.hex:      $(obj)u-boot
+u-boot.hex:    u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
 
-$(obj)u-boot.srec:     $(obj)u-boot
+u-boot.srec:   u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
 
-$(obj)u-boot.bin:      $(obj)u-boot
+u-boot.bin:    u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
                $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
                $(BOARD_SIZE_CHECK)
 
-$(obj)u-boot.ldr:      $(obj)u-boot
+u-boot.ldr:    u-boot
                $(CREATE_LDR_ENV)
                $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
                $(BOARD_SIZE_CHECK)
 
-$(obj)u-boot.ldr.hex:  $(obj)u-boot.ldr
+u-boot.ldr.hex:        u-boot.ldr
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
 
-$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
+u-boot.ldr.srec:       u-boot.ldr
                $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
 
 #
@@ -403,79 +780,78 @@ ifndef CONFIG_SYS_UBOOT_START
 CONFIG_SYS_UBOOT_START := 0
 endif
 
-$(obj)u-boot.img:      $(obj)u-boot.bin
-               $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
+u-boot.img:    u-boot.bin
+               tools/mkimage -A $(ARCH) -T firmware -C none \
                -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
                -e $(CONFIG_SYS_UBOOT_START) \
                -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
                        sed -e 's/"[     ]*$$/ for $(BOARD) board"/') \
                -d $< $@
 
-$(obj)u-boot.imx: $(obj)u-boot.bin depend
-               $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
+u-boot.imx: u-boot.bin
+               $(MAKE) $(build)=arch/arm/imx-common $(objtree)/u-boot.imx
 
-$(obj)u-boot.kwb:       $(obj)u-boot.bin
-               $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
+u-boot.kwb:       u-boot.bin
+               tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
                -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
 
-$(obj)u-boot.pbl:      $(obj)u-boot.bin
-               $(obj)tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
+u-boot.pbl:    u-boot.bin
+               tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
                -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \
                -d $< $@
 
-$(obj)u-boot.sha1:     $(obj)u-boot.bin
-               $(obj)tools/ubsha1 $(obj)u-boot.bin
+u-boot.sha1:   u-boot.bin
+               tools/ubsha1 u-boot.bin
 
-$(obj)u-boot.dis:      $(obj)u-boot
+u-boot.dis:    u-boot
                $(OBJDUMP) -d $< > $@
 
 # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
 # $(4) is pad-to
 SPL_PAD_APPEND = \
                $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \
-               $(1) $(obj)$(3); \
-               cat $(obj)$(3) $(2) > $@; \
-               rm $(obj)$(3)
+               $(1) $(3); \
+               cat $(3) $(2) > $@; \
+               rm $(3)
 
 ifdef CONFIG_TPL
-SPL_PAYLOAD := $(obj)tpl/u-boot-with-tpl.bin
+SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
 else
-SPL_PAYLOAD := $(obj)u-boot.bin
+SPL_PAYLOAD := u-boot.bin
 endif
 
-$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(SPL_PAYLOAD)
+u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD)
                $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
 
-$(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
-               $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
+tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin
+               $(call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
 
-$(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-               $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
+u-boot-with-spl.imx: spl/u-boot-spl.bin u-boot.bin
+               $(MAKE) $(build)=arch/arm/imx-common \
                        $(OBJTREE)/u-boot-with-spl.imx
 
-$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-               $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
+u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
+               $(MAKE) $(build)=arch/arm/imx-common \
                        $(OBJTREE)/u-boot-with-nand-spl.imx
 
-$(obj)u-boot.ubl:       $(obj)u-boot-with-spl.bin
-               $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-               -e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
+u-boot.ubl:       u-boot-with-spl.bin
+               tools/mkimage -n $(UBL_CONFIG) -T ublimage \
+               -e $(CONFIG_SYS_TEXT_BASE) -d $< u-boot.ubl
 
-$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
-               $(obj)tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") \
+u-boot.ais:       spl/u-boot-spl.bin u-boot.img
+               tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \
                        -T aisimage \
                        -e $(CONFIG_SPL_TEXT_BASE) \
-                       -d $(obj)spl/u-boot-spl.bin \
-                       $(obj)spl/u-boot-spl.ais
+                       -d spl/u-boot-spl.bin \
+                       spl/u-boot-spl.ais
                $(OBJCOPY) ${OBJCFLAGS} -I binary \
                        --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
-                       $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
-               cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
-                       $(obj)u-boot.ais
+                       spl/u-boot-spl.ais spl/u-boot-spl-pad.ais
+               cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais
 
 
-$(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
-               $(MAKE) $(build) $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
+u-boot.sb:       u-boot.bin spl/u-boot-spl.bin
+               $(MAKE) $(build)=$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
 
 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
 # Both images are created using mkimage (crc etc), so that the ROM
@@ -483,124 +859,188 @@ $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
 # SPL image (with mkimage header) and not the binary. Otherwise the resulting image
 # which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
 # The resulting image containing both U-Boot images is called u-boot.spr
-$(obj)u-boot.spr:      $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
-               $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
+u-boot.spr:    u-boot.img spl/u-boot-spl.bin
+               tools/mkimage -A $(ARCH) -T firmware -C none \
                -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
-               -d $(obj)spl/u-boot-spl.bin $@
+               -d spl/u-boot-spl.bin $@
                $(OBJCOPY) -I binary -O binary \
                        --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
-               cat $(obj)u-boot.img >> $@
+               cat u-boot.img >> $@
 
 ifneq ($(CONFIG_TEGRA),)
-$(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-               $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
-               cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
-               rm $(obj)spl/u-boot-spl-pad.bin
+u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin
+               $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin
+               cat spl/u-boot-spl-pad.bin u-boot.bin > $@
+               rm spl/u-boot-spl-pad.bin
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-$(obj)u-boot-dtb-tegra.bin: $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb
-               cat $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb > $@
+u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb
+               cat $^ > $@
 endif
 endif
 
-$(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
-               cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
+u-boot-img.bin: spl/u-boot-spl.bin u-boot.img
+               cat spl/u-boot-spl.bin u-boot.img > $@
 
 # PPC4xx needs the SPL at the end of the image, since the reset vector
 # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
 # and need to introduce a new build target with the full blown U-Boot
 # at the start padded up to the start of the SPL image. And then concat
 # the SPL image to the end.
-$(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
+u-boot-img-spl-at-end.bin: spl/u-boot-spl.bin u-boot.img
                $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \
-                        --gap-fill=0xff $(obj)u-boot.img $@
-               cat $(obj)spl/u-boot-spl.bin >> $@
+                        --gap-fill=0xff u-boot.img $@
+               cat spl/u-boot-spl.bin >> $@
 
 # Create a new ELF from a raw binary file.  This is useful for arm64
 # where static relocation needs to be performed on the raw binary,
 # but certain simulators only accept an ELF file (but don't do the
 # relocation).
 # FIXME refactor dts/Makefile to share target/arch detection
-$(obj)u-boot.elf: $(obj)u-boot.bin
+u-boot.elf: u-boot.bin
        @$(OBJCOPY)  -B aarch64 -I binary -O elf64-littleaarch64 \
-               $< $(obj)u-boot-elf.o
-       @$(LD) $(obj)u-boot-elf.o -o $@ \
+               $< u-boot-elf.o
+       @$(LD) u-boot-elf.o -o $@ \
                --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
                -Ttext=$(CONFIG_SYS_TEXT_BASE)
 
 ifeq ($(CONFIG_SANDBOX),y)
 GEN_UBOOT = \
-               cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
-                       -Wl,--start-group $(__LIBS) -Wl,--end-group \
+               $(CC) $(SYMS) -T u-boot.lds \
+                       -Wl,--start-group $(u-boot-main) -Wl,--end-group \
                        $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
 else
 GEN_UBOOT = \
-               cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
-                       $(__OBJS) \
-                       --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+               $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+                       $(u-boot-init) \
+                       --start-group $(u-boot-main) --end-group $(PLATFORM_LIBS) \
                        -Map u-boot.map -o u-boot
 endif
 
-$(obj)u-boot:  depend \
-               $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(obj)u-boot.lds
+u-boot:        $(u-boot-init) $(u-boot-main) u-boot.lds
                $(GEN_UBOOT)
 ifeq ($(CONFIG_KALLSYMS),y)
-               smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
+               smap=`$(call SYSTEM_MAP,u-boot) | \
                        awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
-               $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
-                       -c common/system_map.c -o $(obj)common/system_map.o
-               $(GEN_UBOOT) $(obj)common/system_map.o
+               $(CC) $(c_flags) -DSYSTEM_MAP="\"$${smap}\"" \
+                       -c $(srctree)/common/system_map.c -o common/system_map.o
+               $(GEN_UBOOT) common/system_map.o
+endif
+
+# The actual objects are generated when descending, 
+# make sure no implicit rule kicks in
+$(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
+
+# Handle descending into subdirectories listed in $(vmlinux-dirs)
+# Preset locale variables to speed up the build process. Limit locale
+# tweaks to this spot to avoid wrong language settings when running
+# make menuconfig etc.
+# Error messages still appears in the original language
+
+PHONY += $(u-boot-dirs)
+$(u-boot-dirs): depend prepare scripts
+       $(Q)$(MAKE) $(build)=$@
+
+tools: $(TIMESTAMP_FILE) $(VERSION_FILE)
+# The "tools" are needed early
+$(filter-out tools, $(u-boot-dirs)): tools
+# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
+# is "yes"), so compile examples after U-Boot is compiled.
+examples: $(filter-out examples, $(u-boot-dirs))
+
+# Things we need to do before we recursively start building the kernel
+# or the modules are listed in "prepare".
+# A multi level approach is used. prepareN is processed before prepareN-1.
+# archprepare is used in arch Makefiles and when processed asm symlink,
+# version.h and scripts_basic is processed / created.
+
+# Listed in dependency order
+PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
+
+# prepare3 is used to check if we are building in a separate output directory,
+# and if so do:
+# 1) Check that make has not been executed in the kernel src $(srctree)
+prepare3:
+ifneq ($(KBUILD_SRC),)
+       @$(kecho) '  Using $(srctree) as source for u-boot'
+       $(Q)if [ -f $(srctree)/include/config.mk ]; then \
+               echo >&2 "  $(srctree) is not clean, please run 'make mrproper'"; \
+               echo >&2 "  in the '$(srctree)' directory.";\
+               /bin/false; \
+       fi;
 endif
 
-$(OBJS):
+# prepare2 creates a makefile if using a separate output directory
+prepare2: prepare3 outputmakefile
+
+prepare1: prepare2
        @:
 
-$(LIBS):       depend $(SUBDIR_TOOLS)
-               $(MAKE) $(build) $(dir $(subst $(obj),,$@))
+archprepare: prepare1 scripts_basic
+
+prepare0: archprepare FORCE
+       @:
 
-$(SUBDIRS):    depend
-               $(MAKE) -C $@ all
+# All the preparing..
+prepare: prepare0
 
-$(SUBDIR_EXAMPLES-y): $(obj)u-boot
+#
+# Auto-generate the autoconf.mk file (which is included by all makefiles)
+#
+# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
+# the dep file is only include in this top level makefile to determine when
+# to regenerate the autoconf.mk file.
+
+quiet_cmd_autoconf_dep = GEN     $@
+      cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \
+       -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || rm $@
+
+include/autoconf.mk.dep: include/config.h include/common.h
+       $(call cmd,autoconf_dep)
+
+quiet_cmd_autoconf = GEN     $@
+      cmd_autoconf = \
+       $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
+       sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
 
-$(obj)u-boot.lds: $(LDSCRIPT) depend
-               $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
+include/autoconf.mk: include/config.h
+       $(call cmd,autoconf)
 
-nand_spl:      $(TIMESTAMP_FILE) $(VERSION_FILE) depend
-               $(MAKE) -C nand_spl/board/$(BOARDDIR) all
+u-boot.lds: $(LDSCRIPT) depend
+               $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
 
-$(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
-               cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
+nand_spl:      $(TIMESTAMP_FILE) $(VERSION_FILE) depend prepare
+               $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
 
-$(obj)spl/u-boot-spl.bin:      $(SUBDIR_TOOLS) depend
-               $(MAKE) -C spl all
+u-boot-nand.bin:       nand_spl u-boot.bin
+               cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin
 
-$(obj)tpl/u-boot-tpl.bin:      $(SUBDIR_TOOLS) depend
-               $(MAKE) -C spl all CONFIG_TPL_BUILD=y
+spl/u-boot-spl.bin: tools depend prepare 
+               $(MAKE) obj=spl -f $(srctree)/spl/Makefile all
+
+tpl/u-boot-tpl.bin: tools depend prepare
+               $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
 
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:    $(TIMESTAMP_FILE) $(VERSION_FILE) \
-               $(obj)include/spl-autoconf.mk \
-               $(obj)include/tpl-autoconf.mk \
-               $(obj)include/autoconf.mk \
-               $(obj)include/generated/generic-asm-offsets.h \
-               $(obj)include/generated/asm-offsets.h
+               include/generated/generic-asm-offsets.h \
+               include/generated/asm-offsets.h
 
-TAG_SUBDIRS = $(SUBDIRS)
-TAG_SUBDIRS += $(dir $(__LIBS))
-TAG_SUBDIRS += include
+TAG_SUBDIRS := $(u-boot-dirs) include
 
 FIND := find
 FINDFLAGS := -L
 
+PHONY += checkstack
+
 checkstack:
-               $(CROSS_COMPILE)objdump -d $(obj)u-boot \
-                       `$(FIND) $(obj) -name u-boot-spl -print` | \
-                       perl $(src)scripts/checkstack.pl $(ARCH)
+       $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
+       $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
 tags ctags:
-               ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
+               ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
                                                -name '*.[chS]' -print`
 
 etags:
@@ -615,7 +1055,7 @@ SYSTEM_MAP = \
                $(NM) $1 | \
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
                LC_ALL=C sort
-$(obj)System.map:      $(obj)u-boot
+System.map:    u-boot
                @$(call SYSTEM_MAP,$<) > $@
 
 checkthumb:
@@ -641,82 +1081,42 @@ checkdtc:
                false; \
        fi
 
-#
-# Auto-generate the autoconf.mk file (which is included by all makefiles)
-#
-# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
-# the dep file is only include in this top level makefile to determine when
-# to regenerate the autoconf.mk file.
-$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
-       @$(XECHO) Generating $@ ; \
-       : Generate the dependancies ; \
-       $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
-               -MQ $(obj)include/autoconf.mk include/common.h > $@ || \
-               rm $@
-
-$(obj)include/autoconf.mk: $(obj)include/config.h
-       @$(XECHO) Generating $@ ; \
-       : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
-               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
-       rm $@.tmp
-
-# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
-$(obj)include/tpl-autoconf.mk: $(obj)include/config.h
-       @$(XECHO) Generating $@ ; \
-       : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-                       -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
-               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
-       rm $@.tmp
+quiet_cmd_offsets = GEN     $@
+      cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $< $@
 
-$(obj)include/spl-autoconf.mk: $(obj)include/config.h
-       @$(XECHO) Generating $@ ; \
-       : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
-               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
-       rm $@.tmp
+include/generated/generic-asm-offsets.h: lib/asm-offsets.s
+       $(call cmd,offsets)
 
-$(obj)include/generated/generic-asm-offsets.h: $(obj)lib/asm-offsets.s
-       @$(XECHO) Generating $@
-       tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
+quiet_cmd_asm-offsets.s = CC      $@
+      cmd_asm-offsets.s = mkdir -p lib; \
+               $(CC) -DDO_DEPS_ONLY \
+               $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
+               -o $@ $< -c -S
 
-$(obj)lib/asm-offsets.s: $(obj)include/config.h $(src)lib/asm-offsets.c
-       @mkdir -p $(obj)lib
-       $(CC) -DDO_DEPS_ONLY \
-               $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-               -o $@ $(src)lib/asm-offsets.c -c -S
+lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h
+       $(call cmd,asm-offsets.s)
 
-$(obj)include/generated/asm-offsets.h: $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
-       @$(XECHO) Generating $@
-       tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
+include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s
+       $(call cmd,offsets)
 
-$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/config.h
-       @mkdir -p $(obj)$(CPUDIR)/$(SOC)
-       if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
+quiet_cmd_soc_asm-offsets.s = CC      $@
+      cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \
+       if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
                $(CC) -DDO_DEPS_ONLY \
-               $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-                       -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
+               $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
+                       -o $@ $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
        else \
                touch $@; \
        fi
 
+$(CPUDIR)/$(SOC)/asm-offsets.s:        include/config.h
+       $(call cmd,soc_asm-offsets.s)
+
 #########################################################################
-else   # !config.mk
-all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
-$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
-$(filter-out tools,$(SUBDIRS)) \
-depend dep tags ctags etags cscope $(obj)System.map:
-       @echo "System not configured - see README" >&2
-       @ exit 1
-
-tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
-       $(MAKE) -C $@ all
-endif  # config.mk
 
 # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
 # R_AARCH64_RELATIVE (64-bit).
-checkarmreloc: $(obj)u-boot
+checkarmreloc: u-boot
        @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \
                grep R_A | sort -u`"; \
        if test "$$RELOC" != "R_ARM_RELATIVE" -a \
@@ -745,15 +1145,11 @@ $(TIMESTAMP_FILE):
                @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
                @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
 
-easylogo env gdb:
-       $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
-gdbtools: gdb
+env: depend scripts_basic
+       $(Q)$(MAKE) $(build)=tools/$@
 
-xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
-       $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
-
-tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
-       $(MAKE) -C tools HOST_TOOLS_ALL=y
+tools-all: HOST_TOOLS_ALL=y
+tools-all: env tools ;
 
 .PHONY : CHANGELOG
 CHANGELOG:
@@ -764,106 +1160,132 @@ include/license.h: tools/bin2header COPYING
        cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
 #########################################################################
 
-unconfig:
-       @rm -f $(obj)include/config.h $(obj)include/config.mk \
-               $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
-               $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep \
-               $(obj)include/spl-autoconf.mk \
-               $(obj)include/tpl-autoconf.mk
+###
+# Cleaning is done on three levels.
+# make clean     Delete most generated files
+#                Leave enough to build external modules
+# make mrproper  Delete the current configuration, and all generated files
+# make distclean Remove editor backup files, patch leftover files and the like
+
+# Directories & files removed with 'make clean'
+CLEAN_DIRS  += $(MODVERDIR)
+CLEAN_FILES += u-boot.lds include/bmp_logo.h include/bmp_logo_data.h \
+              board/*/config.tmp board/*/*/config.tmp \
+              include/autoconf.mk* include/spl-autoconf.mk \
+              include/tpl-autoconf.mk
+
+# Directories & files removed with 'make clobber'
+CLOBBER_DIRS  += $(patsubst %,spl/%, $(filter-out Makefile, \
+                $(shell ls -1 spl 2>/dev/null))) \
+                tpl
+CLOBBER_FILES += u-boot* MLO MLO* SPL System.map nand_spl/u-boot*
+
+# Directories & files removed with 'make mrproper'
+MRPROPER_DIRS  += include/config include/generated
+MRPROPER_FILES += .config .config.old \
+                 tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
+                 include/config.h include/config.mk
+
+# clean - Delete most, but leave enough to build external modules
+#
+clean: rm-dirs  := $(CLEAN_DIRS)
+clean: rm-files := $(CLEAN_FILES)
+
+clean-dirs     := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $f/Makefile),$f))
+
+clean-dirs      := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
+
+PHONY += $(clean-dirs) clean archclean
+$(clean-dirs):
+       $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
+
+# TODO: Do not use *.cfgtmp
+clean: $(clean-dirs)
+       $(call cmd,rmdirs)
+       $(call cmd,rmfiles)
+       @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
+               \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+               -o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
+               -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
+               -o -name '*.symtypes' -o -name 'modules.order' \
+               -o -name modules.builtin -o -name '.tmp_*.o.*' \
+               -o -name '*.gcno' \) -type f -print | xargs rm -f
+       @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
+               -path './nand_spl/*' -type l -print | xargs rm -f
+
+# clobber
+#
+clobber: rm-dirs  := $(CLOBBER_DIRS)
+clobber: rm-files := $(CLOBBER_FILES)
 
-%_config::     unconfig
-       @$(MKCONFIG) -A $(@:_config=)
+PHONY += clobber
 
-sinclude $(obj).boards.depend
-$(obj).boards.depend:  boards.cfg
-       @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@
+clobber: clean
+       $(call cmd,rmdirs)
+       $(call cmd,rmfiles)
 
-#########################################################################
-#########################################################################
+# mrproper - Delete all generated files, including .config
+#
+mrproper: rm-dirs  := $(wildcard $(MRPROPER_DIRS))
+mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
+mrproper-dirs      := $(addprefix _mrproper_,scripts)
 
-clean:
-       @rm -f $(obj)examples/standalone/atmel_df_pow2                    \
-              $(obj)examples/standalone/hello_world                      \
-              $(obj)examples/standalone/interrupt                        \
-              $(obj)examples/standalone/mem_to_mem_idma2intr             \
-              $(obj)examples/standalone/sched                            \
-              $(obj)examples/standalone/smc911{11,x}_eeprom              \
-              $(obj)examples/standalone/test_burst                       \
-              $(obj)examples/standalone/timer
-       @rm -f $(obj)examples/api/demo{,.bin}
-       @rm -f $(obj)tools/bmp_logo        $(obj)tools/easylogo/easylogo  \
-              $(obj)tools/env/fw_printenv                                \
-              $(obj)tools/envcrc                                         \
-              $(obj)tools/gdb/{gdbcont,gdbsend}                          \
-              $(obj)tools/gen_eth_addr    $(obj)tools/img2srec           \
-              $(obj)tools/dump{env,}image                \
-              $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk         \
-              $(obj)tools/mk{$(BOARD),}spl                               \
-              $(obj)tools/mxsboot                                        \
-              $(obj)tools/ncb             $(obj)tools/ubsha1             \
-              $(obj)tools/kernel-doc/docproc                             \
-              $(obj)tools/proftool
-       @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}        \
-              $(obj)board/matrix_vision/*/bootscript.img                 \
-              $(obj)u-boot.lds                                           \
-              $(obj)arch/blackfin/cpu/init.{lds,elf}
-       @rm -f $(obj)include/bmp_logo.h
-       @rm -f $(obj)include/bmp_logo_data.h
-       @rm -f $(obj)lib/asm-offsets.s
-       @rm -f $(obj)include/generated/asm-offsets.h
-       @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
-       @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
-       @$(MAKE) -s -C doc/DocBook/ cleandocs
-       @find $(OBJTREE) -type f \
-               \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
-               -o -name '*.o'  -o -name '*.a' -o -name '*.exe' \
-               -o -name '*.cfgtmp' \) -print \
-               | xargs rm -f
-
-# Removes everything not needed for testing u-boot
-tidy:  clean
-       @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
-
-clobber:       tidy
-       @find $(OBJTREE) -type f \( -name '*.srec' \
-               -o -name '*.bin' -o -name u-boot.img \) \
-               -print0 | xargs -0 rm -f
-       @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
-               $(obj)cscope.* $(obj)*.*~
-       @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
-       @rm -f $(obj)u-boot.kwb
-       @rm -f $(obj)u-boot.pbl
-       @rm -f $(obj)u-boot.imx
-       @rm -f $(obj)u-boot-with-spl.imx
-       @rm -f $(obj)u-boot-with-nand-spl.imx
-       @rm -f $(obj)u-boot.ubl
-       @rm -f $(obj)u-boot.ais
-       @rm -f $(obj)u-boot.dtb
-       @rm -f $(obj)u-boot.sb
-       @rm -f $(obj)u-boot.spr
-       @rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
-       @rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
-       @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
-       @rm -f $(obj)spl/u-boot-spl.lds
-       @rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.bin,u-boot-tpl.map}
-       @rm -f $(obj)tpl/u-boot-spl.lds
-       @rm -f $(obj)MLO MLO.byteswap
-       @rm -f $(obj)SPL
-       @rm -f $(obj)tools/xway-swap-bytes
-       @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
-       @rm -fr $(obj)include/generated
-       @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
-       @rm -f $(obj)dts/*.tmp
-       @rm -f $(obj)spl/u-boot-spl{,-pad}.ais
-
-mrproper \
-distclean:     clobber unconfig
-ifneq ($(OBJTREE),$(SRCTREE))
-       rm -rf $(obj)*
-endif
+PHONY += $(mrproper-dirs) mrproper archmrproper
+$(mrproper-dirs):
+       $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
+
+mrproper: clobber $(mrproper-dirs)
+       $(call cmd,rmdirs)
+       $(call cmd,rmfiles)
+       @rm -f arch/*/include/asm/arch arch/*/include/asm/proc
+
+# distclean
+#
+PHONY += distclean
+
+distclean: mrproper
+       @find $(srctree) $(RCS_FIND_IGNORE) \
+               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+               -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+               -o -name '.*.rej' \
+               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
+               -type f -print | xargs rm -f
 
 backup:
        F=`basename $(TOPDIR)` ; cd .. ; \
        gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
 
-#########################################################################
+
+# Documentation targets
+# ---------------------------------------------------------------------------
+%docs: scripts_basic FORCE
+       $(Q)$(MAKE) $(build)=scripts build_docproc
+       $(Q)$(MAKE) $(build)=doc/DocBook $@
+
+# Dummies...
+PHONY += prepare scripts
+prepare: ;
+scripts: ;
+
+endif #ifeq ($(config-targets),1)
+endif #ifeq ($(mixed-targets),1)
+
+quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
+      cmd_rmdirs = rm -rf $(rm-dirs)
+
+quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
+      cmd_rmfiles = rm -f $(rm-files)
+
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
+# Usage:
+# $(Q)$(MAKE) $(clean)=dir
+clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
+
+endif  # skip-makefile
+
+PHONY += FORCE
+FORCE:
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable so we can use it in if_changed and friends.
+.PHONY: $(PHONY)
diff --git a/README b/README
index fe48ccd..423ab2c 100644 (file)
--- a/README
+++ b/README
@@ -141,7 +141,6 @@ Directory Hierarchy:
        /s3c24x0        Files specific to Samsung S3C24X0 CPUs
       /arm926ejs       Files specific to ARM 926 CPUs
       /arm1136         Files specific to ARM 1136 CPUs
-      /ixp             Files specific to Intel XScale IXP CPUs
       /pxa             Files specific to Intel XScale PXA CPUs
       /sa1100          Files specific to Intel StrongARM SA1100 CPUs
     /lib               Architecture specific library files
@@ -923,6 +922,8 @@ The following options need to be configured:
                CONFIG_CMD_EXPORTENV    * export the environment
                CONFIG_CMD_EXT2         * ext2 command support
                CONFIG_CMD_EXT4         * ext4 command support
+               CONFIG_CMD_FS_GENERIC   * filesystem commands (e.g. load, ls)
+                                         that work for multiple fs types
                CONFIG_CMD_SAVEENV        saveenv
                CONFIG_CMD_FDC          * Floppy Disk Support
                CONFIG_CMD_FAT          * FAT command support
@@ -2848,11 +2849,31 @@ CBFS (Coreboot Filesystem) support
                CONFIG_RSA
 
                This enables the RSA algorithm used for FIT image verification
-               in U-Boot. See doc/uImage/signature for more information.
+               in U-Boot. See doc/uImage.FIT/signature.txt for more information.
 
                The signing part is build into mkimage regardless of this
                option.
 
+- bootcount support:
+               CONFIG_BOOTCOUNT_LIMIT
+
+               This enables the bootcounter support, see:
+               http://www.denx.de/wiki/DULG/UBootBootCountLimit
+
+               CONFIG_AT91SAM9XE
+               enable special bootcounter support on at91sam9xe based boards.
+               CONFIG_BLACKFIN
+               enable special bootcounter support on blackfin based boards.
+               CONFIG_SOC_DA8XX
+               enable special bootcounter support on da850 based boards.
+               CONFIG_BOOTCOUNT_RAM
+               enable support for the bootcounter in RAM
+               CONFIG_BOOTCOUNT_I2C
+               enable support for the bootcounter on an i2c (like RTC) device.
+                       CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
+                       CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
+                                                   the bootcounter.
+                       CONFIG_BOOTCOUNT_ALEN = address len
 
 - Show boot progress:
                CONFIG_SHOW_BOOT_PROGRESS
diff --git a/arch/arc/include/asm/arch-arc700/hardware.h b/arch/arc/include/asm/arch-arc700/hardware.h
deleted file mode 100644 (file)
index 8ec13a8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Copyright (C) 2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * This file is only required to allow compilation of "designware_i2c" driver.
- * Which explicitly includes <asm/arch/hardware.h>.
- */
index 956aa14..2482bcd 100644 (file)
@@ -41,19 +41,23 @@ int do_elf_reloc_fixups(void)
                         */
                        memcpy(&val, offset_ptr_ram, sizeof(int));
 
+#ifdef __LITTLE_ENDIAN__
                        /* If location in ".text" section swap value */
                        if ((unsigned int)offset_ptr_rom <
                            (unsigned int)&__text_end)
                                val = (val << 16) | (val >> 16);
+#endif
 
                        /* Check that the target points into .text */
                        if (val >= CONFIG_SYS_TEXT_BASE && val <=
                            (unsigned int)&__bss_end) {
                                val += gd->reloc_off;
+#ifdef __LITTLE_ENDIAN__
                                /* If location in ".text" section swap value */
                                if ((unsigned int)offset_ptr_rom <
                                    (unsigned int)&__text_end)
                                        val = (val << 16) | (val >> 16);
+#endif
                                memcpy(offset_ptr_ram, &val, sizeof(int));
                        } else {
                                debug("   %p: rom reloc %x, ram %p, value %x, limit %x\n",
index f74228c..ab1fc4a 100644 (file)
@@ -14,6 +14,6 @@ ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/SPL
 endif
 else
-ALL-y  += $(obj)u-boot.imx
+ALL-y  += u-boot.imx
 endif
 endif
diff --git a/arch/arm/cpu/arm1176/bcm2835/config.mk b/arch/arm/cpu/arm1176/bcm2835/config.mk
deleted file mode 100644 (file)
index b87ce24..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# (C) Copyright 2012 Stephen Warren
-#
-# 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
-# version 2 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.
-
-# Don't attempt to override the target CPU/ABI options;
-# the Raspberry Pi toolchain does the right thing by default.
-PLATFORM_RELFLAGS := $(filter-out -msoft-float,$(PLATFORM_RELFLAGS))
-PLATFORM_CPPFLAGS := $(filter-out -march=armv5t,$(PLATFORM_CPPFLAGS))
index 72c69b9..2c5cd63 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -112,24 +112,38 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
                { .n = 116, .m = 1, .p = 1 }, /* OSC: 12.0 MHz */
                { .n = 108, .m = 2, .p = 1 }, /* OSC: 26.0 MHz */
        },
+
+       /*
+        * T124: 700 MHz
+        *
+        * Register   Field  Bits   Width
+        * ------------------------------
+        * PLLX_BASE  p      23:20    4
+        * PLLX_BASE  n      15: 8    8
+        * PLLX_BASE  m       7: 0    8
+        */
+       {
+               { .n = 108, .m = 1, .p = 1 }, /* OSC: 13.0 MHz */
+               { .n =  73, .m = 1, .p = 1 }, /* OSC: 19.2 MHz */
+               { .n = 116, .m = 1, .p = 1 }, /* OSC: 12.0 MHz */
+               { .n = 108, .m = 2, .p = 1 }, /* OSC: 26.0 MHz */
+       },
 };
 
-void adjust_pllp_out_freqs(void)
+static inline void pllx_set_iddq(void)
 {
+#if defined(CONFIG_TEGRA124)
        struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-       struct clk_pll *pll = &clkrst->crc_pll[CLOCK_ID_PERIPH];
        u32 reg;
 
-       /* Set T30 PLLP_OUT1, 2, 3 & 4 freqs to 9.6, 48, 102 & 204MHz */
-       reg = readl(&pll->pll_out[0]);  /* OUTA, contains OUT2 / OUT1 */
-       reg |= (IN_408_OUT_48_DIVISOR << PLLP_OUT2_RATIO) | PLLP_OUT2_OVR
-               | (IN_408_OUT_9_6_DIVISOR << PLLP_OUT1_RATIO) | PLLP_OUT1_OVR;
-       writel(reg, &pll->pll_out[0]);
-
-       reg = readl(&pll->pll_out[1]);   /* OUTB, contains OUT4 / OUT3 */
-       reg |= (IN_408_OUT_204_DIVISOR << PLLP_OUT4_RATIO) | PLLP_OUT4_OVR
-               | (IN_408_OUT_102_DIVISOR << PLLP_OUT3_RATIO) | PLLP_OUT3_OVR;
-       writel(reg, &pll->pll_out[1]);
+       /* Disable IDDQ */
+       reg = readl(&clkrst->crc_pllx_misc3);
+       reg &= ~PLLX_IDDQ_MASK;
+       writel(reg, &clkrst->crc_pllx_misc3);
+       udelay(2);
+       debug("%s: IDDQ: PLLX IDDQ = 0x%08X\n", __func__,
+             readl(&clkrst->crc_pllx_misc3));
+#endif
 }
 
 int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
@@ -146,6 +160,8 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 
        debug(" pllx_set_rate entry\n");
 
+       pllx_set_iddq();
+
        /* Set BYPASS, m, n and p to PLLX_BASE */
        reg = PLL_BYPASS_MASK | (divm << PLL_DIVM_SHIFT);
        reg |= ((divn << PLL_DIVN_SHIFT) | (divp << PLL_DIVP_SHIFT));
@@ -162,18 +178,23 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
                reg |= (1 << PLL_DCCON_SHIFT);
        writel(reg, &pll->pll_misc);
 
-       /* Enable PLLX */
-       reg = readl(&pll->pll_base);
-       reg |= PLL_ENABLE_MASK;
-
        /* Disable BYPASS */
+       reg = readl(&pll->pll_base);
        reg &= ~PLL_BYPASS_MASK;
        writel(reg, &pll->pll_base);
+       debug("pllx_set_rate: base = 0x%08X\n", reg);
 
        /* Set lock_enable to PLLX_MISC */
        reg = readl(&pll->pll_misc);
        reg |= PLL_LOCK_ENABLE_MASK;
        writel(reg, &pll->pll_misc);
+       debug("pllx_set_rate: misc = 0x%08X\n", reg);
+
+       /* Enable PLLX last, once it's all configured */
+       reg = readl(&pll->pll_base);
+       reg |= PLL_ENABLE_MASK;
+       writel(reg, &pll->pll_base);
+       debug("pllx_set_rate: base final = 0x%08X\n", reg);
 
        return 0;
 }
@@ -207,12 +228,6 @@ void init_pllx(void)
        /* set pllx */
        sel = &tegra_pll_x_table[chip_sku][osc];
        pllx_set_rate(pll, sel->n, sel->m, sel->p, sel->cpcon);
-
-       /* adjust PLLP_out1-4 on T3x/T114 */
-       if (soc_type >= CHIPID_TEGRA30) {
-               debug("  init_pllx: adjusting PLLP out freqs\n");
-               adjust_pllp_out_freqs();
-       }
 }
 
 void enable_cpu_clock(int enable)
@@ -334,7 +349,6 @@ void reset_A9_cpu(int reset)
 void clock_enable_coresight(int enable)
 {
        u32 rst, src = 2;
-       int soc_type;
 
        debug("clock_enable_coresight entry\n");
        clock_set_enable(PERIPH_ID_CORESIGHT, enable);
@@ -343,20 +357,11 @@ void clock_enable_coresight(int enable)
        if (enable) {
                /*
                 * Put CoreSight on PLLP_OUT0 and divide it down as per
-                * PLLP base frequency based on SoC type (T20/T30/T114).
+                * PLLP base frequency based on SoC type (T20/T30+).
                 * Clock divider request would setup CSITE clock as 144MHz
                 * for PLLP base 216MHz and 204MHz for PLLP base 408MHz
                 */
-
-               soc_type = tegra_get_chip();
-               if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114)
-                       src = CLK_DIVIDER(NVBL_PLLP_KHZ, 204000);
-               else if (soc_type == CHIPID_TEGRA20)
-                       src = CLK_DIVIDER(NVBL_PLLP_KHZ, 144000);
-               else
-                       printf("%s: Unknown SoC type %X!\n",
-                                __func__, soc_type);
-
+               src = CLK_DIVIDER(NVBL_PLLP_KHZ, CSITE_KHZ);
                clock_ll_set_source_divisor(PERIPH_ID_CSI, 0, src);
 
                /* Unlock the CPU CoreSight interfaces */
index 60412c7..b4ca44f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2011
+ * (C) Copyright 2010-2014
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
 #define IO_STABILIZATION_DELAY (1000)
 
 #if defined(CONFIG_TEGRA20)
-#define NVBL_PLLP_KHZ  (216000)
-#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114)
-#define NVBL_PLLP_KHZ  (408000)
+#define NVBL_PLLP_KHZ  216000
+#define CSITE_KHZ      144000
+#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) || \
+       defined(CONFIG_TEGRA124)
+#define NVBL_PLLP_KHZ  408000
+#define CSITE_KHZ      204000
 #else
 #error "Unknown Tegra chip!"
 #endif
@@ -68,3 +71,4 @@ int tegra_get_chip(void);
 int tegra_get_sku_info(void);
 int tegra_get_chip_sku(void);
 void adjust_pllp_out_freqs(void);
+void pmic_enable_cpu_vdd(void);
index 51ecff7..d10b96a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -68,7 +68,7 @@ static void enable_cpu_clocks(void)
        /* Wait for PLL-X to lock */
        do {
                reg = readl(&clkrst->crc_pll_simple[SIMPLE_PLLX].pll_base);
-       } while ((reg & (1 << 27)) == 0);
+       } while ((reg & PLL_LOCK_MASK) == 0);
 
        /* Wait until all clocks are stable */
        udelay(PLL_STABILIZATION_DELAY);
@@ -126,18 +126,6 @@ void t114_init_clocks(void)
        /* Set active CPU cluster to G */
        clrbits_le32(&flow->cluster_control, 1);
 
-       /*
-        * Switch system clock to PLLP_OUT4 (108 MHz), AVP will now run
-        * at 108 MHz. This is glitch free as only the source is changed, no
-        * special precaution needed.
-        */
-       val = (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_IRQ_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_RUN_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_IDLE_SOURCE_SHIFT) |
-               (SCLK_SYS_STATE_RUN << SCLK_SYS_STATE_SHIFT);
-       writel(val, &clkrst->crc_sclk_brst_pol);
-
        writel(SUPER_SCLK_ENB_MASK, &clkrst->crc_super_sclk_div);
 
        debug("Setting up PLLX\n");
@@ -204,45 +192,43 @@ void t114_init_clocks(void)
        debug("t114_init_clocks exit\n");
 }
 
-static int is_partition_powered(u32 mask)
+static bool is_partition_powered(u32 partid)
 {
        struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
        u32 reg;
 
        /* Get power gate status */
        reg = readl(&pmc->pmc_pwrgate_status);
-       return (reg & mask) == mask;
+       return !!(reg & (1 << partid));
 }
 
-static int is_clamp_enabled(u32 mask)
+static bool is_clamp_enabled(u32 partid)
 {
        struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
        u32 reg;
 
-       /* Get clamp status. TODO: Add pmc_clamp_status alias to pmc.h */
-       reg = readl(&pmc->pmc_pwrgate_timer_on);
-       return (reg & mask) == mask;
+       /* Get clamp status. */
+       reg = readl(&pmc->pmc_clamp_status);
+       return !!(reg & (1 << partid));
 }
 
-static void power_partition(u32 status, u32 partid)
+static void power_partition(u32 partid)
 {
        struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
 
-       debug("%s: status = %08X, part ID = %08X\n", __func__, status, partid);
+       debug("%s: part ID = %08X\n", __func__, partid);
        /* Is the partition already on? */
-       if (!is_partition_powered(status)) {
+       if (!is_partition_powered(partid)) {
                /* No, toggle the partition power state (OFF -> ON) */
                debug("power_partition, toggling state\n");
-               clrbits_le32(&pmc->pmc_pwrgate_toggle, 0x1F);
-               setbits_le32(&pmc->pmc_pwrgate_toggle, partid);
-               setbits_le32(&pmc->pmc_pwrgate_toggle, START_CP);
+               writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);
 
                /* Wait for the power to come up */
-               while (!is_partition_powered(status))
+               while (!is_partition_powered(partid))
                        ;
 
                /* Wait for the clamp status to be cleared */
-               while (is_clamp_enabled(status))
+               while (is_clamp_enabled(partid))
                        ;
 
                /* Give I/O signals time to stabilize */
@@ -257,13 +243,13 @@ void powerup_cpus(void)
        /* We boot to the fast cluster */
        debug("powerup_cpus entry: G cluster\n");
        /* Power up the fast cluster rail partition */
-       power_partition(CRAIL, CRAILID);
+       power_partition(CRAIL);
 
        /* Power up the fast cluster non-CPU partition */
-       power_partition(C0NC, C0NCID);
+       power_partition(C0NC);
 
        /* Power up the fast cluster CPU0 partition */
-       power_partition(CE0, CE0ID);
+       power_partition(CE0);
 }
 
 void start_cpu(u32 reset_vector)
diff --git a/arch/arm/cpu/arm720t/tegra124/Makefile b/arch/arm/cpu/arm720t/tegra124/Makefile
new file mode 100644 (file)
index 0000000..61abf45
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2013-2014
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += cpu.o
diff --git a/arch/arm/cpu/arm720t/tegra124/config.mk b/arch/arm/cpu/arm720t/tegra124/config.mk
new file mode 100644 (file)
index 0000000..5e10701
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2010-2013
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#/
+USE_PRIVATE_LIBGCC = yes
diff --git a/arch/arm/cpu/arm720t/tegra124/cpu.c b/arch/arm/cpu/arm720t/tegra124/cpu.c
new file mode 100644 (file)
index 0000000..c03aaf1
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/ahb.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/flow.h>
+#include <asm/arch/pinmux.h>
+#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/pmc.h>
+#include <asm/arch-tegra/ap.h>
+#include "../tegra-common/cpu.h"
+
+/* Tegra124-specific CPU init code */
+
+static void enable_cpu_power_rail(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       debug("enable_cpu_power_rail entry\n");
+
+       /* un-tristate PWR_I2C SCL/SDA, rest of the defaults are correct */
+       pinmux_tristate_disable(PINGRP_PWR_I2C_SCL);
+       pinmux_tristate_disable(PINGRP_PWR_I2C_SDA);
+
+       pmic_enable_cpu_vdd();
+
+       /*
+        * Set CPUPWRGOOD_TIMER - APB clock is 1/2 of SCLK (102MHz),
+        * set it for 5ms as per SysEng (102MHz*5ms = 510000 (7C830h).
+        */
+       writel(0x7C830, &pmc->pmc_cpupwrgood_timer);
+
+       /* Set polarity to 0 (normal) and enable CPUPWRREQ_OE */
+       clrbits_le32(&pmc->pmc_cntrl, CPUPWRREQ_POL);
+       setbits_le32(&pmc->pmc_cntrl, CPUPWRREQ_OE);
+}
+
+static void enable_cpu_clocks(void)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg;
+
+       debug("enable_cpu_clocks entry\n");
+
+       /* Wait for PLL-X to lock */
+       do {
+               reg = readl(&clkrst->crc_pll_simple[SIMPLE_PLLX].pll_base);
+               debug("%s: PLLX base = 0x%08X\n", __func__, reg);
+       } while ((reg & PLL_LOCK_MASK) == 0);
+
+       debug("%s: PLLX locked, delay for stable clocks\n", __func__);
+       /* Wait until all clocks are stable */
+       udelay(PLL_STABILIZATION_DELAY);
+
+       debug("%s: Setting CCLK_BURST and DIVIDER\n", __func__);
+       writel(CCLK_BURST_POLICY, &clkrst->crc_cclk_brst_pol);
+       writel(SUPER_CCLK_DIVIDER, &clkrst->crc_super_cclk_div);
+
+       debug("%s: Enabling clock to all CPUs\n", __func__);
+       /* Enable the clock to all CPUs */
+       reg = CLR_CPU3_CLK_STP | CLR_CPU2_CLK_STP | CLR_CPU1_CLK_STP |
+               CLR_CPU0_CLK_STP;
+       writel(reg, &clkrst->crc_clk_cpu_cmplx_clr);
+
+       debug("%s: Enabling main CPU complex clocks\n", __func__);
+       /* Always enable the main CPU complex clocks */
+       clock_enable(PERIPH_ID_CPU);
+       clock_enable(PERIPH_ID_CPULP);
+       clock_enable(PERIPH_ID_CPUG);
+
+       debug("%s: Done\n", __func__);
+}
+
+static void remove_cpu_resets(void)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg;
+
+       debug("remove_cpu_resets entry\n");
+
+       /* Take the slow and fast partitions out of reset */
+       reg = CLR_NONCPURESET;
+       writel(reg, &clkrst->crc_rst_cpulp_cmplx_clr);
+       writel(reg, &clkrst->crc_rst_cpug_cmplx_clr);
+
+       /* Clear the SW-controlled reset of the slow cluster */
+       reg = CLR_CPURESET0 | CLR_DBGRESET0 | CLR_CORERESET0 | CLR_CXRESET0 |
+               CLR_L2RESET | CLR_PRESETDBG;
+       writel(reg, &clkrst->crc_rst_cpulp_cmplx_clr);
+
+       /* Clear the SW-controlled reset of the fast cluster */
+       reg = CLR_CPURESET0 | CLR_DBGRESET0 | CLR_CORERESET0 | CLR_CXRESET0 |
+               CLR_CPURESET1 | CLR_DBGRESET1 | CLR_CORERESET1 | CLR_CXRESET1 |
+               CLR_CPURESET2 | CLR_DBGRESET2 | CLR_CORERESET2 | CLR_CXRESET2 |
+               CLR_CPURESET3 | CLR_DBGRESET3 | CLR_CORERESET3 | CLR_CXRESET3 |
+               CLR_L2RESET | CLR_PRESETDBG;
+       writel(reg, &clkrst->crc_rst_cpug_cmplx_clr);
+}
+
+/**
+ * The Tegra124 requires some special clock initialization, including setting up
+ * the DVC I2C, turning on MSELECT and selecting the G CPU cluster
+ */
+void tegra124_init_clocks(void)
+{
+       struct flow_ctlr *flow = (struct flow_ctlr *)NV_PA_FLOW_BASE;
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       struct clk_rst_ctlr *clkrst =
+                       (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 val;
+
+       debug("tegra124_init_clocks entry\n");
+
+       /* Set active CPU cluster to G */
+       clrbits_le32(&flow->cluster_control, 1);
+
+       /* Change the oscillator drive strength */
+       val = readl(&clkrst->crc_osc_ctrl);
+       val &= ~OSC_XOFS_MASK;
+       val |= (OSC_DRIVE_STRENGTH << OSC_XOFS_SHIFT);
+       writel(val, &clkrst->crc_osc_ctrl);
+
+       /* Update same value in PMC_OSC_EDPD_OVER XOFS field for warmboot */
+       val = readl(&pmc->pmc_osc_edpd_over);
+       val &= ~PMC_XOFS_MASK;
+       val |= (OSC_DRIVE_STRENGTH << PMC_XOFS_SHIFT);
+       writel(val, &pmc->pmc_osc_edpd_over);
+
+       /* Set HOLD_CKE_LOW_EN to 1 */
+       setbits_le32(&pmc->pmc_cntrl2, HOLD_CKE_LOW_EN);
+
+       debug("Setting up PLLX\n");
+       init_pllx();
+
+       val = (1 << CLK_SYS_RATE_AHB_RATE_SHIFT);
+       writel(val, &clkrst->crc_clk_sys_rate);
+
+       /* Enable clocks to required peripherals. TBD - minimize this list */
+       debug("Enabling clocks\n");
+
+       clock_set_enable(PERIPH_ID_CACHE2, 1);
+       clock_set_enable(PERIPH_ID_GPIO, 1);
+       clock_set_enable(PERIPH_ID_TMR, 1);
+       clock_set_enable(PERIPH_ID_CPU, 1);
+       clock_set_enable(PERIPH_ID_EMC, 1);
+       clock_set_enable(PERIPH_ID_I2C5, 1);
+       clock_set_enable(PERIPH_ID_APBDMA, 1);
+       clock_set_enable(PERIPH_ID_MEM, 1);
+       clock_set_enable(PERIPH_ID_CORESIGHT, 1);
+       clock_set_enable(PERIPH_ID_MSELECT, 1);
+       clock_set_enable(PERIPH_ID_DVFS, 1);
+
+       /*
+        * Set MSELECT clock source as PLLP (00), and ask for a clock
+        * divider that would set the MSELECT clock at 102MHz for a
+        * PLLP base of 408MHz.
+        */
+       clock_ll_set_source_divisor(PERIPH_ID_MSELECT, 0,
+                                   CLK_DIVIDER(NVBL_PLLP_KHZ, 102000));
+
+       /* Give clock time to stabilize */
+       udelay(IO_STABILIZATION_DELAY);
+
+       /* I2C5 (DVC) gets CLK_M and a divisor of 17 */
+       clock_ll_set_source_divisor(PERIPH_ID_I2C5, 3, 16);
+
+       /* Give clock time to stabilize */
+       udelay(IO_STABILIZATION_DELAY);
+
+       /* Take required peripherals out of reset */
+       debug("Taking periphs out of reset\n");
+       reset_set_enable(PERIPH_ID_CACHE2, 0);
+       reset_set_enable(PERIPH_ID_GPIO, 0);
+       reset_set_enable(PERIPH_ID_TMR, 0);
+       reset_set_enable(PERIPH_ID_COP, 0);
+       reset_set_enable(PERIPH_ID_EMC, 0);
+       reset_set_enable(PERIPH_ID_I2C5, 0);
+       reset_set_enable(PERIPH_ID_APBDMA, 0);
+       reset_set_enable(PERIPH_ID_MEM, 0);
+       reset_set_enable(PERIPH_ID_CORESIGHT, 0);
+       reset_set_enable(PERIPH_ID_MSELECT, 0);
+       reset_set_enable(PERIPH_ID_DVFS, 0);
+
+       debug("tegra124_init_clocks exit\n");
+}
+
+static bool is_partition_powered(u32 partid)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       u32 reg;
+
+       /* Get power gate status */
+       reg = readl(&pmc->pmc_pwrgate_status);
+       return !!(reg & (1 << partid));
+}
+
+static void power_partition(u32 partid)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       debug("%s: part ID = %08X\n", __func__, partid);
+       /* Is the partition already on? */
+       if (!is_partition_powered(partid)) {
+               /* No, toggle the partition power state (OFF -> ON) */
+               debug("power_partition, toggling state\n");
+               writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);
+
+               /* Wait for the power to come up */
+               while (!is_partition_powered(partid))
+                       ;
+
+               /* Give I/O signals time to stabilize */
+               udelay(IO_STABILIZATION_DELAY);
+       }
+}
+
+void powerup_cpus(void)
+{
+       debug("powerup_cpus entry\n");
+
+       /* We boot to the fast cluster */
+       debug("powerup_cpus entry: G cluster\n");
+
+       /* Power up the fast cluster rail partition */
+       debug("powerup_cpus: CRAIL\n");
+       power_partition(CRAIL);
+
+       /* Power up the fast cluster non-CPU partition */
+       debug("powerup_cpus: C0NC\n");
+       power_partition(C0NC);
+
+       /* Power up the fast cluster CPU0 partition */
+       debug("powerup_cpus: CE0\n");
+       power_partition(CE0);
+
+       debug("powerup_cpus: done\n");
+}
+
+void start_cpu(u32 reset_vector)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       debug("start_cpu entry, reset_vector = %x\n", reset_vector);
+
+       tegra124_init_clocks();
+
+       /* Set power-gating timer multiplier */
+       clrbits_le32(&pmc->pmc_pwrgate_timer_mult, TIMER_MULT_MASK);
+       setbits_le32(&pmc->pmc_pwrgate_timer_mult, MULT_8);
+
+       enable_cpu_power_rail();
+       enable_cpu_clocks();
+       clock_enable_coresight(1);
+       remove_cpu_resets();
+       writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
+       powerup_cpus();
+       debug("start_cpu exit, should continue @ reset_vector\n");
+}
index e162357..a806483 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -84,18 +84,6 @@ void t30_init_clocks(void)
        /* Set active CPU cluster to G */
        clrbits_le32(flow->cluster_control, 1 << 0);
 
-       /*
-        * Switch system clock to PLLP_OUT4 (108 MHz), AVP will now run
-        * at 108 MHz. This is glitch free as only the source is changed, no
-        * special precaution needed.
-        */
-       val = (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_IRQ_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_RUN_SOURCE_SHIFT) |
-               (SCLK_SOURCE_PLLP_OUT4 << SCLK_SWAKEUP_IDLE_SOURCE_SHIFT) |
-               (SCLK_SYS_STATE_RUN << SCLK_SYS_STATE_SHIFT);
-       writel(val, &clkrst->crc_sclk_brst_pol);
-
        writel(SUPER_SCLK_ENB_MASK, &clkrst->crc_super_sclk_div);
 
        val = (0 << CLK_SYS_RATE_HCLK_DISABLE_SHIFT) |
index 4d9895f..f27ca15 100644 (file)
@@ -13,6 +13,6 @@ ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/SPL
 endif
 else
-ALL-y  += $(obj)u-boot.imx
+ALL-y  += u-boot.imx
 endif
 endif
index d5c978b..69e9d5a 100644 (file)
@@ -4,5 +4,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 ifndef CONFIG_SPL_BUILD
-ALL-$(CONFIG_SPL_FRAMEWORK)    += $(obj)u-boot.ais
+ALL-$(CONFIG_SPL_FRAMEWORK)    += u-boot.ais
 endif
index bd0a2fb..add9232 100644 (file)
@@ -5,5 +5,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  = timer.o cpuinfo.o
+obj-y  = timer.o
+obj-$(CONFIG_DISPLAY_CPUINFO) += cpuinfo.o
 obj-y  += reset.o
index 02332ee..587d99a 100644 (file)
@@ -13,7 +13,7 @@
 #include <command.h>
 #include <linux/compiler.h>
 
-#if defined(CONFIG_DISPLAY_CPUINFO) && defined(CONFIG_OMAP)
+#if defined(CONFIG_OMAP)
 
 #define omap_readw(x)          *(volatile unsigned short *)(x)
 #define omap_readl(x)          *(volatile unsigned long *)(x)
@@ -239,4 +239,4 @@ int print_cpuinfo (void)
        return 0;
 }
 
-#endif /* #if defined(CONFIG_DISPLAY_CPUINFO) && defined(CONFIG_OMAP) */
+#endif /* #if defined(CONFIG_OMAP) */
index 8e3668f..1c06fb4 100644 (file)
@@ -7,5 +7,5 @@ ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/MLO
 ALL-$(CONFIG_SPL_SPI_SUPPORT) += $(OBJTREE)/MLO.byteswap
 else
-ALL-y  += $(obj)u-boot.img
+ALL-y  += u-boot.img
 endif
index 38b7c40..d01f3d9 100644 (file)
@@ -20,6 +20,6 @@ ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/SPL
 endif
 else
-ALL-y  += $(obj)u-boot.imx
+ALL-y  += u-boot.imx
 endif
 endif
index 5bde9d1..1fea4d6 100644 (file)
@@ -26,7 +26,7 @@ struct clk_bit_info {
 };
 
 /* src_bit div_bit prediv_bit */
-static struct clk_bit_info clk_bit_info[PERIPH_ID_COUNT] = {
+static struct clk_bit_info clk_bit_info[] = {
        {0,     0,      -1},
        {4,     4,      -1},
        {8,     8,      -1},
@@ -870,7 +870,6 @@ static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
        struct exynos4_clock *clk =
                (struct exynos4_clock *)samsung_get_base_clock();
        unsigned int addr;
-       unsigned int val;
 
        /*
         * CLK_DIV_FSYS1
@@ -890,10 +889,8 @@ static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
                dev_index -= 2;
        }
 
-       val = readl(addr);
-       val &= ~(0xff << ((dev_index << 4) + 8));
-       val |= (div & 0xff) << ((dev_index << 4) + 8);
-       writel(val, addr);
+       clrsetbits_le32(addr, 0xff << ((dev_index << 4) + 8),
+                       (div & 0xff) << ((dev_index << 4) + 8));
 }
 
 /* exynos4x12: set the mmc clock */
@@ -902,7 +899,6 @@ static void exynos4x12_set_mmc_clk(int dev_index, unsigned int div)
        struct exynos4x12_clock *clk =
                (struct exynos4x12_clock *)samsung_get_base_clock();
        unsigned int addr;
-       unsigned int val;
 
        /*
         * CLK_DIV_FSYS1
@@ -917,10 +913,8 @@ static void exynos4x12_set_mmc_clk(int dev_index, unsigned int div)
                dev_index -= 2;
        }
 
-       val = readl(addr);
-       val &= ~(0xff << ((dev_index << 4) + 8));
-       val |= (div & 0xff) << ((dev_index << 4) + 8);
-       writel(val, addr);
+       clrsetbits_le32(addr, 0xff << ((dev_index << 4) + 8),
+                       (div & 0xff) << ((dev_index << 4) + 8));
 }
 
 /* exynos5: set the mmc clock */
@@ -929,7 +923,6 @@ 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
@@ -944,10 +937,8 @@ static void exynos5_set_mmc_clk(int dev_index, unsigned int div)
                dev_index -= 2;
        }
 
-       val = readl(addr);
-       val &= ~(0xff << ((dev_index << 4) + 8));
-       val |= (div & 0xff) << ((dev_index << 4) + 8);
-       writel(val, addr);
+       clrsetbits_le32(addr, 0xff << ((dev_index << 4) + 8),
+                       (div & 0xff) << ((dev_index << 4) + 8));
 }
 
 /* exynos5: set the mmc clock */
@@ -956,7 +947,7 @@ static void exynos5420_set_mmc_clk(int dev_index, unsigned int div)
        struct exynos5420_clock *clk =
                (struct exynos5420_clock *)samsung_get_base_clock();
        unsigned int addr;
-       unsigned int val, shift;
+       unsigned int shift;
 
        /*
         * CLK_DIV_FSYS1
@@ -967,10 +958,7 @@ static void exynos5420_set_mmc_clk(int dev_index, unsigned int div)
        addr = (unsigned int)&clk->div_fsys1;
        shift = dev_index * 10;
 
-       val = readl(addr);
-       val &= ~(0x3ff << shift);
-       val |= (div & 0x3ff) << shift;
-       writel(val, addr);
+       clrsetbits_le32(addr, 0x3ff << shift, (div & 0x3ff) << shift);
 }
 
 /* get_lcd_clk: return lcd clock frequency */
@@ -1061,7 +1049,6 @@ void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
            (struct exynos4_clock *)samsung_get_base_clock();
-       unsigned int cfg = 0;
 
        /*
         * CLK_GATE_BLOCK
@@ -1073,9 +1060,7 @@ void exynos4_set_lcd_clk(void)
         * CLK_LCD1     [5]
         * CLK_GPS      [7]
         */
-       cfg = readl(&clk->gate_block);
-       cfg |= 1 << 4;
-       writel(cfg, &clk->gate_block);
+       setbits_le32(&clk->gate_block, 1 << 4);
 
        /*
         * CLK_SRC_LCD0
@@ -1085,10 +1070,7 @@ void exynos4_set_lcd_clk(void)
         * MIPI0_SEL            [12:15]
         * set lcd0 src clock 0x6: SCLK_MPLL
         */
-       cfg = readl(&clk->src_lcd0);
-       cfg &= ~(0xf);
-       cfg |= 0x6;
-       writel(cfg, &clk->src_lcd0);
+       clrsetbits_le32(&clk->src_lcd0, 0xf, 0x6);
 
        /*
         * CLK_GATE_IP_LCD0
@@ -1100,9 +1082,7 @@ void exynos4_set_lcd_clk(void)
         * CLK_PPMULCD0         [5]
         * Gating all clocks for FIMD0
         */
-       cfg = readl(&clk->gate_ip_lcd0);
-       cfg |= 1 << 0;
-       writel(cfg, &clk->gate_ip_lcd0);
+       setbits_le32(&clk->gate_ip_lcd0, 1 << 0);
 
        /*
         * CLK_DIV_LCD0
@@ -1114,16 +1094,13 @@ void exynos4_set_lcd_clk(void)
         * MIPI0_PRE_RATIO      [23:20]
         * set fimd ratio
         */
-       cfg &= ~(0xf);
-       cfg |= 0x1;
-       writel(cfg, &clk->div_lcd0);
+       clrsetbits_le32(&clk->div_lcd0, 0xf, 0x1);
 }
 
 void exynos5_set_lcd_clk(void)
 {
        struct exynos5_clock *clk =
            (struct exynos5_clock *)samsung_get_base_clock();
-       unsigned int cfg = 0;
 
        /*
         * CLK_GATE_BLOCK
@@ -1135,9 +1112,7 @@ void exynos5_set_lcd_clk(void)
         * CLK_LCD1     [5]
         * CLK_GPS      [7]
         */
-       cfg = readl(&clk->gate_block);
-       cfg |= 1 << 4;
-       writel(cfg, &clk->gate_block);
+       setbits_le32(&clk->gate_block, 1 << 4);
 
        /*
         * CLK_SRC_LCD0
@@ -1147,10 +1122,7 @@ void exynos5_set_lcd_clk(void)
         * MIPI0_SEL            [12:15]
         * set lcd0 src clock 0x6: SCLK_MPLL
         */
-       cfg = readl(&clk->src_disp1_0);
-       cfg &= ~(0xf);
-       cfg |= 0x6;
-       writel(cfg, &clk->src_disp1_0);
+       clrsetbits_le32(&clk->src_disp1_0, 0xf, 0x6);
 
        /*
         * CLK_GATE_IP_LCD0
@@ -1162,9 +1134,7 @@ void exynos5_set_lcd_clk(void)
         * CLK_PPMULCD0         [5]
         * Gating all clocks for FIMD0
         */
-       cfg = readl(&clk->gate_ip_disp1);
-       cfg |= 1 << 0;
-       writel(cfg, &clk->gate_ip_disp1);
+       setbits_le32(&clk->gate_ip_disp1, 1 << 0);
 
        /*
         * CLK_DIV_LCD0
@@ -1176,16 +1146,13 @@ void exynos5_set_lcd_clk(void)
         * MIPI0_PRE_RATIO      [23:20]
         * set fimd ratio
         */
-       cfg &= ~(0xf);
-       cfg |= 0x0;
-       writel(cfg, &clk->div_disp1_0);
+       clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
 void exynos4_set_mipi_clk(void)
 {
        struct exynos4_clock *clk =
            (struct exynos4_clock *)samsung_get_base_clock();
-       unsigned int cfg = 0;
 
        /*
         * CLK_SRC_LCD0
@@ -1195,10 +1162,7 @@ void exynos4_set_mipi_clk(void)
         * MIPI0_SEL            [12:15]
         * set mipi0 src clock 0x6: SCLK_MPLL
         */
-       cfg = readl(&clk->src_lcd0);
-       cfg &= ~(0xf << 12);
-       cfg |= (0x6 << 12);
-       writel(cfg, &clk->src_lcd0);
+       clrsetbits_le32(&clk->src_lcd0, 0xf << 12, 0x6 << 12);
 
        /*
         * CLK_SRC_MASK_LCD0
@@ -1208,9 +1172,7 @@ void exynos4_set_mipi_clk(void)
         * MIPI0_MASK           [12]
         * set src mask mipi0 0x1: Unmask
         */
-       cfg = readl(&clk->src_mask_lcd0);
-       cfg |= (0x1 << 12);
-       writel(cfg, &clk->src_mask_lcd0);
+       setbits_le32(&clk->src_mask_lcd0, 0x1 << 12);
 
        /*
         * CLK_GATE_IP_LCD0
@@ -1222,9 +1184,7 @@ void exynos4_set_mipi_clk(void)
         * CLK_PPMULCD0         [5]
         * Gating all clocks for MIPI0
         */
-       cfg = readl(&clk->gate_ip_lcd0);
-       cfg |= 1 << 3;
-       writel(cfg, &clk->gate_ip_lcd0);
+       setbits_le32(&clk->gate_ip_lcd0, 1 << 3);
 
        /*
         * CLK_DIV_LCD0
@@ -1236,9 +1196,7 @@ void exynos4_set_mipi_clk(void)
         * MIPI0_PRE_RATIO      [23:20]
         * set mipi ratio
         */
-       cfg &= ~(0xf << 16);
-       cfg |= (0x1 << 16);
-       writel(cfg, &clk->div_lcd0);
+       clrsetbits_le32(&clk->div_lcd0, 0xf << 16, 0x1 << 16);
 }
 
 /*
index 904177a..645c497 100644 (file)
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
        if (err)
                return PERIPH_ID_NONE;
 
-       /* check for invalid peripheral id */
-       if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-               return cell[1];
-
-       debug(" invalid peripheral id\n");
-       return PERIPH_ID_NONE;
+       return cell[1];
 }
 
 int pinmux_decode_periph_id(const void *blob, int node)
index 5617a41..bd65a08 100644 (file)
@@ -409,20 +409,15 @@ u32 imx_get_uartclk(void)
 
 u32 imx_get_fecclk(void)
 {
-       return decode_pll(PLL_ENET, MXC_HCLK);
+       return mxc_get_clock(MXC_IPG_CLK);
 }
 
-int enable_sata_clock(void)
+static int enable_enet_pll(uint32_t en)
 {
-       u32 reg = 0;
-       s32 timeout = 100000;
        struct mxc_ccm_reg *const imx_ccm
                = (struct mxc_ccm_reg *) CCM_BASE_ADDR;
-
-       /* Enable sata clock */
-       reg = readl(&imx_ccm->CCGR5); /* CCGR5 */
-       reg |= MXC_CCM_CCGR5_SATA_MASK;
-       writel(reg, &imx_ccm->CCGR5);
+       s32 timeout = 100000;
+       u32 reg = 0;
 
        /* Enable PLLs */
        reg = readl(&imx_ccm->analog_pll_enet);
@@ -437,10 +432,70 @@ int enable_sata_clock(void)
                return -EIO;
        reg &= ~BM_ANADIG_PLL_SYS_BYPASS;
        writel(reg, &imx_ccm->analog_pll_enet);
-       reg |= BM_ANADIG_PLL_ENET_ENABLE_SATA;
+       reg |= en;
        writel(reg, &imx_ccm->analog_pll_enet);
+       return 0;
+}
 
-       return 0 ;
+static void ungate_sata_clock(void)
+{
+       struct mxc_ccm_reg *const imx_ccm =
+               (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+       /* Enable SATA clock. */
+       setbits_le32(&imx_ccm->CCGR5, MXC_CCM_CCGR5_SATA_MASK);
+}
+
+static void ungate_pcie_clock(void)
+{
+       struct mxc_ccm_reg *const imx_ccm =
+               (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+       /* Enable PCIe clock. */
+       setbits_le32(&imx_ccm->CCGR4, MXC_CCM_CCGR4_PCIE_MASK);
+}
+
+int enable_sata_clock(void)
+{
+       ungate_sata_clock();
+       return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA);
+}
+
+int enable_pcie_clock(void)
+{
+       struct anatop_regs *anatop_regs =
+               (struct anatop_regs *)ANATOP_BASE_ADDR;
+       struct mxc_ccm_reg *ccm_regs = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+       /*
+        * Here be dragons!
+        *
+        * The register ANATOP_MISC1 is not documented in the Freescale
+        * MX6RM. The register that is mapped in the ANATOP space and
+        * marked as ANATOP_MISC1 is actually documented in the PMU section
+        * of the datasheet as PMU_MISC1.
+        *
+        * Switch LVDS clock source to SATA (0xb), disable clock INPUT and
+        * enable clock OUTPUT. This is important for PCI express link that
+        * is clocked from the i.MX6.
+        */
+#define ANADIG_ANA_MISC1_LVDSCLK1_IBEN         (1 << 12)
+#define ANADIG_ANA_MISC1_LVDSCLK1_OBEN         (1 << 10)
+#define ANADIG_ANA_MISC1_LVDS1_CLK_SEL_MASK    0x0000001F
+       clrsetbits_le32(&anatop_regs->ana_misc1,
+                       ANADIG_ANA_MISC1_LVDSCLK1_IBEN |
+                       ANADIG_ANA_MISC1_LVDS1_CLK_SEL_MASK,
+                       ANADIG_ANA_MISC1_LVDSCLK1_OBEN | 0xb);
+
+       /* PCIe reference clock sourced from AXI. */
+       clrbits_le32(&ccm_regs->cbcmr, MXC_CCM_CBCMR_PCIE_AXI_CLK_SEL);
+
+       /* Party time! Ungate the clock to the PCIe. */
+       ungate_sata_clock();
+       ungate_pcie_clock();
+
+       return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA |
+                              BM_ANADIG_PLL_ENET_ENABLE_PCIE);
 }
 
 unsigned int mxc_get_clock(enum mxc_clock clk)
index 0208cba..1725279 100644 (file)
@@ -8,6 +8,8 @@
  */
 
 #include <common.h>
+#include <asm/armv7.h>
+#include <asm/pl310.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
@@ -41,14 +43,19 @@ u32 get_cpu_rev(void)
 
        if (type != MXC_CPU_MX6SL) {
                reg = readl(&anatop->digprog);
+               struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
+               u32 cfg = readl(&scu->config) & 3;
                type = ((reg >> 16) & 0xff);
                if (type == MXC_CPU_MX6DL) {
-                       struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
-                       u32 cfg = readl(&scu->config) & 3;
-
                        if (!cfg)
                                type = MXC_CPU_MX6SOLO;
                }
+
+               if (type == MXC_CPU_MX6Q) {
+                       if (cfg == 1)
+                               type = MXC_CPU_MX6D;
+               }
+
        }
        reg &= 0xff;            /* mx6 silicon revision */
        return (type << 12) | (reg + 0x10);
@@ -62,6 +69,9 @@ u32 __weak get_board_rev(void)
        if (type == MXC_CPU_MX6SOLO)
                cpurev = (MXC_CPU_MX6DL) << 12 | (cpurev & 0xFFF);
 
+       if (type == MXC_CPU_MX6D)
+               cpurev = (MXC_CPU_MX6Q) << 12 | (cpurev & 0xFFF);
+
        return cpurev;
 }
 #endif
@@ -177,10 +187,41 @@ static void imx_set_wdog_powerdown(bool enable)
        writew(enable, &wdog2->wmcr);
 }
 
+static void set_ahb_rate(u32 val)
+{
+       struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+       u32 reg, div;
+
+       div = get_periph_clk() / val - 1;
+       reg = readl(&mxc_ccm->cbcdr);
+
+       writel((reg & (~MXC_CCM_CBCDR_AHB_PODF_MASK)) |
+               (div << MXC_CCM_CBCDR_AHB_PODF_OFFSET), &mxc_ccm->cbcdr);
+}
+
+static void clear_mmdc_ch_mask(void)
+{
+       struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+       /* Clear MMDC channel mask */
+       writel(0, &mxc_ccm->ccdr);
+}
+
 int arch_cpu_init(void)
 {
        init_aips();
 
+       /* Need to clear MMDC_CHx_MASK to make warm reset work. */
+       clear_mmdc_ch_mask();
+
+       /*
+        * When low freq boot is enabled, ROM will not set AHB
+        * freq, so we need to ensure AHB freq is 132MHz in such
+        * scenario.
+        */
+       if (mxc_get_clock(MXC_ARM_CLK) == 396000000)
+               set_ahb_rate(132000000);
+
        imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
 
 #ifdef CONFIG_APBH_DMA
@@ -336,3 +377,59 @@ void imx_setup_hdmi(void)
        writel(reg, &mxc_ccm->chsccdr);
 }
 #endif
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define IOMUXC_GPR11_L2CACHE_AS_OCRAM 0x00000002
+void v7_outer_cache_enable(void)
+{
+       struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
+       unsigned int val;
+
+#if defined CONFIG_MX6SL
+       struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
+       val = readl(&iomux->gpr[11]);
+       if (val & IOMUXC_GPR11_L2CACHE_AS_OCRAM) {
+               /* L2 cache configured as OCRAM, reset it */
+               val &= ~IOMUXC_GPR11_L2CACHE_AS_OCRAM;
+               writel(val, &iomux->gpr[11]);
+       }
+#endif
+
+       writel(0x132, &pl310->pl310_tag_latency_ctrl);
+       writel(0x132, &pl310->pl310_data_latency_ctrl);
+
+       val = readl(&pl310->pl310_prefetch_ctrl);
+
+       /* Turn on the L2 I/D prefetch */
+       val |= 0x30000000;
+
+       /*
+        * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
+        * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
+        * But according to ARM PL310 errata: 752271
+        * ID: 752271: Double linefill feature can cause data corruption
+        * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
+        * Workaround: The only workaround to this erratum is to disable the
+        * double linefill feature. This is the default behavior.
+        */
+
+#ifndef CONFIG_MX6Q
+       val |= 0x40800000;
+#endif
+       writel(val, &pl310->pl310_prefetch_ctrl);
+
+       val = readl(&pl310->pl310_power_ctrl);
+       val |= L2X0_DYNAMIC_CLK_GATING_EN;
+       val |= L2X0_STNDBY_MODE_EN;
+       writel(val, &pl310->pl310_power_ctrl);
+
+       setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+}
+
+void v7_outer_cache_disable(void)
+{
+       struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
+
+       clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+}
+#endif /* !CONFIG_SYS_L2CACHE_OFF */
index 69fff32..52e0f4a 100644 (file)
@@ -66,7 +66,18 @@ u32 spl_boot_device(void)
 
 u32 spl_boot_mode(void)
 {
-       return gd->arch.omap_boot_params.omap_bootmode;
+       u32 val = gd->arch.omap_boot_params.omap_bootmode;
+
+       if (val == MMCSD_MODE_RAW)
+               return MMCSD_MODE_RAW;
+       else if (val == MMCSD_MODE_FAT)
+               return MMCSD_MODE_FAT;
+       else
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+               return MMCSD_MODE_EMMCBOOT;
+#else
+               return MMCSD_MODE_UNDEFINED;
+#endif
 }
 
 void spl_board_init(void)
index dfa3760..8e7411d 100644 (file)
@@ -418,55 +418,6 @@ static void setup_dplls(void)
 #endif
 }
 
-#ifdef CONFIG_SYS_CLOCKS_ENABLE_ALL
-static void setup_non_essential_dplls(void)
-{
-       u32 abe_ref_clk;
-       const struct dpll_params *params;
-
-       /* IVA */
-       clrsetbits_le32((*prcm)->cm_bypclk_dpll_iva,
-               CM_BYPCLK_DPLL_IVA_CLKSEL_MASK, DPLL_IVA_CLKSEL_CORE_X2_DIV_2);
-
-       params = get_iva_dpll_params(*dplls_data);
-       do_setup_dpll((*prcm)->cm_clkmode_dpll_iva, params, DPLL_LOCK, "iva");
-
-       /* Configure ABE dpll */
-       params = get_abe_dpll_params(*dplls_data);
-#ifdef CONFIG_SYS_OMAP_ABE_SYSCK
-       abe_ref_clk = CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK;
-
-       if (omap_revision() == DRA752_ES1_0)
-               /* Select the sys clk for dpll_abe */
-               clrsetbits_le32((*prcm)->cm_abe_pll_sys_clksel,
-                               CM_CLKSEL_ABE_PLL_SYS_CLKSEL_MASK,
-                               CM_ABE_PLL_SYS_CLKSEL_SYSCLK2);
-#else
-       abe_ref_clk = CM_ABE_PLL_REF_CLKSEL_CLKSEL_32KCLK;
-       /*
-        * We need to enable some additional options to achieve
-        * 196.608MHz from 32768 Hz
-        */
-       setbits_le32((*prcm)->cm_clkmode_dpll_abe,
-                       CM_CLKMODE_DPLL_DRIFTGUARD_EN_MASK|
-                       CM_CLKMODE_DPLL_RELOCK_RAMP_EN_MASK|
-                       CM_CLKMODE_DPLL_LPMODE_EN_MASK|
-                       CM_CLKMODE_DPLL_REGM4XEN_MASK);
-       /* Spend 4 REFCLK cycles at each stage */
-       clrsetbits_le32((*prcm)->cm_clkmode_dpll_abe,
-                       CM_CLKMODE_DPLL_RAMP_RATE_MASK,
-                       1 << CM_CLKMODE_DPLL_RAMP_RATE_SHIFT);
-#endif
-
-       /* Select the right reference clk */
-       clrsetbits_le32((*prcm)->cm_abe_pll_ref_clksel,
-                       CM_ABE_PLL_REF_CLKSEL_CLKSEL_MASK,
-                       abe_ref_clk << CM_ABE_PLL_REF_CLKSEL_CLKSEL_SHIFT);
-       /* Lock the dpll */
-       do_setup_dpll((*prcm)->cm_clkmode_dpll_abe, params, DPLL_LOCK, "abe");
-}
-#endif
-
 u32 get_offset_code(u32 volt_offset, struct pmic_data *pmic)
 {
        u32 offset_code;
@@ -760,10 +711,6 @@ void prcm_init(void)
                timer_init();
                scale_vcores(*omap_vcores);
                setup_dplls();
-#ifdef CONFIG_SYS_CLOCKS_ENABLE_ALL
-               setup_non_essential_dplls();
-               enable_non_essential_clocks();
-#endif
                setup_warmreset_time();
                break;
        default:
index cd6289b..429c4be 100644 (file)
@@ -179,8 +179,7 @@ void emif_update_timings(u32 base, const struct emif_regs *regs)
        writel(regs->temp_alert_config, &emif->emif_temp_alert_config);
        writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw);
 
-       if ((omap_revision() >= OMAP5430_ES1_0) ||
-                               (omap_revision() == DRA752_ES1_0)) {
+       if ((omap_revision() >= OMAP5430_ES1_0) || is_dra7xx()) {
                writel(EMIF_L3_CONFIG_VAL_SYS_10_MPU_5_LL_0,
                        &emif->emif_l3_config);
        } else if (omap_revision() >= OMAP4460_ES1_0) {
@@ -309,7 +308,7 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
         * The same sequence should work on OMAP5432 as well. But strange that
         * it is not working
         */
-       if (omap_revision() == DRA752_ES1_0) {
+       if (is_dra7xx()) {
                do_ext_phy_settings(base, regs);
                writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
                writel(regs->sdram_config_init, &emif->emif_sdram_config);
index 85d3754..ade744e 100644 (file)
@@ -43,16 +43,10 @@ static void set_mux_conf_regs(void)
                set_muxconf_regs_essential();
                break;
        case OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL:
-#ifdef CONFIG_SYS_ENABLE_PADS_ALL
-               set_muxconf_regs_non_essential();
-#endif
                break;
        case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR:
        case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH:
                set_muxconf_regs_essential();
-#ifdef CONFIG_SYS_ENABLE_PADS_ALL
-               set_muxconf_regs_non_essential();
-#endif
                break;
        }
 }
@@ -254,6 +248,7 @@ u32 get_device_type(void)
                                      (DEVICE_TYPE_MASK)) >> DEVICE_TYPE_SHIFT;
 }
 
+#if defined(CONFIG_DISPLAY_CPUINFO)
 /*
  * Print CPU information
  */
@@ -264,6 +259,8 @@ int print_cpuinfo(void)
 
        return 0;
 }
+#endif
+
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
index f5468c4..cad4fee 100644 (file)
@@ -12,6 +12,7 @@
 #include <scsi.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sata.h>
+#include <sata.h>
 #include <asm/io.h>
 #include "pipe3-phy.h"
 
@@ -31,7 +32,7 @@ struct omap_pipe3 sata_phy = {
        .dpll_map = dpll_map_sata,
 };
 
-int omap_sata_init(void)
+int init_sata(int dev)
 {
        int ret;
        u32 val;
index 1d6a57c..2a3d1c5 100644 (file)
@@ -11,5 +11,5 @@
 ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/MLO
 else
-ALL-y  += $(obj)u-boot.img
+ALL-y  += u-boot.img
 endif
index 1d6a57c..2a3d1c5 100644 (file)
@@ -11,5 +11,5 @@
 ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/MLO
 else
-ALL-y  += $(obj)u-boot.img
+ALL-y  += u-boot.img
 endif
index 1b2f439..4dec73e 100644 (file)
@@ -399,91 +399,6 @@ void enable_basic_uboot_clocks(void)
                         1);
 }
 
-/*
- * Enable non-essential clock domains, modules and
- * do some additional special settings needed
- */
-void enable_non_essential_clocks(void)
-{
-       u32 const clk_domains_non_essential[] = {
-               (*prcm)->cm_mpu_m3_clkstctrl,
-               (*prcm)->cm_ivahd_clkstctrl,
-               (*prcm)->cm_dsp_clkstctrl,
-               (*prcm)->cm_dss_clkstctrl,
-               (*prcm)->cm_sgx_clkstctrl,
-               (*prcm)->cm1_abe_clkstctrl,
-               (*prcm)->cm_c2c_clkstctrl,
-               (*prcm)->cm_cam_clkstctrl,
-               (*prcm)->cm_dss_clkstctrl,
-               (*prcm)->cm_sdma_clkstctrl,
-               0
-       };
-
-       u32 const clk_modules_hw_auto_non_essential[] = {
-               (*prcm)->cm_l3instr_l3_3_clkctrl,
-               (*prcm)->cm_l3instr_l3_instr_clkctrl,
-               (*prcm)->cm_l3instr_intrconn_wp1_clkctrl,
-               (*prcm)->cm_l3init_hsi_clkctrl,
-               0
-       };
-
-       u32 const clk_modules_explicit_en_non_essential[] = {
-               (*prcm)->cm1_abe_aess_clkctrl,
-               (*prcm)->cm1_abe_pdm_clkctrl,
-               (*prcm)->cm1_abe_dmic_clkctrl,
-               (*prcm)->cm1_abe_mcasp_clkctrl,
-               (*prcm)->cm1_abe_mcbsp1_clkctrl,
-               (*prcm)->cm1_abe_mcbsp2_clkctrl,
-               (*prcm)->cm1_abe_mcbsp3_clkctrl,
-               (*prcm)->cm1_abe_slimbus_clkctrl,
-               (*prcm)->cm1_abe_timer5_clkctrl,
-               (*prcm)->cm1_abe_timer6_clkctrl,
-               (*prcm)->cm1_abe_timer7_clkctrl,
-               (*prcm)->cm1_abe_timer8_clkctrl,
-               (*prcm)->cm1_abe_wdt3_clkctrl,
-               (*prcm)->cm_l4per_gptimer9_clkctrl,
-               (*prcm)->cm_l4per_gptimer10_clkctrl,
-               (*prcm)->cm_l4per_gptimer11_clkctrl,
-               (*prcm)->cm_l4per_gptimer3_clkctrl,
-               (*prcm)->cm_l4per_gptimer4_clkctrl,
-               (*prcm)->cm_l4per_hdq1w_clkctrl,
-               (*prcm)->cm_l4per_mcbsp4_clkctrl,
-               (*prcm)->cm_l4per_mcspi2_clkctrl,
-               (*prcm)->cm_l4per_mcspi3_clkctrl,
-               (*prcm)->cm_l4per_mcspi4_clkctrl,
-               (*prcm)->cm_l4per_mmcsd3_clkctrl,
-               (*prcm)->cm_l4per_mmcsd4_clkctrl,
-               (*prcm)->cm_l4per_mmcsd5_clkctrl,
-               (*prcm)->cm_l4per_uart1_clkctrl,
-               (*prcm)->cm_l4per_uart2_clkctrl,
-               (*prcm)->cm_l4per_uart4_clkctrl,
-               (*prcm)->cm_wkup_keyboard_clkctrl,
-               (*prcm)->cm_wkup_wdtimer2_clkctrl,
-               (*prcm)->cm_cam_iss_clkctrl,
-               (*prcm)->cm_cam_fdif_clkctrl,
-               (*prcm)->cm_dss_dss_clkctrl,
-               (*prcm)->cm_sgx_sgx_clkctrl,
-               0
-       };
-
-       /* Enable optional functional clock for ISS */
-       setbits_le32((*prcm)->cm_cam_iss_clkctrl, ISS_CLKCTRL_OPTFCLKEN_MASK);
-
-       /* Enable all optional functional clocks of DSS */
-       setbits_le32((*prcm)->cm_dss_dss_clkctrl, DSS_CLKCTRL_OPTFCLKEN_MASK);
-
-       do_enable_clocks(clk_domains_non_essential,
-                        clk_modules_hw_auto_non_essential,
-                        clk_modules_explicit_en_non_essential,
-                        0);
-
-       /* Put camera module in no sleep mode */
-       clrsetbits_le32((*prcm)->cm_cam_clkstctrl,
-                       MODULE_CLKCTRL_MODULEMODE_MASK,
-                       CD_CLKCTRL_CLKTRCTRL_NO_SLEEP <<
-                       MODULE_CLKCTRL_MODULEMODE_SHIFT);
-}
-
 void hw_data_init(void)
 {
        u32 omap_rev = omap_revision();
index 31b6795..3bf8897 100644 (file)
 s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb)
 {
        u32 vset;
+       u32 fuse_enable_mask = OMAP5_ABB_FUSE_ENABLE_MASK;
+       u32 fuse_vset_mask = OMAP5_ABB_FUSE_VSET_MASK;
 
+       if (!is_omap54xx()) {
+               /* DRA7 */
+               fuse_enable_mask = DRA7_ABB_FUSE_ENABLE_MASK;
+               fuse_vset_mask = DRA7_ABB_FUSE_VSET_MASK;
+       }
        /*
         * ABB parameters must be properly fused
         * otherwise ABB should be disabled
         */
        vset = readl(fuse);
-       if (!(vset & OMAP5_ABB_FUSE_ENABLE_MASK))
+       if (!(vset & fuse_enable_mask))
                return -1;
 
        /* prepare VSET value for LDOVBB mux register */
-       vset &= OMAP5_ABB_FUSE_VSET_MASK;
-       vset >>= ffs(OMAP5_ABB_FUSE_VSET_MASK) - 1;
+       vset &= fuse_vset_mask;
+       vset >>= ffs(fuse_vset_mask) - 1;
        vset <<= ffs(OMAP5_ABB_LDOVBBMPU_VSET_OUT_MASK) - 1;
        vset |= OMAP5_ABB_LDOVBBMPU_MUX_CTRL_MASK;
 
index 2673af9..261b272 100644 (file)
@@ -9,5 +9,5 @@
 ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/MLO
 else
-ALL-y  += $(obj)u-boot.img
+ALL-y  += u-boot.img
 endif
index 5268a1f..ad97132 100644 (file)
@@ -486,94 +486,6 @@ void enable_basic_uboot_clocks(void)
                         1);
 }
 
-/*
- * Enable non-essential clock domains, modules and
- * do some additional special settings needed
- */
-void enable_non_essential_clocks(void)
-{
-       u32 const clk_domains_non_essential[] = {
-               (*prcm)->cm_mpu_m3_clkstctrl,
-               (*prcm)->cm_ivahd_clkstctrl,
-               (*prcm)->cm_dsp_clkstctrl,
-               (*prcm)->cm_dss_clkstctrl,
-               (*prcm)->cm_sgx_clkstctrl,
-               (*prcm)->cm1_abe_clkstctrl,
-               (*prcm)->cm_c2c_clkstctrl,
-               (*prcm)->cm_cam_clkstctrl,
-               (*prcm)->cm_dss_clkstctrl,
-               (*prcm)->cm_sdma_clkstctrl,
-               0
-       };
-
-       u32 const clk_modules_hw_auto_non_essential[] = {
-               (*prcm)->cm_mpu_m3_mpu_m3_clkctrl,
-               (*prcm)->cm_ivahd_ivahd_clkctrl,
-               (*prcm)->cm_ivahd_sl2_clkctrl,
-               (*prcm)->cm_dsp_dsp_clkctrl,
-               (*prcm)->cm_l3instr_l3_3_clkctrl,
-               (*prcm)->cm_l3instr_l3_instr_clkctrl,
-               (*prcm)->cm_l3instr_intrconn_wp1_clkctrl,
-               (*prcm)->cm_l3init_hsi_clkctrl,
-               (*prcm)->cm_l4per_hdq1w_clkctrl,
-               0
-       };
-
-       u32 const clk_modules_explicit_en_non_essential[] = {
-               (*prcm)->cm1_abe_aess_clkctrl,
-               (*prcm)->cm1_abe_pdm_clkctrl,
-               (*prcm)->cm1_abe_dmic_clkctrl,
-               (*prcm)->cm1_abe_mcasp_clkctrl,
-               (*prcm)->cm1_abe_mcbsp1_clkctrl,
-               (*prcm)->cm1_abe_mcbsp2_clkctrl,
-               (*prcm)->cm1_abe_mcbsp3_clkctrl,
-               (*prcm)->cm1_abe_slimbus_clkctrl,
-               (*prcm)->cm1_abe_timer5_clkctrl,
-               (*prcm)->cm1_abe_timer6_clkctrl,
-               (*prcm)->cm1_abe_timer7_clkctrl,
-               (*prcm)->cm1_abe_timer8_clkctrl,
-               (*prcm)->cm1_abe_wdt3_clkctrl,
-               (*prcm)->cm_l4per_gptimer9_clkctrl,
-               (*prcm)->cm_l4per_gptimer10_clkctrl,
-               (*prcm)->cm_l4per_gptimer11_clkctrl,
-               (*prcm)->cm_l4per_gptimer3_clkctrl,
-               (*prcm)->cm_l4per_gptimer4_clkctrl,
-               (*prcm)->cm_l4per_mcspi2_clkctrl,
-               (*prcm)->cm_l4per_mcspi3_clkctrl,
-               (*prcm)->cm_l4per_mcspi4_clkctrl,
-               (*prcm)->cm_l4per_mmcsd3_clkctrl,
-               (*prcm)->cm_l4per_mmcsd4_clkctrl,
-               (*prcm)->cm_l4per_mmcsd5_clkctrl,
-               (*prcm)->cm_l4per_uart1_clkctrl,
-               (*prcm)->cm_l4per_uart2_clkctrl,
-               (*prcm)->cm_l4per_uart4_clkctrl,
-               (*prcm)->cm_wkup_keyboard_clkctrl,
-               (*prcm)->cm_wkup_wdtimer2_clkctrl,
-               (*prcm)->cm_cam_iss_clkctrl,
-               (*prcm)->cm_cam_fdif_clkctrl,
-               (*prcm)->cm_dss_dss_clkctrl,
-               (*prcm)->cm_sgx_sgx_clkctrl,
-               0
-       };
-
-       /* Enable optional functional clock for ISS */
-       setbits_le32((*prcm)->cm_cam_iss_clkctrl, ISS_CLKCTRL_OPTFCLKEN_MASK);
-
-       /* Enable all optional functional clocks of DSS */
-       setbits_le32((*prcm)->cm_dss_dss_clkctrl, DSS_CLKCTRL_OPTFCLKEN_MASK);
-
-       do_enable_clocks(clk_domains_non_essential,
-                        clk_modules_hw_auto_non_essential,
-                        clk_modules_explicit_en_non_essential,
-                        0);
-
-       /* Put camera module in no sleep mode */
-       clrsetbits_le32((*prcm)->cm_cam_clkstctrl,
-                       MODULE_CLKCTRL_MODULEMODE_MASK,
-                       CD_CLKCTRL_CLKTRCTRL_NO_SLEEP <<
-                       MODULE_CLKCTRL_MODULEMODE_SHIFT);
-}
-
 const struct ctrl_ioregs ioregs_omap5430 = {
        .ctrl_ddrch = DDR_IO_I_34OHM_SR_FASTEST_WD_DQ_NO_PULL_DQS_PULL_DOWN,
        .ctrl_lpddr2ch = DDR_IO_I_34OHM_SR_FASTEST_WD_CK_CKE_NCS_CA_PULL_DOWN,
@@ -639,6 +551,7 @@ void hw_data_init(void)
        break;
 
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
        *prcm = &dra7xx_prcm;
        *dplls_data = &dra7xx_dplls;
        *omap_vcores = &dra752_volts;
@@ -666,6 +579,7 @@ void get_ioregs(const struct ctrl_ioregs **regs)
                *regs = &ioregs_omap5432_es2;
                break;
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
                *regs = &ioregs_dra7xx_es1;
                break;
 
index 5386ae0..737d23c 100644 (file)
@@ -333,6 +333,9 @@ void init_omap_revision(void)
        case DRA752_CONTROL_ID_CODE_ES1_0:
                *omap_si_rev = DRA752_ES1_0;
                break;
+       case DRA752_CONTROL_ID_CODE_ES1_1:
+               *omap_si_rev = DRA752_ES1_1;
+               break;
        default:
                *omap_si_rev = OMAP5430_SILICON_ID_INVALID;
        }
index 77c428b..ff32807 100644 (file)
@@ -432,11 +432,13 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
        .control_srcomp_code_latch              = 0x4A002E84,
        .control_ddr_control_ext_0              = 0x4A002E88,
        .control_padconf_core_base              = 0x4A003400,
+       .control_std_fuse_opp_vdd_mpu_2         = 0x4A003B24,
        .control_port_emif1_sdram_config        = 0x4AE0C110,
        .control_port_emif1_lpddr2_nvm_config   = 0x4AE0C114,
        .control_port_emif2_sdram_config        = 0x4AE0C118,
        .control_emif1_sdram_config_ext         = 0x4AE0C144,
        .control_emif2_sdram_config_ext         = 0x4AE0C148,
+       .control_wkup_ldovbb_mpu_voltage_ctrl   = 0x4AE0C158,
        .control_padconf_mode                   = 0x4AE0C5A0,
        .control_xtal_oscillator                = 0x4AE0C5A4,
        .control_i2c_2                          = 0x4AE0C5A8,
@@ -807,6 +809,9 @@ struct prcm_regs const dra7xx_prcm = {
        .cm_dsp_clkstctrl                       = 0x4a005400,
        .cm_dsp_dsp_clkctrl                     = 0x4a005420,
 
+       /* prm irqstatus regs */
+       .prm_irqstatus_mpu_2                    = 0x4ae06014,
+
        /* cm2.ckgen */
        .cm_clksel_usb_60mhz                    = 0x4a008104,
        .cm_clkmode_dpll_per                    = 0x4a008140,
@@ -967,4 +972,7 @@ struct prcm_regs const dra7xx_prcm = {
        .prm_vc_val_bypass                      = 0x4ae07da0,
        .prm_vc_cfg_i2c_mode                    = 0x4ae07db4,
        .prm_vc_cfg_i2c_clk                     = 0x4ae07db8,
+
+       .prm_abbldo_mpu_setup                   = 0x4AE07DDC,
+       .prm_abbldo_mpu_ctrl                    = 0x4AE07DE0,
 };
index 2e18706..16a91f9 100644 (file)
@@ -245,6 +245,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
                *regs = &emif_regs_ddr3_532_mhz_1cs_es2;
                break;
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
                switch (emif_nr) {
                case 1:
                        *regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
@@ -273,6 +274,7 @@ static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs
                *dmm_lisa_regs = &lisa_map_4G_x_2_x_2;
                break;
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
        default:
                *dmm_lisa_regs = &lisa_map_2G_x_2_x_2_2G_x_1_x_2;
        }
@@ -460,6 +462,7 @@ static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr,
                *size = ARRAY_SIZE(ddr3_ext_phy_ctrl_const_base_es2);
                break;
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
                if (emif_nr == 1) {
                        *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
                        *size =
@@ -626,6 +629,7 @@ const struct read_write_regs *get_bug_regs(u32 *iterations)
                             sizeof(omap5_bug_00339_regs[0]);
                break;
        case DRA752_ES1_0:
+       case DRA752_ES1_1:
                bug_00339_regs_ptr = dra_bug_00339_regs;
                *iterations = sizeof(dra_bug_00339_regs)/
                             sizeof(dra_bug_00339_regs[0]);
index d33ab7d..3d18491 100644 (file)
@@ -4,5 +4,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 ifndef CONFIG_SPL_BUILD
-ALL-y  += $(obj)u-boot.img
+ALL-y  += u-boot.img
 endif
index 6c9b11a..5aac773 100644 (file)
@@ -38,12 +38,19 @@ _irq:                       .word _irq
 _fiq:                  .word _fiq
 _pad:                  .word 0x12345678 /* now 16*4=64 */
 #else
+.globl _undefined_instruction
 _undefined_instruction: .word undefined_instruction
+.globl _software_interrupt
 _software_interrupt:   .word software_interrupt
+.globl _prefetch_abort
 _prefetch_abort:       .word prefetch_abort
+.globl _data_abort
 _data_abort:           .word data_abort
+.globl _not_used
 _not_used:             .word not_used
+.globl _irq
 _irq:                  .word irq
+.globl _fiq
 _fiq:                  .word fiq
 _pad:                  .word 0x12345678 /* now 16*4=64 */
 #endif /* CONFIG_SPL_BUILD */
index 886b509..77e2319 100644 (file)
@@ -17,4 +17,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/arm/cpu/armv7/tegra124/Makefile b/arch/arm/cpu/armv7/tegra124/Makefile
new file mode 100644 (file)
index 0000000..9478d44
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2013-2014
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/arm/cpu/armv7/tegra124/config.mk b/arch/arm/cpu/armv7/tegra124/config.mk
new file mode 100644 (file)
index 0000000..2f1c645
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# (C) Copyright 2013
+# NVIDIA Corporation <www.nvidia.com>
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+CONFIG_ARCH_DEVICE_TREE := tegra124
index 518d6d1..413eba1 100644 (file)
@@ -17,4 +17,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
index d382d49..3363a3c 100644 (file)
@@ -12,3 +12,5 @@ obj-y := timer.o
 obj-y  += cpu.o
 obj-y  += ddrc.o
 obj-y  += slcr.o
+obj-y  += clk.o
+obj-$(CONFIG_SPL_BUILD)        += spl.o
diff --git a/arch/arm/cpu/armv7/zynq/clk.c b/arch/arm/cpu/armv7/zynq/clk.c
new file mode 100644 (file)
index 0000000..d2885dc
--- /dev/null
@@ -0,0 +1,664 @@
+/*
+ * Copyright (C) 2013 Soren Brinkmann <soren.brinkmann@xilinx.com>
+ * Copyright (C) 2013 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <common.h>
+#include <errno.h>
+#include <clk.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/clk.h>
+
+/* Board oscillator frequency */
+#ifndef CONFIG_ZYNQ_PS_CLK_FREQ
+# define CONFIG_ZYNQ_PS_CLK_FREQ       33333333UL
+#endif
+
+/* Register bitfield defines */
+#define PLLCTRL_FBDIV_MASK     0x7f000
+#define PLLCTRL_FBDIV_SHIFT    12
+#define PLLCTRL_BPFORCE_MASK   (1 << 4)
+#define PLLCTRL_PWRDWN_MASK    2
+#define PLLCTRL_PWRDWN_SHIFT   1
+#define PLLCTRL_RESET_MASK     1
+#define PLLCTRL_RESET_SHIFT    0
+
+#define ZYNQ_CLK_MAXDIV                0x3f
+#define CLK_CTRL_DIV1_SHIFT    20
+#define CLK_CTRL_DIV1_MASK     (ZYNQ_CLK_MAXDIV << CLK_CTRL_DIV1_SHIFT)
+#define CLK_CTRL_DIV0_SHIFT    8
+#define CLK_CTRL_DIV0_MASK     (ZYNQ_CLK_MAXDIV << CLK_CTRL_DIV0_SHIFT)
+#define CLK_CTRL_SRCSEL_SHIFT  4
+#define CLK_CTRL_SRCSEL_MASK   (0x3 << CLK_CTRL_SRCSEL_SHIFT)
+
+#define CLK_CTRL_DIV2X_SHIFT   26
+#define CLK_CTRL_DIV2X_MASK    (ZYNQ_CLK_MAXDIV << CLK_CTRL_DIV2X_SHIFT)
+#define CLK_CTRL_DIV3X_SHIFT   20
+#define CLK_CTRL_DIV3X_MASK    (ZYNQ_CLK_MAXDIV << CLK_CTRL_DIV3X_SHIFT)
+
+#define ZYNQ_CLKMUX_SEL_0      0
+#define ZYNQ_CLKMUX_SEL_1      1
+#define ZYNQ_CLKMUX_SEL_2      2
+#define ZYNQ_CLKMUX_SEL_3      3
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct clk;
+
+/**
+ * struct clk_ops:
+ * @set_rate:  Function pointer to set_rate() implementation
+ * @get_rate:  Function pointer to get_rate() implementation
+ */
+struct clk_ops {
+       int (*set_rate)(struct clk *clk, unsigned long rate);
+       unsigned long (*get_rate)(struct clk *clk);
+};
+
+/**
+ * struct clk:
+ * @name:      Clock name
+ * @frequency: Currenct frequency
+ * @parent:    Parent clock
+ * @flags:     Clock flags
+ * @reg:       Clock control register
+ * @ops:       Clock operations
+ */
+struct clk {
+       char            *name;
+       unsigned long   frequency;
+       enum zynq_clk   parent;
+       unsigned int    flags;
+       u32             *reg;
+       struct clk_ops  ops;
+};
+#define ZYNQ_CLK_FLAGS_HAS_2_DIVS      1
+
+static struct clk clks[clk_max];
+
+/**
+ * __zynq_clk_cpu_get_parent() - Decode clock multiplexer
+ * @srcsel:    Mux select value
+ * Returns the clock identifier associated with the selected mux input.
+ */
+static int __zynq_clk_cpu_get_parent(unsigned int srcsel)
+{
+       unsigned int ret;
+
+       switch (srcsel) {
+       case ZYNQ_CLKMUX_SEL_0:
+       case ZYNQ_CLKMUX_SEL_1:
+               ret = armpll_clk;
+               break;
+       case ZYNQ_CLKMUX_SEL_2:
+               ret = ddrpll_clk;
+               break;
+       case ZYNQ_CLKMUX_SEL_3:
+               ret = iopll_clk;
+               break;
+       default:
+               ret = armpll_clk;
+               break;
+       }
+
+       return ret;
+}
+
+/**
+ * ddr2x_get_rate() - Get clock rate of DDR2x clock
+ * @clk:       Clock handle
+ * Returns the current clock rate of @clk.
+ */
+static unsigned long ddr2x_get_rate(struct clk *clk)
+{
+       u32 clk_ctrl = readl(clk->reg);
+       u32 div = (clk_ctrl & CLK_CTRL_DIV2X_MASK) >> CLK_CTRL_DIV2X_SHIFT;
+
+       return DIV_ROUND_CLOSEST(zynq_clk_get_rate(clk->parent), div);
+}
+
+/**
+ * ddr3x_get_rate() - Get clock rate of DDR3x clock
+ * @clk:       Clock handle
+ * Returns the current clock rate of @clk.
+ */
+static unsigned long ddr3x_get_rate(struct clk *clk)
+{
+       u32 clk_ctrl = readl(clk->reg);
+       u32 div = (clk_ctrl & CLK_CTRL_DIV3X_MASK) >> CLK_CTRL_DIV3X_SHIFT;
+
+       return DIV_ROUND_CLOSEST(zynq_clk_get_rate(clk->parent), div);
+}
+
+static void init_ddr_clocks(void)
+{
+       u32 div0, div1;
+       unsigned long prate = zynq_clk_get_rate(ddrpll_clk);
+       u32 clk_ctrl = readl(&slcr_base->ddr_clk_ctrl);
+
+       /* DDR2x */
+       clks[ddr2x_clk].reg = &slcr_base->ddr_clk_ctrl;
+       clks[ddr2x_clk].parent = ddrpll_clk;
+       clks[ddr2x_clk].name = "ddr_2x";
+       clks[ddr2x_clk].frequency = ddr2x_get_rate(&clks[ddr2x_clk]);
+       clks[ddr2x_clk].ops.get_rate = ddr2x_get_rate;
+
+       /* DDR3x */
+       clks[ddr3x_clk].reg = &slcr_base->ddr_clk_ctrl;
+       clks[ddr3x_clk].parent = ddrpll_clk;
+       clks[ddr3x_clk].name = "