Merge branch 'master' of git://git.denx.de/u-boot-video
authorTom Rini <trini@ti.com>
Mon, 16 Dec 2013 14:30:52 +0000 (09:30 -0500)
committerTom Rini <trini@ti.com>
Mon, 16 Dec 2013 14:56:24 +0000 (09:56 -0500)
463 files changed:
.gitignore
Makefile
README
arch/arm/config.mk
arch/arm/cpu/Makefile
arch/arm/cpu/arm926ejs/at91/led.c
arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
arch/arm/cpu/armv7/Makefile
arch/arm/cpu/armv7/am33xx/board.c
arch/arm/cpu/armv7/am33xx/ddr.c
arch/arm/cpu/armv7/at91/sama5d3_devices.c
arch/arm/cpu/armv7/at91/timer.c
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/exynos/pinmux.c
arch/arm/cpu/armv7/exynos/spl_boot.c
arch/arm/cpu/armv7/nonsec_virt.S
arch/arm/cpu/armv7/omap-common/Makefile
arch/arm/cpu/armv7/omap-common/emif-common.c
arch/arm/cpu/armv7/omap-common/pipe3-phy.c [new file with mode: 0644]
arch/arm/cpu/armv7/omap-common/pipe3-phy.h [new file with mode: 0644]
arch/arm/cpu/armv7/omap-common/sata.c [new file with mode: 0644]
arch/arm/cpu/armv7/omap3/clock.c
arch/arm/cpu/armv7/omap4/hw_data.c
arch/arm/cpu/armv7/omap4/sdram_elpida.c
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/rmobile/Makefile
arch/arm/cpu/armv7/rmobile/config.mk [deleted file]
arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/cpu_info.c
arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/pfc-r8a7790.h [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c [new file with mode: 0644]
arch/arm/cpu/armv7/rmobile/timer.c
arch/arm/cpu/armv7/socfpga/Makefile
arch/arm/cpu/armv7/socfpga/freeze_controller.c [new file with mode: 0644]
arch/arm/cpu/armv7/socfpga/spl.c
arch/arm/cpu/armv7/zynq/cpu.c
arch/arm/cpu/armv7/zynq/timer.c
arch/arm/cpu/at91-common/Makefile [new file with mode: 0644]
arch/arm/cpu/at91-common/mpddrc.c [new file with mode: 0644]
arch/arm/cpu/at91-common/phy.c [new file with mode: 0644]
arch/arm/cpu/at91-common/spl.c [new file with mode: 0644]
arch/arm/cpu/at91-common/u-boot-spl.lds [new file with mode: 0644]
arch/arm/cpu/ixp/u-boot.lds
arch/arm/cpu/pxa/timer.c
arch/arm/cpu/u-boot-spl.lds
arch/arm/cpu/u-boot.lds
arch/arm/include/asm/arch-am33xx/ddr_defs.h
arch/arm/include/asm/arch-at91/at91_common.h
arch/arm/include/asm/arch-at91/at91_pio.h
arch/arm/include/asm/arch-at91/at91_pit.h
arch/arm/include/asm/arch-at91/at91_pmc.h
arch/arm/include/asm/arch-at91/at91_spi.h
arch/arm/include/asm/arch-at91/at91_wdt.h
arch/arm/include/asm/arch-at91/at91cap9.h
arch/arm/include/asm/arch-at91/at91sam9_smc.h
arch/arm/include/asm/arch-at91/atmel_mpddrc.h [new file with mode: 0644]
arch/arm/include/asm/arch-at91/gpio.h
arch/arm/include/asm/arch-at91/sama5d3.h
arch/arm/include/asm/arch-at91/spl.h [new file with mode: 0644]
arch/arm/include/asm/arch-davinci/hardware.h
arch/arm/include/asm/arch-exynos/dwmmc.h
arch/arm/include/asm/arch-exynos/mmc.h
arch/arm/include/asm/arch-exynos/power.h
arch/arm/include/asm/arch-exynos/spi.h
arch/arm/include/asm/arch-omap3/clock.h
arch/arm/include/asm/arch-omap3/omap3.h
arch/arm/include/asm/arch-omap4/sys_proto.h
arch/arm/include/asm/arch-omap5/clock.h
arch/arm/include/asm/arch-omap5/omap.h
arch/arm/include/asm/arch-omap5/sata.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/gpio.h
arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/r8a7790.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/r8a7791-gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/r8a7791.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/rmobile.h
arch/arm/include/asm/arch-s5pc1xx/mmc.h
arch/arm/include/asm/arch-socfpga/freeze_controller.h [new file with mode: 0644]
arch/arm/include/asm/emif.h
arch/arm/include/asm/omap_common.h
arch/arm/lib/bootm.c
arch/blackfin/config.mk
arch/blackfin/cpu/.gitignore
arch/blackfin/cpu/Makefile
arch/blackfin/cpu/bootrom-asm-offsets.awk [deleted file]
arch/blackfin/cpu/bootrom-asm-offsets.c.in [deleted file]
arch/blackfin/cpu/gpio.c
arch/blackfin/cpu/initcode.c
arch/blackfin/include/asm/blackfin_local.h
arch/blackfin/include/asm/gpio.h
arch/blackfin/lib/board.c
arch/blackfin/lib/clocks.c
arch/powerpc/config.mk
arch/powerpc/cpu/74xx_7xx/config.mk
arch/powerpc/cpu/Makefile
arch/powerpc/cpu/mpc512x/config.mk
arch/powerpc/cpu/mpc5xx/config.mk
arch/powerpc/cpu/mpc5xxx/config.mk
arch/powerpc/cpu/mpc824x/config.mk
arch/powerpc/cpu/mpc8260/config.mk
arch/powerpc/cpu/mpc83xx/Makefile
arch/powerpc/cpu/mpc83xx/config.mk
arch/powerpc/cpu/mpc85xx/config.mk
arch/powerpc/cpu/mpc85xx/speed.c
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/cpu/mpc86xx/config.mk
arch/powerpc/cpu/mpc8xx/config.mk
arch/powerpc/cpu/mpc8xxx/Makefile
arch/powerpc/cpu/ppc4xx/config.mk
arch/powerpc/include/asm/config_mpc85xx.h
arch/powerpc/lib/bootm.c
arch/sandbox/cpu/os.c
arch/sandbox/cpu/start.c
arch/sandbox/include/asm/config.h
arch/sandbox/include/asm/getopt.h
arch/sandbox/include/asm/sections.h
arch/sandbox/include/asm/spi.h [new file with mode: 0644]
arch/sandbox/include/asm/state.h
board/BuS/vl_ma2sc/vl_ma2sc.c
board/actux1/u-boot.lds
board/actux2/u-boot.lds
board/actux3/u-boot.lds
board/afeb9260/afeb9260.c
board/atmel/at91sam9260ek/at91sam9260ek.c
board/atmel/at91sam9263ek/at91sam9263ek.c
board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
board/atmel/sama5d3xek/sama5d3xek.c
board/bf609-ezkit/bf609-ezkit.c
board/bluewater/snapper9260/snapper9260.c
board/calao/sbc35_a9g20/sbc35_a9g20.c
board/calao/usb_a9263/Makefile [new file with mode: 0644]
board/calao/usb_a9263/usb_a9263.c [new file with mode: 0644]
board/compulab/cm_t335/Makefile [new file with mode: 0644]
board/compulab/cm_t335/cm_t335.c [new file with mode: 0644]
board/compulab/cm_t335/mux.c [new file with mode: 0644]
board/compulab/cm_t335/spl.c [new file with mode: 0644]
board/compulab/cm_t335/u-boot.lds [new file with mode: 0644]
board/compulab/cm_t35/Makefile
board/compulab/cm_t35/leds.c [deleted file]
board/dvlhost/u-boot.lds
board/egnite/ethernut5/ethernut5.c
board/esd/meesc/meesc.c
board/esd/otc570/otc570.c
board/eukrea/cpu9260/cpu9260.c
board/freescale/c29xpcie/ddr.c
board/freescale/common/p_corenet/Makefile
board/freescale/mx31ads/u-boot.lds
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/isee/igep0033/board.c
board/phytec/pcm051/board.c
board/renesas/koelsch/Makefile [new file with mode: 0644]
board/renesas/koelsch/koelsch.c [new file with mode: 0644]
board/renesas/koelsch/qos.c [new file with mode: 0644]
board/renesas/koelsch/qos.h [new file with mode: 0644]
board/renesas/lager/Makefile [new file with mode: 0644]
board/renesas/lager/lager.c [new file with mode: 0644]
board/renesas/lager/qos.c [new file with mode: 0644]
board/renesas/lager/qos.h [new file with mode: 0644]
board/ronetix/pm9261/led.c
board/ronetix/pm9261/pm9261.c
board/ronetix/pm9263/led.c
board/ronetix/pm9263/pm9263.c
board/ronetix/pm9g45/pm9g45.c
board/samsung/smdk5250/exynos5-dt.c
board/samsung/trats/trats.c
board/samsung/trats2/trats2.c
board/sandbox/sandbox/README.sandbox
board/siemens/common/factoryset.c
board/siemens/common/factoryset.h
board/siemens/corvus/Makefile [new file with mode: 0644]
board/siemens/corvus/board.c [new file with mode: 0644]
board/siemens/dxr2/board.c
board/siemens/dxr2/board.h
board/siemens/dxr2/mux.c
board/siemens/pxm2/board.c
board/siemens/rut/board.c
board/siemens/taurus/Makefile [new file with mode: 0644]
board/siemens/taurus/taurus.c [new file with mode: 0644]
board/taskit/stamp9g20/stamp9g20.c
board/ti/am335x/board.c
board/ti/am335x/u-boot.lds
board/ti/dra7xx/evm.c
board/ti/omap5_uevm/evm.c
board/ti/omap730p2/Makefile [deleted file]
board/ti/omap730p2/README.omap730p2 [deleted file]
board/ti/omap730p2/config.mk [deleted file]
board/ti/omap730p2/flash.c [deleted file]
board/ti/omap730p2/lowlevel_init.S [deleted file]
board/ti/omap730p2/omap730p2.c [deleted file]
board/ti/panda/panda.c
board/ti/ti814x/evm.c
board/ti/ti816x/evm.c
board/vpac270/u-boot-spl.lds
boards.cfg
common/Makefile
common/board_f.c
common/cmd_bootm.c
common/cmd_eeprom.c
common/cmd_elf.c
common/fdt_support.c
config.mk
doc/README.at91-soc
doc/README.scrapyard
doc/README.vxworks [new file with mode: 0644]
doc/SPI/README.sandbox-spi [new file with mode: 0644]
doc/device-tree-bindings/spi/spi-bus.txt [new file with mode: 0644]
drivers/block/ahci.c
drivers/bootcount/Makefile
drivers/bootcount/bootcount_davinci.c
drivers/bootcount/bootcount_env.c [new file with mode: 0644]
drivers/gpio/at91_gpio.c
drivers/i2c/Makefile
drivers/i2c/fti2c010.c
drivers/i2c/omap24xx_i2c.c
drivers/i2c/s3c24x0_i2c.c
drivers/i2c/soft_i2c.c
drivers/misc/cros_ec_spi.c
drivers/mmc/Makefile
drivers/mmc/dw_mmc.c
drivers/mmc/exynos_dw_mmc.c
drivers/mmc/fsl_esdhc_spl.c
drivers/mmc/ftsdc021_sdhci.c [new file with mode: 0644]
drivers/mtd/nand/Makefile
drivers/mtd/nand/atmel_nand.c
drivers/mtd/spi/Makefile
drivers/mtd/spi/fsl_espi_spl.c
drivers/mtd/spi/sandbox.c [new file with mode: 0644]
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_probe.c
drivers/mtd/ubi/Makefile
drivers/net/at91_emac.c
drivers/net/cpsw.c
drivers/net/fm/init.c
drivers/power/twl6030.c
drivers/serial/lpc32xx_hsuart.c
drivers/spi/Makefile
drivers/spi/bfin_spi.c
drivers/spi/bfin_spi6xx.c
drivers/spi/exynos_spi.c
drivers/spi/sandbox_spi.c [new file with mode: 0644]
drivers/spi/spi.c
drivers/usb/gadget/Makefile
drivers/usb/gadget/g_dnl.c
drivers/usb/gadget/regs-otg.h
drivers/usb/gadget/s3c_udc_otg.c
drivers/usb/host/ehci-omap.c
drivers/video/bus_vcxk.c
dts/Makefile
examples/standalone/.gitignore
examples/standalone/82559_eeprom.c [deleted file]
examples/standalone/Makefile
fs/jffs2/jffs2_1pass.c
fs/yaffs2/yaffs_uboot_glue.c
fs/yaffs2/yaffsfs.c
include/common.h
include/config_defaults.h
include/configs/B4860QDS.h
include/configs/BSC9131RDB.h
include/configs/BSC9132QDS.h
include/configs/DU440.h
include/configs/EXBITGEN.h
include/configs/JSE.h
include/configs/KAREF.h
include/configs/METROBOX.h
include/configs/MIP405.h
include/configs/MPC8315ERDB.h
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349EMDS.h
include/configs/MPC8349ITX.h
include/configs/MPC8360EMDS.h
include/configs/MPC8360ERDK.h
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/MPC8536DS.h
include/configs/MPC8540ADS.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8569MDS.h
include/configs/MPC8572DS.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/P1010RDB.h
include/configs/P1022DS.h
include/configs/P1023RDS.h
include/configs/P1_P2_RDB.h
include/configs/P2020COME.h
include/configs/P2020DS.h
include/configs/P2041RDB.h
include/configs/PIP405.h
include/configs/PMC440.h
include/configs/T1040QDS.h
include/configs/T1040RDB.h
include/configs/T1042RDB_PI.h
include/configs/T2080QDS.h
include/configs/TQM834x.h
include/configs/VCMA9.h
include/configs/W7OLMC.h
include/configs/W7OLMG.h
include/configs/ac14xx.h
include/configs/actux1.h
include/configs/actux2.h
include/configs/actux3.h
include/configs/actux4.h
include/configs/afeb9260.h
include/configs/alpr.h
include/configs/am335x_evm.h
include/configs/am3517_evm.h
include/configs/amcc-common.h
include/configs/aria.h
include/configs/arndale.h
include/configs/at91sam9260ek.h
include/configs/at91sam9263ek.h
include/configs/at91sam9m10g45ek.h
include/configs/at91sam9n12ek.h
include/configs/balloon3.h
include/configs/bf506f-ezkit.h
include/configs/bf525-ucr2.h
include/configs/bf533-stamp.h
include/configs/bf537-minotaur.h
include/configs/bf537-srv1.h
include/configs/bf561-acvilon.h
include/configs/bf561-ezkit.h
include/configs/blackstamp.h
include/configs/blackvme.h
include/configs/cm-bf537e.h
include/configs/cm-bf537u.h
include/configs/cm-bf548.h
include/configs/cm_t335.h [new file with mode: 0644]
include/configs/cm_t35.h
include/configs/coreboot.h
include/configs/corenet_ds.h
include/configs/corvus.h [new file with mode: 0644]
include/configs/cpu9260.h
include/configs/csb272.h
include/configs/csb472.h
include/configs/dnp5370.h
include/configs/dra7xx_evm.h
include/configs/dvlhost.h
include/configs/dxr2.h
include/configs/eb_cpux9k2.h
include/configs/ethernut5.h
include/configs/exynos5250-dt.h
include/configs/h2_p2_dbg_board.h [deleted file]
include/configs/km/kmp204x-common.h
include/configs/koelsch.h [new file with mode: 0644]
include/configs/korat.h
include/configs/lager.h [new file with mode: 0644]
include/configs/lp8x4x.h
include/configs/lubbock.h
include/configs/lwmon5.h
include/configs/mecp5123.h
include/configs/meesc.h
include/configs/mpc5121ads.h
include/configs/mpq101.h
include/configs/mx1ads.h
include/configs/omap3_beagle.h
include/configs/omap4_panda.h
include/configs/omap5912osk.h
include/configs/omap5_uevm.h
include/configs/omap730.h [deleted file]
include/configs/omap730p2.h [deleted file]
include/configs/otc570.h
include/configs/p1_p2_rdb_pc.h
include/configs/p3p440.h
include/configs/palmld.h
include/configs/palmtc.h
include/configs/palmtreo680.h
include/configs/pcs440ep.h
include/configs/pdm360ng.h
include/configs/pm9261.h
include/configs/pm9263.h
include/configs/pm9g45.h
include/configs/pxa-common.h
include/configs/pxa255_idp.h
include/configs/pxm2.h
include/configs/quad100hd.h
include/configs/rsdproto.h
include/configs/rut.h
include/configs/sama5d3xek.h
include/configs/sandbox.h
include/configs/sbc35_a9g20.h
include/configs/sbc8349.h
include/configs/sbc8548.h
include/configs/sbc8641d.h
include/configs/siemens-am33x-common.h
include/configs/smdk2410.h
include/configs/snapper9260.h
include/configs/socrates.h
include/configs/stamp9g20.h
include/configs/stxgp3.h
include/configs/stxssa.h
include/configs/t4qds.h
include/configs/taurus.h [new file with mode: 0644]
include/configs/tcm-bf537.h
include/configs/ti_am335x_common.h
include/configs/trats.h
include/configs/trats2.h
include/configs/trizepsiv.h
include/configs/usb_a9263.h [new file with mode: 0644]
include/configs/vexpress_common.h
include/configs/vl_ma2sc.h
include/configs/vme8349.h
include/configs/vpac270.h
include/configs/xaeniax.h
include/configs/zeus.h
include/configs/zipitz2.h
include/dwmmc.h
include/faraday/ftsdc021.h [new file with mode: 0644]
include/i2c.h
include/spi.h
include/spi_flash.h
include/twl6030.h
include/vxworks.h
lib/time.c
post/Makefile
post/board/lwmon/Makefile
post/board/lwmon5/Makefile
post/board/netta/Makefile
post/board/pdm360ng/Makefile
post/cpu/mpc83xx/Makefile
post/cpu/ppc4xx/Makefile
post/drivers/Makefile
post/lib_powerpc/Makefile
post/lib_powerpc/fpu/Makefile
scripts/binutils-version.sh [moved from tools/binutils-version.sh with 100% similarity, mode: 0644]
scripts/checkpatch.pl [moved from tools/checkpatch.pl with 100% similarity]
scripts/checkstack.pl [moved from tools/checkstack.pl with 100% similarity]
scripts/cleanpatch [moved from tools/cleanpatch with 100% similarity]
scripts/dtc-version.sh [moved from tools/dtc-version.sh with 100% similarity, mode: 0644]
scripts/gcc-version.sh [moved from tools/gcc-version.sh with 100% similarity, mode: 0644]
scripts/setlocalversion [moved from tools/setlocalversion with 100% similarity]
spl/.gitignore [deleted file]
spl/Makefile
test/image/test-imagetools.sh [new file with mode: 0755]
tools/.gitignore
tools/Makefile
tools/aisimage.c
tools/default_image.c
tools/dumpimage.c [new file with mode: 0644]
tools/dumpimage.h [new file with mode: 0644]
tools/fit_image.c
tools/imagetool.c [new file with mode: 0644]
tools/imagetool.h [new file with mode: 0644]
tools/imximage.c
tools/kwbimage.c
tools/mkimage.c
tools/mkimage.h
tools/mxsimage.c
tools/omapimage.c
tools/pblimage.c
tools/ublimage.c

index a39bd54..3b14c25 100644 (file)
@@ -47,8 +47,6 @@
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
-/u-boot.bd
-/u-boot.geany
 
 #
 # Generated files
 /errlog
 /reloc_off
 
+/spl/
+!/spl/Makefile
+/tpl/
+
 /include/generated/
 /include/spl-autoconf.mk
 /include/tpl-autoconf.mk
@@ -88,6 +90,3 @@ GPATH
 GRTAGS
 GSYMS
 GTAGS
-
-# spl ais files
-/spl/*.ais
index 8b86913..d6398fe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -109,11 +109,6 @@ export     TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
 MKCONFIG       := $(SRCTREE)/mkconfig
 export MKCONFIG
 
-ifneq ($(OBJTREE),$(SRCTREE))
-REMOTE_BUILD   := 1
-export REMOTE_BUILD
-endif
-
 # $(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.
@@ -187,7 +182,7 @@ ifndef LDSCRIPT
        #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
        ifdef CONFIG_SYS_LDSCRIPT
                # need to strip off double quotes
-               LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
+               LDSCRIPT := $(CONFIG_SYS_LDSCRIPT:"%"=%)
        endif
 endif
 
@@ -218,15 +213,11 @@ endif
 #########################################################################
 # U-Boot objects....order is important (i.e. start must be first)
 
-OBJS  = $(CPUDIR)/start.o
-ifeq ($(CPU),ppc4xx)
-OBJS += $(CPUDIR)/resetvec.o
-endif
-ifeq ($(CPU),mpc85xx)
-OBJS += $(CPUDIR)/resetvec.o
-endif
+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),$(OBJS))
+OBJS := $(addprefix $(obj),$(head-y))
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
 
@@ -249,9 +240,9 @@ LIBS-y += drivers/i2c/
 LIBS-y += drivers/input/
 LIBS-y += drivers/mmc/
 LIBS-y += drivers/mtd/
-LIBS-y += drivers/mtd/nand/
+LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
 LIBS-y += drivers/mtd/onenand/
-LIBS-y += drivers/mtd/ubi/
+LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
 LIBS-y += drivers/mtd/spi/
 LIBS-y += drivers/net/
 LIBS-y += drivers/net/phy/
@@ -275,7 +266,7 @@ LIBS-y += drivers/usb/ulpi/
 LIBS-y += common/
 LIBS-y += lib/libfdt/
 LIBS-$(CONFIG_API) += api/
-LIBS-y += post/
+LIBS-$(CONFIG_HAS_POST) += post/
 LIBS-y += test/
 
 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
@@ -345,7 +336,7 @@ 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
 ifneq ($(CONFIG_SPL_TARGET),)
-ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
+ALL-$(CONFIG_SPL) += $(obj)$(CONFIG_SPL_TARGET:"%"=%)
 endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
@@ -372,7 +363,7 @@ $(obj)u-boot.hex:   $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
 
 $(obj)u-boot.srec:     $(obj)u-boot
-               $(OBJCOPY) -O srec $< $@
+               $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
 
 $(obj)u-boot.bin:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
@@ -528,7 +519,7 @@ GEN_UBOOT = \
 endif
 
 $(obj)u-boot:  depend \
-               $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
+               $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(obj)u-boot.lds
                $(GEN_UBOOT)
 ifeq ($(CONFIG_KALLSYMS),y)
                smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
@@ -549,10 +540,7 @@ $(SUBDIRS):        depend
 
 $(SUBDIR_EXAMPLES-y): $(obj)u-boot
 
-$(LDSCRIPT):   depend
-               $(MAKE) -C $(dir $@) $(notdir $@)
-
-$(obj)u-boot.lds: $(LDSCRIPT)
+$(obj)u-boot.lds: $(LDSCRIPT) depend
                $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
 
 nand_spl:      $(TIMESTAMP_FILE) $(VERSION_FILE) depend
@@ -586,7 +574,7 @@ FINDFLAGS := -L
 checkstack:
                $(CROSS_COMPILE)objdump -d $(obj)u-boot \
                        `$(FIND) $(obj) -name u-boot-spl -print` | \
-                       perl $(src)tools/checkstack.pl $(ARCH)
+                       perl $(src)scripts/checkstack.pl $(ARCH)
 
 tags ctags:
                ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
@@ -638,63 +626,49 @@ checkdtc:
 # to regenerate the autoconf.mk file.
 $(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Generate the dependancies ; \
        $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
-               -MQ $(obj)include/autoconf.mk include/common.h > $@
+               -MQ $(obj)include/autoconf.mk include/common.h > $@ || \
+               rm $@
 
 $(obj)include/autoconf.mk: $(obj)include/config.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
-               sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
+       $(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 $@ ; \
-       set -e ; \
        : Extract the config macros ; \
        $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-                       -DDO_DEPS_ONLY -dM include/common.h | \
-       sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
+                       -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
+               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
 
 $(obj)include/spl-autoconf.mk: $(obj)include/config.h
        @$(XECHO) Generating $@ ; \
-       set -e ; \
        : Extract the config macros ; \
-       $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h | \
-       sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
-       mv $@.tmp $@
-
-$(obj)include/generated/generic-asm-offsets.h: $(obj)include/autoconf.mk.dep \
-       $(obj)include/spl-autoconf.mk \
-       $(obj)include/tpl-autoconf.mk \
-       $(obj)lib/asm-offsets.s
+       $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
+               sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
+       rm $@.tmp
+
+$(obj)include/generated/generic-asm-offsets.h: $(obj)lib/asm-offsets.s
        @$(XECHO) Generating $@
        tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
 
-$(obj)lib/asm-offsets.s:       $(obj)include/autoconf.mk.dep \
-       $(obj)include/spl-autoconf.mk \
-       $(obj)include/tpl-autoconf.mk \
-       $(src)lib/asm-offsets.c
+$(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
 
-$(obj)include/generated/asm-offsets.h: $(obj)include/autoconf.mk.dep \
-       $(obj)include/spl-autoconf.mk \
-       $(obj)include/tpl-autoconf.mk \
-       $(obj)$(CPUDIR)/$(SOC)/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 $@
 
-$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s:  $(obj)include/autoconf.mk.dep \
-       $(obj)include/spl-autoconf.mk \
-       $(obj)include/tpl-autoconf.mk
+$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/config.h
        @mkdir -p $(obj)$(CPUDIR)/$(SOC)
        if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
                $(CC) -DDO_DEPS_ONLY \
@@ -726,7 +700,7 @@ checkarmreloc: $(obj)u-boot
 
 $(VERSION_FILE):
                @mkdir -p $(dir $(VERSION_FILE))
-               @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
+               @( localvers='$(shell $(TOPDIR)/scripts/setlocalversion $(TOPDIR))' ; \
                   printf '#define PLAIN_VERSION "%s%s"\n' \
                        "$(U_BOOT_VERSION)" "$${localvers}" ; \
                   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
@@ -781,9 +755,7 @@ $(obj).boards.depend:       boards.cfg
 #########################################################################
 
 clean:
-       @rm -f $(obj)examples/standalone/82559_eeprom                     \
-              $(obj)examples/standalone/atmel_df_pow2                    \
-              $(obj)examples/standalone/eepro100_eeprom                  \
+       @rm -f $(obj)examples/standalone/atmel_df_pow2                    \
               $(obj)examples/standalone/hello_world                      \
               $(obj)examples/standalone/interrupt                        \
               $(obj)examples/standalone/mem_to_mem_idma2intr             \
@@ -793,10 +765,11 @@ clean:
               $(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,fw_setenv}                    \
+              $(obj)tools/env/fw_printenv                                \
               $(obj)tools/envcrc                                         \
-              $(obj)tools/gdb/{astest,gdbcont,gdbsend}                   \
+              $(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                                        \
@@ -805,9 +778,7 @@ clean:
               $(obj)tools/proftool
        @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}        \
               $(obj)board/matrix_vision/*/bootscript.img                 \
-              $(obj)board/voiceblue/eeprom                               \
               $(obj)u-boot.lds                                           \
-              $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]          \
               $(obj)arch/blackfin/cpu/init.{lds,elf}
        @rm -f $(obj)include/bmp_logo.h
        @rm -f $(obj)include/bmp_logo_data.h
@@ -842,7 +813,6 @@ clobber:    tidy
        @rm -f $(obj)u-boot.ais
        @rm -f $(obj)u-boot.dtb
        @rm -f $(obj)u-boot.sb
-       @rm -f $(obj)u-boot.bd
        @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}
diff --git a/README b/README
index 265e81e..895fef3 100644 (file)
--- a/README
+++ b/README
@@ -818,6 +818,22 @@ The following options need to be configured:
                as a convenience, when switching between booting from
                RAM and NFS.
 
+- Bootcount:
+               CONFIG_BOOTCOUNT_LIMIT
+               Implements a mechanism for detecting a repeating reboot
+               cycle, see:
+               http://www.denx.de/wiki/view/DULG/UBootBootCountLimit
+
+               CONFIG_BOOTCOUNT_ENV
+               If no softreset save registers are found on the hardware
+               "bootcount" is stored in the environment. To prevent a
+               saveenv on all reboots, the environment variable
+               "upgrade_available" is used. If "upgrade_available" is
+               0, "bootcount" is always 0, if "upgrade_available" is
+               1 "bootcount" is incremented in the environment.
+               So the Userspace Applikation must set the "upgrade_available"
+               and "bootcount" variable to 0, if a boot was successfully.
+
 - Pre-Boot Commands:
                CONFIG_PREBOOT
 
@@ -2125,6 +2141,12 @@ CBFS (Coreboot Filesystem) support
                  - set CONFIG_SYS_I2C_ZYNQ_SPEED for speed setting
                  - set CONFIG_SYS_I2C_ZYNQ_SLAVE for slave addr
 
+               - drivers/i2c/s3c24x0_i2c.c:
+                 - activate this driver with CONFIG_SYS_I2C_S3C24X0
+                 - This driver adds i2c buses (11 for Exynos5250, Exynos5420
+                   9 i2c buses for Exynos4 and 1 for S3C24X0 SoCs from Samsung)
+                   with a fix speed from 100000 and the slave addr 0!
+
                additional defines:
 
                CONFIG_SYS_NUM_I2C_BUSES
@@ -4388,6 +4410,9 @@ Low Level (hardware related) configuration options:
 
                NOTE : currently only supported on AM335x platforms.
 
+- CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
+               Enables the RTC32K OSC on AM33xx based plattforms
+
 Freescale QE/FMAN Firmware Support:
 -----------------------------------
 
@@ -5227,6 +5252,15 @@ when your kernel is intended to use an initial ramdisk:
        Load Address: 0x00000000
        Entry Point:  0x00000000
 
+The "dumpimage" is a tool to disassemble images built by mkimage. Its "-i"
+option performs the converse operation of the mkimage's second form (the "-d"
+option). Given an image built by mkimage, the dumpimage extracts a "data file"
+from the image:
+
+       tools/dumpimage -i image -p position data_file
+         -i ==> extract from the 'image' a specific 'data_file', \
+          indexed by 'position'
+
 
 Installing a Linux Image:
 -------------------------
index bdabcf4..fd3e5fb 100644 (file)
@@ -103,3 +103,6 @@ ALL-y += checkarmreloc
 # such usage by requiring word relocations.
 PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations)
 endif
+
+# limit ourselves to the sections we want in the .bin.
+OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn
index fd0da53..b2d30b1 100644 (file)
@@ -1,2 +1,3 @@
+obj-$(CONFIG_AT91FAMILY) += at91-common/
 obj-$(CONFIG_TEGRA) += $(SOC)-common/
 obj-$(CONFIG_TEGRA) += tegra-common/
index 5dd9048..46ed055 100644 (file)
@@ -7,43 +7,41 @@
  */
 
 #include <common.h>
-#include <asm/io.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_pio.h>
+#include <asm/gpio.h>
 #include <asm/arch/gpio.h>
 
 #ifdef CONFIG_RED_LED
 void red_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 1);
 }
 
 void red_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_RED_LED, 0);
 }
 #endif
 
 #ifdef CONFIG_GREEN_LED
 void green_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 0);
 }
 
 void green_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
 }
 #endif
 
 #ifdef CONFIG_YELLOW_LED
 void yellow_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 0);
+       gpio_set_value(CONFIG_YELLOW_LED, 0);
 }
 
 void yellow_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
+       gpio_set_value(CONFIG_YELLOW_LED, 1);
 }
 #endif
index 40bcc31..80fb9bd 100644 (file)
@@ -51,11 +51,13 @@ SECTIONS
 
        _end = .;
 
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynsym*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.hash*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 4927736..76b499d 100644 (file)
@@ -51,11 +51,13 @@ SECTIONS
 
        _end = .;
 
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynsym*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.hash*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index d3347b3..0467d00 100644 (file)
@@ -12,7 +12,7 @@ obj-y += cache_v7.o
 obj-y  += cpu.o
 obj-y  += syslib.o
 
-ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),)
+ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y  += lowlevel_init.o
 endif
index 453effa..803aa9c 100644 (file)
@@ -149,6 +149,7 @@ __weak void am33xx_spl_board_init(void)
        do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
 }
 
+#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
 static void rtc32k_enable(void)
 {
        struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;
@@ -164,6 +165,7 @@ static void rtc32k_enable(void)
        /* Enable the RTC 32K OSC by setting bits 3 and 6. */
        writel((1 << 3) | (1 << 6), &rtc->osc);
 }
+#endif
 
 static void uart_soft_reset(void)
 {
@@ -232,8 +234,10 @@ void s_init(void)
 #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
        prcm_init();
        set_mux_conf_regs();
+#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
        rtc32k_enable();
+#endif
        sdram_init();
 #endif
 }
index fa697c7..5b0454c 100644 (file)
@@ -89,15 +89,12 @@ void config_ddr_phy(const struct emif_regs *regs, int nr)
 void config_cmd_ctrl(const struct cmd_control *cmd, int nr)
 {
        writel(cmd->cmd0csratio, &ddr_cmd_reg[nr]->cm0csratio);
-       writel(cmd->cmd0dldiff, &ddr_cmd_reg[nr]->cm0dldiff);
        writel(cmd->cmd0iclkout, &ddr_cmd_reg[nr]->cm0iclkout);
 
        writel(cmd->cmd1csratio, &ddr_cmd_reg[nr]->cm1csratio);
-       writel(cmd->cmd1dldiff, &ddr_cmd_reg[nr]->cm1dldiff);
        writel(cmd->cmd1iclkout, &ddr_cmd_reg[nr]->cm1iclkout);
 
        writel(cmd->cmd2csratio, &ddr_cmd_reg[nr]->cm2csratio);
-       writel(cmd->cmd2dldiff, &ddr_cmd_reg[nr]->cm2dldiff);
        writel(cmd->cmd2iclkout, &ddr_cmd_reg[nr]->cm2iclkout);
 }
 
@@ -121,10 +118,6 @@ void config_ddr_data(const struct ddr_data *data, int nr)
                        &(ddr_data_reg[nr]+i)->dt0fwsratio0);
                writel(data->datawrsratio0,
                        &(ddr_data_reg[nr]+i)->dt0wrsratio0);
-               writel(data->datauserank0delay,
-                       &(ddr_data_reg[nr]+i)->dt0rdelays0);
-               writel(data->datadldiff0,
-                       &(ddr_data_reg[nr]+i)->dt0dldiff0);
        }
 }
 
index 51f0a6d..78ecfc8 100644 (file)
@@ -15,7 +15,7 @@
 
 unsigned int has_emac()
 {
-       return cpu_is_sama5d31() || cpu_is_sama5d35();
+       return cpu_is_sama5d31() || cpu_is_sama5d35() || cpu_is_sama5d36();
 }
 
 unsigned int has_gmac()
@@ -42,6 +42,8 @@ char *get_cpu_name()
                        return "SAMA5D34";
                case ARCH_EXID_SAMA5D35:
                        return "SAMA5D35";
+               case ARCH_EXID_SAMA5D36:
+                       return "SAMA5D36";
                default:
                        return "Unknown CPU type";
                }
@@ -82,7 +84,7 @@ void at91_seriald_hw_init(void)
        at91_set_a_periph(AT91_PIO_PORTB, 30, 0);       /* DRXD */
 
        /* Enable clock */
-       at91_periph_clk_enable(ATMEL_ID_SYS);
+       at91_periph_clk_enable(ATMEL_ID_DBGU);
 }
 
 #if defined(CONFIG_ATMEL_SPI)
index 3808aed..e3ebfe0 100644 (file)
@@ -60,7 +60,7 @@ int timer_init(void)
        at91_pit_t *pit = (at91_pit_t *)ATMEL_BASE_PIT;
 
        /* Enable PITC Clock */
-       at91_periph_clk_enable(ATMEL_ID_SYS);
+       at91_periph_clk_enable(ATMEL_ID_PIT);
 
        /* Enable PITC */
        writel(TIMER_LOAD_VAL | AT91_PIT_MR_EN , &pit->mr);
index 36fedd6..84a5047 100644 (file)
@@ -1410,7 +1410,8 @@ void set_mmc_clk(int dev_index, unsigned int div)
        else {
                if (proid_is_exynos4412())
                        exynos4x12_set_mmc_clk(dev_index, div);
-               exynos4_set_mmc_clk(dev_index, div);
+               else
+                       exynos4_set_mmc_clk(dev_index, div);
        }
 }
 
index 8002bce..74cc700 100644 (file)
@@ -462,7 +462,7 @@ static int exynos4_pinmux_config(int peripheral, int flags)
        case PERIPH_ID_SDMMC1:
        case PERIPH_ID_SDMMC3:
        case PERIPH_ID_SDMMC4:
-               printf("SDMMC device %d not implemented\n", peripheral);
+               debug("SDMMC device %d not implemented\n", peripheral);
                return -1;
        default:
                debug("%s: invalid peripheral %d", __func__, peripheral);
index 3651c00..ade45fd 100644 (file)
 #include <asm/arch/clock.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/dmc.h>
+#include <asm/arch/periph.h>
+#include <asm/arch/pinmux.h>
 #include <asm/arch/power.h>
 #include <asm/arch/spl.h>
+#include <asm/arch/spi.h>
 
 #include "common_setup.h"
 #include "clock_init.h"
@@ -59,6 +62,121 @@ static int config_branch_prediction(int set_cr_z)
 }
 #endif
 
+#ifdef CONFIG_SPI_BOOTING
+static void spi_rx_tx(struct exynos_spi *regs, int todo,
+                       void *dinp, void const *doutp, int i)
+{
+       uint *rxp = (uint *)(dinp + (i * (32 * 1024)));
+       int rx_lvl, tx_lvl;
+       uint out_bytes, in_bytes;
+
+       out_bytes = todo;
+       in_bytes = todo;
+       setbits_le32(&regs->ch_cfg, SPI_CH_RST);
+       clrbits_le32(&regs->ch_cfg, SPI_CH_RST);
+       writel(((todo * 8) / 32) | SPI_PACKET_CNT_EN, &regs->pkt_cnt);
+
+       while (in_bytes) {
+               uint32_t spi_sts;
+               int temp;
+
+               spi_sts = readl(&regs->spi_sts);
+               rx_lvl = ((spi_sts >> 15) & 0x7f);
+               tx_lvl = ((spi_sts >> 6) & 0x7f);
+               while (tx_lvl < 32 && out_bytes) {
+                       temp = 0xffffffff;
+                       writel(temp, &regs->tx_data);
+                       out_bytes -= 4;
+                       tx_lvl += 4;
+               }
+               while (rx_lvl >= 4 && in_bytes) {
+                       temp = readl(&regs->rx_data);
+                       if (rxp)
+                               *rxp++ = temp;
+                       in_bytes -= 4;
+                       rx_lvl -= 4;
+               }
+       }
+}
+
+/*
+ * Copy uboot from spi flash to RAM
+ *
+ * @parma uboot_size   size of u-boot to copy
+ * @param uboot_addr   address in u-boot to copy
+ */
+static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
+{
+       int upto, todo;
+       int i, timeout = 100;
+       struct exynos_spi *regs = (struct exynos_spi *)CONFIG_ENV_SPI_BASE;
+
+       set_spi_clk(PERIPH_ID_SPI1, 50000000); /* set spi clock to 50Mhz */
+       /* set the spi1 GPIO */
+       exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
+
+       /* set pktcnt and enable it */
+       writel(4 | SPI_PACKET_CNT_EN, &regs->pkt_cnt);
+       /* set FB_CLK_SEL */
+       writel(SPI_FB_DELAY_180, &regs->fb_clk);
+       /* set CH_WIDTH and BUS_WIDTH as word */
+       setbits_le32(&regs->mode_cfg, SPI_MODE_CH_WIDTH_WORD |
+                                       SPI_MODE_BUS_WIDTH_WORD);
+       clrbits_le32(&regs->ch_cfg, SPI_CH_CPOL_L); /* CPOL: active high */
+
+       /* clear rx and tx channel if set priveously */
+       clrbits_le32(&regs->ch_cfg, SPI_RX_CH_ON | SPI_TX_CH_ON);
+
+       setbits_le32(&regs->swap_cfg, SPI_RX_SWAP_EN |
+                       SPI_RX_BYTE_SWAP |
+                       SPI_RX_HWORD_SWAP);
+
+       /* do a soft reset */
+       setbits_le32(&regs->ch_cfg, SPI_CH_RST);
+       clrbits_le32(&regs->ch_cfg, SPI_CH_RST);
+
+       /* now set rx and tx channel ON */
+       setbits_le32(&regs->ch_cfg, SPI_RX_CH_ON | SPI_TX_CH_ON | SPI_CH_HS_EN);
+       clrbits_le32(&regs->cs_reg, SPI_SLAVE_SIG_INACT); /* CS low */
+
+       /* Send read instruction (0x3h) followed by a 24 bit addr */
+       writel((SF_READ_DATA_CMD << 24) | SPI_FLASH_UBOOT_POS, &regs->tx_data);
+
+       /* waiting for TX done */
+       while (!(readl(&regs->spi_sts) & SPI_ST_TX_DONE)) {
+               if (!timeout) {
+                       debug("SPI TIMEOUT\n");
+                       break;
+               }
+               timeout--;
+       }
+
+       for (upto = 0, i = 0; upto < uboot_size; upto += todo, i++) {
+               todo = min(uboot_size - upto, (1 << 15));
+               spi_rx_tx(regs, todo, (void *)(uboot_addr),
+                         (void *)(SPI_FLASH_UBOOT_POS), i);
+       }
+
+       setbits_le32(&regs->cs_reg, SPI_SLAVE_SIG_INACT);/* make the CS high */
+
+       /*
+        * Let put controller mode to BYTE as
+        * SPI driver does not support WORD mode yet
+        */
+       clrbits_le32(&regs->mode_cfg, SPI_MODE_CH_WIDTH_WORD |
+                                       SPI_MODE_BUS_WIDTH_WORD);
+       writel(0, &regs->swap_cfg);
+
+       /*
+        * Flush spi tx, rx fifos and reset the SPI controller
+        * and clear rx/tx channel
+        */
+       clrsetbits_le32(&regs->ch_cfg, SPI_CH_HS_EN, SPI_CH_RST);
+       clrbits_le32(&regs->ch_cfg, SPI_CH_RST);
+       clrbits_le32(&regs->ch_cfg, SPI_TX_CH_ON | SPI_RX_CH_ON);
+}
+#endif
+
 /*
 * Copy U-boot from mmc to RAM:
 * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
@@ -70,6 +188,9 @@ void copy_uboot_to_ram(void)
 
        u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
        u32 offset = 0, size = 0;
+#ifdef CONFIG_SPI_BOOTING
+       struct spl_machine_param *param = spl_get_machine_params();
+#endif
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
        u32 (*copy_bl2_from_emmc)(u32 nblock, u32 dst);
        void (*end_bootop_from_emmc)(void);
@@ -91,9 +212,8 @@ void copy_uboot_to_ram(void)
        switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
        case BOOT_MODE_SERIAL:
-               offset = SPI_FLASH_UBOOT_POS;
-               size = CONFIG_BL2_SIZE;
-               copy_bl2 = get_irom_func(SPI_INDEX);
+               /* Customised function to copy u-boot from SF */
+               exynos_spi_copy(param->uboot_size, CONFIG_SYS_TEXT_BASE);
                break;
 #endif
        case BOOT_MODE_MMC:
index 24b4c18..6367e09 100644 (file)
@@ -14,6 +14,7 @@
 .arch_extension sec
 .arch_extension virt
 
+       .align  5
 /* the vector table for secure state and HYP mode */
 _monitor_vectors:
        .word 0 /* reset */
@@ -32,7 +33,6 @@ _monitor_vectors:
  * to non-secure state.
  * We use only r0 and r1 here, due to constraints in the caller.
  */
-       .align  5
 _secure_monitor:
        mrc     p15, 0, r1, c1, c1, 0           @ read SCR
        bic     r1, r1, #0x4e                   @ clear IRQ, FIQ, EA, nET bits
index 4d3a165..59f5352 100644 (file)
@@ -17,6 +17,11 @@ obj-y        += vc.o
 obj-y  += abb.o
 endif
 
+ifneq ($(CONFIG_OMAP54XX),)
+obj-y  += pipe3-phy.o
+obj-$(CONFIG_SCSI_AHCI_PLAT) += sata.o
+endif
+
 ifeq ($(CONFIG_OMAP34XX),)
 obj-y  += boot-common.o
 obj-y  += lowlevel_init.o
index b0e1caa..5a3f285 100644 (file)
@@ -206,7 +206,7 @@ void emif_update_timings(u32 base, const struct emif_regs *regs)
        }
 }
 
-static void ddr3_leveling(u32 base, const struct emif_regs *regs)
+static void omap5_ddr3_leveling(u32 base, const struct emif_regs *regs)
 {
        struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
 
@@ -217,47 +217,86 @@ static void ddr3_leveling(u32 base, const struct emif_regs *regs)
 
        /*
         * Set invert_clkout (if activated)--DDR_PHYCTRL_1
-        * Invert clock adds an additional half cycle delay on the command
-        * interface.  The additional half cycle, is usually meant to enable
-        * leveling in the situation that DQS is later than CK on the board.It
-        * also helps provide some additional margin for leveling.
+        * Invert clock adds an additional half cycle delay on the
+        * command interface.  The additional half cycle, is usually
+        * meant to enable leveling in the situation that DQS is later
+        * than CK on the board.It also helps provide some additional
+        * margin for leveling.
         */
-       writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1);
-       writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw);
+       writel(regs->emif_ddr_phy_ctlr_1,
+              &emif->emif_ddr_phy_ctrl_1);
+
+       writel(regs->emif_ddr_phy_ctlr_1,
+              &emif->emif_ddr_phy_ctrl_1_shdw);
        __udelay(130);
 
        writel(((LP_MODE_DISABLE << EMIF_REG_LP_MODE_SHIFT)
-               & EMIF_REG_LP_MODE_MASK), &emif->emif_pwr_mgmt_ctrl);
+              & EMIF_REG_LP_MODE_MASK), &emif->emif_pwr_mgmt_ctrl);
 
        /* Launch Full leveling */
        writel(DDR3_FULL_LVL, &emif->emif_rd_wr_lvl_ctl);
 
        /* Wait till full leveling is complete */
        readl(&emif->emif_rd_wr_lvl_ctl);
-       __udelay(130);
+             __udelay(130);
 
        /* Read data eye leveling no of samples */
        config_data_eye_leveling_samples(base);
 
-       /* Launch 8 incremental WR_LVL- to compensate for PHY limitation */
-       writel(0x2 << EMIF_REG_WRLVLINC_INT_SHIFT, &emif->emif_rd_wr_lvl_ctl);
+       /*
+        * Launch 8 incremental WR_LVL- to compensate for
+        * PHY limitation.
+        */
+       writel(0x2 << EMIF_REG_WRLVLINC_INT_SHIFT,
+              &emif->emif_rd_wr_lvl_ctl);
+
        __udelay(130);
 
        /* Launch Incremental leveling */
        writel(DDR3_INC_LVL, &emif->emif_rd_wr_lvl_ctl);
-       __udelay(130);
+              __udelay(130);
 }
 
-static void ddr3_sw_leveling(u32 base, const struct emif_regs *regs)
+static void dra7_ddr3_leveling(u32 base, const struct emif_regs *regs)
 {
        struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
 
-       writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1);
-       writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw);
+       u32 fifo_reg;
+
+       fifo_reg = readl(&emif->emif_ddr_fifo_misaligned_clear_1);
+       writel(fifo_reg | 0x00000100,
+              &emif->emif_ddr_fifo_misaligned_clear_1);
+
+       fifo_reg = readl(&emif->emif_ddr_fifo_misaligned_clear_2);
+       writel(fifo_reg | 0x00000100,
+              &emif->emif_ddr_fifo_misaligned_clear_2);
+
+       /* Launch Full leveling */
+       writel(DDR3_FULL_LVL, &emif->emif_rd_wr_lvl_ctl);
+
+       /* Wait till full leveling is complete */
+       readl(&emif->emif_rd_wr_lvl_ctl);
+             __udelay(130);
+
+       /* Read data eye leveling no of samples */
        config_data_eye_leveling_samples(base);
 
-       writel(regs->emif_rd_wr_lvl_ctl, &emif->emif_rd_wr_lvl_ctl);
-       writel(regs->sdram_config, &emif->emif_sdram_config);
+       /*
+        * Disable leveling. This is because if leveling is kept
+        * enabled, then PHY triggers a false leveling during
+        * EMIF-idle scenario which results in wrong delay
+        * values getting updated. After this the EMIF becomes
+        * unaccessible. So disable it after the first time
+        */
+       writel(0x0, &emif->emif_rd_wr_lvl_rmp_ctl);
+}
+
+static void ddr3_leveling(u32 base, const struct emif_regs *regs)
+{
+       if (is_omap54xx())
+               omap5_ddr3_leveling(base, regs);
+       else
+               dra7_ddr3_leveling(base, regs);
 }
 
 static void ddr3_init(u32 base, const struct emif_regs *regs)
@@ -270,9 +309,6 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
         * defined, contents of mode Registers must be fully initialized.
         * H/W takes care of this initialization
         */
-       writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
-       writel(regs->sdram_config_init, &emif->emif_sdram_config);
-
        writel(regs->emif_ddr_phy_ctlr_1_init, &emif->emif_ddr_phy_ctrl_1);
 
        /* Update timing registers */
@@ -283,15 +319,24 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
        writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl);
        writel(regs->read_idle_ctrl, &emif->emif_read_idlectrl);
 
-       do_ext_phy_settings(base, regs);
+       /*
+        * The same sequence should work on OMAP5432 as well. But strange that
+        * it is not working
+        */
+       if (omap_revision() == DRA752_ES1_0) {
+               do_ext_phy_settings(base, regs);
+               writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
+               writel(regs->sdram_config_init, &emif->emif_sdram_config);
+       } else {
+               writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
+               writel(regs->sdram_config_init, &emif->emif_sdram_config);
+               do_ext_phy_settings(base, regs);
+       }
 
        /* enable leveling */
        writel(regs->emif_rd_wr_lvl_rmp_ctl, &emif->emif_rd_wr_lvl_rmp_ctl);
 
-       if (omap_revision() == DRA752_ES1_0)
-               ddr3_sw_leveling(base, regs);
-       else
-               ddr3_leveling(base, regs);
+       ddr3_leveling(base, regs);
 }
 
 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
@@ -1079,10 +1124,7 @@ static void do_sdram_init(u32 base)
        if (warm_reset() && (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3)) {
                set_lpmode_selfrefresh(base);
                emif_reset_phy(base);
-               if (omap_revision() == DRA752_ES1_0)
-                       ddr3_sw_leveling(base, regs);
-               else
-                       ddr3_leveling(base, regs);
+               ddr3_leveling(base, regs);
        }
 
        /* Write to the shadow registers */
@@ -1244,6 +1286,42 @@ void dmm_init(u32 base)
 
 }
 
+static void do_bug0039_workaround(u32 base)
+{
+       u32 val, i, clkctrl;
+       struct emif_reg_struct *emif_base = (struct emif_reg_struct *)base;
+       const struct read_write_regs *bug_00339_regs;
+       u32 iterations;
+       u32 *phy_status_base = &emif_base->emif_ddr_phy_status[0];
+       u32 *phy_ctrl_base = &emif_base->emif_ddr_ext_phy_ctrl_1;
+
+       if (is_dra7xx())
+               phy_status_base++;
+
+       bug_00339_regs = get_bug_regs(&iterations);
+
+       /* Put EMIF in to idle */
+       clkctrl = __raw_readl((*prcm)->cm_memif_clkstctrl);
+       __raw_writel(0x0, (*prcm)->cm_memif_clkstctrl);
+
+       /* Copy the phy status registers in to phy ctrl shadow registers */
+       for (i = 0; i < iterations; i++) {
+               val = __raw_readl(phy_status_base +
+                                 bug_00339_regs[i].read_reg - 1);
+
+               __raw_writel(val, phy_ctrl_base +
+                            ((bug_00339_regs[i].write_reg - 1) << 1));
+
+               __raw_writel(val, phy_ctrl_base +
+                            (bug_00339_regs[i].write_reg << 1) - 1);
+       }
+
+       /* Disable leveling */
+       writel(0x0, &emif_base->emif_rd_wr_lvl_rmp_ctl);
+
+       __raw_writel(clkctrl,  (*prcm)->cm_memif_clkstctrl);
+}
+
 /*
  * SDRAM initialization:
  * SDRAM initialization has two parts:
@@ -1319,5 +1397,11 @@ void sdram_init(void)
                        debug("get_ram_size() successful");
        }
 
+       if (sdram_type == EMIF_SDRAM_TYPE_DDR3 &&
+           (!in_sdram && !warm_reset())) {
+               do_bug0039_workaround(EMIF1_BASE);
+               do_bug0039_workaround(EMIF2_BASE);
+       }
+
        debug("<<sdram_init()\n");
 }
diff --git a/arch/arm/cpu/armv7/omap-common/pipe3-phy.c b/arch/arm/cpu/armv7/omap-common/pipe3-phy.c
new file mode 100644 (file)
index 0000000..b71d769
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * TI PIPE3 PHY
+ *
+ * (C) Copyright 2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <sata.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include "pipe3-phy.h"
+
+/* PLLCTRL Registers */
+#define PLL_STATUS              0x00000004
+#define PLL_GO                  0x00000008
+#define PLL_CONFIGURATION1      0x0000000C
+#define PLL_CONFIGURATION2      0x00000010
+#define PLL_CONFIGURATION3      0x00000014
+#define PLL_CONFIGURATION4      0x00000020
+
+#define PLL_REGM_MASK           0x001FFE00
+#define PLL_REGM_SHIFT          9
+#define PLL_REGM_F_MASK         0x0003FFFF
+#define PLL_REGM_F_SHIFT        0
+#define PLL_REGN_MASK           0x000001FE
+#define PLL_REGN_SHIFT          1
+#define PLL_SELFREQDCO_MASK     0x0000000E
+#define PLL_SELFREQDCO_SHIFT    1
+#define PLL_SD_MASK             0x0003FC00
+#define PLL_SD_SHIFT            10
+#define SET_PLL_GO              0x1
+#define PLL_TICOPWDN            BIT(16)
+#define PLL_LDOPWDN             BIT(15)
+#define PLL_LOCK                0x2
+#define PLL_IDLE                0x1
+
+/* PHY POWER CONTROL Register */
+#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_MASK         0x003FC000
+#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT        0xE
+
+#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_MASK        0xFFC00000
+#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_SHIFT       0x16
+
+#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON       0x3
+#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF      0x0
+
+
+#define PLL_IDLE_TIME   100     /* in milliseconds */
+#define PLL_LOCK_TIME   100     /* in milliseconds */
+
+static inline u32 omap_pipe3_readl(void __iomem *addr, unsigned offset)
+{
+       return __raw_readl(addr + offset);
+}
+
+static inline void omap_pipe3_writel(void __iomem *addr, unsigned offset,
+               u32 data)
+{
+       __raw_writel(data, addr + offset);
+}
+
+static struct pipe3_dpll_params *omap_pipe3_get_dpll_params(struct omap_pipe3
+                                                                       *pipe3)
+{
+       u32 rate;
+       struct pipe3_dpll_map *dpll_map = pipe3->dpll_map;
+
+       rate = get_sys_clk_freq();
+
+       for (; dpll_map->rate; dpll_map++) {
+               if (rate == dpll_map->rate)
+                       return &dpll_map->params;
+       }
+
+       printf("%s: No DPLL configuration for %u Hz SYS CLK\n",
+              __func__, rate);
+       return NULL;
+}
+
+
+static int omap_pipe3_wait_lock(struct omap_pipe3 *phy)
+{
+       u32 val;
+       int timeout = PLL_LOCK_TIME;
+
+       do {
+               mdelay(1);
+               val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
+               if (val & PLL_LOCK)
+                       break;
+       } while (--timeout);
+
+       if (!(val & PLL_LOCK)) {
+               printf("%s: DPLL failed to lock\n", __func__);
+               return -EBUSY;
+       }
+
+       return 0;
+}
+
+static int omap_pipe3_dpll_program(struct omap_pipe3 *phy)
+{
+       u32                     val;
+       struct pipe3_dpll_params *dpll_params;
+
+       dpll_params = omap_pipe3_get_dpll_params(phy);
+       if (!dpll_params) {
+               printf("%s: Invalid DPLL parameters\n", __func__);
+               return -EINVAL;
+       }
+
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1);
+       val &= ~PLL_REGN_MASK;
+       val |= dpll_params->n << PLL_REGN_SHIFT;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val);
+
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION2);
+       val &= ~PLL_SELFREQDCO_MASK;
+       val |= dpll_params->freq << PLL_SELFREQDCO_SHIFT;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION2, val);
+
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1);
+       val &= ~PLL_REGM_MASK;
+       val |= dpll_params->m << PLL_REGM_SHIFT;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val);
+
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION4);
+       val &= ~PLL_REGM_F_MASK;
+       val |= dpll_params->mf << PLL_REGM_F_SHIFT;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION4, val);
+
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION3);
+       val &= ~PLL_SD_MASK;
+       val |= dpll_params->sd << PLL_SD_SHIFT;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION3, val);
+
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_GO, SET_PLL_GO);
+
+       return omap_pipe3_wait_lock(phy);
+}
+
+static void omap_control_phy_power(struct omap_pipe3 *phy, int on)
+{
+       u32 val, rate;
+
+       val = readl(phy->power_reg);
+
+       rate = get_sys_clk_freq();
+       rate = rate/1000000;
+
+       if (on) {
+               val &= ~(OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_MASK |
+                               OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_MASK);
+               val |= OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON <<
+                       OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT;
+               val |= rate <<
+                       OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_SHIFT;
+       } else {
+               val &= ~OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_MASK;
+               val |= OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF <<
+                       OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT;
+       }
+
+       writel(val, phy->power_reg);
+}
+
+int phy_pipe3_power_on(struct omap_pipe3 *phy)
+{
+       int ret;
+       u32 val;
+
+       /* Program the DPLL only if not locked */
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
+       if (!(val & PLL_LOCK)) {
+               ret = omap_pipe3_dpll_program(phy);
+               if (ret)
+                       return ret;
+       } else {
+               /* else just bring it out of IDLE mode */
+               val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION2);
+               if (val & PLL_IDLE) {
+                       val &= ~PLL_IDLE;
+                       omap_pipe3_writel(phy->pll_ctrl_base,
+                                         PLL_CONFIGURATION2, val);
+                       ret = omap_pipe3_wait_lock(phy);
+                       if (ret)
+                               return ret;
+               }
+       }
+
+       /* Power up the PHY */
+       omap_control_phy_power(phy, 1);
+
+       return 0;
+}
+
+int phy_pipe3_power_off(struct omap_pipe3 *phy)
+{
+       u32 val;
+       int timeout = PLL_IDLE_TIME;
+
+       /* Power down the PHY */
+       omap_control_phy_power(phy, 0);
+
+       /* Put DPLL in IDLE mode */
+       val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION2);
+       val |= PLL_IDLE;
+       omap_pipe3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION2, val);
+
+       /* wait for LDO and Oscillator to power down */
+       do {
+               mdelay(1);
+               val = omap_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
+               if ((val & PLL_TICOPWDN) && (val & PLL_LDOPWDN))
+                       break;
+       } while (--timeout);
+
+       if (!(val & PLL_TICOPWDN) || !(val & PLL_LDOPWDN)) {
+               printf("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n",
+                      __func__, val);
+               return -EBUSY;
+       }
+
+       return 0;
+}
+
diff --git a/arch/arm/cpu/armv7/omap-common/pipe3-phy.h b/arch/arm/cpu/armv7/omap-common/pipe3-phy.h
new file mode 100644 (file)
index 0000000..441f49a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * TI PIPE3 PHY
+ *
+ * (C) Copyright 2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __OMAP_PIPE3_PHY_H
+#define __OMAP_PIPE3_PHY_H
+
+struct pipe3_dpll_params {
+       u16     m;
+       u8      n;
+       u8      freq:3;
+       u8      sd;
+       u32     mf;
+};
+
+struct pipe3_dpll_map {
+       unsigned long rate;
+       struct pipe3_dpll_params params;
+};
+
+struct omap_pipe3 {
+       void __iomem            *pll_ctrl_base;
+       void __iomem            *power_reg;
+       struct pipe3_dpll_map   *dpll_map;
+};
+
+
+int phy_pipe3_power_on(struct omap_pipe3 *phy);
+int phy_pipe3_power_off(struct omap_pipe3 *pipe3);
+
+#endif /* __OMAP_PIPE3_PHY_H */
diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c
new file mode 100644 (file)
index 0000000..f5468c4
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * TI SATA platform driver
+ *
+ * (C) Copyright 2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <ahci.h>
+#include <scsi.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sata.h>
+#include <asm/io.h>
+#include "pipe3-phy.h"
+
+static struct pipe3_dpll_map dpll_map_sata[] = {
+       {12000000, {1000, 7, 4, 6, 0} },        /* 12 MHz */
+       {16800000, {714, 7, 4, 6, 0} },         /* 16.8 MHz */
+       {19200000, {625, 7, 4, 6, 0} },         /* 19.2 MHz */
+       {20000000, {600, 7, 4, 6, 0} },         /* 20 MHz */
+       {26000000, {461, 7, 4, 6, 0} },         /* 26 MHz */
+       {38400000, {312, 7, 4, 6, 0} },         /* 38.4 MHz */
+       { },                                    /* Terminator */
+};
+
+struct omap_pipe3 sata_phy = {
+       .pll_ctrl_base = (void __iomem *)TI_SATA_PLLCTRL_BASE,
+       /* .power_reg is updated at runtime */
+       .dpll_map = dpll_map_sata,
+};
+
+int omap_sata_init(void)
+{
+       int ret;
+       u32 val;
+
+       u32 const clk_domains_sata[] = {
+               0
+       };
+
+       u32 const clk_modules_hw_auto_sata[] = {
+               (*prcm)->cm_l3init_ocp2scp3_clkctrl,
+               0
+       };
+
+       u32 const clk_modules_explicit_en_sata[] = {
+               (*prcm)->cm_l3init_sata_clkctrl,
+               0
+       };
+
+       do_enable_clocks(clk_domains_sata,
+                        clk_modules_hw_auto_sata,
+                        clk_modules_explicit_en_sata,
+                        0);
+
+       /* Enable optional functional clock for SATA */
+       setbits_le32((*prcm)->cm_l3init_sata_clkctrl,
+                    SATA_CLKCTRL_OPTFCLKEN_MASK);
+
+       sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata;
+
+       /* Power up the PHY */
+       phy_pipe3_power_on(&sata_phy);
+
+       /* Enable SATA module, No Idle, No Standby */
+       val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO;
+       writel(val, TI_SATA_WRAPPER_BASE + TI_SATA_SYSCONFIG);
+
+       ret = ahci_init(DWC_AHSATA_BASE);
+       scsi_scan(1);
+
+       return ret;
+}
index 14fc7e8..1bc27bd 100644 (file)
@@ -730,8 +730,6 @@ void per_clocks_enable(void)
                sr32(&prcm_base->fclken_cam, 0, 32, FCK_CAM_ON);
                sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
        }
-       sr32(&prcm_base->fclken_per, 0, 32, FCK_PER_ON);
-       sr32(&prcm_base->iclken_per, 0, 32, ICK_PER_ON);
 
        sdelay(1000);
 }
index 6a225c8..1b2f439 100644 (file)
@@ -288,17 +288,21 @@ struct vcores_data omap4460_volts = {
        .mm.pmic = &twl6030,
 };
 
+/*
+ * Take closest integer part of the mV value corresponding to a TWL6032 SMPS
+ * voltage selection code. Aligned with OMAP4470 ES1.0 OCA V.0.7.
+ */
 struct vcores_data omap4470_volts = {
-       .mpu.value = 1200,
+       .mpu.value = 1202,
        .mpu.addr = SMPS_REG_ADDR_SMPS1,
        .mpu.pmic = &twl6030,
 
        .core.value = 1126,
-       .core.addr = SMPS_REG_ADDR_SMPS1,
+       .core.addr = SMPS_REG_ADDR_SMPS2,
        .core.pmic = &twl6030,
 
-       .mm.value = 1137,
-       .mm.addr = SMPS_REG_ADDR_SMPS1,
+       .mm.value = 1139,
+       .mm.addr = SMPS_REG_ADDR_SMPS5,
        .mm.pmic = &twl6030,
 };
 
index e4c8316..6903696 100644 (file)
@@ -32,7 +32,7 @@
 
 #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
 
-static const struct emif_regs emif_regs_elpida_200_mhz_2cs = {
+const struct emif_regs emif_regs_elpida_200_mhz_2cs = {
        .sdram_config_init              = 0x80000eb9,
        .sdram_config                   = 0x80001ab9,
        .ref_ctrl                       = 0x0000030c,
@@ -46,7 +46,7 @@ static const struct emif_regs emif_regs_elpida_200_mhz_2cs = {
        .emif_ddr_phy_ctlr_1            = 0x049ff808
 };
 
-static const struct emif_regs emif_regs_elpida_380_mhz_1cs = {
+const struct emif_regs emif_regs_elpida_380_mhz_1cs = {
        .sdram_config_init              = 0x80000eb1,
        .sdram_config                   = 0x80001ab1,
        .ref_ctrl                       = 0x000005cd,
@@ -321,3 +321,8 @@ void get_lpddr2_mr_regs(const struct lpddr2_mr_regs **regs)
 {
        *regs = &mr_regs;
 }
+
+__weak const struct read_write_regs *get_bug_regs(u32 *iterations)
+{
+       return 0;
+}
index a1b249e..82910e8 100644 (file)
@@ -600,6 +600,7 @@ const struct ctrl_ioregs ioregs_omap5432_es1 = {
        .ctrl_ddrio_1 = DDR_IO_1_VREF_CELLS_DDR3_VALUE,
        .ctrl_ddrio_2 = DDR_IO_2_VREF_CELLS_DDR3_VALUE,
        .ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES,
+       .ctrl_emif_sdram_config_ext_final = SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
 };
 
 const struct ctrl_ioregs ioregs_omap5432_es2 = {
@@ -610,16 +611,18 @@ const struct ctrl_ioregs ioregs_omap5432_es2 = {
        .ctrl_ddrio_1 = DDR_IO_1_VREF_CELLS_DDR3_VALUE_ES2,
        .ctrl_ddrio_2 = DDR_IO_2_VREF_CELLS_DDR3_VALUE_ES2,
        .ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES,
+       .ctrl_emif_sdram_config_ext_final = SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
 };
 
 const struct ctrl_ioregs ioregs_dra7xx_es1 = {
        .ctrl_ddrch = 0x40404040,
        .ctrl_lpddr2ch = 0x40404040,
        .ctrl_ddr3ch = 0x80808080,
-       .ctrl_ddrio_0 = 0xbae8c631,
-       .ctrl_ddrio_1 = 0xb46318d8,
+       .ctrl_ddrio_0 = 0xA2084210,
+       .ctrl_ddrio_1 = 0x84210840,
        .ctrl_ddrio_2 = 0x84210000,
-       .ctrl_emif_sdram_config_ext = 0xb2c00000,
+       .ctrl_emif_sdram_config_ext = 0x0001C1A7,
+       .ctrl_emif_sdram_config_ext_final = 0x000101A7,
        .ctrl_ddr_ctrl_ext_0 = 0xA2000000,
 };
 
index 1065891..5386ae0 100644 (file)
@@ -168,12 +168,6 @@ void do_io_settings(void)
                io_settings_lpddr2();
        else
                io_settings_ddr3();
-
-       /* Efuse settings */
-       writel(EFUSE_1, (*ctrl)->control_efuse_1);
-       writel(EFUSE_2, (*ctrl)->control_efuse_2);
-       writel(EFUSE_3, (*ctrl)->control_efuse_3);
-       writel(EFUSE_4, (*ctrl)->control_efuse_4);
 }
 
 static const struct srcomp_params srcomp_parameters[NUM_SYS_CLKS] = {
@@ -297,13 +291,17 @@ void srcomp_enable(void)
 
 void config_data_eye_leveling_samples(u32 emif_base)
 {
+       const struct ctrl_ioregs *ioregs;
+
+       get_ioregs(&ioregs);
+
        /*EMIF_SDRAM_CONFIG_EXT-Read data eye leveling no of samples =4*/
        if (emif_base == EMIF1_BASE)
-               writel(SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
-                       (*ctrl)->control_emif1_sdram_config_ext);
+               writel(ioregs->ctrl_emif_sdram_config_ext_final,
+                      (*ctrl)->control_emif1_sdram_config_ext);
        else if (emif_base == EMIF2_BASE)
-               writel(SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
-                       (*ctrl)->control_emif2_sdram_config_ext);
+               writel(ioregs->ctrl_emif_sdram_config_ext_final,
+                      (*ctrl)->control_emif2_sdram_config_ext);
 }
 
 void init_omap_revision(void)
index 304ac1c..77c428b 100644 (file)
@@ -203,8 +203,10 @@ struct prcm_regs const omap5_es1_prcm = {
        .cm_l3init_hsusbotg_clkctrl = 0x4a009360,
        .cm_l3init_hsusbtll_clkctrl = 0x4a009368,
        .cm_l3init_p1500_clkctrl = 0x4a009378,
+       .cm_l3init_sata_clkctrl = 0x4a009388,
        .cm_l3init_fsusb_clkctrl = 0x4a0093d0,
        .cm_l3init_ocp2scp1_clkctrl = 0x4a0093e0,
+       .cm_l3init_ocp2scp3_clkctrl = 0x4a0093e8,
 
        /* cm2.l4per */
        .cm_l4per_clkstctrl = 0x4a009400,
@@ -296,6 +298,7 @@ struct omap_sys_ctrl_regs const omap5_ctrl = {
        .control_status                         = 0x4A002134,
        .control_std_fuse_opp_vdd_mpu_2         = 0x4A0021B4,
        .control_phy_power_usb                  = 0x4A002370,
+       .control_phy_power_sata                 = 0x4A002374,
        .control_padconf_core_base              = 0x4A002800,
        .control_paconf_global                  = 0x4A002DA0,
        .control_paconf_mode                    = 0x4A002DA4,
@@ -373,6 +376,7 @@ struct omap_sys_ctrl_regs const omap5_ctrl = {
 
 struct omap_sys_ctrl_regs const dra7xx_ctrl = {
        .control_status                         = 0x4A002134,
+       .control_phy_power_sata                 = 0x4A002374,
        .control_core_mac_id_0_lo               = 0x4A002514,
        .control_core_mac_id_0_hi               = 0x4A002518,
        .control_core_mac_id_1_lo               = 0x4A00251C,
@@ -698,6 +702,7 @@ struct prcm_regs const omap5_es2_prcm = {
        .cm_l3init_hsusbotg_clkctrl = 0x4a009660,
        .cm_l3init_hsusbtll_clkctrl = 0x4a009668,
        .cm_l3init_p1500_clkctrl = 0x4a009678,
+       .cm_l3init_sata_clkctrl = 0x4a009688,
        .cm_l3init_fsusb_clkctrl = 0x4a0096d0,
        .cm_l3init_ocp2scp1_clkctrl = 0x4a0096e0,
        .cm_l3init_ocp2scp3_clkctrl = 0x4a0096e8,
@@ -891,9 +896,11 @@ struct prcm_regs const dra7xx_prcm = {
        .cm_l3init_hsusbhost_clkctrl            = 0x4a009340,
        .cm_l3init_hsusbotg_clkctrl             = 0x4a009348,
        .cm_l3init_hsusbtll_clkctrl             = 0x4a009350,
+       .cm_l3init_sata_clkctrl                 = 0x4a009388,
        .cm_gmac_clkstctrl                      = 0x4a0093c0,
        .cm_gmac_gmac_clkctrl                   = 0x4a0093d0,
        .cm_l3init_ocp2scp1_clkctrl             = 0x4a0093e0,
+       .cm_l3init_ocp2scp3_clkctrl             = 0x4a0093e8,
 
        /* cm2.l4per */
        .cm_l4per_clkstctrl                     = 0x4a009700,
index e65c116..2e18706 100644 (file)
@@ -148,13 +148,13 @@ const struct emif_regs emif_1_regs_ddr3_532_mhz_1cs_dra_es1 = {
        .read_idle_ctrl                 = 0x00050000,
        .zq_config                      = 0x0007190B,
        .temp_alert_config              = 0x00000000,
-       .emif_ddr_phy_ctlr_1_init       = 0x0E20400A,
-       .emif_ddr_phy_ctlr_1            = 0x0E24400A,
-       .emif_ddr_ext_phy_ctrl_1        = 0x04040100,
-       .emif_ddr_ext_phy_ctrl_2        = 0x009E009E,
-       .emif_ddr_ext_phy_ctrl_3        = 0x009E009E,
-       .emif_ddr_ext_phy_ctrl_4        = 0x009E009E,
-       .emif_ddr_ext_phy_ctrl_5        = 0x009E009E,
+       .emif_ddr_phy_ctlr_1_init       = 0x0024400A,
+       .emif_ddr_phy_ctlr_1            = 0x0024400A,
+       .emif_ddr_ext_phy_ctrl_1        = 0x10040100,
+       .emif_ddr_ext_phy_ctrl_2        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_3        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_4        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_5        = 0x00B000B0,
        .emif_rd_wr_lvl_rmp_win         = 0x00000000,
        .emif_rd_wr_lvl_rmp_ctl         = 0x80000000,
        .emif_rd_wr_lvl_ctl             = 0x00000000,
@@ -172,13 +172,13 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
        .read_idle_ctrl                 = 0x00050000,
        .zq_config                      = 0x0007190B,
        .temp_alert_config              = 0x00000000,
-       .emif_ddr_phy_ctlr_1_init       = 0x0020400A,
-       .emif_ddr_phy_ctlr_1            = 0x0E24400A,
-       .emif_ddr_ext_phy_ctrl_1        = 0x04040100,
-       .emif_ddr_ext_phy_ctrl_2        = 0x009D009D,
-       .emif_ddr_ext_phy_ctrl_3        = 0x009D009D,
-       .emif_ddr_ext_phy_ctrl_4        = 0x009D009D,
-       .emif_ddr_ext_phy_ctrl_5        = 0x009D009D,
+       .emif_ddr_phy_ctlr_1_init       = 0x0024400A,
+       .emif_ddr_phy_ctlr_1            = 0x0024400A,
+       .emif_ddr_ext_phy_ctrl_1        = 0x10040100,
+       .emif_ddr_ext_phy_ctrl_2        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_3        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_4        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_5        = 0x00B000B0,
        .emif_rd_wr_lvl_rmp_win         = 0x00000000,
        .emif_rd_wr_lvl_rmp_ctl         = 0x80000000,
        .emif_rd_wr_lvl_ctl             = 0x00000000,
@@ -306,7 +306,7 @@ void emif_get_device_details(u32 emif_nr,
 
 #endif /* CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS */
 
-const u32 ext_phy_ctrl_const_base[EMIF_EXT_PHY_CTRL_CONST_REG] = {
+const u32 ext_phy_ctrl_const_base[] = {
        0x01004010,
        0x00001004,
        0x04010040,
@@ -329,7 +329,7 @@ const u32 ext_phy_ctrl_const_base[EMIF_EXT_PHY_CTRL_CONST_REG] = {
        0x0
 };
 
-const u32 ddr3_ext_phy_ctrl_const_base_es1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
+const u32 ddr3_ext_phy_ctrl_const_base_es1[] = {
        0x01004010,
        0x00001004,
        0x04010040,
@@ -352,7 +352,7 @@ const u32 ddr3_ext_phy_ctrl_const_base_es1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
        0x0
 };
 
-const u32 ddr3_ext_phy_ctrl_const_base_es2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
+const u32 ddr3_ext_phy_ctrl_const_base_es2[] = {
        0x50D4350D,
        0x00000D43,
        0x04010040,
@@ -376,51 +376,61 @@ const u32 ddr3_ext_phy_ctrl_const_base_es2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
 };
 
 const u32
-dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
-       0x009E009E,
-       0x002E002E,
-       0x002E002E,
-       0x002E002E,
-       0x002E002E,
-       0x002E002E,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x004D004D,
-       0x0,
-       0x600020,
+dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[] = {
+       0x00B000B0,
+       0x00400040,
+       0x00400040,
+       0x00400040,
+       0x00400040,
+       0x00400040,
+       0x00800080,
+       0x00800080,
+       0x00800080,
+       0x00800080,
+       0x00800080,
+       0x00600060,
+       0x00600060,
+       0x00600060,
+       0x00600060,
+       0x00600060,
+       0x00800080,
+       0x00800080,
        0x40010080,
-       0x8102040
+       0x08102040,
+       0x0,
+       0x0,
+       0x0,
+       0x0,
+       0x0
 };
 
 const u32
-dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
-       0x009D009D,
-       0x002D002D,
-       0x002D002D,
-       0x002D002D,
-       0x002D002D,
-       0x002D002D,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
-       0x00570057,
+dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[] = {
+       0x00BB00BB,
+       0x00440044,
+       0x00440044,
+       0x00440044,
+       0x00440044,
+       0x00440044,
+       0x007F007F,
+       0x007F007F,
+       0x007F007F,
+       0x007F007F,
+       0x007F007F,
+       0x00600060,
+       0x00600060,
+       0x00600060,
+       0x00600060,
+       0x00600060,
        0x0,
-       0x600020,
+       0x00600020,
        0x40010080,
-       0x8102040
+       0x08102040,
+       0x0,
+       0x0,
+       0x0,
+       0x0,
+       0x0
 };
 
 const struct lpddr2_mr_regs mr_regs = {
@@ -431,27 +441,38 @@ const struct lpddr2_mr_regs mr_regs = {
        .mr16   = MR16_REF_FULL_ARRAY
 };
 
-static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr, const u32 **regs)
+static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr,
+                                            const u32 **regs,
+                                            u32 *size)
 {
        switch (omap_revision()) {
        case OMAP5430_ES1_0:
        case OMAP5430_ES2_0:
                *regs = ext_phy_ctrl_const_base;
+               *size = ARRAY_SIZE(ext_phy_ctrl_const_base);
                break;
        case OMAP5432_ES1_0:
                *regs = ddr3_ext_phy_ctrl_const_base_es1;
+               *size = ARRAY_SIZE(ddr3_ext_phy_ctrl_const_base_es1);
                break;
        case OMAP5432_ES2_0:
                *regs = ddr3_ext_phy_ctrl_const_base_es2;
+               *size = ARRAY_SIZE(ddr3_ext_phy_ctrl_const_base_es2);
                break;
        case DRA752_ES1_0:
-               if (emif_nr == 1)
+               if (emif_nr == 1) {
                        *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
-               else
+                       *size =
+                       ARRAY_SIZE(dra_ddr3_ext_phy_ctrl_const_base_es1_emif1);
+               } else {
                        *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif2;
+                       *size =
+                       ARRAY_SIZE(dra_ddr3_ext_phy_ctrl_const_base_es1_emif2);
+               }
                break;
        default:
                *regs = ddr3_ext_phy_ctrl_const_base_es2;
+               *size = ARRAY_SIZE(ddr3_ext_phy_ctrl_const_base_es2);
 
        }
 }
@@ -468,6 +489,7 @@ void do_ext_phy_settings(u32 base, const struct emif_regs *regs)
        u32 emif_nr;
        const u32 *ext_phy_ctrl_const_regs;
        u32 i = 0;
+       u32 size;
 
        emif_nr = (base == EMIF1_BASE) ? 1 : 2;
 
@@ -487,8 +509,10 @@ void do_ext_phy_settings(u32 base, const struct emif_regs *regs)
         * external phy 6-24 registers do not change with
         * ddr frequency
         */
-       emif_get_ext_phy_ctrl_const_regs(emif_nr, &ext_phy_ctrl_const_regs);
-       for (i = 0; i < EMIF_EXT_PHY_CTRL_CONST_REG; i++) {
+       emif_get_ext_phy_ctrl_const_regs(emif_nr,
+                                        &ext_phy_ctrl_const_regs, &size);
+
+       for (i = 0; i < size; i++) {
                writel(ext_phy_ctrl_const_regs[i],
                       emif_ext_phy_ctrl_base++);
                /* Update shadow registers */
@@ -545,6 +569,74 @@ static const struct lpddr2_device_timings dev_4G_S4_timings = {
        .min_tck        = &min_tck,
 };
 
+/*
+ * List of status registers to be controlled back to control registers
+ * after initial leveling
+ * readreg, writereg
+ */
+const struct read_write_regs omap5_bug_00339_regs[] = {
+       { 8,  5 },
+       { 9,  6 },
+       { 10, 7 },
+       { 14, 8 },
+       { 15, 9 },
+       { 16, 10 },
+       { 11, 2 },
+       { 12, 3 },
+       { 13, 4 },
+       { 17, 11 },
+       { 18, 12 },
+       { 19, 13 },
+};
+
+const struct read_write_regs dra_bug_00339_regs[] = {
+       { 7,  7 },
+       { 8,  8 },
+       { 9,  9 },
+       { 10, 10 },
+       { 11, 11 },
+       { 12, 2 },
+       { 13, 3 },
+       { 14, 4 },
+       { 15, 5 },
+       { 16, 6 },
+       { 17, 12 },
+       { 18, 13 },
+       { 19, 14 },
+       { 20, 15 },
+       { 21, 16 },
+       { 22, 17 },
+       { 23, 18 },
+       { 24, 19 },
+       { 25, 20 },
+       { 26, 21}
+};
+
+const struct read_write_regs *get_bug_regs(u32 *iterations)
+{
+       const struct read_write_regs *bug_00339_regs_ptr = NULL;
+
+       switch (omap_revision()) {
+       case OMAP5430_ES1_0:
+       case OMAP5430_ES2_0:
+       case OMAP5432_ES1_0:
+       case OMAP5432_ES2_0:
+               bug_00339_regs_ptr = omap5_bug_00339_regs;
+               *iterations = sizeof(omap5_bug_00339_regs)/
+                            sizeof(omap5_bug_00339_regs[0]);
+               break;
+       case DRA752_ES1_0:
+               bug_00339_regs_ptr = dra_bug_00339_regs;
+               *iterations = sizeof(dra_bug_00339_regs)/
+                            sizeof(dra_bug_00339_regs[0]);
+               break;
+       default:
+               printf("\n Error: UnKnown SOC");
+       }
+
+       return bug_00339_regs_ptr;
+}
+
 void emif_get_device_timings_sdp(u32 emif_nr,
                const struct lpddr2_device_timings **cs0_device_timings,
                const struct lpddr2_device_timings **cs1_device_timings)
index 5e296c4..2221999 100644 (file)
@@ -5,14 +5,13 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y = lowlevel_init.o
-obj-y += cpu_info.o
+obj-y = cpu_info.o
 obj-y += emac.o
 
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o
 obj-$(CONFIG_GLOBAL_TIMER) += timer.o
-obj-$(CONFIG_R8A7740) += cpu_info-r8a7740.o
-obj-$(CONFIG_R8A7740) += pfc-r8a7740.o
-obj-$(CONFIG_SH73A0) += cpu_info-sh73a0.o
-obj-$(CONFIG_SH73A0) += pfc-sh73a0.o
+obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
+obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-r8a7790.o pfc-r8a7790.o
+obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-r8a7791.o pfc-r8a7791.o
+obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
 obj-$(CONFIG_TMU_TIMER) += ../../../../sh/lib/time.o
diff --git a/arch/arm/cpu/armv7/rmobile/config.mk b/arch/arm/cpu/armv7/rmobile/config.mk
deleted file mode 100644 (file)
index 3a36ab6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-# Make ARMv5 to allow more compilers to work, even though its v7a.
-PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c b/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
new file mode 100644 (file)
index 0000000..7232e23
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
+ *     This file is r8a7790 processor support.
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+#include <common.h>
+#include <asm/io.h>
+
+#define PRR 0xFF000044
+
+u32 rmobile_get_cpu_type(void)
+{
+       return (readl(PRR) & 0x00007F00) >> 8;
+}
+
+u32 rmobile_get_cpu_rev_integer(void)
+{
+       return (readl(PRR) & 0x000000F0) >> 4;
+}
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c b/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
new file mode 100644 (file)
index 0000000..2de58ed
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+#include <common.h>
+#include <asm/io.h>
+
+#define PRR 0xFF000044
+
+u32 rmobile_get_cpu_type(void)
+{
+       u32 product;
+
+       product = readl(PRR);
+
+       return (u32)((product & 0x00007F00) >> 8);
+}
+
+u32 rmobile_get_cpu_rev_integer(void)
+{
+       u32 product;
+
+       product = readl(PRR);
+
+       return (u32)((product & 0x000000F0) >> 4);
+}
index 07a33fb..83d5282 100644 (file)
@@ -58,6 +58,16 @@ int print_cpuinfo(void)
                       rmobile_get_cpu_rev_fraction());
                break;
 
+       case 0x45:
+               printf("CPU: Renesas Electronics R8A7790 rev %d\n",
+                      rmobile_get_cpu_rev_integer());
+               break;
+
+       case 0x47:
+               printf("CPU: Renesas Electronics R8A7791 rev %d\n",
+                       rmobile_get_cpu_rev_integer());
+               break;
+
        default:
                printf("CPU: Renesas Electronics CPU rev %d.%d\n",
                       rmobile_get_cpu_rev_integer(),
diff --git a/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S b/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
new file mode 100644 (file)
index 0000000..e07cc80
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
+ *     This file is lager low level initialize.
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(lowlevel_init)
+       mrc     p15, 0, r4, c0, c0, 5 /* mpidr */
+       orr     r4, r4, r4, lsr #6
+       and     r4, r4, #7 /* id 0-3 = ca15.0,1,2,3 */
+
+       b do_lowlevel_init
+
+       .pool
+
+/*
+ * CPU ID #1-#3 come here
+ */
+       .align  4
+do_cpu_waiting:
+       ldr     r1, =0xe6180000 /* sysc */
+1:     ldr     r0, [r1, #0x20] /* sbar */
+       tst     r0, r0
+       beq     1b
+       bx      r0
+
+/*
+ * Only CPU ID #0 comes here
+ */
+       .align  4
+do_lowlevel_init:
+       /* surpress wfe if ca15 */
+       tst     r4, #4
+       mrceq p15, 0, r0, c1, c0, 1     /* actlr */
+       orreq r0, r0, #(1<<7)
+       mcreq p15, 0, r0, c1, c0, 1
+       /* and set l2 latency */
+       mrceq p15, 1, r0, c9, c0, 2     /* l2ctlr */
+       orreq r0, r0, #0x00000800
+       orreq r0, r0, #0x00000003
+       mcreq p15, 1, r0, c9, c0, 2
+
+       ldr     r3, =(CONFIG_SYS_INIT_SP_ADDR)
+       sub     sp, r3, #4
+       str     lr, [sp]
+
+       /* initialize system */
+       bl s_init
+
+       ldr     lr, [sp]
+       mov     pc, lr
+       nop
+ENDPROC(lowlevel_init)
+       .ltorg
diff --git a/arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c b/arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c
new file mode 100644 (file)
index 0000000..1259062
--- /dev/null
@@ -0,0 +1,829 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c
+ *     This file is r8a7790 processor support - PFC hardware block.
+ *
+ * Copy from linux-kernel:drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ * Copyright (C) 2013 Magnus Damm
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <sh_pfc.h>
+#include <asm/gpio.h>
+#include "pfc-r8a7790.h"
+
+enum {
+       PINMUX_RESERVED = 0,
+
+       PINMUX_DATA_BEGIN,
+       GP_ALL(DATA),
+       PINMUX_DATA_END,
+
+       PINMUX_INPUT_BEGIN,
+       GP_ALL(IN),
+       PINMUX_INPUT_END,
+
+       PINMUX_OUTPUT_BEGIN,
+       GP_ALL(OUT),
+       PINMUX_OUTPUT_END,
+
+       PINMUX_FUNCTION_BEGIN,
+       GP_ALL(FN),
+
+       /* GPSR0 */
+       FN_IP0_2_0, FN_IP0_5_3, FN_IP0_8_6, FN_IP0_11_9, FN_IP0_15_12,
+       FN_IP0_19_16, FN_IP0_22_20, FN_IP0_26_23, FN_IP0_30_27,
+       FN_IP1_3_0, FN_IP1_7_4, FN_IP1_11_8, FN_IP1_14_12,
+       FN_IP1_17_15, FN_IP1_21_18, FN_IP1_25_22, FN_IP1_27_26,
+       FN_IP1_29_28, FN_IP2_2_0, FN_IP2_5_3, FN_IP2_8_6, FN_IP2_11_9,
+       FN_IP2_14_12, FN_IP2_17_15, FN_IP2_21_18, FN_IP2_25_22,
+       FN_IP2_28_26, FN_IP3_3_0, FN_IP3_7_4, FN_IP3_11_8,
+       FN_IP3_14_12, FN_IP3_17_15,
+
+       /* GPSR1 */
+       FN_IP3_19_18, FN_IP3_22_20, FN_IP3_25_23, FN_IP3_28_26,
+       FN_IP3_31_29, FN_IP4_2_0, FN_IP4_5_3, FN_IP4_8_6, FN_IP4_11_9,
+       FN_IP4_14_12, FN_IP4_17_15, FN_IP4_20_18, FN_IP4_23_21,
+       FN_IP4_26_24, FN_IP4_29_27, FN_IP5_2_0, FN_IP5_5_3, FN_IP5_9_6,
+       FN_IP5_12_10, FN_IP5_14_13, FN_IP5_17_15, FN_IP5_20_18,
+       FN_IP5_23_21, FN_IP5_26_24, FN_IP5_29_27, FN_IP6_2_0,
+       FN_IP6_5_3, FN_IP6_8_6, FN_IP6_10_9, FN_IP6_13_11,
+
+       /* GPSR2 */
+       FN_IP7_28_27, FN_IP7_30_29, FN_IP8_1_0, FN_IP8_3_2, FN_IP8_5_4,
+       FN_IP8_7_6, FN_IP8_9_8, FN_IP8_11_10, FN_IP8_13_12, FN_IP8_15_14,
+       FN_IP8_17_16, FN_IP8_19_18, FN_IP8_21_20, FN_IP8_23_22,
+       FN_IP8_25_24, FN_IP8_26, FN_IP8_27, FN_VI1_DATA7_VI1_B7,
+       FN_IP6_16_14, FN_IP6_19_17, FN_IP6_22_20, FN_IP6_25_23,
+       FN_IP6_28_26, FN_IP6_31_29, FN_IP7_2_0, FN_IP7_5_3, FN_IP7_7_6,
+       FN_IP7_9_8, FN_IP7_12_10, FN_IP7_15_13,
+
+       /* GPSR3 */
+       FN_IP8_28, FN_IP8_30_29, FN_IP9_1_0, FN_IP9_3_2, FN_IP9_5_4,
+       FN_IP9_7_6, FN_IP9_11_8, FN_IP9_15_12, FN_IP9_17_16, FN_IP9_19_18,
+       FN_IP9_21_20, FN_IP9_23_22, FN_IP9_25_24, FN_IP9_27_26,
+       FN_IP9_31_28, FN_IP10_3_0, FN_IP10_6_4, FN_IP10_10_7, FN_IP10_14_11,
+       FN_IP10_18_15, FN_IP10_22_19, FN_IP10_25_23, FN_IP10_29_26,
+       FN_IP11_3_0, FN_IP11_4, FN_IP11_6_5, FN_IP11_8_7, FN_IP11_10_9,
+       FN_IP11_12_11, FN_IP11_14_13, FN_IP11_17_15, FN_IP11_21_18,
+
+       /* GPSR4 */
+       FN_IP11_23_22, FN_IP11_26_24, FN_IP11_29_27, FN_IP11_31_30,
+       FN_IP12_1_0, FN_IP12_3_2, FN_IP12_5_4, FN_IP12_7_6, FN_IP12_10_8,
+       FN_IP12_13_11, FN_IP12_16_14, FN_IP12_19_17, FN_IP12_22_20,
+       FN_IP12_24_23, FN_IP12_27_25, FN_IP12_30_28, FN_IP13_2_0,
+       FN_IP13_6_3, FN_IP13_9_7, FN_IP13_12_10, FN_IP13_15_13,
+       FN_IP13_18_16, FN_IP13_22_19, FN_IP13_25_23, FN_IP13_28_26,
+       FN_IP13_30_29, FN_IP14_2_0, FN_IP14_5_3, FN_IP14_8_6, FN_IP14_11_9,
+       FN_IP14_15_12, FN_IP14_18_16,
+
+       /* GPSR5 */
+       FN_IP14_21_19, FN_IP14_24_22, FN_IP14_27_25, FN_IP14_30_28,
+       FN_IP15_2_0, FN_IP15_5_3, FN_IP15_8_6, FN_IP15_11_9, FN_IP15_13_12,
+       FN_IP15_15_14, FN_IP15_17_16, FN_IP15_19_18, FN_IP15_22_20,
+       FN_IP15_25_23, FN_IP15_27_26, FN_IP15_29_28, FN_IP16_2_0,
+       FN_IP16_5_3, FN_USB0_PWEN, FN_USB0_OVC_VBUS, FN_IP16_6, FN_IP16_7,
+       FN_USB2_PWEN, FN_USB2_OVC, FN_AVS1, FN_AVS2, FN_DU_DOTCLKIN0,
+       FN_IP7_26_25, FN_DU_DOTCLKIN2, FN_IP7_18_16, FN_IP7_21_19, FN_IP7_24_22,
+
+       /* IPSR0 - IPSR5 */
+       /* IPSR6 */
+       FN_DACK0, FN_IRQ0, FN_INTC_IRQ0_N, FN_SSI_SCK6_B,
+       FN_VI1_VSYNC_N, FN_VI1_VSYNC_N_B, FN_SSI_WS78_C,
+       FN_DREQ1_N, FN_VI1_CLKENB, FN_VI1_CLKENB_B,
+       FN_SSI_SDATA7_C, FN_SSI_SCK78_B, FN_DACK1, FN_IRQ1,
+       FN_INTC_IRQ1_N, FN_SSI_WS6_B, FN_SSI_SDATA8_C,
+       FN_DREQ2_N, FN_HSCK1_B, FN_HCTS0_N_B,
+       FN_MSIOF0_TXD_B, FN_DACK2, FN_IRQ2, FN_INTC_IRQ2_N,
+       FN_SSI_SDATA6_B, FN_HRTS0_N_B, FN_MSIOF0_RXD_B,
+       FN_ETH_CRS_DV, FN_RMII_CRS_DV, FN_STP_ISCLK_0_B,
+       FN_TS_SDEN0_D, FN_GLO_Q0_C, FN_SCL2_E,
+       FN_SCL2_CIS_E, FN_ETH_RX_ER, FN_RMII_RX_ER,
+       FN_STP_ISD_0_B, FN_TS_SPSYNC0_D, FN_GLO_Q1_C,
+       FN_SDA2_E, FN_SDA2_CIS_E, FN_ETH_RXD0, FN_RMII_RXD0,
+       FN_STP_ISEN_0_B, FN_TS_SDAT0_D, FN_GLO_I0_C,
+       FN_SCIFB1_SCK_G, FN_SCK1_E, FN_ETH_RXD1,
+       FN_RMII_RXD1, FN_HRX0_E, FN_STP_ISSYNC_0_B,
+       FN_TS_SCK0_D, FN_GLO_I1_C, FN_SCIFB1_RXD_G,
+       FN_RX1_E, FN_ETH_LINK, FN_RMII_LINK, FN_HTX0_E,
+       FN_STP_IVCXO27_0_B, FN_SCIFB1_TXD_G, FN_TX1_E,
+       FN_ETH_REF_CLK, FN_RMII_REF_CLK, FN_HCTS0_N_E,
+       FN_STP_IVCXO27_1_B, FN_HRX0_F,
+
+       /* IPSR7 */
+       FN_ETH_MDIO, FN_RMII_MDIO, FN_HRTS0_N_E,
+       FN_SIM0_D_C, FN_HCTS0_N_F, FN_ETH_TXD1,
+       FN_RMII_TXD1, FN_HTX0_F, FN_BPFCLK_G, FN_RDS_CLK_F,
+       FN_ETH_TX_EN, FN_RMII_TX_EN, FN_SIM0_CLK_C,
+       FN_HRTS0_N_F, FN_ETH_MAGIC, FN_RMII_MAGIC,
+       FN_SIM0_RST_C, FN_ETH_TXD0, FN_RMII_TXD0,
+       FN_STP_ISCLK_1_B, FN_TS_SDEN1_C, FN_GLO_SCLK_C,
+       FN_ETH_MDC, FN_RMII_MDC, FN_STP_ISD_1_B,
+       FN_TS_SPSYNC1_C, FN_GLO_SDATA_C, FN_PWM0,
+       FN_SCIFA2_SCK_C, FN_STP_ISEN_1_B, FN_TS_SDAT1_C,
+       FN_GLO_SS_C, FN_PWM1, FN_SCIFA2_TXD_C,
+       FN_STP_ISSYNC_1_B, FN_TS_SCK1_C, FN_GLO_RFON_C,
+       FN_PCMOE_N, FN_PWM2, FN_PWMFSW0, FN_SCIFA2_RXD_C,
+       FN_PCMWE_N, FN_IECLK_C, FN_DU1_DOTCLKIN,
+       FN_AUDIO_CLKC, FN_AUDIO_CLKOUT_C, FN_VI0_CLK,
+       FN_ATACS00_N, FN_AVB_RXD1, FN_MII_RXD1,
+       FN_VI0_DATA0_VI0_B0, FN_ATACS10_N, FN_AVB_RXD2,
+       FN_MII_RXD2,
+
+       /* IPSR8 - IPSR16 */
+
+       FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
+       FN_SEL_SCIF1_4,
+       FN_SEL_SCIFB_0, FN_SEL_SCIFB_1, FN_SEL_SCIFB_2,
+       FN_SEL_SCIFB2_0, FN_SEL_SCIFB2_1, FN_SEL_SCIFB2_2,
+       FN_SEL_SCIFB1_0, FN_SEL_SCIFB1_1, FN_SEL_SCIFB1_2, FN_SEL_SCIFB1_3,
+       FN_SEL_SCIFB1_4,
+       FN_SEL_SCIFB1_5, FN_SEL_SCIFB1_6,
+       FN_SEL_SCIFA1_0, FN_SEL_SCIFA1_1, FN_SEL_SCIFA1_2, FN_SEL_SCIFA1_3,
+       FN_SEL_SCIF0_0, FN_SEL_SCIF0_1,
+       FN_SEL_SCFA_0, FN_SEL_SCFA_1,
+       FN_SEL_SOF1_0, FN_SEL_SOF1_1,
+       FN_SEL_SSI7_0, FN_SEL_SSI7_1, FN_SEL_SSI7_2,
+       FN_SEL_SSI6_0, FN_SEL_SSI6_1,
+       FN_SEL_SSI5_0, FN_SEL_SSI5_1, FN_SEL_SSI5_2,
+       FN_SEL_VI3_0, FN_SEL_VI3_1,
+       FN_SEL_VI2_0, FN_SEL_VI2_1,
+       FN_SEL_VI1_0, FN_SEL_VI1_1,
+       FN_SEL_VI0_0, FN_SEL_VI0_1,
+       FN_SEL_TSIF1_0, FN_SEL_TSIF1_1, FN_SEL_TSIF1_2,
+       FN_SEL_LBS_0, FN_SEL_LBS_1,
+       FN_SEL_TSIF0_0, FN_SEL_TSIF0_1, FN_SEL_TSIF0_2, FN_SEL_TSIF0_3,
+       FN_SEL_SOF3_0, FN_SEL_SOF3_1,
+       FN_SEL_SOF0_0, FN_SEL_SOF0_1,
+
+       FN_SEL_TMU1_0, FN_SEL_TMU1_1,
+       FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1,
+       FN_SEL_SCIFCLK_0, FN_SEL_SCIFCLK_1,
+       FN_SEL_CAN0_0, FN_SEL_CAN0_1, FN_SEL_CAN0_2, FN_SEL_CAN0_3,
+       FN_SEL_CANCLK_0, FN_SEL_CANCLK_1,
+       FN_SEL_SCIFA2_0, FN_SEL_SCIFA2_1, FN_SEL_SCIFA2_2,
+       FN_SEL_CAN1_0, FN_SEL_CAN1_1,
+       FN_SEL_ADI_0, FN_SEL_ADI_1,
+       FN_SEL_SSP_0, FN_SEL_SSP_1,
+       FN_SEL_FM_0, FN_SEL_FM_1, FN_SEL_FM_2, FN_SEL_FM_3,
+       FN_SEL_FM_4, FN_SEL_FM_5, FN_SEL_FM_6,
+       FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1, FN_SEL_HSCIF0_2, FN_SEL_HSCIF0_3,
+       FN_SEL_HSCIF0_4, FN_SEL_HSCIF0_5,
+       FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2,
+       FN_SEL_RDS_0, FN_SEL_RDS_1, FN_SEL_RDS_2,
+       FN_SEL_RDS_3, FN_SEL_RDS_4, FN_SEL_RDS_5,
+       FN_SEL_SIM_0, FN_SEL_SIM_1, FN_SEL_SIM_2,
+       FN_SEL_SSI8_0, FN_SEL_SSI8_1, FN_SEL_SSI8_2,
+
+       FN_SEL_IICDVFS_0, FN_SEL_IICDVFS_1,
+       FN_SEL_IIC0_0, FN_SEL_IIC0_1,
+       FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2,
+       FN_SEL_IIC2_0, FN_SEL_IIC2_1, FN_SEL_IIC2_2, FN_SEL_IIC2_3,
+       FN_SEL_IIC2_4,
+       FN_SEL_IIC1_0, FN_SEL_IIC1_1, FN_SEL_IIC1_2,
+       FN_SEL_I2C2_0, FN_SEL_I2C2_1, FN_SEL_I2C2_2, FN_SEL_I2C2_3,
+       FN_SEL_I2C2_4,
+       FN_SEL_I2C1_0, FN_SEL_I2C1_1, FN_SEL_I2C1_2,
+
+       PINMUX_FUNCTION_END,
+
+       PINMUX_MARK_BEGIN,
+
+       DACK0_MARK, IRQ0_MARK, INTC_IRQ0_N_MARK, SSI_SCK6_B_MARK,
+       VI1_VSYNC_N_MARK, VI1_VSYNC_N_B_MARK, SSI_WS78_C_MARK,
+       DREQ1_N_MARK, VI1_CLKENB_MARK, VI1_CLKENB_B_MARK,
+       SSI_SDATA7_C_MARK, SSI_SCK78_B_MARK, DACK1_MARK, IRQ1_MARK,
+       INTC_IRQ1_N_MARK, SSI_WS6_B_MARK, SSI_SDATA8_C_MARK,
+       DREQ2_N_MARK, HSCK1_B_MARK, HCTS0_N_B_MARK,
+       MSIOF0_TXD_B_MARK, DACK2_MARK, IRQ2_MARK, INTC_IRQ2_N_MARK,
+       SSI_SDATA6_B_MARK, HRTS0_N_B_MARK, MSIOF0_RXD_B_MARK,
+       ETH_CRS_DV_MARK, RMII_CRS_DV_MARK, STP_ISCLK_0_B_MARK,
+       TS_SDEN0_D_MARK, GLO_Q0_C_MARK, SCL2_E_MARK,
+       SCL2_CIS_E_MARK, ETH_RX_ER_MARK, RMII_RX_ER_MARK,
+       STP_ISD_0_B_MARK, TS_SPSYNC0_D_MARK, GLO_Q1_C_MARK,
+       SDA2_E_MARK, SDA2_CIS_E_MARK, ETH_RXD0_MARK, RMII_RXD0_MARK,
+       STP_ISEN_0_B_MARK, TS_SDAT0_D_MARK, GLO_I0_C_MARK,
+       SCIFB1_SCK_G_MARK, SCK1_E_MARK, ETH_RXD1_MARK,
+       RMII_RXD1_MARK, HRX0_E_MARK, STP_ISSYNC_0_B_MARK,
+       TS_SCK0_D_MARK, GLO_I1_C_MARK, SCIFB1_RXD_G_MARK,
+       RX1_E_MARK, ETH_LINK_MARK, RMII_LINK_MARK, HTX0_E_MARK,
+       STP_IVCXO27_0_B_MARK, SCIFB1_TXD_G_MARK, TX1_E_MARK,
+       ETH_REF_CLK_MARK, RMII_REF_CLK_MARK, HCTS0_N_E_MARK,
+       STP_IVCXO27_1_B_MARK, HRX0_F_MARK,
+
+       ETH_MDIO_MARK, RMII_MDIO_MARK, HRTS0_N_E_MARK,
+       SIM0_D_C_MARK, HCTS0_N_F_MARK, ETH_TXD1_MARK,
+       RMII_TXD1_MARK, HTX0_F_MARK, BPFCLK_G_MARK, RDS_CLK_F_MARK,
+       ETH_TX_EN_MARK, RMII_TX_EN_MARK, SIM0_CLK_C_MARK,
+       HRTS0_N_F_MARK, ETH_MAGIC_MARK, RMII_MAGIC_MARK,
+       SIM0_RST_C_MARK, ETH_TXD0_MARK, RMII_TXD0_MARK,
+       STP_ISCLK_1_B_MARK, TS_SDEN1_C_MARK, GLO_SCLK_C_MARK,
+       ETH_MDC_MARK, RMII_MDC_MARK, STP_ISD_1_B_MARK,
+       TS_SPSYNC1_C_MARK, GLO_SDATA_C_MARK, PWM0_MARK,
+       SCIFA2_SCK_C_MARK, STP_ISEN_1_B_MARK, TS_SDAT1_C_MARK,
+       GLO_SS_C_MARK, PWM1_MARK, SCIFA2_TXD_C_MARK,
+       STP_ISSYNC_1_B_MARK, TS_SCK1_C_MARK, GLO_RFON_C_MARK,
+       PCMOE_N_MARK, PWM2_MARK, PWMFSW0_MARK, SCIFA2_RXD_C_MARK,
+       PCMWE_N_MARK, IECLK_C_MARK, DU1_DOTCLKIN_MARK,
+       AUDIO_CLKC_MARK, AUDIO_CLKOUT_C_MARK, VI0_CLK_MARK,
+       ATACS00_N_MARK, AVB_RXD1_MARK, MII_RXD1_MARK,
+       VI0_DATA0_VI0_B0_MARK, ATACS10_N_MARK, AVB_RXD2_MARK,
+       MII_RXD2_MARK,
+
+       PINMUX_MARK_END,
+};
+
+static pinmux_enum_t pinmux_data[] = {
+       PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */
+
+       PINMUX_IPSR_DATA(IP6_2_0, DACK0),
+       PINMUX_IPSR_DATA(IP6_2_0, IRQ0),
+       PINMUX_IPSR_DATA(IP6_2_0, INTC_IRQ0_N),
+       PINMUX_IPSR_MODSEL_DATA(IP6_2_0, SSI_SCK6_B, SEL_SSI6_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_2_0, VI1_VSYNC_N, SEL_VI1_0),
+       PINMUX_IPSR_MODSEL_DATA(IP6_2_0, VI1_VSYNC_N_B, SEL_VI1_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_2_0, SSI_WS78_C, SEL_SSI7_2),
+       PINMUX_IPSR_DATA(IP6_5_3, DREQ1_N),
+       PINMUX_IPSR_MODSEL_DATA(IP6_5_3, VI1_CLKENB, SEL_VI1_0),
+       PINMUX_IPSR_MODSEL_DATA(IP6_5_3, VI1_CLKENB_B, SEL_VI1_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_5_3, SSI_SDATA7_C, SEL_SSI7_2),
+       PINMUX_IPSR_MODSEL_DATA(IP6_5_3, SSI_SCK78_B, SEL_SSI7_1),
+       PINMUX_IPSR_DATA(IP6_8_6, DACK1),
+       PINMUX_IPSR_DATA(IP6_8_6, IRQ1),
+       PINMUX_IPSR_DATA(IP6_8_6, INTC_IRQ1_N),
+       PINMUX_IPSR_MODSEL_DATA(IP6_8_6, SSI_WS6_B, SEL_SSI6_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_8_6, SSI_SDATA8_C, SEL_SSI8_2),
+       PINMUX_IPSR_DATA(IP6_10_9, DREQ2_N),
+       PINMUX_IPSR_MODSEL_DATA(IP6_10_9, HSCK1_B, SEL_HSCIF1_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_10_9, HCTS0_N_B, SEL_HSCIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_10_9, MSIOF0_TXD_B, SEL_SOF0_1),
+       PINMUX_IPSR_DATA(IP6_13_11, DACK2),
+       PINMUX_IPSR_DATA(IP6_13_11, IRQ2),
+       PINMUX_IPSR_DATA(IP6_13_11, INTC_IRQ2_N),
+       PINMUX_IPSR_MODSEL_DATA(IP6_13_11, SSI_SDATA6_B, SEL_SSI6_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_13_11, HRTS0_N_B, SEL_HSCIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_13_11, MSIOF0_RXD_B, SEL_SOF0_1),
+       PINMUX_IPSR_DATA(IP6_16_14, ETH_CRS_DV),
+       PINMUX_IPSR_DATA(IP6_16_14, RMII_CRS_DV),
+       PINMUX_IPSR_MODSEL_DATA(IP6_16_14, STP_ISCLK_0_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_16_14, TS_SDEN0_D, SEL_TSIF0_3),
+       PINMUX_IPSR_MODSEL_DATA(IP6_16_14, GLO_Q0_C, SEL_GPS_2),
+       PINMUX_IPSR_MODSEL_DATA(IP6_16_14, SCL2_E, SEL_IIC2_4),
+       PINMUX_IPSR_MODSEL_DATA(IP6_16_14, SCL2_CIS_E, SEL_I2C2_4),
+       PINMUX_IPSR_DATA(IP6_19_17, ETH_RX_ER),
+       PINMUX_IPSR_DATA(IP6_19_17, RMII_RX_ER),
+       PINMUX_IPSR_MODSEL_DATA(IP6_19_17, STP_ISD_0_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_19_17, TS_SPSYNC0_D, SEL_TSIF0_3),
+       PINMUX_IPSR_MODSEL_DATA(IP6_19_17, GLO_Q1_C, SEL_GPS_2),
+       PINMUX_IPSR_MODSEL_DATA(IP6_19_17, SDA2_E, SEL_IIC2_4),
+       PINMUX_IPSR_MODSEL_DATA(IP6_19_17, SDA2_CIS_E, SEL_I2C2_4),
+       PINMUX_IPSR_DATA(IP6_22_20, ETH_RXD0),
+       PINMUX_IPSR_DATA(IP6_22_20, RMII_RXD0),
+       PINMUX_IPSR_MODSEL_DATA(IP6_22_20, STP_ISEN_0_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_22_20, TS_SDAT0_D, SEL_TSIF0_3),
+       PINMUX_IPSR_MODSEL_DATA(IP6_22_20, GLO_I0_C, SEL_GPS_2),
+       PINMUX_IPSR_MODSEL_DATA(IP6_22_20, SCIFB1_SCK_G, SEL_SCIFB1_6),
+       PINMUX_IPSR_MODSEL_DATA(IP6_22_20, SCK1_E, SEL_SCIF1_4),
+       PINMUX_IPSR_DATA(IP6_25_23, ETH_RXD1),
+       PINMUX_IPSR_DATA(IP6_25_23, RMII_RXD1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, HRX0_E, SEL_HSCIF0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, STP_ISSYNC_0_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, TS_SCK0_D, SEL_TSIF0_3),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, GLO_I1_C, SEL_GPS_2),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, SCIFB1_RXD_G, SEL_SCIFB1_6),
+       PINMUX_IPSR_MODSEL_DATA(IP6_25_23, RX1_E, SEL_SCIF1_4),
+       PINMUX_IPSR_DATA(IP6_28_26, ETH_LINK),
+       PINMUX_IPSR_DATA(IP6_28_26, RMII_LINK),
+       PINMUX_IPSR_MODSEL_DATA(IP6_28_26, HTX0_E, SEL_HSCIF0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP6_28_26, STP_IVCXO27_0_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_28_26, SCIFB1_TXD_G, SEL_SCIFB1_6),
+       PINMUX_IPSR_MODSEL_DATA(IP6_28_26, TX1_E, SEL_SCIF1_4),
+       PINMUX_IPSR_DATA(IP6_31_29, ETH_REF_CLK),
+       PINMUX_IPSR_DATA(IP6_31_29, RMII_REF_CLK),
+       PINMUX_IPSR_MODSEL_DATA(IP6_31_29, HCTS0_N_E, SEL_HSCIF0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP6_31_29, STP_IVCXO27_1_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP6_31_29, HRX0_F, SEL_HSCIF0_5),
+
+       PINMUX_IPSR_DATA(IP7_2_0, ETH_MDIO),
+       PINMUX_IPSR_DATA(IP7_2_0, RMII_MDIO),
+       PINMUX_IPSR_MODSEL_DATA(IP7_2_0, HRTS0_N_E, SEL_HSCIF0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP7_2_0, SIM0_D_C, SEL_SIM_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_2_0, HCTS0_N_F, SEL_HSCIF0_5),
+       PINMUX_IPSR_DATA(IP7_5_3, ETH_TXD1),
+       PINMUX_IPSR_DATA(IP7_5_3, RMII_TXD1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_5_3, HTX0_F, SEL_HSCIF0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP7_5_3, BPFCLK_G, SEL_SIM_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_5_3, RDS_CLK_F, SEL_HSCIF0_5),
+       PINMUX_IPSR_DATA(IP7_7_6, ETH_TX_EN),
+       PINMUX_IPSR_DATA(IP7_7_6, RMII_TX_EN),
+       PINMUX_IPSR_MODSEL_DATA(IP7_7_6, SIM0_CLK_C, SEL_SIM_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_7_6, HRTS0_N_F, SEL_HSCIF0_5),
+       PINMUX_IPSR_DATA(IP7_9_8, ETH_MAGIC),
+       PINMUX_IPSR_DATA(IP7_9_8, RMII_MAGIC),
+       PINMUX_IPSR_MODSEL_DATA(IP7_9_8, SIM0_RST_C, SEL_SIM_2),
+       PINMUX_IPSR_DATA(IP7_12_10, ETH_TXD0),
+       PINMUX_IPSR_DATA(IP7_12_10, RMII_TXD0),
+       PINMUX_IPSR_MODSEL_DATA(IP7_12_10, STP_ISCLK_1_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_12_10, TS_SDEN1_C, SEL_TSIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_12_10, GLO_SCLK_C, SEL_GPS_2),
+       PINMUX_IPSR_DATA(IP7_15_13, ETH_MDC),
+       PINMUX_IPSR_DATA(IP7_15_13, RMII_MDC),
+       PINMUX_IPSR_MODSEL_DATA(IP7_15_13, STP_ISD_1_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_15_13, TS_SPSYNC1_C, SEL_TSIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_15_13, GLO_SDATA_C, SEL_GPS_2),
+       PINMUX_IPSR_DATA(IP7_18_16, PWM0),
+       PINMUX_IPSR_MODSEL_DATA(IP7_18_16, SCIFA2_SCK_C, SEL_SCIFA2_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_18_16, STP_ISEN_1_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_18_16, TS_SDAT1_C, SEL_TSIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_18_16, GLO_SS_C, SEL_GPS_2),
+       PINMUX_IPSR_DATA(IP7_21_19, PWM1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_21_19, SCIFA2_TXD_C, SEL_SCIFA2_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_21_19, STP_ISSYNC_1_B, SEL_SSP_1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_21_19, TS_SCK1_C, SEL_TSIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP7_21_19, GLO_RFON_C, SEL_GPS_2),
+       PINMUX_IPSR_DATA(IP7_21_19, PCMOE_N),
+       PINMUX_IPSR_DATA(IP7_24_22, PWM2),
+       PINMUX_IPSR_DATA(IP7_24_22, PWMFSW0),
+       PINMUX_IPSR_MODSEL_DATA(IP7_24_22, SCIFA2_RXD_C, SEL_SCIFA2_2),
+       PINMUX_IPSR_DATA(IP7_24_22, PCMWE_N),
+       PINMUX_IPSR_MODSEL_DATA(IP7_24_22, IECLK_C, SEL_IEB_2),
+       PINMUX_IPSR_DATA(IP7_26_25, DU1_DOTCLKIN),
+       PINMUX_IPSR_DATA(IP7_26_25, AUDIO_CLKC),
+       PINMUX_IPSR_DATA(IP7_26_25, AUDIO_CLKOUT_C),
+       PINMUX_IPSR_MODSEL_DATA(IP7_28_27, VI0_CLK, SEL_VI0_0),
+       PINMUX_IPSR_DATA(IP7_28_27, ATACS00_N),
+       PINMUX_IPSR_DATA(IP7_28_27, AVB_RXD1),
+       PINMUX_IPSR_DATA(IP7_28_27, MII_RXD1),
+       PINMUX_IPSR_MODSEL_DATA(IP7_30_29, VI0_DATA0_VI0_B0, SEL_VI0_0),
+       PINMUX_IPSR_DATA(IP7_30_29, ATACS10_N),
+       PINMUX_IPSR_DATA(IP7_30_29, AVB_RXD2),
+       PINMUX_IPSR_DATA(IP7_30_29, MII_RXD2),
+
+};
+
+static struct pinmux_gpio pinmux_gpios[] = {
+       PINMUX_GPIO_GP_ALL(),
+
+       /*IPSR0 - IPSR5*/
+       /*IPSR6*/
+       GPIO_FN(DACK0), GPIO_FN(IRQ0), GPIO_FN(INTC_IRQ0_N),
+       GPIO_FN(SSI_SCK6_B), GPIO_FN(VI1_VSYNC_N), GPIO_FN(VI1_VSYNC_N_B),
+       GPIO_FN(SSI_WS78_C), GPIO_FN(DREQ1_N), GPIO_FN(VI1_CLKENB),
+       GPIO_FN(VI1_CLKENB_B), GPIO_FN(SSI_SDATA7_C), GPIO_FN(SSI_SCK78_B),
+       GPIO_FN(DACK1), GPIO_FN(IRQ1), GPIO_FN(INTC_IRQ1_N), GPIO_FN(SSI_WS6_B),
+       GPIO_FN(SSI_SDATA8_C), GPIO_FN(DREQ2_N), GPIO_FN(HSCK1_B),
+       GPIO_FN(HCTS0_N_B), GPIO_FN(MSIOF0_TXD_B), GPIO_FN(DACK2),
+       GPIO_FN(IRQ2), GPIO_FN(INTC_IRQ2_N), GPIO_FN(SSI_SDATA6_B),
+       GPIO_FN(HRTS0_N_B), GPIO_FN(MSIOF0_RXD_B), GPIO_FN(ETH_CRS_DV),
+       GPIO_FN(RMII_CRS_DV), GPIO_FN(STP_ISCLK_0_B), GPIO_FN(TS_SDEN0_D),
+       GPIO_FN(GLO_Q0_C), GPIO_FN(SCL2_E), GPIO_FN(SCL2_CIS_E),
+       GPIO_FN(ETH_RX_ER), GPIO_FN(RMII_RX_ER), GPIO_FN(STP_ISD_0_B),
+       GPIO_FN(TS_SPSYNC0_D), GPIO_FN(GLO_Q1_C), GPIO_FN(SDA2_E),
+       GPIO_FN(SDA2_CIS_E), GPIO_FN(ETH_RXD0), GPIO_FN(RMII_RXD0),
+       GPIO_FN(STP_ISEN_0_B), GPIO_FN(TS_SDAT0_D), GPIO_FN(GLO_I0_C),
+       GPIO_FN(SCIFB1_SCK_G), GPIO_FN(SCK1_E), GPIO_FN(ETH_RXD1),
+       GPIO_FN(RMII_RXD1), GPIO_FN(HRX0_E), GPIO_FN(STP_ISSYNC_0_B),
+       GPIO_FN(TS_SCK0_D), GPIO_FN(GLO_I1_C), GPIO_FN(SCIFB1_RXD_G),
+       GPIO_FN(RX1_E), GPIO_FN(ETH_LINK), GPIO_FN(RMII_LINK), GPIO_FN(HTX0_E),
+       GPIO_FN(STP_IVCXO27_0_B), GPIO_FN(SCIFB1_TXD_G), GPIO_FN(TX1_E),
+       GPIO_FN(ETH_REF_CLK), GPIO_FN(RMII_REF_CLK), GPIO_FN(HCTS0_N_E),
+       GPIO_FN(STP_IVCXO27_1_B), GPIO_FN(HRX0_F),
+
+       /*IPSR7*/
+       GPIO_FN(ETH_MDIO), GPIO_FN(RMII_MDIO), GPIO_FN(HRTS0_N_E),
+       GPIO_FN(SIM0_D_C), GPIO_FN(HCTS0_N_F), GPIO_FN(ETH_TXD1),
+       GPIO_FN(RMII_TXD1), GPIO_FN(HTX0_F), GPIO_FN(BPFCLK_G),
+       GPIO_FN(RDS_CLK_F), GPIO_FN(ETH_TX_EN), GPIO_FN(RMII_TX_EN),
+       GPIO_FN(SIM0_CLK_C), GPIO_FN(HRTS0_N_F), GPIO_FN(ETH_MAGIC),
+       GPIO_FN(RMII_MAGIC), GPIO_FN(SIM0_RST_C), GPIO_FN(ETH_TXD0),
+       GPIO_FN(RMII_TXD0), GPIO_FN(STP_ISCLK_1_B), GPIO_FN(TS_SDEN1_C),
+       GPIO_FN(GLO_SCLK_C), GPIO_FN(ETH_MDC), GPIO_FN(RMII_MDC),
+       GPIO_FN(STP_ISD_1_B), GPIO_FN(TS_SPSYNC1_C), GPIO_FN(GLO_SDATA_C),
+       GPIO_FN(PWM0), GPIO_FN(SCIFA2_SCK_C), GPIO_FN(STP_ISEN_1_B),
+       GPIO_FN(TS_SDAT1_C), GPIO_FN(GLO_SS_C), GPIO_FN(PWM1),
+       GPIO_FN(SCIFA2_TXD_C), GPIO_FN(STP_ISSYNC_1_B), GPIO_FN(TS_SCK1_C),
+       GPIO_FN(GLO_RFON_C), GPIO_FN(PCMOE_N), GPIO_FN(PWM2), GPIO_FN(PWMFSW0),
+       GPIO_FN(SCIFA2_RXD_C), GPIO_FN(PCMWE_N), GPIO_FN(IECLK_C),
+       GPIO_FN(DU1_DOTCLKIN), GPIO_FN(AUDIO_CLKC), GPIO_FN(AUDIO_CLKOUT_C),
+       GPIO_FN(VI0_CLK), GPIO_FN(ATACS00_N), GPIO_FN(AVB_RXD1),
+       GPIO_FN(MII_RXD1), GPIO_FN(VI0_DATA0_VI0_B0), GPIO_FN(ATACS10_N),
+       GPIO_FN(AVB_RXD2), GPIO_FN(MII_RXD2),
+       /*IPSR8 - IPSR16*/
+};
+
+static struct pinmux_cfg_reg pinmux_config_regs[] = {
+       { PINMUX_CFG_REG("GPSR0", 0xE6060004, 32, 1) {
+               GP_0_31_FN, FN_IP3_17_15,
+               GP_0_30_FN, FN_IP3_14_12,
+               GP_0_29_FN, FN_IP3_11_8,
+               GP_0_28_FN, FN_IP3_7_4,
+               GP_0_27_FN, FN_IP3_3_0,
+               GP_0_26_FN, FN_IP2_28_26,
+               GP_0_25_FN, FN_IP2_25_22,
+               GP_0_24_FN, FN_IP2_21_18,
+               GP_0_23_FN, FN_IP2_17_15,
+               GP_0_22_FN, FN_IP2_14_12,
+               GP_0_21_FN, FN_IP2_11_9,
+               GP_0_20_FN, FN_IP2_8_6,
+               GP_0_19_FN, FN_IP2_5_3,
+               GP_0_18_FN, FN_IP2_2_0,
+               GP_0_17_FN, FN_IP1_29_28,
+               GP_0_16_FN, FN_IP1_27_26,
+               GP_0_15_FN, FN_IP1_25_22,
+               GP_0_14_FN, FN_IP1_21_18,
+               GP_0_13_FN, FN_IP1_17_15,
+               GP_0_12_FN, FN_IP1_14_12,
+               GP_0_11_FN, FN_IP1_11_8,
+               GP_0_10_FN, FN_IP1_7_4,
+               GP_0_9_FN, FN_IP1_3_0,
+               GP_0_8_FN, FN_IP0_30_27,
+               GP_0_7_FN, FN_IP0_26_23,
+               GP_0_6_FN, FN_IP0_22_20,
+               GP_0_5_FN, FN_IP0_19_16,
+               GP_0_4_FN, FN_IP0_15_12,
+               GP_0_3_FN, FN_IP0_11_9,
+               GP_0_2_FN, FN_IP0_8_6,
+               GP_0_1_FN, FN_IP0_5_3,
+               GP_0_0_FN, FN_IP0_2_0 }
+       },
+       { PINMUX_CFG_REG("GPSR1", 0xE6060008, 32, 1) {
+               0, 0,
+               0, 0,
+               GP_1_29_FN, FN_IP6_13_11,
+               GP_1_28_FN, FN_IP6_10_9,
+               GP_1_27_FN, FN_IP6_8_6,
+               GP_1_26_FN, FN_IP6_5_3,
+               GP_1_25_FN, FN_IP6_2_0,
+               GP_1_24_FN, FN_IP5_29_27,
+               GP_1_23_FN, FN_IP5_26_24,
+               GP_1_22_FN, FN_IP5_23_21,
+               GP_1_21_FN, FN_IP5_20_18,
+               GP_1_20_FN, FN_IP5_17_15,
+               GP_1_19_FN, FN_IP5_14_13,
+               GP_1_18_FN, FN_IP5_12_10,
+               GP_1_17_FN, FN_IP5_9_6,
+               GP_1_16_FN, FN_IP5_5_3,
+               GP_1_15_FN, FN_IP5_2_0,
+               GP_1_14_FN, FN_IP4_29_27,
+               GP_1_13_FN, FN_IP4_26_24,
+               GP_1_12_FN, FN_IP4_23_21,
+               GP_1_11_FN, FN_IP4_20_18,
+               GP_1_10_FN, FN_IP4_17_15,
+               GP_1_9_FN, FN_IP4_14_12,
+               GP_1_8_FN, FN_IP4_11_9,
+               GP_1_7_FN, FN_IP4_8_6,
+               GP_1_6_FN, FN_IP4_5_3,
+               GP_1_5_FN, FN_IP4_2_0,
+               GP_1_4_FN, FN_IP3_31_29,
+               GP_1_3_FN, FN_IP3_28_26,
+               GP_1_2_FN, FN_IP3_25_23,
+               GP_1_1_FN, FN_IP3_22_20,
+               GP_1_0_FN, FN_IP3_19_18, }
+       },
+       { PINMUX_CFG_REG("GPSR2", 0xE606000C, 32, 1) {
+               0, 0,
+               0, 0,
+               GP_2_29_FN, FN_IP7_15_13,
+               GP_2_28_FN, FN_IP7_12_10,
+               GP_2_27_FN, FN_IP7_9_8,
+               GP_2_26_FN, FN_IP7_7_6,
+               GP_2_25_FN, FN_IP7_5_3,
+               GP_2_24_FN, FN_IP7_2_0,
+               GP_2_23_FN, FN_IP6_31_29,
+               GP_2_22_FN, FN_IP6_28_26,
+               GP_2_21_FN, FN_IP6_25_23,
+               GP_2_20_FN, FN_IP6_22_20,
+               GP_2_19_FN, FN_IP6_19_17,
+               GP_2_18_FN, FN_IP6_16_14,
+               GP_2_17_FN, FN_VI1_DATA7_VI1_B7,
+               GP_2_16_FN, FN_IP8_27,
+               GP_2_15_FN, FN_IP8_26,
+               GP_2_14_FN, FN_IP8_25_24,
+               GP_2_13_FN, FN_IP8_23_22,
+               GP_2_12_FN, FN_IP8_21_20,
+               GP_2_11_FN, FN_IP8_19_18,
+               GP_2_10_FN, FN_IP8_17_16,
+               GP_2_9_FN, FN_IP8_15_14,
+               GP_2_8_FN, FN_IP8_13_12,
+               GP_2_7_FN, FN_IP8_11_10,
+               GP_2_6_FN, FN_IP8_9_8,
+               GP_2_5_FN, FN_IP8_7_6,
+               GP_2_4_FN, FN_IP8_5_4,
+               GP_2_3_FN, FN_IP8_3_2,
+               GP_2_2_FN, FN_IP8_1_0,
+               GP_2_1_FN, FN_IP7_30_29,
+               GP_2_0_FN, FN_IP7_28_27 }
+       },
+       { PINMUX_CFG_REG("GPSR3", 0xE6060010, 32, 1) {
+               GP_3_31_FN, FN_IP11_21_18,
+               GP_3_30_FN, FN_IP11_17_15,
+               GP_3_29_FN, FN_IP11_14_13,
+               GP_3_28_FN, FN_IP11_12_11,
+               GP_3_27_FN, FN_IP11_10_9,
+               GP_3_26_FN, FN_IP11_8_7,
+               GP_3_25_FN, FN_IP11_6_5,
+               GP_3_24_FN, FN_IP11_4,
+               GP_3_23_FN, FN_IP11_3_0,
+               GP_3_22_FN, FN_IP10_29_26,
+               GP_3_21_FN, FN_IP10_25_23,
+               GP_3_20_FN, FN_IP10_22_19,
+               GP_3_19_FN, FN_IP10_18_15,
+               GP_3_18_FN, FN_IP10_14_11,
+               GP_3_17_FN, FN_IP10_10_7,
+               GP_3_16_FN, FN_IP10_6_4,
+               GP_3_15_FN, FN_IP10_3_0,
+               GP_3_14_FN, FN_IP9_31_28,
+               GP_3_13_FN, FN_IP9_27_26,
+               GP_3_12_FN, FN_IP9_25_24,
+               GP_3_11_FN, FN_IP9_23_22,
+               GP_3_10_FN, FN_IP9_21_20,
+               GP_3_9_FN, FN_IP9_19_18,
+               GP_3_8_FN, FN_IP9_17_16,
+               GP_3_7_FN, FN_IP9_15_12,
+               GP_3_6_FN, FN_IP9_11_8,
+               GP_3_5_FN, FN_IP9_7_6,
+               GP_3_4_FN, FN_IP9_5_4,
+               GP_3_3_FN, FN_IP9_3_2,
+               GP_3_2_FN, FN_IP9_1_0,
+               GP_3_1_FN, FN_IP8_30_29,
+               GP_3_0_FN, FN_IP8_28 }
+       },
+       { PINMUX_CFG_REG("GPSR4", 0xE6060014, 32, 1) {
+               GP_4_31_FN, FN_IP14_18_16,
+               GP_4_30_FN, FN_IP14_15_12,
+               GP_4_29_FN, FN_IP14_11_9,
+               GP_4_28_FN, FN_IP14_8_6,
+               GP_4_27_FN, FN_IP14_5_3,
+               GP_4_26_FN, FN_IP14_2_0,
+               GP_4_25_FN, FN_IP13_30_29,
+               GP_4_24_FN, FN_IP13_28_26,
+               GP_4_23_FN, FN_IP13_25_23,
+               GP_4_22_FN, FN_IP13_22_19,
+               GP_4_21_FN, FN_IP13_18_16,
+               GP_4_20_FN, FN_IP13_15_13,
+               GP_4_19_FN, FN_IP13_12_10,
+               GP_4_18_FN, FN_IP13_9_7,
+               GP_4_17_FN, FN_IP13_6_3,
+               GP_4_16_FN, FN_IP13_2_0,
+               GP_4_15_FN, FN_IP12_30_28,
+               GP_4_14_FN, FN_IP12_27_25,
+               GP_4_13_FN, FN_IP12_24_23,
+               GP_4_12_FN, FN_IP12_22_20,
+               GP_4_11_FN, FN_IP12_19_17,
+               GP_4_10_FN, FN_IP12_16_14,
+               GP_4_9_FN, FN_IP12_13_11,
+               GP_4_8_FN, FN_IP12_10_8,
+               GP_4_7_FN, FN_IP12_7_6,
+               GP_4_6_FN, FN_IP12_5_4,
+               GP_4_5_FN, FN_IP12_3_2,
+               GP_4_4_FN, FN_IP12_1_0,
+               GP_4_3_FN, FN_IP11_31_30,
+               GP_4_2_FN, FN_IP11_29_27,
+               GP_4_1_FN, FN_IP11_26_24,
+               GP_4_0_FN, FN_IP11_23_22 }
+       },
+       { PINMUX_CFG_REG("GPSR5", 0xE6060018, 32, 1) {
+               GP_5_31_FN, FN_IP7_24_22,
+               GP_5_30_FN, FN_IP7_21_19,
+               GP_5_29_FN, FN_IP7_18_16,
+               GP_5_28_FN, FN_DU_DOTCLKIN2,
+               GP_5_27_FN, FN_IP7_26_25,
+               GP_5_26_FN, FN_DU_DOTCLKIN0,
+               GP_5_25_FN, FN_AVS2,
+               GP_5_24_FN, FN_AVS1,
+               GP_5_23_FN, FN_USB2_OVC,
+               GP_5_22_FN, FN_USB2_PWEN,
+               GP_5_21_FN, FN_IP16_7,
+               GP_5_20_FN, FN_IP16_6,
+               GP_5_19_FN, FN_USB0_OVC_VBUS,
+               GP_5_18_FN, FN_USB0_PWEN,
+               GP_5_17_FN, FN_IP16_5_3,
+               GP_5_16_FN, FN_IP16_2_0,
+               GP_5_15_FN, FN_IP15_29_28,
+               GP_5_14_FN, FN_IP15_27_26,
+               GP_5_13_FN, FN_IP15_25_23,
+               GP_5_12_FN, FN_IP15_22_20,
+               GP_5_11_FN, FN_IP15_19_18,
+               GP_5_10_FN, FN_IP15_17_16,
+               GP_5_9_FN, FN_IP15_15_14,
+               GP_5_8_FN, FN_IP15_13_12,
+               GP_5_7_FN, FN_IP15_11_9,
+               GP_5_6_FN, FN_IP15_8_6,
+               GP_5_5_FN, FN_IP15_5_3,
+               GP_5_4_FN, FN_IP15_2_0,
+               GP_5_3_FN, FN_IP14_30_28,
+               GP_5_2_FN, FN_IP14_27_25,
+               GP_5_1_FN, FN_IP14_24_22,
+               GP_5_0_FN, FN_IP14_21_19 }
+       },
+
+       /*IPSR0 - IPSR5*/
+       { PINMUX_CFG_REG_VAR("IPSR6", 0xE6060038, 32,
+                            3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3) {
+               /* IP6_31_29 [3] */
+               FN_ETH_REF_CLK, FN_RMII_REF_CLK, FN_HCTS0_N_E,
+               FN_STP_IVCXO27_1_B, FN_HRX0_F, 0, 0, 0,
+               /* IP6_28_26 [3] */
+               FN_ETH_LINK, FN_RMII_LINK, FN_HTX0_E,
+               FN_STP_IVCXO27_0_B, FN_SCIFB1_TXD_G, FN_TX1_E, 0, 0,
+               /* IP6_25_23 [3] */
+               FN_ETH_RXD1, FN_RMII_RXD1, FN_HRX0_E, FN_STP_ISSYNC_0_B,
+               FN_TS_SCK0_D, FN_GLO_I1_C, FN_SCIFB1_RXD_G, FN_RX1_E,
+               /* IP6_22_20 [3] */
+               FN_ETH_RXD0, FN_RMII_RXD0, FN_STP_ISEN_0_B, FN_TS_SDAT0_D,
+               FN_GLO_I0_C, FN_SCIFB1_SCK_G, FN_SCK1_E, 0,
+               /* IP6_19_17 [3] */
+               FN_ETH_RX_ER, FN_RMII_RX_ER, FN_STP_ISD_0_B,
+               FN_TS_SPSYNC0_D, FN_GLO_Q1_C, FN_SDA2_E, FN_SDA2_CIS_E, 0,
+               /* IP6_16_14 [3] */
+               FN_ETH_CRS_DV, FN_RMII_CRS_DV, FN_STP_ISCLK_0_B,
+               FN_TS_SDEN0_D, FN_GLO_Q0_C, FN_SCL2_E,
+               FN_SCL2_CIS_E, 0,
+               /* IP6_13_11 [3] */
+               FN_DACK2, FN_IRQ2, FN_INTC_IRQ2_N,
+               FN_SSI_SDATA6_B, FN_HRTS0_N_B, FN_MSIOF0_RXD_B, 0, 0,
+               /* IP6_10_9 [2] */
+               FN_DREQ2_N, FN_HSCK1_B, FN_HCTS0_N_B, FN_MSIOF0_TXD_B,
+               /* IP6_8_6 [3] */
+               FN_DACK1, FN_IRQ1, FN_INTC_IRQ1_N, FN_SSI_WS6_B,
+               FN_SSI_SDATA8_C, 0, 0, 0,
+               /* IP6_5_3 [3] */
+               FN_DREQ1_N, FN_VI1_CLKENB, FN_VI1_CLKENB_B,
+               FN_SSI_SDATA7_C, FN_SSI_SCK78_B, 0, 0, 0,
+               /* IP6_2_0 [3] */
+               FN_DACK0, FN_IRQ0, FN_INTC_IRQ0_N, FN_SSI_SCK6_B,
+               FN_VI1_VSYNC_N, FN_VI1_VSYNC_N_B, FN_SSI_WS78_C, 0, }
+       },
+       { PINMUX_CFG_REG_VAR("IPSR7", 0xE606003C, 32,
+                            1, 2, 2, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3) {
+               /* IP7_31 [1] */
+               0, 0,
+               /* IP7_30_29 [2] */
+               FN_VI0_DATA0_VI0_B0, FN_ATACS10_N, FN_AVB_RXD2,
+               FN_MII_RXD2,
+               /* IP7_28_27 [2] */
+               FN_VI0_CLK, FN_ATACS00_N, FN_AVB_RXD1, FN_MII_RXD1,
+               /* IP7_26_25 [2] */
+               FN_DU1_DOTCLKIN, FN_AUDIO_CLKC, FN_AUDIO_CLKOUT_C, 0,
+               /* IP7_24_22 [3] */
+               FN_PWM2, FN_PWMFSW0, FN_SCIFA2_RXD_C, FN_PCMWE_N, FN_IECLK_C,
+               0, 0, 0,
+               /* IP7_21_19 [3] */
+               FN_PWM1, FN_SCIFA2_TXD_C, FN_STP_ISSYNC_1_B, FN_TS_SCK1_C,
+               FN_GLO_RFON_C, FN_PCMOE_N, 0, 0,
+               /* IP7_18_16 [3] */
+               FN_PWM0, FN_SCIFA2_SCK_C, FN_STP_ISEN_1_B, FN_TS_SDAT1_C,
+               FN_GLO_SS_C, 0, 0, 0,
+               /* IP7_15_13 [3] */
+               FN_ETH_MDC, FN_RMII_MDC, FN_STP_ISD_1_B,
+               FN_TS_SPSYNC1_C, FN_GLO_SDATA_C, 0, 0, 0,
+               /* IP7_12_10 [3] */
+               FN_ETH_TXD0, FN_RMII_TXD0, FN_STP_ISCLK_1_B, FN_TS_SDEN1_C,
+               FN_GLO_SCLK_C, 0, 0, 0,
+               /* IP7_9_8 [2] */
+               FN_ETH_MAGIC, FN_RMII_MAGIC, FN_SIM0_RST_C, 0,
+               /* IP7_7_6 [2] */
+               FN_ETH_TX_EN, FN_RMII_TX_EN, FN_SIM0_CLK_C, FN_HRTS0_N_F,
+               /* IP7_5_3 [3] */
+               FN_ETH_TXD1, FN_RMII_TXD1, FN_HTX0_F, FN_BPFCLK_G, FN_RDS_CLK_F,
+               0, 0, 0,
+               /* IP7_2_0 [3] */
+               FN_ETH_MDIO, FN_RMII_MDIO, FN_HRTS0_N_E,
+               FN_SIM0_D_C, FN_HCTS0_N_F, 0, 0, 0, }
+       },
+       /*IPSR8 - IPSR16*/
+       { PINMUX_CFG_REG("INOUTSEL0", 0xE6050004, 32, 1) { GP_INOUTSEL(0) } },
+       { PINMUX_CFG_REG("INOUTSEL1", 0xE6051004, 32, 1) {
+               0, 0,
+               0, 0,
+               GP_1_29_IN, GP_1_29_OUT,
+               GP_1_28_IN, GP_1_28_OUT,
+               GP_1_27_IN, GP_1_27_OUT,
+               GP_1_26_IN, GP_1_26_OUT,
+               GP_1_25_IN, GP_1_25_OUT,
+               GP_1_24_IN, GP_1_24_OUT,
+               GP_1_23_IN, GP_1_23_OUT,
+               GP_1_22_IN, GP_1_22_OUT,
+               GP_1_21_IN, GP_1_21_OUT,
+               GP_1_20_IN, GP_1_20_OUT,
+               GP_1_19_IN, GP_1_19_OUT,
+               GP_1_18_IN, GP_1_18_OUT,
+               GP_1_17_IN, GP_1_17_OUT,
+               GP_1_16_IN, GP_1_16_OUT,
+               GP_1_15_IN, GP_1_15_OUT,
+               GP_1_14_IN, GP_1_14_OUT,
+               GP_1_13_IN, GP_1_13_OUT,
+               GP_1_12_IN, GP_1_12_OUT,
+               GP_1_11_IN, GP_1_11_OUT,
+               GP_1_10_IN, GP_1_10_OUT,
+               GP_1_9_IN, GP_1_9_OUT,
+               GP_1_8_IN, GP_1_8_OUT,
+               GP_1_7_IN, GP_1_7_OUT,
+               GP_1_6_IN, GP_1_6_OUT,
+               GP_1_5_IN, GP_1_5_OUT,
+               GP_1_4_IN, GP_1_4_OUT,
+               GP_1_3_IN, GP_1_3_OUT,
+               GP_1_2_IN, GP_1_2_OUT,
+               GP_1_1_IN, GP_1_1_OUT,
+               GP_1_0_IN, GP_1_0_OUT, }
+       },
+       { PINMUX_CFG_REG("INOUTSEL2", 0xE6052004, 32, 1) {
+               0, 0,
+               0, 0,
+               GP_2_29_IN, GP_2_29_OUT,
+               GP_2_28_IN, GP_2_28_OUT,
+               GP_2_27_IN, GP_2_27_OUT,
+               GP_2_26_IN, GP_2_26_OUT,
+               GP_2_25_IN, GP_2_25_OUT,
+               GP_2_24_IN, GP_2_24_OUT,
+               GP_2_23_IN, GP_2_23_OUT,
+               GP_2_22_IN, GP_2_22_OUT,
+               GP_2_21_IN, GP_2_21_OUT,
+               GP_2_20_IN, GP_2_20_OUT,
+               GP_2_19_IN, GP_2_19_OUT,
+               GP_2_18_IN, GP_2_18_OUT,
+               GP_2_17_IN, GP_2_17_OUT,
+               GP_2_16_IN, GP_2_16_OUT,
+               GP_2_15_IN, GP_2_15_OUT,
+               GP_2_14_IN, GP_2_14_OUT,
+               GP_2_13_IN, GP_2_13_OUT,
+               GP_2_12_IN, GP_2_12_OUT,
+               GP_2_11_IN, GP_2_11_OUT,
+               GP_2_10_IN, GP_2_10_OUT,
+               GP_2_9_IN, GP_2_9_OUT,
+               GP_2_8_IN, GP_2_8_OUT,
+               GP_2_7_IN, GP_2_7_OUT,
+               GP_2_6_IN, GP_2_6_OUT,
+               GP_2_5_IN, GP_2_5_OUT,
+               GP_2_4_IN, GP_2_4_OUT,
+               GP_2_3_IN, GP_2_3_OUT,
+               GP_2_2_IN, GP_2_2_OUT,
+               GP_2_1_IN, GP_2_1_OUT,
+               GP_2_0_IN, GP_2_0_OUT, }
+       },
+       { PINMUX_CFG_REG("INOUTSEL3", 0xE6053004, 32, 1) { GP_INOUTSEL(3) } },
+       { PINMUX_CFG_REG("INOUTSEL4", 0xE6054004, 32, 1) { GP_INOUTSEL(4) } },
+       { PINMUX_CFG_REG("INOUTSEL5", 0xE6055004, 32, 1) { GP_INOUTSEL(5) } },
+       { },
+};
+
+static struct pinmux_data_reg pinmux_data_regs[] = {
+       { PINMUX_DATA_REG("INDT0", 0xE6050008, 32) { GP_INDT(0) } },
+       { PINMUX_DATA_REG("INDT1", 0xE6051008, 32) {
+               0, 0, GP_1_29_DATA, GP_1_28_DATA,
+               GP_1_27_DATA, GP_1_26_DATA, GP_1_25_DATA, GP_1_24_DATA,
+               GP_1_23_DATA, GP_1_22_DATA, GP_1_21_DATA, GP_1_20_DATA,
+               GP_1_19_DATA, GP_1_18_DATA, GP_1_17_DATA, GP_1_16_DATA,
+               GP_1_15_DATA, GP_1_14_DATA, GP_1_13_DATA, GP_1_12_DATA,
+               GP_1_11_DATA, GP_1_10_DATA, GP_1_9_DATA, GP_1_8_DATA,
+               GP_1_7_DATA, GP_1_6_DATA, GP_1_5_DATA, GP_1_4_DATA,
+               GP_1_3_DATA, GP_1_2_DATA, GP_1_1_DATA, GP_1_0_DATA }
+       },
+       { PINMUX_DATA_REG("INDT2", 0xE6052008, 32) {
+               0, 0, GP_2_29_DATA, GP_2_28_DATA,
+               GP_2_27_DATA, GP_2_26_DATA, GP_2_25_DATA, GP_2_24_DATA,
+               GP_2_23_DATA, GP_2_22_DATA, GP_2_21_DATA, GP_2_20_DATA,
+               GP_2_19_DATA, GP_2_18_DATA, GP_2_17_DATA, GP_2_16_DATA,
+               GP_2_15_DATA, GP_2_14_DATA, GP_2_13_DATA, GP_2_12_DATA,
+               GP_2_11_DATA, GP_2_10_DATA, GP_2_9_DATA, GP_2_8_DATA,
+               GP_2_7_DATA, GP_2_6_DATA, GP_2_5_DATA, GP_2_4_DATA,
+               GP_2_3_DATA, GP_2_2_DATA, GP_2_1_DATA, GP_2_0_DATA }
+       },
+       { PINMUX_DATA_REG("INDT3", 0xE6053008, 32) { GP_INDT(3) } },
+       { PINMUX_DATA_REG("INDT4", 0xE6054008, 32) { GP_INDT(4) } },
+       { PINMUX_DATA_REG("INDT5", 0xE6055008, 32) { GP_INDT(5) } },
+       { },
+};
+
+static struct pinmux_info r8a7790_pinmux_info = {
+       .name = "r8a7790_pfc",
+
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .reserved_id = PINMUX_RESERVED,
+       .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
+       .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
+       .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
+       .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .first_gpio = GPIO_GP_0_0,
+       .last_gpio = GPIO_FN_MII_RXD2 /* GPIO_FN_TCLK1_B */,
+
+       .gpios = pinmux_gpios,
+       .cfg_regs = pinmux_config_regs,
+       .data_regs = pinmux_data_regs,
+
+       .gpio_data = pinmux_data,
+       .gpio_data_size = ARRAY_SIZE(pinmux_data),
+};
+
+void r8a7790_pinmux_init(void)
+{
+       register_pinmux(&r8a7790_pinmux_info);
+}
diff --git a/arch/arm/cpu/armv7/rmobile/pfc-r8a7790.h b/arch/arm/cpu/armv7/rmobile/pfc-r8a7790.h
new file mode 100644 (file)
index 0000000..a13317b
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/pfc-r8a7790.h
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __PFC_R8A7790_H__
+#define __PFC_R8A7790_H__
+
+#include <sh_pfc.h>
+#include <asm/gpio.h>
+
+#define CPU_32_PORT(fn, pfx, sfx)                              \
+       PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
+       PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx),     \
+       PORT_1(fn, pfx##31, sfx)
+
+#define CPU_32_PORT2(fn, pfx, sfx)                             \
+       PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
+       PORT_10(fn, pfx##2, sfx)
+
+#if defined(CONFIG_R8A7790)
+#define CPU_32_PORT1(fn, pfx, sfx)                             \
+       PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
+       PORT_10(fn, pfx##2, sfx)                                \
+/* GP_0_0_DATA -> GP_5_31_DATA (except for GP1[30],GP1[31],GP2[30],GP2[31]) */
+#define CPU_ALL_PORT(fn, pfx, sfx)                             \
+       CPU_32_PORT(fn, pfx##_0_, sfx),                         \
+       CPU_32_PORT1(fn, pfx##_1_, sfx),                        \
+       CPU_32_PORT2(fn, pfx##_2_, sfx),                        \
+       CPU_32_PORT(fn, pfx##_3_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_4_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_5_, sfx)
+
+#elif defined(CONFIG_R8A7791)
+#define CPU_32_PORT1(fn, pfx, sfx)                             \
+       PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
+       PORT_1(fn, pfx##20, sfx), PORT_1(fn, pfx##21, sfx),     \
+       PORT_1(fn, pfx##22, sfx), PORT_1(fn, pfx##23, sfx),     \
+       PORT_1(fn, pfx##24, sfx), PORT_1(fn, pfx##25, sfx)
+
+/*
+ * GP_0_0_DATA -> GP_7_25_DATA
+ * (except for GP1[26],GP1[27],GP1[28],GP1[29]),GP1[30]),GP1[31]
+ *  GP7[26],GP7[27],GP7[28],GP7[29]),GP7[30]),GP7[31])
+ */
+#define CPU_ALL_PORT(fn, pfx, sfx)                             \
+       CPU_32_PORT(fn, pfx##_0_, sfx),                         \
+       CPU_32_PORT1(fn, pfx##_1_, sfx),                        \
+       CPU_32_PORT(fn, pfx##_2_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_3_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_4_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_5_, sfx),                         \
+       CPU_32_PORT(fn, pfx##_6_, sfx),                         \
+       CPU_32_PORT1(fn, pfx##_7_, sfx)
+#else
+#error "NO support"
+#endif
+
+#define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA)
+#define _GP_DATA(pfx, sfx) PINMUX_DATA(GP##pfx##_DATA, GP##pfx##_FN,   \
+                                      GP##pfx##_IN, GP##pfx##_OUT)
+
+#define _GP_INOUTSEL(pfx, sfx) GP##pfx##_IN, GP##pfx##_OUT
+#define _GP_INDT(pfx, sfx) GP##pfx##_DATA
+
+#define GP_ALL(str)    CPU_ALL_PORT(_PORT_ALL, GP, str)
+#define PINMUX_GPIO_GP_ALL()   CPU_ALL_PORT(_GP_GPIO, , unused)
+#define PINMUX_DATA_GP_ALL()   CPU_ALL_PORT(_GP_DATA, , unused)
+
+#define PORT_10_REV(fn, pfx, sfx)                              \
+       PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx),       \
+       PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx),       \
+       PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx),       \
+       PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx),       \
+       PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx)
+
+#define CPU_32_PORT_REV(fn, pfx, sfx)                                  \
+       PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx),             \
+       PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx),     \
+       PORT_10_REV(fn, pfx, sfx)
+
+#define GP_INOUTSEL(bank) CPU_32_PORT_REV(_GP_INOUTSEL, _##bank##_, unused)
+#define GP_INDT(bank) CPU_32_PORT_REV(_GP_INDT, _##bank##_, unused)
+
+#define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn)
+#define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \
+                                                         FN_##ipsr, FN_##fn)
+
+#endif /* __PFC_R8A7790_H__ */
diff --git a/arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c b/arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c
new file mode 100644 (file)
index 0000000..f49f990
--- /dev/null
@@ -0,0 +1,1117 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <sh_pfc.h>
+#include <asm/gpio.h>
+#include "pfc-r8a7790.h"
+
+enum {
+       PINMUX_RESERVED = 0,
+
+       PINMUX_DATA_BEGIN,
+       GP_ALL(DATA),
+       PINMUX_DATA_END,
+
+       PINMUX_INPUT_BEGIN,
+       GP_ALL(IN),
+       PINMUX_INPUT_END,
+
+       PINMUX_OUTPUT_BEGIN,
+       GP_ALL(OUT),
+       PINMUX_OUTPUT_END,
+
+       PINMUX_FUNCTION_BEGIN,
+       GP_ALL(FN),
+
+       /* GPSR0 */
+       FN_IP0_0, FN_IP0_1, FN_IP0_2, FN_IP0_3, FN_IP0_4, FN_IP0_5,
+       FN_IP0_6, FN_IP0_7, FN_IP0_8, FN_IP0_9, FN_IP0_10, FN_IP0_11,
+       FN_IP0_12, FN_IP0_13, FN_IP0_14, FN_IP0_15, FN_IP0_18_16, FN_IP0_20_19,
+       FN_IP0_22_21, FN_IP0_24_23, FN_IP0_26_25, FN_IP0_28_27, FN_IP0_30_29,
+       FN_IP1_1_0, FN_IP1_3_2, FN_IP1_5_4, FN_IP1_7_6, FN_IP1_10_8,
+       FN_IP1_13_11, FN_IP1_16_14, FN_IP1_19_17, FN_IP1_22_20,
+
+       /* GPSR1 */
+       FN_IP1_25_23, FN_IP1_28_26, FN_IP1_31_29, FN_IP2_2_0, FN_IP2_4_3,
+       FN_IP2_6_5, FN_IP2_9_7, FN_IP2_12_10, FN_IP2_15_13, FN_IP2_18_16,
+       FN_IP2_20_19, FN_IP2_22_21, FN_EX_CS0_N, FN_IP2_24_23, FN_IP2_26_25,
+       FN_IP2_29_27, FN_IP3_2_0, FN_IP3_5_3, FN_IP3_8_6, FN_RD_N,
+       FN_IP3_11_9, FN_IP3_13_12, FN_IP3_15_14 , FN_IP3_17_16 , FN_IP3_19_18,
+       FN_IP3_21_20,
+
+       /* GPSR2 */
+       FN_IP3_27_25, FN_IP3_30_28, FN_IP4_1_0, FN_IP4_4_2, FN_IP4_7_5,
+       FN_IP4_9_8, FN_IP4_12_10, FN_IP4_15_13, FN_IP4_18_16, FN_IP4_19,
+       FN_IP4_20, FN_IP4_21, FN_IP4_23_22, FN_IP4_25_24, FN_IP4_27_26,
+       FN_IP4_30_28, FN_IP5_2_0, FN_IP5_5_3, FN_IP5_8_6, FN_IP5_11_9,
+       FN_IP5_14_12, FN_IP5_16_15, FN_IP5_19_17, FN_IP5_21_20, FN_IP5_23_22,
+       FN_IP5_25_24, FN_IP5_28_26, FN_IP5_31_29, FN_AUDIO_CLKA, FN_IP6_2_0,
+       FN_IP6_5_3, FN_IP6_7_6,
+
+       /* GPSR3 */
+       FN_IP7_5_3, FN_IP7_8_6, FN_IP7_10_9, FN_IP7_12_11, FN_IP7_14_13,
+       FN_IP7_16_15, FN_IP7_18_17, FN_IP7_20_19, FN_IP7_23_21, FN_IP7_26_24,
+       FN_IP7_29_27, FN_IP8_2_0, FN_IP8_5_3, FN_IP8_8_6, FN_IP8_11_9,
+       FN_IP8_14_12, FN_IP8_17_15, FN_IP8_20_18, FN_IP8_23_21, FN_IP8_25_24,
+       FN_IP8_27_26, FN_IP8_30_28, FN_IP9_2_0, FN_IP9_5_3, FN_IP9_6, FN_IP9_7,
+       FN_IP9_10_8, FN_IP9_11, FN_IP9_12, FN_IP9_15_13, FN_IP9_16,
+       FN_IP9_18_17,
+
+       /* GPSR4 */
+       FN_VI0_CLK, FN_IP9_20_19, FN_IP9_22_21, FN_IP9_24_23, FN_IP9_26_25,
+       FN_VI0_DATA0_VI0_B0, FN_VI0_DATA0_VI0_B1, FN_VI0_DATA0_VI0_B2,
+       FN_IP9_28_27, FN_VI0_DATA0_VI0_B4, FN_VI0_DATA0_VI0_B5,
+       FN_VI0_DATA0_VI0_B6, FN_VI0_DATA0_VI0_B7, FN_IP9_31_29, FN_IP10_2_0,
+       FN_IP10_5_3, FN_IP10_8_6, FN_IP10_11_9, FN_IP10_14_12, FN_IP10_16_15,
+       FN_IP10_18_17, FN_IP10_21_19, FN_IP10_24_22, FN_IP10_26_25,
+       FN_IP10_28_27, FN_IP10_31_29, FN_IP11_2_0, FN_IP11_5_3, FN_IP11_8_6,
+       FN_IP15_1_0, FN_IP15_3_2, FN_IP15_5_4,
+
+       /* GPSR5 */
+       FN_IP11_11_9, FN_IP11_14_12, FN_IP11_16_15, FN_IP11_18_17, FN_IP11_19,
+       FN_IP11_20, FN_IP11_21, FN_IP11_22, FN_IP11_23, FN_IP11_24,
+       FN_IP11_25, FN_IP11_26, FN_IP11_27, FN_IP11_29_28, FN_IP11_31_30,
+       FN_IP12_1_0, FN_IP12_3_2, FN_IP12_6_4, FN_IP12_9_7, FN_IP12_12_10,
+       FN_IP12_15_13, FN_IP12_17_16, FN_IP12_19_18, FN_IP12_21_20,
+       FN_IP12_23_22, FN_IP12_26_24, FN_IP12_29_27, FN_IP13_2_0, FN_IP13_4_3,
+       FN_IP13_6_5, FN_IP13_9_7, FN_IP3_24_22,
+
+       /* GPSR6 */
+       FN_IP13_10, FN_IP13_11, FN_IP13_12, FN_IP13_13, FN_IP13_14,
+       FN_IP13_15, FN_IP13_18_16, FN_IP13_21_19, FN_IP13_22, FN_IP13_24_23,
+       FN_IP13_25, FN_IP13_26, FN_IP13_27, FN_IP13_30_28, FN_IP14_1_0,
+       FN_IP14_2, FN_IP14_3, FN_IP14_4, FN_IP14_5, FN_IP14_6, FN_IP14_7,
+       FN_IP14_10_8, FN_IP14_13_11, FN_IP14_16_14, FN_IP14_19_17,
+       FN_IP14_22_20, FN_IP14_25_23, FN_IP14_28_26, FN_IP14_31_29,
+
+       /* GPSR7 */
+       FN_IP15_17_15, FN_IP15_20_18, FN_IP15_23_21, FN_IP15_26_24,
+       FN_IP15_29_27, FN_IP16_2_0, FN_IP16_5_3, FN_IP16_7_6, FN_IP16_9_8,
+       FN_IP16_11_10, FN_IP6_9_8, FN_IP6_11_10, FN_IP6_13_12, FN_IP6_15_14,
+       FN_IP6_18_16, FN_IP6_20_19, FN_IP6_23_21, FN_IP6_26_24, FN_IP6_29_27,
+       FN_IP7_2_0, FN_IP15_8_6, FN_IP15_11_9, FN_IP15_14_12,
+       FN_USB0_PWEN, FN_USB0_OVC, FN_USB1_PWEN,
+
+       /* IPSR0 -  IPSR10 */
+
+       /* IPSR11 */
+       FN_VI0_R5, FN_VI2_DATA6, FN_GLO_SDATA_B, FN_RX0_C, FN_SDA1_D,
+       FN_VI0_R6, FN_VI2_DATA7, FN_GLO_SS_B, FN_TX1_C, FN_SCL4_B,
+       FN_VI0_R7, FN_GLO_RFON_B, FN_RX1_C, FN_CAN0_RX_E,
+       FN_SDA4_B, FN_HRX1_D, FN_SCIFB0_RXD_D,
+       FN_VI1_HSYNC_N, FN_AVB_RXD0, FN_TS_SDATA0_B, FN_TX4_B, FN_SCIFA4_TXD_B,
+       FN_VI1_VSYNC_N, FN_AVB_RXD1, FN_TS_SCK0_B, FN_RX4_B, FN_SCIFA4_RXD_B,
+       FN_VI1_CLKENB, FN_AVB_RXD2, FN_TS_SDEN0_B,
+       FN_VI1_FIELD, FN_AVB_RXD3, FN_TS_SPSYNC0_B,
+       FN_VI1_CLK, FN_AVB_RXD4, FN_VI1_DATA0, FN_AVB_RXD5,
+       FN_VI1_DATA1, FN_AVB_RXD6, FN_VI1_DATA2, FN_AVB_RXD7,
+       FN_VI1_DATA3, FN_AVB_RX_ER, FN_VI1_DATA4, FN_AVB_MDIO,
+       FN_VI1_DATA5, FN_AVB_RX_DV, FN_VI1_DATA6, FN_AVB_MAGIC,
+       FN_VI1_DATA7, FN_AVB_MDC,
+       FN_ETH_MDIO, FN_AVB_RX_CLK, FN_SCL2_C,
+       FN_ETH_CRS_DV, FN_AVB_LINK, FN_SDA2_C,
+
+       /* IPSR12 */
+       FN_ETH_RX_ER, FN_AVB_CRS, FN_SCL3, FN_SCL7,
+       FN_ETH_RXD0, FN_AVB_PHY_INT, FN_SDA3, FN_SDA7,
+       FN_ETH_RXD1, FN_AVB_GTXREFCLK, FN_CAN0_TX_C,
+       FN_SCL2_D, FN_MSIOF1_RXD_E,
+       FN_ETH_LINK, FN_AVB_TXD0, FN_CAN0_RX_C, FN_SDA2_D, FN_MSIOF1_SCK_E,
+       FN_ETH_REFCLK, FN_AVB_TXD1, FN_SCIFA3_RXD_B,
+       FN_CAN1_RX_C, FN_MSIOF1_SYNC_E,
+       FN_ETH_TXD1, FN_AVB_TXD2, FN_SCIFA3_TXD_B,
+       FN_CAN1_TX_C, FN_MSIOF1_TXD_E,
+       FN_ETH_TX_EN, FN_AVB_TXD3, FN_TCLK1_B, FN_CAN_CLK_B,
+       FN_ETH_MAGIC, FN_AVB_TXD4, FN_IETX_C,
+       FN_ETH_TXD0, FN_AVB_TXD5, FN_IECLK_C,
+       FN_ETH_MDC, FN_AVB_TXD6, FN_IERX_C,
+       FN_STP_IVCXO27_0, FN_AVB_TXD7, FN_SCIFB2_TXD_D,
+       FN_ADIDATA_B, FN_MSIOF0_SYNC_C,
+       FN_STP_ISCLK_0, FN_AVB_TX_EN, FN_SCIFB2_RXD_D,
+       FN_ADICS_SAMP_B, FN_MSIOF0_SCK_C,
+
+       /* IPSR13 */
+       /* MOD_SEL */
+       FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
+       FN_SEL_SCIFB_0, FN_SEL_SCIFB_1, FN_SEL_SCIFB_2, FN_SEL_SCIFB_3,
+       FN_SEL_SCIFB2_0, FN_SEL_SCIFB2_1, FN_SEL_SCIFB2_2, FN_SEL_SCIFB2_3,
+       FN_SEL_SCIFB1_0, FN_SEL_SCIFB1_1, FN_SEL_SCIFB1_2, FN_SEL_SCIFB1_3,
+       FN_SEL_SCIFA1_0, FN_SEL_SCIFA1_1, FN_SEL_SCIFA1_2,
+       FN_SEL_SSI9_0, FN_SEL_SSI9_1,
+       FN_SEL_SCFA_0, FN_SEL_SCFA_1,
+       FN_SEL_QSP_0, FN_SEL_QSP_1,
+       FN_SEL_SSI7_0, FN_SEL_SSI7_1,
+       FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2, FN_SEL_HSCIF1_3,
+       FN_SEL_HSCIF1_4,
+       FN_SEL_VI1_0, FN_SEL_VI1_1, FN_SEL_VI1_2,
+       FN_SEL_TMU1_0, FN_SEL_TMU1_1,
+       FN_SEL_LBS_0, FN_SEL_LBS_1, FN_SEL_LBS_2, FN_SEL_LBS_3,
+       FN_SEL_TSIF0_0, FN_SEL_TSIF0_1, FN_SEL_TSIF0_2, FN_SEL_TSIF0_3,
+       FN_SEL_SOF0_0, FN_SEL_SOF0_1, FN_SEL_SOF0_2,
+
+       /* MOD_SEL2 */
+       FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, FN_SEL_SCIF0_3,
+       FN_SEL_SCIF0_4,
+       FN_SEL_SCIF_0, FN_SEL_SCIF_1,
+       FN_SEL_CAN0_0, FN_SEL_CAN0_1, FN_SEL_CAN0_2, FN_SEL_CAN0_3,
+       FN_SEL_CAN0_4, FN_SEL_CAN0_5,
+       FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3,
+       FN_SEL_SCIFA2_0, FN_SEL_SCIFA2_1,
+       FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2,
+       FN_SEL_ADG_0, FN_SEL_ADG_1,
+       FN_SEL_FM_0, FN_SEL_FM_1, FN_SEL_FM_2, FN_SEL_FM_3, FN_SEL_FM_4,
+       FN_SEL_SCIFA5_0, FN_SEL_SCIFA5_1, FN_SEL_SCIFA5_2,
+       FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3,
+       FN_SEL_SCIFA4_0, FN_SEL_SCIFA4_1, FN_SEL_SCIFA4_2,
+       FN_SEL_SCIFA3_0, FN_SEL_SCIFA3_1, FN_SEL_SCIFA3_2,
+       FN_SEL_SIM_0, FN_SEL_SIM_1,
+       FN_SEL_SSI8_0, FN_SEL_SSI8_1,
+
+       /* MOD_SEL3 */
+       FN_SEL_HSCIF2_0, FN_SEL_HSCIF2_1, FN_SEL_HSCIF2_2, FN_SEL_HSCIF2_3,
+       FN_SEL_CANCLK_0, FN_SEL_CANCLK_1, FN_SEL_CANCLK_2, FN_SEL_CANCLK_3,
+       FN_SEL_IIC8_0, FN_SEL_IIC8_1, FN_SEL_IIC8_2,
+       FN_SEL_IIC7_0, FN_SEL_IIC7_1, FN_SEL_IIC7_2,
+       FN_SEL_IIC4_0, FN_SEL_IIC4_1, FN_SEL_IIC4_2,
+       FN_SEL_IIC3_0, FN_SEL_IIC3_1, FN_SEL_IIC3_2, FN_SEL_IIC3_3,
+       FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
+       FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2,
+       FN_SEL_MMC_0, FN_SEL_MMC_1,
+       FN_SEL_SCIF5_0, FN_SEL_SCIF5_1,
+       FN_SEL_IIC2_0, FN_SEL_IIC2_1, FN_SEL_IIC2_2, FN_SEL_IIC2_3,
+       FN_SEL_IIC1_0, FN_SEL_IIC1_1, FN_SEL_IIC1_2, FN_SEL_IIC1_3,
+       FN_SEL_IIC1_4,
+       FN_SEL_IIC0_0, FN_SEL_IIC0_1, FN_SEL_IIC0_2,
+
+       /* MOD_SEL4 */
+       FN_SEL_SOF1_0, FN_SEL_SOF1_1, FN_SEL_SOF1_2, FN_SEL_SOF1_3,
+       FN_SEL_SOF1_4,
+       FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1, FN_SEL_HSCIF0_2,
+       FN_SEL_DIS_0, FN_SEL_DIS_1, FN_SEL_DIS_2,
+       FN_SEL_RAD_0, FN_SEL_RAD_1,
+       FN_SEL_RCN_0, FN_SEL_RCN_1,
+       FN_SEL_RSP_0, FN_SEL_RSP_1,
+       FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2, FN_SEL_SCIF2_3,
+       FN_SEL_SCIF2_4,
+       FN_SEL_SOF2_0, FN_SEL_SOF2_1, FN_SEL_SOF2_2, FN_SEL_SOF2_3,
+       FN_SEL_SOF2_4,
+       FN_SEL_SSI1_0, FN_SEL_SSI1_1,
+       FN_SEL_SSI0_0, FN_SEL_SSI0_1,
+       FN_SEL_SSP_0, FN_SEL_SSP_1, FN_SEL_SSP_2,
+       PINMUX_FUNCTION_END,
+
+       PINMUX_MARK_BEGIN,
+
+       EX_CS0_N_MARK, RD_N_MARK,
+
+       AUDIO_CLKA_MARK,
+
+       VI0_CLK_MARK, VI0_DATA0_VI0_B0_MARK, VI0_DATA0_VI0_B1_MARK,
+       VI0_DATA0_VI0_B2_MARK, VI0_DATA0_VI0_B4_MARK, VI0_DATA0_VI0_B5_MARK,
+       VI0_DATA0_VI0_B6_MARK, VI0_DATA0_VI0_B7_MARK,
+
+       USB0_PWEN_MARK, USB0_OVC_MARK, USB1_PWEN_MARK,
+
+       /* IPSR0  IPSR10 */
+       /* IPSR11 */
+       VI0_R5_MARK, VI2_DATA6_MARK, GLO_SDATA_B_MARK, RX0_C_MARK, SDA1_D_MARK,
+       VI0_R6_MARK, VI2_DATA7_MARK, GLO_SS_B_MARK, TX1_C_MARK, SCL4_B_MARK,
+       VI0_R7_MARK, GLO_RFON_B_MARK, RX1_C_MARK, CAN0_RX_E_MARK,
+       SDA4_B_MARK, _MARK, HRX1_D_MARK, SCIFB0_RXD_D_MARK,
+       VI1_HSYNC_N_MARK, AVB_RXD0_MARK, TS_SDATA0_B_MARK,
+       TX4_B_MARK, SCIFA4_TXD_B_MARK,
+       VI1_VSYNC_N_MARK, AVB_RXD1_MARK, TS_SCK0_B_MARK,
+       RX4_B_MARK, SCIFA4_RXD_B_MARK,
+       VI1_CLKENB_MARK, AVB_RXD2_MARK, TS_SDEN0_B_MARK,
+       VI1_FIELD_MARK, AVB_RXD3_MARK, TS_SPSYNC0_B_MARK,
+       VI1_CLK_MARK, AVB_RXD4_MARK, VI1_DATA0_MARK, AVB_RXD5_MARK,
+       VI1_DATA1_MARK, AVB_RXD6_MARK, VI1_DATA2_MARK, AVB_RXD7_MARK,
+       VI1_DATA3_MARK, AVB_RX_ER_MARK, VI1_DATA4_MARK, AVB_MDIO_MARK,
+       VI1_DATA5_MARK, AVB_RX_DV_MARK, VI1_DATA6_MARK, AVB_MAGIC_MARK,
+       VI1_DATA7_MARK, AVB_MDC_MARK,
+       ETH_MDIO_MARK, AVB_RX_CLK_MARK, SCL2_C_MARK,
+       ETH_CRS_DV_MARK, AVB_LINK_MARK, SDA2_C_MARK,
+
+       /* IPSR12 */
+       ETH_RX_ER_MARK, AVB_CRS_MARK, SCL3_MARK, SCL7_MARK,
+       ETH_RXD0_MARK, AVB_PHY_INT_MARK, SDA3_MARK, SDA7_MARK,
+       ETH_RXD1_MARK, AVB_GTXREFCLK_MARK, CAN0_TX_C_MARK,
+       SCL2_D_MARK, MSIOF1_RXD_E_MARK,
+       ETH_LINK_MARK, AVB_TXD0_MARK, CAN0_RX_C_MARK,
+       SDA2_D_MARK, MSIOF1_SCK_E_MARK,
+       ETH_REFCLK_MARK, AVB_TXD1_MARK, SCIFA3_RXD_B_MARK,
+       CAN1_RX_C_MARK, MSIOF1_SYNC_E_MARK,
+       ETH_TXD1_MARK, AVB_TXD2_MARK, SCIFA3_TXD_B_MARK,
+       CAN1_TX_C_MARK, MSIOF1_TXD_E_MARK,
+       ETH_TX_EN_MARK, AVB_TXD3_MARK, TCLK1_B_MARK, CAN_CLK_B_MARK,
+       ETH_MAGIC_MARK, AVB_TXD4_MARK, IETX_C_MARK,
+       ETH_TXD0_MARK, AVB_TXD5_MARK, IECLK_C_MARK,
+       ETH_MDC_MARK, AVB_TXD6_MARK, IERX_C_MARK,
+       STP_IVCXO27_0_MARK, AVB_TXD7_MARK, SCIFB2_TXD_D_MARK,
+       ADIDATA_B_MARK, MSIOF0_SYNC_C_MARK,
+       STP_ISCLK_0_MARK, AVB_TX_EN_MARK, SCIFB2_RXD_D_MARK,
+       ADICS_SAMP_B_MARK, MSIOF0_SCK_C_MARK,
+
+       /* IPSR13 */
+       PINMUX_MARK_END,
+};
+
+static pinmux_enum_t pinmux_data[] = {
+       PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */
+
+       /* OTHER IPSR0  - IPSR10 */
+       /* IPSR11 */
+       PINMUX_IPSR_DATA(IP11_2_0, VI0_R5),
+       PINMUX_IPSR_DATA(IP11_2_0, VI2_DATA6),
+       PINMUX_IPSR_MODSEL_DATA(IP11_2_0, GLO_SDATA_B, SEL_GPS_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_2_0, RX0_C, SEL_SCIF0_2),
+       PINMUX_IPSR_MODSEL_DATA(IP11_2_0, SDA1_D, SEL_IIC1_3),
+       PINMUX_IPSR_DATA(IP11_5_3, VI0_R6),
+       PINMUX_IPSR_DATA(IP11_5_3, VI2_DATA7),
+       PINMUX_IPSR_MODSEL_DATA(IP11_5_3, GLO_SS_B, SEL_GPS_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_5_3, TX1_C, SEL_SCIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP11_5_3, SCL4_B, SEL_IIC4_1),
+       PINMUX_IPSR_DATA(IP11_8_6, VI0_R7),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, GLO_RFON_B, SEL_GPS_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, RX1_C, SEL_SCIF1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, CAN0_RX_E, SEL_CAN0_4),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, SDA4_B, SEL_IIC4_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, HRX1_D, SEL_HSCIF1_3),
+       PINMUX_IPSR_MODSEL_DATA(IP11_8_6, SCIFB0_RXD_D, SEL_SCIFB_3),
+       PINMUX_IPSR_MODSEL_DATA(IP11_11_9, VI1_HSYNC_N, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_11_9, AVB_RXD0),
+       PINMUX_IPSR_MODSEL_DATA(IP11_11_9, TS_SDATA0_B, SEL_TSIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_11_9, TX4_B, SEL_SCIF4_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_11_9, SCIFA4_TXD_B, SEL_SCIFA4_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_14_12, VI1_VSYNC_N, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_14_12, AVB_RXD1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_14_12, TS_SCK0_B, SEL_TSIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_14_12, RX4_B, SEL_SCIF4_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_14_12, SCIFA4_RXD_B, SEL_SCIFA4_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_16_15, VI1_CLKENB, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_16_15, AVB_RXD2),
+       PINMUX_IPSR_MODSEL_DATA(IP11_16_15, TS_SDEN0_B, SEL_TSIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_18_17, VI1_FIELD, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_18_17, AVB_RXD3),
+       PINMUX_IPSR_MODSEL_DATA(IP11_18_17, TS_SPSYNC0_B, SEL_TSIF0_1),
+       PINMUX_IPSR_MODSEL_DATA(IP11_19, VI1_CLK, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_19, AVB_RXD4),
+       PINMUX_IPSR_MODSEL_DATA(IP11_20, VI1_DATA0, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_20, AVB_RXD5),
+       PINMUX_IPSR_MODSEL_DATA(IP11_21, VI1_DATA1, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_21, AVB_RXD6),
+       PINMUX_IPSR_MODSEL_DATA(IP11_22, VI1_DATA2, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_22, AVB_RXD7),
+       PINMUX_IPSR_MODSEL_DATA(IP11_23, VI1_DATA3, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_23, AVB_RX_ER),
+       PINMUX_IPSR_MODSEL_DATA(IP11_24, VI1_DATA4, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_24, AVB_MDIO),
+       PINMUX_IPSR_MODSEL_DATA(IP11_25, VI1_DATA5, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_25, AVB_RX_DV),
+       PINMUX_IPSR_MODSEL_DATA(IP11_26, VI1_DATA6, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_26, AVB_MAGIC),
+       PINMUX_IPSR_MODSEL_DATA(IP11_27, VI1_DATA7, SEL_VI1_0),
+       PINMUX_IPSR_DATA(IP11_27, AVB_MDC),
+       PINMUX_IPSR_DATA(IP11_29_28, ETH_MDIO),
+       PINMUX_IPSR_DATA(IP11_29_28, AVB_RX_CLK),
+       PINMUX_IPSR_MODSEL_DATA(IP11_29_28, SCL2_C, SEL_IIC2_2),
+       PINMUX_IPSR_DATA(IP11_31_30, ETH_CRS_DV),
+       PINMUX_IPSR_DATA(IP11_31_30, AVB_LINK),
+       PINMUX_IPSR_MODSEL_DATA(IP11_31_30, SDA2_C, SEL_IIC2_2),
+
+       /* IPSR12 */
+       PINMUX_IPSR_DATA(IP12_1_0, ETH_RX_ER),
+       PINMUX_IPSR_DATA(IP12_1_0, AVB_CRS),
+       PINMUX_IPSR_MODSEL_DATA(IP12_1_0, SCL3, SEL_IIC3_0),
+       PINMUX_IPSR_MODSEL_DATA(IP12_1_0, SCL7, SEL_IIC7_0),
+       PINMUX_IPSR_DATA(IP12_3_2, ETH_RXD0),
+       PINMUX_IPSR_DATA(IP12_3_2, AVB_PHY_INT),
+       PINMUX_IPSR_MODSEL_DATA(IP12_3_2, SDA3, SEL_IIC3_0),
+       PINMUX_IPSR_MODSEL_DATA(IP12_3_2, SDA7, SEL_IIC7_0),
+       PINMUX_IPSR_DATA(IP12_6_4, ETH_RXD1),
+       PINMUX_IPSR_DATA(IP12_6_4, AVB_GTXREFCLK),
+       PINMUX_IPSR_MODSEL_DATA(IP12_6_4, CAN0_TX_C, SEL_CAN0_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_6_4, SCL2_D, SEL_IIC2_3),
+       PINMUX_IPSR_MODSEL_DATA(IP12_6_4, MSIOF1_RXD_E, SEL_SOF1_4),
+       PINMUX_IPSR_DATA(IP12_9_7, ETH_LINK),
+       PINMUX_IPSR_DATA(IP12_9_7, AVB_TXD0),
+       PINMUX_IPSR_MODSEL_DATA(IP12_9_7, CAN0_RX_C, SEL_CAN0_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_9_7, SDA2_D, SEL_IIC2_3),
+       PINMUX_IPSR_MODSEL_DATA(IP12_9_7, MSIOF1_SCK_E, SEL_SOF1_4),
+       PINMUX_IPSR_DATA(IP12_12_10, ETH_REFCLK),
+       PINMUX_IPSR_DATA(IP12_12_10, AVB_TXD1),
+       PINMUX_IPSR_MODSEL_DATA(IP12_12_10, SCIFA3_RXD_B, SEL_SCIFA3_1),
+       PINMUX_IPSR_MODSEL_DATA(IP12_12_10, CAN1_RX_C, SEL_CAN1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_12_10, MSIOF1_SYNC_E, SEL_SOF1_4),
+       PINMUX_IPSR_DATA(IP12_15_13, ETH_TXD1),
+       PINMUX_IPSR_DATA(IP12_15_13, AVB_TXD2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_15_13, SCIFA3_TXD_B, SEL_SCIFA3_1),
+       PINMUX_IPSR_MODSEL_DATA(IP12_15_13, CAN1_TX_C, SEL_CAN1_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_15_13, MSIOF1_TXD_E, SEL_SOF1_4),
+       PINMUX_IPSR_DATA(IP12_17_16, ETH_TX_EN),
+       PINMUX_IPSR_DATA(IP12_17_16, AVB_TXD3),
+       PINMUX_IPSR_MODSEL_DATA(IP12_17_16, TCLK1_B, SEL_TMU1_0),
+       PINMUX_IPSR_MODSEL_DATA(IP12_17_16, CAN_CLK_B, SEL_CANCLK_1),
+       PINMUX_IPSR_DATA(IP12_19_18, ETH_MAGIC),
+       PINMUX_IPSR_DATA(IP12_19_18, AVB_TXD4),
+       PINMUX_IPSR_MODSEL_DATA(IP12_19_18, IETX_C, SEL_IEB_2),
+       PINMUX_IPSR_DATA(IP12_21_20, ETH_TXD0),
+       PINMUX_IPSR_DATA(IP12_21_20, AVB_TXD5),
+       PINMUX_IPSR_MODSEL_DATA(IP12_21_20, IECLK_C, SEL_IEB_2),
+       PINMUX_IPSR_DATA(IP12_23_22, ETH_MDC),
+       PINMUX_IPSR_DATA(IP12_23_22, AVB_TXD6),
+       PINMUX_IPSR_MODSEL_DATA(IP12_23_22, IERX_C, SEL_IEB_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_26_24, STP_IVCXO27_0, SEL_SSP_0),
+       PINMUX_IPSR_DATA(IP12_26_24, AVB_TXD7),
+       PINMUX_IPSR_MODSEL_DATA(IP12_26_24, SCIFB2_TXD_D, SEL_SCIFB2_3),
+       PINMUX_IPSR_MODSEL_DATA(IP12_26_24, ADIDATA_B, SEL_RAD_1),
+       PINMUX_IPSR_MODSEL_DATA(IP12_26_24, MSIOF0_SYNC_C, SEL_SOF0_2),
+       PINMUX_IPSR_MODSEL_DATA(IP12_29_27, STP_ISCLK_0, SEL_SSP_0),
+       PINMUX_IPSR_DATA(IP12_29_27, AVB_TX_EN),
+       PINMUX_IPSR_MODSEL_DATA(IP12_29_27, SCIFB2_RXD_D, SEL_SCIFB2_3),
+       PINMUX_IPSR_MODSEL_DATA(IP12_29_27, ADICS_SAMP_B, SEL_RAD_1),
+       PINMUX_IPSR_MODSEL_DATA(IP12_29_27, MSIOF0_SCK_C, SEL_SOF0_2),
+
+       /* IPSR13 - IPSR16 */
+};
+
+static struct pinmux_gpio pinmux_gpios[] = {
+       PINMUX_GPIO_GP_ALL(),
+
+       /* OTHER, IPSR0 - IPSR10 */
+       /* IPSR11 */
+       GPIO_FN(VI0_R5), GPIO_FN(VI2_DATA6), GPIO_FN(GLO_SDATA_B),
+       GPIO_FN(RX0_C), GPIO_FN(SDA1_D),
+       GPIO_FN(VI0_R6), GPIO_FN(VI2_DATA7),
+       GPIO_FN(GLO_SS_B), GPIO_FN(TX1_C), GPIO_FN(SCL4_B),
+       GPIO_FN(VI0_R7), GPIO_FN(GLO_RFON_B),
+       GPIO_FN(RX1_C), GPIO_FN(CAN0_RX_E),
+       GPIO_FN(SDA4_B), GPIO_FN(HRX1_D), GPIO_FN(SCIFB0_RXD_D),
+       GPIO_FN(VI1_HSYNC_N), GPIO_FN(AVB_RXD0), GPIO_FN(TS_SDATA0_B),
+       GPIO_FN(TX4_B), GPIO_FN(SCIFA4_TXD_B),
+       GPIO_FN(VI1_VSYNC_N), GPIO_FN(AVB_RXD1), GPIO_FN(TS_SCK0_B),
+       GPIO_FN(RX4_B), GPIO_FN(SCIFA4_RXD_B),
+       GPIO_FN(VI1_CLKENB), GPIO_FN(AVB_RXD2), GPIO_FN(TS_SDEN0_B),
+       GPIO_FN(VI1_FIELD), GPIO_FN(AVB_RXD3), GPIO_FN(TS_SPSYNC0_B),
+       GPIO_FN(VI1_CLK), GPIO_FN(AVB_RXD4),
+       GPIO_FN(VI1_DATA0), GPIO_FN(AVB_RXD5),
+       GPIO_FN(VI1_DATA1), GPIO_FN(AVB_RXD6),
+       GPIO_FN(VI1_DATA2), GPIO_FN(AVB_RXD7),
+       GPIO_FN(VI1_DATA3), GPIO_FN(AVB_RX_ER),
+       GPIO_FN(VI1_DATA4), GPIO_FN(AVB_MDIO),
+       GPIO_FN(VI1_DATA5), GPIO_FN(AVB_RX_DV),
+       GPIO_FN(VI1_DATA6), GPIO_FN(AVB_MAGIC),
+       GPIO_FN(VI1_DATA7), GPIO_FN(AVB_MDC),
+       GPIO_FN(ETH_MDIO), GPIO_FN(AVB_RX_CLK), GPIO_FN(SCL2_C),
+       GPIO_FN(ETH_CRS_DV), GPIO_FN(AVB_LINK), GPIO_FN(SDA2_C),
+
+       /* IPSR12 */
+       GPIO_FN(ETH_RX_ER), GPIO_FN(AVB_CRS), GPIO_FN(SCL3), GPIO_FN(SCL7),
+       GPIO_FN(ETH_RXD0), GPIO_FN(AVB_PHY_INT), GPIO_FN(SDA3), GPIO_FN(SDA7),
+       GPIO_FN(ETH_RXD1), GPIO_FN(AVB_GTXREFCLK), GPIO_FN(CAN0_TX_C),
+       GPIO_FN(SCL2_D), GPIO_FN(MSIOF1_RXD_E),
+       GPIO_FN(ETH_LINK), GPIO_FN(AVB_TXD0), GPIO_FN(CAN0_RX_C),
+       GPIO_FN(SDA2_D), GPIO_FN(MSIOF1_SCK_E),
+       GPIO_FN(ETH_REFCLK), GPIO_FN(AVB_TXD1), GPIO_FN(SCIFA3_RXD_B),
+       GPIO_FN(CAN1_RX_C), GPIO_FN(MSIOF1_SYNC_E),
+       GPIO_FN(ETH_TXD1), GPIO_FN(AVB_TXD2), GPIO_FN(SCIFA3_TXD_B),
+       GPIO_FN(CAN1_TX_C), GPIO_FN(MSIOF1_TXD_E),
+       GPIO_FN(ETH_TX_EN), GPIO_FN(AVB_TXD3),
+       GPIO_FN(TCLK1_B), GPIO_FN(CAN_CLK_B),
+       GPIO_FN(ETH_MAGIC), GPIO_FN(AVB_TXD4), GPIO_FN(IETX_C),
+       GPIO_FN(ETH_TXD0), GPIO_FN(AVB_TXD5), GPIO_FN(IECLK_C),
+       GPIO_FN(ETH_MDC), GPIO_FN(AVB_TXD6), GPIO_FN(IERX_C),
+       GPIO_FN(STP_IVCXO27_0), GPIO_FN(AVB_TXD7), GPIO_FN(SCIFB2_TXD_D),
+       GPIO_FN(ADIDATA_B), GPIO_FN(MSIOF0_SYNC_C),
+       GPIO_FN(STP_ISCLK_0), GPIO_FN(AVB_TX_EN), GPIO_FN(SCIFB2_RXD_D),
+       GPIO_FN(ADICS_SAMP_B), GPIO_FN(MSIOF0_SCK_C),
+
+       /* IPSR13 - IPSR16 */
+};
+
+static struct pinmux_cfg_reg pinmux_config_regs[] = {
+       { PINMUX_CFG_REG("GPSR0", 0xE6060004, 32, 1) {
+               GP_0_31_FN, FN_IP1_22_20,
+               GP_0_30_FN, FN_IP1_19_17,
+               GP_0_29_FN, FN_IP1_16_14,
+               GP_0_28_FN, FN_IP1_13_11,
+               GP_0_27_FN, FN_IP1_10_8,
+               GP_0_26_FN, FN_IP1_7_6,
+               GP_0_25_FN, FN_IP1_5_4,
+               GP_0_24_FN, FN_IP1_3_2,
+               GP_0_23_FN, FN_IP1_1_0,
+               GP_0_22_FN, FN_IP0_30_29,
+               GP_0_21_FN, FN_IP0_28_27,
+               GP_0_20_FN, FN_IP0_26_25,
+               GP_0_19_FN, FN_IP0_24_23,
+               GP_0_18_FN, FN_IP0_22_21,
+               GP_0_17_FN, FN_IP0_20_19,
+               GP_0_16_FN, FN_IP0_18_16,
+               GP_0_15_FN, FN_IP0_15,
+               GP_0_14_FN, FN_IP0_14,
+               GP_0_13_FN, FN_IP0_13,
+               GP_0_12_FN, FN_IP0_12,
+               GP_0_11_FN, FN_IP0_11,
+               GP_0_10_FN, FN_IP0_10,
+               GP_0_9_FN, FN_IP0_9,
+               GP_0_8_FN, FN_IP0_8,
+               GP_0_7_FN, FN_IP0_7,
+               GP_0_6_FN, FN_IP0_6,
+               GP_0_5_FN, FN_IP0_5,
+               GP_0_4_FN, FN_IP0_4,
+               GP_0_3_FN, FN_IP0_3,
+               GP_0_2_FN, FN_IP0_2,
+               GP_0_1_FN, FN_IP0_1,
+               GP_0_0_FN, FN_IP0_0, }
+       },
+       { PINMUX_CFG_REG("GPSR1", 0xE6060008, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_1_25_FN, FN_IP3_21_20,
+               GP_1_24_FN, FN_IP3_19_18,
+               GP_1_23_FN, FN_IP3_17_16,
+               GP_1_22_FN, FN_IP3_15_14,
+               GP_1_21_FN, FN_IP3_13_12,
+               GP_1_20_FN, FN_IP3_11_9,
+               GP_1_19_FN, FN_RD_N,
+               GP_1_18_FN, FN_IP3_8_6,
+               GP_1_17_FN, FN_IP3_5_3,
+               GP_1_16_FN, FN_IP3_2_0,
+               GP_1_15_FN, FN_IP2_29_27,
+               GP_1_14_FN, FN_IP2_26_25,
+               GP_1_13_FN, FN_IP2_24_23,
+               GP_1_12_FN, FN_EX_CS0_N,
+               GP_1_11_FN, FN_IP2_22_21,
+               GP_1_10_FN, FN_IP2_20_19,
+               GP_1_9_FN, FN_IP2_18_16,
+               GP_1_8_FN, FN_IP2_15_13,
+               GP_1_7_FN, FN_IP2_12_10,
+               GP_1_6_FN, FN_IP2_9_7,
+               GP_1_5_FN, FN_IP2_6_5,
+               GP_1_4_FN, FN_IP2_4_3,
+               GP_1_3_FN, FN_IP2_2_0,
+               GP_1_2_FN, FN_IP1_31_29,
+               GP_1_1_FN, FN_IP1_28_26,
+               GP_1_0_FN, FN_IP1_25_23, }
+       },
+       { PINMUX_CFG_REG("GPSR2", 0xE606000C, 32, 1) {
+               GP_2_31_FN, FN_IP6_7_6,
+               GP_2_30_FN, FN_IP6_5_3,
+               GP_2_29_FN, FN_IP6_2_0,
+               GP_2_28_FN, FN_AUDIO_CLKA,
+               GP_2_27_FN, FN_IP5_31_29,
+               GP_2_26_FN, FN_IP5_28_26,
+               GP_2_25_FN, FN_IP5_25_24,
+               GP_2_24_FN, FN_IP5_23_22,
+               GP_2_23_FN, FN_IP5_21_20,
+               GP_2_22_FN, FN_IP5_19_17,
+               GP_2_21_FN, FN_IP5_16_15,
+               GP_2_20_FN, FN_IP5_14_12,
+               GP_2_19_FN, FN_IP5_11_9,
+               GP_2_18_FN, FN_IP5_8_6,
+               GP_2_17_FN, FN_IP5_5_3,
+               GP_2_16_FN, FN_IP5_2_0,
+               GP_2_15_FN, FN_IP4_30_28,
+               GP_2_14_FN, FN_IP4_27_26,
+               GP_2_13_FN, FN_IP4_25_24,
+               GP_2_12_FN, FN_IP4_23_22,
+               GP_2_11_FN, FN_IP4_21,
+               GP_2_10_FN, FN_IP4_20,
+               GP_2_9_FN, FN_IP4_19,
+               GP_2_8_FN, FN_IP4_18_16,
+               GP_2_7_FN, FN_IP4_15_13,
+               GP_2_6_FN, FN_IP4_12_10,
+               GP_2_5_FN, FN_IP4_9_8,
+               GP_2_4_FN, FN_IP4_7_5,
+               GP_2_3_FN, FN_IP4_4_2,
+               GP_2_2_FN, FN_IP4_1_0,
+               GP_2_1_FN, FN_IP3_30_28,
+               GP_2_0_FN, FN_IP3_27_25 }
+       },
+       { PINMUX_CFG_REG("GPSR3", 0xE6060010, 32, 1) {
+               GP_3_31_FN, FN_IP9_18_17,
+               GP_3_30_FN, FN_IP9_16,
+               GP_3_29_FN, FN_IP9_15_13,
+               GP_3_28_FN, FN_IP9_12,
+               GP_3_27_FN, FN_IP9_11,
+               GP_3_26_FN, FN_IP9_10_8,
+               GP_3_25_FN, FN_IP9_7,
+               GP_3_24_FN, FN_IP9_6,
+               GP_3_23_FN, FN_IP9_5_3,
+               GP_3_22_FN, FN_IP9_2_0,
+               GP_3_21_FN, FN_IP8_30_28,
+               GP_3_20_FN, FN_IP8_27_26,
+               GP_3_19_FN, FN_IP8_25_24,
+               GP_3_18_FN, FN_IP8_23_21,
+               GP_3_17_FN, FN_IP8_20_18,
+               GP_3_16_FN, FN_IP8_17_15,
+               GP_3_15_FN, FN_IP8_14_12,
+               GP_3_14_FN, FN_IP8_11_9,
+               GP_3_13_FN, FN_IP8_8_6,
+               GP_3_12_FN, FN_IP8_5_3,
+               GP_3_11_FN, FN_IP8_2_0,
+               GP_3_10_FN, FN_IP7_29_27,
+               GP_3_9_FN, FN_IP7_26_24,
+               GP_3_8_FN, FN_IP7_23_21,
+               GP_3_7_FN, FN_IP7_20_19,
+               GP_3_6_FN, FN_IP7_18_17,
+               GP_3_5_FN, FN_IP7_16_15,
+               GP_3_4_FN, FN_IP7_14_13,
+               GP_3_3_FN, FN_IP7_12_11,
+               GP_3_2_FN, FN_IP7_10_9,
+               GP_3_1_FN, FN_IP7_8_6,
+               GP_3_0_FN, FN_IP7_5_3 }
+       },
+       { PINMUX_CFG_REG("GPSR4", 0xE6060014, 32, 1) {
+               GP_4_31_FN, FN_IP15_5_4,
+               GP_4_30_FN, FN_IP15_3_2,
+               GP_4_29_FN, FN_IP15_1_0,
+               GP_4_28_FN, FN_IP11_8_6,
+               GP_4_27_FN, FN_IP11_5_3,
+               GP_4_26_FN, FN_IP11_2_0,
+               GP_4_25_FN, FN_IP10_31_29,
+               GP_4_24_FN, FN_IP10_28_27,
+               GP_4_23_FN, FN_IP10_26_25,
+               GP_4_22_FN, FN_IP10_24_22,
+               GP_4_21_FN, FN_IP10_21_19,
+               GP_4_20_FN, FN_IP10_18_17,
+               GP_4_19_FN, FN_IP10_16_15,
+               GP_4_18_FN, FN_IP10_14_12,
+               GP_4_17_FN, FN_IP10_11_9,
+               GP_4_16_FN, FN_IP10_8_6,
+               GP_4_15_FN, FN_IP10_5_3,
+               GP_4_14_FN, FN_IP10_2_0,
+               GP_4_13_FN, FN_IP9_31_29,
+               GP_4_12_FN, FN_VI0_DATA0_VI0_B7,
+               GP_4_11_FN, FN_VI0_DATA0_VI0_B6,
+               GP_4_10_FN, FN_VI0_DATA0_VI0_B5,
+               GP_4_9_FN, FN_VI0_DATA0_VI0_B4,
+               GP_4_8_FN, FN_IP9_28_27,
+               GP_4_7_FN, FN_VI0_DATA0_VI0_B2,
+               GP_4_6_FN, FN_VI0_DATA0_VI0_B1,
+               GP_4_5_FN, FN_VI0_DATA0_VI0_B0,
+               GP_4_4_FN, FN_IP9_26_25,
+               GP_4_3_FN, FN_IP9_24_23,
+               GP_4_2_FN, FN_IP9_22_21,
+               GP_4_1_FN, FN_IP9_20_19,
+               GP_4_0_FN, FN_VI0_CLK }
+       },
+       { PINMUX_CFG_REG("GPSR5", 0xE6060018, 32, 1) {
+               GP_5_31_FN, FN_IP3_24_22,
+               GP_5_30_FN, FN_IP13_9_7,
+               GP_5_29_FN, FN_IP13_6_5,
+               GP_5_28_FN, FN_IP13_4_3,
+               GP_5_27_FN, FN_IP13_2_0,
+               GP_5_26_FN, FN_IP12_29_27,
+               GP_5_25_FN, FN_IP12_26_24,
+               GP_5_24_FN, FN_IP12_23_22,
+               GP_5_23_FN, FN_IP12_21_20,
+               GP_5_22_FN, FN_IP12_19_18,
+               GP_5_21_FN, FN_IP12_17_16,
+               GP_5_20_FN, FN_IP12_15_13,
+               GP_5_19_FN, FN_IP12_12_10,
+               GP_5_18_FN, FN_IP12_9_7,
+               GP_5_17_FN, FN_IP12_6_4,
+               GP_5_16_FN, FN_IP12_3_2,
+               GP_5_15_FN, FN_IP12_1_0,
+               GP_5_14_FN, FN_IP11_31_30,
+               GP_5_13_FN, FN_IP11_29_28,
+               GP_5_12_FN, FN_IP11_27,
+               GP_5_11_FN, FN_IP11_26,
+               GP_5_10_FN, FN_IP11_25,
+               GP_5_9_FN, FN_IP11_24,
+               GP_5_8_FN, FN_IP11_23,
+               GP_5_7_FN, FN_IP11_22,
+               GP_5_6_FN, FN_IP11_21,
+               GP_5_5_FN, FN_IP11_20,
+               GP_5_4_FN, FN_IP11_19,
+               GP_5_3_FN, FN_IP11_18_17,
+               GP_5_2_FN, FN_IP11_16_15,
+               GP_5_1_FN, FN_IP11_14_12,
+               GP_5_0_FN, FN_IP11_11_9 }
+       },
+       { PINMUX_CFG_REG("GPSR6", 0xE606001C, 32, 1) {
+               0, 0,
+               0, 0,
+               GP_6_29_FN, FN_IP14_31_29,
+               GP_6_28_FN, FN_IP14_28_26,
+               GP_6_27_FN, FN_IP14_25_23,
+               GP_6_26_FN, FN_IP14_22_20,
+               GP_6_25_FN, FN_IP14_19_17,
+               GP_6_24_FN, FN_IP14_16_14,
+               GP_6_23_FN, FN_IP14_13_11,
+               GP_6_22_FN, FN_IP14_10_8,
+               GP_6_21_FN, FN_IP14_7,
+               GP_6_20_FN, FN_IP14_6,
+               GP_6_19_FN, FN_IP14_5,
+               GP_6_18_FN, FN_IP14_4,
+               GP_6_17_FN, FN_IP14_3,
+               GP_6_16_FN, FN_IP14_2,
+               GP_6_15_FN, FN_IP14_1_0,
+               GP_6_14_FN, FN_IP13_30_28,
+               GP_6_13_FN, FN_IP13_27,
+               GP_6_12_FN, FN_IP13_26,
+               GP_6_11_FN, FN_IP13_25,
+               GP_6_10_FN, FN_IP13_24_23,
+               GP_6_9_FN, FN_IP13_22,
+               0, 0,
+               GP_6_7_FN, FN_IP13_21_19,
+               GP_6_6_FN, FN_IP13_18_16,
+               GP_6_5_FN, FN_IP13_15,
+               GP_6_4_FN, FN_IP13_14,
+               GP_6_3_FN, FN_IP13_13,
+               GP_6_2_FN, FN_IP13_12,
+               GP_6_1_FN, FN_IP13_11,
+               GP_6_0_FN, FN_IP13_10 }
+       },
+       { PINMUX_CFG_REG("GPSR7", 0xE6060074, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_7_25_FN, FN_USB1_PWEN,
+               GP_7_24_FN, FN_USB0_OVC,
+               GP_7_23_FN, FN_USB0_PWEN,
+               GP_7_22_FN, FN_IP15_14_12,
+               GP_7_21_FN, FN_IP15_11_9,
+               GP_7_20_FN, FN_IP15_8_6,
+               GP_7_19_FN, FN_IP7_2_0,
+               GP_7_18_FN, FN_IP6_29_27,
+               GP_7_17_FN, FN_IP6_26_24,
+               GP_7_16_FN, FN_IP6_23_21,
+               GP_7_15_FN, FN_IP6_20_19,
+               GP_7_14_FN, FN_IP6_18_16,
+               GP_7_13_FN, FN_IP6_15_14,
+               GP_7_12_FN, FN_IP6_13_12,
+               GP_7_11_FN, FN_IP6_11_10,
+               GP_7_10_FN, FN_IP6_9_8,
+               GP_7_9_FN, FN_IP16_11_10,
+               GP_7_8_FN, FN_IP16_9_8,
+               GP_7_7_FN, FN_IP16_7_6,
+               GP_7_6_FN, FN_IP16_5_3,
+               GP_7_5_FN, FN_IP16_2_0,
+               GP_7_4_FN, FN_IP15_29_27,
+               GP_7_3_FN, FN_IP15_26_24,
+               GP_7_2_FN, FN_IP15_23_21,
+               GP_7_1_FN, FN_IP15_20_18,
+               GP_7_0_FN, FN_IP15_17_15 }
+       },
+       /* IPSR0 - IPSR10 */
+       { PINMUX_CFG_REG_VAR("IPSR11", 0xE606004C, 32,
+                            2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
+                            3, 3, 3, 3, 3) {
+               /* IP11_31_30 [2] */
+               FN_ETH_CRS_DV, FN_AVB_LINK, FN_SDA2_C, 0,
+               /* IP11_29_28 [2] */
+               FN_ETH_MDIO, FN_AVB_RX_CLK, FN_SCL2_C, 0,
+               /* IP11_27 [1] */
+               FN_VI1_DATA7, FN_AVB_MDC,
+               /* IP11_26 [1] */
+               FN_VI1_DATA6, FN_AVB_MAGIC,
+               /* IP11_25 [1] */
+               FN_VI1_DATA5, FN_AVB_RX_DV,
+               /* IP11_24 [1] */
+               FN_VI1_DATA4, FN_AVB_MDIO,
+               /* IP11_23 [1] */
+               FN_VI1_DATA3, FN_AVB_RX_ER,
+               /* IP11_22 [1] */
+               FN_VI1_DATA2, FN_AVB_RXD7,
+               /* IP11_21 [1] */
+               FN_VI1_DATA1, FN_AVB_RXD6,
+               /* IP11_20 [1] */
+               FN_VI1_DATA0, FN_AVB_RXD5,
+               /* IP11_19 [1] */
+               FN_VI1_CLK, FN_AVB_RXD4,
+               /* IP11_18_17 [2] */
+               FN_VI1_FIELD, FN_AVB_RXD3, FN_TS_SPSYNC0_B, 0,
+               /* IP11_16_15 [2] */
+               FN_VI1_CLKENB, FN_AVB_RXD2, FN_TS_SDEN0_B, 0,
+               /* IP11_14_12 [3] */
+               FN_VI1_VSYNC_N, FN_AVB_RXD1, FN_TS_SCK0_B,
+               FN_RX4_B, FN_SCIFA4_RXD_B,
+               0, 0, 0,
+               /* IP11_11_9 [3] */
+               FN_VI1_HSYNC_N, FN_AVB_RXD0, FN_TS_SDATA0_B,
+               FN_TX4_B, FN_SCIFA4_TXD_B,
+               0, 0, 0,
+               /* IP11_8_6 [3] */
+               FN_VI0_R7, FN_GLO_RFON_B, FN_RX1_C, FN_CAN0_RX_E,
+               FN_SDA4_B, FN_HRX1_D, FN_SCIFB0_RXD_D, 0,
+               /* IP11_5_3 [3] */
+               FN_VI0_R6, FN_VI2_DATA7, FN_GLO_SS_B, FN_TX1_C, FN_SCL4_B,
+               0, 0, 0,
+               /* IP11_2_0 [3] */
+               FN_VI0_R5, FN_VI2_DATA6, FN_GLO_SDATA_B, FN_RX0_C, FN_SDA1_D,
+               0, 0, 0, }
+       },
+       { PINMUX_CFG_REG_VAR("IPSR12", 0xE6060050, 32,
+                            2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2) {
+               /* IP12_31_30 [2] */
+               0, 0, 0, 0,
+               /* IP12_29_27 [3] */
+               FN_STP_ISCLK_0, FN_AVB_TX_EN, FN_SCIFB2_RXD_D,
+               FN_ADICS_SAMP_B, FN_MSIOF0_SCK_C,
+               0, 0, 0,
+               /* IP12_26_24 [3] */
+               FN_STP_IVCXO27_0, FN_AVB_TXD7, FN_SCIFB2_TXD_D,
+               FN_ADIDATA_B, FN_MSIOF0_SYNC_C,
+               0, 0, 0,
+               /* IP12_23_22 [2] */
+               FN_ETH_MDC, FN_AVB_TXD6, FN_IERX_C, 0,
+               /* IP12_21_20 [2] */
+               FN_ETH_TXD0, FN_AVB_TXD5, FN_IECLK_C, 0,
+               /* IP12_19_18 [2] */
+               FN_ETH_MAGIC, FN_AVB_TXD4, FN_IETX_C, 0,
+               /* IP12_17_16 [2] */
+               FN_ETH_TX_EN, FN_AVB_TXD3, FN_TCLK1_B, FN_CAN_CLK_B,
+               /* IP12_15_13 [3] */
+               FN_ETH_TXD1, FN_AVB_TXD2, FN_SCIFA3_TXD_B,
+               FN_CAN1_TX_C, FN_MSIOF1_TXD_E,
+               0, 0, 0,
+               /* IP12_12_10 [3] */
+               FN_ETH_REFCLK, FN_AVB_TXD1, FN_SCIFA3_RXD_B,
+               FN_CAN1_RX_C, FN_MSIOF1_SYNC_E,
+               0, 0, 0,
+               /* IP12_9_7 [3] */
+               FN_ETH_LINK, FN_AVB_TXD0, FN_CAN0_RX_C,
+               FN_SDA2_D, FN_MSIOF1_SCK_E,
+               0, 0, 0,
+               /* IP12_6_4 [3] */
+               FN_ETH_RXD1, FN_AVB_GTXREFCLK, FN_CAN0_TX_C,
+               FN_SCL2_D, FN_MSIOF1_RXD_E,
+               0, 0, 0,
+               /* IP12_3_2 [2] */
+               FN_ETH_RXD0, FN_AVB_PHY_INT, FN_SDA3, FN_SDA7,
+               /* IP12_1_0 [2] */
+               FN_ETH_RX_ER, FN_AVB_CRS, FN_SCL3, FN_SCL7, }
+       },
+
+       /* IPSR13 - IPSR16 */
+
+       { PINMUX_CFG_REG_VAR("MOD_SEL", 0xE6060090, 32,
+                            1, 2, 2, 2, 3, 2, 1, 1, 1, 1,
+                            3, 2, 2, 2, 1, 2, 2, 2) {
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_SCIF1 [2] */
+               FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
+               /* SEL_SCIFB [2] */
+               FN_SEL_SCIFB_0, FN_SEL_SCIFB_1, FN_SEL_SCIFB_2, FN_SEL_SCIFB_3,
+               /* SEL_SCIFB2 [2] */
+               FN_SEL_SCIFB2_0, FN_SEL_SCIFB2_1,
+               FN_SEL_SCIFB2_2, FN_SEL_SCIFB2_3,
+               /* SEL_SCIFB1 [3] */
+               FN_SEL_SCIFB1_0, FN_SEL_SCIFB1_1,
+               FN_SEL_SCIFB1_2, FN_SEL_SCIFB1_3,
+               0, 0, 0, 0,
+               /* SEL_SCIFA1 [2] */
+               FN_SEL_SCIFA1_0, FN_SEL_SCIFA1_1, FN_SEL_SCIFA1_2, 0,
+               /* SEL_SSI9 [1] */
+               FN_SEL_SSI9_0, FN_SEL_SSI9_1,
+               /* SEL_SCFA [1] */
+               FN_SEL_SCFA_0, FN_SEL_SCFA_1,
+               /* SEL_QSP [1] */
+               FN_SEL_QSP_0, FN_SEL_QSP_1,
+               /* SEL_SSI7 [1] */
+               FN_SEL_SSI7_0, FN_SEL_SSI7_1,
+               /* SEL_HSCIF1 [3] */
+               FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2,
+               FN_SEL_HSCIF1_3, FN_SEL_HSCIF1_4,
+               0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* SEL_VI1 [2] */
+               FN_SEL_VI1_0, FN_SEL_VI1_1, FN_SEL_VI1_2, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* SEL_TMU [1] */
+               FN_SEL_TMU1_0, FN_SEL_TMU1_1,
+               /* SEL_LBS [2] */
+               FN_SEL_LBS_0, FN_SEL_LBS_1, FN_SEL_LBS_2, FN_SEL_LBS_3,
+               /* SEL_TSIF0 [2] */
+               FN_SEL_TSIF0_0, FN_SEL_TSIF0_1, FN_SEL_TSIF0_2, FN_SEL_TSIF0_3,
+               /* SEL_SOF0 [2] */
+               FN_SEL_SOF0_0, FN_SEL_SOF0_1, FN_SEL_SOF0_2, 0, }
+       },
+       { PINMUX_CFG_REG_VAR("MOD_SEL2", 0xE6060094, 32,
+                            3, 1, 1, 3, 2, 1, 1, 2, 2,
+                            1, 3, 2, 1, 2, 2, 2, 1, 1, 1) {
+               /* SEL_SCIF0 [3] */
+               FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2,
+               FN_SEL_SCIF0_3, FN_SEL_SCIF0_4,
+               0, 0, 0,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_SCIF [1] */
+               FN_SEL_SCIF_0, FN_SEL_SCIF_1,
+               /* SEL_CAN0 [3] */
+               FN_SEL_CAN0_0, FN_SEL_CAN0_1, FN_SEL_CAN0_2, FN_SEL_CAN0_3,
+               FN_SEL_CAN0_4, FN_SEL_CAN0_5,
+               0, 0,
+               /* SEL_CAN1 [2] */
+               FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_SCIFA2 [1] */
+               FN_SEL_SCIFA2_0, FN_SEL_SCIFA2_1,
+               /* SEL_SCIF4 [2] */
+               FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* SEL_ADG [1] */
+               FN_SEL_ADG_0, FN_SEL_ADG_1,
+               /* SEL_FM [3] */
+               FN_SEL_FM_0, FN_SEL_FM_1, FN_SEL_FM_2,
+               FN_SEL_FM_3, FN_SEL_FM_4,
+               0, 0, 0,
+               /* SEL_SCIFA5 [2] */
+               FN_SEL_SCIFA5_0, FN_SEL_SCIFA5_1, FN_SEL_SCIFA5_2, 0,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_GPS [2] */
+               FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3,
+               /* SEL_SCIFA4 [2] */
+               FN_SEL_SCIFA4_0, FN_SEL_SCIFA4_1, FN_SEL_SCIFA4_2, 0,
+               /* SEL_SCIFA3 [2] */
+               FN_SEL_SCIFA3_0, FN_SEL_SCIFA3_1, FN_SEL_SCIFA3_2, 0,
+               /* SEL_SIM [1] */
+               FN_SEL_SIM_0, FN_SEL_SIM_1,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_SSI8 [1] */
+               FN_SEL_SSI8_0, FN_SEL_SSI8_1, }
+       },
+       { PINMUX_CFG_REG_VAR("MOD_SEL3", 0xE6060098, 32,
+                            2, 2, 2, 2, 2, 2, 2, 2,
+                            1, 1, 2, 2, 3, 2, 2, 2, 1) {
+               /* SEL_HSCIF2 [2] */
+               FN_SEL_HSCIF2_0, FN_SEL_HSCIF2_1,
+               FN_SEL_HSCIF2_2, FN_SEL_HSCIF2_3,
+               /* SEL_CANCLK [2] */
+               FN_SEL_CANCLK_0, FN_SEL_CANCLK_1,
+               FN_SEL_CANCLK_2, FN_SEL_CANCLK_3,
+               /* SEL_IIC8 [2] */
+               FN_SEL_IIC8_0, FN_SEL_IIC8_1, FN_SEL_IIC8_2, 0,
+               /* SEL_IIC7 [2] */
+               FN_SEL_IIC7_0, FN_SEL_IIC7_1, FN_SEL_IIC7_2, 0,
+               /* SEL_IIC4 [2] */
+               FN_SEL_IIC4_0, FN_SEL_IIC4_1, FN_SEL_IIC4_2, 0,
+               /* SEL_IIC3 [2] */
+               FN_SEL_IIC3_0, FN_SEL_IIC3_1, FN_SEL_IIC3_2, FN_SEL_IIC3_3,
+               /* SEL_SCIF3 [2] */
+               FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
+               /* SEL_IEB [2] */
+               FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2,
+               /* SEL_MMC [1] */
+               FN_SEL_MMC_0, FN_SEL_MMC_1,
+               /* SEL_SCIF5 [1] */
+               FN_SEL_SCIF5_0, FN_SEL_SCIF5_1,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* SEL_IIC2 [2] */
+               FN_SEL_IIC2_0, FN_SEL_IIC2_1, FN_SEL_IIC2_2, FN_SEL_IIC2_3,
+               /* SEL_IIC1 [3] */
+               FN_SEL_IIC1_0, FN_SEL_IIC1_1, FN_SEL_IIC1_2, FN_SEL_IIC1_3,
+               FN_SEL_IIC1_4,
+               0, 0, 0,
+               /* SEL_IIC0 [2] */
+               FN_SEL_IIC0_0, FN_SEL_IIC0_1, FN_SEL_IIC0_2, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* RESEVED [1] */
+               0, 0, }
+       },
+       { PINMUX_CFG_REG_VAR("MOD_SEL4", 0xE606009C, 32,
+                            3, 2, 2, 1, 1, 1, 1, 3, 2,
+                            2, 3, 1, 1, 1, 2, 2, 2, 2) {
+               /* SEL_SOF1 [3] */
+               FN_SEL_SOF1_0, FN_SEL_SOF1_1, FN_SEL_SOF1_2, FN_SEL_SOF1_3,
+               FN_SEL_SOF1_4,
+               0, 0, 0,
+               /* SEL_HSCIF0 [2] */
+               FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1, FN_SEL_HSCIF0_2, 0,
+               /* SEL_DIS [2] */
+               FN_SEL_DIS_0, FN_SEL_DIS_1, FN_SEL_DIS_2, 0,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_RAD [1] */
+               FN_SEL_RAD_0, FN_SEL_RAD_1,
+               /* SEL_RCN [1] */
+               FN_SEL_RCN_0, FN_SEL_RCN_1,
+               /* SEL_RSP [1] */
+               FN_SEL_RSP_0, FN_SEL_RSP_1,
+               /* SEL_SCIF2 [3] */
+               FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2,
+               FN_SEL_SCIF2_3, FN_SEL_SCIF2_4,
+               0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* SEL_SOF2 [3] */
+               FN_SEL_SOF2_0, FN_SEL_SOF2_1, FN_SEL_SOF2_2,
+               FN_SEL_SOF2_3, FN_SEL_SOF2_4,
+               0, 0, 0,
+               /* RESEVED [1] */
+               0, 0,
+               /* SEL_SSI1 [1] */
+               FN_SEL_SSI1_0, FN_SEL_SSI1_1,
+               /* SEL_SSI0 [1] */
+               FN_SEL_SSI0_0, FN_SEL_SSI0_1,
+               /* SEL_SSP [2] */
+               FN_SEL_SSP_0, FN_SEL_SSP_1, FN_SEL_SSP_2, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0,
+               /* RESEVED [2] */
+               0, 0, 0, 0, }
+       },
+       { PINMUX_CFG_REG("INOUTSEL0", 0xE6050004, 32, 1) { GP_INOUTSEL(0) } },
+       { PINMUX_CFG_REG("INOUTSEL1", 0xE6051004, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_1_25_IN, GP_1_25_OUT,
+               GP_1_24_IN, GP_1_24_OUT,
+               GP_1_23_IN, GP_1_23_OUT,
+               GP_1_22_IN, GP_1_22_OUT,
+               GP_1_21_IN, GP_1_21_OUT,
+               GP_1_20_IN, GP_1_20_OUT,
+               GP_1_19_IN, GP_1_19_OUT,
+               GP_1_18_IN, GP_1_18_OUT,
+               GP_1_17_IN, GP_1_17_OUT,
+               GP_1_16_IN, GP_1_16_OUT,
+               GP_1_15_IN, GP_1_15_OUT,
+               GP_1_14_IN, GP_1_14_OUT,
+               GP_1_13_IN, GP_1_13_OUT,
+               GP_1_12_IN, GP_1_12_OUT,
+               GP_1_11_IN, GP_1_11_OUT,
+               GP_1_10_IN, GP_1_10_OUT,
+               GP_1_9_IN, GP_1_9_OUT,
+               GP_1_8_IN, GP_1_8_OUT,
+               GP_1_7_IN, GP_1_7_OUT,
+               GP_1_6_IN, GP_1_6_OUT,
+               GP_1_5_IN, GP_1_5_OUT,
+               GP_1_4_IN, GP_1_4_OUT,
+               GP_1_3_IN, GP_1_3_OUT,
+               GP_1_2_IN, GP_1_2_OUT,
+               GP_1_1_IN, GP_1_1_OUT,
+               GP_1_0_IN, GP_1_0_OUT, }
+       },
+       { PINMUX_CFG_REG("INOUTSEL2", 0xE6052004, 32, 1) { GP_INOUTSEL(2) } },
+       { PINMUX_CFG_REG("INOUTSEL3", 0xE6053004, 32, 1) { GP_INOUTSEL(3) } },
+       { PINMUX_CFG_REG("INOUTSEL4", 0xE6054004, 32, 1) { GP_INOUTSEL(4) } },
+       { PINMUX_CFG_REG("INOUTSEL5", 0xE6055004, 32, 1) { GP_INOUTSEL(5) } },
+       { PINMUX_CFG_REG("INOUTSEL6", 0xE6055404, 32, 1) { GP_INOUTSEL(6) } },
+       { PINMUX_CFG_REG("INOUTSEL7", 0xE6055804, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_7_25_IN, GP_7_25_OUT,
+               GP_7_24_IN, GP_7_24_OUT,
+               GP_7_23_IN, GP_7_23_OUT,
+               GP_7_22_IN, GP_7_22_OUT,
+               GP_7_21_IN, GP_7_21_OUT,
+               GP_7_20_IN, GP_7_20_OUT,
+               GP_7_19_IN, GP_7_19_OUT,
+               GP_7_18_IN, GP_7_18_OUT,
+               GP_7_17_IN, GP_7_17_OUT,
+               GP_7_16_IN, GP_7_16_OUT,
+               GP_7_15_IN, GP_7_15_OUT,
+               GP_7_14_IN, GP_7_14_OUT,
+               GP_7_13_IN, GP_7_13_OUT,
+               GP_7_12_IN, GP_7_12_OUT,
+               GP_7_11_IN, GP_7_11_OUT,
+               GP_7_10_IN, GP_7_10_OUT,
+               GP_7_9_IN, GP_7_9_OUT,
+               GP_7_8_IN, GP_7_8_OUT,
+               GP_7_7_IN, GP_7_7_OUT,
+               GP_7_6_IN, GP_7_6_OUT,
+               GP_7_5_IN, GP_7_5_OUT,
+               GP_7_4_IN, GP_7_4_OUT,
+               GP_7_3_IN, GP_7_3_OUT,
+               GP_7_2_IN, GP_7_2_OUT,
+               GP_7_1_IN, GP_7_1_OUT,
+               GP_7_0_IN, GP_7_0_OUT, }
+       },
+       { },
+};
+
+static struct pinmux_data_reg pinmux_data_regs[] = {
+       { PINMUX_DATA_REG("INDT0", 0xE6050008, 32) { GP_INDT(0) } },
+       { PINMUX_DATA_REG("INDT1", 0xE6051008, 32) {
+               0, 0, 0, 0,
+               0, 0, GP_1_25_DATA, GP_1_24_DATA,
+               GP_1_23_DATA, GP_1_22_DATA, GP_1_21_DATA, GP_1_20_DATA,
+               GP_1_19_DATA, GP_1_18_DATA, GP_1_17_DATA, GP_1_16_DATA,
+               GP_1_15_DATA, GP_1_14_DATA, GP_1_13_DATA, GP_1_12_DATA,
+               GP_1_11_DATA, GP_1_10_DATA, GP_1_9_DATA, GP_1_8_DATA,
+               GP_1_7_DATA, GP_1_6_DATA, GP_1_5_DATA, GP_1_4_DATA,
+               GP_1_3_DATA, GP_1_2_DATA, GP_1_1_DATA, GP_1_0_DATA }
+       },
+       { PINMUX_DATA_REG("INDT2", 0xE6052008, 32) { GP_INDT(2) } },
+       { PINMUX_DATA_REG("INDT3", 0xE6053008, 32) { GP_INDT(3) } },
+       { PINMUX_DATA_REG("INDT4", 0xE6054008, 32) { GP_INDT(4) } },
+       { PINMUX_DATA_REG("INDT5", 0xE6055008, 32) { GP_INDT(5) } },
+       { PINMUX_DATA_REG("INDT6", 0xE6055408, 32) { GP_INDT(6) } },
+       { PINMUX_DATA_REG("INDT7", 0xE6055808, 32) {
+               0, 0, 0, 0,
+               0, 0, GP_7_25_DATA, GP_7_24_DATA,
+               GP_7_23_DATA, GP_7_22_DATA, GP_7_21_DATA, GP_7_20_DATA,
+               GP_7_19_DATA, GP_7_18_DATA, GP_7_17_DATA, GP_7_16_DATA,
+               GP_7_15_DATA, GP_7_14_DATA, GP_7_13_DATA, GP_7_12_DATA,
+               GP_7_11_DATA, GP_7_10_DATA, GP_7_9_DATA, GP_7_8_DATA,
+               GP_7_7_DATA, GP_7_6_DATA, GP_7_5_DATA, GP_7_4_DATA,
+               GP_7_3_DATA, GP_7_2_DATA, GP_7_1_DATA, GP_7_0_DATA }
+       },
+       { },
+};
+
+static struct pinmux_info r8a7791_pinmux_info = {
+       .name = "r8a7791_pfc",
+
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .reserved_id = PINMUX_RESERVED,
+       .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
+       .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
+       .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
+       .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .first_gpio = GPIO_GP_0_0,
+       .last_gpio = GPIO_FN_MSIOF0_SCK_C /* GPIO_FN_CAN1_RX_B */,
+
+       .gpios = pinmux_gpios,
+       .cfg_regs = pinmux_config_regs,
+       .data_regs = pinmux_data_regs,
+
+       .gpio_data = pinmux_data,
+       .gpio_data_size = ARRAY_SIZE(pinmux_data),
+};
+
+void r8a7791_pinmux_init(void)
+{
+       register_pinmux(&r8a7791_pinmux_info);
+}
index 72e0c12..04700e7 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <div64.h>
 #include <asm/io.h>
 #include <asm/arch-armv7/globaltimer.h>
 #include <asm/arch/rmobile.h>
@@ -38,13 +39,16 @@ static u64 get_time_us(void)
        u64 timer = get_cpu_global_timer();
 
        timer = ((timer << 2) + (CLK2MHZ(CONFIG_SYS_CPU_CLK) >> 1));
-       timer /= (u64)CLK2MHZ(CONFIG_SYS_CPU_CLK);
+       do_div(timer, CLK2MHZ(CONFIG_SYS_CPU_CLK));
        return timer;
 }
 
 static ulong get_time_ms(void)
 {
-       return (ulong)(get_time_us() / 1000);
+       u64 us = get_time_us();
+
+       do_div(us, 1000);
+       return us;
 }
 
 int timer_init(void)
index dac2bbd..3e84a0c 100644 (file)
@@ -9,4 +9,4 @@
 
 obj-y  := lowlevel_init.o
 obj-y  += misc.o timer.o reset_manager.o system_manager.o
-obj-$(CONFIG_SPL_BUILD) += spl.o
+obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
diff --git a/arch/arm/cpu/armv7/socfpga/freeze_controller.c b/arch/arm/cpu/armv7/socfpga/freeze_controller.c
new file mode 100644 (file)
index 0000000..b8c9bce
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ *  Copyright (C) 2013 Altera Corporation <www.altera.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/freeze_controller.h>
+#include <asm/arch/timer.h>
+#include <asm/errno.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct socfpga_freeze_controller *freeze_controller_base =
+               (void *)(SOCFPGA_SYSMGR_ADDRESS + SYSMGR_FRZCTRL_ADDRESS);
+
+/*
+ * Default state from cold reset is FREEZE_ALL; the global
+ * flag is set to TRUE to indicate the IO banks are frozen
+ */
+static uint32_t frzctrl_channel_freeze[FREEZE_CHANNEL_NUM]
+       = { FREEZE_CTRL_FROZEN, FREEZE_CTRL_FROZEN,
+       FREEZE_CTRL_FROZEN, FREEZE_CTRL_FROZEN};
+
+/* Freeze HPS IOs */
+void sys_mgr_frzctrl_freeze_req(void)
+{
+       u32 ioctrl_reg_offset;
+       u32 reg_value;
+       u32 reg_cfg_mask;
+       u32 channel_id;
+
+       /* select software FSM */
+       writel(SYSMGR_FRZCTRL_SRC_VIO1_ENUM_SW, &freeze_controller_base->src);
+
+       /* Freeze channel 0 to 2 */
+       for (channel_id = 0; channel_id <= 2; channel_id++) {
+               ioctrl_reg_offset = (u32)(
+                       &freeze_controller_base->vioctrl +
+                       (channel_id << SYSMGR_FRZCTRL_VIOCTRL_SHIFT));
+
+               /*
+                * Assert active low enrnsl, plniotri
+                * and niotri signals
+                */
+               reg_cfg_mask =
+                       SYSMGR_FRZCTRL_VIOCTRL_SLEW_MASK
+                       | SYSMGR_FRZCTRL_VIOCTRL_WKPULLUP_MASK
+                       | SYSMGR_FRZCTRL_VIOCTRL_TRISTATE_MASK;
+               clrbits_le32(ioctrl_reg_offset, reg_cfg_mask);
+
+               /*
+                * Note: Delay for 20ns at min
+                * Assert active low bhniotri signal and de-assert
+                * active high csrdone
+                */
+               reg_cfg_mask
+                       = SYSMGR_FRZCTRL_VIOCTRL_BUSHOLD_MASK
+                       | SYSMGR_FRZCTRL_VIOCTRL_CFG_MASK;
+               clrbits_le32(ioctrl_reg_offset, reg_cfg_mask);
+
+               /* Set global flag to indicate channel is frozen */
+               frzctrl_channel_freeze[channel_id] = FREEZE_CTRL_FROZEN;
+       }
+
+       /* Freeze channel 3 */
+       /*
+        * Assert active low enrnsl, plniotri and
+        * niotri signals
+        */
+       reg_cfg_mask
+               = SYSMGR_FRZCTRL_HIOCTRL_SLEW_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_WKPULLUP_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_TRISTATE_MASK;
+       clrbits_le32(&freeze_controller_base->hioctrl, reg_cfg_mask);
+
+       /*
+        * assert active low bhniotri & nfrzdrv signals,
+        * de-assert active high csrdone and assert
+        * active high frzreg and nfrzdrv signals
+        */
+       reg_value = readl(&freeze_controller_base->hioctrl);
+       reg_cfg_mask
+               = SYSMGR_FRZCTRL_HIOCTRL_BUSHOLD_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_CFG_MASK;
+       reg_value
+               = (reg_value & ~reg_cfg_mask)
+               | SYSMGR_FRZCTRL_HIOCTRL_REGRST_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_OCTRST_MASK;
+       writel(reg_value, &freeze_controller_base->hioctrl);
+
+       /*
+        * assert active high reinit signal and de-assert
+        * active high pllbiasen signals
+        */
+       reg_value = readl(&freeze_controller_base->hioctrl);
+       reg_value
+               = (reg_value &
+               ~SYSMGR_FRZCTRL_HIOCTRL_OCT_CFGEN_CALSTART_MASK)
+               | SYSMGR_FRZCTRL_HIOCTRL_DLLRST_MASK;
+       writel(reg_value, &freeze_controller_base->hioctrl);
+
+       /* Set global flag to indicate channel is frozen */
+       frzctrl_channel_freeze[channel_id] = FREEZE_CTRL_FROZEN;
+}
+
+/* Unfreeze/Thaw HPS IOs */
+void sys_mgr_frzctrl_thaw_req(void)
+{
+       u32 ioctrl_reg_offset;
+       u32 reg_cfg_mask;
+       u32 reg_value;
+       u32 channel_id;
+
+       /* select software FSM */
+       writel(SYSMGR_FRZCTRL_SRC_VIO1_ENUM_SW, &freeze_controller_base->src);
+
+       /* Thaw channel 0 to 2 */
+       for (channel_id = 0; channel_id <= 2; channel_id++) {
+               ioctrl_reg_offset
+                       = (u32)(&freeze_controller_base->vioctrl
+                               + (channel_id << SYSMGR_FRZCTRL_VIOCTRL_SHIFT));
+
+               /*
+                * Assert active low bhniotri signal and
+                * de-assert active high csrdone
+                */
+               reg_cfg_mask
+                       = SYSMGR_FRZCTRL_VIOCTRL_BUSHOLD_MASK
+                       | SYSMGR_FRZCTRL_VIOCTRL_CFG_MASK;
+               setbits_le32(ioctrl_reg_offset, reg_cfg_mask);
+
+               /*
+                * Note: Delay for 20ns at min
+                * de-assert active low plniotri and niotri signals
+                */
+               reg_cfg_mask
+                       = SYSMGR_FRZCTRL_VIOCTRL_WKPULLUP_MASK
+                       | SYSMGR_FRZCTRL_VIOCTRL_TRISTATE_MASK;
+               setbits_le32(ioctrl_reg_offset, reg_cfg_mask);
+
+               /*
+                * Note: Delay for 20ns at min
+                * de-assert active low enrnsl signal
+                */
+               setbits_le32(ioctrl_reg_offset,
+                       SYSMGR_FRZCTRL_VIOCTRL_SLEW_MASK);
+
+               /* Set global flag to indicate channel is thawed */
+               frzctrl_channel_freeze[channel_id] = FREEZE_CTRL_THAWED;
+       }
+
+       /* Thaw channel 3 */
+       /* de-assert active high reinit signal */
+       clrbits_le32(&freeze_controller_base->hioctrl,
+               SYSMGR_FRZCTRL_HIOCTRL_DLLRST_MASK);
+
+       /*
+        * Note: Delay for 40ns at min
+        * assert active high pllbiasen signals
+        */
+       setbits_le32(&freeze_controller_base->hioctrl,
+               SYSMGR_FRZCTRL_HIOCTRL_OCT_CFGEN_CALSTART_MASK);
+
+       /*
+        * Delay 1000 intosc. intosc is based on eosc1
+        * Use worst case which is fatest eosc1=50MHz, delay required
+        * is 1/50MHz * 1000 = 20us
+        */
+       udelay(20);
+
+       /*
+        * de-assert active low bhniotri signals,
+        * assert active high csrdone and nfrzdrv signal
+        */
+       reg_value = readl(&freeze_controller_base->hioctrl);
+       reg_value = (reg_value
+               | SYSMGR_FRZCTRL_HIOCTRL_BUSHOLD_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_CFG_MASK)
+               & ~SYSMGR_FRZCTRL_HIOCTRL_OCTRST_MASK;
+       writel(reg_value, &freeze_controller_base->hioctrl);
+
+       /*
+        * Delay 33 intosc
+        * Use worst case which is fatest eosc1=50MHz, delay required
+        * is 1/50MHz * 33 = 660ns ~= 1us
+        */
+       udelay(1);
+
+       /* de-assert active low plniotri and niotri signals */
+       reg_cfg_mask
+               = SYSMGR_FRZCTRL_HIOCTRL_WKPULLUP_MASK
+               | SYSMGR_FRZCTRL_HIOCTRL_TRISTATE_MASK;
+
+       setbits_le32(&freeze_controller_base->hioctrl, reg_cfg_mask);
+
+       /*
+        * Note: Delay for 40ns at min
+        * de-assert active high frzreg signal
+        */
+       clrbits_le32(&freeze_controller_base->hioctrl,
+               SYSMGR_FRZCTRL_HIOCTRL_REGRST_MASK);
+
+       /*
+        * Note: Delay for 40ns at min
+        * de-assert active low enrnsl signal
+        */
+       setbits_le32(&freeze_controller_base->hioctrl,
+               SYSMGR_FRZCTRL_HIOCTRL_SLEW_MASK);
+
+       /* Set global flag to indicate channel is thawed */
+       frzctrl_channel_freeze[channel_id] = FREEZE_CTRL_THAWED;
+}
index 74bceab..36a00c3 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/arch/reset_manager.h>
 #include <spl.h>
 #include <asm/arch/system_manager.h>
+#include <asm/arch/freeze_controller.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -27,6 +28,10 @@ u32 spl_boot_device(void)
 void spl_board_init(void)
 {
 #ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET
+       debug("Freezing all I/O banks\n");
+       /* freeze all IO banks */
+       sys_mgr_frzctrl_freeze_req();
+
        /* configure the pin muxing through system manager */
        sysmgr_pinmux_init();
 #endif /* CONFIG_SOCFPGA_VIRTUAL_TARGET */
@@ -34,6 +39,10 @@ void spl_board_init(void)
        /* de-assert reset for peripherals and bridges based on handoff */
        reset_deassert_peripherals_handoff();
 
+       debug("Unfreezing/Thaw all I/O banks\n");
+       /* unfreeze / thaw all IO banks */
+       sys_mgr_frzctrl_thaw_req();
+
        /* enable console uart printing */
        preloader_console_init();
 }
index 2bb3843..9af340e 100644 (file)
@@ -16,23 +16,24 @@ void lowlevel_init(void)
 int arch_cpu_init(void)
 {
        zynq_slcr_unlock();
-       /* remap DDR to zero, FILTERSTART */
-       writel(0, &scu_base->filter_start);
 
        /* Device config APB, unlock the PCAP */
        writel(0x757BDF0D, &devcfg_base->unlock);
        writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
 
+#if (CONFIG_SYS_SDRAM_BASE == 0)
+       /* remap DDR to zero, FILTERSTART */
+       writel(0, &scu_base->filter_start);
+
        /* OCM_CFG, Mask out the ROM, map ram into upper addresses */
        writel(0x1F, &slcr_base->ocm_cfg);
        /* FPGA_RST_CTRL, clear resets on AXI fabric ports */
        writel(0x0, &slcr_base->fpga_rst_ctrl);
-       /* TZ_DDR_RAM, Set DDR trust zone non-secure */
-       writel(0xFFFFFFFF, &slcr_base->trust_zone);
        /* Set urgent bits with register */
        writel(0x0, &slcr_base->ddr_urgent_sel);
        /* Urgent write, ports S2/S3 */
        writel(0xC, &slcr_base->ddr_urgent);
+#endif
 
        zynq_slcr_lock();
 
index 636322a..2be253c 100644 (file)
@@ -107,8 +107,7 @@ void __udelay(unsigned long usec)
        if (usec == 0)
                return;
 
-       countticks = (u32) (((unsigned long long) TIMER_TICK_HZ * usec) /
-                                                               1000000);
+       countticks = lldiv(TIMER_TICK_HZ * usec, 1000000);
 
        /* decrementing timer */
        timeend = readl(&timer_base->counter) - countticks;
diff --git a/arch/arm/cpu/at91-common/Makefile b/arch/arm/cpu/at91-common/Makefile
new file mode 100644 (file)
index 0000000..5b97838
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2000-2008
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# (C) Copyright 2013 Atmel Corporation
+#                   Bo Shen <voice.shen@atmel.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-$(CONFIG_AT91_WANTS_COMMON_PHY) += phy.o
+obj-$(CONFIG_SPL_BUILD) += mpddrc.o spl.o
diff --git a/arch/arm/cpu/at91-common/mpddrc.c b/arch/arm/cpu/at91-common/mpddrc.c
new file mode 100644 (file)
index 0000000..8136396
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2013 Atmel Corporation
+ *                   Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/atmel_mpddrc.h>
+
+static inline void atmel_mpddr_op(int mode, u32 ram_address)
+{
+       struct atmel_mpddr *mpddr = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC;
+
+       writel(mode, &mpddr->mr);
+       writel(0, ram_address);
+}
+
+int ddr2_init(const unsigned int ram_address,
+             const struct atmel_mpddr *mpddr_value)
+{
+       struct atmel_mpddr *mpddr = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC;
+       u32 ba_off, cr;
+
+       /* Compute bank offset according to NC in configuration register */
+       ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
+       if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
+               ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
+
+       ba_off += (mpddr_value->md & ATMEL_MPDDRC_MD_DBW_MASK) ? 1 : 2;
+
+       /* Program the memory device type into the memory device register */
+       writel(mpddr_value->md, &mpddr->md);
+
+       /* Program the configuration register */
+       writel(mpddr_value->cr, &mpddr->cr);
+
+       /* Program the timing register */
+       writel(mpddr_value->tpr0, &mpddr->tpr0);
+       writel(mpddr_value->tpr1, &mpddr->tpr1);
+       writel(mpddr_value->tpr2, &mpddr->tpr2);
+
+       /* Issue a NOP command */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_NOP_CMD, ram_address);
+
+       /* A 200 us is provided to precede any signal toggle */
+       udelay(200);
+
+       /* Issue a NOP command */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_NOP_CMD, ram_address);
+
+       /* Issue an all banks precharge command */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_PRCGALL_CMD, ram_address);
+
+       /* Issue an extended mode register set(EMRS2) to choose operation */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD,
+                      ram_address + (0x2 << ba_off));
+
+       /* Issue an extended mode register set(EMRS3) to set EMSR to 0 */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD,
+                      ram_address + (0x3 << ba_off));
+
+       /*
+        * Issue an extended mode register set(EMRS1) to enable DLL and
+        * program D.I.C (output driver impedance control)
+        */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD,
+                      ram_address + (0x1 << ba_off));
+
+       /* Enable DLL reset */
+       cr = readl(&mpddr->cr);
+       writel(cr | ATMEL_MPDDRC_CR_DLL_RESET_ENABLED, &mpddr->cr);
+
+       /* A mode register set(MRS) cycle is issued to reset DLL */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_LMR_CMD, ram_address);
+
+       /* Issue an all banks precharge command */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_PRCGALL_CMD, ram_address);
+
+       /* Two auto-refresh (CBR) cycles are provided */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_RFSH_CMD, ram_address);
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_RFSH_CMD, ram_address);
+
+       /* Disable DLL reset */
+       cr = readl(&mpddr->cr);
+       writel(cr & (~ATMEL_MPDDRC_CR_DLL_RESET_ENABLED), &mpddr->cr);
+
+       /* A mode register set (MRS) cycle is issued to disable DLL reset */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_LMR_CMD, ram_address);
+
+       /* Set OCD calibration in default state */
+       cr = readl(&mpddr->cr);
+       writel(cr | ATMEL_MPDDRC_CR_OCD_DEFAULT, &mpddr->cr);
+
+       /*
+        * An extended mode register set (EMRS1) cycle is issued
+        * to OCD default value
+        */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD,
+                      ram_address + (0x1 << ba_off));
+
+        /* OCD calibration mode exit */
+       cr = readl(&mpddr->cr);
+       writel(cr & (~ATMEL_MPDDRC_CR_OCD_DEFAULT), &mpddr->cr);
+
+       /*
+        * An extended mode register set (EMRS1) cycle is issued
+        * to enable OCD exit
+        */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD,
+                      ram_address + (0x1 << ba_off));
+
+       /* A nornal mode command is provided */
+       atmel_mpddr_op(ATMEL_MPDDRC_MR_MODE_NORMAL_CMD, ram_address);
+
+       /* Perform a write access to any DDR2-SDRAM address */
+       writel(0, ram_address);
+
+       /* Write the refresh rate */
+       writel(mpddr_value->rtr, &mpddr->rtr);
+
+       return 0;
+}
diff --git a/arch/arm/cpu/at91-common/phy.c b/arch/arm/cpu/at91-common/phy.c
new file mode 100644 (file)
index 0000000..3b6c60c
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * (C) Copyright 2012
+ * Markus Hubig <mhubig@imko.de>
+ * IMKO GmbH <www.imko.de>
+ *
+ * Copyright (C) 2013 DENX Software Engineering, hs@denx.de
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/sizes.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <watchdog.h>
+
+void at91_phy_reset(void)
+{
+       unsigned long erstl;
+       unsigned long start = get_timer(0);
+       unsigned long const timeout = 1000; /* 1000ms */
+       at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
+
+       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
+
+       /*
+        * Need to reset PHY -> 500ms reset
+        * Reset PHY by pulling the NRST line for 500ms to low. To do so
+        * disable user reset for low level on NRST pin and poll the NRST
+        * level in reset status register.
+        */
+       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
+               AT91_RSTC_MR_URSTEN, &rstc->mr);
+
+       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
+
+       /* Wait for end of hardware reset */
+       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL)) {
+               /* avoid shutdown by watchdog */
+               WATCHDOG_RESET();
+               mdelay(10);
+
+               /* timeout for not getting stuck in an endless loop */
+               if (get_timer(start) >= timeout) {
+                       puts("*** ERROR: Timeout waiting for PHY reset!\n");
+                       break;
+               }
+       };
+
+       /* Restore NRST value */
+       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+}
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
new file mode 100644 (file)
index 0000000..37c0cc4
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2013 Atmel Corporation
+ *                   Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_wdt.h>
+#include <asm/arch/clk.h>
+#include <spl.h>
+
+static void at91_disable_wdt(void)
+{
+       struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
+
+       writel(AT91_WDT_MR_WDDIS, &wdt->mr);
+}
+
+void at91_plla_init(u32 pllar)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       writel(pllar, &pmc->pllar);
+       while (!(readl(&pmc->sr) & (AT91_PMC_LOCKA | AT91_PMC_MCKRDY)))
+               ;
+}
+
+void at91_mck_init(u32 mckr)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       u32 tmp;
+
+       tmp = readl(&pmc->mckr);
+       tmp &= ~(AT91_PMC_MCKR_PRES_MASK |
+                AT91_PMC_MCKR_MDIV_MASK |
+                AT91_PMC_MCKR_PLLADIV_2);
+       tmp |= mckr & (AT91_PMC_MCKR_PRES_MASK |
+                      AT91_PMC_MCKR_MDIV_MASK |
+                      AT91_PMC_MCKR_PLLADIV_2);
+       writel(tmp, &pmc->mckr);
+
+       while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY))
+               ;
+}
+
+
+u32 spl_boot_device(void)
+{
+#ifdef CONFIG_SYS_USE_MMC
+       return BOOT_DEVICE_MMC1;
+#endif
+       return BOOT_DEVICE_NONE;
+}
+
+u32 spl_boot_mode(void)
+{
+       switch (spl_boot_device()) {
+#ifdef CONFIG_SYS_USE_MMC
+       case BOOT_DEVICE_MMC1:
+               return MMCSD_MODE_FAT;
+               break;
+#endif
+       case BOOT_DEVICE_NONE:
+       default:
+               hang();
+       }
+}
+
+void s_init(void)
+{
+       /* disable watchdog */
+       at91_disable_wdt();
+
+       /* PMC configuration */
+       at91_pmc_init();
+
+       at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK);
+
+       timer_init();
+
+       board_early_init_f();
+
+       preloader_console_init();
+
+       mem_init();
+}
diff --git a/arch/arm/cpu/at91-common/u-boot-spl.lds b/arch/arm/cpu/at91-common/u-boot-spl.lds
new file mode 100644 (file)
index 0000000..038335d
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *     Aneesh V <aneesh@ti.com>
+ *
+ * (C) 2013 Atmel Corporation
+ *         Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
+               LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
+               LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       .text      :
+       {
+               __start = .;
+               arch/arm/cpu/armv7/start.o      (.text*)
+               *(.text*)
+       } >.sram
+
+       . = ALIGN(4);
+       .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+       . = ALIGN(4);
+       .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+
+       . = ALIGN(4);
+       __image_copy_end = .;
+       _end = .;
+
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.bss*)
+               . = ALIGN(4);
+               __bss_end = .;
+       } >.sdram
+}
index c8d2e12..676ae2c 100644 (file)
@@ -79,10 +79,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 78d9f32..c4717de 100644 (file)
@@ -28,12 +28,12 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned long long tick_to_time(unsigned long long tick)
 {
-       return tick * CONFIG_SYS_HZ / TIMER_FREQ_HZ;
+       return lldiv(tick * CONFIG_SYS_HZ, TIMER_FREQ_HZ);
 }
 
 static unsigned long long us_to_tick(unsigned long long us)
 {
-       return (us * TIMER_FREQ_HZ) / 1000000;
+       return lldiv(us * TIMER_FREQ_HZ, 1000000);
 }
 
 int timer_init(void)
index 36cc54a..4880d0f 100644 (file)
@@ -51,12 +51,15 @@ SECTIONS
                __bss_end = .;
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
 
 #if defined(CONFIG_SPL_MAX_SIZE)
index 23bf030..9463a33 100644 (file)
@@ -91,12 +91,14 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
-       /DISCARD/ : { *(.ARM.exidx*) }
-       /DISCARD/ : { *(.gnu.linkonce.armexidx.*) }
+       .dynsym _end : { *(.dynsym) }
+       .hash : { *(.hash) }
+       .got.plt : { *(.got.plt) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index fe48b5f..2278358 100644 (file)
@@ -18,7 +18,6 @@
 #define VTP_CTRL_READY         (0x1 << 5)
 #define VTP_CTRL_ENABLE                (0x1 << 6)
 #define VTP_CTRL_START_EN      (0x1)
-#define PHY_DLL_LOCK_DIFF      0x0
 #define DDR_CKE_CTRL_NORMAL    0x1
 #define PHY_EN_DYN_PWRDN       (0x1 << 20)
 
@@ -29,7 +28,6 @@
 #define MT47H128M16RT25E_EMIF_TIM3             0x0000033F
 #define MT47H128M16RT25E_EMIF_SDCFG            0x41805332
 #define MT47H128M16RT25E_EMIF_SDREF            0x0000081a
-#define MT47H128M16RT25E_DLL_LOCK_DIFF         0x0
 #define MT47H128M16RT25E_RATIO                 0x80
 #define MT47H128M16RT25E_INVERT_CLKOUT         0x00
 #define MT47H128M16RT25E_RD_DQS                        0x12
@@ -38,7 +36,6 @@
 #define MT47H128M16RT25E_PHY_GATELVL           0x00
 #define MT47H128M16RT25E_PHY_WR_DATA           0x40
 #define MT47H128M16RT25E_PHY_FIFO_WE           0x80
-#define MT47H128M16RT25E_PHY_RANK0_DELAY               0x1
 #define MT47H128M16RT25E_IOCTRL_VALUE          0x18B
 
 /* Micron MT41J128M16JT-125 */
@@ -49,7 +46,6 @@
 #define MT41J128MJT125_EMIF_SDCFG              0x61C04AB2
 #define MT41J128MJT125_EMIF_SDREF              0x0000093B
 #define MT41J128MJT125_ZQ_CFG                  0x50074BE4
-#define MT41J128MJT125_DLL_LOCK_DIFF           0x1
 #define MT41J128MJT125_RATIO                   0x40
 #define MT41J128MJT125_INVERT_CLKOUT           0x1
 #define MT41J128MJT125_RD_DQS                  0x3B
 #define MT41J128MJT125_PHY_FIFO_WE             0x100
 #define MT41J128MJT125_IOCTRL_VALUE            0x18B
 
+/* Micron MT41J64M16JT-125 */
+#define MT41J64MJT125_EMIF_SDCFG               0x61C04A32
+
+/* Micron MT41J256M16JT-125 */
+#define MT41J256MJT125_EMIF_SDCFG              0x61C04B32
+
 /* Micron MT41J256M8HX-15E */
 #define MT41J256M8HX15E_EMIF_READ_LATENCY      0x06
 #define MT41J256M8HX15E_EMIF_TIM1              0x0888A39B
@@ -66,7 +68,6 @@
 #define MT41J256M8HX15E_EMIF_SDCFG             0x61C04B32
 #define MT41J256M8HX15E_EMIF_SDREF             0x0000093B
 #define MT41J256M8HX15E_ZQ_CFG                 0x50074BE4
-#define MT41J256M8HX15E_DLL_LOCK_DIFF          0x1
 #define MT41J256M8HX15E_RATIO                  0x40
 #define MT41J256M8HX15E_INVERT_CLKOUT          0x1
 #define MT41J256M8HX15E_RD_DQS                 0x3B
@@ -83,7 +84,6 @@
 #define MT41K256M16HA125E_EMIF_SDCFG           0x61C05332
 #define MT41K256M16HA125E_EMIF_SDREF           0xC30
 #define MT41K256M16HA125E_ZQ_CFG               0x50074BE4
-#define MT41K256M16HA125E_DLL_LOCK_DIFF                0x1
 #define MT41K256M16HA125E_RATIO                        0x80
 #define MT41K256M16HA125E_INVERT_CLKOUT                0x0
 #define MT41K256M16HA125E_RD_DQS               0x38
 #define MT41J512M8RH125_EMIF_SDCFG             0x61C04BB2
 #define MT41J512M8RH125_EMIF_SDREF             0x0000093B
 #define MT41J512M8RH125_ZQ_CFG                 0x50074BE4
-#define MT41J512M8RH125_DLL_LOCK_DIFF          0x1
 #define MT41J512M8RH125_RATIO                  0x80
 #define MT41J512M8RH125_INVERT_CLKOUT          0x0
 #define MT41J512M8RH125_RD_DQS                 0x3B
 #define K4B2G1646EBIH9_EMIF_SDCFG              0x61C052B2
 #define K4B2G1646EBIH9_EMIF_SDREF              0x00000C30
 #define K4B2G1646EBIH9_ZQ_CFG                  0x50074BE4
-#define K4B2G1646EBIH9_DLL_LOCK_DIFF           0x1
 #define K4B2G1646EBIH9_RATIO                   0x80
 #define K4B2G1646EBIH9_INVERT_CLKOUT           0x0
 #define K4B2G1646EBIH9_RD_DQS                  0x35
@@ -149,18 +147,15 @@ void config_ddr_phy(const struct emif_regs *regs, int nr);
 struct ddr_cmd_regs {
        unsigned int resv0[7];
        unsigned int cm0csratio;        /* offset 0x01C */
-       unsigned int resv1[2];
-       unsigned int cm0dldiff;         /* offset 0x028 */
+       unsigned int resv1[3];
        unsigned int cm0iclkout;        /* offset 0x02C */
        unsigned int resv2[8];
        unsigned int cm1csratio;        /* offset 0x050 */
-       unsigned int resv3[2];
-       unsigned int cm1dldiff;         /* offset 0x05C */
+       unsigned int resv3[3];
        unsigned int cm1iclkout;        /* offset 0x060 */
        unsigned int resv4[8];
        unsigned int cm2csratio;        /* offset 0x084 */
-       unsigned int resv5[2];
-       unsigned int cm2dldiff;         /* offset 0x090 */
+       unsigned int resv5[3];
        unsigned int cm2iclkout;        /* offset 0x094 */
        unsigned int resv6[3];
 };
@@ -197,24 +192,21 @@ struct ddr_regs {
        unsigned int cm0configclk;      /* offset 0x010 */
        unsigned int resv1[2];
        unsigned int cm0csratio;        /* offset 0x01C */
-       unsigned int resv2[2];
-       unsigned int cm0dldiff;         /* offset 0x028 */
+       unsigned int resv2[3];
        unsigned int cm0iclkout;        /* offset 0x02C */
        unsigned int resv3[4];
        unsigned int cm1config;         /* offset 0x040 */
        unsigned int cm1configclk;      /* offset 0x044 */
        unsigned int resv4[2];
        unsigned int cm1csratio;        /* offset 0x050 */
-       unsigned int resv5[2];
-       unsigned int cm1dldiff;         /* offset 0x05C */
+       unsigned int resv5[3];
        unsigned int cm1iclkout;        /* offset 0x060 */
        unsigned int resv6[4];
        unsigned int cm2config;         /* offset 0x074 */
        unsigned int cm2configclk;      /* offset 0x078 */
        unsigned int resv7[2];
        unsigned int cm2csratio;        /* offset 0x084 */
-       unsigned int resv8[2];
-       unsigned int cm2dldiff;         /* offset 0x090 */
+       unsigned int resv8[3];
        unsigned int cm2iclkout;        /* offset 0x094 */
        unsigned int resv9[12];
        unsigned int dt0rdsratio0;      /* offset 0x0C8 */
@@ -243,17 +235,14 @@ struct cmd_control {
        unsigned long cmd0csratio;
        unsigned long cmd0csforce;
        unsigned long cmd0csdelay;
-       unsigned long cmd0dldiff;
        unsigned long cmd0iclkout;
        unsigned long cmd1csratio;
        unsigned long cmd1csforce;
        unsigned long cmd1csdelay;
-       unsigned long cmd1dldiff;
        unsigned long cmd1iclkout;
        unsigned long cmd2csratio;
        unsigned long cmd2csforce;
        unsigned long cmd2csdelay;
-       unsigned long cmd2dldiff;
        unsigned long cmd2iclkout;
 };
 
@@ -267,8 +256,6 @@ struct ddr_data {
        unsigned long datagiratio0;
        unsigned long datafwsratio0;
        unsigned long datawrsratio0;
-       unsigned long datauserank0delay;
-       unsigned long datadldiff0;
 };
 
 /**
index abcb97d..59e2f43 100644 (file)
@@ -22,5 +22,10 @@ void at91_spi1_hw_init(unsigned long cs_mask);
 void at91_udp_hw_init(void);
 void at91_uhp_hw_init(void);
 void at91_lcd_hw_init(void);
+void at91_plla_init(u32 pllar);
+void at91_mck_init(u32 mckr);
+void at91_pmc_init(void);
+void mem_init(void);
+void at91_phy_reset(void);
 
 #endif /* AT91_COMMON_H */
index 676f024..50464ff 100644 (file)
@@ -151,37 +151,4 @@ int at91_get_pio_value(unsigned port, unsigned pin);
 #define        AT91_PIO_PORTD          0x3
 #define        AT91_PIO_PORTE          0x4
 
-#ifdef CONFIG_AT91_LEGACY
-
-#define PIO_PER                0x00    /* Enable Register */
-#define PIO_PDR                0x04    /* Disable Register */
-#define PIO_PSR                0x08    /* Status Register */
-#define PIO_OER                0x10    /* Output Enable Register */
-#define PIO_ODR                0x14    /* Output Disable Register */
-#define PIO_OSR                0x18    /* Output Status Register */
-#define PIO_IFER       0x20    /* Glitch Input Filter Enable */
-#define PIO_IFDR       0x24    /* Glitch Input Filter Disable */
-#define PIO_IFSR       0x28    /* Glitch Input Filter Status */
-#define PIO_SODR       0x30    /* Set Output Data Register */
-#define PIO_CODR       0x34    /* Clear Output Data Register */
-#define PIO_ODSR       0x38    /* Output Data Status Register */
-#define PIO_PDSR       0x3c    /* Pin Data Status Register */
-#define PIO_IER                0x40    /* Interrupt Enable Register */
-#define PIO_IDR                0x44    /* Interrupt Disable Register */
-#define PIO_IMR                0x48    /* Interrupt Mask Register */
-#define PIO_ISR                0x4c    /* Interrupt Status Register */
-#define PIO_MDER       0x50    /* Multi-driver Enable Register */
-#define PIO_MDDR       0x54    /* Multi-driver Disable Register */
-#define PIO_MDSR       0x58    /* Multi-driver Status Register */
-#define PIO_PUDR       0x60    /* Pull-up Disable Register */
-#define PIO_PUER       0x64    /* Pull-up Enable Register */
-#define PIO_PUSR       0x68    /* Pull-up Status Register */
-#define PIO_ASR                0x70    /* Peripheral A Select Register */
-#define PIO_BSR                0x74    /* Peripheral B Select Register */
-#define PIO_ABSR       0x78    /* AB Status Register */
-#define PIO_OWER       0xa0    /* Output Write Enable Register */
-#define PIO_OWDR       0xa4    /* Output Write Disable Register */
-#define PIO_OWSR       0xa8    /* Output Write Status Register */
-#endif
-
 #endif
index d314b06..56724f1 100644 (file)
@@ -25,20 +25,4 @@ typedef struct at91_pit {
 #define                AT91_PIT_MR_PIV_MASK(x) (x & 0x000fffff)
 #define                AT91_PIT_MR_PIV(x)      (x & AT91_PIT_MR_PIV_MASK)
 
-#ifdef CONFIG_AT91_LEGACY
-
-#define AT91_PIT_MR            (AT91_PIT + 0x00)       /* Mode Register */
-#define                AT91_PIT_PITIEN         (1 << 25)               /* Timer Interrupt Enable */
-#define                AT91_PIT_PITEN          (1 << 24)               /* Timer Enabled */
-#define                AT91_PIT_PIV            (0xfffff)               /* Periodic Interval Value */
-
-#define AT91_PIT_SR            (AT91_PIT + 0x04)       /* Status Register */
-#define                AT91_PIT_PITS           (1 << 0)                /* Timer Status */
-
-#define AT91_PIT_PIVR          (AT91_PIT + 0x08)       /* Periodic Interval Value Register */
-#define AT91_PIT_PIIR          (AT91_PIT + 0x0c)       /* Periodic Interval Image Register */
-#define                AT91_PIT_PICNT          (0xfff << 20)           /* Interval Counter */
-#define                AT91_PIT_CPIV           (0xfffff)               /* Inverval Value */
-
-#endif /* CONFIG_AT91_LEGACY */
 #endif
index 7b36f74..4535608 100644 (file)
 #ifndef AT91_PMC_H
 #define AT91_PMC_H
 
+#ifdef __ASSEMBLY__
+
 #define        AT91_ASM_PMC_MOR        (ATMEL_BASE_PMC + 0x20)
 #define        AT91_ASM_PMC_PLLAR      (ATMEL_BASE_PMC + 0x28)
 #define        AT91_ASM_PMC_PLLBR      (ATMEL_BASE_PMC + 0x2c)
 #define AT91_ASM_PMC_MCKR      (ATMEL_BASE_PMC + 0x30)
 #define AT91_ASM_PMC_SR                (ATMEL_BASE_PMC + 0x68)
 
-#ifndef __ASSEMBLY__
+#else
 
 #include <asm/types.h>
 
@@ -73,7 +75,11 @@ typedef struct at91_pmc {
 #define AT91_PMC_PLLXR_DIV(x)          (x & 0xFF)
 #define AT91_PMC_PLLXR_PLLCOUNT(x)     ((x & 0x3F) << 8)
 #define AT91_PMC_PLLXR_OUT(x)          ((x & 0x03) << 14)
+#ifdef CONFIG_SAMA5D3
+#define AT91_PMC_PLLXR_MUL(x)          ((x & 0x7F) << 18)
+#else
 #define AT91_PMC_PLLXR_MUL(x)          ((x & 0x7FF) << 16)
+#endif
 #define AT91_PMC_PLLAR_29              0x20000000
 #define AT91_PMC_PLLBR_USBDIV_1                0x00000000
 #define AT91_PMC_PLLBR_USBDIV_2                0x10000000
@@ -124,8 +130,8 @@ typedef struct at91_pmc {
 #define AT91_PMC_MCKR_MDIV_MASK                0x00000300
 #endif
 
-#define AT91_PMC_MCKR_PLLADIV_1                0x00001000
-#define AT91_PMC_MCKR_PLLADIV_2                0x00002000
+#define AT91_PMC_MCKR_PLLADIV_1                0x00000000
+#define AT91_PMC_MCKR_PLLADIV_2                0x00001000
 
 #define AT91_PMC_IXR_MOSCS             0x00000001
 #define AT91_PMC_IXR_LOCKA             0x00000002
@@ -137,13 +143,6 @@ typedef struct at91_pmc {
 #define AT91_PMC_IXR_PCKRDY2           0x00000400
 #define AT91_PMC_IXR_PCKRDY3           0x00000800
 
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_PMC_SCER           (AT91_PMC + 0x00)       /* System Clock Enable Register */
-#define        AT91_PMC_SCDR           (AT91_PMC + 0x04)       /* System Clock Disable Register */
-
-#define        AT91_PMC_SCSR           (AT91_PMC + 0x08)       /* System Clock Status Register */
-#endif
-
 #define                AT91_PMC_PCK            (1 <<  0)               /* Processor Clock */
 #define                AT91RM9200_PMC_UDP      (1 <<  1)               /* USB Devcice Port Clock [AT91RM9200 only] */
 #define                AT91RM9200_PMC_MCKUDP   (1 <<  2)               /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
@@ -159,34 +158,18 @@ typedef struct at91_pmc {
 #define                AT91_PMC_HCK0           (1 << 16)               /* AHB Clock (USB host) [AT91SAM9261 only] */
 #define                AT91_PMC_HCK1           (1 << 17)               /* AHB Clock (LCD) [AT91SAM9261 only] */
 
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_PMC_PCER           (AT91_PMC + 0x10)       /* Peripheral Clock Enable Register */
-#define        AT91_PMC_PCDR           (AT91_PMC + 0x14)       /* Peripheral Clock Disable Register */
-#define        AT91_PMC_PCSR           (AT91_PMC + 0x18)       /* Peripheral Clock Status Register */
-
-#define        AT91_CKGR_UCKR          (AT91_PMC + 0x1C)       /* UTMI Clock Register [SAM9RL, CAP9] */
-#endif
-
 #define                AT91_PMC_UPLLEN         (1   << 16)             /* UTMI PLL Enable */
 #define                AT91_PMC_UPLLCOUNT      (0xf << 20)             /* UTMI PLL Start-up Time */
 #define                AT91_PMC_BIASEN         (1   << 24)             /* UTMI BIAS Enable */
 #define                AT91_PMC_BIASCOUNT      (0xf << 28)             /* UTMI PLL Start-up Time */
 
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_CKGR_MOR           (AT91_PMC + 0x20)       /* Main Oscillator Register [not on SAM9RL] */
-#endif
 #define                AT91_PMC_MOSCEN         (1    << 0)             /* Main Oscillator Enable */
 #define                AT91_PMC_OSCBYPASS      (1    << 1)             /* Oscillator Bypass [SAM9x, CAP9] */
 #define                AT91_PMC_OSCOUNT        (0xff << 8)             /* Main Oscillator Start-up Time */
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_CKGR_MCFR          (AT91_PMC + 0x24)       /* Main Clock Frequency Register */
-#endif
+
 #define                AT91_PMC_MAINF          (0xffff <<  0)          /* Main Clock Frequency */
 #define                AT91_PMC_MAINRDY        (1      << 16)          /* Main Clock Ready */
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_CKGR_PLLAR         (AT91_PMC + 0x28)       /* PLL A Register */
-#define        AT91_CKGR_PLLBR         (AT91_PMC + 0x2c)       /* PLL B Register */
-#endif
+
 #define                AT91_PMC_DIV            (0xff  <<  0)           /* Divider */
 #define                AT91_PMC_PLLCOUNT       (0x3f  <<  8)           /* PLL Counter */
 #define                AT91_PMC_OUT            (3     << 14)           /* PLL Clock Frequency Range */
@@ -198,9 +181,6 @@ typedef struct at91_pmc {
 #define                AT91_PMC_USB96M         (1     << 28)           /* Divider by 2 Enable (PLLB only) */
 #define                AT91_PMC_PLLA_WR_ERRATA (1     << 29)           /* Bit 29 must always be set to 1 when programming the CKGR_PLLAR register */
 
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_PMC_MCKR           (AT91_PMC + 0x30)       /* Master Clock Register */
-#endif
 #define                AT91_PMC_CSS            (3 <<  0)               /* Master Clock Selection */
 #define                        AT91_PMC_CSS_SLOW               (0 << 0)
 #define                        AT91_PMC_CSS_MAIN               (1 << 0)
@@ -228,9 +208,6 @@ typedef struct at91_pmc {
 #define                        AT91_PMC_PDIV_1                 (0 << 12)
 #define                        AT91_PMC_PDIV_2                 (1 << 12)
 
-#ifdef CONFIG_AT91_LEGACY
-#define                AT91_PMC_USB                    (AT91_PMC + 0x38)       /* USB Clock Register */
-#endif
 #define                AT91_PMC_USBS_USB_PLLA          (0x0)           /* USB Clock Input is PLLA */
 #define                AT91_PMC_USBS_USB_UPLL          (0x1)           /* USB Clock Input is UPLL */
 #define                AT91_PMC_USBS_USB_PLLB          (0x1)           /* USB Clock Input is PLLB, AT91SAM9N12 only */
@@ -238,13 +215,6 @@ typedef struct at91_pmc {
 #define                AT91_PMC_USBDIV_8               (0x7 <<  8)     /* USB Clock divided by 8 */
 #define                AT91_PMC_USBDIV_10              (0x9 <<  8)     /* USB Clock divided by 10 */
 
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_PMC_PCKR(n)        (AT91_PMC + 0x40 + ((n) * 4))   /* Programmable Clock 0-3 Registers */
-
-#define        AT91_PMC_IER            (AT91_PMC + 0x60)       /* Interrupt Enable Register */
-#define        AT91_PMC_IDR            (AT91_PMC + 0x64)       /* Interrupt Disable Register */
-#define        AT91_PMC_SR             (AT91_PMC + 0x68)       /* Status Register */
-#endif
 #define                AT91_PMC_MOSCS          (1 <<  0)               /* MOSCS Flag */
 #define                AT91_PMC_LOCKA          (1 <<  1)               /* PLLA Lock */
 #define                AT91_PMC_LOCKB          (1 <<  2)               /* PLLB Lock */
@@ -255,13 +225,6 @@ typedef struct at91_pmc {
 #define                AT91_PMC_PCK1RDY        (1 <<  9)               /* Programmable Clock 1 */
 #define                AT91_PMC_PCK2RDY        (1 << 10)               /* Programmable Clock 2 */
 #define                AT91_PMC_PCK3RDY        (1 << 11)               /* Programmable Clock 3 */
-#ifdef CONFIG_AT91_LEGACY
-#define        AT91_PMC_IMR            (AT91_PMC + 0x6c)       /* Interrupt Mask Register */
 
-#define AT91_PMC_PROT          (AT91_PMC + 0xe4)       /* Protect Register [AT91CAP9 revC only] */
-#endif
 #define                AT91_PMC_PROTKEY        0x504d4301      /* Activation Code */
-#ifdef CONFIG_AT91_LEGACY
-#define AT91_PMC_VER           (AT91_PMC + 0xfc)       /* PMC Module Version [AT91CAP9 only] */
-#endif /* CONFIG_AT91_LEGACY */
 #endif
index f44cf67..b18665b 100644 (file)
@@ -118,6 +118,6 @@ typedef struct at91_spi {
 
 #define AT91_SPI_PTSR          0x0124                  /* PDC Transfer Status Register */
 
-#endif /* CONFIG_AT91_LEGACY */
+#endif /* CONFIG_ATMEL_LEGACY */
 
 #endif
index f0f4ed1..0644bbf 100644 (file)
@@ -40,25 +40,4 @@ typedef struct at91_wdt {
 #define AT91_WDT_MR_WDDBGHLT           0x10000000
 #define AT91_WDT_MR_WDIDLEHLT          0x20000000
 
-#ifdef CONFIG_AT91_LEGACY
-
-#define AT91_WDT_CR            (AT91_WDT + 0x00)       /* Watchdog Control Register */
-#define                AT91_WDT_WDRSTT         (1    << 0)             /* Restart */
-#define                AT91_WDT_KEY            (0xa5 << 24)            /* KEY Password */
-
-#define AT91_WDT_MR            (AT91_WDT + 0x04)       /* Watchdog Mode Register */
-#define                AT91_WDT_WDV            (0xfff << 0)            /* Counter Value */
-#define                AT91_WDT_WDFIEN         (1     << 12)           /* Fault Interrupt Enable */
-#define                AT91_WDT_WDRSTEN        (1     << 13)           /* Reset Processor */
-#define                AT91_WDT_WDRPROC        (1     << 14)           /* Timer Restart */
-#define                AT91_WDT_WDDIS          (1     << 15)           /* Watchdog Disable */
-#define                AT91_WDT_WDD            (0xfff << 16)           /* Delta Value */
-#define                AT91_WDT_WDDBGHLT       (1     << 28)           /* Debug Halt */
-#define                AT91_WDT_WDIDLEHLT      (1     << 29)           /* Idle Halt */
-
-#define AT91_WDT_SR            (AT91_WDT + 0x08)       /* Watchdog Status Register */
-#define                AT91_WDT_WDUNF          (1 << 0)                /* Watchdog Underflow */
-#define                AT91_WDT_WDERR          (1 << 1)                /* Watchdog Error */
-
-#endif /* CONFIG_AT91_LEGACY */
 #endif
index 7ac5bc1..63870bc 100644 (file)
 #define AT91_RSTC_BASE 0xfffffd00
 #define AT91_PIT_BASE  0xfffffd30
 
-#ifdef CONFIG_AT91_LEGACY
-
-/*
- * User Peripheral physical base addresses.
- */
-#define AT91CAP9_BASE_UDPHS            0xfff78000
-#define AT91CAP9_BASE_TCB0             0xfff7c000
-#define AT91CAP9_BASE_TC0              0xfff7c000
-#define AT91CAP9_BASE_TC1              0xfff7c040
-#define AT91CAP9_BASE_TC2              0xfff7c080
-#define AT91CAP9_BASE_MCI0             0xfff80000
-#define AT91CAP9_BASE_MCI1             0xfff84000
-#define AT91CAP9_BASE_TWI              0xfff88000
-#define AT91CAP9_BASE_US0              0xfff8c000
-#define AT91CAP9_BASE_US1              0xfff90000
-#define AT91CAP9_BASE_US2              0xfff94000
-#define AT91CAP9_BASE_SSC0             0xfff98000
-#define AT91CAP9_BASE_SSC1             0xfff9c000
-#define AT91CAP9_BASE_AC97C            0xfffa0000
-#define AT91CAP9_BASE_SPI0             0xfffa4000
-#define AT91CAP9_BASE_SPI1             0xfffa8000
-#define AT91CAP9_BASE_CAN              0xfffac000
-#define AT91CAP9_BASE_PWMC             0xfffb8000
-#define AT91CAP9_BASE_EMAC             0xfffbc000
-#define AT91CAP9_BASE_ADC              0xfffc0000
-#define AT91CAP9_BASE_ISI              0xfffc4000
-#define AT91_BASE_SYS                  0xffffe200
-
-/*
- * System Peripherals (offset from AT91_BASE_SYS)
- */
-#define AT91_ECC       (0xffffe200 - AT91_BASE_SYS)
-#define AT91_BCRAMC    (0xffffe400 - AT91_BASE_SYS)
-#define AT91_DDRSDRC   (0xffffe600 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffe800 - AT91_BASE_SYS)
-#define AT91_MATRIX    (0xffffea00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffeb10 - AT91_BASE_SYS)
-#define AT91_DMA       (0xffffec00 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
-#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
-#define AT91_SCKCR     (0xfffffd50 - AT91_BASE_SYS)
-#define AT91_GPBR_REVB (0xfffffd50 - AT91_BASE_SYS)
-#define AT91_GPBR_REVC (0xfffffd60 - AT91_BASE_SYS)
-
-#define AT91_USART0    AT91CAP9_BASE_US0
-#define AT91_USART1    AT91CAP9_BASE_US1
-#define AT91_USART2    AT91CAP9_BASE_US2
-
-/*
- * SCKCR flags
- */
-#define AT91CAP9_SCKCR_RCEN    (1 << 0)        /* RC Oscillator Enable */
-#define AT91CAP9_SCKCR_OSC32EN (1 << 1)        /* 32kHz Oscillator Enable */
-#define AT91CAP9_SCKCR_OSC32BYP        (1 << 2)        /* 32kHz Oscillator Bypass */
-#define AT91CAP9_SCKCR_OSCSEL  (1 << 3)        /* Slow Clock Selector */
-#define                AT91CAP9_SCKCR_OSCSEL_RC        (0 << 3)
-#define                AT91CAP9_SCKCR_OSCSEL_32        (1 << 3)
-
-#endif /* CONFIG_AT91_LEGACY */
 /*
  * Internal Memory.
  */
index ec5d797..d29e98e 100644 (file)
@@ -73,64 +73,4 @@ typedef struct       at91_smc {
 #define AT91_SMC_MODE_PS_16            0x20000000
 #define AT91_SMC_MODE_PS_32            0x30000000
 
-#ifdef CONFIG_AT91_LEGACY
-
-#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
-#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
-#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
-#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
-#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
-#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
-#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
-
-#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
-#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
-#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
-#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
-#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
-#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
-#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
-
-#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
-#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
-#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
-#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
-#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
-
-#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
-#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
-#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
-#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
-#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
-#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
-#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
-#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
-#define                        AT91_SMC_BAT_SELECT             (0 << 8)
-#define                        AT91_SMC_BAT_WRITE              (1 << 8)
-#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
-#define                        AT91_SMC_DBW_8                  (0 << 12)
-#define                        AT91_SMC_DBW_16                 (1 << 12)
-#define                        AT91_SMC_DBW_32                 (2 << 12)
-#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
-#define                        AT91_SMC_TDF_(x)                ((x) << 16)
-#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
-#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
-#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
-#define                        AT91_SMC_PS_4                   (0 << 28)
-#define                        AT91_SMC_PS_8                   (1 << 28)
-#define                        AT91_SMC_PS_16                  (2 << 28)
-#define                        AT91_SMC_PS_32                  (3 << 28)
-
-#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
-#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
-#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
-#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
-#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
-#endif
-
-#endif
 #endif
diff --git a/arch/arm/include/asm/arch-at91/atmel_mpddrc.h b/arch/arm/include/asm/arch-at91/atmel_mpddrc.h
new file mode 100644 (file)
index 0000000..5741f6e
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2013 Atmel Corporation
+ *                   Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ATMEL_MPDDRC_H__
+#define __ATMEL_MPDDRC_H__
+
+/*
+ * Only define the needed register in mpddr
+ * If other register needed, will add them later
+ */
+struct atmel_mpddr {
+       u32 mr;
+       u32 rtr;
+       u32 cr;
+       u32 tpr0;
+       u32 tpr1;
+       u32 tpr2;
+       u32 reserved[2];
+       u32 md;
+};
+
+int ddr2_init(const unsigned int ram_address,
+              const struct atmel_mpddr *mpddr);
+
+/* Bit field in mode register */
+#define ATMEL_MPDDRC_MR_MODE_NORMAL_CMD                0x0
+#define ATMEL_MPDDRC_MR_MODE_NOP_CMD           0x1
+#define ATMEL_MPDDRC_MR_MODE_PRCGALL_CMD       0x2
+#define ATMEL_MPDDRC_MR_MODE_LMR_CMD           0x3
+#define ATMEL_MPDDRC_MR_MODE_RFSH_CMD          0x4
+#define ATMEL_MPDDRC_MR_MODE_EXT_LMR_CMD       0x5
+#define ATMEL_MPDDRC_MR_MODE_DEEP_CMD          0x6
+#define ATMEL_MPDDRC_MR_MODE_LPDDR2_CMD                0x7
+
+/* Bit field in configuration register */
+#define ATMEL_MPDDRC_CR_NC_MASK                        0x3
+#define ATMEL_MPDDRC_CR_NC_COL_9               0x0
+#define ATMEL_MPDDRC_CR_NC_COL_10              0x1
+#define ATMEL_MPDDRC_CR_NC_COL_11              0x2
+#define ATMEL_MPDDRC_CR_NC_COL_12              0x3
+#define ATMEL_MPDDRC_CR_NR_MASK                        (0x3 << 2)
+#define ATMEL_MPDDRC_CR_NR_ROW_11              (0x0 << 2)
+#define ATMEL_MPDDRC_CR_NR_ROW_12              (0x1 << 2)
+#define ATMEL_MPDDRC_CR_NR_ROW_13              (0x2 << 2)
+#define ATMEL_MPDDRC_CR_NR_ROW_14              (0x3 << 2)
+#define ATMEL_MPDDRC_CR_CAS_MASK               (0x7 << 4)
+#define ATMEL_MPDDRC_CR_CAS_DDR_CAS2           (0x2 << 4)
+#define ATMEL_MPDDRC_CR_CAS_DDR_CAS3           (0x3 << 4)
+#define ATMEL_MPDDRC_CR_CAS_DDR_CAS4           (0x4 << 4)
+#define ATMEL_MPDDRC_CR_CAS_DDR_CAS5           (0x5 << 4)
+#define ATMEL_MPDDRC_CR_CAS_DDR_CAS6           (0x6 << 4)
+#define ATMEL_MPDDRC_CR_DLL_RESET_ENABLED      (0x1 << 7)
+#define ATMEL_MPDDRC_CR_DIC_DS                 (0x1 << 8)
+#define ATMEL_MPDDRC_CR_DIS_DLL                        (0x1 << 9)
+#define ATMEL_MPDDRC_CR_OCD_DEFAULT            (0x7 << 12)
+#define ATMEL_MPDDRC_CR_ENRDM_ON               (0x1 << 17)
+#define ATMEL_MPDDRC_CR_NB_8BANKS              (0x1 << 20)
+#define ATMEL_MPDDRC_CR_NDQS_DISABLED          (0x1 << 21)
+#define ATMEL_MPDDRC_CR_DECOD_INTERLEAVED      (0x1 << 22)
+#define ATMEL_MPDDRC_CR_UNAL_SUPPORTED         (0x1 << 23)
+
+/* Bit field in timing parameter 0 register */
+#define ATMEL_MPDDRC_TPR0_TRAS_OFFSET          0
+#define ATMEL_MPDDRC_TPR0_TRAS_MASK            0xf
+#define ATMEL_MPDDRC_TPR0_TRCD_OFFSET          4
+#define ATMEL_MPDDRC_TPR0_TRCD_MASK            0xf
+#define ATMEL_MPDDRC_TPR0_TWR_OFFSET           8
+#define ATMEL_MPDDRC_TPR0_TWR_MASK             0xf
+#define ATMEL_MPDDRC_TPR0_TRC_OFFSET           12
+#define ATMEL_MPDDRC_TPR0_TRC_MASK             0xf
+#define ATMEL_MPDDRC_TPR0_TRP_OFFSET           16
+#define ATMEL_MPDDRC_TPR0_TRP_MASK             0xf
+#define ATMEL_MPDDRC_TPR0_TRRD_OFFSET          20
+#define ATMEL_MPDDRC_TPR0_TRRD_MASK            0xf
+#define ATMEL_MPDDRC_TPR0_TWTR_OFFSET          24
+#define ATMEL_MPDDRC_TPR0_TWTR_MASK            0x7
+#define ATMEL_MPDDRC_TPR0_RDC_WRRD_OFFSET      27
+#define ATMEL_MPDDRC_TPR0_RDC_WRRD_MASK                0x1
+#define ATMEL_MPDDRC_TPR0_TMRD_OFFSET          28
+#define ATMEL_MPDDRC_TPR0_TMRD_MASK            0xf
+
+/* Bit field in timing parameter 1 register */
+#define ATMEL_MPDDRC_TPR1_TRFC_OFFSET          0
+#define ATMEL_MPDDRC_TPR1_TRFC_MASK            0x7f
+#define ATMEL_MPDDRC_TPR1_TXSNR_OFFSET         8
+#define ATMEL_MPDDRC_TPR1_TXSNR_MASK           0xff
+#define ATMEL_MPDDRC_TPR1_TXSRD_OFFSET         16
+#define ATMEL_MPDDRC_TPR1_TXSRD_MASK           0xff
+#define ATMEL_MPDDRC_TPR1_TXP_OFFSET           24
+#define ATMEL_MPDDRC_TPR1_TXP_MASK             0xf
+
+/* Bit field in timing parameter 2 register */
+#define ATMEL_MPDDRC_TPR2_TXARD_OFFSET         0
+#define ATMEL_MPDDRC_TPR2_TXARD_MASK           0xf
+#define ATMEL_MPDDRC_TPR2_TXARDS_OFFSET                4
+#define ATMEL_MPDDRC_TPR2_TXARDS_MASK          0xf
+#define ATMEL_MPDDRC_TPR2_TRPA_OFFSET          8
+#define ATMEL_MPDDRC_TPR2_TRPA_MASK            0xf
+#define ATMEL_MPDDRC_TPR2_TRTP_OFFSET          12
+#define ATMEL_MPDDRC_TPR2_TRTP_MASK            0x7
+#define ATMEL_MPDDRC_TPR2_TFAW_OFFSET          16
+#define ATMEL_MPDDRC_TPR2_TFAW_MASK            0xf
+
+/* Bit field in Memory Device Register */
+#define ATMEL_MPDDRC_MD_LPDDR_SDRAM    0x3
+#define ATMEL_MPDDRC_MD_DDR2_SDRAM     0x6
+#define ATMEL_MPDDRC_MD_DBW_MASK       (0x1 << 4)
+#define ATMEL_MPDDRC_MD_DBW_32_BITS    (0x0 << 4)
+#define ATMEL_MPDDRC_MD_DBW_16_BITS    (0x1 << 4)
+
+#endif
index 0700427..ff6142b 100644 (file)
@@ -16,7 +16,7 @@
 
 #ifdef CONFIG_ATMEL_LEGACY
 
-#define PIN_BASE               32
+#define PIN_BASE               0
 
 #define MAX_GPIO_BANKS         5
 
@@ -231,4 +231,26 @@ static inline unsigned pin_to_mask(unsigned pin)
 #define at91_set_gpio_value(x, y)      at91_set_pio_value(x, y)
 #define at91_get_gpio_value(x)         at91_get_pio_value(x)
 #endif
-#endif
+
+#define GPIO_PIOA_BASE  (0)
+#define GPIO_PIOB_BASE  (GPIO_PIOA_BASE + 32)
+#define GPIO_PIOC_BASE  (GPIO_PIOB_BASE + 32)
+#define GPIO_PIOD_BASE  (GPIO_PIOC_BASE + 32)
+#define GPIO_PIOE_BASE  (GPIO_PIOD_BASE + 32)
+#define GPIO_PIN_PA(x)  (GPIO_PIOA_BASE + (x))
+#define GPIO_PIN_PB(x)  (GPIO_PIOB_BASE + (x))
+#define GPIO_PIN_PC(x)  (GPIO_PIOC_BASE + (x))
+#define GPIO_PIN_PD(x)  (GPIO_PIOD_BASE + (x))
+#define GPIO_PIN_PE(x)  (GPIO_PIOE_BASE + (x))
+
+static inline unsigned at91_gpio_to_port(unsigned gpio)
+{
+       return gpio / 32;
+}
+
+static inline unsigned at91_gpio_to_pin(unsigned gpio)
+{
+       return gpio % 32;
+}
+
+#endif /* __ASM_ARCH_AT91_GPIO_H */
index 123a627..6d936f4 100644 (file)
@@ -79,6 +79,7 @@
 #define ARCH_EXID_SAMA5D33     0x00414300
 #define ARCH_EXID_SAMA5D34     0x00414301
 #define ARCH_EXID_SAMA5D35     0x00584300
+#define ARCH_EXID_SAMA5D36     0x00004301
 
 #define cpu_is_sama5d3()       (get_chip_id() == ARCH_ID_SAMA5D3)
 #define cpu_is_sama5d31()      (cpu_is_sama5d3() && \
@@ -89,6 +90,8 @@
                (get_extension_chip_id() == ARCH_EXID_SAMA5D34))
 #define cpu_is_sama5d35()      (cpu_is_sama5d3() && \
                (get_extension_chip_id() == ARCH_EXID_SAMA5D35))
+#define cpu_is_sama5d36()      (cpu_is_sama5d3() && \
+               (get_extension_chip_id() == ARCH_EXID_SAMA5D36))
 
 /*
  * User Peripherals physical base addresses.
diff --git a/arch/arm/include/asm/arch-at91/spl.h b/arch/arm/include/asm/arch-at91/spl.h
new file mode 100644 (file)
index 0000000..68c5349
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013 Atmel Corporation
+ *                   Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef        _ASM_ARCH_SPL_H_
+#define        _ASM_ARCH_SPL_H_
+
+enum {
+       BOOT_DEVICE_NONE,
+#ifdef CONFIG_SYS_USE_MMC
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_MMC2_2,
+#endif
+};
+
+#endif
index 7aaf4bf..27b1844 100644 (file)
@@ -478,8 +478,9 @@ struct davinci_syscfg_regs {
        dv_reg  rsvd[13];
        dv_reg  kick0;
        dv_reg  kick1;
-       dv_reg  rsvd1[53];
+       dv_reg  rsvd1[52];
        dv_reg  mstpri[3];
+       dv_reg  rsvd2;
        dv_reg  pinmux[20];
        dv_reg  suspsrc;
        dv_reg  chipsig;
index d1c5d4f..09d739d 100644 (file)
@@ -6,10 +6,6 @@
  */
 
 #define DWMCI_CLKSEL           0x09C
-#define DWMCI_SHIFT_0          0x0
-#define DWMCI_SHIFT_1          0x1
-#define DWMCI_SHIFT_2          0x2
-#define DWMCI_SHIFT_3          0x3
 #define DWMCI_SET_SAMPLE_CLK(x)        (x)
 #define DWMCI_SET_DRV_CLK(x)   ((x) << 16)
 #define DWMCI_SET_DIV_RATIO(x) ((x) << 24)
index 98312d1..98d6530 100644 (file)
@@ -55,7 +55,7 @@
 
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
-static inline unsigned int s5p_mmc_init(int index, int bus_width)
+static inline int s5p_mmc_init(int index, int bus_width)
 {
        unsigned int base = samsung_get_base_mmc() +
                                (S5P_MMC_DEV_OFFSET * index);
index 8db18c5..2bfee18 100644 (file)
@@ -16,7 +16,7 @@ struct exynos4_power {
        unsigned int    gnss_rtc_out_ctrl;
        unsigned char   res2[0x1ec];
        unsigned int    system_power_down_ctrl;
-       unsigned char   res3[0x1];
+       unsigned int    res3;
        unsigned int    system_power_down_option;
        unsigned char   res4[0x1f4];
        unsigned int    swreset;
index 147c1a7..0ba931b 100644 (file)
@@ -30,6 +30,7 @@ struct exynos_spi {
 #define EXYNOS_SPI_MAX_FREQ    50000000
 
 #define SPI_TIMEOUT_MS         10
+#define SF_READ_DATA_CMD       0x3
 
 /* SPI_CHCFG */
 #define SPI_CH_HS_EN           (1 << 6)
index be669c1..1912cc9 100644 (file)
@@ -27,8 +27,6 @@
 #define ICK_DSS_ON     0x00000001
 #define FCK_CAM_ON     0x00000001
 #define ICK_CAM_ON     0x00000001
-#define FCK_PER_ON     0x0003ffff
-#define ICK_PER_ON     0x0003ffff
 
 /* Used to index into DPLL parameter tables */
 typedef struct {
index 7fb549a..65a5995 100644 (file)
@@ -55,6 +55,7 @@ struct control_prog_io {
 #define OMAP34XX_UART1                 (OMAP34XX_L4_IO_BASE + 0x6a000)
 #define OMAP34XX_UART2                 (OMAP34XX_L4_IO_BASE + 0x6c000)
 #define OMAP34XX_UART3                 (OMAP34XX_L4_PER + 0x20000)
+#define OMAP34XX_UART4                 (OMAP34XX_L4_PER + 0x42000)
 
 /* General Purpose Timers */
 #define OMAP34XX_GPT1                  0x48318000
index 39c5316..ce8217f 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+extern const struct emif_regs emif_regs_elpida_200_mhz_2cs;
+extern const struct emif_regs emif_regs_elpida_380_mhz_1cs;
+extern const struct emif_regs emif_regs_elpida_400_mhz_1cs;
+extern const struct emif_regs emif_regs_elpida_400_mhz_2cs;
 struct omap_sysinfo {
        char *board_string;
 };
index 8869b50..2dfe4ef 100644 (file)
 #define HSMMC_CLKCTRL_CLKSEL_MASK              (1 << 24)
 #define HSMMC_CLKCTRL_CLKSEL_DIV_MASK          (1 << 25)
 
+/* CM_L3INIT_SATA_CLKCTRL */
+#define SATA_CLKCTRL_OPTFCLKEN_MASK            (1 << 8)
+
 /* CM_WKUP_GPTIMER1_CLKCTRL */
 #define GPTIMER1_CLKCTRL_CLKSEL_MASK           (1 << 24)
 
index 3c2306f..590235b 100644 (file)
@@ -64,6 +64,9 @@
 /* QSPI */
 #define QSPI_BASE              0x4B300000
 
+/* SATA */
+#define DWC_AHSATA_BASE                0x4A140000
+
 /*
  * Hardware Register Details
  */
@@ -239,6 +242,7 @@ struct ctrl_ioregs {
        u32 ctrl_ddrio_1;
        u32 ctrl_ddrio_2;
        u32 ctrl_emif_sdram_config_ext;
+       u32 ctrl_emif_sdram_config_ext_final;
        u32 ctrl_ddr_ctrl_ext_0;
 };
 
diff --git a/arch/arm/include/asm/arch-omap5/sata.h b/arch/arm/include/asm/arch-omap5/sata.h
new file mode 100644 (file)
index 0000000..2ca8947
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * SATA Wrapper Register map
+ *
+ * (C) Copyright 2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TI_SATA_H
+#define _TI_SATA_H
+
+/* SATA Wrapper module */
+#define TI_SATA_WRAPPER_BASE           (OMAP54XX_L4_CORE_BASE + 0x141100)
+/* SATA PHY Module */
+#define TI_SATA_PLLCTRL_BASE           (OMAP54XX_L4_CORE_BASE + 0x96800)
+
+/* SATA Wrapper register offsets */
+#define TI_SATA_SYSCONFIG                      0x00
+#define TI_SATA_CDRLOCK                                0x04
+
+/* Register Set */
+#define TI_SATA_SYSCONFIG_OVERRIDE0            (1 << 16)
+#define TI_SATA_SYSCONFIG_STANDBY_MASK         (0x3 << 4)
+#define TI_SATA_SYSCONFIG_IDLE_MASK            (0x3 << 2)
+
+/* Standby modes */
+#define TI_SATA_STANDBY_FORCE                  0x0
+#define TI_SATA_STANDBY_NO                     (0x1 << 4)
+#define TI_SATA_STANDBY_SMART_WAKE             (0x3 << 4)
+#define TI_SATA_STANDBY_SMART                  (0x2 << 4)
+
+/* Idle modes */
+#define TI_SATA_IDLE_FORCE                     0x0
+#define TI_SATA_IDLE_NO                                (0x1 << 2)
+#define TI_SATA_IDLE_SMART_WAKE                        (0x3 << 2)
+#define TI_SATA_IDLE_SMART                     (0x2 << 2)
+
+#ifdef CONFIG_SCSI_AHCI_PLAT
+int omap_sata_init(void);
+#else
+static inline int omap_sata_init(void)
+{
+       return 0;
+}
+#endif /* CONFIG_SCSI_AHCI_PLAT */
+
+#endif /* _TI_SATA_H */
index 6b5e4ed..560e9f4 100644 (file)
@@ -7,6 +7,12 @@ void sh73a0_pinmux_init(void);
 #elif defined(CONFIG_R8A7740)
 #include "r8a7740-gpio.h"
 void r8a7740_pinmux_init(void);
+#elif defined(CONFIG_R8A7790)
+#include "r8a7790-gpio.h"
+void r8a7790_pinmux_init(void);
+#elif defined(CONFIG_R8A7791)
+#include "r8a7791-gpio.h"
+void r8a7791_pinmux_init(void);
 #endif
 
 #endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h b/arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h
new file mode 100644 (file)
index 0000000..444e361
--- /dev/null
@@ -0,0 +1,387 @@
+#ifndef __ASM_R8A7790_H__
+#define __ASM_R8A7790_H__
+
+/* Pin Function Controller:
+ * GPIO_FN_xx - GPIO used to select pin function
+ * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
+ */
+enum {
+       GPIO_GP_0_0, GPIO_GP_0_1, GPIO_GP_0_2, GPIO_GP_0_3,
+       GPIO_GP_0_4, GPIO_GP_0_5, GPIO_GP_0_6, GPIO_GP_0_7,
+       GPIO_GP_0_8, GPIO_GP_0_9, GPIO_GP_0_10, GPIO_GP_0_11,
+       GPIO_GP_0_12, GPIO_GP_0_13, GPIO_GP_0_14, GPIO_GP_0_15,
+       GPIO_GP_0_16, GPIO_GP_0_17, GPIO_GP_0_18, GPIO_GP_0_19,
+       GPIO_GP_0_20, GPIO_GP_0_21, GPIO_GP_0_22, GPIO_GP_0_23,
+       GPIO_GP_0_24, GPIO_GP_0_25, GPIO_GP_0_26, GPIO_GP_0_27,
+       GPIO_GP_0_28, GPIO_GP_0_29, GPIO_GP_0_30, GPIO_GP_0_31,
+
+       GPIO_GP_1_0, GPIO_GP_1_1, GPIO_GP_1_2, GPIO_GP_1_3,
+       GPIO_GP_1_4, GPIO_GP_1_5, GPIO_GP_1_6, GPIO_GP_1_7,
+       GPIO_GP_1_8, GPIO_GP_1_9, GPIO_GP_1_10, GPIO_GP_1_11,
+       GPIO_GP_1_12, GPIO_GP_1_13, GPIO_GP_1_14, GPIO_GP_1_15,
+       GPIO_GP_1_16, GPIO_GP_1_17, GPIO_GP_1_18, GPIO_GP_1_19,
+       GPIO_GP_1_20, GPIO_GP_1_21, GPIO_GP_1_22, GPIO_GP_1_23,
+       GPIO_GP_1_24, GPIO_GP_1_25, GPIO_GP_1_26, GPIO_GP_1_27,
+       GPIO_GP_1_28, GPIO_GP_1_29,
+
+       GPIO_GP_2_0, GPIO_GP_2_1, GPIO_GP_2_2, GPIO_GP_2_3,
+       GPIO_GP_2_4, GPIO_GP_2_5, GPIO_GP_2_6, GPIO_GP_2_7,
+       GPIO_GP_2_8, GPIO_GP_2_9, GPIO_GP_2_10, GPIO_GP_2_11,
+       GPIO_GP_2_12, GPIO_GP_2_13, GPIO_GP_2_14, GPIO_GP_2_15,
+       GPIO_GP_2_16, GPIO_GP_2_17, GPIO_GP_2_18, GPIO_GP_2_19,
+       GPIO_GP_2_20, GPIO_GP_2_21, GPIO_GP_2_22, GPIO_GP_2_23,
+       GPIO_GP_2_24, GPIO_GP_2_25, GPIO_GP_2_26, GPIO_GP_2_27,
+       GPIO_GP_2_28, GPIO_GP_2_29,
+
+       GPIO_GP_3_0, GPIO_GP_3_1, GPIO_GP_3_2, GPIO_GP_3_3,
+       GPIO_GP_3_4, GPIO_GP_3_5, GPIO_GP_3_6, GPIO_GP_3_7,
+       GPIO_GP_3_8, GPIO_GP_3_9, GPIO_GP_3_10, GPIO_GP_3_11,
+       GPIO_GP_3_12, GPIO_GP_3_13, GPIO_GP_3_14, GPIO_GP_3_15,
+       GPIO_GP_3_16, GPIO_GP_3_17, GPIO_GP_3_18, GPIO_GP_3_19,
+       GPIO_GP_3_20, GPIO_GP_3_21, GPIO_GP_3_22, GPIO_GP_3_23,
+       GPIO_GP_3_24, GPIO_GP_3_25, GPIO_GP_3_26, GPIO_GP_3_27,
+       GPIO_GP_3_28, GPIO_GP_3_29, GPIO_GP_3_30, GPIO_GP_3_31,
+
+       GPIO_GP_4_0, GPIO_GP_4_1, GPIO_GP_4_2, GPIO_GP_4_3,
+       GPIO_GP_4_4, GPIO_GP_4_5, GPIO_GP_4_6, GPIO_GP_4_7,
+       GPIO_GP_4_8, GPIO_GP_4_9, GPIO_GP_4_10, GPIO_GP_4_11,
+       GPIO_GP_4_12, GPIO_GP_4_13, GPIO_GP_4_14, GPIO_GP_4_15,
+       GPIO_GP_4_16, GPIO_GP_4_17, GPIO_GP_4_18, GPIO_GP_4_19,
+       GPIO_GP_4_20, GPIO_GP_4_21, GPIO_GP_4_22, GPIO_GP_4_23,
+       GPIO_GP_4_24, GPIO_GP_4_25, GPIO_GP_4_26, GPIO_GP_4_27,
+       GPIO_GP_4_28, GPIO_GP_4_29, GPIO_GP_4_30, GPIO_GP_4_31,
+
+       GPIO_GP_5_0, GPIO_GP_5_1, GPIO_GP_5_2, GPIO_GP_5_3,
+       GPIO_GP_5_4, GPIO_GP_5_5, GPIO_GP_5_6, GPIO_GP_5_7,
+       GPIO_GP_5_8, GPIO_GP_5_9, GPIO_GP_5_10, GPIO_GP_5_11,
+       GPIO_GP_5_12, GPIO_GP_5_13, GPIO_GP_5_14, GPIO_GP_5_15,
+       GPIO_GP_5_16, GPIO_GP_5_17, GPIO_GP_5_18, GPIO_GP_5_19,
+       GPIO_GP_5_20, GPIO_GP_5_21, GPIO_GP_5_22, GPIO_GP_5_23,
+       GPIO_GP_5_24, GPIO_GP_5_25, GPIO_GP_5_26, GPIO_GP_5_27,
+       GPIO_GP_5_28, GPIO_GP_5_29, GPIO_GP_5_30, GPIO_GP_5_31,
+
+       GPIO_FN_VI1_DATA7_VI1_B7, GPIO_FN_USB0_PWEN, GPIO_FN_USB0_OVC_VBUS,
+       GPIO_FN_USB2_PWEN, GPIO_FN_USB2_OVC, GPIO_FN_AVS1, GPIO_FN_AVS2,
+       GPIO_FN_DU_DOTCLKIN0, GPIO_FN_DU_DOTCLKIN2,
+
+       /* IPSR0 */
+       GPIO_FN_D1, GPIO_FN_MSIOF3_SYNC_B, GPIO_FN_VI3_DATA1, GPIO_FN_VI0_G5,
+       GPIO_FN_VI0_G5_B, GPIO_FN_D2, GPIO_FN_MSIOF3_RXD_B, GPIO_FN_VI3_DATA2,
+       GPIO_FN_VI0_G6, GPIO_FN_VI0_G6_B, GPIO_FN_D3, GPIO_FN_MSIOF3_TXD_B,
+       GPIO_FN_VI3_DATA3, GPIO_FN_VI0_G7, GPIO_FN_VI0_G7_B, GPIO_FN_D4,
+       GPIO_FN_SCIFB1_RXD_F, GPIO_FN_SCIFB0_RXD_C, GPIO_FN_VI3_DATA4,
+       GPIO_FN_VI0_R0, GPIO_FN_VI0_R0_B, GPIO_FN_RX0_B, GPIO_FN_D5,
+       GPIO_FN_SCIFB1_TXD_F, GPIO_FN_SCIFB0_TXD_C, GPIO_FN_VI3_DATA5,
+       GPIO_FN_VI0_R1, GPIO_FN_VI0_R1_B, GPIO_FN_TX0_B, GPIO_FN_D6,
+       GPIO_FN_SCL2_C, GPIO_FN_VI3_DATA6, GPIO_FN_VI0_R2, GPIO_FN_VI0_R2_B,
+       GPIO_FN_SCL2_CIS_C, GPIO_FN_D7, GPIO_FN_AD_DI_B, GPIO_FN_SDA2_C,
+       GPIO_FN_VI3_DATA7, GPIO_FN_VI0_R3, GPIO_FN_VI0_R3_B, GPIO_FN_SDA2_CIS_C,
+       GPIO_FN_D8, GPIO_FN_SCIFA1_SCK_C, GPIO_FN_AVB_TXD0, GPIO_FN_MII_TXD0,
+       GPIO_FN_VI0_G0, GPIO_FN_VI0_G0_B, GPIO_FN_VI2_DATA0_VI2_B0,
+
+       /* IPSR1 */
+       GPIO_FN_D9, GPIO_FN_SCIFA1_RXD_C, GPIO_FN_AVB_TXD1, GPIO_FN_MII_TXD1,
+       GPIO_FN_VI0_G1, GPIO_FN_VI0_G1_B, GPIO_FN_VI2_DATA1_VI2_B1, GPIO_FN_D10,
+       GPIO_FN_SCIFA1_TXD_C, GPIO_FN_AVB_TXD2, GPIO_FN_MII_TXD2,
+       GPIO_FN_VI0_G2, GPIO_FN_VI0_G2_B, GPIO_FN_VI2_DATA2_VI2_B2, GPIO_FN_D11,
+       GPIO_FN_SCIFA1_CTS_N_C, GPIO_FN_AVB_TXD3, GPIO_FN_MII_TXD3,
+       GPIO_FN_VI0_G3, GPIO_FN_VI0_G3_B, GPIO_FN_VI2_DATA3_VI2_B3,
+       GPIO_FN_D12, GPIO_FN_SCIFA1_RTS_N_C, GPIO_FN_AVB_TXD4,
+       GPIO_FN_VI0_HSYNC_N, GPIO_FN_VI0_HSYNC_N_B, GPIO_FN_VI2_DATA4_VI2_B4,
+       GPIO_FN_D13, GPIO_FN_AVB_TXD5, GPIO_FN_VI0_VSYNC_N,
+       GPIO_FN_VI0_VSYNC_N_B, GPIO_FN_VI2_DATA5_VI2_B5, GPIO_FN_D14,
+       GPIO_FN_SCIFB1_RXD_C, GPIO_FN_AVB_TXD6, GPIO_FN_RX1_B,
+       GPIO_FN_VI0_CLKENB, GPIO_FN_VI0_CLKENB_B, GPIO_FN_VI2_DATA6_VI2_B6,
+       GPIO_FN_D15, GPIO_FN_SCIFB1_TXD_C, GPIO_FN_AVB_TXD7, GPIO_FN_TX1_B,
+       GPIO_FN_VI0_FIELD, GPIO_FN_VI0_FIELD_B, GPIO_FN_VI2_DATA7_VI2_B7,
+       GPIO_FN_A0, GPIO_FN_PWM3, GPIO_FN_A1, GPIO_FN_PWM4,
+
+       /* IPSR2 */
+       GPIO_FN_A2, GPIO_FN_PWM5, GPIO_FN_MSIOF1_SS1_B, GPIO_FN_A3,
+       GPIO_FN_PWM6, GPIO_FN_MSIOF1_SS2_B, GPIO_FN_A4, GPIO_FN_MSIOF1_TXD_B,
+       GPIO_FN_TPU0TO0, GPIO_FN_A5, GPIO_FN_SCIFA1_TXD_B, GPIO_FN_TPU0TO1,
+       GPIO_FN_A6, GPIO_FN_SCIFA1_RTS_N_B, GPIO_FN_TPU0TO2, GPIO_FN_A7,
+       GPIO_FN_SCIFA1_SCK_B, GPIO_FN_AUDIO_CLKOUT_B, GPIO_FN_TPU0TO3,
+       GPIO_FN_A8, GPIO_FN_SCIFA1_RXD_B, GPIO_FN_SSI_SCK5_B, GPIO_FN_VI0_R4,
+       GPIO_FN_VI0_R4_B, GPIO_FN_SCIFB2_RXD_C, GPIO_FN_VI2_DATA0_VI2_B0_B,
+       GPIO_FN_A9, GPIO_FN_SCIFA1_CTS_N_B, GPIO_FN_SSI_WS5_B, GPIO_FN_VI0_R5,
+       GPIO_FN_VI0_R5_B, GPIO_FN_SCIFB2_TXD_C, GPIO_FN_VI2_DATA1_VI2_B1_B,
+       GPIO_FN_A10, GPIO_FN_SSI_SDATA5_B, GPIO_FN_MSIOF2_SYNC, GPIO_FN_VI0_R6,
+       GPIO_FN_VI0_R6_B, GPIO_FN_VI2_DATA2_VI2_B2_B,
+
+       /* IPSR3 */
+       GPIO_FN_A11, GPIO_FN_SCIFB2_CTS_N_B, GPIO_FN_MSIOF2_SCK, GPIO_FN_VI1_R0,
+       GPIO_FN_VI1_R0_B, GPIO_FN_VI2_G0, GPIO_FN_VI2_DATA3_VI2_B3_B,
+       GPIO_FN_A12, GPIO_FN_SCIFB2_RXD_B, GPIO_FN_MSIOF2_TXD, GPIO_FN_VI1_R1,
+       GPIO_FN_VI1_R1_B, GPIO_FN_VI2_G1, GPIO_FN_VI2_DATA4_VI2_B4_B,
+       GPIO_FN_A13, GPIO_FN_SCIFB2_RTS_N_B, GPIO_FN_EX_WAIT2,
+       GPIO_FN_MSIOF2_RXD, GPIO_FN_VI1_R2, GPIO_FN_VI1_R2_B, GPIO_FN_VI2_G2,
+       GPIO_FN_VI2_DATA5_VI2_B5_B, GPIO_FN_A14, GPIO_FN_SCIFB2_TXD_B,
+       GPIO_FN_ATACS11_N, GPIO_FN_MSIOF2_SS1, GPIO_FN_A15,
+       GPIO_FN_SCIFB2_SCK_B, GPIO_FN_ATARD1_N, GPIO_FN_MSIOF2_SS2, GPIO_FN_A16,
+       GPIO_FN_ATAWR1_N, GPIO_FN_A17, GPIO_FN_AD_DO_B, GPIO_FN_ATADIR1_N,
+       GPIO_FN_A18, GPIO_FN_AD_CLK_B, GPIO_FN_ATAG1_N, GPIO_FN_A19,
+       GPIO_FN_AD_NCS_N_B, GPIO_FN_ATACS01_N, GPIO_FN_EX_WAIT0_B, GPIO_FN_A20,
+       GPIO_FN_SPCLK, GPIO_FN_VI1_R3, GPIO_FN_VI1_R3_B, GPIO_FN_VI2_G4,
+
+       /* IPSR4 */
+       GPIO_FN_A21, GPIO_FN_MOSI_IO0, GPIO_FN_VI1_R4, GPIO_FN_VI1_R4_B,
+       GPIO_FN_VI2_G5, GPIO_FN_A22, GPIO_FN_MISO_IO1, GPIO_FN_VI1_R5,
+       GPIO_FN_VI1_R5_B, GPIO_FN_VI2_G6, GPIO_FN_A23, GPIO_FN_IO2,
+       GPIO_FN_VI1_G7, GPIO_FN_VI1_G7_B, GPIO_FN_VI2_G7, GPIO_FN_A24,
+       GPIO_FN_IO3, GPIO_FN_VI1_R7, GPIO_FN_VI1_R7_B, GPIO_FN_VI2_CLKENB,
+       GPIO_FN_VI2_CLKENB_B, GPIO_FN_A25, GPIO_FN_SSL, GPIO_FN_VI1_G6,
+       GPIO_FN_VI1_G6_B, GPIO_FN_VI2_FIELD, GPIO_FN_VI2_FIELD_B, GPIO_FN_CS0_N,
+       GPIO_FN_VI1_R6, GPIO_FN_VI1_R6_B, GPIO_FN_VI2_G3, GPIO_FN_MSIOF0_SS2_B,
+       GPIO_FN_CS1_N_A26, GPIO_FN_SPEEDIN, GPIO_FN_VI0_R7, GPIO_FN_VI0_R7_B,
+       GPIO_FN_VI2_CLK, GPIO_FN_VI2_CLK_B, GPIO_FN_EX_CS0_N, GPIO_FN_HRX1_B,
+       GPIO_FN_VI1_G5, GPIO_FN_VI1_G5_B, GPIO_FN_VI2_R0, GPIO_FN_HTX0_B,
+       GPIO_FN_MSIOF0_SS1_B, GPIO_FN_EX_CS1_N, GPIO_FN_GPS_CLK,
+       GPIO_FN_HCTS1_N_B, GPIO_FN_VI1_FIELD, GPIO_FN_VI1_FIELD_B,
+       GPIO_FN_VI2_R1, GPIO_FN_EX_CS2_N, GPIO_FN_GPS_SIGN, GPIO_FN_HRTS1_N_B,
+       GPIO_FN_VI3_CLKENB, GPIO_FN_VI1_G0, GPIO_FN_VI1_G0_B, GPIO_FN_VI2_R2,
+
+       /* IPSR5 */
+       GPIO_FN_EX_CS3_N, GPIO_FN_GPS_MAG, GPIO_FN_VI3_FIELD, GPIO_FN_VI1_G1,
+       GPIO_FN_VI1_G1_B, GPIO_FN_VI2_R3, GPIO_FN_EX_CS4_N,
+       GPIO_FN_MSIOF1_SCK_B, GPIO_FN_VI3_HSYNC_N,
+       GPIO_FN_VI2_HSYNC_N, GPIO_FN_SCL1, GPIO_FN_VI2_HSYNC_N_B,
+       GPIO_FN_INTC_EN0_N, GPIO_FN_SCL1_CIS, GPIO_FN_EX_CS5_N, GPIO_FN_CAN0_RX,
+       GPIO_FN_MSIOF1_RXD_B, GPIO_FN_VI3_VSYNC_N, GPIO_FN_VI1_G2,
+       GPIO_FN_VI1_G2_B, GPIO_FN_VI2_R4, GPIO_FN_SDA1, GPIO_FN_INTC_EN1_N,
+       GPIO_FN_SDA1_CIS, GPIO_FN_BS_N, GPIO_FN_IETX, GPIO_FN_HTX1_B,
+       GPIO_FN_CAN1_TX, GPIO_FN_DRACK0, GPIO_FN_IETX_C, GPIO_FN_RD_N,
+       GPIO_FN_CAN0_TX, GPIO_FN_SCIFA0_SCK_B, GPIO_FN_RD_WR_N, GPIO_FN_VI1_G3,
+       GPIO_FN_VI1_G3_B, GPIO_FN_VI2_R5, GPIO_FN_SCIFA0_RXD_B,
+       GPIO_FN_INTC_IRQ4_N, GPIO_FN_WE0_N, GPIO_FN_IECLK, GPIO_FN_CAN_CLK,
+       GPIO_FN_VI2_VSYNC_N, GPIO_FN_SCIFA0_TXD_B, GPIO_FN_VI2_VSYNC_N_B,
+       GPIO_FN_WE1_N, GPIO_FN_IERX, GPIO_FN_CAN1_RX, GPIO_FN_VI1_G4,
+       GPIO_FN_VI1_G4_B, GPIO_FN_VI2_R6, GPIO_FN_SCIFA0_CTS_N_B,
+       GPIO_FN_IERX_C, GPIO_FN_EX_WAIT0, GPIO_FN_IRQ3, GPIO_FN_INTC_IRQ3_N,
+       GPIO_FN_VI3_CLK, GPIO_FN_SCIFA0_RTS_N_B, GPIO_FN_HRX0_B,
+       GPIO_FN_MSIOF0_SCK_B, GPIO_FN_DREQ0_N, GPIO_FN_VI1_HSYNC_N,
+       GPIO_FN_VI1_HSYNC_N_B, GPIO_FN_VI2_R7, GPIO_FN_SSI_SCK78_C,
+       GPIO_FN_SSI_WS78_B,
+
+       /* IPSR6 */
+       GPIO_FN_DACK0, GPIO_FN_IRQ0, GPIO_FN_INTC_IRQ0_N, GPIO_FN_SSI_SCK6_B,
+       GPIO_FN_VI1_VSYNC_N, GPIO_FN_VI1_VSYNC_N_B, GPIO_FN_SSI_WS78_C,
+       GPIO_FN_DREQ1_N, GPIO_FN_VI1_CLKENB, GPIO_FN_VI1_CLKENB_B,
+       GPIO_FN_SSI_SDATA7_C, GPIO_FN_SSI_SCK78_B, GPIO_FN_DACK1, GPIO_FN_IRQ1,
+       GPIO_FN_INTC_IRQ1_N, GPIO_FN_SSI_WS6_B, GPIO_FN_SSI_SDATA8_C,
+       GPIO_FN_DREQ2_N, GPIO_FN_HSCK1_B, GPIO_FN_HCTS0_N_B,
+       GPIO_FN_MSIOF0_TXD_B, GPIO_FN_DACK2, GPIO_FN_IRQ2, GPIO_FN_INTC_IRQ2_N,
+       GPIO_FN_SSI_SDATA6_B, GPIO_FN_HRTS0_N_B, GPIO_FN_MSIOF0_RXD_B,
+       GPIO_FN_ETH_CRS_DV, GPIO_FN_RMII_CRS_DV, GPIO_FN_STP_ISCLK_0_B,
+       GPIO_FN_TS_SDEN0_D, GPIO_FN_GLO_Q0_C, GPIO_FN_SCL2_E,
+       GPIO_FN_SCL2_CIS_E, GPIO_FN_ETH_RX_ER, GPIO_FN_RMII_RX_ER,
+       GPIO_FN_STP_ISD_0_B, GPIO_FN_TS_SPSYNC0_D, GPIO_FN_GLO_Q1_C,
+       GPIO_FN_SDA2_E, GPIO_FN_SDA2_CIS_E, GPIO_FN_ETH_RXD0, GPIO_FN_RMII_RXD0,
+       GPIO_FN_STP_ISEN_0_B, GPIO_FN_TS_SDAT0_D, GPIO_FN_GLO_I0_C,
+       GPIO_FN_SCIFB1_SCK_G, GPIO_FN_SCK1_E, GPIO_FN_ETH_RXD1,
+       GPIO_FN_RMII_RXD1, GPIO_FN_HRX0_E, GPIO_FN_STP_ISSYNC_0_B,
+       GPIO_FN_TS_SCK0_D, GPIO_FN_GLO_I1_C, GPIO_FN_SCIFB1_RXD_G,
+       GPIO_FN_RX1_E, GPIO_FN_ETH_LINK, GPIO_FN_RMII_LINK, GPIO_FN_HTX0_E,
+       GPIO_FN_STP_IVCXO27_0_B, GPIO_FN_SCIFB1_TXD_G, GPIO_FN_TX1_E,
+       GPIO_FN_ETH_REF_CLK, GPIO_FN_RMII_REF_CLK, GPIO_FN_HCTS0_N_E,
+       GPIO_FN_STP_IVCXO27_1_B, GPIO_FN_HRX0_F,
+
+       /* IPSR7 */
+       GPIO_FN_ETH_MDIO, GPIO_FN_RMII_MDIO, GPIO_FN_HRTS0_N_E,
+       GPIO_FN_SIM0_D_C, GPIO_FN_HCTS0_N_F, GPIO_FN_ETH_TXD1,
+       GPIO_FN_RMII_TXD1, GPIO_FN_HTX0_F, GPIO_FN_BPFCLK_G, GPIO_FN_RDS_CLK_F,
+       GPIO_FN_ETH_TX_EN, GPIO_FN_RMII_TX_EN, GPIO_FN_SIM0_CLK_C,
+       GPIO_FN_HRTS0_N_F, GPIO_FN_ETH_MAGIC, GPIO_FN_RMII_MAGIC,
+       GPIO_FN_SIM0_RST_C, GPIO_FN_ETH_TXD0, GPIO_FN_RMII_TXD0,
+       GPIO_FN_STP_ISCLK_1_B, GPIO_FN_TS_SDEN1_C, GPIO_FN_GLO_SCLK_C,
+       GPIO_FN_ETH_MDC, GPIO_FN_RMII_MDC, GPIO_FN_STP_ISD_1_B,
+       GPIO_FN_TS_SPSYNC1_C, GPIO_FN_GLO_SDATA_C, GPIO_FN_PWM0,
+       GPIO_FN_SCIFA2_SCK_C, GPIO_FN_STP_ISEN_1_B, GPIO_FN_TS_SDAT1_C,
+       GPIO_FN_GLO_SS_C, GPIO_FN_PWM1, GPIO_FN_SCIFA2_TXD_C,
+       GPIO_FN_STP_ISSYNC_1_B, GPIO_FN_TS_SCK1_C, GPIO_FN_GLO_RFON_C,
+       GPIO_FN_PCMOE_N, GPIO_FN_PWM2, GPIO_FN_PWMFSW0, GPIO_FN_SCIFA2_RXD_C,
+       GPIO_FN_PCMWE_N, GPIO_FN_IECLK_C, GPIO_FN_DU1_DOTCLKIN,
+       GPIO_FN_AUDIO_CLKC, GPIO_FN_AUDIO_CLKOUT_C, GPIO_FN_VI0_CLK,
+       GPIO_FN_ATACS00_N, GPIO_FN_AVB_RXD1, GPIO_FN_MII_RXD1,
+       GPIO_FN_VI0_DATA0_VI0_B0, GPIO_FN_ATACS10_N, GPIO_FN_AVB_RXD2,
+       GPIO_FN_MII_RXD2,
+
+       /* IPSR8 */
+       GPIO_FN_VI0_DATA1_VI0_B1, GPIO_FN_ATARD0_N, GPIO_FN_AVB_RXD3,
+       GPIO_FN_MII_RXD3, GPIO_FN_VI0_DATA2_VI0_B2, GPIO_FN_ATAWR0_N,
+       GPIO_FN_AVB_RXD4, GPIO_FN_VI0_DATA3_VI0_B3, GPIO_FN_ATADIR0_N,
+       GPIO_FN_AVB_RXD5, GPIO_FN_VI0_DATA4_VI0_B4, GPIO_FN_ATAG0_N,
+       GPIO_FN_AVB_RXD6, GPIO_FN_VI0_DATA5_VI0_B5, GPIO_FN_EX_WAIT1,
+       GPIO_FN_AVB_RXD7, GPIO_FN_VI0_DATA6_VI0_B6, GPIO_FN_AVB_RX_ER,
+       GPIO_FN_MII_RX_ER, GPIO_FN_VI0_DATA7_VI0_B7, GPIO_FN_AVB_RX_CLK,
+       GPIO_FN_MII_RX_CLK, GPIO_FN_VI1_CLK, GPIO_FN_AVB_RX_DV,
+       GPIO_FN_MII_RX_DV, GPIO_FN_VI1_DATA0_VI1_B0, GPIO_FN_SCIFA1_SCK_D,
+       GPIO_FN_AVB_CRS, GPIO_FN_MII_CRS, GPIO_FN_VI1_DATA1_VI1_B1,
+       GPIO_FN_SCIFA1_RXD_D, GPIO_FN_AVB_MDC, GPIO_FN_MII_MDC,
+       GPIO_FN_VI1_DATA2_VI1_B2, GPIO_FN_SCIFA1_TXD_D, GPIO_FN_AVB_MDIO,
+       GPIO_FN_MII_MDIO, GPIO_FN_VI1_DATA3_VI1_B3, GPIO_FN_SCIFA1_CTS_N_D,
+       GPIO_FN_AVB_GTX_CLK, GPIO_FN_VI1_DATA4_VI1_B4, GPIO_FN_SCIFA1_RTS_N_D,
+       GPIO_FN_AVB_MAGIC, GPIO_FN_MII_MAGIC, GPIO_FN_VI1_DATA5_VI1_B5,
+       GPIO_FN_AVB_PHY_INT, GPIO_FN_VI1_DATA6_VI1_B6, GPIO_FN_AVB_GTXREFCLK,
+       GPIO_FN_SD0_CLK, GPIO_FN_VI1_DATA0_VI1_B0_B, GPIO_FN_SD0_CMD,
+       GPIO_FN_SCIFB1_SCK_B, GPIO_FN_VI1_DATA1_VI1_B1_B,
+
+       /* IPSR9 */
+       GPIO_FN_SD0_DAT0, GPIO_FN_SCIFB1_RXD_B, GPIO_FN_VI1_DATA2_VI1_B2_B,
+       GPIO_FN_SD0_DAT1, GPIO_FN_SCIFB1_TXD_B, GPIO_FN_VI1_DATA3_VI1_B3_B,
+       GPIO_FN_SD0_DAT2, GPIO_FN_SCIFB1_CTS_N_B, GPIO_FN_VI1_DATA4_VI1_B4_B,
+       GPIO_FN_SD0_DAT3, GPIO_FN_SCIFB1_RTS_N_B, GPIO_FN_VI1_DATA5_VI1_B5_B,
+       GPIO_FN_SD0_CD, GPIO_FN_MMC0_D6, GPIO_FN_TS_SDEN0_B, GPIO_FN_USB0_EXTP,
+       GPIO_FN_GLO_SCLK, GPIO_FN_VI1_DATA6_VI1_B6_B, GPIO_FN_SCL1_B,
+       GPIO_FN_SCL1_CIS_B, GPIO_FN_VI2_DATA6_VI2_B6_B, GPIO_FN_SD0_WP,
+       GPIO_FN_MMC0_D7, GPIO_FN_TS_SPSYNC0_B, GPIO_FN_USB0_IDIN,
+       GPIO_FN_GLO_SDATA, GPIO_FN_VI1_DATA7_VI1_B7_B, GPIO_FN_SDA1_B,
+       GPIO_FN_SDA1_CIS_B, GPIO_FN_VI2_DATA7_VI2_B7_B, GPIO_FN_SD1_CLK,
+       GPIO_FN_AVB_TX_EN, GPIO_FN_MII_TX_EN, GPIO_FN_SD1_CMD,
+       GPIO_FN_AVB_TX_ER, GPIO_FN_MII_TX_ER, GPIO_FN_SCIFB0_SCK_B,
+       GPIO_FN_SD1_DAT0, GPIO_FN_AVB_TX_CLK, GPIO_FN_MII_TX_CLK,
+       GPIO_FN_SCIFB0_RXD_B, GPIO_FN_SD1_DAT1, GPIO_FN_AVB_LINK,
+       GPIO_FN_MII_LINK, GPIO_FN_SCIFB0_TXD_B, GPIO_FN_SD1_DAT2,
+       GPIO_FN_AVB_COL, GPIO_FN_MII_COL, GPIO_FN_SCIFB0_CTS_N_B,
+       GPIO_FN_SD1_DAT3, GPIO_FN_AVB_RXD0, GPIO_FN_MII_RXD0,
+       GPIO_FN_SCIFB0_RTS_N_B, GPIO_FN_SD1_CD, GPIO_FN_MMC1_D6,
+       GPIO_FN_TS_SDEN1, GPIO_FN_USB1_EXTP, GPIO_FN_GLO_SS, GPIO_FN_VI0_CLK_B,
+       GPIO_FN_SCL2_D, GPIO_FN_SCL2_CIS_D, GPIO_FN_SIM0_CLK_B,
+       GPIO_FN_VI3_CLK_B,
+
+       /* IPSR10 */
+       GPIO_FN_SD1_WP, GPIO_FN_MMC1_D7, GPIO_FN_TS_SPSYNC1, GPIO_FN_USB1_IDIN,
+       GPIO_FN_GLO_RFON, GPIO_FN_VI1_CLK_B, GPIO_FN_SDA2_D, GPIO_FN_SDA2_CIS_D,
+       GPIO_FN_SIM0_D_B, GPIO_FN_SD2_CLK, GPIO_FN_MMC0_CLK, GPIO_FN_SIM0_CLK,
+       GPIO_FN_VI0_DATA0_VI0_B0_B, GPIO_FN_TS_SDEN0_C, GPIO_FN_GLO_SCLK_B,
+       GPIO_FN_VI3_DATA0_B, GPIO_FN_SD2_CMD, GPIO_FN_MMC0_CMD, GPIO_FN_SIM0_D,
+       GPIO_FN_VI0_DATA1_VI0_B1_B, GPIO_FN_SCIFB1_SCK_E, GPIO_FN_SCK1_D,
+       GPIO_FN_TS_SPSYNC0_C, GPIO_FN_GLO_SDATA_B, GPIO_FN_VI3_DATA1_B,
+       GPIO_FN_SD2_DAT0, GPIO_FN_MMC0_D0, GPIO_FN_FMCLK_B,
+       GPIO_FN_VI0_DATA2_VI0_B2_B, GPIO_FN_SCIFB1_RXD_E, GPIO_FN_RX1_D,
+       GPIO_FN_TS_SDAT0_C, GPIO_FN_GLO_SS_B, GPIO_FN_VI3_DATA2_B,
+       GPIO_FN_SD2_DAT1, GPIO_FN_MMC0_D1, GPIO_FN_FMIN_B, GPIO_FN_RDS_DATA,
+       GPIO_FN_VI0_DATA3_VI0_B3_B, GPIO_FN_SCIFB1_TXD_E, GPIO_FN_TX1_D,
+       GPIO_FN_TS_SCK0_C, GPIO_FN_GLO_RFON_B, GPIO_FN_VI3_DATA3_B,
+       GPIO_FN_SD2_DAT2, GPIO_FN_MMC0_D2, GPIO_FN_BPFCLK_B, GPIO_FN_RDS_CLK,
+       GPIO_FN_VI0_DATA4_VI0_B4_B, GPIO_FN_HRX0_D, GPIO_FN_TS_SDEN1_B,
+       GPIO_FN_GLO_Q0_B, GPIO_FN_VI3_DATA4_B, GPIO_FN_SD2_DAT3,
+       GPIO_FN_MMC0_D3, GPIO_FN_SIM0_RST, GPIO_FN_VI0_DATA5_VI0_B5_B,
+       GPIO_FN_HTX0_D, GPIO_FN_TS_SPSYNC1_B, GPIO_FN_GLO_Q1_B,
+       GPIO_FN_VI3_DATA5_B, GPIO_FN_SD2_CD, GPIO_FN_MMC0_D4,
+       GPIO_FN_TS_SDAT0_B, GPIO_FN_USB2_EXTP, GPIO_FN_GLO_I0,
+       GPIO_FN_VI0_DATA6_VI0_B6_B, GPIO_FN_HCTS0_N_D, GPIO_FN_TS_SDAT1_B,
+       GPIO_FN_GLO_I0_B, GPIO_FN_VI3_DATA6_B,
+
+       /* IPSR11 */
+       GPIO_FN_SD2_WP, GPIO_FN_MMC0_D5, GPIO_FN_TS_SCK0_B, GPIO_FN_USB2_IDIN,
+       GPIO_FN_GLO_I1, GPIO_FN_VI0_DATA7_VI0_B7_B, GPIO_FN_HRTS0_N_D,
+       GPIO_FN_TS_SCK1_B, GPIO_FN_GLO_I1_B, GPIO_FN_VI3_DATA7_B,
+       GPIO_FN_SD3_CLK, GPIO_FN_MMC1_CLK, GPIO_FN_SD3_CMD, GPIO_FN_MMC1_CMD,
+       GPIO_FN_MTS_N, GPIO_FN_SD3_DAT0, GPIO_FN_MMC1_D0, GPIO_FN_STM_N,
+       GPIO_FN_SD3_DAT1, GPIO_FN_MMC1_D1, GPIO_FN_MDATA, GPIO_FN_SD3_DAT2,
+       GPIO_FN_MMC1_D2, GPIO_FN_SDATA, GPIO_FN_SD3_DAT3, GPIO_FN_MMC1_D3,
+       GPIO_FN_SCKZ, GPIO_FN_SD3_CD, GPIO_FN_MMC1_D4, GPIO_FN_TS_SDAT1,
+       GPIO_FN_VSP, GPIO_FN_GLO_Q0, GPIO_FN_SIM0_RST_B, GPIO_FN_SD3_WP,
+       GPIO_FN_MMC1_D5, GPIO_FN_TS_SCK1, GPIO_FN_GLO_Q1, GPIO_FN_FMIN_C,
+       GPIO_FN_RDS_DATA_B, GPIO_FN_FMIN_E, GPIO_FN_RDS_DATA_D, GPIO_FN_FMIN_F,
+       GPIO_FN_RDS_DATA_E, GPIO_FN_MLB_CLK, GPIO_FN_SCL2_B, GPIO_FN_SCL2_CIS_B,
+       GPIO_FN_MLB_SIG, GPIO_FN_SCIFB1_RXD_D, GPIO_FN_RX1_C, GPIO_FN_SDA2_B,
+       GPIO_FN_SDA2_CIS_B, GPIO_FN_MLB_DAT, GPIO_FN_SPV_EVEN,
+       GPIO_FN_SCIFB1_TXD_D, GPIO_FN_TX1_C, GPIO_FN_BPFCLK_C,
+       GPIO_FN_RDS_CLK_B, GPIO_FN_SSI_SCK0129, GPIO_FN_CAN_CLK_B,
+       GPIO_FN_MOUT0,
+
+       /* IPSR12 */
+       GPIO_FN_SSI_WS0129, GPIO_FN_CAN0_TX_B, GPIO_FN_MOUT1,
+       GPIO_FN_SSI_SDATA0, GPIO_FN_CAN0_RX_B, GPIO_FN_MOUT2,
+       GPIO_FN_SSI_SDATA1, GPIO_FN_CAN1_TX_B, GPIO_FN_MOUT5,
+       GPIO_FN_SSI_SDATA2, GPIO_FN_CAN1_RX_B, GPIO_FN_SSI_SCK1, GPIO_FN_MOUT6,
+       GPIO_FN_SSI_SCK34, GPIO_FN_STP_OPWM_0, GPIO_FN_SCIFB0_SCK,
+       GPIO_FN_MSIOF1_SCK, GPIO_FN_CAN_DEBUG_HW_TRIGGER, GPIO_FN_SSI_WS34,
+       GPIO_FN_STP_IVCXO27_0, GPIO_FN_SCIFB0_RXD, GPIO_FN_MSIOF1_SYNC,
+       GPIO_FN_CAN_STEP0, GPIO_FN_SSI_SDATA3, GPIO_FN_STP_ISCLK_0,
+       GPIO_FN_SCIFB0_TXD, GPIO_FN_MSIOF1_SS1, GPIO_FN_CAN_TXCLK,
+       GPIO_FN_SSI_SCK4, GPIO_FN_STP_ISD_0, GPIO_FN_SCIFB0_CTS_N,
+       GPIO_FN_MSIOF1_SS2, GPIO_FN_SSI_SCK5_C, GPIO_FN_CAN_DEBUGOUT0,
+       GPIO_FN_SSI_WS4, GPIO_FN_STP_ISEN_0, GPIO_FN_SCIFB0_RTS_N,
+       GPIO_FN_MSIOF1_TXD, GPIO_FN_SSI_WS5_C, GPIO_FN_CAN_DEBUGOUT1,
+       GPIO_FN_SSI_SDATA4, GPIO_FN_STP_ISSYNC_0, GPIO_FN_MSIOF1_RXD,
+       GPIO_FN_CAN_DEBUGOUT2, GPIO_FN_SSI_SCK5, GPIO_FN_SCIFB1_SCK,
+       GPIO_FN_IERX_B, GPIO_FN_DU2_EXHSYNC_DU2_HSYNC, GPIO_FN_QSTH_QHS,
+       GPIO_FN_CAN_DEBUGOUT3, GPIO_FN_SSI_WS5, GPIO_FN_SCIFB1_RXD,
+       GPIO_FN_IECLK_B, GPIO_FN_DU2_EXVSYNC_DU2_VSYNC, GPIO_FN_QSTB_QHE,
+       GPIO_FN_CAN_DEBUGOUT4,
+
+       /* IPSR13 */
+       GPIO_FN_SSI_SDATA5, GPIO_FN_SCIFB1_TXD, GPIO_FN_IETX_B, GPIO_FN_DU2_DR2,
+       GPIO_FN_LCDOUT2, GPIO_FN_CAN_DEBUGOUT5, GPIO_FN_SSI_SCK6,
+       GPIO_FN_SCIFB1_CTS_N, GPIO_FN_BPFCLK_D, GPIO_FN_RDS_CLK_C,
+       GPIO_FN_DU2_DR3, GPIO_FN_LCDOUT3, GPIO_FN_CAN_DEBUGOUT6,
+       GPIO_FN_BPFCLK_F, GPIO_FN_RDS_CLK_E, GPIO_FN_SSI_WS6,
+       GPIO_FN_SCIFB1_RTS_N, GPIO_FN_CAN0_TX_D, GPIO_FN_DU2_DR4,
+       GPIO_FN_LCDOUT4, GPIO_FN_CAN_DEBUGOUT7, GPIO_FN_SSI_SDATA6,
+       GPIO_FN_FMIN_D, GPIO_FN_RDS_DATA_C, GPIO_FN_DU2_DR5, GPIO_FN_LCDOUT5,
+       GPIO_FN_CAN_DEBUGOUT8, GPIO_FN_SSI_SCK78, GPIO_FN_STP_IVCXO27_1,
+       GPIO_FN_SCK1, GPIO_FN_SCIFA1_SCK, GPIO_FN_DU2_DR6, GPIO_FN_LCDOUT6,
+       GPIO_FN_CAN_DEBUGOUT9, GPIO_FN_SSI_WS78, GPIO_FN_STP_ISCLK_1,
+       GPIO_FN_SCIFB2_SCK, GPIO_FN_SCIFA2_CTS_N, GPIO_FN_DU2_DR7,
+       GPIO_FN_LCDOUT7, GPIO_FN_CAN_DEBUGOUT10, GPIO_FN_SSI_SDATA7,
+       GPIO_FN_STP_ISD_1, GPIO_FN_SCIFB2_RXD, GPIO_FN_SCIFA2_RTS_N,
+       GPIO_FN_TCLK2, GPIO_FN_QSTVA_QVS, GPIO_FN_CAN_DEBUGOUT11,
+       GPIO_FN_BPFCLK_E, GPIO_FN_RDS_CLK_D, GPIO_FN_SSI_SDATA7_B,
+       GPIO_FN_FMIN_G, GPIO_FN_RDS_DATA_F, GPIO_FN_SSI_SDATA8,
+       GPIO_FN_STP_ISEN_1, GPIO_FN_SCIFB2_TXD, GPIO_FN_CAN0_TX_C,
+       GPIO_FN_CAN_DEBUGOUT12, GPIO_FN_SSI_SDATA8_B, GPIO_FN_SSI_SDATA9,
+       GPIO_FN_STP_ISSYNC_1, GPIO_FN_SCIFB2_CTS_N, GPIO_FN_SSI_WS1,
+       GPIO_FN_SSI_SDATA5_C, GPIO_FN_CAN_DEBUGOUT13, GPIO_FN_AUDIO_CLKA,
+       GPIO_FN_SCIFB2_RTS_N, GPIO_FN_CAN_DEBUGOUT14,
+
+       /* IPSR14 */
+       GPIO_FN_AUDIO_CLKB, GPIO_FN_SCIF_CLK, GPIO_FN_CAN0_RX_D,
+       GPIO_FN_DVC_MUTE, GPIO_FN_CAN0_RX_C, GPIO_FN_CAN_DEBUGOUT15,
+       GPIO_FN_REMOCON, GPIO_FN_SCIFA0_SCK, GPIO_FN_HSCK1, GPIO_FN_SCK0,
+       GPIO_FN_MSIOF3_SS2, GPIO_FN_DU2_DG2, GPIO_FN_LCDOUT10, GPIO_FN_SDA1_C,
+       GPIO_FN_SDA1_CIS_C, GPIO_FN_SCIFA0_RXD, GPIO_FN_HRX1, GPIO_FN_RX0,
+       GPIO_FN_DU2_DR0, GPIO_FN_LCDOUT0, GPIO_FN_SCIFA0_TXD, GPIO_FN_HTX1,
+       GPIO_FN_TX0, GPIO_FN_DU2_DR1, GPIO_FN_LCDOUT1, GPIO_FN_SCIFA0_CTS_N,
+       GPIO_FN_HCTS1_N, GPIO_FN_CTS0_N, GPIO_FN_MSIOF3_SYNC, GPIO_FN_DU2_DG3,
+       GPIO_FN_LCDOUT11, GPIO_FN_PWM0_B, GPIO_FN_SCL1_C, GPIO_FN_SCL1_CIS_C,
+       GPIO_FN_SCIFA0_RTS_N, GPIO_FN_HRTS1_N, GPIO_FN_RTS0_N_TANS,
+       GPIO_FN_MSIOF3_SS1, GPIO_FN_DU2_DG0, GPIO_FN_LCDOUT8, GPIO_FN_PWM1_B,
+       GPIO_FN_SCIFA1_RXD, GPIO_FN_AD_DI, GPIO_FN_RX1,
+       GPIO_FN_DU2_EXODDF_DU2_ODDF_DISP_CDE, GPIO_FN_QCPV_QDE,
+       GPIO_FN_SCIFA1_TXD, GPIO_FN_AD_DO, GPIO_FN_TX1, GPIO_FN_DU2_DG1,
+       GPIO_FN_LCDOUT9, GPIO_FN_SCIFA1_CTS_N, GPIO_FN_AD_CLK,
+       GPIO_FN_CTS1_N, GPIO_FN_MSIOF3_RXD, GPIO_FN_DU0_DOTCLKOUT, GPIO_FN_QCLK,
+       GPIO_FN_SCIFA1_RTS_N, GPIO_FN_AD_NCS_N, GPIO_FN_RTS1_N_TANS,
+       GPIO_FN_MSIOF3_TXD, GPIO_FN_DU1_DOTCLKOUT, GPIO_FN_QSTVB_QVE,
+       GPIO_FN_HRTS0_N_C,
+
+       /* IPSR15 */
+       GPIO_FN_SCIFA2_SCK, GPIO_FN_FMCLK, GPIO_FN_MSIOF3_SCK, GPIO_FN_DU2_DG7,
+       GPIO_FN_LCDOUT15, GPIO_FN_SCIF_CLK_B, GPIO_FN_SCIFA2_RXD, GPIO_FN_FMIN,
+       GPIO_FN_DU2_DB0, GPIO_FN_LCDOUT16, GPIO_FN_SCL2, GPIO_FN_SCL2_CIS,
+       GPIO_FN_SCIFA2_TXD, GPIO_FN_BPFCLK, GPIO_FN_DU2_DB1, GPIO_FN_LCDOUT17,
+       GPIO_FN_SDA2, GPIO_FN_SDA2_CIS, GPIO_FN_HSCK0, GPIO_FN_TS_SDEN0,
+       GPIO_FN_DU2_DG4, GPIO_FN_LCDOUT12, GPIO_FN_HCTS0_N_C, GPIO_FN_HRX0,
+       GPIO_FN_DU2_DB2, GPIO_FN_LCDOUT18, GPIO_FN_HTX0, GPIO_FN_DU2_DB3,
+       GPIO_FN_LCDOUT19, GPIO_FN_HCTS0_N, GPIO_FN_SSI_SCK9, GPIO_FN_DU2_DB4,
+       GPIO_FN_LCDOUT20, GPIO_FN_HRTS0_N, GPIO_FN_SSI_WS9, GPIO_FN_DU2_DB5,
+       GPIO_FN_LCDOUT21, GPIO_FN_MSIOF0_SCK, GPIO_FN_TS_SDAT0, GPIO_FN_ADICLK,
+       GPIO_FN_DU2_DB6, GPIO_FN_LCDOUT22, GPIO_FN_MSIOF0_SYNC, GPIO_FN_TS_SCK0,
+       GPIO_FN_SSI_SCK2, GPIO_FN_ADIDATA, GPIO_FN_DU2_DB7, GPIO_FN_LCDOUT23,
+       GPIO_FN_SCIFA2_RXD_B, GPIO_FN_MSIOF0_SS1, GPIO_FN_ADICHS0,
+       GPIO_FN_DU2_DG5, GPIO_FN_LCDOUT13, GPIO_FN_MSIOF0_TXD, GPIO_FN_ADICHS1,
+       GPIO_FN_DU2_DG6, GPIO_FN_LCDOUT14,
+
+       /* IPSR16 */
+       GPIO_FN_MSIOF0_SS2, GPIO_FN_AUDIO_CLKOUT, GPIO_FN_ADICHS2,
+       GPIO_FN_DU2_DISP, GPIO_FN_QPOLA, GPIO_FN_HTX0_C, GPIO_FN_SCIFA2_TXD_B,
+       GPIO_FN_MSIOF0_RXD, GPIO_FN_TS_SPSYNC0, GPIO_FN_SSI_WS2,
+       GPIO_FN_ADICS_SAMP, GPIO_FN_DU2_CDE, GPIO_FN_QPOLB, GPIO_FN_HRX0_C,
+       GPIO_FN_USB1_PWEN, GPIO_FN_AUDIO_CLKOUT_D, GPIO_FN_USB1_OVC,
+       GPIO_FN_TCLK1_B,
+};
+
+#endif /* __ASM_R8A7790_H__ */
diff --git a/arch/arm/include/asm/arch-rmobile/r8a7790.h b/arch/arm/include/asm/arch-rmobile/r8a7790.h
new file mode 100644 (file)
index 0000000..42d65d3
--- /dev/null
@@ -0,0 +1,614 @@
+/*
+ * arch/arm/include/asm/arch-rmobile/r8a7790.h
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __ASM_ARCH_R8A7790_H
+#define __ASM_ARCH_R8A7790_H
+
+/*
+ * R8A7790 I/O Addresses
+ */
+#define        RWDT_BASE               0xE6020000
+#define        SWDT_BASE               0xE6030000
+#define        LBSC_BASE               0xFEC00200
+#define DBSC3_0_BASE           0xE6790000
+#define DBSC3_1_BASE           0xE67A0000
+#define TMU_BASE               0xE61E0000
+#define        GPIO5_BASE              0xE6055000
+
+#define S3C_BASE               0xE6784000
+#define S3C_INT_BASE           0xE6784A00
+#define S3C_MEDIA_BASE         0xE6784B00
+
+#define S3C_QOS_DCACHE_BASE    0xE6784BDC
+#define S3C_QOS_CCI0_BASE      0xE6784C00
+#define S3C_QOS_CCI1_BASE      0xE6784C24
+#define S3C_QOS_MXI_BASE       0xE6784C48
+#define S3C_QOS_AXI_BASE       0xE6784C6C
+
+#define DBSC3_0_QOS_R0_BASE    0xE6791000
+#define DBSC3_0_QOS_R1_BASE    0xE6791100
+#define DBSC3_0_QOS_R2_BASE    0xE6791200
+#define DBSC3_0_QOS_R3_BASE    0xE6791300
+#define DBSC3_0_QOS_R4_BASE    0xE6791400
+#define DBSC3_0_QOS_R5_BASE    0xE6791500
+#define DBSC3_0_QOS_R6_BASE    0xE6791600
+#define DBSC3_0_QOS_R7_BASE    0xE6791700
+#define DBSC3_0_QOS_R8_BASE    0xE6791800
+#define DBSC3_0_QOS_R9_BASE    0xE6791900
+#define DBSC3_0_QOS_R10_BASE   0xE6791A00
+#define DBSC3_0_QOS_R11_BASE   0xE6791B00
+#define DBSC3_0_QOS_R12_BASE   0xE6791C00
+#define DBSC3_0_QOS_R13_BASE   0xE6791D00
+#define DBSC3_0_QOS_R14_BASE   0xE6791E00
+#define DBSC3_0_QOS_R15_BASE   0xE6791F00
+#define DBSC3_0_QOS_W0_BASE    0xE6792000
+#define DBSC3_0_QOS_W1_BASE    0xE6792100
+#define DBSC3_0_QOS_W2_BASE    0xE6792200
+#define DBSC3_0_QOS_W3_BASE    0xE6792300
+#define DBSC3_0_QOS_W4_BASE    0xE6792400
+#define DBSC3_0_QOS_W5_BASE    0xE6792500
+#define DBSC3_0_QOS_W6_BASE    0xE6792600
+#define DBSC3_0_QOS_W7_BASE    0xE6792700
+#define DBSC3_0_QOS_W8_BASE    0xE6792800
+#define DBSC3_0_QOS_W9_BASE    0xE6792900
+#define DBSC3_0_QOS_W10_BASE   0xE6792A00
+#define DBSC3_0_QOS_W11_BASE   0xE6792B00
+#define DBSC3_0_QOS_W12_BASE   0xE6792C00
+#define DBSC3_0_QOS_W13_BASE   0xE6792D00
+#define DBSC3_0_QOS_W14_BASE   0xE6792E00
+#define DBSC3_0_QOS_W15_BASE   0xE6792F00
+
+#define DBSC3_0_DBADJ2         0xE67900C8
+
+#define CCI_400_MAXOT_1                0xF0091110
+#define CCI_400_MAXOT_2                0xF0092110
+#define CCI_400_QOSCNTL_1      0xF009110C
+#define CCI_400_QOSCNTL_2      0xF009210C
+
+#define        MXI_BASE                0xFE960000
+#define        MXI_QOS_BASE            0xFE960300
+
+#define SYS_AXI_SYX64TO128_BASE        0xFF800300
+#define SYS_AXI_AVB_BASE       0xFF800340
+#define SYS_AXI_G2D_BASE       0xFF800540
+#define SYS_AXI_IMP0_BASE      0xFF800580
+#define SYS_AXI_IMP1_BASE      0xFF8005C0
+#define SYS_AXI_IMUX0_BASE     0xFF800600
+#define SYS_AXI_IMUX1_BASE     0xFF800640
+#define SYS_AXI_IMUX2_BASE     0xFF800680
+#define SYS_AXI_LBS_BASE       0xFF8006C0
+#define SYS_AXI_MMUDS_BASE     0xFF800700
+#define SYS_AXI_MMUM_BASE      0xFF800740
+#define SYS_AXI_MMUR_BASE      0xFF800780
+#define SYS_AXI_MMUS0_BASE     0xFF8007C0
+#define SYS_AXI_MMUS1_BASE     0xFF800800
+#define SYS_AXI_MTSB0_BASE     0xFF800880
+#define SYS_AXI_MTSB1_BASE     0xFF8008C0
+#define SYS_AXI_PCI_BASE       0xFF800900
+#define SYS_AXI_RTX_BASE       0xFF800940
+#define SYS_AXI_SDS0_BASE      0xFF800A80
+#define SYS_AXI_SDS1_BASE      0xFF800AC0
+#define SYS_AXI_USB20_BASE     0xFF800C00
+#define SYS_AXI_USB21_BASE     0xFF800C40
+#define SYS_AXI_USB22_BASE     0xFF800C80
+#define SYS_AXI_USB30_BASE     0xFF800CC0
+
+#define RT_AXI_SHX_BASE                0xFF810100
+#define RT_AXI_RDS_BASE                0xFF8101C0
+#define RT_AXI_RTX64TO128_BASE 0xFF810200
+#define RT_AXI_STPRO_BASE      0xFF810240
+
+#define MP_AXI_ADSP_BASE       0xFF820100
+#define MP_AXI_ASDS0_BASE      0xFF8201C0
+#define MP_AXI_ASDS1_BASE      0xFF820200
+#define MP_AXI_MLP_BASE                0xFF820240
+#define MP_AXI_MMUMP_BASE      0xFF820280
+#define MP_AXI_SPU_BASE                0xFF8202C0
+#define MP_AXI_SPUC_BASE       0xFF820300
+
+#define SYS_AXI256_AXI128TO256_BASE    0xFF860100
+#define SYS_AXI256_SYX_BASE    0xFF860140
+#define SYS_AXI256_MPX_BASE    0xFF860180
+#define SYS_AXI256_MXI_BASE    0xFF8601C0
+
+#define CCI_AXI_MMUS0_BASE     0xFF880100
+#define CCI_AXI_SYX2_BASE      0xFF880140
+#define CCI_AXI_MMUR_BASE      0xFF880180
+#define CCI_AXI_MMUDS_BASE     0xFF8801C0
+#define CCI_AXI_MMUM_BASE      0xFF880200
+#define CCI_AXI_MXI_BASE       0xFF880240
+#define CCI_AXI_MMUS1_BASE     0xFF880280
+#define CCI_AXI_MMUMP_BASE     0xFF8802C0
+
+#define MEDIA_AXI_JPR_BASE     0xFE964100
+#define MEDIA_AXI_JPW_BASE     0xFE966100
+#define MEDIA_AXI_GCU0R_BASE   0xFE964140
+#define MEDIA_AXI_GCU0W_BASE   0xFE966140
+#define MEDIA_AXI_GCU1R_BASE   0xFE964180
+#define MEDIA_AXI_GCU1W_BASE   0xFE966180
+#define MEDIA_AXI_TDMR_BASE    0xFE964500
+#define MEDIA_AXI_TDMW_BASE    0xFE966500
+#define MEDIA_AXI_VSP0CR_BASE  0xFE964540
+#define MEDIA_AXI_VSP0CW_BASE  0xFE966540
+#define MEDIA_AXI_VSP1CR_BASE  0xFE964580
+#define MEDIA_AXI_VSP1CW_BASE  0xFE966580
+#define MEDIA_AXI_VSPDU0CR_BASE        0xFE9645C0
+#define MEDIA_AXI_VSPDU0CW_BASE        0xFE9665C0
+#define MEDIA_AXI_VSPDU1CR_BASE        0xFE964600
+#define MEDIA_AXI_VSPDU1CW_BASE        0xFE966600
+#define MEDIA_AXI_VIN0W_BASE   0xFE966900
+#define MEDIA_AXI_VSP0R_BASE   0xFE964D00
+#define MEDIA_AXI_VSP0W_BASE   0xFE966D00
+#define MEDIA_AXI_FDP0R_BASE   0xFE964D40
+#define MEDIA_AXI_FDP0W_BASE   0xFE966D40
+#define MEDIA_AXI_IMSR_BASE    0xFE964D80
+#define MEDIA_AXI_IMSW_BASE    0xFE966D80
+#define MEDIA_AXI_VSP1R_BASE   0xFE965100
+#define MEDIA_AXI_VSP1W_BASE   0xFE967100
+#define MEDIA_AXI_FDP1R_BASE   0xFE965140
+#define MEDIA_AXI_FDP1W_BASE   0xFE967140
+#define MEDIA_AXI_IMRR_BASE    0xFE965180
+#define MEDIA_AXI_IMRW_BASE    0xFE967180
+#define MEDIA_AXI_FDP2R_BASE   0xFE9651C0
+#define MEDIA_AXI_FDP2W_BASE   0xFE966DC0
+#define MEDIA_AXI_VSPD0R_BASE  0xFE965500
+#define MEDIA_AXI_VSPD0W_BASE  0xFE967500
+#define MEDIA_AXI_VSPD1R_BASE  0xFE965540
+#define MEDIA_AXI_VSPD1W_BASE  0xFE967540
+#define MEDIA_AXI_DU0R_BASE    0xFE965580
+#define MEDIA_AXI_DU0W_BASE    0xFE967580
+#define MEDIA_AXI_DU1R_BASE    0xFE9655C0
+#define MEDIA_AXI_DU1W_BASE    0xFE9675C0
+#define MEDIA_AXI_VCP0CR_BASE  0xFE965900
+#define MEDIA_AXI_VCP0CW_BASE  0xFE967900
+#define MEDIA_AXI_VCP0VR_BASE  0xFE965940
+#define MEDIA_AXI_VCP0VW_BASE  0xFE967940
+#define MEDIA_AXI_VPC0R_BASE   0xFE965980
+#define MEDIA_AXI_VCP1CR_BASE  0xFE965D00
+#define MEDIA_AXI_VCP1CW_BASE  0xFE967D00
+#define MEDIA_AXI_VCP1VR_BASE  0xFE965D40
+#define MEDIA_AXI_VCP1VW_BASE  0xFE967D40
+#define MEDIA_AXI_VPC1R_BASE   0xFE965D80
+
+#define SYS_AXI_AVBDMSCR       0xFF802000
+#define SYS_AXI_SYX2DMSCR      0xFF802004
+#define SYS_AXI_CC50DMSCR      0xFF802008
+#define SYS_AXI_CC51DMSCR      0xFF80200C
+#define SYS_AXI_CCIDMSCR       0xFF802010
+#define SYS_AXI_CSDMSCR                0xFF802014
+#define SYS_AXI_DDMDMSCR       0xFF802018
+#define SYS_AXI_ETHDMSCR       0xFF80201C
+#define SYS_AXI_G2DDMSCR       0xFF802020
+#define SYS_AXI_IMP0DMSCR      0xFF802024
+#define SYS_AXI_IMP1DMSCR      0xFF802028
+#define SYS_AXI_LBSDMSCR       0xFF80202C
+#define SYS_AXI_MMUDSDMSCR     0xFF802030
+#define SYS_AXI_MMUMXDMSCR     0xFF802034
+#define SYS_AXI_MMURDDMSCR     0xFF802038
+#define SYS_AXI_MMUS0DMSCR     0xFF80203C
+#define SYS_AXI_MMUS1DMSCR     0xFF802040
+#define SYS_AXI_MPXDMSCR       0xFF802044
+#define SYS_AXI_MTSB0DMSCR     0xFF802048
+#define SYS_AXI_MTSB1DMSCR     0xFF80204C
+#define SYS_AXI_PCIDMSCR       0xFF802050
+#define SYS_AXI_RTXDMSCR       0xFF802054
+#define SYS_AXI_SAT0DMSCR      0xFF802058
+#define SYS_AXI_SAT1DMSCR      0xFF80205C
+#define SYS_AXI_SDM0DMSCR      0xFF802060
+#define SYS_AXI_SDM1DMSCR      0xFF802064
+#define SYS_AXI_SDS0DMSCR      0xFF802068
+#define SYS_AXI_SDS1DMSCR      0xFF80206C
+#define SYS_AXI_ETRABDMSCR     0xFF802070
+#define SYS_AXI_ETRKFDMSCR     0xFF802074
+#define SYS_AXI_UDM0DMSCR      0xFF802078
+#define SYS_AXI_UDM1DMSCR      0xFF80207C
+#define SYS_AXI_USB20DMSCR     0xFF802080
+#define SYS_AXI_USB21DMSCR     0xFF802084
+#define SYS_AXI_USB22DMSCR     0xFF802088
+#define SYS_AXI_USB30DMSCR     0xFF80208C
+#define SYS_AXI_X128TO64SLVDMSCR       0xFF802100
+#define SYS_AXI_X64TO128SLVDMSCR       0xFF802104
+#define SYS_AXI_AVBSLVDMSCR    0xFF802108
+#define SYS_AXI_SYX2SLVDMSCR   0xFF80210C
+#define SYS_AXI_ETHSLVDMSCR    0xFF802110
+#define SYS_AXI_GICSLVDMSCR    0xFF802114
+#define SYS_AXI_IMPSLVDMSCR    0xFF802118
+#define SYS_AXI_IMX0SLVDMSCR   0xFF80211C
+#define SYS_AXI_IMX1SLVDMSCR   0xFF802120
+#define SYS_AXI_IMX2SLVDMSCR   0xFF802124
+#define SYS_AXI_LBSSLVDMSCR    0xFF802128
+#define SYS_AXI_MMC0SLVDMSCR   0xFF80212C
+#define SYS_AXI_MMC1SLVDMSCR   0xFF802130
+#define SYS_AXI_MPXSLVDMSCR    0xFF802134
+#define SYS_AXI_MTSB0SLVDMSCR  0xFF802138
+#define SYS_AXI_MTSB1SLVDMSCR  0xFF80213C
+#define SYS_AXI_MXTSLVDMSCR    0xFF802140
+#define SYS_AXI_PCISLVDMSCR    0xFF802144
+#define SYS_AXI_SYAPBSLVDMSCR  0xFF802148
+#define SYS_AXI_QSAPBSLVDMSCR  0xFF80214C
+#define SYS_AXI_RTXSLVDMSCR    0xFF802150
+#define SYS_AXI_SAT0SLVDMSCR   0xFF802168
+#define SYS_AXI_SAT1SLVDMSCR   0xFF80216C
+#define SYS_AXI_SDAP0SLVDMSCR  0xFF802170
+#define SYS_AXI_SDAP1SLVDMSCR  0xFF802174
+#define SYS_AXI_SDAP2SLVDMSCR  0xFF802178
+#define SYS_AXI_SDAP3SLVDMSCR  0xFF80217C
+#define SYS_AXI_SGXSLVDMSCR    0xFF802180
+#define SYS_AXI_STBSLVDMSCR    0xFF802188
+#define SYS_AXI_STMSLVDMSCR    0xFF80218C
+#define SYS_AXI_TSPL0SLVDMSCR  0xFF802194
+#define SYS_AXI_TSPL1SLVDMSCR  0xFF802198
+#define SYS_AXI_TSPL2SLVDMSCR  0xFF80219C
+#define SYS_AXI_USB20SLVDMSCR  0xFF8021A0
+#define SYS_AXI_USB21SLVDMSCR  0xFF8021A4
+#define SYS_AXI_USB22SLVDMSCR  0xFF8021A8
+#define SYS_AXI_USB30SLVDMSCR  0xFF8021AC
+
+#define RT_AXI_CBMDMSCR                0xFF812000
+#define RT_AXI_DBDMSCR         0xFF812004
+#define RT_AXI_RDMDMSCR                0xFF812008
+#define RT_AXI_RDSDMSCR                0xFF81200C
+#define RT_AXI_STRDMSCR                0xFF812010
+#define RT_AXI_SY2RTDMSCR      0xFF812014
+#define RT_AXI_CBSSLVDMSCR     0xFF812100
+#define RT_AXI_DBSSLVDMSCR     0xFF812104
+#define RT_AXI_RTAP1SLVDMSCR   0xFF812108
+#define RT_AXI_RTAP2SLVDMSCR   0xFF81210C
+#define RT_AXI_RTAP3SLVDMSCR   0xFF812110
+#define RT_AXI_RT2SYSLVDMSCR   0xFF812114
+#define RT_AXI_A128TO64SLVDMSCR        0xFF812118
+#define RT_AXI_A64TO128SLVDMSCR        0xFF81211C
+#define RT_AXI_A64TO128CSLVDMSCR       0xFF812120
+#define RT_AXI_UTLBRSLVDMSCR   0xFF812128
+
+#define MP_AXI_ADSPDMSCR       0xFF822000
+#define MP_AXI_ASDM0DMSCR      0xFF822004
+#define MP_AXI_ASDM1DMSCR      0xFF822008
+#define MP_AXI_ASDS0DMSCR      0xFF82200C
+#define MP_AXI_ASDS1DMSCR      0xFF822010
+#define MP_AXI_MLPDMSCR                0xFF822014
+#define MP_AXI_MMUMPDMSCR      0xFF822018
+#define MP_AXI_SPUDMSCR                0xFF82201C
+#define MP_AXI_SPUCDMSCR       0xFF822020
+#define MP_AXI_SY2MPDMSCR      0xFF822024
+#define MP_AXI_ADSPSLVDMSCR    0xFF822100
+#define MP_AXI_MLMSLVDMSCR     0xFF822104
+#define MP_AXI_MPAP4SLVDMSCR   0xFF822108
+#define MP_AXI_MPAP5SLVDMSCR   0xFF82210C
+#define MP_AXI_MPAP6SLVDMSCR   0xFF822110
+#define MP_AXI_MPAP7SLVDMSCR   0xFF822114
+#define MP_AXI_MP2SYSLVDMSCR   0xFF822118
+#define MP_AXI_MP2SY2SLVDMSCR  0xFF82211C
+#define MP_AXI_MPXAPSLVDMSCR   0xFF822124
+#define MP_AXI_SPUSLVDMSCR     0xFF822128
+#define MP_AXI_UTLBMPSLVDMSCR  0xFF82212C
+
+#define ADM_AXI_ASDM0DMSCR     0xFF842000
+#define ADM_AXI_ASDM1DMSCR     0xFF842004
+#define ADM_AXI_MPAP1SLVDMSCR  0xFF842104
+#define ADM_AXI_MPAP2SLVDMSCR  0xFF842108
+#define ADM_AXI_MPAP3SLVDMSCR  0xFF84210C
+
+#define DM_AXI_RDMDMSCR                0xFF852000
+#define DM_AXI_SDM0DMSCR       0xFF852004
+#define DM_AXI_SDM1DMSCR       0xFF852008
+#define DM_AXI_MMAP0SLVDMSCR   0xFF852100
+#define DM_AXI_MMAP1SLVDMSCR   0xFF852104
+#define DM_AXI_QSPAPSLVDMSCR   0xFF852108
+#define DM_AXI_RAP4SLVDMSCR    0xFF85210C
+#define DM_AXI_RAP5SLVDMSCR    0xFF852110
+#define DM_AXI_SAP4SLVDMSCR    0xFF852114
+#define DM_AXI_SAP5SLVDMSCR    0xFF852118
+#define DM_AXI_SAP6SLVDMSCR    0xFF85211C
+#define DM_AXI_SAP65SLVDMSCR   0xFF852120
+#define DM_AXI_SDAP0SLVDMSCR   0xFF852124
+#define DM_AXI_SDAP1SLVDMSCR   0xFF852128
+#define DM_AXI_SDAP2SLVDMSCR   0xFF85212C
+#define DM_AXI_SDAP3SLVDMSCR   0xFF852130
+
+#define SYS_AXI256_SYXDMSCR    0xFF862000
+#define SYS_AXI256_MPXDMSCR    0xFF862004
+#define SYS_AXI256_MXIDMSCR    0xFF862008
+#define SYS_AXI256_X128TO256SLVDMSCR   0xFF862100
+#define SYS_AXI256_X256TO128SLVDMSCR   0xFF862104
+#define SYS_AXI256_SYXSLVDMSCR 0xFF862108
+#define SYS_AXI256_CCXSLVDMSCR 0xFF86210C
+#define SYS_AXI256_S3CSLVDMSCR 0xFF862110
+
+#define MXT_SYXDMSCR           0xFF872000
+#define MXT_CMM0SLVDMSCR       0xFF872100
+#define MXT_CMM1SLVDMSCR       0xFF872104
+#define MXT_CMM2SLVDMSCR       0xFF872108
+#define MXT_FDPSLVDMSCR                0xFF87210C
+#define MXT_IMRSLVDMSCR                0xFF872110
+#define MXT_VINSLVDMSCR                0xFF872114
+#define MXT_VPC0SLVDMSCR       0xFF872118
+#define MXT_VPC1SLVDMSCR       0xFF87211C
+#define MXT_VSP0SLVDMSCR       0xFF872120
+#define MXT_VSP1SLVDMSCR       0xFF872124
+#define MXT_VSPD0SLVDMSCR      0xFF872128
+#define MXT_VSPD1SLVDMSCR      0xFF87212C
+#define MXT_MAP1SLVDMSCR       0xFF872130
+#define MXT_MAP2SLVDMSCR       0xFF872134
+
+#define CCI_AXI_MMUS0DMSCR     0xFF882000
+#define CCI_AXI_SYX2DMSCR      0xFF882004
+#define CCI_AXI_MMURDMSCR      0xFF882008
+#define CCI_AXI_MMUDSDMSCR     0xFF88200C
+#define CCI_AXI_MMUMDMSCR      0xFF882010
+#define CCI_AXI_MXIDMSCR       0xFF882014
+#define CCI_AXI_MMUS1DMSCR     0xFF882018
+#define CCI_AXI_MMUMPDMSCR     0xFF88201C
+#define CCI_AXI_DVMDMSCR       0xFF882020
+#define CCI_AXI_CCISLVDMSCR    0xFF882100
+
+#define CCI_AXI_IPMMUIDVMCR    0xFF880400
+#define CCI_AXI_IPMMURDVMCR    0xFF880404
+#define CCI_AXI_IPMMUS0DVMCR   0xFF880408
+#define CCI_AXI_IPMMUS1DVMCR   0xFF88040C
+#define CCI_AXI_IPMMUMPDVMCR   0xFF880410
+#define CCI_AXI_IPMMUDSDVMCR   0xFF880414
+#define CCI_AXI_AX2ADDRMASK    0xFF88041C
+
+#ifndef __ASSEMBLY__
+#include <asm/types.h>
+
+/* RWDT */
+struct r8a7790_rwdt {
+       u32 rwtcnt;     /* 0x00 */
+       u32 rwtcsra;    /* 0x04 */
+       u16 rwtcsrb;    /* 0x08 */
+};
+
+/* SWDT */
+struct r8a7790_swdt {
+       u32 swtcnt;     /* 0x00 */
+       u32 swtcsra;    /* 0x04 */
+       u16 swtcsrb;    /* 0x08 */
+};
+
+/* LBSC */
+struct r8a7790_lbsc {
+       u32 cs0ctrl;
+       u32 cs1ctrl;
+       u32 ecs0ctrl;
+       u32 ecs1ctrl;
+       u32 ecs2ctrl;
+       u32 ecs3ctrl;
+       u32 ecs4ctrl;
+       u32 ecs5ctrl;
+       u32 dummy0[4];  /* 0x20 .. 0x2C */
+       u32 cswcr0;
+       u32 cswcr1;
+       u32 ecswcr0;
+       u32 ecswcr1;
+       u32 ecswcr2;
+       u32 ecswcr3;
+       u32 ecswcr4;
+       u32 ecswcr5;
+       u32 exdmawcr0;
+       u32 exdmawcr1;
+       u32 exdmawcr2;
+       u32 dummy1[9];  /* 0x5C .. 0x7C */
+       u32 cspwcr0;
+       u32 cspwcr1;
+       u32 ecspwcr0;
+       u32 ecspwcr1;
+       u32 ecspwcr2;
+       u32 ecspwcr3;
+       u32 ecspwcr4;
+       u32 ecspwcr5;
+       u32 exwtsync;
+       u32 dummy2[3];  /* 0xA4 .. 0xAC */
+       u32 cs0bstctl;
+       u32 cs0btph;
+       u32 dummy3[2];  /* 0xB8 .. 0xBC */
+       u32 cs1gdst;
+       u32 ecs0gdst;
+       u32 ecs1gdst;
+       u32 ecs2gdst;
+       u32 ecs3gdst;
+       u32 ecs4gdst;
+       u32 ecs5gdst;
+       u32 dummy4[5];  /* 0xDC .. 0xEC */
+       u32 exdmaset0;
+       u32 exdmaset1;
+       u32 exdmaset2;
+       u32 dummy5[5];  /* 0xFC .. 0x10C */
+       u32 exdmcr0;
+       u32 exdmcr1;
+       u32 exdmcr2;
+       u32 dummy6[5];  /* 0x11C .. 0x12C */
+       u32 bcintsr;
+       u32 bcintcr;
+       u32 bcintmr;
+       u32 dummy7;     /* 0x13C */
+       u32 exbatlv;
+       u32 exwtsts;
+       u32 dummy8[14]; /* 0x148 .. 0x17C */
+       u32 atacsctrl;
+       u32 dummy9[15]; /* 0x184 .. 0x1BC */
+       u32 exbct;
+       u32 extct;
+};
+
+/* DBSC3 */
+struct r8a7790_dbsc3 {
+       u32 dummy0[3];  /* 0x00 .. 0x08 */
+       u32 dbstate1;
+       u32 dbacen;
+       u32 dbrfen;
+       u32 dbcmd;
+       u32 dbwait;
+       u32 dbkind;
+       u32 dbconf0;
+       u32 dummy1[2];  /* 0x28 .. 0x2C */
+       u32 dbphytype;
+       u32 dummy2[3];  /* 0x34 .. 0x3C */
+       u32 dbtr0;
+       u32 dbtr1;
+       u32 dbtr2;
+       u32 dummy3;     /* 0x4C */
+       u32 dbtr3;
+       u32 dbtr4;
+       u32 dbtr5;
+       u32 dbtr6;
+       u32 dbtr7;
+       u32 dbtr8;
+       u32 dbtr9;
+       u32 dbtr10;
+       u32 dbtr11;
+       u32 dbtr12;
+       u32 dbtr13;
+       u32 dbtr14;
+       u32 dbtr15;
+       u32 dbtr16;
+       u32 dbtr17;
+       u32 dbtr18;
+       u32 dbtr19;
+       u32 dummy4[7];  /* 0x94 .. 0xAC */
+       u32 dbbl;
+       u32 dummy5[3];  /* 0xB4 .. 0xBC */
+       u32 dbadj0;
+       u32 dummy6;     /* 0xC4 */
+       u32 dbadj2;
+       u32 dummy7[5];  /* 0xCC .. 0xDC */
+       u32 dbrfcnf0;
+       u32 dbrfcnf1;
+       u32 dbrfcnf2;
+       u32 dummy8[2];  /* 0xEC .. 0xF0 */
+       u32 dbcalcnf;
+       u32 dbcaltr;
+       u32 dummy9;     /* 0xFC */
+       u32 dbrnk0;
+       u32 dummy10[31];        /* 0x104 .. 0x17C */
+       u32 dbpdncnf;
+       u32 dummy11[47];        /* 0x184 ..0x23C */
+       u32 dbdfistat;
+       u32 dbdficnt;
+       u32 dummy12[14];        /* 0x248 .. 0x27C */
+       u32 dbpdlck;
+       u32 dummy13[3]; /* 0x284 .. 0x28C */
+       u32 dbpdrga;
+       u32 dummy14[3]; /* 0x294 .. 0x29C */
+       u32 dbpdrgd;
+       u32 dummy15[24];        /* 0x2A4 .. 0x300 */
+       u32 dbbs0cnt1;
+       u32 dummy16[30];        /* 0x308 .. 0x37C */
+       u32 dbwt0cnf0;
+       u32 dbwt0cnf1;
+       u32 dbwt0cnf2;
+       u32 dbwt0cnf3;
+       u32 dbwt0cnf4;
+};
+
+/* GPIO */
+struct r8a7790_gpio {
+       u32 iointsel;
+       u32 inoutsel;
+       u32 outdt;
+       u32 indt;
+       u32 intdt;
+       u32 intclr;
+       u32 intmsk;
+       u32 posneg;
+       u32 edglevel;
+       u32 filonoff;
+       u32 intmsks;
+       u32 mskclrs;
+       u32 outdtsel;
+       u32 outdth;
+       u32 outdtl;
+       u32 bothedge;
+};
+
+/* S3C(QoS) */
+struct r8a7790_s3c {
+       u32 s3cexcladdmsk;
+       u32 s3cexclidmsk;
+       u32 s3cadsplcr;
+       u32 s3cmaar;
+       u32 s3carcr11;
+       u32 s3crorr;
+       u32 s3cworr;
+       u32 s3carcr22;
+       u32 dummy1[2];  /* 0x20 .. 0x24 */
+       u32 s3cmctr;
+       u32 dummy2;     /* 0x2C */
+       u32 cconf0;
+       u32 cconf1;
+       u32 cconf2;
+       u32 cconf3;
+};
+
+struct r8a7790_s3c_qos {
+       u32 s3cqos0;
+       u32 s3cqos1;
+       u32 s3cqos2;
+       u32 s3cqos3;
+       u32 s3cqos4;
+       u32 s3cqos5;
+       u32 s3cqos6;
+       u32 s3cqos7;
+       u32 s3cqos8;
+};
+
+/* DBSC(QoS) */
+struct r8a7790_dbsc3_qos {
+       u32 dblgcnt;
+       u32 dbtmval0;
+       u32 dbtmval1;
+       u32 dbtmval2;
+       u32 dbtmval3;
+       u32 dbrqctr;
+       u32 dbthres0;
+       u32 dbthres1;
+       u32 dbthres2;
+       u32 dummy0;     /* 0x24 */
+       u32 dblgqon;
+};
+
+/* MXI(QoS) */
+struct r8a7790_mxi {
+       u32 mxsaar0;
+       u32 mxsaar1;
+       u32 dummy0[7];  /* 0x08 .. 0x20 */
+       u32 mxaxiracr;
+       u32 mxs3cracr;
+       u32 dummy1[2];  /* 0x2C .. 0x30 */
+       u32 mxaxiwacr;
+       u32 mxs3cwacr;
+       u32 dummy2;     /* 0x3C */
+       u32 mxrtcr;
+       u32 mxwtcr;
+};
+
+struct r8a7790_mxi_qos {
+       u32 vspdu0;
+       u32 vspdu1;
+       u32 du0;
+       u32 du1;
+};
+
+/* AXI(QoS) */
+struct r8a7790_axi_qos {
+       u32 qosconf;
+       u32 qosctset0;
+       u32 qosctset1;
+       u32 qosctset2;
+       u32 qosctset3;
+       u32 qosreqctr;
+       u32 qosthres0;
+       u32 qosthres1;
+       u32 qosthres2;
+       u32 qosqon;
+};
+
+#endif
+
+#endif /* __ASM_ARCH_R8A7790_H */
diff --git a/arch/arm/include/asm/arch-rmobile/r8a7791-gpio.h b/arch/arm/include/asm/arch-rmobile/r8a7791-gpio.h
new file mode 100644 (file)
index 0000000..d3cf0c1
--- /dev/null
@@ -0,0 +1,438 @@
+#ifndef __ASM_R8A7791_H__
+#define __ASM_R8A7791_H__
+
+/* Pin Function Controller:
+ * GPIO_FN_xx - GPIO used to select pin function
+ * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
+ */
+enum {
+       GPIO_GP_0_0, GPIO_GP_0_1, GPIO_GP_0_2, GPIO_GP_0_3,
+       GPIO_GP_0_4, GPIO_GP_0_5, GPIO_GP_0_6, GPIO_GP_0_7,
+       GPIO_GP_0_8, GPIO_GP_0_9, GPIO_GP_0_10, GPIO_GP_0_11,
+       GPIO_GP_0_12, GPIO_GP_0_13, GPIO_GP_0_14, GPIO_GP_0_15,
+       GPIO_GP_0_16, GPIO_GP_0_17, GPIO_GP_0_18, GPIO_GP_0_19,
+       GPIO_GP_0_20, GPIO_GP_0_21, GPIO_GP_0_22, GPIO_GP_0_23,
+       GPIO_GP_0_24, GPIO_GP_0_25, GPIO_GP_0_26, GPIO_GP_0_27,
+       GPIO_GP_0_28, GPIO_GP_0_29, GPIO_GP_0_30, GPIO_GP_0_31,
+
+       GPIO_GP_1_0, GPIO_GP_1_1, GPIO_GP_1_2, GPIO_GP_1_3,
+       GPIO_GP_1_4, GPIO_GP_1_5, GPIO_GP_1_6, GPIO_GP_1_7,
+       GPIO_GP_1_8, GPIO_GP_1_9, GPIO_GP_1_10, GPIO_GP_1_11,
+       GPIO_GP_1_12, GPIO_GP_1_13, GPIO_GP_1_14, GPIO_GP_1_15,
+       GPIO_GP_1_16, GPIO_GP_1_17, GPIO_GP_1_18, GPIO_GP_1_19,
+       GPIO_GP_1_20, GPIO_GP_1_21, GPIO_GP_1_22, GPIO_GP_1_23,
+       GPIO_GP_1_24, GPIO_GP_1_25,
+
+       GPIO_GP_2_0, GPIO_GP_2_1, GPIO_GP_2_2, GPIO_GP_2_3,
+       GPIO_GP_2_4, GPIO_GP_2_5, GPIO_GP_2_6, GPIO_GP_2_7,
+       GPIO_GP_2_8, GPIO_GP_2_9, GPIO_GP_2_10, GPIO_GP_2_11,
+       GPIO_GP_2_12, GPIO_GP_2_13, GPIO_GP_2_14, GPIO_GP_2_15,
+       GPIO_GP_2_16, GPIO_GP_2_17, GPIO_GP_2_18, GPIO_GP_2_19,
+       GPIO_GP_2_20, GPIO_GP_2_21, GPIO_GP_2_22, GPIO_GP_2_23,
+       GPIO_GP_2_24, GPIO_GP_2_25, GPIO_GP_2_26, GPIO_GP_2_27,
+       GPIO_GP_2_28, GPIO_GP_2_29, GPIO_GP_2_30, GPIO_GP_2_31,
+
+       GPIO_GP_3_0, GPIO_GP_3_1, GPIO_GP_3_2, GPIO_GP_3_3,
+       GPIO_GP_3_4, GPIO_GP_3_5, GPIO_GP_3_6, GPIO_GP_3_7,
+       GPIO_GP_3_8, GPIO_GP_3_9, GPIO_GP_3_10, GPIO_GP_3_11,
+       GPIO_GP_3_12, GPIO_GP_3_13, GPIO_GP_3_14, GPIO_GP_3_15,
+       GPIO_GP_3_16, GPIO_GP_3_17, GPIO_GP_3_18, GPIO_GP_3_19,
+       GPIO_GP_3_20, GPIO_GP_3_21, GPIO_GP_3_22, GPIO_GP_3_23,
+       GPIO_GP_3_24, GPIO_GP_3_25, GPIO_GP_3_26, GPIO_GP_3_27,
+       GPIO_GP_3_28, GPIO_GP_3_29, GPIO_GP_3_30, GPIO_GP_3_31,
+
+       GPIO_GP_4_0, GPIO_GP_4_1, GPIO_GP_4_2, GPIO_GP_4_3,
+       GPIO_GP_4_4, GPIO_GP_4_5, GPIO_GP_4_6, GPIO_GP_4_7,
+       GPIO_GP_4_8, GPIO_GP_4_9, GPIO_GP_4_10, GPIO_GP_4_11,
+       GPIO_GP_4_12, GPIO_GP_4_13, GPIO_GP_4_14, GPIO_GP_4_15,
+       GPIO_GP_4_16, GPIO_GP_4_17, GPIO_GP_4_18, GPIO_GP_4_19,
+       GPIO_GP_4_20, GPIO_GP_4_21, GPIO_GP_4_22, GPIO_GP_4_23,
+       GPIO_GP_4_24, GPIO_GP_4_25, GPIO_GP_4_26, GPIO_GP_4_27,
+       GPIO_GP_4_28, GPIO_GP_4_29, GPIO_GP_4_30, GPIO_GP_4_31,
+
+       GPIO_GP_5_0, GPIO_GP_5_1, GPIO_GP_5_2, GPIO_GP_5_3,
+       GPIO_GP_5_4, GPIO_GP_5_5, GPIO_GP_5_6, GPIO_GP_5_7,
+       GPIO_GP_5_8, GPIO_GP_5_9, GPIO_GP_5_10, GPIO_GP_5_11,
+       GPIO_GP_5_12, GPIO_GP_5_13, GPIO_GP_5_14, GPIO_GP_5_15,
+       GPIO_GP_5_16, GPIO_GP_5_17, GPIO_GP_5_18, GPIO_GP_5_19,
+       GPIO_GP_5_20, GPIO_GP_5_21, GPIO_GP_5_22, GPIO_GP_5_23,
+       GPIO_GP_5_24, GPIO_GP_5_25, GPIO_GP_5_26, GPIO_GP_5_27,
+       GPIO_GP_5_28, GPIO_GP_5_29, GPIO_GP_5_30, GPIO_GP_5_31,
+
+       GPIO_GP_6_0, GPIO_GP_6_1, GPIO_GP_6_2, GPIO_GP_6_3,
+       GPIO_GP_6_4, GPIO_GP_6_5, GPIO_GP_6_6, GPIO_GP_6_7,
+       GPIO_GP_6_8, GPIO_GP_6_9, GPIO_GP_6_10, GPIO_GP_6_11,
+       GPIO_GP_6_12, GPIO_GP_6_13, GPIO_GP_6_14, GPIO_GP_6_15,
+       GPIO_GP_6_16, GPIO_GP_6_17, GPIO_GP_6_18, GPIO_GP_6_19,
+       GPIO_GP_6_20, GPIO_GP_6_21, GPIO_GP_6_22, GPIO_GP_6_23,
+       GPIO_GP_6_24, GPIO_GP_6_25, GPIO_GP_6_26, GPIO_GP_6_27,
+       GPIO_GP_6_28, GPIO_GP_6_29, GPIO_GP_6_30, GPIO_GP_6_31,
+
+       GPIO_GP_7_0, GPIO_GP_7_1, GPIO_GP_7_2, GPIO_GP_7_3,
+       GPIO_GP_7_4, GPIO_GP_7_5, GPIO_GP_7_6, GPIO_GP_7_7,
+       GPIO_GP_7_8, GPIO_GP_7_9, GPIO_GP_7_10, GPIO_GP_7_11,
+       GPIO_GP_7_12, GPIO_GP_7_13, GPIO_GP_7_14, GPIO_GP_7_15,
+       GPIO_GP_7_16, GPIO_GP_7_17, GPIO_GP_7_18, GPIO_GP_7_19,
+       GPIO_GP_7_20, GPIO_GP_7_21, GPIO_GP_7_22, GPIO_GP_7_23,
+       GPIO_GP_7_24, GPIO_GP_7_25,
+
+       GPIO_FN_EX_CS0_N, GPIO_FN_RD_N, GPIO_FN_AUDIO_CLKA,
+       GPIO_FN_VI0_CLK, GPIO_FN_VI0_DATA0_VI0_B0,
+       GPIO_FN_VI0_DATA0_VI0_B1, GPIO_FN_VI0_DATA0_VI0_B2,
+       GPIO_FN_VI0_DATA0_VI0_B4, GPIO_FN_VI0_DATA0_VI0_B5,
+       GPIO_FN_VI0_DATA0_VI0_B6, GPIO_FN_VI0_DATA0_VI0_B7,
+       GPIO_FN_USB0_PWEN, GPIO_FN_USB0_OVC, GPIO_FN_USB1_PWEN,
+
+       /* IPSR0 */
+       GPIO_FN_D0, GPIO_FN_D1, GPIO_FN_D2, GPIO_FN_D3, GPIO_FN_D4, GPIO_FN_D5,
+       GPIO_FN_D6, GPIO_FN_D7, GPIO_FN_D8, GPIO_FN_D9, GPIO_FN_D10,
+       GPIO_FN_D11, GPIO_FN_D12, GPIO_FN_D13, GPIO_FN_D14, GPIO_FN_D15,
+       GPIO_FN_A0, GPIO_FN_ATAWR0_N_C, GPIO_FN_MSIOF0_SCK_B,
+       GPIO_FN_SCL0_C, GPIO_FN_PWM2_B,
+       GPIO_FN_A1, GPIO_FN_MSIOF0_SYNC_B, GPIO_FN_A2, GPIO_FN_MSIOF0_SS1_B,
+       GPIO_FN_A3, GPIO_FN_MSIOF0_SS2_B, GPIO_FN_A4, GPIO_FN_MSIOF0_TXD_B,
+       GPIO_FN_A5, GPIO_FN_MSIOF0_RXD_B, GPIO_FN_A6, GPIO_FN_MSIOF1_SCK,
+
+       /* IPSR1 */
+       GPIO_FN_A7, GPIO_FN_MSIOF1_SYNC, GPIO_FN_A8,
+       GPIO_FN_MSIOF1_SS1, GPIO_FN_SCL0,
+       GPIO_FN_A9, GPIO_FN_MSIOF1_SS2, GPIO_FN_SDA0,
+       GPIO_FN_A10, GPIO_FN_MSIOF1_TXD, GPIO_FN_MSIOF1_TXD_D,
+       GPIO_FN_A11, GPIO_FN_MSIOF1_RXD, GPIO_FN_SCL3_D, GPIO_FN_MSIOF1_RXD_D,
+       GPIO_FN_A12, GPIO_FN_FMCLK, GPIO_FN_SDA3_D, GPIO_FN_MSIOF1_SCK_D,
+       GPIO_FN_A13, GPIO_FN_ATAG0_N_C, GPIO_FN_BPFCLK, GPIO_FN_MSIOF1_SS1_D,
+       GPIO_FN_A14, GPIO_FN_ATADIR0_N_C, GPIO_FN_FMIN,
+       GPIO_FN_FMIN_C, GPIO_FN_MSIOF1_SYNC_D,
+       GPIO_FN_A15, GPIO_FN_BPFCLK_C,
+       GPIO_FN_A16, GPIO_FN_DREQ2_B, GPIO_FN_FMCLK_C, GPIO_FN_SCIFA1_SCK_B,
+       GPIO_FN_A17, GPIO_FN_DACK2_B, GPIO_FN_SDA0_C,
+       GPIO_FN_A18, GPIO_FN_DREQ1, GPIO_FN_SCIFA1_RXD_C, GPIO_FN_SCIFB1_RXD_C,
+
+       /* IPSR2 */
+       GPIO_FN_A19, GPIO_FN_DACK1, GPIO_FN_SCIFA1_TXD_C,
+       GPIO_FN_SCIFB1_TXD_C, GPIO_FN_SCIFB1_SCK_B,
+       GPIO_FN_A20, GPIO_FN_SPCLK,
+       GPIO_FN_A21, GPIO_FN_ATAWR0_N_B, GPIO_FN_MOSI_IO0,
+       GPIO_FN_A22, GPIO_FN_MISO_IO1, GPIO_FN_FMCLK_B,
+       GPIO_FN_TX0, GPIO_FN_SCIFA0_TXD,
+       GPIO_FN_A23, GPIO_FN_IO2, GPIO_FN_BPFCLK_B,
+       GPIO_FN_RX0, GPIO_FN_SCIFA0_RXD,
+       GPIO_FN_A24, GPIO_FN_DREQ2, GPIO_FN_IO3,
+       GPIO_FN_TX1, GPIO_FN_SCIFA1_TXD,
+       GPIO_FN_A25, GPIO_FN_DACK2, GPIO_FN_SSL, GPIO_FN_DREQ1_C,
+       GPIO_FN_RX1, GPIO_FN_SCIFA1_RXD,
+       GPIO_FN_CS0_N, GPIO_FN_ATAG0_N_B, GPIO_FN_SCL1,
+       GPIO_FN_CS1_N_A26, GPIO_FN_ATADIR0_N_B, GPIO_FN_SDA1,
+       GPIO_FN_EX_CS1_N, GPIO_FN_MSIOF2_SCK,
+       GPIO_FN_EX_CS2_N, GPIO_FN_ATAWR0_N, GPIO_FN_MSIOF2_SYNC,
+       GPIO_FN_EX_CS3_N, GPIO_FN_ATADIR0_N, GPIO_FN_MSIOF2_TXD,
+       GPIO_FN_ATAG0_N, GPIO_FN_EX_WAIT1,
+
+       /* IPSR3 */
+       GPIO_FN_EX_CS4_N, GPIO_FN_ATARD0_N,
+       GPIO_FN_MSIOF2_RXD, GPIO_FN_EX_WAIT2,
+       GPIO_FN_EX_CS5_N, GPIO_FN_ATACS00_N, GPIO_FN_MSIOF2_SS1,
+       GPIO_FN_HRX1_B, GPIO_FN_SCIFB1_RXD_B,
+       GPIO_FN_PWM1, GPIO_FN_TPU_TO1,
+       GPIO_FN_BS_N, GPIO_FN_ATACS10_N, GPIO_FN_MSIOF2_SS2,
+       GPIO_FN_HTX1_B, GPIO_FN_SCIFB1_TXD_B,
+       GPIO_FN_PWM2, GPIO_FN_TPU_TO2,
+       GPIO_FN_RD_WR_N, GPIO_FN_HRX2_B, GPIO_FN_FMIN_B,
+       GPIO_FN_SCIFB0_RXD_B, GPIO_FN_DREQ1_D,
+       GPIO_FN_WE0_N, GPIO_FN_HCTS2_N_B, GPIO_FN_SCIFB0_TXD_B,
+       GPIO_FN_WE1_N, GPIO_FN_ATARD0_N_B,
+       GPIO_FN_HTX2_B, GPIO_FN_SCIFB0_RTS_N_B,
+       GPIO_FN_EX_WAIT0, GPIO_FN_HRTS2_N_B, GPIO_FN_SCIFB0_CTS_N_B,
+       GPIO_FN_DREQ0, GPIO_FN_PWM3, GPIO_FN_TPU_TO3,
+       GPIO_FN_DACK0, GPIO_FN_DRACK0, GPIO_FN_REMOCON,
+       GPIO_FN_SPEEDIN, GPIO_FN_HSCK0_C, GPIO_FN_HSCK2_C,
+       GPIO_FN_SCIFB0_SCK_B, GPIO_FN_SCIFB2_SCK_B,
+       GPIO_FN_DREQ2_C, GPIO_FN_HTX2_D,
+       GPIO_FN_SSI_SCK0129, GPIO_FN_HRX0_C, GPIO_FN_HRX2_C,
+       GPIO_FN_SCIFB0_RXD_C, GPIO_FN_SCIFB2_RXD_C,
+       GPIO_FN_SSI_WS0129, GPIO_FN_HTX0_C, GPIO_FN_HTX2_C,
+       GPIO_FN_SCIFB0_TXD_C, GPIO_FN_SCIFB2_TXD_C,
+
+       /* IPSR4 */
+       GPIO_FN_SSI_SDATA0, GPIO_FN_SCL0_B,
+       GPIO_FN_SCL7_B, GPIO_FN_MSIOF2_SCK_C,
+       GPIO_FN_SSI_SCK1, GPIO_FN_SDA0_B, GPIO_FN_SDA7_B,
+       GPIO_FN_MSIOF2_SYNC_C, GPIO_FN_GLO_I0_D,
+       GPIO_FN_SSI_WS1, GPIO_FN_SCL1_B, GPIO_FN_SCL8_B,
+       GPIO_FN_MSIOF2_TXD_C, GPIO_FN_GLO_I1_D,
+       GPIO_FN_SSI_SDATA1, GPIO_FN_SDA1_B,
+       GPIO_FN_SDA8_B, GPIO_FN_MSIOF2_RXD_C,
+       GPIO_FN_SSI_SCK2, GPIO_FN_SCL2, GPIO_FN_GPS_CLK_B,
+       GPIO_FN_GLO_Q0_D, GPIO_FN_HSCK1_E,
+       GPIO_FN_SSI_WS2, GPIO_FN_SDA2, GPIO_FN_GPS_SIGN_B,
+       GPIO_FN_RX2_E, GPIO_FN_GLO_Q1_D, GPIO_FN_HCTS1_N_E,
+       GPIO_FN_SSI_SDATA2, GPIO_FN_GPS_MAG_B,
+       GPIO_FN_TX2_E, GPIO_FN_HRTS1_N_E,
+       GPIO_FN_SSI_SCK34, GPIO_FN_SSI_WS34, GPIO_FN_SSI_SDATA3,
+       GPIO_FN_SSI_SCK4, GPIO_FN_GLO_SS_D,
+       GPIO_FN_SSI_WS4, GPIO_FN_GLO_RFON_D,
+       GPIO_FN_SSI_SDATA4, GPIO_FN_MSIOF2_SCK_D,
+       GPIO_FN_SSI_SCK5, GPIO_FN_MSIOF1_SCK_C,
+       GPIO_FN_TS_SDATA0, GPIO_FN_GLO_I0,
+       GPIO_FN_MSIOF2_SYNC_D, GPIO_FN_VI1_R2_B,
+
+       /* IPSR5 */
+       GPIO_FN_SSI_WS5, GPIO_FN_MSIOF1_SYNC_C, GPIO_FN_TS_SCK0,
+       GPIO_FN_GLO_I1, GPIO_FN_MSIOF2_TXD_D, GPIO_FN_VI1_R3_B,
+       GPIO_FN_SSI_SDATA5, GPIO_FN_MSIOF1_TXD_C, GPIO_FN_TS_SDEN0,
+       GPIO_FN_GLO_Q0, GPIO_FN_MSIOF2_SS1_D, GPIO_FN_VI1_R4_B,
+       GPIO_FN_SSI_SCK6, GPIO_FN_MSIOF1_RXD_C, GPIO_FN_TS_SPSYNC0,
+       GPIO_FN_GLO_Q1, GPIO_FN_MSIOF2_RXD_D, GPIO_FN_VI1_R5_B,
+       GPIO_FN_SSI_WS6, GPIO_FN_GLO_SCLK,
+       GPIO_FN_MSIOF2_SS2_D, GPIO_FN_VI1_R6_B,
+       GPIO_FN_SSI_SDATA6, GPIO_FN_STP_IVCXO27_0_B,
+       GPIO_FN_GLO_SDATA, GPIO_FN_VI1_R7_B,
+       GPIO_FN_SSI_SCK78, GPIO_FN_STP_ISCLK_0_B, GPIO_FN_GLO_SS,
+       GPIO_FN_SSI_WS78, GPIO_FN_TX0_D, GPIO_FN_STP_ISD_0_B, GPIO_FN_GLO_RFON,
+       GPIO_FN_SSI_SDATA7, GPIO_FN_RX0_D, GPIO_FN_STP_ISEN_0_B,
+       GPIO_FN_SSI_SDATA8, GPIO_FN_TX1_D, GPIO_FN_STP_ISSYNC_0_B,
+       GPIO_FN_SSI_SCK9, GPIO_FN_RX1_D, GPIO_FN_GLO_SCLK_D,
+       GPIO_FN_SSI_WS9, GPIO_FN_TX3_D, GPIO_FN_CAN0_TX_D, GPIO_FN_GLO_SDATA_D,
+       GPIO_FN_SSI_SDATA9, GPIO_FN_RX3_D, GPIO_FN_CAN0_RX_D,
+
+       /* IPSR6 */
+       GPIO_FN_AUDIO_CLKB, GPIO_FN_STP_OPWM_0_B, GPIO_FN_MSIOF1_SCK_B,
+       GPIO_FN_SCIF_CLK, GPIO_FN_BPFCLK_E,
+       GPIO_FN_AUDIO_CLKC, GPIO_FN_SCIFB0_SCK_C, GPIO_FN_MSIOF1_SYNC_B,
+       GPIO_FN_RX2, GPIO_FN_SCIFA2_RXD, GPIO_FN_FMIN_E,
+       GPIO_FN_AUDIO_CLKOUT, GPIO_FN_MSIOF1_SS1_B,
+       GPIO_FN_TX2, GPIO_FN_SCIFA2_TXD,
+       GPIO_FN_IRQ0, GPIO_FN_SCIFB1_RXD_D, GPIO_FN_INTC_IRQ0_N,
+       GPIO_FN_IRQ1, GPIO_FN_SCIFB1_SCK_C, GPIO_FN_INTC_IRQ1_N,
+       GPIO_FN_IRQ2, GPIO_FN_SCIFB1_TXD_D, GPIO_FN_INTC_IRQ2_N,
+       GPIO_FN_IRQ3, GPIO_FN_SCL4_C,
+       GPIO_FN_MSIOF2_TXD_E, GPIO_FN_INTC_IRQ3_N,
+       GPIO_FN_IRQ4, GPIO_FN_HRX1_C, GPIO_FN_SDA4_C,
+       GPIO_FN_MSIOF2_RXD_E, GPIO_FN_INTC_IRQ4_N,
+       GPIO_FN_IRQ5, GPIO_FN_HTX1_C, GPIO_FN_SCL1_E, GPIO_FN_MSIOF2_SCK_E,
+       GPIO_FN_IRQ6, GPIO_FN_HSCK1_C, GPIO_FN_MSIOF1_SS2_B,
+       GPIO_FN_SDA1_E, GPIO_FN_MSIOF2_SYNC_E,
+       GPIO_FN_IRQ7, GPIO_FN_HCTS1_N_C, GPIO_FN_MSIOF1_TXD_B,
+       GPIO_FN_GPS_CLK_C, GPIO_FN_GPS_CLK_D,
+       GPIO_FN_IRQ8, GPIO_FN_HRTS1_N_C, GPIO_FN_MSIOF1_RXD_B,
+       GPIO_FN_GPS_SIGN_C, GPIO_FN_GPS_SIGN_D,
+
+       /* IPSR7 */
+       GPIO_FN_IRQ9, GPIO_FN_DU1_DOTCLKIN_B, GPIO_FN_CAN_CLK_D,
+       GPIO_FN_GPS_MAG_C, GPIO_FN_SCIF_CLK_B, GPIO_FN_GPS_MAG_D,
+       GPIO_FN_DU1_DR0, GPIO_FN_LCDOUT0, GPIO_FN_VI1_DATA0_B, GPIO_FN_TX0_B,
+       GPIO_FN_SCIFA0_TXD_B, GPIO_FN_MSIOF2_SCK_B,
+       GPIO_FN_DU1_DR1, GPIO_FN_LCDOUT1, GPIO_FN_VI1_DATA1_B, GPIO_FN_RX0_B,
+       GPIO_FN_SCIFA0_RXD_B, GPIO_FN_MSIOF2_SYNC_B,
+       GPIO_FN_DU1_DR2, GPIO_FN_LCDOUT2, GPIO_FN_SSI_SCK0129_B,
+       GPIO_FN_DU1_DR3, GPIO_FN_LCDOUT3, GPIO_FN_SSI_WS0129_B,
+       GPIO_FN_DU1_DR4, GPIO_FN_LCDOUT4, GPIO_FN_SSI_SDATA0_B,
+       GPIO_FN_DU1_DR5, GPIO_FN_LCDOUT5, GPIO_FN_SSI_SCK1_B,
+       GPIO_FN_DU1_DR6, GPIO_FN_LCDOUT6, GPIO_FN_SSI_WS1_B,
+       GPIO_FN_DU1_DR7, GPIO_FN_LCDOUT7, GPIO_FN_SSI_SDATA1_B,
+       GPIO_FN_DU1_DG0, GPIO_FN_LCDOUT8, GPIO_FN_VI1_DATA2_B, GPIO_FN_TX1_B,
+       GPIO_FN_SCIFA1_TXD_B, GPIO_FN_MSIOF2_SS1_B,
+       GPIO_FN_DU1_DG1, GPIO_FN_LCDOUT9, GPIO_FN_VI1_DATA3_B, GPIO_FN_RX1_B,
+       GPIO_FN_SCIFA1_RXD_B, GPIO_FN_MSIOF2_SS2_B,
+       GPIO_FN_DU1_DG2, GPIO_FN_LCDOUT10, GPIO_FN_VI1_DATA4_B,
+       GPIO_FN_SCIF1_SCK_B, GPIO_FN_SCIFA1_SCK, GPIO_FN_SSI_SCK78_B,
+
+       /* IPSR8 */
+       GPIO_FN_DU1_DG3, GPIO_FN_LCDOUT11,
+       GPIO_FN_VI1_DATA5_B, GPIO_FN_SSI_WS78_B,
+       GPIO_FN_DU1_DG4, GPIO_FN_LCDOUT12, GPIO_FN_VI1_DATA6_B,
+       GPIO_FN_HRX0_B, GPIO_FN_SCIFB2_RXD_B, GPIO_FN_SSI_SDATA7_B,
+       GPIO_FN_DU1_DG5, GPIO_FN_LCDOUT13, GPIO_FN_VI1_DATA7_B,
+       GPIO_FN_HCTS0_N_B, GPIO_FN_SCIFB2_TXD_B, GPIO_FN_SSI_SDATA8_B,
+       GPIO_FN_DU1_DG6, GPIO_FN_LCDOUT14, GPIO_FN_HRTS0_N_B,
+       GPIO_FN_SCIFB2_CTS_N_B, GPIO_FN_SSI_SCK9_B,
+       GPIO_FN_DU1_DG7, GPIO_FN_LCDOUT15, GPIO_FN_HTX0_B,
+       GPIO_FN_SCIFB2_RTS_N_B, GPIO_FN_SSI_WS9_B,
+       GPIO_FN_DU1_DB0, GPIO_FN_LCDOUT16, GPIO_FN_VI1_CLK_B, GPIO_FN_TX2_B,
+       GPIO_FN_SCIFA2_TXD_B, GPIO_FN_MSIOF2_TXD_B,
+       GPIO_FN_DU1_DB1, GPIO_FN_LCDOUT17, GPIO_FN_VI1_HSYNC_N_B,
+       GPIO_FN_RX2_B, GPIO_FN_SCIFA2_RXD_B, GPIO_FN_MSIOF2_RXD_B,
+       GPIO_FN_DU1_DB2, GPIO_FN_LCDOUT18, GPIO_FN_VI1_VSYNC_N_B,
+       GPIO_FN_SCIF2_SCK_B, GPIO_FN_SCIFA2_SCK, GPIO_FN_SSI_SDATA9_B,
+       GPIO_FN_DU1_DB3, GPIO_FN_LCDOUT19, GPIO_FN_VI1_CLKENB_B,
+       GPIO_FN_DU1_DB4, GPIO_FN_LCDOUT20,
+       GPIO_FN_VI1_FIELD_B, GPIO_FN_CAN1_RX,
+       GPIO_FN_DU1_DB5, GPIO_FN_LCDOUT21, GPIO_FN_TX3,
+       GPIO_FN_SCIFA3_TXD, GPIO_FN_CAN1_TX,
+
+       /* IPSR9 */
+       GPIO_FN_DU1_DB6, GPIO_FN_LCDOUT22, GPIO_FN_SCL3_C,
+       GPIO_FN_RX3, GPIO_FN_SCIFA3_RXD,
+       GPIO_FN_DU1_DB7, GPIO_FN_LCDOUT23, GPIO_FN_SDA3_C,
+       GPIO_FN_SCIF3_SCK, GPIO_FN_SCIFA3_SCK,
+       GPIO_FN_DU1_DOTCLKIN, GPIO_FN_QSTVA_QVS,
+       GPIO_FN_DU1_DOTCLKOUT0, GPIO_FN_QCLK,
+       GPIO_FN_DU1_DOTCLKOUT1, GPIO_FN_QSTVB_QVE, GPIO_FN_CAN0_TX,
+       GPIO_FN_TX3_B, GPIO_FN_SCL2_B, GPIO_FN_PWM4,
+       GPIO_FN_DU1_EXHSYNC_DU1_HSYNC, GPIO_FN_QSTH_QHS,
+       GPIO_FN_DU1_EXVSYNC_DU1_VSYNC, GPIO_FN_QSTB_QHE,
+       GPIO_FN_DU1_EXODDF_DU1_ODDF_DISP_CDE, GPIO_FN_QCPV_QDE,
+       GPIO_FN_CAN0_RX, GPIO_FN_RX3_B, GPIO_FN_SDA2_B,
+       GPIO_FN_DU1_DISP, GPIO_FN_QPOLA,
+       GPIO_FN_DU1_CDE, GPIO_FN_QPOLB, GPIO_FN_PWM4_B,
+       GPIO_FN_VI0_CLKENB, GPIO_FN_TX4,
+       GPIO_FN_SCIFA4_TXD, GPIO_FN_TS_SDATA0_D,
+       GPIO_FN_VI0_FIELD, GPIO_FN_RX4, GPIO_FN_SCIFA4_RXD, GPIO_FN_TS_SCK0_D,
+       GPIO_FN_VI0_HSYNC_N, GPIO_FN_TX5,
+       GPIO_FN_SCIFA5_TXD, GPIO_FN_TS_SDEN0_D,
+       GPIO_FN_VI0_VSYNC_N, GPIO_FN_RX5,
+       GPIO_FN_SCIFA5_RXD, GPIO_FN_TS_SPSYNC0_D,
+       GPIO_FN_VI0_DATA3_VI0_B3, GPIO_FN_SCIF3_SCK_B, GPIO_FN_SCIFA3_SCK_B,
+       GPIO_FN_VI0_G0, GPIO_FN_SCL8, GPIO_FN_STP_IVCXO27_0_C, GPIO_FN_SCL4,
+       GPIO_FN_HCTS2_N, GPIO_FN_SCIFB2_CTS_N, GPIO_FN_ATAWR1_N,
+
+       /* IPSR10 */
+       GPIO_FN_VI0_G1, GPIO_FN_SDA8, GPIO_FN_STP_ISCLK_0_C, GPIO_FN_SDA4,
+       GPIO_FN_HRTS2_N, GPIO_FN_SCIFB2_RTS_N, GPIO_FN_ATADIR1_N,
+       GPIO_FN_VI0_G2, GPIO_FN_VI2_HSYNC_N, GPIO_FN_STP_ISD_0_C,
+       GPIO_FN_SCL3_B, GPIO_FN_HSCK2, GPIO_FN_SCIFB2_SCK, GPIO_FN_ATARD1_N,
+       GPIO_FN_VI0_G3, GPIO_FN_VI2_VSYNC_N, GPIO_FN_STP_ISEN_0_C,
+       GPIO_FN_SDA3_B, GPIO_FN_HRX2, GPIO_FN_SCIFB2_RXD, GPIO_FN_ATACS01_N,
+       GPIO_FN_VI0_G4, GPIO_FN_VI2_CLKENB, GPIO_FN_STP_ISSYNC_0_C,
+       GPIO_FN_HTX2, GPIO_FN_SCIFB2_TXD, GPIO_FN_SCIFB0_SCK_D,
+       GPIO_FN_VI0_G5, GPIO_FN_VI2_FIELD, GPIO_FN_STP_OPWM_0_C,
+       GPIO_FN_FMCLK_D, GPIO_FN_CAN0_TX_E,
+       GPIO_FN_HTX1_D, GPIO_FN_SCIFB0_TXD_D,
+       GPIO_FN_VI0_G6, GPIO_FN_VI2_CLK, GPIO_FN_BPFCLK_D,
+       GPIO_FN_VI0_G7, GPIO_FN_VI2_DATA0, GPIO_FN_FMIN_D,
+       GPIO_FN_VI0_R0, GPIO_FN_VI2_DATA1, GPIO_FN_GLO_I0_B,
+       GPIO_FN_TS_SDATA0_C, GPIO_FN_ATACS11_N,
+       GPIO_FN_VI0_R1, GPIO_FN_VI2_DATA2, GPIO_FN_GLO_I1_B,
+       GPIO_FN_TS_SCK0_C, GPIO_FN_ATAG1_N,
+       GPIO_FN_VI0_R2, GPIO_FN_VI2_DATA3,
+       GPIO_FN_GLO_Q0_B, GPIO_FN_TS_SDEN0_C,
+       GPIO_FN_VI0_R3, GPIO_FN_VI2_DATA4,
+       GPIO_FN_GLO_Q1_B, GPIO_FN_TS_SPSYNC0_C,
+       GPIO_FN_VI0_R4, GPIO_FN_VI2_DATA5, GPIO_FN_GLO_SCLK_B,
+       GPIO_FN_TX0_C, GPIO_FN_SCL1_D,
+
+       /* IPSR11 */
+       GPIO_FN_VI0_R5, GPIO_FN_VI2_DATA6, GPIO_FN_GLO_SDATA_B,
+       GPIO_FN_RX0_C, GPIO_FN_SDA1_D,
+       GPIO_FN_VI0_R6, GPIO_FN_VI2_DATA7, GPIO_FN_GLO_SS_B,
+       GPIO_FN_TX1_C, GPIO_FN_SCL4_B,
+       GPIO_FN_VI0_R7, GPIO_FN_GLO_RFON_B, GPIO_FN_RX1_C, GPIO_FN_CAN0_RX_E,
+       GPIO_FN_SDA4_B, GPIO_FN_HRX1_D, GPIO_FN_SCIFB0_RXD_D,
+       GPIO_FN_VI1_HSYNC_N, GPIO_FN_AVB_RXD0, GPIO_FN_TS_SDATA0_B,
+       GPIO_FN_TX4_B, GPIO_FN_SCIFA4_TXD_B,
+       GPIO_FN_VI1_VSYNC_N, GPIO_FN_AVB_RXD1, GPIO_FN_TS_SCK0_B,
+       GPIO_FN_RX4_B, GPIO_FN_SCIFA4_RXD_B,
+       GPIO_FN_VI1_CLKENB, GPIO_FN_AVB_RXD2, GPIO_FN_TS_SDEN0_B,
+       GPIO_FN_VI1_FIELD, GPIO_FN_AVB_RXD3, GPIO_FN_TS_SPSYNC0_B,
+       GPIO_FN_VI1_CLK, GPIO_FN_AVB_RXD4, GPIO_FN_VI1_DATA0, GPIO_FN_AVB_RXD5,
+       GPIO_FN_VI1_DATA1, GPIO_FN_AVB_RXD6,
+       GPIO_FN_VI1_DATA2, GPIO_FN_AVB_RXD7,
+       GPIO_FN_VI1_DATA3, GPIO_FN_AVB_RX_ER,
+       GPIO_FN_VI1_DATA4, GPIO_FN_AVB_MDIO,
+       GPIO_FN_VI1_DATA5, GPIO_FN_AVB_RX_DV,
+       GPIO_FN_VI1_DATA6, GPIO_FN_AVB_MAGIC,
+       GPIO_FN_VI1_DATA7, GPIO_FN_AVB_MDC,
+       GPIO_FN_ETH_MDIO, GPIO_FN_AVB_RX_CLK, GPIO_FN_SCL2_C,
+       GPIO_FN_ETH_CRS_DV, GPIO_FN_AVB_LINK, GPIO_FN_SDA2_C,
+
+       /* IPSR12 */
+       GPIO_FN_ETH_RX_ER, GPIO_FN_AVB_CRS, GPIO_FN_SCL3, GPIO_FN_SCL7,
+       GPIO_FN_ETH_RXD0, GPIO_FN_AVB_PHY_INT, GPIO_FN_SDA3, GPIO_FN_SDA7,
+       GPIO_FN_ETH_RXD1, GPIO_FN_AVB_GTXREFCLK, GPIO_FN_CAN0_TX_C,
+       GPIO_FN_SCL2_D, GPIO_FN_MSIOF1_RXD_E,
+       GPIO_FN_ETH_LINK, GPIO_FN_AVB_TXD0, GPIO_FN_CAN0_RX_C,
+       GPIO_FN_SDA2_D, GPIO_FN_MSIOF1_SCK_E,
+       GPIO_FN_ETH_REFCLK, GPIO_FN_AVB_TXD1, GPIO_FN_SCIFA3_RXD_B,
+       GPIO_FN_CAN1_RX_C, GPIO_FN_MSIOF1_SYNC_E,
+       GPIO_FN_ETH_TXD1, GPIO_FN_AVB_TXD2, GPIO_FN_SCIFA3_TXD_B,
+       GPIO_FN_CAN1_TX_C, GPIO_FN_MSIOF1_TXD_E,
+       GPIO_FN_ETH_TX_EN, GPIO_FN_AVB_TXD3,
+       GPIO_FN_TCLK1_B, GPIO_FN_CAN_CLK_B,
+       GPIO_FN_ETH_MAGIC, GPIO_FN_AVB_TXD4, GPIO_FN_IETX_C,
+       GPIO_FN_ETH_TXD0, GPIO_FN_AVB_TXD5, GPIO_FN_IECLK_C,
+       GPIO_FN_ETH_MDC, GPIO_FN_AVB_TXD6, GPIO_FN_IERX_C,
+       GPIO_FN_STP_IVCXO27_0, GPIO_FN_AVB_TXD7, GPIO_FN_SCIFB2_TXD_D,
+       GPIO_FN_ADIDATA_B, GPIO_FN_MSIOF0_SYNC_C,
+       GPIO_FN_STP_ISCLK_0, GPIO_FN_AVB_TX_EN, GPIO_FN_SCIFB2_RXD_D,
+       GPIO_FN_ADICS_SAMP_B, GPIO_FN_MSIOF0_SCK_C,
+
+       /* IPSR13 */
+       GPIO_FN_STP_ISD_0, GPIO_FN_AVB_TX_ER, GPIO_FN_SCIFB2_SCK_C,
+       GPIO_FN_ADICLK_B, GPIO_FN_MSIOF0_SS1_C,
+       GPIO_FN_STP_ISEN_0, GPIO_FN_AVB_TX_CLK,
+       GPIO_FN_ADICHS0_B, GPIO_FN_MSIOF0_SS2_C,
+       GPIO_FN_STP_ISSYNC_0, GPIO_FN_AVB_COL,
+       GPIO_FN_ADICHS1_B, GPIO_FN_MSIOF0_RXD_C,
+       GPIO_FN_STP_OPWM_0, GPIO_FN_AVB_GTX_CLK, GPIO_FN_PWM0_B,
+       GPIO_FN_ADICHS2_B, GPIO_FN_MSIOF0_TXD_C,
+       GPIO_FN_SD0_CLK, GPIO_FN_SPCLK_B, GPIO_FN_SD0_CMD, GPIO_FN_MOSI_IO0_B,
+       GPIO_FN_SD0_DATA0, GPIO_FN_MISO_IO1_B,
+       GPIO_FN_SD0_DATA1, GPIO_FN_IO2_B,
+       GPIO_FN_SD0_DATA2, GPIO_FN_IO3_B, GPIO_FN_SD0_DATA3, GPIO_FN_SSL_B,
+       GPIO_FN_SD0_CD, GPIO_FN_MMC_D6_B,
+       GPIO_FN_SIM0_RST_B, GPIO_FN_CAN0_RX_F,
+       GPIO_FN_SCIFA5_TXD_B, GPIO_FN_TX3_C,
+       GPIO_FN_SD0_WP, GPIO_FN_MMC_D7_B, GPIO_FN_SIM0_D_B, GPIO_FN_CAN0_TX_F,
+       GPIO_FN_SCIFA5_RXD_B, GPIO_FN_RX3_C,
+       GPIO_FN_SD1_CMD, GPIO_FN_REMOCON_B,
+       GPIO_FN_SD1_DATA0, GPIO_FN_SPEEDIN_B,
+       GPIO_FN_SD1_DATA1, GPIO_FN_IETX_B, GPIO_FN_SD1_DATA2, GPIO_FN_IECLK_B,
+       GPIO_FN_SD1_DATA3, GPIO_FN_IERX_B,
+       GPIO_FN_SD1_CD, GPIO_FN_PWM0, GPIO_FN_TPU_TO0, GPIO_FN_SCL1_C,
+
+       /* IPSR14 */
+       GPIO_FN_SD1_WP, GPIO_FN_PWM1_B, GPIO_FN_SDA1_C,
+       GPIO_FN_SD2_CLK, GPIO_FN_MMC_CLK, GPIO_FN_SD2_CMD, GPIO_FN_MMC_CMD,
+       GPIO_FN_SD2_DATA0, GPIO_FN_MMC_D0, GPIO_FN_SD2_DATA1, GPIO_FN_MMC_D1,
+       GPIO_FN_SD2_DATA2, GPIO_FN_MMC_D2, GPIO_FN_SD2_DATA3, GPIO_FN_MMC_D3,
+       GPIO_FN_SD2_CD, GPIO_FN_MMC_D4, GPIO_FN_SCL8_C,
+       GPIO_FN_TX5_B, GPIO_FN_SCIFA5_TXD_C,
+       GPIO_FN_SD2_WP, GPIO_FN_MMC_D5, GPIO_FN_SDA8_C,
+       GPIO_FN_RX5_B, GPIO_FN_SCIFA5_RXD_C,
+       GPIO_FN_MSIOF0_SCK, GPIO_FN_RX2_C, GPIO_FN_ADIDATA,
+       GPIO_FN_VI1_CLK_C, GPIO_FN_VI1_G0_B,
+       GPIO_FN_MSIOF0_SYNC, GPIO_FN_TX2_C, GPIO_FN_ADICS_SAMP,
+       GPIO_FN_VI1_CLKENB_C, GPIO_FN_VI1_G1_B,
+       GPIO_FN_MSIOF0_TXD, GPIO_FN_ADICLK,
+       GPIO_FN_VI1_FIELD_C, GPIO_FN_VI1_G2_B,
+       GPIO_FN_MSIOF0_RXD, GPIO_FN_ADICHS0,
+       GPIO_FN_VI1_DATA0_C, GPIO_FN_VI1_G3_B,
+       GPIO_FN_MSIOF0_SS1, GPIO_FN_MMC_D6, GPIO_FN_ADICHS1, GPIO_FN_TX0_E,
+       GPIO_FN_VI1_HSYNC_N_C, GPIO_FN_SCL7_C, GPIO_FN_VI1_G4_B,
+       GPIO_FN_MSIOF0_SS2, GPIO_FN_MMC_D7, GPIO_FN_ADICHS2, GPIO_FN_RX0_E,
+       GPIO_FN_VI1_VSYNC_N_C, GPIO_FN_SDA7_C, GPIO_FN_VI1_G5_B,
+
+       /* IPSR15 */
+       GPIO_FN_SIM0_RST, GPIO_FN_IETX, GPIO_FN_CAN1_TX_D,
+       GPIO_FN_SIM0_CLK, GPIO_FN_IECLK, GPIO_FN_CAN_CLK_C,
+       GPIO_FN_SIM0_D, GPIO_FN_IERX, GPIO_FN_CAN1_RX_D,
+       GPIO_FN_GPS_CLK, GPIO_FN_DU1_DOTCLKIN_C, GPIO_FN_AUDIO_CLKB_B,
+       GPIO_FN_PWM5_B, GPIO_FN_SCIFA3_TXD_C,
+       GPIO_FN_GPS_SIGN, GPIO_FN_TX4_C, GPIO_FN_SCIFA4_TXD_C, GPIO_FN_PWM5,
+       GPIO_FN_VI1_G6_B, GPIO_FN_SCIFA3_RXD_C,
+       GPIO_FN_GPS_MAG, GPIO_FN_RX4_C, GPIO_FN_SCIFA4_RXD_C, GPIO_FN_PWM6,
+       GPIO_FN_VI1_G7_B, GPIO_FN_SCIFA3_SCK_C,
+       GPIO_FN_HCTS0_N, GPIO_FN_SCIFB0_CTS_N, GPIO_FN_GLO_I0_C,
+       GPIO_FN_TCLK1, GPIO_FN_VI1_DATA1_C,
+       GPIO_FN_HRTS0_N, GPIO_FN_SCIFB0_RTS_N,
+       GPIO_FN_GLO_I1_C, GPIO_FN_VI1_DATA2_C,
+       GPIO_FN_HSCK0, GPIO_FN_SCIFB0_SCK, GPIO_FN_GLO_Q0_C, GPIO_FN_CAN_CLK,
+       GPIO_FN_TCLK2, GPIO_FN_VI1_DATA3_C,
+       GPIO_FN_HRX0, GPIO_FN_SCIFB0_RXD, GPIO_FN_GLO_Q1_C,
+       GPIO_FN_CAN0_RX_B, GPIO_FN_VI1_DATA4_C,
+       GPIO_FN_HTX0, GPIO_FN_SCIFB0_TXD, GPIO_FN_GLO_SCLK_C,
+       GPIO_FN_CAN0_TX_B, GPIO_FN_VI1_DATA5_C,
+
+       /* IPSR16 */
+       GPIO_FN_HRX1, GPIO_FN_SCIFB1_RXD, GPIO_FN_VI1_R0_B,
+       GPIO_FN_GLO_SDATA_C, GPIO_FN_VI1_DATA6_C,
+       GPIO_FN_HTX1, GPIO_FN_SCIFB1_TXD, GPIO_FN_VI1_R1_B,
+       GPIO_FN_GLO_SS_C, GPIO_FN_VI1_DATA7_C,
+       GPIO_FN_HSCK1, GPIO_FN_SCIFB1_SCK, GPIO_FN_MLB_CK, GPIO_FN_GLO_RFON_C,
+       GPIO_FN_HCTS1_N, GPIO_FN_SCIFB1_CTS_N,
+       GPIO_FN_MLB_SIG, GPIO_FN_CAN1_TX_B,
+       GPIO_FN_HRTS1_N, GPIO_FN_SCIFB1_RTS_N,
+       GPIO_FN_MLB_DAT, GPIO_FN_CAN1_RX_B,
+};
+
+#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/include/asm/arch-rmobile/r8a7791.h b/arch/arm/include/asm/arch-rmobile/r8a7791.h
new file mode 100644 (file)
index 0000000..2afda0a
--- /dev/null
@@ -0,0 +1,664 @@
+/*
+ * arch/arm/include/asm/arch-rmobile/r8a7791.h
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __ASM_ARCH_R8A7791_H
+#define __ASM_ARCH_R8A7791_H
+
+/*
+ * R8A7791 I/O Addresses
+ */
+#define        RWDT_BASE       0xE6020000
+#define        SWDT_BASE       0xE6030000
+#define        LBSC_BASE       0xFEC00200
+#define DBSC3_0_BASE   0xE6790000
+#define DBSC3_1_BASE   0xE67A0000
+#define TMU_BASE       0xE61E0000
+#define        GPIO5_BASE      0xE6055000
+
+#define S3C_BASE       0xE6784000
+#define S3C_INT_BASE   0xE6784A00
+#define S3C_MEDIA_BASE 0xE6784B00
+
+#define S3C_QOS_DCACHE_BASE    0xE6784BDC
+#define S3C_QOS_CCI0_BASE      0xE6784C00
+#define S3C_QOS_CCI1_BASE      0xE6784C24
+#define S3C_QOS_MXI_BASE       0xE6784C48
+#define S3C_QOS_AXI_BASE       0xE6784C6C
+
+#define DBSC3_0_QOS_R0_BASE    0xE6791000
+#define DBSC3_0_QOS_R1_BASE    0xE6791100
+#define DBSC3_0_QOS_R2_BASE    0xE6791200
+#define DBSC3_0_QOS_R3_BASE    0xE6791300
+#define DBSC3_0_QOS_R4_BASE    0xE6791400
+#define DBSC3_0_QOS_R5_BASE    0xE6791500
+#define DBSC3_0_QOS_R6_BASE    0xE6791600
+#define DBSC3_0_QOS_R7_BASE    0xE6791700
+#define DBSC3_0_QOS_R8_BASE    0xE6791800
+#define DBSC3_0_QOS_R9_BASE    0xE6791900
+#define DBSC3_0_QOS_R10_BASE   0xE6791A00
+#define DBSC3_0_QOS_R11_BASE   0xE6791B00
+#define DBSC3_0_QOS_R12_BASE   0xE6791C00
+#define DBSC3_0_QOS_R13_BASE   0xE6791D00
+#define DBSC3_0_QOS_R14_BASE   0xE6791E00
+#define DBSC3_0_QOS_R15_BASE   0xE6791F00
+#define DBSC3_0_QOS_W0_BASE    0xE6792000
+#define DBSC3_0_QOS_W1_BASE    0xE6792100
+#define DBSC3_0_QOS_W2_BASE    0xE6792200
+#define DBSC3_0_QOS_W3_BASE    0xE6792300
+#define DBSC3_0_QOS_W4_BASE    0xE6792400
+#define DBSC3_0_QOS_W5_BASE    0xE6792500
+#define DBSC3_0_QOS_W6_BASE    0xE6792600
+#define DBSC3_0_QOS_W7_BASE    0xE6792700
+#define DBSC3_0_QOS_W8_BASE    0xE6792800
+#define DBSC3_0_QOS_W9_BASE    0xE6792900
+#define DBSC3_0_QOS_W10_BASE   0xE6792A00
+#define DBSC3_0_QOS_W11_BASE   0xE6792B00
+#define DBSC3_0_QOS_W12_BASE   0xE6792C00
+#define DBSC3_0_QOS_W13_BASE   0xE6792D00
+#define DBSC3_0_QOS_W14_BASE   0xE6792E00
+#define DBSC3_0_QOS_W15_BASE   0xE6792F00
+
+#define DBSC3_1_QOS_R0_BASE    0xE67A1000
+#define DBSC3_1_QOS_R1_BASE    0xE67A1100
+#define DBSC3_1_QOS_R2_BASE    0xE67A1200
+#define DBSC3_1_QOS_R3_BASE    0xE67A1300
+#define DBSC3_1_QOS_R4_BASE    0xE67A1400
+#define DBSC3_1_QOS_R5_BASE    0xE67A1500
+#define DBSC3_1_QOS_R6_BASE    0xE67A1600
+#define DBSC3_1_QOS_R7_BASE    0xE67A1700
+#define DBSC3_1_QOS_R8_BASE    0xE67A1800
+#define DBSC3_1_QOS_R9_BASE    0xE67A1900
+#define DBSC3_1_QOS_R10_BASE   0xE67A1A00
+#define DBSC3_1_QOS_R11_BASE   0xE67A1B00
+#define DBSC3_1_QOS_R12_BASE   0xE67A1C00
+#define DBSC3_1_QOS_R13_BASE   0xE67A1D00
+#define DBSC3_1_QOS_R14_BASE   0xE67A1E00
+#define DBSC3_1_QOS_R15_BASE   0xE67A1F00
+#define DBSC3_1_QOS_W0_BASE    0xE67A2000
+#define DBSC3_1_QOS_W1_BASE    0xE67A2100
+#define DBSC3_1_QOS_W2_BASE    0xE67A2200
+#define DBSC3_1_QOS_W3_BASE    0xE67A2300
+#define DBSC3_1_QOS_W4_BASE    0xE67A2400
+#define DBSC3_1_QOS_W5_BASE    0xE67A2500
+#define DBSC3_1_QOS_W6_BASE    0xE67A2600
+#define DBSC3_1_QOS_W7_BASE    0xE67A2700
+#define DBSC3_1_QOS_W8_BASE    0xE67A2800
+#define DBSC3_1_QOS_W9_BASE    0xE67A2900
+#define DBSC3_1_QOS_W10_BASE   0xE67A2A00
+#define DBSC3_1_QOS_W11_BASE   0xE67A2B00
+#define DBSC3_1_QOS_W12_BASE   0xE67A2C00
+#define DBSC3_1_QOS_W13_BASE   0xE67A2D00
+#define DBSC3_1_QOS_W14_BASE   0xE67A2E00
+#define DBSC3_1_QOS_W15_BASE   0xE67A2F00
+
+#define DBSC3_0_DBADJ2         0xE67900C8
+
+#define CCI_400_MAXOT_1                0xF0091110
+#define CCI_400_MAXOT_2                0xF0092110
+#define CCI_400_QOSCNTL_1      0xF009110C
+#define CCI_400_QOSCNTL_2      0xF009210C
+
+#define        MXI_BASE                0xFE960000
+#define        MXI_QOS_BASE            0xFE960300
+
+#define SYS_AXI_SYX64TO128_BASE        0xFF800300
+#define SYS_AXI_AVB_BASE       0xFF800340
+#define SYS_AXI_G2D_BASE       0xFF800540
+#define SYS_AXI_IMP0_BASE      0xFF800580
+#define SYS_AXI_IMP1_BASE      0xFF8005C0
+#define SYS_AXI_IMUX0_BASE     0xFF800600
+#define SYS_AXI_IMUX1_BASE     0xFF800640
+#define SYS_AXI_IMUX2_BASE     0xFF800680
+#define SYS_AXI_LBS_BASE       0xFF8006C0
+#define SYS_AXI_MMUDS_BASE     0xFF800700
+#define SYS_AXI_MMUM_BASE      0xFF800740
+#define SYS_AXI_MMUR_BASE      0xFF800780
+#define SYS_AXI_MMUS0_BASE     0xFF8007C0
+#define SYS_AXI_MMUS1_BASE     0xFF800800
+#define SYS_AXI_MTSB0_BASE     0xFF800880
+#define SYS_AXI_MTSB1_BASE     0xFF8008C0
+#define SYS_AXI_PCI_BASE       0xFF800900
+#define SYS_AXI_RTX_BASE       0xFF800940
+#define SYS_AXI_SDS0_BASE      0xFF800A80
+#define SYS_AXI_SDS1_BASE      0xFF800AC0
+#define SYS_AXI_USB20_BASE     0xFF800C00
+#define SYS_AXI_USB21_BASE     0xFF800C40
+#define SYS_AXI_USB22_BASE     0xFF800C80
+#define SYS_AXI_USB30_BASE     0xFF800CC0
+#define SYS_AXI_AX2M_BASE      0xFF800380
+#define SYS_AXI_CC50_BASE      0xFF8003C0
+#define SYS_AXI_CCI_BASE       0xFF800440
+#define SYS_AXI_CS_BASE                0xFF800480
+#define SYS_AXI_DDM_BASE       0xFF8004C0
+#define SYS_AXI_ETH_BASE       0xFF800500
+#define SYS_AXI_MPXM_BASE      0xFF800840
+#define SYS_AXI_SAT0_BASE      0xFF800980
+#define SYS_AXI_SAT1_BASE      0xFF8009C0
+#define SYS_AXI_SDM0_BASE      0xFF800A00
+#define SYS_AXI_SDM1_BASE      0xFF800A40
+#define SYS_AXI_TRAB_BASE      0xFF800B00
+#define SYS_AXI_UDM0_BASE      0xFF800B80
+#define SYS_AXI_UDM1_BASE      0xFF800BC0
+
+#define RT_AXI_SHX_BASE                0xFF810100
+#define RT_AXI_DBG_BASE                0xFF810140
+#define RT_AXI_RDM_BASE                0xFF810180
+#define RT_AXI_RDS_BASE                0xFF8101C0
+#define RT_AXI_RTX64TO128_BASE 0xFF810200
+#define RT_AXI_STPRO_BASE      0xFF810240
+#define RT_AXI_SY2RT_BASE      0xFF810280
+
+#define MP_AXI_ADSP_BASE       0xFF820100
+#define MP_AXI_ASDS0_BASE      0xFF8201C0
+#define MP_AXI_ASDS1_BASE      0xFF820200
+#define MP_AXI_MLP_BASE                0xFF820240
+#define MP_AXI_MMUMP_BASE      0xFF820280
+#define MP_AXI_SPU_BASE                0xFF8202C0
+#define MP_AXI_SPUC_BASE       0xFF820300
+
+#define SYS_AXI256_AXI128TO256_BASE    0xFF860100
+#define SYS_AXI256_SYX_BASE    0xFF860140
+#define SYS_AXI256_MPX_BASE    0xFF860180
+#define SYS_AXI256_MXI_BASE    0xFF8601C0
+
+#define CCI_AXI_MMUS0_BASE     0xFF880100
+#define CCI_AXI_SYX2_BASE      0xFF880140
+#define CCI_AXI_MMUR_BASE      0xFF880180
+#define CCI_AXI_MMUDS_BASE     0xFF8801C0
+#define CCI_AXI_MMUM_BASE      0xFF880200
+#define CCI_AXI_MXI_BASE       0xFF880240
+#define CCI_AXI_MMUS1_BASE     0xFF880280
+#define CCI_AXI_MMUMP_BASE     0xFF8802C0
+
+#define MEDIA_AXI_MXR_BASE     0xFE960080
+#define MEDIA_AXI_MXW_BASE     0xFE9600C0
+#define MEDIA_AXI_JPR_BASE     0xFE964100
+#define MEDIA_AXI_JPW_BASE     0xFE966100
+#define MEDIA_AXI_GCU0R_BASE   0xFE964140
+#define MEDIA_AXI_GCU0W_BASE   0xFE966140
+#define MEDIA_AXI_GCU1R_BASE   0xFE964180
+#define MEDIA_AXI_GCU1W_BASE   0xFE966180
+#define MEDIA_AXI_TDMR_BASE    0xFE964500
+#define MEDIA_AXI_TDMW_BASE    0xFE966500
+#define MEDIA_AXI_VSP0CR_BASE  0xFE964540
+#define MEDIA_AXI_VSP0CW_BASE  0xFE966540
+#define MEDIA_AXI_VSP1CR_BASE  0xFE964580
+#define MEDIA_AXI_VSP1CW_BASE  0xFE966580
+#define MEDIA_AXI_VSPDU0CR_BASE        0xFE9645C0
+#define MEDIA_AXI_VSPDU0CW_BASE        0xFE9665C0
+#define MEDIA_AXI_VSPDU1CR_BASE        0xFE964600
+#define MEDIA_AXI_VSPDU1CW_BASE        0xFE966600
+#define MEDIA_AXI_VIN0W_BASE   0xFE966900
+#define MEDIA_AXI_VSP0R_BASE   0xFE964D00
+#define MEDIA_AXI_VSP0W_BASE   0xFE966D00
+#define MEDIA_AXI_FDP0R_BASE   0xFE964D40
+#define MEDIA_AXI_FDP0W_BASE   0xFE966D40
+#define MEDIA_AXI_IMSR_BASE    0xFE964D80
+#define MEDIA_AXI_IMSW_BASE    0xFE966D80
+#define MEDIA_AXI_VSP1R_BASE   0xFE965100
+#define MEDIA_AXI_VSP1W_BASE   0xFE967100
+#define MEDIA_AXI_FDP1R_BASE   0xFE965140
+#define MEDIA_AXI_FDP1W_BASE   0xFE967140
+#define MEDIA_AXI_IMRR_BASE    0xFE965180
+#define MEDIA_AXI_IMRW_BASE    0xFE967180
+#define MEDIA_AXI_FDP2R_BASE   0xFE9651C0
+#define MEDIA_AXI_FDP2W_BASE   0xFE966DC0
+#define MEDIA_AXI_VSPD0R_BASE  0xFE965500
+#define MEDIA_AXI_VSPD0W_BASE  0xFE967500
+#define MEDIA_AXI_VSPD1R_BASE  0xFE965540
+#define MEDIA_AXI_VSPD1W_BASE  0xFE967540
+#define MEDIA_AXI_DU0R_BASE    0xFE965580
+#define MEDIA_AXI_DU0W_BASE    0xFE967580
+#define MEDIA_AXI_DU1R_BASE    0xFE9655C0
+#define MEDIA_AXI_DU1W_BASE    0xFE9675C0
+#define MEDIA_AXI_VCP0CR_BASE  0xFE965900
+#define MEDIA_AXI_VCP0CW_BASE  0xFE967900
+#define MEDIA_AXI_VCP0VR_BASE  0xFE965940
+#define MEDIA_AXI_VCP0VW_BASE  0xFE967940
+#define MEDIA_AXI_VPC0R_BASE   0xFE965980
+#define MEDIA_AXI_VCP1CR_BASE  0xFE965D00
+#define MEDIA_AXI_VCP1CW_BASE  0xFE967D00
+#define MEDIA_AXI_VCP1VR_BASE  0xFE965D40
+#define MEDIA_AXI_VCP1VW_BASE  0xFE967D40
+#define MEDIA_AXI_VPC1R_BASE   0xFE965D80
+
+#define SYS_AXI_AVBDMSCR       0xFF802000
+#define SYS_AXI_SYX2DMSCR      0xFF802004
+#define SYS_AXI_CC50DMSCR      0xFF802008
+#define SYS_AXI_CC51DMSCR      0xFF80200C
+#define SYS_AXI_CCIDMSCR       0xFF802010
+#define SYS_AXI_CSDMSCR                0xFF802014
+#define SYS_AXI_DDMDMSCR       0xFF802018
+#define SYS_AXI_ETHDMSCR       0xFF80201C
+#define SYS_AXI_G2DDMSCR       0xFF802020
+#define SYS_AXI_IMP0DMSCR      0xFF802024
+#define SYS_AXI_IMP1DMSCR      0xFF802028
+#define SYS_AXI_LBSDMSCR       0xFF80202C
+#define SYS_AXI_MMUDSDMSCR     0xFF802030
+#define SYS_AXI_MMUMXDMSCR     0xFF802034
+#define SYS_AXI_MMURDDMSCR     0xFF802038
+#define SYS_AXI_MMUS0DMSCR     0xFF80203C
+#define SYS_AXI_MMUS1DMSCR     0xFF802040
+#define SYS_AXI_MPXDMSCR       0xFF802044
+#define SYS_AXI_MTSB0DMSCR     0xFF802048
+#define SYS_AXI_MTSB1DMSCR     0xFF80204C
+#define SYS_AXI_PCIDMSCR       0xFF802050
+#define SYS_AXI_RTXDMSCR       0xFF802054
+#define SYS_AXI_SAT0DMSCR      0xFF802058
+#define SYS_AXI_SAT1DMSCR      0xFF80205C
+#define SYS_AXI_SDM0DMSCR      0xFF802060
+#define SYS_AXI_SDM1DMSCR      0xFF802064
+#define SYS_AXI_SDS0DMSCR      0xFF802068
+#define SYS_AXI_SDS1DMSCR      0xFF80206C
+#define SYS_AXI_ETRABDMSCR     0xFF802070
+#define SYS_AXI_ETRKFDMSCR     0xFF802074
+#define SYS_AXI_UDM0DMSCR      0xFF802078
+#define SYS_AXI_UDM1DMSCR      0xFF80207C
+#define SYS_AXI_USB20DMSCR     0xFF802080
+#define SYS_AXI_USB21DMSCR     0xFF802084
+#define SYS_AXI_USB22DMSCR     0xFF802088
+#define SYS_AXI_USB30DMSCR     0xFF80208C
+#define SYS_AXI_X128TO64SLVDMSCR       0xFF802100
+#define SYS_AXI_X64TO128SLVDMSCR       0xFF802104
+#define SYS_AXI_AVBSLVDMSCR    0xFF802108
+#define SYS_AXI_SYX2SLVDMSCR   0xFF80210C
+#define SYS_AXI_ETHSLVDMSCR    0xFF802110
+#define SYS_AXI_GICSLVDMSCR    0xFF802114
+#define SYS_AXI_IMPSLVDMSCR    0xFF802118
+#define SYS_AXI_IMX0SLVDMSCR   0xFF80211C
+#define SYS_AXI_IMX1SLVDMSCR   0xFF802120
+#define SYS_AXI_IMX2SLVDMSCR   0xFF802124
+#define SYS_AXI_LBSSLVDMSCR    0xFF802128
+#define SYS_AXI_MMC0SLVDMSCR   0xFF80212C
+#define SYS_AXI_MMC1SLVDMSCR   0xFF802130
+#define SYS_AXI_MPXSLVDMSCR    0xFF802134
+#define SYS_AXI_MTSB0SLVDMSCR  0xFF802138
+#define SYS_AXI_MTSB1SLVDMSCR  0xFF80213C
+#define SYS_AXI_MXTSLVDMSCR    0xFF802140
+#define SYS_AXI_PCISLVDMSCR    0xFF802144
+#define SYS_AXI_SYAPBSLVDMSCR  0xFF802148
+#define SYS_AXI_QSAPBSLVDMSCR  0xFF80214C
+#define SYS_AXI_RTXSLVDMSCR    0xFF802150
+#define SYS_AXI_SAT0SLVDMSCR   0xFF802168
+#define SYS_AXI_SAT1SLVDMSCR   0xFF80216C
+#define SYS_AXI_SDAP0SLVDMSCR  0xFF802170
+#define SYS_AXI_SDAP1SLVDMSCR  0xFF802174
+#define SYS_AXI_SDAP2SLVDMSCR  0xFF802178
+#define SYS_AXI_SDAP3SLVDMSCR  0xFF80217C
+#define SYS_AXI_SGXSLVDMSCR    0xFF802180
+#define SYS_AXI_STBSLVDMSCR    0xFF802188
+#define SYS_AXI_STMSLVDMSCR    0xFF80218C
+#define SYS_AXI_TSPL0SLVDMSCR  0xFF802194
+#define SYS_AXI_TSPL1SLVDMSCR  0xFF802198
+#define SYS_AXI_TSPL2SLVDMSCR  0xFF80219C
+#define SYS_AXI_USB20SLVDMSCR  0xFF8021A0
+#define SYS_AXI_USB21SLVDMSCR  0xFF8021A4
+#define SYS_AXI_USB22SLVDMSCR  0xFF8021A8
+#define SYS_AXI_USB30SLVDMSCR  0xFF8021AC
+
+#define RT_AXI_CBMDMSCR                0xFF812000
+#define RT_AXI_DBDMSCR         0xFF812004
+#define RT_AXI_RDMDMSCR                0xFF812008
+#define RT_AXI_RDSDMSCR                0xFF81200C
+#define RT_AXI_STRDMSCR                0xFF812010
+#define RT_AXI_SY2RTDMSCR      0xFF812014
+#define RT_AXI_CBSSLVDMSCR     0xFF812100
+#define RT_AXI_DBSSLVDMSCR     0xFF812104
+#define RT_AXI_RTAP1SLVDMSCR   0xFF812108
+#define RT_AXI_RTAP2SLVDMSCR   0xFF81210C
+#define RT_AXI_RTAP3SLVDMSCR   0xFF812110
+#define RT_AXI_RT2SYSLVDMSCR   0xFF812114
+#define RT_AXI_A128TO64SLVDMSCR        0xFF812118
+#define RT_AXI_A64TO128SLVDMSCR        0xFF81211C
+#define RT_AXI_A64TO128CSLVDMSCR       0xFF812120
+#define RT_AXI_UTLBRSLVDMSCR   0xFF812128
+
+#define MP_AXI_ADSPDMSCR       0xFF822000
+#define MP_AXI_ASDM0DMSCR      0xFF822004
+#define MP_AXI_ASDM1DMSCR      0xFF822008
+#define MP_AXI_ASDS0DMSCR      0xFF82200C
+#define MP_AXI_ASDS1DMSCR      0xFF822010
+#define MP_AXI_MLPDMSCR                0xFF822014
+#define MP_AXI_MMUMPDMSCR      0xFF822018
+#define MP_AXI_SPUDMSCR                0xFF82201C
+#define MP_AXI_SPUCDMSCR       0xFF822020
+#define MP_AXI_SY2MPDMSCR      0xFF822024
+#define MP_AXI_ADSPSLVDMSCR    0xFF822100
+#define MP_AXI_MLMSLVDMSCR     0xFF822104
+#define MP_AXI_MPAP4SLVDMSCR   0xFF822108
+#define MP_AXI_MPAP5SLVDMSCR   0xFF82210C
+#define MP_AXI_MPAP6SLVDMSCR   0xFF822110
+#define MP_AXI_MPAP7SLVDMSCR   0xFF822114
+#define MP_AXI_MP2SYSLVDMSCR   0xFF822118
+#define MP_AXI_MP2SY2SLVDMSCR  0xFF82211C
+#define MP_AXI_MPXAPSLVDMSCR   0xFF822124
+#define MP_AXI_SPUSLVDMSCR     0xFF822128
+#define MP_AXI_UTLBMPSLVDMSCR  0xFF82212C
+
+#define ADM_AXI_ASDM0DMSCR     0xFF842000
+#define ADM_AXI_ASDM1DMSCR     0xFF842004
+#define ADM_AXI_MPAP1SLVDMSCR  0xFF842104
+#define ADM_AXI_MPAP2SLVDMSCR  0xFF842108
+#define ADM_AXI_MPAP3SLVDMSCR  0xFF84210C
+
+#define DM_AXI_RDMDMSCR                0xFF852000
+#define DM_AXI_SDM0DMSCR       0xFF852004
+#define DM_AXI_SDM1DMSCR       0xFF852008
+#define DM_AXI_MMAP0SLVDMSCR   0xFF852100
+#define DM_AXI_MMAP1SLVDMSCR   0xFF852104
+#define DM_AXI_QSPAPSLVDMSCR   0xFF852108
+#define DM_AXI_RAP4SLVDMSCR    0xFF85210C
+#define DM_AXI_RAP5SLVDMSCR    0xFF852110
+#define DM_AXI_SAP4SLVDMSCR    0xFF852114
+#define DM_AXI_SAP5SLVDMSCR    0xFF852118
+#define DM_AXI_SAP6SLVDMSCR    0xFF85211C
+#define DM_AXI_SAP65SLVDMSCR   0xFF852120
+#define DM_AXI_SDAP0SLVDMSCR   0xFF852124
+#define DM_AXI_SDAP1SLVDMSCR   0xFF852128
+#define DM_AXI_SDAP2SLVDMSCR   0xFF85212C
+#define DM_AXI_SDAP3SLVDMSCR   0xFF852130
+
+#define SYS_AXI256_SYXDMSCR    0xFF862000
+#define SYS_AXI256_MPXDMSCR    0xFF862004
+#define SYS_AXI256_MXIDMSCR    0xFF862008
+#define SYS_AXI256_X128TO256SLVDMSCR   0xFF862100
+#define SYS_AXI256_X256TO128SLVDMSCR   0xFF862104
+#define SYS_AXI256_SYXSLVDMSCR 0xFF862108
+#define SYS_AXI256_CCXSLVDMSCR 0xFF86210C
+#define SYS_AXI256_S3CSLVDMSCR 0xFF862110
+
+#define MXT_SYXDMSCR           0xFF872000
+#define MXT_CMM0SLVDMSCR       0xFF872100
+#define MXT_CMM1SLVDMSCR       0xFF872104
+#define MXT_CMM2SLVDMSCR       0xFF872108
+#define MXT_FDPSLVDMSCR                0xFF87210C
+#define MXT_IMRSLVDMSCR                0xFF872110
+#define MXT_VINSLVDMSCR                0xFF872114
+#define MXT_VPC0SLVDMSCR       0xFF872118
+#define MXT_VPC1SLVDMSCR       0xFF87211C
+#define MXT_VSP0SLVDMSCR       0xFF872120
+#define MXT_VSP1SLVDMSCR       0xFF872124
+#define MXT_VSPD0SLVDMSCR      0xFF872128
+#define MXT_VSPD1SLVDMSCR      0xFF87212C
+#define MXT_MAP1SLVDMSCR       0xFF872130
+#define MXT_MAP2SLVDMSCR       0xFF872134
+
+#define CCI_AXI_MMUS0DMSCR     0xFF882000
+#define CCI_AXI_SYX2DMSCR      0xFF882004
+#define CCI_AXI_MMURDMSCR      0xFF882008
+#define CCI_AXI_MMUDSDMSCR     0xFF88200C
+#define CCI_AXI_MMUMDMSCR      0xFF882010
+#define CCI_AXI_MXIDMSCR       0xFF882014
+#define CCI_AXI_MMUS1DMSCR     0xFF882018
+#define CCI_AXI_MMUMPDMSCR     0xFF88201C
+#define CCI_AXI_DVMDMSCR       0xFF882020
+#define CCI_AXI_CCISLVDMSCR    0xFF882100
+
+#define CCI_AXI_IPMMUIDVMCR    0xFF880400
+#define CCI_AXI_IPMMURDVMCR    0xFF880404
+#define CCI_AXI_IPMMUS0DVMCR   0xFF880408
+#define CCI_AXI_IPMMUS1DVMCR   0xFF88040C
+#define CCI_AXI_IPMMUMPDVMCR   0xFF880410
+#define CCI_AXI_IPMMUDSDVMCR   0xFF880414
+#define CCI_AXI_AX2ADDRMASK    0xFF88041C
+
+#ifndef __ASSEMBLY__
+#include <asm/types.h>
+
+/* RWDT */
+struct r8a7791_rwdt {
+       u32 rwtcnt;     /* 0x00 */
+       u32 rwtcsra;    /* 0x04 */
+       u16 rwtcsrb;    /* 0x08 */
+};
+
+/* SWDT */
+struct r8a7791_swdt {
+       u32 swtcnt;     /* 0x00 */
+       u32 swtcsra;    /* 0x04 */
+       u16 swtcsrb;    /* 0x08 */
+};
+
+/* LBSC */
+struct r8a7791_lbsc {
+       u32 cs0ctrl;
+       u32 cs1ctrl;
+       u32 ecs0ctrl;
+       u32 ecs1ctrl;
+       u32 ecs2ctrl;
+       u32 ecs3ctrl;
+       u32 ecs4ctrl;
+       u32 ecs5ctrl;
+       u32 dummy0[4];  /* 0x20 .. 0x2C */
+       u32 cswcr0;
+       u32 cswcr1;
+       u32 ecswcr0;
+       u32 ecswcr1;
+       u32 ecswcr2;
+       u32 ecswcr3;
+       u32 ecswcr4;
+       u32 ecswcr5;
+       u32 exdmawcr0;
+       u32 exdmawcr1;
+       u32 exdmawcr2;
+       u32 dummy1[9];  /* 0x5C .. 0x7C */
+       u32 cspwcr0;
+       u32 cspwcr1;
+       u32 ecspwcr0;
+       u32 ecspwcr1;
+       u32 ecspwcr2;
+       u32 ecspwcr3;
+       u32 ecspwcr4;
+       u32 ecspwcr5;
+       u32 exwtsync;
+       u32 dummy2[3];  /* 0xA4 .. 0xAC */
+       u32 cs0bstctl;
+       u32 cs0btph;
+       u32 dummy3[2];  /* 0xB8 .. 0xBC */
+       u32 cs1gdst;
+       u32 ecs0gdst;
+       u32 ecs1gdst;
+       u32 ecs2gdst;
+       u32 ecs3gdst;
+       u32 ecs4gdst;
+       u32 ecs5gdst;
+       u32 dummy4[5];  /* 0xDC .. 0xEC */
+       u32 exdmaset0;
+       u32 exdmaset1;
+       u32 exdmaset2;
+       u32 dummy5[5];  /* 0xFC .. 0x10C */
+       u32 exdmcr0;
+       u32 exdmcr1;
+       u32 exdmcr2;
+       u32 dummy6[5];  /* 0x11C .. 0x12C */
+       u32 bcintsr;
+       u32 bcintcr;
+       u32 bcintmr;
+       u32 dummy7;     /* 0x13C */
+       u32 exbatlv;
+       u32 exwtsts;
+       u32 dummy8[14]; /* 0x148 .. 0x17C */
+       u32 atacsctrl;
+       u32 dummy9[15]; /* 0x184 .. 0x1BC */
+       u32 exbct;
+       u32 extct;
+};
+
+/* DBSC3 */
+struct r8a7791_dbsc3 {
+       u32 dummy0[3];  /* 0x00 .. 0x08 */
+       u32 dbstate1;
+       u32 dbacen;
+       u32 dbrfen;
+       u32 dbcmd;
+       u32 dbwait;
+       u32 dbkind;
+       u32 dbconf0;
+       u32 dummy1[2];  /* 0x28 .. 0x2C */
+       u32 dbphytype;
+       u32 dummy2[3];  /* 0x34 .. 0x3C */
+       u32 dbtr0;
+       u32 dbtr1;
+       u32 dbtr2;
+       u32 dummy3;     /* 0x4C */
+       u32 dbtr3;
+       u32 dbtr4;
+       u32 dbtr5;
+       u32 dbtr6;
+       u32 dbtr7;
+       u32 dbtr8;
+       u32 dbtr9;
+       u32 dbtr10;
+       u32 dbtr11;
+       u32 dbtr12;
+       u32 dbtr13;
+       u32 dbtr14;
+       u32 dbtr15;
+       u32 dbtr16;
+       u32 dbtr17;
+       u32 dbtr18;
+       u32 dbtr19;
+       u32 dummy4[7];  /* 0x94 .. 0xAC */
+       u32 dbbl;
+       u32 dummy5[3];  /* 0xB4 .. 0xBC */
+       u32 dbadj0;
+       u32 dummy6;     /* 0xC4 */
+       u32 dbadj2;
+       u32 dummy7[5];  /* 0xCC .. 0xDC */
+       u32 dbrfcnf0;
+       u32 dbrfcnf1;
+       u32 dbrfcnf2;
+       u32 dummy8[2];  /* 0xEC .. 0xF0 */
+       u32 dbcalcnf;
+       u32 dbcaltr;
+       u32 dummy9;     /* 0xFC */
+       u32 dbrnk0;
+       u32 dummy10[31];        /* 0x104 .. 0x17C */
+       u32 dbpdncnf;
+       u32 dummy11[47];        /* 0x184 ..0x23C */
+       u32 dbdfistat;
+       u32 dbdficnt;
+       u32 dummy12[14];        /* 0x248 .. 0x27C */
+       u32 dbpdlck;
+       u32 dummy13[3]; /* 0x284 .. 0x28C */
+       u32 dbpdrga;
+       u32 dummy14[3]; /* 0x294 .. 0x29C */
+       u32 dbpdrgd;
+       u32 dummy15[24];        /* 0x2A4 .. 0x300 */
+       u32 dbbs0cnt1;
+       u32 dummy16[30];        /* 0x308 .. 0x37C */
+       u32 dbwt0cnf0;
+       u32 dbwt0cnf1;
+       u32 dbwt0cnf2;
+       u32 dbwt0cnf3;
+       u32 dbwt0cnf4;
+};
+
+/* GPIO */
+struct r8a7791_gpio {
+       u32 iointsel;
+       u32 inoutsel;
+       u32 outdt;
+       u32 indt;
+       u32 intdt;
+       u32 intclr;
+       u32 intmsk;
+       u32 posneg;
+       u32 edglevel;
+       u32 filonoff;
+       u32 intmsks;
+       u32 mskclrs;
+       u32 outdtsel;
+       u32 outdth;
+       u32 outdtl;
+       u32 bothedge;
+};
+
+/* S3C(QoS) */
+struct r8a7791_s3c {
+       u32 s3cexcladdmsk;
+       u32 s3cexclidmsk;
+       u32 s3cadsplcr;
+       u32 s3cmaar;
+       u32 dummy0;     /* 0x10 */
+       u32 s3crorr;
+       u32 s3cworr;
+       u32 s3carcr22;
+       u32 dummy1[2];  /* 0x20 .. 0x24 */
+       u32 s3cmctr;
+       u32 dummy2;     /* 0x2C */
+       u32 cconf0;
+       u32 cconf1;
+       u32 cconf2;
+       u32 cconf3;
+};
+
+struct r8a7791_s3c_qos {
+       u32 s3cqos0;
+       u32 s3cqos1;
+       u32 s3cqos2;
+       u32 s3cqos3;
+       u32 s3cqos4;
+       u32 s3cqos5;
+       u32 s3cqos6;
+       u32 s3cqos7;
+       u32 s3cqos8;
+};
+
+/* DBSC(QoS) */
+struct r8a7791_dbsc3_qos {
+       u32 dblgcnt;
+       u32 dbtmval0;
+       u32 dbtmval1;
+       u32 dbtmval2;
+       u32 dbtmval3;
+       u32 dbrqctr;
+       u32 dbthres0;
+       u32 dbthres1;
+       u32 dbthres2;
+       u32 dummy0;     /* 0x24 */
+       u32 dblgqon;
+};
+
+/* MXI(QoS) */
+struct r8a7791_mxi {
+       u32 mxsaar0;
+       u32 mxsaar1;
+       u32 dummy0[8];  /* 0x08 .. 0x24 */
+       u32 mxs3cracr;
+       u32 dummy1[3];  /* 0x2C .. 0x34 */
+       u32 mxs3cwacr;
+       u32 dummy2;     /* 0x3C */
+       u32 mxrtcr;
+       u32 mxwtcr;
+};
+
+struct r8a7791_mxi_qos {
+       u32 vspdu0;
+       u32 vspdu1;
+       u32 du0;
+       u32 du1;
+};
+
+/* AXI(QoS) */
+struct r8a7791_axi_qos {
+       u32 qosconf;
+       u32 qosctset0;
+       u32 qosctset1;
+       u32 qosctset2;
+       u32 qosctset3;
+       u32 qosreqctr;
+       u32 qosthres0;
+       u32 qosthres1;
+       u32 qosthres2;
+       u32 qosqon;
+};
+
+#endif
+
+#endif /* __ASM_ARCH_R8A7791_H */
index ac17561..2382565 100644 (file)
@@ -6,6 +6,10 @@
 #include <asm/arch/sh73a0.h>
 #elif defined(CONFIG_R8A7740)
 #include <asm/arch/r8a7740.h>
+#elif defined(CONFIG_R8A7790)
+#include <asm/arch/r8a7790.h>
+#elif defined(CONFIG_R8A7791)
+#include <asm/arch/r8a7791.h>
 #else
 #error "SOC Name not defined"
 #endif
index 55ff10b..dd473c8 100644 (file)
@@ -55,7 +55,7 @@
 
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
-static inline unsigned int s5p_mmc_init(int index, int bus_width)
+static inline int s5p_mmc_init(int index, int bus_width)
 {
        unsigned int base = samsung_get_base_mmc() +
                                 (S5P_MMC_DEV_OFFSET * index);
diff --git a/arch/arm/include/asm/arch-socfpga/freeze_controller.h b/arch/arm/include/asm/arch-socfpga/freeze_controller.h
new file mode 100644 (file)
index 0000000..120f20e
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  Copyright (C) 2013 Altera Corporation <www.altera.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef        _FREEZE_CONTROLLER_H_
+#define        _FREEZE_CONTROLLER_H_
+
+struct socfpga_freeze_controller {
+       u32     vioctrl;
+       u32     padding[3];
+       u32     hioctrl;
+       u32     src;
+       u32     hwctrl;
+};
+
+#define FREEZE_CHANNEL_NUM             (4)
+
+typedef enum {
+       FREEZE_CTRL_FROZEN = 0,
+       FREEZE_CTRL_THAWED = 1
+} FREEZE_CTRL_CHAN_STATE;
+
+#define SYSMGR_FRZCTRL_ADDRESS 0x40
+#define SYSMGR_FRZCTRL_SRC_VIO1_ENUM_SW 0x0
+#define SYSMGR_FRZCTRL_SRC_VIO1_ENUM_HW 0x1
+#define SYSMGR_FRZCTRL_VIOCTRL_SLEW_MASK 0x00000010
+#define SYSMGR_FRZCTRL_VIOCTRL_WKPULLUP_MASK 0x00000008
+#define SYSMGR_FRZCTRL_VIOCTRL_TRISTATE_MASK 0x00000004
+#define SYSMGR_FRZCTRL_VIOCTRL_BUSHOLD_MASK 0x00000002
+#define SYSMGR_FRZCTRL_VIOCTRL_CFG_MASK 0x00000001
+#define SYSMGR_FRZCTRL_HIOCTRL_SLEW_MASK 0x00000010
+#define SYSMGR_FRZCTRL_HIOCTRL_WKPULLUP_MASK 0x00000008
+#define SYSMGR_FRZCTRL_HIOCTRL_TRISTATE_MASK 0x00000004
+#define SYSMGR_FRZCTRL_HIOCTRL_BUSHOLD_MASK 0x00000002
+#define SYSMGR_FRZCTRL_HIOCTRL_CFG_MASK 0x00000001
+#define SYSMGR_FRZCTRL_HIOCTRL_REGRST_MASK 0x00000080
+#define SYSMGR_FRZCTRL_HIOCTRL_OCTRST_MASK 0x00000040
+#define SYSMGR_FRZCTRL_HIOCTRL_OCT_CFGEN_CALSTART_MASK 0x00000100
+#define SYSMGR_FRZCTRL_HIOCTRL_DLLRST_MASK 0x00000020
+#define SYSMGR_FRZCTRL_HWCTRL_VIO1REQ_MASK 0x00000001
+#define SYSMGR_FRZCTRL_HWCTRL_VIO1STATE_ENUM_FROZEN 0x2
+#define SYSMGR_FRZCTRL_HWCTRL_VIO1STATE_ENUM_THAWED 0x1
+#define SYSMGR_FRZCTRL_VIOCTRL_SHIFT 0x2
+
+void sys_mgr_frzctrl_freeze_req(void);
+void sys_mgr_frzctrl_thaw_req(void);
+
+#endif /* _FREEZE_CONTROLLER_H_ */
index 1b94a99..d9d521a 100644 (file)
        (0xFF << EMIF_SYS_ADDR_SHIFT))
 
 #define EMIF_EXT_PHY_CTRL_TIMING_REG   0x5
-#define EMIF_EXT_PHY_CTRL_CONST_REG    0x14
 
 /* Reg mapping structure */
 struct emif_reg_struct {
@@ -641,7 +640,9 @@ struct emif_reg_struct {
        u32 emif_ddr_phy_ctrl_2;
        u32 padding7[12];
        u32 emif_rd_wr_exec_thresh;
-       u32 padding8[55];
+       u32 padding8[7];
+       u32 emif_ddr_phy_status[21];
+       u32 padding9[27];
        u32 emif_ddr_ext_phy_ctrl_1;
        u32 emif_ddr_ext_phy_ctrl_1_shdw;
        u32 emif_ddr_ext_phy_ctrl_2;
@@ -690,6 +691,9 @@ struct emif_reg_struct {
        u32 emif_ddr_ext_phy_ctrl_23_shdw;
        u32 emif_ddr_ext_phy_ctrl_24;
        u32 emif_ddr_ext_phy_ctrl_24_shdw;
+       u32 padding[22];
+       u32 emif_ddr_fifo_misaligned_clear_1;
+       u32 emif_ddr_fifo_misaligned_clear_2;
 };
 
 struct dmm_lisa_map_regs {
@@ -1139,6 +1143,11 @@ struct lpddr2_mr_regs {
        s8 mr16;
 };
 
+struct read_write_regs {
+       u32 read_reg;
+       u32 write_reg;
+};
+
 /* assert macros */
 #if defined(DEBUG)
 #define emif_assert(c) ({ if (!(c)) for (;;); })
@@ -1167,4 +1176,5 @@ extern u32 *const T_den;
 
 void config_data_eye_leveling_samples(u32 emif_base);
 u32 emif_sdram_type(void);
+const struct read_write_regs *get_bug_regs(u32 *iterations);
 #endif
index 8a395e8..a78f990 100644 (file)
@@ -226,6 +226,7 @@ struct prcm_regs {
        u32 cm_l3init_hsusbotg_clkctrl;
        u32 cm_l3init_hsusbtll_clkctrl;
        u32 cm_l3init_p1500_clkctrl;
+       u32 cm_l3init_sata_clkctrl;
        u32 cm_l3init_fsusb_clkctrl;
        u32 cm_l3init_ocp2scp1_clkctrl;
        u32 cm_l3init_ocp2scp3_clkctrl;
@@ -366,6 +367,7 @@ struct omap_sys_ctrl_regs {
        u32 control_ldosram_mpu_voltage_ctrl;
        u32 control_ldosram_core_voltage_ctrl;
        u32 control_usbotghs_ctrl;
+       u32 control_phy_power_sata;
        u32 control_padconf_core_base;
        u32 control_paconf_global;
        u32 control_paconf_mode;
@@ -605,6 +607,14 @@ static inline u8 is_omap54xx(void)
        extern u32 *const omap_si_rev;
        return ((*omap_si_rev & 0xFF000000) == OMAP54xx);
 }
+
+#define DRA7XX         0x07000000
+
+static inline u8 is_dra7xx(void)
+{
+       extern u32 *const omap_si_rev;
+       return ((*omap_si_rev & 0xFF000000) == DRA7XX);
+}
 #endif
 
 /*
index f476a89..dff10ba 100644 (file)
@@ -326,3 +326,26 @@ int bootz_setup(ulong image, ulong *start, ulong *end)
 }
 
 #endif /* CONFIG_CMD_BOOTZ */
+
+#if defined(CONFIG_BOOTM_VXWORKS)
+void boot_prep_vxworks(bootm_headers_t *images)
+{
+#if defined(CONFIG_OF_LIBFDT)
+       int off;
+
+       if (images->ft_addr) {
+               off = fdt_path_offset(images->ft_addr, "/memory");
+               if (off < 0) {
+                       if (arch_fixup_memory_node(images->ft_addr))
+                               puts("## WARNING: fixup memory failed!\n");
+               }
+       }
+#endif
+       cleanup_before_linux();
+}
+void boot_jump_vxworks(bootm_headers_t *images)
+{
+       /* ARM VxWorks requires device tree physical address to be passed */
+       ((void (*)(void *))images->ep)(images->ft_addr);
+}
+#endif
index 35f8716..73fa798 100644 (file)
@@ -14,9 +14,9 @@ CONFIG_BFIN_CPU := \
        $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \
                $(src)include/configs/$(BOARD).h)
 else
-CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
+CONFIG_BFIN_CPU := $(strip $(CONFIG_BFIN_CPU:"%"=%))
 endif
-CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
+CONFIG_BFIN_BOOT_MODE := $(strip $(CONFIG_BFIN_BOOT_MODE:"%"=%))
 
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
index ba986d8..3df1fa2 100644 (file)
@@ -1,4 +1,2 @@
-bootrom-asm-offsets.[chs]
-
 init.lds
 init.elf
index 243dc22..a61594a 100644 (file)
@@ -23,16 +23,6 @@ obj-y  += traps.o
 
 extra-y += check_initcode
 
-extra-y += bootrom-asm-offsets.h
-$(obj)bootrom-asm-offsets.c: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk
-       echo '#include <asm/mach-common/bits/bootrom.h>' | $(CPP) $(CPPFLAGS) - | gawk -f ./bootrom-asm-offsets.awk > $@.tmp
-       mv $@.tmp $@
-$(obj)bootrom-asm-offsets.s: $(obj)bootrom-asm-offsets.c
-       $(CC) $(CFLAGS) -S $^ -o $@.tmp
-       mv $@.tmp $@
-$(obj)bootrom-asm-offsets.h: $(obj)bootrom-asm-offsets.s
-       sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^ > $@
-
 # make sure our initcode (which goes into LDR) does not
 # have relocs or external references
 $(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
diff --git a/arch/blackfin/cpu/bootrom-asm-offsets.awk b/arch/blackfin/cpu/bootrom-asm-offsets.awk
deleted file mode 100644 (file)
index 1d61824..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/gawk -f
-BEGIN {
-       print "/* DO NOT EDIT: AUTOMATICALLY GENERATED"
-       print " * Input files: bootrom-asm-offsets.awk bootrom-asm-offsets.c.in"
-       print " * DO NOT EDIT: AUTOMATICALLY GENERATED"
-       print " */"
-       print ""
-       system("cat bootrom-asm-offsets.c.in")
-       print "{"
-}
-
-{
-       /* find a structure definition */
-       if ($0 ~ /typedef struct .* {/) {
-               delete members;
-               i = 0;
-
-               /* extract each member of the structure */
-               while (1) {
-                       getline
-                       if ($1 == "}")
-                               break;
-                       gsub(/[*;]/, "");
-                       members[i++] = $NF;
-               }
-
-               /* grab the structure's name */
-               struct = $NF;
-               sub(/;$/, "", struct);
-
-               /* output the DEFINE() macros */
-               while (i-- > 0)
-                       print "\tDEFINE(" struct ", " members[i] ");"
-               print ""
-       }
-}
-
-END {
-       print "\treturn 0;"
-       print "}"
-}
diff --git a/arch/blackfin/cpu/bootrom-asm-offsets.c.in b/arch/blackfin/cpu/bootrom-asm-offsets.c.in
deleted file mode 100644 (file)
index 64c2f24..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* A little trick taken from the kernel asm-offsets.h where we convert
- * the C structures automatically into a bunch of defines for use in
- * the assembly files.
- */
-
-#include <linux/stddef.h>
-#include <asm/mach-common/bits/bootrom.h>
-
-#define _DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
-#define DEFINE(s, m) _DEFINE(offset_##s##_##m, offsetof(s, m))
-
-int main(int argc, char * const argv[])
index 5e9c68a..86da706 100644 (file)
@@ -12,7 +12,7 @@
 #include <asm/gpio.h>
 #include <asm/portmux.h>
 
-#ifdef CONFIG_ADI_GPIO1
+#ifndef CONFIG_ADI_GPIO2
 #if ANOMALY_05000311 || ANOMALY_05000323
 enum {
        AWA_data = SYSCR,
index ffaf101..2e640af 100644 (file)
@@ -18,8 +18,6 @@
 #include <asm/mach-common/bits/core.h>
 #include <asm/serial.h>
 
-#define BUG() while (1) asm volatile("emuexcpt;");
-
 #ifndef __ADSPBF60x__
 #include <asm/mach-common/bits/ebiu.h>
 #include <asm/mach-common/bits/pll.h>
@@ -147,8 +145,6 @@ static struct ddr_config ddr_config_table[] = {
 __attribute__((always_inline))
 static inline void serial_init(void)
 {
-       uint32_t uart_base = UART_BASE;
-
 #if defined(__ADSPBF54x__) || defined(__ADSPBF60x__)
 # ifdef BFIN_BOOT_UART_USE_RTS
 #  define BFIN_UART_USE_RTS 1
@@ -156,6 +152,7 @@ static inline void serial_init(void)
 #  define BFIN_UART_USE_RTS 0
 # endif
        if (BFIN_UART_USE_RTS && CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
+               uint32_t uart_base = UART_BASE;
                size_t i;
 
                /* force RTS rather than relying on auto RTS */
@@ -195,8 +192,8 @@ static inline void serial_init(void)
 
 #if CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS
        if (BFIN_DEBUG_EARLY_SERIAL) {
-               serial_early_init(uart_base);
-               serial_early_set_baud(uart_base, CONFIG_BAUDRATE);
+               serial_early_init(UART_BASE);
+               serial_early_set_baud(UART_BASE, CONFIG_BAUDRATE);
        }
 #endif
 }
@@ -547,7 +544,7 @@ maybe_self_refresh(ADI_BOOT_DATA *bs)
 __attribute__((always_inline)) static inline u16
 program_clocks(ADI_BOOT_DATA *bs, bool put_into_srfs)
 {
-       u16 vr_ctl;
+       u16 vr_ctl = 0;
 
        serial_putc('a');
 
@@ -731,6 +728,8 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB)
 
        serial_putc('a');
 
+       if (BFIN_DEBUG_EARLY_SERIAL ||
+               CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
 #ifdef __ADSPBF60x__
        sdivR = bfin_read_CGU_DIV();
        sdivR = ((sdivR >> 8) & 0x1f) * ((sdivR >> 5) & 0x7);
@@ -744,6 +743,8 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB)
        divisor = vcoB * sdivR;
        quotient = early_division(dividend, divisor);
        serial_early_put_div(quotient - ANOMALY_05000230);
+       }
+
        serial_putc('c');
 }
 
@@ -913,7 +914,8 @@ check_hibernation(ADI_BOOT_DATA *bs, u16 vr_ctl, bool put_into_srfs)
                        continue;
 
                serial_putc('z');
-               uint32_t *hibernate_magic = bfin_read32(DPM0_RESTORE4);
+               uint32_t *hibernate_magic =
+                       (uint32_t *)bfin_read32(DPM0_RESTORE4);
                SSYNC(); /* make sure memory controller is done */
                if (hibernate_magic[0] == 0xDEADBEEF) {
                        serial_putc('c');
index 8ea8cde..4d6eeab 100644 (file)
@@ -81,6 +81,8 @@ extern void blackfin_dcache_flush_invalidate_range(const void *, const void *);
 # define NOP_PAD_ANOMALY_05000198
 #endif
 
+#define BFIN_BUG() while (1) asm volatile("emuexcpt;");
+
 #define _bfin_readX(addr, size, asm_size, asm_ext) ({ \
        u32 __v; \
        __asm__ __volatile__( \
@@ -111,7 +113,7 @@ extern void blackfin_dcache_flush_invalidate_range(const void *, const void *);
        sizeof(*(addr)) == 1 ? bfin_read8(addr)  : \
        sizeof(*(addr)) == 2 ? bfin_read16(addr) : \
        sizeof(*(addr)) == 4 ? bfin_read32(addr) : \
-       ({ BUG(); 0; }); \
+       ({ BFIN_BUG(); 0; }); \
 })
 #define bfin_write(addr, val) \
 do { \
@@ -119,7 +121,8 @@ do { \
        case 1: bfin_write8(addr, val);  break; \
        case 2: bfin_write16(addr, val); break; \
        case 4: bfin_write32(addr, val); break; \
-       default: BUG(); \
+       default: \
+               BFIN_BUG(); \
        } \
 } while (0)
 
index 376ec02..6ebcf01 100644 (file)
@@ -72,7 +72,7 @@
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_ADI_GPIO1
+#ifndef CONFIG_ADI_GPIO2
 void set_gpio_dir(unsigned, unsigned short);
 void set_gpio_inen(unsigned, unsigned short);
 void set_gpio_polar(unsigned, unsigned short);
index 17d1f46..392d72d 100644 (file)
@@ -19,6 +19,7 @@
 #include <net.h>
 #include <status_led.h>
 #include <version.h>
+#include <watchdog.h>
 
 #include <asm/cplb.h>
 #include <asm/mach-common/bits/mpu.h>
index 97795e1..7ed56a7 100644 (file)
@@ -36,7 +36,10 @@ u_long get_vco(void)
 u_long get_cclk(void)
 {
        static u_long cached_cclk_pll_div, cached_cclk;
-       u_long div, csel, ssel;
+       u_long div, csel;
+#ifndef CGU_DIV
+       u_long ssel;
+#endif
 
        if (pll_is_bypassed())
                return CONFIG_CLKIN_HZ;
index e6bb935..f75c3bf 100644 (file)
@@ -9,8 +9,9 @@ CROSS_COMPILE ?= ppc_8xx-
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 LDFLAGS_FINAL += --gc-sections
-PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
-PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
+PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections \
+                                                               -meabi
+PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ -ffixed-r2
 PLATFORM_LDFLAGS  += -n
 
 # Support generic board on PPC
index 9053191..96812a0 100644 (file)
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -ffixed-r2 -mstring
+PLATFORM_CPPFLAGS += -DCONFIG_74xx_7xx -mstring
index d630abe..88b5298 100644 (file)
@@ -1,3 +1,3 @@
-ifneq ($(filter mpc83xx mpc85xx mpc86xx,$(CPU)),)
-obj-y += mpc8xxx/
-endif
+obj-$(CONFIG_MPC83xx) += mpc8xxx/
+obj-$(CONFIG_MPC85xx) += mpc8xxx/
+obj-$(CONFIG_MPC86xx) += mpc8xxx/
index 04717a4..03759e6 100644 (file)
@@ -4,7 +4,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \
-                       -ffixed-r2 -msoft-float -mcpu=603e
+PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 -msoft-float -mcpu=603e
index b33f17a..31e2dc9 100644 (file)
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS +=   -meabi
-
-PLATFORM_CPPFLAGS +=   -DCONFIG_5xx -ffixed-r2 -mpowerpc -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_5xx -mpowerpc -msoft-float
index 57bdd2d..3384f6f 100644 (file)
@@ -5,7 +5,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 \
+PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx \
                     -mstring -mcpu=603e -mmultiple
index ef605f0..a224bc8 100644 (file)
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -mstring -mcpu=603e -msoft-float
index 91b0497..dfac710 100644 (file)
@@ -5,7 +5,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 \
+PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 \
                     -mstring -mcpu=603e -mmultiple
index c345dd6..cf91162 100644 (file)
@@ -38,9 +38,7 @@ obj-$(CONFIG_OF_LIBFDT) += fdt.o
 # Stub implementations of cache management functions for USB
 obj-y += cache.o
 
-ifdef CONFIG_SYS_FSL_DDR2
-obj-$(CONFIG_MPC8349) += $(SRCTREE)/drivers/ddr/fsl/mpc85xx_ddr_gen2.o
-else
+ifndef CONFIG_SYS_FSL_DDRC_GEN2
 obj-y += spd_sdram.o
 endif
 obj-$(CONFIG_SYS_FSL_DDR2) += law.o
index c16a003..dfce4d5 100644 (file)
@@ -4,7 +4,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 \
-                       -ffixed-r2 -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_MPC83xx -DCONFIG_E300 -msoft-float
index 9eef539..72c964c 100644 (file)
@@ -5,13 +5,10 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string
+PLATFORM_CPPFLAGS += -Wa,-me500 -msoft-float -mno-string
 
 # -mspe=yes is needed to have -mno-spe accepted by a buggy GCC;
 # see "[PATCH,rs6000] make -mno-spe work as expected" on
 # http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html
-PF_CPPFLAGS_SPE := $(call cc-option,-mspe=yes) \
+PLATFORM_CPPFLAGS += $(call cc-option,-mspe=yes) \
                   $(call cc-option,-mno-spe)
-PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_SPE)
index 1a58a19..7c7467f 100644 (file)
@@ -86,6 +86,14 @@ void get_sys_info(sys_info_t *sys_info)
        mem_pll_rat = (in_be32(&gur->rcwsr[0]) >>
                        FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT)
                        & FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
+       /* T4240/T4160 Rev2.0 MEM_PLL_RAT uses a value which is half of
+        * T4240/T4160 Rev1.0. eg. It's 12 in Rev1.0, however, for Rev2.0
+        * it uses 6.
+        */
+#if defined(CONFIG_PPC_T4240) || defined(CONFIG_PPC_T4160)
+       if (SVR_MAJ(get_svr()) >= 2)
+               mem_pll_rat *= 2;
+#endif
        if (mem_pll_rat > 2)
                sys_info->freq_ddrbus *= mem_pll_rat;
        else
@@ -221,6 +229,9 @@ void get_sys_info(sys_info_t *sys_info)
        case 4:
                sys_info->freq_fman[1] = freq_c_pll[CONFIG_SYS_FM2_CLK + 1] / 4;
                break;
+       case 5:
+               sys_info->freq_fman[1] = sys_info->freq_systembus;
+               break;
        case 6:
                sys_info->freq_fman[1] = freq_c_pll[CONFIG_SYS_FM2_CLK] / 2;
                break;
index 6a81fa7..db84d10 100644 (file)
@@ -886,7 +886,11 @@ delete_ccsr_l2_tlb:
        erratum_set_dcsr 0xb0008 0x00900000
        erratum_set_dcsr 0xb0e40 0xe00a0000
        erratum_set_ccsr 0x18600 CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY
+#ifdef  CONFIG_RAMBOOT_PBL
+       erratum_set_ccsr 0x10f00 0x495e5000
+#else
        erratum_set_ccsr 0x10f00 0x415e5000
+#endif
        erratum_set_ccsr 0x11f00 0x415e5000
 
        /* Make temp mapping uncacheable again, if it was initially */
index 5dbf6a8..69a0b96 100644 (file)
@@ -5,7 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -ffixed-r2 -mstring
-PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float
+PLATFORM_CPPFLAGS += -mstring -maltivec -mabi=altivec -msoft-float
index c04e733..ee2c883 100644 (file)
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-
-PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -mstring -mcpu=860 -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_8xx -mstring -mcpu=860 -msoft-float
index f66ee2e..e95539e 100644 (file)
@@ -19,10 +19,8 @@ ifdef MINIMAL
 obj-$(CONFIG_FSL_LAW) += law.o
 
 else
-
-ifneq ($(CPU),mpc83xx)
-obj-y  += cpu.o
-endif
+obj-$(CONFIG_MPC85xx) += cpu.o
+obj-$(CONFIG_MPC86xx) += cpu.o
 
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
index c2b0f9a..71c2a6c 100644 (file)
@@ -5,8 +5,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -meabi
-PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_4xx -mstring -msoft-float
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
 is440:=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg))
index 99e16bd..244ccbf 100644 (file)
@@ -711,7 +711,7 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
 #define CONFIG_FM_PLAT_CLK_DIV 1
 #define CONFIG_SYS_FM1_CLK             CONFIG_FM_PLAT_CLK_DIV
 #define CONFIG_SYS_FM_MURAM_SIZE       0x30000
-#define CONFIG_SYS_FSL_TBCLK_DIV       32
+#define CONFIG_SYS_FSL_TBCLK_DIV       16
 #define CONFIG_SYS_FSL_PCIE_COMPAT     "fsl,qoriq-pcie-v2.4"
 #define CONFIG_SYS_FSL_USB1_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB2_PHY_ENABLE
index e7153b0..41fc8f7 100644 (file)
@@ -32,6 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 extern ulong get_effective_memsize(void);
 static ulong get_sp (void);
+extern void ft_fixup_num_cores(void *blob);
 static void set_clocks_in_mhz (bd_t *kbd);
 
 #ifndef CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE
@@ -277,3 +278,58 @@ static void set_clocks_in_mhz (bd_t *kbd)
 #endif /* CONFIG_MPC5xxx */
        }
 }
+
+#if defined(CONFIG_BOOTM_VXWORKS)
+void boot_prep_vxworks(bootm_headers_t *images)
+{
+#if defined(CONFIG_OF_LIBFDT)
+       int off;
+       u64 base, size;
+
+       if (!images->ft_addr)
+               return;
+
+       base = (u64)gd->bd->bi_memstart;
+       size = (u64)gd->bd->bi_memsize;
+
+       off = fdt_path_offset(images->ft_addr, "/memory");
+       if (off < 0)
+               fdt_fixup_memory(images->ft_addr, base, size);
+
+#if defined(CONFIG_MP)
+#if defined(CONFIG_MPC85xx)
+       ft_fixup_cpu(images->ft_addr, base + size);
+       ft_fixup_num_cores(images->ft_addr);
+#elif defined(CONFIG_MPC86xx)
+       off = fdt_add_mem_rsv(images->ft_addr,
+                       determine_mp_bootpg(NULL), (u64)4096);
+       if (off < 0)
+               printf("## WARNING %s: %s\n", __func__, fdt_strerror(off));
+       ft_fixup_num_cores(images->ft_addr);
+#endif
+       flush_cache((unsigned long)images->ft_addr, images->ft_len);
+#endif
+#endif
+}
+
+void boot_jump_vxworks(bootm_headers_t *images)
+{
+       /* PowerPC VxWorks boot interface conforms to the ePAPR standard
+        * general purpuse registers:
+        *
+        *      r3: Effective address of the device tree image
+        *      r4: 0
+        *      r5: 0
+        *      r6: ePAPR magic value
+        *      r7: shall be the size of the boot IMA in bytes
+        *      r8: 0
+        *      r9: 0
+        *      TCR: WRC = 0, no watchdog timer reset will occur
+        */
+       WATCHDOG_RESET();
+
+       ((void (*)(void *, ulong, ulong, ulong,
+               ulong, ulong, ulong))images->ep)(images->ft_addr,
+               0, 0, EPAPR_MAGIC, getenv_bootm_mapsize(), 0, 0);
+}
+#endif
index db66fd3..26f44cb 100644 (file)
@@ -161,7 +161,7 @@ static struct option *long_opts;
 
 int os_parse_args(struct sandbox_state *state, int argc, char *argv[])
 {
-       struct sb_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
+       struct sandbox_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
        size_t num_options = __u_boot_sandbox_option_count();
        size_t i;
 
index f1cb793..1b15454 100644 (file)
@@ -13,7 +13,7 @@
 int sandbox_early_getopt_check(void)
 {
        struct sandbox_state *state = state_get_current();
-       struct sb_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
+       struct sandbox_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
        size_t num_options = __u_boot_sandbox_option_count();
        size_t i;
        int max_arg_len, max_noarg_len;
@@ -40,7 +40,7 @@ int sandbox_early_getopt_check(void)
        max_noarg_len = max_arg_len + 7;
 
        for (i = 0; i < num_options; ++i) {
-               struct sb_cmdline_option *opt = sb_opt[i];
+               struct sandbox_cmdline_option *opt = sb_opt[i];
 
                /* first output the short flag if it has one */
                if (opt->flag_short >= 0x100)
@@ -61,12 +61,12 @@ int sandbox_early_getopt_check(void)
        os_exit(0);
 }
 
-static int sb_cmdline_cb_help(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char *arg)
 {
        /* just flag to sandbox_early_getopt_check to show usage */
        return 1;
 }
-SB_CMDLINE_OPT_SHORT(help, 'h', 0, "Display help");
+SANDBOX_CMDLINE_OPT_SHORT(help, 'h', 0, "Display help");
 
 int sandbox_main_loop_init(void)
 {
@@ -81,19 +81,20 @@ int sandbox_main_loop_init(void)
        return 0;
 }
 
-static int sb_cmdline_cb_command(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_command(struct sandbox_state *state,
+                                     const char *arg)
 {
        state->cmd = arg;
        return 0;
 }
-SB_CMDLINE_OPT_SHORT(command, 'c', 1, "Execute U-Boot command");
+SANDBOX_CMDLINE_OPT_SHORT(command, 'c', 1, "Execute U-Boot command");
 
-static int sb_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
 {
        state->fdt_fname = arg;
        return 0;
 }
-SB_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
+SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
 
 int main(int argc, char *argv[])
 {
index 7755a4d..ec7729e 100644 (file)
@@ -9,4 +9,12 @@
 
 #define CONFIG_SANDBOX_ARCH
 
+/* Used by drivers/spi/sandbox_spi.c and arch/sandbox/include/asm/state.h */
+#ifndef CONFIG_SANDBOX_SPI_MAX_BUS
+#define CONFIG_SANDBOX_SPI_MAX_BUS 1
+#endif
+#ifndef CONFIG_SANDBOX_SPI_MAX_CS
+#define CONFIG_SANDBOX_SPI_MAX_CS 10
+#endif
+
 #endif
index 685883c..3048c2c 100644 (file)
@@ -18,7 +18,7 @@ struct sandbox_state;
  * consumer code should focus on the macros below and
  * the callback function.
  */
-struct sb_cmdline_option {
+struct sandbox_cmdline_option {
        /* The long flag name: "help" for "--help" */
        const char *flag;
        /* The (optional) short flag name: "h" for "-h" */
@@ -35,18 +35,19 @@ struct sb_cmdline_option {
  * Internal macro to expand the lower macros into the necessary
  * magic junk that makes this all work.
  */
-#define _SB_CMDLINE_OPT(f, s, ha, h) \
-       static struct sb_cmdline_option sb_cmdline_option_##f = { \
+#define _SANDBOX_CMDLINE_OPT(f, s, ha, h) \
+       static struct sandbox_cmdline_option sandbox_cmdline_option_##f = { \
                .flag = #f, \
                .flag_short = s, \
                .help = h, \
                .has_arg = ha, \
-               .callback = sb_cmdline_cb_##f, \
+               .callback = sandbox_cmdline_cb_##f, \
        }; \
        /* Ppointer to the struct in a special section for the linker script */ \
        static __attribute__((section(".u_boot_sandbox_getopt"), used)) \
-               struct sb_cmdline_option *sb_cmdline_option_##f##_ptr = \
-               &sb_cmdline_option_##f
+               struct sandbox_cmdline_option \
+                       *sandbox_cmdline_option_##f##_ptr = \
+                       &sandbox_cmdline_option_##f
 
 /**
  * Macros for end code to declare new command line flags.
@@ -56,16 +57,16 @@ struct sb_cmdline_option {
  * @param h   The help string displayed when showing --help
  *
  * This invocation:
- *   SB_CMDLINE_OPT(foo, 0, "The foo arg");
+ *   SANDBOX_CMDLINE_OPT(foo, 0, "The foo arg");
  * Will create a new flag named "--foo" (no short option) that takes
  * no argument.  If the user specifies "--foo", then the callback func
- * sb_cmdline_cb_foo() will automatically be called.
+ * sandbox_cmdline_cb_foo() will automatically be called.
  */
-#define SB_CMDLINE_OPT(f, ha, h) _SB_CMDLINE_OPT(f, 0, ha, h)
+#define SANDBOX_CMDLINE_OPT(f, ha, h) _SANDBOX_CMDLINE_OPT(f, 0, ha, h)
 /*
  * Same as above, but @s is used to specify a short flag e.g.
- *   SB_CMDLINE_OPT(foo, 'f', 0, "The foo arg");
+ *   SANDBOX_CMDLINE_OPT(foo, 'f', 0, "The foo arg");
  */
-#define SB_CMDLINE_OPT_SHORT(f, s, ha, h) _SB_CMDLINE_OPT(f, s, ha, h)
+#define SANDBOX_CMDLINE_OPT_SHORT(f, s, ha, h) _SANDBOX_CMDLINE_OPT(f, s, ha, h)
 
 #endif
index 4c37860..fbc1bd1 100644 (file)
@@ -11,9 +11,9 @@
 
 #include <asm-generic/sections.h>
 
-struct sb_cmdline_option;
+struct sandbox_cmdline_option;
 
-extern struct sb_cmdline_option *__u_boot_sandbox_option_start[],
+extern struct sandbox_cmdline_option *__u_boot_sandbox_option_start[],
        *__u_boot_sandbox_option_end[];
 
 static inline size_t __u_boot_sandbox_option_count(void)
diff --git a/arch/sandbox/include/asm/spi.h b/arch/sandbox/include/asm/spi.h
new file mode 100644 (file)
index 0000000..49b4a0f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Simulate a SPI port and clients (see README.sandbox for details)
+ *
+ * Copyright (c) 2011-2013 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __ASM_SPI_H__
+#define __ASM_SPI_H__
+
+#include <linux/types.h>
+
+/*
+ * The interface between the SPI bus and the SPI client.  The bus will
+ * instantiate a client, and that then call into it via these entry
+ * points.  These should be enough for the client to emulate the SPI
+ * device just like the real hardware.
+ */
+struct sandbox_spi_emu_ops {
+       /* The bus wants to instantiate a new client, so setup everything */
+       int (*setup)(void **priv, const char *spec);
+       /* The bus is done with us, so break things down */
+       void (*free)(void *priv);
+       /* The CS has been "activated" -- we won't worry about low/high */
+       void (*cs_activate)(void *priv);
+       /* The CS has been "deactivated" -- we won't worry about low/high */
+       void (*cs_deactivate)(void *priv);
+       /* The client is rx-ing bytes from the bus, so it should tx some */
+       int (*xfer)(void *priv, const u8 *rx, u8 *tx, uint bytes);
+};
+
+/*
+ * There are times when the data lines are allowed to tristate.  What
+ * is actually sensed on the line depends on the hardware.  It could
+ * always be 0xFF/0x00 (if there are pull ups/downs), or things could
+ * float and so we'd get garbage back.  This func encapsulates that
+ * scenario so we can worry about the details here.
+ */
+static inline void sandbox_spi_tristate(u8 *buf, uint len)
+{
+       /* XXX: make this into a user config option ? */
+       memset(buf, 0xff, len);
+}
+
+/*
+ * Extract the bus/cs from the spi spec and return the start of the spi
+ * client spec.  If the bus/cs are invalid for the current config, then
+ * it returns NULL.
+ *
+ * Example: arg="0:1:foo" will set bus to 0, cs to 1, and return "foo"
+ */
+const char *sandbox_spi_parse_spec(const char *arg, unsigned long *bus,
+                                  unsigned long *cs);
+
+#endif
index 093c81d..a38820b 100644 (file)
@@ -15,6 +15,11 @@ enum exit_type_id {
        STATE_EXIT_POWER_OFF,
 };
 
+struct sandbox_spi_info {
+       const char *spec;
+       const struct sandbox_spi_emu_ops *ops;
+};
+
 /* The complete state of the test system */
 struct sandbox_state {
        const char *cmd;                /* Command to execute */
@@ -23,6 +28,10 @@ struct sandbox_state {
        const char *parse_err;          /* Error to report from parsing */
        int argc;                       /* Program arguments */
        char **argv;
+
+       /* Pointer to information for each SPI bus/cs */
+       struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
+                                       [CONFIG_SANDBOX_SPI_MAX_CS];
 };
 
 /**
index e2ae6fd..63f7ad9 100644 (file)
 #include <common.h>
 #include <asm/sizes.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_pio.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/at91sam9263.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91_common.h>
@@ -66,35 +66,22 @@ static void vl_ma2sc_nand_hw_init(void)
 
        /* Configure RDY/BSY */
 #ifdef CONFIG_SYS_NAND_READY_PIN
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 #endif
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
 #ifdef CONFIG_MACB
 static void vl_ma2sc_macb_hw_init(void)
 {
-       unsigned long   erstl;
        at91_pmc_t      *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
-       at91_rstc_t     *rstc   = (at91_rstc_t *) ATMEL_BASE_RSTC;
+
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+       at91_phy_reset();
 
        at91_macb_hw_init();
 }
index b0f09f5..4716e4f 100644 (file)
@@ -87,10 +87,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index d84934e..f00d7c7 100644 (file)
@@ -87,10 +87,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 30c204b..2de3ca6 100644 (file)
@@ -87,10 +87,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index e1b1c10..ea9575d 100644 (file)
@@ -13,7 +13,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -67,8 +66,6 @@ static void afeb9260_macb_hw_init(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
 
        /* Enable EMAC clock */
@@ -94,20 +91,7 @@ static void afeb9260_macb_hw_init(void)
               pin_to_mask(AT91_PIN_PA28),
               &pioa->pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
-               &rstc->mr);
-
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(pin_to_mask(AT91_PIN_PA14) |
index 263de49..7f14af1 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <atmel_mci.h>
 
@@ -73,8 +72,6 @@ static void at91sam9260ek_macb_hw_init(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
        /* Enable EMAC clock */
        writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
@@ -98,21 +95,7 @@ static void at91sam9260ek_macb_hw_init(void)
                pin_to_mask(AT91_PIN_PA28),
                &pioa->pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
-               &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(pin_to_mask(AT91_PIN_PA14) |
index 2e9246f..d42a173 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91_pio.h>
 #include <asm/arch/clk.h>
@@ -82,10 +81,9 @@ static void at91sam9263ek_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void at91sam9263ek_macb_hw_init(void)
 {
-       unsigned long   erstl;
        at91_pmc_t      *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
        at91_pio_t      *pio    = (at91_pio_t *) ATMEL_BASE_PIO;
-       at91_rstc_t     *rstc   = (at91_rstc_t *) ATMEL_BASE_RSTC;
+
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
 
@@ -97,23 +95,10 @@ static void at91sam9263ek_macb_hw_init(void)
         *
         * PHY has internal pull-down
         */
-
        writel(1 << 25, &pio->pioc.pudr);
        writel((1 << 25) | (1 <<26), &pio->pioe.pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(1 << 25, &pio->pioc.puer);
index 6a071f6..b7e2efd 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <lcd.h>
@@ -88,8 +87,6 @@ static void at91sam9m10g45ek_macb_hw_init(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
@@ -107,21 +104,7 @@ static void at91sam9m10g45ek_macb_hw_init(void)
               pin_to_mask(AT91_PIN_PA13),
               &pioa->pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
-               &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(pin_to_mask(AT91_PIN_PA15) |
index 83fd63f..eff94a4 100644 (file)
@@ -20,6 +20,9 @@
 #include <micrel.h>
 #include <net.h>
 #include <netdev.h>
+#include <spl.h>
+#include <asm/arch/atmel_mpddrc.h>
+#include <asm/arch/at91_wdt.h>
 
 #ifdef CONFIG_USB_GADGET_ATMEL_USBA
 #include <asm/arch/atmel_usba_udc.h>
@@ -159,6 +162,12 @@ void lcd_show_board_info(void)
 
 int board_early_init_f(void)
 {
+       at91_periph_clk_enable(ATMEL_ID_PIOA);
+       at91_periph_clk_enable(ATMEL_ID_PIOB);
+       at91_periph_clk_enable(ATMEL_ID_PIOC);
+       at91_periph_clk_enable(ATMEL_ID_PIOD);
+       at91_periph_clk_enable(ATMEL_ID_PIOE);
+
        at91_seriald_hw_init();
 
        return 0;
@@ -291,3 +300,85 @@ void spi_cs_deactivate(struct spi_slave *slave)
        }
 }
 #endif /* CONFIG_ATMEL_SPI */
+
+/* SPL */
+#ifdef CONFIG_SPL_BUILD
+void spl_board_init(void)
+{
+#ifdef CONFIG_SYS_USE_MMC
+       sama5d3xek_mci_hw_init();
+#endif
+}
+
+static void ddr2_conf(struct atmel_mpddr *ddr2)
+{
+       ddr2->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
+
+       ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
+                   ATMEL_MPDDRC_CR_NR_ROW_14 |
+                   ATMEL_MPDDRC_CR_CAS_DDR_CAS3 |
+                   ATMEL_MPDDRC_CR_ENRDM_ON |
+                   ATMEL_MPDDRC_CR_NB_8BANKS |
+                   ATMEL_MPDDRC_CR_NDQS_DISABLED |
+                   ATMEL_MPDDRC_CR_DECOD_INTERLEAVED |
+                   ATMEL_MPDDRC_CR_UNAL_SUPPORTED);
+       /*
+        * As the DDR2-SDRAm device requires a refresh time is 7.8125us
+        * when DDR run at 133MHz, so it needs (7.8125us * 133MHz / 10^9) clocks
+        */
+       ddr2->rtr = 0x411;
+
+       ddr2->tpr0 = (6 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TWR_OFFSET |
+                     8 << ATMEL_MPDDRC_TPR0_TRC_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRP_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET);
+
+       ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET |
+                     200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
+                     28 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
+                     26 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
+
+       ddr2->tpr2 = (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
+                     7 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
+                     8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
+}
+
+void mem_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       struct atmel_mpddr ddr2;
+
+       ddr2_conf(&ddr2);
+
+       /* enable MPDDR clock */
+       at91_periph_clk_enable(ATMEL_ID_MPDDRC);
+       writel(0x4, &pmc->scer);
+
+       /* DDRAM2 Controller initialize */
+       ddr2_init(ATMEL_BASE_DDRCS, &ddr2);
+}
+
+void at91_pmc_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       u32 tmp;
+
+       tmp = AT91_PMC_PLLAR_29 |
+             AT91_PMC_PLLXR_PLLCOUNT(0x3f) |
+             AT91_PMC_PLLXR_MUL(43) |
+             AT91_PMC_PLLXR_DIV(1);
+       at91_plla_init(tmp);
+
+       writel(0x3 << 8, &pmc->pllicpr);
+
+       tmp = AT91_PMC_MCKR_MDIV_4 |
+             AT91_PMC_MCKR_CSS_PLLA;
+       at91_mck_init(tmp);
+}
+#endif
index 0388226..cfc64fe 100644 (file)
@@ -10,6 +10,7 @@
 #include <netdev.h>
 #include <asm/blackfin.h>
 #include <asm/io.h>
+#include <asm/sdh.h>
 #include <asm/portmux.h>
 #include "soft_switch.h"
 
index 8a6919d..bfde129 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <net.h>
 #include <netdev.h>
@@ -31,8 +30,6 @@ static void macb_hw_init(void)
 {
        struct at91_pmc *pmc   = (struct at91_pmc  *)ATMEL_BASE_PMC;
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
@@ -54,18 +51,7 @@ static void macb_hw_init(void)
        /* Enable ethernet power */
        pca953x_set_val(0x28, IO_EXP_ETH_POWER, 0);
 
-       /* Need to reset PHY -> 500ms reset */
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
-              AT91_RSTC_MR_URSTEN, &rstc->mr);
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+       at91_phy_reset();
 
        /* Bring the ethernet out of reset */
        pca953x_set_val(0x28, IO_EXP_ETH_RESET, 1);
index ecf261c..2074a93 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
@@ -77,8 +76,6 @@ static void sbc35_a9g20_macb_hw_init(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
        /* Enable EMAC clock */
        writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
@@ -102,21 +99,7 @@ static void sbc35_a9g20_macb_hw_init(void)
               pin_to_mask(AT91_PIN_PA28),
               &pioa->pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
-               &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(pin_to_mask(AT91_PIN_PA14) |
diff --git a/board/calao/usb_a9263/Makefile b/board/calao/usb_a9263/Makefile
new file mode 100644 (file)
index 0000000..8a22b3e
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop <stelian@popies.net>
+# Lead Tech Design <www.leadtechdesign.com>
+#
+# (C) Copyright 2013
+# Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+
+obj-y  += usb_a9263.o
diff --git a/board/calao/usb_a9263/usb_a9263.c b/board/calao/usb_a9263/usb_a9263.c
new file mode 100644 (file)
index 0000000..266e950
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * (C) Copyright 2007-2013
+ * Stelian Pop <stelian.pop@leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ * Thomas Petazzoni, Free Electrons, <thomas.petazzoni@free-electrons.com>
+ * Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_matrix.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm-generic/gpio.h>
+#include <asm/io.h>
+#include <net.h>
+#include <netdev.h>
+#include <dataflash.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_HAS_DATAFLASH
+AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = {
+       {CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0},       /* Logical adress, CS */
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+       {0x00000000, 0x00001FFF, FLAG_PROTECT_SET, 0, "Bootstrap"},
+       {0x00002000, 0x00003FFF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+       {0x00004000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0, "U-Boot"},
+};
+#endif
+
+#ifdef CONFIG_CMD_NAND
+static void usb_a9263_nand_hw_init(void)
+{
+       unsigned long csa;
+       at91_smc_t *smc = (at91_smc_t *)ATMEL_BASE_SMC0;
+       at91_matrix_t *matrix = (at91_matrix_t *)ATMEL_BASE_MATRIX;
+       at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+       /* Enable CS3 */
+       csa = readl(&matrix->csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+       writel(csa, &matrix->csa[0]);
+
+       /* Configure SMC CS3 for NAND/SmartMedia */
+       writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+              AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+              &smc->cs[3].setup);
+
+       writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+              AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+              &smc->cs[3].pulse);
+
+       writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+              &smc->cs[3].cycle);
+
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+              AT91_SMC_MODE_EXNW_DISABLE |
+              AT91_SMC_MODE_DBW_8 |
+              AT91_SMC_MODE_TDF_CYCLE(2), &smc->cs[3].mode);
+
+       writel(1 << ATMEL_ID_PIOA | 1 << ATMEL_ID_PIOCDE, &pmc->pcer);
+
+       /* Configure RDY/BSY */
+       gpio_request(CONFIG_SYS_NAND_READY_PIN, "NAND ready/busy");
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
+
+       /* Enable NandFlash */
+       gpio_request(CONFIG_SYS_NAND_ENABLE_PIN, "NAND enable");
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void usb_a9263_macb_hw_init(void)
+{
+       at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+       /* Enable clock */
+       writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
+
+       /*
+        * Disable pull-up on:
+        *  RXDV (PC25) => PHY normal mode (not Test mode)
+        *  ERX0 (PE25) => PHY ADDR0
+        *  ERX1 (PE26) => PHY ADDR1 => PHYADDR = 0x0
+        *
+        * PHY has internal weak pull-up/pull-down
+        */
+       gpio_request(GPIO_PIN_PC(25), "PHY mode");
+       gpio_direction_input(GPIO_PIN_PC(25));
+
+       gpio_request(GPIO_PIN_PE(25), "PHY ADDR0");
+       gpio_direction_input(GPIO_PIN_PE(25));
+
+       gpio_request(GPIO_PIN_PE(26), "PHY ADDR1");
+       gpio_direction_input(GPIO_PIN_PE(26));
+
+       at91_phy_reset();
+
+       /* It will set proper pinmux for ports PC25, PE25-26 */
+       at91_macb_hw_init();
+}
+#endif
+
+int board_init(void)
+{
+       /* adress of boot parameters */
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+#ifdef CONFIG_CMD_NAND
+       usb_a9263_nand_hw_init();
+#endif
+#ifdef CONFIG_HAS_DATAFLASH
+       at91_spi0_hw_init(1 << 0);
+#endif
+#ifdef CONFIG_MACB
+       usb_a9263_macb_hw_init();
+#endif
+#ifdef CONFIG_USB_OHCI_NEW
+       at91_uhp_hw_init();
+#endif
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
+       return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+
+#ifdef CONFIG_MACB
+       rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x0001);
+#endif
+       return rc;
+}
diff --git a/board/compulab/cm_t335/Makefile b/board/compulab/cm_t335/Makefile
new file mode 100644 (file)
index 0000000..0e6e96e
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2013 Compulab Ltd - http://compulab.co.il/
+#
+# Author: Ilya Ledvich <ilya@compulab.co.il>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += $(BOARD).o
+obj-$(CONFIG_SPL_BUILD) += mux.o spl.o
diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c
new file mode 100644 (file)
index 0000000..01019e8
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Board functions for Compulab CM-T335 board
+ *
+ * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Ilya Ledvich <ilya@compulab.co.il>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <miiphy.h>
+#include <cpsw.h>
+
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/hardware_am33xx.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+
+#include "../common/eeprom.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Basic board specific setup.  Pinmux has been handled already.
+ */
+int board_init(void)
+{
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+       gpmc_init();
+
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+       status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
+#endif
+       return 0;
+}
+
+#if defined (CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)
+static void cpsw_control(int enabled)
+{
+       /* VTP can be added here */
+       return;
+}
+
+static struct cpsw_slave_data cpsw_slave = {
+       .slave_reg_ofs  = 0x208,
+       .sliver_reg_ofs = 0xd80,
+       .phy_id         = 0,
+       .phy_if         = PHY_INTERFACE_MODE_RGMII,
+};
+
+static struct cpsw_platform_data cpsw_data = {
+       .mdio_base              = CPSW_MDIO_BASE,
+       .cpsw_base              = CPSW_BASE,
+       .mdio_div               = 0xff,
+       .channels               = 8,
+       .cpdma_reg_ofs          = 0x800,
+       .slaves                 = 1,
+       .slave_data             = &cpsw_slave,
+       .ale_reg_ofs            = 0xd00,
+       .ale_entries            = 1024,
+       .host_port_reg_ofs      = 0x108,
+       .hw_stats_reg_ofs       = 0x900,
+       .bd_ram_ofs             = 0x2000,
+       .mac_control            = (1 << 5),
+       .control                = cpsw_control,
+       .host_port_num          = 0,
+       .version                = CPSW_CTRL_VERSION_2,
+};
+
+/* PHY reset GPIO */
+#define GPIO_PHY_RST           GPIO_PIN(3, 7)
+
+static void board_phy_init(void)
+{
+       gpio_request(GPIO_PHY_RST, "phy_rst");
+       gpio_direction_output(GPIO_PHY_RST, 0);
+       mdelay(2);
+       gpio_set_value(GPIO_PHY_RST, 1);
+       mdelay(2);
+}
+
+static void get_efuse_mac_addr(uchar *enetaddr)
+{
+       uint32_t mac_hi, mac_lo;
+       struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+       mac_lo = readl(&cdev->macid0l);
+       mac_hi = readl(&cdev->macid0h);
+       enetaddr[0] = mac_hi & 0xFF;
+       enetaddr[1] = (mac_hi & 0xFF00) >> 8;
+       enetaddr[2] = (mac_hi & 0xFF0000) >> 16;
+       enetaddr[3] = (mac_hi & 0xFF000000) >> 24;
+       enetaddr[4] = mac_lo & 0xFF;
+       enetaddr[5] = (mac_lo & 0xFF00) >> 8;
+}
+
+/*
+ * Routine: handle_mac_address
+ * Description: prepare MAC address for on-board Ethernet.
+ */
+static int handle_mac_address(void)
+{
+       uchar enetaddr[6];
+       int rv;
+
+       rv = eth_getenv_enetaddr("ethaddr", enetaddr);
+       if (rv)
+               return 0;
+
+       rv = cl_eeprom_read_mac_addr(enetaddr);
+       if (rv)
+               get_efuse_mac_addr(enetaddr);
+
+       if (!is_valid_ether_addr(enetaddr))
+               return -1;
+
+       return eth_setenv_enetaddr("ethaddr", enetaddr);
+}
+
+#define AR8051_PHY_DEBUG_ADDR_REG      0x1d
+#define AR8051_PHY_DEBUG_DATA_REG      0x1e
+#define AR8051_DEBUG_RGMII_CLK_DLY_REG 0x5
+#define AR8051_RGMII_TX_CLK_DLY                0x100
+
+int board_eth_init(bd_t *bis)
+{
+       int rv, n = 0;
+       const char *devname;
+       struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+       rv = handle_mac_address();
+       if (rv)
+               printf("No MAC address found!\n");
+
+       writel(RGMII_MODE_ENABLE | RGMII_INT_DELAY, &cdev->miisel);
+
+       board_phy_init();
+
+       rv = cpsw_register(&cpsw_data);
+       if (rv < 0)
+               printf("Error %d registering CPSW switch\n", rv);
+       else
+               n += rv;
+
+       /*
+        * CPSW RGMII Internal Delay Mode is not supported in all PVT
+        * operating points.  So we must set the TX clock delay feature
+        * in the AR8051 PHY.  Since we only support a single ethernet
+        * device, we only do this for the first instance.
+        */
+       devname = miiphy_get_current_dev();
+
+       miiphy_write(devname, 0x0, AR8051_PHY_DEBUG_ADDR_REG,
+                    AR8051_DEBUG_RGMII_CLK_DLY_REG);
+       miiphy_write(devname, 0x0, AR8051_PHY_DEBUG_DATA_REG,
+                    AR8051_RGMII_TX_CLK_DLY);
+       return n;
+}
+#endif /* CONFIG_DRIVER_TI_CPSW && !CONFIG_SPL_BUILD */
diff --git a/board/compulab/cm_t335/mux.c b/board/compulab/cm_t335/mux.c
new file mode 100644 (file)
index 0000000..7d2beb0
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Pinmux configuration for Compulab CM-T335 board
+ *
+ * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Ilya Ledvich <ilya@compulab.co.il>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/mux.h>
+#include <asm/io.h>
+
+static struct module_pin_mux uart0_pin_mux[] = {
+       {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},
+       {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},
+       {-1},
+};
+
+static struct module_pin_mux uart1_pin_mux[] = {
+       {OFFSET(uart1_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},
+       {OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},
+       {OFFSET(uart1_ctsn), (MODE(0) | PULLUP_EN | RXACTIVE)},
+       {OFFSET(uart1_rtsn), (MODE(0) | PULLUDEN)},
+       {-1},
+};
+
+static struct module_pin_mux mmc0_pin_mux[] = {
+       {OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},
+       {-1},
+};
+
+static struct module_pin_mux i2c0_pin_mux[] = {
+       {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE | PULLUDDIS | SLEWCTRL)},
+       {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE | PULLUDDIS | SLEWCTRL)},
+       {-1},
+};
+
+static struct module_pin_mux i2c1_pin_mux[] = {
+       /* I2C_DATA */
+       {OFFSET(uart0_ctsn), (MODE(3) | RXACTIVE | PULLUDDIS | SLEWCTRL)},
+       /* I2C_SCLK */
+       {OFFSET(uart0_rtsn), (MODE(3) | RXACTIVE | PULLUDDIS | SLEWCTRL)},
+       {-1},
+};
+
+static struct module_pin_mux rgmii1_pin_mux[] = {
+       {OFFSET(mii1_txen), MODE(2)},                   /* RGMII1_TCTL */
+       {OFFSET(mii1_rxdv), MODE(2) | RXACTIVE},        /* RGMII1_RCTL */
+       {OFFSET(mii1_txd3), MODE(2)},                   /* RGMII1_TD3 */
+       {OFFSET(mii1_txd2), MODE(2)},                   /* RGMII1_TD2 */
+       {OFFSET(mii1_txd1), MODE(2)},                   /* RGMII1_TD1 */
+       {OFFSET(mii1_txd0), MODE(2)},                   /* RGMII1_TD0 */
+       {OFFSET(mii1_txclk), MODE(2)},                  /* RGMII1_TCLK */
+       {OFFSET(mii1_rxclk), MODE(2) | RXACTIVE},       /* RGMII1_RCLK */
+       {OFFSET(mii1_rxd3), MODE(2) | RXACTIVE},        /* RGMII1_RD3 */
+       {OFFSET(mii1_rxd2), MODE(2) | RXACTIVE},        /* RGMII1_RD2 */
+       {OFFSET(mii1_rxd1), MODE(2) | RXACTIVE},        /* RGMII1_RD1 */
+       {OFFSET(mii1_rxd0), MODE(2) | RXACTIVE},        /* RGMII1_RD0 */
+       {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */
+       {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},        /* MDIO_CLK */
+       {-1},
+};
+
+static struct module_pin_mux nand_pin_mux[] = {
+       {OFFSET(gpmc_ad0), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD0 */
+       {OFFSET(gpmc_ad1), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD1 */
+       {OFFSET(gpmc_ad2), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD2 */
+       {OFFSET(gpmc_ad3), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD3 */
+       {OFFSET(gpmc_ad4), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD4 */
+       {OFFSET(gpmc_ad5), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD5 */
+       {OFFSET(gpmc_ad6), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD6 */
+       {OFFSET(gpmc_ad7), (MODE(0) | PULLUP_EN | RXACTIVE)},   /* NAND AD7 */
+       {OFFSET(gpmc_wait0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* NAND WAIT */
+       {OFFSET(gpmc_wpn), (MODE(7) | PULLUP_EN | RXACTIVE)},   /* NAND_WPN */
+       {OFFSET(gpmc_csn0), (MODE(0) | PULLUDEN)},              /* NAND_CS0 */
+       {OFFSET(gpmc_advn_ale), (MODE(0) | PULLUDEN)},  /* NAND_ADV_ALE */
+       {OFFSET(gpmc_oen_ren), (MODE(0) | PULLUDEN)},   /* NAND_OE */
+       {OFFSET(gpmc_wen), (MODE(0) | PULLUDEN)},       /* NAND_WEN */
+       {OFFSET(gpmc_be0n_cle), (MODE(0) | PULLUDEN)},  /* NAND_BE_CLE */
+       {-1},
+};
+
+static struct module_pin_mux eth_phy_rst_pin_mux[] = {
+       {OFFSET(emu0), (MODE(7) | PULLUDDIS)},  /* GPIO3_7 */
+       {-1},
+};
+
+static struct module_pin_mux status_led_pin_mux[] = {
+       {OFFSET(gpmc_csn3), (MODE(7) | PULLUDEN)},      /* GPIO2_0 */
+       {-1},
+};
+
+void set_uart_mux_conf(void)
+{
+       configure_module_pin_mux(uart0_pin_mux);
+       configure_module_pin_mux(uart1_pin_mux);
+}
+
+void set_mux_conf_regs(void)
+{
+       configure_module_pin_mux(i2c0_pin_mux);
+       configure_module_pin_mux(i2c1_pin_mux);
+       configure_module_pin_mux(rgmii1_pin_mux);
+       configure_module_pin_mux(eth_phy_rst_pin_mux);
+       configure_module_pin_mux(mmc0_pin_mux);
+       configure_module_pin_mux(nand_pin_mux);
+       configure_module_pin_mux(status_led_pin_mux);
+}
diff --git a/board/compulab/cm_t335/spl.c b/board/compulab/cm_t335/spl.c
new file mode 100644 (file)
index 0000000..99f3a86
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * SPL specific code for Compulab CM-T335 board
+ *
+ * Board functions for Compulab CM-T335 board
+ *
+ * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Ilya Ledvich <ilya@compulab.co.il>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <errno.h>
+
+#include <asm/arch/ddr_defs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/clocks_am33xx.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/hardware_am33xx.h>
+#include <asm/sizes.h>
+
+static const struct ddr_data ddr3_data = {
+       .datardsratio0          = MT41J128MJT125_RD_DQS,
+       .datawdsratio0          = MT41J128MJT125_WR_DQS,
+       .datafwsratio0          = MT41J128MJT125_PHY_FIFO_WE,
+       .datawrsratio0          = MT41J128MJT125_PHY_WR_DATA,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+       .cmd0csratio            = MT41J128MJT125_RATIO,
+       .cmd0iclkout            = MT41J128MJT125_INVERT_CLKOUT,
+
+       .cmd1csratio            = MT41J128MJT125_RATIO,
+       .cmd1iclkout            = MT41J128MJT125_INVERT_CLKOUT,
+
+       .cmd2csratio            = MT41J128MJT125_RATIO,
+       .cmd2iclkout            = MT41J128MJT125_INVERT_CLKOUT,
+};
+
+static struct emif_regs ddr3_emif_reg_data = {
+       .sdram_config           = MT41J128MJT125_EMIF_SDCFG,
+       .ref_ctrl               = MT41J128MJT125_EMIF_SDREF,
+       .sdram_tim1             = MT41J128MJT125_EMIF_TIM1,
+       .sdram_tim2             = MT41J128MJT125_EMIF_TIM2,
+       .sdram_tim3             = MT41J128MJT125_EMIF_TIM3,
+       .zq_config              = MT41J128MJT125_ZQ_CFG,
+       .emif_ddr_phy_ctlr_1    = MT41J128MJT125_EMIF_READ_LATENCY |
+                                       PHY_EN_DYN_PWRDN,
+};
+
+const struct dpll_params dpll_ddr = {
+/*       M           N            M2  M3  M4  M5  M6 */
+       303, (V_OSCK/1000000) - 1, 1, -1, -1, -1, -1};
+
+void am33xx_spl_board_init(void)
+{
+       struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+       /* Get the frequency */
+       dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
+
+       /* Set CORE Frequencies to OPP100 */
+       do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);
+
+       /* Set MPU Frequency to what we detected now that voltages are set */
+       do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
+}
+
+const struct dpll_params *get_dpll_ddr_params(void)
+{
+       return &dpll_ddr;
+}
+
+static void probe_sdram_size(long size)
+{
+       switch (size) {
+       case SZ_512M:
+               ddr3_emif_reg_data.sdram_config = MT41J256MJT125_EMIF_SDCFG;
+               break;
+       case SZ_256M:
+               ddr3_emif_reg_data.sdram_config = MT41J128MJT125_EMIF_SDCFG;
+               break;
+       case SZ_128M:
+               ddr3_emif_reg_data.sdram_config = MT41J64MJT125_EMIF_SDCFG;
+               break;
+       default:
+               puts("Failed configuring DRAM, resetting...\n\n");
+               reset_cpu(0);
+       }
+       debug("%s: setting DRAM size to %ldM\n", __func__, size >> 20);
+       config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, &ddr3_data,
+                  &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
+}
+
+void sdram_init(void)
+{
+       long size = SZ_1G;
+
+       do {
+               size = size / 2;
+               probe_sdram_size(size);
+       } while (get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, size) < size);
+
+       return;
+}
diff --git a/board/compulab/cm_t335/u-boot.lds b/board/compulab/cm_t335/u-boot.lds
new file mode 100644 (file)
index 0000000..1b609a2
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2004-2008 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text :
+       {
+               *(.__image_copy_start)
+               CPUDIR/start.o (.text*)
+               board/compulab/cm_t335/built-in.o (.text*)
+               *(.text*)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+
+       . = ALIGN(4);
+       .data : {
+               *(.data*)
+       }
+
+       . = ALIGN(4);
+
+       . = .;
+
+       . = ALIGN(4);
+       .u_boot_list : {
+               KEEP(*(SORT(.u_boot_list*)));
+       }
+
+       . = ALIGN(4);
+
+       .image_copy_end :
+       {
+               *(.__image_copy_end)
+       }
+
+       .rel_dyn_start :
+       {
+               *(.__rel_dyn_start)
+       }
+
+       .rel.dyn : {
+               *(.rel*)
+       }
+
+       .rel_dyn_end :
+       {
+               *(.__rel_dyn_end)
+       }
+
+       _end = .;
+
+       /*
+        * Deprecated: this MMU section is used by pxa at present but
+        * should not be used by new boards/CPUs.
+        */
+       . = ALIGN(4096);
+       .mmutable : {
+               *(.mmutable)
+       }
+
+/*
+ * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
+ * __bss_base and __bss_limit are for linker only (overlay ordering)
+ */
+
+       .bss_start __rel_dyn_start (OVERLAY) : {
+               KEEP(*(.__bss_start));
+               __bss_base = .;
+       }
+
+       .bss __bss_base (OVERLAY) : {
+               *(.bss*)
+                . = ALIGN(4);
+                __bss_limit = .;
+       }
+
+       .bss_end __bss_limit (OVERLAY) : {
+               KEEP(*(.__bss_end));
+       }
+
+       /DISCARD/ : { *(.dynsym) }
+       /DISCARD/ : { *(.dynstr*) }
+       /DISCARD/ : { *(.dynamic*) }
+       /DISCARD/ : { *(.plt*) }
+       /DISCARD/ : { *(.interp*) }
+       /DISCARD/ : { *(.gnu*) }
+}
index 6e2e1cb..ede250b 100644 (file)
@@ -7,4 +7,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  += cm_t35.o leds.o
+obj-y  += cm_t35.o
diff --git a/board/compulab/cm_t35/leds.c b/board/compulab/cm_t35/leds.c
deleted file mode 100644 (file)
index 7e2803e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * (C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
- *
- * Author: Igor Grinberg <grinberg@compulab.co.il>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <status_led.h>
-#include <asm/gpio.h>
-
-static unsigned int leds[] = { GREEN_LED_GPIO };
-
-void __led_init(led_id_t mask, int state)
-{
-       if (gpio_request(leds[mask], "") != 0) {
-               printf("%s: failed requesting GPIO%u\n", __func__, leds[mask]);
-               return;
-       }
-
-       gpio_direction_output(leds[mask], 0);
-}
-
-void __led_set(led_id_t mask, int state)
-{
-       gpio_set_value(leds[mask], state == STATUS_LED_ON);
-}
-
-void __led_toggle(led_id_t mask)
-{
-       gpio_set_value(leds[mask], !gpio_get_value(leds[mask]));
-}
index 0035a0b..ebcaf44 100644 (file)
@@ -87,10 +87,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 1f5eea5..b45213c 100644 (file)
@@ -71,6 +71,7 @@
 #include <asm/arch/at91_spi.h>
 #include <asm/arch/gpio.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 
 #include "ethernut5_pwrman.h"
 
@@ -141,7 +142,7 @@ static void ethernut5_nand_hw_init(void)
        /* Ready pin is optional. */
        at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 #endif
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
index 9bf6739..c5994e0 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -74,10 +75,10 @@ static void meesc_nand_hw_init(void)
                &smc->cs[3].mode);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
index acc1b31..4751d0a 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -82,10 +83,10 @@ static void otc570_nand_hw_init(void)
                &smc->cs[3].mode);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
index 5e1524e..01ecccb 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/at91_pio.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/hardware.h>
@@ -79,39 +79,24 @@ static void cpu9260_nand_hw_init(void)
        writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
 #ifdef CONFIG_MACB
 static void cpu9260_macb_hw_init(void)
 {
-       unsigned long rstcmr;
        at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
-       at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
 
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
 
        at91_set_pio_pullup(AT91_PIO_PORTA, 17, 1);
 
-       rstcmr = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0xD) |
-                               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | rstcmr | AT91_RSTC_MR_URSTEN, &rstc->mr);
+       at91_phy_reset();
 
        at91_macb_hw_init();
 }
index 968655c..7c915b0 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <i2c.h>
 #include <asm/fsl_law.h>
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
@@ -92,3 +93,15 @@ void fsl_ddr_board_options(memctl_options_t *popts,
                popts->cs_local_opts[i].odt_wr_cfg = FSL_DDR_ODT_CS;
        }
 }
+
+void get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)
+{
+       int ret = i2c_read(i2c_address, 0, 2, (uint8_t *)spd,
+                               sizeof(generic_spd_eeprom_t));
+
+       if (ret) {
+               printf("DDR: failed to read SPD from address %u\n",
+                               i2c_address);
+               memset(spd, 0, sizeof(generic_spd_eeprom_t));
+       }
+}
index 889c493..1f399d2 100644 (file)
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-CPPFLAGS += -I$(TOPDIR)
-
 obj-y                  += law.o
 obj-$(CONFIG_PCI)      += pci.o
 obj-y                  += tlb.o
index 8d5cc91..1cca176 100644 (file)
@@ -90,13 +90,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.bss*) }
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynsym*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.hash*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 966abb2..5f3d6fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -354,7 +354,7 @@ int board_eth_init(bd_t *bis)
                puts("No address specified for VSC7385 microcode.\n");
 #endif
 
-       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.regs = TSEC_GET_MDIO_REGS_BASE(1);
        mdio_info.name = DEFAULT_MII_NAME;
 
        fsl_pq_mdio_init(bis, &mdio_info);
index 0b8356d..6a8ca2b 100644 (file)
@@ -35,20 +35,16 @@ static const struct ddr_data ddr3_data = {
        .datawdsratio0 = K4B2G1646EBIH9_WR_DQS,
        .datafwsratio0 = K4B2G1646EBIH9_PHY_FIFO_WE,
        .datawrsratio0 = K4B2G1646EBIH9_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct cmd_control ddr3_cmd_ctrl_data = {
        .cmd0csratio = K4B2G1646EBIH9_RATIO,
-       .cmd0dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd0iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 
        .cmd1csratio = K4B2G1646EBIH9_RATIO,
-       .cmd1dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd1iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 
        .cmd2csratio = K4B2G1646EBIH9_RATIO,
-       .cmd2dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd2iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 };
 
index 034886a..68463e7 100644 (file)
@@ -49,25 +49,22 @@ const struct dpll_params *get_dpll_ddr_params(void)
        return &dpll_ddr;
 }
 
+#ifdef CONFIG_REV1
 static const struct ddr_data ddr3_data = {
        .datardsratio0 = MT41J256M8HX15E_RD_DQS,
        .datawdsratio0 = MT41J256M8HX15E_WR_DQS,
        .datafwsratio0 = MT41J256M8HX15E_PHY_FIFO_WE,
        .datawrsratio0 = MT41J256M8HX15E_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct cmd_control ddr3_cmd_ctrl_data = {
        .cmd0csratio = MT41J256M8HX15E_RATIO,
-       .cmd0dldiff = MT41J256M8HX15E_DLL_LOCK_DIFF,
        .cmd0iclkout = MT41J256M8HX15E_INVERT_CLKOUT,
 
        .cmd1csratio = MT41J256M8HX15E_RATIO,
-       .cmd1dldiff = MT41J256M8HX15E_DLL_LOCK_DIFF,
        .cmd1iclkout = MT41J256M8HX15E_INVERT_CLKOUT,
 
        .cmd2csratio = MT41J256M8HX15E_RATIO,
-       .cmd2dldiff = MT41J256M8HX15E_DLL_LOCK_DIFF,
        .cmd2iclkout = MT41J256M8HX15E_INVERT_CLKOUT,
 };
 
@@ -82,6 +79,48 @@ static struct emif_regs ddr3_emif_reg_data = {
                                PHY_EN_DYN_PWRDN,
 };
 
+void sdram_init(void)
+{
+       config_ddr(DDR_CLK_MHZ, MT41J256M8HX15E_IOCTRL_VALUE, &ddr3_data,
+                  &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
+}
+#else
+static const struct ddr_data ddr3_data = {
+       .datardsratio0 = MT41K256M16HA125E_RD_DQS,
+       .datawdsratio0 = MT41K256M16HA125E_WR_DQS,
+       .datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE,
+       .datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+       .cmd0csratio = MT41K256M16HA125E_RATIO,
+       .cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+
+       .cmd1csratio = MT41K256M16HA125E_RATIO,
+       .cmd1iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+
+       .cmd2csratio = MT41K256M16HA125E_RATIO,
+       .cmd2iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+};
+
+static struct emif_regs ddr3_emif_reg_data = {
+       .sdram_config = MT41K256M16HA125E_EMIF_SDCFG,
+       .ref_ctrl = MT41K256M16HA125E_EMIF_SDREF,
+       .sdram_tim1 = MT41K256M16HA125E_EMIF_TIM1,
+       .sdram_tim2 = MT41K256M16HA125E_EMIF_TIM2,
+       .sdram_tim3 = MT41K256M16HA125E_EMIF_TIM3,
+       .zq_config = MT41K256M16HA125E_ZQ_CFG,
+       .emif_ddr_phy_ctlr_1 = MT41K256M16HA125E_EMIF_READ_LATENCY |
+                               PHY_EN_DYN_PWRDN,
+};
+
+void sdram_init(void)
+{
+       config_ddr(DDR_CLK_MHZ, MT41K256M16HA125E_IOCTRL_VALUE, &ddr3_data,
+                  &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
+}
+#endif
+
 void set_uart_mux_conf(void)
 {
        enable_uart0_pin_mux();
@@ -95,12 +134,6 @@ void set_mux_conf_regs(void)
 
        enable_board_pin_mux();
 }
-
-void sdram_init(void)
-{
-       config_ddr(DDR_CLK_MHZ, MT41J256M8HX15E_IOCTRL_VALUE, &ddr3_data,
-                       &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
-}
 #endif
 
 /*
diff --git a/board/renesas/koelsch/Makefile b/board/renesas/koelsch/Makefile
new file mode 100644 (file)
index 0000000..b4d0183
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# board/renesas/koelsch/Makefile
+#
+# Copyright (C) 2013 Renesas Electronics Corporation
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y  := koelsch.o qos.o
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
new file mode 100644 (file)
index 0000000..7153f65
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+ * board/renesas/koelsch/koelsch.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ *
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <asm/processor.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/gpio.h>
+#include <asm/arch/rmobile.h>
+#include <i2c.h>
+#include "qos.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define s_init_wait(cnt) \
+       ({      \
+               u32 i = 0x10000 * cnt;  \
+               while (i > 0)   \
+                       i--;    \
+       })
+
+
+#define dbpdrgd_check(bsc) \
+       ({      \
+               while ((readl(&bsc->dbpdrgd) & 0x1) != 0x1)     \
+                       ;       \
+       })
+
+#if defined(CONFIG_NORFLASH)
+static void bsc_init(void)
+{
+       struct r8a7791_lbsc *lbsc = (struct r8a7791_lbsc *)LBSC_BASE;
+       struct r8a7791_dbsc3 *dbsc3_0 = (struct r8a7791_dbsc3 *)DBSC3_0_BASE;
+
+       /* LBSC */
+       writel(0x00000020, &lbsc->cs0ctrl);
+       writel(0x00000020, &lbsc->cs1ctrl);
+       writel(0x00002020, &lbsc->ecs0ctrl);
+       writel(0x00002020, &lbsc->ecs1ctrl);
+
+       writel(0x077F077F, &lbsc->cswcr0);
+       writel(0x077F077F, &lbsc->cswcr1);
+       writel(0x077F077F, &lbsc->ecswcr0);
+       writel(0x077F077F, &lbsc->ecswcr1);
+
+       /* DBSC3 */
+       s_init_wait(10);
+
+       writel(0x0000A55A, &dbsc3_0->dbpdlck);
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x80000000, &dbsc3_0->dbpdrgd);
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000006, &dbsc3_0->dbpdrga);
+       writel(0x0001C000, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000023, &dbsc3_0->dbpdrga);
+       writel(0x00FD2480, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000010, &dbsc3_0->dbpdrga);
+       writel(0xF004649B, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000000F, &dbsc3_0->dbpdrga);
+       writel(0x00181EE4, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000000E, &dbsc3_0->dbpdrga);
+       writel(0x33C03812, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000003, &dbsc3_0->dbpdrga);
+       writel(0x0300C481, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000007, &dbsc3_0->dbkind);
+       writel(0x10030A02, &dbsc3_0->dbconf0);
+       writel(0x00000001, &dbsc3_0->dbphytype);
+       writel(0x00000000, &dbsc3_0->dbbl);
+       writel(0x0000000B, &dbsc3_0->dbtr0);
+       writel(0x00000008, &dbsc3_0->dbtr1);
+       writel(0x00000000, &dbsc3_0->dbtr2);
+       writel(0x0000000B, &dbsc3_0->dbtr3);
+       writel(0x000C000B, &dbsc3_0->dbtr4);
+       writel(0x00000027, &dbsc3_0->dbtr5);
+       writel(0x0000001C, &dbsc3_0->dbtr6);
+       writel(0x00000005, &dbsc3_0->dbtr7);
+       writel(0x00000018, &dbsc3_0->dbtr8);
+       writel(0x00000008, &dbsc3_0->dbtr9);
+       writel(0x0000000C, &dbsc3_0->dbtr10);
+       writel(0x00000009, &dbsc3_0->dbtr11);
+       writel(0x00000012, &dbsc3_0->dbtr12);
+       writel(0x000000D0, &dbsc3_0->dbtr13);
+       writel(0x00140005, &dbsc3_0->dbtr14);
+       writel(0x00050004, &dbsc3_0->dbtr15);
+       writel(0x70233005, &dbsc3_0->dbtr16);
+       writel(0x000C0000, &dbsc3_0->dbtr17);
+       writel(0x00000300, &dbsc3_0->dbtr18);
+       writel(0x00000040, &dbsc3_0->dbtr19);
+       writel(0x00000001, &dbsc3_0->dbrnk0);
+       writel(0x00020001, &dbsc3_0->dbadj0);
+       writel(0x20082008, &dbsc3_0->dbadj2);
+       writel(0x00020002, &dbsc3_0->dbwt0cnf0);
+       writel(0x0000000F, &dbsc3_0->dbwt0cnf4);
+
+       writel(0x00000015, &dbsc3_0->dbpdrga);
+       writel(0x00000D70, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000016, &dbsc3_0->dbpdrga);
+       writel(0x00000006, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000017, &dbsc3_0->dbpdrga);
+       writel(0x00000018, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000012, &dbsc3_0->dbpdrga);
+       writel(0x9D5CBB66, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000013, &dbsc3_0->dbpdrga);
+       writel(0x1A868300, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000023, &dbsc3_0->dbpdrga);
+       writel(0x00FDB6C0, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000014, &dbsc3_0->dbpdrga);
+       writel(0x300214D8, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000001A, &dbsc3_0->dbpdrga);
+       writel(0x930035C7, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000060, &dbsc3_0->dbpdrga);
+       writel(0x330657B2, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000011, &dbsc3_0->dbpdrga);
+       writel(0x1000040B, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x00000071, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x2100FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+
+       writel(0x110000DB, &dbsc3_0->dbcmd);
+
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x00000181, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x0000FE01, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000000, &dbsc3_0->dbbs0cnt1);
+       writel(0x01004C20, &dbsc3_0->dbcalcnf);
+       writel(0x014000AA, &dbsc3_0->dbcaltr);
+       writel(0x00000140, &dbsc3_0->dbrfcnf0);
+       writel(0x00081860, &dbsc3_0->dbrfcnf1);
+       writel(0x00010000, &dbsc3_0->dbrfcnf2);
+       writel(0x00000001, &dbsc3_0->dbrfen);
+       writel(0x00000001, &dbsc3_0->dbacen);
+}
+#else
+#define bsc_init() do {} while (0)
+#endif /* CONFIG_NORFLASH */
+
+void s_init(void)
+{
+       struct r8a7791_rwdt *rwdt = (struct r8a7791_rwdt *)RWDT_BASE;
+       struct r8a7791_swdt *swdt = (struct r8a7791_swdt *)SWDT_BASE;
+
+       /* Watchdog init */
+       writel(0xA5A5A500, &rwdt->rwtcsra);
+       writel(0xA5A5A500, &swdt->swtcsra);
+
+       /* QoS */
+       qos_init();
+
+       /* BSC */
+       bsc_init();
+}
+
+#define MSTPSR1                0xE6150038
+#define SMSTPCR1       0xE6150134
+#define TMU0_MSTP125   (1 << 25)
+
+#define MSTPSR7                0xE61501C4
+#define SMSTPCR7       0xE615014C
+#define SCIF0_MSTP721  (1 << 21)
+
+#define PMMR   0xE6060000
+#define GPSR4  0xE6060014
+#define IPSR14 0xE6060058
+
+#define set_guard_reg(addr, mask, value)       \
+{ \
+       u32 val; \
+       val = (readl(addr) & ~(mask)) | (value); \
+       writel(~val, PMMR); \
+       writel(val, addr); \
+}
+
+#define mstp_setbits(type, addr, saddr, set) \
+       out_##type((saddr), in_##type(addr) | (set))
+#define mstp_clrbits(type, addr, saddr, clear) \
+       out_##type((saddr), in_##type(addr) & ~(clear))
+#define mstp_setbits_le32(addr, saddr, set) \
+       mstp_setbits(le32, addr, saddr, set)
+#define mstp_clrbits_le32(addr, saddr, clear)   \
+       mstp_clrbits(le32, addr, saddr, clear)
+
+int board_early_init_f(void)
+{
+       mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+
+#if defined(CONFIG_NORFLASH)
+       /* SCIF0 */
+       set_guard_reg(GPSR4, 0x34000000, 0x00000000);
+       set_guard_reg(IPSR14, 0x00000FC7, 0x00000481);
+       set_guard_reg(GPSR4, 0x00000000, 0x34000000);
+#endif
+
+       mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721);
+
+       return 0;
+}
+
+int board_init(void)
+{
+       /* adress of boot parameters */
+       gd->bd->bi_boot_params = KOELSCH_SDRAM_BASE + 0x100;
+
+       /* Init PFC controller */
+       r8a7791_pinmux_init();
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+       return 0;
+}
+
+const struct rmobile_sysinfo sysinfo = {
+       CONFIG_RMOBILE_BOARD_STRING
+};
+
+void dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = KOELSCH_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = KOELSCH_SDRAM_SIZE;
+}
+
+int board_late_init(void)
+{
+       return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+}
diff --git a/board/renesas/koelsch/qos.c b/board/renesas/koelsch/qos.c
new file mode 100644 (file)
index 0000000..7f88f7d
--- /dev/null
@@ -0,0 +1,1220 @@
+/*
+ * board/renesas/koelsch/qos.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ *
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/arch/rmobile.h>
+
+/* QoS version 0.23 */
+
+enum {
+       DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04,
+       DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09,
+       DBSC3_10, DBSC3_11, DBSC3_12, DBSC3_13, DBSC3_14,
+       DBSC3_15,
+       DBSC3_NR,
+};
+
+static u32 dbsc3_0_r_qos_addr[DBSC3_NR] = {
+       [DBSC3_00] = DBSC3_0_QOS_R0_BASE,
+       [DBSC3_01] = DBSC3_0_QOS_R1_BASE,
+       [DBSC3_02] = DBSC3_0_QOS_R2_BASE,
+       [DBSC3_03] = DBSC3_0_QOS_R3_BASE,
+       [DBSC3_04] = DBSC3_0_QOS_R4_BASE,
+       [DBSC3_05] = DBSC3_0_QOS_R5_BASE,
+       [DBSC3_06] = DBSC3_0_QOS_R6_BASE,
+       [DBSC3_07] = DBSC3_0_QOS_R7_BASE,
+       [DBSC3_08] = DBSC3_0_QOS_R8_BASE,
+       [DBSC3_09] = DBSC3_0_QOS_R9_BASE,
+       [DBSC3_10] = DBSC3_0_QOS_R10_BASE,
+       [DBSC3_11] = DBSC3_0_QOS_R11_BASE,
+       [DBSC3_12] = DBSC3_0_QOS_R12_BASE,
+       [DBSC3_13] = DBSC3_0_QOS_R13_BASE,
+       [DBSC3_14] = DBSC3_0_QOS_R14_BASE,
+       [DBSC3_15] = DBSC3_0_QOS_R15_BASE,
+};
+
+static u32 dbsc3_0_w_qos_addr[DBSC3_NR] = {
+       [DBSC3_00] = DBSC3_0_QOS_W0_BASE,
+       [DBSC3_01] = DBSC3_0_QOS_W1_BASE,
+       [DBSC3_02] = DBSC3_0_QOS_W2_BASE,
+       [DBSC3_03] = DBSC3_0_QOS_W3_BASE,
+       [DBSC3_04] = DBSC3_0_QOS_W4_BASE,
+       [DBSC3_05] = DBSC3_0_QOS_W5_BASE,
+       [DBSC3_06] = DBSC3_0_QOS_W6_BASE,
+       [DBSC3_07] = DBSC3_0_QOS_W7_BASE,
+       [DBSC3_08] = DBSC3_0_QOS_W8_BASE,
+       [DBSC3_09] = DBSC3_0_QOS_W9_BASE,
+       [DBSC3_10] = DBSC3_0_QOS_W10_BASE,
+       [DBSC3_11] = DBSC3_0_QOS_W11_BASE,
+       [DBSC3_12] = DBSC3_0_QOS_W12_BASE,
+       [DBSC3_13] = DBSC3_0_QOS_W13_BASE,
+       [DBSC3_14] = DBSC3_0_QOS_W14_BASE,
+       [DBSC3_15] = DBSC3_0_QOS_W15_BASE,
+};
+
+static u32 dbsc3_1_r_qos_addr[DBSC3_NR] = {
+       [DBSC3_00] = DBSC3_1_QOS_R0_BASE,
+       [DBSC3_01] = DBSC3_1_QOS_R1_BASE,
+       [DBSC3_02] = DBSC3_1_QOS_R2_BASE,
+       [DBSC3_03] = DBSC3_1_QOS_R3_BASE,
+       [DBSC3_04] = DBSC3_1_QOS_R4_BASE,
+       [DBSC3_05] = DBSC3_1_QOS_R5_BASE,
+       [DBSC3_06] = DBSC3_1_QOS_R6_BASE,
+       [DBSC3_07] = DBSC3_1_QOS_R7_BASE,
+       [DBSC3_08] = DBSC3_1_QOS_R8_BASE,
+       [DBSC3_09] = DBSC3_1_QOS_R9_BASE,
+       [DBSC3_10] = DBSC3_1_QOS_R10_BASE,
+       [DBSC3_11] = DBSC3_1_QOS_R11_BASE,
+       [DBSC3_12] = DBSC3_1_QOS_R12_BASE,
+       [DBSC3_13] = DBSC3_1_QOS_R13_BASE,
+       [DBSC3_14] = DBSC3_1_QOS_R14_BASE,
+       [DBSC3_15] = DBSC3_1_QOS_R15_BASE,
+};
+
+static u32 dbsc3_1_w_qos_addr[DBSC3_NR] = {
+       [DBSC3_00] = DBSC3_1_QOS_W0_BASE,
+       [DBSC3_01] = DBSC3_1_QOS_W1_BASE,
+       [DBSC3_02] = DBSC3_1_QOS_W2_BASE,
+       [DBSC3_03] = DBSC3_1_QOS_W3_BASE,
+       [DBSC3_04] = DBSC3_1_QOS_W4_BASE,
+       [DBSC3_05] = DBSC3_1_QOS_W5_BASE,
+       [DBSC3_06] = DBSC3_1_QOS_W6_BASE,
+       [DBSC3_07] = DBSC3_1_QOS_W7_BASE,
+       [DBSC3_08] = DBSC3_1_QOS_W8_BASE,
+       [DBSC3_09] = DBSC3_1_QOS_W9_BASE,
+       [DBSC3_10] = DBSC3_1_QOS_W10_BASE,
+       [DBSC3_11] = DBSC3_1_QOS_W11_BASE,
+       [DBSC3_12] = DBSC3_1_QOS_W12_BASE,
+       [DBSC3_13] = DBSC3_1_QOS_W13_BASE,
+       [DBSC3_14] = DBSC3_1_QOS_W14_BASE,
+       [DBSC3_15] = DBSC3_1_QOS_W15_BASE,
+};
+
+void qos_init(void)
+{
+       int i;
+       struct r8a7791_s3c *s3c;
+       struct r8a7791_s3c_qos *s3c_qos;
+       struct r8a7791_dbsc3_qos *qos_addr;
+       struct r8a7791_mxi *mxi;
+       struct r8a7791_mxi_qos *mxi_qos;
+       struct r8a7791_axi_qos *axi_qos;
+
+       /* DBSC DBADJ2 */
+       writel(0x20042004, DBSC3_0_DBADJ2);
+
+       /* S3C -QoS */
+       s3c = (struct r8a7791_s3c *)S3C_BASE;
+       writel(0x00FF1B1D, &s3c->s3cadsplcr);
+       writel(0x1F0D0C0C, &s3c->s3crorr);
+       writel(0x1F0D0C0A, &s3c->s3cworr);
+
+       /* QoS Control Registers */
+       s3c_qos = (struct r8a7791_s3c_qos *)S3C_QOS_CCI0_BASE;
+       writel(0x00890089, &s3c_qos->s3cqos0);
+       writel(0x20960010, &s3c_qos->s3cqos1);
+       writel(0x20302030, &s3c_qos->s3cqos2);
+       writel(0x20AA2200, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20960010, &s3c_qos->s3cqos5);
+       writel(0x20302030, &s3c_qos->s3cqos6);
+       writel(0x20AA2200, &s3c_qos->s3cqos7);
+       writel(0x00002032, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7791_s3c_qos *)S3C_QOS_CCI1_BASE;
+       writel(0x00890089, &s3c_qos->s3cqos0);
+       writel(0x20960010, &s3c_qos->s3cqos1);
+       writel(0x20302030, &s3c_qos->s3cqos2);
+       writel(0x20AA2200, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20960010, &s3c_qos->s3cqos5);
+       writel(0x20302030, &s3c_qos->s3cqos6);
+       writel(0x20AA2200, &s3c_qos->s3cqos7);
+       writel(0x00002032, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7791_s3c_qos *)S3C_QOS_MXI_BASE;
+       writel(0x00820082, &s3c_qos->s3cqos0);
+       writel(0x20960020, &s3c_qos->s3cqos1);
+       writel(0x20302030, &s3c_qos->s3cqos2);
+       writel(0x20AA20DC, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20960020, &s3c_qos->s3cqos5);
+       writel(0x20302030, &s3c_qos->s3cqos6);
+       writel(0x20AA20DC, &s3c_qos->s3cqos7);
+       writel(0x00002032, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7791_s3c_qos *)S3C_QOS_AXI_BASE;
+       writel(0x00820082, &s3c_qos->s3cqos0);
+       writel(0x20960020, &s3c_qos->s3cqos1);
+       writel(0x20302030, &s3c_qos->s3cqos2);
+       writel(0x20AA20FA, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20960020, &s3c_qos->s3cqos5);
+       writel(0x20302030, &s3c_qos->s3cqos6);
+       writel(0x20AA20FA, &s3c_qos->s3cqos7);
+       writel(0x00002032, &s3c_qos->s3cqos8);
+
+       /* DBSC -QoS */
+       /* DBSC0 - Read */
+       for (i = DBSC3_00; i < DBSC3_NR; i++) {
+               qos_addr = (struct r8a7791_dbsc3_qos *)dbsc3_0_r_qos_addr[i];
+               writel(0x00000002, &qos_addr->dblgcnt);
+               writel(0x00002096, &qos_addr->dbtmval0);
+               writel(0x00002064, &qos_addr->dbtmval1);
+               writel(0x00002032, &qos_addr->dbtmval2);
+               writel(0x00001FB0, &qos_addr->dbtmval3);
+               writel(0x00000001, &qos_addr->dbrqctr);
+               writel(0x00002078, &qos_addr->dbthres0);
+               writel(0x0000204B, &qos_addr->dbthres1);
+               writel(0x00001FE7, &qos_addr->dbthres2);
+               writel(0x00000001, &qos_addr->dblgqon);
+       }
+
+       /* DBSC0 - Write */
+       for (i = DBSC3_00; i < DBSC3_NR; i++) {
+               qos_addr = (struct r8a7791_dbsc3_qos *)dbsc3_0_w_qos_addr[i];
+               writel(0x00000002, &qos_addr->dblgcnt);
+               writel(0x000020EB, &qos_addr->dbtmval0);
+               writel(0x0000206E, &qos_addr->dbtmval1);
+               writel(0x00002050, &qos_addr->dbtmval2);
+               writel(0x0000203A, &qos_addr->dbtmval3);
+               writel(0x00000001, &qos_addr->dbrqctr);
+               writel(0x00002078, &qos_addr->dbthres0);
+               writel(0x0000205A, &qos_addr->dbthres1);
+               writel(0x0000203C, &qos_addr->dbthres2);
+               writel(0x00000001, &qos_addr->dblgqon);
+       }
+
+       /* DBSC1 - Read */
+       for (i = DBSC3_00; i < DBSC3_NR; i++) {
+               qos_addr = (struct r8a7791_dbsc3_qos *)dbsc3_1_r_qos_addr[i];
+               writel(0x00000002, &qos_addr->dblgcnt);
+               writel(0x00002096, &qos_addr->dbtmval0);
+               writel(0x00002064, &qos_addr->dbtmval1);
+               writel(0x00002032, &qos_addr->dbtmval2);
+               writel(0x00001FB0, &qos_addr->dbtmval3);
+               writel(0x00000001, &qos_addr->dbrqctr);
+               writel(0x00002078, &qos_addr->dbthres0);
+               writel(0x0000204B, &qos_addr->dbthres1);
+               writel(0x00001FE7, &qos_addr->dbthres2);
+               writel(0x00000001, &qos_addr->dblgqon);
+       }
+
+       /* DBSC1 - Write */
+       for (i = DBSC3_00; i < DBSC3_NR; i++) {
+               qos_addr = (struct r8a7791_dbsc3_qos *)dbsc3_1_w_qos_addr[i];
+               writel(0x00000002, &qos_addr->dblgcnt);
+               writel(0x000020EB, &qos_addr->dbtmval0);
+               writel(0x0000206E, &qos_addr->dbtmval1);
+               writel(0x00002050, &qos_addr->dbtmval2);
+               writel(0x0000203A, &qos_addr->dbtmval3);
+               writel(0x00000001, &qos_addr->dbrqctr);
+               writel(0x00002078, &qos_addr->dbthres0);
+               writel(0x0000205A, &qos_addr->dbthres1);
+               writel(0x0000203C, &qos_addr->dbthres2);
+               writel(0x00000001, &qos_addr->dblgqon);
+       }
+
+       /* CCI-400 -QoS */
+       writel(0x20001000, CCI_400_MAXOT_1);
+       writel(0x20001000, CCI_400_MAXOT_2);
+       writel(0x0000000C, CCI_400_QOSCNTL_1);
+       writel(0x0000000C, CCI_400_QOSCNTL_2);
+
+       /* MXI -QoS */
+       /* Transaction Control (MXI) */
+       mxi = (struct r8a7791_mxi *)MXI_BASE;
+       writel(0x00000013, &mxi->mxrtcr);
+       writel(0x00000013, &mxi->mxwtcr);
+       writel(0x00780080, &mxi->mxsaar0);
+       writel(0x02000800, &mxi->mxsaar1);
+
+       /* QoS Control (MXI) */
+       mxi_qos = (struct r8a7791_mxi_qos *)MXI_QOS_BASE;
+       writel(0x0000000C, &mxi_qos->vspdu0);
+       writel(0x0000000C, &mxi_qos->vspdu1);
+       writel(0x0000000D, &mxi_qos->du0);
+       writel(0x0000000D, &mxi_qos->du1);
+
+       /* AXI -QoS */
+       /* Transaction Control (MXI) */
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SYX64TO128_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_AVB_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_G2D_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_IMP0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002021, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_IMP1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002037, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_IMUX0_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_IMUX1_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_IMUX2_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_LBS_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000214C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MMUDS_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MMUM_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MMUR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MMUS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MMUS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MTSB0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002021, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MTSB1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002021, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_PCI_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000214C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_RTX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SDS0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SDS1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_USB20_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_USB21_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_USB22_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_USB30_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000214C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_AX2M_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_CC50_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002029, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_CCI_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_CS_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_DDM_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_ETH_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_MPXM_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SAT0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SAT1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SDM0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000214C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_SDM1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000214C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_TRAB_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020A6, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_UDM0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI_UDM1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (RT-AXI) */
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_SHX_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_DBG_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_RDM_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002299, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_RDS_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002029, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_RTX64TO128_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_STPRO_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002029, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)RT_AXI_SY2RT_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (MP-AXI) */
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_ADSP_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002037, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_ASDS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_ASDS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_MLP_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_MMUMP_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_SPU_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002053, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MP_AXI_SPUC_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000206E, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (SYS-AXI256) */
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI256_AXI128TO256_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI256_SYX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI256_MPX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)SYS_AXI256_MXI_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (CCI-AXI) */
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_SYX2_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUDS_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUM_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MXI_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x00002245, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)CCI_AXI_MMUMP_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (Media-AXI) */
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_MXR_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x000020DC, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x000020AA, &axi_qos->qosthres0);
+       writel(0x00002032, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_MXW_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x000020DC, &axi_qos->qosctset0);
+       writel(0x00002096, &axi_qos->qosctset1);
+       writel(0x00002030, &axi_qos->qosctset2);
+       writel(0x00002030, &axi_qos->qosctset3);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x000020AA, &axi_qos->qosthres0);
+       writel(0x00002032, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_JPR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_JPW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_TDMR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_TDMW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSP1CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSP1CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPDU0CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPDU0CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPDU1CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPDU1CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002190, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VIN0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_FDP0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_FDP0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_IMSR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_IMSW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSP1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSP1W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_FDP1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_FDP1W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_IMRR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_IMRW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPD0R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPD0W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPD1R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VSPD1W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x000020C8, &axi_qos->qosctset0);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_DU0R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002063, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_DU0W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002063, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VCP0CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002073, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VCP0CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002073, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VCP0VR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002073, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VCP0VW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002073, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7791_axi_qos *)MEDIA_AXI_VPC0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002073, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002064, &axi_qos->qosthres0);
+       writel(0x00002004, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+}
diff --git a/board/renesas/koelsch/qos.h b/board/renesas/koelsch/qos.h
new file mode 100644 (file)
index 0000000..9a6c046
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __QOS_H__
+#define __QOS_H__
+
+void qos_init(void);
+
+#endif
diff --git a/board/renesas/lager/Makefile b/board/renesas/lager/Makefile
new file mode 100644 (file)
index 0000000..034c6f8
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# board/renesas/lager/Makefile
+#
+# Copyright (C) 2013 Renesas Electronics Corporation
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y  := lager.o qos.o
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
new file mode 100644 (file)
index 0000000..5c99fc9
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ * board/renesas/lager/lager.c
+ *     This file is lager board support.
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ * Copyright (C) 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <netdev.h>
+#include <asm/processor.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/gpio.h>
+#include <asm/arch/rmobile.h>
+#include "qos.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define s_init_wait(cnt) \
+       ({      \
+               u32 i = 0x10000 * cnt;  \
+               while (i > 0)   \
+                       i--;    \
+       })
+
+#define dbpdrgd_check(bsc) \
+       ({      \
+               while ((readl(&bsc->dbpdrgd) & 0x1) != 0x1)     \
+                       ;       \
+       })
+
+#if defined(CONFIG_NORFLASH)
+static void bsc_init(void)
+{
+       struct r8a7790_lbsc *lbsc = (struct r8a7790_lbsc *)LBSC_BASE;
+       struct r8a7790_dbsc3 *dbsc3_0 = (struct r8a7790_dbsc3 *)DBSC3_0_BASE;
+
+       /* LBSC */
+       writel(0x00000020, &lbsc->cs0ctrl);
+       writel(0x00000020, &lbsc->cs1ctrl);
+       writel(0x00002020, &lbsc->ecs0ctrl);
+       writel(0x00002020, &lbsc->ecs1ctrl);
+
+       writel(0x077F077F, &lbsc->cswcr0);
+       writel(0x077F077F, &lbsc->cswcr1);
+       writel(0x077F077F, &lbsc->ecswcr0);
+       writel(0x077F077F, &lbsc->ecswcr1);
+
+       /* DBSC3 */
+       s_init_wait(10);
+
+       writel(0x0000A55A, &dbsc3_0->dbpdlck);
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x80000000, &dbsc3_0->dbpdrgd);
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000006, &dbsc3_0->dbpdrga);
+       writel(0x0001C000, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000023, &dbsc3_0->dbpdrga);
+       writel(0x00FD2480, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000010, &dbsc3_0->dbpdrga);
+       writel(0xF004649B, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000000F, &dbsc3_0->dbpdrga);
+       writel(0x00181EE4, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000000E, &dbsc3_0->dbpdrga);
+       writel(0x33C03812, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000003, &dbsc3_0->dbpdrga);
+       writel(0x0300C481, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000007, &dbsc3_0->dbkind);
+       writel(0x10030A02, &dbsc3_0->dbconf0);
+       writel(0x00000001, &dbsc3_0->dbphytype);
+       writel(0x00000000, &dbsc3_0->dbbl);
+       writel(0x0000000B, &dbsc3_0->dbtr0);
+       writel(0x00000008, &dbsc3_0->dbtr1);
+       writel(0x00000000, &dbsc3_0->dbtr2);
+       writel(0x0000000B, &dbsc3_0->dbtr3);
+       writel(0x000C000B, &dbsc3_0->dbtr4);
+       writel(0x00000027, &dbsc3_0->dbtr5);
+       writel(0x0000001C, &dbsc3_0->dbtr6);
+       writel(0x00000005, &dbsc3_0->dbtr7);
+       writel(0x00000018, &dbsc3_0->dbtr8);
+       writel(0x00000008, &dbsc3_0->dbtr9);
+       writel(0x0000000C, &dbsc3_0->dbtr10);
+       writel(0x00000009, &dbsc3_0->dbtr11);
+       writel(0x00000012, &dbsc3_0->dbtr12);
+       writel(0x000000D0, &dbsc3_0->dbtr13);
+       writel(0x00140005, &dbsc3_0->dbtr14);
+       writel(0x00050004, &dbsc3_0->dbtr15);
+       writel(0x70233005, &dbsc3_0->dbtr16);
+       writel(0x000C0000, &dbsc3_0->dbtr17);
+       writel(0x00000300, &dbsc3_0->dbtr18);
+       writel(0x00000040, &dbsc3_0->dbtr19);
+       writel(0x00000001, &dbsc3_0->dbrnk0);
+       writel(0x00020001, &dbsc3_0->dbadj0);
+       writel(0x20082008, &dbsc3_0->dbadj2);
+       writel(0x00020002, &dbsc3_0->dbwt0cnf0);
+       writel(0x0000000F, &dbsc3_0->dbwt0cnf4);
+
+       writel(0x00000015, &dbsc3_0->dbpdrga);
+       writel(0x00000D70, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000016, &dbsc3_0->dbpdrga);
+       writel(0x00000006, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000017, &dbsc3_0->dbpdrga);
+       writel(0x00000018, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000012, &dbsc3_0->dbpdrga);
+       writel(0x9D5CBB66, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000013, &dbsc3_0->dbpdrga);
+       writel(0x1A868300, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000023, &dbsc3_0->dbpdrga);
+       writel(0x00FDB6C0, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000014, &dbsc3_0->dbpdrga);
+       writel(0x300214D8, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000001A, &dbsc3_0->dbpdrga);
+       writel(0x930035C7, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000060, &dbsc3_0->dbpdrga);
+       writel(0x330657B2, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000011, &dbsc3_0->dbpdrga);
+       writel(0x1000040B, &dbsc3_0->dbpdrgd);
+
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x00000071, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x2100FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+       writel(0x0000FA00, &dbsc3_0->dbcmd);
+
+       writel(0x110000DB, &dbsc3_0->dbcmd);
+
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x00000181, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000001, &dbsc3_0->dbpdrga);
+       writel(0x0000FE01, &dbsc3_0->dbpdrgd);
+
+       writel(0x00000004, &dbsc3_0->dbpdrga);
+       dbpdrgd_check(dbsc3_0);
+
+       writel(0x00000000, &dbsc3_0->dbbs0cnt1);
+       writel(0x01004C20, &dbsc3_0->dbcalcnf);
+       writel(0x014000AA, &dbsc3_0->dbcaltr);
+       writel(0x00000140, &dbsc3_0->dbrfcnf0);
+       writel(0x00081860, &dbsc3_0->dbrfcnf1);
+       writel(0x00010000, &dbsc3_0->dbrfcnf2);
+       writel(0x00000001, &dbsc3_0->dbrfen);
+       writel(0x00000001, &dbsc3_0->dbacen);
+}
+#else
+#define bsc_init() do {} while (0)
+#endif /* CONFIG_NORFLASH */
+
+void s_init(void)
+{
+       struct r8a7790_rwdt *rwdt = (struct r8a7790_rwdt *)RWDT_BASE;
+       struct r8a7790_swdt *swdt = (struct r8a7790_swdt *)SWDT_BASE;
+
+       /* Watchdog init */
+       writel(0xA5A5A500, &rwdt->rwtcsra);
+       writel(0xA5A5A500, &swdt->swtcsra);
+
+       /* QoS(Quality-of-Service) Init */
+       qos_init();
+
+       /* BSC init */
+       bsc_init();
+}
+
+#define MSTPSR1        0xE6150038
+#define SMSTPCR1       0xE6150134
+#define TMU0_MSTP125   (1 << 25)
+
+#define MSTPSR7        0xE61501C4
+#define SMSTPCR7       0xE615014C
+#define SCIF0_MSTP721  (1 << 21)
+
+#define PMMR   0xE6060000
+#define GPSR4  0xE6060014
+#define IPSR14 0xE6060058
+
+#define        set_guard_reg(addr, mask, value)        \
+{ \
+       u32     val; \
+       val = (readl(addr) & ~(mask)) | (value);        \
+       writel(~val, PMMR);     \
+       writel(val, addr);      \
+}
+
+#define mstp_setbits(type, addr, saddr, set) \
+       out_##type((saddr), in_##type(addr) | (set))
+#define mstp_clrbits(type, addr, saddr, clear) \
+       out_##type((saddr), in_##type(addr) & ~(clear))
+#define mstp_setbits_le32(addr, saddr, set)    \
+               mstp_setbits(le32, addr, saddr, set)
+#define mstp_clrbits_le32(addr, saddr, clear)  \
+               mstp_clrbits(le32, addr, saddr, clear)
+
+int board_early_init_f(void)
+{
+       /* TMU0 */
+       mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+
+#if defined(CONFIG_NORFLASH)
+       /* SCIF0 */
+       set_guard_reg(GPSR4, 0x34000000, 0x00000000);
+       set_guard_reg(IPSR14, 0x00000FC7, 0x00000481);
+       set_guard_reg(GPSR4,  0x00000000, 0x34000000);
+#endif
+
+       mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721);
+
+       return 0;
+}
+
+DECLARE_GLOBAL_DATA_PTR;
+int board_init(void)
+{
+       /* board id for linux */
+       gd->bd->bi_arch_number = MACH_TYPE_LAGER;
+       /* adress of boot parameters */
+       gd->bd->bi_boot_params = LAGER_SDRAM_BASE + 0x100;
+
+       /* Init PFC controller */
+       r8a7790_pinmux_init();
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+       return 0;
+}
+
+const struct rmobile_sysinfo sysinfo = {
+       CONFIG_RMOBILE_BOARD_STRING
+};
+
+void dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = LAGER_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = LAGER_SDRAM_SIZE;
+}
+
+int board_late_init(void)
+{
+       return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+}
diff --git a/board/renesas/lager/qos.c b/board/renesas/lager/qos.c
new file mode 100644 (file)
index 0000000..b88511a
--- /dev/null
@@ -0,0 +1,1119 @@
+/*
+ * board/renesas/lager/qos.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/arch/rmobile.h>
+
+/* QoS version 0.954 */
+
+enum {
+       DBSC3_R00, DBSC3_R01, DBSC3_R02, DBSC3_R03, DBSC3_R04,
+       DBSC3_R05, DBSC3_R06, DBSC3_R07, DBSC3_R08, DBSC3_R09,
+       DBSC3_R10, DBSC3_R11, DBSC3_R12, DBSC3_R13, DBSC3_R14,
+       DBSC3_R15,
+       DBSC3_W00, DBSC3_W01, DBSC3_W02, DBSC3_W03, DBSC3_W04,
+       DBSC3_W05, DBSC3_W06, DBSC3_W07, DBSC3_W08, DBSC3_W09,
+       DBSC3_W10, DBSC3_W11, DBSC3_W12, DBSC3_W13, DBSC3_W14,
+       DBSC3_W15,
+       DBSC3_NR,
+};
+
+static const u32 dbsc3_qos_addr[DBSC3_NR] = {
+       [DBSC3_R00] = DBSC3_0_QOS_R0_BASE,
+       [DBSC3_R01] = DBSC3_0_QOS_R1_BASE,
+       [DBSC3_R02] = DBSC3_0_QOS_R2_BASE,
+       [DBSC3_R03] = DBSC3_0_QOS_R3_BASE,
+       [DBSC3_R04] = DBSC3_0_QOS_R4_BASE,
+       [DBSC3_R05] = DBSC3_0_QOS_R5_BASE,
+       [DBSC3_R06] = DBSC3_0_QOS_R6_BASE,
+       [DBSC3_R07] = DBSC3_0_QOS_R7_BASE,
+       [DBSC3_R08] = DBSC3_0_QOS_R8_BASE,
+       [DBSC3_R09] = DBSC3_0_QOS_R9_BASE,
+       [DBSC3_R10] = DBSC3_0_QOS_R10_BASE,
+       [DBSC3_R11] = DBSC3_0_QOS_R11_BASE,
+       [DBSC3_R12] = DBSC3_0_QOS_R12_BASE,
+       [DBSC3_R13] = DBSC3_0_QOS_R13_BASE,
+       [DBSC3_R14] = DBSC3_0_QOS_R14_BASE,
+       [DBSC3_R15] = DBSC3_0_QOS_R15_BASE,
+       [DBSC3_W00] = DBSC3_0_QOS_W0_BASE,
+       [DBSC3_W01] = DBSC3_0_QOS_W1_BASE,
+       [DBSC3_W02] = DBSC3_0_QOS_W2_BASE,
+       [DBSC3_W03] = DBSC3_0_QOS_W3_BASE,
+       [DBSC3_W04] = DBSC3_0_QOS_W4_BASE,
+       [DBSC3_W05] = DBSC3_0_QOS_W5_BASE,
+       [DBSC3_W06] = DBSC3_0_QOS_W6_BASE,
+       [DBSC3_W07] = DBSC3_0_QOS_W7_BASE,
+       [DBSC3_W08] = DBSC3_0_QOS_W8_BASE,
+       [DBSC3_W09] = DBSC3_0_QOS_W9_BASE,
+       [DBSC3_W10] = DBSC3_0_QOS_W10_BASE,
+       [DBSC3_W11] = DBSC3_0_QOS_W11_BASE,
+       [DBSC3_W12] = DBSC3_0_QOS_W12_BASE,
+       [DBSC3_W13] = DBSC3_0_QOS_W13_BASE,
+       [DBSC3_W14] = DBSC3_0_QOS_W14_BASE,
+       [DBSC3_W15] = DBSC3_0_QOS_W15_BASE,
+};
+
+void qos_init(void)
+{
+       int i;
+       struct r8a7790_s3c *s3c;
+       struct r8a7790_s3c_qos *s3c_qos;
+       struct r8a7790_dbsc3_qos *qos_addr;
+       struct r8a7790_mxi *mxi;
+       struct r8a7790_mxi_qos *mxi_qos;
+       struct r8a7790_axi_qos *axi_qos;
+
+       /* DBSC DBADJ2 */
+       writel(0x20042004, DBSC3_0_DBADJ2);
+
+       /* S3C -QoS */
+       s3c = (struct r8a7790_s3c *)S3C_BASE;
+       writel(0x80FF1C1E, &s3c->s3cadsplcr);
+       writel(0x1F060505, &s3c->s3crorr);
+       writel(0x1F020100, &s3c->s3cworr);
+
+       /* QoS Control Registers */
+       s3c_qos = (struct r8a7790_s3c_qos *)S3C_QOS_CCI0_BASE;
+       writel(0x00800080, &s3c_qos->s3cqos0);
+       writel(0x22000010, &s3c_qos->s3cqos1);
+       writel(0x22002200, &s3c_qos->s3cqos2);
+       writel(0x2F002200, &s3c_qos->s3cqos3);
+       writel(0x2F002F00, &s3c_qos->s3cqos4);
+       writel(0x22000010, &s3c_qos->s3cqos5);
+       writel(0x22002200, &s3c_qos->s3cqos6);
+       writel(0x2F002200, &s3c_qos->s3cqos7);
+       writel(0x2F002F00, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7790_s3c_qos *)S3C_QOS_CCI1_BASE;
+       writel(0x00800080, &s3c_qos->s3cqos0);
+       writel(0x22000010, &s3c_qos->s3cqos1);
+       writel(0x22002200, &s3c_qos->s3cqos2);
+       writel(0x2F002200, &s3c_qos->s3cqos3);
+       writel(0x2F002F00, &s3c_qos->s3cqos4);
+       writel(0x22000010, &s3c_qos->s3cqos5);
+       writel(0x22002200, &s3c_qos->s3cqos6);
+       writel(0x2F002200, &s3c_qos->s3cqos7);
+       writel(0x2F002F00, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7790_s3c_qos *)S3C_QOS_MXI_BASE;
+       writel(0x80918099, &s3c_qos->s3cqos0);
+       writel(0x20410010, &s3c_qos->s3cqos1);
+       writel(0x200A2023, &s3c_qos->s3cqos2);
+       writel(0x20502001, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20410FFF, &s3c_qos->s3cqos5);
+       writel(0x200A2023, &s3c_qos->s3cqos6);
+       writel(0x20502001, &s3c_qos->s3cqos7);
+       writel(0x20142032, &s3c_qos->s3cqos8);
+
+       s3c_qos = (struct r8a7790_s3c_qos *)S3C_QOS_AXI_BASE;
+
+       writel(0x00810089, &s3c_qos->s3cqos0);
+       writel(0x20410001, &s3c_qos->s3cqos1);
+       writel(0x200A2023, &s3c_qos->s3cqos2);
+       writel(0x20502001, &s3c_qos->s3cqos3);
+       writel(0x00002032, &s3c_qos->s3cqos4);
+       writel(0x20410FFF, &s3c_qos->s3cqos5);
+       writel(0x200A2023, &s3c_qos->s3cqos6);
+       writel(0x20502001, &s3c_qos->s3cqos7);
+       writel(0x20142032, &s3c_qos->s3cqos8);
+
+       writel(0x00200808, &s3c->s3carcr11);
+
+       /* DBSC -QoS */
+       /* DBSC0 - Read/Write */
+       for (i = DBSC3_R00; i < DBSC3_NR; i++) {
+               qos_addr = (struct r8a7790_dbsc3_qos *)dbsc3_qos_addr[i];
+               writel(0x00000203, &qos_addr->dblgcnt);
+               writel(0x00002064, &qos_addr->dbtmval0);
+               writel(0x00002048, &qos_addr->dbtmval1);
+               writel(0x00002032, &qos_addr->dbtmval2);
+               writel(0x00002019, &qos_addr->dbtmval3);
+               writel(0x00000001, &qos_addr->dbrqctr);
+               writel(0x00002019, &qos_addr->dbthres0);
+               writel(0x00002019, &qos_addr->dbthres1);
+               writel(0x00002019, &qos_addr->dbthres2);
+               writel(0x00000000, &qos_addr->dblgqon);
+       }
+       /* CCI-400 -QoS */
+       writel(0x20001000, CCI_400_MAXOT_1);
+       writel(0x20001000, CCI_400_MAXOT_2);
+       writel(0x0000000C, CCI_400_QOSCNTL_1);
+       writel(0x0000000C, CCI_400_QOSCNTL_2);
+
+       /* MXI -QoS */
+       /* Transaction Control (MXI) */
+       mxi = (struct r8a7790_mxi *)MXI_BASE;
+       writel(0x00000013, &mxi->mxrtcr);
+       writel(0x00000013, &mxi->mxwtcr);
+       writel(0x00B800C0, &mxi->mxsaar0);
+       writel(0x02000800, &mxi->mxsaar1);
+       writel(0x00200000, &mxi->mxs3cracr);
+       writel(0x00200000, &mxi->mxs3cwacr);
+       writel(0x00200000, &mxi->mxaxiracr);
+       writel(0x00200000, &mxi->mxaxiwacr);
+
+       /* QoS Control (MXI) */
+       mxi_qos = (struct r8a7790_mxi_qos *)MXI_QOS_BASE;
+       writel(0x0000000C, &mxi_qos->vspdu0);
+       writel(0x0000000C, &mxi_qos->vspdu1);
+       writel(0x0000000D, &mxi_qos->du0);
+       writel(0x0000000D, &mxi_qos->du1);
+
+       /* AXI -QoS */
+       /* Transaction Control (MXI) */
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_SYX64TO128_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_AVB_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200A, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_G2D_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200A, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_IMP0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002002, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_IMP1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002004, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_IMUX0_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_IMUX1_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_IMUX2_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_LBS_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MMUDS_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MMUM_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MMUR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MMUS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MMUS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MTSB0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002002, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_MTSB1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002002, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_PCI_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_RTX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_SDS0_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200A, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_SDS1_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200A, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_USB20_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002005, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_USB21_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002005, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_USB22_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002005, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI_USB30_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (RT-AXI) */
+       axi_qos = (struct r8a7790_axi_qos *)RT_AXI_SHX_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002005, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)RT_AXI_RDS_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)RT_AXI_RTX64TO128_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)RT_AXI_STPRO_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002003, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (MP-AXI) */
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_ADSP_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_ASDS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_ASDS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002014, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_MLP_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002002, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_MMUMP_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_SPU_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MP_AXI_SPUC_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200D, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (SYS-AXI256) */
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI256_AXI128TO256_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI256_SYX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI256_MPX_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)SYS_AXI256_MXI_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (CCI-AXI) */
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUS0_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_SYX2_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUDS_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUM_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MXI_BASE;
+       writel(0x00000002, &axi_qos->qosconf);
+       writel(0x0000200F, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUS1_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)CCI_AXI_MMUMP_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002001, &axi_qos->qosctset0);
+       writel(0x00002009, &axi_qos->qosctset1);
+       writel(0x00002003, &axi_qos->qosctset2);
+       writel(0x00002003, &axi_qos->qosctset3);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000000, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       /* QoS Register (Media-AXI) */
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_JPR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_JPW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_GCU0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_GCU0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_GCU1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_GCU1W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_TDMR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_TDMW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP0CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP0CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP1CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP1CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPDU0CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPDU0CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPDU1CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPDU1CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002018, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VIN0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP0W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_IMSR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_IMSW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSP1W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP1W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_IMRR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_IMRW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP2R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_FDP2W_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPD0R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPD0W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPD1R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VSPD1W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_DU0R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_DU0W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_DU1R_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_DU1W_BASE;
+       writel(0x00000000, &axi_qos->qosconf);
+       writel(0x0000200C, &axi_qos->qosctset0);
+       writel(0x00000001, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP0CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP0CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP0VR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP0VW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VPC0R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP1CR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP1CW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP1VR_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VCP1VW_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000001, &axi_qos->qosqon);
+
+       axi_qos = (struct r8a7790_axi_qos *)MEDIA_AXI_VPC1R_BASE;
+       writel(0x00000001, &axi_qos->qosconf);
+       writel(0x00002007, &axi_qos->qosctset0);
+       writel(0x00000020, &axi_qos->qosreqctr);
+       writel(0x00002006, &axi_qos->qosthres0);
+       writel(0x00002001, &axi_qos->qosthres1);
+       writel(0x00000001, &axi_qos->qosthres2);
+       writel(0x00000000, &axi_qos->qosqon);
+}
diff --git a/board/renesas/lager/qos.h b/board/renesas/lager/qos.h
new file mode 100644 (file)
index 0000000..9a6c046
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __QOS_H__
+#define __QOS_H__
+
+void qos_init(void);
+
+#endif
index 223a516..cc4c2a0 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 #include <common.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
-#include <asm/io.h>
 
 void coloured_LED_init(void)
 {
@@ -19,11 +19,11 @@ void coloured_LED_init(void)
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
-       at91_set_pio_output(CONFIG_RED_LED, 1);
-       at91_set_pio_output(CONFIG_GREEN_LED, 1);
-       at91_set_pio_output(CONFIG_YELLOW_LED, 1);
+       gpio_direction_output(CONFIG_RED_LED, 1);
+       gpio_direction_output(CONFIG_GREEN_LED, 1);
+       gpio_direction_output(CONFIG_YELLOW_LED, 1);
 
-       at91_set_pio_value(CONFIG_RED_LED, 0);
-       at91_set_pio_value(CONFIG_GREEN_LED, 1);
-       at91_set_pio_value(CONFIG_YELLOW_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_YELLOW_LED, 1);
 }
index a2a569b..a634383 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <asm/sizes.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -73,10 +74,10 @@ static void pm9261_nand_hw_init(void)
                &pmc->pcer);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 
        at91_set_a_periph(AT91_PIO_PORTC, 0, 0);        /* NANDOE */
        at91_set_a_periph(AT91_PIO_PORTC, 1, 0);        /* NANDWE */
index 44e3430..bfc2310 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 #include <common.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
-#include <asm/io.h>
 
 void coloured_LED_init(void)
 {
@@ -19,9 +19,9 @@ void coloured_LED_init(void)
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
 
-       at91_set_pio_output(CONFIG_RED_LED, 1);
-       at91_set_pio_output(CONFIG_GREEN_LED, 1);
+       gpio_direction_output(CONFIG_RED_LED, 1);
+       gpio_direction_output(CONFIG_GREEN_LED, 1);
 
-       at91_set_pio_value(CONFIG_RED_LED, 0);
-       at91_set_pio_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
 }
index 48eba99..3cedeef 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <asm/sizes.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -67,10 +68,10 @@ static void pm9263_nand_hw_init(void)
                &smc->cs[3].mode);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
index 5bb5a3c..c9f2747 100644 (file)
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <asm/sizes.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -66,11 +67,11 @@ static void pm9g45_nand_hw_init(void)
 
 #ifdef CONFIG_SYS_NAND_READY_PIN
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 #endif
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
index 6bcc883..6aa0509 100644 (file)
@@ -150,8 +150,6 @@ int power_init_board(void)
 
        set_ps_hold_ctrl();
 
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-
        if (pmic_init(I2C_PMIC))
                return -1;
 
index 7012c13..8aba51c 100644 (file)
@@ -57,15 +57,18 @@ int board_init(void)
 
 void i2c_init_board(void)
 {
-       struct exynos4_gpio_part1 *gpio1 =
-               (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
+       int err;
        struct exynos4_gpio_part2 *gpio2 =
                (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
 
-       /* I2C_5 -> PMIC -> Adapter 0 */
-       s5p_gpio_direction_output(&gpio1->b, 7, 1);
-       s5p_gpio_direction_output(&gpio1->b, 6, 1);
-       /* I2C_9 -> FG -> Adapter 1 */
+       /* I2C_5 -> PMIC */
+       err = exynos_pinmux_config(PERIPH_ID_I2C5, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("I2C%d not configured\n", (I2C_5));
+               return;
+       }
+
+       /* I2C_8 -> FG */
        s5p_gpio_direction_output(&gpio2->y4, 0, 1);
        s5p_gpio_direction_output(&gpio2->y4, 1, 1);
 }
@@ -290,10 +293,10 @@ int power_init_board(void)
         * The FUEL_GAUGE is marked as I2C9 on the schematic, but connected
         * to logical I2C adapter 1
         */
-       ret = pmic_init(I2C_0);
+       ret = pmic_init(I2C_5);
        ret |= pmic_init_max8997();
-       ret |= power_fg_init(I2C_1);
-       ret |= power_muic_init(I2C_0);
+       ret |= power_fg_init(I2C_8);
+       ret |= power_muic_init(I2C_5);
        ret |= power_bat_init(0);
        if (ret)
                return ret;
@@ -501,6 +504,17 @@ int board_usb_init(int index, enum usb_init_type init)
        debug("USB_udc_probe\n");
        return s3c_udc_probe(&s5pc210_otg_data);
 }
+
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void)
+{
+       struct pmic *muic = pmic_get("MAX8997_MUIC");
+       if (!muic)
+               return 0;
+
+       return !!muic->chrg->chrg_type(muic);
+}
+#endif
 #endif
 
 static void pmic_reset(void)
index d44d825..147de17 100644 (file)
@@ -25,6 +25,9 @@
 #include <power/max77693_fg.h>
 #include <libtizen.h>
 #include <errno.h>
+#include <usb.h>
+#include <usb/s3c_udc.h>
+#include <usb_mass_storage.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -40,7 +43,7 @@ static void check_hw_revision(void)
        int modelrev = 0;
        int i;
 
-       gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+       gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
        /*
         * GPM1[1:0]: MODEL_REV[1:0]
@@ -90,7 +93,7 @@ static inline u32 get_model_rev(void)
 
 static void board_external_gpio_init(void)
 {
-       gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+       gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
        /*
         * some pins which in alive block are connected with external pull-up
@@ -115,12 +118,17 @@ static void board_external_gpio_init(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static void board_init_i2c(void)
 {
-       gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
-       gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+       int err;
+
+       gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
+       gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
        /* I2C_7 */
-       s5p_gpio_direction_output(&gpio1->d0, 2, 1);
-       s5p_gpio_direction_output(&gpio1->d0, 3, 1);
+       err = exynos_pinmux_config(PERIPH_ID_I2C7, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("I2C%d not configured\n", (I2C_7));
+               return;
+       }
 
        /* I2C_8 */
        s5p_gpio_direction_output(&gpio1->f1, 4, 1);
@@ -132,6 +140,24 @@ static void board_init_i2c(void)
 }
 #endif
 
+#ifdef CONFIG_SYS_I2C_SOFT
+int get_soft_i2c_scl_pin(void)
+{
+       if (I2C_ADAP_HWNR)
+               return exynos4x12_gpio_part2_get_nr(m2, 1); /* I2C9 */
+       else
+               return exynos4x12_gpio_part1_get_nr(f1, 4); /* I2C8 */
+}
+
+int get_soft_i2c_sda_pin(void)
+{
+       if (I2C_ADAP_HWNR)
+               return exynos4x12_gpio_part2_get_nr(m2, 0); /* I2C9 */
+       else
+               return exynos4x12_gpio_part1_get_nr(f1, 5); /* I2C8 */
+}
+#endif
+
 int board_early_init_f(void)
 {
        check_hw_revision();
@@ -147,7 +173,7 @@ static int pmic_init_max77686(void);
 int board_init(void)
 {
        struct exynos4_power *pwr =
-               (struct exynos4_power *)EXYNOS4X12_POWER_BASE;
+               (struct exynos4_power *)samsung_get_base_power();
 
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
@@ -167,11 +193,11 @@ int power_init_board(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
        board_init_i2c();
 #endif
-       pmic_init(I2C_0);               /* I2C adapter 0 - bus name I2C_5 */
+       pmic_init(I2C_7);               /* I2C adapter 7 - bus name s3c24x0_7 */
        pmic_init_max77686();
-       pmic_init_max77693(I2C_2);      /* I2C adapter 2 - bus name I2C_10 */
-       power_muic_init(I2C_2);         /* I2C adapter 2 - bus name I2C_10 */
-       power_fg_init(I2C_1);           /* I2C adapter 1 - bus name I2C_9 */
+       pmic_init_max77693(I2C_9);      /* I2C adapter 9 - bus name soft1 */
+       power_muic_init(I2C_9);         /* I2C adapter 9 - bus name soft1 */
+       power_fg_init(I2C_8);           /* I2C adapter 8 - bus name soft0 */
        power_bat_init(0);
 
        p_chrg = pmic_get("MAX77693_PMIC");
@@ -254,7 +280,7 @@ int board_mmc_init(bd_t *bis)
 {
        int err0, err2 = 0;
 
-       gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+       gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
        /* eMMC_EN: SD_0_CDn: GPK0[2] Output High */
        s5p_gpio_direction_output(&gpio2->k0, 2, 1);
@@ -308,6 +334,95 @@ int board_mmc_init(bd_t *bis)
        return err0 & err2;
 }
 
+#ifdef CONFIG_USB_GADGET
+static int s5pc210_phy_control(int on)
+{
+       int ret = 0;
+       unsigned int val;
+       struct pmic *p, *p_pmic, *p_muic;
+
+       p_pmic = pmic_get("MAX77686_PMIC");
+       if (!p_pmic)
+               return -ENODEV;
+
+       if (pmic_probe(p_pmic))
+               return -1;
+
+       p_muic = pmic_get("MAX77693_MUIC");
+       if (!p_muic)
+               return -ENODEV;
+
+       if (pmic_probe(p_muic))
+               return -1;
+
+       if (on) {
+               ret = max77686_set_ldo_mode(p_pmic, 12, OPMODE_ON);
+               if (ret)
+                       return -1;
+
+               p = pmic_get("MAX77693_PMIC");
+               if (!p)
+                       return -ENODEV;
+
+               if (pmic_probe(p))
+                       return -1;
+
+               /* SAFEOUT */
+               ret = pmic_reg_read(p, MAX77693_SAFEOUT, &val);
+               if (ret)
+                       return -1;
+
+               val |= MAX77693_ENSAFEOUT1;
+               ret = pmic_reg_write(p, MAX77693_SAFEOUT, val);
+               if (ret)
+                       return -1;
+
+               /* PATH: USB */
+               ret = pmic_reg_write(p_muic, MAX77693_MUIC_CONTROL1,
+                       MAX77693_MUIC_CTRL1_DN1DP2);
+
+       } else {
+               ret = max77686_set_ldo_mode(p_pmic, 12, OPMODE_LPM);
+               if (ret)
+                       return -1;
+
+               /* PATH: UART */
+               ret = pmic_reg_write(p_muic, MAX77693_MUIC_CONTROL1,
+                       MAX77693_MUIC_CTRL1_UT1UR2);
+       }
+
+       if (ret)
+               return -1;
+
+       return 0;
+}
+
+struct s3c_plat_otg_data s5pc210_otg_data = {
+       .phy_control    = s5pc210_phy_control,
+       .regs_phy       = EXYNOS4X12_USBPHY_BASE,
+       .regs_otg       = EXYNOS4X12_USBOTG_BASE,
+       .usb_phy_ctrl   = EXYNOS4X12_USBPHY_CONTROL,
+       .usb_flags      = PHY0_SLEEP,
+};
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+       debug("USB_udc_probe\n");
+       return s3c_udc_probe(&s5pc210_otg_data);
+}
+
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void)
+{
+       struct pmic *muic = pmic_get("MAX77693_MUIC");
+       if (!muic)
+               return 0;
+
+       return !!muic->chrg->chrg_type(muic);
+}
+#endif
+#endif
+
 static int pmic_init_max77686(void)
 {
        struct pmic *p = pmic_get("MAX77686_PMIC");
@@ -421,7 +536,7 @@ void exynos_lcd_power_on(void)
 {
        struct pmic *p = pmic_get("MAX77686_PMIC");
 
-       gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
+       gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
 
        /* LCD_2.2V_EN: GPC0[1] */
        s5p_gpio_set_pull(&gpio1->c0, 1, GPIO_PULL_UP);
@@ -435,7 +550,7 @@ void exynos_lcd_power_on(void)
 
 void exynos_reset_lcd(void)
 {
-       gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
+       gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
 
        /* reset lcd */
        s5p_gpio_direction_output(&gpio1->f2, 1, 0);
index 30b0541..6989557 100644 (file)
@@ -31,6 +31,60 @@ the console. It does not set the terminal into raw mode, so cursor keys and
 history will not work yet.
 
 
+SPI Emulation
+-------------
+
+Sandbox supports SPI and SPI flash emulation.
+
+This is controlled by the spi_sf argument, the format of which is:
+
+   bus:cs:device:file
+
+   bus    - SPI bus number
+   cs     - SPI chip select number
+   device - SPI device emulation name
+   file   - File on disk containing the data
+
+For example:
+
+ dd if=/dev/zero of=spi.bin bs=1M count=4
+ ./u-boot --spi_sf 0:0:M25P16:spi.bin
+
+With this setup you can issue SPI flash commands as normal:
+
+=>sf probe
+SF: Detected M25P16 with page size 64 KiB, total 2 MiB
+=>sf read 0 0 10000
+SF: 65536 bytes @ 0x0 Read: OK
+=>
+
+Since this is a full SPI emulation (rather than just flash), you can
+also use low-level SPI commands:
+
+=>sspi 0:0 32 9f
+FF202015
+
+This is issuing a READ_ID command and getting back 20 (ST Micro) part
+0x2015 (the M25P16).
+
+Drivers are connected to a particular bus/cs using sandbox's state
+structure (see the 'spi' member). A set of operations must be provided
+for each driver.
+
+
+Configuration settings for the curious are:
+
+CONFIG_SANDBOX_SPI_MAX_BUS
+       The maximum number of SPI buses supported by the driver (default 1).
+
+CONFIG_SANDBOX_SPI_MAX_CS
+       The maximum number of chip selects supported by the driver
+       (default 10).
+
+CONFIG_SPI_IDLE_VAL
+       The idle value on the SPI bus
+
+
 Tests
 -----
 
index fbe7997..266dbbb 100644 (file)
@@ -15,7 +15,8 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/unaligned.h>
 #include <net.h>
-#include <usbdescriptors.h>
+#include <errno.h>
+#include <g_dnl.h>
 #include "factoryset.h"
 
 #define EEPR_PG_SZ             0x80
@@ -224,8 +225,20 @@ int factoryset_read_eeprom(int i2c_addr)
                                        MAX_STRING_LENGTH)) {
                debug("display name: %s\n", factory_dat.disp_name);
        }
-
 #endif
+       if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV",
+                                       (uchar *)"num", factory_dat.serial,
+                                       MAX_STRING_LENGTH)) {
+               debug("serial number: %s\n", factory_dat.serial);
+       }
+       if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV",
+                                       (uchar *)"ver", buf,
+                                       MAX_STRING_LENGTH)) {
+               factory_dat.version = simple_strtoul((char *)buf,
+                                                           NULL, 16);
+               debug("version number: %d\n", factory_dat.version);
+       }
+
        return 0;
 
 err:
@@ -279,6 +292,13 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
        put_unaligned(factory_dat.usb_vendor_id, &dev->idVendor);
        put_unaligned(factory_dat.usb_product_id, &dev->idProduct);
+       g_dnl_set_serialnumber((char *)factory_dat.serial);
+
        return 0;
 }
+
+int g_dnl_get_board_bcd_device_number(int gcnum)
+{
+       return factory_dat.version;
+}
 #endif /* defined(CONFIG_SPL_BUILD) */
index 445f384..4d6de10 100644 (file)
@@ -18,6 +18,8 @@ struct factorysetcontainer {
 #if defined(CONFIG_VIDEO)
        unsigned char disp_name[MAX_STRING_LENGTH];
 #endif
+       unsigned char serial[MAX_STRING_LENGTH];
+       int version;
 };
 
 int factoryset_read_eeprom(int i2c_addr);
diff --git a/board/siemens/corvus/Makefile b/board/siemens/corvus/Makefile
new file mode 100644 (file)
index 0000000..f3ebf77
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Makefile for siemens CORVUS (AT91SAM9G45) based board
+# (C) Copyright 2013 Siemens AG
+#
+# Based on:
+# U-Boot file: board/atmel/at91sam9m10g45ek/Makefile
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop <stelian@popies.net>
+# Lead Tech Design <www.leadtechdesign.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += board.o
diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c
new file mode 100644 (file)
index 0000000..f1e93ef
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Board functions for Siemens CORVUS (AT91SAM9G45) based board
+ * (C) Copyright 2013 Siemens AG
+ *
+ * Based on:
+ * U-Boot file: board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/at91sam9g45_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/clk.h>
+#include <lcd.h>
+#include <atmel_lcdc.h>
+#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
+#include <net.h>
+#endif
+#include <netdev.h>
+#include <spi.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_CMD_NAND
+static void corvus_nand_hw_init(void)
+{
+       struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
+       struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       unsigned long csa;
+
+       /* Enable CS3 */
+       csa = readl(&matrix->ebicsa);
+       csa |= AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA;
+       writel(csa, &matrix->ebicsa);
+
+       /* Configure SMC CS3 for NAND/SmartMedia */
+       writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+              AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+              &smc->cs[3].setup);
+       writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(3) |
+              AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(2),
+              &smc->cs[3].pulse);
+       writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(4),
+              &smc->cs[3].cycle);
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+              AT91_SMC_MODE_EXNW_DISABLE |
+#ifdef CONFIG_SYS_NAND_DBW_16
+              AT91_SMC_MODE_DBW_16 |
+#else /* CONFIG_SYS_NAND_DBW_8 */
+              AT91_SMC_MODE_DBW_8 |
+#endif
+              AT91_SMC_MODE_TDF_CYCLE(3),
+              &smc->cs[3].mode);
+
+       writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
+
+       /* Configure RDY/BSY */
+       at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+
+       /* Enable NandFlash */
+       at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+}
+#endif
+
+#ifdef CONFIG_CMD_USB
+static void taurus_usb_hw_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       writel(1 << ATMEL_ID_PIODE, &pmc->pcer);
+
+       at91_set_gpio_output(AT91_PIN_PD1, 0);
+       at91_set_gpio_output(AT91_PIN_PD3, 0);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void corvus_macb_hw_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       /* Enable clock */
+       writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
+
+       /*
+        * Disable pull-up on:
+        *      RXDV (PA15) => PHY normal mode (not Test mode)
+        *      ERX0 (PA12) => PHY ADDR0
+        *      ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0
+        *
+        * PHY has internal pull-down
+        */
+       at91_set_pio_pullup(AT91_PIO_PORTA, 15, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 12, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 13, 0);
+
+       at91_phy_reset();
+
+       /* Re-enable pull-up */
+       at91_set_pio_pullup(AT91_PIO_PORTA, 15, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 12, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 13, 1);
+
+       /* And the pins. */
+       at91_macb_hw_init();
+}
+#endif
+
+int board_early_init_f(void)
+{
+       at91_seriald_hw_init();
+       return 0;
+}
+
+int board_init(void)
+{
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+#ifdef CONFIG_CMD_NAND
+       corvus_nand_hw_init();
+#endif
+#ifdef CONFIG_ATMEL_SPI
+       at91_spi0_hw_init(1 << 4);
+#endif
+#ifdef CONFIG_HAS_DATAFLASH
+       at91_spi0_hw_init(1 << 0);
+#endif
+#ifdef CONFIG_MACB
+       corvus_macb_hw_init();
+#endif
+#ifdef CONFIG_CMD_USB
+       taurus_usb_hw_init();
+#endif
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
+       return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_MACB
+       rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
+#endif
+       return rc;
+}
+
+/* SPI chip select control */
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus == 0 && cs < 2;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       switch (slave->cs) {
+       case 1:
+                       at91_set_gpio_output(AT91_PIN_PB18, 0);
+                       break;
+       case 0:
+       default:
+                       at91_set_gpio_output(AT91_PIN_PB3, 0);
+                       break;
+       }
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       switch (slave->cs) {
+       case 1:
+                       at91_set_gpio_output(AT91_PIN_PB18, 1);
+                       break;
+       case 0:
+       default:
+                       at91_set_gpio_output(AT91_PIN_PB3, 1);
+                       break;
+       }
+}
index af9d84f..3a5e11d 100644 (file)
@@ -38,11 +38,11 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SPL_BUILD
 static struct dxr2_baseboard_id __attribute__((section(".data"))) settings;
-
+/* @303MHz-i0 */
 const struct ddr3_data ddr3_default = {
-       0x33524444, 0x56312e33, 0x0100, 0x0001, 0x003A, 0x008A, 0x010B,
-       0x00C4, 0x0888A39B, 0x26247FDA, 0x501F821F, 0x0006, 0x61C04AB2,
-       0x00000618,
+       0x33524444, 0x56312e34, 0x0080, 0x0000, 0x0038, 0x003E, 0x00A4,
+       0x0075, 0x0888A39B, 0x26247FDA, 0x501F821F, 0x00100206, 0x61A44A32,
+       0x00000618, 0x0000014A,
 };
 
 static void set_default_ddr3_timings(void)
@@ -73,6 +73,7 @@ static void print_ddr3_timings(void)
 
        PRINTARGS(sdram_config);
        PRINTARGS(ref_ctrl);
+       PRINTARGS(ioctr_val);
 }
 
 static void print_chip_data(void)
@@ -139,13 +140,9 @@ struct emif_regs dxr2_ddr3_emif_reg_data = {
 };
 
 struct ddr_data dxr2_ddr3_data = {
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 struct cmd_control dxr2_ddr3_cmd_ctrl_data = {
-       .cmd0dldiff = 0,
-       .cmd1dldiff = 0,
-       .cmd2dldiff = 0,
 };
        /* pass values from eeprom */
        dxr2_ddr3_emif_reg_data.sdram_tim1 = settings.ddr3.sdram_tim1;
@@ -168,7 +165,7 @@ struct cmd_control dxr2_ddr3_cmd_ctrl_data = {
        dxr2_ddr3_cmd_ctrl_data.cmd2csratio = settings.ddr3.ddr3_sratio;
        dxr2_ddr3_cmd_ctrl_data.cmd2iclkout = settings.ddr3.iclkout;
 
-       config_ddr(DDR_PLL_FREQ, DXR2_IOCTRL_VAL, &dxr2_ddr3_data,
+       config_ddr(DDR_PLL_FREQ, settings.ddr3.ioctr_val, &dxr2_ddr3_data,
                   &dxr2_ddr3_cmd_ctrl_data, &dxr2_ddr3_emif_reg_data, 0);
 }
 
index 2be78fb..abf5432 100644 (file)
 #define MAGIC_CHIP     0x50494843
 
 /* Automatic generated definition */
-/* Wed, 19 Jun 2013 10:57:48 +0200 */
-/* From file: draco/ddr3-data-micron.txt */
+/* Wed, 18 Sep 2013 18:58:27 +0200 */
+/* From file: draco/ddr3-data-micron-v2.txt */
 struct ddr3_data {
        unsigned int magic;                     /* 0x33524444 */
-       unsigned int version;                   /* 0x56312e33 */
+       unsigned int version;                   /* 0x56312e34 */
        unsigned short int ddr3_sratio;         /* 0x0100 */
        unsigned short int iclkout;             /* 0x0001 */
        unsigned short int dt0rdsratio0;        /* 0x003A */
@@ -36,9 +36,10 @@ struct ddr3_data {
        unsigned int sdram_tim1;                /* 0x0888A39B */
        unsigned int sdram_tim2;                /* 0x26247FDA */
        unsigned int sdram_tim3;                /* 0x501F821F */
-       unsigned short int emif_ddr_phy_ctlr_1; /* 0x0006 */
+       unsigned int emif_ddr_phy_ctlr_1;       /* 0x00100206 */
        unsigned int sdram_config;              /* 0x61C04AB2 */
        unsigned int ref_ctrl;                  /* 0x00000618 */
+       unsigned int ioctr_val;                 /* 0x0000018B */
 };
 
 struct chip_data {
index bc80b79..5c22999 100644 (file)
@@ -63,6 +63,164 @@ static struct module_pin_mux gpios_pin_mux[] = {
        {OFFSET(gpmc_ad11), (MODE(7) | PULLUDEN | RXACTIVE)},
        {OFFSET(gpmc_csn3), MODE(7) },                  /* LED0 GPIO2_0 */
        {OFFSET(emu0), MODE(7)},                        /* LED1 GPIO3_7 */
+       /* Triacs in HW Rev 2 */
+       {OFFSET(uart1_ctsn), MODE(7) | PULLUDDIS | RXACTIVE},   /* Y5 GPIO0_12*/
+       {OFFSET(mmc0_dat1), MODE(7) | PULLUDDIS | RXACTIVE},    /* Y3 GPIO2_28*/
+       {OFFSET(mmc0_dat2), MODE(7) | PULLUDDIS | RXACTIVE},    /* Y7 GPIO2_27*/
+       /* Triacs initial HW Rev */
+       {OFFSET(gpmc_csn1), MODE(7) | RXACTIVE | PULLUDDIS},    /* 1_30 Y0 */
+       {OFFSET(gpmc_be1n), MODE(7) | RXACTIVE | PULLUDDIS},    /* 1_28 Y1 */
+       {OFFSET(gpmc_csn2), MODE(7) | RXACTIVE | PULLUDDIS},    /* 1_31 Y2 */
+       {OFFSET(lcd_data15), MODE(7) | RXACTIVE | PULLUDDIS},   /* 0_11 Y3 */
+       {OFFSET(lcd_data14), MODE(7) | RXACTIVE | PULLUDDIS},   /* 0_10 Y4 */
+       {OFFSET(gpmc_clk), MODE(7) | RXACTIVE | PULLUDDIS},     /* 2_1  Y5 */
+       {OFFSET(emu1), MODE(7) | RXACTIVE | PULLUDDIS},         /* 3_8  Y6 */
+       {OFFSET(gpmc_ad15), MODE(7) | RXACTIVE | PULLUDDIS},    /* 1_15 Y7 */
+       /* Remaining pins that were not used in this file */
+       {OFFSET(gpmc_ad8), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_ad9), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a4), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a5), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a6), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a7), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a8), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a9), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a10), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(gpmc_a11), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data4), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data5), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data6), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data7), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data8), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_data9), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_vsync), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_hsync), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_pclk), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(lcd_ac_bias_en), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mmc0_dat3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mmc0_dat0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mmc0_clk), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mmc0_cmd), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(spi0_sclk), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(spi0_d0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(spi0_d1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(spi0_cs0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(uart0_ctsn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(uart0_rtsn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(uart1_rtsn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(uart1_rxd), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(uart1_txd), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_aclkx), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_fsx), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_axr0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_ahclkr), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_aclkr), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_fsr), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_axr1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(mcasp0_ahclkx), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(xdma_event_intr0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(xdma_event_intr1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(nresetin_out), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(porz), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(nnmi), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(osc0_in), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(osc0_out), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(rsvd1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(tms), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(tdi), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(tdo), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(tck), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ntrst), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(osc1_in), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(osc1_out), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(pmic_power_en), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(rtc_porz), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(rsvd2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ext_wakeup), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(enz_kaldo_1p8v), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_dm), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_dp), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_ce), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_id), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_vbus), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb0_drvvbus), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_dm), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_dp), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_ce), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_id), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_vbus), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(usb1_drvvbus), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_resetn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_csn0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_cke), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_ck), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_nck), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_casn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_rasn), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_wen), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_ba0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_ba1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_ba2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a4), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a5), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a6), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a7), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a8), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a9), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a10), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a11), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a12), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a13), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a14), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_a15), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_odt), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d4), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d5), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d6), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d7), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d8), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d9), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d10), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d11), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d12), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d13), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d14), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_d15), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqm0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqm1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqs0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqsn0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqs1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_dqsn1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_vref), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_vtp), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_strben0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ddr_strben1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain7), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain6), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain5), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain4), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain3), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain2), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain1), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(ain0), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(vrefp), MODE(7) | RXACTIVE | PULLUDDIS},
+       {OFFSET(vrefn), MODE(7) | RXACTIVE | PULLUDDIS},
        {-1},
 };
 
index 2c1841f..0a25b4b 100644 (file)
@@ -58,19 +58,14 @@ struct ddr_data pxm2_ddr3_data = {
        .datawdsratio0 = 0,
        .datafwsratio0 = 0x8020080,
        .datawrsratio0 = 0x4010040,
-       .datauserank0delay = 1,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 struct cmd_control pxm2_ddr3_cmd_ctrl_data = {
        .cmd0csratio = 0x80,
-       .cmd0dldiff = 0,
        .cmd0iclkout = 0,
        .cmd1csratio = 0x80,
-       .cmd1dldiff = 0,
        .cmd1iclkout = 0,
        .cmd2csratio = 0x80,
-       .cmd2dldiff = 0,
        .cmd2iclkout = 0,
 };
 
@@ -413,8 +408,7 @@ static int conf_disp_pll(int m, int n)
 
 static int board_video_init(void)
 {
-       /* set 300 MHz */
-       conf_disp_pll(25, 2);
+       conf_disp_pll(24, 1);
        if (factory_dat.pxm50)
                da8xx_video_init(&lcd_panels[0], &lcd_cfg, lcd_cfg.bpp);
        else
index 5de8fc6..77592db 100644 (file)
@@ -63,19 +63,14 @@ struct ddr_data rut_ddr3_data = {
        .datawdsratio0 = 0x85,
        .datafwsratio0 = 0x100,
        .datawrsratio0 = 0xc1,
-       .datauserank0delay = 1,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 struct cmd_control rut_ddr3_cmd_ctrl_data = {
        .cmd0csratio = 0x40,
-       .cmd0dldiff = 0,
        .cmd0iclkout = 1,
        .cmd1csratio = 0x40,
-       .cmd1dldiff = 0,
        .cmd1iclkout = 1,
        .cmd2csratio = 0x40,
-       .cmd2dldiff = 0,
        .cmd2iclkout = 1,
 };
 
@@ -83,9 +78,48 @@ struct cmd_control rut_ddr3_cmd_ctrl_data = {
                   &rut_ddr3_cmd_ctrl_data, &rut_ddr3_emif_reg_data, 0);
 }
 
+static int request_and_pulse_reset(int gpio, const char *name)
+{
+       int ret;
+       const int delay_us = 2000; /* 2ms */
+
+       ret = gpio_request(gpio, name);
+       if (ret < 0) {
+               printf("%s: Unable to request %s\n", __func__, name);
+               goto err;
+       }
+
+       ret = gpio_direction_output(gpio, 0);
+       if (ret < 0) {
+               printf("%s: Unable to set %s  as output\n", __func__, name);
+               goto err_free_gpio;
+       }
+
+       udelay(delay_us);
+
+       gpio_set_value(gpio, 1);
+
+       return 0;
+
+err_free_gpio:
+       gpio_free(gpio);
+err:
+       return ret;
+}
+
+#define GPIO_TO_PIN(bank, gpio)                (32 * (bank) + (gpio))
+#define ETH_PHY_RESET_GPIO             GPIO_TO_PIN(2, 18)
+#define MAXTOUCH_RESET_GPIO            GPIO_TO_PIN(3, 18)
+#define DISPLAY_RESET_GPIO             GPIO_TO_PIN(3, 19)
+
+#define REQUEST_AND_PULSE_RESET(N) \
+               request_and_pulse_reset(N, #N);
+
 static void spl_siemens_board_init(void)
 {
-       return;
+       REQUEST_AND_PULSE_RESET(ETH_PHY_RESET_GPIO);
+       REQUEST_AND_PULSE_RESET(MAXTOUCH_RESET_GPIO);
+       REQUEST_AND_PULSE_RESET(DISPLAY_RESET_GPIO);
 }
 #endif /* if def CONFIG_SPL_BUILD */
 
@@ -336,7 +370,6 @@ int clk_get(int clk)
 static int conf_disp_pll(int m, int n)
 {
        struct cm_perpll *cmper = (struct cm_perpll *)CM_PER;
-       struct cm_dpll *cmdpll = (struct cm_dpll *)CM_DPLL;
        struct dpll_params dpll_lcd = {m, n, -1, -1, -1, -1, -1};
 #if defined(DISPL_PLL_SPREAD_SPECTRUM)
        struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
@@ -353,8 +386,6 @@ static int conf_disp_pll(int m, int n)
                0
        };
        do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
-       /* 0x44e0_0500 write lcdc pixel clock mux Linux hat hier 0 */
-       writel(0x0, &cmdpll->clklcdcpixelclk);
 
        do_setup_dpll(&dpll_lcd_regs, &dpll_lcd);
 
@@ -380,10 +411,13 @@ static int enable_lcd(void)
 {
        unsigned char buf[1];
 
+       set_gpio(BOARD_LCD_RESET, 0);
+       mdelay(1);
        set_gpio(BOARD_LCD_RESET, 1);
+       mdelay(1);
 
        /* spi lcd init */
-       kwh043st20_f01_spi_startup(1, 0, 5000000, SPI_MODE_3);
+       kwh043st20_f01_spi_startup(1, 0, 5000000, SPI_MODE_0);
 
        /* backlight on */
        buf[0] = 0xf;
@@ -418,7 +452,7 @@ static int board_video_init(void)
                printf("%s: %s not found, using default %s\n", __func__,
                       factory_dat.disp_name, lcd_panels[i].name);
        }
-       conf_disp_pll(25, 2);
+       conf_disp_pll(24, 1);
        da8xx_video_init(&lcd_panels[display], &lcd_cfgs[display],
                         lcd_cfgs[display].bpp);
 
diff --git a/board/siemens/taurus/Makefile b/board/siemens/taurus/Makefile
new file mode 100644 (file)
index 0000000..a26fb92
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Makefile for Siemens TAURUS (AT91SAM9G20) based board
+# (C) Copyright 2013 Siemens AG
+#
+# Based on:
+# U-Boot file: board/atmel/at91sam9260ek/Makefile
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop <stelian@popies.net>
+# Lead Tech Design <www.leadtechdesign.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += taurus.o
diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
new file mode 100644 (file)
index 0000000..673b302
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Board functions for Siemens TAURUS (AT91SAM9G20) based boards
+ * (C) Copyright Siemens AG
+ *
+ * Based on:
+ * U-Boot file: board/atmel/at91sam9260ek/at91sam9260ek.c
+ *
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/at91sam9260_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91sam9_sdramc.h>
+#include <atmel_mci.h>
+
+#include <net.h>
+#include <netdev.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_CMD_NAND
+static void taurus_nand_hw_init(void)
+{
+       struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
+       struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+       unsigned long csa;
+
+       /* Assign CS3 to NAND/SmartMedia Interface */
+       csa = readl(&matrix->ebicsa);
+       csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
+       writel(csa, &matrix->ebicsa);
+
+       /* Configure SMC CS3 for NAND/SmartMedia */
+       writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) |
+              AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0),
+              &smc->cs[3].setup);
+       writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(3) |
+              AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(3),
+              &smc->cs[3].pulse);
+       writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(7),
+              &smc->cs[3].cycle);
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+              AT91_SMC_MODE_EXNW_DISABLE |
+              AT91_SMC_MODE_DBW_8 |
+              AT91_SMC_MODE_TDF_CYCLE(3),
+              &smc->cs[3].mode);
+
+       /* Configure RDY/BSY */
+       at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+
+       /* Enable NandFlash */
+       at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void taurus_macb_hw_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       /* Enable EMAC clock */
+       writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
+
+       /*
+        * Disable pull-up on:
+        *      RXDV (PA17) => PHY normal mode (not Test mode)
+        *      ERX0 (PA14) => PHY ADDR0
+        *      ERX1 (PA15) => PHY ADDR1
+        *      ERX2 (PA25) => PHY ADDR2
+        *      ERX3 (PA26) => PHY ADDR3
+        *      ECRS (PA28) => PHY ADDR4  => PHYADDR = 0x0
+        *
+        * PHY has internal pull-down
+        */
+       at91_set_pio_pullup(AT91_PIO_PORTA, 14, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 15, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 17, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 25, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 26, 0);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 28, 0);
+
+       at91_phy_reset();
+
+       at91_set_gpio_input(AT91_PIN_PA25, 1);   /* ERST tri-state */
+
+       /* Re-enable pull-up */
+       at91_set_pio_pullup(AT91_PIO_PORTA, 14, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 15, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 17, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 25, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 26, 1);
+       at91_set_pio_pullup(AT91_PIO_PORTA, 28, 1);
+
+       /* Initialize EMAC=MACB hardware */
+       at91_macb_hw_init();
+}
+#endif
+
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
+{
+       at91_mci_hw_init();
+
+       return atmel_mci_init((void *)ATMEL_BASE_MCI);
+}
+#endif
+
+int board_early_init_f(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       /* Enable clocks for all PIOs */
+       writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
+               (1 << ATMEL_ID_PIOC),
+               &pmc->pcer);
+
+       return 0;
+}
+
+int board_init(void)
+{
+       /* adress of boot parameters */
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+       at91_seriald_hw_init();
+#ifdef CONFIG_CMD_NAND
+       taurus_nand_hw_init();
+#endif
+#ifdef CONFIG_MACB
+       taurus_macb_hw_init();
+#endif
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
+       return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_MACB
+       rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC0, 0x00);
+#endif
+       return rc;
+}
index 704a63b..27cdf77 100644 (file)
@@ -19,7 +19,6 @@
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <watchdog.h>
 
@@ -67,8 +66,6 @@ static void stamp9G20_nand_hw_init(void)
 static void stamp9G20_macb_hw_init(void)
 {
        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
-       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
-       unsigned long erstl;
 
        /* Enable the PHY Chip via PA26 on the Stamp 2 Adaptor */
        at91_set_gpio_output(AT91_PIN_PA26, 0);
@@ -91,33 +88,7 @@ static void stamp9G20_macb_hw_init(void)
                pin_to_mask(AT91_PIN_PA28),
                &pioa->pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | (AT91_RSTC_MR_ERSTL(13) &
-                               ~AT91_RSTC_MR_URSTEN), &rstc->mr);
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-
-       /* Wait for end of hardware reset */
-       unsigned long start = get_timer(0);
-       unsigned long timeout = 1000; /* 1000ms */
-
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL)) {
-
-               /* avoid shutdown by watchdog */
-               WATCHDOG_RESET();
-               mdelay(10);
-
-               /* timeout for not getting stuck in an endless loop */
-               if (get_timer(start) >= timeout) {
-                       puts("*** ERROR: Timeout waiting for PHY reset!\n");
-                       break;
-               };
-       };
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
-               &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(pin_to_mask(AT91_PIN_PA14) |
index db225ce..33693e4 100644 (file)
@@ -107,21 +107,16 @@ static const struct ddr_data ddr2_data = {
                          (MT47H128M16RT25E_PHY_WR_DATA<<20) |
                          (MT47H128M16RT25E_PHY_WR_DATA<<10) |
                          (MT47H128M16RT25E_PHY_WR_DATA<<0)),
-       .datauserank0delay = MT47H128M16RT25E_PHY_RANK0_DELAY,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct cmd_control ddr2_cmd_ctrl_data = {
        .cmd0csratio = MT47H128M16RT25E_RATIO,
-       .cmd0dldiff = MT47H128M16RT25E_DLL_LOCK_DIFF,
        .cmd0iclkout = MT47H128M16RT25E_INVERT_CLKOUT,
 
        .cmd1csratio = MT47H128M16RT25E_RATIO,
-       .cmd1dldiff = MT47H128M16RT25E_DLL_LOCK_DIFF,
        .cmd1iclkout = MT47H128M16RT25E_INVERT_CLKOUT,
 
        .cmd2csratio = MT47H128M16RT25E_RATIO,
-       .cmd2dldiff = MT47H128M16RT25E_DLL_LOCK_DIFF,
        .cmd2iclkout = MT47H128M16RT25E_INVERT_CLKOUT,
 };
 
@@ -139,7 +134,6 @@ static const struct ddr_data ddr3_data = {
        .datawdsratio0 = MT41J128MJT125_WR_DQS,
        .datafwsratio0 = MT41J128MJT125_PHY_FIFO_WE,
        .datawrsratio0 = MT41J128MJT125_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct ddr_data ddr3_beagleblack_data = {
@@ -147,7 +141,6 @@ static const struct ddr_data ddr3_beagleblack_data = {
        .datawdsratio0 = MT41K256M16HA125E_WR_DQS,
        .datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE,
        .datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct ddr_data ddr3_evm_data = {
@@ -155,48 +148,38 @@ static const struct ddr_data ddr3_evm_data = {
        .datawdsratio0 = MT41J512M8RH125_WR_DQS,
        .datafwsratio0 = MT41J512M8RH125_PHY_FIFO_WE,
        .datawrsratio0 = MT41J512M8RH125_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct cmd_control ddr3_cmd_ctrl_data = {
        .cmd0csratio = MT41J128MJT125_RATIO,
-       .cmd0dldiff = MT41J128MJT125_DLL_LOCK_DIFF,
        .cmd0iclkout = MT41J128MJT125_INVERT_CLKOUT,
 
        .cmd1csratio = MT41J128MJT125_RATIO,
-       .cmd1dldiff = MT41J128MJT125_DLL_LOCK_DIFF,
        .cmd1iclkout = MT41J128MJT125_INVERT_CLKOUT,
 
        .cmd2csratio = MT41J128MJT125_RATIO,
-       .cmd2dldiff = MT41J128MJT125_DLL_LOCK_DIFF,
        .cmd2iclkout = MT41J128MJT125_INVERT_CLKOUT,
 };
 
 static const struct cmd_control ddr3_beagleblack_cmd_ctrl_data = {
        .cmd0csratio = MT41K256M16HA125E_RATIO,
-       .cmd0dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
        .cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
 
        .cmd1csratio = MT41K256M16HA125E_RATIO,
-       .cmd1dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
        .cmd1iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
 
        .cmd2csratio = MT41K256M16HA125E_RATIO,
-       .cmd2dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
        .cmd2iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
 };
 
 static const struct cmd_control ddr3_evm_cmd_ctrl_data = {
        .cmd0csratio = MT41J512M8RH125_RATIO,
-       .cmd0dldiff = MT41J512M8RH125_DLL_LOCK_DIFF,
        .cmd0iclkout = MT41J512M8RH125_INVERT_CLKOUT,
 
        .cmd1csratio = MT41J512M8RH125_RATIO,
-       .cmd1dldiff = MT41J512M8RH125_DLL_LOCK_DIFF,
        .cmd1iclkout = MT41J512M8RH125_INVERT_CLKOUT,
 
        .cmd2csratio = MT41J512M8RH125_RATIO,
-       .cmd2dldiff = MT41J512M8RH125_DLL_LOCK_DIFF,
        .cmd2iclkout = MT41J512M8RH125_INVERT_CLKOUT,
 };
 
index e77a501..6a734b3 100644 (file)
@@ -108,10 +108,13 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 9657c75..9ae88c5 100644 (file)
@@ -14,6 +14,7 @@
 #include <palmas.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sata.h>
 
 #include "mux_data.h"
 
@@ -77,6 +78,12 @@ int board_init(void)
        return 0;
 }
 
+int board_late_init(void)
+{
+       omap_sata_init();
+       return 0;
+}
+
 /**
  * @brief misc_init_r - Configure EVM board specific configurations
  * such as power configurations, ethernet initialization as phase2 of
index bb3a699..af854da 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/ehci.h>
 #include <asm/ehci-omap.h>
+#include <asm/arch/sata.h>
 
 #define DIE_ID_REG_BASE     (OMAP54XX_L4_CORE_BASE + 0x2000)
 #define DIE_ID_REG_OFFSET      0x200
@@ -67,6 +68,12 @@ int board_init(void)
        return 0;
 }
 
+int board_late_init(void)
+{
+       omap_sata_init();
+       return 0;
+}
+
 int board_eth_init(bd_t *bis)
 {
        return 0;
diff --git a/board/ti/omap730p2/Makefile b/board/ti/omap730p2/Makefile
deleted file mode 100644 (file)
index 8242f3d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2000-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  := omap730p2.o flash.o
-obj-y  += lowlevel_init.o
diff --git a/board/ti/omap730p2/README.omap730p2 b/board/ti/omap730p2/README.omap730p2
deleted file mode 100644 (file)
index 7c70916..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-
-                    u-boot for the TI OMAP730 Perseus2
-
-                     Dave Peverley, MPC-Data Limited
-                        http://www.mpc-data.co.uk
-
-
-Overview :
-
- As the OMAP730 is similar to the OMAP1610 in many ways, this port was based
-on the u-boot port to the OMAP1610 Innovator. Supported features are :
-
-  - Serial terminal support
-  - Onboard NOR Flash
-  - Ethernet via the seperate debug board
-  - Tested on Rev4 and Rev5 boards
-
- It has also been tested to work correctly when built with a 'standard' GCC
-3.2.1 cross-compiler as well as Montavista Linux CEE 3.1's toolchain.
-
-
-Hardware Configuration :
-
- The main dips on the P2 board should be set to 2,3,7 and 9 on with all
-others off. On the debug board, dips 1 and 7 should be on with the rest off.
-The serial console has been set up to run from the DB9 connector on the
-P2 board at 115200 baud, 8 data bits, no stop bits, 1 parity bit.
-
- It should be noted that the P2 board has NOR flash that is addressable via
-either CS0 or CS3. This mode can be changed via DIP9 on the P2 board.
-
-
-Installing u-boot for the P2 :
-
- You can simply build u-boot for the Perseus by following the instructions
-in the main readme file. The target configuration is "omap730p2_config".
-Once u-boot has been built, you should strip the executable so it can be
-loaded via CCS (which cant cope with the symbols in the ELF binary) :
-  $ cp u-boot u-boot.out
-  $ arm-linux-strip u-boot.out
-
- The method we've used for installing u-boot the first time on a P2 is
-as follows :
-
-1) Configure TI Code Composer Studio to connect to the P2 board via JTAG
-   as described in the Users Guide.
-
-2) Set up the P2 to boot from CS3, and connect with CCS. Reset the CPU
-   and run the "init_mmu" GEL script.
-
-3) Use the "Load Program" option to send the u-boot.out file to the P2 and
-   run.
-
- At this point, u-boot should run and you will see the boot menu on your
-serial terminal. You can then load the u-boot image to memory :
-
-  # loadb 0x10000000
-
- Send the "u-boot.bin" binary via the serial using Kermit. Once loaded
-you can self-flash u-boot :
-
-  # protect off 1:0
-  # erase 1:0
-  # cp.b 0x10000000 0x0 0x20000
-
- You should now be able to reset the board and run u-boot from flash.
-
-
-Alternative flash option :
-
- Sometimes, if you've been silly, you can get the board into a state where
-whats in flash has upset the board so much that you can no longer connect
-to the P2 via JTAG. However, you can set DIP9 to off to swap the boot mode
-of the P2 so that you boot from RAM instead of NOR flash. This moves NOR
-flash up to 0x0C000000. You can build a special version of u-boot to
-utilise this by the following config :
-
-  $ make omap730p2_cs0boot_config
-
- If you load this up via CCS it will detect flash at its alternate location
-and allow you to programme your u-boot image (which, remember must be built
-for CS3 boot!) Once you do this, you can revert to CS3 boot and it will work
-fine again.
-
-
-Errata :
-
-1) It's been observed that sometimes the tftp transfer of kernels to the
-   board can have checksum errors or stall. This appears to be an issue
-   with the lan91c96.c driver, and can normally be worked around by
-   resetting the board and trying again.
diff --git a/board/ti/omap730p2/config.mk b/board/ti/omap730p2/config.mk
deleted file mode 100644 (file)
index 8618820..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
-# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
-#
-# (C) Copyright 2003
-# Texas Instruments, <www.ti.com>
-# Kshitij Gupta <Kshitij@ti.com>
-#
-# TI Perseus 2 board with OMAP720 (ARM925EJS) cpu
-# see http://www.ti.com/ for more information on Texas Instruments
-#
-# Innovator has 1 bank of 256 MB SDRAM
-# Physical Address:
-# 1000'0000 to 2000'0000
-#
-#
-# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
-# (mem base + reserved)
-#
-# we load ourself to 1108'0000
-#
-#
-
-CONFIG_SYS_TEXT_BASE = 0x11080000
diff --git a/board/ti/omap730p2/flash.c b/board/ti/omap730p2/flash.c
deleted file mode 100644 (file)
index 56f981c..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * (C) Copyright 2001
- * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
- *
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2003
- * Texas Instruments, <www.ti.com>
- * Kshitij Gupta <Kshitij@ti.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <linux/byteorder/swab.h>
-
-#define PHYS_FLASH_SECT_SIZE   0x00020000      /* 256 KB sectors (x2) */
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips    */
-
-/* Board support for 1 or 2 flash devices */
-#undef FLASH_PORT_WIDTH32
-#define FLASH_PORT_WIDTH16
-
-#ifdef FLASH_PORT_WIDTH16
-#define FLASH_PORT_WIDTH               ushort
-#define FLASH_PORT_WIDTHV              vu_short
-#define SWAP(x)                        __swab16(x)
-#else
-#define FLASH_PORT_WIDTH               ulong
-#define FLASH_PORT_WIDTHV              vu_long
-#define SWAP(x)                        __swab32(x)
-#endif
-
-#define FPW    FLASH_PORT_WIDTH
-#define FPWV   FLASH_PORT_WIDTHV
-
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-
-
-/* Flash Organization Structure */
-typedef struct OrgDef {
-       unsigned int sector_number;
-       unsigned int sector_size;
-} OrgDef;
-
-
-/* Flash Organizations */
-OrgDef OrgIntel_28F256L18T[] = {
-       {4, 32 * 1024},                         /* 4 * 32kBytes sectors */
-       {255, 128 * 1024},                      /* 255 * 128kBytes sectors */
-};
-
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-unsigned long flash_init (void);
-static ulong flash_get_size (FPW * addr, flash_info_t * info);
-static int write_data (flash_info_t * info, ulong dest, FPW data);
-static void flash_get_offsets (ulong base, flash_info_t * info);
-void inline spin_wheel (void);
-void flash_print_info (flash_info_t * info);
-void flash_unprotect_sectors (FPWV * addr);
-int flash_erase (flash_info_t * info, int s_first, int s_last);
-int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
-
-/*-----------------------------------------------------------------------
- */
-
-unsigned long flash_init (void)
-{
-       int i;
-       ulong size = 0;
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
-               switch (i) {
-               case 0:
-                       flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
-                       flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
-                       break;
-               default:
-                       panic ("configured too many flash banks!\n");
-                       break;
-               }
-               size += flash_info[i].size;
-       }
-
-       /* Protect monitor and environment sectors
-        */
-       flash_protect (FLAG_PROTECT_SET,
-                       CONFIG_SYS_FLASH_BASE,
-                       CONFIG_SYS_FLASH_BASE + monitor_flash_len - 1, &flash_info[0]);
-
-       flash_protect (FLAG_PROTECT_SET,
-                       CONFIG_ENV_ADDR,
-                       CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
-
-       return size;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_get_offsets (ulong base, flash_info_t * info)
-{
-       int i;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               return;
-       }
-
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
-               for (i = 0; i < info->sector_count; i++) {
-                       if (i > 255) {
-                               info->start[i] = base + (i * 0x8000);
-                               info->protect[i] = 0;
-                       } else {
-                               info->start[i] = base +
-                                               (i * PHYS_FLASH_SECT_SIZE);
-                               info->protect[i] = 0;
-                       }
-               }
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-void flash_print_info (flash_info_t * info)
-{
-       int i;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               printf ("missing or unknown FLASH type\n");
-               return;
-       }
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case FLASH_MAN_INTEL:
-               printf ("INTEL ");
-               break;
-       default:
-               printf ("Unknown Vendor ");
-               break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_28F256L18T:
-               printf ("FLASH 28F256L18T\n");
-               break;
-       default:
-               printf ("Unknown Chip Type\n");
-               break;
-       }
-
-       printf ("  Size: %ld MB in %d Sectors\n",
-                       info->size >> 20, info->sector_count);
-
-       printf ("  Sector Start Addresses:");
-       for (i = 0; i < info->sector_count; ++i) {
-               if ((i % 5) == 0)
-                       printf ("\n   ");
-               printf (" %08lX%s",
-                       info->start[i], info->protect[i] ? " (RO)" : "     ");
-       }
-       printf ("\n");
-       return;
-}
-
-/*
- * The following code cannot be run from FLASH!
- */
-static ulong flash_get_size (FPW * addr, flash_info_t * info)
-{
-       volatile FPW value;
-
-       /* Write auto select command: read Manufacturer ID */
-       addr[0x5555] = (FPW) 0x00AA00AA;
-       addr[0x2AAA] = (FPW) 0x00550055;
-       addr[0x5555] = (FPW) 0x00900090;
-
-       mb ();
-       value = addr[0];
-
-       switch (value) {
-
-       case (FPW) INTEL_MANUFACT:
-               info->flash_id = FLASH_MAN_INTEL;
-               break;
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               addr[0] = (FPW) 0x00FF00FF;     /* restore read mode */
-               return (0);             /* no or unknown flash  */
-       }
-
-       mb ();
-       value = addr[1];        /* device ID        */
-       switch (value) {
-
-       case (FPW) (INTEL_ID_28F256L18T):
-               info->flash_id += FLASH_28F256L18T;
-               info->sector_count = 259;
-               info->size = 0x02000000;
-               break;                  /* => 32 MB     */
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               break;
-       }
-
-       if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) {
-               printf ("** ERROR: sector count %d > max (%d) **\n",
-                               info->sector_count, CONFIG_SYS_MAX_FLASH_SECT);
-               info->sector_count = CONFIG_SYS_MAX_FLASH_SECT;
-       }
-
-       addr[0] = (FPW) 0x00FF00FF;     /* restore read mode */
-
-       return (info->size);
-}
-
-
-/* unprotects a sector for write and erase
- * on some intel parts, this unprotects the entire chip, but it
- * wont hurt to call this additional times per sector...
- */
-void flash_unprotect_sectors (FPWV * addr)
-{
-#define PD_FINTEL_WSMS_READY_MASK    0x0080
-
-       *addr = (FPW) 0x00500050;       /* clear status register */
-
-       /* this sends the clear lock bit command */
-       *addr = (FPW) 0x00600060;
-       *addr = (FPW) 0x00D000D0;
-}
-
-
-/*-----------------------------------------------------------------------
- */
-
-int flash_erase (flash_info_t * info, int s_first, int s_last)
-{
-       int flag, prot, sect;
-       ulong type, start;
-       int rcode = 0;
-
-       if ((s_first < 0) || (s_first > s_last)) {
-               if (info->flash_id == FLASH_UNKNOWN) {
-                       printf ("- missing\n");
-               } else {
-                       printf ("- no sectors to erase\n");
-               }
-               return 1;
-       }
-
-       type = (info->flash_id & FLASH_VENDMASK);
-       if ((type != FLASH_MAN_INTEL)) {
-               printf ("Can't erase unknown flash type %08lx - aborted\n",
-                               info->flash_id);
-               return 1;
-       }
-
-       prot = 0;
-       for (sect = s_first; sect <= s_last; ++sect) {
-               if (info->protect[sect]) {
-                       prot++;
-               }
-       }
-
-       if (prot) {
-               printf ("- Warning: %d protected sectors will not be erased!\n",
-                               prot);
-       } else {
-               printf ("\n");
-       }
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts ();
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       FPWV *addr = (FPWV *) (info->start[sect]);
-                       FPW status;
-
-                       printf ("Erasing sector %2d ... ", sect);
-
-                       flash_unprotect_sectors (addr);
-
-                       /* arm simple, non interrupt dependent timer */
-                       start = get_timer(0);
-
-                       *addr = (FPW) 0x00500050;/* clear status register */
-                       *addr = (FPW) 0x00200020;/* erase setup */
-                       *addr = (FPW) 0x00D000D0;/* erase confirm */
-
-                       while (((status =
-                               *addr) & (FPW) 0x00800080) !=
-                               (FPW) 0x00800080) {
-                                       if (get_timer(start) >
-                                       CONFIG_SYS_FLASH_ERASE_TOUT) {
-                                       printf ("Timeout\n");
-                                       /* suspend erase     */
-                                       *addr = (FPW) 0x00B000B0;
-                                       /* reset to read mode */
-                                       *addr = (FPW) 0x00FF00FF;
-                                       rcode = 1;
-                                       break;
-                               }
-                       }
-
-                       /* clear status register cmd.   */
-                       *addr = (FPW) 0x00500050;
-                       *addr = (FPW) 0x00FF00FF;/* resest to read mode */
-                       printf (" done\n");
-               }
-       }
-
-       if (flag)
-               enable_interrupts();
-
-       return rcode;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- * 4 - Flash not identified
- */
-
-int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-       ulong cp, wp;
-       FPW data;
-       int count, i, l, rc, port_width;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               return 4;
-       }
-/* get lower word aligned address */
-#ifdef FLASH_PORT_WIDTH16
-       wp = (addr & ~1);
-       port_width = 2;
-#else
-       wp = (addr & ~3);
-       port_width = 4;
-#endif
-
-       /*
-        * handle unaligned start bytes
-        */
-       if ((l = addr - wp) != 0) {
-               data = 0;
-               for (i = 0, cp = wp; i < l; ++i, ++cp) {
-                       data = (data << 8) | (*(uchar *) cp);
-               }
-               for (; i < port_width && cnt > 0; ++i) {
-                       data = (data << 8) | *src++;
-                       --cnt;
-                       ++cp;
-               }
-               for (; cnt == 0 && i < port_width; ++i, ++cp) {
-                       data = (data << 8) | (*(uchar *) cp);
-               }
-
-               if ((rc = write_data (info, wp, SWAP (data))) != 0) {
-                       return (rc);
-               }
-               wp += port_width;
-       }
-
-       /*
-        * handle word aligned part
-        */
-       count = 0;
-       while (cnt >= port_width) {
-               data = 0;
-               for (i = 0; i < port_width; ++i) {
-                       data = (data << 8) | *src++;
-               }
-               if ((rc = write_data (info, wp, SWAP (data))) != 0) {
-                       return (rc);
-               }
-               wp += port_width;
-               cnt -= port_width;
-               if (count++ > 0x800) {
-                       spin_wheel ();
-                       count = 0;
-               }
-       }
-
-       if (cnt == 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       data = 0;
-       for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
-               data = (data << 8) | *src++;
-               --cnt;
-       }
-       for (; i < port_width; ++i, ++cp) {
-               data = (data << 8) | (*(uchar *) cp);
-       }
-
-       return (write_data (info, wp, SWAP (data)));
-}
-
-/*-----------------------------------------------------------------------
- * Write a word or halfword to Flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_data (flash_info_t * info, ulong dest, FPW data)
-{
-       FPWV *addr = (FPWV *) dest;
-       ulong status;
-       int flag, rc = 0;
-       ulong start;
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*addr & data) != data) {
-               printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr);
-               return (2);
-       }
-       flash_unprotect_sectors (addr);
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts ();
-       *addr = (FPW) 0x00400040;       /* write setup */
-       *addr = data;
-
-       /* arm simple, non interrupt dependent timer */
-       start = get_timer(0);
-
-       /* wait while polling the status register */
-       while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
-               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       rc = 1;
-                       goto done;
-               }
-       }
-done:
-       *addr = (FPW)0x00FF00FF;        /* restore read mode */
-       if (flag)
-               enable_interrupts();
-       return rc;
-}
-
-void inline spin_wheel (void)
-{
-       static int p = 0;
-       static char w[] = "\\/-";
-
-       printf ("\010%c", w[p]);
-       (++p == 3) ? (p = 0) : 0;
-}
diff --git a/board/ti/omap730p2/lowlevel_init.S b/board/ti/omap730p2/lowlevel_init.S
deleted file mode 100644 (file)
index 795c495..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Board specific setup info
- *
- * (C) Copyright 2003-2004
- *
- * Texas Instruments, <www.ti.com>
- * Kshitij Gupta <Kshitij@ti.com>
- *
- * Modified for OMAP 1610 H2 board by Nishant Kamat, Jan 2004
- *
- * Modified for OMAP730 P2 Board by Dave Peverley, MPC-Data Limited
- * (http://www.mpc-data.co.uk)
- *
- * TODO : Tidy up and change to use system register defines
- *        from omap730.h where possible.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <version.h>
-
-#if defined(CONFIG_OMAP730)
-#include <./configs/omap730.h>
-#endif
-
-_TEXT_BASE:
-       .word   CONFIG_SYS_TEXT_BASE    /* sdram load addr from config.mk */
-
-.globl lowlevel_init
-lowlevel_init:
-       /* Save callers address in r11 - r11 must never be modified */
-       mov r11, lr
-
-       /*------------------------------------------------------*
-        *mask all IRQs by setting all bits in the INTMR default*
-        *------------------------------------------------------*/
-       mov     r1,     #0xffffffff
-       ldr     r0,     =REG_IHL1_MIR
-       str     r1,     [r0]
-       ldr     r0,     =REG_IHL2_MIR
-       str     r1,     [r0]
-
-       /*------------------------------------------------------*
-        * Set up ARM CLM registers (IDLECT1)                   *
-        *------------------------------------------------------*/
-       ldr     r0,     REG_ARM_IDLECT1
-       ldr     r1,     VAL_ARM_IDLECT1
-       str     r1,     [r0]
-
-       /*------------------------------------------------------*
-        * Set up ARM CLM registers (IDLECT2)                   *
-        *------------------------------------------------------*/
-       ldr     r0,     REG_ARM_IDLECT2
-       ldr     r1,     VAL_ARM_IDLECT2
-       str     r1,     [r0]
-
-       /*------------------------------------------------------*
-        * Set up ARM CLM registers (IDLECT3)                   *
-        *------------------------------------------------------*/
-       ldr     r0,     REG_ARM_IDLECT3
-       ldr     r1,     VAL_ARM_IDLECT3
-       str     r1,     [r0]
-
-
-       mov     r1,     #0x01           /* PER_EN bit */
-       ldr     r0,     REG_ARM_RSTCT2
-       strh    r1,     [r0]            /* CLKM; Peripheral reset. */
-
-       /* Set CLKM to Sync-Scalable    */
-       /* I supposedly need to enable the dsp clock before switching */
-       mov     r1,     #0x1000
-       ldr     r0,     REG_ARM_SYSST
-       strh    r1,     [r0]
-       mov     r0,     #0x400
-1:
-       subs    r0,     r0,     #0x1    /* wait for any bubbles to finish */
-       bne     1b
-       ldr     r1,     VAL_ARM_CKCTL
-       ldr     r0,     REG_ARM_CKCTL
-       strh    r1,     [r0]
-
-       /* a few nops to let settle */
-       nop
-       nop
-       nop
-       nop
-       nop
-       nop
-       nop
-       nop
-       nop
-       nop
-
-       /* setup DPLL 1 */
-       /* Ramp up the clock to 96Mhz */
-       ldr     r1,     VAL_DPLL1_CTL
-       ldr     r0,     REG_DPLL1_CTL
-       strh    r1,     [r0]
-       ands    r1,     r1,     #0x10   /* Check if PLL is enabled. */
-       beq     lock_end        /* Do not look for lock if BYPASS selected */
-2:
-       ldrh    r1,     [r0]
-       ands    r1,     r1,     #0x01   /*      Check the LOCK bit.*/
-       beq 2b                  /*      loop until bit goes hi. */
-lock_end:
-
-       /*------------------------------------------------------*
-        * Turn off the watchdog during init...                 *
-        *------------------------------------------------------*/
-       ldr     r0,     REG_WATCHDOG
-       ldr     r1,     WATCHDOG_VAL1
-       str     r1,     [r0]
-       ldr     r1,     WATCHDOG_VAL2
-       str     r1,     [r0]
-       ldr     r0,     REG_WSPRDOG
-       ldr     r1,     WSPRDOG_VAL1
-       str     r1,     [r0]
-       ldr     r0,     REG_WWPSDOG
-
-watch1Wait:
-       ldr     r1,     [r0]
-       tst     r1,     #0x10
-       bne     watch1Wait
-
-       ldr     r0,     REG_WSPRDOG
-       ldr     r1,     WSPRDOG_VAL2
-       str     r1,     [r0]
-       ldr     r0,     REG_WWPSDOG
-watch2Wait:
-       ldr     r1,     [r0]
-       tst     r1,     #0x10
-       bne     watch2Wait
-
-       /* Set memory timings corresponding to the new clock speed */
-
-       /* Check execution location to determine current execution location
-        * and branch to appropriate initialization code.
-        */
-       /* Compare physical SDRAM base & current execution location. */
-       and     r0, pc, #0xF0000000
-       /* Compare. */
-       cmp     r0, #0
-       /* Skip over EMIF-fast initialization if running from SDRAM. */
-       bne     skip_sdram
-
-       /*
-       * Delay for SDRAM initialization.
-       */
-       mov     r3,     #0x1800         /* value should be checked */
-3:
-       subs    r3,     r3,     #0x1    /* Decrement count */
-       bne     3b
-
-       ldr     r0,     REG_SDRAM_CONFIG
-       ldr     r1,     SDRAM_CONFIG_VAL
-       str     r1,     [r0]
-
-       ldr     r0,     REG_SDRAM_MRS_LEGACY
-       ldr     r1,     SDRAM_MRS_VAL
-       str     r1,     [r0]
-
-skip_sdram:
-
-common_tc:
-       /* slow interface */
-       ldr     r1,     VAL_TC_EMIFS_CS0_CONFIG
-       ldr     r0,     REG_TC_EMIFS_CS0_CONFIG
-       str     r1,     [r0] /* Chip Select 0 */
-
-       ldr     r1,     VAL_TC_EMIFS_CS1_CONFIG
-       ldr     r0,     REG_TC_EMIFS_CS1_CONFIG
-       str     r1,     [r0] /* Chip Select 1 */
-       ldr     r1,     VAL_TC_EMIFS_CS2_CONFIG
-       ldr     r0,     REG_TC_EMIFS_CS2_CONFIG
-       str     r1,     [r0] /* Chip Select 2 */
-       ldr     r1,     VAL_TC_EMIFS_CS3_CONFIG
-       ldr     r0,     REG_TC_EMIFS_CS3_CONFIG
-       str     r1,     [r0] /* Chip Select 3 */
-
-       /* 48MHz clock request for UART1 */
-       ldr     r1,     PERSEUS2_CONFIG_BASE
-       ldrh    r0,     [r1, #CONFIG_PCC_CONF]
-       orr     r0,     r0, #CONF_MOD_UART1_CLK_MODE_R
-       strh    r0,     [r1, #CONFIG_PCC_CONF]
-
-       /* Initialize public and private rheas
-        *  - set access factor 2 on both rhea / strobe
-        *  - disable write buffer on strb0, enable write buffer on strb1
-        */
-
-       ldr     R0,     REG_RHEA_PUB_CTL
-       ldr     R1,     REG_RHEA_PRIV_CTL
-       ldr     R2,     VAL_RHEA_CTL
-       strh    R2,     [R0]
-       strh    R2,     [R1]
-       mov     R3,     #2          /* disable write buffer on strb0, enable write buffer on strb1 */
-       strh    R3,     [R0, #0x08]     /* arm rhea control reg */
-       strh    R3,     [R1, #0x08]
-
-       /* enable IRQ and FIQ */
-
-       mrs     r4,     CPSR
-       bic     r4,     r4, #IRQ_MASK
-       bic     r4,     r4, #FIQ_MASK
-       msr     CPSR,   r4
-
-       /* set TAP CONF to TRI EMULATION */
-
-       ldr     r1,     [r0, #CONFIG_MODE2]
-       bic     r1,     r1, #0x18
-       orr     r1,     r1, #0x10
-       str     r1,     [r0, #CONFIG_MODE2]
-
-       /* set tdbgen to 1 */
-
-       ldr     r0,     PERSEUS2_CONFIG_BASE
-       ldr     r1,     [r0, #CONFIG_MODE1]
-       mov     r2,     #0x10000
-       orr     r1,     r1, r2
-       str     r1,     [r0, #CONFIG_MODE1]
-
-#ifdef CONFIG_P2_OMAP1610
-       /* inserting additional 2 clock cycle hold time for LAN */
-       ldr     r0,     REG_TC_EMIFS_CS1_ADVANCED
-       ldr     r1,     VAL_TC_EMIFS_CS1_ADVANCED
-       str     r1,     [r0]
-#endif
-       /* Start MPU Timer 1 */
-       ldr     r0,     REG_MPU_LOAD_TIMER
-       ldr     r1,     VAL_MPU_LOAD_TIMER
-       str     r1,     [r0]
-
-       ldr     r0,     REG_MPU_CNTL_TIMER
-       ldr     r1,     VAL_MPU_CNTL_TIMER
-       str     r1,     [r0]
-
-       /* back to arch calling code */
-       mov     pc,     r11
-
-       /* the literal pools origin */
-       .ltorg
-
-REG_TC_EMIFS_CONFIG:           /* 32 bits */
-       .word 0xfffecc0c
-REG_TC_EMIFS_CS0_CONFIG:       /* 32 bits */
-       .word 0xfffecc10
-REG_TC_EMIFS_CS1_CONFIG:       /* 32 bits */
-       .word 0xfffecc14
-REG_TC_EMIFS_CS2_CONFIG:       /* 32 bits */
-       .word 0xfffecc18
-REG_TC_EMIFS_CS3_CONFIG:       /* 32 bits */
-       .word 0xfffecc1c
-
-#ifdef CONFIG_P2_OMAP730
-REG_TC_EMIFS_CS1_ADVANCED:     /* 32 bits */
-       .word 0xfffecc54
-#endif
-
-/* MPU clock/reset/power mode control registers */
-REG_ARM_CKCTL:                 /* 16 bits */
-       .word 0xfffece00
-
-REG_ARM_IDLECT3:               /* 16 bits */
-       .word 0xfffece24
-REG_ARM_IDLECT2:               /* 16 bits */
-       .word 0xfffece08
-REG_ARM_IDLECT1:               /* 16 bits */
-       .word 0xfffece04
-
-REG_ARM_RSTCT2:                        /* 16 bits */
-       .word 0xfffece14
-REG_ARM_SYSST:                 /* 16 bits */
-       .word 0xfffece18
-/* DPLL control registers */
-REG_DPLL1_CTL:                 /* 16 bits */
-       .word 0xfffecf00
-
-/* Watch Dog register */
-/* secure watchdog stop */
-REG_WSPRDOG:
-       .word 0xfffeb048
-/* watchdog write pending */
-REG_WWPSDOG:
-       .word 0xfffeb034
-
-WSPRDOG_VAL1:
-       .word 0x0000aaaa
-WSPRDOG_VAL2:
-       .word 0x00005555
-
-/* SDRAM config is: auto refresh enabled, 16 bit 4 bank,
- counter @8192 rows, 10 ns, 8 burst */
-REG_SDRAM_CONFIG:
-       .word 0xfffecc20
-
-REG_SDRAM_MRS_LEGACY:
-       .word 0xfffecc24
-
-REG_WATCHDOG:
-       .word 0xfffec808
-
-REG_MPU_LOAD_TIMER:
-       .word 0xfffec504
-REG_MPU_CNTL_TIMER:
-       .word 0xfffec500
-
-/* Public and private rhea bridge registers definition */
-
-REG_RHEA_PUB_CTL:
-       .word 0xFFFECA00
-
-REG_RHEA_PRIV_CTL:
-       .word 0xFFFED300
-
-/* EMIFF SDRAM Configuration register
-   - self refresh disable
-   - auto refresh enabled
-   - SDRAM type 64 Mb, 16 bits bus 4 banks
-   - power down enabled
-   - SDRAM clock disabled
- */
-SDRAM_CONFIG_VAL:
-       .word 0x0C017DF4
-
-/* Burst full page length ; cas latency = 3 */
-SDRAM_MRS_VAL:
-       .word 0x00000037
-
-VAL_ARM_CKCTL:
-       .word 0x6505
-VAL_DPLL1_CTL:
-       .word 0x3412
-
-#ifdef CONFIG_P2_OMAP730
-VAL_TC_EMIFS_CS0_CONFIG:
-       .word 0x0000FFF3
-VAL_TC_EMIFS_CS1_CONFIG:
-       .word 0x00004278
-VAL_TC_EMIFS_CS2_CONFIG:
-       .word 0x00004278
-VAL_TC_EMIFS_CS3_CONFIG:
-       .word 0x00004278
-VAL_TC_EMIFS_CS1_ADVANCED:
-       .word 0x00000022
-#endif
-
-VAL_ARM_IDLECT1:
-       .word 0x00000400
-VAL_ARM_IDLECT2:
-       .word 0x00000886
-VAL_ARM_IDLECT3:
-       .word 0x00000015
-
-WATCHDOG_VAL1:
-       .word 0x000000f5
-WATCHDOG_VAL2:
-       .word 0x000000a0
-
-VAL_MPU_LOAD_TIMER:
-       .word 0xffffffff
-VAL_MPU_CNTL_TIMER:
-       .word 0xffffffa1
-
-VAL_RHEA_CTL:
-       .word                   0xFF22
-
-/* Config Register vals */
-PERSEUS2_CONFIG_BASE:
-       .word                   0xFFFE1000
-
-.equ   CONFIG_PCC_CONF,        0xB4
-.equ   CONFIG_MODE1,           0x10
-.equ   CONFIG_MODE2,           0x14
-.equ   CONF_MOD_UART1_CLK_MODE_R,      0x0A
-
-/* misc values */
-.equ   IRQ_MASK,               0x80           /* IRQ mask value */
-.equ   FIQ_MASK,               0x40           /* FIQ mask value */
diff --git a/board/ti/omap730p2/omap730p2.c b/board/ti/omap730p2/omap730p2.c
deleted file mode 100644 (file)
index 554019c..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
- *
- * (C) Copyright 2003
- * Texas Instruments, <www.ti.com>
- * Kshitij Gupta <Kshitij@ti.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <netdev.h>
-#if defined(CONFIG_OMAP730)
-#include <./configs/omap730.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int test_boot_mode(void);
-void spin_up_leds(void);
-void flash__init (void);
-void ether__init (void);
-void set_muxconf_regs (void);
-void peripheral_power_enable (void);
-
-#define FLASH_ON_CS0   1
-#define FLASH_ON_CS3   0
-
-static inline void delay (unsigned long loops)
-{
-       __asm__ volatile ("1:\n"
-                         "subs %0, %1, #1\n"
-                         "bne 1b":"=r" (loops):"0" (loops));
-}
-
-int test_boot_mode(void)
-{
-       /* Check for CS0 and CS3 address decode swapping */
-       if (*((volatile int *)EMIFS_CONFIG) & 0x00000002)
-               return(FLASH_ON_CS3);
-       else
-               return(FLASH_ON_CS0);
-}
-
-/* Toggle backup LED indication */
-void toggle_backup_led(void)
-{
-       static int  backupLEDState = 0;  /* Init variable so that the LED will be ON the first time */
-       volatile unsigned int *IOConfReg;
-
-
-       IOConfReg = (volatile unsigned int *) ((unsigned int) OMAP730_GPIO_BASE_5 + GPIO_DATA_OUTPUT);
-
-       if (backupLEDState != 0) {
-               *IOConfReg &= (0xFFFFEFFF);
-               backupLEDState = 0;
-       } else {
-               *IOConfReg |= (0x00001000);
-               backupLEDState = 1;
-       }
-}
-
-/*
- * Miscellaneous platform dependent initialisations
- */
-
-int board_init (void)
-{
-       /* arch number of OMAP 730 P2 Board - Same as the Innovator! */
-       gd->bd->bi_arch_number = MACH_TYPE_OMAP_PERSEUS2;
-
-       /* adress of boot parameters */
-       gd->bd->bi_boot_params = 0x10000100;
-
-       /* Configure MUX settings */
-       set_muxconf_regs ();
-
-       peripheral_power_enable ();
-
-       /* Backup LED indication via GPIO_140 -> Red led if MUX correctly setup */
-       toggle_backup_led();
-
-       /* Hold GSM in reset until needed */
-       *((volatile unsigned short *)M_CTL) &= ~1;
-
-       /*
-        *  CSx timings, GPIO Mux ... setup
-        */
-
-       /* Flash: CS0 timings setup */
-       *((volatile unsigned int *) FLASH_CFG_0) = 0x0000fff3;
-       *((volatile unsigned int *) FLASH_ACFG_0_1) = 0x00000088;
-
-       /* Ethernet support trough the debug board */
-       /* CS1 timings setup */
-       *((volatile unsigned int *) FLASH_CFG_1) = 0x0000fff3;
-       *((volatile unsigned int *) FLASH_ACFG_0_1) = 0x00000000;
-
-       /* this speeds up your boot a quite a bit.  However to make it
-        *  work, you need make sure your kernel startup flush bug is fixed.
-        *  ... rkw ...
-        */
-       icache_enable ();
-
-       flash__init ();
-       ether__init ();
-
-       return 0;
-}
-
-/******************************
- Routine:
- Description:
-******************************/
-void flash__init (void)
-{
-       unsigned int regval;
-
-       regval = *((volatile unsigned int *) EMIFS_CONFIG);
-       /* Turn off write protection for flash devices. */
-       regval = regval | 0x0001;
-       *((volatile unsigned int *) EMIFS_CONFIG) = regval;
-}
-
-/*************************************************************
- Routine:ether__init
- Description: take the Ethernet controller out of reset and wait
-                          for the EEPROM load to complete.
-*************************************************************/
-void ether__init (void)
-{
-#define LAN_RESET_REGISTER 0x0400001c
-
-       *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0000;
-       do {
-               *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0001;
-               udelay (100);
-       } while (*((volatile unsigned short *) LAN_RESET_REGISTER) != 0x0001);
-
-       do {
-               *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0000;
-               udelay (100);
-       } while (*((volatile unsigned short *) LAN_RESET_REGISTER) != 0x0000);
-
-#define ETH_CONTROL_REG 0x0400030b
-
-       *((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
-       udelay (100);
-}
-
-/******************************
- Routine:
- Description:
-******************************/
-int dram_init (void)
-{
-       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-
-       return 0;
-}
-
-/******************************************************
- Routine: set_muxconf_regs
- Description: Setting up the configuration Mux registers
-                         specific to the hardware
-*******************************************************/
-void set_muxconf_regs (void)
-{
-       volatile unsigned int *MuxConfReg;
-       /* set each registers to its reset value; */
-
-       /*
-        *  Backup LED Indication
-        */
-
-       /* Configure MUXed pin. Mode 6: GPIO_140 */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS2_IO_CONF10);
-       *MuxConfReg &= (0xFFFFFF1F);         /* Clear D_MPU_LPG1 */
-       *MuxConfReg |= 0x000000C0;           /* Set D_MPU_LPG1 to 0x6 */
-
-       /* Configure GPIO_140 as output */
-       MuxConfReg = (volatile unsigned int *) ((unsigned int) OMAP730_GPIO_BASE_5 + GPIO_DIRECTION_CONTROL);
-       *MuxConfReg &= (0xFFFFEFFF);         /* Clear direction (output) for GPIO 140 */
-
-       /*
-        * Configure GPIOs for battery charge & feedback
-        */
-
-       /* Configure MUXed pin. Mode 6: GPIO_35 */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS2_IO_CONF3);
-       *MuxConfReg &= 0xFFFFFFF1;           /* Clear M_CLK_OUT */
-       *MuxConfReg |= 0x0000000C;           /* Set M_CLK_OUT = 0x6 (GPIOs) */
-
-       /* Configure MUXed pin. Mode 6: GPIO_72,73,74 */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS2_IO_CONF5);
-       *MuxConfReg &= 0xFFFF1FFF;           /* Clear D_DDR */
-       *MuxConfReg |= 0x0000C000;           /* Set D_DDR = 0x6 (GPIOs) */
-
-       MuxConfReg = (volatile unsigned int *) ((unsigned int) OMAP730_GPIO_BASE_3 + GPIO_DIRECTION_CONTROL);
-       *MuxConfReg |= 0x00000100;           /* Configure GPIO_72 as input */
-       *MuxConfReg &= 0xFFFFFDFF;           /* Configure GPIO_73 as output     */
-
-       /*
-        * Allow battery charge
-        */
-
-       MuxConfReg = (volatile unsigned int *) ((unsigned int) OMAP730_GPIO_BASE_3 + GPIO_DATA_OUTPUT);
-       *MuxConfReg &= (0xFFFFFDFF);         /* Clear GPIO_73 pin */
-
-       /*
-        * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
-        * It is used as the Ethernet controller interrupt
-        */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS2_IO_CONF9);
-       *MuxConfReg &= 0x1FFFFFFF;
-}
-
-/******************************************************
- Routine: peripheral_power_enable
- Description: Enable the power for UART1
-*******************************************************/
-void peripheral_power_enable (void)
-{
-       volatile unsigned int *MuxConfReg;
-
-
-       /* Set up pins used by UART */
-
-       /* Start UART clock (48MHz) */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS_PCC_CONF_REG);
-       *MuxConfReg &= (0xFFFFFFF7);
-       *MuxConfReg |= (0x00000008);
-
-       /* Get the UART pin in mode0  */
-       MuxConfReg = (volatile unsigned int *) (PERSEUS2_IO_CONF3);
-       *MuxConfReg &= (0xFF1FFFFF);
-       *MuxConfReg &= (0xF1FFFFFF);
-}
-
-#ifdef CONFIG_CMD_NET
-int board_eth_init(bd_t *bis)
-{
-       int rc = 0;
-#ifdef CONFIG_LAN91C96
-       rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
-#endif
-       return rc;
-}
-#endif
index c104024..cda09a9 100644 (file)
@@ -123,6 +123,66 @@ int get_board_revision(void)
 }
 
 /**
+ * is_panda_es_rev_b3() - Detect if we are running on rev B3 of panda board ES
+ *
+ *
+ * Detect if we are running on B3 version of ES panda board,
+ * This can be done by reading the level of GPIO 171 and checking the
+ * processor revisions.
+ * GPIO171: 1 => Panda ES Rev B3
+ *
+ * Return : return 1 if Panda ES Rev B3 , else return 0
+ */
+u8 is_panda_es_rev_b3(void)
+{
+        int processor_rev = omap_revision();
+        int ret = 0;
+
+        if ((processor_rev >= OMAP4460_ES1_0 &&
+             processor_rev <= OMAP4460_ES1_1)) {
+
+                /* Setup the mux for the common board ID pins (gpio 171) */
+                writew((IEN | M3),
+                       (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
+
+                /* if processor_rev is panda ES and GPIO171 is 1,it is rev b3 */
+                ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
+        }
+        return ret;
+}
+
+#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
+/*
+ * emif_get_reg_dump() - emif_get_reg_dump strong function
+ *
+ * @emif_nr - emif base
+ * @regs - reg dump of timing values
+ *
+ * Strong function to override emif_get_reg_dump weak function in sdram_elpida.c
+ */
+void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
+{
+       u32 omap4_rev = omap_revision();
+
+       /* Same devices and geometry on both EMIFs */
+       if (omap4_rev == OMAP4430_ES1_0)
+               *regs = &emif_regs_elpida_380_mhz_1cs;
+       else if (omap4_rev == OMAP4430_ES2_0)
+               *regs = &emif_regs_elpida_200_mhz_2cs;
+       else if (omap4_rev == OMAP4430_ES2_3)
+               *regs = &emif_regs_elpida_400_mhz_1cs;
+       else if (omap4_rev < OMAP4470_ES1_0) {
+               if(is_panda_es_rev_b3())
+                       *regs = &emif_regs_elpida_400_mhz_1cs;
+               else
+                       *regs = &emif_regs_elpida_400_mhz_2cs;
+       }
+       else
+               *regs = &emif_regs_elpida_400_mhz_1cs;
+}
+#endif
+
+/**
  * @brief misc_init_r - Configure Panda board specific configurations
  * such as power configurations, ethernet initialization as phase2 of
  * boot sequence
index e406326..0b76a77 100644 (file)
@@ -33,15 +33,12 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 #ifdef CONFIG_SPL_BUILD
 static const struct cmd_control evm_ddr2_cctrl_data = {
        .cmd0csratio    = 0x80,
-       .cmd0dldiff     = 0x04,
        .cmd0iclkout    = 0x00,
 
        .cmd1csratio    = 0x80,
-       .cmd1dldiff     = 0x04,
        .cmd1iclkout    = 0x00,
 
        .cmd2csratio    = 0x80,
-       .cmd2dldiff     = 0x04,
        .cmd2iclkout    = 0x00,
 };
 
@@ -77,8 +74,6 @@ static const struct ddr_data evm_ddr2_data = {
        .datagiratio0           = ((0<<10) | (0<<0)),
        .datafwsratio0          = ((0x90<<10) | (0x90<<0)),
        .datawrsratio0          = ((0x50<<10) | (0x50<<0)),
-       .datauserank0delay      = 1,
-       .datadldiff0            = 0x4,
 };
 
 void set_uart_mux_conf(void)
index 74d35e9..a53859e 100644 (file)
@@ -59,21 +59,16 @@ static struct ddr_data ddr2_data = {
        .datagiratio0           = ((0x0<<10) | (0x0<<0)),
        .datafwsratio0          = ((0x13A<<10) | (0x13A<<0)),
        .datawrsratio0          = ((0x8A<<10) | (0x8A<<0)),
-       .datauserank0delay      = 0x1,
-       .datadldiff0            = 0x0, /* depend on cpu rev, set later */
 };
 
 static struct cmd_control ddr2_ctrl = {
        .cmd0csratio    = 0x80,
-       .cmd0dldiff     = 0x04, /* reset value is 0x4 */
        .cmd0iclkout    = 0x00,
 
        .cmd1csratio    = 0x80,
-       .cmd1dldiff     = 0x04, /* reset value is 0x4 */
        .cmd1iclkout    = 0x00,
 
        .cmd2csratio    = 0x80,
-       .cmd2dldiff     = 0x04, /* reset value is 0x4 */
        .cmd2iclkout    = 0x00,
 
 };
@@ -150,21 +145,16 @@ static struct ddr_data ddr3_data = {
        .datagiratio0           = ((0x20<<10) | 0x20<<0),
        .datafwsratio0          = ((RD_DQS_GATE<<10) | (RD_DQS_GATE<<0)),
        .datawrsratio0          = (((WR_DQS+0x40)<<10) | ((WR_DQS+0x40)<<0)),
-       .datauserank0delay      = 0x1,
-       .datadldiff0            = 0x0, /* depend on cpu rev, set later */
 };
 
 static const struct cmd_control ddr3_ctrl = {
        .cmd0csratio    = 0x100,
-       .cmd0dldiff     = 0x004, /* reset value is 0x4 */
        .cmd0iclkout    = 0x001,
 
        .cmd1csratio    = 0x100,
-       .cmd1dldiff     = 0x004, /* reset value is 0x4 */
        .cmd1iclkout    = 0x001,
 
        .cmd2csratio    = 0x100,
-       .cmd2dldiff     = 0x004, /* reset value is 0x4 */
        .cmd2iclkout    = 0x001,
 };
 
@@ -198,11 +188,6 @@ void sdram_init(void)
        config_dmm(&evm_lisa_map_regs);
 
 #ifdef CONFIG_TI816X_EVM_DDR2
-       ddr2_data.datadldiff0 = (get_cpu_rev() == 0x1 ? 0x0 : 0xF);
-       ddr2_ctrl.cmd0dldiff = (get_cpu_rev() == 0x1 ? 0x0 : 0xF);
-       ddr2_ctrl.cmd1dldiff = (get_cpu_rev() == 0x1 ? 0x0 : 0xF);
-       ddr2_ctrl.cmd2dldiff = (get_cpu_rev() == 0x1 ? 0x0 : 0xF);
-
        if (CONFIG_TI816X_USE_EMIF0) {
                ddr2_emif0_regs.emif_ddr_phy_ctlr_1 =
                        (get_cpu_rev() == 0x1 ? 0x0000010B : 0x0000030B);
@@ -217,8 +202,6 @@ void sdram_init(void)
 #endif
 
 #ifdef CONFIG_TI816X_EVM_DDR3
-       ddr3_data.datadldiff0 = (get_cpu_rev() == 0x1 ? 0x0 : 0xF);
-
        if (CONFIG_TI816X_USE_EMIF0)
                config_ddr(0, 0, &ddr3_data, &ddr3_ctrl, &ddr3_emif0_regs, 0);
 
index c9b50e9..02d107c 100644 (file)
@@ -62,13 +62,13 @@ SECTIONS
                __bss_end = .;
        }
 
-       /DISCARD/ : { *(.bss*) }
-       /DISCARD/ : { *(.dynsym) }
-       /DISCARD/ : { *(.dynstr*) }
-       /DISCARD/ : { *(.dynsym*) }
-       /DISCARD/ : { *(.dynamic*) }
-       /DISCARD/ : { *(.hash*) }
-       /DISCARD/ : { *(.plt*) }
-       /DISCARD/ : { *(.interp*) }
-       /DISCARD/ : { *(.gnu*) }
+       .dynsym _end : { *(.dynsym) }
+       .dynbss : { *(.dynbss) }
+       .dynstr : { *(.dynstr*) }
+       .dynamic : { *(.dynamic*) }
+       .hash : { *(.hash*) }
+       .plt : { *(.plt*) }
+       .interp : { *(.interp*) }
+       .gnu : { *(.gnu*) }
+       .ARM.exidx : { *(.ARM.exidx*) }
 }
index 114cc86..2128996 100644 (file)
@@ -119,6 +119,7 @@ Active  arm         arm926ejs      at91        calao           tny_a9260
 Active  arm         arm926ejs      at91        calao           tny_a9260           tny_a9260_nandflash                  tny_a9260:AT91SAM9260,SYS_USE_NANDFLASH                                                                                           Albin Tonnerre <albin.tonnerre@free-electrons.com>
 Active  arm         arm926ejs      at91        calao           tny_a9260           tny_a9g20_eeprom                     tny_a9260:AT91SAM9G20,SYS_USE_EEPROM                                                                                              Albin Tonnerre <albin.tonnerre@free-electrons.com>
 Active  arm         arm926ejs      at91        calao           tny_a9260           tny_a9g20_nandflash                  tny_a9260:AT91SAM9G20,SYS_USE_NANDFLASH                                                                                           Albin Tonnerre <albin.tonnerre@free-electrons.com>
+Active  arm         arm926ejs      at91        calao           usb_a9263           usb_a9263_dataflash                  usb_a9263:AT91SAM9263,SYS_USE_DATAFLASH                                                                                           Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
 Active  arm         arm926ejs      at91        egnite          ethernut5           ethernut5                            ethernut5:AT91SAM9XE                                                                                                              egnite GmbH <info@egnite.de>
 Active  arm         arm926ejs      at91        emk             top9000             top9000eval_xe                       top9000:EVAL9000                                                                                                                  Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
 Active  arm         arm926ejs      at91        emk             top9000             top9000su_xe                         top9000:SU9000                                                                                                                    Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
@@ -139,6 +140,9 @@ Active  arm         arm926ejs      at91        ronetix         pm9263
 Active  arm         arm926ejs      at91        ronetix         pm9g45              pm9g45                               pm9g45:AT91SAM9G45                                                                                                                Ilko Iliev <iliev@ronetix.at>
 Active  arm         arm926ejs      at91        taskit          stamp9g20           portuxg20                            stamp9g20:AT91SAM9G20,PORTUXG20                                                                                                   Markus Hubig <mhubig@imko.de>
 Active  arm         arm926ejs      at91        taskit          stamp9g20           stamp9g20                            stamp9g20:AT91SAM9G20                                                                                                             Markus Hubig <mhubig@imko.de>
+Active  arm         arm926ejs      at91        siemens         taurus              axm                                  taurus:AT91SAM9G20,MACH_TYPE=2068,BOARD_AXM                                                                                       Heiko Schocher <hs@denx.de>
+Active  arm         arm926ejs      at91        siemens         corvus              corvus                               corvus:AT91SAM9M10G45,SYS_USE_NANDFLASH                                                                                           Heiko Schocher <hs@denx.de>
+Active  arm         arm926ejs      at91        siemens         taurus              taurus                               taurus:AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS                                                                                    Heiko Schocher <hs@denx.de>
 Active  arm         arm926ejs      davinci     ait             cam_enc_4xx         cam_enc_4xx                          cam_enc_4xx                                                                                                                       Heiko Schocher <hs@denx.de>
 Active  arm         arm926ejs      davinci     Barix           ipam390             ipam390                              -                                                                                                                                 Heiko Schocher <hs@denx.de>
 Active  arm         arm926ejs      davinci     davinci         da8xxevm            da830evm                             -                                                                                                                                 Nick Thompson <nick.thompson@gefanuc.com>
@@ -213,9 +217,6 @@ Active  arm         arm926ejs      mxs         schulercontrol  sc_sps_1
 Active  arm         arm926ejs      nomadik     st              nhk8815             nhk8815                              -                                                                                                                                 Nomadik Linux Team <STN_WMM_nomadik_linux@list.st.com>:Alessandro Rubini <rubini@unipv.it>
 Active  arm         arm926ejs      nomadik     st              nhk8815             nhk8815_onenand                      nhk8815:BOOT_ONENAND                                                                                                              Nomadik Linux Team <STN_WMM_nomadik_linux@list.st.com>:Alessandro Rubini <rubini@unipv.it>
 Active  arm         arm926ejs      omap        ti              -                   omap5912osk                          -                                                                                                                                 Rishi Bhattacharya <rishi@ti.com>
-Active  arm         arm926ejs      omap        ti              omap730p2           omap730p2                            omap730p2:CS3_BOOT                                                                                                                Dave Peverley <dpeverley@mpc-data.co.uk>
-Active  arm         arm926ejs      omap        ti              omap730p2           omap730p2_cs0boot                    omap730p2:CS0_BOOT                                                                                                                Dave Peverley <dpeverley@mpc-data.co.uk>
-Active  arm         arm926ejs      omap        ti              omap730p2           omap730p2_cs3boot                    omap730p2:CS3_BOOT                                                                                                                Dave Peverley <dpeverley@mpc-data.co.uk>
 Active  arm         arm926ejs      orion5x     LaCie           -                   edminiv2                             -                                                                                                                                 Albert ARIBAUD <albert.u.boot@aribaud.net>
 Active  arm         arm926ejs      pantheon    Marvell         -                   dkb                                  -                                                                                                                                 Lei Wen <leiwen@marvell.com>
 Active  arm         arm926ejs      spear       spear           -                   x600                                 x600                                                                                                                              Stefan Roese <sr@denx.de>
@@ -247,8 +248,10 @@ Active  arm         arm946es       -           armltd          integrator
 Active  arm         armv7          -           armltd          vexpress            vexpress_ca15_tc2                    -                                                                                                                                 -
 Active  arm         armv7          -           armltd          vexpress            vexpress_ca5x2                       -                                                                                                                                 Matt Waddel <matt.waddel@linaro.org>
 Active  arm         armv7          -           armltd          vexpress            vexpress_ca9x4                       -                                                                                                                                 Matt Waddel <matt.waddel@linaro.org>
+Active  arm         armv7          am33xx      compulab        cm_t335             cm_t335                              cm_t335                                                                                                                           Igor Grinberg <grinberg@compulab.co.il>
 Active  arm         armv7          am33xx      isee            igep0033            am335x_igep0033                      -                                                                                                                                 Enric Balletbo i Serra <eballetbo@iseebcn.com>
-Active  arm         armv7          am33xx      phytec          pcm051              pcm051                               pcm051                                                                                                                            Lars Poeschel <poeschel@lemonage.de>
+Active  arm         armv7          am33xx      phytec          pcm051              pcm051_rev1                          pcm051:REV1                                                                                                                       Lars Poeschel <poeschel@lemonage.de>
+Active  arm         armv7          am33xx      phytec          pcm051              pcm051_rev3                          pcm051:REV3                                                                                                                       Lars Poeschel <poeschel@lemonage.de>
 Active  arm         armv7          am33xx      siemens         dxr2                dxr2                                 -                                                                                                                                 Roger Meier <r.meier@siemens.com>
 Active  arm         armv7          am33xx      siemens         pxm2                pxm2                                 -                                                                                                                                 Roger Meier <r.meier@siemens.com>
 Active  arm         armv7          am33xx      siemens         rut                 rut                                  -                                                                                                                                 Roger Meier <r.meier@siemens.com>
@@ -257,14 +260,14 @@ Active  arm         armv7          am33xx      ti              am335x
 Active  arm         armv7          am33xx      ti              am335x              am335x_evm_nor                       am335x_evm:SERIAL1,CONS_INDEX=1,NAND,NOR                                                                                          Tom Rini <trini@ti.com>
 Active  arm         armv7          am33xx      ti              am335x              am335x_evm_norboot                   am335x_evm:SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT                                                                                      Tom Rini <trini@ti.com>
 Active  arm         armv7          am33xx      ti              am335x              am335x_evm_spiboot                   am335x_evm:SERIAL1,CONS_INDEX=1,SPI_BOOT                                                                                          Tom Rini <trini@ti.com>
-Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart1                     am335x_evm:SERIAL2,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini@ti.com>
-Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart2                     am335x_evm:SERIAL3,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini@ti.com>
-Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart3                     am335x_evm:SERIAL4,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini@ti.com>
-Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart4                     am335x_evm:SERIAL5,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini@ti.com>
-Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart5                     am335x_evm:SERIAL6,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini@ti.com>
+Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart1                     am335x_evm:SERIAL2,CONS_INDEX=2,NAND                                                                                              Tom Rini <trini@ti.com>
+Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart2                     am335x_evm:SERIAL3,CONS_INDEX=3,NAND                                                                                              Tom Rini <trini@ti.com>
+Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart3                     am335x_evm:SERIAL4,CONS_INDEX=4,NAND                                                                                              Tom Rini <trini@ti.com>
+Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart4                     am335x_evm:SERIAL5,CONS_INDEX=5,NAND                                                                                              Tom Rini <trini@ti.com>
+Active  arm         armv7          am33xx      ti              am335x              am335x_evm_uart5                     am335x_evm:SERIAL6,CONS_INDEX=6,NAND                                                                                              Tom Rini <trini@ti.com>
 Active  arm         armv7          am33xx      ti              am335x              am335x_evm_usbspl                    am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT                                                                           Tom Rini <trini@ti.com>
 Active  arm         armv7          am33xx      ti              am43xx              am43xx_evm                           am43xx_evm:SERIAL1,CONS_INDEX=1                                                                                                   -
-Active  arm         armv7          am33xx      ti              ti814x              ti814x_evm                           -                                                                                                                                 Matt Porter <mporter@ti.com>
+Active  arm         armv7          am33xx      ti              ti814x              ti814x_evm                           -                                                                                                                                 Matt Porter <matt.porter@linaro.org>
 Active  arm         armv7          am33xx      ti              ti816x              ti816x_evm                           -                                                                                                                                 -
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_mmc                       sama5d3xek:SAMA5D3,SYS_USE_MMC                                                                                                    Bo Shen <voice.shen@atmel.com>
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_nandflash                 sama5d3xek:SAMA5D3,SYS_USE_NANDFLASH                                                                                              Bo Shen <voice.shen@atmel.com>
@@ -341,6 +344,10 @@ Active  arm         armv7          omap5       ti              dra7xx
 Active  arm         armv7          omap5       ti              omap5_uevm          omap5_uevm                           -                                                                                                                                 -
 Active  arm         armv7          rmobile     atmark-techno   armadillo-800eva    armadillo-800eva                     -                                                                                                                                 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
 Active  arm         armv7          rmobile     kmc             kzm9g               kzm9g                                -                                                                                                                                 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>:Tetsuyuki Kobayashi <koba@kmckk.co.jp>
+Active  arm         armv7          rmobile     renesas         lager               lager                                -                                                                                                                                 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Active  arm         armv7          rmobile     renesas         lager               lager_nor                            lager:NORFLASH                                                                                                                    Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Active  arm         armv7          rmobile     renesas         koelsch             koelsch                              -                                                                                                                                 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Active  arm         armv7          rmobile     renesas         koelsch             koelsch_nor                          koelsch:NORFLASH                                                                                                                  Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Minkyu Kang <mk7.kang@samsung.com>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <mk7.kang@samsung.com>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
index 74404be..d12cba5 100644 (file)
@@ -230,8 +230,6 @@ obj-$(CONFIG_FIT_SIGNATURE) += image-sig.o
 obj-y += memsize.o
 obj-y += stdio.o
 
-CPPFLAGS += -I..
-
 $(obj)env_embedded.o: $(src)env_embedded.c
        $(CC) $(AFLAGS) -Wa,--no-warn \
                -DENV_CRC=$(shell $(obj)../tools/envcrc) \
index f0664bc..fcfd713 100644 (file)
@@ -1010,6 +1010,7 @@ void board_init_f(ulong boot_flags)
 #endif
 
        gd->flags = boot_flags;
+       gd->have_console = 0;
 
        if (initcall_run_list(init_sequence_f))
                hang();
index ba73f57..3f57659 100644 (file)
 #include <asm/io.h>
 #include <linux/compiler.h>
 
+#if defined(CONFIG_BOOTM_VXWORKS) && \
+       (defined(CONFIG_PPC) || defined(CONFIG_ARM))
+#include <vxworks.h>
+#endif
+
 #if defined(CONFIG_CMD_USB)
 #include <usb.h>
 #endif
@@ -120,8 +125,11 @@ static boot_os_fn do_bootm_ose;
 #if defined(CONFIG_BOOTM_PLAN9)
 static boot_os_fn do_bootm_plan9;
 #endif
-#if defined(CONFIG_CMD_ELF)
+#if defined(CONFIG_BOOTM_VXWORKS) && \
+       (defined(CONFIG_PPC) || defined(CONFIG_ARM))
 static boot_os_fn do_bootm_vxworks;
+#endif
+#if defined(CONFIG_CMD_ELF)
 static boot_os_fn do_bootm_qnxelf;
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
@@ -149,8 +157,11 @@ static boot_os_fn *boot_os[] = {
 #if defined(CONFIG_BOOTM_PLAN9)
        [IH_OS_PLAN9] = do_bootm_plan9,
 #endif
-#if defined(CONFIG_CMD_ELF)
+#if defined(CONFIG_BOOTM_VXWORKS) && \
+       (defined(CONFIG_PPC) || defined(CONFIG_ARM))
        [IH_OS_VXWORKS] = do_bootm_vxworks,
+#endif
+#if defined(CONFIG_CMD_ELF)
        [IH_OS_QNX] = do_bootm_qnxelf,
 #endif
 #ifdef CONFIG_INTEGRITY
@@ -333,7 +344,8 @@ static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc,
        if (((images.os.type == IH_TYPE_KERNEL) ||
             (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
             (images.os.type == IH_TYPE_MULTI)) &&
-           (images.os.os == IH_OS_LINUX)) {
+           (images.os.os == IH_OS_LINUX ||
+                images.os.os == IH_OS_VXWORKS)) {
                if (bootm_find_ramdisk(flag, argc, argv))
                        return 1;
 
@@ -1531,10 +1543,10 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
 
        /*
         * NetBSD Stage-2 Loader Parameters:
-        *   r3: ptr to board info data
-        *   r4: image address
-        *   r5: console device
-        *   r6: boot args string
+        *   arg[0]: pointer to board info data
+        *   arg[1]: image load address
+        *   arg[2]: char pointer to the console device to use
+        *   arg[3]: char pointer to the boot arguments
         */
        (*loader)(gd->bd, os_hdr, consdev, cmdline);
 
@@ -1678,12 +1690,66 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[],
 }
 #endif /* CONFIG_BOOTM_PLAN9 */
 
-#if defined(CONFIG_CMD_ELF)
+#if defined(CONFIG_BOOTM_VXWORKS) && \
+       (defined(CONFIG_PPC) || defined(CONFIG_ARM))
+
+void do_bootvx_fdt(bootm_headers_t *images)
+{
+#if defined(CONFIG_OF_LIBFDT)
+       int ret;
+       char *bootline;
+       ulong of_size = images->ft_len;
+       char **of_flat_tree = &images->ft_addr;
+       struct lmb *lmb = &images->lmb;
+
+       if (*of_flat_tree) {
+               boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
+
+               ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
+               if (ret)
+                       return;
+
+               ret = fdt_add_subnode(*of_flat_tree, 0, "chosen");
+               if ((ret >= 0 || ret == -FDT_ERR_EXISTS)) {
+                       bootline = getenv("bootargs");
+                       if (bootline) {
+                               ret = fdt_find_and_setprop(*of_flat_tree,
+                                               "/chosen", "bootargs",
+                                               bootline,
+                                               strlen(bootline) + 1, 1);
+                               if (ret < 0) {
+                                       printf("## ERROR: %s : %s\n", __func__,
+                                              fdt_strerror(ret));
+                                       return;
+                               }
+                       }
+               } else {
+                       printf("## ERROR: %s : %s\n", __func__,
+                              fdt_strerror(ret));
+                       return;
+               }
+       }
+#endif
+
+       boot_prep_vxworks(images);
+
+       bootstage_mark(BOOTSTAGE_ID_RUN_OS);
+
+#if defined(CONFIG_OF_LIBFDT)
+       printf("## Starting vxWorks at 0x%08lx, device tree at 0x%08lx ...\n",
+              (ulong)images->ep, (ulong)*of_flat_tree);
+#else
+       printf("## Starting vxWorks at 0x%08lx\n", (ulong)images->ep);
+#endif
+
+       boot_jump_vxworks(images);
+
+       puts("## vxWorks terminated\n");
+}
+
 static int do_bootm_vxworks(int flag, int argc, char * const argv[],
                             bootm_headers_t *images)
 {
-       char str[80];
-
        if (flag != BOOTM_STATE_OS_GO)
                return 0;
 
@@ -1694,13 +1760,13 @@ static int do_bootm_vxworks(int flag, int argc, char * const argv[],
        }
 #endif
 
-       sprintf(str, "%lx", images->ep); /* write entry-point into string */
-       setenv("loadaddr", str);
-       do_bootvx(NULL, 0, 0, NULL);
+       do_bootvx_fdt(images);
 
        return 1;
 }
+#endif
 
+#if defined(CONFIG_CMD_ELF)
 static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
                            bootm_headers_t *images)
 {
index 02539c4..3924805 100644 (file)
@@ -161,7 +161,7 @@ int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt
 #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
                spi_read (addr, alen, buffer, len);
 #else
-               if (i2c_read (addr[0], addr[1], alen-1, buffer, len) != 0)
+               if (i2c_read(addr[0], offset, alen - 1, buffer, len))
                        rcode = 1;
 #endif
                buffer += len;
@@ -339,7 +339,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
                /* Write is enabled ... now write eeprom value.
                 */
 #endif
-               if (i2c_write (addr[0], addr[1], alen-1, buffer, len) != 0)
+               if (i2c_write(addr[0], offset, alen - 1, buffer, len))
                        rcode = 1;
 
 #endif
index f741f6b..ab9c7e3 100644 (file)
@@ -156,16 +156,16 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         * If we don't know where the image is then we're done.
         */
 
-       if (argc < 1)
+       if (argc < 2)
                addr = load_addr;
        else
-               addr = simple_strtoul(argv[0], NULL, 16);
+               addr = simple_strtoul(argv[1], NULL, 16);
 
 #if defined(CONFIG_CMD_NET)
        /*
         * Check to see if we need to tftp the image ourselves before starting
         */
-       if ((argc == 1) && (strcmp(argv[0], "tftp") == 0)) {
+       if ((argc == 2) && (strcmp(argv[1], "tftp") == 0)) {
                if (NetLoop(TFTPGET) <= 0)
                        return 1;
                printf("Automatic boot of VxWorks image at address 0x%08lx ...\n",
index 1f0d8f5..4e32b02 100644 (file)
@@ -400,10 +400,11 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
        nodeoffset = fdt_path_offset(blob, "/memory");
        if (nodeoffset < 0) {
                nodeoffset = fdt_add_subnode(blob, 0, "memory");
-               if (nodeoffset < 0)
+               if (nodeoffset < 0) {
                        printf("WARNING: could not create /memory: %s.\n",
                                        fdt_strerror(nodeoffset));
-               return nodeoffset;
+                       return nodeoffset;
+               }
        }
        err = fdt_setprop(blob, nodeoffset, "device_type", "memory",
                        sizeof("memory"));
index d5b09a0..b824bb3 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -125,9 +125,9 @@ endif
 
 # cc-version
 # Usage gcc-ver := $(call cc-version)
-cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
-binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS))
-dtc-version = $(shell $(SHELL) $(SRCTREE)/tools/dtc-version.sh $(DTC))
+cc-version = $(shell $(SHELL) $(SRCTREE)/scripts/gcc-version.sh $(CC))
+binutils-version = $(shell $(SHELL) $(SRCTREE)/scripts/binutils-version.sh $(AS))
+dtc-version = $(shell $(SHELL) $(SRCTREE)/scripts/dtc-version.sh $(DTC))
 
 #
 # Include the make variables (CC, etc...)
index bed035c..ab3f713 100644 (file)
@@ -39,3 +39,10 @@ The method for updating
 3. add new structures for SoC access
 4. Convert arch, driver and boards file to new SoC
 5. remove legacy code, if all boards and drives are ready
+
+2013-10-30 Andreas Bießmann <andreas.devel@googlemail.com>:
+
+The goal is almost reached, we could remove the CONFIG_AT91_LEGACY switch but
+remain the CONFIG_ATMEL_LEGACY switch until the GPIO disaster is fixed. The
+AT91 spi driver has also some CONFIG_ATMEL_LEGACY stuff left, so another point
+to fix until this README can be removed.
index f045f43..604de0c 100644 (file)
@@ -11,9 +11,10 @@ easily if here is something they might want to dig for...
 
 Board            Arch        CPU            Commit      Removed     Last known maintainer/contact
 =================================================================================================
+omap730p2        arm         arm926ejs      -           2013-11-11
 pn62             powerpc     mpc824x        -           2013-11-11  Wolfgang Grandegger <wg@grandegger.com>
-pdnb3            arm         ixp            -           2013-09-24  Stefan Roese <sr@denx.de>
-scpu             arm         ixp            -           2013-09-24  Stefan Roese <sr@denx.de>
+pdnb3            arm         ixp            304db0b     2013-09-24  Stefan Roese <sr@denx.de>
+scpu             arm         ixp            304db0b     2013-09-24  Stefan Roese <sr@denx.de>
 omap1510inn      arm         arm925t        0610a16     2013-09-23  Kshitij Gupta <kshitij@ti.com>
 CANBT            powerpc     405CR          fb8f4fd     2013-08-07  Matthias Fuchs <matthias.fuchs@esd.eu>
 Alaska8220       powerpc     mpc8220        d6ed322     2013-05-11
diff --git a/doc/README.vxworks b/doc/README.vxworks
new file mode 100644 (file)
index 0000000..4cb302e
--- /dev/null
@@ -0,0 +1,19 @@
+From VxWorks 6.9+ (not include 6.9), VxWorks starts adopting device tree as its hardware
+decription mechansim (for PowerPC and ARM), thus requiring boot interface changes.
+This section will describe the new interface.
+
+For PowerPC, the calling convention of the new VxWorks entry point conforms to the ePAPR standard,
+which is shown below (see ePAPR for more details):
+
+    void (*kernel_entry)(fdt_addr,
+              0, 0, EPAPR_MAGIC, boot_IMA, 0, 0)
+
+For ARM, the calling convention is show below:
+
+    void (*kernel_entry)(void *fdt_addr)
+
+When booting new VxWorks kernel (uImage format), the parameters passed to bootm is like below:
+
+    bootm <kernel image address> - <device tree address>
+
+The do_bootvx command still works as it was for older VxWorks kernels.
diff --git a/doc/SPI/README.sandbox-spi b/doc/SPI/README.sandbox-spi
new file mode 100644 (file)
index 0000000..bb73eaf
--- /dev/null
@@ -0,0 +1,64 @@
+Sandbox SPI/SPI Flash Implementation
+====================================
+
+U-Boot supports SPI and SPI flash emuation in sandbox. This must be enabled
+using the --spi_sf paramter when starting U-Boot.
+
+For example:
+
+$ make O=sandbox sandbox_config
+$ make O=sandbox
+$ ./sandbox/u-boot --spi_sf 0:0:W25Q128:b/chromeos_peach/out/image.bin
+
+The four parameters to spi_sf are:
+
+   SPI bus number (typically 0)
+   SPI chip select number (typically 0)
+   SPI chip to emulate
+   File containing emulated data
+
+Supported chips are W25Q16 (2MB), W25Q32 (4MB) and W25Q128 (16MB). Once
+U-Boot it started you can use 'sf' commands as normal. For example:
+
+$ ./b/sandbox/u-boot --spi_sf 0:0:W25Q128:b/chromeos_peach/out/image.bin \
+       -c "sf probe; sf test 0 100000; sf read 0 1000 1000; \
+               sf erase 1000 1000; sf write 0 1000 1000"
+
+
+U-Boot 2013.10-00237-gd4e0fdb (Nov 07 2013 - 20:08:15)
+
+DRAM:  128 MiB
+Using default environment
+
+In:    serial
+Out:   serial
+Err:   serial
+SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
+SPI flash test:
+0 erase: 1 ticks, 1024000 KiB/s 8192.000 Mbps
+1 check: 2 ticks, 512000 KiB/s 4096.000 Mbps
+2 write: 6 ticks, 170666 KiB/s 1365.328 Mbps
+3 read: 0 ticks, 1048576000 KiB/s -201326.-592 Mbps
+Test passed
+0 erase: 1 ticks, 1024000 KiB/s 8192.000 Mbps
+1 check: 2 ticks, 512000 KiB/s 4096.000 Mbps
+2 write: 6 ticks, 170666 KiB/s 1365.328 Mbps
+3 read: 0 ticks, 1048576000 KiB/s -201326.-592 Mbps
+SF: 4096 bytes @ 0x1000 Read: OK
+SF: 4096 bytes @ 0x1000 Erased: OK
+SF: 4096 bytes @ 0x1000 Written: OK
+
+
+Since the SPI bus is fully implemented as well as the SPI flash connected to
+it, you can also use low-level SPI commands to access the flash. For example
+this reads the device ID from the emulated chip:
+
+=> sspi 0 32 9f
+FFEF4018
+
+
+Simon Glass
+sjg@chromium.org
+7/11/2013
+Note that the sandbox SPI implementation was written by Mike Frysinger
+<vapier@gentoo.org>.
diff --git a/doc/device-tree-bindings/spi/spi-bus.txt b/doc/device-tree-bindings/spi/spi-bus.txt
new file mode 100644 (file)
index 0000000..800dafe
--- /dev/null
@@ -0,0 +1,92 @@
+SPI (Serial Peripheral Interface) busses
+
+SPI busses can be described with a node for the SPI master device
+and a set of child nodes for each SPI slave on the bus.  For this
+discussion, it is assumed that the system's SPI controller is in
+SPI master mode.  This binding does not describe SPI controllers
+in slave mode.
+
+The SPI master node requires the following properties:
+- #address-cells  - number of cells required to define a chip select
+               address on the SPI bus.
+- #size-cells     - should be zero.
+- compatible      - name of SPI bus controller following generic names
+               recommended practice.
+- cs-gpios       - (optional) gpios chip select.
+No other properties are required in the SPI bus node.  It is assumed
+that a driver for an SPI bus device will understand that it is an SPI bus.
+However, the binding does not attempt to define the specific method for
+assigning chip select numbers.  Since SPI chip select configuration is
+flexible and non-standardized, it is left out of this binding with the
+assumption that board specific platform code will be used to manage
+chip selects.  Individual drivers can define additional properties to
+support describing the chip select layout.
+
+Optional property:
+- num-cs : total number of chipselects
+
+If cs-gpios is used the number of chip select will automatically increased
+with max(cs-gpios > hw cs)
+
+So if for example the controller has 2 CS lines, and the cs-gpios
+property looks like this:
+
+cs-gpios = <&gpio1 0 0> <0> <&gpio1 1 0> <&gpio1 2 0>;
+
+Then it should be configured so that num_chipselect = 4 with the
+following mapping:
+
+cs0 : &gpio1 0 0
+cs1 : native
+cs2 : &gpio1 1 0
+cs3 : &gpio1 2 0
+
+SPI slave nodes must be children of the SPI master node and can
+contain the following properties.
+- reg             - (required) chip select address of device.
+- compatible      - (required) name of SPI device following generic names
+               recommended practice
+- spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
+- spi-cpol        - (optional) Empty property indicating device requires
+               inverse clock polarity (CPOL) mode
+- spi-cpha        - (optional) Empty property indicating device requires
+               shifted clock phase (CPHA) mode
+- spi-cs-high     - (optional) Empty property indicating device requires
+               chip select active high
+- spi-3wire       - (optional) Empty property indicating device requires
+                   3-wire mode.
+- spi-tx-bus-width - (optional) The bus width(number of data wires) that
+                      used for MOSI. Defaults to 1 if not present.
+- spi-rx-bus-width - (optional) The bus width(number of data wires) that
+                      used for MISO. Defaults to 1 if not present.
+
+Some SPI controllers and devices support Dual and Quad SPI transfer mode.
+It allows data in SPI system transfered in 2 wires(DUAL) or 4 wires(QUAD).
+Now the value that spi-tx-bus-width and spi-rx-bus-width can receive is
+only 1(SINGLE), 2(DUAL) and 4(QUAD).
+Dual/Quad mode is not allowed when 3-wire mode is used.
+
+If a gpio chipselect is used for the SPI slave the gpio number will be passed
+via the cs_gpio
+
+SPI example for an MPC5200 SPI bus:
+       spi@f00 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
+               reg = <0xf00 0x20>;
+               interrupts = <2 13 0 2 14 0>;
+               interrupt-parent = <&mpc5200_pic>;
+
+               ethernet-switch@0 {
+                       compatible = "micrel,ks8995m";
+                       spi-max-frequency = <1000000>;
+                       reg = <0>;
+               };
+
+               codec@1 {
+                       compatible = "ti,tlv320aic26";
+                       spi-max-frequency = <100000>;
+                       reg = <1>;
+               };
+       };
index 0daad36..e64df4f 100644 (file)
@@ -379,6 +379,11 @@ static int ahci_init_one(pci_dev_t pdev)
        int rc;
 
        probe_ent = malloc(sizeof(struct ahci_probe_ent));
+       if (!probe_ent) {
+               printf("%s: No memory for probe_ent\n", __func__);
+               return -ENOMEM;
+       }
+
        memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
        probe_ent->dev = pdev;
 
@@ -503,7 +508,7 @@ static int ahci_port_start(u8 port)
        mem = (u32) malloc(AHCI_PORT_PRIV_DMA_SZ + 2048);
        if (!mem) {
                free(pp);
-               printf("No mem for table!\n");
+               printf("%s: No mem for table!\n", __func__);
                return -ENOMEM;
        }
 
@@ -618,7 +623,7 @@ static int ata_scsiop_inquiry(ccb *pccb)
                95 - 4,
        };
        u8 fis[20];
-       u16 *tmpid;
+       ALLOC_CACHE_ALIGN_BUFFER(u16, tmpid, ATA_ID_WORDS);
        u8 port;
 
        /* Clean ccb data buffer */
@@ -637,14 +642,10 @@ static int ata_scsiop_inquiry(ccb *pccb)
 
        /* Read id from sata */
        port = pccb->target;
-       tmpid = malloc(ATA_ID_WORDS * 2);
-       if (!tmpid)
-               return -ENOMEM;
 
        if (ahci_device_data_io(port, (u8 *) &fis, sizeof(fis), (u8 *)tmpid,
                                ATA_ID_WORDS * 2, 0)) {
                debug("scsi_ahci: SCSI inquiry command failure.\n");
-               free(tmpid);
                return -EIO;
        }
 
@@ -889,6 +890,11 @@ int ahci_init(u32 base)
        u32 linkmap;
 
        probe_ent = malloc(sizeof(struct ahci_probe_ent));
+       if (!probe_ent) {
+               printf("%s: No memory for probe_ent\n", __func__);
+               return -ENOMEM;
+       }
+
        memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
 
        probe_ent->host_flags = ATA_FLAG_SATA
index 8256ed0..bed6971 100644 (file)
@@ -6,5 +6,6 @@ obj-y                           += bootcount.o
 obj-$(CONFIG_AT91SAM9XE)       += bootcount_at91.o
 obj-$(CONFIG_BLACKFIN)         += bootcount_blackfin.o
 obj-$(CONFIG_SOC_DA8XX)                += bootcount_davinci.o
-obj-$(CONFIG_AM33XX)           += bootcount_davinci.o
+obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o
 obj-$(CONFIG_BOOTCOUNT_RAM)    += bootcount_ram.o
+obj-$(CONFIG_BOOTCOUNT_ENV)    += bootcount_env.o
index f0acfad..fa87b5e 100644 (file)
@@ -2,6 +2,10 @@
  * (C) Copyright 2011
  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  *
+ * A bootcount driver for the RTC IP block found on many TI platforms.
+ * This requires the RTC clocks, etc, to be enabled prior to use and
+ * not all boards with this IP block on it will have the RTC in use.
+ *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
diff --git a/drivers/bootcount/bootcount_env.c b/drivers/bootcount/bootcount_env.c
new file mode 100644 (file)
index 0000000..2d6e8db
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2013
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+void bootcount_store(ulong a)
+{
+       int upgrade_available = getenv_ulong("upgrade_available", 10, 0);
+
+       if (upgrade_available) {
+               setenv_ulong("bootcount", a);
+               saveenv();
+       }
+}
+
+ulong bootcount_load(void)
+{
+       int upgrade_available = getenv_ulong("upgrade_available", 10, 0);
+       ulong val = 0;
+
+       if (upgrade_available)
+               val = getenv_ulong("bootcount", 10, 0);
+
+       return val;
+}
index af09786..8b76666 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/sizes.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pio.h>
+#include <asm/arch/gpio.h>
 
 static struct at91_port *at91_pio_get_port(unsigned port)
 {
@@ -356,9 +357,6 @@ int at91_get_pio_value(unsigned port, unsigned pin)
 
 /* Common GPIO API */
 
-#define at91_gpio_to_port(gpio)                (gpio / 32)
-#define at91_gpio_to_pin(gpio)         (gpio % 32)
-
 int gpio_request(unsigned gpio, const char *label)
 {
        return 0;
index 553b519..fa3a875 100644 (file)
@@ -12,7 +12,6 @@ obj-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
 obj-$(CONFIG_I2C_MV) += mv_i2c.o
 obj-$(CONFIG_I2C_MXS) += mxs_i2c.o
 obj-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
-obj-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 obj-$(CONFIG_U8500_I2C) += u8500_i2c.o
 obj-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
@@ -24,6 +23,7 @@ obj-$(CONFIG_SYS_I2C_OMAP24XX) += omap24xx_i2c.o
 obj-$(CONFIG_SYS_I2C_OMAP34XX) += omap24xx_i2c.o
 obj-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o
 obj-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o
+obj-$(CONFIG_SYS_I2C_S3C24X0) += s3c24x0_i2c.o
 obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
 obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
 obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
index ddeb941..fb9fa35 100644 (file)
 
 #include "fti2c010.h"
 
-#ifndef CONFIG_HARD_I2C
-#error "fti2c010: CONFIG_HARD_I2C is not defined"
+#ifndef CONFIG_SYS_I2C_SPEED
+#define CONFIG_SYS_I2C_SPEED    5000
 #endif
 
-#ifndef CONFIG_SYS_I2C_SPEED
-#define CONFIG_SYS_I2C_SPEED    50000
+#ifndef CONFIG_SYS_I2C_SLAVE
+#define CONFIG_SYS_I2C_SLAVE    0
 #endif
 
-#ifndef CONFIG_FTI2C010_FREQ
-#define CONFIG_FTI2C010_FREQ    clk_get_rate("I2C")
+#ifndef CONFIG_FTI2C010_CLOCK
+#define CONFIG_FTI2C010_CLOCK   clk_get_rate("I2C")
 #endif
 
-/* command timeout */
-#define CFG_CMD_TIMEOUT         10 /* ms */
+#ifndef CONFIG_FTI2C010_TIMEOUT
+#define CONFIG_FTI2C010_TIMEOUT 10 /* ms */
+#endif
 
-/* 7-bit chip address + 1-bit read/write */
-#define I2C_RD(chip)            ((((chip) << 1) & 0xff) | 1)
-#define I2C_WR(chip)            (((chip) << 1) & 0xff)
+/* 7-bit dev address + 1-bit read/write */
+#define I2C_RD(dev)             ((((dev) << 1) & 0xfe) | 1)
+#define I2C_WR(dev)             (((dev) << 1) & 0xfe)
 
 struct fti2c010_chip {
-       void __iomem *regs;
-       uint bus;
-       uint speed;
+       struct fti2c010_regs *regs;
 };
 
 static struct fti2c010_chip chip_list[] = {
        {
-               .bus  = 0,
-               .regs = (void __iomem *)CONFIG_FTI2C010_BASE,
+               .regs = (struct fti2c010_regs *)CONFIG_FTI2C010_BASE,
        },
-#ifdef CONFIG_I2C_MULTI_BUS
-# ifdef CONFIG_FTI2C010_BASE1
+#ifdef CONFIG_FTI2C010_BASE1
        {
-               .bus  = 1,
-               .regs = (void __iomem *)CONFIG_FTI2C010_BASE1,
+               .regs = (struct fti2c010_regs *)CONFIG_FTI2C010_BASE1,
        },
-# endif
-# ifdef CONFIG_FTI2C010_BASE2
+#endif
+#ifdef CONFIG_FTI2C010_BASE2
        {
-               .bus  = 2,
-               .regs = (void __iomem *)CONFIG_FTI2C010_BASE2,
+               .regs = (struct fti2c010_regs *)CONFIG_FTI2C010_BASE2,
        },
-# endif
-# ifdef CONFIG_FTI2C010_BASE3
+#endif
+#ifdef CONFIG_FTI2C010_BASE3
        {
-               .bus  = 3,
-               .regs = (void __iomem *)CONFIG_FTI2C010_BASE3,
+               .regs = (struct fti2c010_regs *)CONFIG_FTI2C010_BASE3,
        },
-# endif
-#endif  /* #ifdef CONFIG_I2C_MULTI_BUS */
+#endif
 };
 
-static struct fti2c010_chip *curr = chip_list;
+static int fti2c010_reset(struct fti2c010_chip *chip)
+{
+       ulong ts;
+       int ret = -1;
+       struct fti2c010_regs *regs = chip->regs;
+
+       writel(CR_I2CRST, &regs->cr);
+       for (ts = get_timer(0); get_timer(ts) < CONFIG_FTI2C010_TIMEOUT; ) {
+               if (!(readl(&regs->cr) & CR_I2CRST)) {
+                       ret = 0;
+                       break;
+               }
+       }
 
-static int fti2c010_wait(uint32_t mask)
+       if (ret)
+               printf("fti2c010: reset timeout\n");
+
+       return ret;
+}
+
+static int fti2c010_wait(struct fti2c010_chip *chip, uint32_t mask)
 {
        int ret = -1;
        uint32_t stat, ts;
-       struct fti2c010_regs *regs = curr->regs;
+       struct fti2c010_regs *regs = chip->regs;
 
-       for (ts = get_timer(0); get_timer(ts) < CFG_CMD_TIMEOUT; ) {
+       for (ts = get_timer(0); get_timer(ts) < CONFIG_FTI2C010_TIMEOUT; ) {
                stat = readl(&regs->sr);
                if ((stat & mask) == mask) {
                        ret = 0;
@@ -84,88 +95,124 @@ static int fti2c010_wait(uint32_t mask)
        return ret;
 }
 
-/*
- * u-boot I2C API
- */
+static unsigned int set_i2c_bus_speed(struct fti2c010_chip *chip,
+       unsigned int speed)
+{
+       struct fti2c010_regs *regs = chip->regs;
+       unsigned int clk = CONFIG_FTI2C010_CLOCK;
+       unsigned int gsr = 0;
+       unsigned int tsr = 32;
+       unsigned int div, rate;
+
+       for (div = 0; div < 0x3ffff; ++div) {
+               /* SCLout = PCLK/(2*(COUNT + 2) + GSR) */
+               rate = clk / (2 * (div + 2) + gsr);
+               if (rate <= speed)
+                       break;
+       }
+
+       writel(TGSR_GSR(gsr) | TGSR_TSR(tsr), &regs->tgsr);
+       writel(CDR_DIV(div), &regs->cdr);
+
+       return rate;
+}
 
 /*
  * Initialization, must be called once on start up, may be called
  * repeatedly to change the speed and slave addresses.
  */
-void i2c_init(int speed, int slaveaddr)
+static void fti2c010_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
-       if (speed || !curr->speed)
-               i2c_set_bus_speed(speed);
+       struct fti2c010_chip *chip = chip_list + adap->hwadapnr;
 
-       /* if slave mode disabled */
-       if (!slaveaddr)
+       if (adap->init_done)
                return;
 
-       /*
-        * TODO:
-        * Implement slave mode, but is it really necessary?
-        */
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+       /* Call board specific i2c bus reset routine before accessing the
+        * environment, which might be in a chip on that bus. For details
+        * about this problem see doc/I2C_Edge_Conditions.
+       */
+       i2c_init_board();
+#endif
+
+       /* master init */
+
+       fti2c010_reset(chip);
+
+       set_i2c_bus_speed(chip, speed);
+
+       /* slave init, don't care */
+
+#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
+       /* Call board specific i2c bus reset routine AFTER the bus has been
+        * initialized. Use either this callpoint or i2c_init_board;
+        * which is called before fti2c010_init operations.
+        * For details about this problem see doc/I2C_Edge_Conditions.
+       */
+       i2c_board_late_init();
+#endif
 }
 
 /*
  * Probe the given I2C chip address.  Returns 0 if a chip responded,
  * not 0 on failure.
  */
-int i2c_probe(uchar chip)
+static int fti2c010_probe(struct i2c_adapter *adap, u8 dev)
 {
+       struct fti2c010_chip *chip = chip_list + adap->hwadapnr;
+       struct fti2c010_regs *regs = chip->regs;
        int ret;
-       struct fti2c010_regs *regs = curr->regs;
-
-       i2c_init(0, 0);
 
        /* 1. Select slave device (7bits Address + 1bit R/W) */
-       writel(I2C_WR(chip), &regs->dr);
+       writel(I2C_WR(dev), &regs->dr);
        writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
-       ret = fti2c010_wait(SR_DT);
+       ret = fti2c010_wait(chip, SR_DT);
        if (ret)
                return ret;
 
        /* 2. Select device register */
        writel(0, &regs->dr);
        writel(CR_ENABLE | CR_TBEN, &regs->cr);
-       ret = fti2c010_wait(SR_DT);
+       ret = fti2c010_wait(chip, SR_DT);
 
        return ret;
 }
 
-/*
- * Read/Write interface:
- *   chip:    I2C chip address, range 0..127
- *   addr:    Memory (register) address within the chip
- *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
- *              memories, 0 for register type devices with only one
- *              register)
- *   buffer:  Where to read/write the data
- *   len:     How many bytes to read/write
- *
- *   Returns: 0 on success, not 0 on failure
- */
-int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+static void to_i2c_addr(u8 *buf, uint32_t addr, int alen)
+{
+       int i, shift;
+
+       if (!buf || alen <= 0)
+               return;
+
+       /* MSB first */
+       i = 0;
+       shift = (alen - 1) * 8;
+       while (alen-- > 0) {
+               buf[i] = (u8)(addr >> shift);
+               shift -= 8;
+       }
+}
+
+static int fti2c010_read(struct i2c_adapter *adap,
+                       u8 dev, uint addr, int alen, uchar *buf, int len)
 {
+       struct fti2c010_chip *chip = chip_list + adap->hwadapnr;
+       struct fti2c010_regs *regs = chip->regs;
        int ret, pos;
        uchar paddr[4];
-       struct fti2c010_regs *regs = curr->regs;
 
-       i2c_init(0, 0);
-
-       paddr[0] = (addr >> 0)  & 0xFF;
-       paddr[1] = (addr >> 8)  & 0xFF;
-       paddr[2] = (addr >> 16) & 0xFF;
-       paddr[3] = (addr >> 24) & 0xFF;
+       to_i2c_addr(paddr, addr, alen);
 
        /*
         * Phase A. Set register address
         */
 
        /* A.1 Select slave device (7bits Address + 1bit R/W) */
-       writel(I2C_WR(chip), &regs->dr);
+       writel(I2C_WR(dev), &regs->dr);
        writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
-       ret = fti2c010_wait(SR_DT);
+       ret = fti2c010_wait(chip, SR_DT);
        if (ret)
                return ret;
 
@@ -175,7 +222,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
 
                writel(paddr[pos], &regs->dr);
                writel(ctrl, &regs->cr);
-               ret = fti2c010_wait(SR_DT);
+               ret = fti2c010_wait(chip, SR_DT);
                if (ret)
                        return ret;
        }
@@ -185,9 +232,9 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
         */
 
        /* B.1 Select slave device (7bits Address + 1bit R/W) */
-       writel(I2C_RD(chip), &regs->dr);
+       writel(I2C_RD(dev), &regs->dr);
        writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
-       ret = fti2c010_wait(SR_DT);
+       ret = fti2c010_wait(chip, SR_DT);
        if (ret)
                return ret;
 
@@ -201,7 +248,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
                        stat |= SR_ACK;
                }
                writel(ctrl, &regs->cr);
-               ret = fti2c010_wait(stat);
+               ret = fti2c010_wait(chip, stat);
                if (ret)
                        break;
                buf[pos] = (uchar)(readl(&regs->dr) & 0xFF);
@@ -210,39 +257,24 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
        return ret;
 }
 
-/*
- * Read/Write interface:
- *   chip:    I2C chip address, range 0..127
- *   addr:    Memory (register) address within the chip
- *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
- *              memories, 0 for register type devices with only one
- *              register)
- *   buffer:  Where to read/write the data
- *   len:     How many bytes to read/write
- *
- *   Returns: 0 on success, not 0 on failure
- */
-int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
+static int fti2c010_write(struct i2c_adapter *adap,
+                       u8 dev, uint addr, int alen, u8 *buf, int len)
 {
+       struct fti2c010_chip *chip = chip_list + adap->hwadapnr;
+       struct fti2c010_regs *regs = chip->regs;
        int ret, pos;
        uchar paddr[4];
-       struct fti2c010_regs *regs = curr->regs;
 
-       i2c_init(0, 0);
-
-       paddr[0] = (addr >> 0)  & 0xFF;
-       paddr[1] = (addr >> 8)  & 0xFF;
-       paddr[2] = (addr >> 16) & 0xFF;
-       paddr[3] = (addr >> 24) & 0xFF;
+       to_i2c_addr(paddr, addr, alen);
 
        /*
         * Phase A. Set register address
         *
         * A.1 Select slave device (7bits Address + 1bit R/W)
         */
-       writel(I2C_WR(chip), &regs->dr);
+       writel(I2C_WR(dev), &regs->dr);
        writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr);
-       ret = fti2c010_wait(SR_DT);
+       ret = fti2c010_wait(chip, SR_DT);
        if (ret)
                return ret;
 
@@ -252,7 +284,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
 
                writel(paddr[pos], &regs->dr);
                writel(ctrl, &regs->cr);
-               ret = fti2c010_wait(SR_DT);
+               ret = fti2c010_wait(chip, SR_DT);
                if (ret)
                        return ret;
        }
@@ -267,7 +299,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
                        ctrl |= CR_STOP;
                writel(buf[pos], &regs->dr);
                writel(ctrl, &regs->cr);
-               ret = fti2c010_wait(SR_DT);
+               ret = fti2c010_wait(chip, SR_DT);
                if (ret)
                        break;
        }
@@ -275,94 +307,40 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
        return ret;
 }
 
-/*
- * Functions for setting the current I2C bus and its speed
- */
-#ifdef CONFIG_I2C_MULTI_BUS
-
-/*
- * i2c_set_bus_num:
- *
- *  Change the active I2C bus.  Subsequent read/write calls will
- *  go to this one.
- *
- *    bus - bus index, zero based
- *
- *    Returns: 0 on success, not 0 on failure
- */
-int i2c_set_bus_num(uint bus)
-{
-       if (bus >= ARRAY_SIZE(chip_list))
-               return -1;
-       curr = chip_list + bus;
-       i2c_init(0, 0);
-       return 0;
-}
-
-/*
- * i2c_get_bus_num:
- *
- *  Returns index of currently active I2C bus.  Zero-based.
- */
-
-uint i2c_get_bus_num(void)
-{
-       return curr->bus;
-}
-
-#endif    /* #ifdef CONFIG_I2C_MULTI_BUS */
-
-/*
- * i2c_set_bus_speed:
- *
- *  Change the speed of the active I2C bus
- *
- *    speed - bus speed in Hz
- *
- *    Returns: 0 on success, not 0 on failure
- */
-int i2c_set_bus_speed(uint speed)
+static unsigned int fti2c010_set_bus_speed(struct i2c_adapter *adap,
+                       unsigned int speed)
 {
-       struct fti2c010_regs *regs = curr->regs;
-       uint clk = CONFIG_FTI2C010_FREQ;
-       uint gsr = 0, tsr = 32;
-       uint spd, div;
-
-       if (!speed)
-               speed = CONFIG_SYS_I2C_SPEED;
-
-       for (div = 0; div < 0x3ffff; ++div) {
-               /* SCLout = PCLK/(2*(COUNT + 2) + GSR) */
-               spd = clk / (2 * (div + 2) + gsr);
-               if (spd <= speed)
-                       break;
-       }
-
-       if (curr->speed == spd)
-               return 0;
-
-       writel(CR_I2CRST, &regs->cr);
-       mdelay(100);
-       if (readl(&regs->cr) & CR_I2CRST) {
-               printf("fti2c010: reset timeout\n");
-               return -1;
-       }
+       struct fti2c010_chip *chip = chip_list + adap->hwadapnr;
+       int ret;
 
-       curr->speed = spd;
+       fti2c010_reset(chip);
+       ret = set_i2c_bus_speed(chip, speed);
 
-       writel(TGSR_GSR(gsr) | TGSR_TSR(tsr), &regs->tgsr);
-       writel(CDR_DIV(div), &regs->cdr);
-
-       return 0;
+       return ret;
 }
 
 /*
- * i2c_get_bus_speed:
- *
- *  Returns speed of currently active I2C bus in Hz
+ * Register i2c adapters
  */
-
-uint i2c_get_bus_speed(void)
-{
-       return curr->speed;
-}
+U_BOOT_I2C_ADAP_COMPLETE(i2c_0, fti2c010_init, fti2c010_probe, fti2c010_read,
+                       fti2c010_write, fti2c010_set_bus_speed,
+                       CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
+                       0)
+#ifdef CONFIG_FTI2C010_BASE1
+U_BOOT_I2C_ADAP_COMPLETE(i2c_1, fti2c010_init, fti2c010_probe, fti2c010_read,
+                       fti2c010_write, fti2c010_set_bus_speed,
+                       CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
+                       1)
+#endif
+#ifdef CONFIG_FTI2C010_BASE2
+U_BOOT_I2C_ADAP_COMPLETE(i2c_2, fti2c010_init, fti2c010_probe, fti2c010_read,
+                       fti2c010_write, fti2c010_set_bus_speed,
+                       CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
+                       2)
+#endif
+#ifdef CONFIG_FTI2C010_BASE3
+U_BOOT_I2C_ADAP_COMPLETE(i2c_3, fti2c010_init, fti2c010_probe, fti2c010_read,
+                       fti2c010_write, fti2c010_set_bus_speed,
+                       CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
+                       3)
+#endif
index 3d38c03..c784004 100644 (file)
@@ -158,7 +158,6 @@ static void omap24_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
        udelay(1000);
        flush_fifo(adap);
        writew(0xFFFF, &i2c_base->stat);
-       writew(0, &i2c_base->cnt);
 }
 
 static void flush_fifo(struct i2c_adapter *adap)
@@ -198,8 +197,6 @@ static int omap24_i2c_probe(struct i2c_adapter *adap, uchar chip)
                return res;
 
        /* No data transfer, slave addr only */
-       writew(0, &i2c_base->cnt);
-       /* Set slave address */
        writew(chip, &i2c_base->sa);
        /* Stop bit needed here */
        writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX |
@@ -234,7 +231,6 @@ static int omap24_i2c_probe(struct i2c_adapter *adap, uchar chip)
 pr_exit:
        flush_fifo(adap);
        writew(0xFFFF, &i2c_base->stat);
-       writew(0, &i2c_base->cnt);
        return res;
 }
 
@@ -372,7 +368,6 @@ static int omap24_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
 rd_exit:
        flush_fifo(adap);
        writew(0xFFFF, &i2c_base->stat);
-       writew(0, &i2c_base->cnt);
        return i2c_error;
 }
 
@@ -473,7 +468,6 @@ static int omap24_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
 wr_exit:
        flush_fifo(adap);
        writew(0xFFFF, &i2c_base->stat);
-       writew(0, &i2c_base->cnt);
        return i2c_error;
 }
 
index f77a9d1..fd328f0 100644 (file)
@@ -23,8 +23,6 @@
 #include <i2c.h>
 #include "s3c24x0_i2c.h"
 
-#ifdef CONFIG_HARD_I2C
-
 #define        I2C_WRITE       0
 #define I2C_READ       1
 
  * For SPL boot some boards need i2c before SDRAM is initialised so force
  * variables to live in SRAM
  */
-static unsigned int g_current_bus __attribute__((section(".data")));
 static struct s3c24x0_i2c_bus i2c_bus[CONFIG_MAX_I2C_NUM]
                        __attribute__((section(".data")));
 
@@ -254,17 +251,17 @@ static void ReadWriteByte(struct s3c24x0_i2c *i2c)
        writel(readl(&i2c->iiccon) & ~I2CCON_IRPND, &i2c->iiccon);
 }
 
-static struct s3c24x0_i2c *get_base_i2c(void)
+static struct s3c24x0_i2c *get_base_i2c(int bus)
 {
 #ifdef CONFIG_EXYNOS4
        struct s3c24x0_i2c *i2c = (struct s3c24x0_i2c *)(samsung_get_base_i2c()
                                                        + (EXYNOS4_I2C_SPACING
-                                                       * g_current_bus));
+                                                       * bus));
        return i2c;
 #elif defined CONFIG_EXYNOS5
        struct s3c24x0_i2c *i2c = (struct s3c24x0_i2c *)(samsung_get_base_i2c()
                                                        + (EXYNOS5_I2C_SPACING
-                                                       * g_current_bus));
+                                                       * bus));
        return i2c;
 #else
        return s3c24x0_get_base_i2c();
@@ -298,7 +295,6 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
        writel(I2C_MODE_MT | I2C_TXRX_ENA, &i2c->iicstat);
 }
 
-#ifdef CONFIG_I2C_MULTI_BUS
 static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)
 {
        struct exynos5_hsi2c *hsregs = i2c_bus->hsregs;
@@ -307,8 +303,10 @@ static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)
        unsigned int i = 0, utemp0 = 0, utemp1 = 0;
        unsigned int t_ftl_cycle;
 
-#if defined CONFIG_EXYNOS5
+#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
        clkin = get_i2c_clk();
+#else
+       clkin = get_PCLK();
 #endif
        /* FPCLK / FI2C =
         * (CLK_DIV + 1) * (TSCLK_L + TSCLK_H + 2) + 8 + 2 * FLT_CYCLE
@@ -330,7 +328,6 @@ static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)
        }
        return -1;
 }
-#endif
 
 static void hsi2c_ch_init(struct s3c24x0_i2c_bus *i2c_bus)
 {
@@ -401,49 +398,18 @@ static void exynos5_i2c_reset(struct s3c24x0_i2c_bus *i2c_bus)
        hsi2c_ch_init(i2c_bus);
 }
 
-/*
- * MULTI BUS I2C support
- */
-
-#ifdef CONFIG_I2C_MULTI_BUS
-int i2c_set_bus_num(unsigned int bus)
-{
-       struct s3c24x0_i2c_bus *i2c_bus;
-
-       i2c_bus = get_bus(bus);
-       if (!i2c_bus)
-               return -1;
-       g_current_bus = bus;
-
-       if (i2c_bus->is_highspeed) {
-               if (hsi2c_get_clk_details(i2c_bus))
-                       return -1;
-               hsi2c_ch_init(i2c_bus);
-       } else {
-               i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
-                                               CONFIG_SYS_I2C_SLAVE);
-       }
-
-       return 0;
-}
-
-unsigned int i2c_get_bus_num(void)
-{
-       return g_current_bus;
-}
-#endif
-
-void i2c_init(int speed, int slaveadd)
+static void s3c24x0_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
 {
        struct s3c24x0_i2c *i2c;
+       struct s3c24x0_i2c_bus *bus;
+
 #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
        struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
 #endif
        ulong start_time = get_timer(0);
 
        /* By default i2c channel 0 is the current bus */
-       g_current_bus = 0;
-       i2c = get_base_i2c();
+       i2c = get_base_i2c(adap->hwadapnr);
 
        /*
         * In case the previous transfer is still going, wait to give it a
@@ -505,6 +471,10 @@ void i2c_init(int speed, int slaveadd)
        }
 #endif /* #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5) */
        i2c_ch_init(i2c, speed, slaveadd);
+
+       bus = &i2c_bus[adap->hwadapnr];
+       bus->active = true;
+       bus->regs = i2c;
 }
 
 /*
@@ -728,6 +698,40 @@ static int hsi2c_read(struct exynos5_hsi2c *i2c,
        return rv;
 }
 
+static unsigned int s3c24x0_i2c_set_bus_speed(struct i2c_adapter *adap,
+                                         unsigned int speed)
+{
+       struct s3c24x0_i2c_bus *i2c_bus;
+
+       i2c_bus = get_bus(adap->hwadapnr);
+       if (!i2c_bus)
+               return -1;
+
+       i2c_bus->clock_frequency = speed;
+
+       if (i2c_bus->is_highspeed) {
+               if (hsi2c_get_clk_details(i2c_bus))
+                       return -1;
+               hsi2c_ch_init(i2c_bus);
+       } else {
+               i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
+                           CONFIG_SYS_I2C_S3C24X0_SLAVE);
+       }
+
+       return 0;
+}
+
+#ifdef CONFIG_EXYNOS5
+static void exynos_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
+{
+       /* This will override the speed selected in the fdt for that port */
+       debug("i2c_init(speed=%u, slaveaddr=0x%x)\n", speed, slaveaddr);
+       if (i2c_set_bus_speed(speed))
+               printf("i2c_init: failed to init bus %d for speed = %d\n",
+                                               adap->hwadapnr, speed);
+}
+#endif
+
 /*
  * cmd_type is 0 for write, 1 for read.
  *
@@ -840,13 +844,13 @@ bailout:
        return result;
 }
 
-int i2c_probe(uchar chip)
+static int s3c24x0_i2c_probe(struct i2c_adapter *adap, uchar chip)
 {
        struct s3c24x0_i2c_bus *i2c_bus;
        uchar buf[1];
        int ret;
 
-       i2c_bus = get_bus(g_current_bus);
+       i2c_bus = get_bus(adap->hwadapnr);
        if (!i2c_bus)
                return -1;
        buf[0] = 0;
@@ -864,11 +868,11 @@ int i2c_probe(uchar chip)
                                I2C_READ, chip << 1, 0, 0, buf, 1);
        }
 
-
        return ret != I2C_OK;
 }
 
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int s3c24x0_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
+                           int alen, uchar *buffer, int len)
 {
        struct s3c24x0_i2c_bus *i2c_bus;
        uchar xaddr[4];
@@ -902,7 +906,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
                chip |= ((addr >> (alen * 8)) &
                         CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
 #endif
-       i2c_bus = get_bus(g_current_bus);
+       i2c_bus = get_bus(adap->hwadapnr);
        if (!i2c_bus)
                return -1;
 
@@ -922,7 +926,8 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
        return 0;
 }
 
-int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int s3c24x0_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
+                        int alen, uchar *buffer, int len)
 {
        struct s3c24x0_i2c_bus *i2c_bus;
        uchar xaddr[4];
@@ -955,7 +960,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
                chip |= ((addr >> (alen * 8)) &
                         CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
 #endif
-       i2c_bus = get_bus(g_current_bus);
+       i2c_bus = get_bus(adap->hwadapnr);
        if (!i2c_bus)
                return -1;
 
@@ -1001,8 +1006,8 @@ static void process_nodes(const void *blob, int node_list[], int count,
 
                bus->id = pinmux_decode_periph_id(blob, node);
                bus->clock_frequency = fdtdec_get_int(blob, node,
-                                                     "clock-frequency",
-                                                     CONFIG_SYS_I2C_SPEED);
+                                               "clock-frequency",
+                                               CONFIG_SYS_I2C_S3C24X0_SPEED);
                bus->node = node;
                bus->bus_num = i;
                exynos_pinmux_config(bus->id, 0);
@@ -1044,7 +1049,6 @@ int i2c_get_bus_num_fdt(int node)
        return -1;
 }
 
-#ifdef CONFIG_I2C_MULTI_BUS
 int i2c_reset_port_fdt(const void *blob, int node)
 {
        struct s3c24x0_i2c_bus *i2c_bus;
@@ -1068,12 +1072,178 @@ int i2c_reset_port_fdt(const void *blob, int node)
                hsi2c_ch_init(i2c_bus);
        } else {
                i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
-                                               CONFIG_SYS_I2C_SLAVE);
+                           CONFIG_SYS_I2C_S3C24X0_SLAVE);
        }
 
        return 0;
 }
 #endif
-#endif
 
-#endif /* CONFIG_HARD_I2C */
+/*
+ * Register s3c24x0 i2c adapters
+ */
+#if defined(CONFIG_EXYNOS5420)
+U_BOOT_I2C_ADAP_COMPLETE(i2c00, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 0)
+U_BOOT_I2C_ADAP_COMPLETE(i2c01, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 1)
+U_BOOT_I2C_ADAP_COMPLETE(i2c02, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 2)
+U_BOOT_I2C_ADAP_COMPLETE(i2c03, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 3)
+U_BOOT_I2C_ADAP_COMPLETE(i2c04, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 4)
+U_BOOT_I2C_ADAP_COMPLETE(i2c05, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 5)
+U_BOOT_I2C_ADAP_COMPLETE(i2c06, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 6)
+U_BOOT_I2C_ADAP_COMPLETE(i2c07, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 7)
+U_BOOT_I2C_ADAP_COMPLETE(i2c08, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 8)
+U_BOOT_I2C_ADAP_COMPLETE(i2c09, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 9)
+U_BOOT_I2C_ADAP_COMPLETE(i2c10, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 10)
+#elif defined(CONFIG_EXYNOS5250)
+U_BOOT_I2C_ADAP_COMPLETE(i2c00, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 0)
+U_BOOT_I2C_ADAP_COMPLETE(i2c01, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 1)
+U_BOOT_I2C_ADAP_COMPLETE(i2c02, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 2)
+U_BOOT_I2C_ADAP_COMPLETE(i2c03, exynos_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 3)
+U_BOOT_I2C_ADAP_COMPLETE(i2c04, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 4)
+U_BOOT_I2C_ADAP_COMPLETE(i2c05, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 5)
+U_BOOT_I2C_ADAP_COMPLETE(i2c06, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 6)
+U_BOOT_I2C_ADAP_COMPLETE(i2c07, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 7)
+U_BOOT_I2C_ADAP_COMPLETE(i2c08, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 8)
+U_BOOT_I2C_ADAP_COMPLETE(i2c09, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 9)
+U_BOOT_I2C_ADAP_COMPLETE(s3c10, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 10)
+#elif defined(CONFIG_EXYNOS4)
+U_BOOT_I2C_ADAP_COMPLETE(i2c00, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 0)
+U_BOOT_I2C_ADAP_COMPLETE(i2c01, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 1)
+U_BOOT_I2C_ADAP_COMPLETE(i2c02, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 2)
+U_BOOT_I2C_ADAP_COMPLETE(i2c03, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 3)
+U_BOOT_I2C_ADAP_COMPLETE(i2c04, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 4)
+U_BOOT_I2C_ADAP_COMPLETE(i2c05, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 5)
+U_BOOT_I2C_ADAP_COMPLETE(i2c06, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 6)
+U_BOOT_I2C_ADAP_COMPLETE(i2c07, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 7)
+U_BOOT_I2C_ADAP_COMPLETE(i2c08, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 8)
+#else
+U_BOOT_I2C_ADAP_COMPLETE(s3c0, s3c24x0_i2c_init, s3c24x0_i2c_probe,
+                       s3c24x0_i2c_read, s3c24x0_i2c_write,
+                       s3c24x0_i2c_set_bus_speed,
+                       CONFIG_SYS_I2C_S3C24X0_SPEED,
+                       CONFIG_SYS_I2C_S3C24X0_SLAVE, 0)
+#endif
index 396fea8..dfea54a 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pio.h>
-#ifdef CONFIG_AT91_LEGACY
+#ifdef CONFIG_ATMEL_LEGACY
 #include <asm/arch/gpio.h>
 #endif
 #endif
index 202acf2..2fc9110 100644 (file)
@@ -135,8 +135,7 @@ int cros_ec_spi_decode_fdt(struct cros_ec_dev *dev, const void *blob)
  */
 int cros_ec_spi_init(struct cros_ec_dev *dev, const void *blob)
 {
-       dev->spi = spi_setup_slave_fdt(blob, dev->parent_node,
-                                      dev->cs, dev->max_frequency, 0);
+       dev->spi = spi_setup_slave_fdt(blob, dev->parent_node, dev->node);
        if (!dev->spi) {
                debug("%s: Could not setup SPI slave\n", __func__);
                return -1;
index a7ae38d..1ed26ca 100644 (file)
@@ -9,6 +9,7 @@ obj-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 obj-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o
+obj-$(CONFIG_FTSDC021) += ftsdc021_sdhci.o
 obj-$(CONFIG_GENERIC_MMC) += mmc.o
 obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
 obj-$(CONFIG_MMC_SPI) += mmc_spi.o
index 1e0f72b..19d9b0b 100644 (file)
@@ -11,7 +11,6 @@
 #include <mmc.h>
 #include <dwmmc.h>
 #include <asm-generic/errno.h>
-#include <asm/arch/dwmmc.h>
 
 #define PAGE_SIZE 4096
 
@@ -300,17 +299,9 @@ static void dwmci_set_ios(struct mmc *mmc)
 static int dwmci_init(struct mmc *mmc)
 {
        struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
-       u32 fifo_size;
-
-       if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
-               dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
-               dwmci_writel(host, EMMCP_SEND0, 0);
-               dwmci_writel(host, EMMCP_CTRL0,
-                            MPSCTRL_SECURE_READ_BIT |
-                            MPSCTRL_SECURE_WRITE_BIT |
-                            MPSCTRL_NON_SECURE_READ_BIT |
-                            MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
-       }
+
+       if (host->board_init)
+               host->board_init(host);
 
        dwmci_writel(host, DWMCI_PWREN, 1);
 
@@ -330,13 +321,9 @@ static int dwmci_init(struct mmc *mmc)
        dwmci_writel(host, DWMCI_IDINTEN, 0);
        dwmci_writel(host, DWMCI_BMOD, 1);
 
-       if (!host->fifoth_val) {
-               fifo_size = dwmci_readl(host, DWMCI_FIFOTH);
-               fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1;
-               host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) |
-                       TX_WMARK(fifo_size / 2);
+       if (host->fifoth_val) {
+               dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
        }
-       dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
 
        dwmci_writel(host, DWMCI_CLKENA, 0);
        dwmci_writel(host, DWMCI_CLKSRC, 0);
index a0f1511..b3e5c5e 100644 (file)
@@ -34,6 +34,19 @@ unsigned int exynos_dwmci_get_clk(int dev_index)
        return get_mmc_clk(dev_index);
 }
 
+static void exynos_dwmci_board_init(struct dwmci_host *host)
+{
+       if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
+               dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
+               dwmci_writel(host, EMMCP_SEND0, 0);
+               dwmci_writel(host, EMMCP_CTRL0,
+                            MPSCTRL_SECURE_READ_BIT |
+                            MPSCTRL_SECURE_WRITE_BIT |
+                            MPSCTRL_NON_SECURE_READ_BIT |
+                            MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
+       }
+}
+
 /*
  * This function adds the mmc channel to be registered with mmc core.
  * index -     mmc channel number.
@@ -65,6 +78,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
 #ifdef CONFIG_EXYNOS5420
        host->quirks = DWMCI_QUIRK_DISABLE_SMU;
 #endif
+       host->board_init = exynos_dwmci_board_init;
 
        if (clksel) {
                host->clksel_val = clksel;
index 65c52a2..8fc263f 100644 (file)
@@ -42,6 +42,10 @@ void __noreturn mmc_boot(void)
                hang();
        }
 
+#ifdef CONFIG_FSL_CORENET
+       offset = CONFIG_SYS_MMC_U_BOOT_OFFS;
+       code_len = CONFIG_SYS_MMC_U_BOOT_SIZE;
+#else
        blklen = mmc->read_bl_len;
        tmp_buf = malloc(blklen);
        if (!tmp_buf) {
@@ -91,6 +95,7 @@ void __noreturn mmc_boot(void)
        /*
        * Load U-Boot image from mmc into RAM
        */
+#endif
        blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
        blk_cnt = ALIGN(code_len, mmc->read_bl_len) / mmc->read_bl_len;
        err = mmc->block_dev.block_read(0, blk_start, blk_cnt,
diff --git a/drivers/mmc/ftsdc021_sdhci.c b/drivers/mmc/ftsdc021_sdhci.c
new file mode 100644 (file)
index 0000000..1f6cdba
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2013 Faraday Technology
+ * Kuo-Jung Su <dantesu@faraday-tech.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <sdhci.h>
+
+#ifndef CONFIG_FTSDC021_CLOCK
+#define CONFIG_FTSDC021_CLOCK   clk_get_rate("MMC")
+#endif
+
+int ftsdc021_sdhci_init(u32 regbase)
+{
+       struct sdhci_host *host = NULL;
+       uint32_t freq = CONFIG_FTSDC021_CLOCK;
+
+       host = calloc(1, sizeof(struct sdhci_host));
+       if (!host) {
+               puts("sdh_host malloc fail!\n");
+               return 1;
+       }
+
+       host->name = "FTSDC021";
+       host->ioaddr = (void __iomem *)regbase;
+       host->quirks = 0;
+       add_sdhci(host, freq, 0);
+
+       return 0;
+}
index e145cd1..02b149c 100644 (file)
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-ifdef CONFIG_CMD_NAND
-
 ifdef CONFIG_SPL_BUILD
 
 ifdef CONFIG_SPL_NAND_DRIVERS
@@ -69,4 +67,3 @@ obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_spl.o
 obj-$(CONFIG_NAND_MXC) += mxc_nand_spl.o
 
 endif # drivers
-endif # nand
index 16b7df0..05ddfbb 100644 (file)
@@ -12,9 +12,8 @@
  */
 
 #include <common.h>
-#include <asm/arch/hardware.h>
+#include <asm/gpio.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/at91_pio.h>
 
 #include <malloc.h>
 #include <nand.h>
@@ -1154,8 +1153,7 @@ static void at91_nand_hwcontrol(struct mtd_info *mtd,
                        IO_ADDR_W |= CONFIG_SYS_NAND_MASK_ALE;
 
 #ifdef CONFIG_SYS_NAND_ENABLE_PIN
-               at91_set_gpio_value(CONFIG_SYS_NAND_ENABLE_PIN,
-                                   !(ctrl & NAND_NCE));
+               gpio_set_value(CONFIG_SYS_NAND_ENABLE_PIN, !(ctrl & NAND_NCE));
 #endif
                this->IO_ADDR_W = (void *) IO_ADDR_W;
        }
@@ -1167,7 +1165,7 @@ static void at91_nand_hwcontrol(struct mtd_info *mtd,
 #ifdef CONFIG_SYS_NAND_READY_PIN
 static int at91_nand_ready(struct mtd_info *mtd)
 {
-       return at91_get_gpio_value(CONFIG_SYS_NAND_READY_PIN);
+       return gpio_get_value(CONFIG_SYS_NAND_READY_PIN);
 }
 #endif
 
index 1bbeb7d..26483a2 100644 (file)
@@ -13,4 +13,5 @@ endif
 obj-$(CONFIG_CMD_SF)        += sf.o
 obj-$(CONFIG_SPI_FLASH) += sf_probe.o sf_ops.o
 obj-$(CONFIG_SPI_FRAM_RAMTRON) += ramtron.o
+obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
 obj-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
index 6263d8c..e5ac79b 100644 (file)
@@ -31,6 +31,10 @@ void spi_boot(void)
                hang();
        }
 
+#ifdef CONFIG_FSL_CORENET
+       offset = CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
+       code_len = CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE;
+#else
        /*
        * Load U-Boot image from SPI flash into RAM
        */
@@ -50,6 +54,7 @@ void spi_boot(void)
        code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
        /* Skip spl code */
        code_len = code_len - CONFIG_SPL_MAX_SIZE;
+#endif
        /* copy code to DDR */
        spi_flash_read(flash, offset, code_len,
                       (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
new file mode 100644 (file)
index 0000000..a62ef4c
--- /dev/null
@@ -0,0 +1,483 @@
+/*
+ * Simulate a SPI flash
+ *
+ * Copyright (c) 2011-2013 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <spi.h>
+#include <os.h>
+
+#include <spi_flash.h>
+#include "sf_internal.h"
+
+#include <asm/getopt.h>
+#include <asm/spi.h>
+#include <asm/state.h>
+
+/*
+ * The different states that our SPI flash transitions between.
+ * We need to keep track of this across multiple xfer calls since
+ * the SPI bus could possibly call down into us multiple times.
+ */
+enum sandbox_sf_state {
+       SF_CMD,   /* default state -- we're awaiting a command */
+       SF_ID,    /* read the flash's (jedec) ID code */
+       SF_ADDR,  /* processing the offset in the flash to read/etc... */
+       SF_READ,  /* reading data from the flash */
+       SF_WRITE, /* writing data to the flash, i.e. page programming */
+       SF_ERASE, /* erase the flash */
+       SF_READ_STATUS, /* read the flash's status register */
+       SF_READ_STATUS1, /* read the flash's status register upper 8 bits*/
+};
+
+static const char *sandbox_sf_state_name(enum sandbox_sf_state state)
+{
+       static const char * const states[] = {
+               "CMD", "ID", "ADDR", "READ", "WRITE", "ERASE", "READ_STATUS",
+       };
+       return states[state];
+}
+
+/* Bits for the status register */
+#define STAT_WIP       (1 << 0)
+#define STAT_WEL       (1 << 1)
+
+/* Assume all SPI flashes have 3 byte addresses since they do atm */
+#define SF_ADDR_LEN    3
+
+struct sandbox_spi_flash_erase_commands {
+       u8 cmd;
+       u32 size;
+};
+#define IDCODE_LEN 5
+#define MAX_ERASE_CMDS 3
+struct sandbox_spi_flash_data {
+       const char *name;
+       u8 idcode[IDCODE_LEN];
+       u32 size;
+       const struct sandbox_spi_flash_erase_commands
+                                               erase_cmds[MAX_ERASE_CMDS];
+};
+
+/* Structure describing all the flashes we know how to emulate */
+static const struct sandbox_spi_flash_data sandbox_sf_flashes[] = {
+       {
+               "M25P16", { 0x20, 0x20, 0x15 }, (2 << 20),
+               {       /* erase commands */
+                       { 0xd8, (64 << 10), }, /* sector */
+                       { 0xc7, (2 << 20), }, /* bulk */
+               },
+       },
+       {
+               "W25Q32", { 0xef, 0x40, 0x16 }, (4 << 20),
+               {       /* erase commands */
+                       { 0x20, (4 << 10), }, /* 4KB */
+                       { 0xd8, (64 << 10), }, /* sector */
+                       { 0xc7, (4 << 20), }, /* bulk */
+               },
+       },
+       {
+               "W25Q128", { 0xef, 0x40, 0x18 }, (16 << 20),
+               {       /* erase commands */
+                       { 0x20, (4 << 10), }, /* 4KB */
+                       { 0xd8, (64 << 10), }, /* sector */
+                       { 0xc7, (16 << 20), }, /* bulk */
+               },
+       },
+};
+
+/* Used to quickly bulk erase backing store */
+static u8 sandbox_sf_0xff[0x1000];
+
+/* Internal state data for each SPI flash */
+struct sandbox_spi_flash {
+       /*
+        * As we receive data over the SPI bus, our flash transitions
+        * between states.  For example, we start off in the SF_CMD
+        * state where the first byte tells us what operation to perform
+        * (such as read or write the flash).  But the operation itself
+        * can go through a few states such as first reading in the
+        * offset in the flash to perform the requested operation.
+        * Thus "state" stores the exact state that our machine is in
+        * while "cmd" stores the overall command we're processing.
+        */
+       enum sandbox_sf_state state;
+       uint cmd;
+       const void *cmd_data;
+       /* Current position in the flash; used when reading/writing/etc... */
+       uint off;
+       /* How many address bytes we've consumed */
+       uint addr_bytes, pad_addr_bytes;
+       /* The current flash status (see STAT_XXX defines above) */
+       u16 status;
+       /* Data describing the flash we're emulating */
+       const struct sandbox_spi_flash_data *data;
+       /* The file on disk to serv up data from */
+       int fd;
+};
+
+static int sandbox_sf_setup(void **priv, const char *spec)
+{
+       /* spec = idcode:file */
+       struct sandbox_spi_flash *sbsf;
+       const char *file;
+       size_t i, len, idname_len;
+       const struct sandbox_spi_flash_data *data;
+
+       file = strchr(spec, ':');
+       if (!file) {
+               printf("sandbox_sf: unable to parse file\n");
+               goto error;
+       }
+       idname_len = file - spec;
+       ++file;
+
+       for (i = 0; i < ARRAY_SIZE(sandbox_sf_flashes); ++i) {
+               data = &sandbox_sf_flashes[i];
+               len = strlen(data->name);
+               if (idname_len != len)
+                       continue;
+               if (!memcmp(spec, data->name, len))
+                       break;
+       }
+       if (i == ARRAY_SIZE(sandbox_sf_flashes)) {
+               printf("sandbox_sf: unknown flash '%*s'\n", (int)idname_len,
+                      spec);
+               goto error;
+       }
+
+       if (sandbox_sf_0xff[0] == 0x00)
+               memset(sandbox_sf_0xff, 0xff, sizeof(sandbox_sf_0xff));
+
+       sbsf = calloc(sizeof(*sbsf), 1);
+       if (!sbsf) {
+               printf("sandbox_sf: out of memory\n");
+               goto error;
+       }
+
+       sbsf->fd = os_open(file, 02);
+       if (sbsf->fd == -1) {
+               free(sbsf);
+               printf("sandbox_sf: unable to open file '%s'\n", file);
+               goto error;
+       }
+
+       sbsf->data = data;
+
+       *priv = sbsf;
+       return 0;
+
+ error:
+       return 1;
+}
+
+static void sandbox_sf_free(void *priv)
+{
+       struct sandbox_spi_flash *sbsf = priv;
+
+       os_close(sbsf->fd);
+       free(sbsf);
+}
+
+static void sandbox_sf_cs_activate(void *priv)
+{
+       struct sandbox_spi_flash *sbsf = priv;
+
+       debug("sandbox_sf: CS activated; state is fresh!\n");
+
+       /* CS is asserted, so reset state */
+       sbsf->off = 0;
+       sbsf->addr_bytes = 0;
+       sbsf->pad_addr_bytes = 0;
+       sbsf->state = SF_CMD;
+       sbsf->cmd = SF_CMD;
+}
+
+static void sandbox_sf_cs_deactivate(void *priv)
+{
+       debug("sandbox_sf: CS deactivated; cmd done processing!\n");
+}
+
+/* Figure out what command this stream is telling us to do */
+static int sandbox_sf_process_cmd(struct sandbox_spi_flash *sbsf, const u8 *rx,
+                                 u8 *tx)
+{
+       enum sandbox_sf_state oldstate = sbsf->state;
+
+       /* We need to output a byte for the cmd byte we just ate */
+       sandbox_spi_tristate(tx, 1);
+
+       sbsf->cmd = rx[0];
+       switch (sbsf->cmd) {
+       case CMD_READ_ID:
+               sbsf->state = SF_ID;
+               sbsf->cmd = SF_ID;
+               break;
+       case CMD_READ_ARRAY_FAST:
+               sbsf->pad_addr_bytes = 1;
+       case CMD_READ_ARRAY_SLOW:
+       case CMD_PAGE_PROGRAM:
+ state_addr:
+               sbsf->state = SF_ADDR;
+               break;
+       case CMD_WRITE_DISABLE:
+               debug(" write disabled\n");
+               sbsf->status &= ~STAT_WEL;
+               break;
+       case CMD_READ_STATUS:
+               sbsf->state = SF_READ_STATUS;
+               break;
+       case CMD_READ_STATUS1:
+               sbsf->state = SF_READ_STATUS1;
+               break;
+       case CMD_WRITE_ENABLE:
+               debug(" write enabled\n");
+               sbsf->status |= STAT_WEL;
+               break;
+       default: {
+               size_t i;
+
+               /* handle erase commands first */
+               for (i = 0; i < MAX_ERASE_CMDS; ++i) {
+                       const struct sandbox_spi_flash_erase_commands *
+                               erase_cmd = &sbsf->data->erase_cmds[i];
+
+                       if (erase_cmd->cmd == 0x00)
+                               continue;
+                       if (sbsf->cmd != erase_cmd->cmd)
+                               continue;
+
+                       sbsf->cmd_data = erase_cmd;
+                       goto state_addr;
+               }
+
+               debug(" cmd unknown: %#x\n", sbsf->cmd);
+               return 1;
+       }
+       }
+
+       if (oldstate != sbsf->state)
+               debug(" cmd: transition to %s state\n",
+                     sandbox_sf_state_name(sbsf->state));
+
+       return 0;
+}
+
+int sandbox_erase_part(struct sandbox_spi_flash *sbsf, int size)
+{
+       int todo;
+       int ret;
+
+       while (size > 0) {
+               todo = min(size, sizeof(sandbox_sf_0xff));
+               ret = os_write(sbsf->fd, sandbox_sf_0xff, todo);
+               if (ret != todo)
+                       return ret;
+               size -= todo;
+       }
+
+       return 0;
+}
+
+static int sandbox_sf_xfer(void *priv, const u8 *rx, u8 *tx,
+               uint bytes)
+{
+       struct sandbox_spi_flash *sbsf = priv;
+       uint cnt, pos = 0;
+       int ret;
+
+       debug("sandbox_sf: state:%x(%s) bytes:%u\n", sbsf->state,
+             sandbox_sf_state_name(sbsf->state), bytes);
+
+       if (sbsf->state == SF_CMD) {
+               /* Figure out the initial state */
+               if (sandbox_sf_process_cmd(sbsf, rx, tx))
+                       return 1;
+               ++pos;
+       }
+
+       /* Process the remaining data */
+       while (pos < bytes) {
+               switch (sbsf->state) {
+               case SF_ID: {
+                       u8 id;
+
+                       debug(" id: off:%u tx:", sbsf->off);
+                       if (sbsf->off < IDCODE_LEN)
+                               id = sbsf->data->idcode[sbsf->off];
+                       else
+                               id = 0;
+                       debug("%02x\n", id);
+                       tx[pos++] = id;
+                       ++sbsf->off;
+                       break;
+               }
+               case SF_ADDR:
+                       debug(" addr: bytes:%u rx:%02x ", sbsf->addr_bytes,
+                             rx[pos]);
+
+                       if (sbsf->addr_bytes++ < SF_ADDR_LEN)
+                               sbsf->off = (sbsf->off << 8) | rx[pos];
+                       debug("addr:%06x\n", sbsf->off);
+
+                       sandbox_spi_tristate(&tx[pos++], 1);
+
+                       /* See if we're done processing */
+                       if (sbsf->addr_bytes <
+                                       SF_ADDR_LEN + sbsf->pad_addr_bytes)
+                               break;
+
+                       /* Next state! */
+                       if (os_lseek(sbsf->fd, sbsf->off, OS_SEEK_SET) < 0) {
+                               puts("sandbox_sf: os_lseek() failed");
+                               return 1;
+                       }
+                       switch (sbsf->cmd) {
+                       case CMD_READ_ARRAY_FAST:
+                       case CMD_READ_ARRAY_SLOW:
+                               sbsf->state = SF_READ;
+                               break;
+                       case CMD_PAGE_PROGRAM:
+                               sbsf->state = SF_WRITE;
+                               break;
+                       default:
+                               /* assume erase state ... */
+                               sbsf->state = SF_ERASE;
+                               goto case_sf_erase;
+                       }
+                       debug(" cmd: transition to %s state\n",
+                             sandbox_sf_state_name(sbsf->state));
+                       break;
+               case SF_READ:
+                       /*
+                        * XXX: need to handle exotic behavior:
+                        *      - reading past end of device
+                        */
+
+                       cnt = bytes - pos;
+                       debug(" tx: read(%u)\n", cnt);
+                       ret = os_read(sbsf->fd, tx + pos, cnt);
+                       if (ret < 0) {
+                               puts("sandbox_spi: os_read() failed\n");
+                               return 1;
+                       }
+                       pos += ret;
+                       break;
+               case SF_READ_STATUS:
+                       debug(" read status: %#x\n", sbsf->status);
+                       cnt = bytes - pos;
+                       memset(tx + pos, sbsf->status, cnt);
+                       pos += cnt;
+                       break;
+               case SF_READ_STATUS1:
+                       debug(" read status: %#x\n", sbsf->status);
+                       cnt = bytes - pos;
+                       memset(tx + pos, sbsf->status >> 8, cnt);
+                       pos += cnt;
+                       break;
+               case SF_WRITE:
+                       /*
+                        * XXX: need to handle exotic behavior:
+                        *      - unaligned addresses
+                        *      - more than a page (256) worth of data
+                        *      - reading past end of device
+                        */
+                       if (!(sbsf->status & STAT_WEL)) {
+                               puts("sandbox_sf: write enable not set before write\n");
+                               goto done;
+                       }
+
+                       cnt = bytes - pos;
+                       debug(" rx: write(%u)\n", cnt);
+                       sandbox_spi_tristate(&tx[pos], cnt);
+                       ret = os_write(sbsf->fd, rx + pos, cnt);
+                       if (ret < 0) {
+                               puts("sandbox_spi: os_write() failed\n");
+                               return 1;
+                       }
+                       pos += ret;
+                       sbsf->status &= ~STAT_WEL;
+                       break;
+               case SF_ERASE:
+ case_sf_erase: {
+                       const struct sandbox_spi_flash_erase_commands *
+                                               erase_cmd = sbsf->cmd_data;
+
+                       if (!(sbsf->status & STAT_WEL)) {
+                               puts("sandbox_sf: write enable not set before erase\n");
+                               goto done;
+                       }
+
+                       /* verify address is aligned */
+                       if (sbsf->off & (erase_cmd->size - 1)) {
+                               debug(" sector erase: cmd:%#x needs align:%#x, but we got %#x\n",
+                                     erase_cmd->cmd, erase_cmd->size,
+                                     sbsf->off);
+                               sbsf->status &= ~STAT_WEL;
+                               goto done;
+                       }
+
+                       debug(" sector erase addr: %u\n", sbsf->off);
+
+                       cnt = bytes - pos;
+                       sandbox_spi_tristate(&tx[pos], cnt);
+                       pos += cnt;
+
+                       /*
+                        * TODO(vapier@gentoo.org): latch WIP in status, and
+                        * delay before clearing it ?
+                        */
+                       ret = sandbox_erase_part(sbsf, erase_cmd->size);
+                       sbsf->status &= ~STAT_WEL;
+                       if (ret) {
+                               debug("sandbox_sf: Erase failed\n");
+                               goto done;
+                       }
+                       goto done;
+               }
+               default:
+                       debug(" ??? no idea what to do ???\n");
+                       goto done;
+               }
+       }
+
+ done:
+       return pos == bytes ? 0 : 1;
+}
+
+static const struct sandbox_spi_emu_ops sandbox_sf_ops = {
+       .setup         = sandbox_sf_setup,
+       .free          = sandbox_sf_free,
+       .cs_activate   = sandbox_sf_cs_activate,
+       .cs_deactivate = sandbox_sf_cs_deactivate,
+       .xfer          = sandbox_sf_xfer,
+};
+
+static int sandbox_cmdline_cb_spi_sf(struct sandbox_state *state,
+                                    const char *arg)
+{
+       unsigned long bus, cs;
+       const char *spec = sandbox_spi_parse_spec(arg, &bus, &cs);
+
+       if (!spec)
+               return 1;
+
+       /*
+        * It is safe to not make a copy of 'spec' because it comes from the
+        * command line.
+        *
+        * TODO(sjg@chromium.org): It would be nice if we could parse the
+        * spec here, but the problem is that no U-Boot init has been done
+        * yet. Perhaps we can figure something out.
+        */
+       state->spi[bus][cs].ops = &sandbox_sf_ops;
+       state->spi[bus][cs].spec = spec;
+       return 0;
+}
+SANDBOX_CMDLINE_OPT(spi_sf, 1, "connect a SPI flash: <bus>:<cs>:<id>:<file>");
index 732ddf8..d291746 100644 (file)
@@ -28,6 +28,7 @@
 #define CMD_PAGE_PROGRAM               0x02
 #define CMD_WRITE_DISABLE              0x04
 #define CMD_READ_STATUS                        0x05
+#define CMD_READ_STATUS1               0x35
 #define CMD_WRITE_ENABLE               0x06
 #define CMD_READ_CONFIG                        0x35
 #define CMD_FLAG_STATUS                        0x70
index 5eb8ffe..c1eb754 100644 (file)
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <asm/io.h>
 
 #include "sf_internal.h"
 
@@ -279,22 +280,19 @@ int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
                debug("%s: Memory map must cover entire device\n", __func__);
                return -1;
        }
-       flash->memory_map = (void *)addr;
+       flash->memory_map = map_sysmem(addr, size);
 
        return 0;
 }
 #endif /* CONFIG_OF_CONTROL */
 
-struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
-               unsigned int max_hz, unsigned int spi_mode)
+static struct spi_flash *spi_flash_probe_slave(struct spi_slave *spi)
 {
-       struct spi_slave *spi;
        struct spi_flash *flash = NULL;
        u8 idcode[5];
        int ret;
 
        /* Setup spi_slave */
-       spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
        if (!spi) {
                printf("SF: Failed to set up slave\n");
                return NULL;
@@ -358,6 +356,26 @@ err_claim_bus:
        return NULL;
 }
 
+struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
+               unsigned int max_hz, unsigned int spi_mode)
+{
+       struct spi_slave *spi;
+
+       spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
+       return spi_flash_probe_slave(spi);
+}
+
+#ifdef CONFIG_OF_SPI_FLASH
+struct spi_flash *spi_flash_probe_fdt(const void *blob, int slave_node,
+                                     int spi_node)
+{
+       struct spi_slave *spi;
+
+       spi = spi_setup_slave_fdt(blob, slave_node, spi_node);
+       return spi_flash_probe_slave(spi);
+}
+#endif
+
 void spi_flash_free(struct spi_flash *flash)
 {
        spi_free_slave(flash->spi);
index e1f3a24..56c2823 100644 (file)
@@ -5,9 +5,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-ifdef CONFIG_CMD_UBI
 obj-y += build.o vtbl.o vmt.o upd.o kapi.o eba.o io.o wl.o scan.o crc32.o
-
 obj-y += misc.o
 obj-y += debug.o
-endif
index 73612ea..64d4c56 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#ifndef CONFIG_AT91_LEGACY
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_emac.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_pio.h>
-#else
-/* remove next 5 lines, if all RM9200 boards convert to at91 arch */
-#include <asm/arch-at91/at91rm9200.h>
-#include <asm/arch-at91/hardware.h>
-#include <asm/arch-at91/at91_emac.h>
-#include <asm/arch-at91/at91_pmc.h>
-#include <asm/arch-at91/at91_pio.h>
-#endif
 #include <net.h>
 #include <netdev.h>
 #include <malloc.h>
index 39240d9..50167aa 100644 (file)
@@ -914,7 +914,7 @@ static int cpsw_recv(struct eth_device *dev)
        void *buffer;
        int len;
 
-       cpsw_update_link(priv);
+       cpsw_check_link(priv);
 
        while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
                invalidate_dcache_range((unsigned long)buffer,
index cd787f4..74c72d3 100644 (file)
@@ -276,13 +276,64 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)
                "status", "disabled", strlen("disabled") + 1, 1);
 }
 
+#ifdef CONFIG_SYS_FMAN_V3
+static int ft_fixup_xgec(void *blob, struct fm_eth_info *info)
+{
+       int off, i, ci;
+#define FM1_10GEC3_RX_PORT_ADDR        (CONFIG_SYS_CCSRBAR_PHYS + 0x488000)
+#define FM1_10GEC3_TX_PORT_ADDR        (CONFIG_SYS_CCSRBAR_PHYS + 0x4a8000)
+#define FM1_10GEC3_MAC_ADDR    (CONFIG_SYS_CCSRBAR_PHYS + 0x4e0000)
+
+       if ((info->port == FM1_10GEC3) || (info->port == FM1_10GEC4)) {
+               ci = (info->port == FM1_10GEC3) ? 2 : 3;
+               i = (info->port == FM1_10GEC3) ? 0 : 1;
+
+               off = fdt_node_offset_by_compat_reg(blob, "fsl,fman-port-1g-rx",
+                                                   FM1_10GEC3_RX_PORT_ADDR +
+                                                   i * 0x1000);
+               if (off > 0) {
+                       fdt_setprop(blob, off, "cell-index", &ci, sizeof(int));
+                       fdt_setprop(blob, off, "compatible",
+                                   "fsl,fman-port-10g-rx", 20);
+               } else {
+                       goto err;
+               }
+
+               off = fdt_node_offset_by_compat_reg(blob, "fsl,fman-port-1g-tx",
+                                                   FM1_10GEC3_TX_PORT_ADDR +
+                                                   i * 0x1000);
+               if (off > 0) {
+                       fdt_setprop(blob, off, "cell-index", &ci, sizeof(int));
+                       fdt_setprop(blob, off, "compatible",
+                                   "fsl,fman-port-10g-tx", 20);
+               } else {
+                       goto err;
+               }
+
+               off = fdt_node_offset_by_compat_reg(blob, "fsl,fman-memac",
+                                                   FM1_10GEC3_MAC_ADDR +
+                                                   i * 0x2000);
+               if (off > 0)
+                       fdt_setprop(blob, off, "cell-index", &ci, sizeof(int));
+               else
+                       goto err;
+       }
+       return 0;
+err:
+       printf("WARNING: Fail to find the node\n");
+       return -1;
+}
+#endif
+
 void fdt_fixup_fman_ethernet(void *blob)
 {
        int i;
 
 #ifdef CONFIG_SYS_FMAN_V3
-       for (i = 0; i < ARRAY_SIZE(fm_info); i++)
+       for (i = 0; i < ARRAY_SIZE(fm_info); i++) {
                ft_fixup_port(blob, &fm_info[i], "fsl,fman-memac");
+               ft_fixup_xgec(blob, &fm_info[i]);
+       }
 #else
        for (i = 0; i < ARRAY_SIZE(fm_info); i++) {
                if (fm_info[i].type == FM_ETH_1G_E)
index 0858b60..a1c6663 100644 (file)
@@ -9,6 +9,26 @@
 
 #include <twl6030.h>
 
+static struct twl6030_data *twl;
+
+static struct twl6030_data twl6030_info = {
+       .chip_type      = chip_TWL6030,
+       .adc_rbase      = GPCH0_LSB,
+       .adc_ctrl       = CTRL_P2,
+       .adc_enable     = CTRL_P2_SP2,
+       .vbat_mult      = TWL6030_VBAT_MULT,
+       .vbat_shift     = TWL6030_VBAT_SHIFT,
+};
+
+static struct twl6030_data twl6032_info = {
+       .chip_type      = chip_TWL6032,
+       .adc_rbase      = TWL6032_GPCH0_LSB,
+       .adc_ctrl       = TWL6032_CTRL_P1,
+       .adc_enable     = CTRL_P1_SP1,
+       .vbat_mult      = TWL6032_VBAT_MULT,
+       .vbat_shift     = TWL6032_VBAT_SHIFT,
+};
+
 static int twl6030_gpadc_read_channel(u8 channel_no)
 {
        u8 lsb = 0;
@@ -16,12 +36,12 @@ static int twl6030_gpadc_read_channel(u8 channel_no)
        int ret = 0;
 
        ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC,
-                                 GPCH0_LSB + channel_no * 2, &lsb);
+                                 twl->adc_rbase + channel_no * 2, &lsb);
        if (ret)
                return ret;
 
        ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC,
-                                 GPCH0_MSB + channel_no * 2, &msb);
+                                 twl->adc_rbase + 1 + channel_no * 2, &msb);
        if (ret)
                return ret;
 
@@ -33,7 +53,8 @@ static int twl6030_gpadc_sw2_trigger(void)
        u8 val;
        int ret = 0;
 
-       ret = twl6030_i2c_write_u8(TWL6030_CHIP_ADC, CTRL_P2, CTRL_P2_SP2);
+       ret = twl6030_i2c_write_u8(TWL6030_CHIP_ADC,
+                                  twl->adc_ctrl, twl->adc_enable);
        if (ret)
                return ret;
 
@@ -41,7 +62,8 @@ static int twl6030_gpadc_sw2_trigger(void)
        val =  CTRL_P2_BUSY;
 
        while (!((val & CTRL_P2_EOCP2) && (!(val & CTRL_P2_BUSY)))) {
-               ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC, CTRL_P2, &val);
+               ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC,
+                                         twl->adc_ctrl, &val);
                if (ret)
                        return ret;
                udelay(1000);
@@ -102,6 +124,18 @@ int twl6030_get_battery_voltage(void)
 {
        int battery_volt = 0;
        int ret = 0;
+       u8 vbatch;
+
+       if (twl->chip_type == chip_TWL6030) {
+               vbatch = TWL6030_GPADC_VBAT_CHNL;
+       } else {
+               ret = twl6030_i2c_write_u8(TWL6030_CHIP_ADC,
+                                          TWL6032_GPSELECT_ISB,
+                                          TWL6032_GPADC_VBAT_CHNL);
+               if (ret)
+                       return ret;
+               vbatch = 0;
+       }
 
        /* Start GPADC SW conversion */
        ret = twl6030_gpadc_sw2_trigger();
@@ -111,12 +145,12 @@ int twl6030_get_battery_voltage(void)
        }
 
        /* measure Vbat voltage */
-       battery_volt = twl6030_gpadc_read_channel(7);
+       battery_volt = twl6030_gpadc_read_channel(vbatch);
        if (battery_volt < 0) {
                printf("Failed to read battery voltage\n");
                return ret;
        }
-       battery_volt = (battery_volt * 25 * 1000) >> (10 + 2);
+       battery_volt = (battery_volt * twl->vbat_mult) >> twl->vbat_shift;
        printf("Battery Voltage: %d mV\n", battery_volt);
 
        return battery_volt;
@@ -124,12 +158,35 @@ int twl6030_get_battery_voltage(void)
 
 void twl6030_init_battery_charging(void)
 {
-       u8 stat1 = 0;
+       u8 val = 0;
        int battery_volt = 0;
        int ret = 0;
 
+       ret = twl6030_i2c_read_u8(TWL6030_CHIP_USB, USB_PRODUCT_ID_LSB, &val);
+       if (ret) {
+               puts("twl6030_init_battery_charging(): could not determine chip!\n");
+               return;
+       }
+       if (val == 0x30) {
+               twl = &twl6030_info;
+       } else if (val == 0x32) {
+               twl = &twl6032_info;
+       } else {
+               puts("twl6030_init_battery_charging(): unsupported chip type\n");
+               return;
+       }
+
        /* Enable VBAT measurement */
-       twl6030_i2c_write_u8(TWL6030_CHIP_PM, MISC1, VBAT_MEAS);
+       if (twl->chip_type == chip_TWL6030) {
+               twl6030_i2c_write_u8(TWL6030_CHIP_PM, MISC1, VBAT_MEAS);
+               twl6030_i2c_write_u8(TWL6030_CHIP_ADC,
+                                    TWL6030_GPADC_CTRL,
+                                    GPADC_CTRL_SCALER_DIV4);
+       } else {
+               twl6030_i2c_write_u8(TWL6030_CHIP_ADC,
+                                    TWL6032_GPADC_CTRL2,
+                                    GPADC_CTRL2_CH18_SCALER_EN);
+       }
 
        /* Enable GPADC module */
        ret = twl6030_i2c_write_u8(TWL6030_CHIP_CHARGER, TOGGLE1, FGS | GPADCS);
@@ -146,10 +203,10 @@ void twl6030_init_battery_charging(void)
                printf("Main battery voltage too low!\n");
 
        /* Check for the presence of USB charger */
-       twl6030_i2c_read_u8(TWL6030_CHIP_CHARGER, CONTROLLER_STAT1, &stat1);
+       twl6030_i2c_read_u8(TWL6030_CHIP_CHARGER, CONTROLLER_STAT1, &val);
 
        /* check for battery presence indirectly via Fuel gauge */
-       if ((stat1 & VBUS_DET) && (battery_volt < 3300))
+       if ((val & VBUS_DET) && (battery_volt < 3300))
                twl6030_start_usb_charging();
 
        return;
index 9c7c621..c8926a8 100644 (file)
@@ -38,6 +38,9 @@ static int lpc32xx_serial_getc(void)
 
 static void lpc32xx_serial_putc(const char c)
 {
+       if (c == '\n')
+               serial_putc('\r');
+
        writel(c, &hsuart->tx);
 
        /* Wait for character to be sent */
index 27902fe..ed4ecd7 100644 (file)
@@ -27,6 +27,7 @@ obj-$(CONFIG_MXC_SPI) += mxc_spi.o
 obj-$(CONFIG_MXS_SPI) += mxs_spi.o
 obj-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o
 obj-$(CONFIG_OMAP3_SPI) += omap3_spi.o
+obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
 obj-$(CONFIG_SOFT_SPI) += soft_spi.o
 obj-$(CONFIG_SH_SPI) += sh_spi.o
 obj-$(CONFIG_FSL_ESPI) += fsl_espi.o
index bb88f30..aa89d89 100644 (file)
@@ -162,21 +162,22 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
 
-       if (bus >= ARRAY_SIZE(pins) || pins[bus] == NULL) {
-               debug("%s: invalid bus %u\n", __func__, bus);
-               return NULL;
-       }
        switch (bus) {
 #ifdef SPI0_CTL
-               case 0: mmr_base = SPI0_CTL; break;
+       case 0:
+               mmr_base = SPI0_CTL; break;
 #endif
 #ifdef SPI1_CTL
-               case 1: mmr_base = SPI1_CTL; break;
+       case 1:
+               mmr_base = SPI1_CTL; break;
 #endif
 #ifdef SPI2_CTL
-               case 2: mmr_base = SPI2_CTL; break;
+       case 2:
+               mmr_base = SPI2_CTL; break;
 #endif
-               default: return NULL;
+       default:
+               debug("%s: invalid bus %u\n", __func__, bus);
+               return NULL;
        }
 
        bss = spi_alloc_slave(struct bfin_spi_slave, bus, cs);
index c25c4a9..07b833d 100644 (file)
@@ -154,10 +154,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
 
-       if (bus >= ARRAY_SIZE(pins) || pins[bus] == NULL) {
-               debug("%s: invalid bus %u\n", __func__, bus);
-               return NULL;
-       }
        switch (bus) {
 #ifdef SPI0_REGBASE
        case 0:
@@ -175,6 +171,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
                break;
 #endif
        default:
+               debug("%s: invalid bus %u\n", __func__, bus);
                return NULL;
        }
 
index 699c57e..4d5def2 100644 (file)
@@ -529,18 +529,18 @@ static int process_nodes(const void *blob, int node_list[], int count)
  * @param node         SPI peripheral node to use
  * @return 0 if ok, -1 on error
  */
-struct spi_slave *spi_setup_slave_fdt(const void *blob, int node,
-               unsigned int cs, unsigned int max_hz, unsigned int mode)
+struct spi_slave *spi_setup_slave_fdt(const void *blob, int slave_node,
+                                     int spi_node)
 {
        struct spi_bus *bus;
        unsigned int i;
 
        for (i = 0, bus = spi_bus; i < bus_count; i++, bus++) {
-               if (bus->node == node)
-                       return spi_setup_slave(i, cs, max_hz, mode);
+               if (bus->node == spi_node)
+                       return spi_base_setup_slave_fdt(blob, i, slave_node);
        }
 
-       debug("%s: Failed to find bus node %d\n", __func__, node);
+       debug("%s: Failed to find bus node %d\n", __func__, spi_node);
        return NULL;
 }
 
diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c
new file mode 100644 (file)
index 0000000..7895305
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Simulate a SPI port
+ *
+ * Copyright (c) 2011-2013 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <spi.h>
+#include <os.h>
+
+#include <asm/errno.h>
+#include <asm/spi.h>
+#include <asm/state.h>
+
+#ifndef CONFIG_SPI_IDLE_VAL
+# define CONFIG_SPI_IDLE_VAL 0xFF
+#endif
+
+struct sandbox_spi_slave {
+       struct spi_slave slave;
+       const struct sandbox_spi_emu_ops *ops;
+       void *priv;
+};
+
+#define to_sandbox_spi_slave(s) container_of(s, struct sandbox_spi_slave, slave)
+
+const char *sandbox_spi_parse_spec(const char *arg, unsigned long *bus,
+                                  unsigned long *cs)
+{
+       char *endp;
+
+       *bus = simple_strtoul(arg, &endp, 0);
+       if (*endp != ':' || *bus >= CONFIG_SANDBOX_SPI_MAX_BUS)
+               return NULL;
+
+       *cs = simple_strtoul(endp + 1, &endp, 0);
+       if (*endp != ':' || *cs >= CONFIG_SANDBOX_SPI_MAX_CS)
+               return NULL;
+
+       return endp + 1;
+}
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus < CONFIG_SANDBOX_SPI_MAX_BUS &&
+               cs < CONFIG_SANDBOX_SPI_MAX_CS;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       struct sandbox_spi_slave *sss = to_sandbox_spi_slave(slave);
+
+       debug("sandbox_spi: activating CS\n");
+       if (sss->ops->cs_activate)
+               sss->ops->cs_activate(sss->priv);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       struct sandbox_spi_slave *sss = to_sandbox_spi_slave(slave);
+
+       debug("sandbox_spi: deactivating CS\n");
+       if (sss->ops->cs_deactivate)
+               sss->ops->cs_deactivate(sss->priv);
+}
+
+void spi_init(void)
+{
+}
+
+void spi_set_speed(struct spi_slave *slave, uint hz)
+{
+}
+
+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
+               unsigned int max_hz, unsigned int mode)
+{
+       struct sandbox_spi_slave *sss;
+       struct sandbox_state *state = state_get_current();
+       const char *spec;
+
+       if (!spi_cs_is_valid(bus, cs)) {
+               debug("sandbox_spi: Invalid SPI bus/cs\n");
+               return NULL;
+       }
+
+       sss = spi_alloc_slave(struct sandbox_spi_slave, bus, cs);
+       if (!sss) {
+               debug("sandbox_spi: Out of memory\n");
+               return NULL;
+       }
+
+       spec = state->spi[bus][cs].spec;
+       sss->ops = state->spi[bus][cs].ops;
+       if (!spec || !sss->ops || sss->ops->setup(&sss->priv, spec)) {
+               free(sss);
+               printf("sandbox_spi: unable to locate a slave client\n");
+               return NULL;
+       }
+
+       return &sss->slave;
+}
+
+void spi_free_slave(struct spi_slave *slave)
+{
+       struct sandbox_spi_slave *sss = to_sandbox_spi_slave(slave);
+
+       debug("sandbox_spi: releasing slave\n");
+
+       if (sss->ops->free)
+               sss->ops->free(sss->priv);
+
+       free(sss);
+}
+
+static int spi_bus_claim_cnt[CONFIG_SANDBOX_SPI_MAX_BUS];
+
+int spi_claim_bus(struct spi_slave *slave)
+{
+       if (spi_bus_claim_cnt[slave->bus]++) {
+               printf("sandbox_spi: error: bus already claimed: %d!\n",
+                      spi_bus_claim_cnt[slave->bus]);
+       }
+
+       return 0;
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+       if (--spi_bus_claim_cnt[slave->bus]) {
+               printf("sandbox_spi: error: bus freed too often: %d!\n",
+                      spi_bus_claim_cnt[slave->bus]);
+       }
+}
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+               void *din, unsigned long flags)
+{
+       struct sandbox_spi_slave *sss = to_sandbox_spi_slave(slave);
+       uint bytes = bitlen / 8, i;
+       int ret = 0;
+       u8 *tx = (void *)dout, *rx = din;
+
+       if (bitlen == 0)
+               goto done;
+
+       /* we can only do 8 bit transfers */
+       if (bitlen % 8) {
+               printf("sandbox_spi: xfer: invalid bitlen size %u; needs to be 8bit\n",
+                      bitlen);
+               flags |= SPI_XFER_END;
+               goto done;
+       }
+
+       if (flags & SPI_XFER_BEGIN)
+               spi_cs_activate(slave);
+
+       /* make sure rx/tx buffers are full so clients can assume */
+       if (!tx) {
+               debug("sandbox_spi: xfer: auto-allocating tx scratch buffer\n");
+               tx = malloc(bytes);
+               if (!tx) {
+                       debug("sandbox_spi: Out of memory\n");
+                       return -ENOMEM;
+               }
+       }
+       if (!rx) {
+               debug("sandbox_spi: xfer: auto-allocating rx scratch buffer\n");
+               rx = malloc(bytes);
+               if (!rx) {
+                       debug("sandbox_spi: Out of memory\n");
+                       return -ENOMEM;
+               }
+       }
+
+       debug("sandbox_spi: xfer: bytes = %u\n tx:", bytes);
+       for (i = 0; i < bytes; ++i)
+               debug(" %u:%02x", i, tx[i]);
+       debug("\n");
+
+       ret = sss->ops->xfer(sss->priv, tx, rx, bytes);
+
+       debug("sandbox_spi: xfer: got back %i (that's %s)\n rx:",
+             ret, ret ? "bad" : "good");
+       for (i = 0; i < bytes; ++i)
+               debug(" %u:%02x", i, rx[i]);
+       debug("\n");
+
+       if (tx != dout)
+               free(tx);
+       if (rx != din)
+               free(rx);
+
+ done:
+       if (flags & SPI_XFER_END)
+               spi_cs_deactivate(slave);
+
+       return ret;
+}
index b76a26c..7ddea9b 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <fdtdec.h>
 #include <malloc.h>
 #include <spi.h>
 
@@ -37,3 +38,21 @@ void *spi_do_alloc_slave(int offset, int size, unsigned int bus,
 
        return ptr;
 }
+
+#ifdef CONFIG_OF_SPI
+struct spi_slave *spi_base_setup_slave_fdt(const void *blob, int busnum,
+                                          int node)
+{
+       int cs, max_hz, mode = 0;
+
+       cs = fdtdec_get_int(blob, node, "reg", -1);
+       max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", 100000);
+       if (fdtdec_get_bool(blob, node, "spi-cpol"))
+               mode |= SPI_CPOL;
+       if (fdtdec_get_bool(blob, node, "spi-cpha"))
+               mode |= SPI_CPHA;
+       if (fdtdec_get_bool(blob, node, "spi-cs-high"))
+               mode |= SPI_CS_HIGH;
+       return spi_setup_slave(busnum, cs, max_hz, mode);
+}
+#endif
index f52d3f4..f13b172 100644 (file)
@@ -5,12 +5,8 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-# if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)
-#   Everytime you forget how crufty makefiles can get things like
-#   this remind you...
-ifneq (,$(CONFIG_USB_GADGET)$(CONFIG_USB_ETHER))
-obj-y += epautoconf.o config.o usbstring.o
-endif
+obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o
+obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
index 8dc3d9f..dd95afe 100644 (file)
@@ -147,6 +147,23 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
        return 0;
 }
 
+__weak int g_dnl_get_board_bcd_device_number(int gcnum)
+{
+       return gcnum;
+}
+
+static int g_dnl_get_bcd_device_number(struct usb_composite_dev *cdev)
+{
+       struct usb_gadget *gadget = cdev->gadget;
+       int gcnum;
+
+       gcnum = usb_gadget_controller_number(gadget);
+       if (gcnum > 0)
+               gcnum += 0x200;
+
+       return g_dnl_get_board_bcd_device_number(gcnum);
+}
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
        struct usb_gadget *gadget = cdev->gadget;
@@ -181,11 +198,9 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
        if (ret)
                goto error;
 
-       gcnum = usb_gadget_controller_number(gadget);
-
-       debug("gcnum: %d\n", gcnum);
+       gcnum = g_dnl_get_bcd_device_number(cdev);
        if (gcnum >= 0)
-               device_desc.bcdDevice = cpu_to_le16(0x0200 + gcnum);
+               device_desc.bcdDevice = cpu_to_le16(gcnum);
        else {
                debug("%s: controller '%s' not recognized\n",
                        shortname, gadget->name);
index 84bfcc5..ac5d112 100644 (file)
@@ -226,6 +226,11 @@ struct s3c_usbotg_reg {
 #define CLK_SEL_12MHZ                   (0x2 << 0)
 #define CLK_SEL_48MHZ                   (0x0 << 0)
 
+#define EXYNOS4X12_ID_PULLUP0          (0x01 << 3)
+#define EXYNOS4X12_COMMON_ON_N0        (0x01 << 4)
+#define EXYNOS4X12_CLK_SEL_12MHZ       (0x02 << 0)
+#define EXYNOS4X12_CLK_SEL_24MHZ       (0x05 << 0)
+
 /* Device Configuration Register DCFG */
 #define DEV_SPEED_HIGH_SPEED_20         (0x0 << 0)
 #define DEV_SPEED_FULL_SPEED_20         (0x1 << 0)
index 7e20209..ba17a04 100644 (file)
@@ -167,8 +167,13 @@ void otg_phy_init(struct s3c_udc *dev)
                writel((readl(&phy->phypwr) &~(OTG_DISABLE_0 | ANALOG_PWRDOWN)
                        &~FORCE_SUSPEND_0), &phy->phypwr);
 
-       writel((readl(&phy->phyclk) &~(ID_PULLUP0 | COMMON_ON_N0)) |
-              CLK_SEL_24MHZ, &phy->phyclk); /* PLL 24Mhz */
+       if (s5p_cpu_id == 0x4412)
+               writel((readl(&phy->phyclk) & ~(EXYNOS4X12_ID_PULLUP0 |
+                       EXYNOS4X12_COMMON_ON_N0)) | EXYNOS4X12_CLK_SEL_24MHZ,
+                      &phy->phyclk); /* PLL 24Mhz */
+       else
+               writel((readl(&phy->phyclk) & ~(ID_PULLUP0 | COMMON_ON_N0)) |
+                      CLK_SEL_24MHZ, &phy->phyclk); /* PLL 24Mhz */
 
        writel((readl(&phy->rstcon) &~(LINK_SW_RST | PHYLNK_SW_RST))
               | PHY_SW_RST0, &phy->rstcon);
index c4ce487..1b215c2 100644 (file)
@@ -28,21 +28,48 @@ static struct omap_ehci *const ehci = (struct omap_ehci *)OMAP_EHCI_BASE;
 
 static int omap_uhh_reset(void)
 {
-/*
- * Soft resetting the UHH module causes instability issues on
- * all OMAPs so we just avoid it.
- *
- * See OMAP36xx Errata
- *  i571: USB host EHCI may stall when entering smart-standby mode
- *  i660: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
- *
- * On OMAP4/5, soft-resetting the UHH module will put it into
- * Smart-Idle mode and lead to a deadlock.
- *
- * On OMAP3, this doesn't seem to be the case but still instabilities
- * are observed on beagle (3530 ES1.0) if soft-reset is used.
- * e.g. NFS root failures with Linux kernel.
- */
+       int timeout = 0;
+       u32 rev;
+
+       rev = readl(&uhh->rev);
+
+       /* Soft RESET */
+       writel(OMAP_UHH_SYSCONFIG_SOFTRESET, &uhh->sysc);
+
+       switch (rev) {
+       case OMAP_USBHS_REV1:
+               /* Wait for soft RESET to complete */
+               while (!(readl(&uhh->syss) & 0x1)) {
+                       if (timeout > 100) {
+                               printf("%s: RESET timeout\n", __func__);
+                               return -1;
+                       }
+                       udelay(10);
+                       timeout++;
+               }
+
+               /* Set No-Idle, No-Standby */
+               writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+               break;
+
+       default:        /* Rev. 2 onwards */
+
+               udelay(2); /* Need to wait before accessing SYSCONFIG back */
+
+               /* Wait for soft RESET to complete */
+               while ((readl(&uhh->sysc) & 0x1)) {
+                       if (timeout > 100) {
+                               printf("%s: RESET timeout\n", __func__);
+                               return -1;
+                       }
+                       udelay(10);
+                       timeout++;
+               }
+
+               writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+               break;
+       }
+
        return 0;
 }
 
index 0138bca..60a5cc5 100644 (file)
@@ -20,7 +20,6 @@ vu_long  *vcxk_bws_long = ((vu_long *) (CONFIG_SYS_VCXK_BASE));
        #ifndef VCBITMASK
                #define VCBITMASK(bitno)        (0x0001 << (bitno % 16))
        #endif
-#ifndef CONFIG_AT91_LEGACY
 at91_pio_t *pio = (at91_pio_t *) AT91_PIO_BASE;
 #define VCXK_INIT_PIN(PORT, PIN, DDR, I0O1) \
        do { \
@@ -37,20 +36,6 @@ at91_pio_t *pio = (at91_pio_t *) AT91_PIO_BASE;
 #define VCXK_ACKNOWLEDGE       \
        (!(readl(&pio->CONFIG_SYS_VCXK_ACKNOWLEDGE_PORT.pdsr) & \
                        CONFIG_SYS_VCXK_ACKNOWLEDGE_PIN))
-#else
-       #define VCXK_INIT_PIN(PORT, PIN, DDR, I0O1) \
-               ((AT91PS_PIO) PORT)->PIO_PER = PIN; \
-               ((AT91PS_PIO) PORT)->DDR = PIN; \
-               ((AT91PS_PIO) PORT)->PIO_MDDR = PIN; \
-               if (!I0O1) ((AT91PS_PIO) PORT)->PIO_PPUER = PIN;
-
-       #define VCXK_SET_PIN(PORT, PIN) ((AT91PS_PIO) PORT)->PIO_SODR  = PIN;
-       #define VCXK_CLR_PIN(PORT, PIN) ((AT91PS_PIO) PORT)->PIO_CODR  = PIN;
-
-       #define VCXK_ACKNOWLEDGE        \
-               (!(((AT91PS_PIO) CONFIG_SYS_VCXK_ACKNOWLEDGE_PORT)->\
-                       PIO_PDSR & CONFIG_SYS_VCXK_ACKNOWLEDGE_PIN))
-#endif
 #elif defined(CONFIG_MCF52x2)
        #include <asm/m5282.h>
        #ifndef VCBITMASK
index 140c8bc..6c7198f 100644 (file)
@@ -10,7 +10,7 @@
 ifeq ($(DEVICE_TREE),)
 $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
 $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file))
-DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
+DEVICE_TREE = $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
 endif
 
 DTS_INCDIRS =  $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts
index 4d9ce66..6d3a616 100644 (file)
@@ -1,6 +1,4 @@
-/82559_eeprom
 /atmel_df_pow2
-/eepro100_eeprom
 /hello_world
 /interrupt
 /mem_to_mem_idma2intr
diff --git a/examples/standalone/82559_eeprom.c b/examples/standalone/82559_eeprom.c
deleted file mode 100644 (file)
index c253055..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright 1998-2001 by Donald Becker.
- * This software may be used and distributed according to the terms of
- * the GNU General Public License (GPL), incorporated herein by reference.
- * Contact the author for use under other terms.
- *
- * This program must be compiled with "-O"!
- * See the bottom of this file for the suggested compile-command.
- *
- * The author may be reached as becker@scyld.com, or C/O
- *  Scyld Computing Corporation
- *  410 Severn Ave., Suite 210
- *  Annapolis MD 21403
- *
- * Common-sense licensing statement: Using any portion of this program in
- * your own program means that you must give credit to the original author
- * and release the resulting code under the GPL.
- */
-
-#define _PPC_STRING_H_         /* avoid unnecessary str/mem functions */
-
-#include <common.h>
-#include <exports.h>
-#include <asm/io.h>
-
-
-/* Default EEPROM for i82559 */
-static unsigned short default_eeprom[64] = {
-       0x0100, 0x0302, 0x0504, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0x40c0, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-       0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
-};
-
-static unsigned short eeprom[256];
-
-static int eeprom_size = 64;
-static int eeprom_addr_size = 6;
-
-static int debug = 0;
-
-static inline unsigned short swap16(unsigned short x)
-{
-       return (((x & 0xff) << 8) | ((x & 0xff00) >> 8));
-}
-
-
-void * memcpy(void * dest,const void *src,size_t count)
-{
-       char *tmp = (char *) dest, *s = (char *) src;
-
-       while (count--)
-               *tmp++ = *s++;
-
-       return dest;
-}
-
-
-/* The EEPROM commands include the alway-set leading bit. */
-#define EE_WRITE_CMD   (5)
-#define EE_READ_CMD            (6)
-#define EE_ERASE_CMD   (7)
-
-/* Serial EEPROM section. */
-#define EE_SHIFT_CLK   0x01    /* EEPROM shift clock. */
-#define EE_CS                  0x02    /* EEPROM chip select. */
-#define EE_DATA_WRITE  0x04    /* EEPROM chip data in. */
-#define EE_DATA_READ   0x08    /* EEPROM chip data out. */
-#define EE_ENB                 (0x4800 | EE_CS)
-#define EE_WRITE_0             0x4802
-#define EE_WRITE_1             0x4806
-#define EE_OFFSET              14
-
-/* Delay between EEPROM clock transitions. */
-#define eeprom_delay(ee_addr)  inw(ee_addr)
-
-/* Wait for the EEPROM to finish the previous operation. */
-static int eeprom_busy_poll(long ee_ioaddr)
-{
-       int i;
-       outw(EE_ENB, ee_ioaddr);
-       for (i = 0; i < 10000; i++)                     /* Typical 2000 ticks */
-               if (inw(ee_ioaddr) & EE_DATA_READ)
-                       break;
-       return i;
-}
-
-/* This executes a generic EEPROM command, typically a write or write enable.
-   It returns the data output from the EEPROM, and thus may also be used for
-   reads. */
-static int do_eeprom_cmd(long ioaddr, int cmd, int cmd_len)
-{
-       unsigned retval = 0;
-       long ee_addr = ioaddr + EE_OFFSET;
-
-       if (debug > 1)
-               printf(" EEPROM op 0x%x: ", cmd);
-
-       outw(EE_ENB | EE_SHIFT_CLK, ee_addr);
-
-       /* Shift the command bits out. */
-       do {
-               short dataval = (cmd & (1 << cmd_len)) ? EE_WRITE_1 : EE_WRITE_0;
-               outw(dataval, ee_addr);
-               eeprom_delay(ee_addr);
-               if (debug > 2)
-                       printf("%X", inw(ee_addr) & 15);
-               outw(dataval | EE_SHIFT_CLK, ee_addr);
-               eeprom_delay(ee_addr);
-               retval = (retval << 1) | ((inw(ee_addr) & EE_DATA_READ) ? 1 : 0);
-       } while (--cmd_len >= 0);
-#if 0
-       outw(EE_ENB, ee_addr);
-#endif
-       /* Terminate the EEPROM access. */
-       outw(EE_ENB & ~EE_CS, ee_addr);
-       if (debug > 1)
-               printf(" EEPROM result is 0x%5.5x.\n", retval);
-       return retval;
-}
-
-static int read_eeprom(long ioaddr, int location, int addr_len)
-{
-       return do_eeprom_cmd(ioaddr, ((EE_READ_CMD << addr_len) | location)
-               << 16 , 3 + addr_len + 16) & 0xffff;
-}
-
-static void write_eeprom(long ioaddr, int index, int value, int addr_len)
-{
-       long ee_ioaddr = ioaddr + EE_OFFSET;
-       int i;
-
-       /* Poll for previous op finished. */
-       eeprom_busy_poll(ee_ioaddr);                    /* Typical 0 ticks */
-       /* Enable programming modes. */
-       do_eeprom_cmd(ioaddr, (0x4f << (addr_len-4)), 3 + addr_len);
-       /* Do the actual write. */
-       do_eeprom_cmd(ioaddr,
-                                 (((EE_WRITE_CMD<<addr_len) | index)<<16) | (value & 0xffff),
-                                 3 + addr_len + 16);
-       /* Poll for write finished. */
-       i = eeprom_busy_poll(ee_ioaddr);                        /* Typical 2000 ticks */
-       if (debug)
-               printf(" Write finished after %d ticks.\n", i);
-       /* Disable programming. This command is not instantaneous, so we check
-          for busy before the next op. */
-       do_eeprom_cmd(ioaddr, (0x40 << (addr_len-4)), 3 + addr_len);
-       eeprom_busy_poll(ee_ioaddr);
-}
-
-static int reset_eeprom(unsigned long ioaddr, unsigned char *hwaddr)
-{
-       unsigned short checksum = 0;
-       int size_test;
-       int i;
-
-       printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
-
-       size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
-       eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
-       eeprom_size = 1 << eeprom_addr_size;
-
-       memcpy(eeprom, default_eeprom, sizeof default_eeprom);
-
-       for (i = 0; i < 3; i++)
-               eeprom[i] = (hwaddr[i*2+1]<<8) + hwaddr[i*2];
-
-       /* Recalculate the checksum. */
-       for (i = 0; i < eeprom_size - 1; i++)
-               checksum += eeprom[i];
-       eeprom[i] = 0xBABA - checksum;
-
-       for (i = 0; i < eeprom_size; i++)
-               write_eeprom(ioaddr, i, eeprom[i], eeprom_addr_size);
-
-       for (i = 0; i < eeprom_size; i++)
-               if (read_eeprom(ioaddr, i, eeprom_addr_size) != eeprom[i]) {
-                       printf("failed\n");
-                       return 1;
-               }
-
-       printf("done\n");
-       return 0;
-}
-
-static unsigned int hatoi(char *p, char **errp)
-{
-       unsigned int res = 0;
-
-       while (1) {
-               switch (*p) {
-               case 'a':
-               case 'b':
-               case 'c':
-               case 'd':
-               case 'e':
-               case 'f':
-                       res |= (*p - 'a' + 10);
-                       break;
-               case 'A':
-               case 'B':
-               case 'C':
-               case 'D':
-               case 'E':
-               case 'F':
-                       res |= (*p - 'A' + 10);
-                       break;
-               case '0':
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                       res |= (*p - '0');
-                       break;
-               default:
-                       if (errp) {
-                               *errp = p;
-                       }
-               return res;
-               }
-               p++;
-               if (*p == 0) {
-                       break;
-               }
-               res <<= 4;
-       }
-
-       if (errp) {
-               *errp = NULL;
-       }
-
-       return res;
-}
-
-static unsigned char *gethwaddr(char *in, unsigned char *out)
-{
-       char tmp[3];
-       int i;
-       char *err;
-
-       for (i=0;i<6;i++) {
-               if (in[i*3+2] == 0 && i == 5) {
-                       out[i] = hatoi(&in[i*3], &err);
-                       if (err) {
-                               return NULL;
-                       }
-               } else if (in[i*3+2] == ':' && i < 5) {
-                       tmp[0] = in[i*3];
-                       tmp[1] = in[i*3+1];
-                       tmp[2] = 0;
-                       out[i] = hatoi(tmp, &err);
-                       if (err) {
-                               return NULL;
-                       }
-               } else {
-                       return NULL;
-               }
-       }
-
-       return out;
-}
-
-static u32
-read_config_dword(int bus, int dev, int func, int reg)
-{
-       u32 res;
-
-       outl(0x80000000|(bus&0xff)<<16|(dev&0x1f)<<11|(func&7)<<8|(reg&0xfc),
-            0xcf8);
-       res = inl(0xcfc);
-       outl(0, 0xcf8);
-       return res;
-}
-
-static u16
-read_config_word(int bus, int dev, int func, int reg)
-{
-       u32 res;
-
-       outl(0x80000000|(bus&0xff)<<16|(dev&0x1f)<<11|(func&7)<<8|(reg&0xfc),
-            0xcf8);
-       res = inw(0xcfc + (reg & 2));
-       outl(0, 0xcf8);
-       return res;
-}
-
-static void
-write_config_word(int bus, int dev, int func, int reg, u16 data)
-{
-
-       outl(0x80000000|(bus&0xff)<<16|(dev&0x1f)<<11|(func&7)<<8|(reg&0xfc),
-            0xcf8);
-       outw(data, 0xcfc + (reg & 2));
-       outl(0, 0xcf8);
-}
-
-
-int main (int argc, char * const argv[])
-{
-       unsigned char *eth_addr;
-       uchar buf[6];
-       int instance;
-
-       app_startup(argv);
-       if (argc != 2) {
-               printf ("call with base Ethernet address\n");
-               return 1;
-       }
-
-
-       eth_addr = gethwaddr(argv[1], buf);
-       if (NULL == eth_addr) {
-               printf ("Can not parse ethernet address\n");
-               return 1;
-       }
-       if (eth_addr[5] & 0x01) {
-               printf("Base Ethernet address must be even\n");
-       }
-
-
-       for (instance = 0; instance < 2; instance ++)  {
-               unsigned int io_addr;
-               unsigned char mac[6];
-               int bar1 = read_config_dword(0, 6+instance, 0, 0x14);
-               if (! (bar1 & 1)) {
-                       printf("ETH%d is disabled %x\n", instance, bar1);
-               } else {
-                       printf("ETH%d IO=0x%04x\n", instance, bar1 & ~3);
-               }
-               io_addr = (bar1 & (~3L));
-
-
-               write_config_word(0, 6+instance, 0, 4,
-                                 read_config_word(0, 6+instance, 0, 4) | 1);
-               printf("ETH%d CMD %04x\n", instance,
-                          read_config_word(0, 6+instance, 0, 4));
-
-               memcpy(mac, eth_addr, 6);
-               mac[5] += instance;
-
-               printf("got io=%04x, ha=%02x:%02x:%02x:%02x:%02x:%02x\n",
-                          io_addr, mac[0], mac[1], mac[2],
-                          mac[3], mac[4], mac[5]);
-               reset_eeprom(io_addr, mac);
-       }
-       return 0;
-}
index f4f102b..0841c75 100644 (file)
@@ -7,25 +7,22 @@
 
 include $(TOPDIR)/config.mk
 
-ELF-$(ARCH)  :=
-ELF-$(CPU)   :=
 ELF-y        := hello_world
 
 ELF-$(CONFIG_SMC91111)           += smc91111_eeprom
 ELF-$(CONFIG_SMC911X)            += smc911x_eeprom
 ELF-$(CONFIG_SPI_FLASH_ATMEL)    += atmel_df_pow2
-ELF-i386                         += 82559_eeprom
-ELF-mpc5xxx                      += interrupt
-ELF-mpc8xx                       += test_burst timer
-ELF-mpc8260                      += mem_to_mem_idma2intr
-ELF-ppc                          += sched
+ELF-$(CONFIG_MPC5xxx)            += interrupt
+ELF-$(CONFIG_8xx)                += test_burst timer
+ELF-$(CONFIG_8260)               += mem_to_mem_idma2intr
+ELF-$(CONFIG_PPC)                += sched
 
 #
 # Some versions of make do not handle trailing white spaces properly;
 # leading to build failures. The problem was found with GNU Make 3.80.
 # Using 'strip' as a workaround for the problem.
 #
-ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(CPU)))
+ELF := $(strip $(ELF-y))
 
 SREC := $(addsuffix .srec,$(ELF))
 BIN  := $(addsuffix .bin,$(ELF))
@@ -34,11 +31,9 @@ COBJS        := $(ELF:=.o)
 
 LIB    = $(obj)libstubs.o
 
-LIBAOBJS-$(ARCH)     :=
-LIBAOBJS-$(CPU)      :=
-LIBAOBJS-ppc         += $(ARCH)_longjmp.o $(ARCH)_setjmp.o
-LIBAOBJS-mpc8xx      += test_burst_lib.o
-LIBAOBJS := $(LIBAOBJS-$(ARCH)) $(LIBAOBJS-$(CPU))
+LIBAOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o
+LIBAOBJS-$(CONFIG_8xx) += test_burst_lib.o
+LIBAOBJS := $(LIBAOBJS-y)
 
 LIBCOBJS = stubs.o
 
index c856983..3fb5db3 100644 (file)
 #include <common.h>
 #include <config.h>
 #include <malloc.h>
+#include <div64.h>
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <watchdog.h>
@@ -1438,7 +1439,7 @@ jffs2_1pass_build_lists(struct part_info * part)
 {
        struct b_lists *pL;
        struct jffs2_unknown_node *node;
-       u32 nr_sectors = part->size/part->sector_size;
+       u32 nr_sectors;
        u32 i;
        u32 counter4 = 0;
        u32 counterF = 0;
@@ -1447,6 +1448,7 @@ jffs2_1pass_build_lists(struct part_info * part)
        u32 buf_size = DEFAULT_EMPTY_SCAN_SIZE;
        char *buf;
 
+       nr_sectors = lldiv(part->size, part->sector_size);
        /* turn off the lcd.  Refreshing the lcd adds 50% overhead to the */
        /* jffs2 list building enterprise nope.  in newer versions the overhead is */
        /* only about 5 %.  not enough to inconvenience people for. */
index e113e40..50000a1 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <div64.h>
 
 #include <config.h>
 #include "nand.h"
@@ -184,7 +185,7 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev,
        }
 
        if (end_block == 0)
-               end_block = mtd->size / mtd->erasesize - 1;
+               end_block = lldiv(mtd->size, mtd->erasesize - 1);
 
        if (end_block < start_block) {
                printf("Bad start/end\n");
index ac4a010..334598e 100644 (file)
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <div64.h>
 #include "yaffsfs.h"
 #include "yaffs_guts.h"
 #include "yaffscfg.h"
@@ -1603,8 +1604,8 @@ static int yaffsfs_DoStat(struct yaffs_obj *obj, struct yaffs_stat *buf)
                buf->st_rdev = obj->yst_rdev;
                buf->st_size = yaffs_get_obj_length(obj);
                buf->st_blksize = obj->my_dev->data_bytes_per_chunk;
-               buf->st_blocks = (buf->st_size + buf->st_blksize - 1) /
-                   buf->st_blksize;
+               buf->st_blocks = lldiv(buf->st_size + buf->st_blksize - 1,
+                   buf->st_blksize);
 #if CONFIG_YAFFS_WINCE
                buf->yst_wince_atime[0] = obj->win_atime[0];
                buf->yst_wince_atime[1] = obj->win_atime[1];
index 8ca67f6..d49c514 100644 (file)
@@ -698,6 +698,10 @@ ulong get_ddr_freq(ulong);
 #if defined(CONFIG_MPC85xx)
 typedef MPC85xx_SYS_INFO sys_info_t;
 void   get_sys_info  ( sys_info_t * );
+#  if defined(CONFIG_OF_LIBFDT)
+       void ft_fixup_cpu(void *, u64);
+       void ft_fixup_num_cores(void *);
+#  endif
 #endif
 #if defined(CONFIG_MPC86xx)
 typedef MPC86xx_SYS_INFO sys_info_t;
index 567b46c..ad08c1d 100644 (file)
@@ -14,6 +14,7 @@
 #define CONFIG_BOOTM_NETBSD 1
 #define CONFIG_BOOTM_PLAN9 1
 #define CONFIG_BOOTM_RTEMS 1
+#define CONFIG_BOOTM_VXWORKS 1
 
 #define CONFIG_GZIP 1
 #define CONFIG_ZLIB 1
index b2a5c19..3c6cd61 100644 (file)
@@ -737,7 +737,6 @@ unsigned long get_board_ddr_clk(void);
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 499d8c2..4aed5af 100644 (file)
@@ -382,7 +382,6 @@ extern unsigned long get_sdram_size(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define CONFIG_USB_EHCI
index a6601fe..f025e31 100644 (file)
@@ -625,7 +625,6 @@ combinations. this should be removed later
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 2d7fc59..71be122 100644 (file)
@@ -406,7 +406,6 @@ int du440_phy_addr(int devnum);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define CONFIG_SOURCE          1
index f366308..208b599 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
index 4284d6a..5738ea9 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
index 71e90d7..39eb2ef 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE  230400        /* kgdb serial port baud   */
-#define CONFIG_KGDB_SER_INDEX 2                     /* kgdb serial port        */
 #endif
 
 /*-----------------------------------------------------------------------
index 32ec0bf..6715435 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE  230400        /* kgdb serial port baud   */
-#define CONFIG_KGDB_SER_INDEX 2                     /* kgdb serial port        */
 #endif
 
 /*-----------------------------------------------------------------------
index f248a56..6042a1e 100644 (file)
  ************************************************************/
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /************************************************************
index 0f9f436..aedb529 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index a1e5f3b..c4c771b 100644 (file)
 
 #if (CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 71fc497..f5b6202 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index a80a696..7640d06 100644 (file)
@@ -67,6 +67,7 @@
  */
 #define CONFIG_SYS_FSL_DDR2
 #ifdef CONFIG_SYS_FSL_DDR2
+#define CONFIG_SYS_FSL_DDRC_GEN2
 #define CONFIG_SYS_SPD_BUS_NUM 0
 #define SPD_EEPROM_ADDRESS1    0x52
 #define SPD_EEPROM_ADDRESS2    0x51
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index e2ae596..ffb9a15 100644 (file)
@@ -730,7 +730,6 @@ boards, we say we have two, but don't display a message if we find only one. */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 
index ed780f1..d4c82cd 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index d31be19..01e7ac7 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 98ffb9c..f52e77a 100644 (file)
@@ -662,7 +662,6 @@ extern int board_pci_host_broken(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index ca28c0e..938f7ab 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 9ab1bc1..9b7cc64 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 046b14b..2d42b25 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 
index eca3b53..b9ad034 100644 (file)
@@ -410,7 +410,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 8132ec0..90fc2da 100644 (file)
@@ -441,7 +441,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 6acd54d..5fff1e2 100644 (file)
@@ -535,7 +535,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 5ffdd01..23c6b07 100644 (file)
@@ -408,7 +408,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index bb9ae2d..44b7679 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 
index 7406ac3..4f438a8 100644 (file)
@@ -430,7 +430,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index df5572b..d877e8b 100644 (file)
@@ -566,7 +566,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 63480ec..44d83a2 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 41ebe31..f930fcd 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 0e666ba..65d61c2 100644 (file)
@@ -670,7 +670,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #if defined(CONFIG_CMD_KGDB)
     #define CONFIG_KGDB_BAUDRATE       230400  /* speed to run kgdb serial port */
-    #define CONFIG_KGDB_SER_INDEX      2       /* which serial port to use */
 #endif
 
 /*
index eab386a..fe5309a 100644 (file)
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest works on */
+#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END         0x1fffffff
 #define CONFIG_PANIC_HANG              /* do not reset board on panic */
 
@@ -739,7 +739,6 @@ extern unsigned long get_sdram_size(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 262c3e5..ba43cce 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 2aa1f59..11c74ff 100644 (file)
@@ -469,7 +469,6 @@ extern unsigned long get_clock_freq(void);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index b592c19..85cb076 100644 (file)
@@ -606,7 +606,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 15d2a43..ce3c762 100644 (file)
@@ -432,7 +432,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 9d3d9b3..ada6c7b 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index b238574..ee71252 100644 (file)
@@ -677,7 +677,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 1180724..29888b4 100644 (file)
  ************************************************************/
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /************************************************************
index 5ab9315..efe6960 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /* pass open firmware flat tree */
index 43a5778..d0ebd6a 100644 (file)
@@ -682,7 +682,6 @@ unsigned long get_board_ddr_clk(void);
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 7931231..d721139 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index eff08e3..2c02d9d 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index ad09816..bff001f 100644 (file)
@@ -155,7 +155,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CHIP_SELECTS_PER_CTRL   (4 * CONFIG_DIMM_SLOTS_PER_CTLR)
 #define CONFIG_DDR_SPD
 #define CONFIG_SYS_FSL_DDR3
-#define CONFIG_FSL_DDR_INTERACTIVE
+#undef CONFIG_FSL_DDR_INTERACTIVE
 #define CONFIG_SYS_SPD_BUS_NUM 0
 #define CONFIG_SYS_SDRAM_SIZE  2048    /* for fixed parameter use */
 #define SPD_EEPROM_ADDRESS1    0x51
index fc25425..15cf2bd 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 79a6079..d40185e 100644 (file)
  * the MPL VCMA9 is equipped with an ATMEL 24C256 EEPROM at
  * address 0x50 with 16bit addressing
  */
-#define CONFIG_HARD_I2C                                /* I2C with hardware support */
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed */
-#define CONFIG_SYS_I2C_SLAVE           0x7F    /* I2C slave addr */
+#define CONFIG_SYS_I2C
 
 /* we use the built-in I2C controller */
-#define CONFIG_DRIVER_S3C24X0_I2C
+#define CONFIG_SYS_I2C_S3C24X0
+#define CONFIG_SYS_I2C_S3C24X0_SPEED    100000 /* I2C speed */
+#define CONFIG_SYS_I2C_S3C24X0_SLAVE    0x7F   /* I2C slave addr */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 #if defined(CONFIG_CMD_KGDB)
 /* speed to run kgdb serial port */
 #define CONFIG_KGDB_BAUDRATE           115200
-/* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX          2       /* which serial port to use */
 #endif
 
 /* Miscellaneous configurable options */
index 8fda1b1..00a24ab 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use     */
 #endif
 
 /*
index 6836fc7..8ed2fa2 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use     */
 #endif
 
 /*
index 1205557..d6cef88 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE           230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX          2       /* which serial port to use */
 #endif
 
 /*
index 3315f54..9b8bd78 100644 (file)
@@ -58,8 +58,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE          230400
-/* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX         1
 #endif
 
 /* Miscellaneous configurable options */
index fb391ec..f0cbff7 100644 (file)
@@ -51,8 +51,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE          230400
-/* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX         1
 #endif
 
 /* Miscellaneous configurable options */
index 61d96f5..7639107 100644 (file)
@@ -49,8 +49,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE          230400
-/* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX         1
 #endif
 
 /* Miscellaneous configurable options */
index 2387279..12bd98a 100644 (file)
@@ -56,8 +56,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE          230400
-/* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX         1
 #endif
 
 /* Miscellaneous configurable options */
index 5e71898..14bac15 100644 (file)
 /* Ethernet */
 #define CONFIG_MACB
 #define CONFIG_RESET_PHY_R
-
+#define CONFIG_AT91_WANTS_COMMON_PHY
 #define CONFIG_NET_RETRY_COUNT         20
 
 /* USB */
index 61fdeba..08bba36 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /* pass open firmware flat tree */
index d75df92..8af4d6a 100644 (file)
        "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
        "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \
        "nandrootfstype=ubifs rootwait=1\0" \
-       "nandsrcaddr=0x280000\0" \
-               "nandboot=echo Booting from nand ...; " \
+       "nandboot=echo Booting from nand ...; " \
                "run nandargs; " \
-               "nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; " \
-               "bootz ${loadaddr}\0" \
-       "nandimgsize=0x500000\0"
+               "nand read ${fdtaddr} u-boot-spl-os; " \
+               "nand read ${loadaddr} kernel; " \
+               "bootz ${loadaddr} - ${fdtaddr}\0"
 #else
 #define NANDARGS ""
 #endif
 #define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_YMODEM_SUPPORT
 
+/* Bootcount using the RTC block */
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_AM33XX
+
 /* CPSW support */
 #define CONFIG_SPL_ETH_SUPPORT
 
index a3473b5..1fa477a 100644 (file)
 #define CONFIG_SYS_OMAP24_I2C_SLAVE    1
 #define CONFIG_SYS_I2C_OMAP34XX
 
-#undef CONFIG_CMD_NET
-#undef CONFIG_CMD_NFS
+/*
+ * Ethernet
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_DRIVER_TI_EMAC_USE_RMII
+#define CONFIG_MII
+#define CONFIG_BOOTP_DEFAULT
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_NET_RETRY_COUNT         10
+
 /*
  * Board NAND Info.
  */
index c9e9a03..0f38c92 100644 (file)
  */
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port*/
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use     */
 #endif
 
 /*
index 32216cd..b8d955a 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE           230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX          2       /* which serial port to use */
 #endif
 
 /*
index 45fa047..a3cb56b 100644 (file)
 #define BL2_START_OFFSET       (CONFIG_BL2_OFFSET/512)
 #define BL2_SIZE_BLOC_COUNT    (CONFIG_BL2_SIZE/512)
 
-#define CONFIG_SPI_BOOTING
-#define EXYNOS_COPY_SPI_FNPTR_ADDR     0x02020058
-#define SPI_FLASH_UBOOT_POS            (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE)
-
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_PART
 
 /* I2C */
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_SPEED   100000          /* 100 Kbps */
-#define CONFIG_DRIVER_S3C24X0_I2C
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000          /* 100 Kbps */
+#define CONFIG_SYS_I2C_S3C24X0
 #define CONFIG_MAX_I2C_NUM     8
-#define CONFIG_SYS_I2C_SLAVE    0x0
+#define CONFIG_SYS_I2C_S3C24X0_SLAVE    0x0
 #define CONFIG_I2C_EDID
 
 /* PMIC */
index 1c4bb81..73917b0 100644 (file)
 #define CONFIG_RMII                    1
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_RESET_PHY_R             1
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* USB */
 #define CONFIG_USB_ATMEL
index 0a1969d..b9aa036 100644 (file)
 #define CONFIG_RMII                    1
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_RESET_PHY_R             1
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* USB */
 #define CONFIG_USB_ATMEL
index 2095fe6..ccfda71 100644 (file)
@@ -15,7 +15,6 @@
 
 #define CONFIG_SYS_TEXT_BASE           0x73f00000
 
-#define CONFIG_AT91_LEGACY
 #define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
 
 /* ARM asynchronous clock */
 /*
  * Command line configuration.
  */
+
+/* No NOR flash */
+#define CONFIG_SYS_NO_FLASH
+
 #include <config_cmd_default.h>
 #undef CONFIG_CMD_BDI
 #undef CONFIG_CMD_FPGA
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
 
-/* No NOR flash */
-#define CONFIG_SYS_NO_FLASH
-
 /* NAND flash */
 #ifdef CONFIG_CMD_NAND
 #define CONFIG_NAND_ATMEL
 #define CONFIG_RMII
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_RESET_PHY_R
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* USB */
 #define CONFIG_USB_EHCI
index 4ec1799..e23549d 100644 (file)
 #define CONFIG_SYS_NAND_BASE           0x40000000
 #define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
 #define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
-#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIO_PORTD, 4
-#define CONFIG_SYS_NAND_READY_PIN      AT91_PIO_PORTD, 5
+#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PD(4)
+#define CONFIG_SYS_NAND_READY_PIN      GPIO_PIN_PD(5)
 
 /* PMECC & PMERRLOC */
 #define CONFIG_ATMEL_NAND_HWECC
index 12df45b..8b2a6cf 100644 (file)
@@ -61,7 +61,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define        CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index 77b6735..eed2d5b 100644 (file)
@@ -56,6 +56,7 @@
 /*
  * Flash Settings
  */
+
 #define CONFIG_FLASH_CFI_DRIVER
 #define CONFIG_SYS_FLASH_BASE          0x20000000
 #define CONFIG_SYS_FLASH_CFI
@@ -63,7 +64,9 @@
 #define CONFIG_SYS_MAX_FLASH_SECT      71
 #define CONFIG_CMD_FLASH
 #define CONFIG_MONITOR_IS_IN_RAM
-
+/*
+#define CONFIG_SYS_NO_FLASH
+*/
 
 /*
  * SPI Settings
 #define CONFIG_BFIN_SPI
 #define CONFIG_ENV_SPI_MAX_HZ  30000000
 #define CONFIG_SF_DEFAULT_SPEED        30000000
+/*
 #define CONFIG_SPI_FLASH
 #define CONFIG_SPI_FLASH_STMICRO
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_SPI
-
+*/
 
 /*
  * Env Storage Settings
@@ -94,6 +98,7 @@
 #define CONFIG_DCACHE_OFF
 #define CONFIG_UART_CONSOLE    0
 #define CONFIG_BAUDRATE 115200
+#define CONFIG_BFIN_SERIAL
 
 #define CONFIG_CMD_MEMORY
 #undef CONFIG_GZIP
index 1f65130..008f4b5 100644 (file)
@@ -85,6 +85,7 @@
 #define CONFIG_UART_CONSOLE    0
 
 #define CONFIG_BAUDRATE                115200
+#define CONFIG_BFIN_SERIAL
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock0 rw"
 #define CONFIG_BOOTCOMMAND     "run sfboot"
 #define CONFIG_BOOTDELAY       5
index a22c868..f5b9658 100644 (file)
 /*
  * Software (bit-bang) I2C driver configuration
  */
-#define PF_SCL                 PF3
-#define PF_SDA                 PF2
-#define I2C_INIT               (*pFIO_DIR |=  PF_SCL); asm("ssync;")
-#define I2C_ACTIVE             (*pFIO_DIR |=  PF_SDA); \
-                               *pFIO_INEN &= ~PF_SDA; asm("ssync;")
-#define I2C_TRISTATE           (*pFIO_DIR &= ~PF_SDA); \
-                               *pFIO_INEN |= PF_SDA; asm("ssync;")
-#define I2C_READ               ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); \
-                               asm("ssync;")
-#define I2C_SDA(bit)   if (bit) { \
-                               *pFIO_FLAG_S = PF_SDA; \
-                               asm("ssync;"); \
-                               } \
-                       else    { \
-                               *pFIO_FLAG_C = PF_SDA; \
-                               asm("ssync;"); \
-                               }
-#define I2C_SCL(bit)   if (bit) { \
-                               *pFIO_FLAG_S = PF_SCL; \
-                               asm("ssync;"); \
-                               } \
-                       else    { \
-                               *pFIO_FLAG_C = PF_SCL; \
-                               asm("ssync;"); \
-                               }
-#define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
-
+#define CONFIG_SOFT_I2C_GPIO_SCL       GPIO_PF3
+#define CONFIG_SOFT_I2C_GPIO_SDA       GPIO_PF2
 
 /*
  * Flash Settings
index feb9d73..156eeab 100644 (file)
 
 #define CONFIG_BAUDRATE                57600
 #define CONFIG_UART_CONSOLE    0
+#define CONFIG_BFIN_SERIAL
 
 #define CONFIG_PANIC_HANG      1
 #define CONFIG_RTC_BFIN                1
index 1de8ffe..e12d761 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 #define CONFIG_UART_CONSOLE    0
+#define CONFIG_BFIN_SERIAL
 
 #define CONFIG_PANIC_HANG      1
 #define CONFIG_RTC_BFIN                1
index ee585c0..15ca1af 100644 (file)
@@ -53,7 +53,7 @@
 #define CONFIG_EBIU_AMBCTL0_VAL                0xffc2ffc2
 #define CONFIG_EBIU_AMBCTL1_VAL                0x99b35554
 
-#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
+#define CONFIG_SYS_MONITOR_LEN         (384 * 1024)
 #define CONFIG_SYS_MALLOC_LEN          (128 * 1024)
 
 
index 404039a..fb6f948 100644 (file)
@@ -90,6 +90,7 @@
  */
 #define CONFIG_SYS_I2C_SOFT
 #ifdef CONFIG_SYS_I2C_SOFT
+#define CONFIG_SYS_I2C
 #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF0
 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF1
 #define I2C_DELAY              udelay(5)       /* 1/4 I2C clock duration */
index 5b3aac7..7de4253 100644 (file)
 #define CONFIG_BAUDRATE                57600
 #define CONFIG_LOADS_ECHO      1
 #define CONFIG_UART_CONSOLE    0
+#define CONFIG_BFIN_SERIAL
 
 /*
  * I2C settings
index cd37f9a..6e5774c 100644 (file)
 #define CONFIG_BAUDRATE                57600
 #define CONFIG_LOADS_ECHO      1
 #define CONFIG_UART_CONSOLE    0
+#define CONFIG_BFIN_SERIAL
 
 /*
  * U-Boot environment variables. Use "printenv" to examine.
index 8f10eba..2838012 100644 (file)
@@ -55,7 +55,7 @@
 #define CONFIG_EBIU_AMBCTL0_VAL        (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3)
 #define CONFIG_EBIU_AMBCTL1_VAL        (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3)
 
-#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
 #define CONFIG_SYS_MALLOC_LEN  (128 * 1024)
 
 
 #define FLASHBOOT_ENV_SETTINGS \
        "flashboot=flread 20040000 1000000 3c0000;" \
        "bootm 0x1000000\0"
-
+#define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
 
 /*
  * Pull in common ADI header for remaining command/environment setup
index a1c8e8a..da4cc67 100644 (file)
@@ -54,7 +54,7 @@
 #define CONFIG_EBIU_AMBCTL0_VAL        (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3)
 #define CONFIG_EBIU_AMBCTL1_VAL        (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3)
 
-#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
 #define CONFIG_SYS_MALLOC_LEN  (128 * 1024)
 
 
 #define FLASHBOOT_ENV_SETTINGS \
        "flashboot=flread 20040000 1000000 300000;" \
        "bootm 0x1000000\0"
+#define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
 
 
 /*
index 3c9eeb5..7f27eda 100644 (file)
 #define CONFIG_BOOTCOMMAND     "run flashboot"
 #define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20040000\0"
 
+#define CONFIG_ADI_GPIO2
+
 #ifndef __ADSPBF542__
 /* Don't waste time transferring a logo over the UART */
 # if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART)
diff --git a/include/configs/cm_t335.h b/include/configs/cm_t335.h
new file mode 100644 (file)
index 0000000..56e9a8e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Config file for Compulab CM-T335 board
+ *
+ * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Ilya Ledvich <ilya@compulab.co.il>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_CM_T335_H
+#define __CONFIG_CM_T335_H
+
+#define CONFIG_CM_T335
+#define CONFIG_NAND
+
+#include <configs/ti_am335x_common.h>
+
+#undef CONFIG_BOARD_LATE_INIT
+#undef CONFIG_SPI
+#undef CONFIG_OMAP3_SPI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_SPL_OS_BOOT
+#undef CONFIG_BOOTCOUNT_LIMIT
+#undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
+
+#undef CONFIG_MAX_RAM_BANK_SIZE
+#define CONFIG_MAX_RAM_BANK_SIZE       (512 << 20)     /* 512MB */
+
+#undef CONFIG_SYS_PROMPT
+#define CONFIG_SYS_PROMPT              "CM-T335 # "
+
+#define CONFIG_OMAP_COMMON
+
+#define MACH_TYPE_CM_T335              4586    /* Until the next sync */
+#define CONFIG_MACH_TYPE               MACH_TYPE_CM_T335
+
+/* Clock Defines */
+#define V_OSCK                         25000000  /* Clock output from T2 */
+#define V_SCLK                         (V_OSCK)
+
+#define CONFIG_ENV_SIZE                        (16 << 10)      /* 16 KiB */
+
+#ifndef CONFIG_SPL_BUILD
+#define MMCARGS \
+       "mmcdev=0\0" \
+       "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
+       "mmcrootfstype=ext4\0" \
+       "mmcargs=setenv bootargs console=${console} " \
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype}\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0"
+
+#define NANDARGS \
+       "mtdids=" MTDIDS_DEFAULT "\0" \
+       "mtdparts=" MTDPARTS_DEFAULT "\0" \
+       "nandroot=ubi0:rootfs rw\0" \
+       "nandrootfstype=ubifs\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype} " \
+               "ubi.mtd=${rootfs_name}\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nboot ${loadaddr} nand0 900000; " \
+               "bootm ${loadaddr}\0"
+
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=82000000\0" \
+       "console=ttyO0,115200n8\0" \
+       "rootfs_name=rootfs\0" \
+       "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       MMCARGS \
+       NANDARGS
+
+#define CONFIG_BOOTCOMMAND \
+       "mmc dev ${mmcdev}; if mmc rescan; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+                               "run mmcboot; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
+#endif /* CONFIG_SPL_BUILD */
+
+#define CONFIG_TIMESTAMP
+#define CONFIG_SYS_AUTOLOAD            "no"
+
+/* Serial console configuration */
+#define CONFIG_CONS_INDEX              1
+#define CONFIG_SERIAL1                 1       /* UART0 */
+
+/* NS16550 Configuration */
+#define CONFIG_SYS_NS16550_COM1                0x44e09000      /* UART0 */
+#define CONFIG_SYS_NS16550_COM2                0x48022000      /* UART1 */
+#define CONFIG_BAUDRATE                        115200
+
+/* I2C Configuration */
+#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* Main EEPROM */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/* SPL */
+#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+
+/* Network. */
+#define CONFIG_PHY_GIGE
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_ADDR                        0
+#define CONFIG_PHY_ATHEROS
+
+/* NAND support */
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
+                                        CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_PAGE_SIZE      2048
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_BLOCK_SIZE     (128 * 1024)
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS         { 2, 3, 4, 5, 6, 7, 8, 9, \
+                                        10, 11, 12, 13, 14, 15, 16, 17, \
+                                        18, 19, 20, 21, 22, 23, 24, 25, \
+                                        26, 27, 28, 29, 30, 31, 32, 33, \
+                                        34, 35, 36, 37, 38, 39, 40, 41, \
+                                        42, 43, 44, 45, 46, 47, 48, 49, \
+                                        50, 51, 52, 53, 54, 55, 56, 57, }
+
+#define CONFIG_SYS_NAND_ECCSIZE                512
+#define CONFIG_SYS_NAND_ECCBYTES       14
+
+#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_TEXT_BASE
+
+#undef CONFIG_SYS_NAND_U_BOOT_OFFS
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x200000
+
+#define CONFIG_CMD_NAND
+#define GPMC_NAND_ECC_LP_x8_LAYOUT
+#define MTDIDS_DEFAULT                 "nand0=nand"
+#define MTDPARTS_DEFAULT               "mtdparts=nand:2m(spl)," \
+                                       "1m(u-boot),1m(u-boot-env)," \
+                                       "1m(dtb),4m(splash)," \
+                                       "6m(kernel),-(rootfs)"
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET              0x300000 /* environment starts here */
+#define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+
+/* GPIO pin + bank to pin ID mapping */
+#define GPIO_PIN(_bank, _pin)          ((_bank << 5) + _pin)
+
+/* Status LED */
+#define CONFIG_STATUS_LED
+#define CONFIG_GPIO_LED
+#define CONFIG_BOARD_SPECIFIC_LED
+#define STATUS_LED_BIT                 GPIO_PIN(2, 0)
+/* Status LED polarity is inversed, so init it in the "off" state */
+#define STATUS_LED_STATE               STATUS_LED_OFF
+#define STATUS_LED_PERIOD              (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT                        0
+
+#ifndef CONFIG_SPL_BUILD
+/*
+ * Enable PCA9555 at I2C0-0x26.
+ * First select the I2C0 bus with "i2c dev 0", then use "pca953x" command.
+ */
+#define CONFIG_PCA953X
+#define CONFIG_CMD_PCA953X
+#define CONFIG_CMD_PCA953X_INFO
+#define CONFIG_SYS_I2C_PCA953X_ADDR    0x26
+#define CONFIG_SYS_I2C_PCA953X_WIDTH   { {0x26, 16} }
+#endif /* CONFIG_SPL_BUILD */
+
+#endif /* __CONFIG_CM_T335_H */
+
index f4ecd0d..e72187e 100644 (file)
 /* Status LED */
 #define CONFIG_STATUS_LED              /* Status LED enabled */
 #define CONFIG_BOARD_SPECIFIC_LED
-#define STATUS_LED_GREEN               0
-#define STATUS_LED_BIT                 STATUS_LED_GREEN
+#define CONFIG_GPIO_LED
+#define GREEN_LED_GPIO                 186 /* CM-T35 Green LED is GPIO186 */
+#define GREEN_LED_DEV                  0
+#define STATUS_LED_BIT                 GREEN_LED_GPIO
 #define STATUS_LED_STATE               STATUS_LED_ON
 #define STATUS_LED_PERIOD              (CONFIG_SYS_HZ / 2)
-#define STATUS_LED_BOOT                        STATUS_LED_BIT
-#define GREEN_LED_GPIO                 186 /* CM-T35 Green LED is GPIO186 */
+#define STATUS_LED_BOOT                        GREEN_LED_DEV
 
 #define CONFIG_SPLASHIMAGE_GUARD
 
index 556b42a..d1d732f 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE                   115200
-#define CONFIG_KGDB_SER_INDEX                  2
 #endif
 
 /*
index 665295c..969b990 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
diff --git a/include/configs/corvus.h b/include/configs/corvus.h
new file mode 100644 (file)
index 0000000..11ba4cf
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Common board functions for siemens AT91SAM9G45 based boards
+ * (C) Copyright 2013 Siemens AG
+ *
+ * Based on:
+ * U-Boot file: include/configs/at91sam9m10g45ek.h
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/hardware.h>
+
+#define MACH_TYPE_CORVUS               2066
+
+/*
+ * Warning: changing CONFIG_SYS_TEXT_BASE requires
+ * adapting the initial boot program.
+ * Since the linker has to swallow that define, we must use a pure
+ * hex number here!
+ */
+
+#define CONFIG_SYS_TEXT_BASE  0x73f00000
+
+#define CONFIG_AT91_LEGACY
+#define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
+
+/* ARM asynchronous clock */
+#define CONFIG_SYS_AT91_SLOW_CLOCK      32768
+#define CONFIG_SYS_AT91_MAIN_CLOCK      12000000 /* from 12 MHz crystal */
+#define CONFIG_SYS_HZ                  1000
+
+#define CONFIG_AT91FAMILY
+
+#define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs      */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_DISPLAY_CPUINFO
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_OF_LIBFDT
+
+/* general purpose I/O */
+#define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
+#define CONFIG_AT91_GPIO
+#define CONFIG_AT91_GPIO_PULLUP        1       /* keep pullups on peripheral pins */
+
+/* serial console */
+#define CONFIG_ATMEL_USART
+#define CONFIG_USART_BASE              ATMEL_BASE_DBGU
+#define CONFIG_USART_ID                        ATMEL_ID_SYS
+
+/* LED */
+#define CONFIG_AT91_LED
+#define CONFIG_RED_LED         AT91_PIN_PD31   /* this is the user1 led */
+#define CONFIG_GREEN_LED       AT91_PIN_PD0    /* this is the user2 led */
+
+#define CONFIG_BOOTDELAY       3
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_LOADS
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_USB
+
+/* SDRAM */
+#define CONFIG_NR_DRAM_BANKS           1
+#define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_CS6
+#define CONFIG_SYS_SDRAM_SIZE          0x08000000
+
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
+
+/* No NOR flash */
+#define CONFIG_SYS_NO_FLASH
+
+/* NAND flash */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_NAND_ATMEL
+#define CONFIG_SYS_MAX_NAND_DEVICE             1
+#define CONFIG_SYS_NAND_BASE                   ATMEL_BASE_CS3
+#define CONFIG_SYS_NAND_DBW_8
+/* our ALE is AD21 */
+#define CONFIG_SYS_NAND_MASK_ALE               (1 << 21)
+/* our CLE is AD22 */
+#define CONFIG_SYS_NAND_MASK_CLE               (1 << 22)
+#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIN_PC14
+#define CONFIG_SYS_NAND_READY_PIN              AT91_PIN_PC8
+
+#endif
+
+/* Ethernet */
+#define CONFIG_MACB
+#define CONFIG_RMII
+#define CONFIG_NET_RETRY_COUNT         20
+#define CONFIG_AT91_WANTS_COMMON_PHY
+
+/* USB */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_ATMEL
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS     2
+#define CONFIG_DOS_PARTITION
+#define CONFIG_USB_STORAGE
+
+#define CONFIG_SYS_LOAD_ADDR           0x72000000      /* load address */
+
+/* bootstrap + u-boot + env in nandflash */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET              0x100000
+#define CONFIG_ENV_OFFSET_REDUND       0x180000
+#define CONFIG_ENV_SIZE                        0x20000
+
+#define CONFIG_BOOTCOMMAND                                             \
+       "nand read 0x70000000 0x200000 0x300000;"                       \
+       "bootm 0x70000000"
+#define CONFIG_BOOTARGS                                                        \
+       "console=ttyS0,115200 earlyprintk "                             \
+       "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"          \
+       "256k(env),256k(env_redundant),256k(spare),"                    \
+       "512k(dtb),6M(kernel)ro,-(rootfs) "                             \
+       "root=/dev/mtdblock7 rw rootfstype=jffs2"
+
+#define CONFIG_BAUDRATE                        115200
+
+#define CONFIG_SYS_PROMPT              "U-Boot> "
+#define CONFIG_SYS_CBSIZE              256
+#define CONFIG_SYS_MAXARGS             16
+#define CONFIG_SYS_PBSIZE      (CONFIG_SYS_CBSIZE +    \
+                                sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN  ROUND(3 * CONFIG_ENV_SIZE + \
+                               128*1024, 0x1000)
+
+#endif
index ccf36a5..39f7062 100644 (file)
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
-#define CONFIG_SYS_NAND_READY_PIN              AT91_PIO_PORTC, 13
-#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIO_PORTC, 14
+#define CONFIG_SYS_NAND_READY_PIN              GPIO_PIN_PC(13)
+#define CONFIG_SYS_NAND_ENABLE_PIN             GPIO_PIN_PC(14)
 #define CONFIG_SYS_NAND_MASK_ALE               (1 << 21)
 #define CONFIG_SYS_NAND_MASK_CLE               (1 << 22)
 
 #define CONFIG_RMII
 #define CONFIG_NET_RETRY_COUNT                 20
 #define CONFIG_MACB_SEARCH_PHY
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* LEDS */
 /* Status LED */
index ca0bffa..8a848be 100644 (file)
@@ -99,7 +99,6 @@
  */
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 596095d..5c03417 100644 (file)
@@ -98,7 +98,6 @@
  */
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index d0e72e3..4f2c742 100644 (file)
 #define CONFIG_DNP5370_EXT_WD_DISABLE 1
 
 #define CONFIG_UART_CONSOLE 0
+#define CONFIG_BFIN_SERIAL
 #define CONFIG_BAUDRATE     115200
 #define CONFIG_BOOTCOMMAND  "bootm 0x20030000"
 #define CONFIG_BOOTARGS     "console=ttyBF0,115200 root=/dev/mtdblock3 rootfstype=ext2"
index 8a69c7d..48b47cb 100644 (file)
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB2PHY2_HOST
 
+/* SATA */
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_CMD_SCSI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
+#define CONFIG_SYS_SCSI_MAX_LUN                1
+#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+                                               CONFIG_SYS_SCSI_MAX_LUN)
+
 #endif /* __CONFIG_DRA7XX_EVM_H */
index 87b3314..1af7f16 100644 (file)
@@ -57,8 +57,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 # define CONFIG_KGDB_BAUDRATE          230400
-/* which serial port to use */
-# define CONFIG_KGDB_SER_INDEX         1
 #endif
 
 /* Miscellaneous configurable options */
index cd553ec..1e42f5c 100644 (file)
@@ -21,8 +21,8 @@
 
 #define CONFIG_SYS_MPUCLK      275
 #define DXR2_IOCTRL_VAL        0x18b
-#define DDR_PLL_FREQ   266
-#define CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K
+#define DDR_PLL_FREQ   303
+#undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
 
 #define BOARD_DFU_BUTTON_GPIO  27
 #define BOARD_DFU_BUTTON_LED   64
@@ -62,7 +62,7 @@
 /* Default env settings */
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "hostname=dxr2\0" \
-       "nand_img_size=0x300000\0" \
+       "nand_img_size=0x400000\0" \
        "optargs=\0" \
        CONFIG_COMMON_ENV_SETTINGS
 
        "run dfu_start; " \
        "reset; " \
 "fi;" \
-"if ping ${serverip}; then " \
-       "run net_nfs; " \
-"fi;" \
-"run nand_boot;"
+"run nand_boot;" \
+"reset;"
+
 
 #else
 #define CONFIG_BOOTDELAY               0
index 2d8c42c..f7e70aa 100644 (file)
 #define CONFIG_SYS_LOAD_ADDR           0x21000000  /* default load address */
 #define CONFIG_STANDALONE_LOAD_ADDR    0x21000000
 
-#define CONFIG_SYS_BOOT_SIZE           0x00 /* 0 KBytes */
-#define CONFIG_SYS_U_BOOT_BASE         PHYS_FLASH_1
-#define CONFIG_SYS_U_BOOT_SIZE         0x60000 /* 384 KBytes */
-
 #define CONFIG_BOOT_RETRY_TIME         30
 #define CONFIG_CMDLINE_EDITING
 
index 252df54..480d867 100644 (file)
 #define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
 /* our CLE is AD22 */
 #define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
-#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIO_PORTC, 14
+#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PC(14)
 #endif
 
 /* JFFS2 */
index bdefee1..8fb904c 100644 (file)
 #define COPY_BL2_FNPTR_ADDR    0x02020030
 
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
 
 /* specific .lds file */
 #define CONFIG_SPL_LDSCRIPT    "board/samsung/common/exynos-uboot-spl.lds"
 
 /* I2C */
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_SPEED   100000          /* 100 Kbps */
-#define CONFIG_DRIVER_S3C24X0_I2C
+#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000          /* 100 Kbps */
+#define CONFIG_SYS_I2C_S3C24X0
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_MAX_I2C_NUM     8
-#define CONFIG_SYS_I2C_SLAVE    0x0
+#define CONFIG_SYS_I2C_S3C24X0_SLAVE    0x0
 #define CONFIG_I2C_EDID
 
 /* PMIC */
 /* SPI */
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_SPI_FLASH
+#define CONFIG_ENV_SPI_BASE    0x12D30000
 
 #ifdef CONFIG_SPI_FLASH
 #define CONFIG_EXYNOS_SPI
 #define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
 #define CONFIG_SF_DEFAULT_SPEED                50000000
 #define EXYNOS5_SPI_NUM_CONTROLLERS    5
+#define CONFIG_OF_SPI
 #endif
 
 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_POWER_I2C
 #define CONFIG_POWER_MAX77686
 
-/* SPI */
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_SPI_FLASH
-
-#ifdef CONFIG_SPI_FLASH
-#define CONFIG_EXYNOS_SPI
-#define CONFIG_CMD_SF
-#define CONFIG_CMD_SPI
-#define CONFIG_SPI_FLASH_WINBOND
-#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
-#define CONFIG_SF_DEFAULT_SPEED                50000000
-#define EXYNOS5_SPI_NUM_CONTROLLERS    5
-#endif
-
-#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_SPI_MODE    SPI_MODE_0
-#define CONFIG_ENV_SECT_SIZE   CONFIG_ENV_SIZE
-#define CONFIG_ENV_SPI_BUS     1
-#define CONFIG_ENV_SPI_MAX_HZ  50000000
-#endif
-
 /* Ethernet Controllor Driver */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_SMC911X
diff --git a/include/configs/h2_p2_dbg_board.h b/include/configs/h2_p2_dbg_board.h
deleted file mode 100644 (file)
index 4ba2c55..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *   TI H2 and P2 Debug Board hardware map
- *
- * Copyright (C) 2004 MPC-Data Limited. (http://www.mpc-data.co.uk)
- * Author: MPC-Data Limited
- *        Dave Peverley
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __INCLUDED_H2_P2_DBH_BOARD_H
-#define __INCLUDED_H2_P2_DBH_BOARD_H
-
-#include <asm/sizes.h>
-
-/*
- * The Debug board is designed to function with the P2 Sample, H2
- * Sample and 1610 Innovator boards. The main difference AFAICT is
- * the chip selects used with each system ;
- *
- *   P2 Sample : CS1 of OMAP730 is used to select the CPLD & LAN regs
- *   H2 Sample : CS1a is used to select the CPLD registers.
- *
- */
-
-/***************************************************************************
- * CPLD Registers
- **************************************************************************/
-
-#define H2DBG_CPLD_REVISION        0x04000010
-#define H2DBG_BOARD_REVISION       0x04000012
-#define H2DBG_GPIO_REGISTER        0x04000014
-#define H2DBG_LED_CONTROL          0x04000016
-#define H2DBG_MISC_INPUT           0x04000018
-#define H2DBG_LAN_STATUS           0x0400001A
-#define H2DBG_LAN_RESET            0x0400001C
-#define H2DBG_ETH_REG_BASE         0x04000300
-
-/***************************************************************************
- * Ethernet Control Registers
- * These are for the LAN91C96 on the debug board
- **************************************************************************/
-
-/* Bank 0 in IO space */
-
-#define ETH_TCR            (H2DBG_ETH_REG_BASE + 0x00)   /* Transmit Control Register */
-#define ETH_EPH_STATUS     (H2DBG_ETH_REG_BASE + 0x02)   /* EPH Status Register */
-#define ETH_RCR            (H2DBG_ETH_REG_BASE + 0x04)   /* Receive Control Register */
-#define ETH_COUNTER        (H2DBG_ETH_REG_BASE + 0x06)   /* Counter Register */
-#define ETH_MIR            (H2DBG_ETH_REG_BASE + 0x08)   /* Memory Information Register */
-#define ETH_MCR            (H2DBG_ETH_REG_BASE + 0x0A)   /* Memory Configuration Register */
-
-/* Bank 1 in IO space */
-
-#define ETH_CONFIG         (H2DBG_ETH_REG_BASE + 0x00)   /* Configuration Register */
-#define ETH_BASE           (H2DBG_ETH_REG_BASE + 0x02)   /* Base Address Register */
-#define ETH_IA0            (H2DBG_ETH_REG_BASE + 0x04)   /* Individual Address Register - 0 */
-#define ETH_IA1            (H2DBG_ETH_REG_BASE + 0x05)   /* Individual Address Register - 1 */
-#define ETH_IA2            (H2DBG_ETH_REG_BASE + 0x06)   /* Individual Address Register - 2 */
-#define ETH_IA3            (H2DBG_ETH_REG_BASE + 0x07)   /* Individual Address Register - 3 */
-#define ETH_IA4            (H2DBG_ETH_REG_BASE + 0x08)   /* Individual Address Register - 4 */
-#define ETH_IA5            (H2DBG_ETH_REG_BASE + 0x09)   /* Individual Address Register - 5 */
-#define ETH_GEN_PURPOSE    (H2DBG_ETH_REG_BASE + 0x0A)   /* General Address Registers */
-#define ETH_CONTROL        (H2DBG_ETH_REG_BASE + 0x0B)   /* Control Register */
-
-/* Bank 2 in IO space */
-
-#define ETH_MMU            (H2DBG_ETH_REG_BASE + 0x00)   /* MMU Command Register */
-#define ETH_AUTO_TX_START  (H2DBG_ETH_REG_BASE + 0x01)   /* Auto Tx Start Register */
-#define ETH_PNR            (H2DBG_ETH_REG_BASE + 0x02)   /* Packet Number Register */
-#define ETH_ARR            (H2DBG_ETH_REG_BASE + 0x03)   /* Allocation Result Register */
-#define ETH_FIFO           (H2DBG_ETH_REG_BASE + 0x04)   /* FIFO Ports Register */
-#define ETH_POINTER        (H2DBG_ETH_REG_BASE + 0x06)   /* Pointer Register */
-#define ETH_DATA_HIGH      (H2DBG_ETH_REG_BASE + 0x08)   /* Data High Register */
-#define ETH_DATA_LOW       (H2DBG_ETH_REG_BASE + 0x0A)   /* Data Low Register */
-#define ETH_INT_STATS      (H2DBG_ETH_REG_BASE + 0x0C)   /* Interrupt Status Register - RO */
-#define ETH_INT_ACK        (H2DBG_ETH_REG_BASE + 0x0C)   /* Interrupt Acknowledge Register -WO */
-#define ETH_INT_MASK       (H2DBG_ETH_REG_BASE + 0x0D)   /* Interrupt Mask Register */
-
-
-#ifndef __ASSEMBLY__
-
-/*
- * A couple of utility inlines to aid debugging using the LED's on the
- * debug board.
- */
-
-static inline void set_led_state(int state)
-{
-       static unsigned long hw_led_state = 0;
-       volatile unsigned short *led_address = (volatile unsigned short *)0x04000016;
-
-       hw_led_state = ((unsigned long)state);
-       *((unsigned short *) (led_address)) = (unsigned short) (~hw_led_state & 0xFFFF);
-}
-
-
-static inline void spin_up_leds(void)
-{
-       volatile int i, j, k;
-
-       for (k = 0; k < 2; k++) {
-               for (i = 0; i < 16; i++) {
-                       for (j = 0; j < 5000; j++) {
-                               set_led_state(1 << i);
-                       }
-               }
-               for (i = 15; i >= 0; i--) {
-                       for (j = 0; j < 5000; j++) {
-                               set_led_state(1 << i);
-                       }
-               }
-       }
-}
-
-#endif    /* !  __ASSEMBLY__ */
-
-#endif    /* !  __INCLUDED_H2_P2_DBH_BOARD_H */
index 7700b38..50330cc 100644 (file)
@@ -385,7 +385,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define __USB_PHY_TYPE utmi
diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h
new file mode 100644 (file)
index 0000000..59c4948
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * include/configs/koelsch.h
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __KOELSCH_H
+#define __KOELSCH_H
+
+#undef DEBUG
+#define CONFIG_ARMV7
+#define CONFIG_R8A7791
+#define CONFIG_RMOBILE
+#define CONFIG_RMOBILE_BOARD_STRING "Koelsch"
+#define CONFIG_SH_GPIO_PFC
+
+#include <asm/arch/rmobile.h>
+
+#define        CONFIG_CMD_EDITENV
+#define        CONFIG_CMD_SAVEENV
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_DFL
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_BOOTZ
+#define        CONFIG_CMD_FLASH
+
+#define        CONFIG_CMDLINE_TAG
+#define        CONFIG_SETUP_MEMORY_TAGS
+#define        CONFIG_INITRD_TAG
+#define        CONFIG_CMDLINE_EDITING
+
+#define CONFIG_OF_LIBFDT
+#define BOARD_LATE_INIT
+
+#define CONFIG_BAUDRATE                38400
+#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTARGS                ""
+
+#define CONFIG_VERSION_VARIABLE
+#undef CONFIG_SHOW_BOOT_PROGRESS
+
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_USE_ARCH_MEMSET
+#define CONFIG_USE_ARCH_MEMCPY
+#define CONFIG_TMU_TIMER
+
+/* STACK */
+#define CONFIG_SYS_INIT_SP_ADDR                0xE633fffc
+#define STACK_AREA_SIZE                                0xC000
+#define LOW_LEVEL_MERAM_STACK  \
+               (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
+
+/* MEMORY */
+#define KOELSCH_SDRAM_BASE     0x40000000
+#define KOELSCH_SDRAM_SIZE     (2048u * 1024 * 1024)
+#define KOELSCH_UBOOT_SDRAM_SIZE       (512 * 1024 * 1024)
+
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_CBSIZE              256
+#define CONFIG_SYS_PBSIZE              256
+#define CONFIG_SYS_MAXARGS             16
+#define CONFIG_SYS_BARGSIZE            512
+#define CONFIG_SYS_BAUDRATE_TABLE      { 38400, 115200 }
+
+/* SCIF */
+#define CONFIG_SCIF_CONSOLE
+#define CONFIG_CONS_SCIF0
+#define SCIF0_BASE             0xe6e60000
+#undef CONFIG_SYS_CONSOLE_INFO_QUIET
+#undef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
+#undef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
+
+#define CONFIG_SYS_MEMTEST_START       (KOELSCH_SDRAM_BASE)
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
+                                        504 * 1024 * 1024)
+#undef CONFIG_SYS_ALT_MEMTEST
+#undef CONFIG_SYS_MEMTEST_SCRATCH
+#undef CONFIG_SYS_LOADS_BAUD_CHANGE
+
+#define CONFIG_SYS_SDRAM_BASE          (KOELSCH_SDRAM_BASE)
+#define CONFIG_SYS_SDRAM_SIZE          (KOELSCH_UBOOT_SDRAM_SIZE)
+#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x7fc0)
+#define CONFIG_NR_DRAM_BANKS           1
+
+#define CONFIG_SYS_MONITOR_BASE                0x00000000
+#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (1 * 1024 * 1024)
+#define CONFIG_SYS_GBL_DATA_SIZE       (256)
+#define CONFIG_SYS_BOOTMAPSZ           (8 * 1024 * 1024)
+
+/* FLASH */
+#define CONFIG_SYS_TEXT_BASE   0x00000000
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
+#define        CONFIG_FLASH_CFI_DRIVER
+#define        CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
+#define        CONFIG_FLASH_SHOW_PROGRESS      45
+#define CONFIG_SYS_FLASH_BASE          0x00000000
+#define        CONFIG_SYS_FLASH_SIZE           0x04000000      /* 64 MB */
+#define CONFIG_SYS_MAX_FLASH_SECT      1024
+#define CONFIG_SYS_MAX_FLASH_BANKS     1
+#define CONFIG_SYS_FLASH_BANKS_LIST    { (CONFIG_SYS_FLASH_BASE) }
+#define        CONFIG_SYS_FLASH_BANKS_SIZES    { (CONFIG_SYS_FLASH_SIZE) }
+#define CONFIG_SYS_FLASH_ERASE_TOUT    3000
+#define CONFIG_SYS_FLASH_WRITE_TOUT    3000
+#define CONFIG_SYS_FLASH_LOCK_TOUT     3000
+#define CONFIG_SYS_FLASH_UNLOCK_TOUT   3000
+
+/* ENV setting */
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_OVERWRITE   1
+#define CONFIG_ENV_SECT_SIZE   (256 * 1024)
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + \
+                                CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_ENV_OFFSET      (CONFIG_ENV_ADDR)
+#define CONFIG_ENV_SIZE                (CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
+
+/* Board Clock */
+#define        CONFIG_SYS_CLK_FREQ     10000000
+#define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ
+#define CONFIG_SH_SCIF_CLK_FREQ        14745600
+#define CONFIG_SYS_TMU_CLK_DIV 4
+#define CONFIG_SYS_HZ          1000
+
+#endif /* __KOELSCH_H */
index b09af19..811ff99 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400 /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use     */
 #endif
 
 /* Pass open firmware flat tree */
diff --git a/include/configs/lager.h b/include/configs/lager.h
new file mode 100644 (file)
index 0000000..7819edd
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * include/configs/lager.h
+ *     This file is lager board configuration.
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __LAGER_H
+#define __LAGER_H
+
+#undef DEBUG
+#define CONFIG_ARMV7
+#define CONFIG_R8A7790
+#define CONFIG_RMOBILE
+#define CONFIG_RMOBILE_BOARD_STRING "Lager"
+#define CONFIG_SH_GPIO_PFC
+#define MACH_TYPE_LAGER                4538
+#define CONFIG_MACH_TYPE       MACH_TYPE_LAGER
+
+#include <asm/arch/rmobile.h>
+
+#define        CONFIG_CMD_EDITENV
+#define        CONFIG_CMD_SAVEENV
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_DFL
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_BOOTZ
+#define        CONFIG_CMD_FLASH
+
+#define        CONFIG_CMDLINE_TAG
+#define        CONFIG_SETUP_MEMORY_TAGS
+#define        CONFIG_INITRD_TAG
+#define        CONFIG_CMDLINE_EDITING
+#define        CONFIG_OF_LIBFDT
+
+/* #define CONFIG_OF_LIBFDT */
+#define BOARD_LATE_INIT
+
+#define CONFIG_BAUDRATE                38400
+#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTARGS                ""
+
+#define CONFIG_VERSION_VARIABLE
+#undef CONFIG_SHOW_BOOT_PROGRESS
+
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_USE_ARCH_MEMSET
+#define CONFIG_USE_ARCH_MEMCPY
+#define CONFIG_TMU_TIMER
+
+/* STACK */
+#define CONFIG_SYS_INIT_SP_ADDR                0xE827fffc
+#define STACK_AREA_SIZE                                0xC000
+#define LOW_LEVEL_MERAM_STACK  \
+               (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
+
+/* MEMORY */
+#define LAGER_SDRAM_BASE       0x40000000
+#define LAGER_SDRAM_SIZE       (2048u * 1024 * 1024)
+#define LAGER_UBOOT_SDRAM_SIZE (512 * 1024 * 1024)
+
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_CBSIZE              256
+#define CONFIG_SYS_PBSIZE              256
+#define CONFIG_SYS_MAXARGS             16
+#define CONFIG_SYS_BARGSIZE            512
+#define CONFIG_SYS_BAUDRATE_TABLE      { 38400, 115200 }
+
+/* SCIF */
+#define CONFIG_SCIF_CONSOLE
+#define CONFIG_CONS_SCIF0
+#define SCIF0_BASE             0xe6e60000
+#undef CONFIG_SYS_CONSOLE_INFO_QUIET
+#undef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
+#undef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
+
+#define CONFIG_SYS_MEMTEST_START       (LAGER_SDRAM_BASE)
+#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
+                                        504 * 1024 * 1024)
+#undef CONFIG_SYS_ALT_MEMTEST
+#undef CONFIG_SYS_MEMTEST_SCRATCH
+#undef CONFIG_SYS_LOADS_BAUD_CHANGE
+
+#define CONFIG_SYS_SDRAM_BASE          (LAGER_SDRAM_BASE)
+#define CONFIG_SYS_SDRAM_SIZE          (LAGER_UBOOT_SDRAM_SIZE)
+#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x7fc0)
+#define CONFIG_NR_DRAM_BANKS           1
+
+#define CONFIG_SYS_MONITOR_BASE                0x00000000
+#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (1 * 1024 * 1024)
+#define CONFIG_SYS_GBL_DATA_SIZE       (256)
+#define CONFIG_SYS_BOOTMAPSZ           (8 * 1024 * 1024)
+
+/* USE NOR FLASH */
+#define CONFIG_SYS_TEXT_BASE   0x00000000
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
+#define        CONFIG_FLASH_CFI_DRIVER
+#define        CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
+#define        CONFIG_FLASH_SHOW_PROGRESS      45
+#define CONFIG_SYS_FLASH_BASE          0x00000000
+#define        CONFIG_SYS_FLASH_SIZE           0x04000000      /* 64 MB */
+#define CONFIG_SYS_MAX_FLASH_SECT      1024
+#define CONFIG_SYS_MAX_FLASH_BANKS     1
+#define CONFIG_SYS_FLASH_BANKS_LIST    { (CONFIG_SYS_FLASH_BASE) }
+#define        CONFIG_SYS_FLASH_BANKS_SIZES    { (CONFIG_SYS_FLASH_SIZE) }
+#define CONFIG_SYS_FLASH_ERASE_TOUT    3000
+#define CONFIG_SYS_FLASH_WRITE_TOUT    3000
+#define CONFIG_SYS_FLASH_LOCK_TOUT     3000
+#define CONFIG_SYS_FLASH_UNLOCK_TOUT   3000
+
+/* ENV setting */
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_OVERWRITE   1
+#define CONFIG_ENV_SECT_SIZE   (256 * 1024)
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + \
+                                CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_ENV_OFFSET      (CONFIG_ENV_ADDR)
+#define CONFIG_ENV_SIZE                (CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
+
+/* Board Clock */
+#define CONFIG_BASE_CLK_FREQ   20000000u
+#define CONFIG_SH_TMU_CLK_FREQ (CONFIG_BASE_CLK_FREQ / 2) /* EXT / 2 */
+#define CONFIG_PLL1_CLK_FREQ   (CONFIG_BASE_CLK_FREQ * 156 / 2)
+#define CONFIG_PLL1_DIV2_CLK_FREQ      (CONFIG_PLL1_CLK_FREQ / 2)
+#define CONFIG_MP_CLK_FREQ     (CONFIG_PLL1_DIV2_CLK_FREQ / 15)
+#define CONFIG_SH_SCIF_CLK_FREQ        CONFIG_MP_CLK_FREQ
+
+#define CONFIG_SYS_TMU_CLK_DIV 4
+#define CONFIG_SYS_HZ          1000
+
+#endif /* __LAGER_H */
index 68e1a97..379c786 100644 (file)
@@ -93,7 +93,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define        CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index b87df54..4ffe165 100644 (file)
@@ -86,7 +86,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /*
index c348329..e9c8d8f 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2           /* which serial port to use */
 #endif
 
 /*
index 6501ea4..d415ecd 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 91f6e2f..86ce5f2 100644 (file)
 # define CONFIG_SYS_NAND_DBW_8
 # define CONFIG_SYS_NAND_MASK_ALE              (1 << 21)
 # define CONFIG_SYS_NAND_MASK_CLE              (1 << 22)
-# define CONFIG_SYS_NAND_ENABLE_PIN            AT91_PIO_PORTD, 15
-# define CONFIG_SYS_NAND_READY_PIN             AT91_PIO_PORTA, 22
+# define CONFIG_SYS_NAND_ENABLE_PIN            GPIO_PIN_PD(15)
+# define CONFIG_SYS_NAND_READY_PIN             GPIO_PIN_PA(22)
 #endif
 
 /* Ethernet */
index 4a8adf6..38337b4 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index ec09e15..4cac8ee 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 # define CONFIG_KGDB_BAUDRATE  230400 /* speed to run kgdb serial port */
-# define CONFIG_KGDB_SER_INDEX 2      /* which serial port to use */
 #endif
 
 /*
index c15d546..12667c5 100644 (file)
@@ -86,8 +86,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
-                                               /* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
 #endif
 
 /*
index 9eab190..3acb854 100644 (file)
 #define CONFIG_USB_EHCI_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO       147
 
-#define CONFIG_USB_ULPI
-#define CONFIG_USB_ULPI_VIEWPORT_OMAP
-
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
index 6820e42..73dc088 100644 (file)
@@ -36,9 +36,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
 
-#define CONFIG_USB_ULPI
-#define CONFIG_USB_ULPI_VIEWPORT_OMAP
-
 #include <configs/omap4_common.h>
 #define CONFIG_CMD_NET
 
index c48790d..376dfdb 100644 (file)
@@ -94,7 +94,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  1       /* which serial port to use */
 #endif
 
 /*
index 4d3a800..2f128b8 100644 (file)
 /* Max time to hold reset on this board, see doc/README.omap-reset-time */
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC       16296
 
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_CMD_SCSI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
+#define CONFIG_SYS_SCSI_MAX_LUN                1
+#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+                                               CONFIG_SYS_SCSI_MAX_LUN)
+
 #endif /* __CONFIG_OMAP5_EVM_H */
diff --git a/include/configs/omap730.h b/include/configs/omap730.h
deleted file mode 100644 (file)
index b54e0fb..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *   OMAP730 hardware map
- *
- * Copyright (C) 2004 MPC-Data Limited. (http://www.mpc-data.co.uk)
- * Author: MPC-Data Limited
- *        Dave Peverley
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __INCLUDED_OMAP730_H
-#define __INCLUDED_OMAP730_H
-
-#include <asm/sizes.h>
-
-/***************************************************************************
- * OMAP730 Configuration Registers
- **************************************************************************/
-
-#define PERSEUS2_MPU_DEV_ID               ((unsigned int)(0xFFFE1000))
-#define PERSEUS2_GSM_DEV_ID0              ((unsigned int)(0xFFFE1000))
-#define PERSEUS2_GDM_DEV_ID1              ((unsigned int)(0xFFFE1002))
-#define DSP_CONF                          ((unsigned int)(0xFFFE1004))
-#define PERSEUS2_MPU_DIE_ID0              ((unsigned int)(0xFFFE1008))
-#define GSM_ASIC_CONF                     ((unsigned int)(0xFFFE1008))
-#define PERSEUS2_MPU_DIE_ID1              ((unsigned int)(0xFFFE100C))
-#define PERSEUS2_MODE1                    ((unsigned int)(0xFFFE1010))
-#define PERSEUS2_GSM_DIE_ID0              ((unsigned int)(0xFFFE1010))
-#define PERSEUS2_GSM_DIE_ID1              ((unsigned int)(0xFFFE1012))
-#define PERSEUS2_MODE2                    ((unsigned int)(0xFFFE1014))
-#define PERSEUS2_GSM_DIE_ID2              ((unsigned int)(0xFFFE1014))
-#define PERSEUS2_GSM_DIE_ID3              ((unsigned int)(0xFFFE1016))
-#define PERSEUS2_ANALOG_CELLS_CONF        ((unsigned int)(0xFFFE1018))
-#define SPECCTL                           ((unsigned int)(0xFFFE101C))
-#define SPARE1                            ((unsigned int)(0xFFFE1020))
-#define SPARE2                            ((unsigned int)(0xFFFE1024))
-#define GSM_PBG_IRQ                       ((unsigned int)(0xFFFE1028))
-#define DMA_REQ_CONF                      ((unsigned int)(0xFFFE1030))
-#define PE_CONF_NO_DUAL                   ((unsigned int)(0xFFFE1060))
-#define PERSEUS2_IO_CONF0                 ((unsigned int)(0xFFFE1070))
-#define PERSEUS2_IO_CONF1                 ((unsigned int)(0xFFFE1074))
-#define PERSEUS2_IO_CONF2                 ((unsigned int)(0xFFFE1078))
-#define PERSEUS2_IO_CONF3                 ((unsigned int)(0xFFFE107C))
-#define PERSEUS2_IO_CONF4                 ((unsigned int)(0xFFFE1080))
-#define PERSEUS2_IO_CONF5                 ((unsigned int)(0xFFFE1084))
-#define PERSEUS2_IO_CONF6                 ((unsigned int)(0xFFFE1088))
-#define PERSEUS2_IO_CONF7                 ((unsigned int)(0xFFFE108C))
-#define PERSEUS2_IO_CONF8                 ((unsigned int)(0xFFFE1090))
-#define PERSEUS2_IO_CONF9                 ((unsigned int)(0xFFFE1094))
-#define PERSEUS2_IO_CONF10                ((unsigned int)(0xFFFE1098))
-#define PERSEUS2_IO_CONF11                ((unsigned int)(0xFFFE109C))
-#define PERSEUS2_IO_CONF12                ((unsigned int)(0xFFFE10A0))
-#define PERSEUS2_IO_CONF13                ((unsigned int)(0xFFFE10A4))
-#define PERSEUS_PCC_CONF_REG              ((unsigned int)(0xFFFE10B4))
-#define BIST_STATUS_INTERNAL              ((unsigned int)(0xFFFE10B8))
-#define BIST_CONTROL                      ((unsigned int)(0xFFFE10C0))
-#define BOOT_ROM_REG                      ((unsigned int)(0xFFFE10C4))
-#define PRODUCTION_ID_REG                 ((unsigned int)(0xFFFE10C8))
-#define BIST_SECROM_SIGNATURE1_INTERNAL   ((unsigned int)(0xFFFE10D0))
-#define BIST_SECROM_SIGNATURE2_INTERNAL   ((unsigned int)(0xFFFE10D4))
-#define BIST_CONTROL_2                    ((unsigned int)(0xFFFE10D8))
-#define DEBUG1                            ((unsigned int)(0xFFFE10E0))
-#define DEBUG2                            ((unsigned int)(0xFFFE10E4))
-#define DEBUG_DMA_IRQ                     ((unsigned int)(0xFFFE10E8))
-
-/***************************************************************************
- * OMAP730 EMIFS Registers                                       (TRM 2.5.7)
- **************************************************************************/
-
-#define TCMIF_BASE                 0xFFFECC00
-
-#define EMIFS_LRUREG               (TCMIF_BASE + 0x04)
-#define EMIFS_CONFIG               (TCMIF_BASE + 0x0C)
-#define FLASH_CFG_0                (TCMIF_BASE + 0x10)
-#define FLASH_CFG_1                (TCMIF_BASE + 0x14)
-#define FLASH_CFG_2                (TCMIF_BASE + 0x18)
-#define FLASH_CFG_3                (TCMIF_BASE + 0x1C)
-#define FL_CFG_DYN_WAIT            (TCMIF_BASE + 0x40)
-#define EMIFS_TIMEOUT1_REG         (TCMIF_BASE + 0x28)
-#define EMIFS_TIMEOUT2_REG         (TCMIF_BASE + 0x2C)
-#define EMIFS_TIMEOUT3_REG         (TCMIF_BASE + 0x30)
-#define EMIFS_ABORT_ADDR           (TCMIF_BASE + 0x44)
-#define EMIFS_ABORT_TYPE           (TCMIF_BASE + 0x48)
-#define EMIFS_ABORT_TOUT           (TCMIF_BASE + 0x4C)
-#define FLASH_ACFG_0_1             (TCMIF_BASE + 0x50)
-#define FLASH_ACFG_1_1             (TCMIF_BASE + 0x54)
-#define FLASH_ACFG_2_1             (TCMIF_BASE + 0x58)
-#define FLASH_ACFG_3_1             (TCMIF_BASE + 0x5C)
-
-/***************************************************************************
- * OMAP730 Interrupt handlers
- **************************************************************************/
-
-#define OMAP_IH1_BASE          0xFFFECB00     /* MPU Level 1 IRQ handler */
-#define OMAP_IH2_BASE           0xfffe0000
-
-/***************************************************************************
- * OMAP730 Timers
- *
- * There are three general purpose OS timers in the 730 that can be
- * configured in autoreload or one-shot modes.
- **************************************************************************/
-
-#define OMAP730_32kHz_TIMER_BASE  0xFFFB9000
-
-/* 32k Timer Registers */
-#define TIMER32k_CR               0x08
-#define TIMER32k_TVR              0x00
-#define TIMER32k_TCR              0x04
-
-/* 32k Timer Control Register definition */
-#define TIMER32k_TSS              (1<<0)
-#define TIMER32k_TRB              (1<<1)
-#define TIMER32k_INT              (1<<2)
-#define TIMER32k_ARL              (1<<3)
-
-/* MPU Timer base addresses  */
-#define OMAP730_MPUTIMER_BASE  0xfffec500
-#define OMAP730_MPUTIMER_OFF   0x00000100
-
-#define OMAP730_TIMER1_BASE    0xFFFEC500
-#define OMAP730_TIMER2_BASE    0xFFFEC600
-#define OMAP730_TIMER3_BASE    0xFFFEC700
-
-/* MPU Timer Register offsets */
-#define CNTL_TIMER                0x00   /* MPU_CNTL_TIMER */
-#define LOAD_TIM                  0x04   /* MPU_LOAD_TIMER */
-#define READ_TIM                  0x08   /* MPU_READ_TIMER */
-
-/* MPU_CNTL_TIMER register bits */
-#define MPUTIM_FREE               (1<<6)
-#define MPUTIM_CLOCK_ENABLE       (1<<5)
-#define MPUTIM_PTV_MASK           (0x7<<MPUTIM_PTV_BIT)
-#define MPUTIM_PTV_BIT            2
-#define MPUTIM_AR                 (1<<1)
-#define MPUTIM_ST                 (1<<0)
-
-/***************************************************************************
- * OMAP730 GPIO
- *
- * The GPIO control is split over 6 register bases in the OMAP730 to allow
- * access to all the (6 x 32) GPIO pins!
- **************************************************************************/
-
-#define OMAP730_GPIO_BASE_1        0xFFFBC000
-#define OMAP730_GPIO_BASE_2        0xFFFBC800
-#define OMAP730_GPIO_BASE_3        0xFFFBD000
-#define OMAP730_GPIO_BASE_4        0xFFFBD800
-#define OMAP730_GPIO_BASE_5        0xFFFBE000
-#define OMAP730_GPIO_BASE_6        0xFFFBE800
-
-#define GPIO_DATA_INPUT            0x00
-#define GPIO_DATA_OUTPUT           0x04
-#define GPIO_DIRECTION_CONTROL     0x08
-#define GPIO_INTERRUPT_CONTROL     0x0C
-#define GPIO_INTERRUPT_MASK        0x10
-#define GPIO_INTERRUPT_STATUS      0x14
-
-#define GPIO_DATA_INPUT_1            ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_1           ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_1     ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_1     ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_1        ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_1      ((unsigned int)(OMAP730_GPIO_BASE_1 + GPIO_INTERRUPT_STATUS))
-
-#define GPIO_DATA_INPUT_2            ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_2           ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_2     ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_2     ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_2        ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_2      ((unsigned int)(OMAP730_GPIO_BASE_2 + GPIO_INTERRUPT_STATUS))
-
-#define GPIO_DATA_INPUT_3            ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_3           ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_3     ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_3     ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_3        ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_3      ((unsigned int)(OMAP730_GPIO_BASE_3 + GPIO_INTERRUPT_STATUS))
-
-#define GPIO_DATA_INPUT_4            ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_4           ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_4     ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_4     ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_4        ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_4      ((unsigned int)(OMAP730_GPIO_BASE_4 + GPIO_INTERRUPT_STATUS))
-
-#define GPIO_DATA_INPUT_5            ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_5           ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_5     ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_5     ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_5        ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_5      ((unsigned int)(OMAP730_GPIO_BASE_5 + GPIO_INTERRUPT_STATUS))
-
-#define GPIO_DATA_INPUT_6            ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_DATA_INPUT))
-#define GPIO_DATA_OUTPUT_6           ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_DATA_OUTPUT))
-#define GPIO_DIRECTION_CONTROL_6     ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_DIRECTION_CONTROL))
-#define GPIO_INTERRUPT_CONTROL_6     ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_INTERRUPT_CONTROL))
-#define GPIO_INTERRUPT_MASK_6        ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_INTERRUPT_MASK))
-#define GPIO_INTERRUPT_STATUS_6      ((unsigned int)(OMAP730_GPIO_BASE_6 + GPIO_INTERRUPT_STATUS))
-
-/***************************************************************************
- * OMAP730 Watchdog timers
- **************************************************************************/
-
-#define WDTIM_BASE                 0xFFFEC800
-#define WDTIM_CONTROL              (WDTIM_BASE + 0x00)    /* MPU_CNTL_TIMER */
-#define WDTIM_LOAD                 (WDTIM_BASE + 0x04)    /* MPU_LOAD_TIMER */
-#define WDTIM_READ                 (WDTIM_BASE + 0x04)    /* MPU_READ_TIMER */
-#define WDTIM_MODE                 (WDTIM_BASE + 0x08)    /* MPU_TIMER_MODE */
-
-/***************************************************************************
- * OMAP730 Interrupt Registers
- **************************************************************************/
-
-/* Interrupt Register offsets */
-
-#define IRQ_ITR                               0x00
-#define IRQ_MIR                               0x04
-#define IRQ_SIR_IRQ                           0x10
-#define IRQ_SIR_FIQ                           0x14
-#define IRQ_CONTROL_REG                       0x18
-#define IRQ_ILR0                              0x1C  /* ILRx == ILR0 + (0x4 * x) */
-#define IRQ_SIR                               0x9C  /* a.k.a.IRQ_ISR */
-#define IRQ_GMIR                              0xA0
-
-#define REG_IHL1_MIR  (OMAP_IH1_BASE + IRQ_MIR)
-#define REG_IHL2_MIR  (OMAP_IH2_BASE + IRQ_MIR)
-
-/***************************************************************************
- * OMAP730 Intersystem Communication Register                      (TRM 4.5)
- **************************************************************************/
-
-#define ICR_BASE                   0xFFFBB800
-
-#define M_ICR                      (ICR_BASE + 0x00)
-#define G_ICR                      (ICR_BASE + 0x02)
-#define M_CTL                      (ICR_BASE + 0x04)
-#define G_CTL                      (ICR_BASE + 0x06)
-#define PM_BA                      (ICR_BASE + 0x0A)
-#define DM_BA                      (ICR_BASE + 0x0C)
-#define RM_BA                      (ICR_BASE + 0x0E)
-#define SSPI_TAS                   (ICR_BASE + 0x12)
-
-#endif /* ! __INCLUDED_OMAP730_H */
diff --git a/include/configs/omap730p2.h b/include/configs/omap730p2.h
deleted file mode 100644 (file)
index 947f27b..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * MPC Data Limited (http://www.mpc-data.co.uk)
- * Dave Peverley <dpeverley at mpc-data.co.uk>
- *
- * Configuation settings for the TI OMAP Perseus 2 board.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/* allow to overwrite serial and ethaddr */
-#define CONFIG_ENV_OVERWRITE
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_ARM926EJS          1         /* This is an arm926ejs CPU core  */
-#define CONFIG_OMAP               1         /* in a TI OMAP core    */
-#define CONFIG_OMAP730            1         /* which is in a 730  */
-#define CONFIG_P2_OMAP730         1         /*  a Perseus 2 Board  */
-
-/*
- * Input clock of PLL
- * The OMAP730 Perseus 2 has 13MHz input clock
- */
-
-#define CONFIG_SYS_CLK_FREQ       13000000
-
-#define CONFIG_CMDLINE_TAG        1         /* enable passing of ATAGs  */
-#define CONFIG_SETUP_MEMORY_TAGS   1
-
-/*
- * Size of malloc() pool
- */
-
-#define CONFIG_SYS_MALLOC_LEN             (CONFIG_ENV_SIZE + 128*1024)
-
-/*
- * Hardware drivers
- */
-
-#define CONFIG_LAN91C96
-#define CONFIG_LAN91C96_BASE      0x04000300
-#define CONFIG_LAN91C96_EXT_PHY
-
-/*
- * NS16550 Configuration
- */
-
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE       (1)
-#define CONFIG_SYS_NS16550_CLK            (48000000)     /* can be 12M/32Khz or 48Mhz */
-#define CONFIG_SYS_NS16550_COM1           0xfffb0000     /* uart1, bluetooth uart
-                                                  * on perseus */
-
-/*
- * select serial console configuration
- */
-
-#define CONFIG_SERIAL1            1         /* we use SERIAL 1 on OMAP730 Perseus 2 */
-
-#define CONFIG_CONS_INDEX         1
-#define CONFIG_BAUDRATE                   115200
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_DHCP
-
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_BOOTPATH
-
-
-#include <configs/omap730.h>
-#include <configs/h2_p2_dbg_board.h>
-
-#define CONFIG_BOOTDELAY          3
-#define CONFIG_BOOTARGS                   "mem=32M console=ttyS0,115200n8 noinitrd root=/dev/nfs rw ip=bootp"
-
-#define CONFIG_LOADADDR                   0x10000000
-
-#define CONFIG_ETHADDR
-#define CONFIG_NETMASK            255.255.255.0
-#define CONFIG_IPADDR             192.168.0.23
-#define CONFIG_SERVERIP                   192.150.0.100
-#define CONFIG_BOOTFILE                   "uImage"  /* File to load */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE      115200    /* Speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX     1         /* Which serial port to use */
-#endif
-
-/*
- * Miscellaneous configurable options
- */
-
-#define CONFIG_SYS_LONGHELP                                   /* undef to save memory     */
-#define CONFIG_SYS_PROMPT                 "OMAP730 P2 # "     /* Monitor Command Prompt   */
-#define CONFIG_SYS_CBSIZE                 256                 /* Console I/O Buffer Size  */
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE                 (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-#define CONFIG_SYS_MAXARGS                16                  /* max number of command args   */
-#define CONFIG_SYS_BARGSIZE               CONFIG_SYS_CBSIZE           /* Boot Argument Buffer Size    */
-
-#define CONFIG_SYS_MEMTEST_START          0x10000000          /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END            0x12000000          /* 32 MB in DRAM    */
-
-#define CONFIG_SYS_LOAD_ADDR              0x10000000          /* default load address */
-
-/* The OMAP730 has 3 general purpose MPU timers, they can be driven by
- * the RefClk (12Mhz) or by DPLL1. This time is further subdivided by a
- * local divisor.
- */
-#define CONFIG_SYS_TIMERBASE           0xFFFEC500      /* use timer 1 */
-#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1), divide by 256 */
-#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
-
-/*-----------------------------------------------------------------------
- * Physical Memory Map
- */
-
-#define CONFIG_NR_DRAM_BANKS      1              /* we have 1 bank of DRAM */
-#define PHYS_SDRAM_1              0x10000000     /* SDRAM Bank #1 */
-#define PHYS_SDRAM_1_SIZE         0x02000000     /* 32 MB */
-
-#if defined(CONFIG_CS0_BOOT)
-#define PHYS_FLASH_1              0x0C000000
-#elif defined(CONFIG_CS3_BOOT)
-#define PHYS_FLASH_1              0x00000000
-#else
-#error Unknown Boot Chip-Select number
-#endif
-
-#define PHYS_SRAM              0x20000000
-
-#define CONFIG_SYS_FLASH_BASE             PHYS_FLASH_1
-
-/*-----------------------------------------------------------------------
- * FLASH and environment organization
- */
-
-#define CONFIG_SYS_MAX_FLASH_BANKS        1              /* max number of memory banks */
-#define PHYS_FLASH_SIZE                   0x02000000     /* 32MB */
-#define CONFIG_SYS_MAX_FLASH_SECT         (259)          /* max number of sectors on one chip */
-/* addr of environment */
-#define CONFIG_ENV_ADDR                   (CONFIG_SYS_FLASH_BASE + 0x020000)
-
-/* timeout values are in ticks */
-#define CONFIG_SYS_FLASH_ERASE_TOUT        (20*CONFIG_SYS_HZ)    /* Timeout for Flash Erase */
-#define CONFIG_SYS_FLASH_WRITE_TOUT        (20*CONFIG_SYS_HZ)    /* Timeout for Flash Write */
-
-#define CONFIG_ENV_IS_IN_FLASH    1
-#define CONFIG_ENV_SIZE                   0x20000        /* Total Size of Environment Sector */
-#define CONFIG_ENV_OFFSET                 0x20000        /* environment starts here  */
-
-#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define CONFIG_SYS_INIT_SP_ADDR        PHYS_SRAM
-
-#endif   /* ! __CONFIG_H */
index 3f4e073..629967d 100644 (file)
 # define CONFIG_SYS_NAND_DBW_8
 # define CONFIG_SYS_NAND_MASK_ALE              (1 << 21)
 # define CONFIG_SYS_NAND_MASK_CLE              (1 << 22)
-# define CONFIG_SYS_NAND_ENABLE_PIN            AT91_PIO_PORTD, 15
-# define CONFIG_SYS_NAND_READY_PIN             AT91_PIO_PORTA, 22
+# define CONFIG_SYS_NAND_ENABLE_PIN            GPIO_PIN_PD(15)
+# define CONFIG_SYS_NAND_READY_PIN             GPIO_PIN_PA(22)
 #endif
 
 /* Ethernet */
index 57ed019..c6df11b 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 3fde7ca..1fdd602 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 #endif /* __CONFIG_H */
index 84bc9ed..ae4dd75 100644 (file)
@@ -93,7 +93,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define        CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index 661101c..1f94f0c 100644 (file)
@@ -95,7 +95,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define        CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index adf8519..3662663 100644 (file)
@@ -94,7 +94,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index 400cb3e..5a5fe7f 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*-----------------------------------------------------------------------
index 266d107..2a54e5c 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /* POST support */
index fc95cf0..4a71927 100644 (file)
 #define        CONFIG_SYS_MCKR1_VAL            \
                (AT91_PMC_MCKR_CSS_SLOW |       \
                 AT91_PMC_MCKR_PRES_1 | \
-                AT91_PMC_MCKR_MDIV_2 | \
-                AT91_PMC_MCKR_PLLADIV_1)
+                AT91_PMC_MCKR_MDIV_2)
 
 /* PCK/2 = MCK Master Clock from PLLA */
 #define        CONFIG_SYS_MCKR2_VAL            \
                (AT91_PMC_MCKR_CSS_PLLA |       \
                 AT91_PMC_MCKR_PRES_1 | \
-                AT91_PMC_MCKR_MDIV_2 | \
-                AT91_PMC_MCKR_PLLADIV_1)
+                AT91_PMC_MCKR_MDIV_2)
 
 /* define PDC[31:16] as DATA[31:16] */
 #define CONFIG_SYS_PIOC_PDR_VAL1       0xFFFF0000
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTC, 12
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTC, 13
-#define        CONFIG_YELLOW_LED       AT91_PIO_PORTC, 15
+#define CONFIG_RED_LED         GPIO_PIN_PC(12)
+#define CONFIG_GREEN_LED       GPIO_PIN_PC(13)
+#define CONFIG_YELLOW_LED      GPIO_PIN_PC(15)
 
 #define CONFIG_BOOTDELAY       3
 
 #define CONFIG_SYS_NAND_MASK_ALE               (1 << 22)
 /* our CLE is AD21 */
 #define CONFIG_SYS_NAND_MASK_CLE               (1 << 21)
-#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIO_PORTC, 14
-#define CONFIG_SYS_NAND_READY_PIN              AT91_PIO_PORTA, 16
+#define CONFIG_SYS_NAND_ENABLE_PIN             GPIO_PIN_PC(14)
+#define CONFIG_SYS_NAND_READY_PIN              GPIO_PIN_PA(16)
 
 /* NOR flash */
 #define CONFIG_SYS_FLASH_CFI                   1
index 533e249..d9c04d1 100644 (file)
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTB, 7       /* this is the power led */
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTB, 8       /* this is the user1 led */
+#define CONFIG_RED_LED         GPIO_PIN_PB(7) /* this is the power led */
+#define CONFIG_GREEN_LED       GPIO_PIN_PB(8) /* this is the user1 led */
 
 #define CONFIG_BOOTDELAY       3
 
 #define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
 /* our CLE is AD22 */
 #define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
-#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIO_PORTD, 15
-#define CONFIG_SYS_NAND_READY_PIN      AT91_PIO_PORTB, 30
+#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PD(15)
+#define CONFIG_SYS_NAND_READY_PIN      GPIO_PIN_PB(30)
 
 #endif
 
index e0c388e..f78e0ec 100644 (file)
@@ -54,8 +54,8 @@
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTD, 31 /* this is the user1 led */
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTD, 0 /* this is the user2 led */
+#define CONFIG_RED_LED         GPIO_PIN_PD(31) /* this is the user1 led */
+#define CONFIG_GREEN_LED       GPIO_PIN_PD(0)  /* this is the user2 led */
 
 #define CONFIG_BOOTDELAY       3
 
 #define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
 /* our CLE is AD22 */
 #define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
-#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIO_PORTC, 14
-#define CONFIG_SYS_NAND_READY_PIN      AT91_PIO_PORTD, 3
+#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PC(14)
+#define CONFIG_SYS_NAND_READY_PIN      GPIO_PIN_PD(3)
 
 #endif
 
index 5856ee1..f0ecc34 100644 (file)
@@ -16,7 +16,6 @@
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400
-#define        CONFIG_KGDB_SER_INDEX           2
 #endif
 
 /*
index 84ad006..af7c076 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /*
index 20b0f9a..7722f7b 100644 (file)
@@ -70,6 +70,7 @@
        "hostname=pxm2\0" \
        "nand_img_size=0x500000\0" \
        "optargs=\0" \
+       "splashpos=m,m\0"       \
        CONFIG_COMMON_ENV_SETTINGS \
        "mmc_dev=0\0" \
        "mmc_root=/dev/mmcblk0p2 rw\0" \
                "fi;" \
        "fi;" \
        "run nand_boot;" \
-       "if ping ${serverip}; then " \
-               "run net_nfs; " \
-       "fi; "
+       "reset;"
 
 #else
 #define CONFIG_BOOTDELAY               0
 #define DA8XX_LCD_CNTL_BASE    LCD_CNTL_BASE
 #define PWM_TICKS      0x1388
 #define PWM_DUTY       0x200
+#define CONFIG_SYS_CONSOLE_BG_COL      0xff
+#define CONFIG_SYS_CONSOLE_FG_COL      0x00
 #endif
 
 #endif /* ! __CONFIG_PXM2_H */
index 7b04e0c..20d6178 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /* ENVIRONMENT VARS */
index f144f84..92318c3 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /*
index 7c94644..d4519f9 100644 (file)
@@ -65,7 +65,8 @@
 /* Default env settings */
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "hostname=rut\0" \
-       "splashpos=488,352\0" \
+       "nand_img_size=0x500000\0" \
+       "splashpos=m,m\0" \
        "optargs=fixrtc --no-log consoleblank=0 \0" \
        CONFIG_COMMON_ENV_SETTINGS \
        "mmc_dev=0\0" \
                "fi;" \
        "fi;" \
        "run nand_boot;" \
-       "if ping ${serverip}; then " \
-               "run net_nfs; " \
-       "fi; "
+       "reset;"
 
 #else
 #define CONFIG_BOOTDELAY               0
 #define BOARD_LCD_RESET                115     /* Bank 3 pin 19 */
 #define CONFIG_ARCH_EARLY_INIT_R
 #define CONFIG_FORMIKE
+#define DISPL_PLL_SPREAD_SPECTRUM
+#define CONFIG_SYS_CONSOLE_BG_COL      0xff
+#define CONFIG_SYS_CONSOLE_FG_COL      0x00
 #endif
 
 #endif /* ! __CONFIG_RUT_H */
index 5a6f0fc..c34feb5 100644 (file)
 #define CONFIG_AT91FAMILY
 #define CONFIG_ARCH_CPU_INIT
 
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_SKIP_LOWLEVEL_INIT
+#endif
+
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DISPLAY_CPUINFO
 
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
 #define CONFIG_SYS_SDRAM_SIZE          0x20000000
 
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_INIT_SP_ADDR                0x310000
+#else
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
+#endif
 
 /* SerialFlash */
 #define CONFIG_CMD_SF
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (1024 * 1024)
 
+/* SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_TEXT_BASE           0x300000
+#define CONFIG_SPL_MAX_SIZE            0x10000
+#define CONFIG_SPL_BSS_START_ADDR      0x20000000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+#define CONFIG_SYS_SPL_MALLOC_START    0x20080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x80000
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+
+#define CONFIG_SPL_BOARD_INIT
+#ifdef CONFIG_SYS_USE_MMC
+#define CONFIG_SPL_LDSCRIPT            arch/arm/cpu/at91-common/u-boot-spl.lds
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION   1
+#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME       "u-boot.img"
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#endif
+
 #endif
index a4edc62..7e78a23 100644 (file)
 #define CONFIG_ENV_SIZE                8192
 #define CONFIG_ENV_IS_NOWHERE
 
+/* SPI */
+#define CONFIG_SANDBOX_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SF_TEST
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SANDBOX
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SPI_FLASH_WINBOND
+
 /* Memory things - we don't really want a memory test */
 #define CONFIG_SYS_LOAD_ADDR           0x00000000
 #define CONFIG_SYS_MEMTEST_START       0x00100000
index cbcd4e1..7e16c45 100644 (file)
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_RESET_PHY_R
 #define CONFIG_MACB_SEARCH_PHY
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* USB */
 #define CONFIG_USB_ATMEL
index a258fe8..b7f83e0 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index bdb8eb5..4912d69 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index dba948a..78f8219 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index f37653f..4569fd4 100644 (file)
 #define CONFIG_USB_GADGET
 #define CONFIG_USBDOWNLOAD_GADGET
 
-/* USB TI's IDs */
+/* USB DRACO ID as default */
 #define CONFIG_USBD_HS
-#define CONFIG_G_DNL_VENDOR_NUM 0x0525
-#define CONFIG_G_DNL_PRODUCT_NUM 0x4a47
-#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#define CONFIG_G_DNL_VENDOR_NUM 0x0908
+#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2
+#define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
 
 /* USB Device Firmware Update support */
 #define CONFIG_DFU_FUNCTION
 #define CONFIG_COMMON_ENV_SETTINGS \
        "verify=no \0" \
        "project_dir=systemone\0" \
+       "upgrade_available=0\0" \
+       "altbootcmd=run bootcmd\0" \
+       "bootlimit=3\0" \
+       "partitionset_active=A\0" \
        "loadaddr=0x82000000\0" \
        "kloadaddr=0x81000000\0" \
        "script_addr=0x81900000\0" \
-       "console=console=ttyMTD,mtdoops console=ttyO0,115200n8\0" \
-       "active_set=a\0" \
+       "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
        "nand_active_ubi_vol=rootfs_a\0" \
+       "nand_active_ubi_vol_A=rootfs_a\0" \
+       "nand_active_ubi_vol_B=rootfs_b\0" \
        "nand_root_fs_type=ubifs rootwait=1\0" \
        "nand_src_addr=0x280000\0" \
-       "nand_src_addr_a=0x280000\0" \
-       "nand_src_addr_b=0x780000\0" \
+       "nand_src_addr_A=0x280000\0" \
+       "nand_src_addr_B=0x780000\0" \
        "nfsopts=nolock rw mem=128M\0" \
        "ip_method=none\0" \
        "bootenv=uEnv.txt\0" \
        "bootargs_defaults=setenv bootargs " \
                "console=${console} " \
+               "${testargs} " \
                "${optargs}\0" \
        "nand_args=run bootargs_defaults;" \
                "mtdparts default;" \
-               "setenv nand_active_ubi_vol rootfs_${active_set};" \
-               "setenv ${active_set} true;" \
-               "if test -n ${a}; then " \
-                       "setenv nand_src_addr ${nand_src_addr_a};" \
+               "setenv ${partitionset_active} true;" \
+               "if test -n ${A}; then " \
+                       "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
+                       "setenv nand_src_addr ${nand_src_addr_A};" \
                "fi;" \
-               "if test -n ${b}; then " \
-                       "setenv nand_src_addr ${nand_src_addr_b};" \
+               "if test -n ${B}; then " \
+                       "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
+                       "setenv nand_src_addr ${nand_src_addr_B};" \
                "fi;" \
                "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
                "ubi.mtd=9,2048;" \
                "setenv bootargs ${bootargs} " \
                "root=/dev/nfs ${mtdparts} " \
                "nfsroot=${serverip}:${rootpath},${nfsopts} " \
-               "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
+               "ip=${ipaddr}:${serverip}:" \
                "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
-       "nand_boot=echo Booting from nand, active set ${active_set} ...; " \
+       "nand_boot=echo Booting from nand; " \
+               "if test ${upgrade_available} -eq 1; then " \
+                       "if test ${bootcount} -gt ${bootlimit}; " \
+                               "then " \
+                               "setenv upgrade_available 0;" \
+                               "setenv ${partitionset_active} true;" \
+                               "if test -n ${A}; then " \
+                                       "setenv partitionset_active B; " \
+                                       "env delete A; " \
+                               "fi;" \
+                               "if test -n ${B}; then " \
+                                       "setenv partitionset_active A; " \
+                                       "env delete B; " \
+                               "fi;" \
+                               "saveenv; " \
+                       "fi;" \
+               "fi;" \
+               "echo set ${partitionset_active}...;" \
                "run nand_args; " \
                "nand read.i ${kloadaddr} ${nand_src_addr} " \
                "${nand_img_size}; bootm ${kloadaddr}\0" \
                "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
                "bootm ${kloadaddr}\0" \
        "flash_self=run nand_boot\0" \
-       "flash_self_test=setenv bootargs_defaults ${bootargs_defaults} test; " \
+       "flash_self_test=setenv testargs test; " \
                "run nand_boot\0" \
        "dfu_start=echo Preparing for dfu mode ...; " \
                "run dfu_args; \0" \
                "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
                "from memory and root filesystem over NFS; echo Type " \
                "'run net_nfs' to get Kernel over TFTP and mount root " \
-               "filesystem over NFS; echo Set active_set variable to 'a' " \
-               "or 'b' to select kernel and rootfs partition; " \
+               "filesystem over NFS; " \
+               "echo Set partitionset_active variable to 'A' " \
+               "or 'B' to select kernel and rootfs partition; " \
                "echo" \
                "\0"
 
 #define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, "           \
                                "press \"<Esc><Esc>\" to stop\n", bootdelay
 
+/* Reboot after 60 sec if bootcmd fails */
+#define CONFIG_RESET_TO_RETRY
+#define CONFIG_BOOT_RETRY_TIME 60
+
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_ENV
+
+/* Enable Device-Tree (FDT) support */
+#define CONFIG_OF_LIBFDT
+#define CONFIG_CMD_FDT
+
 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */
index a87444e..d4ae19f 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
-/* what's this ? it's not used anywhere */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index 5436bae..94a65c4 100644 (file)
@@ -59,6 +59,7 @@
 #define CONFIG_RMII
 #define CONFIG_NET_RETRY_COUNT         20
 #define CONFIG_RESET_PHY_R
+#define CONFIG_AT91_WANTS_COMMON_PHY
 #define CONFIG_TFTP_PORT
 #define CONFIG_TFTP_TSIZE
 
@@ -74,7 +75,6 @@
 #define CONFIG_USB_STORAGE
 
 /* GPIOs and IO expander */
-#define CONFIG_AT91_LEGACY
 #define CONFIG_ATMEL_LEGACY
 #define CONFIG_AT91_GPIO
 #define CONFIG_AT91_GPIO_PULLUP                1
index 0e6b864..fd590e4 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port*/
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use     */
 #endif
 
 
index 248e657..51339b1 100644 (file)
 #ifdef CONFIG_MACB
 # define CONFIG_RMII                   /* use reduced MII inteface */
 # define CONFIG_NET_RETRY_COUNT        20      /* # of DHCP/BOOTP retries */
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* BOOTP and DHCP options */
 # define CONFIG_BOOTP_BOOTFILESIZE
index ee1f1f3..2a9c9a3 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*Note: change below for your network setting!!! */
index 63dd767..d0cb68a 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*Note: change below for your network setting!!! */
index d9b0ed0..54a5e3e 100644 (file)
 
 #ifdef CONFIG_CMD_KGDB
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
new file mode 100644 (file)
index 0000000..c980023
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Common board functions for Siemens TAURUS (AT91SAM9G20) based boards
+ * (C) Copyright 2013 Siemens AG
+ *
+ * Based on:
+ * U-Boot file: include/configs/at91sam9260ek.h
+ *
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * SoC must be defined first, before hardware.h is included.
+ * In this case SoC is defined in boards.cfg.
+ */
+#include <asm/hardware.h>
+
+#define MACH_TYPE_TAURUS               2067
+#define MACH_TYPE_AXM                  2068
+
+/*
+ * Warning: changing CONFIG_SYS_TEXT_BASE requires
+ * adapting the initial boot program.
+ * Since the linker has to swallow that define, we must use a pure
+ * hex number here!
+ */
+
+
+#define CONFIG_SYS_TEXT_BASE           0x23f00000
+
+/* ARM asynchronous clock */
+#define CONFIG_SYS_AT91_SLOW_CLOCK     32768           /* slow clock xtal */
+#define CONFIG_SYS_AT91_MAIN_CLOCK     18432000        /* main clock xtal */
+#define CONFIG_SYS_HZ                  1000
+
+/* Misc CPU related */
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_DISPLAY_CPUINFO
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_OF_LIBFDT
+
+/* general purpose I/O */
+#define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
+#define CONFIG_AT91_GPIO
+#define CONFIG_AT91_GPIO_PULLUP        1       /* keep pullups on peripheral pins */
+
+/* serial console */
+#define CONFIG_ATMEL_USART
+#define CONFIG_USART_BASE              ATMEL_BASE_DBGU
+#define CONFIG_USART_ID                        ATMEL_ID_SYS
+#define CONFIG_BAUDRATE                        115200
+
+#define CONFIG_BOOTDELAY       3
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_SOURCE
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NAND
+
+/*
+ * SDRAM: 1 bank, min 32, max 128 MB
+ * Initialized before u-boot gets started.
+ */
+#define CONFIG_NR_DRAM_BANKS           1
+#define CONFIG_SYS_SDRAM_BASE          ATMEL_BASE_CS1
+#define CONFIG_SYS_SDRAM_SIZE          (128 * 1024 * 1024)
+
+/*
+ * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
+ * leaving the correct space for initial global data structure above
+ * that address while providing maximum stack area below.
+ */
+# define CONFIG_SYS_INIT_SP_ADDR \
+       (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
+
+/* NAND flash */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_NAND_ATMEL
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_SYS_NAND_BASE           ATMEL_BASE_CS3
+#define CONFIG_SYS_NAND_DBW_8
+#define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
+#define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
+#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIN_PC14
+#define CONFIG_SYS_NAND_READY_PIN      AT91_PIN_PC13
+#endif
+
+/* NOR flash - no real flash on this board */
+#define CONFIG_SYS_NO_FLASH                    1
+
+/* Ethernet */
+#define CONFIG_MACB
+#define CONFIG_RMII
+#define CONFIG_AT91_WANTS_COMMON_PHY
+
+/* USB */
+#if defined(CONFIG_BOARD_TAURUS)
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
+#define CONFIG_SYS_USB_OHCI_REGS_BASE          0x00500000
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91sam9260"
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     2
+#define CONFIG_USB_STORAGE
+#endif
+
+/* load address */
+#define CONFIG_SYS_LOAD_ADDR                   0x22000000
+
+/* bootstrap in spi flash , u-boot + env + linux in nandflash */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET              0x100000
+#define CONFIG_ENV_OFFSET_REDUND       0x180000
+#define CONFIG_ENV_SIZE                0x20000         /* 1 sector = 128 kB */
+#define CONFIG_BOOTCOMMAND     "nand read 0x22000000 0x200000 0x300000; bootm"
+#define CONFIG_BOOTARGS                                                        \
+       "console=ttyS0,115200 earlyprintk "                             \
+       "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"          \
+       "256k(env),256k(env_redundant),256k(spare),"                    \
+       "512k(dtb),6M(kernel)ro,-(rootfs) "                             \
+       "root=/dev/mtdblock7 rw rootfstype=jffs2"
+
+#define CONFIG_SYS_PROMPT              "U-Boot> "
+#define CONFIG_SYS_CBSIZE              256
+#define CONFIG_SYS_MAXARGS             16
+#define CONFIG_SYS_PBSIZE \
+       (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN \
+       ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
+
+#endif
index 627836a..58bcdc8 100644 (file)
@@ -55,7 +55,7 @@
 #define CONFIG_EBIU_AMBCTL0_VAL        (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3)
 #define CONFIG_EBIU_AMBCTL1_VAL        (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3)
 
-#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
 #define CONFIG_SYS_MALLOC_LEN  (128 * 1024)
 
 
 #define FLASHBOOT_ENV_SETTINGS \
        "flashboot=flread 20040000 1000000 300000;" \
        "bootm 0x1000000\0"
+#define CONFIG_BOARD_SIZE_LIMIT $$((384 * 1024))
 
 
 /*
index 10fe47f..4364eef 100644 (file)
@@ -18,6 +18,7 @@
 #define CONFIG_SYS_CACHELINE_SIZE       64
 #define CONFIG_MAX_RAM_BANK_SIZE       (1024 << 20)    /* 1GB */
 #define CONFIG_SYS_TIMERBASE           0x48040000      /* Use Timer2 */
+#define CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
 
 #include <asm/arch/omap.h>
 
@@ -42,9 +43,9 @@
 
 /*
  * RTC related defines. To use bootcount you must set bootlimit in the
- * environment to a non-zero value.
+ * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT
+ * in the board config.
  */
-#define CONFIG_BOOTCOUNT_LIMIT
 #define CONFIG_SYS_BOOTCOUNT_ADDR      0x44E3E000
 
 /* Enable the HW watchdog, since we can use this with bootcount */
index 3d080c4..0877142 100644 (file)
@@ -16,6 +16,7 @@
  */
 #define CONFIG_SAMSUNG         /* in a SAMSUNG core */
 #define CONFIG_S5P             /* which is in a S5P Family */
+#define CONFIG_EXYNOS4         /* which is in a EXYNOS4XXX */
 #define CONFIG_EXYNOS4210      /* which is in a EXYNOS4210 */
 #define CONFIG_TRATS           /* working with TRATS */
 #define CONFIG_TIZEN           /* TIZEN lib */
 #define CONFIG_SYS_CACHELINE_SIZE       32
 
 #define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_S3C24X0
+#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000
+#define CONFIG_SYS_I2C_S3C24X0_SLAVE   0xFE
+#define CONFIG_MAX_I2C_NUM             8
 #define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
 #define CONFIG_SYS_I2C_SOFT_SPEED      50000
-#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
-#define I2C_SOFT_DECLARATIONS2
-#define CONFIG_SYS_I2C_SOFT_SPEED_2     50000
-#define CONFIG_SYS_I2C_SOFT_SLAVE_2     0x7F
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SOFT_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS 15
 
 #include <asm/arch/gpio.h>
 
-/* I2C PMIC */
-#define CONFIG_SOFT_I2C_I2C5_SCL exynos4_gpio_part1_get_nr(b, 7)
-#define CONFIG_SOFT_I2C_I2C5_SDA exynos4_gpio_part1_get_nr(b, 6)
-
 /* I2C FG */
-#define CONFIG_SOFT_I2C_I2C9_SCL exynos4_gpio_part2_get_nr(y4, 1)
-#define CONFIG_SOFT_I2C_I2C9_SDA exynos4_gpio_part2_get_nr(y4, 0)
-
-#define CONFIG_SOFT_I2C_GPIO_SCL get_multi_scl_pin()
-#define CONFIG_SOFT_I2C_GPIO_SDA get_multi_sda_pin()
-#define I2C_INIT multi_i2c_init()
+#define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_part2_get_nr(y4, 1)
+#define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_part2_get_nr(y4, 0)
 
 #define CONFIG_POWER
 #define CONFIG_POWER_I2C
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
+#define CONFIG_USB_CABLE_CHECK
 
 /* LCD */
 #define CONFIG_EXYNOS_FB
index 0e93836..5d86a3d 100644 (file)
@@ -20,8 +20,6 @@
 #define CONFIG_EXYNOS4         /* which is in a EXYNOS4XXX */
 #define CONFIG_TIZEN           /* TIZEN lib */
 
-#define PLATFORM_NO_UNALIGNED
-
 #include <asm/arch/cpu.h>              /* get chip and board defs */
 
 #define CONFIG_ARCH_CPU_INIT
 
 #define CONFIG_DISPLAY_CPUINFO
 
-/*
- * Size of malloc() pool
- */
-#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (2 << 20))
+#include <asm/sizes.h>
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (80 * SZ_1M))
 
 /* select serial console configuration */
 #define CONFIG_SERIAL2
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_DFU
 #define CONFIG_CMD_GPT
 #define CONFIG_CMD_PMIC
 
 #define CONFIG_CMD_EXT4
 #define CONFIG_CMD_EXT4_WRITE
 
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+
+/* TIZEN THOR downloader support */
+#define CONFIG_CMD_THOR_DOWNLOAD
+#define CONFIG_THOR_FUNCTION
+
+/* USB Samsung's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
+#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
+#define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM
+#define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D
+#define CONFIG_G_DNL_MANUFACTURER "Samsung"
+
 /* To use the TFTPBOOT over USB, Please enable the CONFIG_CMD_NET */
 #undef CONFIG_CMD_NET
 
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
 /* Tizen - partitions definitions */
-#define PARTS_CSA              "csa-mmc"
-#define PARTS_BOOTLOADER       "u-boot"
+#define PARTS_CSA              "csa"
 #define PARTS_BOOT             "boot"
+#define PARTS_MODEM            "modem"
+#define PARTS_CSC              "csc"
 #define PARTS_ROOT             "platform"
 #define PARTS_DATA             "data"
-#define PARTS_CSC              "csc"
 #define PARTS_UMS              "ums"
 
 #define PARTS_DEFAULT \
-       "uuid_disk=${uuid_gpt_disk};" \
-       "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
-       "name="PARTS_BOOTLOADER",size=60MiB," \
-               "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
-       "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
-       "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
-       "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
+       "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
+       "name="PARTS_BOOT",size=64MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
+       "name="PARTS_MODEM",size=100MiB,uuid=${uuid_gpt_"PARTS_MODEM"};" \
        "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
+       "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
+       "name="PARTS_DATA",size=512MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
        "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
 
+#define CONFIG_DFU_ALT \
+       "u-boot mmc 80 800;" \
+       "uImage ext4 0 2;" \
+       "exynos4412-trats2.dtb ext4 0 2;" \
+       ""PARTS_ROOT" part 0 5\0"
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "bootk=" \
                "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \
        "rootfstype=ext4\0" \
        "console=" CONFIG_DEFAULT_CONSOLE \
        "kernelname=uImage\0" \
-       "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 uImage\0" \
-               "0x40007FC0 ${kernelname}\0" \
+       "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \
+               "${kernelname}\0" \
        "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \
                "${fdtfile}\0" \
-       "mmcdev=0\0" \
+       "mmcdev=CONFIG_MMC_DEFAULT_DEV\0" \
        "mmcbootpart=2\0" \
        "mmcrootpart=5\0" \
        "opts=always_resume=1\0" \
        "partitions=" PARTS_DEFAULT \
+       "dfu_alt_info=" CONFIG_DFU_ALT \
        "uartpath=ap\0" \
        "usbpath=ap\0" \
        "consoleon=set console console=ttySAC2,115200n8; save; reset\0" \
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_LOAD_ADDR \
                                        - GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_HZ                  1000
-
 /* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
 
 #include <asm/arch/gpio.h>
 
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_S3C24X0
+#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000
+#define CONFIG_SYS_I2C_S3C24X0_SLAVE   0
+#define CONFIG_MAX_I2C_NUM             8
+#define CONFIG_SYS_I2C_SOFT
 #define CONFIG_SYS_I2C_SOFT_SPEED      50000
 #define CONFIG_SYS_I2C_SOFT_SLAVE      0x00
 #define I2C_SOFT_DECLARATIONS2
 #define CONFIG_SYS_I2C_SOFT_SPEED_2     50000
 #define CONFIG_SYS_I2C_SOFT_SLAVE_2     0x00
-#define I2C_SOFT_DECLARATIONS3
-#define CONFIG_SYS_I2C_SOFT_SPEED_3     50000
-#define CONFIG_SYS_I2C_SOFT_SLAVE_3     0x00
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
 #define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_I2C_MULTI_BUS
-#define CONFIG_SOFT_I2C_MULTI_BUS
-#define CONFIG_SYS_MAX_I2C_BUS         15
-
-#define CONFIG_SOFT_I2C_I2C5_SCL exynos4x12_gpio_part1_get_nr(d0, 3)
-#define CONFIG_SOFT_I2C_I2C5_SDA exynos4x12_gpio_part1_get_nr(d0, 2)
-#define CONFIG_SOFT_I2C_I2C9_SCL exynos4x12_gpio_part1_get_nr(f1, 4)
-#define CONFIG_SOFT_I2C_I2C9_SDA exynos4x12_gpio_part1_get_nr(f1, 5)
-#define CONFIG_SOFT_I2C_I2C10_SCL exynos4x12_gpio_part2_get_nr(m2, 1)
-#define CONFIG_SOFT_I2C_I2C10_SDA exynos4x12_gpio_part2_get_nr(m2, 0)
-#define CONFIG_SOFT_I2C_GPIO_SCL get_multi_scl_pin()
-#define CONFIG_SOFT_I2C_GPIO_SDA get_multi_sda_pin()
-#define I2C_INIT multi_i2c_init()
+
+#ifndef __ASSEMBLY__
+int get_soft_i2c_scl_pin(void);
+int get_soft_i2c_sda_pin(void);
+#endif
+#define CONFIG_SOFT_I2C_GPIO_SCL       get_soft_i2c_scl_pin()
+#define CONFIG_SOFT_I2C_GPIO_SDA       get_soft_i2c_sda_pin()
 
 /* POWER */
 #define CONFIG_POWER
 #define CONFIG_POWER_MUIC_MAX77693
 #define CONFIG_POWER_FG_MAX77693
 #define CONFIG_POWER_BATTERY_TRATS2
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_S3C_UDC_OTG
+#define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW    2
+#define CONFIG_USB_CABLE_CHECK
 
 /* LCD */
 #define CONFIG_EXYNOS_FB
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 250 * 4) + (1 << 12))
 
+#define CONFIG_CMD_USB_MASS_STORAGE
+#define CONFIG_USB_GADGET_MASS_STORAGE
+
 /* Pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT    1
 
index 0615117..b7804d2 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /*
diff --git a/include/configs/usb_a9263.h b/include/configs/usb_a9263.h
new file mode 100644 (file)
index 0000000..c4d04de
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * (C) Copyright 2007-2013
+ * Stelian Pop <stelian.pop@leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ * Thomas Petazzoni, Free Electrons, <thomas.petazzoni@free-electrons.com>
+ * Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+ *
+ * Settings for Calao USB-A9263 board
+ *
+ * U-Boot image has to be less than 200704 bytes, otherwise at91bootstrap
+ * installed on board will not be able to load it properly.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+#include <asm/hardware.h>
+
+/* ARM asynchronous clock */
+#define CONFIG_SYS_AT91_MAIN_CLOCK     12000000        /* 12 MHz crystal */
+#define CONFIG_SYS_AT91_SLOW_CLOCK     32768
+#define CONFIG_SYS_HZ                  1000
+
+#define CONFIG_MACH_TYPE               MACH_TYPE_USB_A9263
+
+#define CONFIG_ARCH_CPU_INIT
+
+#define CONFIG_CMDLINE_TAG     /* enable passing of ATAGs      */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+#define CONFIG_DISPLAY_CPUINFO
+
+#define CONFIG_OF_LIBFDT
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_SYS_TEXT_BASE           0x23f00000
+
+/*
+ * Hardware drivers
+ */
+#define CONFIG_AT91_GPIO
+
+/* serial console */
+#define CONFIG_ATMEL_USART
+#define CONFIG_USART_BASE              ATMEL_BASE_DBGU
+#define CONFIG_USART_ID                        ATMEL_ID_SYS
+#define CONFIG_BAUDRATE                        115200
+
+#define CONFIG_BOOTDELAY 3
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NAND
+
+/* SDRAM */
+#define CONFIG_NR_DRAM_BANKS           1
+#define CONFIG_SYS_SDRAM_BASE          ATMEL_BASE_CS1
+#define CONFIG_SYS_SDRAM_SIZE          0x04000000
+
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
+
+/* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
+#define CONFIG_HAS_DATAFLASH
+#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
+#define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
+#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000
+#define AT91_SPI_CLK                           8000000
+#define DATAFLASH_TCSS                         (0x1a << 16)
+#define DATAFLASH_TCHS                         (0x1 << 24)
+
+/* no NOR flash */
+#define CONFIG_SYS_NO_FLASH
+
+/* NAND flash */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_NAND_ATMEL
+#define CONFIG_SYS_MAX_NAND_DEVICE             1
+#define CONFIG_SYS_NAND_BASE                   ATMEL_BASE_CS3
+/* our ALE is AD21 */
+#define CONFIG_SYS_NAND_MASK_ALE               (1 << 21)
+/* our CLE is AD22 */
+#define CONFIG_SYS_NAND_MASK_CLE               (1 << 22)
+#define CONFIG_SYS_NAND_ENABLE_PIN             GPIO_PIN_PD(15)
+#define CONFIG_SYS_NAND_READY_PIN              GPIO_PIN_PA(22)
+#endif
+
+#define MTDPARTS_DEFAULT \
+       "mtdparts=atmel_nand:16m(kernel)ro,120m(root1),-(root2)"
+
+/* Ethernet */
+#define CONFIG_MACB
+#define CONFIG_RMII
+#define CONFIG_NET_RETRY_COUNT                 20
+#define CONFIG_AT91_WANTS_COMMON_PHY
+
+/* USB */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_DOS_PARTITION
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
+#define CONFIG_SYS_USB_OHCI_REGS_BASE          0x00a00000
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME          "at91sam9263"
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     2
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_FAT
+#endif
+
+#define CONFIG_SYS_LOAD_ADDR                   0x22000000
+
+#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END                 0x23e00000
+
+/* bootstrap + u-boot + env in dataflash on CS0 */
+#define CONFIG_ENV_IS_IN_DATAFLASH
+#define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x4000)
+#define CONFIG_ENV_OFFSET      0x2000
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + \
+                                CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_SIZE                0x2000
+#define CONFIG_BOOTCOMMAND     "nboot 21000000 0"
+#define CONFIG_BOOTARGS                "console=ttyS0,115200 " \
+       "root=/dev/mtdblock1 " \
+       "mtdparts=" MTDPARTS_DEFAULT " " \
+       "rw rootfstype=jffs2"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "mtdparts=" MTDPARTS_DEFAULT "\0" \
+
+#define CONFIG_SYS_PROMPT              "U-Boot> "
+#define CONFIG_SYS_CBSIZE              256
+#define CONFIG_SYS_MAXARGS             16
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                        sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_LONGHELP
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN  ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
+
+#endif
index 6da5e8f..7e78f8a 100644 (file)
 #define VEXPRESS_FLASHPROG_FLVPPEN     (1 << 0)
 
 #define CONFIG_SYS_TIMER_RATE          1000000
-#define CONFIG_SYS_TIMER_COUNTER       (0x10011000 + 0x4)
+#define CONFIG_SYS_TIMER_COUNTER       (V2M_TIMER01 + 0x4)
 #define CONFIG_SYS_TIMER_COUNTS_DOWN
 
 /* SMSC9115 Ethernet from SMSC9118 family */
index 1489080..88aaa95 100644 (file)
 #define CONFIG_SYS_NAND_DBW_8          1
 #define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)       /* our ALE is AD21 */
 #define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)       /* our CLE is AD22 */
-#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIO_PORTD, 15
-#define CONFIG_SYS_NAND_READY_PIN      AT91_PIO_PORTB, 0
+#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PD(15)
+#define CONFIG_SYS_NAND_READY_PIN      GPIO_PIN_PB(0)
 #define CONFIG_SYS_64BIT_VSPRINTF      /* needed for nand_util.c */
 #endif
 
 #define CONFIG_RMII
 #define CONFIG_NET_MULTI
 #define CONFIG_NET_RETRY_COUNT         5
+#define CONFIG_AT91_WANTS_COMMON_PHY
 
 #define CONFIG_OVERWRITE_ETHADDR_ONCE
 
index 734d13f..7ecbafe 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 /*
index c3ac612..71a89b6 100644 (file)
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400  /* kgdb serial port speed */
-#define        CONFIG_KGDB_SER_INDEX           2       /* which serial port to use */
 #endif
 
 /*
index 431ed96..2999d1b 100644 (file)
@@ -84,7 +84,6 @@
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200                  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  1                       /* which serial port to use */
 #endif
 
 /*
index 9d58738..d8aeb37 100644 (file)
 
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
 /*
index 52a745e..f9ccca7 100644 (file)
@@ -117,7 +117,6 @@ unsigned char zipitz2_spi_read(void);
  */
 #ifdef CONFIG_CMD_KGDB
 #define        CONFIG_KGDB_BAUDRATE            230400          /* speed to run kgdb serial port */
-#define        CONFIG_KGDB_SER_INDEX           2               /* which serial port to use */
 #endif
 
 /*
index 6c91143..a02dd67 100644 (file)
@@ -141,6 +141,7 @@ struct dwmci_host {
        struct mmc *mmc;
 
        void (*clksel)(struct dwmci_host *host);
+       void (*board_init)(struct dwmci_host *host);
        unsigned int (*get_mmc_clk)(int dev_index);
 };
 
diff --git a/include/faraday/ftsdc021.h b/include/faraday/ftsdc021.h
new file mode 100644 (file)
index 0000000..de8e250
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013 Faraday Technology
+ * Dante Su <dantesu@faraday-tech.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __FTSDC021_H
+#define __FTSDC021_H
+
+int ftsdc021_sdhci_init(u32 regbase);
+
+#endif /* __FTSDC021_H */
index c1be533..f93a183 100644 (file)
@@ -147,7 +147,7 @@ extern struct i2c_bus_hose  i2c_bus[];
 
 # elif (defined(CONFIG_AT91RM9200) || \
        defined(CONFIG_AT91SAM9260) ||  defined(CONFIG_AT91SAM9261) || \
-       defined(CONFIG_AT91SAM9263)) && !defined(CONFIG_AT91_LEGACY)
+       defined(CONFIG_AT91SAM9263))
 #  define I2C_SOFT_DECLARATIONS        at91_pio_t *pio = (at91_pio_t *) ATMEL_BASE_PIOA;
 # else
 #  define I2C_SOFT_DECLARATIONS
index e2563c9..aba7922 100644 (file)
@@ -259,13 +259,24 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
  * spi_free_slave() to free it later.
  *
  * @param blob:                Device tree blob
- * @param node:                SPI peripheral node to use
- * @param cs:          Chip select to use
- * @param max_hz:      Maximum SCK rate in Hz (0 for default)
- * @param mode:                Clock polarity, clock phase and other parameters
+ * @param slave_node:  Slave node to use
+ * @param spi_node:    SPI peripheral node to use
  * @return pointer to new spi_slave structure
  */
-struct spi_slave *spi_setup_slave_fdt(const void *blob, int node,
-               unsigned int cs, unsigned int max_hz, unsigned int mode);
+struct spi_slave *spi_setup_slave_fdt(const void *blob, int slave_node,
+                                     int spi_node);
+
+/**
+ * spi_base_setup_slave_fdt() - helper function to set up a SPI slace
+ *
+ * This decodes SPI properties from the slave node to determine the
+ * chip select and SPI parameters.
+ *
+ * @blob:      Device tree blob
+ * @busnum:    Bus number to use
+ * @node:      Device tree node for the SPI bus
+ */
+struct spi_slave *spi_base_setup_slave_fdt(const void *blob, int busnum,
+                                          int node);
 
 #endif /* _SPI_H_ */
index 25ca8f1..afc3a58 100644 (file)
@@ -67,6 +67,19 @@ struct spi_flash {
 
 struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
                unsigned int max_hz, unsigned int spi_mode);
+
+/**
+ * Set up a new SPI flash from an fdt node
+ *
+ * @param blob         Device tree blob
+ * @param slave_node   Pointer to this SPI slave node in the device tree
+ * @param spi_node     Cached pointer to the SPI interface this node belongs
+ *                     to
+ * @return 0 if ok, -1 on error
+ */
+struct spi_flash *spi_flash_probe_fdt(const void *blob, int slave_node,
+                                     int spi_node);
+
 void spi_flash_free(struct spi_flash *flash);
 
 static inline int spi_flash_read(struct spi_flash *flash, u32 offset,
index b4035ba..7898699 100644 (file)
 #define CTRL_P2_EOCP2  (1 << 1)
 #define CTRL_P2_BUSY   (1 << 0)
 
+#define TWL6032_CTRL_P1        0x36
+#define CTRL_P1_SP1    (1 << 3)
+
 #define GPCH0_LSB      0x57
 #define GPCH0_MSB      0x58
 
+#define TWL6032_GPCH0_LSB      0x3b
+
+#define TWL6032_GPSELECT_ISB   0x35
+
+#define USB_PRODUCT_ID_LSB     0x02
+
+#define TWL6030_GPADC_VBAT_CHNL        0x07
+#define TWL6032_GPADC_VBAT_CHNL        0x12
+
+#define TWL6030_GPADC_CTRL     0x2e
+#define TWL6032_GPADC_CTRL2    0x2f
+#define GPADC_CTRL2_CH18_SCALER_EN     (1 << 2)
+#define GPADC_CTRL_SCALER_DIV4         (1 << 3)
+
+#define TWL6030_VBAT_MULT      40 * 1000
+#define TWL6032_VBAT_MULT      25 * 1000
+
+#define TWL6030_VBAT_SHIFT     (10 + 3)
+#define TWL6032_VBAT_SHIFT     (12 + 2)
+
+enum twl603x_chip_type{
+       chip_TWL6030,
+       chip_TWL6032,
+       chip_TWL603X_cnt
+};
+
+struct twl6030_data{
+       u8 chip_type;
+       u8 adc_rbase;
+       u8 adc_ctrl;
+       u8 adc_enable;
+       int vbat_mult;
+       int vbat_shift;
+};
+
 /* Functions to read and write from TWL6030 */
 static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
 {
index c5d1577..122043c 100644 (file)
@@ -9,6 +9,9 @@
 #define _VXWORKS_H_
 
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+void boot_prep_vxworks(bootm_headers_t *images);
+void boot_jump_vxworks(bootm_headers_t *images);
+void do_bootvx_fdt(bootm_headers_t *images);
 
 /*
  * Use bootaddr to find the location in memory that VxWorks
index 09bb05a..8085aa4 100644 (file)
@@ -71,8 +71,8 @@ unsigned long __weak notrace timer_get_us(void)
 }
 static unsigned long long usec_to_tick(unsigned long usec)
 {
-       uint64_t tick = usec * get_tbclk();
-       usec *= get_tbclk();
+       uint64_t tick = usec;
+       tick *= get_tbclk();
        do_div(tick, 1000000);
        return tick;
 }
index 1439244..2fa6f8a 100644 (file)
@@ -5,16 +5,14 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += post.o
+obj- += post.o
 obj-$(CONFIG_POST_STD_LIST)    += tests.o
 
-obj-$(CONFIG_HAS_POST) += drivers/
-ifeq ($(ARCH),powerpc)
-obj-$(CONFIG_HAS_POST) += lib_powerpc/
-endif
-ifneq ($(filter mpc83xx mpc8xx ppc4xx,$(CPU)),)
-obj-$(CONFIG_HAS_POST) += cpu/$(CPU)/
-endif
+obj-y += drivers/
+obj-$(CONFIG_PPC) += lib_powerpc/
+obj-$(CONFIG_MPC83xx) += cpu/mpc83xx/
+obj-$(CONFIG_8xx) += cpu/mpc8xx/
+obj-$(CONFIG_4xx) += cpu/ppc4xx/
 ifneq ($(filter lwmon lwmon5 netta pdm360ng,$(BOARD)),)
-obj-$(CONFIG_HAS_POST) += board/$(BOARD)/
+obj-y += board/$(BOARD)/
 endif
index b23debc..7f6d5a0 100644 (file)
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += sysmon.o
+obj-y += sysmon.o
index a50ce67..76262c7 100644 (file)
@@ -5,4 +5,4 @@
 #
 # SPDX-License-Identifier:     GPL-2.0+
 
-obj-$(CONFIG_HAS_POST) += sysmon.o watchdog.o dspic.o fpga.o dsp.o gdc.o
+obj-y += sysmon.o watchdog.o dspic.o fpga.o dsp.o gdc.o
index 5c37f49..8fc1945 100644 (file)
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += codec.o dsp.o
+obj-y += codec.o dsp.o
index b43b77b..9aa96a1 100644 (file)
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += coproc_com.o
+obj-y += coproc_com.o
index 4b3c50e..d57b667 100644 (file)
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += ecc.o
+obj-y += ecc.o
index ed3e8e8..e9ec286 100644 (file)
@@ -5,12 +5,12 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += cache_4xx.o
-obj-$(CONFIG_HAS_POST) += cache.o
-obj-$(CONFIG_HAS_POST) += denali_ecc.o
-obj-$(CONFIG_HAS_POST) += ether.o
-obj-$(CONFIG_HAS_POST) += fpu.o
-obj-$(CONFIG_HAS_POST) += ocm.o
-obj-$(CONFIG_HAS_POST) += spr.o
-obj-$(CONFIG_HAS_POST) += uart.o
-obj-$(CONFIG_HAS_POST) += watchdog.o
+obj-y += cache_4xx.o
+obj-y += cache.o
+obj-y += denali_ecc.o
+obj-y += ether.o
+obj-y += fpu.o
+obj-y += ocm.o
+obj-y += spr.o
+obj-y += uart.o
+obj-y += watchdog.o
index 328f880..1abfb1f 100644 (file)
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += flash.o i2c.o memory.o rtc.o
+obj-y += flash.o i2c.o memory.o rtc.o
index d2b8a94..0cbb6b6 100644 (file)
@@ -5,9 +5,9 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += asm.o
-obj-$(CONFIG_HAS_POST) += cpu.o cmp.o cmpi.o two.o twox.o three.o threex.o
-obj-$(CONFIG_HAS_POST) += threei.o andi.o srawi.o rlwnm.o rlwinm.o rlwimi.o
-obj-$(CONFIG_HAS_POST) += store.o load.o cr.o b.o multi.o string.o complex.o
+obj-y += asm.o
+obj-y += cpu.o cmp.o cmpi.o two.o twox.o three.o threex.o
+obj-y += threei.o andi.o srawi.o rlwnm.o rlwinm.o rlwimi.o
+obj-y += store.o load.o cr.o b.o multi.o string.o complex.o
 
-obj-$(CONFIG_HAS_POST) += fpu/
+obj-y += fpu/
index ee01a31..ae56a82 100644 (file)
@@ -5,15 +5,15 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_HAS_POST) += 20001122-1.o
-obj-$(CONFIG_HAS_POST) += 20010114-2.o
-obj-$(CONFIG_HAS_POST) += 20010226-1.o
-obj-$(CONFIG_HAS_POST) += 980619-1.o
-obj-$(CONFIG_HAS_POST) += acc1.o
-obj-$(CONFIG_HAS_POST) += compare-fp-1.o
-obj-$(CONFIG_HAS_POST) += fpu.o
-obj-$(CONFIG_HAS_POST) += mul-subnormal-single-1.o
-obj-$(CONFIG_HAS_POST) += darwin-ldouble.o
+obj- += 20001122-1.o
+obj- += 20010114-2.o
+obj- += 20010226-1.o
+obj- += 980619-1.o
+obj- += acc1.o
+obj- += compare-fp-1.o
+obj- += fpu.o
+obj- += mul-subnormal-single-1.o
+obj- += darwin-ldouble.o
 
 CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
 CFLAGS += -mhard-float -fkeep-inline-functions
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from tools/binutils-version.sh
rename to scripts/binutils-version.sh
similarity index 100%
rename from tools/checkpatch.pl
rename to scripts/checkpatch.pl
similarity index 100%
rename from tools/checkstack.pl
rename to scripts/checkstack.pl
similarity index 100%
rename from tools/cleanpatch
rename to scripts/cleanpatch
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from tools/dtc-version.sh
rename to scripts/dtc-version.sh
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from tools/gcc-version.sh
rename to scripts/gcc-version.sh
diff --git a/spl/.gitignore b/spl/.gitignore
deleted file mode 100644 (file)
index 7c88147..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-u-boot-spl
-u-boot-spl.bin
-u-boot-spl.lds
-u-boot-spl.map
index 2a787af..1e88d74 100644 (file)
@@ -37,22 +37,15 @@ endif
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)
 
 ifdef  CONFIG_SPL_START_S_PATH
-START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH))
+START_PATH := $(CONFIG_SPL_START_S_PATH:"%"=%)
 else
 START_PATH := $(CPUDIR)
 endif
 
-START := $(START_PATH)/start.o
-ifeq ($(CPU),x86)
-START += $(START_PATH)/start16.o
-START += $(START_PATH)/resetvec.o
-endif
-ifeq ($(CPU),ppc4xx)
-START += $(START_PATH)/resetvec.o
-endif
-ifeq ($(CPU),mpc85xx)
-START += $(START_PATH)/resetvec.o
-endif
+head-y := $(START_PATH)/start.o
+head-$(CONFIG_X86) += $(START_PATH)/start16.o $(START_PATH)/resetvec.o
+head-$(CONFIG_4xx) += $(START_PATH)/resetvec.o
+head-$(CONFIG_MPC85xx) += $(START_PATH)/resetvec.o
 
 LIBS-y += arch/$(ARCH)/lib/
 
@@ -78,7 +71,7 @@ LIBS-y += fs/
 LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
 LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ \
        drivers/power/pmic/
-LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/
+LIBS-$(if $(CONFIG_CMD_NAND),$(CONFIG_SPL_NAND_SUPPORT)) += drivers/mtd/nand/
 LIBS-$(CONFIG_SPL_ONENAND_SUPPORT) += drivers/mtd/onenand/
 LIBS-$(CONFIG_SPL_DMA_SUPPORT) += drivers/dma/
 LIBS-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
@@ -90,17 +83,13 @@ LIBS-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += drivers/usb/musb-new/
 LIBS-$(CONFIG_SPL_USBETH_SUPPORT) += drivers/usb/gadget/
 LIBS-$(CONFIG_SPL_WATCHDOG_SUPPORT) += drivers/watchdog/
 
-ifneq (,$(CONFIG_MX23)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35))
+ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35))
 LIBS-y += arch/$(ARCH)/imx-common/
 endif
 
 LIBS-$(CONFIG_ARM) += arch/arm/cpu/
 LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
 
-ifneq ($(CONFIG_MX23)$(CONFIG_MX35),)
-LIBS-y += arch/$(ARCH)/imx-common/
-endif
-
 LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
 
 # Add GCC lib
@@ -109,7 +98,7 @@ PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/libgcc.o
 PLATFORM_LIBS := $(filter-out %/libgcc.o, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
 endif
 
-START := $(addprefix $(SPLTREE)/,$(START))
+START := $(addprefix $(SPLTREE)/,$(head-y))
 LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
 
 __START := $(subst $(obj),,$(START))
@@ -118,7 +107,7 @@ __LIBS := $(subst $(obj),,$(LIBS))
 # Linker Script
 ifdef CONFIG_SPL_LDSCRIPT
 # need to strip off double quotes
-LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SPL_LDSCRIPT)))
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(CONFIG_SPL_LDSCRIPT:"%"=%))
 endif
 
 ifeq ($(wildcard $(LDSCRIPT)),)
diff --git a/test/image/test-imagetools.sh b/test/image/test-imagetools.sh
new file mode 100755 (executable)
index 0000000..9e299e1
--- /dev/null
@@ -0,0 +1,141 @@
+#!/bin/bash
+#
+# Written by Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
+#
+# Sanity check for mkimage and dumpimage tools
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+# To run this:
+#
+# make O=sandbox sandbox_config
+# make O=sandbox
+# ./test/image/test-imagetools.sh
+
+BASEDIR=sandbox
+SRCDIR=sandbox/boot
+IMAGE_NAME="v1.0-test"
+IMAGE=linux.img
+DATAFILE0=vmlinuz
+DATAFILE1=initrd.img
+DATAFILE2=System.map
+DATAFILES="${DATAFILE0} ${DATAFILE1} ${DATAFILE2}"
+TEST_OUT=test_output
+MKIMAGE=${BASEDIR}/tools/mkimage
+DUMPIMAGE=${BASEDIR}/tools/dumpimage
+MKIMAGE_LIST=mkimage.list
+DUMPIMAGE_LIST=dumpimage.list
+
+# Remove all the files we created
+cleanup()
+{
+       local file
+
+       for file in ${DATAFILES}; do
+               rm -f ${file} ${SRCDIR}/${file}
+       done
+       rm -f ${IMAGE} ${DUMPIMAGE_LIST} ${MKIMAGE_LIST} ${TEST_OUT}
+       rmdir ${SRCDIR}
+}
+
+# Check that two files are the same
+assert_equal()
+{
+       if ! diff $1 $2; then
+               echo "Failed."
+               cleanup
+               exit 1
+       fi
+}
+
+# Create some test files
+create_files()
+{
+       local file
+
+       mkdir -p ${SRCDIR}
+       for file in ${DATAFILES}; do
+               head -c $RANDOM /dev/urandom >${SRCDIR}/${file}
+       done
+}
+
+# Run a command, echoing it first
+do_cmd()
+{
+       local cmd="$@"
+
+       echo "# ${cmd}"
+       ${cmd} 2>&1
+}
+
+# Run a command, redirecting output
+# Args:
+#    redirect_file
+#    command...
+do_cmd_redir()
+{
+       local redir="$1"
+       shift
+       local cmd="$@"
+
+       echo "# ${cmd}"
+       ${cmd} >${redir}
+}
+
+# Write files into an image
+create_image()
+{
+       local files="${SRCDIR}/${DATAFILE0}:${SRCDIR}/${DATAFILE1}"
+       files+=":${SRCDIR}/${DATAFILE2}"
+
+       echo -e "\nBuilding image..."
+       do_cmd ${MKIMAGE} -A x86 -O linux -T multi -n \"${IMAGE_NAME}\" \
+               -d ${files} ${IMAGE}
+       echo "done."
+}
+
+# Extract files from an image
+extract_image()
+{
+       echo -e "\nExtracting image contents..."
+       do_cmd ${DUMPIMAGE} -i ${IMAGE} -p 0 ${DATAFILE0}
+       do_cmd ${DUMPIMAGE} -i ${IMAGE} -p 1 ${DATAFILE1}
+       do_cmd ${DUMPIMAGE} -i ${IMAGE} -p 2 ${DATAFILE2}
+       do_cmd ${DUMPIMAGE} -i ${IMAGE} -p 2 ${DATAFILE2} -o ${TEST_OUT}
+       echo "done."
+}
+
+# List the contents of a file
+list_image()
+{
+       echo -e "\nListing image contents..."
+       do_cmd_redir ${MKIMAGE_LIST} ${MKIMAGE} -l ${IMAGE}
+       do_cmd_redir ${DUMPIMAGE_LIST} ${DUMPIMAGE} -l ${IMAGE}
+       echo "done."
+}
+
+main()
+{
+       local file
+
+       create_files
+
+       # Compress and extract multifile images, compare the result
+       create_image
+       extract_image
+       for file in ${DATAFILES}; do
+               assert_equal ${file} ${SRCDIR}/${file}
+       done
+       assert_equal ${TEST_OUT} ${DATAFILE2}
+
+       # List contents and compares output fro tools
+       list_image
+       assert_equal ${DUMPIMAGE_LIST} ${MKIMAGE_LIST}
+
+       # Remove files created
+       cleanup
+
+       echo "Tests passed."
+}
+
+main
index a7fee26..930fa2e 100644 (file)
@@ -3,12 +3,12 @@
 /gen_eth_addr
 /img2srec
 /kwboot
+/dumpimage
 /mkenvimage
 /mkimage
 /mpc86x_clk
 /mxsboot
 /ncb
-/ncp
 /proftool
 /ubsha1
 /xway-swap-bytes
index 14d94e3..e1264fd 100644 (file)
@@ -50,6 +50,7 @@ BIN_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
 BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
 BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
+BIN_FILES-y += dumpimage$(SFX)
 BIN_FILES-y += mkenvimage$(SFX)
 BIN_FILES-y += mkimage$(SFX)
 BIN_FILES-$(CONFIG_EXYNOS5250) += mk$(BOARD)spl$(SFX)
@@ -72,10 +73,12 @@ EXT_OBJ_FILES-y += lib/sha1.o
 # Source files located in the tools directory
 NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += default_image.o
+NOPED_OBJ_FILES-y += dumpimage.o
 NOPED_OBJ_FILES-y += fit_image.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += kwbimage.o
+NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
@@ -199,6 +202,30 @@ $(obj)xway-swap-bytes$(SFX):       $(obj)xway-swap-bytes.o
        $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
        $(HOSTSTRIP) $@
 
+$(obj)dumpimage$(SFX): $(obj)aisimage.o \
+                       $(FIT_SIG_OBJS) \
+                       $(obj)crc32.o \
+                       $(obj)default_image.o \
+                       $(obj)fit_image.o \
+                       $(obj)image-fit.o \
+                       $(obj)image.o \
+                       $(obj)image-host.o \
+                       $(obj)imagetool.o \
+                       $(obj)imximage.o \
+                       $(obj)kwbimage.o \
+                       $(obj)dumpimage.o \
+                       $(obj)md5.o \
+                       $(obj)mxsimage.o \
+                       $(obj)omapimage.o \
+                       $(obj)os_support.o \
+                       $(obj)pblimage.o \
+                       $(obj)sha1.o \
+                       $(obj)ublimage.o \
+                       $(LIBFDT_OBJS) \
+                       $(RSA_OBJS)
+       $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTLIBS)
+       $(HOSTSTRIP) $@
+
 $(obj)mkenvimage$(SFX):        $(obj)crc32.o $(obj)mkenvimage.o \
        $(obj)os_support.o
        $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
@@ -212,6 +239,7 @@ $(obj)mkimage$(SFX):        $(obj)aisimage.o \
                        $(obj)image-fit.o \
                        $(obj)image-host.o \
                        $(obj)image.o \
+                       $(obj)imagetool.o \
                        $(obj)imximage.o \
                        $(obj)kwbimage.o \
                        $(obj)md5.o \
index 04fb649..8de370a 100644 (file)
@@ -5,7 +5,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include "aisimage.h"
 #include <image.h>
 
@@ -176,7 +176,7 @@ static uint32_t *ais_insert_cmd_header(uint32_t cmd, uint32_t nargs,
 
 }
 
-static uint32_t *ais_alloc_buffer(struct mkimage_params *params)
+static uint32_t *ais_alloc_buffer(struct image_tool_params *params)
 {
        int dfd;
        struct stat sbuf;
@@ -216,7 +216,7 @@ static uint32_t *ais_alloc_buffer(struct mkimage_params *params)
        return ptr;
 }
 
-static uint32_t *ais_copy_image(struct mkimage_params *params,
+static uint32_t *ais_copy_image(struct image_tool_params *params,
        uint32_t *aisptr)
 
 {
@@ -252,7 +252,7 @@ static uint32_t *ais_copy_image(struct mkimage_params *params,
 
 }
 
-static int aisimage_generate(struct mkimage_params *params,
+static int aisimage_generate(struct image_tool_params *params,
        struct image_type_params *tparams)
 {
        FILE *fd = NULL;
@@ -370,7 +370,7 @@ static int aisimage_check_image_types(uint8_t type)
 }
 
 static int aisimage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct ais_header *ais_hdr = (struct ais_header *)ptr;
 
@@ -384,11 +384,11 @@ static int aisimage_verify_header(unsigned char *ptr, int image_size,
 }
 
 static void aisimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
 }
 
-int aisimage_check_params(struct mkimage_params *params)
+int aisimage_check_params(struct image_tool_params *params)
 {
        if (!params)
                return CFG_INVALID;
@@ -427,5 +427,5 @@ static struct image_type_params aisimage_params = {
 
 void init_ais_image_type(void)
 {
-       mkimage_register(&aisimage_params);
+       register_image_type(&aisimage_params);
 }
index fd8b9f5..0a0792e 100644 (file)
@@ -14,7 +14,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include <u-boot/crc.h>
 
@@ -29,7 +29,7 @@ static int image_check_image_types(uint8_t type)
                return EXIT_FAILURE;
 }
 
-static int image_check_params(struct mkimage_params *params)
+static int image_check_params(struct image_tool_params *params)
 {
        return  ((params->dflag && (params->fflag || params->lflag)) ||
                (params->fflag && (params->dflag || params->lflag)) ||
@@ -37,7 +37,7 @@ static int image_check_params(struct mkimage_params *params)
 }
 
 static int image_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        uint32_t len;
        const unsigned char *data;
@@ -86,7 +86,7 @@ static int image_verify_header(unsigned char *ptr, int image_size,
 }
 
 static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        uint32_t checksum;
 
@@ -117,6 +117,62 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
        image_set_hcrc(hdr, checksum);
 }
 
+static int image_save_datafile(struct image_tool_params *params,
+                              ulong file_data, ulong file_len)
+{
+       int dfd;
+       const char *datafile = params->outfile;
+
+       dfd = open(datafile, O_RDWR | O_CREAT | O_TRUNC | O_BINARY,
+                  S_IRUSR | S_IWUSR);
+       if (dfd < 0) {
+               fprintf(stderr, "%s: Can't open \"%s\": %s\n",
+                       params->cmdname, datafile, strerror(errno));
+               return -1;
+       }
+
+       if (write(dfd, (void *)file_data, file_len) != (ssize_t)file_len) {
+               fprintf(stderr, "%s: Write error on \"%s\": %s\n",
+                       params->cmdname, datafile, strerror(errno));
+               close(dfd);
+               return -1;
+       }
+
+       close(dfd);
+
+       return 0;
+}
+
+static int image_extract_datafile(void *ptr, struct image_tool_params *params)
+{
+       const image_header_t *hdr = (const image_header_t *)ptr;
+       ulong file_data;
+       ulong file_len;
+
+       if (image_check_type(hdr, IH_TYPE_MULTI)) {
+               ulong idx = params->pflag;
+               ulong count;
+
+               /* get the number of data files present in the image */
+               count = image_multi_count(hdr);
+
+               /* retrieve the "data file" at the idx position */
+               image_multi_getimg(hdr, idx, &file_data, &file_len);
+
+               if ((file_len == 0) || (idx >= count)) {
+                       fprintf(stderr, "%s: No such data file %ld in \"%s\"\n",
+                               params->cmdname, idx, params->imagefile);
+                       return -1;
+               }
+       } else {
+               file_data = image_get_data(hdr);
+               file_len = image_get_size(hdr);
+       }
+
+       /* save the "data file" into the file system */
+       return image_save_datafile(params, file_data, file_len);
+}
+
 /*
  * Default image type parameters definition
  */
@@ -128,10 +184,11 @@ static struct image_type_params defimage_params = {
        .verify_header = image_verify_header,
        .print_header = image_print_contents,
        .set_header = image_set_header,
+       .extract_datafile = image_extract_datafile,
        .check_params = image_check_params,
 };
 
 void init_default_image_type(void)
 {
-       mkimage_register(&defimage_params);
+       register_image_type(&defimage_params);
 }
diff --git a/tools/dumpimage.c b/tools/dumpimage.c
new file mode 100644 (file)
index 0000000..542ee28
--- /dev/null
@@ -0,0 +1,305 @@
+/*
+ * Based on mkimage.c.
+ *
+ * Written by Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "dumpimage.h"
+#include <image.h>
+#include <version.h>
+
+static void usage(void);
+
+/* image_type_params linked list to maintain registered image types supports */
+static struct image_type_params *dumpimage_tparams;
+
+/* parameters initialized by core will be used by the image type code */
+static struct image_tool_params params = {
+       .type = IH_TYPE_KERNEL,
+};
+
+/**
+ * dumpimage_register() - register respective image generation/list support
+ *
+ * the input struct image_type_params is checked and appended to the link
+ * list, if the input structure is already registered, issue an error
+ *
+ * @tparams: Image type parameters
+ */
+static void dumpimage_register(struct image_type_params *tparams)
+{
+       struct image_type_params **tp;
+
+       if (!tparams) {
+               fprintf(stderr, "%s: %s: Null input\n", params.cmdname,
+                       __func__);
+               exit(EXIT_FAILURE);
+       }
+
+       /* scan the linked list, check for registry and point the last one */
+       for (tp = &dumpimage_tparams; *tp != NULL; tp = &(*tp)->next) {
+               if (!strcmp((*tp)->name, tparams->name)) {
+                       fprintf(stderr, "%s: %s already registered\n",
+                               params.cmdname, tparams->name);
+                       return;
+               }
+       }
+
+       /* add input struct entry at the end of link list */
+       *tp = tparams;
+       /* mark input entry as last entry in the link list */
+       tparams->next = NULL;
+
+       debug("Registered %s\n", tparams->name);
+}
+
+/**
+ * dumpimage_get_type() - find the image type params for a given image type
+ *
+ * Scan all registered image types and check the input type_id for each
+ * supported image type
+ *
+ * @return respective image_type_params pointer. If the input type is not
+ * supported by any of registered image types, returns NULL
+ */
+static struct image_type_params *dumpimage_get_type(int type)
+{
+       struct image_type_params *curr;
+
+       for (curr = dumpimage_tparams; curr != NULL; curr = curr->next) {
+               if (curr->check_image_type) {
+                       if (!curr->check_image_type(type))
+                               return curr;
+               }
+       }
+       return NULL;
+}
+
+/*
+ * dumpimage_verify_print_header() - verifies the image header
+ *
+ * Scan registered image types and verify the image_header for each
+ * supported image type. If verification is successful, this prints
+ * the respective header.
+ *
+ * @return 0 on success, negative if input image format does not match with
+ * any of supported image types
+ */
+static int dumpimage_verify_print_header(void *ptr, struct stat *sbuf)
+{
+       int retval = -1;
+       struct image_type_params *curr;
+
+       for (curr = dumpimage_tparams; curr != NULL; curr = curr->next) {
+               if (curr->verify_header) {
+                       retval = curr->verify_header((unsigned char *)ptr,
+                                                    sbuf->st_size, &params);
+                       if (retval != 0)
+                               continue;
+                       /*
+                        * Print the image information  if verify is
+                        * successful
+                        */
+                       if (curr->print_header) {
+                               curr->print_header(ptr);
+                       } else {
+                               fprintf(stderr,
+                                       "%s: print_header undefined for %s\n",
+                                       params.cmdname, curr->name);
+                       }
+                       break;
+               }
+       }
+
+       return retval;
+}
+
+/*
+ * dumpimage_extract_datafile -
+ *
+ * It scans all registered image types,
+ * verifies image_header for each supported image type
+ * if verification is successful, it extracts the desired file,
+ * indexed by pflag, from the image
+ *
+ * returns negative if input image format does not match with any of
+ * supported image types
+ */
+static int dumpimage_extract_datafile(void *ptr, struct stat *sbuf)
+{
+       int retval = -1;
+       struct image_type_params *curr;
+
+       for (curr = dumpimage_tparams; curr != NULL; curr = curr->next) {
+               if (curr->verify_header) {
+                       retval = curr->verify_header((unsigned char *)ptr,
+                                                    sbuf->st_size, &params);
+                       if (retval != 0)
+                               continue;
+                       /*
+                        * Extract the file from the image
+                        * if verify is successful
+                        */
+                       if (curr->extract_datafile) {
+                               curr->extract_datafile(ptr, &params);
+                       } else {
+                               fprintf(stderr,
+                                       "%s: extract_datafile undefined for %s\n",
+                                       params.cmdname, curr->name);
+                       break;
+                       }
+               }
+       }
+
+       return retval;
+}
+
+int main(int argc, char **argv)
+{
+       int opt;
+       int ifd = -1;
+       struct stat sbuf;
+       char *ptr;
+       int retval = 0;
+       struct image_type_params *tparams = NULL;
+
+       /* Init all image generation/list support */
+       register_image_tool(dumpimage_register);
+
+       params.cmdname = *argv;
+
+       while ((opt = getopt(argc, argv, "li:o:p:V")) != -1) {
+               switch (opt) {
+               case 'l':
+                       params.lflag = 1;
+                       break;
+               case 'i':
+                       params.imagefile = optarg;
+                       params.iflag = 1;
+                       break;
+               case 'o':
+                       params.outfile = optarg;
+                       break;
+               case 'p':
+                       params.pflag = strtoul(optarg, &ptr, 10);
+                       if (*ptr) {
+                               fprintf(stderr,
+                                       "%s: invalid file position %s\n",
+                                       params.cmdname, *argv);
+                               exit(EXIT_FAILURE);
+                       }
+                       break;
+               case 'V':
+                       printf("dumpimage version %s\n", PLAIN_VERSION);
+                       exit(EXIT_SUCCESS);
+               default:
+                       usage();
+               }
+       }
+
+       if (optind >= argc)
+               usage();
+
+       /* set tparams as per input type_id */
+       tparams = dumpimage_get_type(params.type);
+       if (tparams == NULL) {
+               fprintf(stderr, "%s: unsupported type %s\n",
+                       params.cmdname, genimg_get_type_name(params.type));
+               exit(EXIT_FAILURE);
+       }
+
+       /*
+        * check the passed arguments parameters meets the requirements
+        * as per image type to be generated/listed
+        */
+       if (tparams->check_params) {
+               if (tparams->check_params(&params))
+                       usage();
+       }
+
+       if (params.iflag)
+               params.datafile = argv[optind];
+       else
+               params.imagefile = argv[optind];
+       if (!params.outfile)
+               params.outfile = params.datafile;
+
+       ifd = open(params.imagefile, O_RDONLY|O_BINARY);
+       if (ifd < 0) {
+               fprintf(stderr, "%s: Can't open \"%s\": %s\n",
+                       params.cmdname, params.imagefile,
+                       strerror(errno));
+               exit(EXIT_FAILURE);
+       }
+
+       if (params.lflag || params.iflag) {
+               if (fstat(ifd, &sbuf) < 0) {
+                       fprintf(stderr, "%s: Can't stat \"%s\": %s\n",
+                               params.cmdname, params.imagefile,
+                               strerror(errno));
+                       exit(EXIT_FAILURE);
+               }
+
+               if ((unsigned)sbuf.st_size < tparams->header_size) {
+                       fprintf(stderr,
+                               "%s: Bad size: \"%s\" is not valid image\n",
+                               params.cmdname, params.imagefile);
+                       exit(EXIT_FAILURE);
+               }
+
+               ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, ifd, 0);
+               if (ptr == MAP_FAILED) {
+                       fprintf(stderr, "%s: Can't read \"%s\": %s\n",
+                               params.cmdname, params.imagefile,
+                               strerror(errno));
+                       exit(EXIT_FAILURE);
+               }
+
+               /*
+                * Both calls bellow scan through dumpimage registry for all
+                * supported image types and verify the input image file
+                * header for match
+                */
+               if (params.iflag) {
+                       /*
+                        * Extract the data files from within the matched
+                        * image type. Returns the error code if not matched
+                        */
+                       retval = dumpimage_extract_datafile(ptr, &sbuf);
+               } else {
+                       /*
+                        * Print the image information for matched image type
+                        * Returns the error code if not matched
+                        */
+                       retval = dumpimage_verify_print_header(ptr, &sbuf);
+               }
+
+               (void)munmap((void *)ptr, sbuf.st_size);
+               (void)close(ifd);
+
+               return retval;
+       }
+
+       (void)close(ifd);
+
+       return EXIT_SUCCESS;
+}
+
+static void usage(void)
+{
+       fprintf(stderr, "Usage: %s -l image\n"
+               "          -l ==> list image header information\n",
+               params.cmdname);
+       fprintf(stderr,
+               "       %s -i image [-p position] [-o outfile] data_file\n"
+               "          -i ==> extract from the 'image' a specific 'data_file'"
+               ", indexed by 'position' (starting at 0)\n",
+               params.cmdname);
+       fprintf(stderr,
+               "       %s -V ==> print version information and exit\n",
+               params.cmdname);
+
+       exit(EXIT_FAILURE);
+}
diff --git a/tools/dumpimage.h b/tools/dumpimage.h
new file mode 100644 (file)
index 0000000..d78523d
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Based on mkimage.c.
+ *
+ * Written by Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _DUMPIMAGE_H_
+#define _DUMPIMAGE_H_
+
+#include "os_support.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+#include <sha1.h>
+#include "fdt_host.h"
+#include "imagetool.h"
+
+#undef DUMPIMAGE_DEBUG
+
+#ifdef DUMPIMAGE_DEBUG
+#define debug(fmt, args...)    printf(fmt, ##args)
+#else
+#define debug(fmt, args...)
+#endif /* DUMPIMAGE_DEBUG */
+
+#endif /* _DUMPIMAGE_H_ */
index 0400a60..1466164 100644 (file)
@@ -14,6 +14,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#include "imagetool.h"
 #include "mkimage.h"
 #include <image.h>
 #include <u-boot/crc.h>
@@ -21,7 +22,7 @@
 static image_header_t header;
 
 static int fit_verify_header (unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        return fdt_check_header(ptr);
 }
@@ -34,7 +35,7 @@ static int fit_check_image_types (uint8_t type)
                return EXIT_FAILURE;
 }
 
-int mmap_fdt(struct mkimage_params *params, const char *fname, void **blobp,
+int mmap_fdt(struct image_tool_params *params, const char *fname, void **blobp,
                struct stat *sbuf)
 {
        void *ptr;
@@ -88,7 +89,7 @@ int mmap_fdt(struct mkimage_params *params, const char *fname, void **blobp,
  * returns:
  *     only on success, otherwise calls exit (EXIT_FAILURE);
  */
-static int fit_handle_file (struct mkimage_params *params)
+static int fit_handle_file(struct image_tool_params *params)
 {
        char tmpfile[MKIMAGE_MAX_TMPFILE_LEN];
        char cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN];
@@ -184,7 +185,7 @@ err_system:
        return -1;
 }
 
-static int fit_check_params (struct mkimage_params *params)
+static int fit_check_params(struct image_tool_params *params)
 {
        return  ((params->dflag && (params->fflag || params->lflag)) ||
                (params->fflag && (params->dflag || params->lflag)) ||
@@ -205,5 +206,5 @@ static struct image_type_params fitimage_params = {
 
 void init_fit_image_type (void)
 {
-       mkimage_register (&fitimage_params);
+       register_image_type(&fitimage_params);
 }
diff --git a/tools/imagetool.c b/tools/imagetool.c
new file mode 100644 (file)
index 0000000..29d2189
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2013
+ *
+ * Written by Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "imagetool.h"
+
+/*
+ * Callback function to register a image type within a tool
+ */
+static imagetool_register_t register_func;
+
+/*
+ * register_image_tool -
+ *
+ * The tool provides its own registration function in order to all image
+ * types initialize themselves.
+ */
+void register_image_tool(imagetool_register_t image_register)
+{
+       /*
+        * Save the image tool callback function. It will be used to register
+        * image types within that tool
+        */
+       register_func = image_register;
+
+       /* Init Freescale PBL Boot image generation/list support */
+       init_pbl_image_type();
+       /* Init Kirkwood Boot image generation/list support */
+       init_kwb_image_type();
+       /* Init Freescale imx Boot image generation/list support */
+       init_imx_image_type();
+       /* Init Freescale mxs Boot image generation/list support */
+       init_mxs_image_type();
+       /* Init FIT image generation/list support */
+       init_fit_image_type();
+       /* Init TI OMAP Boot image generation/list support */
+       init_omap_image_type();
+       /* Init Default image generation/list support */
+       init_default_image_type();
+       /* Init Davinci UBL support */
+       init_ubl_image_type();
+       /* Init Davinci AIS support */
+       init_ais_image_type();
+}
+
+/*
+ * register_image_type -
+ *
+ * Register a image type within a tool
+ */
+void register_image_type(struct image_type_params *tparams)
+{
+       register_func(tparams);
+}
diff --git a/tools/imagetool.h b/tools/imagetool.h
new file mode 100644 (file)
index 0000000..c2c9aea
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * (C) Copyright 2013
+ *
+ * Written by Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _IMAGETOOL_H_
+#define _IMAGETOOL_H_
+
+#include "os_support.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+#include <sha1.h>
+#include "fdt_host.h"
+
+#define ARRAY_SIZE(x)          (sizeof(x) / sizeof((x)[0]))
+
+#define IH_ARCH_DEFAULT                IH_ARCH_INVALID
+
+/*
+ * This structure defines all such variables those are initialized by
+ * mkimage and dumpimage main core and need to be referred by image
+ * type specific functions
+ */
+struct image_tool_params {
+       int dflag;
+       int eflag;
+       int fflag;
+       int iflag;
+       int lflag;
+       int pflag;
+       int vflag;
+       int xflag;
+       int skipcpy;
+       int os;
+       int arch;
+       int type;
+       int comp;
+       char *dtc;
+       unsigned int addr;
+       unsigned int ep;
+       char *imagename;
+       char *imagename2;
+       char *datafile;
+       char *imagefile;
+       char *cmdname;
+       const char *outfile;    /* Output filename */
+       const char *keydir;     /* Directory holding private keys */
+       const char *keydest;    /* Destination .dtb for public key */
+       const char *comment;    /* Comment to add to signature node */
+       int require_keys;       /* 1 to mark signing keys as 'required' */
+};
+
+/*
+ * image type specific variables and callback functions
+ */
+struct image_type_params {
+       /* name is an identification tag string for added support */
+       char *name;
+       /*
+        * header size is local to the specific image type to be supported,
+        * mkimage core treats this as number of bytes
+        */
+       uint32_t header_size;
+       /* Image type header pointer */
+       void *hdr;
+       /*
+        * There are several arguments that are passed on the command line
+        * and are registered as flags in image_tool_params structure.
+        * This callback function can be used to check the passed arguments
+        * are in-lined with the image type to be supported
+        *
+        * Returns 1 if parameter check is successful
+        */
+       int (*check_params) (struct image_tool_params *);
+       /*
+        * This function is used by list command (i.e. mkimage -l <filename>)
+        * image type verification code must be put here
+        *
+        * Returns 0 if image header verification is successful
+        * otherwise, returns respective negative error codes
+        */
+       int (*verify_header) (unsigned char *, int, struct image_tool_params *);
+       /* Prints image information abstracting from image header */
+       void (*print_header) (const void *);
+       /*
+        * The header or image contents need to be set as per image type to
+        * be generated using this callback function.
+        * further output file post processing (for ex. checksum calculation,
+        * padding bytes etc..) can also be done in this callback function.
+        */
+       void (*set_header) (void *, struct stat *, int,
+                                       struct image_tool_params *);
+       /*
+        * This function is used by the command to retrieve a data file from
+        * the image (i.e. dumpimage -i <image> -p <position> <data_file>).
+        * Thus the code to extract a file from an image must be put here.
+        *
+        * Returns 0 if the file was successfully retrieved from the image,
+        * or a negative value on error.
+        */
+       int (*extract_datafile) (void *, struct image_tool_params *);
+       /*
+        * Some image generation support for ex (default image type) supports
+        * more than one type_ids, this callback function is used to check
+        * whether input (-T <image_type>) is supported by registered image
+        * generation/list low level code
+        */
+       int (*check_image_type) (uint8_t);
+       /* This callback function will be executed if fflag is defined */
+       int (*fflag_handle) (struct image_tool_params *);
+       /*
+        * This callback function will be executed for variable size record
+        * It is expected to build this header in memory and return its length
+        * and a pointer to it by using image_type_params.header_size and
+        * image_type_params.hdr. The return value shall indicate if an
+        * additional padding should be used when copying the data image
+        * by returning the padding length.
+        */
+       int (*vrec_header) (struct image_tool_params *,
+               struct image_type_params *);
+       /* pointer to the next registered entry in linked list */
+       struct image_type_params *next;
+};
+
+/*
+ * Tool registration function.
+ */
+typedef void (*imagetool_register_t)(struct image_type_params *);
+
+/*
+ * Initializes all image types with the given registration callback
+ * function.
+ * An image tool uses this function to initialize all image types.
+ */
+void register_image_tool(imagetool_register_t image_register);
+
+/*
+ * Register a image type within a tool.
+ * An image type uses this function to register itself within
+ * all tools.
+ */
+void register_image_type(struct image_type_params *tparams);
+
+/*
+ * There is a c file associated with supported image type low level code
+ * for ex. default_image.c, fit_image.c
+ * init_xxx_type() is the only function referred by image tool core to avoid
+ * a single lined header file, you can define them here
+ *
+ * Supported image types init functions
+ */
+void init_default_image_type(void);
+void init_pbl_image_type(void);
+void init_ais_image_type(void);
+void init_kwb_image_type(void);
+void init_imx_image_type(void);
+void init_mxs_image_type(void);
+void init_fit_image_type(void);
+void init_ubl_image_type(void);
+void init_omap_image_type(void);
+
+void pbl_load_uboot(int fd, struct image_tool_params *mparams);
+
+#endif /* _IMAGETOOL_H_ */
index 511e3f2..18dc051 100644 (file)
@@ -9,7 +9,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include "imximage.h"
 
@@ -520,7 +520,7 @@ static int imximage_check_image_types(uint8_t type)
 }
 
 static int imximage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct imx_header *imx_hdr = (struct imx_header *) ptr;
 
@@ -549,7 +549,7 @@ static void imximage_print_header(const void *ptr)
 }
 
 static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        struct imx_header *imxhdr = (struct imx_header *)ptr;
        uint32_t dcd_len;
@@ -589,7 +589,7 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
        }
 }
 
-int imximage_check_params(struct mkimage_params *params)
+int imximage_check_params(struct image_tool_params *params)
 {
        if (!params)
                return CFG_INVALID;
@@ -611,7 +611,7 @@ int imximage_check_params(struct mkimage_params *params)
                (params->xflag) || !(strlen(params->imagename));
 }
 
-static int imximage_generate(struct mkimage_params *params,
+static int imximage_generate(struct image_tool_params *params,
        struct image_type_params *tparams)
 {
        struct imx_header *imxhdr;
@@ -701,5 +701,5 @@ static struct image_type_params imximage_params = {
 
 void init_imx_image_type(void)
 {
-       mkimage_register(&imximage_params);
+       register_image_type(&imximage_params);
 }
index 1df6b20..109d616 100644 (file)
@@ -6,7 +6,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include "kwbimage.h"
 
@@ -54,7 +54,7 @@ static int lineno = -1;
 /*
  * Report Error if xflag is set in addition to default
  */
-static int kwbimage_check_params (struct mkimage_params *params)
+static int kwbimage_check_params(struct image_tool_params *params)
 {
        if (!strlen (params->imagename)) {
                printf ("Error:%s - Configuration file not specified, "
@@ -288,7 +288,7 @@ INVL_CMD:
 }
 
 static void kwbimage_set_header (void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        struct kwb_header *hdr = (struct kwb_header *)ptr;
        bhr_t *mhdr = &hdr->kwb_hdr;
@@ -322,7 +322,7 @@ static void kwbimage_set_header (void *ptr, struct stat *sbuf, int ifd,
 }
 
 static int kwbimage_verify_header (unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct kwb_header *hdr = (struct kwb_header *)ptr;
        bhr_t *mhdr = &hdr->kwb_hdr;
@@ -382,5 +382,5 @@ static struct image_type_params kwbimage_params = {
 
 void init_kwb_image_type (void)
 {
-       mkimage_register (&kwbimage_params);
+       register_image_type(&kwbimage_params);
 }
index 7f22101..123d0c7 100644 (file)
@@ -19,7 +19,7 @@ static void usage(void);
 struct image_type_params *mkimage_tparams = NULL;
 
 /* parameters initialized by core will be used by the image type code */
-struct mkimage_params params = {
+struct image_tool_params params = {
        .os = IH_OS_LINUX,
        .arch = IH_ARCH_PPC,
        .type = IH_TYPE_KERNEL,
@@ -139,24 +139,8 @@ main (int argc, char **argv)
        struct image_type_params *tparams = NULL;
        int pad_len = 0;
 
-       /* Init Freescale PBL Boot image generation/list support */
-       init_pbl_image_type();
-       /* Init Kirkwood Boot image generation/list support */
-       init_kwb_image_type ();
-       /* Init Freescale imx Boot image generation/list support */
-       init_imx_image_type ();
-       /* Init Freescale mxs Boot image generation/list support */
-       init_mxs_image_type();
-       /* Init FIT image generation/list support */
-       init_fit_image_type ();
-       /* Init TI OMAP Boot image generation/list support */
-       init_omap_image_type();
-       /* Init Default image generation/list support */
-       init_default_image_type ();
-       /* Init Davinci UBL support */
-       init_ubl_image_type();
-       /* Init Davinci AIS support */
-       init_ais_image_type();
+       /* Init all image generation/list support */
+       register_image_tool(mkimage_register);
 
        params.cmdname = *argv;
        params.addr = params.ep = 0;
@@ -632,8 +616,7 @@ copy_file (int ifd, const char *datafile, int pad)
        (void) close (dfd);
 }
 
-void
-usage ()
+static void usage(void)
 {
        fprintf (stderr, "Usage: %s -l image\n"
                         "          -l ==> list image header information\n",
index af49154..d5491b6 100644 (file)
@@ -20,6 +20,7 @@
 #include <unistd.h>
 #include <sha1.h>
 #include "fdt_host.h"
+#include "imagetool.h"
 
 #undef MKIMAGE_DEBUG
 
@@ -29,8 +30,6 @@
 #define debug(fmt,args...)
 #endif /* MKIMAGE_DEBUG */
 
-#define ARRAY_SIZE(x)          (sizeof(x) / sizeof((x)[0]))
-
 static inline void *map_sysmem(ulong paddr, unsigned long len)
 {
        return (void *)(uintptr_t)paddr;
@@ -47,124 +46,4 @@ static inline ulong map_to_sysmem(void *ptr)
 #define MKIMAGE_MAX_DTC_CMDLINE_LEN    512
 #define MKIMAGE_DTC                    "dtc"   /* assume dtc is in $PATH */
 
-#define IH_ARCH_DEFAULT                IH_ARCH_INVALID
-
-/*
- * This structure defines all such variables those are initialized by
- * mkimage main core and need to be referred by image type specific
- * functions
- */
-struct mkimage_params {
-       int dflag;
-       int eflag;
-       int fflag;
-       int lflag;
-       int vflag;
-       int xflag;
-       int skipcpy;
-       int os;
-       int arch;
-       int type;
-       int comp;
-       char *dtc;
-       unsigned int addr;
-       unsigned int ep;
-       char *imagename;
-       char *imagename2;
-       char *datafile;
-       char *imagefile;
-       char *cmdname;
-       const char *keydir;     /* Directory holding private keys */
-       const char *keydest;    /* Destination .dtb for public key */
-       const char *comment;    /* Comment to add to signature node */
-       int require_keys;       /* 1 to mark signing keys as 'required' */
-};
-
-/*
- * image type specific variables and callback functions
- */
-struct image_type_params {
-       /* name is an identification tag string for added support */
-       char *name;
-       /*
-        * header size is local to the specific image type to be supported,
-        * mkimage core treats this as number of bytes
-        */
-       uint32_t header_size;
-       /* Image type header pointer */
-       void *hdr;
-       /*
-        * There are several arguments that are passed on the command line
-        * and are registered as flags in mkimage_params structure.
-        * This callback function can be used to check the passed arguments
-        * are in-lined with the image type to be supported
-        *
-        * Returns 1 if parameter check is successful
-        */
-       int (*check_params) (struct mkimage_params *);
-       /*
-        * This function is used by list command (i.e. mkimage -l <filename>)
-        * image type verification code must be put here
-        *
-        * Returns 0 if image header verification is successful
-        * otherwise, returns respective negative error codes
-        */
-       int (*verify_header) (unsigned char *, int, struct mkimage_params *);
-       /* Prints image information abstracting from image header */
-       void (*print_header) (const void *);
-       /*
-        * The header or image contents need to be set as per image type to
-        * be generated using this callback function.
-        * further output file post processing (for ex. checksum calculation,
-        * padding bytes etc..) can also be done in this callback function.
-        */
-       void (*set_header) (void *, struct stat *, int,
-                                       struct mkimage_params *);
-       /*
-        * Some image generation support for ex (default image type) supports
-        * more than one type_ids, this callback function is used to check
-        * whether input (-T <image_type>) is supported by registered image
-        * generation/list low level code
-        */
-       int (*check_image_type) (uint8_t);
-       /* This callback function will be executed if fflag is defined */
-       int (*fflag_handle) (struct mkimage_params *);
-       /*
-        * This callback function will be executed for variable size record
-        * It is expected to build this header in memory and return its length
-        * and a pointer to it by using image_type_params.header_size and
-        * image_type_params.hdr. The return value shall indicate if an
-        * additional padding should be used when copying the data image
-        * by returning the padding length.
-        */
-       int (*vrec_header) (struct mkimage_params *,
-               struct image_type_params *);
-       /* pointer to the next registered entry in linked list */
-       struct image_type_params *next;
-};
-
-/*
- * Exported functions
- */
-void mkimage_register (struct image_type_params *tparams);
-
-/*
- * There is a c file associated with supported image type low level code
- * for ex. default_image.c, fit_image.c
- * init is the only function referred by mkimage core.
- * to avoid a single lined header file, you can define them here
- *
- * Supported image types init functions
- */
-void pbl_load_uboot(int fd, struct mkimage_params *mparams);
-void init_pbl_image_type(void);
-void init_ais_image_type(void);
-void init_kwb_image_type (void);
-void init_imx_image_type (void);
-void init_mxs_image_type(void);
-void init_default_image_type (void);
-void init_fit_image_type (void);
-void init_ubl_image_type(void);
-void init_omap_image_type(void);
-
 #endif /* _MKIIMAGE_H_ */
index 5db19b2..b214050 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <openssl/evp.h>
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include "mxsimage.h"
 #include <image.h>
 
@@ -2148,11 +2148,11 @@ static int mxsimage_check_image_types(uint8_t type)
 }
 
 static void mxsimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
 }
 
-int mxsimage_check_params(struct mkimage_params *params)
+int mxsimage_check_params(struct image_tool_params *params)
 {
        if (!params)
                return -1;
@@ -2193,7 +2193,7 @@ static int mxsimage_verify_print_header(char *file, int silent)
 
 char *imagefile;
 static int mxsimage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct sb_boot_image_header *hdr;
 
@@ -2291,7 +2291,7 @@ static int sb_build_image(struct sb_image_ctx *ictx,
        return 0;
 }
 
-static int mxsimage_generate(struct mkimage_params *params,
+static int mxsimage_generate(struct image_tool_params *params,
        struct image_type_params *tparams)
 {
        int ret;
@@ -2337,7 +2337,7 @@ static struct image_type_params mxsimage_params = {
 
 void init_mxs_image_type(void)
 {
-       mkimage_register(&mxsimage_params);
+       register_image_type(&mxsimage_params);
 }
 
 #else
index 8774a7e..d59bc4d 100644 (file)
@@ -14,7 +14,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include "omapimage.h"
 
@@ -69,7 +69,7 @@ static int valid_gph_load_addr(uint32_t load_addr)
 }
 
 static int omapimage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct ch_toc *toc = (struct ch_toc *)ptr;
        struct gp_header *gph = (struct gp_header *)(ptr+OMAP_CH_HDR_SIZE);
@@ -188,7 +188,7 @@ static int toc_offset(void *hdr, void *member)
 }
 
 static void omapimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        struct ch_toc *toc = (struct ch_toc *)ptr;
        struct ch_settings *chs = (struct ch_settings *)
@@ -224,7 +224,7 @@ static void omapimage_set_header(void *ptr, struct stat *sbuf, int ifd,
        }
 }
 
-int omapimage_check_params(struct mkimage_params *params)
+int omapimage_check_params(struct image_tool_params *params)
 {
        return  (params->dflag && (params->fflag || params->lflag)) ||
                (params->fflag && (params->dflag || params->lflag)) ||
@@ -247,5 +247,5 @@ static struct image_type_params omapimage_params = {
 
 void init_omap_image_type(void)
 {
-       mkimage_register(&omapimage_params);
+       register_image_type(&omapimage_params);
 }
index bac5faf..ef3d7f6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include "pblimage.h"
 
@@ -242,7 +242,7 @@ static void add_end_cmd(void)
        }
 }
 
-void pbl_load_uboot(int ifd, struct mkimage_params *params)
+void pbl_load_uboot(int ifd, struct image_tool_params *params)
 {
        FILE *fp_uboot;
        int size;
@@ -281,7 +281,7 @@ static int pblimage_check_image_types(uint8_t type)
 }
 
 static int pblimage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct pbl_header *pbl_hdr = (struct pbl_header *) ptr;
 
@@ -308,7 +308,7 @@ static void pblimage_print_header(const void *ptr)
 }
 
 static void pblimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        /*nothing need to do, pbl_load_uboot takes care of whole file. */
 }
@@ -327,5 +327,5 @@ static struct image_type_params pblimage_params = {
 void init_pbl_image_type(void)
 {
        pbl_size = 0;
-       mkimage_register(&pblimage_params);
+       register_image_type(&pblimage_params);
 }
index aafe248..cbbbe20 100644 (file)
@@ -13,7 +13,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include "mkimage.h"
+#include "imagetool.h"
 #include <image.h>
 #include "ublimage.h"
 
@@ -193,7 +193,7 @@ static int ublimage_check_image_types(uint8_t type)
 }
 
 static int ublimage_verify_header(unsigned char *ptr, int image_size,
-                       struct mkimage_params *params)
+                       struct image_tool_params *params)
 {
        struct ubl_header *ubl_hdr = (struct ubl_header *)ptr;
 
@@ -211,7 +211,7 @@ static void ublimage_print_header(const void *ptr)
 }
 
 static void ublimage_set_header(void *ptr, struct stat *sbuf, int ifd,
-                               struct mkimage_params *params)
+                               struct image_tool_params *params)
 {
        struct ubl_header *ublhdr = (struct ubl_header *)ptr;
 
@@ -219,7 +219,7 @@ static void ublimage_set_header(void *ptr, struct stat *sbuf, int ifd,
        parse_cfg_file(ublhdr, params->imagename);
 }
 
-int ublimage_check_params(struct mkimage_params *params)
+int ublimage_check_params(struct image_tool_params *params)
 {
        if (!params)
                return CFG_INVALID;
@@ -257,5 +257,5 @@ static struct image_type_params ublimage_params = {
 
 void init_ubl_image_type(void)
 {
-       mkimage_register(&ublimage_params);
+       register_image_type(&ublimage_params);
 }