Merge branch 'master' of git://git.denx.de/u-boot-blackfin
authorTom Rini <trini@ti.com>
Mon, 2 Feb 2015 16:51:58 +0000 (11:51 -0500)
committerTom Rini <trini@ti.com>
Mon, 2 Feb 2015 16:51:58 +0000 (11:51 -0500)
938 files changed:
Kconfig
MAINTAINERS
MAKEALL
Makefile
README
arch/arc/Kconfig
arch/arc/Makefile
arch/arc/config.mk
arch/arc/cpu/arc700/Makefile [deleted file]
arch/arc/cpu/arc700/cache.c [deleted file]
arch/arc/cpu/arc700/config.mk [deleted file]
arch/arc/cpu/arc700/cpu.c [deleted file]
arch/arc/cpu/arc700/interrupts.c [deleted file]
arch/arc/cpu/arc700/reset.c [deleted file]
arch/arc/cpu/arc700/start.S [deleted file]
arch/arc/cpu/arc700/timer.c [deleted file]
arch/arc/cpu/arc700/u-boot.lds [deleted file]
arch/arc/cpu/arcv1/Makefile [new file with mode: 0644]
arch/arc/cpu/arcv1/config.mk [new file with mode: 0644]
arch/arc/cpu/arcv1/start.S [new file with mode: 0644]
arch/arc/cpu/u-boot.lds [new file with mode: 0644]
arch/arc/include/asm/arcregs.h
arch/arc/include/asm/sections.h
arch/arc/lib/Makefile
arch/arc/lib/cache.c [new file with mode: 0644]
arch/arc/lib/cpu.c [new file with mode: 0644]
arch/arc/lib/interrupts.c [new file with mode: 0644]
arch/arc/lib/relocate.c
arch/arc/lib/reset.c [new file with mode: 0644]
arch/arc/lib/sections.c
arch/arc/lib/timer.c [new file with mode: 0644]
arch/arm/Kconfig
arch/arm/cpu/arm926ejs/cpu.c
arch/arm/cpu/arm926ejs/kirkwood/cpu.c
arch/arm/cpu/armv7/am33xx/board.c
arch/arm/cpu/armv7/am33xx/ddr.c
arch/arm/cpu/armv7/am33xx/emif4.c
arch/arm/cpu/armv7/at91/sama5d4_devices.c
arch/arm/cpu/armv7/cpu.c
arch/arm/cpu/armv7/exynos/pinmux.c
arch/arm/cpu/armv7/ls102xa/fdt.c
arch/arm/cpu/armv7/omap-common/boot-common.c
arch/arm/cpu/armv7/omap-common/hwinit-common.c
arch/arm/cpu/armv7/omap3/board.c
arch/arm/cpu/armv7/start.S
arch/arm/cpu/armv7/sunxi/Makefile
arch/arm/cpu/armv7/sunxi/board.c
arch/arm/cpu/armv7/sunxi/clock_sun6i.c
arch/arm/cpu/armv7/sunxi/clock_sun9i.c [new file with mode: 0644]
arch/arm/cpu/armv7/sunxi/rsb.c
arch/arm/cpu/armv7/uniphier/init_page_table.S [new file with mode: 0644]
arch/arm/cpu/armv7/uniphier/init_page_table.c [deleted file]
arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c
arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c
arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c
arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c
arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
arch/arm/cpu/armv7/virt-v7.c
arch/arm/cpu/armv7/zynq/Makefile
arch/arm/cpu/armv7/zynq/config.mk [new file with mode: 0644]
arch/arm/cpu/armv7/zynq/cpu.c
arch/arm/cpu/armv7/zynq/ddrc.c
arch/arm/cpu/armv7/zynq/lowlevel_init.S [new file with mode: 0644]
arch/arm/cpu/armv7/zynq/slcr.c
arch/arm/cpu/armv7/zynq/spl.c
arch/arm/cpu/tegra20-common/pmu.c
arch/arm/dts/exynos4.dtsi
arch/arm/dts/exynos4210-origen.dts
arch/arm/dts/exynos4210-trats.dts
arch/arm/dts/exynos4210-universal_c210.dts
arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/exynos4412-trats2.dts
arch/arm/dts/exynos5.dtsi
arch/arm/dts/exynos5250-arndale.dts
arch/arm/dts/exynos5250-smdk5250.dts
arch/arm/dts/exynos5250-snow.dts
arch/arm/dts/exynos5420-peach-pit.dts
arch/arm/dts/exynos5422-odroidxu3.dts
arch/arm/dts/exynos5800-peach-pi.dts
arch/arm/dts/tegra114-dalmore.dts
arch/arm/dts/tegra124-jetson-tk1.dts
arch/arm/dts/tegra124-venice2.dts
arch/arm/dts/tegra20-colibri_t20_iris.dts
arch/arm/dts/tegra20-harmony.dts
arch/arm/dts/tegra20-medcom-wide.dts
arch/arm/dts/tegra20-paz00.dts
arch/arm/dts/tegra20-seaboard.dts
arch/arm/dts/tegra20-tamonten.dtsi
arch/arm/dts/tegra20-tec.dts
arch/arm/dts/tegra20-trimslice.dts
arch/arm/dts/tegra20-ventana.dts
arch/arm/dts/tegra20-whistler.dts
arch/arm/dts/tegra30-apalis.dts
arch/arm/dts/tegra30-beaver.dts
arch/arm/dts/tegra30-cardhu.dts
arch/arm/dts/tegra30-colibri.dts
arch/arm/dts/tegra30-tamonten.dtsi
arch/arm/include/asm/arch-am33xx/cpu.h
arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
arch/arm/include/asm/arch-at91/atmel_usba_udc.h
arch/arm/include/asm/arch-exynos/pinmux.h
arch/arm/include/asm/arch-ls102xa/config.h
arch/arm/include/asm/arch-ls102xa/gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
arch/arm/include/asm/arch-pantheon/gpio.h [new file with mode: 0644]
arch/arm/include/asm/arch-rmobile/r8a7790.h
arch/arm/include/asm/arch-rmobile/r8a7791.h
arch/arm/include/asm/arch-rmobile/r8a7793.h
arch/arm/include/asm/arch-rmobile/r8a7794.h
arch/arm/include/asm/arch-rmobile/rcar-base.h
arch/arm/include/asm/arch-rmobile/sh_sdhi.h [new file with mode: 0644]
arch/arm/include/asm/arch-sunxi/clock.h
arch/arm/include/asm/arch-sunxi/clock_sun4i.h
arch/arm/include/asm/arch-sunxi/clock_sun6i.h
arch/arm/include/asm/arch-sunxi/clock_sun9i.h [new file with mode: 0644]
arch/arm/include/asm/arch-sunxi/cpu.h
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h [new file with mode: 0644]
arch/arm/include/asm/arch-sunxi/cpu_sun9i.h [new file with mode: 0644]
arch/arm/include/asm/arch-sunxi/display.h
arch/arm/include/asm/arch-sunxi/dram_sun4i.h
arch/arm/include/asm/arch-sunxi/gpio.h
arch/arm/include/asm/arch-sunxi/mmc.h
arch/arm/include/asm/arch-sunxi/rsb.h
arch/arm/include/asm/arch-sunxi/usbc.h
arch/arm/include/asm/arch-tegra/tegra_mmc.h
arch/arm/include/asm/arch-tegra20/display.h
arch/arm/include/asm/arch-uniphier/ddrphy-regs.h
arch/arm/include/asm/arch-uniphier/sg-regs.h
arch/arm/include/asm/arch-zynq/gpio.h
arch/arm/include/asm/arch-zynq/hardware.h
arch/arm/include/asm/arch-zynq/sys_proto.h
arch/arm/include/asm/emif.h
arch/arm/lib/cache.c
arch/arm/lib/spl.c
arch/blackfin/cpu/cpu.c
arch/microblaze/cpu/start.S
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/cpu/Makefile [new file with mode: 0644]
arch/mips/cpu/cpu.c [new file with mode: 0644]
arch/mips/cpu/interrupts.c [new file with mode: 0644]
arch/mips/cpu/mips32/Makefile [deleted file]
arch/mips/cpu/mips32/au1x00/Makefile [deleted file]
arch/mips/cpu/mips32/au1x00/au1x00_eth.c [deleted file]
arch/mips/cpu/mips32/au1x00/au1x00_ide.c [deleted file]
arch/mips/cpu/mips32/au1x00/au1x00_serial.c [deleted file]
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c [deleted file]
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h [deleted file]
arch/mips/cpu/mips32/au1x00/config.mk [deleted file]
arch/mips/cpu/mips32/cache.S [deleted file]
arch/mips/cpu/mips32/cpu.c [deleted file]
arch/mips/cpu/mips32/interrupts.c [deleted file]
arch/mips/cpu/mips32/start.S [deleted file]
arch/mips/cpu/mips32/time.c [deleted file]
arch/mips/cpu/mips64/Makefile [deleted file]
arch/mips/cpu/mips64/cache.S [deleted file]
arch/mips/cpu/mips64/cpu.c [deleted file]
arch/mips/cpu/mips64/interrupts.c [deleted file]
arch/mips/cpu/mips64/start.S [deleted file]
arch/mips/cpu/mips64/time.c [deleted file]
arch/mips/cpu/start.S [new file with mode: 0644]
arch/mips/cpu/time.c [new file with mode: 0644]
arch/mips/include/asm/cacheops.h
arch/mips/include/asm/config.h
arch/mips/include/asm/malta.h
arch/mips/lib/Makefile
arch/mips/lib/bootm.c
arch/mips/lib/cache.c [new file with mode: 0644]
arch/mips/lib/cache_init.S [new file with mode: 0644]
arch/mips/mach-au1x00/Makefile [new file with mode: 0644]
arch/mips/mach-au1x00/au1x00_eth.c [new file with mode: 0644]
arch/mips/mach-au1x00/au1x00_ide.c [new file with mode: 0644]
arch/mips/mach-au1x00/au1x00_serial.c [new file with mode: 0644]
arch/mips/mach-au1x00/au1x00_usb_ohci.c [new file with mode: 0644]
arch/mips/mach-au1x00/au1x00_usb_ohci.h [new file with mode: 0644]
arch/mips/mach-au1x00/config.mk [new file with mode: 0644]
arch/powerpc/Kconfig
arch/powerpc/cpu/74xx_7xx/Kconfig [deleted file]
arch/powerpc/cpu/74xx_7xx/Makefile [deleted file]
arch/powerpc/cpu/74xx_7xx/cache.S [deleted file]
arch/powerpc/cpu/74xx_7xx/config.mk [deleted file]
arch/powerpc/cpu/74xx_7xx/cpu.c [deleted file]
arch/powerpc/cpu/74xx_7xx/cpu_init.c [deleted file]
arch/powerpc/cpu/74xx_7xx/interrupts.c [deleted file]
arch/powerpc/cpu/74xx_7xx/io.S [deleted file]
arch/powerpc/cpu/74xx_7xx/kgdb.S [deleted file]
arch/powerpc/cpu/74xx_7xx/speed.c [deleted file]
arch/powerpc/cpu/74xx_7xx/start.S [deleted file]
arch/powerpc/cpu/74xx_7xx/traps.c [deleted file]
arch/powerpc/cpu/74xx_7xx/u-boot.lds [deleted file]
arch/powerpc/cpu/mpc5xxx/Kconfig
arch/powerpc/cpu/mpc5xxx/pci_mpc5200.c
arch/powerpc/cpu/mpc83xx/Kconfig
arch/powerpc/cpu/mpc85xx/Kconfig
arch/powerpc/cpu/mpc85xx/b4860_ids.c
arch/powerpc/cpu/mpc85xx/cpu_init.c
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c
arch/powerpc/cpu/mpc85xx/t1024_serdes.c
arch/powerpc/cpu/mpc85xx/t1040_serdes.c
arch/powerpc/cpu/mpc8xx/u-boot.lds [deleted file]
arch/powerpc/cpu/mpc8xxx/cpu.c
arch/powerpc/cpu/mpc8xxx/fdt.c
arch/powerpc/cpu/ppc4xx/4xx_pci.c
arch/powerpc/cpu/ppc4xx/Kconfig
arch/powerpc/include/asm/arch-mpc85xx/gpio.h [new file with mode: 0644]
arch/powerpc/include/asm/config.h
arch/powerpc/include/asm/fsl_secure_boot.h
arch/powerpc/include/asm/fsl_serdes.h
arch/powerpc/include/asm/global_data.h
arch/powerpc/lib/board.c
arch/sandbox/cpu/start.c
arch/sandbox/dts/sandbox.dts
arch/x86/cpu/coreboot/Makefile
arch/x86/cpu/coreboot/coreboot.c
arch/x86/cpu/coreboot/ipchecksum.c [deleted file]
arch/x86/cpu/coreboot/tables.c
arch/x86/cpu/cpu.c
arch/x86/cpu/ivybridge/Kconfig
arch/x86/cpu/ivybridge/Makefile
arch/x86/cpu/ivybridge/mrccache.c [new file with mode: 0644]
arch/x86/cpu/ivybridge/sdram.c
arch/x86/cpu/mtrr.c
arch/x86/cpu/start16.S
arch/x86/dts/chromebook_link.dts
arch/x86/include/asm/arch-coreboot/ipchecksum.h [deleted file]
arch/x86/include/asm/arch-ivybridge/mrccache.h [new file with mode: 0644]
arch/x86/include/asm/global_data.h
arch/x86/include/asm/mtrr.h
arch/x86/include/asm/u-boot-x86.h
arch/x86/lib/init_helpers.c
arch/x86/lib/interrupts.c
board/BuS/eb_cpux9k2/cpux9k2.c
board/armltd/vexpress64/Kconfig
board/armltd/vexpress64/MAINTAINERS
board/atmel/sama5d4_xplained/sama5d4_xplained.c
board/atmel/sama5d4ek/sama5d4ek.c
board/avionic-design/common/tamonten-ng.c
board/compulab/cm_fx6/spl.c
board/dave/PPChameleonEVB/Kconfig [deleted file]
board/dave/PPChameleonEVB/MAINTAINERS [deleted file]
board/dave/PPChameleonEVB/Makefile [deleted file]
board/dave/PPChameleonEVB/PPChameleonEVB.c [deleted file]
board/dave/PPChameleonEVB/flash.c [deleted file]
board/dave/PPChameleonEVB/nand.c [deleted file]
board/dave/PPChameleonEVB/u-boot.lds [deleted file]
board/eltec/elppc/Kconfig [deleted file]
board/eltec/elppc/MAINTAINERS [deleted file]
board/eltec/elppc/Makefile [deleted file]
board/eltec/elppc/asm_init.S [deleted file]
board/eltec/elppc/eepro100_srom.c [deleted file]
board/eltec/elppc/elppc.c [deleted file]
board/eltec/elppc/flash.c [deleted file]
board/eltec/elppc/misc.c [deleted file]
board/eltec/elppc/mpc107_i2c.c [deleted file]
board/eltec/elppc/pci.c [deleted file]
board/eltec/elppc/srom.h [deleted file]
board/esd/cpci5200/Kconfig [deleted file]
board/esd/cpci5200/MAINTAINERS [deleted file]
board/esd/cpci5200/Makefile [deleted file]
board/esd/cpci5200/cpci5200.c [deleted file]
board/esd/cpci5200/mt46v16m16-75.h [deleted file]
board/esd/cpci5200/strataflash.c [deleted file]
board/esd/mecp5200/Kconfig [deleted file]
board/esd/mecp5200/MAINTAINERS [deleted file]
board/esd/mecp5200/Makefile [deleted file]
board/esd/mecp5200/mecp5200.c [deleted file]
board/esd/mecp5200/mt46v16m16-75.h [deleted file]
board/esd/pf5200/Kconfig [deleted file]
board/esd/pf5200/MAINTAINERS [deleted file]
board/esd/pf5200/Makefile [deleted file]
board/esd/pf5200/flash.c [deleted file]
board/esd/pf5200/mt46v16m16-75.h [deleted file]
board/esd/pf5200/pf5200.c [deleted file]
board/evb64260/64260.h [deleted file]
board/evb64260/Kconfig [deleted file]
board/evb64260/MAINTAINERS [deleted file]
board/evb64260/Makefile [deleted file]
board/evb64260/README [deleted file]
board/evb64260/README.EVB-64260-750CX [deleted file]
board/evb64260/bootseq.txt [deleted file]
board/evb64260/eth.c [deleted file]
board/evb64260/eth.h [deleted file]
board/evb64260/eth_addrtbl.c [deleted file]
board/evb64260/eth_addrtbl.h [deleted file]
board/evb64260/evb64260.c [deleted file]
board/evb64260/flash.c [deleted file]
board/evb64260/i2c.c [deleted file]
board/evb64260/i2c.h [deleted file]
board/evb64260/intel_flash.c [deleted file]
board/evb64260/intel_flash.h [deleted file]
board/evb64260/local.h [deleted file]
board/evb64260/memory.c [deleted file]
board/evb64260/misc.S [deleted file]
board/evb64260/mpsc.c [deleted file]
board/evb64260/mpsc.h [deleted file]
board/evb64260/pci.c [deleted file]
board/evb64260/sdram_init.c [deleted file]
board/evb64260/serial.c [deleted file]
board/evb64260/u-boot.lds [deleted file]
board/evb64260/zuma_pbb.c [deleted file]
board/evb64260/zuma_pbb.h [deleted file]
board/evb64260/zuma_pbb_mbox.c [deleted file]
board/evb64260/zuma_pbb_mbox.h [deleted file]
board/freescale/c29xpcie/MAINTAINERS
board/freescale/common/pq-mds-pib.c
board/freescale/corenet_ds/MAINTAINERS
board/freescale/ls1021aqds/MAINTAINERS
board/freescale/ls1021aqds/Makefile
board/freescale/ls1021aqds/dcu.c [new file with mode: 0644]
board/freescale/ls1021aqds/ddr.c
board/freescale/ls1021aqds/ls1021aqds.c
board/freescale/ls1021aqds/ls1021aqds_qixis.h
board/freescale/ls1021atwr/MAINTAINERS
board/freescale/ls1021atwr/ls1021atwr.c
board/freescale/mpc7448hpc2/Kconfig [deleted file]
board/freescale/mpc7448hpc2/MAINTAINERS [deleted file]
board/freescale/mpc7448hpc2/Makefile [deleted file]
board/freescale/mpc7448hpc2/README [deleted file]
board/freescale/mpc7448hpc2/asm_init.S [deleted file]
board/freescale/mpc7448hpc2/config.mk [deleted file]
board/freescale/mpc7448hpc2/mpc7448hpc2.c [deleted file]
board/freescale/mpc7448hpc2/tsi108_init.c [deleted file]
board/freescale/mpc8360emds/Kconfig [deleted file]
board/freescale/mpc8360emds/MAINTAINERS [deleted file]
board/freescale/mpc8360emds/Makefile [deleted file]
board/freescale/mpc8360emds/README [deleted file]
board/freescale/mpc8360emds/mpc8360emds.c [deleted file]
board/freescale/mpc8360emds/pci.c [deleted file]
board/freescale/mpc8360erdk/Kconfig [deleted file]
board/freescale/mpc8360erdk/MAINTAINERS [deleted file]
board/freescale/mpc8360erdk/Makefile [deleted file]
board/freescale/mpc8360erdk/mpc8360erdk.c [deleted file]
board/freescale/mpc8360erdk/nand.c [deleted file]
board/freescale/mpc837xerdb/MAINTAINERS
board/freescale/p1_p2_rdb/Kconfig [deleted file]
board/freescale/p1_p2_rdb/MAINTAINERS [deleted file]
board/freescale/p1_p2_rdb/Makefile [deleted file]
board/freescale/p1_p2_rdb/README [deleted file]
board/freescale/p1_p2_rdb/ddr.c [deleted file]
board/freescale/p1_p2_rdb/law.c [deleted file]
board/freescale/p1_p2_rdb/p1_p2_rdb.c [deleted file]
board/freescale/p1_p2_rdb/pci.c [deleted file]
board/freescale/p1_p2_rdb/spl.c [deleted file]
board/freescale/p1_p2_rdb/spl_minimal.c [deleted file]
board/freescale/p1_p2_rdb/tlb.c [deleted file]
board/freescale/p2020come/Kconfig [deleted file]
board/freescale/p2020come/MAINTAINERS [deleted file]
board/freescale/p2020come/Makefile [deleted file]
board/freescale/p2020come/ddr.c [deleted file]
board/freescale/p2020come/law.c [deleted file]
board/freescale/p2020come/p2020come.c [deleted file]
board/freescale/p2020come/tlb.c [deleted file]
board/freescale/p2020ds/Kconfig [deleted file]
board/freescale/p2020ds/MAINTAINERS [deleted file]
board/freescale/p2020ds/Makefile [deleted file]
board/freescale/p2020ds/ddr.c [deleted file]
board/freescale/p2020ds/law.c [deleted file]
board/freescale/p2020ds/p2020ds.c [deleted file]
board/freescale/p2020ds/tlb.c [deleted file]
board/freescale/t102xqds/ddr.c
board/freescale/t102xqds/t102xqds.c
board/freescale/t102xrdb/cpld.h
board/freescale/t102xrdb/ddr.c
board/freescale/t102xrdb/eth_t102xrdb.c
board/freescale/t102xrdb/spl.c
board/freescale/t102xrdb/t102xrdb.c
board/freescale/t1040qds/ddr.c
board/freescale/t1040qds/eth.c
board/freescale/t1040qds/t1040qds.c
board/freescale/t104xrdb/MAINTAINERS
board/freescale/t104xrdb/eth.c
board/freescale/t4rdb/eth.c
board/freescale/t4rdb/t4_rcw.cfg
board/icecube/Kconfig [deleted file]
board/icecube/MAINTAINERS [deleted file]
board/icecube/Makefile [deleted file]
board/icecube/README [deleted file]
board/icecube/README.Lite5200B_low_power [deleted file]
board/icecube/flash.c [deleted file]
board/icecube/icecube.c [deleted file]
board/icecube/mt46v16m16-75.h [deleted file]
board/icecube/mt46v32m16.h [deleted file]
board/icecube/mt48lc16m16a2-75.h [deleted file]
board/imgtec/malta/malta.c
board/iomega/iconnect/kwbimage.cfg
board/nvidia/cardhu/cardhu.c
board/nvidia/dalmore/dalmore.c
board/nvidia/whistler/whistler.c
board/pm520/Kconfig [deleted file]
board/pm520/MAINTAINERS [deleted file]
board/pm520/Makefile [deleted file]
board/pm520/flash.c [deleted file]
board/pm520/mt46v16m16-75.h [deleted file]
board/pm520/mt48lc16m16a2-75.h [deleted file]
board/pm520/pm520.c [deleted file]
board/ppmc7xx/Kconfig [deleted file]
board/ppmc7xx/MAINTAINERS [deleted file]
board/ppmc7xx/Makefile [deleted file]
board/ppmc7xx/flash.c [deleted file]
board/ppmc7xx/init.S [deleted file]
board/ppmc7xx/pci.c [deleted file]
board/ppmc7xx/ppmc7xx.c [deleted file]
board/raidsonic/ib62x0/kwbimage.cfg
board/samsung/odroid/odroid.c
board/sandbox/README.sandbox
board/siemens/corvus/board.c
board/siemens/taurus/taurus.c
board/sunxi/Kconfig
board/sunxi/MAINTAINERS
board/sunxi/Makefile
board/sunxi/board.c
board/sunxi/dram_a10_olinuxino_l.c [deleted file]
board/sunxi/dram_a10s_olinuxino_m.c [deleted file]
board/sunxi/dram_a13_oli_micro.c [deleted file]
board/sunxi/dram_a13_olinuxino.c [deleted file]
board/sunxi/dram_a20_olinuxino_l.c [deleted file]
board/sunxi/dram_a20_olinuxino_l2.c [deleted file]
board/sunxi/dram_bananapi.c [deleted file]
board/sunxi/dram_cubieboard.c [deleted file]
board/sunxi/dram_cubieboard2.c [deleted file]
board/sunxi/dram_cubietruck.c [deleted file]
board/sunxi/dram_linksprite_pcduino3.c [deleted file]
board/sunxi/dram_r7dongle.c [deleted file]
board/sunxi/dram_sun4i_360_1024_iow16.c [deleted file]
board/sunxi/dram_sun4i_360_1024_iow8.c [deleted file]
board/sunxi/dram_sun4i_360_512.c [deleted file]
board/sunxi/dram_sun4i_384_1024_iow8.c [deleted file]
board/sunxi/dram_sun4i_408_1024_iow8.c [deleted file]
board/sunxi/dram_sun4i_auto.c [new file with mode: 0644]
board/sunxi/dram_sun5i_auto.c [new file with mode: 0644]
board/sunxi/dram_sun7i_384_1024_iow16.c [deleted file]
board/sunxi/dram_sun7i_384_512_busw16_iow16.c [deleted file]
board/sunxi/dram_timings_sun4i.h [new file with mode: 0644]
board/sunxi/gmac.c
board/synopsys/Kconfig
board/synopsys/axs101/Kconfig
board/ti/am43xx/board.c
board/ti/am43xx/board.h
board/ti/am43xx/mux.c
board/timll/devkit8000/devkit8000.c
board/toradex/apalis_t30/apalis_t30.c
board/total5200/Kconfig [deleted file]
board/total5200/MAINTAINERS [deleted file]
board/total5200/Makefile [deleted file]
board/total5200/mt48lc16m16a2-75.h [deleted file]
board/total5200/mt48lc32m16a2-75.h [deleted file]
board/total5200/sdram.c [deleted file]
board/total5200/sdram.h [deleted file]
board/total5200/total5200.c [deleted file]
board/woodburn/woodburn.c
board/xilinx/zynq/board.c
common/Makefile
common/board_f.c
common/board_info.c [new file with mode: 0644]
common/board_r.c
common/cmd_bootm.c
common/cmd_demo.c
common/cmd_fpga.c
common/cmd_fs.c
common/cmd_gettime.c
common/cmd_i2c.c
common/cmd_load.c
common/cmd_mmc.c
common/cmd_part.c
common/cmd_usb.c
common/cmd_ximg.c
common/console.c
common/exports.c
common/hash.c
common/image-fit.c
common/image-sig.c
common/image.c
common/lcd.c
common/spl/spl.c
common/usb.c
common/usb_kbd.c
configs/A10-OLinuXino-Lime_defconfig
configs/A10s-OLinuXino-M_defconfig
configs/A13-OLinuXinoM_defconfig
configs/A13-OLinuXino_defconfig
configs/A20-OLinuXino-Lime2_defconfig
configs/A20-OLinuXino-Lime_defconfig
configs/A20-OLinuXino_MICRO_defconfig
configs/Auxtek-T004_defconfig
configs/Bananapi_defconfig
configs/Bananapro_defconfig
configs/C29XPCIE_NOR_SECBOOT_defconfig [new file with mode: 0644]
configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig [new file with mode: 0644]
configs/CATcenter_25_defconfig [deleted file]
configs/CATcenter_33_defconfig [deleted file]
configs/CATcenter_defconfig [deleted file]
configs/CSQ_CS908_defconfig
configs/Chuwi_V7_CW0825_defconfig [new file with mode: 0644]
configs/Colombus_defconfig
configs/Cubieboard2_defconfig
configs/Cubieboard_defconfig
configs/Cubietruck_defconfig
configs/ELPPC_defconfig [deleted file]
configs/Hummingbird_A31_defconfig
configs/Hyundai_A7HD_defconfig [new file with mode: 0644]
configs/Inet_86VS_defconfig [new file with mode: 0644]
configs/Ippo_q8h_v1_2_defconfig
configs/Ippo_q8h_v5_defconfig
configs/Linksprite_pcDuino3_Nano_defconfig [new file with mode: 0644]
configs/Linksprite_pcDuino3_defconfig
configs/Linksprite_pcDuino3_fdt_defconfig
configs/Linksprite_pcDuino_defconfig
configs/Lite5200_LOWBOOT08_defconfig [deleted file]
configs/Lite5200_LOWBOOT_defconfig [deleted file]
configs/Lite5200_defconfig [deleted file]
configs/MPC8360EMDS_33_ATM_defconfig [deleted file]
configs/MPC8360EMDS_33_HOST_33_defconfig [deleted file]
configs/MPC8360EMDS_33_HOST_66_defconfig [deleted file]
configs/MPC8360EMDS_33_SLAVE_defconfig [deleted file]
configs/MPC8360EMDS_33_defconfig [deleted file]
configs/MPC8360EMDS_66_ATM_defconfig [deleted file]
configs/MPC8360EMDS_66_HOST_33_defconfig [deleted file]
configs/MPC8360EMDS_66_HOST_66_defconfig [deleted file]
configs/MPC8360EMDS_66_SLAVE_defconfig [deleted file]
configs/MPC8360EMDS_66_defconfig [deleted file]
configs/MPC8360ERDK_33_defconfig [deleted file]
configs/MPC8360ERDK_defconfig [deleted file]
configs/MSI_Primo73_defconfig
configs/MSI_Primo81_defconfig
configs/Marsboard_A10_defconfig [new file with mode: 0644]
configs/Mele_A1000G_defconfig [deleted file]
configs/Mele_A1000_defconfig
configs/Mele_M3_defconfig
configs/Mele_M5_defconfig [new file with mode: 0644]
configs/Mele_M9_defconfig
configs/Mini-X-1Gb_defconfig [deleted file]
configs/Mini-X_defconfig
configs/P1011RDB_36BIT_SDCARD_defconfig [deleted file]
configs/P1011RDB_36BIT_SPIFLASH_defconfig [deleted file]
configs/P1011RDB_36BIT_defconfig [deleted file]
configs/P1011RDB_NAND_defconfig [deleted file]
configs/P1011RDB_SDCARD_defconfig [deleted file]
configs/P1011RDB_SPIFLASH_defconfig [deleted file]
configs/P1011RDB_defconfig [deleted file]
configs/P1020RDB_36BIT_SDCARD_defconfig [deleted file]
configs/P1020RDB_36BIT_SPIFLASH_defconfig [deleted file]
configs/P1020RDB_36BIT_defconfig [deleted file]
configs/P1020RDB_NAND_defconfig [deleted file]
configs/P1020RDB_SDCARD_defconfig [deleted file]
configs/P1020RDB_SPIFLASH_defconfig [deleted file]
configs/P1020RDB_defconfig [deleted file]
configs/P2010RDB_36BIT_SDCARD_defconfig [deleted file]
configs/P2010RDB_36BIT_SPIFLASH_defconfig [deleted file]
configs/P2010RDB_36BIT_defconfig [deleted file]
configs/P2010RDB_NAND_defconfig [deleted file]
configs/P2010RDB_SDCARD_defconfig [deleted file]
configs/P2010RDB_SPIFLASH_defconfig [deleted file]
configs/P2010RDB_defconfig [deleted file]
configs/P2020COME_SDCARD_defconfig [deleted file]
configs/P2020COME_SPIFLASH_defconfig [deleted file]
configs/P2020DS_36BIT_defconfig [deleted file]
configs/P2020DS_DDR2_defconfig [deleted file]
configs/P2020DS_SDCARD_defconfig [deleted file]
configs/P2020DS_SPIFLASH_defconfig [deleted file]
configs/P2020DS_defconfig [deleted file]
configs/P2020RDB_36BIT_SDCARD_defconfig [deleted file]
configs/P2020RDB_36BIT_SPIFLASH_defconfig [deleted file]
configs/P2020RDB_36BIT_defconfig [deleted file]
configs/P2020RDB_NAND_defconfig [deleted file]
configs/P2020RDB_SDCARD_defconfig [deleted file]
configs/P2020RDB_SPIFLASH_defconfig [deleted file]
configs/P2020RDB_defconfig [deleted file]
configs/P3G4_defconfig [deleted file]
configs/P5040DS_SECURE_BOOT_defconfig [new file with mode: 0644]
configs/PM520_DDR_defconfig [deleted file]
configs/PM520_ROMBOOT_DDR_defconfig [deleted file]
configs/PM520_ROMBOOT_defconfig [deleted file]
configs/PM520_defconfig [deleted file]
configs/PPChameleonEVB_BA_25_defconfig [deleted file]
configs/PPChameleonEVB_BA_33_defconfig [deleted file]
configs/PPChameleonEVB_HI_25_defconfig [deleted file]
configs/PPChameleonEVB_HI_33_defconfig [deleted file]
configs/PPChameleonEVB_ME_25_defconfig [deleted file]
configs/PPChameleonEVB_ME_33_defconfig [deleted file]
configs/PPChameleonEVB_defconfig [deleted file]
configs/T1024QDS_defconfig [new file with mode: 0644]
configs/T1042RDB_SECURE_BOOT_defconfig [new file with mode: 0644]
configs/TZX-Q8-713B7_defconfig [new file with mode: 0644]
configs/Total5200_Rev2_defconfig [deleted file]
configs/Total5200_Rev2_lowboot_defconfig [deleted file]
configs/Total5200_defconfig [deleted file]
configs/Total5200_lowboot_defconfig [deleted file]
configs/ZUMA_defconfig [deleted file]
configs/am335x_boneblack_vboot_defconfig
configs/axm_defconfig
configs/ba10_tv_box_defconfig
configs/chromebook_link_defconfig
configs/cpci5200_defconfig [deleted file]
configs/i12-tvbox_defconfig
configs/icecube_5200_DDR_LOWBOOT08_defconfig [deleted file]
configs/icecube_5200_DDR_LOWBOOT_defconfig [deleted file]
configs/icecube_5200_DDR_defconfig [deleted file]
configs/icecube_5200_LOWBOOT08_defconfig [deleted file]
configs/icecube_5200_LOWBOOT_defconfig [deleted file]
configs/icecube_5200_defconfig [deleted file]
configs/ids8313_defconfig
configs/lite5200b_LOWBOOT_defconfig [deleted file]
configs/lite5200b_PM_defconfig [deleted file]
configs/lite5200b_defconfig [deleted file]
configs/ls1021aqds_nor_lpuart_defconfig [new file with mode: 0644]
configs/ls1021atwr_nor_lpuart_defconfig [new file with mode: 0644]
configs/mecp5200_defconfig [deleted file]
configs/mk802_a10s_defconfig [new file with mode: 0644]
configs/mk802_defconfig [new file with mode: 0644]
configs/mk802ii_defconfig [new file with mode: 0644]
configs/mpc7448hpc2_defconfig [deleted file]
configs/pf5200_defconfig [deleted file]
configs/ph1_ld4_defconfig
configs/ph1_pro4_defconfig
configs/ph1_sld8_defconfig
configs/ppmc7xx_defconfig [deleted file]
configs/qt840a_defconfig [deleted file]
configs/r7-tv-dongle_defconfig
configs/sandbox_defconfig
configs/sunxi_Gemei_G9_defconfig [new file with mode: 0644]
configs/vexpress_aemv8a_defconfig
configs/vexpress_aemv8a_juno_defconfig [new file with mode: 0644]
configs/vexpress_aemv8a_semi_defconfig
configs/zynq_microzed_defconfig
configs/zynq_zc70x_defconfig
configs/zynq_zc770_xm010_defconfig
configs/zynq_zc770_xm012_defconfig
configs/zynq_zc770_xm013_defconfig
configs/zynq_zed_defconfig
configs/zynq_zybo_defconfig
doc/README.distro [new file with mode: 0644]
doc/README.nand
doc/README.scrapyard
doc/README.standalone
doc/README.t1040-l2switch [new file with mode: 0644]
doc/device-tree-bindings/gpio/gpio-samsung.txt [new file with mode: 0644]
doc/device-tree-bindings/gpio/gpio.txt [new file with mode: 0644]
doc/device-tree-bindings/gpio/nvidia,tegra20-gpio.txt [new file with mode: 0644]
doc/device-tree-bindings/i2c/i2c.txt [new file with mode: 0644]
doc/driver-model/README.txt
doc/driver-model/spi-howto.txt
doc/git-mailrc
doc/uImage.FIT/source_file_format.txt
doc/uImage.FIT/verified-boot.txt
drivers/bios_emulator/atibios.c
drivers/bios_emulator/include/x86emu/debug.h
drivers/bios_emulator/x86emu/ops.c
drivers/block/ahci.c
drivers/core/device-remove.c
drivers/core/device.c
drivers/core/root.c
drivers/core/uclass.c
drivers/crypto/Kconfig
drivers/crypto/Makefile
drivers/crypto/fsl/Kconfig [new file with mode: 0644]
drivers/crypto/fsl/Makefile
drivers/crypto/fsl/fsl_rsa.c [new file with mode: 0644]
drivers/crypto/fsl/jobdesc.c
drivers/crypto/fsl/jobdesc.h
drivers/crypto/fsl/rsa_caam.h [new file with mode: 0644]
drivers/crypto/fsl/sec.c [new file with mode: 0644]
drivers/crypto/rsa_mod_exp/Kconfig [new file with mode: 0644]
drivers/crypto/rsa_mod_exp/Makefile [new file with mode: 0644]
drivers/crypto/rsa_mod_exp/mod_exp_sw.c [new file with mode: 0644]
drivers/crypto/rsa_mod_exp/mod_exp_uclass.c [new file with mode: 0644]
drivers/ddr/fsl/fsl_ddr_gen4.c
drivers/demo/demo-shape.c
drivers/demo/demo-uclass.c
drivers/fpga/fpga.c
drivers/fpga/xilinx.c
drivers/gpio/gpio-uclass.c
drivers/gpio/s5p_gpio.c
drivers/gpio/sandbox.c
drivers/gpio/tegra_gpio.c
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/i2c-uclass-compat.c [new file with mode: 0644]
drivers/i2c/i2c-uclass.c
drivers/i2c/i2c-uniphier-f.c [new file with mode: 0644]
drivers/i2c/i2c-uniphier.c [new file with mode: 0644]
drivers/i2c/s3c24x0_i2c.c
drivers/i2c/sandbox_i2c.c
drivers/i2c/tegra_i2c.c
drivers/misc/cros_ec.c
drivers/misc/cros_ec_i2c.c
drivers/misc/cros_ec_spi.c
drivers/mmc/Kconfig
drivers/mmc/Makefile
drivers/mmc/mmc.c
drivers/mmc/s5p_sdhci.c
drivers/mmc/sh_sdhi.c [new file with mode: 0644]
drivers/mmc/sunxi_mmc.c
drivers/mmc/tegra_mmc.c
drivers/mmc/zynq_sdhci.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/omap_gpmc.c
drivers/mtd/nand/tegra_nand.c
drivers/mtd/spi/sandbox.c
drivers/mtd/spi/sf_probe.c
drivers/net/Makefile
drivers/net/designware.c
drivers/net/e1000.c
drivers/net/fm/eth.c
drivers/net/fm/t1040.c
drivers/net/mpc5xxx_fec.c
drivers/net/mvgbe.c
drivers/net/phy/Makefile
drivers/net/phy/aquantia.c [new file with mode: 0644]
drivers/net/phy/micrel.c
drivers/net/phy/phy.c
drivers/net/smc91111.h
drivers/net/tsec.c
drivers/net/vsc9953.c [new file with mode: 0644]
drivers/net/xilinx_ll_temac.c
drivers/net/zynq_gem.c
drivers/pci/pci.c
drivers/pci/pci_auto.c
drivers/pci/pci_rom.c
drivers/pci/pci_tegra.c
drivers/power/Kconfig
drivers/power/as3722.c
drivers/power/axp209.c
drivers/power/axp221.c
drivers/power/pmic/Makefile
drivers/power/pmic/pmic_tps62362.c [new file with mode: 0644]
drivers/power/tps6586x.c
drivers/rtc/mc146818.c
drivers/serial/serial-uclass.c
drivers/serial/serial_zynq.c
drivers/spi/cadence_qspi.c
drivers/spi/designware_spi.c
drivers/spi/exynos_spi.c
drivers/spi/ich.c
drivers/spi/sandbox_spi.c
drivers/spi/soft_spi.c
drivers/spi/spi-uclass.c
drivers/spi/tegra114_spi.c
drivers/spi/tegra20_sflash.c
drivers/spi/tegra20_slink.c
drivers/usb/eth/asix88179.c
drivers/usb/gadget/composite.c
drivers/usb/gadget/f_dfu.c
drivers/usb/gadget/pxa25x_udc.c
drivers/usb/host/ehci-exynos.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/xhci-exynos5.c
drivers/usb/musb-new/Makefile
drivers/usb/musb-new/musb_host.c
drivers/usb/musb-new/musb_host.h
drivers/usb/musb-new/musb_regs.h
drivers/usb/musb-new/musb_uboot.c
drivers/usb/musb-new/sunxi.c [new file with mode: 0644]
drivers/usb/musb-new/usb-compat.h
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/cfb_console.c
drivers/video/hitachi_tx18d42vm_lcd.c [new file with mode: 0644]
drivers/video/hitachi_tx18d42vm_lcd.h [new file with mode: 0644]
drivers/video/sed13806.c
drivers/video/ssd2828.c [new file with mode: 0644]
drivers/video/ssd2828.h [new file with mode: 0644]
drivers/video/sunxi_display.c
drivers/video/tegra.c
drivers/video/vesa_fb.c [new file with mode: 0644]
drivers/video/x86_fb.c [deleted file]
examples/standalone/stubs.c
fs/fs.c
include/74xx_7xx.h [deleted file]
include/_exports.h
include/asm-generic/global_data.h
include/asm-generic/gpio.h
include/axp221.h
include/common.h
include/config_distro_bootcmd.h
include/configs/BSC9131RDB.h
include/configs/BSC9132QDS.h
include/configs/C29XPCIE.h
include/configs/CATcenter.h [deleted file]
include/configs/ELPPC.h [deleted file]
include/configs/IceCube.h [deleted file]
include/configs/MPC8360EMDS.h [deleted file]
include/configs/MPC8360ERDK.h [deleted file]
include/configs/MPC837XERDB.h
include/configs/P1_P2_RDB.h [deleted file]
include/configs/P2020COME.h [deleted file]
include/configs/P2020DS.h [deleted file]
include/configs/P3G4.h [deleted file]
include/configs/PM520.h [deleted file]
include/configs/PPChameleonEVB.h [deleted file]
include/configs/T102xQDS.h
include/configs/T102xRDB.h
include/configs/T1040QDS.h
include/configs/T104xRDB.h
include/configs/Total5200.h [deleted file]
include/configs/ZUMA.h [deleted file]
include/configs/am335x_evm.h
include/configs/am43xx_evm.h
include/configs/arndale.h
include/configs/chromebook_link.h
include/configs/corvus.h
include/configs/cpci5200.h [deleted file]
include/configs/devkit8000.h
include/configs/dockstar.h
include/configs/exynos5-common.h
include/configs/exynos5250-common.h
include/configs/goflexhome.h
include/configs/guruplug.h
include/configs/ib62x0.h
include/configs/iconnect.h
include/configs/ids8313.h
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h
include/configs/malta.h
include/configs/mecp5200.h [deleted file]
include/configs/mpc7448hpc2.h [deleted file]
include/configs/odroid.h
include/configs/pcm051.h
include/configs/pf5200.h [deleted file]
include/configs/pogo_e02.h
include/configs/ppmc7xx.h [deleted file]
include/configs/sama5d3_xplained.h
include/configs/sama5d4_xplained.h
include/configs/sama5d4ek.h
include/configs/sandbox.h
include/configs/sheevaplug.h
include/configs/smdk5250.h
include/configs/snapper9260.h
include/configs/snow.h
include/configs/sun4i.h
include/configs/sun5i.h
include/configs/sun6i.h
include/configs/sun7i.h
include/configs/sun8i.h
include/configs/sunxi-common.h
include/configs/taurus.h
include/configs/ti_am335x_common.h
include/configs/ti_omap5_common.h
include/configs/uniphier.h
include/configs/vexpress_aemv8a.h
include/configs/vexpress_common.h
include/configs/x86-common.h
include/configs/zynq-common.h
include/cros_ec.h
include/dm-demo.h
include/dm/device.h
include/dm/test.h
include/dm/uclass-id.h
include/dm/uclass-internal.h
include/dm/uclass.h
include/exports.h
include/fdtdec.h
include/fpga.h
include/fs.h
include/fsl_ddr.h
include/galileo/core.h [deleted file]
include/galileo/gt64260R.h [deleted file]
include/galileo/memory.h [deleted file]
include/galileo/pci.h [deleted file]
include/hash.h
include/i2c.h
include/image.h
include/linker_lists.h
include/linux/mtd/omap_gpmc.h
include/mipi_display.h [new file with mode: 0644]
include/mmc.h
include/net.h
include/netdev.h
include/pci.h
include/pci_rom.h
include/phy.h
include/power/tps62362.h [new file with mode: 0644]
include/power/tps65218.h
include/rtc.h
include/sdhci.h
include/spartan2.h
include/spartan3.h
include/spi.h
include/u-boot/rsa-checksum.h
include/u-boot/rsa-mod-exp.h [new file with mode: 0644]
include/usb.h
include/vbe.h
include/virtex2.h
include/vsc9953.h [new file with mode: 0644]
include/zynqpl.h
lib/Kconfig
lib/fdtdec.c
lib/rsa/Kconfig [new file with mode: 0644]
lib/rsa/Makefile
lib/rsa/rsa-checksum.c
lib/rsa/rsa-mod-exp.c [new file with mode: 0644]
lib/rsa/rsa-verify.c
net/Makefile
net/checksum.c [new file with mode: 0644]
test/dm/bus.c
test/dm/core.c
test/dm/gpio.c
test/dm/i2c.c
test/dm/spi.c
test/dm/test-dm.sh
test/dm/test-fdt.c
test/dm/test.dts
test/image/test-imagetools.sh
tools/Makefile
tools/aisimage.c
tools/atmelimage.c
tools/buildman/README
tools/buildman/bsettings.py
tools/buildman/builder.py
tools/buildman/builderthread.py
tools/buildman/cmdline.py
tools/buildman/control.py
tools/buildman/test.py
tools/buildman/toolchain.py
tools/default_image.c
tools/dumpimage.c
tools/fit_image.c
tools/gpimage-common.c
tools/gpimage.c
tools/imagetool.c
tools/imagetool.h
tools/imagetool.lds [new file with mode: 0644]
tools/imximage.c
tools/kwbimage.c
tools/mkimage.c
tools/mxsimage.c
tools/omapimage.c
tools/patman/README
tools/patman/gitutil.py
tools/patman/patchstream.py
tools/patman/series.py
tools/pblimage.c
tools/socfpgaimage.c
tools/ublimage.c

diff --git a/Kconfig b/Kconfig
index 4157da3c68485540597b7e8993d6786676ac5d25..fed488fdaf94212dfce21902d2cf812a827f819e 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -116,8 +116,9 @@ config FIT_VERBOSE
        depends on FIT
 
 config FIT_SIGNATURE
-       bool "Enabel signature verification of FIT uImages"
+       bool "Enable signature verification of FIT uImages"
        depends on FIT
+       select RSA
        help
          This option enables signature verification of FIT uImages,
          using a hash signed and verified using RSA.
index 701ec337c664dfe916c72b99f4855c3aa8e4c287..1f7735922d6d464476d19dd16419bf8595853829 100644 (file)
@@ -319,12 +319,6 @@ S: Maintained
 T:     git git://git.denx.de/u-boot-mpc86xx.git
 F:     arch/powerpc/cpu/mpc86xx/
 
-POWERPC PPC74XX PPC7XX
-M:     Wolfgang Denk <wd@denx.de>
-S:     Maintained
-T:     git git://git.denx.de/u-boot-74xx-7xx.git
-F:     arch/powerpc/cpu/74xx_7xx/
-
 POWERPC PPC4XX
 M:     Stefan Roese <sr@denx.de>
 S:     Maintained
diff --git a/MAKEALL b/MAKEALL
index 4d643d194c4b46ac01886385a986eb105f3f0007..c5f665f4d1cf1f8b3baa96f8e13e131fe2003443 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -315,12 +315,6 @@ LIST_85xx="$(targets_by_cpu mpc85xx)"
 
 LIST_86xx="$(targets_by_cpu mpc86xx)"
 
-#########################################################################
-## 74xx/7xx Systems
-#########################################################################
-
-LIST_74xx_7xx="$(targets_by_cpu 74xx_7xx)"
-
 #########################################################################
 ## PowerPC groups
 #########################################################################
@@ -342,7 +336,6 @@ LIST_powerpc="              \
        ${LIST_85xx}    \
        ${LIST_86xx}    \
        ${LIST_4xx}     \
-       ${LIST_74xx_7xx}\
 "
 
 # Alias "ppc" -> "powerpc" to not break compatibility with older scripts
index 36a9a283b051527df532d16c5f4dd69c9be3556c..9b406c844700f9674f4a787cb95019e6d7d4c115 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -776,6 +776,13 @@ ifneq ($(CONFIG_SYS_GENERIC_BOARD),y)
        @echo "See doc/README.generic-board for further information"
        @echo "===================================================="
 endif
+ifeq ($(CONFIG_DM_I2C_COMPAT),y)
+       @echo "===================== WARNING ======================"
+       @echo "This board uses CONFIG_DM_I2C_COMPAT. Please remove"
+       @echo "(possibly in a subsequent patch in your series)"
+       @echo "before sending patches to the mailing list."
+       @echo "===================================================="
+endif
 
 PHONY += dtbs
 dtbs dts/dt.dtb: checkdtc u-boot
@@ -1278,7 +1285,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
                        $(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
-              u-boot* MLO* SPL System.map
+              boot* u-boot* MLO* SPL System.map
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
diff --git a/README b/README
index 0fec497328bd5fd27df28efda7a14d828a106346..a28ff133ee057c17af79a397e44325328f82dedf 100644 (file)
--- a/README
+++ b/README
@@ -182,7 +182,6 @@ Directory Hierarchy:
     /lib               Architecture specific library files
   /powerpc             Files generic to PowerPC architecture
     /cpu               CPU specific files
-      /74xx_7xx                Files specific to Freescale MPC74xx and 7xx CPUs
       /mpc5xx          Files specific to Freescale MPC5xx CPUs
       /mpc5xxx         Files specific to Freescale MPC5xxx CPUs
       /mpc8xx          Files specific to Freescale MPC8xx CPUs
@@ -3177,8 +3176,13 @@ CBFS (Coreboot Filesystem) support
                This enables the RSA algorithm used for FIT image verification
                in U-Boot. See doc/uImage.FIT/signature.txt for more information.
 
+               The Modular Exponentiation algorithm in RSA is implemented using
+               driver model. So CONFIG_DM needs to be enabled by default for this
+               library to function.
+
                The signing part is build into mkimage regardless of this
-               option.
+               option. The software based modular exponentiation is built into
+               mkimage irrespective of this option.
 
 - bootcount support:
                CONFIG_BOOTCOUNT_LIMIT
@@ -5900,9 +5904,10 @@ 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'
+       tools/dumpimage -i image -T type -p position data_file
+         -i ==> extract from the 'image' a specific 'data_file'
+         -T ==> set image type to 'type'
+         -p ==> 'position' (starting at 0) of the 'data_file' inside the 'image'
 
 
 Installing a Linux Image:
index d3ef58be043c20d43f4807c8aa74e8f1ff8d48dc..c6b1efeb8bf9acb06a8cb66a79a8733c1468ccf3 100644 (file)
@@ -4,6 +4,9 @@ menu "ARC architecture"
 config SYS_ARCH
        default "arc"
 
+config SYS_CPU
+       default "arcv1"
+
 choice
        prompt "Target select"
 
index 03ea6dbae0d73d8a61e327af0e9e132b70c7028c..a59231e70ebe7a9c092b4f25ab30cf91a38ca37e 100644 (file)
@@ -2,8 +2,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-head-y := arch/arc/cpu/$(CPU)/start.o
-
 libs-y += arch/arc/cpu/$(CPU)/
 libs-y += arch/arc/lib/
 
index e408800a919b36bc4bd64252c6b4b4602bf62118..5321987a566387ffcaeae4c0d51dfa8801f75351 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := $(ARC_CROSS_COMPILE)
 endif
 
+ifdef CONFIG_ARC_MMU_VER
+CONFIG_MMU = 1
+endif
+
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
 
 # Needed for relocation
diff --git a/arch/arc/cpu/arc700/Makefile b/arch/arc/cpu/arc700/Makefile
deleted file mode 100644 (file)
index cdc5002..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-extra-y        += start.o
-
-obj-y  += cache.o
-obj-y  += cpu.o
-obj-y  += interrupts.o
-obj-y  += reset.o
-obj-y  += timer.o
diff --git a/arch/arc/cpu/arc700/cache.c b/arch/arc/cpu/arc700/cache.c
deleted file mode 100644 (file)
index 39d522d..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <asm/arcregs.h>
-
-/* Bit values in IC_CTRL */
-#define IC_CTRL_CACHE_DISABLE  (1 << 0)
-
-/* Bit values in DC_CTRL */
-#define DC_CTRL_CACHE_DISABLE  (1 << 0)
-#define DC_CTRL_INV_MODE_FLUSH (1 << 6)
-#define DC_CTRL_FLUSH_STATUS   (1 << 8)
-
-int icache_status(void)
-{
-       return (read_aux_reg(ARC_AUX_IC_CTRL) & IC_CTRL_CACHE_DISABLE) !=
-              IC_CTRL_CACHE_DISABLE;
-}
-
-void icache_enable(void)
-{
-       write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) &
-                     ~IC_CTRL_CACHE_DISABLE);
-}
-
-void icache_disable(void)
-{
-       write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) |
-                     IC_CTRL_CACHE_DISABLE);
-}
-
-void invalidate_icache_all(void)
-{
-#ifndef CONFIG_SYS_ICACHE_OFF
-       /* Any write to IC_IVIC register triggers invalidation of entire I$ */
-       write_aux_reg(ARC_AUX_IC_IVIC, 1);
-#endif /* CONFIG_SYS_ICACHE_OFF */
-}
-
-int dcache_status(void)
-{
-       return (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_CACHE_DISABLE) !=
-               DC_CTRL_CACHE_DISABLE;
-}
-
-void dcache_enable(void)
-{
-       write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) &
-                     ~(DC_CTRL_INV_MODE_FLUSH | DC_CTRL_CACHE_DISABLE));
-}
-
-void dcache_disable(void)
-{
-       write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) |
-                     DC_CTRL_CACHE_DISABLE);
-}
-
-void flush_dcache_all(void)
-{
-       /* Do flush of entire cache */
-       write_aux_reg(ARC_AUX_DC_FLSH, 1);
-
-       /* Wait flush end */
-       while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS)
-               ;
-}
-
-#ifndef CONFIG_SYS_DCACHE_OFF
-static void dcache_flush_line(unsigned addr)
-{
-#if (CONFIG_ARC_MMU_VER > 2)
-       write_aux_reg(ARC_AUX_DC_PTAG, addr);
-#endif
-       write_aux_reg(ARC_AUX_DC_FLDL, addr);
-
-       /* Wait flush end */
-       while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS)
-               ;
-
-#ifndef CONFIG_SYS_ICACHE_OFF
-       /*
-        * Invalidate I$ for addresses range just flushed from D$.
-        * If we try to execute data flushed above it will be valid/correct
-        */
-#if (CONFIG_ARC_MMU_VER > 2)
-       write_aux_reg(ARC_AUX_IC_PTAG, addr);
-#endif
-       write_aux_reg(ARC_AUX_IC_IVIL, addr);
-#endif /* CONFIG_SYS_ICACHE_OFF */
-}
-#endif /* CONFIG_SYS_DCACHE_OFF */
-
-void flush_dcache_range(unsigned long start, unsigned long end)
-{
-#ifndef CONFIG_SYS_DCACHE_OFF
-       unsigned int addr;
-
-       start = start & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
-       end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
-
-       for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE)
-               dcache_flush_line(addr);
-#endif /* CONFIG_SYS_DCACHE_OFF */
-}
-
-void invalidate_dcache_range(unsigned long start, unsigned long end)
-{
-#ifndef CONFIG_SYS_DCACHE_OFF
-       unsigned int addr;
-
-       start = start & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
-       end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
-
-       for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE) {
-#if (CONFIG_ARC_MMU_VER > 2)
-               write_aux_reg(ARC_AUX_DC_PTAG, addr);
-#endif
-               write_aux_reg(ARC_AUX_DC_IVDL, addr);
-       }
-#endif /* CONFIG_SYS_DCACHE_OFF */
-}
-
-void invalidate_dcache_all(void)
-{
-#ifndef CONFIG_SYS_DCACHE_OFF
-       /* Write 1 to DC_IVDC register triggers invalidation of entire D$ */
-       write_aux_reg(ARC_AUX_DC_IVDC, 1);
-#endif /* CONFIG_SYS_DCACHE_OFF */
-}
-
-void flush_cache(unsigned long start, unsigned long size)
-{
-       flush_dcache_range(start, start + size);
-}
diff --git a/arch/arc/cpu/arc700/config.mk b/arch/arc/cpu/arc700/config.mk
deleted file mode 100644 (file)
index 3206ff4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -mA7
diff --git a/arch/arc/cpu/arc700/cpu.c b/arch/arc/cpu/arc700/cpu.c
deleted file mode 100644 (file)
index 50634b8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arcregs.h>
-#include <asm/cache.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int arch_cpu_init(void)
-{
-#ifdef CONFIG_SYS_ICACHE_OFF
-       icache_disable();
-#else
-       icache_enable();
-       invalidate_icache_all();
-#endif
-
-       flush_dcache_all();
-#ifdef CONFIG_SYS_DCACHE_OFF
-       dcache_disable();
-#else
-       dcache_enable();
-#endif
-       timer_init();
-
-/* In simulation (ISS) "CHIPID" and "ARCNUM" are all "ff" */
-       if ((read_aux_reg(ARC_AUX_IDENTITY) & 0xffffff00) == 0xffffff00)
-               gd->arch.running_on_hw = 0;
-       else
-               gd->arch.running_on_hw = 1;
-
-       gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
-       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
-
-       return 0;
-}
-
-int arch_early_init_r(void)
-{
-       gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
-       gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-       return 0;
-}
diff --git a/arch/arc/cpu/arc700/interrupts.c b/arch/arc/cpu/arc700/interrupts.c
deleted file mode 100644 (file)
index d93a6eb..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arcregs.h>
-#include <asm/ptrace.h>
-
-/* Bit values in STATUS32 */
-#define E1_MASK                (1 << 1)        /* Level 1 interrupts enable */
-#define E2_MASK                (1 << 2)        /* Level 2 interrupts enable */
-
-int interrupt_init(void)
-{
-       return 0;
-}
-
-/*
- * returns true if interrupts had been enabled before we disabled them
- */
-int disable_interrupts(void)
-{
-       int status = read_aux_reg(ARC_AUX_STATUS32);
-       int state = (status | E1_MASK | E2_MASK) ? 1 : 0;
-
-       status &= ~(E1_MASK | E2_MASK);
-       /* STATUS32 register is updated indirectly with "FLAG" instruction */
-       __asm__("flag %0" : : "r" (status));
-       return state;
-}
-
-void enable_interrupts(void)
-{
-       unsigned int status = read_aux_reg(ARC_AUX_STATUS32);
-
-       status |= E1_MASK | E2_MASK;
-       /* STATUS32 register is updated indirectly with "FLAG" instruction */
-       __asm__("flag %0" : : "r" (status));
-}
-
-static void print_reg_file(long *reg_rev, int start_num)
-{
-       unsigned int i;
-
-       /* Print 3 registers per line */
-       for (i = start_num; i < start_num + 25; i++) {
-               printf("r%02u: 0x%08lx\t", i, (unsigned long)*reg_rev);
-               if (((i + 1) % 3) == 0)
-                       printf("\n");
-
-               /* Because pt_regs has registers reversed */
-               reg_rev--;
-       }
-
-       /* Add new-line if none was inserted in the end of loop above */
-       if (((i + 1) % 3) != 0)
-               printf("\n");
-}
-
-void show_regs(struct pt_regs *regs)
-{
-       printf("RET:\t0x%08lx\nBLINK:\t0x%08lx\nSTAT32:\t0x%08lx\n",
-              regs->ret, regs->blink, regs->status32);
-       printf("GP: 0x%08lx\t r25: 0x%08lx\t\n", regs->r26, regs->r25);
-       printf("BTA: 0x%08lx\t SP: 0x%08lx\t FP: 0x%08lx\n", regs->bta,
-              regs->sp, regs->fp);
-       printf("LPS: 0x%08lx\tLPE: 0x%08lx\tLPC: 0x%08lx\n", regs->lp_start,
-              regs->lp_end, regs->lp_count);
-
-       print_reg_file(&(regs->r0), 0);
-}
-
-void bad_mode(struct pt_regs *regs)
-{
-       if (regs)
-               show_regs(regs);
-
-       panic("Resetting CPU ...\n");
-}
-
-void do_memory_error(unsigned long address, struct pt_regs *regs)
-{
-       printf("Memory error exception @ 0x%lx\n", address);
-       bad_mode(regs);
-}
-
-void do_instruction_error(unsigned long address, struct pt_regs *regs)
-{
-       printf("Instruction error exception @ 0x%lx\n", address);
-       bad_mode(regs);
-}
-
-void do_machine_check_fault(unsigned long address, struct pt_regs *regs)
-{
-       printf("Machine check exception @ 0x%lx\n", address);
-       bad_mode(regs);
-}
-
-void do_interrupt_handler(void)
-{
-       printf("Interrupt fired\n");
-       bad_mode(0);
-}
-
-void do_itlb_miss(struct pt_regs *regs)
-{
-       printf("I TLB miss exception\n");
-       bad_mode(regs);
-}
-
-void do_dtlb_miss(struct pt_regs *regs)
-{
-       printf("D TLB miss exception\n");
-       bad_mode(regs);
-}
-
-void do_tlb_prot_violation(unsigned long address, struct pt_regs *regs)
-{
-       printf("TLB protection violation or misaligned access @ 0x%lx\n",
-              address);
-       bad_mode(regs);
-}
-
-void do_privilege_violation(struct pt_regs *regs)
-{
-       printf("Privilege violation exception\n");
-       bad_mode(regs);
-}
-
-void do_trap(struct pt_regs *regs)
-{
-       printf("Trap exception\n");
-       bad_mode(regs);
-}
-
-void do_extension(struct pt_regs *regs)
-{
-       printf("Extension instruction exception\n");
-       bad_mode(regs);
-}
diff --git a/arch/arc/cpu/arc700/reset.c b/arch/arc/cpu/arc700/reset.c
deleted file mode 100644 (file)
index 98ebf1d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <command.h>
-#include <common.h>
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
-{
-       printf("Put your restart handler here\n");
-
-#ifdef DEBUG
-       /* Stop debug session here */
-       __asm__("brk");
-#endif
-       return 0;
-}
diff --git a/arch/arc/cpu/arc700/start.S b/arch/arc/cpu/arc700/start.S
deleted file mode 100644 (file)
index 563513b..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm-offsets.h>
-#include <config.h>
-#include <asm/arcregs.h>
-
-/*
- * Note on the LD/ST addressing modes with address register write-back
- *
- * LD.a same as LD.aw
- *
- * LD.a    reg1, [reg2, x]  => Pre Incr
- *      Eff Addr for load = [reg2 + x]
- *
- * LD.ab   reg1, [reg2, x]  => Post Incr
- *      Eff Addr for load = [reg2]
- */
-
-.macro PUSH reg
-       st.a    \reg, [%sp, -4]
-.endm
-
-.macro PUSHAX aux
-       lr      %r9, [\aux]
-       PUSH    %r9
-.endm
-
-.macro  SAVE_R1_TO_R24
-       PUSH    %r1
-       PUSH    %r2
-       PUSH    %r3
-       PUSH    %r4
-       PUSH    %r5
-       PUSH    %r6
-       PUSH    %r7
-       PUSH    %r8
-       PUSH    %r9
-       PUSH    %r10
-       PUSH    %r11
-       PUSH    %r12
-       PUSH    %r13
-       PUSH    %r14
-       PUSH    %r15
-       PUSH    %r16
-       PUSH    %r17
-       PUSH    %r18
-       PUSH    %r19
-       PUSH    %r20
-       PUSH    %r21
-       PUSH    %r22
-       PUSH    %r23
-       PUSH    %r24
-.endm
-
-.macro SAVE_ALL_SYS
-
-       st      %r0, [%sp]
-       lr      %r0, [%ecr]
-       st      %r0, [%sp, 8]   /* ECR */
-       st      %sp, [%sp, 4]
-
-       SAVE_R1_TO_R24
-       PUSH    %r25
-       PUSH    %gp
-       PUSH    %fp
-       PUSH    %blink
-       PUSHAX  %eret
-       PUSHAX  %erstatus
-       PUSH    %lp_count
-       PUSHAX  %lp_end
-       PUSHAX  %lp_start
-       PUSHAX  %erbta
-.endm
-
-.align 4
-.globl _start
-_start:
-       /* Critical system events */
-       j       reset                   /* 0 - 0x000 */
-       j       memory_error            /* 1 - 0x008 */
-       j       instruction_error       /* 2 - 0x010 */
-
-       /* Device interrupts */
-.rept  29
-       j       interrupt_handler       /* 3:31 - 0x018:0xF8 */
-.endr
-       /* Exceptions */
-       j       EV_MachineCheck         /* 0x100, Fatal Machine check  (0x20) */
-       j       EV_TLBMissI             /* 0x108, Intruction TLB miss  (0x21) */
-       j       EV_TLBMissD             /* 0x110, Data TLB miss        (0x22) */
-       j       EV_TLBProtV             /* 0x118, Protection Violation (0x23)
-                                                       or Misaligned Access  */
-       j       EV_PrivilegeV           /* 0x120, Privilege Violation  (0x24) */
-       j       EV_Trap                 /* 0x128, Trap exception       (0x25) */
-       j       EV_Extension            /* 0x130, Extn Intruction Excp (0x26) */
-
-memory_error:
-       SAVE_ALL_SYS
-       lr      %r0, [%efa]
-       mov     %r1, %sp
-       j       do_memory_error
-
-instruction_error:
-       SAVE_ALL_SYS
-       lr      %r0, [%efa]
-       mov     %r1, %sp
-       j       do_instruction_error
-
-interrupt_handler:
-       /* Todo - save and restore CPU context when interrupts will be in use */
-       bl      do_interrupt_handler
-       rtie
-
-EV_MachineCheck:
-       SAVE_ALL_SYS
-       lr      %r0, [%efa]
-       mov     %r1, %sp
-       j       do_machine_check_fault
-
-EV_TLBMissI:
-       SAVE_ALL_SYS
-       mov     %r0, %sp
-       j       do_itlb_miss
-
-EV_TLBMissD:
-       SAVE_ALL_SYS
-       mov     %r0, %sp
-       j       do_dtlb_miss
-
-EV_TLBProtV:
-       SAVE_ALL_SYS
-       lr      %r0, [%efa]
-       mov     %r1, %sp
-       j       do_tlb_prot_violation
-
-EV_PrivilegeV:
-       SAVE_ALL_SYS
-       mov     %r0, %sp
-       j       do_privilege_violation
-
-EV_Trap:
-       SAVE_ALL_SYS
-       mov     %r0, %sp
-       j       do_trap
-
-EV_Extension:
-       SAVE_ALL_SYS
-       mov     %r0, %sp
-       j       do_extension
-
-
-reset:
-       /* Setup interrupt vector base that matches "__text_start" */
-       sr      __text_start, [ARC_AUX_INTR_VEC_BASE]
-
-       /* Setup stack pointer */
-       mov     %sp, CONFIG_SYS_INIT_SP_ADDR
-       mov     %fp, %sp
-
-       /* Clear bss */
-       mov     %r0, __bss_start
-       mov     %r1, __bss_end
-
-clear_bss:
-       st.ab   0, [%r0, 4]
-       brlt    %r0, %r1, clear_bss
-
-       /* Zero the one and only argument of "board_init_f" */
-       mov_s   %r0, 0
-       j       board_init_f
-
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- * r0 = start_addr_sp
- * r1 = new__gd
- * r2 = relocaddr
- */
-.align 4
-.globl relocate_code
-relocate_code:
-       /*
-        * r0-r12 might be clobbered by C functions
-        * so we use r13-r16 for storage here
-        */
-       mov     %r13, %r0               /* save addr_sp */
-       mov     %r14, %r1               /* save addr of gd */
-       mov     %r15, %r2               /* save addr of destination */
-
-       mov     %r16, %r2               /* %r9 - relocation offset */
-       sub     %r16, %r16, __image_copy_start
-
-/* Set up the stack */
-stack_setup:
-       mov     %sp, %r13
-       mov     %fp, %sp
-
-/* Check if monitor is loaded right in place for relocation */
-       mov     %r0, __image_copy_start
-       cmp     %r0, %r15               /* skip relocation if code loaded */
-       bz      do_board_init_r         /* in target location already */
-
-/* Copy data (__image_copy_start - __image_copy_end) to new location */
-       mov     %r1, %r15
-       mov     %r2, __image_copy_end
-       sub     %r2, %r2, %r0           /* r3 <- amount of bytes to copy */
-       asr     %r2, %r2, 2             /* r3 <- amount of words to copy */
-       mov     %lp_count, %r2
-       lp      copy_end
-       ld.ab   %r2,[%r0,4]
-       st.ab   %r2,[%r1,4]
-copy_end:
-
-/* Fix relocations related issues */
-       bl      do_elf_reloc_fixups
-#ifndef CONFIG_SYS_ICACHE_OFF
-       bl      invalidate_icache_all
-#endif
-#ifndef CONFIG_SYS_DCACHE_OFF
-       bl      flush_dcache_all
-#endif
-
-/* Update position of intterupt vector table */
-       lr      %r0, [ARC_AUX_INTR_VEC_BASE]    /* Read current position */
-       add     %r0, %r0, %r16                  /* Update address */
-       sr      %r0, [ARC_AUX_INTR_VEC_BASE]    /* Write new position */
-
-do_board_init_r:
-/* Prepare for exection of "board_init_r" in relocated monitor */
-       mov     %r2, board_init_r       /* old address of "board_init_r()" */
-       add     %r2, %r2, %r16          /* new address of "board_init_r()" */
-       mov     %r0, %r14               /* 1-st parameter: gd_t */
-       mov     %r1, %r15               /* 2-nd parameter: dest_addr */
-       j       [%r2]
diff --git a/arch/arc/cpu/arc700/timer.c b/arch/arc/cpu/arc700/timer.c
deleted file mode 100644 (file)
index a0acbbc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm/arcregs.h>
-
-#define NH_MODE        (1 << 1)        /* Disable timer if CPU is halted */
-
-int timer_init(void)
-{
-       write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE);
-       /* Set max value for counter/timer */
-       write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0xffffffff);
-       /* Set initial count value and restart counter/timer */
-       write_aux_reg(ARC_AUX_TIMER0_CNT, 0);
-       return 0;
-}
-
-unsigned long timer_read_counter(void)
-{
-       return read_aux_reg(ARC_AUX_TIMER0_CNT);
-}
diff --git a/arch/arc/cpu/arc700/u-boot.lds b/arch/arc/cpu/arc700/u-boot.lds
deleted file mode 100644 (file)
index 2d01b21..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-OUTPUT_FORMAT("elf32-littlearc", "elf32-littlearc", "elf32-littlearc")
-OUTPUT_ARCH(arc)
-ENTRY(_start)
-SECTIONS
-{
-       . = ALIGN(4);
-       .text : {
-               *(.__text_start)
-               *(.__image_copy_start)
-               CPUDIR/start.o (.text*)
-               *(.text*)
-       }
-
-       . = ALIGN(4);
-       .text_end :
-       {
-               *(.__text_end)
-       }
-
-       . = ALIGN(4);
-       .rodata : {
-               *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-       }
-
-       . = ALIGN(4);
-       .data : {
-               *(.data*)
-       }
-
-       . = ALIGN(4);
-       .u_boot_list : {
-               KEEP(*(SORT(.u_boot_list*)));
-       }
-
-       . = ALIGN(4);
-       .rel_dyn_start : {
-               *(.__rel_dyn_start)
-       }
-
-       .rela.dyn : {
-               *(.rela.dyn)
-       }
-
-       .rel_dyn_end : {
-               *(.__rel_dyn_end)
-       }
-
-       . = ALIGN(4);
-       .bss_start : {
-               *(.__bss_start);
-       }
-
-       .bss : {
-               *(.bss*)
-       }
-
-       .bss_end : {
-               *(.__bss_end);
-       }
-
-       . = ALIGN(4);
-       .image_copy_end : {
-               *(.__image_copy_end)
-               *(.__init_end)
-       }
-}
diff --git a/arch/arc/cpu/arcv1/Makefile b/arch/arc/cpu/arcv1/Makefile
new file mode 100644 (file)
index 0000000..3704ebe
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += start.o
diff --git a/arch/arc/cpu/arcv1/config.mk b/arch/arc/cpu/arcv1/config.mk
new file mode 100644 (file)
index 0000000..3206ff4
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+PLATFORM_CPPFLAGS += -mA7
diff --git a/arch/arc/cpu/arcv1/start.S b/arch/arc/cpu/arcv1/start.S
new file mode 100644 (file)
index 0000000..01cfba4
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <asm/arcregs.h>
+
+/*
+ * Note on the LD/ST addressing modes with address register write-back
+ *
+ * LD.a same as LD.aw
+ *
+ * LD.a    reg1, [reg2, x]  => Pre Incr
+ *      Eff Addr for load = [reg2 + x]
+ *
+ * LD.ab   reg1, [reg2, x]  => Post Incr
+ *      Eff Addr for load = [reg2]
+ */
+
+.macro PUSH reg
+       st.a    \reg, [%sp, -4]
+.endm
+
+.macro PUSHAX aux
+       lr      %r9, [\aux]
+       PUSH    %r9
+.endm
+
+.macro  SAVE_R1_TO_R24
+       PUSH    %r1
+       PUSH    %r2
+       PUSH    %r3
+       PUSH    %r4
+       PUSH    %r5
+       PUSH    %r6
+       PUSH    %r7
+       PUSH    %r8
+       PUSH    %r9
+       PUSH    %r10
+       PUSH    %r11
+       PUSH    %r12
+       PUSH    %r13
+       PUSH    %r14
+       PUSH    %r15
+       PUSH    %r16
+       PUSH    %r17
+       PUSH    %r18
+       PUSH    %r19
+       PUSH    %r20
+       PUSH    %r21
+       PUSH    %r22
+       PUSH    %r23
+       PUSH    %r24
+.endm
+
+.macro SAVE_ALL_SYS
+       /* saving %r0 to reg->r0 in advance since we read %ecr into it */
+       st      %r0, [%sp, -8]
+       lr      %r0, [%ecr]     /* all stack addressing is manual so far */
+       st      %r0, [%sp]
+       st      %sp, [%sp, -4]
+       /* now move %sp to reg->r0 position so we can do "push" automatically */
+       sub     %sp, %sp, 8
+
+       SAVE_R1_TO_R24
+       PUSH    %r25
+       PUSH    %gp
+       PUSH    %fp
+       PUSH    %blink
+       PUSHAX  %eret
+       PUSHAX  %erstatus
+       PUSH    %lp_count
+       PUSHAX  %lp_end
+       PUSHAX  %lp_start
+       PUSHAX  %erbta
+.endm
+
+.macro SAVE_EXCEPTION_SOURCE
+#ifdef CONFIG_MMU
+       /* If MMU exists exception faulting address is loaded in EFA reg */
+       lr      %r0, [%efa]
+#else
+       /* Otherwise in ERET (exception return) reg */
+       lr      %r0, [%eret]
+#endif
+.endm
+
+.section .ivt, "ax",@progbits
+.align 4
+_ivt:
+       /* Critical system events */
+       j       _start                  /* 0 - 0x000 */
+       j       memory_error            /* 1 - 0x008 */
+       j       instruction_error       /* 2 - 0x010 */
+
+       /* Device interrupts */
+.rept  29
+       j       interrupt_handler       /* 3:31 - 0x018:0xF8 */
+.endr
+       /* Exceptions */
+       j       EV_MachineCheck         /* 0x100, Fatal Machine check  (0x20) */
+       j       EV_TLBMissI             /* 0x108, Intruction TLB miss  (0x21) */
+       j       EV_TLBMissD             /* 0x110, Data TLB miss        (0x22) */
+       j       EV_TLBProtV             /* 0x118, Protection Violation (0x23)
+                                                       or Misaligned Access  */
+       j       EV_PrivilegeV           /* 0x120, Privilege Violation  (0x24) */
+       j       EV_Trap                 /* 0x128, Trap exception       (0x25) */
+       j       EV_Extension            /* 0x130, Extn Intruction Excp (0x26) */
+
+.text
+.globl _start
+_start:
+       /* Setup interrupt vector base that matches "__text_start" */
+       sr      __ivt_start, [ARC_AUX_INTR_VEC_BASE]
+
+       /* Setup stack pointer */
+       mov     %sp, CONFIG_SYS_INIT_SP_ADDR
+       mov     %fp, %sp
+
+       /* Clear bss */
+       mov     %r0, __bss_start
+       mov     %r1, __bss_end
+
+clear_bss:
+       st.ab   0, [%r0, 4]
+       brlt    %r0, %r1, clear_bss
+
+       /* Zero the one and only argument of "board_init_f" */
+       mov_s   %r0, 0
+       j       board_init_f
+
+memory_error:
+       SAVE_ALL_SYS
+       SAVE_EXCEPTION_SOURCE
+       mov     %r1, %sp
+       j       do_memory_error
+
+instruction_error:
+       SAVE_ALL_SYS
+       SAVE_EXCEPTION_SOURCE
+       mov     %r1, %sp
+       j       do_instruction_error
+
+interrupt_handler:
+       /* Todo - save and restore CPU context when interrupts will be in use */
+       bl      do_interrupt_handler
+       rtie
+
+EV_MachineCheck:
+       SAVE_ALL_SYS
+       SAVE_EXCEPTION_SOURCE
+       mov     %r1, %sp
+       j       do_machine_check_fault
+
+EV_TLBMissI:
+       SAVE_ALL_SYS
+       mov     %r0, %sp
+       j       do_itlb_miss
+
+EV_TLBMissD:
+       SAVE_ALL_SYS
+       mov     %r0, %sp
+       j       do_dtlb_miss
+
+EV_TLBProtV:
+       SAVE_ALL_SYS
+       SAVE_EXCEPTION_SOURCE
+       mov     %r1, %sp
+       j       do_tlb_prot_violation
+
+EV_PrivilegeV:
+       SAVE_ALL_SYS
+       mov     %r0, %sp
+       j       do_privilege_violation
+
+EV_Trap:
+       SAVE_ALL_SYS
+       mov     %r0, %sp
+       j       do_trap
+
+EV_Extension:
+       SAVE_ALL_SYS
+       mov     %r0, %sp
+       j       do_extension
+
+/*
+ * void relocate_code (addr_sp, gd, addr_moni)
+ *
+ * This "function" does not return, instead it continues in RAM
+ * after relocating the monitor code.
+ *
+ * r0 = start_addr_sp
+ * r1 = new__gd
+ * r2 = relocaddr
+ */
+.align 4
+.globl relocate_code
+relocate_code:
+       /*
+        * r0-r12 might be clobbered by C functions
+        * so we use r13-r16 for storage here
+        */
+       mov     %r13, %r0               /* save addr_sp */
+       mov     %r14, %r1               /* save addr of gd */
+       mov     %r15, %r2               /* save addr of destination */
+
+       mov     %r16, %r2               /* %r9 - relocation offset */
+       sub     %r16, %r16, __image_copy_start
+
+/* Set up the stack */
+stack_setup:
+       mov     %sp, %r13
+       mov     %fp, %sp
+
+/* Check if monitor is loaded right in place for relocation */
+       mov     %r0, __image_copy_start
+       cmp     %r0, %r15               /* skip relocation if code loaded */
+       bz      do_board_init_r         /* in target location already */
+
+/* Copy data (__image_copy_start - __image_copy_end) to new location */
+       mov     %r1, %r15
+       mov     %r2, __image_copy_end
+       sub     %r2, %r2, %r0           /* r3 <- amount of bytes to copy */
+       asr     %r2, %r2, 2             /* r3 <- amount of words to copy */
+       mov     %lp_count, %r2
+       lp      copy_end
+       ld.ab   %r2,[%r0,4]
+       st.ab   %r2,[%r1,4]
+copy_end:
+
+/* Fix relocations related issues */
+       bl      do_elf_reloc_fixups
+#ifndef CONFIG_SYS_ICACHE_OFF
+       bl      invalidate_icache_all
+#endif
+#ifndef CONFIG_SYS_DCACHE_OFF
+       bl      flush_dcache_all
+#endif
+
+/* Update position of intterupt vector table */
+       lr      %r0, [ARC_AUX_INTR_VEC_BASE]    /* Read current position */
+       add     %r0, %r0, %r16                  /* Update address */
+       sr      %r0, [ARC_AUX_INTR_VEC_BASE]    /* Write new position */
+
+do_board_init_r:
+/* Prepare for exection of "board_init_r" in relocated monitor */
+       mov     %r2, board_init_r       /* old address of "board_init_r()" */
+       add     %r2, %r2, %r16          /* new address of "board_init_r()" */
+       mov     %r0, %r14               /* 1-st parameter: gd_t */
+       mov     %r1, %r15               /* 2-nd parameter: dest_addr */
+       j       [%r2]
diff --git a/arch/arc/cpu/u-boot.lds b/arch/arc/cpu/u-boot.lds
new file mode 100644 (file)
index 0000000..ccddbf7
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+OUTPUT_FORMAT("elf32-littlearc", "elf32-littlearc", "elf32-littlearc")
+OUTPUT_ARCH(arc)
+ENTRY(_start)
+SECTIONS
+{
+       . = ALIGN(4);
+       .text : {
+               *(.__text_start)
+               *(.__image_copy_start)
+               *(.text*)
+       }
+
+       . = ALIGN(4);
+       .text_end :
+       {
+               *(.__text_end)
+       }
+
+       . = ALIGN(1024);
+       .ivt_start : {
+               *(.__ivt_start)
+       }
+
+       .ivt :
+       {
+               *(.ivt)
+       }
+
+       .ivt_end : {
+               *(.__ivt_end)
+       }
+
+       . = ALIGN(4);
+       .rodata : {
+               *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+       }
+
+       . = ALIGN(4);
+       .data : {
+               *(.data*)
+       }
+
+       . = ALIGN(4);
+       .u_boot_list : {
+               KEEP(*(SORT(.u_boot_list*)));
+       }
+
+       . = ALIGN(4);
+       .rel_dyn_start : {
+               *(.__rel_dyn_start)
+       }
+
+       .rela.dyn : {
+               *(.rela.dyn)
+       }
+
+       .rel_dyn_end : {
+               *(.__rel_dyn_end)
+       }
+
+       . = ALIGN(4);
+       .bss_start : {
+               *(.__bss_start);
+       }
+
+       .bss : {
+               *(.bss*)
+       }
+
+       .bss_end : {
+               *(.__bss_end);
+       }
+
+       . = ALIGN(4);
+       .image_copy_end : {
+               *(.__image_copy_end)
+               *(.__init_end)
+       }
+}
index 5d48d11bab6b76e2878b69e2ecb7742dd90beca2..8ace87fa0f25953a910161c8c9eaf4e845822b9f 100644 (file)
@@ -24,6 +24,7 @@
 #if (CONFIG_ARC_MMU_VER > 2)
 #define ARC_AUX_IC_PTAG                0x1E
 #endif
+#define ARC_BCR_IC_BUILD       0x77
 
 /* Timer related auxiliary registers */
 #define ARC_AUX_TIMER0_CNT     0x21    /* Timer 0 count */
@@ -42,6 +43,7 @@
 #if (CONFIG_ARC_MMU_VER > 2)
 #define ARC_AUX_DC_PTAG                0x5C
 #endif
+#define ARC_BCR_DC_BUILD       0x72
 
 #ifndef __ASSEMBLY__
 /* Accessors for auxiliary registers */
index 18484a17f216e1bbce10c3b4b7ceae79e5e4595c..b8f2a859fd9a17aff0db8b97decaa39faf2e556f 100644 (file)
@@ -10,5 +10,8 @@
 #include <asm-generic/sections.h>
 
 extern ulong __text_end;
+extern ulong __ivt_start;
+extern ulong __ivt_end;
+extern ulong __image_copy_start;
 
 #endif /* __ASM_ARC_SECTIONS_H */
index 7675f855d5a964c56bd9c0c67f3d4a34c98659a7..bae44199a41b16c7662607d77bff0715def97b83 100644 (file)
@@ -4,6 +4,9 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
+obj-y += cache.o
+obj-y += cpu.o
+obj-y += interrupts.o
 obj-y += sections.o
 obj-y += relocate.o
 obj-y += strchr-700.o
@@ -13,4 +16,7 @@ obj-y += strlen.o
 obj-y += memcmp.o
 obj-y += memcpy-700.o
 obj-y += memset.o
+obj-y += reset.o
+obj-y += timer.o
+
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
new file mode 100644 (file)
index 0000000..fa19a13
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+#include <asm/arcregs.h>
+
+/* Bit values in IC_CTRL */
+#define IC_CTRL_CACHE_DISABLE  (1 << 0)
+
+/* Bit values in DC_CTRL */
+#define DC_CTRL_CACHE_DISABLE  (1 << 0)
+#define DC_CTRL_INV_MODE_FLUSH (1 << 6)
+#define DC_CTRL_FLUSH_STATUS   (1 << 8)
+#define CACHE_VER_NUM_MASK     0xF
+
+int icache_status(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_IC_BUILD) & CACHE_VER_NUM_MASK))
+               return 0;
+
+       return (read_aux_reg(ARC_AUX_IC_CTRL) & IC_CTRL_CACHE_DISABLE) !=
+              IC_CTRL_CACHE_DISABLE;
+}
+
+void icache_enable(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_IC_BUILD) & CACHE_VER_NUM_MASK))
+               return;
+
+       write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) &
+                     ~IC_CTRL_CACHE_DISABLE);
+}
+
+void icache_disable(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_IC_BUILD) & CACHE_VER_NUM_MASK))
+               return;
+
+       write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) |
+                     IC_CTRL_CACHE_DISABLE);
+}
+
+void invalidate_icache_all(void)
+{
+#ifndef CONFIG_SYS_ICACHE_OFF
+       /* Any write to IC_IVIC register triggers invalidation of entire I$ */
+       write_aux_reg(ARC_AUX_IC_IVIC, 1);
+#endif /* CONFIG_SYS_ICACHE_OFF */
+}
+
+int dcache_status(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_DC_BUILD) & CACHE_VER_NUM_MASK))
+               return 0;
+
+       return (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_CACHE_DISABLE) !=
+               DC_CTRL_CACHE_DISABLE;
+}
+
+void dcache_enable(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_DC_BUILD) & CACHE_VER_NUM_MASK))
+               return;
+
+       write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) &
+                     ~(DC_CTRL_INV_MODE_FLUSH | DC_CTRL_CACHE_DISABLE));
+}
+
+void dcache_disable(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_DC_BUILD) & CACHE_VER_NUM_MASK))
+               return;
+
+       write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) |
+                     DC_CTRL_CACHE_DISABLE);
+}
+
+void flush_dcache_all(void)
+{
+       /* If no cache in CPU exit immediately */
+       if (!(read_aux_reg(ARC_BCR_DC_BUILD) & CACHE_VER_NUM_MASK))
+               return;
+
+       /* Do flush of entire cache */
+       write_aux_reg(ARC_AUX_DC_FLSH, 1);
+
+       /* Wait flush end */
+       while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS)
+               ;
+}
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+static void dcache_flush_line(unsigned addr)
+{
+#if (CONFIG_ARC_MMU_VER > 2)
+       write_aux_reg(ARC_AUX_DC_PTAG, addr);
+#endif
+       write_aux_reg(ARC_AUX_DC_FLDL, addr);
+
+       /* Wait flush end */
+       while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS)
+               ;
+
+#ifndef CONFIG_SYS_ICACHE_OFF
+       /*
+        * Invalidate I$ for addresses range just flushed from D$.
+        * If we try to execute data flushed above it will be valid/correct
+        */
+#if (CONFIG_ARC_MMU_VER > 2)
+       write_aux_reg(ARC_AUX_IC_PTAG, addr);
+#endif
+       write_aux_reg(ARC_AUX_IC_IVIL, addr);
+#endif /* CONFIG_SYS_ICACHE_OFF */
+}
+#endif /* CONFIG_SYS_DCACHE_OFF */
+
+void flush_dcache_range(unsigned long start, unsigned long end)
+{
+#ifndef CONFIG_SYS_DCACHE_OFF
+       unsigned int addr;
+
+       start = start & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
+       end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
+
+       for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE)
+               dcache_flush_line(addr);
+#endif /* CONFIG_SYS_DCACHE_OFF */
+}
+
+void invalidate_dcache_range(unsigned long start, unsigned long end)
+{
+#ifndef CONFIG_SYS_DCACHE_OFF
+       unsigned int addr;
+
+       start = start & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
+       end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
+
+       for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE) {
+#if (CONFIG_ARC_MMU_VER > 2)
+               write_aux_reg(ARC_AUX_DC_PTAG, addr);
+#endif
+               write_aux_reg(ARC_AUX_DC_IVDL, addr);
+       }
+#endif /* CONFIG_SYS_DCACHE_OFF */
+}
+
+void invalidate_dcache_all(void)
+{
+#ifndef CONFIG_SYS_DCACHE_OFF
+       /* Write 1 to DC_IVDC register triggers invalidation of entire D$ */
+       write_aux_reg(ARC_AUX_DC_IVDC, 1);
+#endif /* CONFIG_SYS_DCACHE_OFF */
+}
+
+void flush_cache(unsigned long start, unsigned long size)
+{
+       flush_dcache_range(start, start + size);
+}
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c
new file mode 100644 (file)
index 0000000..50634b8
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arcregs.h>
+#include <asm/cache.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int arch_cpu_init(void)
+{
+#ifdef CONFIG_SYS_ICACHE_OFF
+       icache_disable();
+#else
+       icache_enable();
+       invalidate_icache_all();
+#endif
+
+       flush_dcache_all();
+#ifdef CONFIG_SYS_DCACHE_OFF
+       dcache_disable();
+#else
+       dcache_enable();
+#endif
+       timer_init();
+
+/* In simulation (ISS) "CHIPID" and "ARCNUM" are all "ff" */
+       if ((read_aux_reg(ARC_AUX_IDENTITY) & 0xffffff00) == 0xffffff00)
+               gd->arch.running_on_hw = 0;
+       else
+               gd->arch.running_on_hw = 1;
+
+       gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
+       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+       return 0;
+}
+
+int arch_early_init_r(void)
+{
+       gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
+       return 0;
+}
diff --git a/arch/arc/lib/interrupts.c b/arch/arc/lib/interrupts.c
new file mode 100644 (file)
index 0000000..d7cab3b
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arcregs.h>
+#include <asm/ptrace.h>
+
+/* Bit values in STATUS32 */
+#define E1_MASK                (1 << 1)        /* Level 1 interrupts enable */
+#define E2_MASK                (1 << 2)        /* Level 2 interrupts enable */
+
+int interrupt_init(void)
+{
+       return 0;
+}
+
+/*
+ * returns true if interrupts had been enabled before we disabled them
+ */
+int disable_interrupts(void)
+{
+       int status = read_aux_reg(ARC_AUX_STATUS32);
+       int state = (status & (E1_MASK | E2_MASK)) ? 1 : 0;
+
+       status &= ~(E1_MASK | E2_MASK);
+       /* STATUS32 register is updated indirectly with "FLAG" instruction */
+       __asm__("flag %0" : : "r" (status));
+       return state;
+}
+
+void enable_interrupts(void)
+{
+       unsigned int status = read_aux_reg(ARC_AUX_STATUS32);
+
+       status |= E1_MASK | E2_MASK;
+       /* STATUS32 register is updated indirectly with "FLAG" instruction */
+       __asm__("flag %0" : : "r" (status));
+}
+
+static void print_reg_file(long *reg_rev, int start_num)
+{
+       unsigned int i;
+
+       /* Print 3 registers per line */
+       for (i = start_num; i < start_num + 25; i++) {
+               printf("r%02u: 0x%08lx\t", i, (unsigned long)*reg_rev);
+               if (((i + 1) % 3) == 0)
+                       printf("\n");
+
+               /* Because pt_regs has registers reversed */
+               reg_rev--;
+       }
+
+       /* Add new-line if none was inserted in the end of loop above */
+       if (((i + 1) % 3) != 0)
+               printf("\n");
+}
+
+void show_regs(struct pt_regs *regs)
+{
+       printf("ECR:\t0x%08lx\n", regs->ecr);
+       printf("RET:\t0x%08lx\nBLINK:\t0x%08lx\nSTAT32:\t0x%08lx\n",
+              regs->ret, regs->blink, regs->status32);
+       printf("GP: 0x%08lx\t r25: 0x%08lx\t\n", regs->r26, regs->r25);
+       printf("BTA: 0x%08lx\t SP: 0x%08lx\t FP: 0x%08lx\n", regs->bta,
+              regs->sp, regs->fp);
+       printf("LPS: 0x%08lx\tLPE: 0x%08lx\tLPC: 0x%08lx\n", regs->lp_start,
+              regs->lp_end, regs->lp_count);
+
+       print_reg_file(&(regs->r0), 0);
+}
+
+void bad_mode(struct pt_regs *regs)
+{
+       if (regs)
+               show_regs(regs);
+
+       panic("Resetting CPU ...\n");
+}
+
+void do_memory_error(unsigned long address, struct pt_regs *regs)
+{
+       printf("Memory error exception @ 0x%lx\n", address);
+       bad_mode(regs);
+}
+
+void do_instruction_error(unsigned long address, struct pt_regs *regs)
+{
+       printf("Instruction error exception @ 0x%lx\n", address);
+       bad_mode(regs);
+}
+
+void do_machine_check_fault(unsigned long address, struct pt_regs *regs)
+{
+       printf("Machine check exception @ 0x%lx\n", address);
+       bad_mode(regs);
+}
+
+void do_interrupt_handler(void)
+{
+       printf("Interrupt fired\n");
+       bad_mode(0);
+}
+
+void do_itlb_miss(struct pt_regs *regs)
+{
+       printf("I TLB miss exception\n");
+       bad_mode(regs);
+}
+
+void do_dtlb_miss(struct pt_regs *regs)
+{
+       printf("D TLB miss exception\n");
+       bad_mode(regs);
+}
+
+void do_tlb_prot_violation(unsigned long address, struct pt_regs *regs)
+{
+       printf("TLB protection violation or misaligned access @ 0x%lx\n",
+              address);
+       bad_mode(regs);
+}
+
+void do_privilege_violation(struct pt_regs *regs)
+{
+       printf("Privilege violation exception\n");
+       bad_mode(regs);
+}
+
+void do_trap(struct pt_regs *regs)
+{
+       printf("Trap exception\n");
+       bad_mode(regs);
+}
+
+void do_extension(struct pt_regs *regs)
+{
+       printf("Extension instruction exception\n");
+       bad_mode(regs);
+}
index 2482bcdffcc33103e913a5dc8ee33e0923278b18..7797782563bb7f6dc736440fa6fa7aa0818a9e5a 100644 (file)
@@ -26,7 +26,7 @@ int do_elf_reloc_fixups(void)
                offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
 
                /* Check that the location of the relocation is in .text */
-               if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE &&
+               if (offset_ptr_rom >= (Elf32_Addr *)&__image_copy_start &&
                    offset_ptr_rom > last_offset) {
                        unsigned int val;
                        /* Switch to the in-RAM version */
@@ -44,29 +44,22 @@ int do_elf_reloc_fixups(void)
 #ifdef __LITTLE_ENDIAN__
                        /* If location in ".text" section swap value */
                        if ((unsigned int)offset_ptr_rom <
-                           (unsigned int)&__text_end)
+                           (unsigned int)&__ivt_end)
                                val = (val << 16) | (val >> 16);
 #endif
 
-                       /* Check that the target points into .text */
-                       if (val >= CONFIG_SYS_TEXT_BASE && val <=
-                           (unsigned int)&__bss_end) {
+                       /* Check that the target points into executable */
+                       if (val >= (unsigned int)&__image_copy_start && val <=
+                           (unsigned int)&__image_copy_end) {
                                val += gd->reloc_off;
 #ifdef __LITTLE_ENDIAN__
                                /* If location in ".text" section swap value */
                                if ((unsigned int)offset_ptr_rom <
-                                   (unsigned int)&__text_end)
+                                   (unsigned int)&__ivt_end)
                                        val = (val << 16) | (val >> 16);
 #endif
                                memcpy(offset_ptr_ram, &val, sizeof(int));
-                       } else {
-                               debug("   %p: rom reloc %x, ram %p, value %x, limit %x\n",
-                                     re_src, re_src->r_offset, offset_ptr_ram,
-                                     val, (unsigned int)&__bss_end);
                        }
-               } else {
-                       debug("   %p: rom reloc %x, last %p\n", re_src,
-                             re_src->r_offset, last_offset);
                }
                last_offset = offset_ptr_rom;
 
diff --git a/arch/arc/lib/reset.c b/arch/arc/lib/reset.c
new file mode 100644 (file)
index 0000000..98ebf1d
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <command.h>
+#include <common.h>
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+       printf("Put your restart handler here\n");
+
+#ifdef DEBUG
+       /* Stop debug session here */
+       __asm__("brk");
+#endif
+       return 0;
+}
index b0b46a4e9aeeffdc62c8afaabba74151f17f363a..a72c6946d53e5913b619b4178340e5401191b276 100644 (file)
@@ -19,3 +19,5 @@ char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
 char __text_start[0] __attribute__((section(".__text_start")));
 char __text_end[0] __attribute__((section(".__text_end")));
 char __init_end[0] __attribute__((section(".__init_end")));
+char __ivt_start[0] __attribute__((section(".__ivt_start")));
+char __ivt_end[0] __attribute__((section(".__ivt_end")));
diff --git a/arch/arc/lib/timer.c b/arch/arc/lib/timer.c
new file mode 100644 (file)
index 0000000..a0acbbc
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm/arcregs.h>
+
+#define NH_MODE        (1 << 1)        /* Disable timer if CPU is halted */
+
+int timer_init(void)
+{
+       write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE);
+       /* Set max value for counter/timer */
+       write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0xffffffff);
+       /* Set initial count value and restart counter/timer */
+       write_aux_reg(ARC_AUX_TIMER0_CNT, 0);
+       return 0;
+}
+
+unsigned long timer_read_counter(void)
+{
+       return read_aux_reg(ARC_AUX_TIMER0_CNT);
+}
index 5eb1d03cfaafbdb8faf75c01cb5cc5839c0102a1..986b4c5d81db1009110eafb2c4606c79675c03a7 100644 (file)
@@ -51,6 +51,13 @@ config SYS_CPU
         default "sa1100" if CPU_SA1100
        default "armv8" if ARM64
 
+config SEMIHOSTING
+       bool "support boot from semihosting"
+       help
+         In emulated environments, semihosting is a way for
+         the hosted environment to call out to the emulator to
+         retrieve files from the host machine.
+
 choice
        prompt "Target select"
 
@@ -720,10 +727,19 @@ config TEGRA
        select CPU_ARM720T if SPL_BUILD
        select CPU_V7 if !SPL_BUILD
 
-config TARGET_VEXPRESS_AEMV8A
+config TARGET_VEXPRESS64_AEMV8A
        bool "Support vexpress_aemv8a"
        select ARM64
 
+config TARGET_VEXPRESS64_BASE_FVP
+       bool "Support Versatile Express ARMv8a FVP BASE model"
+       select ARM64
+       select SEMIHOSTING
+
+config TARGET_VEXPRESS64_JUNO
+       bool "Support Versatile Express Juno Development Platform"
+       select ARM64
+
 config TARGET_LS2085A_EMU
        bool "Support ls2085a_emu"
        select ARM64
index e37e87b68d14d394dfdb9980cbca40345f5ccc52..a90ce3047bd27f2f100512ce6239073ac6c92fa9 100644 (file)
@@ -45,7 +45,9 @@ int cleanup_before_linux (void)
 /* flush I/D-cache */
 static void cache_flush (void)
 {
+#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
        unsigned long i = 0;
 
        asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
+#endif
 }
index 9e412bbb04d585c949f321ddd04032a652a92e00..4c9d3fde47f58af4915676505bd0cb80d2cd1f45 100644 (file)
@@ -181,7 +181,7 @@ static void kw_sysrst_check(void)
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {
-       char *rev;
+       char *rev = "??";
        u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff;
        u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
 
@@ -192,7 +192,13 @@ int print_cpuinfo(void)
 
        switch (revid) {
        case 0:
-               rev = "Z0";
+               if (devid == 0x6281)
+                       rev = "Z0";
+               else if (devid == 0x6282)
+                       rev = "A0";
+               break;
+       case 1:
+               rev = "A1";
                break;
        case 2:
                rev = "A0";
@@ -201,7 +207,6 @@ int print_cpuinfo(void)
                rev = "A1";
                break;
        default:
-               rev = "??";
                break;
        }
 
index eaf09d1a627746e0aea1c1317aa6a8ea390693ad..81477aa7b0c3fc9e432a248ca632fc0672a693db 100644 (file)
@@ -284,14 +284,6 @@ void s_init(void)
         */
 #ifdef CONFIG_NOR_BOOT
        enable_norboot_pin_mux();
-#endif
-       /*
-        * Save the boot parameters passed from romcode.
-        * We cannot delay the saving further than this,
-        * to prevent overwrites.
-        */
-#ifdef CONFIG_SPL_BUILD
-       save_omap_boot_params();
 #endif
        watchdog_disable();
        set_uart_mux_conf();
@@ -301,9 +293,6 @@ void s_init(void)
        gd->baudrate = CONFIG_BAUDRATE;
        serial_init();
        gd->have_console = 1;
-#elif defined(CONFIG_SPL_BUILD)
-       gd = &gdata;
-       preloader_console_init();
 #endif
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
index fc66872a3179257cb23d8083672f17a174a7df31..85cceae152c2dddf28335cf11846108bef7e7231 100644 (file)
@@ -76,13 +76,13 @@ static void configure_mr(int nr, u32 cs)
 }
 
 /*
- * Configure EMIF4D5 registers and MR registers
+ * Configure EMIF4D5 registers and MR registers For details about these magic
+ * values please see the EMIF registers section of the TRM.
  */
 void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 {
        writel(0xA0, &emif_reg[nr]->emif_pwr_mgmt_ctrl);
        writel(0xA0, &emif_reg[nr]->emif_pwr_mgmt_ctrl_shdw);
-       writel(0x1, &emif_reg[nr]->emif_iodft_tlgc);
        writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
 
        writel(regs->temp_alert_config, &emif_reg[nr]->emif_temp_alert_config);
@@ -106,10 +106,45 @@ void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
                writel(regs->emif_cos_config, &emif_reg[nr]->emif_cos_config);
        }
 
-       writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
-       writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
+       /*
+        * Sequence to ensure that the PHY is in a known state prior to
+        * startting hardware leveling.  Also acts as to latch some state from
+        * the EMIF into the PHY.
+        */
+       writel(0x2011, &emif_reg[nr]->emif_iodft_tlgc);
+       writel(0x2411, &emif_reg[nr]->emif_iodft_tlgc);
+       writel(0x2011, &emif_reg[nr]->emif_iodft_tlgc);
+
+       clrbits_le32(&emif_reg[nr]->emif_sdram_ref_ctrl,
+                       EMIF_REG_INITREF_DIS_MASK);
+
        writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
        writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
+       writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
+       writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
+
+       /* Perform hardware leveling. */
+       udelay(1000);
+       writel(readl(&emif_reg[nr]->emif_ddr_ext_phy_ctrl_36) |
+              0x100, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_36);
+       writel(readl(&emif_reg[nr]->emif_ddr_ext_phy_ctrl_36_shdw) |
+              0x100, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_36_shdw);
+
+       writel(0x80000000, &emif_reg[nr]->emif_rd_wr_lvl_rmp_ctl);
+
+       /* Enable read leveling */
+       writel(0x80000000, &emif_reg[nr]->emif_rd_wr_lvl_ctl);
+
+       /*
+        * Enable full read and write leveling.  Wait for read and write
+        * leveling bit to clear RDWRLVLFULL_START bit 31
+        */
+       while((readl(&emif_reg[nr]->emif_rd_wr_lvl_ctl) & 0x80000000) != 0)
+               ;
+
+       /* Check the timeout register to see if leveling is complete */
+       if((readl(&emif_reg[nr]->emif_status) & 0x70) != 0)
+               puts("DDR3 H/W leveling incomplete with errors\n");
 
        if (emif_sdram_type() == EMIF_SDRAM_TYPE_LPDDR2) {
                configure_mr(nr, 0);
@@ -123,21 +158,15 @@ void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 void config_sdram(const struct emif_regs *regs, int nr)
 {
        if (regs->zq_config) {
-               /*
-                * A value of 0x2800 for the REF CTRL will give us
-                * about 570us for a delay, which will be long enough
-                * to configure things.
-                */
-               writel(0x2800, &emif_reg[nr]->emif_sdram_ref_ctrl);
                writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
                writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
                writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
                writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
                writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
        }
+       writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
        writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
        writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
-       writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
 }
 
 /**
@@ -153,46 +182,55 @@ void set_sdram_timings(const struct emif_regs *regs, int nr)
        writel(regs->sdram_tim3, &emif_reg[nr]->emif_sdram_tim_3_shdw);
 }
 
-void __weak emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size)
-{
-}
-
 /*
- * Configure EXT PHY registers
+ * Configure EXT PHY registers for hardware leveling
  */
 static void ext_phy_settings(const struct emif_regs *regs, int nr)
 {
-       u32 *ext_phy_ctrl_base = 0;
-       u32 *emif_ext_phy_ctrl_base = 0;
-       const u32 *ext_phy_ctrl_const_regs;
-       u32 i = 0;
-       u32 size;
-
-       ext_phy_ctrl_base = (u32 *)&(regs->emif_ddr_ext_phy_ctrl_1);
-       emif_ext_phy_ctrl_base =
-                       (u32 *)&(emif_reg[nr]->emif_ddr_ext_phy_ctrl_1);
-
-       /* Configure external phy control timing registers */
-       for (i = 0; i < EMIF_EXT_PHY_CTRL_TIMING_REG; i++) {
-               writel(*ext_phy_ctrl_base, emif_ext_phy_ctrl_base++);
-               /* Update shadow registers */
-               writel(*ext_phy_ctrl_base++, emif_ext_phy_ctrl_base++);
-       }
-
        /*
-        * external phy 6-24 registers do not change with
-        * ddr frequency
+        * Enable hardware leveling on the EMIF.  For details about these
+        * magic values please see the EMIF registers section of the TRM.
         */
-       emif_get_ext_phy_ctrl_const_regs(&ext_phy_ctrl_const_regs, &size);
-
-       if (!size)
-               return;
+       writel(0x08020080, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_1);
+       writel(0x08020080, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_1_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_22);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_22_shdw);
+       writel(0x00600020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_23);
+       writel(0x00600020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_23_shdw);
+       writel(0x40010080, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_24);
+       writel(0x40010080, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_24_shdw);
+       writel(0x08102040, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_25);
+       writel(0x08102040, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_25_shdw);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_26);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_26_shdw);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_27);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_27_shdw);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_28);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_28_shdw);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_29);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_29_shdw);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_30);
+       writel(0x00200020, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_30_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_31);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_31_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_32);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_32_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_33);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_33_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_34);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_34_shdw);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_35);
+       writel(0x00000000, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_35_shdw);
+       writel(0x000000FF, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_36);
+       writel(0x000000FF, &emif_reg[nr]->emif_ddr_ext_phy_ctrl_36_shdw);
 
-       for (i = 0; i < size; i++) {
-               writel(ext_phy_ctrl_const_regs[i], emif_ext_phy_ctrl_base++);
-               /* Update shadow registers */
-               writel(ext_phy_ctrl_const_regs[i], emif_ext_phy_ctrl_base++);
-       }
+       /*
+        * Sequence to ensure that the PHY is again in a known state after
+        * hardware leveling.
+        */
+       writel(0x2011, &emif_reg[nr]->emif_iodft_tlgc);
+       writel(0x2411, &emif_reg[nr]->emif_iodft_tlgc);
+       writel(0x2011, &emif_reg[nr]->emif_iodft_tlgc);
 }
 
 /**
@@ -201,11 +239,17 @@ static void ext_phy_settings(const struct emif_regs *regs, int nr)
 void config_ddr_phy(const struct emif_regs *regs, int nr)
 {
        /*
-        * disable initialization and refreshes for now until we
+        * Disable initialization and refreshes for now until we
         * finish programming EMIF regs.
+        * Also set time between rising edge of DDR_RESET to rising
+        * edge of DDR_CKE to > 500us per memory spec.
         */
+#ifndef CONFIG_AM43XX
        setbits_le32(&emif_reg[nr]->emif_sdram_ref_ctrl,
                     EMIF_REG_INITREF_DIS_MASK);
+#endif
+       if (regs->zq_config)
+               writel(0x80003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
 
        writel(regs->emif_ddr_phy_ctlr_1,
                &emif_reg[nr]->emif_ddr_phy_ctrl_1);
index 8b7527c5b400a0c574f6ad0d47bfb7743b2ac31d..9cf816c89a627b32230f5b03d00c2e5ba3b01069 100644 (file)
@@ -112,17 +112,20 @@ void config_ddr(unsigned int pll, const struct ctrl_ioregs *ioregs,
 
        /* Set CKE to be controlled by EMIF/DDR PHY */
        writel(DDR_CKE_CTRL_NORMAL, &ddrctrl->ddrckectrl);
+
 #endif
 #ifdef CONFIG_AM43XX
        writel(readl(&cm_device->cm_dll_ctrl) & ~0x1, &cm_device->cm_dll_ctrl);
        while ((readl(&cm_device->cm_dll_ctrl) & CM_DLL_READYST) == 0)
                ;
-       writel(0x80000000, &ddrctrl->ddrioctrl);
 
        config_io_ctrl(ioregs);
 
        /* Set CKE to be controlled by EMIF/DDR PHY */
        writel(DDR_CKE_CTRL_NORMAL, &ddrctrl->ddrckectrl);
+
+       /* Allow EMIF to control DDR_RESET */
+       writel(0x00000000, &ddrctrl->ddrioctrl);
 #endif
 
        /* Program EMIF instance */
index 2708097300d30b27ee945f32e12c4a7f9908acca..7469825565892e1df715c87c320c0738e030cce1 100644 (file)
@@ -6,6 +6,10 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/sama5d4.h>
 
 char *get_cpu_name()
@@ -28,3 +32,15 @@ char *get_cpu_name()
        else
                return "Unknown CPU type";
 }
+
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+void at91_udp_hw_init(void)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       /* Enable UPLL clock */
+       writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr);
+       /* Enable UDPHS clock */
+       at91_periph_clk_enable(ATMEL_ID_UDPHS);
+}
+#endif
index 01cdb7ee76b7f13aaeb1c396e9f7a5e0829fbeeb..c56417dd2f1ec81d8fa1088d8c12fc0aaf6c3848 100644 (file)
@@ -53,7 +53,7 @@ int cleanup_before_linux(void)
         * After D-cache is flushed and before it is disabled there may
         * be some new valid entries brought into the cache. We are sure
         * that these lines are not dirty and will not affect our execution.
-        * (because unwinding the call-stack and setting a bit in CP15 SCTRL
+        * (because unwinding the call-stack and setting a bit in CP15 SCTLR
         * is all we did during this. We have not pushed anything on to the
         * stack. Neither have we affected any static data)
         * So just invalidate the entire d-cache again to avoid coherency
index 94d02970516e9efce5065852bf73182647dfd9de..be43e224fa37074bf2a939ad3e486f3268833910 100644 (file)
@@ -266,22 +266,33 @@ static void exynos5_sromc_config(int flags)
 
 static void exynos5_i2c_config(int peripheral, int flags)
 {
+       int func01, func23;
+
+        /* High-Speed I2C */
+       if (flags & PINMUX_FLAG_HS_MODE) {
+               func01 = 4;
+               func23 = 4;
+       } else {
+               func01 = 2;
+               func23 = 3;
+       }
+
        switch (peripheral) {
        case PERIPH_ID_I2C0:
-               gpio_cfg_pin(EXYNOS5_GPIO_B30, S5P_GPIO_FUNC(0x2));
-               gpio_cfg_pin(EXYNOS5_GPIO_B31, S5P_GPIO_FUNC(0x2));
+               gpio_cfg_pin(EXYNOS5_GPIO_B30, S5P_GPIO_FUNC(func01));
+               gpio_cfg_pin(EXYNOS5_GPIO_B31, S5P_GPIO_FUNC(func01));
                break;
        case PERIPH_ID_I2C1:
-               gpio_cfg_pin(EXYNOS5_GPIO_B32, S5P_GPIO_FUNC(0x2));
-               gpio_cfg_pin(EXYNOS5_GPIO_B33, S5P_GPIO_FUNC(0x2));
+               gpio_cfg_pin(EXYNOS5_GPIO_B32, S5P_GPIO_FUNC(func01));
+               gpio_cfg_pin(EXYNOS5_GPIO_B33, S5P_GPIO_FUNC(func01));
                break;
        case PERIPH_ID_I2C2:
-               gpio_cfg_pin(EXYNOS5_GPIO_A06, S5P_GPIO_FUNC(0x3));
-               gpio_cfg_pin(EXYNOS5_GPIO_A07, S5P_GPIO_FUNC(0x3));
+               gpio_cfg_pin(EXYNOS5_GPIO_A06, S5P_GPIO_FUNC(func23));
+               gpio_cfg_pin(EXYNOS5_GPIO_A07, S5P_GPIO_FUNC(func23));
                break;
        case PERIPH_ID_I2C3:
-               gpio_cfg_pin(EXYNOS5_GPIO_A12, S5P_GPIO_FUNC(0x3));
-               gpio_cfg_pin(EXYNOS5_GPIO_A13, S5P_GPIO_FUNC(0x3));
+               gpio_cfg_pin(EXYNOS5_GPIO_A12, S5P_GPIO_FUNC(func23));
+               gpio_cfg_pin(EXYNOS5_GPIO_A13, S5P_GPIO_FUNC(func23));
                break;
        case PERIPH_ID_I2C4:
                gpio_cfg_pin(EXYNOS5_GPIO_A20, S5P_GPIO_FUNC(0x3));
index 989780d27348d54542a236e095f99a166e47545c..71a175392fd1c063e9149187694c0d7b8eb9f249 100644 (file)
@@ -15,6 +15,8 @@
 #include <fsl_esdhc.h>
 #endif
 #include <tsec.h>
+#include <asm/arch/immap_ls102xa.h>
+#include <fsl_sec.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -77,9 +79,24 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        int off;
        int val;
        const char *sysclk_path;
+       struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+       unsigned int svr;
+       svr = in_be32(&gur->svr);
 
        unsigned long busclk = get_bus_freq(0);
 
+       /* delete crypto node if not on an E-processor */
+       if (!IS_E_PROCESSOR(svr))
+               fdt_fixup_crypto_node(blob, 0);
+#if CONFIG_SYS_FSL_SEC_COMPAT >= 4
+       else {
+               ccsr_sec_t __iomem *sec;
+
+               sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
+               fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms));
+       }
+#endif
+
        fdt_fixup_ethernet(blob);
 
        off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
@@ -107,6 +124,25 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_compat_u32(blob, "fsl,qoriq-sysclk-2.0",
                               "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);
 
+#if defined(CONFIG_DEEP_SLEEP) && defined(CONFIG_SD_BOOT)
+#define UBOOT_HEAD_LEN 0x1000
+       /*
+        * Reserved memory in SD boot deep sleep case.
+        * Second stage uboot binary and malloc space should be reserved.
+        * If the memory they occupied has not been reserved, then this
+        * space would be used by kernel and overwritten in uboot when
+        * deep sleep resume, which cause deep sleep failed.
+        * Since second uboot binary has a head, that space need to be
+        * reserved either(assuming its size is less than 0x1000).
+        */
+       off = fdt_add_mem_rsv(blob, CONFIG_SYS_TEXT_BASE - UBOOT_HEAD_LEN,
+                       CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_SPL_MALLOC_SIZE +
+                       UBOOT_HEAD_LEN);
+       if (off < 0)
+               printf("Failed to reserve memory for SD boot deep sleep: %s\n",
+                      fdt_strerror(off));
+#endif
+
 #if defined(CONFIG_FSL_ESDHC)
        fdt_fixup_esdhc(blob, bd);
 #endif
@@ -133,4 +169,17 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 
        do_fixup_by_compat_u32(blob, "fsl, ls1021a-flexcan",
                               "clock-frequency", busclk / 2, 1);
+
+#ifdef CONFIG_QSPI_BOOT
+       off = fdt_node_offset_by_compat_reg(blob, FSL_IFC_COMPAT,
+                                           CONFIG_SYS_IFC_ADDR);
+       fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+#else
+       off = fdt_node_offset_by_compat_reg(blob, FSL_QSPI_COMPAT,
+                                           QSPI0_BASE_ADDR);
+       fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+       off = fdt_node_offset_by_compat_reg(blob, FSL_DSPI_COMPAT,
+                                           DSPI1_BASE_ADDR);
+       fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+#endif
 }
index 00a108212a7294c40e26ee0e12056a19510b3b0c..17500f2315ee9d3d5a8a5868c3e3e75f46a7148b 100644 (file)
@@ -106,6 +106,16 @@ u32 spl_boot_mode(void)
 
 void spl_board_init(void)
 {
+       /*
+        * Save the boot parameters passed from romcode.
+        * We cannot delay the saving further than this,
+        * to prevent overwrites.
+        */
+       save_omap_boot_params();
+
+       /* Prepare console output */
+       preloader_console_init();
+
 #ifdef CONFIG_SPL_NAND_SUPPORT
        gpmc_init();
 #endif
index dd52e938a9508171ff27dd909c0590f1c1ca7e22..cb35c198f1802edc71215f0bb170dc0407ae1e17 100644 (file)
@@ -111,14 +111,6 @@ int arch_cpu_init(void)
  */
 void s_init(void)
 {
-       /*
-        * Save the boot parameters passed from romcode.
-        * We cannot delay the saving further than this,
-        * to prevent overwrites.
-        */
-#ifdef CONFIG_SPL_BUILD
-       save_omap_boot_params();
-#endif
        init_omap_revision();
        hw_data_init();
 
@@ -133,9 +125,6 @@ void s_init(void)
        srcomp_enable();
        setup_clocks_for_console();
 
-       gd = &gdata;
-
-       preloader_console_init();
        do_io_settings();
 #endif
        prcm_init();
index 53a9e5d77df736f210f3310b8e8bae1ffe44ba16..90d6ae7bb5f5e8c43ef31b6477195875fdb1d1ab 100644 (file)
@@ -119,6 +119,7 @@ int board_mmc_init(bd_t *bis)
 
 void spl_board_init(void)
 {
+       preloader_console_init();
 #if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
        gpmc_init();
 #endif
@@ -264,14 +265,6 @@ void s_init(void)
        ehci_clocks_enable();
 #endif
 
-#ifdef CONFIG_SPL_BUILD
-       gd = &gdata;
-
-       preloader_console_init();
-
-       timer_init();
-#endif
-
        if (!in_sdram)
                mem_init();
 }
index fdc05b942f15bb80415c295faba6832e689d8b01..70048c10aee6736117e078931b75c4b6ba7756a5 100644 (file)
@@ -52,10 +52,10 @@ reset:
  * Continue to use ROM code vector only in OMAP4 spl)
  */
 #if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD))
-       /* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */
-       mrc     p15, 0, r0, c1, c0, 0   @ Read CP15 SCTRL Register
+       /* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
+       mrc     p15, 0, r0, c1, c0, 0   @ Read CP15 SCTLR Register
        bic     r0, #CR_V               @ V = 0
-       mcr     p15, 0, r0, c1, c0, 0   @ Write CP15 SCTRL Register
+       mcr     p15, 0, r0, c1, c0, 0   @ Write CP15 SCTLR Register
 
        /* Set vector address in CP15 VBAR register */
        ldr     r0, =_start
index 1720f7db01ddf7594a53acf43aed660caf178705..48db7442f4f0b771a6f1865a611aa9cb45975d3d 100644 (file)
@@ -15,13 +15,16 @@ obj-y       += pinmux.o
 obj-y  += usbc.o
 obj-$(CONFIG_MACH_SUN6I)       += prcm.o
 obj-$(CONFIG_MACH_SUN8I)       += prcm.o
+obj-$(CONFIG_MACH_SUN9I)       += prcm.o
 obj-$(CONFIG_MACH_SUN6I)       += p2wi.o
 obj-$(CONFIG_MACH_SUN8I)       += rsb.o
+obj-$(CONFIG_MACH_SUN9I)       += rsb.o
 obj-$(CONFIG_MACH_SUN4I)       += clock_sun4i.o
 obj-$(CONFIG_MACH_SUN5I)       += clock_sun4i.o
 obj-$(CONFIG_MACH_SUN6I)       += clock_sun6i.o
 obj-$(CONFIG_MACH_SUN7I)       += clock_sun4i.o
 obj-$(CONFIG_MACH_SUN8I)       += clock_sun6i.o
+obj-$(CONFIG_MACH_SUN9I)       += clock_sun9i.o
 
 ifndef CONFIG_SPL_BUILD
 ifdef CONFIG_ARMV7_PSCI
index bc98c564f9828fe5580a7e39c04b1e57f638f852..6e28bcd040686a3cc2c36b72cb5f7ff1234da796 100644 (file)
 
 #include <linux/compiler.h>
 
-#ifdef CONFIG_SPL_BUILD
-/* Pointer to the global data structure for SPL */
-DECLARE_GLOBAL_DATA_PTR;
-
-/* The sunxi internal brom will try to loader external bootloader
- * from mmc0, nand flash, mmc2.
- * Unfortunately we can't check how SPL was loaded so assume
- * it's always the first SD/MMC controller
- */
-u32 spl_boot_device(void)
-{
-       return BOOT_DEVICE_MMC1;
-}
-
-/* No confirmation data available in SPL yet. Hardcode bootmode */
-u32 spl_boot_mode(void)
-{
-       return MMCSD_MODE_RAW;
-}
-#endif
-
-int gpio_init(void)
+static int gpio_init(void)
 {
 #if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F)
 #if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I)
@@ -86,36 +65,9 @@ int gpio_init(void)
        return 0;
 }
 
-void reset_cpu(ulong addr)
-{
-#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN5I) || defined(CONFIG_MACH_SUN7I)
-       static const struct sunxi_wdog *wdog =
-                &((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
-
-       /* Set the watchdog for its shortest interval (.5s) and wait */
-       writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
-       writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
-
-       while (1) {
-               /* sun5i sometimes gets stuck without this */
-               writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
-       }
-#else /* CONFIG_MACH_SUN6I || CONFIG_MACH_SUN8I || .. */
-       static const struct sunxi_wdog *wdog =
-                ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
-
-       /* Set the watchdog for its shortest interval (.5s) and wait */
-       writel(WDT_CFG_RESET, &wdog->cfg);
-       writel(WDT_MODE_EN, &wdog->mode);
-       writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
-#endif
-}
-
-/* do some early init */
 void s_init(void)
 {
-#if defined CONFIG_SPL_BUILD && \
-               (defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I)
+#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
        /* Magic (undocmented) value taken from boot0, without this DRAM
         * access gets messed up (seems cache related) */
        setbits_le32(SUNXI_SRAMC_BASE + 0x44, 0x1800);
@@ -133,9 +85,27 @@ void s_init(void)
        timer_init();
        gpio_init();
        i2c_init_board();
+}
 
 #ifdef CONFIG_SPL_BUILD
-       gd = &gdata;
+/* The sunxi internal brom will try to loader external bootloader
+ * from mmc0, nand flash, mmc2.
+ * Unfortunately we can't check how SPL was loaded so assume
+ * it's always the first SD/MMC controller
+ */
+u32 spl_boot_device(void)
+{
+       return BOOT_DEVICE_MMC1;
+}
+
+/* No confirmation data available in SPL yet. Hardcode bootmode */
+u32 spl_boot_mode(void)
+{
+       return MMCSD_MODE_RAW;
+}
+
+void board_init_f(ulong dummy)
+{
        preloader_console_init();
 
 #ifdef CONFIG_SPL_I2C_SUPPORT
@@ -143,6 +113,36 @@ void s_init(void)
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
        sunxi_board_init();
+
+       /* Clear the BSS. */
+       memset(__bss_start, 0, __bss_end - __bss_start);
+
+       board_init_r(NULL, 0);
+}
+#endif
+
+void reset_cpu(ulong addr)
+{
+#if defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN5I) || defined(CONFIG_MACH_SUN7I)
+       static const struct sunxi_wdog *wdog =
+                &((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
+
+       /* Set the watchdog for its shortest interval (.5s) and wait */
+       writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
+       writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
+
+       while (1) {
+               /* sun5i sometimes gets stuck without this */
+               writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
+       }
+#else /* CONFIG_MACH_SUN6I || CONFIG_MACH_SUN8I || .. */
+       static const struct sunxi_wdog *wdog =
+                ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
+
+       /* Set the watchdog for its shortest interval (.5s) and wait */
+       writel(WDT_CFG_RESET, &wdog->cfg);
+       writel(WDT_MODE_EN, &wdog->mode);
+       writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
 #endif
 }
 
index d7a7040b72c70a27948841c038d4312b0cda46d2..e2a78676b1654fc6fece0f6fe9058957fe04c595 100644 (file)
@@ -45,10 +45,10 @@ void clock_init_safe(void)
 
 void clock_init_uart(void)
 {
+#if CONFIG_CONS_INDEX < 5
        struct sunxi_ccm_reg *const ccm =
                (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
-#if CONFIG_CONS_INDEX < 5
        /* uart clock source is apb2 */
        writel(APB2_CLK_SRC_OSC24M|
               APB2_CLK_RATE_N_1|
@@ -68,9 +68,6 @@ void clock_init_uart(void)
        /* enable R_PIO and R_UART clocks, and de-assert resets */
        prcm_apb0_enable(PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_UART);
 #endif
-
-       /* Dup with clock_init_safe(), drop once sun6i SPL support lands */
-       writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
 }
 
 int clock_twi_onoff(int port, int state)
diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun9i.c b/arch/arm/cpu/armv7/sunxi/clock_sun9i.c
new file mode 100644 (file)
index 0000000..27179ba
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * sun9i specific clock code
+ *
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/prcm.h>
+#include <asm/arch/sys_proto.h>
+
+void clock_init_uart(void)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+       /* open the clock for uart */
+       setbits_le32(&ccm->apb1_gate,
+                    CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT +
+                                      CONFIG_CONS_INDEX - 1));
+       /* deassert uart reset */
+       setbits_le32(&ccm->apb1_reset_cfg,
+                    1 << (APB1_RESET_UART_SHIFT +
+                          CONFIG_CONS_INDEX - 1));
+
+       /* Dup with clock_init_safe(), drop once sun9i SPL support lands */
+       writel(PLL4_CFG_DEFAULT, &ccm->pll4_periph0_cfg);
+}
+
+int clock_twi_onoff(int port, int state)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+       if (port > 4)
+               return -1;
+
+       /* set the apb reset and clock gate for twi */
+       if (state) {
+               setbits_le32(&ccm->apb1_gate,
+                            CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
+               setbits_le32(&ccm->apb1_reset_cfg,
+                            1 << (APB1_RESET_UART_SHIFT + port));
+       } else {
+               clrbits_le32(&ccm->apb1_reset_cfg,
+                            1 << (APB1_RESET_UART_SHIFT + port));
+               clrbits_le32(&ccm->apb1_gate,
+                            CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
+       }
+
+       return 0;
+}
+
+unsigned int clock_get_pll4_periph0(void)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       uint32_t rval = readl(&ccm->pll4_periph0_cfg);
+       int n = ((rval & CCM_PLL4_CTRL_N_MASK) >> CCM_PLL4_CTRL_N_SHIFT);
+       int p = ((rval & CCM_PLL4_CTRL_P_MASK) >> CCM_PLL4_CTRL_P_SHIFT);
+       int m = ((rval & CCM_PLL4_CTRL_M_MASK) >> CCM_PLL4_CTRL_M_SHIFT) + 1;
+       const int k = 1;
+
+       return ((24000000 * n * k) >> p) / m;
+}
index b72bb9db519f18f3b27d79f939c07a183061ece8..b00befb30119bf547a56270a106359f5bf61c81c 100644 (file)
 #include <asm/arch/prcm.h>
 #include <asm/arch/rsb.h>
 
+static int rsb_set_device_mode(void);
+
 static void rsb_cfg_io(void)
 {
+#ifdef CONFIG_MACH_SUN8I
        sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_GPL0_R_RSB_SCK);
        sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_GPL1_R_RSB_SDA);
        sunxi_gpio_set_pull(SUNXI_GPL(0), 1);
        sunxi_gpio_set_pull(SUNXI_GPL(1), 1);
        sunxi_gpio_set_drv(SUNXI_GPL(0), 2);
        sunxi_gpio_set_drv(SUNXI_GPL(1), 2);
+#elif defined CONFIG_MACH_SUN9I
+       sunxi_gpio_set_cfgpin(SUNXI_GPN(0), SUN9I_GPN0_R_RSB_SCK);
+       sunxi_gpio_set_cfgpin(SUNXI_GPN(1), SUN9I_GPN1_R_RSB_SDA);
+       sunxi_gpio_set_pull(SUNXI_GPN(0), 1);
+       sunxi_gpio_set_pull(SUNXI_GPN(1), 1);
+       sunxi_gpio_set_drv(SUNXI_GPN(0), 2);
+       sunxi_gpio_set_drv(SUNXI_GPN(1), 2);
+#else
+#error unsupported MACH_SUNXI
+#endif
 }
 
 static void rsb_set_clk(void)
@@ -42,7 +55,7 @@ static void rsb_set_clk(void)
        writel((cd_odly << 8) | div, &rsb->ccr);
 }
 
-void rsb_init(void)
+int rsb_init(void)
 {
        struct sunxi_rsb_reg * const rsb =
                (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
@@ -54,6 +67,8 @@ void rsb_init(void)
 
        writel(RSB_CTRL_SOFT_RST, &rsb->ctrl);
        rsb_set_clk();
+
+       return rsb_set_device_mode();
 }
 
 static int rsb_await_trans(void)
@@ -88,13 +103,14 @@ static int rsb_await_trans(void)
        return ret;
 }
 
-int rsb_set_device_mode(u32 device_mode_data)
+static int rsb_set_device_mode(void)
 {
        struct sunxi_rsb_reg * const rsb =
                (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
        unsigned long tmo = timer_get_us() + 1000000;
 
-       writel(RSB_DMCR_DEVICE_MODE_START | device_mode_data, &rsb->dmcr);
+       writel(RSB_DMCR_DEVICE_MODE_START | RSB_DMCR_DEVICE_MODE_DATA,
+              &rsb->dmcr);
 
        while (readl(&rsb->dmcr) & RSB_DMCR_DEVICE_MODE_START) {
                if (timer_get_us() > tmo)
diff --git a/arch/arm/cpu/armv7/uniphier/init_page_table.S b/arch/arm/cpu/armv7/uniphier/init_page_table.S
new file mode 100644 (file)
index 0000000..2638bcd
--- /dev/null
@@ -0,0 +1,26 @@
+#include <config.h>
+#include <linux/linkage.h>
+
+/* page table */
+#define NR_SECTIONS    4096
+#define SECTION_SHIFT  20
+#define DEVICE 0x00002002 /* Non-shareable Device */
+#define NORMAL 0x0000000e /* Normal Memory Write-Back, No Write-Allocate */
+
+#define TEXT_SECTION   ((CONFIG_SPL_TEXT_BASE) >> (SECTION_SHIFT))
+#define STACK_SECTION  ((CONFIG_SYS_INIT_SP_ADDR) >> (SECTION_SHIFT))
+
+       .section ".rodata"
+       .align 14
+ENTRY(init_page_table)
+       section = 0
+       .rept NR_SECTIONS
+       .if section == TEXT_SECTION || section == STACK_SECTION
+       attr = NORMAL
+       .else
+       attr = DEVICE
+       .endif
+       .word (section << SECTION_SHIFT) | attr
+       section = section + 1
+       .endr
+END(init_page_table)
diff --git a/arch/arm/cpu/armv7/uniphier/init_page_table.c b/arch/arm/cpu/armv7/uniphier/init_page_table.c
deleted file mode 100644 (file)
index febb3c8..0000000
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Copyright (C) 2012-2014 Panasonic Corporation
- *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-/* encoding without TEX remap */
-#define NO_MAP 0x00000000 /* No Map */
-#define DEVICE 0x00002002 /* Non-shareable Device */
-#define NORMAL 0x0000000e /* Normal Memory Write-Back, No Write-Allocate */
-
-#define SSC    NORMAL  /* System Cache: Normal */
-#define EXT    DEVICE  /* External Bus: Device */
-#define REG    DEVICE  /* IO Register: Device */
-#define DDR    DEVICE  /* DDR SDRAM: Device */
-
-#define IS_SPL_TEXT_AREA(x)    ((x) == ((CONFIG_SPL_TEXT_BASE) >> 20))
-
-#define IS_INIT_STACK_AREA(x)  ((x) == ((CONFIG_SYS_INIT_SP_ADDR) >> 20))
-
-#define IS_SSC(x)              ((IS_SPL_TEXT_AREA(x)) || \
-                                       (IS_INIT_STACK_AREA(x)))
-#define IS_EXT(x)              ((x) < 0x100)
-
-/* 0x20000000-0x2fffffff, 0xf0000000-0xffffffff are only used by PH1-sLD3 */
-#define IS_REG(x)              (0x200 <= (x) && (x) < 0x300) || \
-                               (0x500 <= (x) && (x) < 0x700) || \
-                               (0xf00 <= (x))
-
-#define IS_DDR(x)              (0x800 <= (x) && (x) < 0xf00)
-
-#define MMU_FLAGS(x)           (IS_SSC(x)) ? SSC : \
-                                       (IS_EXT(x)) ? EXT : \
-                                               (IS_REG(x)) ? REG : \
-                                                       (IS_DDR(x)) ? DDR : \
-                                                               NO_MAP
-
-#define TBL_ENTRY(x)           (((x) << 20) | (MMU_FLAGS(x)))
-
-const u32 __aligned(PGTABLE_SIZE) init_page_table[PGTABLE_SIZE / sizeof(u32)]
-                                                                       = {
-       TBL_ENTRY(0x000), TBL_ENTRY(0x001), TBL_ENTRY(0x002), TBL_ENTRY(0x003),
-       TBL_ENTRY(0x004), TBL_ENTRY(0x005), TBL_ENTRY(0x006), TBL_ENTRY(0x007),
-       TBL_ENTRY(0x008), TBL_ENTRY(0x009), TBL_ENTRY(0x00a), TBL_ENTRY(0x00b),
-       TBL_ENTRY(0x00c), TBL_ENTRY(0x00d), TBL_ENTRY(0x00e), TBL_ENTRY(0x00f),
-       TBL_ENTRY(0x010), TBL_ENTRY(0x011), TBL_ENTRY(0x012), TBL_ENTRY(0x013),
-       TBL_ENTRY(0x014), TBL_ENTRY(0x015), TBL_ENTRY(0x016), TBL_ENTRY(0x017),
-       TBL_ENTRY(0x018), TBL_ENTRY(0x019), TBL_ENTRY(0x01a), TBL_ENTRY(0x01b),
-       TBL_ENTRY(0x01c), TBL_ENTRY(0x01d), TBL_ENTRY(0x01e), TBL_ENTRY(0x01f),
-       TBL_ENTRY(0x020), TBL_ENTRY(0x021), TBL_ENTRY(0x022), TBL_ENTRY(0x023),
-       TBL_ENTRY(0x024), TBL_ENTRY(0x025), TBL_ENTRY(0x026), TBL_ENTRY(0x027),
-       TBL_ENTRY(0x028), TBL_ENTRY(0x029), TBL_ENTRY(0x02a), TBL_ENTRY(0x02b),
-       TBL_ENTRY(0x02c), TBL_ENTRY(0x02d), TBL_ENTRY(0x02e), TBL_ENTRY(0x02f),
-       TBL_ENTRY(0x030), TBL_ENTRY(0x031), TBL_ENTRY(0x032), TBL_ENTRY(0x033),
-       TBL_ENTRY(0x034), TBL_ENTRY(0x035), TBL_ENTRY(0x036), TBL_ENTRY(0x037),
-       TBL_ENTRY(0x038), TBL_ENTRY(0x039), TBL_ENTRY(0x03a), TBL_ENTRY(0x03b),
-       TBL_ENTRY(0x03c), TBL_ENTRY(0x03d), TBL_ENTRY(0x03e), TBL_ENTRY(0x03f),
-       TBL_ENTRY(0x040), TBL_ENTRY(0x041), TBL_ENTRY(0x042), TBL_ENTRY(0x043),
-       TBL_ENTRY(0x044), TBL_ENTRY(0x045), TBL_ENTRY(0x046), TBL_ENTRY(0x047),
-       TBL_ENTRY(0x048), TBL_ENTRY(0x049), TBL_ENTRY(0x04a), TBL_ENTRY(0x04b),
-       TBL_ENTRY(0x04c), TBL_ENTRY(0x04d), TBL_ENTRY(0x04e), TBL_ENTRY(0x04f),
-       TBL_ENTRY(0x050), TBL_ENTRY(0x051), TBL_ENTRY(0x052), TBL_ENTRY(0x053),
-       TBL_ENTRY(0x054), TBL_ENTRY(0x055), TBL_ENTRY(0x056), TBL_ENTRY(0x057),
-       TBL_ENTRY(0x058), TBL_ENTRY(0x059), TBL_ENTRY(0x05a), TBL_ENTRY(0x05b),
-       TBL_ENTRY(0x05c), TBL_ENTRY(0x05d), TBL_ENTRY(0x05e), TBL_ENTRY(0x05f),
-       TBL_ENTRY(0x060), TBL_ENTRY(0x061), TBL_ENTRY(0x062), TBL_ENTRY(0x063),
-       TBL_ENTRY(0x064), TBL_ENTRY(0x065), TBL_ENTRY(0x066), TBL_ENTRY(0x067),
-       TBL_ENTRY(0x068), TBL_ENTRY(0x069), TBL_ENTRY(0x06a), TBL_ENTRY(0x06b),
-       TBL_ENTRY(0x06c), TBL_ENTRY(0x06d), TBL_ENTRY(0x06e), TBL_ENTRY(0x06f),
-       TBL_ENTRY(0x070), TBL_ENTRY(0x071), TBL_ENTRY(0x072), TBL_ENTRY(0x073),
-       TBL_ENTRY(0x074), TBL_ENTRY(0x075), TBL_ENTRY(0x076), TBL_ENTRY(0x077),
-       TBL_ENTRY(0x078), TBL_ENTRY(0x079), TBL_ENTRY(0x07a), TBL_ENTRY(0x07b),
-       TBL_ENTRY(0x07c), TBL_ENTRY(0x07d), TBL_ENTRY(0x07e), TBL_ENTRY(0x07f),
-       TBL_ENTRY(0x080), TBL_ENTRY(0x081), TBL_ENTRY(0x082), TBL_ENTRY(0x083),
-       TBL_ENTRY(0x084), TBL_ENTRY(0x085), TBL_ENTRY(0x086), TBL_ENTRY(0x087),
-       TBL_ENTRY(0x088), TBL_ENTRY(0x089), TBL_ENTRY(0x08a), TBL_ENTRY(0x08b),
-       TBL_ENTRY(0x08c), TBL_ENTRY(0x08d), TBL_ENTRY(0x08e), TBL_ENTRY(0x08f),
-       TBL_ENTRY(0x090), TBL_ENTRY(0x091), TBL_ENTRY(0x092), TBL_ENTRY(0x093),
-       TBL_ENTRY(0x094), TBL_ENTRY(0x095), TBL_ENTRY(0x096), TBL_ENTRY(0x097),
-       TBL_ENTRY(0x098), TBL_ENTRY(0x099), TBL_ENTRY(0x09a), TBL_ENTRY(0x09b),
-       TBL_ENTRY(0x09c), TBL_ENTRY(0x09d), TBL_ENTRY(0x09e), TBL_ENTRY(0x09f),
-       TBL_ENTRY(0x0a0), TBL_ENTRY(0x0a1), TBL_ENTRY(0x0a2), TBL_ENTRY(0x0a3),
-       TBL_ENTRY(0x0a4), TBL_ENTRY(0x0a5), TBL_ENTRY(0x0a6), TBL_ENTRY(0x0a7),
-       TBL_ENTRY(0x0a8), TBL_ENTRY(0x0a9), TBL_ENTRY(0x0aa), TBL_ENTRY(0x0ab),
-       TBL_ENTRY(0x0ac), TBL_ENTRY(0x0ad), TBL_ENTRY(0x0ae), TBL_ENTRY(0x0af),
-       TBL_ENTRY(0x0b0), TBL_ENTRY(0x0b1), TBL_ENTRY(0x0b2), TBL_ENTRY(0x0b3),
-       TBL_ENTRY(0x0b4), TBL_ENTRY(0x0b5), TBL_ENTRY(0x0b6), TBL_ENTRY(0x0b7),
-       TBL_ENTRY(0x0b8), TBL_ENTRY(0x0b9), TBL_ENTRY(0x0ba), TBL_ENTRY(0x0bb),
-       TBL_ENTRY(0x0bc), TBL_ENTRY(0x0bd), TBL_ENTRY(0x0be), TBL_ENTRY(0x0bf),
-       TBL_ENTRY(0x0c0), TBL_ENTRY(0x0c1), TBL_ENTRY(0x0c2), TBL_ENTRY(0x0c3),
-       TBL_ENTRY(0x0c4), TBL_ENTRY(0x0c5), TBL_ENTRY(0x0c6), TBL_ENTRY(0x0c7),
-       TBL_ENTRY(0x0c8), TBL_ENTRY(0x0c9), TBL_ENTRY(0x0ca), TBL_ENTRY(0x0cb),
-       TBL_ENTRY(0x0cc), TBL_ENTRY(0x0cd), TBL_ENTRY(0x0ce), TBL_ENTRY(0x0cf),
-       TBL_ENTRY(0x0d0), TBL_ENTRY(0x0d1), TBL_ENTRY(0x0d2), TBL_ENTRY(0x0d3),
-       TBL_ENTRY(0x0d4), TBL_ENTRY(0x0d5), TBL_ENTRY(0x0d6), TBL_ENTRY(0x0d7),
-       TBL_ENTRY(0x0d8), TBL_ENTRY(0x0d9), TBL_ENTRY(0x0da), TBL_ENTRY(0x0db),
-       TBL_ENTRY(0x0dc), TBL_ENTRY(0x0dd), TBL_ENTRY(0x0de), TBL_ENTRY(0x0df),
-       TBL_ENTRY(0x0e0), TBL_ENTRY(0x0e1), TBL_ENTRY(0x0e2), TBL_ENTRY(0x0e3),
-       TBL_ENTRY(0x0e4), TBL_ENTRY(0x0e5), TBL_ENTRY(0x0e6), TBL_ENTRY(0x0e7),
-       TBL_ENTRY(0x0e8), TBL_ENTRY(0x0e9), TBL_ENTRY(0x0ea), TBL_ENTRY(0x0eb),
-       TBL_ENTRY(0x0ec), TBL_ENTRY(0x0ed), TBL_ENTRY(0x0ee), TBL_ENTRY(0x0ef),
-       TBL_ENTRY(0x0f0), TBL_ENTRY(0x0f1), TBL_ENTRY(0x0f2), TBL_ENTRY(0x0f3),
-       TBL_ENTRY(0x0f4), TBL_ENTRY(0x0f5), TBL_ENTRY(0x0f6), TBL_ENTRY(0x0f7),
-       TBL_ENTRY(0x0f8), TBL_ENTRY(0x0f9), TBL_ENTRY(0x0fa), TBL_ENTRY(0x0fb),
-       TBL_ENTRY(0x0fc), TBL_ENTRY(0x0fd), TBL_ENTRY(0x0fe), TBL_ENTRY(0x0ff),
-       TBL_ENTRY(0x100), TBL_ENTRY(0x101), TBL_ENTRY(0x102), TBL_ENTRY(0x103),
-       TBL_ENTRY(0x104), TBL_ENTRY(0x105), TBL_ENTRY(0x106), TBL_ENTRY(0x107),
-       TBL_ENTRY(0x108), TBL_ENTRY(0x109), TBL_ENTRY(0x10a), TBL_ENTRY(0x10b),
-       TBL_ENTRY(0x10c), TBL_ENTRY(0x10d), TBL_ENTRY(0x10e), TBL_ENTRY(0x10f),
-       TBL_ENTRY(0x110), TBL_ENTRY(0x111), TBL_ENTRY(0x112), TBL_ENTRY(0x113),
-       TBL_ENTRY(0x114), TBL_ENTRY(0x115), TBL_ENTRY(0x116), TBL_ENTRY(0x117),
-       TBL_ENTRY(0x118), TBL_ENTRY(0x119), TBL_ENTRY(0x11a), TBL_ENTRY(0x11b),
-       TBL_ENTRY(0x11c), TBL_ENTRY(0x11d), TBL_ENTRY(0x11e), TBL_ENTRY(0x11f),
-       TBL_ENTRY(0x120), TBL_ENTRY(0x121), TBL_ENTRY(0x122), TBL_ENTRY(0x123),
-       TBL_ENTRY(0x124), TBL_ENTRY(0x125), TBL_ENTRY(0x126), TBL_ENTRY(0x127),
-       TBL_ENTRY(0x128), TBL_ENTRY(0x129), TBL_ENTRY(0x12a), TBL_ENTRY(0x12b),
-       TBL_ENTRY(0x12c), TBL_ENTRY(0x12d), TBL_ENTRY(0x12e), TBL_ENTRY(0x12f),
-       TBL_ENTRY(0x130), TBL_ENTRY(0x131), TBL_ENTRY(0x132), TBL_ENTRY(0x133),
-       TBL_ENTRY(0x134), TBL_ENTRY(0x135), TBL_ENTRY(0x136), TBL_ENTRY(0x137),
-       TBL_ENTRY(0x138), TBL_ENTRY(0x139), TBL_ENTRY(0x13a), TBL_ENTRY(0x13b),
-       TBL_ENTRY(0x13c), TBL_ENTRY(0x13d), TBL_ENTRY(0x13e), TBL_ENTRY(0x13f),
-       TBL_ENTRY(0x140), TBL_ENTRY(0x141), TBL_ENTRY(0x142), TBL_ENTRY(0x143),
-       TBL_ENTRY(0x144), TBL_ENTRY(0x145), TBL_ENTRY(0x146), TBL_ENTRY(0x147),
-       TBL_ENTRY(0x148), TBL_ENTRY(0x149), TBL_ENTRY(0x14a), TBL_ENTRY(0x14b),
-       TBL_ENTRY(0x14c), TBL_ENTRY(0x14d), TBL_ENTRY(0x14e), TBL_ENTRY(0x14f),
-       TBL_ENTRY(0x150), TBL_ENTRY(0x151), TBL_ENTRY(0x152), TBL_ENTRY(0x153),
-       TBL_ENTRY(0x154), TBL_ENTRY(0x155), TBL_ENTRY(0x156), TBL_ENTRY(0x157),
-       TBL_ENTRY(0x158), TBL_ENTRY(0x159), TBL_ENTRY(0x15a), TBL_ENTRY(0x15b),
-       TBL_ENTRY(0x15c), TBL_ENTRY(0x15d), TBL_ENTRY(0x15e), TBL_ENTRY(0x15f),
-       TBL_ENTRY(0x160), TBL_ENTRY(0x161), TBL_ENTRY(0x162), TBL_ENTRY(0x163),
-       TBL_ENTRY(0x164), TBL_ENTRY(0x165), TBL_ENTRY(0x166), TBL_ENTRY(0x167),
-       TBL_ENTRY(0x168), TBL_ENTRY(0x169), TBL_ENTRY(0x16a), TBL_ENTRY(0x16b),
-       TBL_ENTRY(0x16c), TBL_ENTRY(0x16d), TBL_ENTRY(0x16e), TBL_ENTRY(0x16f),
-       TBL_ENTRY(0x170), TBL_ENTRY(0x171), TBL_ENTRY(0x172), TBL_ENTRY(0x173),
-       TBL_ENTRY(0x174), TBL_ENTRY(0x175), TBL_ENTRY(0x176), TBL_ENTRY(0x177),
-       TBL_ENTRY(0x178), TBL_ENTRY(0x179), TBL_ENTRY(0x17a), TBL_ENTRY(0x17b),
-       TBL_ENTRY(0x17c), TBL_ENTRY(0x17d), TBL_ENTRY(0x17e), TBL_ENTRY(0x17f),
-       TBL_ENTRY(0x180), TBL_ENTRY(0x181), TBL_ENTRY(0x182), TBL_ENTRY(0x183),
-       TBL_ENTRY(0x184), TBL_ENTRY(0x185), TBL_ENTRY(0x186), TBL_ENTRY(0x187),
-       TBL_ENTRY(0x188), TBL_ENTRY(0x189), TBL_ENTRY(0x18a), TBL_ENTRY(0x18b),
-       TBL_ENTRY(0x18c), TBL_ENTRY(0x18d), TBL_ENTRY(0x18e), TBL_ENTRY(0x18f),
-       TBL_ENTRY(0x190), TBL_ENTRY(0x191), TBL_ENTRY(0x192), TBL_ENTRY(0x193),
-       TBL_ENTRY(0x194), TBL_ENTRY(0x195), TBL_ENTRY(0x196), TBL_ENTRY(0x197),
-       TBL_ENTRY(0x198), TBL_ENTRY(0x199), TBL_ENTRY(0x19a), TBL_ENTRY(0x19b),
-       TBL_ENTRY(0x19c), TBL_ENTRY(0x19d), TBL_ENTRY(0x19e), TBL_ENTRY(0x19f),
-       TBL_ENTRY(0x1a0), TBL_ENTRY(0x1a1), TBL_ENTRY(0x1a2), TBL_ENTRY(0x1a3),
-       TBL_ENTRY(0x1a4), TBL_ENTRY(0x1a5), TBL_ENTRY(0x1a6), TBL_ENTRY(0x1a7),
-       TBL_ENTRY(0x1a8), TBL_ENTRY(0x1a9), TBL_ENTRY(0x1aa), TBL_ENTRY(0x1ab),
-       TBL_ENTRY(0x1ac), TBL_ENTRY(0x1ad), TBL_ENTRY(0x1ae), TBL_ENTRY(0x1af),
-       TBL_ENTRY(0x1b0), TBL_ENTRY(0x1b1), TBL_ENTRY(0x1b2), TBL_ENTRY(0x1b3),
-       TBL_ENTRY(0x1b4), TBL_ENTRY(0x1b5), TBL_ENTRY(0x1b6), TBL_ENTRY(0x1b7),
-       TBL_ENTRY(0x1b8), TBL_ENTRY(0x1b9), TBL_ENTRY(0x1ba), TBL_ENTRY(0x1bb),
-       TBL_ENTRY(0x1bc), TBL_ENTRY(0x1bd), TBL_ENTRY(0x1be), TBL_ENTRY(0x1bf),
-       TBL_ENTRY(0x1c0), TBL_ENTRY(0x1c1), TBL_ENTRY(0x1c2), TBL_ENTRY(0x1c3),
-       TBL_ENTRY(0x1c4), TBL_ENTRY(0x1c5), TBL_ENTRY(0x1c6), TBL_ENTRY(0x1c7),
-       TBL_ENTRY(0x1c8), TBL_ENTRY(0x1c9), TBL_ENTRY(0x1ca), TBL_ENTRY(0x1cb),
-       TBL_ENTRY(0x1cc), TBL_ENTRY(0x1cd), TBL_ENTRY(0x1ce), TBL_ENTRY(0x1cf),
-       TBL_ENTRY(0x1d0), TBL_ENTRY(0x1d1), TBL_ENTRY(0x1d2), TBL_ENTRY(0x1d3),
-       TBL_ENTRY(0x1d4), TBL_ENTRY(0x1d5), TBL_ENTRY(0x1d6), TBL_ENTRY(0x1d7),
-       TBL_ENTRY(0x1d8), TBL_ENTRY(0x1d9), TBL_ENTRY(0x1da), TBL_ENTRY(0x1db),
-       TBL_ENTRY(0x1dc), TBL_ENTRY(0x1dd), TBL_ENTRY(0x1de), TBL_ENTRY(0x1df),
-       TBL_ENTRY(0x1e0), TBL_ENTRY(0x1e1), TBL_ENTRY(0x1e2), TBL_ENTRY(0x1e3),
-       TBL_ENTRY(0x1e4), TBL_ENTRY(0x1e5), TBL_ENTRY(0x1e6), TBL_ENTRY(0x1e7),
-       TBL_ENTRY(0x1e8), TBL_ENTRY(0x1e9), TBL_ENTRY(0x1ea), TBL_ENTRY(0x1eb),
-       TBL_ENTRY(0x1ec), TBL_ENTRY(0x1ed), TBL_ENTRY(0x1ee), TBL_ENTRY(0x1ef),
-       TBL_ENTRY(0x1f0), TBL_ENTRY(0x1f1), TBL_ENTRY(0x1f2), TBL_ENTRY(0x1f3),
-       TBL_ENTRY(0x1f4), TBL_ENTRY(0x1f5), TBL_ENTRY(0x1f6), TBL_ENTRY(0x1f7),
-       TBL_ENTRY(0x1f8), TBL_ENTRY(0x1f9), TBL_ENTRY(0x1fa), TBL_ENTRY(0x1fb),
-       TBL_ENTRY(0x1fc), TBL_ENTRY(0x1fd), TBL_ENTRY(0x1fe), TBL_ENTRY(0x1ff),
-       TBL_ENTRY(0x200), TBL_ENTRY(0x201), TBL_ENTRY(0x202), TBL_ENTRY(0x203),
-       TBL_ENTRY(0x204), TBL_ENTRY(0x205), TBL_ENTRY(0x206), TBL_ENTRY(0x207),
-       TBL_ENTRY(0x208), TBL_ENTRY(0x209), TBL_ENTRY(0x20a), TBL_ENTRY(0x20b),
-       TBL_ENTRY(0x20c), TBL_ENTRY(0x20d), TBL_ENTRY(0x20e), TBL_ENTRY(0x20f),
-       TBL_ENTRY(0x210), TBL_ENTRY(0x211), TBL_ENTRY(0x212), TBL_ENTRY(0x213),
-       TBL_ENTRY(0x214), TBL_ENTRY(0x215), TBL_ENTRY(0x216), TBL_ENTRY(0x217),
-       TBL_ENTRY(0x218), TBL_ENTRY(0x219), TBL_ENTRY(0x21a), TBL_ENTRY(0x21b),
-       TBL_ENTRY(0x21c), TBL_ENTRY(0x21d), TBL_ENTRY(0x21e), TBL_ENTRY(0x21f),
-       TBL_ENTRY(0x220), TBL_ENTRY(0x221), TBL_ENTRY(0x222), TBL_ENTRY(0x223),
-       TBL_ENTRY(0x224), TBL_ENTRY(0x225), TBL_ENTRY(0x226), TBL_ENTRY(0x227),
-       TBL_ENTRY(0x228), TBL_ENTRY(0x229), TBL_ENTRY(0x22a), TBL_ENTRY(0x22b),
-       TBL_ENTRY(0x22c), TBL_ENTRY(0x22d), TBL_ENTRY(0x22e), TBL_ENTRY(0x22f),
-       TBL_ENTRY(0x230), TBL_ENTRY(0x231), TBL_ENTRY(0x232), TBL_ENTRY(0x233),
-       TBL_ENTRY(0x234), TBL_ENTRY(0x235), TBL_ENTRY(0x236), TBL_ENTRY(0x237),
-       TBL_ENTRY(0x238), TBL_ENTRY(0x239), TBL_ENTRY(0x23a), TBL_ENTRY(0x23b),
-       TBL_ENTRY(0x23c), TBL_ENTRY(0x23d), TBL_ENTRY(0x23e), TBL_ENTRY(0x23f),
-       TBL_ENTRY(0x240), TBL_ENTRY(0x241), TBL_ENTRY(0x242), TBL_ENTRY(0x243),
-       TBL_ENTRY(0x244), TBL_ENTRY(0x245), TBL_ENTRY(0x246), TBL_ENTRY(0x247),
-       TBL_ENTRY(0x248), TBL_ENTRY(0x249), TBL_ENTRY(0x24a), TBL_ENTRY(0x24b),
-       TBL_ENTRY(0x24c), TBL_ENTRY(0x24d), TBL_ENTRY(0x24e), TBL_ENTRY(0x24f),
-       TBL_ENTRY(0x250), TBL_ENTRY(0x251), TBL_ENTRY(0x252), TBL_ENTRY(0x253),
-       TBL_ENTRY(0x254), TBL_ENTRY(0x255), TBL_ENTRY(0x256), TBL_ENTRY(0x257),
-       TBL_ENTRY(0x258), TBL_ENTRY(0x259), TBL_ENTRY(0x25a), TBL_ENTRY(0x25b),
-       TBL_ENTRY(0x25c), TBL_ENTRY(0x25d), TBL_ENTRY(0x25e), TBL_ENTRY(0x25f),
-       TBL_ENTRY(0x260), TBL_ENTRY(0x261), TBL_ENTRY(0x262), TBL_ENTRY(0x263),
-       TBL_ENTRY(0x264), TBL_ENTRY(0x265), TBL_ENTRY(0x266), TBL_ENTRY(0x267),
-       TBL_ENTRY(0x268), TBL_ENTRY(0x269), TBL_ENTRY(0x26a), TBL_ENTRY(0x26b),
-       TBL_ENTRY(0x26c), TBL_ENTRY(0x26d), TBL_ENTRY(0x26e), TBL_ENTRY(0x26f),
-       TBL_ENTRY(0x270), TBL_ENTRY(0x271), TBL_ENTRY(0x272), TBL_ENTRY(0x273),
-       TBL_ENTRY(0x274), TBL_ENTRY(0x275), TBL_ENTRY(0x276), TBL_ENTRY(0x277),
-       TBL_ENTRY(0x278), TBL_ENTRY(0x279), TBL_ENTRY(0x27a), TBL_ENTRY(0x27b),
-       TBL_ENTRY(0x27c), TBL_ENTRY(0x27d), TBL_ENTRY(0x27e), TBL_ENTRY(0x27f),
-       TBL_ENTRY(0x280), TBL_ENTRY(0x281), TBL_ENTRY(0x282), TBL_ENTRY(0x283),
-       TBL_ENTRY(0x284), TBL_ENTRY(0x285), TBL_ENTRY(0x286), TBL_ENTRY(0x287),
-       TBL_ENTRY(0x288), TBL_ENTRY(0x289), TBL_ENTRY(0x28a), TBL_ENTRY(0x28b),
-       TBL_ENTRY(0x28c), TBL_ENTRY(0x28d), TBL_ENTRY(0x28e), TBL_ENTRY(0x28f),
-       TBL_ENTRY(0x290), TBL_ENTRY(0x291), TBL_ENTRY(0x292), TBL_ENTRY(0x293),
-       TBL_ENTRY(0x294), TBL_ENTRY(0x295), TBL_ENTRY(0x296), TBL_ENTRY(0x297),
-       TBL_ENTRY(0x298), TBL_ENTRY(0x299), TBL_ENTRY(0x29a), TBL_ENTRY(0x29b),
-       TBL_ENTRY(0x29c), TBL_ENTRY(0x29d), TBL_ENTRY(0x29e), TBL_ENTRY(0x29f),
-       TBL_ENTRY(0x2a0), TBL_ENTRY(0x2a1), TBL_ENTRY(0x2a2), TBL_ENTRY(0x2a3),
-       TBL_ENTRY(0x2a4), TBL_ENTRY(0x2a5), TBL_ENTRY(0x2a6), TBL_ENTRY(0x2a7),
-       TBL_ENTRY(0x2a8), TBL_ENTRY(0x2a9), TBL_ENTRY(0x2aa), TBL_ENTRY(0x2ab),
-       TBL_ENTRY(0x2ac), TBL_ENTRY(0x2ad), TBL_ENTRY(0x2ae), TBL_ENTRY(0x2af),
-       TBL_ENTRY(0x2b0), TBL_ENTRY(0x2b1), TBL_ENTRY(0x2b2), TBL_ENTRY(0x2b3),
-       TBL_ENTRY(0x2b4), TBL_ENTRY(0x2b5), TBL_ENTRY(0x2b6), TBL_ENTRY(0x2b7),
-       TBL_ENTRY(0x2b8), TBL_ENTRY(0x2b9), TBL_ENTRY(0x2ba), TBL_ENTRY(0x2bb),
-       TBL_ENTRY(0x2bc), TBL_ENTRY(0x2bd), TBL_ENTRY(0x2be), TBL_ENTRY(0x2bf),
-       TBL_ENTRY(0x2c0), TBL_ENTRY(0x2c1), TBL_ENTRY(0x2c2), TBL_ENTRY(0x2c3),
-       TBL_ENTRY(0x2c4), TBL_ENTRY(0x2c5), TBL_ENTRY(0x2c6), TBL_ENTRY(0x2c7),
-       TBL_ENTRY(0x2c8), TBL_ENTRY(0x2c9), TBL_ENTRY(0x2ca), TBL_ENTRY(0x2cb),
-       TBL_ENTRY(0x2cc), TBL_ENTRY(0x2cd), TBL_ENTRY(0x2ce), TBL_ENTRY(0x2cf),
-       TBL_ENTRY(0x2d0), TBL_ENTRY(0x2d1), TBL_ENTRY(0x2d2), TBL_ENTRY(0x2d3),
-       TBL_ENTRY(0x2d4), TBL_ENTRY(0x2d5), TBL_ENTRY(0x2d6), TBL_ENTRY(0x2d7),
-       TBL_ENTRY(0x2d8), TBL_ENTRY(0x2d9), TBL_ENTRY(0x2da), TBL_ENTRY(0x2db),
-       TBL_ENTRY(0x2dc), TBL_ENTRY(0x2dd), TBL_ENTRY(0x2de), TBL_ENTRY(0x2df),
-       TBL_ENTRY(0x2e0), TBL_ENTRY(0x2e1), TBL_ENTRY(0x2e2), TBL_ENTRY(0x2e3),
-       TBL_ENTRY(0x2e4), TBL_ENTRY(0x2e5), TBL_ENTRY(0x2e6), TBL_ENTRY(0x2e7),
-       TBL_ENTRY(0x2e8), TBL_ENTRY(0x2e9), TBL_ENTRY(0x2ea), TBL_ENTRY(0x2eb),
-       TBL_ENTRY(0x2ec), TBL_ENTRY(0x2ed), TBL_ENTRY(0x2ee), TBL_ENTRY(0x2ef),
-       TBL_ENTRY(0x2f0), TBL_ENTRY(0x2f1), TBL_ENTRY(0x2f2), TBL_ENTRY(0x2f3),
-       TBL_ENTRY(0x2f4), TBL_ENTRY(0x2f5), TBL_ENTRY(0x2f6), TBL_ENTRY(0x2f7),
-       TBL_ENTRY(0x2f8), TBL_ENTRY(0x2f9), TBL_ENTRY(0x2fa), TBL_ENTRY(0x2fb),
-       TBL_ENTRY(0x2fc), TBL_ENTRY(0x2fd), TBL_ENTRY(0x2fe), TBL_ENTRY(0x2ff),
-       TBL_ENTRY(0x300), TBL_ENTRY(0x301), TBL_ENTRY(0x302), TBL_ENTRY(0x303),
-       TBL_ENTRY(0x304), TBL_ENTRY(0x305), TBL_ENTRY(0x306), TBL_ENTRY(0x307),
-       TBL_ENTRY(0x308), TBL_ENTRY(0x309), TBL_ENTRY(0x30a), TBL_ENTRY(0x30b),
-       TBL_ENTRY(0x30c), TBL_ENTRY(0x30d), TBL_ENTRY(0x30e), TBL_ENTRY(0x30f),
-       TBL_ENTRY(0x310), TBL_ENTRY(0x311), TBL_ENTRY(0x312), TBL_ENTRY(0x313),
-       TBL_ENTRY(0x314), TBL_ENTRY(0x315), TBL_ENTRY(0x316), TBL_ENTRY(0x317),
-       TBL_ENTRY(0x318), TBL_ENTRY(0x319), TBL_ENTRY(0x31a), TBL_ENTRY(0x31b),
-       TBL_ENTRY(0x31c), TBL_ENTRY(0x31d), TBL_ENTRY(0x31e), TBL_ENTRY(0x31f),
-       TBL_ENTRY(0x320), TBL_ENTRY(0x321), TBL_ENTRY(0x322), TBL_ENTRY(0x323),
-       TBL_ENTRY(0x324), TBL_ENTRY(0x325), TBL_ENTRY(0x326), TBL_ENTRY(0x327),
-       TBL_ENTRY(0x328), TBL_ENTRY(0x329), TBL_ENTRY(0x32a), TBL_ENTRY(0x32b),
-       TBL_ENTRY(0x32c), TBL_ENTRY(0x32d), TBL_ENTRY(0x32e), TBL_ENTRY(0x32f),
-       TBL_ENTRY(0x330), TBL_ENTRY(0x331), TBL_ENTRY(0x332), TBL_ENTRY(0x333),
-       TBL_ENTRY(0x334), TBL_ENTRY(0x335), TBL_ENTRY(0x336), TBL_ENTRY(0x337),
-       TBL_ENTRY(0x338), TBL_ENTRY(0x339), TBL_ENTRY(0x33a), TBL_ENTRY(0x33b),
-       TBL_ENTRY(0x33c), TBL_ENTRY(0x33d), TBL_ENTRY(0x33e), TBL_ENTRY(0x33f),
-       TBL_ENTRY(0x340), TBL_ENTRY(0x341), TBL_ENTRY(0x342), TBL_ENTRY(0x343),
-       TBL_ENTRY(0x344), TBL_ENTRY(0x345), TBL_ENTRY(0x346), TBL_ENTRY(0x347),
-       TBL_ENTRY(0x348), TBL_ENTRY(0x349), TBL_ENTRY(0x34a), TBL_ENTRY(0x34b),
-       TBL_ENTRY(0x34c), TBL_ENTRY(0x34d), TBL_ENTRY(0x34e), TBL_ENTRY(0x34f),
-       TBL_ENTRY(0x350), TBL_ENTRY(0x351), TBL_ENTRY(0x352), TBL_ENTRY(0x353),
-       TBL_ENTRY(0x354), TBL_ENTRY(0x355), TBL_ENTRY(0x356), TBL_ENTRY(0x357),
-       TBL_ENTRY(0x358), TBL_ENTRY(0x359), TBL_ENTRY(0x35a), TBL_ENTRY(0x35b),
-       TBL_ENTRY(0x35c), TBL_ENTRY(0x35d), TBL_ENTRY(0x35e), TBL_ENTRY(0x35f),
-       TBL_ENTRY(0x360), TBL_ENTRY(0x361), TBL_ENTRY(0x362), TBL_ENTRY(0x363),
-       TBL_ENTRY(0x364), TBL_ENTRY(0x365), TBL_ENTRY(0x366), TBL_ENTRY(0x367),
-       TBL_ENTRY(0x368), TBL_ENTRY(0x369), TBL_ENTRY(0x36a), TBL_ENTRY(0x36b),
-       TBL_ENTRY(0x36c), TBL_ENTRY(0x36d), TBL_ENTRY(0x36e), TBL_ENTRY(0x36f),
-       TBL_ENTRY(0x370), TBL_ENTRY(0x371), TBL_ENTRY(0x372), TBL_ENTRY(0x373),
-       TBL_ENTRY(0x374), TBL_ENTRY(0x375), TBL_ENTRY(0x376), TBL_ENTRY(0x377),
-       TBL_ENTRY(0x378), TBL_ENTRY(0x379), TBL_ENTRY(0x37a), TBL_ENTRY(0x37b),
-       TBL_ENTRY(0x37c), TBL_ENTRY(0x37d), TBL_ENTRY(0x37e), TBL_ENTRY(0x37f),
-       TBL_ENTRY(0x380), TBL_ENTRY(0x381), TBL_ENTRY(0x382), TBL_ENTRY(0x383),
-       TBL_ENTRY(0x384), TBL_ENTRY(0x385), TBL_ENTRY(0x386), TBL_ENTRY(0x387),
-       TBL_ENTRY(0x388), TBL_ENTRY(0x389), TBL_ENTRY(0x38a), TBL_ENTRY(0x38b),
-       TBL_ENTRY(0x38c), TBL_ENTRY(0x38d), TBL_ENTRY(0x38e), TBL_ENTRY(0x38f),
-       TBL_ENTRY(0x390), TBL_ENTRY(0x391), TBL_ENTRY(0x392), TBL_ENTRY(0x393),
-       TBL_ENTRY(0x394), TBL_ENTRY(0x395), TBL_ENTRY(0x396), TBL_ENTRY(0x397),
-       TBL_ENTRY(0x398), TBL_ENTRY(0x399), TBL_ENTRY(0x39a), TBL_ENTRY(0x39b),
-       TBL_ENTRY(0x39c), TBL_ENTRY(0x39d), TBL_ENTRY(0x39e), TBL_ENTRY(0x39f),
-       TBL_ENTRY(0x3a0), TBL_ENTRY(0x3a1), TBL_ENTRY(0x3a2), TBL_ENTRY(0x3a3),
-       TBL_ENTRY(0x3a4), TBL_ENTRY(0x3a5), TBL_ENTRY(0x3a6), TBL_ENTRY(0x3a7),
-       TBL_ENTRY(0x3a8), TBL_ENTRY(0x3a9), TBL_ENTRY(0x3aa), TBL_ENTRY(0x3ab),
-       TBL_ENTRY(0x3ac), TBL_ENTRY(0x3ad), TBL_ENTRY(0x3ae), TBL_ENTRY(0x3af),
-       TBL_ENTRY(0x3b0), TBL_ENTRY(0x3b1), TBL_ENTRY(0x3b2), TBL_ENTRY(0x3b3),
-       TBL_ENTRY(0x3b4), TBL_ENTRY(0x3b5), TBL_ENTRY(0x3b6), TBL_ENTRY(0x3b7),
-       TBL_ENTRY(0x3b8), TBL_ENTRY(0x3b9), TBL_ENTRY(0x3ba), TBL_ENTRY(0x3bb),
-       TBL_ENTRY(0x3bc), TBL_ENTRY(0x3bd), TBL_ENTRY(0x3be), TBL_ENTRY(0x3bf),
-       TBL_ENTRY(0x3c0), TBL_ENTRY(0x3c1), TBL_ENTRY(0x3c2), TBL_ENTRY(0x3c3),
-       TBL_ENTRY(0x3c4), TBL_ENTRY(0x3c5), TBL_ENTRY(0x3c6), TBL_ENTRY(0x3c7),
-       TBL_ENTRY(0x3c8), TBL_ENTRY(0x3c9), TBL_ENTRY(0x3ca), TBL_ENTRY(0x3cb),
-       TBL_ENTRY(0x3cc), TBL_ENTRY(0x3cd), TBL_ENTRY(0x3ce), TBL_ENTRY(0x3cf),
-       TBL_ENTRY(0x3d0), TBL_ENTRY(0x3d1), TBL_ENTRY(0x3d2), TBL_ENTRY(0x3d3),
-       TBL_ENTRY(0x3d4), TBL_ENTRY(0x3d5), TBL_ENTRY(0x3d6), TBL_ENTRY(0x3d7),
-       TBL_ENTRY(0x3d8), TBL_ENTRY(0x3d9), TBL_ENTRY(0x3da), TBL_ENTRY(0x3db),
-       TBL_ENTRY(0x3dc), TBL_ENTRY(0x3dd), TBL_ENTRY(0x3de), TBL_ENTRY(0x3df),
-       TBL_ENTRY(0x3e0), TBL_ENTRY(0x3e1), TBL_ENTRY(0x3e2), TBL_ENTRY(0x3e3),
-       TBL_ENTRY(0x3e4), TBL_ENTRY(0x3e5), TBL_ENTRY(0x3e6), TBL_ENTRY(0x3e7),
-       TBL_ENTRY(0x3e8), TBL_ENTRY(0x3e9), TBL_ENTRY(0x3ea), TBL_ENTRY(0x3eb),
-       TBL_ENTRY(0x3ec), TBL_ENTRY(0x3ed), TBL_ENTRY(0x3ee), TBL_ENTRY(0x3ef),
-       TBL_ENTRY(0x3f0), TBL_ENTRY(0x3f1), TBL_ENTRY(0x3f2), TBL_ENTRY(0x3f3),
-       TBL_ENTRY(0x3f4), TBL_ENTRY(0x3f5), TBL_ENTRY(0x3f6), TBL_ENTRY(0x3f7),
-       TBL_ENTRY(0x3f8), TBL_ENTRY(0x3f9), TBL_ENTRY(0x3fa), TBL_ENTRY(0x3fb),
-       TBL_ENTRY(0x3fc), TBL_ENTRY(0x3fd), TBL_ENTRY(0x3fe), TBL_ENTRY(0x3ff),
-       TBL_ENTRY(0x400), TBL_ENTRY(0x401), TBL_ENTRY(0x402), TBL_ENTRY(0x403),
-       TBL_ENTRY(0x404), TBL_ENTRY(0x405), TBL_ENTRY(0x406), TBL_ENTRY(0x407),
-       TBL_ENTRY(0x408), TBL_ENTRY(0x409), TBL_ENTRY(0x40a), TBL_ENTRY(0x40b),
-       TBL_ENTRY(0x40c), TBL_ENTRY(0x40d), TBL_ENTRY(0x40e), TBL_ENTRY(0x40f),
-       TBL_ENTRY(0x410), TBL_ENTRY(0x411), TBL_ENTRY(0x412), TBL_ENTRY(0x413),
-       TBL_ENTRY(0x414), TBL_ENTRY(0x415), TBL_ENTRY(0x416), TBL_ENTRY(0x417),
-       TBL_ENTRY(0x418), TBL_ENTRY(0x419), TBL_ENTRY(0x41a), TBL_ENTRY(0x41b),
-       TBL_ENTRY(0x41c), TBL_ENTRY(0x41d), TBL_ENTRY(0x41e), TBL_ENTRY(0x41f),
-       TBL_ENTRY(0x420), TBL_ENTRY(0x421), TBL_ENTRY(0x422), TBL_ENTRY(0x423),
-       TBL_ENTRY(0x424), TBL_ENTRY(0x425), TBL_ENTRY(0x426), TBL_ENTRY(0x427),
-       TBL_ENTRY(0x428), TBL_ENTRY(0x429), TBL_ENTRY(0x42a), TBL_ENTRY(0x42b),
-       TBL_ENTRY(0x42c), TBL_ENTRY(0x42d), TBL_ENTRY(0x42e), TBL_ENTRY(0x42f),
-       TBL_ENTRY(0x430), TBL_ENTRY(0x431), TBL_ENTRY(0x432), TBL_ENTRY(0x433),
-       TBL_ENTRY(0x434), TBL_ENTRY(0x435), TBL_ENTRY(0x436), TBL_ENTRY(0x437),
-       TBL_ENTRY(0x438), TBL_ENTRY(0x439), TBL_ENTRY(0x43a), TBL_ENTRY(0x43b),
-       TBL_ENTRY(0x43c), TBL_ENTRY(0x43d), TBL_ENTRY(0x43e), TBL_ENTRY(0x43f),
-       TBL_ENTRY(0x440), TBL_ENTRY(0x441), TBL_ENTRY(0x442), TBL_ENTRY(0x443),
-       TBL_ENTRY(0x444), TBL_ENTRY(0x445), TBL_ENTRY(0x446), TBL_ENTRY(0x447),
-       TBL_ENTRY(0x448), TBL_ENTRY(0x449), TBL_ENTRY(0x44a), TBL_ENTRY(0x44b),
-       TBL_ENTRY(0x44c), TBL_ENTRY(0x44d), TBL_ENTRY(0x44e), TBL_ENTRY(0x44f),
-       TBL_ENTRY(0x450), TBL_ENTRY(0x451), TBL_ENTRY(0x452), TBL_ENTRY(0x453),
-       TBL_ENTRY(0x454), TBL_ENTRY(0x455), TBL_ENTRY(0x456), TBL_ENTRY(0x457),
-       TBL_ENTRY(0x458), TBL_ENTRY(0x459), TBL_ENTRY(0x45a), TBL_ENTRY(0x45b),
-       TBL_ENTRY(0x45c), TBL_ENTRY(0x45d), TBL_ENTRY(0x45e), TBL_ENTRY(0x45f),
-       TBL_ENTRY(0x460), TBL_ENTRY(0x461), TBL_ENTRY(0x462), TBL_ENTRY(0x463),
-       TBL_ENTRY(0x464), TBL_ENTRY(0x465), TBL_ENTRY(0x466), TBL_ENTRY(0x467),
-       TBL_ENTRY(0x468), TBL_ENTRY(0x469), TBL_ENTRY(0x46a), TBL_ENTRY(0x46b),
-       TBL_ENTRY(0x46c), TBL_ENTRY(0x46d), TBL_ENTRY(0x46e), TBL_ENTRY(0x46f),
-       TBL_ENTRY(0x470), TBL_ENTRY(0x471), TBL_ENTRY(0x472), TBL_ENTRY(0x473),
-       TBL_ENTRY(0x474), TBL_ENTRY(0x475), TBL_ENTRY(0x476), TBL_ENTRY(0x477),
-       TBL_ENTRY(0x478), TBL_ENTRY(0x479), TBL_ENTRY(0x47a), TBL_ENTRY(0x47b),
-       TBL_ENTRY(0x47c), TBL_ENTRY(0x47d), TBL_ENTRY(0x47e), TBL_ENTRY(0x47f),
-       TBL_ENTRY(0x480), TBL_ENTRY(0x481), TBL_ENTRY(0x482), TBL_ENTRY(0x483),
-       TBL_ENTRY(0x484), TBL_ENTRY(0x485), TBL_ENTRY(0x486), TBL_ENTRY(0x487),
-       TBL_ENTRY(0x488), TBL_ENTRY(0x489), TBL_ENTRY(0x48a), TBL_ENTRY(0x48b),
-       TBL_ENTRY(0x48c), TBL_ENTRY(0x48d), TBL_ENTRY(0x48e), TBL_ENTRY(0x48f),
-       TBL_ENTRY(0x490), TBL_ENTRY(0x491), TBL_ENTRY(0x492), TBL_ENTRY(0x493),
-       TBL_ENTRY(0x494), TBL_ENTRY(0x495), TBL_ENTRY(0x496), TBL_ENTRY(0x497),
-       TBL_ENTRY(0x498), TBL_ENTRY(0x499), TBL_ENTRY(0x49a), TBL_ENTRY(0x49b),
-       TBL_ENTRY(0x49c), TBL_ENTRY(0x49d), TBL_ENTRY(0x49e), TBL_ENTRY(0x49f),
-       TBL_ENTRY(0x4a0), TBL_ENTRY(0x4a1), TBL_ENTRY(0x4a2), TBL_ENTRY(0x4a3),
-       TBL_ENTRY(0x4a4), TBL_ENTRY(0x4a5), TBL_ENTRY(0x4a6), TBL_ENTRY(0x4a7),
-       TBL_ENTRY(0x4a8), TBL_ENTRY(0x4a9), TBL_ENTRY(0x4aa), TBL_ENTRY(0x4ab),
-       TBL_ENTRY(0x4ac), TBL_ENTRY(0x4ad), TBL_ENTRY(0x4ae), TBL_ENTRY(0x4af),
-       TBL_ENTRY(0x4b0), TBL_ENTRY(0x4b1), TBL_ENTRY(0x4b2), TBL_ENTRY(0x4b3),
-       TBL_ENTRY(0x4b4), TBL_ENTRY(0x4b5), TBL_ENTRY(0x4b6), TBL_ENTRY(0x4b7),
-       TBL_ENTRY(0x4b8), TBL_ENTRY(0x4b9), TBL_ENTRY(0x4ba), TBL_ENTRY(0x4bb),
-       TBL_ENTRY(0x4bc), TBL_ENTRY(0x4bd), TBL_ENTRY(0x4be), TBL_ENTRY(0x4bf),
-       TBL_ENTRY(0x4c0), TBL_ENTRY(0x4c1), TBL_ENTRY(0x4c2), TBL_ENTRY(0x4c3),
-       TBL_ENTRY(0x4c4), TBL_ENTRY(0x4c5), TBL_ENTRY(0x4c6), TBL_ENTRY(0x4c7),
-       TBL_ENTRY(0x4c8), TBL_ENTRY(0x4c9), TBL_ENTRY(0x4ca), TBL_ENTRY(0x4cb),
-       TBL_ENTRY(0x4cc), TBL_ENTRY(0x4cd), TBL_ENTRY(0x4ce), TBL_ENTRY(0x4cf),
-       TBL_ENTRY(0x4d0), TBL_ENTRY(0x4d1), TBL_ENTRY(0x4d2), TBL_ENTRY(0x4d3),
-       TBL_ENTRY(0x4d4), TBL_ENTRY(0x4d5), TBL_ENTRY(0x4d6), TBL_ENTRY(0x4d7),
-       TBL_ENTRY(0x4d8), TBL_ENTRY(0x4d9), TBL_ENTRY(0x4da), TBL_ENTRY(0x4db),
-       TBL_ENTRY(0x4dc), TBL_ENTRY(0x4dd), TBL_ENTRY(0x4de), TBL_ENTRY(0x4df),
-       TBL_ENTRY(0x4e0), TBL_ENTRY(0x4e1), TBL_ENTRY(0x4e2), TBL_ENTRY(0x4e3),
-       TBL_ENTRY(0x4e4), TBL_ENTRY(0x4e5), TBL_ENTRY(0x4e6), TBL_ENTRY(0x4e7),
-       TBL_ENTRY(0x4e8), TBL_ENTRY(0x4e9), TBL_ENTRY(0x4ea), TBL_ENTRY(0x4eb),
-       TBL_ENTRY(0x4ec), TBL_ENTRY(0x4ed), TBL_ENTRY(0x4ee), TBL_ENTRY(0x4ef),
-       TBL_ENTRY(0x4f0), TBL_ENTRY(0x4f1), TBL_ENTRY(0x4f2), TBL_ENTRY(0x4f3),
-       TBL_ENTRY(0x4f4), TBL_ENTRY(0x4f5), TBL_ENTRY(0x4f6), TBL_ENTRY(0x4f7),
-       TBL_ENTRY(0x4f8), TBL_ENTRY(0x4f9), TBL_ENTRY(0x4fa), TBL_ENTRY(0x4fb),
-       TBL_ENTRY(0x4fc), TBL_ENTRY(0x4fd), TBL_ENTRY(0x4fe), TBL_ENTRY(0x4ff),
-       TBL_ENTRY(0x500), TBL_ENTRY(0x501), TBL_ENTRY(0x502), TBL_ENTRY(0x503),
-       TBL_ENTRY(0x504), TBL_ENTRY(0x505), TBL_ENTRY(0x506), TBL_ENTRY(0x507),
-       TBL_ENTRY(0x508), TBL_ENTRY(0x509), TBL_ENTRY(0x50a), TBL_ENTRY(0x50b),
-       TBL_ENTRY(0x50c), TBL_ENTRY(0x50d), TBL_ENTRY(0x50e), TBL_ENTRY(0x50f),
-       TBL_ENTRY(0x510), TBL_ENTRY(0x511), TBL_ENTRY(0x512), TBL_ENTRY(0x513),
-       TBL_ENTRY(0x514), TBL_ENTRY(0x515), TBL_ENTRY(0x516), TBL_ENTRY(0x517),
-       TBL_ENTRY(0x518), TBL_ENTRY(0x519), TBL_ENTRY(0x51a), TBL_ENTRY(0x51b),
-       TBL_ENTRY(0x51c), TBL_ENTRY(0x51d), TBL_ENTRY(0x51e), TBL_ENTRY(0x51f),
-       TBL_ENTRY(0x520), TBL_ENTRY(0x521), TBL_ENTRY(0x522), TBL_ENTRY(0x523),
-       TBL_ENTRY(0x524), TBL_ENTRY(0x525), TBL_ENTRY(0x526), TBL_ENTRY(0x527),
-       TBL_ENTRY(0x528), TBL_ENTRY(0x529), TBL_ENTRY(0x52a), TBL_ENTRY(0x52b),
-       TBL_ENTRY(0x52c), TBL_ENTRY(0x52d), TBL_ENTRY(0x52e), TBL_ENTRY(0x52f),
-       TBL_ENTRY(0x530), TBL_ENTRY(0x531), TBL_ENTRY(0x532), TBL_ENTRY(0x533),
-       TBL_ENTRY(0x534), TBL_ENTRY(0x535), TBL_ENTRY(0x536), TBL_ENTRY(0x537),
-       TBL_ENTRY(0x538), TBL_ENTRY(0x539), TBL_ENTRY(0x53a), TBL_ENTRY(0x53b),
-       TBL_ENTRY(0x53c), TBL_ENTRY(0x53d), TBL_ENTRY(0x53e), TBL_ENTRY(0x53f),
-       TBL_ENTRY(0x540), TBL_ENTRY(0x541), TBL_ENTRY(0x542), TBL_ENTRY(0x543),
-       TBL_ENTRY(0x544), TBL_ENTRY(0x545), TBL_ENTRY(0x546), TBL_ENTRY(0x547),
-       TBL_ENTRY(0x548), TBL_ENTRY(0x549), TBL_ENTRY(0x54a), TBL_ENTRY(0x54b),
-       TBL_ENTRY(0x54c), TBL_ENTRY(0x54d), TBL_ENTRY(0x54e), TBL_ENTRY(0x54f),
-       TBL_ENTRY(0x550), TBL_ENTRY(0x551), TBL_ENTRY(0x552), TBL_ENTRY(0x553),
-       TBL_ENTRY(0x554), TBL_ENTRY(0x555), TBL_ENTRY(0x556), TBL_ENTRY(0x557),
-       TBL_ENTRY(0x558), TBL_ENTRY(0x559), TBL_ENTRY(0x55a), TBL_ENTRY(0x55b),
-       TBL_ENTRY(0x55c), TBL_ENTRY(0x55d), TBL_ENTRY(0x55e), TBL_ENTRY(0x55f),
-       TBL_ENTRY(0x560), TBL_ENTRY(0x561), TBL_ENTRY(0x562), TBL_ENTRY(0x563),
-       TBL_ENTRY(0x564), TBL_ENTRY(0x565), TBL_ENTRY(0x566), TBL_ENTRY(0x567),
-       TBL_ENTRY(0x568), TBL_ENTRY(0x569), TBL_ENTRY(0x56a), TBL_ENTRY(0x56b),
-       TBL_ENTRY(0x56c), TBL_ENTRY(0x56d), TBL_ENTRY(0x56e), TBL_ENTRY(0x56f),
-       TBL_ENTRY(0x570), TBL_ENTRY(0x571), TBL_ENTRY(0x572), TBL_ENTRY(0x573),
-       TBL_ENTRY(0x574), TBL_ENTRY(0x575), TBL_ENTRY(0x576), TBL_ENTRY(0x577),
-       TBL_ENTRY(0x578), TBL_ENTRY(0x579), TBL_ENTRY(0x57a), TBL_ENTRY(0x57b),
-       TBL_ENTRY(0x57c), TBL_ENTRY(0x57d), TBL_ENTRY(0x57e), TBL_ENTRY(0x57f),
-       TBL_ENTRY(0x580), TBL_ENTRY(0x581), TBL_ENTRY(0x582), TBL_ENTRY(0x583),
-       TBL_ENTRY(0x584), TBL_ENTRY(0x585), TBL_ENTRY(0x586), TBL_ENTRY(0x587),
-       TBL_ENTRY(0x588), TBL_ENTRY(0x589), TBL_ENTRY(0x58a), TBL_ENTRY(0x58b),
-       TBL_ENTRY(0x58c), TBL_ENTRY(0x58d), TBL_ENTRY(0x58e), TBL_ENTRY(0x58f),
-       TBL_ENTRY(0x590), TBL_ENTRY(0x591), TBL_ENTRY(0x592), TBL_ENTRY(0x593),
-       TBL_ENTRY(0x594), TBL_ENTRY(0x595), TBL_ENTRY(0x596), TBL_ENTRY(0x597),
-       TBL_ENTRY(0x598), TBL_ENTRY(0x599), TBL_ENTRY(0x59a), TBL_ENTRY(0x59b),
-       TBL_ENTRY(0x59c), TBL_ENTRY(0x59d), TBL_ENTRY(0x59e), TBL_ENTRY(0x59f),
-       TBL_ENTRY(0x5a0), TBL_ENTRY(0x5a1), TBL_ENTRY(0x5a2), TBL_ENTRY(0x5a3),
-       TBL_ENTRY(0x5a4), TBL_ENTRY(0x5a5), TBL_ENTRY(0x5a6), TBL_ENTRY(0x5a7),
-       TBL_ENTRY(0x5a8), TBL_ENTRY(0x5a9), TBL_ENTRY(0x5aa), TBL_ENTRY(0x5ab),
-       TBL_ENTRY(0x5ac), TBL_ENTRY(0x5ad), TBL_ENTRY(0x5ae), TBL_ENTRY(0x5af),
-       TBL_ENTRY(0x5b0), TBL_ENTRY(0x5b1), TBL_ENTRY(0x5b2), TBL_ENTRY(0x5b3),
-       TBL_ENTRY(0x5b4), TBL_ENTRY(0x5b5), TBL_ENTRY(0x5b6), TBL_ENTRY(0x5b7),
-       TBL_ENTRY(0x5b8), TBL_ENTRY(0x5b9), TBL_ENTRY(0x5ba), TBL_ENTRY(0x5bb),
-       TBL_ENTRY(0x5bc), TBL_ENTRY(0x5bd), TBL_ENTRY(0x5be), TBL_ENTRY(0x5bf),
-       TBL_ENTRY(0x5c0), TBL_ENTRY(0x5c1), TBL_ENTRY(0x5c2), TBL_ENTRY(0x5c3),
-       TBL_ENTRY(0x5c4), TBL_ENTRY(0x5c5), TBL_ENTRY(0x5c6), TBL_ENTRY(0x5c7),
-       TBL_ENTRY(0x5c8), TBL_ENTRY(0x5c9), TBL_ENTRY(0x5ca), TBL_ENTRY(0x5cb),
-       TBL_ENTRY(0x5cc), TBL_ENTRY(0x5cd), TBL_ENTRY(0x5ce), TBL_ENTRY(0x5cf),
-       TBL_ENTRY(0x5d0), TBL_ENTRY(0x5d1), TBL_ENTRY(0x5d2), TBL_ENTRY(0x5d3),
-       TBL_ENTRY(0x5d4), TBL_ENTRY(0x5d5), TBL_ENTRY(0x5d6), TBL_ENTRY(0x5d7),
-       TBL_ENTRY(0x5d8), TBL_ENTRY(0x5d9), TBL_ENTRY(0x5da), TBL_ENTRY(0x5db),
-       TBL_ENTRY(0x5dc), TBL_ENTRY(0x5dd), TBL_ENTRY(0x5de), TBL_ENTRY(0x5df),
-       TBL_ENTRY(0x5e0), TBL_ENTRY(0x5e1), TBL_ENTRY(0x5e2), TBL_ENTRY(0x5e3),
-       TBL_ENTRY(0x5e4), TBL_ENTRY(0x5e5), TBL_ENTRY(0x5e6), TBL_ENTRY(0x5e7),
-       TBL_ENTRY(0x5e8), TBL_ENTRY(0x5e9), TBL_ENTRY(0x5ea), TBL_ENTRY(0x5eb),
-       TBL_ENTRY(0x5ec), TBL_ENTRY(0x5ed), TBL_ENTRY(0x5ee), TBL_ENTRY(0x5ef),
-       TBL_ENTRY(0x5f0), TBL_ENTRY(0x5f1), TBL_ENTRY(0x5f2), TBL_ENTRY(0x5f3),
-       TBL_ENTRY(0x5f4), TBL_ENTRY(0x5f5), TBL_ENTRY(0x5f6), TBL_ENTRY(0x5f7),
-       TBL_ENTRY(0x5f8), TBL_ENTRY(0x5f9), TBL_ENTRY(0x5fa), TBL_ENTRY(0x5fb),
-       TBL_ENTRY(0x5fc), TBL_ENTRY(0x5fd), TBL_ENTRY(0x5fe), TBL_ENTRY(0x5ff),
-       TBL_ENTRY(0x600), TBL_ENTRY(0x601), TBL_ENTRY(0x602), TBL_ENTRY(0x603),
-       TBL_ENTRY(0x604), TBL_ENTRY(0x605), TBL_ENTRY(0x606), TBL_ENTRY(0x607),
-       TBL_ENTRY(0x608), TBL_ENTRY(0x609), TBL_ENTRY(0x60a), TBL_ENTRY(0x60b),
-       TBL_ENTRY(0x60c), TBL_ENTRY(0x60d), TBL_ENTRY(0x60e), TBL_ENTRY(0x60f),
-       TBL_ENTRY(0x610), TBL_ENTRY(0x611), TBL_ENTRY(0x612), TBL_ENTRY(0x613),
-       TBL_ENTRY(0x614), TBL_ENTRY(0x615), TBL_ENTRY(0x616), TBL_ENTRY(0x617),
-       TBL_ENTRY(0x618), TBL_ENTRY(0x619), TBL_ENTRY(0x61a), TBL_ENTRY(0x61b),
-       TBL_ENTRY(0x61c), TBL_ENTRY(0x61d), TBL_ENTRY(0x61e), TBL_ENTRY(0x61f),
-       TBL_ENTRY(0x620), TBL_ENTRY(0x621), TBL_ENTRY(0x622), TBL_ENTRY(0x623),
-       TBL_ENTRY(0x624), TBL_ENTRY(0x625), TBL_ENTRY(0x626), TBL_ENTRY(0x627),
-       TBL_ENTRY(0x628), TBL_ENTRY(0x629), TBL_ENTRY(0x62a), TBL_ENTRY(0x62b),
-       TBL_ENTRY(0x62c), TBL_ENTRY(0x62d), TBL_ENTRY(0x62e), TBL_ENTRY(0x62f),
-       TBL_ENTRY(0x630), TBL_ENTRY(0x631), TBL_ENTRY(0x632), TBL_ENTRY(0x633),
-       TBL_ENTRY(0x634), TBL_ENTRY(0x635), TBL_ENTRY(0x636), TBL_ENTRY(0x637),
-       TBL_ENTRY(0x638), TBL_ENTRY(0x639), TBL_ENTRY(0x63a), TBL_ENTRY(0x63b),
-       TBL_ENTRY(0x63c), TBL_ENTRY(0x63d), TBL_ENTRY(0x63e), TBL_ENTRY(0x63f),
-       TBL_ENTRY(0x640), TBL_ENTRY(0x641), TBL_ENTRY(0x642), TBL_ENTRY(0x643),
-       TBL_ENTRY(0x644), TBL_ENTRY(0x645), TBL_ENTRY(0x646), TBL_ENTRY(0x647),
-       TBL_ENTRY(0x648), TBL_ENTRY(0x649), TBL_ENTRY(0x64a), TBL_ENTRY(0x64b),
-       TBL_ENTRY(0x64c), TBL_ENTRY(0x64d), TBL_ENTRY(0x64e), TBL_ENTRY(0x64f),
-       TBL_ENTRY(0x650), TBL_ENTRY(0x651), TBL_ENTRY(0x652), TBL_ENTRY(0x653),
-       TBL_ENTRY(0x654), TBL_ENTRY(0x655), TBL_ENTRY(0x656), TBL_ENTRY(0x657),
-       TBL_ENTRY(0x658), TBL_ENTRY(0x659), TBL_ENTRY(0x65a), TBL_ENTRY(0x65b),
-       TBL_ENTRY(0x65c), TBL_ENTRY(0x65d), TBL_ENTRY(0x65e), TBL_ENTRY(0x65f),
-       TBL_ENTRY(0x660), TBL_ENTRY(0x661), TBL_ENTRY(0x662), TBL_ENTRY(0x663),
-       TBL_ENTRY(0x664), TBL_ENTRY(0x665), TBL_ENTRY(0x666), TBL_ENTRY(0x667),
-       TBL_ENTRY(0x668), TBL_ENTRY(0x669), TBL_ENTRY(0x66a), TBL_ENTRY(0x66b),
-       TBL_ENTRY(0x66c), TBL_ENTRY(0x66d), TBL_ENTRY(0x66e), TBL_ENTRY(0x66f),
-       TBL_ENTRY(0x670), TBL_ENTRY(0x671), TBL_ENTRY(0x672), TBL_ENTRY(0x673),
-       TBL_ENTRY(0x674), TBL_ENTRY(0x675), TBL_ENTRY(0x676), TBL_ENTRY(0x677),
-       TBL_ENTRY(0x678), TBL_ENTRY(0x679), TBL_ENTRY(0x67a), TBL_ENTRY(0x67b),
-       TBL_ENTRY(0x67c), TBL_ENTRY(0x67d), TBL_ENTRY(0x67e), TBL_ENTRY(0x67f),
-       TBL_ENTRY(0x680), TBL_ENTRY(0x681), TBL_ENTRY(0x682), TBL_ENTRY(0x683),
-       TBL_ENTRY(0x684), TBL_ENTRY(0x685), TBL_ENTRY(0x686), TBL_ENTRY(0x687),
-       TBL_ENTRY(0x688), TBL_ENTRY(0x689), TBL_ENTRY(0x68a), TBL_ENTRY(0x68b),
-       TBL_ENTRY(0x68c), TBL_ENTRY(0x68d), TBL_ENTRY(0x68e), TBL_ENTRY(0x68f),
-       TBL_ENTRY(0x690), TBL_ENTRY(0x691), TBL_ENTRY(0x692), TBL_ENTRY(0x693),
-       TBL_ENTRY(0x694), TBL_ENTRY(0x695), TBL_ENTRY(0x696), TBL_ENTRY(0x697),
-       TBL_ENTRY(0x698), TBL_ENTRY(0x699), TBL_ENTRY(0x69a), TBL_ENTRY(0x69b),
-       TBL_ENTRY(0x69c), TBL_ENTRY(0x69d), TBL_ENTRY(0x69e), TBL_ENTRY(0x69f),
-       TBL_ENTRY(0x6a0), TBL_ENTRY(0x6a1), TBL_ENTRY(0x6a2), TBL_ENTRY(0x6a3),
-       TBL_ENTRY(0x6a4), TBL_ENTRY(0x6a5), TBL_ENTRY(0x6a6), TBL_ENTRY(0x6a7),
-       TBL_ENTRY(0x6a8), TBL_ENTRY(0x6a9), TBL_ENTRY(0x6aa), TBL_ENTRY(0x6ab),
-       TBL_ENTRY(0x6ac), TBL_ENTRY(0x6ad), TBL_ENTRY(0x6ae), TBL_ENTRY(0x6af),
-       TBL_ENTRY(0x6b0), TBL_ENTRY(0x6b1), TBL_ENTRY(0x6b2), TBL_ENTRY(0x6b3),
-       TBL_ENTRY(0x6b4), TBL_ENTRY(0x6b5), TBL_ENTRY(0x6b6), TBL_ENTRY(0x6b7),
-       TBL_ENTRY(0x6b8), TBL_ENTRY(0x6b9), TBL_ENTRY(0x6ba), TBL_ENTRY(0x6bb),
-       TBL_ENTRY(0x6bc), TBL_ENTRY(0x6bd), TBL_ENTRY(0x6be), TBL_ENTRY(0x6bf),
-       TBL_ENTRY(0x6c0), TBL_ENTRY(0x6c1), TBL_ENTRY(0x6c2), TBL_ENTRY(0x6c3),
-       TBL_ENTRY(0x6c4), TBL_ENTRY(0x6c5), TBL_ENTRY(0x6c6), TBL_ENTRY(0x6c7),
-       TBL_ENTRY(0x6c8), TBL_ENTRY(0x6c9), TBL_ENTRY(0x6ca), TBL_ENTRY(0x6cb),
-       TBL_ENTRY(0x6cc), TBL_ENTRY(0x6cd), TBL_ENTRY(0x6ce), TBL_ENTRY(0x6cf),
-       TBL_ENTRY(0x6d0), TBL_ENTRY(0x6d1), TBL_ENTRY(0x6d2), TBL_ENTRY(0x6d3),
-       TBL_ENTRY(0x6d4), TBL_ENTRY(0x6d5), TBL_ENTRY(0x6d6), TBL_ENTRY(0x6d7),
-       TBL_ENTRY(0x6d8), TBL_ENTRY(0x6d9), TBL_ENTRY(0x6da), TBL_ENTRY(0x6db),
-       TBL_ENTRY(0x6dc), TBL_ENTRY(0x6dd), TBL_ENTRY(0x6de), TBL_ENTRY(0x6df),
-       TBL_ENTRY(0x6e0), TBL_ENTRY(0x6e1), TBL_ENTRY(0x6e2), TBL_ENTRY(0x6e3),
-       TBL_ENTRY(0x6e4), TBL_ENTRY(0x6e5), TBL_ENTRY(0x6e6), TBL_ENTRY(0x6e7),
-       TBL_ENTRY(0x6e8), TBL_ENTRY(0x6e9), TBL_ENTRY(0x6ea), TBL_ENTRY(0x6eb),
-       TBL_ENTRY(0x6ec), TBL_ENTRY(0x6ed), TBL_ENTRY(0x6ee), TBL_ENTRY(0x6ef),
-       TBL_ENTRY(0x6f0), TBL_ENTRY(0x6f1), TBL_ENTRY(0x6f2), TBL_ENTRY(0x6f3),
-       TBL_ENTRY(0x6f4), TBL_ENTRY(0x6f5), TBL_ENTRY(0x6f6), TBL_ENTRY(0x6f7),
-       TBL_ENTRY(0x6f8), TBL_ENTRY(0x6f9), TBL_ENTRY(0x6fa), TBL_ENTRY(0x6fb),
-       TBL_ENTRY(0x6fc), TBL_ENTRY(0x6fd), TBL_ENTRY(0x6fe), TBL_ENTRY(0x6ff),
-       TBL_ENTRY(0x700), TBL_ENTRY(0x701), TBL_ENTRY(0x702), TBL_ENTRY(0x703),
-       TBL_ENTRY(0x704), TBL_ENTRY(0x705), TBL_ENTRY(0x706), TBL_ENTRY(0x707),
-       TBL_ENTRY(0x708), TBL_ENTRY(0x709), TBL_ENTRY(0x70a), TBL_ENTRY(0x70b),
-       TBL_ENTRY(0x70c), TBL_ENTRY(0x70d), TBL_ENTRY(0x70e), TBL_ENTRY(0x70f),
-       TBL_ENTRY(0x710), TBL_ENTRY(0x711), TBL_ENTRY(0x712), TBL_ENTRY(0x713),
-       TBL_ENTRY(0x714), TBL_ENTRY(0x715), TBL_ENTRY(0x716), TBL_ENTRY(0x717),
-       TBL_ENTRY(0x718), TBL_ENTRY(0x719), TBL_ENTRY(0x71a), TBL_ENTRY(0x71b),
-       TBL_ENTRY(0x71c), TBL_ENTRY(0x71d), TBL_ENTRY(0x71e), TBL_ENTRY(0x71f),
-       TBL_ENTRY(0x720), TBL_ENTRY(0x721), TBL_ENTRY(0x722), TBL_ENTRY(0x723),
-       TBL_ENTRY(0x724), TBL_ENTRY(0x725), TBL_ENTRY(0x726), TBL_ENTRY(0x727),
-       TBL_ENTRY(0x728), TBL_ENTRY(0x729), TBL_ENTRY(0x72a), TBL_ENTRY(0x72b),
-       TBL_ENTRY(0x72c), TBL_ENTRY(0x72d), TBL_ENTRY(0x72e), TBL_ENTRY(0x72f),
-       TBL_ENTRY(0x730), TBL_ENTRY(0x731), TBL_ENTRY(0x732), TBL_ENTRY(0x733),
-       TBL_ENTRY(0x734), TBL_ENTRY(0x735), TBL_ENTRY(0x736), TBL_ENTRY(0x737),
-       TBL_ENTRY(0x738), TBL_ENTRY(0x739), TBL_ENTRY(0x73a), TBL_ENTRY(0x73b),
-       TBL_ENTRY(0x73c), TBL_ENTRY(0x73d), TBL_ENTRY(0x73e), TBL_ENTRY(0x73f),
-       TBL_ENTRY(0x740), TBL_ENTRY(0x741), TBL_ENTRY(0x742), TBL_ENTRY(0x743),
-       TBL_ENTRY(0x744), TBL_ENTRY(0x745), TBL_ENTRY(0x746), TBL_ENTRY(0x747),
-       TBL_ENTRY(0x748), TBL_ENTRY(0x749), TBL_ENTRY(0x74a), TBL_ENTRY(0x74b),
-       TBL_ENTRY(0x74c), TBL_ENTRY(0x74d), TBL_ENTRY(0x74e), TBL_ENTRY(0x74f),
-       TBL_ENTRY(0x750), TBL_ENTRY(0x751), TBL_ENTRY(0x752), TBL_ENTRY(0x753),
-       TBL_ENTRY(0x754), TBL_ENTRY(0x755), TBL_ENTRY(0x756), TBL_ENTRY(0x757),
-       TBL_ENTRY(0x758), TBL_ENTRY(0x759), TBL_ENTRY(0x75a), TBL_ENTRY(0x75b),
-       TBL_ENTRY(0x75c), TBL_ENTRY(0x75d), TBL_ENTRY(0x75e), TBL_ENTRY(0x75f),
-       TBL_ENTRY(0x760), TBL_ENTRY(0x761), TBL_ENTRY(0x762), TBL_ENTRY(0x763),
-       TBL_ENTRY(0x764), TBL_ENTRY(0x765), TBL_ENTRY(0x766), TBL_ENTRY(0x767),
-       TBL_ENTRY(0x768), TBL_ENTRY(0x769), TBL_ENTRY(0x76a), TBL_ENTRY(0x76b),
-       TBL_ENTRY(0x76c), TBL_ENTRY(0x76d), TBL_ENTRY(0x76e), TBL_ENTRY(0x76f),
-       TBL_ENTRY(0x770), TBL_ENTRY(0x771), TBL_ENTRY(0x772), TBL_ENTRY(0x773),
-       TBL_ENTRY(0x774), TBL_ENTRY(0x775), TBL_ENTRY(0x776), TBL_ENTRY(0x777),
-       TBL_ENTRY(0x778), TBL_ENTRY(0x779), TBL_ENTRY(0x77a), TBL_ENTRY(0x77b),
-       TBL_ENTRY(0x77c), TBL_ENTRY(0x77d), TBL_ENTRY(0x77e), TBL_ENTRY(0x77f),
-       TBL_ENTRY(0x780), TBL_ENTRY(0x781), TBL_ENTRY(0x782), TBL_ENTRY(0x783),
-       TBL_ENTRY(0x784), TBL_ENTRY(0x785), TBL_ENTRY(0x786), TBL_ENTRY(0x787),
-       TBL_ENTRY(0x788), TBL_ENTRY(0x789), TBL_ENTRY(0x78a), TBL_ENTRY(0x78b),
-       TBL_ENTRY(0x78c), TBL_ENTRY(0x78d), TBL_ENTRY(0x78e), TBL_ENTRY(0x78f),
-       TBL_ENTRY(0x790), TBL_ENTRY(0x791), TBL_ENTRY(0x792), TBL_ENTRY(0x793),
-       TBL_ENTRY(0x794), TBL_ENTRY(0x795), TBL_ENTRY(0x796), TBL_ENTRY(0x797),
-       TBL_ENTRY(0x798), TBL_ENTRY(0x799), TBL_ENTRY(0x79a), TBL_ENTRY(0x79b),
-       TBL_ENTRY(0x79c), TBL_ENTRY(0x79d), TBL_ENTRY(0x79e), TBL_ENTRY(0x79f),
-       TBL_ENTRY(0x7a0), TBL_ENTRY(0x7a1), TBL_ENTRY(0x7a2), TBL_ENTRY(0x7a3),
-       TBL_ENTRY(0x7a4), TBL_ENTRY(0x7a5), TBL_ENTRY(0x7a6), TBL_ENTRY(0x7a7),
-       TBL_ENTRY(0x7a8), TBL_ENTRY(0x7a9), TBL_ENTRY(0x7aa), TBL_ENTRY(0x7ab),
-       TBL_ENTRY(0x7ac), TBL_ENTRY(0x7ad), TBL_ENTRY(0x7ae), TBL_ENTRY(0x7af),
-       TBL_ENTRY(0x7b0), TBL_ENTRY(0x7b1), TBL_ENTRY(0x7b2), TBL_ENTRY(0x7b3),
-       TBL_ENTRY(0x7b4), TBL_ENTRY(0x7b5), TBL_ENTRY(0x7b6), TBL_ENTRY(0x7b7),
-       TBL_ENTRY(0x7b8), TBL_ENTRY(0x7b9), TBL_ENTRY(0x7ba), TBL_ENTRY(0x7bb),
-       TBL_ENTRY(0x7bc), TBL_ENTRY(0x7bd), TBL_ENTRY(0x7be), TBL_ENTRY(0x7bf),
-       TBL_ENTRY(0x7c0), TBL_ENTRY(0x7c1), TBL_ENTRY(0x7c2), TBL_ENTRY(0x7c3),
-       TBL_ENTRY(0x7c4), TBL_ENTRY(0x7c5), TBL_ENTRY(0x7c6), TBL_ENTRY(0x7c7),
-       TBL_ENTRY(0x7c8), TBL_ENTRY(0x7c9), TBL_ENTRY(0x7ca), TBL_ENTRY(0x7cb),
-       TBL_ENTRY(0x7cc), TBL_ENTRY(0x7cd), TBL_ENTRY(0x7ce), TBL_ENTRY(0x7cf),
-       TBL_ENTRY(0x7d0), TBL_ENTRY(0x7d1), TBL_ENTRY(0x7d2), TBL_ENTRY(0x7d3),
-       TBL_ENTRY(0x7d4), TBL_ENTRY(0x7d5), TBL_ENTRY(0x7d6), TBL_ENTRY(0x7d7),
-       TBL_ENTRY(0x7d8), TBL_ENTRY(0x7d9), TBL_ENTRY(0x7da), TBL_ENTRY(0x7db),
-       TBL_ENTRY(0x7dc), TBL_ENTRY(0x7dd), TBL_ENTRY(0x7de), TBL_ENTRY(0x7df),
-       TBL_ENTRY(0x7e0), TBL_ENTRY(0x7e1), TBL_ENTRY(0x7e2), TBL_ENTRY(0x7e3),
-       TBL_ENTRY(0x7e4), TBL_ENTRY(0x7e5), TBL_ENTRY(0x7e6), TBL_ENTRY(0x7e7),
-       TBL_ENTRY(0x7e8), TBL_ENTRY(0x7e9), TBL_ENTRY(0x7ea), TBL_ENTRY(0x7eb),
-       TBL_ENTRY(0x7ec), TBL_ENTRY(0x7ed), TBL_ENTRY(0x7ee), TBL_ENTRY(0x7ef),
-       TBL_ENTRY(0x7f0), TBL_ENTRY(0x7f1), TBL_ENTRY(0x7f2), TBL_ENTRY(0x7f3),
-       TBL_ENTRY(0x7f4), TBL_ENTRY(0x7f5), TBL_ENTRY(0x7f6), TBL_ENTRY(0x7f7),
-       TBL_ENTRY(0x7f8), TBL_ENTRY(0x7f9), TBL_ENTRY(0x7fa), TBL_ENTRY(0x7fb),
-       TBL_ENTRY(0x7fc), TBL_ENTRY(0x7fd), TBL_ENTRY(0x7fe), TBL_ENTRY(0x7ff),
-       TBL_ENTRY(0x800), TBL_ENTRY(0x801), TBL_ENTRY(0x802), TBL_ENTRY(0x803),
-       TBL_ENTRY(0x804), TBL_ENTRY(0x805), TBL_ENTRY(0x806), TBL_ENTRY(0x807),
-       TBL_ENTRY(0x808), TBL_ENTRY(0x809), TBL_ENTRY(0x80a), TBL_ENTRY(0x80b),
-       TBL_ENTRY(0x80c), TBL_ENTRY(0x80d), TBL_ENTRY(0x80e), TBL_ENTRY(0x80f),
-       TBL_ENTRY(0x810), TBL_ENTRY(0x811), TBL_ENTRY(0x812), TBL_ENTRY(0x813),
-       TBL_ENTRY(0x814), TBL_ENTRY(0x815), TBL_ENTRY(0x816), TBL_ENTRY(0x817),
-       TBL_ENTRY(0x818), TBL_ENTRY(0x819), TBL_ENTRY(0x81a), TBL_ENTRY(0x81b),
-       TBL_ENTRY(0x81c), TBL_ENTRY(0x81d), TBL_ENTRY(0x81e), TBL_ENTRY(0x81f),
-       TBL_ENTRY(0x820), TBL_ENTRY(0x821), TBL_ENTRY(0x822), TBL_ENTRY(0x823),
-       TBL_ENTRY(0x824), TBL_ENTRY(0x825), TBL_ENTRY(0x826), TBL_ENTRY(0x827),
-       TBL_ENTRY(0x828), TBL_ENTRY(0x829), TBL_ENTRY(0x82a), TBL_ENTRY(0x82b),
-       TBL_ENTRY(0x82c), TBL_ENTRY(0x82d), TBL_ENTRY(0x82e), TBL_ENTRY(0x82f),
-       TBL_ENTRY(0x830), TBL_ENTRY(0x831), TBL_ENTRY(0x832), TBL_ENTRY(0x833),
-       TBL_ENTRY(0x834), TBL_ENTRY(0x835), TBL_ENTRY(0x836), TBL_ENTRY(0x837),
-       TBL_ENTRY(0x838), TBL_ENTRY(0x839), TBL_ENTRY(0x83a), TBL_ENTRY(0x83b),
-       TBL_ENTRY(0x83c), TBL_ENTRY(0x83d), TBL_ENTRY(0x83e), TBL_ENTRY(0x83f),
-       TBL_ENTRY(0x840), TBL_ENTRY(0x841), TBL_ENTRY(0x842), TBL_ENTRY(0x843),
-       TBL_ENTRY(0x844), TBL_ENTRY(0x845), TBL_ENTRY(0x846), TBL_ENTRY(0x847),
-       TBL_ENTRY(0x848), TBL_ENTRY(0x849), TBL_ENTRY(0x84a), TBL_ENTRY(0x84b),
-       TBL_ENTRY(0x84c), TBL_ENTRY(0x84d), TBL_ENTRY(0x84e), TBL_ENTRY(0x84f),
-       TBL_ENTRY(0x850), TBL_ENTRY(0x851), TBL_ENTRY(0x852), TBL_ENTRY(0x853),
-       TBL_ENTRY(0x854), TBL_ENTRY(0x855), TBL_ENTRY(0x856), TBL_ENTRY(0x857),
-       TBL_ENTRY(0x858), TBL_ENTRY(0x859), TBL_ENTRY(0x85a), TBL_ENTRY(0x85b),
-       TBL_ENTRY(0x85c), TBL_ENTRY(0x85d), TBL_ENTRY(0x85e), TBL_ENTRY(0x85f),
-       TBL_ENTRY(0x860), TBL_ENTRY(0x861), TBL_ENTRY(0x862), TBL_ENTRY(0x863),
-       TBL_ENTRY(0x864), TBL_ENTRY(0x865), TBL_ENTRY(0x866), TBL_ENTRY(0x867),
-       TBL_ENTRY(0x868), TBL_ENTRY(0x869), TBL_ENTRY(0x86a), TBL_ENTRY(0x86b),
-       TBL_ENTRY(0x86c), TBL_ENTRY(0x86d), TBL_ENTRY(0x86e), TBL_ENTRY(0x86f),
-       TBL_ENTRY(0x870), TBL_ENTRY(0x871), TBL_ENTRY(0x872), TBL_ENTRY(0x873),
-       TBL_ENTRY(0x874), TBL_ENTRY(0x875), TBL_ENTRY(0x876), TBL_ENTRY(0x877),
-       TBL_ENTRY(0x878), TBL_ENTRY(0x879), TBL_ENTRY(0x87a), TBL_ENTRY(0x87b),
-       TBL_ENTRY(0x87c), TBL_ENTRY(0x87d), TBL_ENTRY(0x87e), TBL_ENTRY(0x87f),
-       TBL_ENTRY(0x880), TBL_ENTRY(0x881), TBL_ENTRY(0x882), TBL_ENTRY(0x883),
-       TBL_ENTRY(0x884), TBL_ENTRY(0x885), TBL_ENTRY(0x886), TBL_ENTRY(0x887),
-       TBL_ENTRY(0x888), TBL_ENTRY(0x889), TBL_ENTRY(0x88a), TBL_ENTRY(0x88b),
-       TBL_ENTRY(0x88c), TBL_ENTRY(0x88d), TBL_ENTRY(0x88e), TBL_ENTRY(0x88f),
-       TBL_ENTRY(0x890), TBL_ENTRY(0x891), TBL_ENTRY(0x892), TBL_ENTRY(0x893),
-       TBL_ENTRY(0x894), TBL_ENTRY(0x895), TBL_ENTRY(0x896), TBL_ENTRY(0x897),
-       TBL_ENTRY(0x898), TBL_ENTRY(0x899), TBL_ENTRY(0x89a), TBL_ENTRY(0x89b),
-       TBL_ENTRY(0x89c), TBL_ENTRY(0x89d), TBL_ENTRY(0x89e), TBL_ENTRY(0x89f),
-       TBL_ENTRY(0x8a0), TBL_ENTRY(0x8a1), TBL_ENTRY(0x8a2), TBL_ENTRY(0x8a3),
-       TBL_ENTRY(0x8a4), TBL_ENTRY(0x8a5), TBL_ENTRY(0x8a6), TBL_ENTRY(0x8a7),
-       TBL_ENTRY(0x8a8), TBL_ENTRY(0x8a9), TBL_ENTRY(0x8aa), TBL_ENTRY(0x8ab),
-       TBL_ENTRY(0x8ac), TBL_ENTRY(0x8ad), TBL_ENTRY(0x8ae), TBL_ENTRY(0x8af),
-       TBL_ENTRY(0x8b0), TBL_ENTRY(0x8b1), TBL_ENTRY(0x8b2), TBL_ENTRY(0x8b3),
-       TBL_ENTRY(0x8b4), TBL_ENTRY(0x8b5), TBL_ENTRY(0x8b6), TBL_ENTRY(0x8b7),
-       TBL_ENTRY(0x8b8), TBL_ENTRY(0x8b9), TBL_ENTRY(0x8ba), TBL_ENTRY(0x8bb),
-       TBL_ENTRY(0x8bc), TBL_ENTRY(0x8bd), TBL_ENTRY(0x8be), TBL_ENTRY(0x8bf),
-       TBL_ENTRY(0x8c0), TBL_ENTRY(0x8c1), TBL_ENTRY(0x8c2), TBL_ENTRY(0x8c3),
-       TBL_ENTRY(0x8c4), TBL_ENTRY(0x8c5), TBL_ENTRY(0x8c6), TBL_ENTRY(0x8c7),
-       TBL_ENTRY(0x8c8), TBL_ENTRY(0x8c9), TBL_ENTRY(0x8ca), TBL_ENTRY(0x8cb),
-       TBL_ENTRY(0x8cc), TBL_ENTRY(0x8cd), TBL_ENTRY(0x8ce), TBL_ENTRY(0x8cf),
-       TBL_ENTRY(0x8d0), TBL_ENTRY(0x8d1), TBL_ENTRY(0x8d2), TBL_ENTRY(0x8d3),
-       TBL_ENTRY(0x8d4), TBL_ENTRY(0x8d5), TBL_ENTRY(0x8d6), TBL_ENTRY(0x8d7),
-       TBL_ENTRY(0x8d8), TBL_ENTRY(0x8d9), TBL_ENTRY(0x8da), TBL_ENTRY(0x8db),
-       TBL_ENTRY(0x8dc), TBL_ENTRY(0x8dd), TBL_ENTRY(0x8de), TBL_ENTRY(0x8df),
-       TBL_ENTRY(0x8e0), TBL_ENTRY(0x8e1), TBL_ENTRY(0x8e2), TBL_ENTRY(0x8e3),
-       TBL_ENTRY(0x8e4), TBL_ENTRY(0x8e5), TBL_ENTRY(0x8e6), TBL_ENTRY(0x8e7),
-       TBL_ENTRY(0x8e8), TBL_ENTRY(0x8e9), TBL_ENTRY(0x8ea), TBL_ENTRY(0x8eb),
-       TBL_ENTRY(0x8ec), TBL_ENTRY(0x8ed), TBL_ENTRY(0x8ee), TBL_ENTRY(0x8ef),
-       TBL_ENTRY(0x8f0), TBL_ENTRY(0x8f1), TBL_ENTRY(0x8f2), TBL_ENTRY(0x8f3),
-       TBL_ENTRY(0x8f4), TBL_ENTRY(0x8f5), TBL_ENTRY(0x8f6), TBL_ENTRY(0x8f7),
-       TBL_ENTRY(0x8f8), TBL_ENTRY(0x8f9), TBL_ENTRY(0x8fa), TBL_ENTRY(0x8fb),
-       TBL_ENTRY(0x8fc), TBL_ENTRY(0x8fd), TBL_ENTRY(0x8fe), TBL_ENTRY(0x8ff),
-       TBL_ENTRY(0x900), TBL_ENTRY(0x901), TBL_ENTRY(0x902), TBL_ENTRY(0x903),
-       TBL_ENTRY(0x904), TBL_ENTRY(0x905), TBL_ENTRY(0x906), TBL_ENTRY(0x907),
-       TBL_ENTRY(0x908), TBL_ENTRY(0x909), TBL_ENTRY(0x90a), TBL_ENTRY(0x90b),
-       TBL_ENTRY(0x90c), TBL_ENTRY(0x90d), TBL_ENTRY(0x90e), TBL_ENTRY(0x90f),
-       TBL_ENTRY(0x910), TBL_ENTRY(0x911), TBL_ENTRY(0x912), TBL_ENTRY(0x913),
-       TBL_ENTRY(0x914), TBL_ENTRY(0x915), TBL_ENTRY(0x916), TBL_ENTRY(0x917),
-       TBL_ENTRY(0x918), TBL_ENTRY(0x919), TBL_ENTRY(0x91a), TBL_ENTRY(0x91b),
-       TBL_ENTRY(0x91c), TBL_ENTRY(0x91d), TBL_ENTRY(0x91e), TBL_ENTRY(0x91f),
-       TBL_ENTRY(0x920), TBL_ENTRY(0x921), TBL_ENTRY(0x922), TBL_ENTRY(0x923),
-       TBL_ENTRY(0x924), TBL_ENTRY(0x925), TBL_ENTRY(0x926), TBL_ENTRY(0x927),
-       TBL_ENTRY(0x928), TBL_ENTRY(0x929), TBL_ENTRY(0x92a), TBL_ENTRY(0x92b),
-       TBL_ENTRY(0x92c), TBL_ENTRY(0x92d), TBL_ENTRY(0x92e), TBL_ENTRY(0x92f),
-       TBL_ENTRY(0x930), TBL_ENTRY(0x931), TBL_ENTRY(0x932), TBL_ENTRY(0x933),
-       TBL_ENTRY(0x934), TBL_ENTRY(0x935), TBL_ENTRY(0x936), TBL_ENTRY(0x937),
-       TBL_ENTRY(0x938), TBL_ENTRY(0x939), TBL_ENTRY(0x93a), TBL_ENTRY(0x93b),
-       TBL_ENTRY(0x93c), TBL_ENTRY(0x93d), TBL_ENTRY(0x93e), TBL_ENTRY(0x93f),
-       TBL_ENTRY(0x940), TBL_ENTRY(0x941), TBL_ENTRY(0x942), TBL_ENTRY(0x943),
-       TBL_ENTRY(0x944), TBL_ENTRY(0x945), TBL_ENTRY(0x946), TBL_ENTRY(0x947),
-       TBL_ENTRY(0x948), TBL_ENTRY(0x949), TBL_ENTRY(0x94a), TBL_ENTRY(0x94b),
-       TBL_ENTRY(0x94c), TBL_ENTRY(0x94d), TBL_ENTRY(0x94e), TBL_ENTRY(0x94f),
-       TBL_ENTRY(0x950), TBL_ENTRY(0x951), TBL_ENTRY(0x952), TBL_ENTRY(0x953),
-       TBL_ENTRY(0x954), TBL_ENTRY(0x955), TBL_ENTRY(0x956), TBL_ENTRY(0x957),
-       TBL_ENTRY(0x958), TBL_ENTRY(0x959), TBL_ENTRY(0x95a), TBL_ENTRY(0x95b),
-       TBL_ENTRY(0x95c), TBL_ENTRY(0x95d), TBL_ENTRY(0x95e), TBL_ENTRY(0x95f),
-       TBL_ENTRY(0x960), TBL_ENTRY(0x961), TBL_ENTRY(0x962), TBL_ENTRY(0x963),
-       TBL_ENTRY(0x964), TBL_ENTRY(0x965), TBL_ENTRY(0x966), TBL_ENTRY(0x967),
-       TBL_ENTRY(0x968), TBL_ENTRY(0x969), TBL_ENTRY(0x96a), TBL_ENTRY(0x96b),
-       TBL_ENTRY(0x96c), TBL_ENTRY(0x96d), TBL_ENTRY(0x96e), TBL_ENTRY(0x96f),
-       TBL_ENTRY(0x970), TBL_ENTRY(0x971), TBL_ENTRY(0x972), TBL_ENTRY(0x973),
-       TBL_ENTRY(0x974), TBL_ENTRY(0x975), TBL_ENTRY(0x976), TBL_ENTRY(0x977),
-       TBL_ENTRY(0x978), TBL_ENTRY(0x979), TBL_ENTRY(0x97a), TBL_ENTRY(0x97b),
-       TBL_ENTRY(0x97c), TBL_ENTRY(0x97d), TBL_ENTRY(0x97e), TBL_ENTRY(0x97f),
-       TBL_ENTRY(0x980), TBL_ENTRY(0x981), TBL_ENTRY(0x982), TBL_ENTRY(0x983),
-       TBL_ENTRY(0x984), TBL_ENTRY(0x985), TBL_ENTRY(0x986), TBL_ENTRY(0x987),
-       TBL_ENTRY(0x988), TBL_ENTRY(0x989), TBL_ENTRY(0x98a), TBL_ENTRY(0x98b),
-       TBL_ENTRY(0x98c), TBL_ENTRY(0x98d), TBL_ENTRY(0x98e), TBL_ENTRY(0x98f),
-       TBL_ENTRY(0x990), TBL_ENTRY(0x991), TBL_ENTRY(0x992), TBL_ENTRY(0x993),
-       TBL_ENTRY(0x994), TBL_ENTRY(0x995), TBL_ENTRY(0x996), TBL_ENTRY(0x997),
-       TBL_ENTRY(0x998), TBL_ENTRY(0x999), TBL_ENTRY(0x99a), TBL_ENTRY(0x99b),
-       TBL_ENTRY(0x99c), TBL_ENTRY(0x99d), TBL_ENTRY(0x99e), TBL_ENTRY(0x99f),
-       TBL_ENTRY(0x9a0), TBL_ENTRY(0x9a1), TBL_ENTRY(0x9a2), TBL_ENTRY(0x9a3),
-       TBL_ENTRY(0x9a4), TBL_ENTRY(0x9a5), TBL_ENTRY(0x9a6), TBL_ENTRY(0x9a7),
-       TBL_ENTRY(0x9a8), TBL_ENTRY(0x9a9), TBL_ENTRY(0x9aa), TBL_ENTRY(0x9ab),
-       TBL_ENTRY(0x9ac), TBL_ENTRY(0x9ad), TBL_ENTRY(0x9ae), TBL_ENTRY(0x9af),
-       TBL_ENTRY(0x9b0), TBL_ENTRY(0x9b1), TBL_ENTRY(0x9b2), TBL_ENTRY(0x9b3),
-       TBL_ENTRY(0x9b4), TBL_ENTRY(0x9b5), TBL_ENTRY(0x9b6), TBL_ENTRY(0x9b7),
-       TBL_ENTRY(0x9b8), TBL_ENTRY(0x9b9), TBL_ENTRY(0x9ba), TBL_ENTRY(0x9bb),
-       TBL_ENTRY(0x9bc), TBL_ENTRY(0x9bd), TBL_ENTRY(0x9be), TBL_ENTRY(0x9bf),
-       TBL_ENTRY(0x9c0), TBL_ENTRY(0x9c1), TBL_ENTRY(0x9c2), TBL_ENTRY(0x9c3),
-       TBL_ENTRY(0x9c4), TBL_ENTRY(0x9c5), TBL_ENTRY(0x9c6), TBL_ENTRY(0x9c7),
-       TBL_ENTRY(0x9c8), TBL_ENTRY(0x9c9), TBL_ENTRY(0x9ca), TBL_ENTRY(0x9cb),
-       TBL_ENTRY(0x9cc), TBL_ENTRY(0x9cd), TBL_ENTRY(0x9ce), TBL_ENTRY(0x9cf),
-       TBL_ENTRY(0x9d0), TBL_ENTRY(0x9d1), TBL_ENTRY(0x9d2), TBL_ENTRY(0x9d3),
-       TBL_ENTRY(0x9d4), TBL_ENTRY(0x9d5), TBL_ENTRY(0x9d6), TBL_ENTRY(0x9d7),
-       TBL_ENTRY(0x9d8), TBL_ENTRY(0x9d9), TBL_ENTRY(0x9da), TBL_ENTRY(0x9db),
-       TBL_ENTRY(0x9dc), TBL_ENTRY(0x9dd), TBL_ENTRY(0x9de), TBL_ENTRY(0x9df),
-       TBL_ENTRY(0x9e0), TBL_ENTRY(0x9e1), TBL_ENTRY(0x9e2), TBL_ENTRY(0x9e3),
-       TBL_ENTRY(0x9e4), TBL_ENTRY(0x9e5), TBL_ENTRY(0x9e6), TBL_ENTRY(0x9e7),
-       TBL_ENTRY(0x9e8), TBL_ENTRY(0x9e9), TBL_ENTRY(0x9ea), TBL_ENTRY(0x9eb),
-       TBL_ENTRY(0x9ec), TBL_ENTRY(0x9ed), TBL_ENTRY(0x9ee), TBL_ENTRY(0x9ef),
-       TBL_ENTRY(0x9f0), TBL_ENTRY(0x9f1), TBL_ENTRY(0x9f2), TBL_ENTRY(0x9f3),
-       TBL_ENTRY(0x9f4), TBL_ENTRY(0x9f5), TBL_ENTRY(0x9f6), TBL_ENTRY(0x9f7),
-       TBL_ENTRY(0x9f8), TBL_ENTRY(0x9f9), TBL_ENTRY(0x9fa), TBL_ENTRY(0x9fb),
-       TBL_ENTRY(0x9fc), TBL_ENTRY(0x9fd), TBL_ENTRY(0x9fe), TBL_ENTRY(0x9ff),
-       TBL_ENTRY(0xa00), TBL_ENTRY(0xa01), TBL_ENTRY(0xa02), TBL_ENTRY(0xa03),
-       TBL_ENTRY(0xa04), TBL_ENTRY(0xa05), TBL_ENTRY(0xa06), TBL_ENTRY(0xa07),
-       TBL_ENTRY(0xa08), TBL_ENTRY(0xa09), TBL_ENTRY(0xa0a), TBL_ENTRY(0xa0b),
-       TBL_ENTRY(0xa0c), TBL_ENTRY(0xa0d), TBL_ENTRY(0xa0e), TBL_ENTRY(0xa0f),
-       TBL_ENTRY(0xa10), TBL_ENTRY(0xa11), TBL_ENTRY(0xa12), TBL_ENTRY(0xa13),
-       TBL_ENTRY(0xa14), TBL_ENTRY(0xa15), TBL_ENTRY(0xa16), TBL_ENTRY(0xa17),
-       TBL_ENTRY(0xa18), TBL_ENTRY(0xa19), TBL_ENTRY(0xa1a), TBL_ENTRY(0xa1b),
-       TBL_ENTRY(0xa1c), TBL_ENTRY(0xa1d), TBL_ENTRY(0xa1e), TBL_ENTRY(0xa1f),
-       TBL_ENTRY(0xa20), TBL_ENTRY(0xa21), TBL_ENTRY(0xa22), TBL_ENTRY(0xa23),
-       TBL_ENTRY(0xa24), TBL_ENTRY(0xa25), TBL_ENTRY(0xa26), TBL_ENTRY(0xa27),
-       TBL_ENTRY(0xa28), TBL_ENTRY(0xa29), TBL_ENTRY(0xa2a), TBL_ENTRY(0xa2b),
-       TBL_ENTRY(0xa2c), TBL_ENTRY(0xa2d), TBL_ENTRY(0xa2e), TBL_ENTRY(0xa2f),
-       TBL_ENTRY(0xa30), TBL_ENTRY(0xa31), TBL_ENTRY(0xa32), TBL_ENTRY(0xa33),
-       TBL_ENTRY(0xa34), TBL_ENTRY(0xa35), TBL_ENTRY(0xa36), TBL_ENTRY(0xa37),
-       TBL_ENTRY(0xa38), TBL_ENTRY(0xa39), TBL_ENTRY(0xa3a), TBL_ENTRY(0xa3b),
-       TBL_ENTRY(0xa3c), TBL_ENTRY(0xa3d), TBL_ENTRY(0xa3e), TBL_ENTRY(0xa3f),
-       TBL_ENTRY(0xa40), TBL_ENTRY(0xa41), TBL_ENTRY(0xa42), TBL_ENTRY(0xa43),
-       TBL_ENTRY(0xa44), TBL_ENTRY(0xa45), TBL_ENTRY(0xa46), TBL_ENTRY(0xa47),
-       TBL_ENTRY(0xa48), TBL_ENTRY(0xa49), TBL_ENTRY(0xa4a), TBL_ENTRY(0xa4b),
-       TBL_ENTRY(0xa4c), TBL_ENTRY(0xa4d), TBL_ENTRY(0xa4e), TBL_ENTRY(0xa4f),
-       TBL_ENTRY(0xa50), TBL_ENTRY(0xa51), TBL_ENTRY(0xa52), TBL_ENTRY(0xa53),
-       TBL_ENTRY(0xa54), TBL_ENTRY(0xa55), TBL_ENTRY(0xa56), TBL_ENTRY(0xa57),
-       TBL_ENTRY(0xa58), TBL_ENTRY(0xa59), TBL_ENTRY(0xa5a), TBL_ENTRY(0xa5b),
-       TBL_ENTRY(0xa5c), TBL_ENTRY(0xa5d), TBL_ENTRY(0xa5e), TBL_ENTRY(0xa5f),
-       TBL_ENTRY(0xa60), TBL_ENTRY(0xa61), TBL_ENTRY(0xa62), TBL_ENTRY(0xa63),
-       TBL_ENTRY(0xa64), TBL_ENTRY(0xa65), TBL_ENTRY(0xa66), TBL_ENTRY(0xa67),
-       TBL_ENTRY(0xa68), TBL_ENTRY(0xa69), TBL_ENTRY(0xa6a), TBL_ENTRY(0xa6b),
-       TBL_ENTRY(0xa6c), TBL_ENTRY(0xa6d), TBL_ENTRY(0xa6e), TBL_ENTRY(0xa6f),
-       TBL_ENTRY(0xa70), TBL_ENTRY(0xa71), TBL_ENTRY(0xa72), TBL_ENTRY(0xa73),
-       TBL_ENTRY(0xa74), TBL_ENTRY(0xa75), TBL_ENTRY(0xa76), TBL_ENTRY(0xa77),
-       TBL_ENTRY(0xa78), TBL_ENTRY(0xa79), TBL_ENTRY(0xa7a), TBL_ENTRY(0xa7b),
-       TBL_ENTRY(0xa7c), TBL_ENTRY(0xa7d), TBL_ENTRY(0xa7e), TBL_ENTRY(0xa7f),
-       TBL_ENTRY(0xa80), TBL_ENTRY(0xa81), TBL_ENTRY(0xa82), TBL_ENTRY(0xa83),
-       TBL_ENTRY(0xa84), TBL_ENTRY(0xa85), TBL_ENTRY(0xa86), TBL_ENTRY(0xa87),
-       TBL_ENTRY(0xa88), TBL_ENTRY(0xa89), TBL_ENTRY(0xa8a), TBL_ENTRY(0xa8b),
-       TBL_ENTRY(0xa8c), TBL_ENTRY(0xa8d), TBL_ENTRY(0xa8e), TBL_ENTRY(0xa8f),
-       TBL_ENTRY(0xa90), TBL_ENTRY(0xa91), TBL_ENTRY(0xa92), TBL_ENTRY(0xa93),
-       TBL_ENTRY(0xa94), TBL_ENTRY(0xa95), TBL_ENTRY(0xa96), TBL_ENTRY(0xa97),
-       TBL_ENTRY(0xa98), TBL_ENTRY(0xa99), TBL_ENTRY(0xa9a), TBL_ENTRY(0xa9b),
-       TBL_ENTRY(0xa9c), TBL_ENTRY(0xa9d), TBL_ENTRY(0xa9e), TBL_ENTRY(0xa9f),
-       TBL_ENTRY(0xaa0), TBL_ENTRY(0xaa1), TBL_ENTRY(0xaa2), TBL_ENTRY(0xaa3),
-       TBL_ENTRY(0xaa4), TBL_ENTRY(0xaa5), TBL_ENTRY(0xaa6), TBL_ENTRY(0xaa7),
-       TBL_ENTRY(0xaa8), TBL_ENTRY(0xaa9), TBL_ENTRY(0xaaa), TBL_ENTRY(0xaab),
-       TBL_ENTRY(0xaac), TBL_ENTRY(0xaad), TBL_ENTRY(0xaae), TBL_ENTRY(0xaaf),
-       TBL_ENTRY(0xab0), TBL_ENTRY(0xab1), TBL_ENTRY(0xab2), TBL_ENTRY(0xab3),
-       TBL_ENTRY(0xab4), TBL_ENTRY(0xab5), TBL_ENTRY(0xab6), TBL_ENTRY(0xab7),
-       TBL_ENTRY(0xab8), TBL_ENTRY(0xab9), TBL_ENTRY(0xaba), TBL_ENTRY(0xabb),
-       TBL_ENTRY(0xabc), TBL_ENTRY(0xabd), TBL_ENTRY(0xabe), TBL_ENTRY(0xabf),
-       TBL_ENTRY(0xac0), TBL_ENTRY(0xac1), TBL_ENTRY(0xac2), TBL_ENTRY(0xac3),
-       TBL_ENTRY(0xac4), TBL_ENTRY(0xac5), TBL_ENTRY(0xac6), TBL_ENTRY(0xac7),
-       TBL_ENTRY(0xac8), TBL_ENTRY(0xac9), TBL_ENTRY(0xaca), TBL_ENTRY(0xacb),
-       TBL_ENTRY(0xacc), TBL_ENTRY(0xacd), TBL_ENTRY(0xace), TBL_ENTRY(0xacf),
-       TBL_ENTRY(0xad0), TBL_ENTRY(0xad1), TBL_ENTRY(0xad2), TBL_ENTRY(0xad3),
-       TBL_ENTRY(0xad4), TBL_ENTRY(0xad5), TBL_ENTRY(0xad6), TBL_ENTRY(0xad7),
-       TBL_ENTRY(0xad8), TBL_ENTRY(0xad9), TBL_ENTRY(0xada), TBL_ENTRY(0xadb),
-       TBL_ENTRY(0xadc), TBL_ENTRY(0xadd), TBL_ENTRY(0xade), TBL_ENTRY(0xadf),
-       TBL_ENTRY(0xae0), TBL_ENTRY(0xae1), TBL_ENTRY(0xae2), TBL_ENTRY(0xae3),
-       TBL_ENTRY(0xae4), TBL_ENTRY(0xae5), TBL_ENTRY(0xae6), TBL_ENTRY(0xae7),
-       TBL_ENTRY(0xae8), TBL_ENTRY(0xae9), TBL_ENTRY(0xaea), TBL_ENTRY(0xaeb),
-       TBL_ENTRY(0xaec), TBL_ENTRY(0xaed), TBL_ENTRY(0xaee), TBL_ENTRY(0xaef),
-       TBL_ENTRY(0xaf0), TBL_ENTRY(0xaf1), TBL_ENTRY(0xaf2), TBL_ENTRY(0xaf3),
-       TBL_ENTRY(0xaf4), TBL_ENTRY(0xaf5), TBL_ENTRY(0xaf6), TBL_ENTRY(0xaf7),
-       TBL_ENTRY(0xaf8), TBL_ENTRY(0xaf9), TBL_ENTRY(0xafa), TBL_ENTRY(0xafb),
-       TBL_ENTRY(0xafc), TBL_ENTRY(0xafd), TBL_ENTRY(0xafe), TBL_ENTRY(0xaff),
-       TBL_ENTRY(0xb00), TBL_ENTRY(0xb01), TBL_ENTRY(0xb02), TBL_ENTRY(0xb03),
-       TBL_ENTRY(0xb04), TBL_ENTRY(0xb05), TBL_ENTRY(0xb06), TBL_ENTRY(0xb07),
-       TBL_ENTRY(0xb08), TBL_ENTRY(0xb09), TBL_ENTRY(0xb0a), TBL_ENTRY(0xb0b),
-       TBL_ENTRY(0xb0c), TBL_ENTRY(0xb0d), TBL_ENTRY(0xb0e), TBL_ENTRY(0xb0f),
-       TBL_ENTRY(0xb10), TBL_ENTRY(0xb11), TBL_ENTRY(0xb12), TBL_ENTRY(0xb13),
-       TBL_ENTRY(0xb14), TBL_ENTRY(0xb15), TBL_ENTRY(0xb16), TBL_ENTRY(0xb17),
-       TBL_ENTRY(0xb18), TBL_ENTRY(0xb19), TBL_ENTRY(0xb1a), TBL_ENTRY(0xb1b),
-       TBL_ENTRY(0xb1c), TBL_ENTRY(0xb1d), TBL_ENTRY(0xb1e), TBL_ENTRY(0xb1f),
-       TBL_ENTRY(0xb20), TBL_ENTRY(0xb21), TBL_ENTRY(0xb22), TBL_ENTRY(0xb23),
-       TBL_ENTRY(0xb24), TBL_ENTRY(0xb25), TBL_ENTRY(0xb26), TBL_ENTRY(0xb27),
-       TBL_ENTRY(0xb28), TBL_ENTRY(0xb29), TBL_ENTRY(0xb2a), TBL_ENTRY(0xb2b),
-       TBL_ENTRY(0xb2c), TBL_ENTRY(0xb2d), TBL_ENTRY(0xb2e), TBL_ENTRY(0xb2f),
-       TBL_ENTRY(0xb30), TBL_ENTRY(0xb31), TBL_ENTRY(0xb32), TBL_ENTRY(0xb33),
-       TBL_ENTRY(0xb34), TBL_ENTRY(0xb35), TBL_ENTRY(0xb36), TBL_ENTRY(0xb37),
-       TBL_ENTRY(0xb38), TBL_ENTRY(0xb39), TBL_ENTRY(0xb3a), TBL_ENTRY(0xb3b),
-       TBL_ENTRY(0xb3c), TBL_ENTRY(0xb3d), TBL_ENTRY(0xb3e), TBL_ENTRY(0xb3f),
-       TBL_ENTRY(0xb40), TBL_ENTRY(0xb41), TBL_ENTRY(0xb42), TBL_ENTRY(0xb43),
-       TBL_ENTRY(0xb44), TBL_ENTRY(0xb45), TBL_ENTRY(0xb46), TBL_ENTRY(0xb47),
-       TBL_ENTRY(0xb48), TBL_ENTRY(0xb49), TBL_ENTRY(0xb4a), TBL_ENTRY(0xb4b),
-       TBL_ENTRY(0xb4c), TBL_ENTRY(0xb4d), TBL_ENTRY(0xb4e), TBL_ENTRY(0xb4f),
-       TBL_ENTRY(0xb50), TBL_ENTRY(0xb51), TBL_ENTRY(0xb52), TBL_ENTRY(0xb53),
-       TBL_ENTRY(0xb54), TBL_ENTRY(0xb55), TBL_ENTRY(0xb56), TBL_ENTRY(0xb57),
-       TBL_ENTRY(0xb58), TBL_ENTRY(0xb59), TBL_ENTRY(0xb5a), TBL_ENTRY(0xb5b),
-       TBL_ENTRY(0xb5c), TBL_ENTRY(0xb5d), TBL_ENTRY(0xb5e), TBL_ENTRY(0xb5f),
-       TBL_ENTRY(0xb60), TBL_ENTRY(0xb61), TBL_ENTRY(0xb62), TBL_ENTRY(0xb63),
-       TBL_ENTRY(0xb64), TBL_ENTRY(0xb65), TBL_ENTRY(0xb66), TBL_ENTRY(0xb67),
-       TBL_ENTRY(0xb68), TBL_ENTRY(0xb69), TBL_ENTRY(0xb6a), TBL_ENTRY(0xb6b),
-       TBL_ENTRY(0xb6c), TBL_ENTRY(0xb6d), TBL_ENTRY(0xb6e), TBL_ENTRY(0xb6f),
-       TBL_ENTRY(0xb70), TBL_ENTRY(0xb71), TBL_ENTRY(0xb72), TBL_ENTRY(0xb73),
-       TBL_ENTRY(0xb74), TBL_ENTRY(0xb75), TBL_ENTRY(0xb76), TBL_ENTRY(0xb77),
-       TBL_ENTRY(0xb78), TBL_ENTRY(0xb79), TBL_ENTRY(0xb7a), TBL_ENTRY(0xb7b),
-       TBL_ENTRY(0xb7c), TBL_ENTRY(0xb7d), TBL_ENTRY(0xb7e), TBL_ENTRY(0xb7f),
-       TBL_ENTRY(0xb80), TBL_ENTRY(0xb81), TBL_ENTRY(0xb82), TBL_ENTRY(0xb83),
-       TBL_ENTRY(0xb84), TBL_ENTRY(0xb85), TBL_ENTRY(0xb86), TBL_ENTRY(0xb87),
-       TBL_ENTRY(0xb88), TBL_ENTRY(0xb89), TBL_ENTRY(0xb8a), TBL_ENTRY(0xb8b),
-       TBL_ENTRY(0xb8c), TBL_ENTRY(0xb8d), TBL_ENTRY(0xb8e), TBL_ENTRY(0xb8f),
-       TBL_ENTRY(0xb90), TBL_ENTRY(0xb91), TBL_ENTRY(0xb92), TBL_ENTRY(0xb93),
-       TBL_ENTRY(0xb94), TBL_ENTRY(0xb95), TBL_ENTRY(0xb96), TBL_ENTRY(0xb97),
-       TBL_ENTRY(0xb98), TBL_ENTRY(0xb99), TBL_ENTRY(0xb9a), TBL_ENTRY(0xb9b),
-       TBL_ENTRY(0xb9c), TBL_ENTRY(0xb9d), TBL_ENTRY(0xb9e), TBL_ENTRY(0xb9f),
-       TBL_ENTRY(0xba0), TBL_ENTRY(0xba1), TBL_ENTRY(0xba2), TBL_ENTRY(0xba3),
-       TBL_ENTRY(0xba4), TBL_ENTRY(0xba5), TBL_ENTRY(0xba6), TBL_ENTRY(0xba7),
-       TBL_ENTRY(0xba8), TBL_ENTRY(0xba9), TBL_ENTRY(0xbaa), TBL_ENTRY(0xbab),
-       TBL_ENTRY(0xbac), TBL_ENTRY(0xbad), TBL_ENTRY(0xbae), TBL_ENTRY(0xbaf),
-       TBL_ENTRY(0xbb0), TBL_ENTRY(0xbb1), TBL_ENTRY(0xbb2), TBL_ENTRY(0xbb3),
-       TBL_ENTRY(0xbb4), TBL_ENTRY(0xbb5), TBL_ENTRY(0xbb6), TBL_ENTRY(0xbb7),
-       TBL_ENTRY(0xbb8), TBL_ENTRY(0xbb9), TBL_ENTRY(0xbba), TBL_ENTRY(0xbbb),
-       TBL_ENTRY(0xbbc), TBL_ENTRY(0xbbd), TBL_ENTRY(0xbbe), TBL_ENTRY(0xbbf),
-       TBL_ENTRY(0xbc0), TBL_ENTRY(0xbc1), TBL_ENTRY(0xbc2), TBL_ENTRY(0xbc3),
-       TBL_ENTRY(0xbc4), TBL_ENTRY(0xbc5), TBL_ENTRY(0xbc6), TBL_ENTRY(0xbc7),
-       TBL_ENTRY(0xbc8), TBL_ENTRY(0xbc9), TBL_ENTRY(0xbca), TBL_ENTRY(0xbcb),
-       TBL_ENTRY(0xbcc), TBL_ENTRY(0xbcd), TBL_ENTRY(0xbce), TBL_ENTRY(0xbcf),
-       TBL_ENTRY(0xbd0), TBL_ENTRY(0xbd1), TBL_ENTRY(0xbd2), TBL_ENTRY(0xbd3),
-       TBL_ENTRY(0xbd4), TBL_ENTRY(0xbd5), TBL_ENTRY(0xbd6), TBL_ENTRY(0xbd7),
-       TBL_ENTRY(0xbd8), TBL_ENTRY(0xbd9), TBL_ENTRY(0xbda), TBL_ENTRY(0xbdb),
-       TBL_ENTRY(0xbdc), TBL_ENTRY(0xbdd), TBL_ENTRY(0xbde), TBL_ENTRY(0xbdf),
-       TBL_ENTRY(0xbe0), TBL_ENTRY(0xbe1), TBL_ENTRY(0xbe2), TBL_ENTRY(0xbe3),
-       TBL_ENTRY(0xbe4), TBL_ENTRY(0xbe5), TBL_ENTRY(0xbe6), TBL_ENTRY(0xbe7),
-       TBL_ENTRY(0xbe8), TBL_ENTRY(0xbe9), TBL_ENTRY(0xbea), TBL_ENTRY(0xbeb),
-       TBL_ENTRY(0xbec), TBL_ENTRY(0xbed), TBL_ENTRY(0xbee), TBL_ENTRY(0xbef),
-       TBL_ENTRY(0xbf0), TBL_ENTRY(0xbf1), TBL_ENTRY(0xbf2), TBL_ENTRY(0xbf3),
-       TBL_ENTRY(0xbf4), TBL_ENTRY(0xbf5), TBL_ENTRY(0xbf6), TBL_ENTRY(0xbf7),
-       TBL_ENTRY(0xbf8), TBL_ENTRY(0xbf9), TBL_ENTRY(0xbfa), TBL_ENTRY(0xbfb),
-       TBL_ENTRY(0xbfc), TBL_ENTRY(0xbfd), TBL_ENTRY(0xbfe), TBL_ENTRY(0xbff),
-       TBL_ENTRY(0xc00), TBL_ENTRY(0xc01), TBL_ENTRY(0xc02), TBL_ENTRY(0xc03),
-       TBL_ENTRY(0xc04), TBL_ENTRY(0xc05), TBL_ENTRY(0xc06), TBL_ENTRY(0xc07),
-       TBL_ENTRY(0xc08), TBL_ENTRY(0xc09), TBL_ENTRY(0xc0a), TBL_ENTRY(0xc0b),
-       TBL_ENTRY(0xc0c), TBL_ENTRY(0xc0d), TBL_ENTRY(0xc0e), TBL_ENTRY(0xc0f),
-       TBL_ENTRY(0xc10), TBL_ENTRY(0xc11), TBL_ENTRY(0xc12), TBL_ENTRY(0xc13),
-       TBL_ENTRY(0xc14), TBL_ENTRY(0xc15), TBL_ENTRY(0xc16), TBL_ENTRY(0xc17),
-       TBL_ENTRY(0xc18), TBL_ENTRY(0xc19), TBL_ENTRY(0xc1a), TBL_ENTRY(0xc1b),
-       TBL_ENTRY(0xc1c), TBL_ENTRY(0xc1d), TBL_ENTRY(0xc1e), TBL_ENTRY(0xc1f),
-       TBL_ENTRY(0xc20), TBL_ENTRY(0xc21), TBL_ENTRY(0xc22), TBL_ENTRY(0xc23),
-       TBL_ENTRY(0xc24), TBL_ENTRY(0xc25), TBL_ENTRY(0xc26), TBL_ENTRY(0xc27),
-       TBL_ENTRY(0xc28), TBL_ENTRY(0xc29), TBL_ENTRY(0xc2a), TBL_ENTRY(0xc2b),
-       TBL_ENTRY(0xc2c), TBL_ENTRY(0xc2d), TBL_ENTRY(0xc2e), TBL_ENTRY(0xc2f),
-       TBL_ENTRY(0xc30), TBL_ENTRY(0xc31), TBL_ENTRY(0xc32), TBL_ENTRY(0xc33),
-       TBL_ENTRY(0xc34), TBL_ENTRY(0xc35), TBL_ENTRY(0xc36), TBL_ENTRY(0xc37),
-       TBL_ENTRY(0xc38), TBL_ENTRY(0xc39), TBL_ENTRY(0xc3a), TBL_ENTRY(0xc3b),
-       TBL_ENTRY(0xc3c), TBL_ENTRY(0xc3d), TBL_ENTRY(0xc3e), TBL_ENTRY(0xc3f),
-       TBL_ENTRY(0xc40), TBL_ENTRY(0xc41), TBL_ENTRY(0xc42), TBL_ENTRY(0xc43),
-       TBL_ENTRY(0xc44), TBL_ENTRY(0xc45), TBL_ENTRY(0xc46), TBL_ENTRY(0xc47),
-       TBL_ENTRY(0xc48), TBL_ENTRY(0xc49), TBL_ENTRY(0xc4a), TBL_ENTRY(0xc4b),
-       TBL_ENTRY(0xc4c), TBL_ENTRY(0xc4d), TBL_ENTRY(0xc4e), TBL_ENTRY(0xc4f),
-       TBL_ENTRY(0xc50), TBL_ENTRY(0xc51), TBL_ENTRY(0xc52), TBL_ENTRY(0xc53),
-       TBL_ENTRY(0xc54), TBL_ENTRY(0xc55), TBL_ENTRY(0xc56), TBL_ENTRY(0xc57),
-       TBL_ENTRY(0xc58), TBL_ENTRY(0xc59), TBL_ENTRY(0xc5a), TBL_ENTRY(0xc5b),
-       TBL_ENTRY(0xc5c), TBL_ENTRY(0xc5d), TBL_ENTRY(0xc5e), TBL_ENTRY(0xc5f),
-       TBL_ENTRY(0xc60), TBL_ENTRY(0xc61), TBL_ENTRY(0xc62), TBL_ENTRY(0xc63),
-       TBL_ENTRY(0xc64), TBL_ENTRY(0xc65), TBL_ENTRY(0xc66), TBL_ENTRY(0xc67),
-       TBL_ENTRY(0xc68), TBL_ENTRY(0xc69), TBL_ENTRY(0xc6a), TBL_ENTRY(0xc6b),
-       TBL_ENTRY(0xc6c), TBL_ENTRY(0xc6d), TBL_ENTRY(0xc6e), TBL_ENTRY(0xc6f),
-       TBL_ENTRY(0xc70), TBL_ENTRY(0xc71), TBL_ENTRY(0xc72), TBL_ENTRY(0xc73),
-       TBL_ENTRY(0xc74), TBL_ENTRY(0xc75), TBL_ENTRY(0xc76), TBL_ENTRY(0xc77),
-       TBL_ENTRY(0xc78), TBL_ENTRY(0xc79), TBL_ENTRY(0xc7a), TBL_ENTRY(0xc7b),
-       TBL_ENTRY(0xc7c), TBL_ENTRY(0xc7d), TBL_ENTRY(0xc7e), TBL_ENTRY(0xc7f),
-       TBL_ENTRY(0xc80), TBL_ENTRY(0xc81), TBL_ENTRY(0xc82), TBL_ENTRY(0xc83),
-       TBL_ENTRY(0xc84), TBL_ENTRY(0xc85), TBL_ENTRY(0xc86), TBL_ENTRY(0xc87),
-       TBL_ENTRY(0xc88), TBL_ENTRY(0xc89), TBL_ENTRY(0xc8a), TBL_ENTRY(0xc8b),
-       TBL_ENTRY(0xc8c), TBL_ENTRY(0xc8d), TBL_ENTRY(0xc8e), TBL_ENTRY(0xc8f),
-       TBL_ENTRY(0xc90), TBL_ENTRY(0xc91), TBL_ENTRY(0xc92), TBL_ENTRY(0xc93),
-       TBL_ENTRY(0xc94), TBL_ENTRY(0xc95), TBL_ENTRY(0xc96), TBL_ENTRY(0xc97),
-       TBL_ENTRY(0xc98), TBL_ENTRY(0xc99), TBL_ENTRY(0xc9a), TBL_ENTRY(0xc9b),
-       TBL_ENTRY(0xc9c), TBL_ENTRY(0xc9d), TBL_ENTRY(0xc9e), TBL_ENTRY(0xc9f),
-       TBL_ENTRY(0xca0), TBL_ENTRY(0xca1), TBL_ENTRY(0xca2), TBL_ENTRY(0xca3),
-       TBL_ENTRY(0xca4), TBL_ENTRY(0xca5), TBL_ENTRY(0xca6), TBL_ENTRY(0xca7),
-       TBL_ENTRY(0xca8), TBL_ENTRY(0xca9), TBL_ENTRY(0xcaa), TBL_ENTRY(0xcab),
-       TBL_ENTRY(0xcac), TBL_ENTRY(0xcad), TBL_ENTRY(0xcae), TBL_ENTRY(0xcaf),
-       TBL_ENTRY(0xcb0), TBL_ENTRY(0xcb1), TBL_ENTRY(0xcb2), TBL_ENTRY(0xcb3),
-       TBL_ENTRY(0xcb4), TBL_ENTRY(0xcb5), TBL_ENTRY(0xcb6), TBL_ENTRY(0xcb7),
-       TBL_ENTRY(0xcb8), TBL_ENTRY(0xcb9), TBL_ENTRY(0xcba), TBL_ENTRY(0xcbb),
-       TBL_ENTRY(0xcbc), TBL_ENTRY(0xcbd), TBL_ENTRY(0xcbe), TBL_ENTRY(0xcbf),
-       TBL_ENTRY(0xcc0), TBL_ENTRY(0xcc1), TBL_ENTRY(0xcc2), TBL_ENTRY(0xcc3),
-       TBL_ENTRY(0xcc4), TBL_ENTRY(0xcc5), TBL_ENTRY(0xcc6), TBL_ENTRY(0xcc7),
-       TBL_ENTRY(0xcc8), TBL_ENTRY(0xcc9), TBL_ENTRY(0xcca), TBL_ENTRY(0xccb),
-       TBL_ENTRY(0xccc), TBL_ENTRY(0xccd), TBL_ENTRY(0xcce), TBL_ENTRY(0xccf),
-       TBL_ENTRY(0xcd0), TBL_ENTRY(0xcd1), TBL_ENTRY(0xcd2), TBL_ENTRY(0xcd3),
-       TBL_ENTRY(0xcd4), TBL_ENTRY(0xcd5), TBL_ENTRY(0xcd6), TBL_ENTRY(0xcd7),
-       TBL_ENTRY(0xcd8), TBL_ENTRY(0xcd9), TBL_ENTRY(0xcda), TBL_ENTRY(0xcdb),
-       TBL_ENTRY(0xcdc), TBL_ENTRY(0xcdd), TBL_ENTRY(0xcde), TBL_ENTRY(0xcdf),
-       TBL_ENTRY(0xce0), TBL_ENTRY(0xce1), TBL_ENTRY(0xce2), TBL_ENTRY(0xce3),
-       TBL_ENTRY(0xce4), TBL_ENTRY(0xce5), TBL_ENTRY(0xce6), TBL_ENTRY(0xce7),
-       TBL_ENTRY(0xce8), TBL_ENTRY(0xce9), TBL_ENTRY(0xcea), TBL_ENTRY(0xceb),
-       TBL_ENTRY(0xcec), TBL_ENTRY(0xced), TBL_ENTRY(0xcee), TBL_ENTRY(0xcef),
-       TBL_ENTRY(0xcf0), TBL_ENTRY(0xcf1), TBL_ENTRY(0xcf2), TBL_ENTRY(0xcf3),
-       TBL_ENTRY(0xcf4), TBL_ENTRY(0xcf5), TBL_ENTRY(0xcf6), TBL_ENTRY(0xcf7),
-       TBL_ENTRY(0xcf8), TBL_ENTRY(0xcf9), TBL_ENTRY(0xcfa), TBL_ENTRY(0xcfb),
-       TBL_ENTRY(0xcfc), TBL_ENTRY(0xcfd), TBL_ENTRY(0xcfe), TBL_ENTRY(0xcff),
-       TBL_ENTRY(0xd00), TBL_ENTRY(0xd01), TBL_ENTRY(0xd02), TBL_ENTRY(0xd03),
-       TBL_ENTRY(0xd04), TBL_ENTRY(0xd05), TBL_ENTRY(0xd06), TBL_ENTRY(0xd07),
-       TBL_ENTRY(0xd08), TBL_ENTRY(0xd09), TBL_ENTRY(0xd0a), TBL_ENTRY(0xd0b),
-       TBL_ENTRY(0xd0c), TBL_ENTRY(0xd0d), TBL_ENTRY(0xd0e), TBL_ENTRY(0xd0f),
-       TBL_ENTRY(0xd10), TBL_ENTRY(0xd11), TBL_ENTRY(0xd12), TBL_ENTRY(0xd13),
-       TBL_ENTRY(0xd14), TBL_ENTRY(0xd15), TBL_ENTRY(0xd16), TBL_ENTRY(0xd17),
-       TBL_ENTRY(0xd18), TBL_ENTRY(0xd19), TBL_ENTRY(0xd1a), TBL_ENTRY(0xd1b),
-       TBL_ENTRY(0xd1c), TBL_ENTRY(0xd1d), TBL_ENTRY(0xd1e), TBL_ENTRY(0xd1f),
-       TBL_ENTRY(0xd20), TBL_ENTRY(0xd21), TBL_ENTRY(0xd22), TBL_ENTRY(0xd23),
-       TBL_ENTRY(0xd24), TBL_ENTRY(0xd25), TBL_ENTRY(0xd26), TBL_ENTRY(0xd27),
-       TBL_ENTRY(0xd28), TBL_ENTRY(0xd29), TBL_ENTRY(0xd2a), TBL_ENTRY(0xd2b),
-       TBL_ENTRY(0xd2c), TBL_ENTRY(0xd2d), TBL_ENTRY(0xd2e), TBL_ENTRY(0xd2f),
-       TBL_ENTRY(0xd30), TBL_ENTRY(0xd31), TBL_ENTRY(0xd32), TBL_ENTRY(0xd33),
-       TBL_ENTRY(0xd34), TBL_ENTRY(0xd35), TBL_ENTRY(0xd36), TBL_ENTRY(0xd37),
-       TBL_ENTRY(0xd38), TBL_ENTRY(0xd39), TBL_ENTRY(0xd3a), TBL_ENTRY(0xd3b),
-       TBL_ENTRY(0xd3c), TBL_ENTRY(0xd3d), TBL_ENTRY(0xd3e), TBL_ENTRY(0xd3f),
-       TBL_ENTRY(0xd40), TBL_ENTRY(0xd41), TBL_ENTRY(0xd42), TBL_ENTRY(0xd43),
-       TBL_ENTRY(0xd44), TBL_ENTRY(0xd45), TBL_ENTRY(0xd46), TBL_ENTRY(0xd47),
-       TBL_ENTRY(0xd48), TBL_ENTRY(0xd49), TBL_ENTRY(0xd4a), TBL_ENTRY(0xd4b),
-       TBL_ENTRY(0xd4c), TBL_ENTRY(0xd4d), TBL_ENTRY(0xd4e), TBL_ENTRY(0xd4f),
-       TBL_ENTRY(0xd50), TBL_ENTRY(0xd51), TBL_ENTRY(0xd52), TBL_ENTRY(0xd53),
-       TBL_ENTRY(0xd54), TBL_ENTRY(0xd55), TBL_ENTRY(0xd56), TBL_ENTRY(0xd57),
-       TBL_ENTRY(0xd58), TBL_ENTRY(0xd59), TBL_ENTRY(0xd5a), TBL_ENTRY(0xd5b),
-       TBL_ENTRY(0xd5c), TBL_ENTRY(0xd5d), TBL_ENTRY(0xd5e), TBL_ENTRY(0xd5f),
-       TBL_ENTRY(0xd60), TBL_ENTRY(0xd61), TBL_ENTRY(0xd62), TBL_ENTRY(0xd63),
-       TBL_ENTRY(0xd64), TBL_ENTRY(0xd65), TBL_ENTRY(0xd66), TBL_ENTRY(0xd67),
-       TBL_ENTRY(0xd68), TBL_ENTRY(0xd69), TBL_ENTRY(0xd6a), TBL_ENTRY(0xd6b),
-       TBL_ENTRY(0xd6c), TBL_ENTRY(0xd6d), TBL_ENTRY(0xd6e), TBL_ENTRY(0xd6f),
-       TBL_ENTRY(0xd70), TBL_ENTRY(0xd71), TBL_ENTRY(0xd72), TBL_ENTRY(0xd73),
-       TBL_ENTRY(0xd74), TBL_ENTRY(0xd75), TBL_ENTRY(0xd76), TBL_ENTRY(0xd77),
-       TBL_ENTRY(0xd78), TBL_ENTRY(0xd79), TBL_ENTRY(0xd7a), TBL_ENTRY(0xd7b),
-       TBL_ENTRY(0xd7c), TBL_ENTRY(0xd7d), TBL_ENTRY(0xd7e), TBL_ENTRY(0xd7f),
-       TBL_ENTRY(0xd80), TBL_ENTRY(0xd81), TBL_ENTRY(0xd82), TBL_ENTRY(0xd83),
-       TBL_ENTRY(0xd84), TBL_ENTRY(0xd85), TBL_ENTRY(0xd86), TBL_ENTRY(0xd87),
-       TBL_ENTRY(0xd88), TBL_ENTRY(0xd89), TBL_ENTRY(0xd8a), TBL_ENTRY(0xd8b),
-       TBL_ENTRY(0xd8c), TBL_ENTRY(0xd8d), TBL_ENTRY(0xd8e), TBL_ENTRY(0xd8f),
-       TBL_ENTRY(0xd90), TBL_ENTRY(0xd91), TBL_ENTRY(0xd92), TBL_ENTRY(0xd93),
-       TBL_ENTRY(0xd94), TBL_ENTRY(0xd95), TBL_ENTRY(0xd96), TBL_ENTRY(0xd97),
-       TBL_ENTRY(0xd98), TBL_ENTRY(0xd99), TBL_ENTRY(0xd9a), TBL_ENTRY(0xd9b),
-       TBL_ENTRY(0xd9c), TBL_ENTRY(0xd9d), TBL_ENTRY(0xd9e), TBL_ENTRY(0xd9f),
-       TBL_ENTRY(0xda0), TBL_ENTRY(0xda1), TBL_ENTRY(0xda2), TBL_ENTRY(0xda3),
-       TBL_ENTRY(0xda4), TBL_ENTRY(0xda5), TBL_ENTRY(0xda6), TBL_ENTRY(0xda7),
-       TBL_ENTRY(0xda8), TBL_ENTRY(0xda9), TBL_ENTRY(0xdaa), TBL_ENTRY(0xdab),
-       TBL_ENTRY(0xdac), TBL_ENTRY(0xdad), TBL_ENTRY(0xdae), TBL_ENTRY(0xdaf),
-       TBL_ENTRY(0xdb0), TBL_ENTRY(0xdb1), TBL_ENTRY(0xdb2), TBL_ENTRY(0xdb3),
-       TBL_ENTRY(0xdb4), TBL_ENTRY(0xdb5), TBL_ENTRY(0xdb6), TBL_ENTRY(0xdb7),
-       TBL_ENTRY(0xdb8), TBL_ENTRY(0xdb9), TBL_ENTRY(0xdba), TBL_ENTRY(0xdbb),
-       TBL_ENTRY(0xdbc), TBL_ENTRY(0xdbd), TBL_ENTRY(0xdbe), TBL_ENTRY(0xdbf),
-       TBL_ENTRY(0xdc0), TBL_ENTRY(0xdc1), TBL_ENTRY(0xdc2), TBL_ENTRY(0xdc3),
-       TBL_ENTRY(0xdc4), TBL_ENTRY(0xdc5), TBL_ENTRY(0xdc6), TBL_ENTRY(0xdc7),
-       TBL_ENTRY(0xdc8), TBL_ENTRY(0xdc9), TBL_ENTRY(0xdca), TBL_ENTRY(0xdcb),
-       TBL_ENTRY(0xdcc), TBL_ENTRY(0xdcd), TBL_ENTRY(0xdce), TBL_ENTRY(0xdcf),
-       TBL_ENTRY(0xdd0), TBL_ENTRY(0xdd1), TBL_ENTRY(0xdd2), TBL_ENTRY(0xdd3),
-       TBL_ENTRY(0xdd4), TBL_ENTRY(0xdd5), TBL_ENTRY(0xdd6), TBL_ENTRY(0xdd7),
-       TBL_ENTRY(0xdd8), TBL_ENTRY(0xdd9), TBL_ENTRY(0xdda), TBL_ENTRY(0xddb),
-       TBL_ENTRY(0xddc), TBL_ENTRY(0xddd), TBL_ENTRY(0xdde), TBL_ENTRY(0xddf),
-       TBL_ENTRY(0xde0), TBL_ENTRY(0xde1), TBL_ENTRY(0xde2), TBL_ENTRY(0xde3),
-       TBL_ENTRY(0xde4), TBL_ENTRY(0xde5), TBL_ENTRY(0xde6), TBL_ENTRY(0xde7),
-       TBL_ENTRY(0xde8), TBL_ENTRY(0xde9), TBL_ENTRY(0xdea), TBL_ENTRY(0xdeb),
-       TBL_ENTRY(0xdec), TBL_ENTRY(0xded), TBL_ENTRY(0xdee), TBL_ENTRY(0xdef),
-       TBL_ENTRY(0xdf0), TBL_ENTRY(0xdf1), TBL_ENTRY(0xdf2), TBL_ENTRY(0xdf3),
-       TBL_ENTRY(0xdf4), TBL_ENTRY(0xdf5), TBL_ENTRY(0xdf6), TBL_ENTRY(0xdf7),
-       TBL_ENTRY(0xdf8), TBL_ENTRY(0xdf9), TBL_ENTRY(0xdfa), TBL_ENTRY(0xdfb),
-       TBL_ENTRY(0xdfc), TBL_ENTRY(0xdfd), TBL_ENTRY(0xdfe), TBL_ENTRY(0xdff),
-       TBL_ENTRY(0xe00), TBL_ENTRY(0xe01), TBL_ENTRY(0xe02), TBL_ENTRY(0xe03),
-       TBL_ENTRY(0xe04), TBL_ENTRY(0xe05), TBL_ENTRY(0xe06), TBL_ENTRY(0xe07),
-       TBL_ENTRY(0xe08), TBL_ENTRY(0xe09), TBL_ENTRY(0xe0a), TBL_ENTRY(0xe0b),
-       TBL_ENTRY(0xe0c), TBL_ENTRY(0xe0d), TBL_ENTRY(0xe0e), TBL_ENTRY(0xe0f),
-       TBL_ENTRY(0xe10), TBL_ENTRY(0xe11), TBL_ENTRY(0xe12), TBL_ENTRY(0xe13),
-       TBL_ENTRY(0xe14), TBL_ENTRY(0xe15), TBL_ENTRY(0xe16), TBL_ENTRY(0xe17),
-       TBL_ENTRY(0xe18), TBL_ENTRY(0xe19), TBL_ENTRY(0xe1a), TBL_ENTRY(0xe1b),
-       TBL_ENTRY(0xe1c), TBL_ENTRY(0xe1d), TBL_ENTRY(0xe1e), TBL_ENTRY(0xe1f),
-       TBL_ENTRY(0xe20), TBL_ENTRY(0xe21), TBL_ENTRY(0xe22), TBL_ENTRY(0xe23),
-       TBL_ENTRY(0xe24), TBL_ENTRY(0xe25), TBL_ENTRY(0xe26), TBL_ENTRY(0xe27),
-       TBL_ENTRY(0xe28), TBL_ENTRY(0xe29), TBL_ENTRY(0xe2a), TBL_ENTRY(0xe2b),
-       TBL_ENTRY(0xe2c), TBL_ENTRY(0xe2d), TBL_ENTRY(0xe2e), TBL_ENTRY(0xe2f),
-       TBL_ENTRY(0xe30), TBL_ENTRY(0xe31), TBL_ENTRY(0xe32), TBL_ENTRY(0xe33),
-       TBL_ENTRY(0xe34), TBL_ENTRY(0xe35), TBL_ENTRY(0xe36), TBL_ENTRY(0xe37),
-       TBL_ENTRY(0xe38), TBL_ENTRY(0xe39), TBL_ENTRY(0xe3a), TBL_ENTRY(0xe3b),
-       TBL_ENTRY(0xe3c), TBL_ENTRY(0xe3d), TBL_ENTRY(0xe3e), TBL_ENTRY(0xe3f),
-       TBL_ENTRY(0xe40), TBL_ENTRY(0xe41), TBL_ENTRY(0xe42), TBL_ENTRY(0xe43),
-       TBL_ENTRY(0xe44), TBL_ENTRY(0xe45), TBL_ENTRY(0xe46), TBL_ENTRY(0xe47),
-       TBL_ENTRY(0xe48), TBL_ENTRY(0xe49), TBL_ENTRY(0xe4a), TBL_ENTRY(0xe4b),
-       TBL_ENTRY(0xe4c), TBL_ENTRY(0xe4d), TBL_ENTRY(0xe4e), TBL_ENTRY(0xe4f),
-       TBL_ENTRY(0xe50), TBL_ENTRY(0xe51), TBL_ENTRY(0xe52), TBL_ENTRY(0xe53),
-       TBL_ENTRY(0xe54), TBL_ENTRY(0xe55), TBL_ENTRY(0xe56), TBL_ENTRY(0xe57),
-       TBL_ENTRY(0xe58), TBL_ENTRY(0xe59), TBL_ENTRY(0xe5a), TBL_ENTRY(0xe5b),
-       TBL_ENTRY(0xe5c), TBL_ENTRY(0xe5d), TBL_ENTRY(0xe5e), TBL_ENTRY(0xe5f),
-       TBL_ENTRY(0xe60), TBL_ENTRY(0xe61), TBL_ENTRY(0xe62), TBL_ENTRY(0xe63),
-       TBL_ENTRY(0xe64), TBL_ENTRY(0xe65), TBL_ENTRY(0xe66), TBL_ENTRY(0xe67),
-       TBL_ENTRY(0xe68), TBL_ENTRY(0xe69), TBL_ENTRY(0xe6a), TBL_ENTRY(0xe6b),
-       TBL_ENTRY(0xe6c), TBL_ENTRY(0xe6d), TBL_ENTRY(0xe6e), TBL_ENTRY(0xe6f),
-       TBL_ENTRY(0xe70), TBL_ENTRY(0xe71), TBL_ENTRY(0xe72), TBL_ENTRY(0xe73),
-       TBL_ENTRY(0xe74), TBL_ENTRY(0xe75), TBL_ENTRY(0xe76), TBL_ENTRY(0xe77),
-       TBL_ENTRY(0xe78), TBL_ENTRY(0xe79), TBL_ENTRY(0xe7a), TBL_ENTRY(0xe7b),
-       TBL_ENTRY(0xe7c), TBL_ENTRY(0xe7d), TBL_ENTRY(0xe7e), TBL_ENTRY(0xe7f),
-       TBL_ENTRY(0xe80), TBL_ENTRY(0xe81), TBL_ENTRY(0xe82), TBL_ENTRY(0xe83),
-       TBL_ENTRY(0xe84), TBL_ENTRY(0xe85), TBL_ENTRY(0xe86), TBL_ENTRY(0xe87),
-       TBL_ENTRY(0xe88), TBL_ENTRY(0xe89), TBL_ENTRY(0xe8a), TBL_ENTRY(0xe8b),
-       TBL_ENTRY(0xe8c), TBL_ENTRY(0xe8d), TBL_ENTRY(0xe8e), TBL_ENTRY(0xe8f),
-       TBL_ENTRY(0xe90), TBL_ENTRY(0xe91), TBL_ENTRY(0xe92), TBL_ENTRY(0xe93),
-       TBL_ENTRY(0xe94), TBL_ENTRY(0xe95), TBL_ENTRY(0xe96), TBL_ENTRY(0xe97),
-       TBL_ENTRY(0xe98), TBL_ENTRY(0xe99), TBL_ENTRY(0xe9a), TBL_ENTRY(0xe9b),
-       TBL_ENTRY(0xe9c), TBL_ENTRY(0xe9d), TBL_ENTRY(0xe9e), TBL_ENTRY(0xe9f),
-       TBL_ENTRY(0xea0), TBL_ENTRY(0xea1), TBL_ENTRY(0xea2), TBL_ENTRY(0xea3),
-       TBL_ENTRY(0xea4), TBL_ENTRY(0xea5), TBL_ENTRY(0xea6), TBL_ENTRY(0xea7),
-       TBL_ENTRY(0xea8), TBL_ENTRY(0xea9), TBL_ENTRY(0xeaa), TBL_ENTRY(0xeab),
-       TBL_ENTRY(0xeac), TBL_ENTRY(0xead), TBL_ENTRY(0xeae), TBL_ENTRY(0xeaf),
-       TBL_ENTRY(0xeb0), TBL_ENTRY(0xeb1), TBL_ENTRY(0xeb2), TBL_ENTRY(0xeb3),
-       TBL_ENTRY(0xeb4), TBL_ENTRY(0xeb5), TBL_ENTRY(0xeb6), TBL_ENTRY(0xeb7),
-       TBL_ENTRY(0xeb8), TBL_ENTRY(0xeb9), TBL_ENTRY(0xeba), TBL_ENTRY(0xebb),
-       TBL_ENTRY(0xebc), TBL_ENTRY(0xebd), TBL_ENTRY(0xebe), TBL_ENTRY(0xebf),
-       TBL_ENTRY(0xec0), TBL_ENTRY(0xec1), TBL_ENTRY(0xec2), TBL_ENTRY(0xec3),
-       TBL_ENTRY(0xec4), TBL_ENTRY(0xec5), TBL_ENTRY(0xec6), TBL_ENTRY(0xec7),
-       TBL_ENTRY(0xec8), TBL_ENTRY(0xec9), TBL_ENTRY(0xeca), TBL_ENTRY(0xecb),
-       TBL_ENTRY(0xecc), TBL_ENTRY(0xecd), TBL_ENTRY(0xece), TBL_ENTRY(0xecf),
-       TBL_ENTRY(0xed0), TBL_ENTRY(0xed1), TBL_ENTRY(0xed2), TBL_ENTRY(0xed3),
-       TBL_ENTRY(0xed4), TBL_ENTRY(0xed5), TBL_ENTRY(0xed6), TBL_ENTRY(0xed7),
-       TBL_ENTRY(0xed8), TBL_ENTRY(0xed9), TBL_ENTRY(0xeda), TBL_ENTRY(0xedb),
-       TBL_ENTRY(0xedc), TBL_ENTRY(0xedd), TBL_ENTRY(0xede), TBL_ENTRY(0xedf),
-       TBL_ENTRY(0xee0), TBL_ENTRY(0xee1), TBL_ENTRY(0xee2), TBL_ENTRY(0xee3),
-       TBL_ENTRY(0xee4), TBL_ENTRY(0xee5), TBL_ENTRY(0xee6), TBL_ENTRY(0xee7),
-       TBL_ENTRY(0xee8), TBL_ENTRY(0xee9), TBL_ENTRY(0xeea), TBL_ENTRY(0xeeb),
-       TBL_ENTRY(0xeec), TBL_ENTRY(0xeed), TBL_ENTRY(0xeee), TBL_ENTRY(0xeef),
-       TBL_ENTRY(0xef0), TBL_ENTRY(0xef1), TBL_ENTRY(0xef2), TBL_ENTRY(0xef3),
-       TBL_ENTRY(0xef4), TBL_ENTRY(0xef5), TBL_ENTRY(0xef6), TBL_ENTRY(0xef7),
-       TBL_ENTRY(0xef8), TBL_ENTRY(0xef9), TBL_ENTRY(0xefa), TBL_ENTRY(0xefb),
-       TBL_ENTRY(0xefc), TBL_ENTRY(0xefd), TBL_ENTRY(0xefe), TBL_ENTRY(0xeff),
-       TBL_ENTRY(0xf00), TBL_ENTRY(0xf01), TBL_ENTRY(0xf02), TBL_ENTRY(0xf03),
-       TBL_ENTRY(0xf04), TBL_ENTRY(0xf05), TBL_ENTRY(0xf06), TBL_ENTRY(0xf07),
-       TBL_ENTRY(0xf08), TBL_ENTRY(0xf09), TBL_ENTRY(0xf0a), TBL_ENTRY(0xf0b),
-       TBL_ENTRY(0xf0c), TBL_ENTRY(0xf0d), TBL_ENTRY(0xf0e), TBL_ENTRY(0xf0f),
-       TBL_ENTRY(0xf10), TBL_ENTRY(0xf11), TBL_ENTRY(0xf12), TBL_ENTRY(0xf13),
-       TBL_ENTRY(0xf14), TBL_ENTRY(0xf15), TBL_ENTRY(0xf16), TBL_ENTRY(0xf17),
-       TBL_ENTRY(0xf18), TBL_ENTRY(0xf19), TBL_ENTRY(0xf1a), TBL_ENTRY(0xf1b),
-       TBL_ENTRY(0xf1c), TBL_ENTRY(0xf1d), TBL_ENTRY(0xf1e), TBL_ENTRY(0xf1f),
-       TBL_ENTRY(0xf20), TBL_ENTRY(0xf21), TBL_ENTRY(0xf22), TBL_ENTRY(0xf23),
-       TBL_ENTRY(0xf24), TBL_ENTRY(0xf25), TBL_ENTRY(0xf26), TBL_ENTRY(0xf27),
-       TBL_ENTRY(0xf28), TBL_ENTRY(0xf29), TBL_ENTRY(0xf2a), TBL_ENTRY(0xf2b),
-       TBL_ENTRY(0xf2c), TBL_ENTRY(0xf2d), TBL_ENTRY(0xf2e), TBL_ENTRY(0xf2f),
-       TBL_ENTRY(0xf30), TBL_ENTRY(0xf31), TBL_ENTRY(0xf32), TBL_ENTRY(0xf33),
-       TBL_ENTRY(0xf34), TBL_ENTRY(0xf35), TBL_ENTRY(0xf36), TBL_ENTRY(0xf37),
-       TBL_ENTRY(0xf38), TBL_ENTRY(0xf39), TBL_ENTRY(0xf3a), TBL_ENTRY(0xf3b),
-       TBL_ENTRY(0xf3c), TBL_ENTRY(0xf3d), TBL_ENTRY(0xf3e), TBL_ENTRY(0xf3f),
-       TBL_ENTRY(0xf40), TBL_ENTRY(0xf41), TBL_ENTRY(0xf42), TBL_ENTRY(0xf43),
-       TBL_ENTRY(0xf44), TBL_ENTRY(0xf45), TBL_ENTRY(0xf46), TBL_ENTRY(0xf47),
-       TBL_ENTRY(0xf48), TBL_ENTRY(0xf49), TBL_ENTRY(0xf4a), TBL_ENTRY(0xf4b),
-       TBL_ENTRY(0xf4c), TBL_ENTRY(0xf4d), TBL_ENTRY(0xf4e), TBL_ENTRY(0xf4f),
-       TBL_ENTRY(0xf50), TBL_ENTRY(0xf51), TBL_ENTRY(0xf52), TBL_ENTRY(0xf53),
-       TBL_ENTRY(0xf54), TBL_ENTRY(0xf55), TBL_ENTRY(0xf56), TBL_ENTRY(0xf57),
-       TBL_ENTRY(0xf58), TBL_ENTRY(0xf59), TBL_ENTRY(0xf5a), TBL_ENTRY(0xf5b),
-       TBL_ENTRY(0xf5c), TBL_ENTRY(0xf5d), TBL_ENTRY(0xf5e), TBL_ENTRY(0xf5f),
-       TBL_ENTRY(0xf60), TBL_ENTRY(0xf61), TBL_ENTRY(0xf62), TBL_ENTRY(0xf63),
-       TBL_ENTRY(0xf64), TBL_ENTRY(0xf65), TBL_ENTRY(0xf66), TBL_ENTRY(0xf67),
-       TBL_ENTRY(0xf68), TBL_ENTRY(0xf69), TBL_ENTRY(0xf6a), TBL_ENTRY(0xf6b),
-       TBL_ENTRY(0xf6c), TBL_ENTRY(0xf6d), TBL_ENTRY(0xf6e), TBL_ENTRY(0xf6f),
-       TBL_ENTRY(0xf70), TBL_ENTRY(0xf71), TBL_ENTRY(0xf72), TBL_ENTRY(0xf73),
-       TBL_ENTRY(0xf74), TBL_ENTRY(0xf75), TBL_ENTRY(0xf76), TBL_ENTRY(0xf77),
-       TBL_ENTRY(0xf78), TBL_ENTRY(0xf79), TBL_ENTRY(0xf7a), TBL_ENTRY(0xf7b),
-       TBL_ENTRY(0xf7c), TBL_ENTRY(0xf7d), TBL_ENTRY(0xf7e), TBL_ENTRY(0xf7f),
-       TBL_ENTRY(0xf80), TBL_ENTRY(0xf81), TBL_ENTRY(0xf82), TBL_ENTRY(0xf83),
-       TBL_ENTRY(0xf84), TBL_ENTRY(0xf85), TBL_ENTRY(0xf86), TBL_ENTRY(0xf87),
-       TBL_ENTRY(0xf88), TBL_ENTRY(0xf89), TBL_ENTRY(0xf8a), TBL_ENTRY(0xf8b),
-       TBL_ENTRY(0xf8c), TBL_ENTRY(0xf8d), TBL_ENTRY(0xf8e), TBL_ENTRY(0xf8f),
-       TBL_ENTRY(0xf90), TBL_ENTRY(0xf91), TBL_ENTRY(0xf92), TBL_ENTRY(0xf93),
-       TBL_ENTRY(0xf94), TBL_ENTRY(0xf95), TBL_ENTRY(0xf96), TBL_ENTRY(0xf97),
-       TBL_ENTRY(0xf98), TBL_ENTRY(0xf99), TBL_ENTRY(0xf9a), TBL_ENTRY(0xf9b),
-       TBL_ENTRY(0xf9c), TBL_ENTRY(0xf9d), TBL_ENTRY(0xf9e), TBL_ENTRY(0xf9f),
-       TBL_ENTRY(0xfa0), TBL_ENTRY(0xfa1), TBL_ENTRY(0xfa2), TBL_ENTRY(0xfa3),
-       TBL_ENTRY(0xfa4), TBL_ENTRY(0xfa5), TBL_ENTRY(0xfa6), TBL_ENTRY(0xfa7),
-       TBL_ENTRY(0xfa8), TBL_ENTRY(0xfa9), TBL_ENTRY(0xfaa), TBL_ENTRY(0xfab),
-       TBL_ENTRY(0xfac), TBL_ENTRY(0xfad), TBL_ENTRY(0xfae), TBL_ENTRY(0xfaf),
-       TBL_ENTRY(0xfb0), TBL_ENTRY(0xfb1), TBL_ENTRY(0xfb2), TBL_ENTRY(0xfb3),
-       TBL_ENTRY(0xfb4), TBL_ENTRY(0xfb5), TBL_ENTRY(0xfb6), TBL_ENTRY(0xfb7),
-       TBL_ENTRY(0xfb8), TBL_ENTRY(0xfb9), TBL_ENTRY(0xfba), TBL_ENTRY(0xfbb),
-       TBL_ENTRY(0xfbc), TBL_ENTRY(0xfbd), TBL_ENTRY(0xfbe), TBL_ENTRY(0xfbf),
-       TBL_ENTRY(0xfc0), TBL_ENTRY(0xfc1), TBL_ENTRY(0xfc2), TBL_ENTRY(0xfc3),
-       TBL_ENTRY(0xfc4), TBL_ENTRY(0xfc5), TBL_ENTRY(0xfc6), TBL_ENTRY(0xfc7),
-       TBL_ENTRY(0xfc8), TBL_ENTRY(0xfc9), TBL_ENTRY(0xfca), TBL_ENTRY(0xfcb),
-       TBL_ENTRY(0xfcc), TBL_ENTRY(0xfcd), TBL_ENTRY(0xfce), TBL_ENTRY(0xfcf),
-       TBL_ENTRY(0xfd0), TBL_ENTRY(0xfd1), TBL_ENTRY(0xfd2), TBL_ENTRY(0xfd3),
-       TBL_ENTRY(0xfd4), TBL_ENTRY(0xfd5), TBL_ENTRY(0xfd6), TBL_ENTRY(0xfd7),
-       TBL_ENTRY(0xfd8), TBL_ENTRY(0xfd9), TBL_ENTRY(0xfda), TBL_ENTRY(0xfdb),
-       TBL_ENTRY(0xfdc), TBL_ENTRY(0xfdd), TBL_ENTRY(0xfde), TBL_ENTRY(0xfdf),
-       TBL_ENTRY(0xfe0), TBL_ENTRY(0xfe1), TBL_ENTRY(0xfe2), TBL_ENTRY(0xfe3),
-       TBL_ENTRY(0xfe4), TBL_ENTRY(0xfe5), TBL_ENTRY(0xfe6), TBL_ENTRY(0xfe7),
-       TBL_ENTRY(0xfe8), TBL_ENTRY(0xfe9), TBL_ENTRY(0xfea), TBL_ENTRY(0xfeb),
-       TBL_ENTRY(0xfec), TBL_ENTRY(0xfed), TBL_ENTRY(0xfee), TBL_ENTRY(0xfef),
-       TBL_ENTRY(0xff0), TBL_ENTRY(0xff1), TBL_ENTRY(0xff2), TBL_ENTRY(0xff3),
-       TBL_ENTRY(0xff4), TBL_ENTRY(0xff5), TBL_ENTRY(0xff6), TBL_ENTRY(0xff7),
-       TBL_ENTRY(0xff8), TBL_ENTRY(0xff9), TBL_ENTRY(0xffa), TBL_ENTRY(0xffb),
-       TBL_ENTRY(0xffc), TBL_ENTRY(0xffd), TBL_ENTRY(0xffe), TBL_ENTRY(0xfff),
-};
index 68b9d5ff2798d4e9210ec1313c9ea94dd08c8f3d..b83582fee798b5677088caf2f312d1a0ffc94e5f 100644 (file)
@@ -11,7 +11,7 @@
 
 #undef DPLL_SSC_RATE_1PER
 
-void dpll_init(void)
+static void dpll_init(void)
 {
        u32 tmp;
 
@@ -42,7 +42,7 @@ void dpll_init(void)
        writel(tmp, SC_DPLLCTRL2);
 }
 
-void upll_init(void)
+static void upll_init(void)
 {
        u32 tmp, clk_mode_upll, clk_mode_axosel;
 
@@ -82,7 +82,7 @@ void upll_init(void)
        writel(tmp, SC_UPLLCTRL);
 }
 
-void vpll_init(void)
+static void vpll_init(void)
 {
        u32 tmp, clk_mode_axosel;
 
index b4dd799a884bef80a99b351571650ee2081f4bb6..2cc5df608f833151e82cc27d2d15183815dbb5a0 100644 (file)
@@ -21,7 +21,7 @@ void sg_init(void)
 #endif
        writel(tmp, SG_MEMCONF);
 
-       /* Input ports must be enabled deasserting reset of cores */
+       /* Input ports must be enabled before deasserting reset of cores */
        tmp = readl(SG_IECTRL);
        tmp |= 0x1;
        writel(tmp, SG_IECTRL);
index 87889160a7058c39cdd8c32cea9ec8b82eddbe03..bbc3dcb3da8b4593e77889ea947a848d0171a880 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/arch/umc-regs.h>
 #include <asm/arch/ddrphy-regs.h>
 
-static inline void umc_start_ssif(void __iomem *ssif_base)
+static void umc_start_ssif(void __iomem *ssif_base)
 {
        writel(0x00000000, ssif_base + 0x0000b004);
        writel(0xffffffff, ssif_base + 0x0000c004);
@@ -43,8 +43,8 @@ static inline void umc_start_ssif(void __iomem *ssif_base)
        writel(0x00000001, ssif_base + UMC_DMDRST);
 }
 
-void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
-                      int size, int freq)
+static void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
+                             int size, int freq)
 {
        if (freq == 1333) {
                writel(0x45990b11, dramcont + UMC_CMDCTLA);
@@ -119,7 +119,7 @@ void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
        writel(0x00000520, dramcont + UMC_DFICUPDCTLA);
 }
 
-static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
+static int umc_init_sub(int freq, int size_ch0, int size_ch1)
 {
        void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
        void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
index 2dcc0892cc7b7a0557da6cdb2cd05d9cb54f6500..1db90f88a0e7c99badc3a089462929ce998fd191 100644 (file)
@@ -11,7 +11,7 @@
 
 #undef DPLL_SSC_RATE_1PER
 
-void dpll_init(void)
+static void dpll_init(void)
 {
        u32 tmp;
 
@@ -46,7 +46,7 @@ void dpll_init(void)
        writel(tmp, SC_DPLLCTRL2);
 }
 
-void stop_mpll(void)
+static void stop_mpll(void)
 {
        u32 tmp;
 
@@ -62,7 +62,7 @@ void stop_mpll(void)
                ;
 }
 
-void vpll_init(void)
+static void vpll_init(void)
 {
        u32 tmp, clk_mode_axosel;
 
index b4dd799a884bef80a99b351571650ee2081f4bb6..b7c4b1096963ec72dcd195058af33d0ebc1acfcc 100644 (file)
@@ -21,8 +21,8 @@ void sg_init(void)
 #endif
        writel(tmp, SG_MEMCONF);
 
-       /* Input ports must be enabled deasserting reset of cores */
+       /* Input ports must be enabled before deasserting reset of cores */
        tmp = readl(SG_IECTRL);
-       tmp |= 0x1;
+       tmp |= 1 << 6;
        writel(tmp, SG_IECTRL);
 }
index 1973ab04c25e122dc96a826a4b946a60f1bd02ba..2d1bde6f13fcac14f61d2cffb3214f0204fb91a4 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/arch/umc-regs.h>
 #include <asm/arch/ddrphy-regs.h>
 
-static inline void umc_start_ssif(void __iomem *ssif_base)
+static void umc_start_ssif(void __iomem *ssif_base)
 {
        writel(0x00000001, ssif_base + 0x0000b004);
        writel(0xffffffff, ssif_base + 0x0000c004);
@@ -52,8 +52,8 @@ static inline void umc_start_ssif(void __iomem *ssif_base)
        writel(0x00000001, ssif_base + UMC_DMDRST);
 }
 
-void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
-                      int size, int freq)
+static void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
+                             int size, int freq)
 {
        writel(0x66bb0f17, dramcont + UMC_CMDCTLA);
        writel(0x18c6aa44, dramcont + UMC_CMDCTLB);
@@ -88,7 +88,7 @@ void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
        writel(0x80000020, dramcont + UMC_DFICUPDCTLA);
 }
 
-static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
+static int umc_init_sub(int freq, int size_ch0, int size_ch1)
 {
        void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
        void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
index 4d87053430eb771429583368b483adbe5677ee5b..4b82700f44f2686e73cefaa452a6541651024435 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/arch/sc-regs.h>
 #include <asm/arch/sg-regs.h>
 
-void dpll_init(void)
+static void dpll_init(void)
 {
        u32 tmp;
        /*
@@ -54,7 +54,7 @@ void dpll_init(void)
        writel(tmp, SC_DPLLCTRL2);
 }
 
-void upll_init(void)
+static void upll_init(void)
 {
        u32 tmp, clk_mode_upll, clk_mode_axosel;
 
@@ -94,7 +94,7 @@ void upll_init(void)
        writel(tmp, SC_UPLLCTRL);
 }
 
-void vpll_init(void)
+static void vpll_init(void)
 {
        u32 tmp, clk_mode_axosel;
 
index 2e0f9aeaa5e6300baffdc4ee75252adaf9c1777c..2fbc73ab03e4746f5711bb68b6ba74b3f5880fc8 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/arch/umc-regs.h>
 #include <asm/arch/ddrphy-regs.h>
 
-static inline void umc_start_ssif(void __iomem *ssif_base)
+static void umc_start_ssif(void __iomem *ssif_base)
 {
        writel(0x00000000, ssif_base + 0x0000b004);
        writel(0xffffffff, ssif_base + 0x0000c004);
@@ -43,8 +43,8 @@ static inline void umc_start_ssif(void __iomem *ssif_base)
        writel(0x00000001, ssif_base + UMC_DMDRST);
 }
 
-void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
-                      int size, int freq)
+static void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
+                             int size, int freq)
 {
 #ifdef CONFIG_DDR_STANDARD
        writel(0x55990b11, dramcont + UMC_CMDCTLA);
@@ -99,7 +99,7 @@ void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
        writel(0x00000520, dramcont + UMC_DFICUPDCTLA);
 }
 
-static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
+static int umc_init_sub(int freq, int size_ch0, int size_ch1)
 {
        void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
        void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
index 651ca4015d04456df3fa172adb9924af2552c4b5..b69fd37c189c51f338ad7f1cbf766404952fc36d 100644 (file)
@@ -15,8 +15,6 @@
 #include <asm/io.h>
 #include <asm/secure.h>
 
-unsigned long gic_dist_addr;
-
 static unsigned int read_id_pfr1(void)
 {
        unsigned int reg;
@@ -68,6 +66,12 @@ static void kick_secondary_cpus_gic(unsigned long gicdaddr)
 
 void __weak smp_kick_all_cpus(void)
 {
+       unsigned long gic_dist_addr;
+
+       gic_dist_addr = get_gicd_base_address();
+       if (gic_dist_addr == -1)
+               return;
+
        kick_secondary_cpus_gic(gic_dist_addr);
 }
 
@@ -75,6 +79,7 @@ int armv7_init_nonsec(void)
 {
        unsigned int reg;
        unsigned itlinesnr, i;
+       unsigned long gic_dist_addr;
 
        /* check whether the CPU supports the security extensions */
        reg = read_id_pfr1();
index 3363a3c71b9837270e8b5ccfdcc360dc911da0fa..901f2ce4cbb79c73720252b7a54f040ae70a3b7f 100644 (file)
@@ -13,4 +13,5 @@ obj-y += cpu.o
 obj-y  += ddrc.o
 obj-y  += slcr.o
 obj-y  += clk.o
+obj-y  += lowlevel_init.o
 obj-$(CONFIG_SPL_BUILD)        += spl.o
diff --git a/arch/arm/cpu/armv7/zynq/config.mk b/arch/arm/cpu/armv7/zynq/config.mk
new file mode 100644 (file)
index 0000000..778a377
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2013 - 2015 Xilinx, Inc. All rights reserved.
+#
+# SPDX-License-Identifier:      GPL-2.0
+#
+# Allow NEON instructions (needed for lowlevel_init.S with GNU toolchain)
+PLATFORM_RELFLAGS += -mfpu=neon
index 816d0c5da7a5c69104c5458939bf799256e04229..914b1feb6833310144d229c307b8130218d00f02 100644 (file)
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/hardware.h>
 
-void lowlevel_init(void)
-{
-}
-
 #define ZYNQ_SILICON_VER_MASK  0xF0000000
 #define ZYNQ_SILICON_VER_SHIFT 28
 
index d74f8dbbc45dfb9f6440ea38fa44552404f436ef..5b20accbcb172d7e0e40dc7c92933f5123e1485a 100644 (file)
@@ -42,6 +42,8 @@ void zynq_ddrc_init(void)
                 */
                /* cppcheck-suppress nullPointer */
                memset((void *)0, 0, 1 * 1024 * 1024);
+
+               gd->ram_size /= 2;
        } else {
                puts("ECC disabled ");
        }
diff --git a/arch/arm/cpu/armv7/zynq/lowlevel_init.S b/arch/arm/cpu/armv7/zynq/lowlevel_init.S
new file mode 100644 (file)
index 0000000..6d714b7
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2013 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(lowlevel_init)
+
+       /* Enable the the VFP */
+       mrc     p15, 0, r1, c1, c0, 2
+       orr     r1, r1, #(0x3 << 20)
+       orr     r1, r1, #(0x3 << 20)
+       mcr     p15, 0, r1, c1, c0, 2
+       isb
+       fmrx    r1, FPEXC
+       orr     r1,r1, #(1<<30)
+       fmxr    FPEXC, r1
+
+       /* Move back to caller */
+       mov     pc, lr
+
+ENDPROC(lowlevel_init)
index 934ccc31c86fd80723afa6c89be03c5651600cb9..2521589c07e9cf0c07a2f59990a521aafcfea7c8 100644 (file)
@@ -132,7 +132,7 @@ void zynq_slcr_devcfg_disable(void)
        zynq_slcr_unlock();
 
        /* Disable AXI interface by asserting FPGA resets */
-       writel(0xFFFFFFFF, &slcr_base->fpga_rst_ctrl);
+       writel(0xF, &slcr_base->fpga_rst_ctrl);
 
        /* Set Level Shifters DT618760 */
        writel(0xA, &slcr_base->lvl_shftr_en);
index 31627f970efbec334262c0dcfc54e10a9794a668..b80c35794a90797801cd0989da783d30376fcf2f 100644 (file)
@@ -20,9 +20,6 @@ void board_init_f(ulong dummy)
        /* Clear the BSS. */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
-       /* Set global data pointer. */
-       gd = &gdata;
-
        preloader_console_init();
        arch_cpu_init();
        board_init_r(NULL, 0);
@@ -46,12 +43,21 @@ u32 spl_boot_device(void)
                mode = BOOT_DEVICE_SPI;
                break;
 #endif
+       case ZYNQ_BM_NAND:
+               mode = BOOT_DEVICE_NAND;
+               break;
+       case ZYNQ_BM_NOR:
+               mode = BOOT_DEVICE_NOR;
+               break;
 #ifdef CONFIG_SPL_MMC_SUPPORT
        case ZYNQ_BM_SD:
                puts("mmc boot\n");
                mode = BOOT_DEVICE_MMC1;
                break;
 #endif
+       case ZYNQ_BM_JTAG:
+               mode = BOOT_DEVICE_RAM;
+               break;
        default:
                puts("Unsupported boot mode selected\n");
                hang();
index 36a76a24d971e7d012570cc7ad7e3c16a2a1a4f5..a774246a2779435b47376b4f7e2cb093a59a991d 100644 (file)
@@ -52,7 +52,7 @@ int pmu_set_nominal(void)
                debug("%s: Cannot find DVC I2C bus\n", __func__);
                return ret;
        }
-       ret = i2c_get_chip(bus, PMI_I2C_ADDRESS, &dev);
+       ret = i2c_get_chip(bus, PMI_I2C_ADDRESS, 1, &dev);
        if (ret) {
                debug("%s: Cannot find DVC I2C chip\n", __func__);
                return ret;
index 77fad48fb4bd72614d575660af1ae81d2188f9c1..7de227cc01aaae4fde1d817b9dd2670e57fe6ba5 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <0 0 0>;
+               reg = <0x13860000 0x100>;
+               interrupts = <0 56 0>;
        };
 
        i2c@13870000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <1 1 0>;
+               reg = <0x13870000 0x100>;
+               interrupts = <1 57 0>;
        };
 
        i2c@13880000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <2 2 0>;
+               reg = <0x13880000 0x100>;
+               interrupts = <2 58 0>;
        };
 
        i2c@13890000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <3 3 0>;
+               reg = <0x13890000 0x100>;
+               interrupts = <3 59 0>;
        };
 
        i2c@138a0000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <4 4 0>;
+               reg = <0x138a0000 0x100>;
+               interrupts = <4 60 0>;
        };
 
        i2c@138b0000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <5 5 0>;
+               reg = <0x138b0000 0x100>;
+               interrupts = <5 61 0>;
        };
 
        i2c@138c0000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <6 6 0>;
+               reg = <0x138c0000 0x100>;
+               interrupts = <6 62 0>;
        };
 
        i2c@138d0000 {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "samsung,s3c2440-i2c";
-               interrupts = <7 7 0>;
+               reg = <0x138d0000 0x100>;
+               interrupts = <7 63 0>;
        };
 
        sdhci@12510000 {
                interrupts = <0 131 0>;
        };
 
-       gpio: gpio {
-               gpio-controller;
-               #gpio-cells = <2>;
-
-               interrupt-controller;
-               #interrupt-cells = <2>;
-       };
 };
index dd2476c1a39e35f74beb2f21d2cde8a44dcdbd04..3f877615844e107262316dead327905335f862d0 100644 (file)
@@ -36,7 +36,7 @@
        sdhci@12530000 {
                samsung,bus-width = <4>;
                samsung,timing = <1 2 3>;
-               cd-gpios = <&gpio 0xA2 0>;
+               cd-gpios = <&gpk2 2 0>;
        };
 
        sdhci@12540000 {
index 8c7a2c3a78792e777ae2b2019ddb8b1eb0e26989..36d02df3b078a4dd6da6197f779ff609b38ac881 100644 (file)
        sdhci@12510000 {
                samsung,bus-width = <8>;
                samsung,timing = <1 3 3>;
-               pwr-gpios = <&gpio 146 0>;
+               pwr-gpios = <&gpk0 2 0>;
        };
 
        sdhci@12520000 {
        sdhci@12530000 {
                samsung,bus-width = <4>;
                samsung,timing = <1 2 3>;
-               cd-gpios = <&gpio 284 0>;
+               cd-gpios = <&gpx3 4 0>;
        };
 
        sdhci@12540000 {
index 808c3f7cc3a2adc0183428fe3f0035169794aa85..16948c93422725571ab05f2f7ed6e8977cb38571 100644 (file)
@@ -24,7 +24,7 @@
        sdhci@12510000 {
                samsung,bus-width = <8>;
                samsung,timing = <1 3 3>;
-               pwr-gpios = <&gpio 146 0>;
+               pwr-gpios = <&gpk0 2 0>;
        };
 
        sdhci@12520000 {
@@ -34,7 +34,7 @@
        sdhci@12530000 {
                samsung,bus-width = <4>;
                samsung,timing = <1 2 3>;
-               cd-gpios = <&gpio 284 0>;
+               cd-gpios = <&gpx3 4 0>;
        };
 
        sdhci@12540000 {
 
        soft-spi {
                compatible = "u-boot,soft-spi";
-               cs-gpio = <&gpio 235 0>;        /* Y43 */
-               sclk-gpio = <&gpio 225 0>;      /* Y31 */
-               mosi-gpio = <&gpio 227 0>;      /* Y33 */
-               miso-gpio = <&gpio 224 0>;      /* Y30 */
+               cs-gpio = <&gpy4 3 0>;
+               sclk-gpio = <&gpy3 1 0>;
+               mosi-gpio = <&gpy3 3 0>;
+               miso-gpio = <&gpy3 0 0>;
                spi-delay-us = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
index c78efec64957ea53e801df849da005f06e56d36c..00a2917596fcbb99ba932db0a36ca0676f3c4ef7 100644 (file)
 
        aliases {
                i2c0 = "/i2c@13860000";
+               i2c1 = "/i2c@13870000";
+               i2c2 = "/i2c@13880000";
+               i2c3 = "/i2c@13890000";
+               i2c4 = "/i2c@138a0000";
+               i2c5 = "/i2c@138b0000";
+               i2c6 = "/i2c@138c0000";
+               i2c7 = "/i2c@138d0000";
                serial0 = "/serial@13800000";
                console = "/serial@13810000";
                mmc2 = "sdhci@12530000";
@@ -51,7 +58,7 @@
        sdhci@12530000 {
                samsung,bus-width = <4>;
                samsung,timing = <1 2 3>;
-               cd-gpios = <&gpio 122 0>;
+               cd-gpios = <&gpk2 2 0>;
        };
 
        sdhci@12540000 {
index 60e4515a7e7a8833a2c1c62da90bf54fed404a03..dd238df13fe69dc36ba4057717be82b3009f55e1 100644 (file)
        sdhci@12510000 {
                samsung,bus-width = <8>;
                samsung,timing = <1 3 3>;
-               pwr-gpios = <&gpio 0x6a 0>;
+               pwr-gpios = <&gpk0 4 0>;
                status = "disabled";
        };
 
        sdhci@12530000 {
                samsung,bus-width = <4>;
                samsung,timing = <1 2 3>;
-               cd-gpios = <&gpio 0x7a 0>;
+               cd-gpios = <&gpk2 2 0>;
        };
 
        sdhci@12540000 {
        dwmmc@12550000 {
                samsung,bus-width = <8>;
                samsung,timing = <2 1 0>;
-               pwr-gpios = <&gpio 0x6a 0>;
+               pwr-gpios = <&gpk0 4 0>;
                fifoth_val = <0x203f0040>;
                bus_hz = <400000000>;
                div = <0x3>;
index e53906892c82de8b0ba922927fff25c64c859045..238acb80a2393a2b6eb204582ec1c4d75be9518f 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "skeleton.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        compatible = "samsung,exynos5";
                u-boot,dm-pre-reloc;
                id = <3>;
        };
-
-       gpio: gpio {
-       };
 };
index 202f2ea6ed9157767b3ef1d5e1b0f059f54a648b..21c0a214ea5207967a141170fb35f9b26e2a7e18 100644 (file)
        compatible = "samsung,arndale", "samsung,exynos5250";
 
        aliases {
+               i2c0 = "/i2c@12c60000";
+               i2c1 = "/i2c@12c70000";
+               i2c2 = "/i2c@12c80000";
+               i2c3 = "/i2c@12c90000";
+               i2c4 = "/i2c@12ca0000";
+               i2c5 = "/i2c@12cb0000";
+               i2c6 = "/i2c@12cc0000";
+               i2c7 = "/i2c@12cd0000";
                serial0 = "/serial@12C20000";
                console = "/serial@12C20000";
        };
index 885040920c077cad8aa26f8360daed79bc4d0d81..9273562bc54cf6bb73840c28a0c2853bcbe4ac59 100644 (file)
        };
 
        ehci@12110000 {
-               samsung,vbus-gpio = <&gpio 0x316 0>; /* X26 */
+               samsung,vbus-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
        };
 };
index bac501516fd257861f69c2b645553d0f2f920a33..7d8be69d73b7d14c522451bcf9ad552e4a74a97e 100644 (file)
@@ -44,7 +44,8 @@
                        reg = <0x1e>;
                        compatible = "google,cros-ec";
                        i2c-max-frequency = <100000>;
-                       ec-interrupt = <&gpio 182 1>;
+                       u-boot,i2c-offset-len = <0>;
+                       ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
                };
 
                power-regulator@48 {
@@ -68,7 +69,7 @@
                        reg = <0>;
                        compatible = "google,cros-ec";
                        spi-max-frequency = <5000000>;
-                       ec-interrupt = <&gpio 182 1>;
+                       ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
                        optimise-flash-write;
                        status = "disabled";
                };
@@ -76,7 +77,7 @@
 
        sound@3830000 {
                samsung,codec-type = "max98095";
-               codec-enable-gpio = <&gpio 0xb7 0>;
+               codec-enable-gpio = <&gpx1 7 GPIO_ACTIVE_HIGH>;
        };
 
        sound@12d60000 {
        };
 
        ehci@12110000 {
-               samsung,vbus-gpio = <&gpio 0xb1 0>; /* X11 */
+               samsung,vbus-gpio = <&gpx1 1 GPIO_ACTIVE_HIGH>;
        };
 
        xhci@12000000 {
-               samsung,vbus-gpio = <&gpio 0xbf 0>; /* X27 */
+               samsung,vbus-gpio = <&gpx2 7 GPIO_ACTIVE_HIGH>;
        };
 
        tmu@10060000 {
index d1d87350be306fb48b88e32d6e9ded69b3adef32..b801de9787531b3f6b29f4326375afd31ca5977d 100644 (file)
@@ -17,7 +17,7 @@
                "google,peach", "samsung,exynos5420", "samsung,exynos5";
 
        config {
-               google,bad-wake-gpios = <&gpio 0x56 0>; /* gpx0-6 */
+               google,bad-wake-gpios = <&gpx0 6 GPIO_ACTIVE_HIGH>;
                hwid = "PIT TEST A-A 7848";
                lazy-init = <1>;
        };
                        spi-half-duplex;
                        spi-max-timeout-ms = <1100>;
                        spi-frame-header = <0xec>;
-                       ec-interrupt = <&gpio 93 1>; /* GPX1_5 */
+                       ec-interrupt = <&gpx1 5 GPIO_ACTIVE_LOW>;
 
                        /*
                         * This describes the flash memory within the EC. Note
        };
 
        xhci@12000000 {
-               samsung,vbus-gpio = <&gpio 0x40 0>; /* H00 */
+               samsung,vbus-gpio = <&gph0 0 GPIO_ACTIVE_HIGH>;
        };
 
        xhci@12400000 {
-               samsung,vbus-gpio = <&gpio 0x41 0>; /* H01 */
+               samsung,vbus-gpio = <&gph0 1 GPIO_ACTIVE_HIGH>;
        };
 
        fimd@14400000 {
index 79a7acd7df77d67e36c2e2e3dc88871342b74522..8f4663733cc712b6621709de75c8cb77c4110021 100644 (file)
@@ -32,7 +32,7 @@
        };
 
        ehci@12110000 {
-               samsung,vbus-gpio = <&gpio 0x66 0>; /* X26 */
+               samsung,vbus-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
        };
 
        serial@12C20000 {
index e7c380f83beba0381b6d36ab09111056ab7492d6..e4bc100995c3112b2749f5bf96d4a449debbeaf5 100644 (file)
@@ -17,7 +17,7 @@
                "google,peach", "samsung,exynos5800", "samsung,exynos5";
 
        config {
-               google,bad-wake-gpios = <&gpio 0x56 0>; /* gpx0-6 */
+               google,bad-wake-gpios = <&gpx0 6 GPIO_ACTIVE_HIGH>;
                hwid = "PIT TEST A-A 7848";
                lazy-init = <1>;
        };
@@ -32,7 +32,7 @@
                mem-manuf = "samsung";
                mem-type = "ddr3";
                clock-frequency = <800000000>;
-               arm-frequency = <1700000000>;
+               arm-frequency = <900000000>;
        };
 
        tmu@10060000 {
                        spi-half-duplex;
                        spi-max-timeout-ms = <1100>;
                        spi-frame-header = <0xec>;
-                       ec-interrupt = <&gpio 93 1>; /* GPX1_5 */
+                       ec-interrupt = <&gpx1 5 GPIO_ACTIVE_LOW>;
 
                        /*
                         * This describes the flash memory within the EC. Note
        };
 
        xhci@12000000 {
-               samsung,vbus-gpio = <&gpio 0x40 0>; /* H00 */
+               samsung,vbus-gpio = <&gph0 0 GPIO_ACTIVE_HIGH>;
        };
 
        xhci@12400000 {
-               samsung,vbus-gpio = <&gpio 0x41 0>; /* H01 */
+               samsung,vbus-gpio = <&gph0 1 GPIO_ACTIVE_HIGH>;
        };
 
        fimd@14400000 {
index 81ad212e71291906f6d3b16ea020cc41e68ee727..51ff266d760a69c56d12bd69b021b3c7ed5de8c0 100644 (file)
@@ -57,7 +57,7 @@
        };
 
        sdhci@78000400 {
-               cd-gpios = <&gpio 170 1>; /* gpio PV2 */
+               cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
                bus-width = <4>;
                status = "okay";
        };
@@ -68,8 +68,7 @@
        };
 
        usb@7d008000 {
-               /* SPDIF_IN: USB_VBUS_EN1 */
-               nvidia,vbus-gpio = <&gpio 86 0>;
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_HIGH>;
                status = "okay";
        };
 };
index 51fef54d570e2ebc6fc510cbf86fdab7ed04c3fa..e7b66d81a499e683bba22b21110798f75dcb9918 100644 (file)
 
        sdhci@700b0400 {
                status = "okay";
-               cd-gpios = <&gpio 170 1>; /* gpio PV2 */
-               power-gpios = <&gpio 136 0>; /* gpio PR0 */
+               cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
+               power-gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>;
+               wp-gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
        usb@7d000000 {
                status = "okay";
                dr_mode = "otg";
-               nvidia,vbus-gpio = <&gpio 108 0>; /* gpio PN4, USB_VBUS_EN0 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
        };
 
        usb@7d008000 {
                status = "okay";
-               nvidia,vbus-gpio = <&gpio 109 0>; /* gpio PN5, USB_VBUS_EN1 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 5) GPIO_ACTIVE_HIGH>;
        };
 
        regulators {
index f7ccfc5ddd4bf29a6b6f1c86354b55c67513721e..9e93cf90c76e68c8780a1014e4af7439f5b12cf6 100644 (file)
@@ -72,8 +72,9 @@
 
        sdhci@700b0400 {
                status = "okay";
-               cd-gpios = <&gpio 170 0>; /* gpio PV2 */
-               power-gpios = <&gpio 136 0>; /* gpio PR0 */
+               cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>;
+               wp-gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
                bus-width = <4>;
        };
 
        usb@7d000000 {
                status = "okay";
                dr_mode = "otg";
-               nvidia,vbus-gpio = <&gpio 108 0>; /* gpio PN4, USB_VBUS_EN0 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
        };
 
        usb@7d008000 {
                status = "okay";
-               nvidia,vbus-gpio = <&gpio 109 0>; /* gpio PN5, USB_VBUS_EN1 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 5) GPIO_ACTIVE_HIGH>;
        };
 };
index 7cf08f4101f3ae072cda3abc37e55e44a500e101..3131b9201b7029f012c3e4f80df83663c4697d94 100644 (file)
        };
 
        usb@c5004000 {
-               nvidia,phy-reset-gpio = <&gpio 169 0>; /* PV1 */
-               nvidia,vbus-gpio = <&gpio 217 0>; /* PBB1 */
+               nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>;
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>;
        };
 
        usb@c5008000 {
-               nvidia,vbus-gpio = <&gpio 178 1>; /* PW2 low-active */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
        };
 
        nand-controller@70008000 {
-               nvidia,wp-gpios = <&gpio 144 0>; /* PS0 */
+               nvidia,wp-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_HIGH>;
                nvidia,width = <8>;
                nvidia,timing = <15 100 25 80 25 10 15 10 100>;
 
@@ -43,7 +43,7 @@
 
        sdhci@c8000600 {
                status = "okay";
-               cd-gpios = <&gpio 23 1>; /* gpio PC7 */
+               cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>;
                bus-width = <4>;
        };
 };
index 982a14c61c498ff26409b99abb9a61c07586d332..e6e42295e216620e7ad28dbd3ad0245410de30b4 100644 (file)
@@ -37,7 +37,7 @@
        };
 
        nand-controller@70008000 {
-               nvidia,wp-gpios = <&gpio 23 0>;         /* PC7 */
+               nvidia,wp-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_HIGH>;
                nvidia,width = <8>;
                nvidia,timing = <26 100 20 80 20 10 12 10 70>;
                nand@0 {
        };
 
        usb@c5004000 {
-               nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
+               nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) 0>;
        };
 
        sdhci@c8000200 {
                status = "okay";
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 57 0>; /* gpio PH1 */
-               power-gpios = <&gpio 155 0>; /* gpio PT3 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
        sdhci@c8000600 {
                status = "okay";
-               cd-gpios = <&gpio 58 1>; /* gpio PH2 */
-               wp-gpios = <&gpio 59 0>; /* gpio PH3 */
-               power-gpios = <&gpio 70 0>; /* gpio PI6 */
+               cd-gpios = <&gpio TEGRA_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_HIGH>;
                bus-width = <8>;
        };
 
                vsyncx-active-high;
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 0 0>;
-               nvidia,backlight-enable-gpios = <&gpio 13 0>;   /* PB5 */
-               nvidia,lvds-shutdown-gpios = <&gpio 10 0>;      /* PB2 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>;     /* PW0 */
-               nvidia,panel-vdd-gpios = <&gpio 22 0>;          /* PC6 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(B, 5)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(B, 2)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,panel-vdd-gpios = <&gpio TEGRA_GPIO(C, 6)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <0 0 200 0 0>;
        };
 };
index be2ed42dbd74e67233f145a48f483977a36b7e92..b6b57abdef94f9b2f79a7a44c860bab3919c8e3e 100644 (file)
 
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 0 500000>;
-               nvidia,backlight-enable-gpios = <&gpio 13 0>; /* PB5 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>; /* PW0 */
-               nvidia,lvds-shutdown-gpios = <&gpio 10 0>; /* PB2 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(B, 5)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(B, 2)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <0 0 0 0>;
        };
 };
index 9d735b5e6bf6541b3dbfb0974cc3ee668d129d02..16381c3a4c78777e39812e205361797aee3d984b 100644 (file)
@@ -61,9 +61,9 @@
 
        sdhci@c8000000 {
                status = "okay";
-               cd-gpios = <&gpio 173 1>; /* gpio PV5 */
-               wp-gpios = <&gpio 57 0>; /* gpio PH1 */
-               power-gpios = <&gpio 169 0>; /* gpio PV1 */
+               cd-gpios = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
                hsync-active-high;
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 0 0>;
-               nvidia,backlight-enable-gpios = <&gpio 164 0>;  /* PU4 */
-               nvidia,lvds-shutdown-gpios = <&gpio 102 0>;     /* PM6 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>;     /* PW0 */
-               nvidia,panel-vdd-gpios = <&gpio 4 0>;           /* PA4 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(U, 4)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(M, 6)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,panel-vdd-gpios = <&gpio TEGRA_GPIO(A, 4)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <400 4 203 17 15>;
        };
 };
index 43b9911c896a0aed9dbc6bca8f0e3532b8093cf5..10f399284ae189ca9bee5c5d438dba3c7085bebc 100644 (file)
@@ -65,7 +65,7 @@
        };
 
        nand-controller@70008000 {
-               nvidia,wp-gpios = <&gpio 59 0>;         /* PH3 */
+               nvidia,wp-gpios = <&gpio TEGRA_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
                nvidia,width = <8>;
                nvidia,timing = <26 100 20 80 20 10 12 10 70>;
                nand@0 {
        };
 
        usb@c5000000 {
-               nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
                dr_mode = "otg";
        };
 
 
        sdhci@c8000400 {
                status = "okay";
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 57 0>; /* gpio PH1 */
-               power-gpios = <&gpio 70 0>; /* gpio PI6 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
                hsync-active-high;
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 2 0>;
-               nvidia,backlight-enable-gpios = <&gpio 28 0>;   /* PD4 */
-               nvidia,lvds-shutdown-gpios = <&gpio 10 0>;      /* PB2 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>;     /* PW0 */
-               nvidia,panel-vdd-gpios = <&gpio 22 0>;          /* PC6 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(D, 4)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(B, 2)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,panel-vdd-gpios = <&gpio TEGRA_GPIO(C, 6)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <400 4 203 17 15>;
        };
 };
index f379622c944963cba0a0c568cac440bc1dc35eb3..78449e613379dc12ebc8914fdd5f8957c8150ac0 100644 (file)
@@ -14,7 +14,8 @@
                        pll-supply = <&hdmi_pll_reg>;
 
                        nvidia,ddc-i2c-bus = <&hdmi_ddc>;
-                       nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
+                       nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
+                               GPIO_ACTIVE_HIGH>;
                };
        };
 
        };
 
        nand-controller@70008000 {
-               nvidia,wp-gpios = <&gpio 23 0>; /* PC7 */
+               nvidia,wp-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_HIGH>;
                nvidia,width = <8>;
                nvidia,timing = <26 100 20 80 20 10 12 10 70>;
 
        };
 
        sdhci@c8000600 {
-               cd-gpios = <&gpio 58 1>; /* gpio PH2 */
-               wp-gpios = <&gpio 59 0>; /* gpio PH3 */
+               cd-gpios = <&gpio TEGRA_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
                status = "okay";
        };
index e99bd447c1b72bc71bb36a1bc06abec3a0ff93eb..94ba6dc2d41d65e6e9c85873594ccefea979f54d 100644 (file)
 
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 0 500000>;
-               nvidia,backlight-enable-gpios = <&gpio 13 0>; /* PB5 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>; /* PW0 */
-               nvidia,lvds-shutdown-gpios = <&gpio 10 0>; /* PB2 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(B, 5)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(B, 2)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <0 0 0 0>;
        };
 };
index 1637cbd58e32ec4e6f7a4eaf526b348d2fc64f45..27b118f212ad7bec41953dd6e2c18c8da8c431b9 100644 (file)
@@ -62,7 +62,7 @@
        };
 
        usb@c5000000 {
-               nvidia,vbus-gpio = <&gpio 170 0>; /* PV2 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
        };
 
        usb@c5004000 {
@@ -76,8 +76,8 @@
 
        sdhci@c8000600 {
                status = "okay";
-               cd-gpios = <&gpio 121 1>; /* gpio PP1 */
-               wp-gpios = <&gpio 122 0>; /* gpio PP2 */
+               cd-gpios = <&gpio TEGRA_GPIO(P, 1) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(P, 2) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
-                       gpio = <&gpio TEGRA_GPIO(V, 2) 0>;
+                       gpio = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
                        regulator-always-on;
                        regulator-boot-on;
                };
index 68122039180a378c7b20f9f31dbe77ab37a0ed82..939e567d1334f8de272f8a35d4cec7ba142783a6 100644 (file)
@@ -61,9 +61,9 @@
 
        sdhci@c8000400 {
                status = "okay";
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 57 0>; /* gpio PH1 */
-               power-gpios = <&gpio 70 0>; /* gpio PI6 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
                vsync-active-high;
                nvidia,bits-per-pixel = <16>;
                nvidia,pwm = <&pwm 2 0>;
-               nvidia,backlight-enable-gpios = <&gpio 28 0>;   /* PD4 */
-               nvidia,lvds-shutdown-gpios = <&gpio 10 0>;      /* PB2 */
-               nvidia,backlight-vdd-gpios = <&gpio 176 0>;     /* PW0 */
-               nvidia,panel-vdd-gpios = <&gpio 22 0>;          /* PC6 */
+               nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(D, 4)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,lvds-shutdown-gpios = <&gpio TEGRA_GPIO(B, 2)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,backlight-vdd-gpios = <&gpio TEGRA_GPIO(W, 0)
+                                                       GPIO_ACTIVE_HIGH>;
+               nvidia,panel-vdd-gpios = <&gpio TEGRA_GPIO(C, 6)
+                                                       GPIO_ACTIVE_HIGH>;
                nvidia,panel-timings = <0 0 200 0 0>;
        };
 };
index 4fd2496dbc57f07e5c42771814c0ac5df04a34aa..c4a28eb427deff1bb0c79ada0d1fa857f8acd3da 100644 (file)
@@ -66,7 +66,7 @@
 
        sdhci@c8000400 {
                status = "okay";
-               wp-gpios = <&gpio 173 0>; /* gpio PV5 */
+               wp-gpios = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_HIGH>;
                bus-width = <8>;
        };
 
index 5bad3e77698ce81f9ad3f2aef9e6a5052e5b5bf4..15db0f275b6d3740caa1756e9394de6c93764674 100644 (file)
        sdhci@78000000 {
                status = "okay";
                bus-width = <4>;
-               cd-gpios = <&gpio 229 1>; /* PCC5, SD1_CD# */
+               cd-gpios = <&gpio TEGRA_GPIO(CC, 5) GPIO_ACTIVE_HIGH>;
        };
 
        sdhci@78000400 {
                status = "okay";
                bus-width = <8>;
-               cd-gpios = <&gpio 171 1>; /* PV3, MMC1_CD# */
+               cd-gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
        };
 
        sdhci@78000600 {
        usb@7d000000 {
                status = "okay";
                dr_mode = "peripheral";
-               nvidia,vbus-gpio = <&gpio 157 0>;       /* PT5, USBO1_EN */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
        };
 
        /* EHCI instance 1: USB2_DP/N -> USBH2_DP/N */
        usb@7d004000 {
                status = "okay";
-               nvidia,vbus-gpio = <&gpio 233 0>;       /* PDD1, USBH_EN */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
                phy_type = "utmi";
        };
 
        /* EHCI instance 2: USB3_DP/N -> USBH3_DP/N */
        usb@7d008000 {
                status = "okay";
-               nvidia,vbus-gpio = <&gpio 233 0>;       /* PDD1, USBH_EN */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
        };
 
        regulators {
index 5903af68384b80f6c0f8373a6e3a1b8b420e69fa..ae836363ab5242550886196ea1d7a884218a83e6 100644 (file)
 
        sdhci@78000000 {
                status = "okay";
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 155 0>; /* gpio PT3 */
-               power-gpios = <&gpio 31 0>; /* gpio PD7 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(D, 7) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
        usb@7d000000 {
                status = "okay";
                dr_mode = "otg";
-               nvidia,vbus-gpio = <&gpio 238 0>; /* gpio DD6, PEX_L1_CLKREQ */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 6) GPIO_ACTIVE_HIGH>;
        };
 
        usb@7d008000 {
-               nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 4) GPIO_ACTIVE_HIGH>;
                status = "okay";
        };
 
index e13d0fb467137766fcfe5677ca1cf64d889a82de..23ca141df2a55b9634a5e034a3a5c7dfddde79a4 100644 (file)
 
        sdhci@78000000 {
                status = "okay";
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 155 0>; /* gpio PT3 */
-               power-gpios = <&gpio 31 0>; /* gpio PD7 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>;
+               power-gpios = <&gpio TEGRA_GPIO(D, 7) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
        };
 
        usb@7d008000 {
-               nvidia,vbus-gpio = <&gpio 236 0>;       /* PDD4 */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 4) GPIO_ACTIVE_HIGH>;
                status = "okay";
        };
 
index 37b6abd52f05480018af45c46458b56aa4fd664f..6cd1902f11bcb563b8daab2ee7792325f9913628 100644 (file)
@@ -64,7 +64,7 @@
        sdhci@78000200 {
                status = "okay";
                bus-width = <4>;
-               cd-gpios = <&gpio 23 1>; /* PC7, MMCD */
+               cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>;
        };
 
        sdhci@78000600 {
        usb@7d004000 {
                status = "okay";
                phy_type = "utmi";
-               nvidia,vbus-gpio = <&gpio 234 0>;       /* PDD2, VBUS_LAN */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(DD, 2) GPIO_ACTIVE_HIGH>;
        };
 
        /* EHCI instance 2: USB3_DP/N -> USBH_P/N */
        usb@7d008000 {
                status = "okay";
-               nvidia,vbus-gpio = <&gpio 178 1>;       /* PW2, USBH_PEN */
+               nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
        };
 };
index c73afef34ada174178a4aeaeb19b40ef11544842..8eff627f3d0ba546309d2127323aa2bbbe5aca99 100644 (file)
@@ -55,8 +55,8 @@
 
        /* SD slot on the base board */
        sdhci@78000400 {
-               cd-gpios = <&gpio 69 1>; /* gpio PI5 */
-               wp-gpios = <&gpio 67 0>; /* gpio PI3 */
+               cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+               wp-gpios = <&gpio TEGRA_GPIO(I, 3) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
index 8dd69b3c80ee3022cb657720f217b3aaf8eb4568..b94b56cba73d3d8ef5f569eb9c126f40d2033fdc 100644 (file)
@@ -219,6 +219,12 @@ struct cm_dpll {
        unsigned int resv4[2];
        unsigned int clklcdcpixelclk;   /* offset 0x34 */
 };
+
+struct prm_device_inst {
+       unsigned int prm_rstctrl;
+       unsigned int prm_rsttime;
+       unsigned int prm_rstst;
+};
 #else
 /* Encapsulating core pll registers */
 struct cm_wkuppll {
@@ -386,6 +392,11 @@ struct cm_device_inst {
        unsigned int cm_dll_ctrl;
 };
 
+struct prm_device_inst {
+       unsigned int prm_rstctrl;
+       unsigned int prm_rstst;
+};
+
 struct cm_dpll {
        unsigned int resv1;
        unsigned int clktimer2clk;      /* offset 0x04 */
index c67a0801a9e5ef3e9b6fcd370839ead96029516e..d1aed58503fcd8ccb8ff313168650e31e0f188fd 100644 (file)
@@ -39,6 +39,7 @@
 /* VTP Base address */
 #define VTP0_CTRL_ADDR                 0x44E10E0C
 #define VTP1_CTRL_ADDR                 0x48140E10
+#define PRM_DEVICE_INST                        0x44E00F00
 
 /* DDR Base address */
 #define DDR_PHY_CMD_ADDR               0x44E12000
index efdecf4613687b363d95e7884d178ab87e2828d9..29e3816c1a531dca487c0c1b74ddc6238fb6772b 100644 (file)
@@ -71,6 +71,7 @@
 #define PRM_PER_USBPHYOCP2SCP1_CLKCTRL (CM_PER + 0x5c0)
 #define USBPHYOCPSCP_MODULE_EN (1 << 1)
 #define CM_DEVICE_INST                 0x44df4100
+#define PRM_DEVICE_INST                        0x44df4000
 
 /* Control status register */
 #define CTRL_CRYSTAL_FREQ_SRC_MASK             (1 << 31)
index 6f540d23af6330337cf6235d07dd4cb300072e06..38b5012fce5cc17b828310b9c352677ab5bba060 100644 (file)
@@ -31,7 +31,7 @@ static struct usba_ep_data usba_udc_ep[] = {
        EP("ep5", 5, 1024, 3, 1, 1),
        EP("ep6", 6, 1024, 3, 1, 1),
 };
-#elif defined(CONFIG_SAMA5D3)
+#elif defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4)
 static struct usba_ep_data usba_udc_ep[] = {
        EP("ep0", 0, 64, 1, 0, 0),
        EP("ep1", 1, 1024, 3, 1, 0),
index 0b91ef658ca96a0b259f661c7f3cd10bd5520eb5..d0ae7575dae098bd01cb45ed92eee978d6b4768b 100644 (file)
@@ -23,6 +23,9 @@ enum {
        /* Flags for SROM controller */
        PINMUX_FLAG_BANK        = 3 << 0,       /* bank number (0-3) */
        PINMUX_FLAG_16BIT       = 1 << 2,       /* 16-bit width */
+
+       /* Flags for I2C */
+       PINMUX_FLAG_HS_MODE     = 1 << 1,       /* I2C High Speed Mode */
 };
 
 /**
index 5e934da79738a1b62ff289f81b662b0d9dba77b0..791551841c71ac81b7e203ce0da9af3992102a47 100644 (file)
 #define CONFIG_SYS_FSL_DDR_VER                 FSL_DDR_VER_5_0
 #define CONFIG_SYS_FSL_SEC_COMPAT              5
 #define CONFIG_USB_MAX_CONTROLLER_COUNT                1
+#define CONFIG_SYS_FSL_ERRATUM_A008378
 #else
 #error SoC not defined
 #endif
 
+#define FSL_IFC_COMPAT         "fsl,ifc"
+#define FSL_QSPI_COMPAT                "fsl,ls1-qspi"
+#define FSL_DSPI_COMPAT                "fsl,vf610-dspi"
+
 #endif /* _ASM_ARMV7_LS102XA_CONFIG_ */
diff --git a/arch/arm/include/asm/arch-ls102xa/gpio.h b/arch/arm/include/asm/arch-ls102xa/gpio.h
new file mode 100644 (file)
index 0000000..b704436
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Dummy header file to enable CONFIG_OF_CONTROL.
+ * If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
+ * It includes <asm/arch/gpio.h> via <asm/gpio.h>, so those SoCs that enable
+ * OF_CONTROL must have arch/gpio.h.
+ */
+
+#ifndef __ASM_ARCH_LS102XA_GPIO_H_
+#define __ASM_ARCH_LS102XA_GPIO_H_
+
+#endif
index 697d4ca4894b373d51bc7a44ad73b62402935519..f70d568d467841784e77f4b89e8c9fef77038c42 100644 (file)
@@ -105,6 +105,8 @@ struct ccsr_gur {
 
 #define SCFG_ETSECDMAMCR_LE_BD_FR      0xf8001a0f
 #define SCFG_ETSECCMCR_GE2_CLK125      0x04000000
+#define SCFG_ETSECCMCR_GE0_CLK125      0x00000000
+#define SCFG_ETSECCMCR_GE1_CLK125      0x08000000
 #define SCFG_PIXCLKCR_PXCKEN           0x80000000
 #define SCFG_QSPI_CLKSEL               0xc0100000
 
@@ -456,6 +458,8 @@ struct ccsr_ddr {
 #define CCI400_CTRLORD_TERM_BARRIER    0x00000008
 #define CCI400_CTRLORD_EN_BARRIER      0
 #define CCI400_SHAORD_NON_SHAREABLE    0x00000002
+#define CCI400_DVM_MESSAGE_REQ_EN      0x00000002
+#define CCI400_SNOOP_REQ_EN            0x00000001
 
 /* CCI-400 registers */
 struct ccsr_cci400 {
diff --git a/arch/arm/include/asm/arch-pantheon/gpio.h b/arch/arm/include/asm/arch-pantheon/gpio.h
new file mode 100644 (file)
index 0000000..e69de29
index 132d58c117a7b8af76b216455b4d4ee2e00edb94..748b80254602d1c5e816b7b2c668836d364bdb0c 100644 (file)
 #define MSTP10_BITS    0xFFFEFFE0
 #define MSTP11_BITS    0x00000000
 
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI1_BASE 0xEE120000
+#define CONFIG_SYS_SH_SDHI2_BASE 0xEE140000
+#define CONFIG_SYS_SH_SDHI3_BASE 0xEE160000
+#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 4
+
 #define R8A7790_CUT_ES2X       2
 #define IS_R8A7790_ES2()       \
        (rmobile_get_cpu_rev_integer() == R8A7790_CUT_ES2X)
index d2cbcd761dceee6d459c0a34aefd7afb83b1d299..1d06b651f4852e2f5f82e50a94a0e1654fcf88ba 100644 (file)
 /* SH-I2C */
 #define CONFIG_SYS_I2C_SH_BASE2        0xE60B0000
 
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI1_BASE 0xEE140000
+#define CONFIG_SYS_SH_SDHI2_BASE 0xEE160000
+#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 3
+
 #define DBSC3_1_QOS_R0_BASE    0xE67A1000
 #define DBSC3_1_QOS_R1_BASE    0xE67A1100
 #define DBSC3_1_QOS_R2_BASE    0xE67A1200
index 1abdeb7450b31ec0a4b3e682ca3cc2547829b64f..3efc62a1a90c6f18786cb382b35c19adbf442682 100644 (file)
 /* SH-I2C */
 #define CONFIG_SYS_I2C_SH_BASE2        0xE60B0000
 
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI1_BASE 0xEE140000
+#define CONFIG_SYS_SH_SDHI2_BASE 0xEE160000
+#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 3
+
 #define DBSC3_1_QOS_R0_BASE    0xE67A1000
 #define DBSC3_1_QOS_R1_BASE    0xE67A1100
 #define DBSC3_1_QOS_R2_BASE    0xE67A1200
index d7c9004772aa1912332e817438b220fe2c13cb01..6d11fa479b7d7340629bed8718f871020418f5f1 100644 (file)
@@ -27,4 +27,9 @@
 #define MSTP10_BITS    0xFFFEFFE0
 #define MSTP11_BITS    0x000001C0
 
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI1_BASE 0xEE140000
+#define CONFIG_SYS_SH_SDHI2_BASE 0xEE160000
+#define CONFIG_SYS_SH_SDHI_NR_CHANNEL 3
+
 #endif /* __ASM_ARCH_R8A7794_H */
index 23c4bba6edec412378aabe636f58f1f660fa50a3..d594cd77c176532a79fb5629369ed72886bd476c 100644 (file)
@@ -82,6 +82,9 @@
 #define CONFIG_SYS_RCAR_I2C2_BASE      0xE6530000
 #define CONFIG_SYS_RCAR_I2C3_BASE      0xE6540000
 
+/* SDHI */
+#define CONFIG_SYS_SH_SDHI0_BASE       0xEE100000
+
 #define S3C_BASE               0xE6784000
 #define S3C_INT_BASE           0xE6784A00
 #define S3C_MEDIA_BASE         0xE6784B00
diff --git a/arch/arm/include/asm/arch-rmobile/sh_sdhi.h b/arch/arm/include/asm/arch-rmobile/sh_sdhi.h
new file mode 100644 (file)
index 0000000..057bf3f
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * drivers/mmc/sh-sdhi.h
+ *
+ * SD/MMC driver for Reneas rmobile ARM SoCs
+ *
+ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ * Copyright (C) 2008-2009 Renesas Solutions Corp.
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#ifndef _SH_SDHI_H
+#define _SH_SDHI_H
+
+#define SDHI_CMD                       (0x0000 >> 1)
+#define SDHI_PORTSEL                   (0x0004 >> 1)
+#define SDHI_ARG0                      (0x0008 >> 1)
+#define SDHI_ARG1                      (0x000C >> 1)
+#define SDHI_STOP                      (0x0010 >> 1)
+#define SDHI_SECCNT                    (0x0014 >> 1)
+#define SDHI_RSP00                     (0x0018 >> 1)
+#define SDHI_RSP01                     (0x001C >> 1)
+#define SDHI_RSP02                     (0x0020 >> 1)
+#define SDHI_RSP03                     (0x0024 >> 1)
+#define SDHI_RSP04                     (0x0028 >> 1)
+#define SDHI_RSP05                     (0x002C >> 1)
+#define SDHI_RSP06                     (0x0030 >> 1)
+#define SDHI_RSP07                     (0x0034 >> 1)
+#define SDHI_INFO1                     (0x0038 >> 1)
+#define SDHI_INFO2                     (0x003C >> 1)
+#define SDHI_INFO1_MASK                        (0x0040 >> 1)
+#define SDHI_INFO2_MASK                        (0x0044 >> 1)
+#define SDHI_CLK_CTRL                  (0x0048 >> 1)
+#define SDHI_SIZE                      (0x004C >> 1)
+#define SDHI_OPTION                    (0x0050 >> 1)
+#define SDHI_ERR_STS1                  (0x0058 >> 1)
+#define SDHI_ERR_STS2                  (0x005C >> 1)
+#define SDHI_BUF0                      (0x0060 >> 1)
+#define SDHI_SDIO_MODE                 (0x0068 >> 1)
+#define SDHI_SDIO_INFO1                        (0x006C >> 1)
+#define SDHI_SDIO_INFO1_MASK           (0x0070 >> 1)
+#define SDHI_CC_EXT_MODE               (0x01B0 >> 1)
+#define SDHI_SOFT_RST                  (0x01C0 >> 1)
+#define SDHI_VERSION                   (0x01C4 >> 1)
+#define SDHI_HOST_MODE                 (0x01C8 >> 1)
+#define SDHI_SDIF_MODE                 (0x01CC >> 1)
+#define SDHI_EXT_SWAP                  (0x01E0 >> 1)
+#define SDHI_SD_DMACR                  (0x0324 >> 1)
+
+/* SDHI CMD VALUE */
+#define CMD_MASK                       0x0000ffff
+#define SDHI_APP                       0x0040
+#define SDHI_SD_APP_SEND_SCR           0x0073
+#define SDHI_SD_SWITCH                 0x1C06
+
+/* SDHI_PORTSEL */
+#define USE_1PORT                      (1 << 8) /* 1 port */
+
+/* SDHI_ARG */
+#define ARG0_MASK                      0x0000ffff
+#define ARG1_MASK                      0x0000ffff
+
+/* SDHI_STOP */
+#define STOP_SEC_ENABLE                        (1 << 8)
+
+/* SDHI_INFO1 */
+#define INFO1_RESP_END                 (1 << 0)
+#define INFO1_ACCESS_END               (1 << 2)
+#define INFO1_CARD_RE                  (1 << 3)
+#define INFO1_CARD_IN                  (1 << 4)
+#define INFO1_ISD0CD                   (1 << 5)
+#define INFO1_WRITE_PRO                        (1 << 7)
+#define INFO1_DATA3_CARD_RE            (1 << 8)
+#define INFO1_DATA3_CARD_IN            (1 << 9)
+#define INFO1_DATA3                    (1 << 10)
+
+/* SDHI_INFO2 */
+#define INFO2_CMD_ERROR                        (1 << 0)
+#define INFO2_CRC_ERROR                        (1 << 1)
+#define INFO2_END_ERROR                        (1 << 2)
+#define INFO2_TIMEOUT                  (1 << 3)
+#define INFO2_BUF_ILL_WRITE            (1 << 4)
+#define INFO2_BUF_ILL_READ             (1 << 5)
+#define INFO2_RESP_TIMEOUT             (1 << 6)
+#define INFO2_SDDAT0                   (1 << 7)
+#define INFO2_BRE_ENABLE               (1 << 8)
+#define INFO2_BWE_ENABLE               (1 << 9)
+#define INFO2_CBUSY                    (1 << 14)
+#define INFO2_ILA                      (1 << 15)
+#define INFO2_ALL_ERR                  (0x807f)
+
+/* SDHI_INFO1_MASK */
+#define INFO1M_RESP_END                        (1 << 0)
+#define INFO1M_ACCESS_END              (1 << 2)
+#define INFO1M_CARD_RE                 (1 << 3)
+#define INFO1M_CARD_IN                 (1 << 4)
+#define INFO1M_DATA3_CARD_RE           (1 << 8)
+#define INFO1M_DATA3_CARD_IN           (1 << 9)
+#define INFO1M_ALL                     (0xffff)
+#define INFO1M_SET                     (INFO1M_RESP_END |      \
+                                       INFO1M_ACCESS_END |     \
+                                       INFO1M_DATA3_CARD_RE |  \
+                                       INFO1M_DATA3_CARD_IN)
+
+/* SDHI_INFO2_MASK */
+#define INFO2M_CMD_ERROR               (1 << 0)
+#define INFO2M_CRC_ERROR               (1 << 1)
+#define INFO2M_END_ERROR               (1 << 2)
+#define INFO2M_TIMEOUT                 (1 << 3)
+#define INFO2M_BUF_ILL_WRITE           (1 << 4)
+#define INFO2M_BUF_ILL_READ            (1 << 5)
+#define INFO2M_RESP_TIMEOUT            (1 << 6)
+#define INFO2M_BRE_ENABLE              (1 << 8)
+#define INFO2M_BWE_ENABLE              (1 << 9)
+#define INFO2M_ILA                     (1 << 15)
+#define INFO2M_ALL                     (0xffff)
+#define INFO2M_ALL_ERR                 (0x807f)
+
+/* SDHI_CLK_CTRL */
+#define CLK_ENABLE                     (1 << 8)
+
+/* SDHI_OPTION */
+#define OPT_BUS_WIDTH_1                        (1 << 15)       /* bus width = 1 bit */
+
+/* SDHI_ERR_STS1 */
+#define ERR_STS1_CRC_ERROR             ((1 << 11) | (1 << 10) | (1 << 9) | \
+                                       (1 << 8) | (1 << 5))
+#define ERR_STS1_CMD_ERROR             ((1 << 4) | (1 << 3) | (1 << 2) | \
+                                       (1 << 1) | (1 << 0))
+
+/* SDHI_ERR_STS2 */
+#define ERR_STS2_RES_TIMEOUT           (1 << 0)
+#define ERR_STS2_RES_STOP_TIMEOUT      ((1 << 0) | (1 << 1))
+#define ERR_STS2_SYS_ERROR             ((1 << 6) | (1 << 5) | (1 << 4) | \
+                                       (1 << 3) | (1 << 2) | (1 << 1) | \
+                                       (1 << 0))
+
+/* SDHI_SDIO_MODE */
+#define SDIO_MODE_ON                   (1 << 0)
+#define SDIO_MODE_OFF                  (0 << 0)
+
+/* SDHI_SDIO_INFO1 */
+#define SDIO_INFO1_IOIRQ               (1 << 0)
+#define SDIO_INFO1_EXPUB52             (1 << 14)
+#define SDIO_INFO1_EXWT                        (1 << 15)
+
+/* SDHI_SDIO_INFO1_MASK */
+#define SDIO_INFO1M_CLEAR              ((1 << 1) | (1 << 2))
+#define SDIO_INFO1M_ON                 ((1 << 15) | (1 << 14) | (1 << 2) | \
+                                        (1 << 1) | (1 << 0))
+
+/* SDHI_EXT_SWAP */
+#define SET_SWAP                       ((1 << 6) | (1 << 7))   /* SWAP */
+
+/* SDHI_SOFT_RST */
+#define SOFT_RST_ON                    (0 << 0)
+#define SOFT_RST_OFF                   (1 << 0)
+
+#define        CLKDEV_SD_DATA                  25000000        /* 25 MHz */
+#define CLKDEV_HS_DATA                 50000000        /* 50 MHz */
+#define CLKDEV_MMC_DATA                        20000000        /* 20MHz */
+#define        CLKDEV_INIT                     400000          /* 100 - 400 KHz */
+
+/* For quirk */
+#define SH_SDHI_QUIRK_16BIT_BUF                (1)
+int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks);
+
+#endif /* _SH_SDHI_H */
index 505c363e46e1af460837262cff52a8d379f83e1f..3e5d99908192e6b8e99fbada1835281006481fe2 100644 (file)
@@ -17,6 +17,8 @@
 /* clock control module regs definition */
 #if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
 #include <asm/arch/clock_sun6i.h>
+#elif defined(CONFIG_MACH_SUN9I)
+#include <asm/arch/clock_sun9i.h>
 #else
 #include <asm/arch/clock_sun4i.h>
 #endif
 #ifndef __ASSEMBLY__
 int clock_init(void);
 int clock_twi_onoff(int port, int state);
-void clock_set_pll1(unsigned int hz);
-void clock_set_pll3(unsigned int hz);
-unsigned int clock_get_pll5p(void);
-unsigned int clock_get_pll6(void);
 void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz);
 void clock_init_safe(void);
 void clock_init_uart(void);
index 84a9a2bdbc312e6e97a41887b2a35632ddb23bfe..d297ed0f73e434cabcb1345e7c439bcb1639b70e 100644 (file)
@@ -186,6 +186,7 @@ struct sunxi_ccm_reg {
 
 /* ahb clock gate bit offset (second register) */
 #define AHB_GATE_OFFSET_GMAC           17
+#define AHB_GATE_OFFSET_DE_FE0         14
 #define AHB_GATE_OFFSET_DE_BE0         12
 #define AHB_GATE_OFFSET_HDMI           11
 #define AHB_GATE_OFFSET_LCD1           5
@@ -266,7 +267,10 @@ struct sunxi_ccm_reg {
 #define CCM_MMC_CTRL_PLL5              (0x2 << 24)
 #define CCM_MMC_CTRL_ENABLE            (0x1 << 31)
 
+#define CCM_DRAM_GATE_OFFSET_DE_FE1    24 /* Note the order of FE1 and */
+#define CCM_DRAM_GATE_OFFSET_DE_FE0    25 /* FE0 is swapped ! */
 #define CCM_DRAM_GATE_OFFSET_DE_BE0    26
+#define CCM_DRAM_GATE_OFFSET_DE_BE1    27
 
 #define CCM_LCD_CH0_CTRL_PLL3          (0 << 24)
 #define CCM_LCD_CH0_CTRL_PLL7          (1 << 24)
@@ -301,6 +305,8 @@ struct sunxi_ccm_reg {
 #define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
 #define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2)
 #define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2)
+#define CCM_GMAC_CTRL_RX_CLK_DELAY(x)  ((x) << 5)
+#define CCM_GMAC_CTRL_TX_CLK_DELAY(x)  ((x) << 10)
 
 #define CCM_USB_CTRL_PHY0_RST (0x1 << 0)
 #define CCM_USB_CTRL_PHY1_RST (0x1 << 1)
@@ -320,4 +326,11 @@ struct sunxi_ccm_reg {
 #define CCM_DE_CTRL_RST                        (1 << 30)
 #define CCM_DE_CTRL_GATE               (1 << 31)
 
+#ifndef __ASSEMBLY__
+void clock_set_pll1(unsigned int hz);
+void clock_set_pll3(unsigned int hz);
+unsigned int clock_get_pll5p(void);
+unsigned int clock_get_pll6(void);
+#endif
+
 #endif /* _SUNXI_CLOCK_SUN4I_H */
index 4711260c1eef58196d40c46f856c3805012a2824..8a803851e481cea87a7b40c3bc4252a79a5b0fe6 100644 (file)
@@ -243,6 +243,8 @@ struct sunxi_ccm_reg {
 #define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
 #define CCM_GMAC_CTRL_GPIT_MII         (0x0 << 2)
 #define CCM_GMAC_CTRL_GPIT_RGMII       (0x1 << 2)
+#define CCM_GMAC_CTRL_RX_CLK_DELAY(x)  ((x) << 5)
+#define CCM_GMAC_CTRL_TX_CLK_DELAY(x)  ((x) << 10)
 
 #define MDFS_CLK_DEFAULT               0x81000002 /* PLL6 / 3 */
 
@@ -320,6 +322,11 @@ struct sunxi_ccm_reg {
 #define CCM_DE_CTRL_PLL10              (5 << 24)
 #define CCM_DE_CTRL_GATE               (1 << 31)
 
+#ifndef __ASSEMBLY__
+void clock_set_pll1(unsigned int hz);
+void clock_set_pll3(unsigned int hz);
 void clock_set_pll5(unsigned int clk, bool sigma_delta_enable);
+unsigned int clock_get_pll6(void);
+#endif
 
 #endif /* _SUNXI_CLOCK_SUN6I_H */
diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun9i.h b/arch/arm/include/asm/arch-sunxi/clock_sun9i.h
new file mode 100644 (file)
index 0000000..c506b0a
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * sun9i clock register definitions
+ *
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _SUNXI_CLOCK_SUN9I_H
+#define _SUNXI_CLOCK_SUN9I_H
+
+struct sunxi_ccm_reg {
+       u32 pll1_c0_cfg;        /* 0x00 c0cpu# pll configuration */
+       u32 pll2_c1_cfg;        /* 0x04 c1cpu# pll configuration */
+       u32 pll3_audio_cfg;     /* 0x08 audio pll configuration */
+       u32 pll4_periph0_cfg;   /* 0x0c peripheral0 pll configuration */
+       u32 pll5_ve_cfg;        /* 0x10 videoengine pll configuration */
+       u32 pll6_ddr_cfg;       /* 0x14 ddr pll configuration */
+       u32 pll7_video0_cfg;    /* 0x18 video0 pll configuration */
+       u32 pll8_video1_cfg;    /* 0x1c video1 pll configuration */
+       u32 pll9_gpu_cfg;       /* 0x20 gpu pll configuration */
+       u32 pll10_de_cfg;       /* 0x24 displayengine pll configuration */
+       u32 pll11_isp_cfg;      /* 0x28 isp pll6 ontrol */
+       u32 pll12_periph1_cfg;  /* 0x2c peripheral1 pll configuration */
+       u8 reserved1[0x20];     /* 0x30 */
+       u32 cpu_clk_source;     /* 0x50 cpu clk source configuration */
+       u32 c0_cfg;             /* 0x54 cpu cluster 0 clock configuration */
+       u32 c1_cfg;             /* 0x58 cpu cluster 1 clock configuration */
+       u32 gtbus_cfg;          /* 0x5c gtbus clock configuration */
+       u32 ahb0_cfg;           /* 0x60 ahb0 clock configuration */
+       u32 ahb1_cfg;           /* 0x64 ahb1 clock configuration */
+       u32 ahb2_cfg;           /* 0x68 ahb2 clock configuration */
+       u8 reserved2[0x04];     /* 0x6c */
+       u32 apb0_cfg;           /* 0x70 apb0 clock configuration */
+       u32 apb1_cfg;           /* 0x74 apb1 clock configuration */
+       u32 cci400_cfg;         /* 0x78 cci400 clock configuration */
+       u8 reserved3[0x04];     /* 0x7c */
+       u32 ats_cfg;            /* 0x80 ats clock configuration */
+       u32 trace_cfg;          /* 0x84 trace clock configuration */
+       u8 reserved4[0xf8];     /* 0x88 */
+       u32 clk_output_a;       /* 0x180 clk_output_a */
+       u32 clk_output_b;       /* 0x184 clk_output_a */
+       u8 reserved5[0x278];    /* 0x188 */
+
+       u32 nand0_clk_cfg0;     /* 0x400 nand0 clock configuration0 */
+       u32 nand0_clk_cfg1;     /* 0x404 nand1 clock configuration */
+       u8 reserved6[0x08];     /* 0x408 */
+       u32 sd0_clk_cfg;        /* 0x410 sd0 clock configuration */
+       u32 sd1_clk_cfg;        /* 0x414 sd1 clock configuration */
+       u32 sd2_clk_cfg;        /* 0x418 sd2 clock configuration */
+       u32 sd3_clk_cfg;        /* 0x41c sd3 clock configuration */
+       u8 reserved7[0x08];     /* 0x420 */
+       u32 ts_clk_cfg;         /* 0x428 transport stream clock cfg */
+       u32 ss_clk_cfg;         /* 0x42c security system clock cfg */
+       u32 spi0_clk_cfg;       /* 0x430 spi0 clock configuration */
+       u32 spi1_clk_cfg;       /* 0x434 spi1 clock configuration */
+       u32 spi2_clk_cfg;       /* 0x438 spi2 clock configuration */
+       u32 spi3_clk_cfg;       /* 0x43c spi3 clock configuration */
+       u8 reserved8[0x50];     /* 0x440 */
+       u32 de_clk_cfg;         /* 0x490 display engine clock configuration */
+       u8 reserved9[0x04];     /* 0x494 */
+       u32 mp_clk_cfg;         /* 0x498 mp clock configuration */
+       u32 lcd0_clk_cfg;       /* 0x49c LCD0 module clock */
+       u32 lcd1_clk_cfg;       /* 0x4a0 LCD1 module clock */
+       u8 reserved10[0x1c];    /* 0x4a4 */
+       u32 csi_isp_clk_cfg;    /* 0x4c0 CSI ISP module clock */
+       u32 csi0_clk_cfg;       /* 0x4c4 CSI0 module clock */
+       u32 csi1_clk_cfg;       /* 0x4c8 CSI1 module clock */
+       u32 fd_clk_cfg;         /* 0x4cc FD module clock */
+       u32 ve_clk_cfg;         /* 0x4d0 VE module clock */
+       u32 avs_clk_cfg;        /* 0x4d4 AVS module clock */
+       u8 reserved11[0x18];    /* 0x4d8 */
+       u32 gpu_core_clk_cfg;   /* 0x4f0 GPU core clock config */
+       u32 gpu_mem_clk_cfg;    /* 0x4f4 GPU memory clock config */
+       u32 gpu_axi_clk_cfg;    /* 0x4f8 GPU AXI clock config */
+       u8 reserved12[0x10];    /* 0x4fc */
+       u32 gp_adc_clk_cfg;     /* 0x50c General Purpose ADC clk config */
+       u8 reserved13[0x70];    /* 0x510 */
+
+       u32 ahb_gate0;          /* 0x580 AHB0 Gating Register */
+       u32 ahb_gate1;          /* 0x584 AHB1 Gating Register */
+       u32 ahb_gate2;          /* 0x588 AHB2 Gating Register */
+       u8 reserved14[0x04];    /* 0x58c */
+       u32 apb0_gate;          /* 0x590 APB0 Clock Gating Register */
+       u32 apb1_gate;          /* 0x594 APB1 Clock Gating Register */
+       u8 reserved15[0x08];    /* 0x598 */
+       u32 ahb_reset0_cfg;     /* 0x5a0 AHB0 Software Reset Register */
+       u32 ahb_reset1_cfg;     /* 0x5a4 AHB1 Software Reset Register */
+       u32 ahb_reset2_cfg;     /* 0x5a8 AHB2 Software Reset Register */
+       u8 reserved16[0x04];    /* 0x5ac */
+       u32 apb0_reset_cfg;     /* 0x5b0 Bus Software Reset Register 3 */
+       u32 apb1_reset_cfg;     /* 0x5b4 Bus Software Reset Register 4 */
+};
+
+/* pll4_periph0_cfg */
+#define PLL4_CFG_DEFAULT               0x90002800 /* 960 MHz */
+
+#define CCM_PLL4_CTRL_N_SHIFT          8
+#define CCM_PLL4_CTRL_N_MASK           (0xff << CCM_PLL4_CTRL_N_SHIFT)
+#define CCM_PLL4_CTRL_P_SHIFT          16
+#define CCM_PLL4_CTRL_P_MASK           (0x1 << CCM_PLL4_CTRL_P_SHIFT)
+#define CCM_PLL4_CTRL_M_SHIFT          18
+#define CCM_PLL4_CTRL_M_MASK           (0x1 << CCM_PLL4_CTRL_M_SHIFT)
+
+/* sd#_clk_cfg fields */
+#define CCM_MMC_CTRL_M(x)              ((x) - 1)
+#define CCM_MMC_CTRL_OCLK_DLY(x)       ((x) << 8)
+#define CCM_MMC_CTRL_N(x)              ((x) << 16)
+#define CCM_MMC_CTRL_SCLK_DLY(x)       ((x) << 20)
+#define CCM_MMC_CTRL_OSCM24            (0 << 24)
+#define CCM_MMC_CTRL_PLL_PERIPH0       (1 << 24)
+#define CCM_MMC_CTRL_ENABLE            (1 << 31)
+
+/* ahb_gate0 fields */
+/* On sun9i all sdc-s share their ahb gate, so ignore (x) */
+#define AHB_GATE_OFFSET_MMC(x)         8
+
+/* apb1_gate fields */
+#define APB1_GATE_UART_SHIFT           16
+#define APB1_GATE_UART_MASK            (0xff << APB1_GATE_UART_SHIFT)
+#define APB1_GATE_TWI_SHIFT            0
+#define APB1_GATE_TWI_MASK             (0xf << APB1_GATE_TWI_SHIFT)
+
+/* ahb_reset0_cfg fields */
+/* On sun9i all sdc-s share their ahb reset, so ignore (x) */
+#define AHB_RESET_OFFSET_MMC(x)                8
+
+/* apb1_reset_cfg fields */
+#define APB1_RESET_UART_SHIFT          16
+#define APB1_RESET_UART_MASK           (0xff << APB1_RESET_UART_SHIFT)
+#define APB1_RESET_TWI_SHIFT           0
+#define APB1_RESET_TWI_MASK            (0xf << APB1_RESET_TWI_SHIFT)
+
+
+#ifndef __ASSEMBLY__
+unsigned int clock_get_pll4_periph0(void);
+#endif
+
+#endif /* _SUNXI_CLOCK_SUN9I_H */
index 82b3d4676fd7fd51f952882d2c054d53c9e8d87e..73583ed445a57bbdb3863e826056921e0cd25f9e 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * (C) Copyright 2007-2011
- * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
- * Tom Cubie <tangliang@allwinnertech.com>
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #ifndef _SUNXI_CPU_H
 #define _SUNXI_CPU_H
 
-#define SUNXI_SRAM_A1_BASE             0x00000000
-#define SUNXI_SRAM_A1_SIZE             (16 * 1024)     /* 16 kiB */
-
-#define SUNXI_SRAM_A2_BASE             0x00004000      /* 16 kiB */
-#define SUNXI_SRAM_A3_BASE             0x00008000      /* 13 kiB */
-#define SUNXI_SRAM_A4_BASE             0x0000b400      /* 3 kiB */
-#define SUNXI_SRAM_D_BASE              0x00010000      /* 4 kiB */
-#define SUNXI_SRAM_B_BASE              0x00020000      /* 64 kiB (secure) */
-
-#define SUNXI_SRAMC_BASE               0x01c00000
-#define SUNXI_DRAMC_BASE               0x01c01000
-#define SUNXI_DMA_BASE                 0x01c02000
-#define SUNXI_NFC_BASE                 0x01c03000
-#define SUNXI_TS_BASE                  0x01c04000
-#define SUNXI_SPI0_BASE                        0x01c05000
-#define SUNXI_SPI1_BASE                        0x01c06000
-#define SUNXI_MS_BASE                  0x01c07000
-#define SUNXI_TVD_BASE                 0x01c08000
-#define SUNXI_CSI0_BASE                        0x01c09000
-#define SUNXI_TVE0_BASE                        0x01c0a000
-#define SUNXI_EMAC_BASE                        0x01c0b000
-#define SUNXI_LCD0_BASE                        0x01c0C000
-#define SUNXI_LCD1_BASE                        0x01c0d000
-#define SUNXI_VE_BASE                  0x01c0e000
-#define SUNXI_MMC0_BASE                        0x01c0f000
-#define SUNXI_MMC1_BASE                        0x01c10000
-#define SUNXI_MMC2_BASE                        0x01c11000
-#define SUNXI_MMC3_BASE                        0x01c12000
-#if !defined CONFIG_MACH_SUN6I && !defined CONFIG_MACH_SUN8I
-#define SUNXI_USB0_BASE                        0x01c13000
-#define SUNXI_USB1_BASE                        0x01c14000
-#endif
-#define SUNXI_SS_BASE                  0x01c15000
-#define SUNXI_HDMI_BASE                        0x01c16000
-#define SUNXI_SPI2_BASE                        0x01c17000
-#define SUNXI_SATA_BASE                        0x01c18000
-#if !defined CONFIG_MACH_SUN6I && !defined CONFIG_MACH_SUN8I
-#define SUNXI_PATA_BASE                        0x01c19000
-#define SUNXI_ACE_BASE                 0x01c1a000
-#define SUNXI_TVE1_BASE                        0x01c1b000
-#define SUNXI_USB2_BASE                        0x01c1c000
+#if defined(CONFIG_MACH_SUN9I)
+#include <asm/arch/cpu_sun9i.h>
 #else
-#define SUNXI_USB0_BASE                        0x01c19000
-#define SUNXI_USB1_BASE                        0x01c1a000
-#define SUNXI_USB2_BASE                        0x01c1b000
+#include <asm/arch/cpu_sun4i.h>
 #endif
-#define SUNXI_CSI1_BASE                        0x01c1d000
-#define SUNXI_TZASC_BASE               0x01c1e000
-#define SUNXI_SPI3_BASE                        0x01c1f000
-
-#define SUNXI_CCM_BASE                 0x01c20000
-#define SUNXI_INTC_BASE                        0x01c20400
-#define SUNXI_PIO_BASE                 0x01c20800
-#define SUNXI_TIMER_BASE               0x01c20c00
-#define SUNXI_SPDIF_BASE               0x01c21000
-#define SUNXI_AC97_BASE                        0x01c21400
-#define SUNXI_IR0_BASE                 0x01c21800
-#define SUNXI_IR1_BASE                 0x01c21c00
-
-#define SUNXI_IIS_BASE                 0x01c22400
-#define SUNXI_LRADC_BASE               0x01c22800
-#define SUNXI_AD_DA_BASE               0x01c22c00
-#define SUNXI_KEYPAD_BASE              0x01c23000
-#define SUNXI_TZPC_BASE                        0x01c23400
-#define SUNXI_SID_BASE                 0x01c23800
-#define SUNXI_SJTAG_BASE               0x01c23c00
-
-#define SUNXI_TP_BASE                  0x01c25000
-#define SUNXI_PMU_BASE                 0x01c25400
-#define SUN7I_CPUCFG_BASE              0x01c25c00
-
-#define SUNXI_UART0_BASE               0x01c28000
-#define SUNXI_UART1_BASE               0x01c28400
-#define SUNXI_UART2_BASE               0x01c28800
-#define SUNXI_UART3_BASE               0x01c28c00
-#define SUNXI_UART4_BASE               0x01c29000
-#define SUNXI_UART5_BASE               0x01c29400
-#define SUNXI_UART6_BASE               0x01c29800
-#define SUNXI_UART7_BASE               0x01c29c00
-#define SUNXI_PS2_0_BASE               0x01c2a000
-#define SUNXI_PS2_1_BASE               0x01c2a400
-
-#define SUNXI_TWI0_BASE                        0x01c2ac00
-#define SUNXI_TWI1_BASE                        0x01c2b000
-#define SUNXI_TWI2_BASE                        0x01c2b400
-
-#define SUNXI_CAN_BASE                 0x01c2bc00
-
-#define SUNXI_SCR_BASE                 0x01c2c400
-
-#ifndef CONFIG_MACH_SUN6I
-#define SUNXI_GPS_BASE                 0x01c30000
-#define SUNXI_MALI400_BASE             0x01c40000
-#define SUNXI_GMAC_BASE                        0x01c50000
-#else
-#define SUNXI_GMAC_BASE                        0x01c30000
-#endif
-
-#define SUNXI_DRAM_COM_BASE            0x01c62000
-#define SUNXI_DRAM_CTL0_BASE           0x01c63000
-#define SUNXI_DRAM_CTL1_BASE           0x01c64000
-#define SUNXI_DRAM_PHY0_BASE           0x01c65000
-#define SUNXI_DRAM_PHY1_BASE           0x01c66000
-
-/* module sram */
-#define SUNXI_SRAM_C_BASE              0x01d00000
-
-#define SUNXI_DE_FE0_BASE              0x01e00000
-#define SUNXI_DE_FE1_BASE              0x01e20000
-#define SUNXI_DE_BE0_BASE              0x01e60000
-#define SUNXI_DE_BE1_BASE              0x01e40000
-#define SUNXI_MP_BASE                  0x01e80000
-#define SUNXI_AVG_BASE                 0x01ea0000
-
-#define SUNXI_RTC_BASE                 0x01f00000
-#define SUNXI_PRCM_BASE                        0x01f01400
-#define SUN6I_CPUCFG_BASE              0x01f01c00
-#define SUNXI_R_UART_BASE              0x01f02800
-#define SUNXI_R_PIO_BASE               0x01f02c00
-#define SUN6I_P2WI_BASE                        0x01f03400
-#define SUNXI_RSB_BASE                 0x01f03400
-
-/* CoreSight Debug Module */
-#define SUNXI_CSDM_BASE                        0x3f500000
-
-#define SUNXI_DDRII_DDRIII_BASE                0x40000000      /* 2 GiB */
-
-#define SUNXI_BROM_BASE                        0xffff0000      /* 32 kiB */
-
-#define SUNXI_CPU_CFG                  (SUNXI_TIMER_BASE + 0x13c)
-
-/* SS bonding ids used for cpu identification */
-#define SUNXI_SS_BOND_ID_A31           4
-#define SUNXI_SS_BOND_ID_A31S          5
-
-#ifndef __ASSEMBLY__
-void sunxi_board_init(void);
-void sunxi_reset(void);
-int sunxi_get_ss_bonding_id(void);
-int sunxi_get_sid(unsigned int *sid);
-#endif /* __ASSEMBLY__ */
 
-#endif /* _CPU_H */
+#endif /* _SUNXI_CPU_H */
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
new file mode 100644 (file)
index 0000000..dae6069
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * (C) Copyright 2007-2011
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Tom Cubie <tangliang@allwinnertech.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _SUNXI_CPU_SUN4I_H
+#define _SUNXI_CPU_SUN4I_H
+
+#define SUNXI_SRAM_A1_BASE             0x00000000
+#define SUNXI_SRAM_A1_SIZE             (16 * 1024)     /* 16 kiB */
+
+#define SUNXI_SRAM_A2_BASE             0x00004000      /* 16 kiB */
+#define SUNXI_SRAM_A3_BASE             0x00008000      /* 13 kiB */
+#define SUNXI_SRAM_A4_BASE             0x0000b400      /* 3 kiB */
+#define SUNXI_SRAM_D_BASE              0x00010000      /* 4 kiB */
+#define SUNXI_SRAM_B_BASE              0x00020000      /* 64 kiB (secure) */
+
+#define SUNXI_SRAMC_BASE               0x01c00000
+#define SUNXI_DRAMC_BASE               0x01c01000
+#define SUNXI_DMA_BASE                 0x01c02000
+#define SUNXI_NFC_BASE                 0x01c03000
+#define SUNXI_TS_BASE                  0x01c04000
+#define SUNXI_SPI0_BASE                        0x01c05000
+#define SUNXI_SPI1_BASE                        0x01c06000
+#define SUNXI_MS_BASE                  0x01c07000
+#define SUNXI_TVD_BASE                 0x01c08000
+#define SUNXI_CSI0_BASE                        0x01c09000
+#define SUNXI_TVE0_BASE                        0x01c0a000
+#define SUNXI_EMAC_BASE                        0x01c0b000
+#define SUNXI_LCD0_BASE                        0x01c0C000
+#define SUNXI_LCD1_BASE                        0x01c0d000
+#define SUNXI_VE_BASE                  0x01c0e000
+#define SUNXI_MMC0_BASE                        0x01c0f000
+#define SUNXI_MMC1_BASE                        0x01c10000
+#define SUNXI_MMC2_BASE                        0x01c11000
+#define SUNXI_MMC3_BASE                        0x01c12000
+#if !defined CONFIG_MACH_SUN6I && !defined CONFIG_MACH_SUN8I
+#define SUNXI_USB0_BASE                        0x01c13000
+#define SUNXI_USB1_BASE                        0x01c14000
+#endif
+#define SUNXI_SS_BASE                  0x01c15000
+#define SUNXI_HDMI_BASE                        0x01c16000
+#define SUNXI_SPI2_BASE                        0x01c17000
+#define SUNXI_SATA_BASE                        0x01c18000
+#if !defined CONFIG_MACH_SUN6I && !defined CONFIG_MACH_SUN8I
+#define SUNXI_PATA_BASE                        0x01c19000
+#define SUNXI_ACE_BASE                 0x01c1a000
+#define SUNXI_TVE1_BASE                        0x01c1b000
+#define SUNXI_USB2_BASE                        0x01c1c000
+#else
+#define SUNXI_USB0_BASE                        0x01c19000
+#define SUNXI_USB1_BASE                        0x01c1a000
+#define SUNXI_USB2_BASE                        0x01c1b000
+#endif
+#define SUNXI_CSI1_BASE                        0x01c1d000
+#define SUNXI_TZASC_BASE               0x01c1e000
+#define SUNXI_SPI3_BASE                        0x01c1f000
+
+#define SUNXI_CCM_BASE                 0x01c20000
+#define SUNXI_INTC_BASE                        0x01c20400
+#define SUNXI_PIO_BASE                 0x01c20800
+#define SUNXI_TIMER_BASE               0x01c20c00
+#define SUNXI_SPDIF_BASE               0x01c21000
+#define SUNXI_AC97_BASE                        0x01c21400
+#define SUNXI_IR0_BASE                 0x01c21800
+#define SUNXI_IR1_BASE                 0x01c21c00
+
+#define SUNXI_IIS_BASE                 0x01c22400
+#define SUNXI_LRADC_BASE               0x01c22800
+#define SUNXI_AD_DA_BASE               0x01c22c00
+#define SUNXI_KEYPAD_BASE              0x01c23000
+#define SUNXI_TZPC_BASE                        0x01c23400
+#define SUNXI_SID_BASE                 0x01c23800
+#define SUNXI_SJTAG_BASE               0x01c23c00
+
+#define SUNXI_TP_BASE                  0x01c25000
+#define SUNXI_PMU_BASE                 0x01c25400
+#define SUN7I_CPUCFG_BASE              0x01c25c00
+
+#define SUNXI_UART0_BASE               0x01c28000
+#define SUNXI_UART1_BASE               0x01c28400
+#define SUNXI_UART2_BASE               0x01c28800
+#define SUNXI_UART3_BASE               0x01c28c00
+#define SUNXI_UART4_BASE               0x01c29000
+#define SUNXI_UART5_BASE               0x01c29400
+#define SUNXI_UART6_BASE               0x01c29800
+#define SUNXI_UART7_BASE               0x01c29c00
+#define SUNXI_PS2_0_BASE               0x01c2a000
+#define SUNXI_PS2_1_BASE               0x01c2a400
+
+#define SUNXI_TWI0_BASE                        0x01c2ac00
+#define SUNXI_TWI1_BASE                        0x01c2b000
+#define SUNXI_TWI2_BASE                        0x01c2b400
+
+#define SUNXI_CAN_BASE                 0x01c2bc00
+
+#define SUNXI_SCR_BASE                 0x01c2c400
+
+#ifndef CONFIG_MACH_SUN6I
+#define SUNXI_GPS_BASE                 0x01c30000
+#define SUNXI_MALI400_BASE             0x01c40000
+#define SUNXI_GMAC_BASE                        0x01c50000
+#else
+#define SUNXI_GMAC_BASE                        0x01c30000
+#endif
+
+#define SUNXI_DRAM_COM_BASE            0x01c62000
+#define SUNXI_DRAM_CTL0_BASE           0x01c63000
+#define SUNXI_DRAM_CTL1_BASE           0x01c64000
+#define SUNXI_DRAM_PHY0_BASE           0x01c65000
+#define SUNXI_DRAM_PHY1_BASE           0x01c66000
+
+/* module sram */
+#define SUNXI_SRAM_C_BASE              0x01d00000
+
+#define SUNXI_DE_FE0_BASE              0x01e00000
+#define SUNXI_DE_FE1_BASE              0x01e20000
+#define SUNXI_DE_BE0_BASE              0x01e60000
+#define SUNXI_DE_BE1_BASE              0x01e40000
+#define SUNXI_MP_BASE                  0x01e80000
+#define SUNXI_AVG_BASE                 0x01ea0000
+
+#define SUNXI_RTC_BASE                 0x01f00000
+#define SUNXI_PRCM_BASE                        0x01f01400
+#define SUN6I_CPUCFG_BASE              0x01f01c00
+#define SUNXI_R_UART_BASE              0x01f02800
+#define SUNXI_R_PIO_BASE               0x01f02c00
+#define SUN6I_P2WI_BASE                        0x01f03400
+#define SUNXI_RSB_BASE                 0x01f03400
+
+/* CoreSight Debug Module */
+#define SUNXI_CSDM_BASE                        0x3f500000
+
+#define SUNXI_DDRII_DDRIII_BASE                0x40000000      /* 2 GiB */
+
+#define SUNXI_BROM_BASE                        0xffff0000      /* 32 kiB */
+
+#define SUNXI_CPU_CFG                  (SUNXI_TIMER_BASE + 0x13c)
+
+/* SS bonding ids used for cpu identification */
+#define SUNXI_SS_BOND_ID_A31           4
+#define SUNXI_SS_BOND_ID_A31S          5
+
+#ifndef __ASSEMBLY__
+void sunxi_board_init(void);
+void sunxi_reset(void);
+int sunxi_get_ss_bonding_id(void);
+int sunxi_get_sid(unsigned int *sid);
+#endif /* __ASSEMBLY__ */
+
+#endif /* _SUNXI_CPU_SUN4I_H */
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun9i.h b/arch/arm/include/asm/arch-sunxi/cpu_sun9i.h
new file mode 100644 (file)
index 0000000..04889c5
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ * (C) Copyright 2007-2013
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Jerry Wang <wangflord@allwinnertech.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _SUNXI_CPU_SUN9I_H
+#define _SUNXI_CPU_SUN9I_H
+
+#define REGS_AHB0_BASE                 0x01C00000
+#define REGS_AHB1_BASE                 0x00800000
+#define REGS_AHB2_BASE                 0x03000000
+#define REGS_APB0_BASE                 0x06000000
+#define REGS_APB1_BASE                 0x07000000
+#define REGS_RCPUS_BASE                        0x08000000
+
+#define SUNXI_SRAM_D_BASE              0x08100000
+
+/* AHB0 Module */
+#define SUNXI_NFC_BASE                 (REGS_AHB0_BASE + 0x3000)
+#define SUNXI_TSC_BASE                 (REGS_AHB0_BASE + 0x4000)
+
+#define SUNXI_MMC0_BASE                        (REGS_AHB0_BASE + 0x0f000)
+#define SUNXI_MMC1_BASE                        (REGS_AHB0_BASE + 0x10000)
+#define SUNXI_MMC2_BASE                        (REGS_AHB0_BASE + 0x11000)
+#define SUNXI_MMC3_BASE                        (REGS_AHB0_BASE + 0x12000)
+#define SUNXI_MMC_COMMON_BASE          (REGS_AHB0_BASE + 0x13000)
+
+#define SUNXI_SPI0_BASE                        (REGS_AHB0_BASE + 0x1A000)
+#define SUNXI_SPI1_BASE                        (REGS_AHB0_BASE + 0x1B000)
+#define SUNXI_SPI2_BASE                        (REGS_AHB0_BASE + 0x1C000)
+#define SUNXI_SPI3_BASE                        (REGS_AHB0_BASE + 0x1D000)
+
+#define SUNXI_GIC400_BASE              (REGS_AHB0_BASE + 0x40000)
+#define SUNXI_ARMA9_GIC_BASE           (REGS_AHB0_BASE + 0x41000)
+#define SUNXI_ARMA9_CPUIF_BASE         (REGS_AHB0_BASE + 0x42000)
+
+/* AHB1 Module */
+#define SUNXI_DMA_BASE                 (REGS_AHB1_BASE + 0x002000)
+#define SUNXI_USBOTG_BASE              (REGS_AHB1_BASE + 0x100000)
+#define SUNXI_USBEHCI0_BASE            (REGS_AHB1_BASE + 0x200000)
+#define SUNXI_USBEHCI1_BASE            (REGS_AHB1_BASE + 0x201000)
+#define SUNXI_USBEHCI2_BASE            (REGS_AHB1_BASE + 0x202000)
+
+/* AHB2 Module */
+#define SUNXI_DE_SYS_BASE              (REGS_AHB2_BASE + 0x000000)
+#define SUNXI_DISP_SYS_BASE            (REGS_AHB2_BASE + 0x010000)
+#define SUNXI_DE_FE0_BASE              (REGS_AHB2_BASE + 0x100000)
+#define SUNXI_DE_FE1_BASE              (REGS_AHB2_BASE + 0x140000)
+#define SUNXI_DE_FE2_BASE              (REGS_AHB2_BASE + 0x180000)
+
+#define SUNXI_DE_BE0_BASE              (REGS_AHB2_BASE + 0x200000)
+#define SUNXI_DE_BE1_BASE              (REGS_AHB2_BASE + 0x240000)
+#define SUNXI_DE_BE2_BASE              (REGS_AHB2_BASE + 0x280000)
+
+#define SUNXI_DE_DEU0_BASE             (REGS_AHB2_BASE + 0x300000)
+#define SUNXI_DE_DEU1_BASE             (REGS_AHB2_BASE + 0x340000)
+#define SUNXI_DE_DRC0_BASE             (REGS_AHB2_BASE + 0x400000)
+#define SUNXI_DE_DRC1_BASE             (REGS_AHB2_BASE + 0x440000)
+
+#define SUNXI_LCD0_BASE                        (REGS_AHB2_BASE + 0xC00000)
+#define SUNXI_LCD1_BASE                        (REGS_AHB2_BASE + 0xC10000)
+#define SUNXI_LCD2_BASE                        (REGS_AHB2_BASE + 0xC20000)
+#define SUNXI_MIPI_DSI0_BASE           (REGS_AHB2_BASE + 0xC40000)
+/* Also seen as SUNXI_MIPI_DSI0_DPHY_BASE 0x01ca1000 */
+#define SUNXI_MIPI_DSI0_DPHY_BASE      (REGS_AHB2_BASE + 0xC40100)
+#define SUNXI_HDMI_BASE                        (REGS_AHB2_BASE + 0xD00000)
+
+/* APB0 Module */
+#define SUNXI_CCM_BASE                 (REGS_APB0_BASE + 0x0000)
+#define SUNXI_CCMMODULE_BASE           (REGS_APB0_BASE + 0x0400)
+#define SUNXI_PIO_BASE                 (REGS_APB0_BASE + 0x0800)
+#define SUNXI_TIMER_BASE               (REGS_APB0_BASE + 0x0C00)
+#define SUNXI_PWM_BASE                 (REGS_APB0_BASE + 0x1400)
+#define SUNXI_LRADC_BASE               (REGS_APB0_BASE + 0x1800)
+
+/* APB1 Module */
+#define SUNXI_UART0_BASE               (REGS_APB1_BASE + 0x0000)
+#define SUNXI_UART1_BASE               (REGS_APB1_BASE + 0x0400)
+#define SUNXI_UART2_BASE               (REGS_APB1_BASE + 0x0800)
+#define SUNXI_UART3_BASE               (REGS_APB1_BASE + 0x0C00)
+#define SUNXI_UART4_BASE               (REGS_APB1_BASE + 0x1000)
+#define SUNXI_UART5_BASE               (REGS_APB1_BASE + 0x1400)
+#define SUNXI_TWI0_BASE                        (REGS_APB1_BASE + 0x2800)
+#define SUNXI_TWI1_BASE                        (REGS_APB1_BASE + 0x2C00)
+#define SUNXI_TWI2_BASE                        (REGS_APB1_BASE + 0x3000)
+#define SUNXI_TWI3_BASE                        (REGS_APB1_BASE + 0x3400)
+#define SUNXI_TWI4_BASE                        (REGS_APB1_BASE + 0x3800)
+
+/* RCPUS Module */
+#define SUNXI_PRCM_BASE                        (REGS_RCPUS_BASE + 0x1400)
+#define SUNXI_R_UART_BASE              (REGS_RCPUS_BASE + 0x2800)
+#define SUNXI_R_PIO_BASE               (REGS_RCPUS_BASE + 0x2c00)
+#define SUNXI_RSB_BASE                 (REGS_RCPUS_BASE + 0x3400)
+
+/* Misc. */
+#define SUNXI_BROM_BASE                        0xFFFF0000 /* 32K */
+#define SUNXI_CPU_CFG                  (SUNXI_TIMER_BASE + 0x13c)
+
+#ifndef __ASSEMBLY__
+void sunxi_board_init(void);
+void sunxi_reset(void);
+int sunxi_get_sid(unsigned int *sid);
+#endif
+
+#endif /* _SUNXI_CPU_SUN9I_H */
index 2ac8a879dfb6feb5dd298c23322c87063b63d858..5e9425320366d96e44a1512baba2780108e66095 100644 (file)
@@ -9,6 +9,107 @@
 #ifndef _SUNXI_DISPLAY_H
 #define _SUNXI_DISPLAY_H
 
+struct sunxi_de_fe_reg {
+       u32 enable;                     /* 0x000 */
+       u32 frame_ctrl;                 /* 0x004 */
+       u32 bypass;                     /* 0x008 */
+       u32 algorithm_sel;              /* 0x00c */
+       u32 line_int_ctrl;              /* 0x010 */
+       u8 res0[0x0c];                  /* 0x014 */
+       u32 ch0_addr;                   /* 0x020 */
+       u32 ch1_addr;                   /* 0x024 */
+       u32 ch2_addr;                   /* 0x028 */
+       u32 field_sequence;             /* 0x02c */
+       u32 ch0_offset;                 /* 0x030 */
+       u32 ch1_offset;                 /* 0x034 */
+       u32 ch2_offset;                 /* 0x038 */
+       u8 res1[0x04];                  /* 0x03c */
+       u32 ch0_stride;                 /* 0x040 */
+       u32 ch1_stride;                 /* 0x044 */
+       u32 ch2_stride;                 /* 0x048 */
+       u32 input_fmt;                  /* 0x04c */
+       u32 ch3_addr;                   /* 0x050 */
+       u32 ch4_addr;                   /* 0x054 */
+       u32 ch5_addr;                   /* 0x058 */
+       u32 output_fmt;                 /* 0x05c */
+       u32 int_enable;                 /* 0x060 */
+       u32 int_status;                 /* 0x064 */
+       u32 status;                     /* 0x068 */
+       u8 res2[0x04];                  /* 0x06c */
+       u32 csc_coef00;                 /* 0x070 */
+       u32 csc_coef01;                 /* 0x074 */
+       u32 csc_coef02;                 /* 0x078 */
+       u32 csc_coef03;                 /* 0x07c */
+       u32 csc_coef10;                 /* 0x080 */
+       u32 csc_coef11;                 /* 0x084 */
+       u32 csc_coef12;                 /* 0x088 */
+       u32 csc_coef13;                 /* 0x08c */
+       u32 csc_coef20;                 /* 0x090 */
+       u32 csc_coef21;                 /* 0x094 */
+       u32 csc_coef22;                 /* 0x098 */
+       u32 csc_coef23;                 /* 0x09c */
+       u32 deinterlace_ctrl;           /* 0x0a0 */
+       u32 deinterlace_diag;           /* 0x0a4 */
+       u32 deinterlace_tempdiff;       /* 0x0a8 */
+       u32 deinterlace_sawtooth;       /* 0x0ac */
+       u32 deinterlace_spatcomp;       /* 0x0b0 */
+       u32 deinterlace_burstlen;       /* 0x0b4 */
+       u32 deinterlace_preluma;        /* 0x0b8 */
+       u32 deinterlace_tile_addr;      /* 0x0bc */
+       u32 deinterlace_tile_stride;    /* 0x0c0 */
+       u8 res3[0x0c];                  /* 0x0c4 */
+       u32 wb_stride_enable;           /* 0x0d0 */
+       u32 ch3_stride;                 /* 0x0d4 */
+       u32 ch4_stride;                 /* 0x0d8 */
+       u32 ch5_stride;                 /* 0x0dc */
+       u32 fe_3d_ctrl;                 /* 0x0e0 */
+       u32 fe_3d_ch0_addr;             /* 0x0e4 */
+       u32 fe_3d_ch1_addr;             /* 0x0e8 */
+       u32 fe_3d_ch2_addr;             /* 0x0ec */
+       u32 fe_3d_ch0_offset;           /* 0x0f0 */
+       u32 fe_3d_ch1_offset;           /* 0x0f4 */
+       u32 fe_3d_ch2_offset;           /* 0x0f8 */
+       u8 res4[0x04];                  /* 0x0fc */
+       u32 ch0_insize;                 /* 0x100 */
+       u32 ch0_outsize;                /* 0x104 */
+       u32 ch0_horzfact;               /* 0x108 */
+       u32 ch0_vertfact;               /* 0x10c */
+       u32 ch0_horzphase;              /* 0x110 */
+       u32 ch0_vertphase0;             /* 0x114 */
+       u32 ch0_vertphase1;             /* 0x118 */
+       u8 res5[0x04];                  /* 0x11c */
+       u32 ch0_horztapoffset0;         /* 0x120 */
+       u32 ch0_horztapoffset1;         /* 0x124 */
+       u32 ch0_verttapoffset;          /* 0x128 */
+       u8 res6[0xd4];                  /* 0x12c */
+       u32 ch1_insize;                 /* 0x200 */
+       u32 ch1_outsize;                /* 0x204 */
+       u32 ch1_horzfact;               /* 0x208 */
+       u32 ch1_vertfact;               /* 0x20c */
+       u32 ch1_horzphase;              /* 0x210 */
+       u32 ch1_vertphase0;             /* 0x214 */
+       u32 ch1_vertphase1;             /* 0x218 */
+       u8 res7[0x04];                  /* 0x21c */
+       u32 ch1_horztapoffset0;         /* 0x220 */
+       u32 ch1_horztapoffset1;         /* 0x224 */
+       u32 ch1_verttapoffset;          /* 0x228 */
+       u8 res8[0x1d4];                 /* 0x22c */
+       u32 ch0_horzcoef0[32];          /* 0x400 */
+       u32 ch0_horzcoef1[32];          /* 0x480 */
+       u32 ch0_vertcoef[32];           /* 0x500 */
+       u8 res9[0x80];                  /* 0x580 */
+       u32 ch1_horzcoef0[32];          /* 0x600 */
+       u32 ch1_horzcoef1[32];          /* 0x680 */
+       u32 ch1_vertcoef[32];           /* 0x700 */
+       u8 res10[0x280];                /* 0x780 */
+       u32 vpp_enable;                 /* 0xa00 */
+       u32 vpp_dcti;                   /* 0xa04 */
+       u32 vpp_lp1;                    /* 0xa08 */
+       u32 vpp_lp2;                    /* 0xa0c */
+       u32 vpp_wle;                    /* 0xa10 */
+       u32 vpp_ble;                    /* 0xa14 */
+};
+
 struct sunxi_de_be_reg {
        u8 res0[0x800];                 /* 0x000 */
        u32 mode;                       /* 0x800 */
@@ -209,6 +310,20 @@ struct sunxi_tve_reg {
        u32 cfg2;                       /* 0x13c */
 };
 
+/*
+ * DE-FE register constants.
+ */
+#define SUNXI_DE_FE_WIDTH(x)                   (((x) - 1) << 0)
+#define SUNXI_DE_FE_HEIGHT(y)                  (((y) - 1) << 16)
+#define SUNXI_DE_FE_FACTOR_INT(n)              ((n) << 16)
+#define SUNXI_DE_FE_ENABLE_EN                  (1 << 0)
+#define SUNXI_DE_FE_FRAME_CTRL_REG_RDY         (1 << 0)
+#define SUNXI_DE_FE_FRAME_CTRL_COEF_RDY                (1 << 1)
+#define SUNXI_DE_FE_FRAME_CTRL_FRM_START       (1 << 16)
+#define SUNXI_DE_FE_BYPASS_CSC_BYPASS          (1 << 1)
+#define SUNXI_DE_FE_INPUT_FMT_ARGB8888         0x00000151
+#define SUNXI_DE_FE_OUTPUT_FMT_ARGB8888                0x00000002
+
 /*
  * DE-BE register constants.
  */
@@ -219,6 +334,7 @@ struct sunxi_tve_reg {
 #define SUNXI_DE_BE_MODE_LAYER0_ENABLE         (1 << 8)
 #define SUNXI_DE_BE_LAYER_STRIDE(x)            ((x) << 5)
 #define SUNXI_DE_BE_REG_CTRL_LOAD_REGS         (1 << 0)
+#define SUNXI_DE_BE_LAYER_ATTR0_SRC_FE0                0x00000002
 #define SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888   (0x09 << 8)
 
 /*
@@ -249,9 +365,7 @@ struct sunxi_tve_reg {
 #define SUNXI_LCDC_TCON0_TIMING_V_TOTAL(n)     (((n) * 2) << 16)
 #define SUNXI_LCDC_TCON0_LVDS_INTF_BITWIDTH(n) ((n) << 26)
 #define SUNXI_LCDC_TCON0_LVDS_INTF_ENABLE      (1 << 31)
-#define SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE0    (0 << 28)
-#define SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE60   (1 << 28)
-#define SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE120  (2 << 28)
+#define SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE(x)  ((x) << 28)
 #define SUNXI_LCDC_TCON1_CTRL_CLK_DELAY(n)     (((n) & 0x1f) << 4)
 #define SUNXI_LCDC_TCON1_CTRL_ENABLE           (1 << 31)
 #define SUNXI_LCDC_TCON1_TIMING_H_BP(n)                (((n) - 1) << 0)
index 6c1ec5be8620e71f0343da7fa978cef5bb3922f6..40c385a5bc8025e5dc1ca48ffc441bf5440e5ffc 100644 (file)
@@ -76,7 +76,7 @@ struct dram_para {
        u32 cas;
        u32 zq;
        u32 odt_en;
-       u32 size;
+       u32 size; /* For compat with dram.c files from u-boot-sunxi, unused */
        u32 tpr0;
        u32 tpr1;
        u32 tpr2;
index 71cc879c2bb0ebf77e2dd7da5b7a6ee3b668ba12..f2c247d79fc7ee68de1bc32e3272c2da561b4965 100644 (file)
  *
  * sun8i has 1 bank:
  * PL0 - PL11
+ *
+ * sun9i has 3 banks:
+ * PL0 - PL9  | PM0 - PM15  | PN0 - PN1
  */
 #define SUNXI_GPIO_L   11
 #define SUNXI_GPIO_M   12
+#define SUNXI_GPIO_N   13
 
 struct sunxi_gpio {
        u32 cfg[4];
@@ -114,6 +118,7 @@ enum sunxi_gpio_number {
        SUNXI_GPIO_I_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_H),
        SUNXI_GPIO_L_START = 352,
        SUNXI_GPIO_M_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_L),
+       SUNXI_GPIO_N_START = SUNXI_GPIO_NEXT(SUNXI_GPIO_M),
        SUNXI_GPIO_AXP0_START = 1024,
 };
 
@@ -129,6 +134,7 @@ enum sunxi_gpio_number {
 #define SUNXI_GPI(_nr) (SUNXI_GPIO_I_START + (_nr))
 #define SUNXI_GPL(_nr) (SUNXI_GPIO_L_START + (_nr))
 #define SUNXI_GPM(_nr) (SUNXI_GPIO_M_START + (_nr))
+#define SUNXI_GPN(_nr) (SUNXI_GPIO_N_START + (_nr))
 
 #define SUNXI_GPAXP0(_nr)      (SUNXI_GPIO_AXP0_START + (_nr))
 
@@ -187,6 +193,9 @@ enum sunxi_gpio_number {
 #define SUN8I_GPL2_R_UART_TX   2
 #define SUN8I_GPL3_R_UART_RX   2
 
+#define SUN9I_GPN0_R_RSB_SCK   3
+#define SUN9I_GPN1_R_RSB_SDA    3
+
 /* GPIO pin pull-up/down config */
 #define SUNXI_GPIO_PULL_DISABLE        0
 #define SUNXI_GPIO_PULL_UP     1
index 537f1455643cc5ffae3d998599f3b941d2244568..74833b51d1285e12db5865946eb6a34526c645bf 100644 (file)
@@ -43,10 +43,11 @@ struct sunxi_mmc {
        u32 chda;               /* 0x90 */
        u32 cbda;               /* 0x94 */
        u32 res1[26];
-#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
+#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \
+    defined(CONFIG_MACH_SUN9I)
        u32 res2[64];
 #endif
-       u32 fifo;               /* 0x100 (0x200 on sun6i) FIFO access address */
+       u32 fifo;               /* 0x100 / 0x200 FIFO access address */
 };
 
 #define SUNXI_MMC_CLK_POWERSAVE                (0x1 << 17)
@@ -123,5 +124,8 @@ struct sunxi_mmc {
 #define SUNXI_MMC_IDIE_TXIRQ           (0x1 << 0)
 #define SUNXI_MMC_IDIE_RXIRQ           (0x1 << 1)
 
+#define SUNXI_MMC_COMMON_CLK_GATE              (1 << 16)
+#define SUNXI_MMC_COMMON_RESET                 (1 << 18)
+
 struct mmc *sunxi_mmc_init(int sdc_no);
 #endif /* _SUNXI_MMC_H */
index 95a595ab8d418c6c9275eb0cf77399352a1ec1c5..a8934667c4c7b50b0af2aabc40cfec1703826440 100644 (file)
@@ -37,6 +37,7 @@ struct sunxi_rsb_reg {
 #define RSB_STAT_TERR_INT              (1 << 1)
 #define RSB_STAT_LBSY_INT              (1 << 2)
 
+#define RSB_DMCR_DEVICE_MODE_DATA      0x7c3e00
 #define RSB_DMCR_DEVICE_MODE_START     (1 << 31)
 
 #define RSB_CMD_BYTE_WRITE             0x4e
@@ -46,8 +47,7 @@ struct sunxi_rsb_reg {
 #define RSB_DEVADDR_RUNTIME_ADDR(x)    ((x) << 16)
 #define RSB_DEVADDR_DEVICE_ADDR(x)     ((x) << 0)
 
-void rsb_init(void);
-int rsb_set_device_mode(u32 device_mode_data);
+int rsb_init(void);
 int rsb_set_device_address(u16 device_addr, u16 runtime_addr);
 int rsb_write(const u16 runtime_device_addr, const u8 reg_addr, u8 data);
 int rsb_read(const u16 runtime_device_addr, const u8 reg_addr, u8 *data);
index 8d2097336c4288d64cef37fdde88fb5c653e2b7e..cb538cdc7d4c9f632279ead2505d4e1591e1c823 100644 (file)
@@ -11,6 +11,8 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+extern const struct musb_platform_ops sunxi_musb_ops;
+
 void *sunxi_usbc_get_io_base(int index);
 int sunxi_usbc_request_resources(int index);
 int sunxi_usbc_free_resources(int index);
index 84e7b5553de16cb5ea8f5965079ec169d2459022..a20bdaa6187257a8fdd912d8e509e68ba27aac93 100644 (file)
@@ -10,6 +10,7 @@
 #define __TEGRA_MMC_H_
 
 #include <fdtdec.h>
+#include <asm/gpio.h>
 
 /* for mmc_config definition */
 #include <mmc.h>
@@ -134,9 +135,9 @@ struct mmc_host {
        int enabled;            /* 1 to enable, 0 to disable */
        int width;              /* Bus Width, 1, 4 or 8 */
        enum periph_id mmc_id;  /* Peripheral ID: PERIPH_ID_... */
-       struct fdt_gpio_state cd_gpio;          /* Change Detect GPIO */
-       struct fdt_gpio_state pwr_gpio;         /* Power GPIO */
-       struct fdt_gpio_state wp_gpio;          /* Write Protect GPIO */
+       struct gpio_desc cd_gpio;       /* Change Detect GPIO */
+       struct gpio_desc pwr_gpio;      /* Power GPIO */
+       struct gpio_desc wp_gpio;       /* Write Protect GPIO */
        unsigned int version;   /* SDHCI spec. version */
        unsigned int clock;     /* Current clock (MHz) */
        struct mmc_config cfg;  /* mmc configuration */
index a04c84e54b2251d54edbb017e216ded626c88bd4..6feeda3ba83ec42674f589f4dbd4fb1e3948774d 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <asm/arch/dc.h>
 #include <fdtdec.h>
+#include <asm/gpio.h>
 
 /* This holds information about a window which can be displayed */
 struct disp_ctl_win {
@@ -72,10 +73,10 @@ struct fdt_panel_config {
        int pwm_channel;                /* PWM channel to use for backlight */
        enum lcd_cache_t cache_type;
 
-       struct fdt_gpio_state backlight_en;     /* GPIO for backlight enable */
-       struct fdt_gpio_state lvds_shutdown;    /* GPIO for lvds shutdown */
-       struct fdt_gpio_state backlight_vdd;    /* GPIO for backlight vdd */
-       struct fdt_gpio_state panel_vdd;        /* GPIO for panel vdd */
+       struct gpio_desc backlight_en;  /* GPIO for backlight enable */
+       struct gpio_desc lvds_shutdown; /* GPIO for lvds shutdown */
+       struct gpio_desc backlight_vdd; /* GPIO for backlight vdd */
+       struct gpio_desc panel_vdd;     /* GPIO for panel vdd */
        /*
         * Panel required timings
         * Timing 1: delay between panel_vdd-rise and data-rise
index 484559c6cd39936e86e56a29ff89bae514a2857f..6b7d600a9c624cab1c71f46659badb1db3a1aad0 100644 (file)
@@ -72,7 +72,7 @@ struct ddrphy {
                u32 gtr;        /* General Timing Register */
                u32 rsv[3];     /* Reserved */
        } dx[9];
-} __packed;
+};
 
 #endif /* __ASSEMBLY__ */
 
index fa5e6ae0f2d822f3f559dcba42c53ad3282c4ff2..4ae67c8adb652f4b7afad39d144a861c3b9a661c 100644 (file)
 /* Memory Configuration */
 #define SG_MEMCONF                     (SG_CTRL_BASE | 0x0400)
 
-#define SG_MEMCONF_CH0_SIZE_64MB       ((0x0 << 10) | (0x01 << 0))
-#define SG_MEMCONF_CH0_SIZE_128MB      ((0x0 << 10) | (0x02 << 0))
-#define SG_MEMCONF_CH0_SIZE_256MB      ((0x0 << 10) | (0x03 << 0))
-#define SG_MEMCONF_CH0_SIZE_512MB      ((0x1 << 10) | (0x00 << 0))
-#define SG_MEMCONF_CH0_SIZE_1024MB     ((0x1 << 10) | (0x01 << 0))
+#define SG_MEMCONF_CH0_SZ_64M          ((0x0 << 10) | (0x01 << 0))
+#define SG_MEMCONF_CH0_SZ_128M         ((0x0 << 10) | (0x02 << 0))
+#define SG_MEMCONF_CH0_SZ_256M         ((0x0 << 10) | (0x03 << 0))
+#define SG_MEMCONF_CH0_SZ_512M         ((0x1 << 10) | (0x00 << 0))
+#define SG_MEMCONF_CH0_SZ_1G           ((0x1 << 10) | (0x01 << 0))
 #define SG_MEMCONF_CH0_NUM_1           (0x1 << 8)
 #define SG_MEMCONF_CH0_NUM_2           (0x0 << 8)
 
-#define SG_MEMCONF_CH1_SIZE_64MB       ((0x0 << 11) | (0x01 << 2))
-#define SG_MEMCONF_CH1_SIZE_128MB      ((0x0 << 11) | (0x02 << 2))
-#define SG_MEMCONF_CH1_SIZE_256MB      ((0x0 << 11) | (0x03 << 2))
-#define SG_MEMCONF_CH1_SIZE_512MB      ((0x1 << 11) | (0x00 << 2))
-#define SG_MEMCONF_CH1_SIZE_1024MB     ((0x1 << 11) | (0x01 << 2))
+#define SG_MEMCONF_CH1_SZ_64M          ((0x0 << 11) | (0x01 << 2))
+#define SG_MEMCONF_CH1_SZ_128M         ((0x0 << 11) | (0x02 << 2))
+#define SG_MEMCONF_CH1_SZ_256M         ((0x0 << 11) | (0x03 << 2))
+#define SG_MEMCONF_CH1_SZ_512M         ((0x1 << 11) | (0x00 << 2))
+#define SG_MEMCONF_CH1_SZ_1G           ((0x1 << 11) | (0x01 << 2))
 #define SG_MEMCONF_CH1_NUM_1           (0x1 << 9)
 #define SG_MEMCONF_CH1_NUM_2           (0x0 << 9)
 
+#define SG_MEMCONF_CH2_SZ_64M          ((0x0 << 26) | (0x01 << 16))
+#define SG_MEMCONF_CH2_SZ_128M         ((0x0 << 26) | (0x02 << 16))
+#define SG_MEMCONF_CH2_SZ_256M         ((0x0 << 26) | (0x03 << 16))
+#define SG_MEMCONF_CH2_SZ_512M         ((0x1 << 26) | (0x00 << 16))
+#define SG_MEMCONF_CH2_NUM_1           (0x1 << 24)
+#define SG_MEMCONF_CH2_NUM_2           (0x0 << 24)
+
 #define SG_MEMCONF_SPARSEMEM           (0x1 << 4)
 
 /* Pin Control */
 #else
 
 #include <linux/types.h>
+#include <linux/sizes.h>
 #include <asm/io.h>
 
 static inline void sg_set_pinsel(int n, int value)
@@ -111,24 +119,24 @@ static inline void sg_set_pinsel(int n, int value)
 
 static inline u32 sg_memconf_val_ch0(unsigned long size, int num)
 {
-       int size_mb = (size >> 20) / num;
+       int size_mb = size / num;
        u32 ret;
 
        switch (size_mb) {
-       case 64:
-               ret = SG_MEMCONF_CH0_SIZE_64MB;
+       case SZ_64M:
+               ret = SG_MEMCONF_CH0_SZ_64M;
                break;
-       case 128:
-               ret = SG_MEMCONF_CH0_SIZE_128MB;
+       case SZ_128M:
+               ret = SG_MEMCONF_CH0_SZ_128M;
                break;
-       case 256:
-               ret = SG_MEMCONF_CH0_SIZE_256MB;
+       case SZ_256M:
+               ret = SG_MEMCONF_CH0_SZ_256M;
                break;
-       case 512:
-               ret = SG_MEMCONF_CH0_SIZE_512MB;
+       case SZ_512M:
+               ret = SG_MEMCONF_CH0_SZ_512M;
                break;
-       case 1024:
-               ret = SG_MEMCONF_CH0_SIZE_1024MB;
+       case SZ_1G:
+               ret = SG_MEMCONF_CH0_SZ_1G;
                break;
        default:
                BUG();
@@ -151,24 +159,24 @@ static inline u32 sg_memconf_val_ch0(unsigned long size, int num)
 
 static inline u32 sg_memconf_val_ch1(unsigned long size, int num)
 {
-       int size_mb = (size >> 20) / num;
+       int size_mb = size / num;
        u32 ret;
 
        switch (size_mb) {
-       case 64:
-               ret = SG_MEMCONF_CH1_SIZE_64MB;
+       case SZ_64M:
+               ret = SG_MEMCONF_CH1_SZ_64M;
                break;
-       case 128:
-               ret = SG_MEMCONF_CH1_SIZE_128MB;
+       case SZ_128M:
+               ret = SG_MEMCONF_CH1_SZ_128M;
                break;
-       case 256:
-               ret = SG_MEMCONF_CH1_SIZE_256MB;
+       case SZ_256M:
+               ret = SG_MEMCONF_CH1_SZ_256M;
                break;
-       case 512:
-               ret = SG_MEMCONF_CH1_SIZE_512MB;
+       case SZ_512M:
+               ret = SG_MEMCONF_CH1_SZ_512M;
                break;
-       case 1024:
-               ret = SG_MEMCONF_CH1_SIZE_1024MB;
+       case SZ_1G:
+               ret = SG_MEMCONF_CH1_SZ_1G;
                break;
        default:
                BUG();
@@ -188,6 +196,43 @@ static inline u32 sg_memconf_val_ch1(unsigned long size, int num)
        }
        return ret;
 }
+
+static inline u32 sg_memconf_val_ch2(unsigned long size, int num)
+{
+       int size_mb = size / num;
+       u32 ret;
+
+       switch (size_mb) {
+       case SZ_64M:
+               ret = SG_MEMCONF_CH2_SZ_64M;
+               break;
+       case SZ_128M:
+               ret = SG_MEMCONF_CH2_SZ_128M;
+               break;
+       case SZ_256M:
+               ret = SG_MEMCONF_CH2_SZ_256M;
+               break;
+       case SZ_512M:
+               ret = SG_MEMCONF_CH2_SZ_512M;
+               break;
+       default:
+               BUG();
+               break;
+       }
+
+       switch (num) {
+       case 1:
+               ret |= SG_MEMCONF_CH2_NUM_1;
+               break;
+       case 2:
+               ret |= SG_MEMCONF_CH2_NUM_2;
+               break;
+       default:
+               BUG();
+               break;
+       }
+       return ret;
+}
 #endif /* __ASSEMBLY__ */
 
 #endif /* ARCH_SG_REGS_H */
index 2dbba756d737f6674ed050edad6bd212ffefb65b..a26ae872933ef1ad8309e3bac55d76637cd3edc2 100644 (file)
@@ -7,19 +7,4 @@
 #ifndef _ZYNQ_GPIO_H
 #define _ZYNQ_GPIO_H
 
-inline int gpio_get_value(unsigned gpio)
-{
-       return 0;
-}
-
-inline int gpio_set_value(unsigned gpio, int val)
-{
-       return 0;
-}
-
-inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
-
 #endif /* _ZYNQ_GPIO_H */
index 2aede0c552c62a4956028afd36a03ce411d5d55b..e2e0b7321ad44e3eeb22116ae449be1e008d1c34 100644 (file)
@@ -21,6 +21,9 @@
 #define ZYNQ_I2C_BASEADDR1             0xE0005000
 #define ZYNQ_SPI_BASEADDR0             0xE0006000
 #define ZYNQ_SPI_BASEADDR1             0xE0007000
+#define ZYNQ_QSPI_BASEADDR             0xE000D000
+#define ZYNQ_SMC_BASEADDR              0xE000E000
+#define ZYNQ_NAND_BASEADDR             0xE1000000
 #define ZYNQ_DDRC_BASEADDR             0xF8006000
 #define ZYNQ_EFUSE_BASEADDR            0xF800D000
 #define ZYNQ_USB_BASEADDR0             0xE0002000
@@ -28,7 +31,9 @@
 
 /* Bootmode setting values */
 #define ZYNQ_BM_MASK           0x7
+#define ZYNQ_BM_QSPI           0x1
 #define ZYNQ_BM_NOR            0x2
+#define ZYNQ_BM_NAND           0x4
 #define ZYNQ_BM_SD             0x5
 #define ZYNQ_BM_JTAG           0x0
 
index 89c47f3bd3fa2b87bbea973515b61c8e185ae806..9d50e2478f619c2b7d59506e7e6fda64bfc0bc2a 100644 (file)
@@ -20,7 +20,7 @@ extern void zynq_ddrc_init(void);
 extern unsigned int zynq_get_silicon_version(void);
 
 /* Driver extern functions */
-extern int zynq_sdhci_init(u32 regbase);
+extern int zynq_sdhci_init(phys_addr_t regbase);
 extern int zynq_sdhci_of_init(const void *blob);
 
 extern void ps7_init(void);
index 2fe5776c6cf390777f55c632068723e64d44034b..342f045f41419471adea238aed0fcb309e7185d2 100644 (file)
@@ -650,8 +650,8 @@ struct emif_reg_struct {
        u32 emif_rd_wr_exec_thresh;
        u32 emif_cos_config;
        u32 padding9[6];
-       u32 emif_ddr_phy_status[21];
-       u32 padding10[27];
+       u32 emif_ddr_phy_status[28];
+       u32 padding10[20];
        u32 emif_ddr_ext_phy_ctrl_1;
        u32 emif_ddr_ext_phy_ctrl_1_shdw;
        u32 emif_ddr_ext_phy_ctrl_2;
@@ -700,9 +700,36 @@ 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;
+       u32 emif_ddr_ext_phy_ctrl_25;
+       u32 emif_ddr_ext_phy_ctrl_25_shdw;
+       u32 emif_ddr_ext_phy_ctrl_26;
+       u32 emif_ddr_ext_phy_ctrl_26_shdw;
+       u32 emif_ddr_ext_phy_ctrl_27;
+       u32 emif_ddr_ext_phy_ctrl_27_shdw;
+       u32 emif_ddr_ext_phy_ctrl_28;
+       u32 emif_ddr_ext_phy_ctrl_28_shdw;
+       u32 emif_ddr_ext_phy_ctrl_29;
+       u32 emif_ddr_ext_phy_ctrl_29_shdw;
+       u32 emif_ddr_ext_phy_ctrl_30;
+       u32 emif_ddr_ext_phy_ctrl_30_shdw;
+       u32 emif_ddr_ext_phy_ctrl_31;
+       u32 emif_ddr_ext_phy_ctrl_31_shdw;
+       u32 emif_ddr_ext_phy_ctrl_32;
+       u32 emif_ddr_ext_phy_ctrl_32_shdw;
+       u32 emif_ddr_ext_phy_ctrl_33;
+       u32 emif_ddr_ext_phy_ctrl_33_shdw;
+       u32 emif_ddr_ext_phy_ctrl_34;
+       u32 emif_ddr_ext_phy_ctrl_34_shdw;
+       u32 emif_ddr_ext_phy_ctrl_35;
+       u32 emif_ddr_ext_phy_ctrl_35_shdw;
+       union {
+               u32 emif_ddr_ext_phy_ctrl_36;
+               u32 emif_ddr_fifo_misaligned_clear_1;
+       };
+       union {
+               u32 emif_ddr_ext_phy_ctrl_36_shdw;
+               u32 emif_ddr_fifo_misaligned_clear_2;
+       };
 };
 
 struct dmm_lisa_map_regs {
index 9cedeac6d641eb7b8548fb8571bcd6a261388fdb..74cfde637c1c433f3f834cdfbdac48b05ff78b6a 100644 (file)
@@ -25,10 +25,12 @@ __weak void flush_cache(unsigned long start, unsigned long size)
 #endif /* CONFIG_CPU_ARM1136 */
 
 #ifdef CONFIG_CPU_ARM926EJS
+#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
        /* test and clean, page 2-23 of arm926ejs manual */
        asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
        /* disable write buffer as well (page 2-22) */
        asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
+#endif
 #endif /* CONFIG_CPU_ARM926EJS */
        return;
 }
index dfcc596815432b4357114f6aef01b11a66596e04..c41850aaeee533a927042d54abd0202f41b2d561 100644 (file)
 
 /* Pointer to as well as the global data structure for SPL */
 DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * WARNING: This is going away very soon. Don't use it and don't submit
+ * pafches that rely on it. The global_data area is set up in crt0.S.
+ */
 gd_t gdata __attribute__ ((section(".data")));
 
 /*
@@ -28,7 +33,7 @@ void __weak board_init_f(ulong dummy)
        /* Clear the BSS. */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
-       /* Set global data pointer. */
+       /* TODO: Remove settings of the global data pointer here */
        gd = &gdata;
 
        board_init_r(NULL, 0);
index b7f118801d10b812bfea29a1a905b47498bb131a..91aa5cc89c387d90800c1146a77c6e1f196061ae 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "cpu.h"
 #include "initcode.h"
+#include "exports.h"
 
 ulong bfin_poweron_retx;
 DECLARE_GLOBAL_DATA_PTR;
@@ -121,7 +122,7 @@ static void display_global_data(void)
        printf(" |-ram_size: %lx\n", gd->ram_size);
        printf(" |-env_addr: %lx\n", gd->env_addr);
        printf(" |-env_valid: %lx\n", gd->env_valid);
-       printf(" |-jt(%p): %p\n", gd->jt, *(gd->jt));
+       printf(" |-jt(%p): %p\n", gd->jt, gd->jt->get_version);
        printf(" \\-bd: %p\n", gd->bd);
        printf("   |-bi_boot_params: %lx\n", bd->bi_boot_params);
        printf("   |-bi_memstart: %lx\n", bd->bi_memstart);
index 1757bbfa94b9df4950bcf826bc66b22a243ad9da..84c29e54091e68819891f165a30d6c0eeac1c285 100644 (file)
@@ -23,11 +23,15 @@ _start:
 
        mts     rmsr, r0        /* disable cache */
 
+       addi    r8, r0, __end
+       mts     rslr, r8
 #if defined(CONFIG_SPL_BUILD)
        addi    r1, r0, CONFIG_SPL_STACK_ADDR
+       mts     rshr, r1
        addi    r1, r1, -4      /* Decrement SP to top of memory */
 #else
        addi    r1, r0, CONFIG_SYS_INIT_SP_OFFSET
+       mts     rshr, r1
        addi    r1, r1, -4      /* Decrement SP to top of memory */
 
        /* Find-out if u-boot is running on BIG/LITTLE endian platform
@@ -130,7 +134,7 @@ flush:      bralid r15, flush_cache
 
        /* enable instruction and data cache */
        mfs     r12, rmsr
-       ori     r12, r12, 0xa0
+       ori     r12, r12, 0x1a0
        mts     rmsr, r12
 
 clear_bss:
index 4991da2226505dd73c18d9df472d3f786e442046..bc4283d2f13b551cb747d796794286eabbd83027 100644 (file)
@@ -29,12 +29,14 @@ config TARGET_MALTA
        select SUPPORTS_LITTLE_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
+       select SWAP_IO_SPACE
 
 config TARGET_VCT
        bool "Support vct"
        select SUPPORTS_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
+       select SYS_MIPS_CACHE_INIT_RAM_LOAD
 
 config TARGET_DBAU1X00
        bool "Support dbau1x00"
@@ -42,12 +44,14 @@ config TARGET_DBAU1X00
        select SUPPORTS_LITTLE_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
+       select SYS_MIPS_CACHE_INIT_RAM_LOAD
 
 config TARGET_PB1X00
        bool "Support pb1x00"
        select SUPPORTS_LITTLE_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
+       select SYS_MIPS_CACHE_INIT_RAM_LOAD
 
 
 endchoice
@@ -116,6 +120,39 @@ config CPU_MIPS64_R2
 
 endchoice
 
+menu "OS boot interface"
+
+config MIPS_BOOT_CMDLINE_LEGACY
+       bool "Hand over legacy command line to Linux kernel"
+       default y
+       help
+         Enable this option if you want U-Boot to hand over the Yamon-style
+         command line to the kernel. All bootargs will be prepared as argc/argv
+         compatible list. The argument count (argc) is stored in register $a0.
+         The address of the argument list (argv) is stored in register $a1.
+
+config MIPS_BOOT_ENV_LEGACY
+       bool "Hand over legacy environment to Linux kernel"
+       default y
+       help
+         Enable this option if you want U-Boot to hand over the Yamon-style
+         environment to the kernel. Information like memory size, initrd
+         address and size will be prepared as zero-terminated key/value list.
+         The address of the enviroment is stored in register $a2.
+
+config MIPS_BOOT_FDT
+       bool "Hand over a flattened device tree to Linux kernel (INCOMPLETE)"
+       default n
+       help
+         Enable this option if you want U-Boot to hand over a flattened
+         device tree to the kernel.
+
+         Note: the final hand over to the kernel is not yet implemented. After
+               the community agreed on the MIPS boot interface for device trees,
+               the corresponding code will be added.
+
+endmenu
+
 config SUPPORTS_BIG_ENDIAN
        bool
 
@@ -134,12 +171,26 @@ config SUPPORTS_CPU_MIPS64_R1
 config SUPPORTS_CPU_MIPS64_R2
        bool
 
+config CPU_MIPS32
+       bool
+       default y if CPU_MIPS32_R1 || CPU_MIPS32_R2
+
+config CPU_MIPS64
+       bool
+       default y if CPU_MIPS64_R1 || CPU_MIPS64_R2
+
 config 32BIT
        bool
 
 config 64BIT
        bool
 
+config SWAP_IO_SPACE
+       bool
+
+config SYS_MIPS_CACHE_INIT_RAM_LOAD
+       bool
+
 endif
 
 endmenu
index 1907b57229c1486d95e1b3338fb804df5917f7ca..43f0f5c5046b0361dfd20b8e5058edd046bbf5ad 100644 (file)
@@ -2,7 +2,9 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-head-y := arch/mips/cpu/$(CPU)/start.o
+head-y := arch/mips/cpu/start.o
 
-libs-y += arch/mips/cpu/$(CPU)/
+libs-y += arch/mips/cpu/
 libs-y += arch/mips/lib/
+
+libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
diff --git a/arch/mips/cpu/Makefile b/arch/mips/cpu/Makefile
new file mode 100644 (file)
index 0000000..fc6b455
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+extra-y        = start.o
+
+obj-y += time.o
+obj-y += interrupts.o
+obj-y += cpu.o
diff --git a/arch/mips/cpu/cpu.c b/arch/mips/cpu/cpu.c
new file mode 100644 (file)
index 0000000..8d3b2f5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <command.h>
+#include <netdev.h>
+#include <linux/compiler.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+
+void __weak _machine_restart(void)
+{
+       fprintf(stderr, "*** reset failed ***\n");
+
+       while (1)
+               /* NOP */;
+}
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       _machine_restart();
+
+       return 0;
+}
+
+void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
+{
+       write_c0_entrylo0(low0);
+       write_c0_pagemask(pagemask);
+       write_c0_entrylo1(low1);
+       write_c0_entryhi(hi);
+       write_c0_index(index);
+       tlb_write_indexed();
+}
diff --git a/arch/mips/cpu/interrupts.c b/arch/mips/cpu/interrupts.c
new file mode 100644 (file)
index 0000000..275fcf5
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+int interrupt_init(void)
+{
+       return 0;
+}
+
+void enable_interrupts(void)
+{
+}
+
+int disable_interrupts(void)
+{
+       return 0;
+}
diff --git a/arch/mips/cpu/mips32/Makefile b/arch/mips/cpu/mips32/Makefile
deleted file mode 100644 (file)
index fa82dd3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-extra-y        = start.o
-obj-y  = cache.o
-obj-y  += cpu.o interrupts.o time.o
-
-obj-$(CONFIG_SOC_AU1X00) += au1x00/
diff --git a/arch/mips/cpu/mips32/au1x00/Makefile b/arch/mips/cpu/mips32/au1x00/Makefile
deleted file mode 100644 (file)
index c5643e7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2011
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o au1x00_ide.o
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
deleted file mode 100644 (file)
index 4770f56..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Only eth0 supported for now
- *
- * (C) Copyright 2003
- * Thomas.Lange@corelatus.se
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-#include <config.h>
-
-#if defined(CONFIG_SYS_DISCOVER_PHY)
-#error "PHY not supported yet"
-/* We just assume that we are running 100FD for now */
-/* We all use switches, right? ;-) */
-#endif
-
-/* I assume ethernet behaves like au1000 */
-
-#ifdef CONFIG_SOC_AU1000
-/* Base address differ between cpu:s */
-#define ETH0_BASE AU1000_ETH0_BASE
-#define MAC0_ENABLE AU1000_MAC0_ENABLE
-#else
-#ifdef CONFIG_SOC_AU1100
-#define ETH0_BASE AU1100_ETH0_BASE
-#define MAC0_ENABLE AU1100_MAC0_ENABLE
-#else
-#ifdef CONFIG_SOC_AU1500
-#define ETH0_BASE AU1500_ETH0_BASE
-#define MAC0_ENABLE AU1500_MAC0_ENABLE
-#else
-#ifdef CONFIG_SOC_AU1550
-#define ETH0_BASE AU1550_ETH0_BASE
-#define MAC0_ENABLE AU1550_MAC0_ENABLE
-#else
-#error "No valid cpu set"
-#endif
-#endif
-#endif
-#endif
-
-#include <common.h>
-#include <malloc.h>
-#include <net.h>
-#include <command.h>
-#include <asm/io.h>
-#include <asm/au1x00.h>
-
-#if defined(CONFIG_CMD_MII)
-#include <miiphy.h>
-#endif
-
-/* Ethernet Transmit and Receive Buffers */
-#define DBUF_LENGTH  1520
-#define PKT_MAXBUF_SIZE                1518
-
-static char txbuf[DBUF_LENGTH];
-
-static int next_tx;
-static int next_rx;
-
-/* 4 rx and 4 tx fifos */
-#define NO_OF_FIFOS 4
-
-typedef struct{
-       u32 status;
-       u32 addr;
-       u32 len; /* Only used for tx */
-       u32 not_used;
-} mac_fifo_t;
-
-mac_fifo_t mac_fifo[NO_OF_FIFOS];
-
-#define MAX_WAIT 1000
-
-#if defined(CONFIG_CMD_MII)
-int  au1x00_miiphy_read(const char *devname, unsigned char addr,
-               unsigned char reg, unsigned short * value)
-{
-       volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
-       volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
-       u32 mii_control;
-       unsigned int timedout = 20;
-
-       while (*mii_control_reg & MAC_MII_BUSY) {
-               udelay(1000);
-               if (--timedout == 0) {
-                       printf("au1x00_eth: miiphy_read busy timeout!!\n");
-                       return -1;
-               }
-       }
-
-       mii_control = MAC_SET_MII_SELECT_REG(reg) |
-               MAC_SET_MII_SELECT_PHY(addr) | MAC_MII_READ;
-
-       *mii_control_reg = mii_control;
-
-       timedout = 20;
-       while (*mii_control_reg & MAC_MII_BUSY) {
-               udelay(1000);
-               if (--timedout == 0) {
-                       printf("au1x00_eth: miiphy_read busy timeout!!\n");
-                       return -1;
-               }
-       }
-       *value = *mii_data_reg;
-       return 0;
-}
-
-int  au1x00_miiphy_write(const char *devname, unsigned char addr,
-               unsigned char reg, unsigned short value)
-{
-       volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
-       volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
-       u32 mii_control;
-       unsigned int timedout = 20;
-
-       while (*mii_control_reg & MAC_MII_BUSY) {
-               udelay(1000);
-               if (--timedout == 0) {
-                       printf("au1x00_eth: miiphy_write busy timeout!!\n");
-                       return -1;
-               }
-       }
-
-       mii_control = MAC_SET_MII_SELECT_REG(reg) |
-               MAC_SET_MII_SELECT_PHY(addr) | MAC_MII_WRITE;
-
-       *mii_data_reg = value;
-       *mii_control_reg = mii_control;
-       return 0;
-}
-#endif
-
-static int au1x00_send(struct eth_device *dev, void *packet, int length)
-{
-       volatile mac_fifo_t *fifo_tx =
-               (volatile mac_fifo_t*)(MAC0_TX_DMA_ADDR+MAC_TX_BUFF0_STATUS);
-       int i;
-       int res;
-
-       /* tx fifo should always be idle */
-       fifo_tx[next_tx].len = length;
-       fifo_tx[next_tx].addr = (virt_to_phys(packet))|TX_DMA_ENABLE;
-       au_sync();
-
-       udelay(1);
-       i=0;
-       while(!(fifo_tx[next_tx].addr&TX_T_DONE)){
-               if(i>MAX_WAIT){
-                       printf("TX timeout\n");
-                       break;
-               }
-               udelay(1);
-               i++;
-       }
-
-       /* Clear done bit */
-       fifo_tx[next_tx].addr = 0;
-       fifo_tx[next_tx].len = 0;
-       au_sync();
-
-       res = fifo_tx[next_tx].status;
-
-       next_tx++;
-       if(next_tx>=NO_OF_FIFOS){
-               next_tx=0;
-       }
-       return(res);
-}
-
-static int au1x00_recv(struct eth_device* dev){
-       volatile mac_fifo_t *fifo_rx =
-               (volatile mac_fifo_t*)(MAC0_RX_DMA_ADDR+MAC_RX_BUFF0_STATUS);
-
-       int length;
-       u32 status;
-
-       for(;;){
-               if(!(fifo_rx[next_rx].addr&RX_T_DONE)){
-                       /* Nothing has been received */
-                       return(-1);
-               }
-
-               status = fifo_rx[next_rx].status;
-
-               length = status&0x3FFF;
-
-               if(status&RX_ERROR){
-                       printf("Rx error 0x%x\n", status);
-               }
-               else{
-                       /* Pass the packet up to the protocol layers. */
-                       NetReceive(NetRxPackets[next_rx], length - 4);
-               }
-
-               fifo_rx[next_rx].addr = (virt_to_phys(NetRxPackets[next_rx]))|RX_DMA_ENABLE;
-
-               next_rx++;
-               if(next_rx>=NO_OF_FIFOS){
-                       next_rx=0;
-               }
-       } /* for */
-
-       return(0); /* Does anyone use this? */
-}
-
-static int au1x00_init(struct eth_device* dev, bd_t * bd){
-
-       volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
-       volatile u32 *mac_ctrl = (volatile u32*)(ETH0_BASE+MAC_CONTROL);
-       volatile u32 *mac_addr_high = (volatile u32*)(ETH0_BASE+MAC_ADDRESS_HIGH);
-       volatile u32 *mac_addr_low = (volatile u32*)(ETH0_BASE+MAC_ADDRESS_LOW);
-       volatile u32 *mac_mcast_high = (volatile u32*)(ETH0_BASE+MAC_MCAST_HIGH);
-       volatile u32 *mac_mcast_low = (volatile u32*)(ETH0_BASE+MAC_MCAST_LOW);
-       volatile mac_fifo_t *fifo_tx =
-               (volatile mac_fifo_t*)(MAC0_TX_DMA_ADDR+MAC_TX_BUFF0_STATUS);
-       volatile mac_fifo_t *fifo_rx =
-               (volatile mac_fifo_t*)(MAC0_RX_DMA_ADDR+MAC_RX_BUFF0_STATUS);
-       int i;
-
-       next_tx = TX_GET_DMA_BUFFER(fifo_tx[0].addr);
-       next_rx = RX_GET_DMA_BUFFER(fifo_rx[0].addr);
-
-       /* We have to enable clocks before releasing reset */
-       *macen = MAC_EN_CLOCK_ENABLE;
-       udelay(10);
-
-       /* Enable MAC0 */
-       /* We have to release reset before accessing registers */
-       *macen = MAC_EN_CLOCK_ENABLE|MAC_EN_RESET0|
-               MAC_EN_RESET1|MAC_EN_RESET2;
-       udelay(10);
-
-       for(i=0;i<NO_OF_FIFOS;i++){
-               fifo_tx[i].len = 0;
-               fifo_tx[i].addr = virt_to_phys(&txbuf[0]);
-               fifo_rx[i].addr = (virt_to_phys(NetRxPackets[i]))|RX_DMA_ENABLE;
-       }
-
-       /* Put mac addr in little endian */
-#define ea eth_get_dev()->enetaddr
-       *mac_addr_high  =       (ea[5] <<  8) | (ea[4]      ) ;
-       *mac_addr_low   =       (ea[3] << 24) | (ea[2] << 16) |
-               (ea[1] <<  8) | (ea[0]      ) ;
-#undef ea
-       *mac_mcast_low = 0;
-       *mac_mcast_high = 0;
-
-       /* Make sure the MAC buffer is in the correct endian mode */
-#ifdef __LITTLE_ENDIAN
-       *mac_ctrl = MAC_FULL_DUPLEX;
-       udelay(1);
-       *mac_ctrl = MAC_FULL_DUPLEX|MAC_RX_ENABLE|MAC_TX_ENABLE;
-#else
-       *mac_ctrl = MAC_BIG_ENDIAN|MAC_FULL_DUPLEX;
-       udelay(1);
-       *mac_ctrl = MAC_BIG_ENDIAN|MAC_FULL_DUPLEX|MAC_RX_ENABLE|MAC_TX_ENABLE;
-#endif
-
-       return(1);
-}
-
-static void au1x00_halt(struct eth_device* dev){
-       volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
-
-       /* Put MAC0 in reset */
-       *macen = 0;
-}
-
-int au1x00_enet_initialize(bd_t *bis){
-       struct eth_device* dev;
-
-       if ((dev = (struct eth_device*)malloc(sizeof *dev)) == NULL) {
-               puts ("malloc failed\n");
-               return -1;
-       }
-
-       memset(dev, 0, sizeof *dev);
-
-       sprintf(dev->name, "Au1X00 ethernet");
-       dev->iobase = 0;
-       dev->priv   = 0;
-       dev->init   = au1x00_init;
-       dev->halt   = au1x00_halt;
-       dev->send   = au1x00_send;
-       dev->recv   = au1x00_recv;
-
-       eth_register(dev);
-
-#if defined(CONFIG_CMD_MII)
-       miiphy_register(dev->name,
-               au1x00_miiphy_read, au1x00_miiphy_write);
-#endif
-
-       return 1;
-}
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c
deleted file mode 100644 (file)
index ba0b35d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * (C) Copyright 2000-2011
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <ide.h>
-
-/* AU1X00 swaps data in big-endian mode, enforce little-endian function */
-void ide_input_swap_data(int dev, ulong *sect_buf, int words)
-{
-       ide_input_data(dev, sect_buf, words);
-}
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_serial.c b/arch/mips/cpu/mips32/au1x00/au1x00_serial.c
deleted file mode 100644 (file)
index 0463508..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * AU1X00 UART support
- *
- * Hardcoded to UART 0 for now
- * Speed and options also hardcoded to 115200 8N1
- *
- *  Copyright (c) 2003 Thomas.Lange@corelatus.se
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <common.h>
-#include <asm/au1x00.h>
-#include <serial.h>
-#include <linux/compiler.h>
-
-/******************************************************************************
-*
-* serial_init - initialize a channel
-*
-* This routine initializes the number of data bits, parity
-* and set the selected baud rate. Interrupts are disabled.
-* Set the modem control signals if the option is selected.
-*
-* RETURNS: N/A
-*/
-
-static int au1x00_serial_init(void)
-{
-       volatile u32 *uart_fifoctl = (volatile u32*)(UART0_ADDR+UART_FCR);
-       volatile u32 *uart_enable = (volatile u32*)(UART0_ADDR+UART_ENABLE);
-
-       /* Enable clocks first */
-       *uart_enable = UART_EN_CE;
-
-       /* Then release reset */
-       /* Must release reset before setting other regs */
-       *uart_enable = UART_EN_CE|UART_EN_E;
-
-       /* Activate fifos, reset tx and rx */
-       /* Set tx trigger level to 12 */
-       *uart_fifoctl = UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|
-               UART_FCR_CLEAR_XMIT|UART_FCR_T_TRIGGER_12;
-
-       serial_setbrg();
-
-       return 0;
-}
-
-
-static void au1x00_serial_setbrg(void)
-{
-       volatile u32 *uart_clk = (volatile u32*)(UART0_ADDR+UART_CLK);
-       volatile u32 *uart_lcr = (volatile u32*)(UART0_ADDR+UART_LCR);
-       volatile u32 *sys_powerctrl = (u32 *)SYS_POWERCTRL;
-       int sd;
-       int divisorx2;
-
-       /* sd is system clock divisor                   */
-       /* see section 10.4.5 in au1550 datasheet       */
-       sd = (*sys_powerctrl & 0x03) + 2;
-
-       /* calulate 2x baudrate and round */
-       divisorx2 = ((CONFIG_SYS_MIPS_TIMER_FREQ/(sd * 16 * CONFIG_BAUDRATE)));
-
-       if (divisorx2 & 0x01)
-               divisorx2 = divisorx2 + 1;
-
-       *uart_clk = divisorx2 / 2;
-
-       /* Set parity, stop bits and word length to 8N1 */
-       *uart_lcr = UART_LCR_WLEN8;
-}
-
-static void au1x00_serial_putc(const char c)
-{
-       volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
-       volatile u32 *uart_tx = (volatile u32*)(UART0_ADDR+UART_TX);
-
-       if (c == '\n')
-               au1x00_serial_putc('\r');
-
-       /* Wait for fifo to shift out some bytes */
-       while((*uart_lsr&UART_LSR_THRE)==0);
-
-       *uart_tx = (u32)c;
-}
-
-static int au1x00_serial_getc(void)
-{
-       volatile u32 *uart_rx = (volatile u32*)(UART0_ADDR+UART_RX);
-       char c;
-
-       while (!serial_tstc());
-
-       c = (*uart_rx&0xFF);
-       return c;
-}
-
-static int au1x00_serial_tstc(void)
-{
-       volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
-
-       if(*uart_lsr&UART_LSR_DR){
-               /* Data in rfifo */
-               return(1);
-       }
-       return 0;
-}
-
-static struct serial_device au1x00_serial_drv = {
-       .name   = "au1x00_serial",
-       .start  = au1x00_serial_init,
-       .stop   = NULL,
-       .setbrg = au1x00_serial_setbrg,
-       .putc   = au1x00_serial_putc,
-       .puts   = default_serial_puts,
-       .getc   = au1x00_serial_getc,
-       .tstc   = au1x00_serial_tstc,
-};
-
-void au1x00_serial_initialize(void)
-{
-       serial_register(&au1x00_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
-       return &au1x00_serial_drv;
-}
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
deleted file mode 100644 (file)
index 74bdb77..0000000
+++ /dev/null
@@ -1,1609 +0,0 @@
-/*
- * URB OHCI HCD (Host Controller Driver) for USB on the AU1x00.
- *
- * (C) Copyright 2003
- * Gary Jennejohn, DENX Software Engineering <garyj@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- * Note: Part of this code has been derived from linux
- *
- */
-/*
- * IMPORTANT NOTES
- * 1 - this driver is intended for use with USB Mass Storage Devices
- *     (BBB) ONLY. There is NO support for Interrupt or Isochronous pipes!
- */
-
-#include <config.h>
-
-#ifdef CONFIG_USB_OHCI
-
-/* #include <pci.h> no PCI on the AU1x00 */
-
-#include <common.h>
-#include <malloc.h>
-#include <asm/io.h>
-#include <asm/au1x00.h>
-#include <usb.h>
-#include "au1x00_usb_ohci.h"
-
-#define OHCI_USE_NPS           /* force NoPowerSwitching mode */
-#define OHCI_VERBOSE_DEBUG     /* not always helpful */
-#define OHCI_FILL_TRACE
-
-#define USBH_ENABLE_BE (1<<0)
-#define USBH_ENABLE_C  (1<<1)
-#define USBH_ENABLE_E  (1<<2)
-#define USBH_ENABLE_CE (1<<3)
-#define USBH_ENABLE_RD (1<<4)
-
-#ifdef __LITTLE_ENDIAN
-#define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C)
-#else
-#define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C | USBH_ENABLE_BE)
-#endif
-
-
-/* For initializing controller (mask in an HCFS mode too) */
-#define OHCI_CONTROL_INIT \
-       (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
-
-#undef readl
-#undef writel
-
-#define readl(a)     au_readl((long)(a))
-#define writel(v,a)  au_writel((v),(int)(a))
-
-#define DEBUG
-#ifdef DEBUG
-#define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
-#else
-#define dbg(format, arg...) do {} while(0)
-#endif /* DEBUG */
-#define err(format, arg...) printf("ERROR: " format "\n", ## arg)
-#define SHOW_INFO
-#ifdef SHOW_INFO
-#define info(format, arg...) printf("INFO: " format "\n", ## arg)
-#else
-#define info(format, arg...) do {} while(0)
-#endif
-
-#define m16_swap(x) swap_16(x)
-#define m32_swap(x) swap_32(x)
-
-/* global ohci_t */
-static ohci_t gohci;
-/* this must be aligned to a 256 byte boundary */
-struct ohci_hcca ghcca[1];
-/* a pointer to the aligned storage */
-struct ohci_hcca *phcca;
-/* this allocates EDs for all possible endpoints */
-struct ohci_device ohci_dev;
-/* urb_priv */
-urb_priv_t urb_priv;
-/* RHSC flag */
-int got_rhsc;
-/* device which was disconnected */
-struct usb_device *devgone;
-
-/*-------------------------------------------------------------------------*/
-
-/* AMD-756 (D2 rev) reports corrupt register contents in some cases.
- * The erratum (#4) description is incorrect.  AMD's workaround waits
- * till some bits (mostly reserved) are clear; ok for all revs.
- */
-#define OHCI_QUIRK_AMD756 0xabcd
-#define read_roothub(hc, register, mask) ({ \
-       u32 temp = readl (&hc->regs->roothub.register); \
-       if (hc->flags & OHCI_QUIRK_AMD756) \
-               while (temp & mask) \
-                       temp = readl (&hc->regs->roothub.register); \
-       temp; })
-
-static u32 roothub_a (struct ohci *hc)
-       { return read_roothub (hc, a, 0xfc0fe000); }
-static inline u32 roothub_b (struct ohci *hc)
-       { return readl (&hc->regs->roothub.b); }
-static inline u32 roothub_status (struct ohci *hc)
-       { return readl (&hc->regs->roothub.status); }
-static u32 roothub_portstatus (struct ohci *hc, int i)
-       { return read_roothub (hc, portstatus [i], 0xffe0fce0); }
-
-
-/* forward declaration */
-static int hc_interrupt (void);
-static void
-td_submit_job (struct usb_device * dev, unsigned long pipe, void * buffer,
-       int transfer_len, struct devrequest * setup, urb_priv_t * urb, int interval);
-
-/*-------------------------------------------------------------------------*
- * URB support functions
- *-------------------------------------------------------------------------*/
-
-/* free HCD-private data associated with this URB */
-
-static void urb_free_priv (urb_priv_t * urb)
-{
-       int             i;
-       int             last;
-       struct td       * td;
-
-       last = urb->length - 1;
-       if (last >= 0) {
-               for (i = 0; i <= last; i++) {
-                       td = urb->td[i];
-                       if (td) {
-                               td->usb_dev = NULL;
-                               urb->td[i] = NULL;
-                       }
-               }
-       }
-}
-
-/*-------------------------------------------------------------------------*/
-
-#ifdef DEBUG
-static int sohci_get_current_frame_number (struct usb_device * dev);
-
-/* debug| print the main components of an URB
- * small: 0) header + data packets 1) just header */
-
-static void pkt_print (struct usb_device * dev, unsigned long pipe, void * buffer,
-       int transfer_len, struct devrequest * setup, char * str, int small)
-{
-       urb_priv_t * purb = &urb_priv;
-
-       dbg("%s URB:[%4x] dev:%2d,ep:%2d-%c,type:%s,len:%d/%d stat:%#lx",
-                       str,
-                       sohci_get_current_frame_number (dev),
-                       usb_pipedevice (pipe),
-                       usb_pipeendpoint (pipe),
-                       usb_pipeout (pipe)? 'O': 'I',
-                       usb_pipetype (pipe) < 2? (usb_pipeint (pipe)? "INTR": "ISOC"):
-                               (usb_pipecontrol (pipe)? "CTRL": "BULK"),
-                       purb->actual_length,
-                       transfer_len, dev->status);
-#ifdef OHCI_VERBOSE_DEBUG
-       if (!small) {
-               int i, len;
-
-               if (usb_pipecontrol (pipe)) {
-                       printf (__FILE__ ": cmd(8):");
-                       for (i = 0; i < 8 ; i++)
-                               printf (" %02x", ((__u8 *) setup) [i]);
-                       printf ("\n");
-               }
-               if (transfer_len > 0 && buffer) {
-                       printf (__FILE__ ": data(%d/%d):",
-                               purb->actual_length,
-                               transfer_len);
-                       len = usb_pipeout (pipe)?
-                                       transfer_len: purb->actual_length;
-                       for (i = 0; i < 16 && i < len; i++)
-                               printf (" %02x", ((__u8 *) buffer) [i]);
-                       printf ("%s\n", i < len? "...": "");
-               }
-       }
-#endif
-}
-
-/* just for debugging; prints non-empty branches of the int ed tree inclusive iso eds*/
-void ep_print_int_eds (ohci_t *ohci, char * str) {
-       int i, j;
-        __u32 * ed_p;
-       for (i= 0; i < 32; i++) {
-               j = 5;
-               ed_p = &(ohci->hcca->int_table [i]);
-               if (*ed_p == 0)
-                   continue;
-               printf (__FILE__ ": %s branch int %2d(%2x):", str, i, i);
-               while (*ed_p != 0 && j--) {
-                       ed_t *ed = (ed_t *)m32_swap(ed_p);
-                       printf (" ed: %4x;", ed->hwINFO);
-                       ed_p = &ed->hwNextED;
-               }
-               printf ("\n");
-       }
-}
-
-static void ohci_dump_intr_mask (char *label, __u32 mask)
-{
-       dbg ("%s: 0x%08x%s%s%s%s%s%s%s%s%s",
-               label,
-               mask,
-               (mask & OHCI_INTR_MIE) ? " MIE" : "",
-               (mask & OHCI_INTR_OC) ? " OC" : "",
-               (mask & OHCI_INTR_RHSC) ? " RHSC" : "",
-               (mask & OHCI_INTR_FNO) ? " FNO" : "",
-               (mask & OHCI_INTR_UE) ? " UE" : "",
-               (mask & OHCI_INTR_RD) ? " RD" : "",
-               (mask & OHCI_INTR_SF) ? " SF" : "",
-               (mask & OHCI_INTR_WDH) ? " WDH" : "",
-               (mask & OHCI_INTR_SO) ? " SO" : ""
-               );
-}
-
-static void maybe_print_eds (char *label, __u32 value)
-{
-       ed_t *edp = (ed_t *)value;
-
-       if (value) {
-               dbg ("%s %08x", label, value);
-               dbg ("%08x", edp->hwINFO);
-               dbg ("%08x", edp->hwTailP);
-               dbg ("%08x", edp->hwHeadP);
-               dbg ("%08x", edp->hwNextED);
-       }
-}
-
-static char * hcfs2string (int state)
-{
-       switch (state) {
-               case OHCI_USB_RESET:    return "reset";
-               case OHCI_USB_RESUME:   return "resume";
-               case OHCI_USB_OPER:     return "operational";
-               case OHCI_USB_SUSPEND:  return "suspend";
-       }
-       return "?";
-}
-
-/* dump control and status registers */
-static void ohci_dump_status (ohci_t *controller)
-{
-       struct ohci_regs        *regs = controller->regs;
-       __u32                   temp;
-
-       temp = readl (&regs->revision) & 0xff;
-       if (temp != 0x10)
-               dbg ("spec %d.%d", (temp >> 4), (temp & 0x0f));
-
-       temp = readl (&regs->control);
-       dbg ("control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d", temp,
-               (temp & OHCI_CTRL_RWE) ? " RWE" : "",
-               (temp & OHCI_CTRL_RWC) ? " RWC" : "",
-               (temp & OHCI_CTRL_IR) ? " IR" : "",
-               hcfs2string (temp & OHCI_CTRL_HCFS),
-               (temp & OHCI_CTRL_BLE) ? " BLE" : "",
-               (temp & OHCI_CTRL_CLE) ? " CLE" : "",
-               (temp & OHCI_CTRL_IE) ? " IE" : "",
-               (temp & OHCI_CTRL_PLE) ? " PLE" : "",
-               temp & OHCI_CTRL_CBSR
-               );
-
-       temp = readl (&regs->cmdstatus);
-       dbg ("cmdstatus: 0x%08x SOC=%d%s%s%s%s", temp,
-               (temp & OHCI_SOC) >> 16,
-               (temp & OHCI_OCR) ? " OCR" : "",
-               (temp & OHCI_BLF) ? " BLF" : "",
-               (temp & OHCI_CLF) ? " CLF" : "",
-               (temp & OHCI_HCR) ? " HCR" : ""
-               );
-
-       ohci_dump_intr_mask ("intrstatus", readl (&regs->intrstatus));
-       ohci_dump_intr_mask ("intrenable", readl (&regs->intrenable));
-
-       maybe_print_eds ("ed_periodcurrent", readl (&regs->ed_periodcurrent));
-
-       maybe_print_eds ("ed_controlhead", readl (&regs->ed_controlhead));
-       maybe_print_eds ("ed_controlcurrent", readl (&regs->ed_controlcurrent));
-
-       maybe_print_eds ("ed_bulkhead", readl (&regs->ed_bulkhead));
-       maybe_print_eds ("ed_bulkcurrent", readl (&regs->ed_bulkcurrent));
-
-       maybe_print_eds ("donehead", readl (&regs->donehead));
-}
-
-static void ohci_dump_roothub (ohci_t *controller, int verbose)
-{
-       __u32                   temp, ndp, i;
-
-       temp = roothub_a (controller);
-       ndp = (temp & RH_A_NDP);
-
-       if (verbose) {
-               dbg ("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d", temp,
-                       ((temp & RH_A_POTPGT) >> 24) & 0xff,
-                       (temp & RH_A_NOCP) ? " NOCP" : "",
-                       (temp & RH_A_OCPM) ? " OCPM" : "",
-                       (temp & RH_A_DT) ? " DT" : "",
-                       (temp & RH_A_NPS) ? " NPS" : "",
-                       (temp & RH_A_PSM) ? " PSM" : "",
-                       ndp
-                       );
-               temp = roothub_b (controller);
-               dbg ("roothub.b: %08x PPCM=%04x DR=%04x",
-                       temp,
-                       (temp & RH_B_PPCM) >> 16,
-                       (temp & RH_B_DR)
-                       );
-               temp = roothub_status (controller);
-               dbg ("roothub.status: %08x%s%s%s%s%s%s",
-                       temp,
-                       (temp & RH_HS_CRWE) ? " CRWE" : "",
-                       (temp & RH_HS_OCIC) ? " OCIC" : "",
-                       (temp & RH_HS_LPSC) ? " LPSC" : "",
-                       (temp & RH_HS_DRWE) ? " DRWE" : "",
-                       (temp & RH_HS_OCI) ? " OCI" : "",
-                       (temp & RH_HS_LPS) ? " LPS" : ""
-                       );
-       }
-
-       for (i = 0; i < ndp; i++) {
-               temp = roothub_portstatus (controller, i);
-               dbg ("roothub.portstatus [%d] = 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s",
-                       i,
-                       temp,
-                       (temp & RH_PS_PRSC) ? " PRSC" : "",
-                       (temp & RH_PS_OCIC) ? " OCIC" : "",
-                       (temp & RH_PS_PSSC) ? " PSSC" : "",
-                       (temp & RH_PS_PESC) ? " PESC" : "",
-                       (temp & RH_PS_CSC) ? " CSC" : "",
-
-                       (temp & RH_PS_LSDA) ? " LSDA" : "",
-                       (temp & RH_PS_PPS) ? " PPS" : "",
-                       (temp & RH_PS_PRS) ? " PRS" : "",
-                       (temp & RH_PS_POCI) ? " POCI" : "",
-                       (temp & RH_PS_PSS) ? " PSS" : "",
-
-                       (temp & RH_PS_PES) ? " PES" : "",
-                       (temp & RH_PS_CCS) ? " CCS" : ""
-                       );
-       }
-}
-
-static void ohci_dump (ohci_t *controller, int verbose)
-{
-       dbg ("OHCI controller usb-%s state", controller->slot_name);
-
-       /* dumps some of the state we know about */
-       ohci_dump_status (controller);
-       if (verbose)
-               ep_print_int_eds (controller, "hcca");
-       dbg ("hcca frame #%04x", controller->hcca->frame_no);
-       ohci_dump_roothub (controller, 1);
-}
-
-
-#endif /* DEBUG */
-
-/*-------------------------------------------------------------------------*
- * Interface functions (URB)
- *-------------------------------------------------------------------------*/
-
-/* get a transfer request */
-
-int sohci_submit_job(struct usb_device *dev, unsigned long pipe, void *buffer,
-               int transfer_len, struct devrequest *setup, int interval)
-{
-       ohci_t *ohci;
-       ed_t * ed;
-       urb_priv_t *purb_priv;
-       int i, size = 0;
-
-       ohci = &gohci;
-
-       /* when controller's hung, permit only roothub cleanup attempts
-        * such as powering down ports */
-       if (ohci->disabled) {
-               err("sohci_submit_job: EPIPE");
-               return -1;
-       }
-
-       /* every endpoint has a ed, locate and fill it */
-       if (!(ed = ep_add_ed (dev, pipe))) {
-               err("sohci_submit_job: ENOMEM");
-               return -1;
-       }
-
-       /* for the private part of the URB we need the number of TDs (size) */
-       switch (usb_pipetype (pipe)) {
-               case PIPE_BULK: /* one TD for every 4096 Byte */
-                       size = (transfer_len - 1) / 4096 + 1;
-                       break;
-               case PIPE_CONTROL: /* 1 TD for setup, 1 for ACK and 1 for every 4096 B */
-                       size = (transfer_len == 0)? 2:
-                                               (transfer_len - 1) / 4096 + 3;
-                       break;
-       }
-
-       if (size >= (N_URB_TD - 1)) {
-               err("need %d TDs, only have %d", size, N_URB_TD);
-               return -1;
-       }
-       purb_priv = &urb_priv;
-       purb_priv->pipe = pipe;
-
-       /* fill the private part of the URB */
-       purb_priv->length = size;
-       purb_priv->ed = ed;
-       purb_priv->actual_length = 0;
-
-       /* allocate the TDs */
-       /* note that td[0] was allocated in ep_add_ed */
-       for (i = 0; i < size; i++) {
-               purb_priv->td[i] = td_alloc (dev);
-               if (!purb_priv->td[i]) {
-                       purb_priv->length = i;
-                       urb_free_priv (purb_priv);
-                       err("sohci_submit_job: ENOMEM");
-                       return -1;
-               }
-       }
-
-       if (ed->state == ED_NEW || (ed->state & ED_DEL)) {
-               urb_free_priv (purb_priv);
-               err("sohci_submit_job: EINVAL");
-               return -1;
-       }
-
-       /* link the ed into a chain if is not already */
-       if (ed->state != ED_OPER)
-               ep_link (ohci, ed);
-
-       /* fill the TDs and link it to the ed */
-       td_submit_job(dev, pipe, buffer, transfer_len, setup, purb_priv, interval);
-
-       return 0;
-}
-
-/*-------------------------------------------------------------------------*/
-
-#ifdef DEBUG
-/* tell us the current USB frame number */
-
-static int sohci_get_current_frame_number (struct usb_device *usb_dev)
-{
-       ohci_t *ohci = &gohci;
-
-       return m16_swap (ohci->hcca->frame_no);
-}
-#endif
-
-/*-------------------------------------------------------------------------*
- * ED handling functions
- *-------------------------------------------------------------------------*/
-
-/* link an ed into one of the HC chains */
-
-static int ep_link (ohci_t *ohci, ed_t *edi)
-{
-       volatile ed_t *ed = edi;
-
-       ed->state = ED_OPER;
-
-       switch (ed->type) {
-       case PIPE_CONTROL:
-               ed->hwNextED = 0;
-               if (ohci->ed_controltail == NULL) {
-                       writel ((long)ed, &ohci->regs->ed_controlhead);
-               } else {
-                       ohci->ed_controltail->hwNextED = m32_swap (ed);
-               }
-               ed->ed_prev = ohci->ed_controltail;
-               if (!ohci->ed_controltail && !ohci->ed_rm_list[0] &&
-                       !ohci->ed_rm_list[1] && !ohci->sleeping) {
-                       ohci->hc_control |= OHCI_CTRL_CLE;
-                       writel (ohci->hc_control, &ohci->regs->control);
-               }
-               ohci->ed_controltail = edi;
-               break;
-
-       case PIPE_BULK:
-               ed->hwNextED = 0;
-               if (ohci->ed_bulktail == NULL) {
-                       writel ((long)ed, &ohci->regs->ed_bulkhead);
-               } else {
-                       ohci->ed_bulktail->hwNextED = m32_swap (ed);
-               }
-               ed->ed_prev = ohci->ed_bulktail;
-               if (!ohci->ed_bulktail && !ohci->ed_rm_list[0] &&
-                       !ohci->ed_rm_list[1] && !ohci->sleeping) {
-                       ohci->hc_control |= OHCI_CTRL_BLE;
-                       writel (ohci->hc_control, &ohci->regs->control);
-               }
-               ohci->ed_bulktail = edi;
-               break;
-       }
-       return 0;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* unlink an ed from one of the HC chains.
- * just the link to the ed is unlinked.
- * the link from the ed still points to another operational ed or 0
- * so the HC can eventually finish the processing of the unlinked ed */
-
-static int ep_unlink (ohci_t *ohci, ed_t *ed)
-{
-       ed->hwINFO |= m32_swap (OHCI_ED_SKIP);
-
-       switch (ed->type) {
-       case PIPE_CONTROL:
-               if (ed->ed_prev == NULL) {
-                       if (!ed->hwNextED) {
-                               ohci->hc_control &= ~OHCI_CTRL_CLE;
-                               writel (ohci->hc_control, &ohci->regs->control);
-                       }
-                       writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_controlhead);
-               } else {
-                       ed->ed_prev->hwNextED = ed->hwNextED;
-               }
-               if (ohci->ed_controltail == ed) {
-                       ohci->ed_controltail = ed->ed_prev;
-               } else {
-                       ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
-               }
-               break;
-
-       case PIPE_BULK:
-               if (ed->ed_prev == NULL) {
-                       if (!ed->hwNextED) {
-                               ohci->hc_control &= ~OHCI_CTRL_BLE;
-                               writel (ohci->hc_control, &ohci->regs->control);
-                       }
-                       writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_bulkhead);
-               } else {
-                       ed->ed_prev->hwNextED = ed->hwNextED;
-               }
-               if (ohci->ed_bulktail == ed) {
-                       ohci->ed_bulktail = ed->ed_prev;
-               } else {
-                       ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
-               }
-               break;
-       }
-       ed->state = ED_UNLINK;
-       return 0;
-}
-
-
-/*-------------------------------------------------------------------------*/
-
-/* add/reinit an endpoint; this should be done once at the usb_set_configuration command,
- * but the USB stack is a little bit stateless so we do it at every transaction
- * if the state of the ed is ED_NEW then a dummy td is added and the state is changed to ED_UNLINK
- * in all other cases the state is left unchanged
- * the ed info fields are setted anyway even though most of them should not change */
-
-static ed_t * ep_add_ed (struct usb_device *usb_dev, unsigned long pipe)
-{
-       td_t *td;
-       ed_t *ed_ret;
-       volatile ed_t *ed;
-
-       ed = ed_ret = &ohci_dev.ed[(usb_pipeendpoint (pipe) << 1) |
-                       (usb_pipecontrol (pipe)? 0: usb_pipeout (pipe))];
-
-       if ((ed->state & ED_DEL) || (ed->state & ED_URB_DEL)) {
-               err("ep_add_ed: pending delete");
-               /* pending delete request */
-               return NULL;
-       }
-
-       if (ed->state == ED_NEW) {
-               ed->hwINFO = m32_swap (OHCI_ED_SKIP); /* skip ed */
-               /* dummy td; end of td list for ed */
-               td = td_alloc (usb_dev);
-               ed->hwTailP = m32_swap (td);
-               ed->hwHeadP = ed->hwTailP;
-               ed->state = ED_UNLINK;
-               ed->type = usb_pipetype (pipe);
-               ohci_dev.ed_cnt++;
-       }
-
-       ed->hwINFO = m32_swap (usb_pipedevice (pipe)
-                       | usb_pipeendpoint (pipe) << 7
-                       | (usb_pipeisoc (pipe)? 0x8000: 0)
-                       | (usb_pipecontrol (pipe)? 0: (usb_pipeout (pipe)? 0x800: 0x1000))
-                       | (usb_dev->speed == USB_SPEED_LOW) << 13
-                       | usb_maxpacket (usb_dev, pipe) << 16);
-
-       return ed_ret;
-}
-
-/*-------------------------------------------------------------------------*
- * TD handling functions
- *-------------------------------------------------------------------------*/
-
-/* enqueue next TD for this URB (OHCI spec 5.2.8.2) */
-
-static void td_fill (ohci_t *ohci, unsigned int info,
-       void *data, int len,
-       struct usb_device *dev, int index, urb_priv_t *urb_priv)
-{
-       volatile td_t  *td, *td_pt;
-#ifdef OHCI_FILL_TRACE
-       int i;
-#endif
-
-       if (index > urb_priv->length) {
-               err("index > length");
-               return;
-       }
-       /* use this td as the next dummy */
-       td_pt = urb_priv->td [index];
-       td_pt->hwNextTD = 0;
-
-       /* fill the old dummy TD */
-       td = urb_priv->td [index] = (td_t *)(m32_swap (urb_priv->ed->hwTailP) & ~0xf);
-
-       td->ed = urb_priv->ed;
-       td->next_dl_td = NULL;
-       td->index = index;
-       td->data = (__u32)data;
-#ifdef OHCI_FILL_TRACE
-       if (1 || (usb_pipebulk(urb_priv->pipe) &&
-                               usb_pipeout(urb_priv->pipe))) {
-               for (i = 0; i < len; i++)
-               printf("td->data[%d] %#2x\n",i, ((unsigned char *)(td->data+0x80000000))[i]);
-       }
-#endif
-       if (!len)
-               data = 0;
-
-       td->hwINFO = m32_swap (info);
-       td->hwCBP = m32_swap (data);
-       if (data)
-               td->hwBE = m32_swap (data + len - 1);
-       else
-               td->hwBE = 0;
-       td->hwNextTD = m32_swap (td_pt);
-       td->hwPSW [0] = m16_swap (((__u32)data & 0x0FFF) | 0xE000);
-
-       /* append to queue */
-       td->ed->hwTailP = td->hwNextTD;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* prepare all TDs of a transfer */
-
-#define kseg_to_phys(x)          ((void *)((__u32)(x) - 0x80000000))
-
-static void td_submit_job (struct usb_device *dev, unsigned long pipe, void *buffer,
-       int transfer_len, struct devrequest *setup, urb_priv_t *urb, int interval)
-{
-       ohci_t *ohci = &gohci;
-       int data_len = transfer_len;
-       void *data;
-       int cnt = 0;
-       __u32 info = 0;
-       unsigned int toggle = 0;
-
-       /* OHCI handles the DATA-toggles itself, we just use the USB-toggle bits for reseting */
-       if(usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe))) {
-               toggle = TD_T_TOGGLE;
-       } else {
-               toggle = TD_T_DATA0;
-               usb_settoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe), 1);
-       }
-       urb->td_cnt = 0;
-       if (data_len)
-               data = kseg_to_phys(buffer);
-       else
-               data = 0;
-
-       switch (usb_pipetype (pipe)) {
-       case PIPE_BULK:
-               info = usb_pipeout (pipe)?
-                       TD_CC | TD_DP_OUT : TD_CC | TD_DP_IN ;
-               while(data_len > 4096) {
-                       td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, 4096, dev, cnt, urb);
-                       data += 4096; data_len -= 4096; cnt++;
-               }
-               info = usb_pipeout (pipe)?
-                       TD_CC | TD_DP_OUT : TD_CC | TD_R | TD_DP_IN ;
-               td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, data_len, dev, cnt, urb);
-               cnt++;
-
-               if (!ohci->sleeping)
-                       writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */
-               break;
-
-       case PIPE_CONTROL:
-               info = TD_CC | TD_DP_SETUP | TD_T_DATA0;
-               td_fill (ohci, info, kseg_to_phys(setup), 8, dev, cnt++, urb);
-               if (data_len > 0) {
-                       info = usb_pipeout (pipe)?
-                               TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 : TD_CC | TD_R | TD_DP_IN | TD_T_DATA1;
-                       /* NOTE:  mishandles transfers >8K, some >4K */
-                       td_fill (ohci, info, data, data_len, dev, cnt++, urb);
-               }
-               info = usb_pipeout (pipe)?
-                       TD_CC | TD_DP_IN | TD_T_DATA1: TD_CC | TD_DP_OUT | TD_T_DATA1;
-               td_fill (ohci, info, data, 0, dev, cnt++, urb);
-               if (!ohci->sleeping)
-                       writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */
-               break;
-       }
-       if (urb->length != cnt)
-               dbg("TD LENGTH %d != CNT %d", urb->length, cnt);
-}
-
-/*-------------------------------------------------------------------------*
- * Done List handling functions
- *-------------------------------------------------------------------------*/
-
-
-/* calculate the transfer length and update the urb */
-
-static void dl_transfer_length(td_t * td)
-{
-       __u32 tdINFO, tdBE, tdCBP;
-       urb_priv_t *lurb_priv = &urb_priv;
-
-       tdINFO = m32_swap (td->hwINFO);
-       tdBE   = m32_swap (td->hwBE);
-       tdCBP  = m32_swap (td->hwCBP);
-
-
-       if (!(usb_pipecontrol(lurb_priv->pipe) &&
-           ((td->index == 0) || (td->index == lurb_priv->length - 1)))) {
-               if (tdBE != 0) {
-                       if (td->hwCBP == 0)
-                               lurb_priv->actual_length += tdBE - td->data + 1;
-                       else
-                               lurb_priv->actual_length += tdCBP - td->data;
-               }
-       }
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* replies to the request have to be on a FIFO basis so
- * we reverse the reversed done-list */
-
-static td_t * dl_reverse_done_list (ohci_t *ohci)
-{
-       __u32 td_list_hc;
-       td_t *td_rev = NULL;
-       td_t *td_list = NULL;
-       urb_priv_t *lurb_priv = NULL;
-
-       td_list_hc = m32_swap (ohci->hcca->done_head) & 0xfffffff0;
-       ohci->hcca->done_head = 0;
-
-       while (td_list_hc) {
-               td_list = (td_t *)td_list_hc;
-
-               if (TD_CC_GET (m32_swap (td_list->hwINFO))) {
-                       lurb_priv = &urb_priv;
-                       dbg(" USB-error/status: %x : %p",
-                                       TD_CC_GET (m32_swap (td_list->hwINFO)), td_list);
-                       if (td_list->ed->hwHeadP & m32_swap (0x1)) {
-                               if (lurb_priv && ((td_list->index + 1) < lurb_priv->length)) {
-                                       td_list->ed->hwHeadP =
-                                               (lurb_priv->td[lurb_priv->length - 1]->hwNextTD & m32_swap (0xfffffff0)) |
-                                                                       (td_list->ed->hwHeadP & m32_swap (0x2));
-                                       lurb_priv->td_cnt += lurb_priv->length - td_list->index - 1;
-                               } else
-                                       td_list->ed->hwHeadP &= m32_swap (0xfffffff2);
-                       }
-               }
-
-               td_list->next_dl_td = td_rev;
-               td_rev = td_list;
-               td_list_hc = m32_swap (td_list->hwNextTD) & 0xfffffff0;
-       }
-       return td_list;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* td done list */
-static int dl_done_list (ohci_t *ohci, td_t *td_list)
-{
-       td_t *td_list_next = NULL;
-       ed_t *ed;
-       int cc = 0;
-       int stat = 0;
-       /* urb_t *urb; */
-       urb_priv_t *lurb_priv;
-       __u32 tdINFO, edHeadP, edTailP;
-
-       while (td_list) {
-               td_list_next = td_list->next_dl_td;
-
-               lurb_priv = &urb_priv;
-               tdINFO = m32_swap (td_list->hwINFO);
-
-               ed = td_list->ed;
-
-               dl_transfer_length(td_list);
-
-               /* error code of transfer */
-               cc = TD_CC_GET (tdINFO);
-               if (cc != 0) {
-                       dbg("ConditionCode %#x", cc);
-                       stat = cc_to_error[cc];
-               }
-
-               if (ed->state != ED_NEW) {
-                       edHeadP = m32_swap (ed->hwHeadP) & 0xfffffff0;
-                       edTailP = m32_swap (ed->hwTailP);
-
-                       /* unlink eds if they are not busy */
-                       if ((edHeadP == edTailP) && (ed->state == ED_OPER))
-                               ep_unlink (ohci, ed);
-               }
-
-               td_list = td_list_next;
-       }
-       return stat;
-}
-
-/*-------------------------------------------------------------------------*
- * Virtual Root Hub
- *-------------------------------------------------------------------------*/
-
-#include <usbroothubdes.h>
-
-/* Hub class-specific descriptor is constructed dynamically */
-
-
-/*-------------------------------------------------------------------------*/
-
-#define OK(x)                  len = (x); break
-#ifdef DEBUG
-#define WR_RH_STAT(x)          {info("WR:status %#8x", (x));writel((x), &gohci.regs->roothub.status);}
-#define WR_RH_PORTSTAT(x)      {info("WR:portstatus[%d] %#8x", wIndex-1, (x));writel((x), &gohci.regs->roothub.portstatus[wIndex-1]);}
-#else
-#define WR_RH_STAT(x)          writel((x), &gohci.regs->roothub.status)
-#define WR_RH_PORTSTAT(x)      writel((x), &gohci.regs->roothub.portstatus[wIndex-1])
-#endif
-#define RD_RH_STAT             roothub_status(&gohci)
-#define RD_RH_PORTSTAT         roothub_portstatus(&gohci,wIndex-1)
-
-/* request to virtual root hub */
-
-int rh_check_port_status(ohci_t *controller)
-{
-       __u32 temp, ndp, i;
-       int res;
-
-       res = -1;
-       temp = roothub_a (controller);
-       ndp = (temp & RH_A_NDP);
-       for (i = 0; i < ndp; i++) {
-               temp = roothub_portstatus (controller, i);
-               /* check for a device disconnect */
-               if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
-                       (RH_PS_PESC | RH_PS_CSC)) &&
-                       ((temp & RH_PS_CCS) == 0)) {
-                       res = i;
-                       break;
-               }
-       }
-       return res;
-}
-
-static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
-               void *buffer, int transfer_len, struct devrequest *cmd)
-{
-       void * data = buffer;
-       int leni = transfer_len;
-       int len = 0;
-       int stat = 0;
-       __u32 datab[4];
-       __u8 *data_buf = (__u8 *)datab;
-       __u16 bmRType_bReq;
-       __u16 wValue;
-       __u16 wIndex;
-       __u16 wLength;
-
-#ifdef DEBUG
-urb_priv.actual_length = 0;
-pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
-#else
-       mdelay(1);
-#endif
-       if (usb_pipeint(pipe)) {
-               info("Root-Hub submit IRQ: NOT implemented");
-               return 0;
-       }
-
-       bmRType_bReq  = cmd->requesttype | (cmd->request << 8);
-       wValue        = m16_swap (cmd->value);
-       wIndex        = m16_swap (cmd->index);
-       wLength       = m16_swap (cmd->length);
-
-       info("Root-Hub: adr: %2x cmd(%1x): %08x %04x %04x %04x",
-               dev->devnum, 8, bmRType_bReq, wValue, wIndex, wLength);
-
-       switch (bmRType_bReq) {
-       /* Request Destination:
-          without flags: Device,
-          RH_INTERFACE: interface,
-          RH_ENDPOINT: endpoint,
-          RH_CLASS means HUB here,
-          RH_OTHER | RH_CLASS  almost ever means HUB_PORT here
-       */
-
-       case RH_GET_STATUS:
-                       *(__u16 *) data_buf = m16_swap (1); OK (2);
-       case RH_GET_STATUS | RH_INTERFACE:
-                       *(__u16 *) data_buf = m16_swap (0); OK (2);
-       case RH_GET_STATUS | RH_ENDPOINT:
-                       *(__u16 *) data_buf = m16_swap (0); OK (2);
-       case RH_GET_STATUS | RH_CLASS:
-                       *(__u32 *) data_buf = m32_swap (
-                               RD_RH_STAT & ~(RH_HS_CRWE | RH_HS_DRWE));
-                       OK (4);
-       case RH_GET_STATUS | RH_OTHER | RH_CLASS:
-                       *(__u32 *) data_buf = m32_swap (RD_RH_PORTSTAT); OK (4);
-
-       case RH_CLEAR_FEATURE | RH_ENDPOINT:
-               switch (wValue) {
-                       case (RH_ENDPOINT_STALL): OK (0);
-               }
-               break;
-
-       case RH_CLEAR_FEATURE | RH_CLASS:
-               switch (wValue) {
-                       case RH_C_HUB_LOCAL_POWER:
-                               OK(0);
-                       case (RH_C_HUB_OVER_CURRENT):
-                                       WR_RH_STAT(RH_HS_OCIC); OK (0);
-               }
-               break;
-
-       case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
-               switch (wValue) {
-                       case (RH_PORT_ENABLE):
-                                       WR_RH_PORTSTAT (RH_PS_CCS ); OK (0);
-                       case (RH_PORT_SUSPEND):
-                                       WR_RH_PORTSTAT (RH_PS_POCI); OK (0);
-                       case (RH_PORT_POWER):
-                                       WR_RH_PORTSTAT (RH_PS_LSDA); OK (0);
-                       case (RH_C_PORT_CONNECTION):
-                                       WR_RH_PORTSTAT (RH_PS_CSC ); OK (0);
-                       case (RH_C_PORT_ENABLE):
-                                       WR_RH_PORTSTAT (RH_PS_PESC); OK (0);
-                       case (RH_C_PORT_SUSPEND):
-                                       WR_RH_PORTSTAT (RH_PS_PSSC); OK (0);
-                       case (RH_C_PORT_OVER_CURRENT):
-                                       WR_RH_PORTSTAT (RH_PS_OCIC); OK (0);
-                       case (RH_C_PORT_RESET):
-                                       WR_RH_PORTSTAT (RH_PS_PRSC); OK (0);
-               }
-               break;
-
-       case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
-               switch (wValue) {
-                       case (RH_PORT_SUSPEND):
-                                       WR_RH_PORTSTAT (RH_PS_PSS ); OK (0);
-                       case (RH_PORT_RESET): /* BUG IN HUP CODE *********/
-                                       if (RD_RH_PORTSTAT & RH_PS_CCS)
-                                           WR_RH_PORTSTAT (RH_PS_PRS);
-                                       OK (0);
-                       case (RH_PORT_POWER):
-                                       WR_RH_PORTSTAT (RH_PS_PPS ); OK (0);
-                       case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
-                                       if (RD_RH_PORTSTAT & RH_PS_CCS)
-                                           WR_RH_PORTSTAT (RH_PS_PES );
-                                       OK (0);
-               }
-               break;
-
-       case RH_SET_ADDRESS: gohci.rh.devnum = wValue; OK(0);
-
-       case RH_GET_DESCRIPTOR:
-               switch ((wValue & 0xff00) >> 8) {
-                       case (0x01): /* device descriptor */
-                               len = min_t(unsigned int,
-                                         leni,
-                                         min_t(unsigned int,
-                                             sizeof (root_hub_dev_des),
-                                             wLength));
-                               data_buf = root_hub_dev_des; OK(len);
-                       case (0x02): /* configuration descriptor */
-                               len = min_t(unsigned int,
-                                         leni,
-                                         min_t(unsigned int,
-                                             sizeof (root_hub_config_des),
-                                             wLength));
-                               data_buf = root_hub_config_des; OK(len);
-                       case (0x03): /* string descriptors */
-                               if(wValue==0x0300) {
-                                       len = min_t(unsigned int,
-                                                 leni,
-                                                 min_t(unsigned int,
-                                                     sizeof (root_hub_str_index0),
-                                                     wLength));
-                                       data_buf = root_hub_str_index0;
-                                       OK(len);
-                               }
-                               if(wValue==0x0301) {
-                                       len = min_t(unsigned int,
-                                                 leni,
-                                                 min_t(unsigned int,
-                                                     sizeof (root_hub_str_index1),
-                                                     wLength));
-                                       data_buf = root_hub_str_index1;
-                                       OK(len);
-                       }
-                       default:
-                               stat = USB_ST_STALLED;
-               }
-               break;
-
-       case RH_GET_DESCRIPTOR | RH_CLASS:
-           {
-                   __u32 temp = roothub_a (&gohci);
-
-                   data_buf [0] = 9;           /* min length; */
-                   data_buf [1] = 0x29;
-                   data_buf [2] = temp & RH_A_NDP;
-                   data_buf [3] = 0;
-                   if (temp & RH_A_PSM)        /* per-port power switching? */
-                       data_buf [3] |= 0x1;
-                   if (temp & RH_A_NOCP)       /* no overcurrent reporting? */
-                       data_buf [3] |= 0x10;
-                   else if (temp & RH_A_OCPM)  /* per-port overcurrent reporting? */
-                       data_buf [3] |= 0x8;
-
-                   /* corresponds to data_buf[4-7] */
-                   datab [1] = 0;
-                   data_buf [5] = (temp & RH_A_POTPGT) >> 24;
-                   temp = roothub_b (&gohci);
-                   data_buf [7] = temp & RH_B_DR;
-                   if (data_buf [2] < 7) {
-                       data_buf [8] = 0xff;
-                   } else {
-                       data_buf [0] += 2;
-                       data_buf [8] = (temp & RH_B_DR) >> 8;
-                       data_buf [10] = data_buf [9] = 0xff;
-                   }
-
-                   len = min_t(unsigned int, leni,
-                             min_t(unsigned int, data_buf [0], wLength));
-                   OK (len);
-               }
-
-       case RH_GET_CONFIGURATION:      *(__u8 *) data_buf = 0x01; OK (1);
-
-       case RH_SET_CONFIGURATION:      WR_RH_STAT (0x10000); OK (0);
-
-       default:
-               dbg ("unsupported root hub command");
-               stat = USB_ST_STALLED;
-       }
-
-#ifdef DEBUG
-       ohci_dump_roothub (&gohci, 1);
-#else
-       mdelay(1);
-#endif
-
-       len = min_t(int, len, leni);
-       if (data != data_buf)
-           memcpy (data, data_buf, len);
-       dev->act_len = len;
-       dev->status = stat;
-
-#ifdef DEBUG
-       if (transfer_len)
-               urb_priv.actual_length = transfer_len;
-       pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
-#else
-       mdelay(1);
-#endif
-
-       return stat;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* common code for handling submit messages - used for all but root hub */
-/* accesses. */
-int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
-               int transfer_len, struct devrequest *setup, int interval)
-{
-       int stat = 0;
-       int maxsize = usb_maxpacket(dev, pipe);
-       int timeout;
-
-       /* device pulled? Shortcut the action. */
-       if (devgone == dev) {
-               dev->status = USB_ST_CRC_ERR;
-               return 0;
-       }
-
-#ifdef DEBUG
-       urb_priv.actual_length = 0;
-       pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
-#else
-       mdelay(1);
-#endif
-       if (!maxsize) {
-               err("submit_common_message: pipesize for pipe %lx is zero",
-                       pipe);
-               return -1;
-       }
-
-       if (sohci_submit_job(dev, pipe, buffer, transfer_len, setup, interval) < 0) {
-               err("sohci_submit_job failed");
-               return -1;
-       }
-
-       mdelay(10);
-       /* ohci_dump_status(&gohci); */
-
-       /* allow more time for a BULK device to react - some are slow */
-#define BULK_TO         5000   /* timeout in milliseconds */
-       if (usb_pipebulk(pipe))
-               timeout = BULK_TO;
-       else
-               timeout = 100;
-
-       timeout *= 4;
-       /* wait for it to complete */
-       for (;;) {
-               /* check whether the controller is done */
-               stat = hc_interrupt();
-               if (stat < 0) {
-                       stat = USB_ST_CRC_ERR;
-                       break;
-               }
-               if (stat >= 0 && stat != 0xff) {
-                       /* 0xff is returned for an SF-interrupt */
-                       break;
-               }
-               if (--timeout) {
-                       udelay(250); /* mdelay(1); */
-               } else {
-                       err("CTL:TIMEOUT ");
-                       stat = USB_ST_CRC_ERR;
-                       break;
-               }
-       }
-       /* we got an Root Hub Status Change interrupt */
-       if (got_rhsc) {
-#ifdef DEBUG
-               ohci_dump_roothub (&gohci, 1);
-#endif
-               got_rhsc = 0;
-               /* abuse timeout */
-               timeout = rh_check_port_status(&gohci);
-               if (timeout >= 0) {
-#if 0 /* this does nothing useful, but leave it here in case that changes */
-                       /* the called routine adds 1 to the passed value */
-                       usb_hub_port_connect_change(gohci.rh.dev, timeout - 1);
-#endif
-                       /*
-                        * XXX
-                        * This is potentially dangerous because it assumes
-                        * that only one device is ever plugged in!
-                        */
-                       devgone = dev;
-               }
-       }
-
-       dev->status = stat;
-       dev->act_len = transfer_len;
-
-#ifdef DEBUG
-       pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe));
-#else
-       mdelay(1);
-#endif
-
-       /* free TDs in urb_priv */
-       urb_free_priv (&urb_priv);
-       return 0;
-}
-
-/* submit routines called from usb.c */
-int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
-               int transfer_len)
-{
-       info("submit_bulk_msg");
-       return submit_common_msg(dev, pipe, buffer, transfer_len, NULL, 0);
-}
-
-int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
-               int transfer_len, struct devrequest *setup)
-{
-       int maxsize = usb_maxpacket(dev, pipe);
-
-       info("submit_control_msg");
-#ifdef DEBUG
-       urb_priv.actual_length = 0;
-       pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
-#else
-       mdelay(1);
-#endif
-       if (!maxsize) {
-               err("submit_control_message: pipesize for pipe %lx is zero",
-                       pipe);
-               return -1;
-       }
-       if (((pipe >> 8) & 0x7f) == gohci.rh.devnum) {
-               gohci.rh.dev = dev;
-               /* root hub - redirect */
-               return ohci_submit_rh_msg(dev, pipe, buffer, transfer_len,
-                       setup);
-       }
-
-       return submit_common_msg(dev, pipe, buffer, transfer_len, setup, 0);
-}
-
-int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
-               int transfer_len, int interval)
-{
-       info("submit_int_msg");
-       return -1;
-}
-
-/*-------------------------------------------------------------------------*
- * HC functions
- *-------------------------------------------------------------------------*/
-
-/* reset the HC and BUS */
-
-static int hc_reset (ohci_t *ohci)
-{
-       int timeout = 30;
-       int smm_timeout = 50; /* 0,5 sec */
-
-       if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */
-               writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
-               info("USB HC TakeOver from SMM");
-               while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
-                       mdelay (10);
-                       if (--smm_timeout == 0) {
-                               err("USB HC TakeOver failed!");
-                               return -1;
-                       }
-               }
-       }
-
-       /* Disable HC interrupts */
-       writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
-
-       dbg("USB HC reset_hc usb-%s: ctrl = 0x%X ;",
-               ohci->slot_name,
-               readl (&ohci->regs->control));
-
-       /* Reset USB (needed by some controllers) */
-       writel (0, &ohci->regs->control);
-
-       /* HC Reset requires max 10 us delay */
-       writel (OHCI_HCR,  &ohci->regs->cmdstatus);
-       while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
-               if (--timeout == 0) {
-                       err("USB HC reset timed out!");
-                       return -1;
-               }
-               udelay (1);
-       }
-       return 0;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* Start an OHCI controller, set the BUS operational
- * enable interrupts
- * connect the virtual root hub */
-
-static int hc_start (ohci_t * ohci)
-{
-       __u32 mask;
-       unsigned int fminterval;
-
-       ohci->disabled = 1;
-
-       /* Tell the controller where the control and bulk lists are
-        * The lists are empty now. */
-
-       writel (0, &ohci->regs->ed_controlhead);
-       writel (0, &ohci->regs->ed_bulkhead);
-
-       writel ((__u32)ohci->hcca, &ohci->regs->hcca); /* a reset clears this */
-
-       fminterval = 0x2edf;
-       writel ((fminterval * 9) / 10, &ohci->regs->periodicstart);
-       fminterval |= ((((fminterval - 210) * 6) / 7) << 16);
-       writel (fminterval, &ohci->regs->fminterval);
-       writel (0x628, &ohci->regs->lsthresh);
-
-       /* start controller operations */
-       ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
-       ohci->disabled = 0;
-       writel (ohci->hc_control, &ohci->regs->control);
-
-       /* disable all interrupts */
-       mask = (OHCI_INTR_SO | OHCI_INTR_WDH | OHCI_INTR_SF | OHCI_INTR_RD |
-                       OHCI_INTR_UE | OHCI_INTR_FNO | OHCI_INTR_RHSC |
-                       OHCI_INTR_OC | OHCI_INTR_MIE);
-       writel (mask, &ohci->regs->intrdisable);
-       /* clear all interrupts */
-       mask &= ~OHCI_INTR_MIE;
-       writel (mask, &ohci->regs->intrstatus);
-       /* Choose the interrupts we care about now  - but w/o MIE */
-       mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
-       writel (mask, &ohci->regs->intrenable);
-
-#ifdef OHCI_USE_NPS
-       /* required for AMD-756 and some Mac platforms */
-       writel ((roothub_a (ohci) | RH_A_NPS) & ~RH_A_PSM,
-               &ohci->regs->roothub.a);
-       writel (RH_HS_LPSC, &ohci->regs->roothub.status);
-#endif /* OHCI_USE_NPS */
-
-       /* POTPGT delay is bits 24-31, in 2 ms units. */
-       mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
-
-       /* connect the virtual root hub */
-       ohci->rh.devnum = 0;
-
-       return 0;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* an interrupt happens */
-
-static int
-hc_interrupt (void)
-{
-       ohci_t *ohci = &gohci;
-       struct ohci_regs *regs = ohci->regs;
-       int ints;
-       int stat = -1;
-
-       if ((ohci->hcca->done_head != 0) && !(m32_swap (ohci->hcca->done_head) & 0x01)) {
-               ints =  OHCI_INTR_WDH;
-       } else {
-               ints = readl (&regs->intrstatus);
-       }
-
-       /* dbg("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no)); */
-
-       if (ints & OHCI_INTR_RHSC) {
-               got_rhsc = 1;
-       }
-
-       if (ints & OHCI_INTR_UE) {
-               ohci->disabled++;
-               err ("OHCI Unrecoverable Error, controller usb-%s disabled",
-                       ohci->slot_name);
-               /* e.g. due to PCI Master/Target Abort */
-
-#ifdef DEBUG
-               ohci_dump (ohci, 1);
-#else
-       mdelay(1);
-#endif
-               /* FIXME: be optimistic, hope that bug won't repeat often. */
-               /* Make some non-interrupt context restart the controller. */
-               /* Count and limit the retries though; either hardware or */
-               /* software errors can go forever... */
-               hc_reset (ohci);
-               return -1;
-       }
-
-       if (ints & OHCI_INTR_WDH) {
-               mdelay(1);
-               writel (OHCI_INTR_WDH, &regs->intrdisable);
-               stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
-               writel (OHCI_INTR_WDH, &regs->intrenable);
-       }
-
-       if (ints & OHCI_INTR_SO) {
-               dbg("USB Schedule overrun\n");
-               writel (OHCI_INTR_SO, &regs->intrenable);
-               stat = -1;
-       }
-
-       /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
-       if (ints & OHCI_INTR_SF) {
-               unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1;
-               mdelay(1);
-               writel (OHCI_INTR_SF, &regs->intrdisable);
-               if (ohci->ed_rm_list[frame] != NULL)
-                       writel (OHCI_INTR_SF, &regs->intrenable);
-               stat = 0xff;
-       }
-
-       writel (ints, &regs->intrstatus);
-       return stat;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/*-------------------------------------------------------------------------*/
-
-/* De-allocate all resources.. */
-
-static void hc_release_ohci (ohci_t *ohci)
-{
-       dbg ("USB HC release ohci usb-%s", ohci->slot_name);
-
-       if (!ohci->disabled)
-               hc_reset (ohci);
-}
-
-/*-------------------------------------------------------------------------*/
-
-#define __read_32bit_c0_register(source, sel)                          \
-({ int __res;                                                          \
-       if (sel == 0)                                                   \
-               __asm__ __volatile__(                                   \
-                       "mfc0\t%0, " #source "\n\t"                     \
-                       : "=r" (__res));                                \
-       else                                                            \
-               __asm__ __volatile__(                                   \
-                       ".set\tmips32\n\t"                              \
-                       "mfc0\t%0, " #source ", " #sel "\n\t"           \
-                       ".set\tmips0\n\t"                               \
-                       : "=r" (__res));                                \
-       __res;                                                          \
-})
-
-#define read_c0_prid()         __read_32bit_c0_register($15, 0)
-
-/*
- * low level initalisation routine, called from usb.c
- */
-static char ohci_inited = 0;
-
-int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
-{
-       u32 pin_func;
-       u32 sys_freqctrl, sys_clksrc;
-       u32 prid = read_c0_prid();
-
-       dbg("in usb_lowlevel_init\n");
-
-       /* zero and disable FREQ2 */
-       sys_freqctrl = au_readl(SYS_FREQCTRL0);
-       sys_freqctrl &= ~0xFFF00000;
-       au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-       /* zero and disable USBH/USBD clocks */
-       sys_clksrc = au_readl(SYS_CLKSRC);
-       sys_clksrc &= ~0x00007FE0;
-       au_writel(sys_clksrc, SYS_CLKSRC);
-
-       sys_freqctrl = au_readl(SYS_FREQCTRL0);
-       sys_freqctrl &= ~0xFFF00000;
-
-       sys_clksrc = au_readl(SYS_CLKSRC);
-       sys_clksrc &= ~0x00007FE0;
-
-       switch (prid & 0x000000FF) {
-       case 0x00: /* DA */
-       case 0x01: /* HA */
-       case 0x02: /* HB */
-               /* CPU core freq to 48MHz to slow it way down... */
-               au_writel(4, SYS_CPUPLL);
-
-               /*
-                * Setup 48MHz FREQ2 from CPUPLL for USB Host
-                */
-               /* FRDIV2=3 -> div by 8 of 384MHz -> 48MHz */
-               sys_freqctrl |= ((3<<22) | (1<<21) | (0<<20));
-               au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-               /* CPU core freq to 384MHz */
-               au_writel(0x20, SYS_CPUPLL);
-
-               printf("Au1000: 48MHz OHCI workaround enabled\n");
-               break;
-
-       default:  /* HC and newer */
-               /* FREQ2 = aux/2 = 48 MHz */
-               sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
-               au_writel(sys_freqctrl, SYS_FREQCTRL0);
-               break;
-       }
-
-       /*
-        * Route 48MHz FREQ2 into USB Host and/or Device
-        */
-       sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
-       au_writel(sys_clksrc, SYS_CLKSRC);
-
-       /* configure pins GPIO[14:9] as GPIO */
-       pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8080);
-
-       au_writel(pin_func, SYS_PINFUNC);
-       au_writel(0x2800, SYS_TRIOUTCLR);
-       au_writel(0x0030, SYS_OUTPUTCLR);
-
-       dbg("OHCI board setup complete\n");
-
-       /* enable host controller */
-       au_writel(USBH_ENABLE_CE, USB_HOST_CONFIG);
-       udelay(1000);
-       au_writel(USBH_ENABLE_INIT, USB_HOST_CONFIG);
-       udelay(1000);
-
-       /* wait for reset complete (read register twice; see au1500 errata) */
-       while (au_readl(USB_HOST_CONFIG),
-              !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD))
-               udelay(1000);
-
-       dbg("OHCI clock running\n");
-
-       memset (&gohci, 0, sizeof (ohci_t));
-       memset (&urb_priv, 0, sizeof (urb_priv_t));
-
-       /* align the storage */
-       if ((__u32)&ghcca[0] & 0xff) {
-               err("HCCA not aligned!!");
-               return -1;
-       }
-       phcca = &ghcca[0];
-       info("aligned ghcca %p", phcca);
-       memset(&ohci_dev, 0, sizeof(struct ohci_device));
-       if ((__u32)&ohci_dev.ed[0] & 0x7) {
-               err("EDs not aligned!!");
-               return -1;
-       }
-       memset(gtd, 0, sizeof(td_t) * (NUM_TD + 1));
-       if ((__u32)gtd & 0x7) {
-               err("TDs not aligned!!");
-               return -1;
-       }
-       ptd = gtd;
-       gohci.hcca = phcca;
-       memset (phcca, 0, sizeof (struct ohci_hcca));
-
-       gohci.disabled = 1;
-       gohci.sleeping = 0;
-       gohci.irq = -1;
-       gohci.regs = (struct ohci_regs *)(USB_OHCI_BASE | 0xA0000000);
-
-       gohci.flags = 0;
-       gohci.slot_name = "au1x00";
-
-       dbg("OHCI revision: 0x%08x\n"
-              "  RH: a: 0x%08x b: 0x%08x\n",
-              readl(&gohci.regs->revision),
-              readl(&gohci.regs->roothub.a), readl(&gohci.regs->roothub.b));
-
-       if (hc_reset (&gohci) < 0)
-               goto errout;
-
-       /* FIXME this is a second HC reset; why?? */
-       writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
-       mdelay (10);
-
-       if (hc_start (&gohci) < 0)
-               goto errout;
-
-#ifdef DEBUG
-       ohci_dump (&gohci, 1);
-#else
-       mdelay(1);
-#endif
-       ohci_inited = 1;
-       return 0;
-
-  errout:
-       err("OHCI initialization error\n");
-       hc_release_ohci (&gohci);
-       /* Initialization failed */
-       au_writel(readl(USB_HOST_CONFIG) & ~USBH_ENABLE_CE, USB_HOST_CONFIG);
-       return -1;
-}
-
-int usb_lowlevel_stop(int index)
-{
-       /* this gets called really early - before the controller has */
-       /* even been initialized! */
-       if (!ohci_inited)
-               return 0;
-       /* TODO release any interrupts, etc. */
-       /* call hc_release_ohci() here ? */
-       hc_reset (&gohci);
-       /* may not want to do this */
-       /* Disable clock */
-       au_writel(readl(USB_HOST_CONFIG) & ~USBH_ENABLE_CE, USB_HOST_CONFIG);
-       return 0;
-}
-
-#endif /* CONFIG_USB_OHCI */
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h
deleted file mode 100644 (file)
index bb9f351..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * URB OHCI HCD (Host Controller Driver) for USB.
- *
- * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
- * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
- *
- * usb-ohci.h
- */
-
-
-static int cc_to_error[16] = {
-
-/* mapping of the OHCI CC status to error codes */
-       /* No  Error  */        0,
-       /* CRC Error  */        USB_ST_CRC_ERR,
-       /* Bit Stuff  */        USB_ST_BIT_ERR,
-       /* Data Togg  */        USB_ST_CRC_ERR,
-       /* Stall      */        USB_ST_STALLED,
-       /* DevNotResp */        -1,
-       /* PIDCheck   */        USB_ST_BIT_ERR,
-       /* UnExpPID   */        USB_ST_BIT_ERR,
-       /* DataOver   */        USB_ST_BUF_ERR,
-       /* DataUnder  */        USB_ST_BUF_ERR,
-       /* reservd    */        -1,
-       /* reservd    */        -1,
-       /* BufferOver */        USB_ST_BUF_ERR,
-       /* BuffUnder  */        USB_ST_BUF_ERR,
-       /* Not Access */        -1,
-       /* Not Access */        -1
-};
-
-/* ED States */
-
-#define ED_NEW         0x00
-#define ED_UNLINK      0x01
-#define ED_OPER                0x02
-#define ED_DEL         0x04
-#define ED_URB_DEL     0x08
-
-/* usb_ohci_ed */
-struct ed {
-       __u32 hwINFO;
-       __u32 hwTailP;
-       __u32 hwHeadP;
-       __u32 hwNextED;
-
-       struct ed *ed_prev;
-       __u8 int_period;
-       __u8 int_branch;
-       __u8 int_load;
-       __u8 int_interval;
-       __u8 state;
-       __u8 type;
-       __u16 last_iso;
-       struct ed *ed_rm_list;
-
-       struct usb_device *usb_dev;
-       __u32 unused[3];
-} __attribute__((aligned(16)));
-typedef struct ed ed_t;
-
-
-/* TD info field */
-#define TD_CC                  0xf0000000
-#define TD_CC_GET(td_p)                ((td_p >>28) & 0x0f)
-#define TD_CC_SET(td_p, cc)    (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28)
-#define TD_EC                  0x0C000000
-#define TD_T                   0x03000000
-#define TD_T_DATA0             0x02000000
-#define TD_T_DATA1             0x03000000
-#define TD_T_TOGGLE            0x00000000
-#define TD_R                   0x00040000
-#define TD_DI                  0x00E00000
-#define TD_DI_SET(X)           (((X) & 0x07)<< 21)
-#define TD_DP                  0x00180000
-#define TD_DP_SETUP            0x00000000
-#define TD_DP_IN               0x00100000
-#define TD_DP_OUT              0x00080000
-
-#define TD_ISO                 0x00010000
-#define TD_DEL                 0x00020000
-
-/* CC Codes */
-#define TD_CC_NOERROR          0x00
-#define TD_CC_CRC              0x01
-#define TD_CC_BITSTUFFING      0x02
-#define TD_CC_DATATOGGLEM      0x03
-#define TD_CC_STALL            0x04
-#define TD_DEVNOTRESP          0x05
-#define TD_PIDCHECKFAIL                0x06
-#define TD_UNEXPECTEDPID       0x07
-#define TD_DATAOVERRUN         0x08
-#define TD_DATAUNDERRUN                0x09
-#define TD_BUFFEROVERRUN       0x0C
-#define TD_BUFFERUNDERRUN      0x0D
-#define TD_NOTACCESSED         0x0F
-
-
-#define MAXPSW 1
-
-struct td {
-       __u32 hwINFO;
-       __u32 hwCBP;            /* Current Buffer Pointer */
-       __u32 hwNextTD;         /* Next TD Pointer */
-       __u32 hwBE;             /* Memory Buffer End Pointer */
-
-       __u16 hwPSW[MAXPSW];
-       __u8 unused;
-       __u8 index;
-       struct ed *ed;
-       struct td *next_dl_td;
-       struct usb_device *usb_dev;
-       int transfer_len;
-       __u32 data;
-
-       __u32 unused2[2];
-} __attribute__((aligned(32)));
-typedef struct td td_t;
-
-#define OHCI_ED_SKIP   (1 << 14)
-
-/*
- * The HCCA (Host Controller Communications Area) is a 256 byte
- * structure defined in the OHCI spec. that the host controller is
- * told the base address of.  It must be 256-byte aligned.
- */
-
-#define NUM_INTS 32    /* part of the OHCI standard */
-struct ohci_hcca {
-       __u32   int_table[NUM_INTS];    /* Interrupt ED table */
-       __u16   frame_no;               /* current frame number */
-       __u16   pad1;                   /* set to 0 on each frame_no change */
-       __u32   done_head;              /* info returned for an interrupt */
-       u8              reserved_for_hc[116];
-} __attribute__((aligned(256)));
-
-
-/*
- * Maximum number of root hub ports.
- */
-#define MAX_ROOT_PORTS 15      /* maximum OHCI root hub ports */
-
-/*
- * This is the structure of the OHCI controller's memory mapped I/O
- * region.  This is Memory Mapped I/O. You must use the readl() and
- * writel() macros defined in asm/io.h to access these!!
- */
-struct ohci_regs {
-       /* control and status registers */
-       __u32   revision;
-       __u32   control;
-       __u32   cmdstatus;
-       __u32   intrstatus;
-       __u32   intrenable;
-       __u32   intrdisable;
-       /* memory pointers */
-       __u32   hcca;
-       __u32   ed_periodcurrent;
-       __u32   ed_controlhead;
-       __u32   ed_controlcurrent;
-       __u32   ed_bulkhead;
-       __u32   ed_bulkcurrent;
-       __u32   donehead;
-       /* frame counters */
-       __u32   fminterval;
-       __u32   fmremaining;
-       __u32   fmnumber;
-       __u32   periodicstart;
-       __u32   lsthresh;
-       /* Root hub ports */
-       struct  ohci_roothub_regs {
-               __u32   a;
-               __u32   b;
-               __u32   status;
-               __u32   portstatus[MAX_ROOT_PORTS];
-       } roothub;
-} __attribute__((aligned(32)));
-
-
-/* OHCI CONTROL AND STATUS REGISTER MASKS */
-
-/*
- * HcControl (control) register masks
- */
-#define OHCI_CTRL_CBSR (3 << 0)        /* control/bulk service ratio */
-#define OHCI_CTRL_PLE  (1 << 2)        /* periodic list enable */
-#define OHCI_CTRL_IE   (1 << 3)        /* isochronous enable */
-#define OHCI_CTRL_CLE  (1 << 4)        /* control list enable */
-#define OHCI_CTRL_BLE  (1 << 5)        /* bulk list enable */
-#define OHCI_CTRL_HCFS (3 << 6)        /* host controller functional state */
-#define OHCI_CTRL_IR   (1 << 8)        /* interrupt routing */
-#define OHCI_CTRL_RWC  (1 << 9)        /* remote wakeup connected */
-#define OHCI_CTRL_RWE  (1 << 10)       /* remote wakeup enable */
-
-/* pre-shifted values for HCFS */
-#      define OHCI_USB_RESET   (0 << 6)
-#      define OHCI_USB_RESUME  (1 << 6)
-#      define OHCI_USB_OPER    (2 << 6)
-#      define OHCI_USB_SUSPEND (3 << 6)
-
-/*
- * HcCommandStatus (cmdstatus) register masks
- */
-#define OHCI_HCR       (1 << 0)        /* host controller reset */
-#define OHCI_CLF       (1 << 1)        /* control list filled */
-#define OHCI_BLF       (1 << 2)        /* bulk list filled */
-#define OHCI_OCR       (1 << 3)        /* ownership change request */
-#define OHCI_SOC       (3 << 16)       /* scheduling overrun count */
-
-/*
- * masks used with interrupt registers:
- * HcInterruptStatus (intrstatus)
- * HcInterruptEnable (intrenable)
- * HcInterruptDisable (intrdisable)
- */
-#define OHCI_INTR_SO   (1 << 0)        /* scheduling overrun */
-#define OHCI_INTR_WDH  (1 << 1)        /* writeback of done_head */
-#define OHCI_INTR_SF   (1 << 2)        /* start frame */
-#define OHCI_INTR_RD   (1 << 3)        /* resume detect */
-#define OHCI_INTR_UE   (1 << 4)        /* unrecoverable error */
-#define OHCI_INTR_FNO  (1 << 5)        /* frame number overflow */
-#define OHCI_INTR_RHSC (1 << 6)        /* root hub status change */
-#define OHCI_INTR_OC   (1 << 30)       /* ownership change */
-#define OHCI_INTR_MIE  (1 << 31)       /* master interrupt enable */
-
-
-/* Virtual Root HUB */
-struct virt_root_hub {
-       int devnum; /* Address of Root Hub endpoint */
-       void *dev;  /* was urb */
-       void *int_addr;
-       int send;
-       int interval;
-};
-
-/* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
-
-/* destination of request */
-#define RH_INTERFACE           0x01
-#define RH_ENDPOINT            0x02
-#define RH_OTHER               0x03
-
-#define RH_CLASS               0x20
-#define RH_VENDOR              0x40
-
-/* Requests: bRequest << 8 | bmRequestType */
-#define RH_GET_STATUS          0x0080
-#define RH_CLEAR_FEATURE       0x0100
-#define RH_SET_FEATURE         0x0300
-#define RH_SET_ADDRESS         0x0500
-#define RH_GET_DESCRIPTOR      0x0680
-#define RH_SET_DESCRIPTOR      0x0700
-#define RH_GET_CONFIGURATION   0x0880
-#define RH_SET_CONFIGURATION   0x0900
-#define RH_GET_STATE           0x0280
-#define RH_GET_INTERFACE       0x0A80
-#define RH_SET_INTERFACE       0x0B00
-#define RH_SYNC_FRAME          0x0C80
-/* Our Vendor Specific Request */
-#define RH_SET_EP              0x2000
-
-
-/* Hub port features */
-#define RH_PORT_CONNECTION     0x00
-#define RH_PORT_ENABLE         0x01
-#define RH_PORT_SUSPEND                0x02
-#define RH_PORT_OVER_CURRENT   0x03
-#define RH_PORT_RESET          0x04
-#define RH_PORT_POWER          0x08
-#define RH_PORT_LOW_SPEED      0x09
-
-#define RH_C_PORT_CONNECTION   0x10
-#define RH_C_PORT_ENABLE       0x11
-#define RH_C_PORT_SUSPEND      0x12
-#define RH_C_PORT_OVER_CURRENT 0x13
-#define RH_C_PORT_RESET                0x14
-
-/* Hub features */
-#define RH_C_HUB_LOCAL_POWER   0x00
-#define RH_C_HUB_OVER_CURRENT  0x01
-
-#define RH_DEVICE_REMOTE_WAKEUP 0x00
-#define RH_ENDPOINT_STALL      0x01
-
-#define RH_ACK                 0x01
-#define RH_REQ_ERR             -1
-#define RH_NACK                        0x00
-
-
-/* OHCI ROOT HUB REGISTER MASKS */
-
-/* roothub.portstatus [i] bits */
-#define RH_PS_CCS              0x00000001      /* current connect status */
-#define RH_PS_PES              0x00000002      /* port enable status*/
-#define RH_PS_PSS              0x00000004      /* port suspend status */
-#define RH_PS_POCI             0x00000008      /* port over current indicator */
-#define RH_PS_PRS              0x00000010      /* port reset status */
-#define RH_PS_PPS              0x00000100      /* port power status */
-#define RH_PS_LSDA             0x00000200      /* low speed device attached */
-#define RH_PS_CSC              0x00010000      /* connect status change */
-#define RH_PS_PESC             0x00020000      /* port enable status change */
-#define RH_PS_PSSC             0x00040000      /* port suspend status change */
-#define RH_PS_OCIC             0x00080000      /* over current indicator change */
-#define RH_PS_PRSC             0x00100000      /* port reset status change */
-
-/* roothub.status bits */
-#define RH_HS_LPS              0x00000001      /* local power status */
-#define RH_HS_OCI              0x00000002      /* over current indicator */
-#define RH_HS_DRWE             0x00008000      /* device remote wakeup enable */
-#define RH_HS_LPSC             0x00010000      /* local power status change */
-#define RH_HS_OCIC             0x00020000      /* over current indicator change */
-#define RH_HS_CRWE             0x80000000      /* clear remote wakeup enable */
-
-/* roothub.b masks */
-#define RH_B_DR                        0x0000ffff      /* device removable flags */
-#define RH_B_PPCM              0xffff0000      /* port power control mask */
-
-/* roothub.a masks */
-#define        RH_A_NDP                (0xff << 0)     /* number of downstream ports */
-#define        RH_A_PSM                (1 << 8)        /* power switching mode */
-#define        RH_A_NPS                (1 << 9)        /* no power switching */
-#define        RH_A_DT                 (1 << 10)       /* device type (mbz) */
-#define        RH_A_OCPM               (1 << 11)       /* over current protection mode */
-#define        RH_A_NOCP               (1 << 12)       /* no over current protection */
-#define        RH_A_POTPGT             (0xff << 24)    /* power on to power good time */
-
-/* urb */
-#define N_URB_TD 48
-typedef struct
-{
-       ed_t *ed;
-       __u16 length;           /* number of tds associated with this request */
-       __u16 td_cnt;           /* number of tds already serviced */
-       int   state;
-       unsigned long pipe;
-       int actual_length;
-       td_t *td[N_URB_TD];     /* list pointer to all corresponding TDs associated with this request */
-} urb_priv_t;
-#define URB_DEL 1
-
-/*
- * This is the full ohci controller description
- *
- * Note how the "proper" USB information is just
- * a subset of what the full implementation needs. (Linus)
- */
-
-
-typedef struct ohci {
-       struct ohci_hcca *hcca;         /* hcca */
-       /*dma_addr_t hcca_dma;*/
-
-       int irq;
-       int disabled;                   /* e.g. got a UE, we're hung */
-       int sleeping;
-       unsigned long flags;            /* for HC bugs */
-
-       struct ohci_regs *regs;         /* OHCI controller's memory */
-
-       ed_t *ed_rm_list[2];            /* lists of all endpoints to be removed */
-       ed_t *ed_bulktail;              /* last endpoint of bulk list */
-       ed_t *ed_controltail;           /* last endpoint of control list */
-       int intrstatus;
-       __u32 hc_control;               /* copy of the hc control reg */
-       struct usb_device *dev[32];
-       struct virt_root_hub rh;
-
-       const char      *slot_name;
-} ohci_t;
-
-#define NUM_EDS 8              /* num of preallocated endpoint descriptors */
-
-struct ohci_device {
-       ed_t    ed[NUM_EDS];
-       int ed_cnt;
-};
-
-/* hcd */
-/* endpoint */
-static int ep_link(ohci_t * ohci, ed_t * ed);
-static int ep_unlink(ohci_t * ohci, ed_t * ed);
-static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe);
-
-/*-------------------------------------------------------------------------*/
-
-/* we need more TDs than EDs */
-#define NUM_TD 64
-
-/* +1 so we can align the storage */
-td_t gtd[NUM_TD+1];
-/* pointers to aligned storage */
-td_t *ptd;
-
-/* TDs ... */
-static inline struct td *
-td_alloc (struct usb_device *usb_dev)
-{
-       int i;
-       struct td       *td;
-
-       td = NULL;
-       for (i = 0; i < NUM_TD; i++) {
-               if (ptd[i].usb_dev == NULL) {
-                       td = &ptd[i];
-                       td->usb_dev = usb_dev;
-                       break;
-               }
-       }
-       return td;
-}
-
-static inline void
-ed_free (struct ed *ed)
-{
-       ed->usb_dev = NULL;
-}
diff --git a/arch/mips/cpu/mips32/au1x00/config.mk b/arch/mips/cpu/mips32/au1x00/config.mk
deleted file mode 100644 (file)
index 5c89129..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2011
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -mtune=4kc
diff --git a/arch/mips/cpu/mips32/cache.S b/arch/mips/cpu/mips32/cache.S
deleted file mode 100644 (file)
index 22bd844..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- *  Cache-handling routined for MIPS CPUs
- *
- *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm-offsets.h>
-#include <config.h>
-#include <asm/asm.h>
-#include <asm/regdef.h>
-#include <asm/mipsregs.h>
-#include <asm/addrspace.h>
-#include <asm/cacheops.h>
-
-#ifndef CONFIG_SYS_MIPS_CACHE_MODE
-#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
-#endif
-
-#define RA             t9
-
-#define INDEX_BASE     CKSEG0
-
-       .macro  cache_op op addr
-       .set    push
-       .set    noreorder
-       .set    mips3
-       cache   \op, 0(\addr)
-       .set    pop
-       .endm
-
-       .macro  f_fill64 dst, offset, val
-       LONG_S  \val, (\offset +  0 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  1 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  2 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  3 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  4 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  5 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  6 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  7 * LONGSIZE)(\dst)
-#if LONGSIZE == 4
-       LONG_S  \val, (\offset +  8 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  9 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 10 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 11 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 12 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 13 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 14 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 15 * LONGSIZE)(\dst)
-#endif
-       .endm
-
-/*
- * mips_init_icache(uint PRId, ulong icache_size, unchar icache_linesz)
- */
-LEAF(mips_init_icache)
-       blez            a1, 9f
-       mtc0            zero, CP0_TAGLO
-       /* clear tag to invalidate */
-       PTR_LI          t0, INDEX_BASE
-       PTR_ADDU        t1, t0, a1
-1:     cache_op        INDEX_STORE_TAG_I t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-       /* fill once, so data field parity is correct */
-       PTR_LI          t0, INDEX_BASE
-2:     cache_op        FILL t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 2b
-       /* invalidate again - prudent but not strictly neccessary */
-       PTR_LI          t0, INDEX_BASE
-1:     cache_op        INDEX_STORE_TAG_I t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-9:     jr              ra
-       END(mips_init_icache)
-
-/*
- * mips_init_dcache(uint PRId, ulong dcache_size, unchar dcache_linesz)
- */
-LEAF(mips_init_dcache)
-       blez            a1, 9f
-       mtc0            zero, CP0_TAGLO
-       /* clear all tags */
-       PTR_LI          t0, INDEX_BASE
-       PTR_ADDU        t1, t0, a1
-1:     cache_op        INDEX_STORE_TAG_D t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-       /* load from each line (in cached space) */
-       PTR_LI          t0, INDEX_BASE
-2:     LONG_L          zero, 0(t0)
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 2b
-       /* clear all tags */
-       PTR_LI          t0, INDEX_BASE
-1:     cache_op        INDEX_STORE_TAG_D t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-9:     jr              ra
-       END(mips_init_dcache)
-
-/*
- * mips_cache_reset - low level initialisation of the primary caches
- *
- * This routine initialises the primary caches to ensure that they have good
- * parity.  It must be called by the ROM before any cached locations are used
- * to prevent the possibility of data with bad parity being written to memory.
- *
- * To initialise the instruction cache it is essential that a source of data
- * with good parity is available. This routine will initialise an area of
- * memory starting at location zero to be used as a source of parity.
- *
- * RETURNS: N/A
- *
- */
-NESTED(mips_cache_reset, 0, ra)
-       move    RA, ra
-
-#if !defined(CONFIG_SYS_ICACHE_SIZE) || !defined(CONFIG_SYS_DCACHE_SIZE) || \
-    !defined(CONFIG_SYS_CACHELINE_SIZE)
-       /* read Config1 for use below */
-       mfc0    t5, CP0_CONFIG, 1
-#endif
-
-#ifdef CONFIG_SYS_CACHELINE_SIZE
-       li      t7, CONFIG_SYS_CACHELINE_SIZE
-       li      t8, CONFIG_SYS_CACHELINE_SIZE
-#else
-       /* Detect I-cache line size. */
-       srl     t8, t5, MIPS_CONF1_IL_SHIFT
-       andi    t8, t8, (MIPS_CONF1_IL >> MIPS_CONF1_IL_SHIFT)
-       beqz    t8, 1f
-       li      t6, 2
-       sllv    t8, t6, t8
-
-1:     /* Detect D-cache line size. */
-       srl     t7, t5, MIPS_CONF1_DL_SHIFT
-       andi    t7, t7, (MIPS_CONF1_DL >> MIPS_CONF1_DL_SHIFT)
-       beqz    t7, 1f
-       li      t6, 2
-       sllv    t7, t6, t7
-1:
-#endif
-
-#ifdef CONFIG_SYS_ICACHE_SIZE
-       li      t2, CONFIG_SYS_ICACHE_SIZE
-#else
-       /* Detect I-cache size. */
-       srl     t6, t5, MIPS_CONF1_IS_SHIFT
-       andi    t6, t6, (MIPS_CONF1_IS >> MIPS_CONF1_IS_SHIFT)
-       li      t4, 32
-       xori    t2, t6, 0x7
-       beqz    t2, 1f
-       addi    t6, t6, 1
-       sllv    t4, t4, t6
-1:     /* At this point t4 == I-cache sets. */
-       mul     t2, t4, t8
-       srl     t6, t5, MIPS_CONF1_IA_SHIFT
-       andi    t6, t6, (MIPS_CONF1_IA >> MIPS_CONF1_IA_SHIFT)
-       addi    t6, t6, 1
-       /* At this point t6 == I-cache ways. */
-       mul     t2, t2, t6
-#endif
-
-#ifdef CONFIG_SYS_DCACHE_SIZE
-       li      t3, CONFIG_SYS_DCACHE_SIZE
-#else
-       /* Detect D-cache size. */
-       srl     t6, t5, MIPS_CONF1_DS_SHIFT
-       andi    t6, t6, (MIPS_CONF1_DS >> MIPS_CONF1_DS_SHIFT)
-       li      t4, 32
-       xori    t3, t6, 0x7
-       beqz    t3, 1f
-       addi    t6, t6, 1
-       sllv    t4, t4, t6
-1:     /* At this point t4 == I-cache sets. */
-       mul     t3, t4, t7
-       srl     t6, t5, MIPS_CONF1_DA_SHIFT
-       andi    t6, t6, (MIPS_CONF1_DA >> MIPS_CONF1_DA_SHIFT)
-       addi    t6, t6, 1
-       /* At this point t6 == I-cache ways. */
-       mul     t3, t3, t6
-#endif
-
-       /* Determine the largest L1 cache size */
-#if defined(CONFIG_SYS_ICACHE_SIZE) && defined(CONFIG_SYS_DCACHE_SIZE)
-#if CONFIG_SYS_ICACHE_SIZE > CONFIG_SYS_DCACHE_SIZE
-       li      v0, CONFIG_SYS_ICACHE_SIZE
-#else
-       li      v0, CONFIG_SYS_DCACHE_SIZE
-#endif
-#else
-       move    v0, t2
-       sltu    t1, t2, t3
-       movn    v0, t3, t1
-#endif
-       /*
-        * Now clear that much memory starting from zero.
-        */
-       PTR_LI          a0, CKSEG1
-       PTR_ADDU        a1, a0, v0
-2:     PTR_ADDIU       a0, 64
-       f_fill64        a0, -64, zero
-       bne             a0, a1, 2b
-
-       /*
-        * The caches are probably in an indeterminate state,
-        * so we force good parity into them by doing an
-        * invalidate, load/fill, invalidate for each line.
-        */
-
-       /*
-        * Assume bottom of RAM will generate good parity for the cache.
-        */
-
-       /*
-        * Initialize the I-cache first,
-        */
-       move    a1, t2
-       move    a2, t8
-       PTR_LA  v1, mips_init_icache
-       jalr    v1
-
-       /*
-        * then initialize D-cache.
-        */
-       move    a1, t3
-       move    a2, t7
-       PTR_LA  v1, mips_init_dcache
-       jalr    v1
-
-       jr      RA
-       END(mips_cache_reset)
-
-/*
- * dcache_status - get cache status
- *
- * RETURNS: 0 - cache disabled; 1 - cache enabled
- *
- */
-LEAF(dcache_status)
-       mfc0    t0, CP0_CONFIG
-       li      t1, CONF_CM_UNCACHED
-       andi    t0, t0, CONF_CM_CMASK
-       move    v0, zero
-       beq     t0, t1, 2f
-       li      v0, 1
-2:     jr      ra
-       END(dcache_status)
-
-/*
- * dcache_disable - disable cache
- *
- * RETURNS: N/A
- *
- */
-LEAF(dcache_disable)
-       mfc0    t0, CP0_CONFIG
-       li      t1, -8
-       and     t0, t0, t1
-       ori     t0, t0, CONF_CM_UNCACHED
-       mtc0    t0, CP0_CONFIG
-       jr      ra
-       END(dcache_disable)
-
-/*
- * dcache_enable - enable cache
- *
- * RETURNS: N/A
- *
- */
-LEAF(dcache_enable)
-       mfc0    t0, CP0_CONFIG
-       ori     t0, CONF_CM_CMASK
-       xori    t0, CONF_CM_CMASK
-       ori     t0, CONFIG_SYS_MIPS_CACHE_MODE
-       mtc0    t0, CP0_CONFIG
-       jr      ra
-       END(dcache_enable)
diff --git a/arch/mips/cpu/mips32/cpu.c b/arch/mips/cpu/mips32/cpu.c
deleted file mode 100644 (file)
index 278865b..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <netdev.h>
-#include <asm/mipsregs.h>
-#include <asm/cacheops.h>
-#include <asm/reboot.h>
-
-#define cache_op(op,addr)                                              \
-       __asm__ __volatile__(                                           \
-       "       .set    push                                    \n"     \
-       "       .set    noreorder                               \n"     \
-       "       .set    mips3\n\t                               \n"     \
-       "       cache   %0, %1                                  \n"     \
-       "       .set    pop                                     \n"     \
-       :                                                               \
-       : "i" (op), "R" (*(unsigned char *)(addr)))
-
-void __attribute__((weak)) _machine_restart(void)
-{
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       _machine_restart();
-
-       fprintf(stderr, "*** reset failed ***\n");
-       return 0;
-}
-
-#ifdef CONFIG_SYS_CACHELINE_SIZE
-
-static inline unsigned long icache_line_size(void)
-{
-       return CONFIG_SYS_CACHELINE_SIZE;
-}
-
-static inline unsigned long dcache_line_size(void)
-{
-       return CONFIG_SYS_CACHELINE_SIZE;
-}
-
-#else /* !CONFIG_SYS_CACHELINE_SIZE */
-
-static inline unsigned long icache_line_size(void)
-{
-       unsigned long conf1, il;
-       conf1 = read_c0_config1();
-       il = (conf1 & MIPS_CONF1_IL) >> MIPS_CONF1_IL_SHIFT;
-       if (!il)
-               return 0;
-       return 2 << il;
-}
-
-static inline unsigned long dcache_line_size(void)
-{
-       unsigned long conf1, dl;
-       conf1 = read_c0_config1();
-       dl = (conf1 & MIPS_CONF1_DL) >> MIPS_CONF1_DL_SHIFT;
-       if (!dl)
-               return 0;
-       return 2 << dl;
-}
-
-#endif /* !CONFIG_SYS_CACHELINE_SIZE */
-
-void flush_cache(ulong start_addr, ulong size)
-{
-       unsigned long ilsize = icache_line_size();
-       unsigned long dlsize = dcache_line_size();
-       unsigned long addr, aend;
-
-       /* aend will be miscalculated when size is zero, so we return here */
-       if (size == 0)
-               return;
-
-       addr = start_addr & ~(dlsize - 1);
-       aend = (start_addr + size - 1) & ~(dlsize - 1);
-
-       if (ilsize == dlsize) {
-               /* flush I-cache & D-cache simultaneously */
-               while (1) {
-                       cache_op(HIT_WRITEBACK_INV_D, addr);
-                       cache_op(HIT_INVALIDATE_I, addr);
-                       if (addr == aend)
-                               break;
-                       addr += dlsize;
-               }
-               return;
-       }
-
-       /* flush D-cache */
-       while (1) {
-               cache_op(HIT_WRITEBACK_INV_D, addr);
-               if (addr == aend)
-                       break;
-               addr += dlsize;
-       }
-
-       /* flush I-cache */
-       addr = start_addr & ~(ilsize - 1);
-       aend = (start_addr + size - 1) & ~(ilsize - 1);
-       while (1) {
-               cache_op(HIT_INVALIDATE_I, addr);
-               if (addr == aend)
-                       break;
-               addr += ilsize;
-       }
-}
-
-void flush_dcache_range(ulong start_addr, ulong stop)
-{
-       unsigned long lsize = dcache_line_size();
-       unsigned long addr = start_addr & ~(lsize - 1);
-       unsigned long aend = (stop - 1) & ~(lsize - 1);
-
-       while (1) {
-               cache_op(HIT_WRITEBACK_INV_D, addr);
-               if (addr == aend)
-                       break;
-               addr += lsize;
-       }
-}
-
-void invalidate_dcache_range(ulong start_addr, ulong stop)
-{
-       unsigned long lsize = dcache_line_size();
-       unsigned long addr = start_addr & ~(lsize - 1);
-       unsigned long aend = (stop - 1) & ~(lsize - 1);
-
-       while (1) {
-               cache_op(HIT_INVALIDATE_D, addr);
-               if (addr == aend)
-                       break;
-               addr += lsize;
-       }
-}
-
-void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
-{
-       write_c0_entrylo0(low0);
-       write_c0_pagemask(pagemask);
-       write_c0_entrylo1(low1);
-       write_c0_entryhi(hi);
-       write_c0_index(index);
-       tlb_write_indexed();
-}
-
-int cpu_eth_init(bd_t *bis)
-{
-#ifdef CONFIG_SOC_AU1X00
-       au1x00_enet_initialize(bis);
-#endif
-       return 0;
-}
diff --git a/arch/mips/cpu/mips32/interrupts.c b/arch/mips/cpu/mips32/interrupts.c
deleted file mode 100644 (file)
index 275fcf5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-int interrupt_init(void)
-{
-       return 0;
-}
-
-void enable_interrupts(void)
-{
-}
-
-int disable_interrupts(void)
-{
-       return 0;
-}
diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
deleted file mode 100644 (file)
index 384ea26..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- *  Startup Code for MIPS32 CPU-core
- *
- *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm-offsets.h>
-#include <config.h>
-#include <asm/regdef.h>
-#include <asm/mipsregs.h>
-
-#ifndef CONFIG_SYS_MIPS_CACHE_MODE
-#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
-#endif
-
-       /*
-        * For the moment disable interrupts, mark the kernel mode and
-        * set ST0_KX so that the CPU does not spit fire when using
-        * 64-bit addresses.
-        */
-       .macro  setup_c0_status set clr
-       .set    push
-       mfc0    t0, CP0_STATUS
-       or      t0, ST0_CU0 | \set | 0x1f | \clr
-       xor     t0, 0x1f | \clr
-       mtc0    t0, CP0_STATUS
-       .set    noreorder
-       sll     zero, 3                         # ehb
-       .set    pop
-       .endm
-
-       .set noreorder
-
-       .globl _start
-       .text
-_start:
-       /* U-boot entry point */
-       b       reset
-        nop
-
-       .org 0x10
-#if defined(CONFIG_SYS_XWAY_EBU_BOOTCFG)
-       /*
-        * Almost all Lantiq XWAY SoC devices have an external bus unit (EBU) to
-        * access external NOR flashes. If the board boots from NOR flash the
-        * internal BootROM does a blind read at address 0xB0000010 to read the
-        * initial configuration for that EBU in order to access the flash
-        * device with correct parameters. This config option is board-specific.
-        */
-       .word CONFIG_SYS_XWAY_EBU_BOOTCFG
-       .word 0x0
-#elif defined(CONFIG_MALTA)
-       /*
-        * Linux expects the Board ID here.
-        */
-       .word 0x00000420        # 0x420 (Malta Board with CoreLV)
-       .word 0x00000000
-#endif
-
-       .org 0x200
-       /* TLB refill, 32 bit task */
-1:     b       1b
-        nop
-
-       .org 0x280
-       /* XTLB refill, 64 bit task */
-1:     b       1b
-        nop
-
-       .org 0x300
-       /* Cache error exception */
-1:     b       1b
-        nop
-
-       .org 0x380
-       /* General exception */
-1:     b       1b
-        nop
-
-       .org 0x400
-       /* Catch interrupt exceptions */
-1:     b       1b
-        nop
-
-       .org 0x480
-       /* EJTAG debug exception */
-1:     b       1b
-        nop
-
-       .align 4
-reset:
-
-       /* Clear watch registers */
-       mtc0    zero, CP0_WATCHLO
-       mtc0    zero, CP0_WATCHHI
-
-       /* WP(Watch Pending), SW0/1 should be cleared */
-       mtc0    zero, CP0_CAUSE
-
-       setup_c0_status 0 0
-
-       /* Init Timer */
-       mtc0    zero, CP0_COUNT
-       mtc0    zero, CP0_COMPARE
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-       /* CONFIG0 register */
-       li      t0, CONF_CM_UNCACHED
-       mtc0    t0, CP0_CONFIG
-#endif
-
-       /* Initialize $gp */
-       bal     1f
-        nop
-       .word   _gp
-1:
-       lw      gp, 0(ra)
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-       /* Initialize any external memory */
-       la      t9, lowlevel_init
-       jalr    t9
-        nop
-
-       /* Initialize caches... */
-       la      t9, mips_cache_reset
-       jalr    t9
-        nop
-
-       /* ... and enable them */
-       li      t0, CONFIG_SYS_MIPS_CACHE_MODE
-       mtc0    t0, CP0_CONFIG
-#endif
-
-       /* Set up temporary stack */
-       li      sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
-       move    fp, sp
-
-       la      t9, board_init_f
-       jr      t9
-        move   ra, zero
-
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- * a0 = addr_sp
- * a1 = gd
- * a2 = destination address
- */
-       .globl  relocate_code
-       .ent    relocate_code
-relocate_code:
-       move    sp, a0                  # set new stack pointer
-       move    fp, sp
-
-       move    s0, a1                  # save gd in s0
-       move    s2, a2                  # save destination address in s2
-
-       li      t0, CONFIG_SYS_MONITOR_BASE
-       sub     s1, s2, t0              # s1 <-- relocation offset
-
-       la      t3, in_ram
-       lw      t2, -12(t3)             # t2 <-- __image_copy_end
-       move    t1, a2
-
-       add     gp, s1                  # adjust gp
-
-       /*
-        * t0 = source address
-        * t1 = target address
-        * t2 = source end address
-        */
-1:
-       lw      t3, 0(t0)
-       sw      t3, 0(t1)
-       addu    t0, 4
-       blt     t0, t2, 1b
-        addu   t1, 4
-
-       /* If caches were enabled, we would have to flush them here. */
-       sub     a1, t1, s2              # a1 <-- size
-       la      t9, flush_cache
-       jalr    t9
-        move   a0, s2                  # a0 <-- destination address
-
-       /* Jump to where we've relocated ourselves */
-       addi    t0, s2, in_ram - _start
-       jr      t0
-        nop
-
-       .word   __rel_dyn_end
-       .word   __rel_dyn_start
-       .word   __image_copy_end
-       .word   _GLOBAL_OFFSET_TABLE_
-       .word   num_got_entries
-
-in_ram:
-       /*
-        * Now we want to update GOT.
-        *
-        * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
-        * generated by GNU ld. Skip these reserved entries from relocation.
-        */
-       lw      t3, -4(t0)              # t3 <-- num_got_entries
-       lw      t8, -8(t0)              # t8 <-- _GLOBAL_OFFSET_TABLE_
-       add     t8, s1                  # t8 now holds relocated _G_O_T_
-       addi    t8, t8, 8               # skipping first two entries
-       li      t2, 2
-1:
-       lw      t1, 0(t8)
-       beqz    t1, 2f
-        add    t1, s1
-       sw      t1, 0(t8)
-2:
-       addi    t2, 1
-       blt     t2, t3, 1b
-        addi   t8, 4
-
-       /* Update dynamic relocations */
-       lw      t1, -16(t0)             # t1 <-- __rel_dyn_start
-       lw      t2, -20(t0)             # t2 <-- __rel_dyn_end
-
-       b       2f                      # skip first reserved entry
-        addi   t1, 8
-
-1:
-       lw      t8, -4(t1)              # t8 <-- relocation info
-
-       li      t3, 3
-       bne     t8, t3, 2f              # skip non R_MIPS_REL32 entries
-        nop
-
-       lw      t3, -8(t1)              # t3 <-- location to fix up in FLASH
-
-       lw      t8, 0(t3)               # t8 <-- original pointer
-       add     t8, s1                  # t8 <-- adjusted pointer
-
-       add     t3, s1                  # t3 <-- location to fix up in RAM
-       sw      t8, 0(t3)
-
-2:
-       blt     t1, t2, 1b
-        addi   t1, 8                   # each rel.dyn entry is 8 bytes
-
-       /*
-        * Clear BSS
-        *
-        * GOT is now relocated. Thus __bss_start and __bss_end can be
-        * accessed directly via $gp.
-        */
-       la      t1, __bss_start         # t1 <-- __bss_start
-       la      t2, __bss_end           # t2 <-- __bss_end
-
-1:
-       sw      zero, 0(t1)
-       blt     t1, t2, 1b
-        addi   t1, 4
-
-       move    a0, s0                  # a0 <-- gd
-       move    a1, s2
-       la      t9, board_init_r
-       jr      t9
-        move   ra, zero
-
-       .end    relocate_code
diff --git a/arch/mips/cpu/mips32/time.c b/arch/mips/cpu/mips32/time.c
deleted file mode 100644 (file)
index 386f45a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mipsregs.h>
-
-static unsigned long timestamp;
-
-/* how many counter cycles in a jiffy */
-#define CYCLES_PER_JIFFY       \
-       (CONFIG_SYS_MIPS_TIMER_FREQ + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ
-
-/*
- * timer without interrupts
- */
-
-int timer_init(void)
-{
-       /* Set up the timer for the first expiration. */
-       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-
-       return 0;
-}
-
-ulong get_timer(ulong base)
-{
-       unsigned int count;
-       unsigned int expirelo = read_c0_compare();
-
-       /* Check to see if we have missed any timestamps. */
-       count = read_c0_count();
-       while ((count - expirelo) < 0x7fffffff) {
-               expirelo += CYCLES_PER_JIFFY;
-               timestamp++;
-       }
-       write_c0_compare(expirelo);
-
-       return timestamp - base;
-}
-
-void __udelay(unsigned long usec)
-{
-       unsigned int tmo;
-
-       tmo = read_c0_count() + (usec * (CONFIG_SYS_MIPS_TIMER_FREQ / 1000000));
-       while ((tmo - read_c0_count()) < 0x7fffffff)
-               /*NOP*/;
-}
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On MIPS it just returns the timer value.
- */
-unsigned long long get_ticks(void)
-{
-       return get_timer(0);
-}
-
-/*
- * This function is derived from PowerPC code (timebase clock frequency).
- * On MIPS it returns the number of timer ticks per second.
- */
-ulong get_tbclk(void)
-{
-       return CONFIG_SYS_HZ;
-}
diff --git a/arch/mips/cpu/mips64/Makefile b/arch/mips/cpu/mips64/Makefile
deleted file mode 100644 (file)
index 899c319..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-extra-y        = start.o
-obj-y  = cpu.o interrupts.o time.o cache.o
diff --git a/arch/mips/cpu/mips64/cache.S b/arch/mips/cpu/mips64/cache.S
deleted file mode 100644 (file)
index 36d8688..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- *  Cache-handling routined for MIPS CPUs
- *
- *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm-offsets.h>
-#include <config.h>
-#include <asm/asm.h>
-#include <asm/regdef.h>
-#include <asm/mipsregs.h>
-#include <asm/addrspace.h>
-#include <asm/cacheops.h>
-
-#define RA             t9
-
-/*
- * 16kB is the maximum size of instruction and data caches on MIPS 4K,
- * 64kB is on 4KE, 24K, 5K, etc. Set bigger size for convenience.
- *
- * Note that the above size is the maximum size of primary cache. U-Boot
- * doesn't have L2 cache support for now.
- */
-#define MIPS_MAX_CACHE_SIZE    0x10000
-
-#define INDEX_BASE     CKSEG0
-
-       .macro  cache_op op addr
-       .set    push
-       .set    noreorder
-       .set    mips3
-       cache   \op, 0(\addr)
-       .set    pop
-       .endm
-
-       .macro  f_fill64 dst, offset, val
-       LONG_S  \val, (\offset +  0 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  1 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  2 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  3 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  4 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  5 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  6 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  7 * LONGSIZE)(\dst)
-#if LONGSIZE == 4
-       LONG_S  \val, (\offset +  8 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset +  9 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 10 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 11 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 12 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 13 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 14 * LONGSIZE)(\dst)
-       LONG_S  \val, (\offset + 15 * LONGSIZE)(\dst)
-#endif
-       .endm
-
-/*
- * mips_init_icache(uint PRId, ulong icache_size, unchar icache_linesz)
- */
-LEAF(mips_init_icache)
-       blez            a1, 9f
-       mtc0            zero, CP0_TAGLO
-       /* clear tag to invalidate */
-       PTR_LI          t0, INDEX_BASE
-       PTR_ADDU        t1, t0, a1
-1:     cache_op        INDEX_STORE_TAG_I t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-       /* fill once, so data field parity is correct */
-       PTR_LI          t0, INDEX_BASE
-2:     cache_op        FILL t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 2b
-       /* invalidate again - prudent but not strictly neccessary */
-       PTR_LI          t0, INDEX_BASE
-1:     cache_op        INDEX_STORE_TAG_I t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-9:     jr              ra
-       END(mips_init_icache)
-
-/*
- * mips_init_dcache(uint PRId, ulong dcache_size, unchar dcache_linesz)
- */
-LEAF(mips_init_dcache)
-       blez            a1, 9f
-       mtc0            zero, CP0_TAGLO
-       /* clear all tags */
-       PTR_LI          t0, INDEX_BASE
-       PTR_ADDU        t1, t0, a1
-1:     cache_op        INDEX_STORE_TAG_D t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-       /* load from each line (in cached space) */
-       PTR_LI          t0, INDEX_BASE
-2:     LONG_L          zero, 0(t0)
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 2b
-       /* clear all tags */
-       PTR_LI          t0, INDEX_BASE
-1:     cache_op        INDEX_STORE_TAG_D t0
-       PTR_ADDU        t0, a2
-       bne             t0, t1, 1b
-9:     jr              ra
-       END(mips_init_dcache)
-
-/*
- * mips_cache_reset - low level initialisation of the primary caches
- *
- * This routine initialises the primary caches to ensure that they have good
- * parity.  It must be called by the ROM before any cached locations are used
- * to prevent the possibility of data with bad parity being written to memory.
- *
- * To initialise the instruction cache it is essential that a source of data
- * with good parity is available. This routine will initialise an area of
- * memory starting at location zero to be used as a source of parity.
- *
- * RETURNS: N/A
- *
- */
-NESTED(mips_cache_reset, 0, ra)
-       move    RA, ra
-       li      t2, CONFIG_SYS_ICACHE_SIZE
-       li      t3, CONFIG_SYS_DCACHE_SIZE
-       li      t8, CONFIG_SYS_CACHELINE_SIZE
-
-       li      v0, MIPS_MAX_CACHE_SIZE
-
-       /*
-        * Now clear that much memory starting from zero.
-        */
-       PTR_LI          a0, CKSEG1
-       PTR_ADDU        a1, a0, v0
-2:     PTR_ADDIU       a0, 64
-       f_fill64        a0, -64, zero
-       bne             a0, a1, 2b
-
-       /*
-        * The caches are probably in an indeterminate state,
-        * so we force good parity into them by doing an
-        * invalidate, load/fill, invalidate for each line.
-        */
-
-       /*
-        * Assume bottom of RAM will generate good parity for the cache.
-        */
-
-       /*
-        * Initialize the I-cache first,
-        */
-       move    a1, t2
-       move    a2, t8
-       PTR_LA  v1, mips_init_icache
-       jalr    v1
-
-       /*
-        * then initialize D-cache.
-        */
-       move    a1, t3
-       move    a2, t8
-       PTR_LA  v1, mips_init_dcache
-       jalr    v1
-
-       jr      RA
-       END(mips_cache_reset)
-
-/*
- * dcache_status - get cache status
- *
- * RETURNS: 0 - cache disabled; 1 - cache enabled
- *
- */
-LEAF(dcache_status)
-       mfc0    t0, CP0_CONFIG
-       li      t1, CONF_CM_UNCACHED
-       andi    t0, t0, CONF_CM_CMASK
-       move    v0, zero
-       beq     t0, t1, 2f
-       li      v0, 1
-2:     jr      ra
-       END(dcache_status)
-
-/*
- * dcache_disable - disable cache
- *
- * RETURNS: N/A
- *
- */
-LEAF(dcache_disable)
-       mfc0    t0, CP0_CONFIG
-       li      t1, -8
-       and     t0, t0, t1
-       ori     t0, t0, CONF_CM_UNCACHED
-       mtc0    t0, CP0_CONFIG
-       jr      ra
-       END(dcache_disable)
-
-/*
- * dcache_enable - enable cache
- *
- * RETURNS: N/A
- *
- */
-LEAF(dcache_enable)
-       mfc0    t0, CP0_CONFIG
-       ori     t0, CONF_CM_CMASK
-       xori    t0, CONF_CM_CMASK
-       ori     t0, CONF_CM_CACHABLE_NONCOHERENT
-       mtc0    t0, CP0_CONFIG
-       jr      ra
-       END(dcache_enable)
diff --git a/arch/mips/cpu/mips64/cpu.c b/arch/mips/cpu/mips64/cpu.c
deleted file mode 100644 (file)
index 9f45cfc..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <netdev.h>
-#include <asm/mipsregs.h>
-#include <asm/cacheops.h>
-#include <asm/reboot.h>
-
-#define cache_op(op, addr)                                             \
-       __asm__ __volatile__(                                           \
-       "       .set    push\n"                                         \
-       "       .set    noreorder\n"                                    \
-       "       .set    mips64\n"                                       \
-       "       cache   %0, %1\n"                                       \
-       "       .set    pop\n"                                          \
-       :                                                               \
-       : "i" (op), "R" (*(unsigned char *)(addr)))
-
-void __attribute__((weak)) _machine_restart(void)
-{
-       fprintf(stderr, "*** reset failed ***\n");
-
-       while (1)
-               /* NOP */;
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       _machine_restart();
-
-       return 0;
-}
-
-void flush_cache(ulong start_addr, ulong size)
-{
-       unsigned long lsize = CONFIG_SYS_CACHELINE_SIZE;
-       unsigned long addr = start_addr & ~(lsize - 1);
-       unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
-
-       /* aend will be miscalculated when size is zero, so we return here */
-       if (size == 0)
-               return;
-
-       while (1) {
-               cache_op(HIT_WRITEBACK_INV_D, addr);
-               cache_op(HIT_INVALIDATE_I, addr);
-               if (addr == aend)
-                       break;
-               addr += lsize;
-       }
-}
-
-void flush_dcache_range(ulong start_addr, ulong stop)
-{
-       unsigned long lsize = CONFIG_SYS_CACHELINE_SIZE;
-       unsigned long addr = start_addr & ~(lsize - 1);
-       unsigned long aend = (stop - 1) & ~(lsize - 1);
-
-       while (1) {
-               cache_op(HIT_WRITEBACK_INV_D, addr);
-               if (addr == aend)
-                       break;
-               addr += lsize;
-       }
-}
-
-void invalidate_dcache_range(ulong start_addr, ulong stop)
-{
-       unsigned long lsize = CONFIG_SYS_CACHELINE_SIZE;
-       unsigned long addr = start_addr & ~(lsize - 1);
-       unsigned long aend = (stop - 1) & ~(lsize - 1);
-
-       while (1) {
-               cache_op(HIT_INVALIDATE_D, addr);
-               if (addr == aend)
-                       break;
-               addr += lsize;
-       }
-}
-
-void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
-{
-       write_c0_entrylo0(low0);
-       write_c0_pagemask(pagemask);
-       write_c0_entrylo1(low1);
-       write_c0_entryhi(hi);
-       write_c0_index(index);
-       tlb_write_indexed();
-}
diff --git a/arch/mips/cpu/mips64/interrupts.c b/arch/mips/cpu/mips64/interrupts.c
deleted file mode 100644 (file)
index 275fcf5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-int interrupt_init(void)
-{
-       return 0;
-}
-
-void enable_interrupts(void)
-{
-}
-
-int disable_interrupts(void)
-{
-       return 0;
-}
diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
deleted file mode 100644 (file)
index 6ff714e..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *  Startup Code for MIPS64 CPU-core
- *
- *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <asm-offsets.h>
-#include <config.h>
-#include <asm/regdef.h>
-#include <asm/mipsregs.h>
-
-#ifndef CONFIG_SYS_MIPS_CACHE_MODE
-#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
-#endif
-
-#ifdef CONFIG_SYS_LITTLE_ENDIAN
-#define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
-       (((r_type) << 24) | ((r_type2) << 16) | ((r_type3) << 8) | (ssym))
-#else
-#define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
-       ((r_type) | ((r_type2) << 8) | ((r_type3) << 16) | (ssym) << 24)
-#endif
-
-       /*
-        * For the moment disable interrupts, mark the kernel mode and
-        * set ST0_KX so that the CPU does not spit fire when using
-        * 64-bit addresses.
-        */
-       .macro  setup_c0_status set clr
-       .set    push
-       mfc0    t0, CP0_STATUS
-       or      t0, ST0_CU0 | \set | 0x1f | \clr
-       xor     t0, 0x1f | \clr
-       mtc0    t0, CP0_STATUS
-       .set    noreorder
-       sll     zero, 3                         # ehb
-       .set    pop
-       .endm
-
-       .set noreorder
-
-       .globl _start
-       .text
-_start:
-       /* U-boot entry point */
-       b       reset
-        nop
-
-       .org 0x200
-       /* TLB refill, 32 bit task */
-1:     b       1b
-        nop
-
-       .org 0x280
-       /* XTLB refill, 64 bit task */
-1:     b       1b
-        nop
-
-       .org 0x300
-       /* Cache error exception */
-1:     b       1b
-        nop
-
-       .org 0x380
-       /* General exception */
-1:     b       1b
-        nop
-
-       .org 0x400
-       /* Catch interrupt exceptions */
-1:     b       1b
-        nop
-
-       .org 0x480
-       /* EJTAG debug exception */
-1:     b       1b
-        nop
-
-       .align 4
-reset:
-
-       /* Clear watch registers */
-       dmtc0   zero, CP0_WATCHLO
-       dmtc0   zero, CP0_WATCHHI
-
-       /* WP(Watch Pending), SW0/1 should be cleared */
-       mtc0    zero, CP0_CAUSE
-
-       setup_c0_status ST0_KX 0
-
-       /* Init Timer */
-       mtc0    zero, CP0_COUNT
-       mtc0    zero, CP0_COMPARE
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-       /* CONFIG0 register */
-       dli     t0, CONF_CM_UNCACHED
-       mtc0    t0, CP0_CONFIG
-#endif
-
-       /*
-        * Initialize $gp, force 8 byte alignment of bal instruction to forbid
-        * the compiler to put nop's between bal and _gp. This is required to
-        * keep _gp and ra aligned to 8 byte.
-        */
-       .align  3
-       bal     1f
-        nop
-       .dword  _gp
-1:
-       ld      gp, 0(ra)
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-       /* Initialize any external memory */
-       dla     t9, lowlevel_init
-       jalr    t9
-        nop
-
-       /* Initialize caches... */
-       dla     t9, mips_cache_reset
-       jalr    t9
-        nop
-
-       /* ... and enable them */
-       dli     t0, CONFIG_SYS_MIPS_CACHE_MODE
-       mtc0    t0, CP0_CONFIG
-#endif
-
-       /* Set up temporary stack */
-       dli     sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
-       move    fp, sp
-
-       dla     t9, board_init_f
-       jr      t9
-        move   ra, zero
-
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- * a0 = addr_sp
- * a1 = gd
- * a2 = destination address
- */
-       .globl  relocate_code
-       .ent    relocate_code
-relocate_code:
-       move    sp, a0                  # set new stack pointer
-       move    fp, sp
-
-       move    s0, a1                  # save gd in s0
-       move    s2, a2                  # save destination address in s2
-
-       dli     t0, CONFIG_SYS_MONITOR_BASE
-       dsub    s1, s2, t0              # s1 <-- relocation offset
-
-       dla     t3, in_ram
-       ld      t2, -24(t3)             # t2 <-- __image_copy_end
-       move    t1, a2
-
-       dadd    gp, s1                  # adjust gp
-
-       /*
-        * t0 = source address
-        * t1 = target address
-        * t2 = source end address
-        */
-1:
-       lw      t3, 0(t0)
-       sw      t3, 0(t1)
-       daddu   t0, 4
-       blt     t0, t2, 1b
-        daddu  t1, 4
-
-       /* If caches were enabled, we would have to flush them here. */
-       dsub    a1, t1, s2              # a1 <-- size
-       dla     t9, flush_cache
-       jalr    t9
-        move   a0, s2                  # a0 <-- destination address
-
-       /* Jump to where we've relocated ourselves */
-       daddi   t0, s2, in_ram - _start
-       jr      t0
-        nop
-
-       .dword  __rel_dyn_end
-       .dword  __rel_dyn_start
-       .dword  __image_copy_end
-       .dword  _GLOBAL_OFFSET_TABLE_
-       .dword  num_got_entries
-
-in_ram:
-       /*
-        * Now we want to update GOT.
-        *
-        * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
-        * generated by GNU ld. Skip these reserved entries from relocation.
-        */
-       ld      t3, -8(t0)              # t3 <-- num_got_entries
-       ld      t8, -16(t0)             # t8 <-- _GLOBAL_OFFSET_TABLE_
-       dadd    t8, s1                  # t8 now holds relocated _G_O_T_
-       daddi   t8, t8, 16              # skipping first two entries
-       dli     t2, 2
-1:
-       ld      t1, 0(t8)
-       beqz    t1, 2f
-        dadd   t1, s1
-       sd      t1, 0(t8)
-2:
-       daddi   t2, 1
-       blt     t2, t3, 1b
-        daddi  t8, 8
-
-       /* Update dynamic relocations */
-       ld      t1, -32(t0)             # t1 <-- __rel_dyn_start
-       ld      t2, -40(t0)             # t2 <-- __rel_dyn_end
-
-       b       2f                      # skip first reserved entry
-        daddi  t1, 16
-
-1:
-       lw      t8, -4(t1)              # t8 <-- relocation info
-
-       dli     t3, MIPS64_R_INFO(0x00, 0x00, 0x12, 0x03)
-       bne     t8, t3, 2f              # skip non R_MIPS_REL32 entries
-        nop
-
-       ld      t3, -16(t1)             # t3 <-- location to fix up in FLASH
-
-       ld      t8, 0(t3)               # t8 <-- original pointer
-       dadd    t8, s1                  # t8 <-- adjusted pointer
-
-       dadd    t3, s1                  # t3 <-- location to fix up in RAM
-       sd      t8, 0(t3)
-
-2:
-       blt     t1, t2, 1b
-        daddi  t1, 16                  # each rel.dyn entry is 16 bytes
-
-       /*
-        * Clear BSS
-        *
-        * GOT is now relocated. Thus __bss_start and __bss_end can be
-        * accessed directly via $gp.
-        */
-       dla     t1, __bss_start         # t1 <-- __bss_start
-       dla     t2, __bss_end           # t2 <-- __bss_end
-
-1:
-       sd      zero, 0(t1)
-       blt     t1, t2, 1b
-        daddi  t1, 8
-
-       move    a0, s0                  # a0 <-- gd
-       move    a1, s2
-       dla     t9, board_init_r
-       jr      t9
-        move   ra, zero
-
-       .end    relocate_code
diff --git a/arch/mips/cpu/mips64/time.c b/arch/mips/cpu/mips64/time.c
deleted file mode 100644 (file)
index 0497acf..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mipsregs.h>
-
-static unsigned long timestamp;
-
-/* how many counter cycles in a jiffy */
-#define CYCLES_PER_JIFFY        \
-       (CONFIG_SYS_MIPS_TIMER_FREQ + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ
-
-/*
- * timer without interrupts
- */
-
-int timer_init(void)
-{
-       /* Set up the timer for the first expiration. */
-       write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
-
-       return 0;
-}
-
-ulong get_timer(ulong base)
-{
-       unsigned int count;
-       unsigned int expirelo = read_c0_compare();
-
-       /* Check to see if we have missed any timestamps. */
-       count = read_c0_count();
-       while ((count - expirelo) < 0x7fffffff) {
-               expirelo += CYCLES_PER_JIFFY;
-               timestamp++;
-       }
-       write_c0_compare(expirelo);
-
-       return timestamp - base;
-}
-
-void __udelay(unsigned long usec)
-{
-       unsigned int tmo;
-
-       tmo = read_c0_count() + (usec * (CONFIG_SYS_MIPS_TIMER_FREQ / 1000000));
-       while ((tmo - read_c0_count()) < 0x7fffffff)
-               /*NOP*/;
-}
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On MIPS it just returns the timer value.
- */
-unsigned long long get_ticks(void)
-{
-       return get_timer(0);
-}
-
-/*
- * This function is derived from PowerPC code (timebase clock frequency).
- * On MIPS it returns the number of timer ticks per second.
- */
-ulong get_tbclk(void)
-{
-       return CONFIG_SYS_HZ;
-}
diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
new file mode 100644 (file)
index 0000000..3b5b622
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ *  Startup Code for MIPS32 CPU-core
+ *
+ *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+
+#ifndef CONFIG_SYS_MIPS_CACHE_MODE
+#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
+#endif
+
+#ifndef CONFIG_SYS_INIT_SP_ADDR
+#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + \
+                               CONFIG_SYS_INIT_SP_OFFSET)
+#endif
+
+#ifdef CONFIG_32BIT
+# define MIPS_RELOC    3
+# define STATUS_SET    0
+#endif
+
+#ifdef CONFIG_64BIT
+# ifdef CONFIG_SYS_LITTLE_ENDIAN
+#  define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
+       (((r_type) << 24) | ((r_type2) << 16) | ((r_type3) << 8) | (ssym))
+# else
+#  define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
+       ((r_type) | ((r_type2) << 8) | ((r_type3) << 16) | (ssym) << 24)
+# endif
+# define MIPS_RELOC    MIPS64_R_INFO(0x00, 0x00, 0x12, 0x03)
+# define STATUS_SET    ST0_KX
+#endif
+
+       /*
+        * For the moment disable interrupts, mark the kernel mode and
+        * set ST0_KX so that the CPU does not spit fire when using
+        * 64-bit addresses.
+        */
+       .macro  setup_c0_status set clr
+       .set    push
+       mfc0    t0, CP0_STATUS
+       or      t0, ST0_CU0 | \set | 0x1f | \clr
+       xor     t0, 0x1f | \clr
+       mtc0    t0, CP0_STATUS
+       .set    noreorder
+       sll     zero, 3                         # ehb
+       .set    pop
+       .endm
+
+       .set noreorder
+
+       .globl _start
+       .text
+_start:
+       /* U-boot entry point */
+       b       reset
+        nop
+
+       .org 0x10
+#if defined(CONFIG_SYS_XWAY_EBU_BOOTCFG)
+       /*
+        * Almost all Lantiq XWAY SoC devices have an external bus unit (EBU) to
+        * access external NOR flashes. If the board boots from NOR flash the
+        * internal BootROM does a blind read at address 0xB0000010 to read the
+        * initial configuration for that EBU in order to access the flash
+        * device with correct parameters. This config option is board-specific.
+        */
+       .word CONFIG_SYS_XWAY_EBU_BOOTCFG
+       .word 0x0
+#elif defined(CONFIG_MALTA)
+       /*
+        * Linux expects the Board ID here.
+        */
+       .word 0x00000420        # 0x420 (Malta Board with CoreLV)
+       .word 0x00000000
+#endif
+
+       .org 0x200
+       /* TLB refill, 32 bit task */
+1:     b       1b
+        nop
+
+       .org 0x280
+       /* XTLB refill, 64 bit task */
+1:     b       1b
+        nop
+
+       .org 0x300
+       /* Cache error exception */
+1:     b       1b
+        nop
+
+       .org 0x380
+       /* General exception */
+1:     b       1b
+        nop
+
+       .org 0x400
+       /* Catch interrupt exceptions */
+1:     b       1b
+        nop
+
+       .org 0x480
+       /* EJTAG debug exception */
+1:     b       1b
+        nop
+
+       .align 4
+reset:
+
+       /* Clear watch registers */
+       MTC0    zero, CP0_WATCHLO
+       MTC0    zero, CP0_WATCHHI
+
+       /* WP(Watch Pending), SW0/1 should be cleared */
+       mtc0    zero, CP0_CAUSE
+
+       setup_c0_status STATUS_SET 0
+
+       /* Init Timer */
+       mtc0    zero, CP0_COUNT
+       mtc0    zero, CP0_COMPARE
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+       /* CONFIG0 register */
+       li      t0, CONF_CM_UNCACHED
+       mtc0    t0, CP0_CONFIG
+#endif
+
+       /*
+        * Initialize $gp, force pointer sized alignment of bal instruction to
+        * forbid the compiler to put nop's between bal and _gp. This is
+        * required to keep _gp and ra aligned to 8 byte.
+        */
+       .align  PTRLOG
+       bal     1f
+        nop
+       PTR     _gp
+1:
+       PTR_L   gp, 0(ra)
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+       /* Initialize any external memory */
+       PTR_LA  t9, lowlevel_init
+       jalr    t9
+        nop
+
+       /* Initialize caches... */
+       PTR_LA  t9, mips_cache_reset
+       jalr    t9
+        nop
+
+       /* ... and enable them */
+       li      t0, CONFIG_SYS_MIPS_CACHE_MODE
+       mtc0    t0, CP0_CONFIG
+#endif
+
+       /* Set up temporary stack */
+       PTR_LI  t0, -16
+       PTR_LI  t1, CONFIG_SYS_INIT_SP_ADDR
+       and     sp, t1, t0              # force 16 byte alignment
+       PTR_SUB sp, sp, GD_SIZE         # reserve space for gd
+       and     sp, sp, t0              # force 16 byte alignment
+       move    k0, sp                  # save gd pointer
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+       PTR_LI  t2, CONFIG_SYS_MALLOC_F_LEN
+       PTR_SUB sp, sp, t2              # reserve space for early malloc
+       and     sp, sp, t0              # force 16 byte alignment
+#endif
+       move    fp, sp
+
+       /* Clear gd */
+       move    t0, k0
+1:
+       sw      zero, 0(t0)
+       blt     t0, t1, 1b
+        PTR_ADDI t0, 4
+
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+       PTR_ADDU t0, k0, GD_MALLOC_BASE # gd->malloc_base offset
+       sw      sp, 0(t0)
+#endif
+
+       PTR_LA  t9, board_init_f
+       jr      t9
+        move   ra, zero
+
+/*
+ * void relocate_code (addr_sp, gd, addr_moni)
+ *
+ * This "function" does not return, instead it continues in RAM
+ * after relocating the monitor code.
+ *
+ * a0 = addr_sp
+ * a1 = gd
+ * a2 = destination address
+ */
+       .globl  relocate_code
+       .ent    relocate_code
+relocate_code:
+       move    sp, a0                  # set new stack pointer
+       move    fp, sp
+
+       move    s0, a1                  # save gd in s0
+       move    s2, a2                  # save destination address in s2
+
+       PTR_LI  t0, CONFIG_SYS_MONITOR_BASE
+       PTR_SUB s1, s2, t0              # s1 <-- relocation offset
+
+       PTR_LA  t3, in_ram
+       PTR_L   t2, -(3 * PTRSIZE)(t3)  # t2 <-- __image_copy_end
+       move    t1, a2
+
+       PTR_ADD gp, s1                  # adjust gp
+
+       /*
+        * t0 = source address
+        * t1 = target address
+        * t2 = source end address
+        */
+1:
+       lw      t3, 0(t0)
+       sw      t3, 0(t1)
+       PTR_ADDU t0, 4
+       blt     t0, t2, 1b
+        PTR_ADDU t1, 4
+
+       /* If caches were enabled, we would have to flush them here. */
+       PTR_SUB a1, t1, s2              # a1 <-- size
+       PTR_LA  t9, flush_cache
+       jalr    t9
+        move   a0, s2                  # a0 <-- destination address
+
+       /* Jump to where we've relocated ourselves */
+       PTR_ADDI t0, s2, in_ram - _start
+       jr      t0
+        nop
+
+       PTR     __rel_dyn_end
+       PTR     __rel_dyn_start
+       PTR     __image_copy_end
+       PTR     _GLOBAL_OFFSET_TABLE_
+       PTR     num_got_entries
+
+in_ram:
+       /*
+        * Now we want to update GOT.
+        *
+        * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
+        * generated by GNU ld. Skip these reserved entries from relocation.
+        */
+       PTR_L   t3, -(1 * PTRSIZE)(t0)  # t3 <-- num_got_entries
+       PTR_L   t8, -(2 * PTRSIZE)(t0)  # t8 <-- _GLOBAL_OFFSET_TABLE_
+       PTR_ADD t8, s1                  # t8 now holds relocated _G_O_T_
+       PTR_ADDI t8, t8, 2 * PTRSIZE    # skipping first two entries
+       PTR_LI  t2, 2
+1:
+       PTR_L   t1, 0(t8)
+       beqz    t1, 2f
+        PTR_ADD t1, s1
+       PTR_S   t1, 0(t8)
+2:
+       PTR_ADDI t2, 1
+       blt     t2, t3, 1b
+        PTR_ADDI t8, PTRSIZE
+
+       /* Update dynamic relocations */
+       PTR_L   t1, -(4 * PTRSIZE)(t0)  # t1 <-- __rel_dyn_start
+       PTR_L   t2, -(5 * PTRSIZE)(t0)  # t2 <-- __rel_dyn_end
+
+       b       2f                      # skip first reserved entry
+        PTR_ADDI t1, 2 * PTRSIZE
+
+1:
+       lw      t8, -4(t1)              # t8 <-- relocation info
+
+       PTR_LI  t3, MIPS_RELOC
+       bne     t8, t3, 2f              # skip non-MIPS_RELOC entries
+        nop
+
+       PTR_L   t3, -(2 * PTRSIZE)(t1)  # t3 <-- location to fix up in FLASH
+
+       PTR_L   t8, 0(t3)               # t8 <-- original pointer
+       PTR_ADD t8, s1                  # t8 <-- adjusted pointer
+
+       PTR_ADD t3, s1                  # t3 <-- location to fix up in RAM
+       PTR_S   t8, 0(t3)
+
+2:
+       blt     t1, t2, 1b
+        PTR_ADDI t1, 2 * PTRSIZE       # each rel.dyn entry is 2*PTRSIZE bytes
+
+       /*
+        * Clear BSS
+        *
+        * GOT is now relocated. Thus __bss_start and __bss_end can be
+        * accessed directly via $gp.
+        */
+       PTR_LA  t1, __bss_start         # t1 <-- __bss_start
+       PTR_LA  t2, __bss_end           # t2 <-- __bss_end
+
+1:
+       PTR_S   zero, 0(t1)
+       blt     t1, t2, 1b
+        PTR_ADDI t1, PTRSIZE
+
+       move    a0, s0                  # a0 <-- gd
+       move    a1, s2
+       PTR_LA  t9, board_init_r
+       jr      t9
+        move   ra, zero
+
+       .end    relocate_code
diff --git a/arch/mips/cpu/time.c b/arch/mips/cpu/time.c
new file mode 100644 (file)
index 0000000..553da5f
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/mipsregs.h>
+
+unsigned long notrace timer_read_counter(void)
+{
+       return read_c0_count();
+}
+
+ulong notrace get_tbclk(void)
+{
+       return CONFIG_SYS_MIPS_TIMER_FREQ;
+}
index 6464250d8486ec6261c1c6066dd7bb104dd61ee9..75ec380980f7653b1505d1316eae20329704cbb3 100644 (file)
 #ifndef        __ASM_CACHEOPS_H
 #define        __ASM_CACHEOPS_H
 
+#ifndef __ASSEMBLY__
+
+static inline void mips_cache(int op, const volatile void *addr)
+{
+#ifdef __GCC_HAVE_BUILTIN_MIPS_CACHE
+       __builtin_mips_cache(op, addr);
+#else
+       __asm__ __volatile__("cache %0, %1" : : "i"(op), "R"(addr))
+#endif
+}
+
+#endif /* !__ASSEMBLY__ */
+
 /*
  * Cache Operations available on all MIPS processors with R4000-style caches
  */
index 1c8a42bd2f6ea8233e019100ea4560be5ef17984..3a891ba62727511706291cf292b0fb23b7ec2a02 100644 (file)
@@ -7,8 +7,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
-
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
index 9e7c045aacf79f121847191f0748fb95998590bf..d9ffc1558dbfa392db6b3c0eef40fd4bebb4aa59 100644 (file)
@@ -64,4 +64,9 @@
 
 #define PCI_CFG_PIIX4_GENCFG_SERIRQ    (1 << 16)
 
+#define PCI_CFG_PIIX4_IDETIM_PRI       0x40
+#define PCI_CFG_PIIX4_IDETIM_SEC       0x42
+
+#define PCI_CFG_PIIX4_IDETIM_IDE       (1 << 15)
+
 #endif /* _MIPS_ASM_MALTA_H */
index 7f9b6536afa84ab8e7ff2947bec24518caae95b5..ac536da674d3958063f35f8e4bc76ae4c777f3d5 100644 (file)
@@ -5,6 +5,8 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
+obj-y  += cache.o
+obj-y  += cache_init.o
 obj-y  += io.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
index e0722d20d1e876122939117163071e4ecd525b26..d9d8396e63b24b90838970c3256408a3c633f56b 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <image.h>
+#include <fdt_support.h>
 #include <asm/addrspace.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -20,6 +21,18 @@ DECLARE_GLOBAL_DATA_PTR;
 #define mips_boot_malta                0
 #endif
 
+#if defined(CONFIG_MIPS_BOOT_CMDLINE_LEGACY)
+#define mips_boot_cmdline_legacy       1
+#else
+#define mips_boot_cmdline_legacy       0
+#endif
+
+#if defined(CONFIG_MIPS_BOOT_ENV_LEGACY)
+#define mips_boot_env_legacy   1
+#else
+#define mips_boot_env_legacy   0
+#endif
+
 static int linux_argc;
 static char **linux_argv;
 static char *linux_argp;
@@ -60,9 +73,39 @@ static int boot_setup_linux(bootm_headers_t *images)
        if (ret)
                return ret;
 
+#if defined(CONFIG_MIPS_BOOT_FDT) && defined(CONFIG_OF_LIBFDT)
+       if (images->ft_len) {
+               boot_fdt_add_mem_rsv_regions(&images->lmb, images->ft_addr);
+
+               ret = boot_relocate_fdt(&images->lmb, &images->ft_addr,
+                       &images->ft_len);
+               if (ret)
+                       return ret;
+       }
+#endif
+
        return 0;
 }
 
+static void boot_setup_fdt(bootm_headers_t *images)
+{
+#if defined(CONFIG_MIPS_BOOT_FDT) && defined(CONFIG_OF_LIBFDT)
+       u64 mem_start = 0;
+       u64 mem_size = gd->ram_size;
+
+       debug("## setup FDT\n");
+
+       fdt_chosen(images->ft_addr, 1);
+       fdt_fixup_memory_banks(images->ft_addr, &mem_start, &mem_size, 1);
+       fdt_fixup_ethernet(images->ft_addr);
+       fdt_initrd(images->ft_addr, images->initrd_start, images->initrd_end, 1);
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+       ft_board_setup(images->ft_addr, gd->bd);
+#endif
+#endif
+}
+
 static void linux_cmdline_init(void)
 {
        linux_argc = 1;
@@ -92,7 +135,7 @@ static void linux_cmdline_dump(void)
                debug("   arg %03d: %s\n", i, linux_argv[i]);
 }
 
-static void boot_cmdline_linux(bootm_headers_t *images)
+static void linux_cmdline_legacy(bootm_headers_t *images)
 {
        const char *bootargs, *next, *quote;
 
@@ -130,8 +173,40 @@ static void boot_cmdline_linux(bootm_headers_t *images)
 
                bootargs = next;
        }
+}
 
-       linux_cmdline_dump();
+static void linux_cmdline_append(bootm_headers_t *images)
+{
+       char buf[24];
+       ulong mem, rd_start, rd_size;
+
+       /* append mem */
+       mem = gd->ram_size >> 20;
+       sprintf(buf, "mem=%luM", mem);
+       linux_cmdline_set(buf, strlen(buf));
+
+       /* append rd_start and rd_size */
+       rd_start = images->initrd_start;
+       rd_size = images->initrd_end - images->initrd_start;
+
+       if (rd_size) {
+               sprintf(buf, "rd_start=0x%08lX", rd_start);
+               linux_cmdline_set(buf, strlen(buf));
+               sprintf(buf, "rd_size=0x%lX", rd_size);
+               linux_cmdline_set(buf, strlen(buf));
+       }
+}
+
+static void boot_cmdline_linux(bootm_headers_t *images)
+{
+       if (mips_boot_cmdline_legacy && !images->ft_len) {
+               linux_cmdline_legacy(images);
+
+               if (!mips_boot_env_legacy)
+                       linux_cmdline_append(images);
+
+               linux_cmdline_dump();
+       }
 }
 
 static void linux_env_init(void)
@@ -165,7 +240,7 @@ static void linux_env_set(const char *env_name, const char *env_val)
        }
 }
 
-static void boot_prep_linux(bootm_headers_t *images)
+static void linux_env_legacy(bootm_headers_t *images)
 {
        char env_buf[12];
        const char *cp;
@@ -213,6 +288,15 @@ static void boot_prep_linux(bootm_headers_t *images)
        }
 }
 
+static void boot_prep_linux(bootm_headers_t *images)
+{
+       if (mips_boot_env_legacy && !images->ft_len)
+               linux_env_legacy(images);
+
+       if (images->ft_len)
+               boot_setup_fdt(images);
+}
+
 static void boot_jump_linux(bootm_headers_t *images)
 {
        typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong);
@@ -226,8 +310,12 @@ static void boot_jump_linux(bootm_headers_t *images)
        if (mips_boot_malta)
                linux_extra = gd->ram_size;
 
-       /* we assume that the kernel is in place */
-       printf("\nStarting kernel ...\n\n");
+#ifdef CONFIG_BOOTSTAGE_FDT
+       bootstage_fdt_add_report();
+#endif
+#ifdef CONFIG_BOOTSTAGE_REPORT
+       bootstage_report();
+#endif
 
        kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, linux_extra);
 }
diff --git a/arch/mips/lib/cache.c b/arch/mips/lib/cache.c
new file mode 100644 (file)
index 0000000..e245614
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/cacheops.h>
+#include <asm/mipsregs.h>
+
+#ifdef CONFIG_SYS_CACHELINE_SIZE
+
+static inline unsigned long icache_line_size(void)
+{
+       return CONFIG_SYS_CACHELINE_SIZE;
+}
+
+static inline unsigned long dcache_line_size(void)
+{
+       return CONFIG_SYS_CACHELINE_SIZE;
+}
+
+#else /* !CONFIG_SYS_CACHELINE_SIZE */
+
+static inline unsigned long icache_line_size(void)
+{
+       unsigned long conf1, il;
+       conf1 = read_c0_config1();
+       il = (conf1 & MIPS_CONF1_IL) >> MIPS_CONF1_IL_SHIFT;
+       if (!il)
+               return 0;
+       return 2 << il;
+}
+
+static inline unsigned long dcache_line_size(void)
+{
+       unsigned long conf1, dl;
+       conf1 = read_c0_config1();
+       dl = (conf1 & MIPS_CONF1_DL) >> MIPS_CONF1_DL_SHIFT;
+       if (!dl)
+               return 0;
+       return 2 << dl;
+}
+
+#endif /* !CONFIG_SYS_CACHELINE_SIZE */
+
+void flush_cache(ulong start_addr, ulong size)
+{
+       unsigned long ilsize = icache_line_size();
+       unsigned long dlsize = dcache_line_size();
+       const void *addr, *aend;
+
+       /* aend will be miscalculated when size is zero, so we return here */
+       if (size == 0)
+               return;
+
+       addr = (const void *)(start_addr & ~(dlsize - 1));
+       aend = (const void *)((start_addr + size - 1) & ~(dlsize - 1));
+
+       if (ilsize == dlsize) {
+               /* flush I-cache & D-cache simultaneously */
+               while (1) {
+                       mips_cache(HIT_WRITEBACK_INV_D, addr);
+                       mips_cache(HIT_INVALIDATE_I, addr);
+                       if (addr == aend)
+                               break;
+                       addr += dlsize;
+               }
+               return;
+       }
+
+       /* flush D-cache */
+       while (1) {
+               mips_cache(HIT_WRITEBACK_INV_D, addr);
+               if (addr == aend)
+                       break;
+               addr += dlsize;
+       }
+
+       /* flush I-cache */
+       addr = (const void *)(start_addr & ~(ilsize - 1));
+       aend = (const void *)((start_addr + size - 1) & ~(ilsize - 1));
+       while (1) {
+               mips_cache(HIT_INVALIDATE_I, addr);
+               if (addr == aend)
+                       break;
+               addr += ilsize;
+       }
+}
+
+void flush_dcache_range(ulong start_addr, ulong stop)
+{
+       unsigned long lsize = dcache_line_size();
+       const void *addr = (const void *)(start_addr & ~(lsize - 1));
+       const void *aend = (const void *)((stop - 1) & ~(lsize - 1));
+
+       while (1) {
+               mips_cache(HIT_WRITEBACK_INV_D, addr);
+               if (addr == aend)
+                       break;
+               addr += lsize;
+       }
+}
+
+void invalidate_dcache_range(ulong start_addr, ulong stop)
+{
+       unsigned long lsize = dcache_line_size();
+       const void *addr = (const void *)(start_addr & ~(lsize - 1));
+       const void *aend = (const void *)((stop - 1) & ~(lsize - 1));
+
+       while (1) {
+               mips_cache(HIT_INVALIDATE_D, addr);
+               if (addr == aend)
+                       break;
+               addr += lsize;
+       }
+}
diff --git a/arch/mips/lib/cache_init.S b/arch/mips/lib/cache_init.S
new file mode 100644 (file)
index 0000000..137d728
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ *  Cache-handling routined for MIPS CPUs
+ *
+ *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+#include <asm/addrspace.h>
+#include <asm/cacheops.h>
+
+#ifndef CONFIG_SYS_MIPS_CACHE_MODE
+#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
+#endif
+
+#define INDEX_BASE     CKSEG0
+
+       .macro  f_fill64 dst, offset, val
+       LONG_S  \val, (\offset +  0 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  1 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  2 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  3 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  4 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  5 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  6 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  7 * LONGSIZE)(\dst)
+#if LONGSIZE == 4
+       LONG_S  \val, (\offset +  8 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  9 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 10 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 11 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 12 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 13 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 14 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 15 * LONGSIZE)(\dst)
+#endif
+       .endm
+
+       .macro cache_loop       curr, end, line_sz, op
+10:    cache           \op, 0(\curr)
+       PTR_ADDU        \curr, \curr, \line_sz
+       bne             \curr, \end, 10b
+       .endm
+
+       .macro  l1_info         sz, line_sz, off
+       .set    push
+       .set    noat
+
+       mfc0    $1, CP0_CONFIG, 1
+
+       /* detect line size */
+       srl     \line_sz, $1, \off + MIPS_CONF1_DL_SHIFT - MIPS_CONF1_DA_SHIFT
+       andi    \line_sz, \line_sz, (MIPS_CONF1_DL >> MIPS_CONF1_DL_SHIFT)
+       move    \sz, zero
+       beqz    \line_sz, 10f
+       li      \sz, 2
+       sllv    \line_sz, \sz, \line_sz
+
+       /* detect associativity */
+       srl     \sz, $1, \off + MIPS_CONF1_DA_SHIFT - MIPS_CONF1_DA_SHIFT
+       andi    \sz, \sz, (MIPS_CONF1_DA >> MIPS_CONF1_DA_SHIFT)
+       addi    \sz, \sz, 1
+
+       /* sz *= line_sz */
+       mul     \sz, \sz, \line_sz
+
+       /* detect log32(sets) */
+       srl     $1, $1, \off + MIPS_CONF1_DS_SHIFT - MIPS_CONF1_DA_SHIFT
+       andi    $1, $1, (MIPS_CONF1_DS >> MIPS_CONF1_DS_SHIFT)
+       addiu   $1, $1, 1
+       andi    $1, $1, 0x7
+
+       /* sz <<= log32(sets) */
+       sllv    \sz, \sz, $1
+
+       /* sz *= 32 */
+       li      $1, 32
+       mul     \sz, \sz, $1
+10:
+       .set    pop
+       .endm
+/*
+ * mips_cache_reset - low level initialisation of the primary caches
+ *
+ * This routine initialises the primary caches to ensure that they have good
+ * parity.  It must be called by the ROM before any cached locations are used
+ * to prevent the possibility of data with bad parity being written to memory.
+ *
+ * To initialise the instruction cache it is essential that a source of data
+ * with good parity is available. This routine will initialise an area of
+ * memory starting at location zero to be used as a source of parity.
+ *
+ * RETURNS: N/A
+ *
+ */
+LEAF(mips_cache_reset)
+#ifdef CONFIG_SYS_ICACHE_SIZE
+       li      t2, CONFIG_SYS_ICACHE_SIZE
+       li      t8, CONFIG_SYS_CACHELINE_SIZE
+#else
+       l1_info t2, t8, MIPS_CONF1_IA_SHIFT
+#endif
+
+#ifdef CONFIG_SYS_DCACHE_SIZE
+       li      t3, CONFIG_SYS_DCACHE_SIZE
+       li      t9, CONFIG_SYS_CACHELINE_SIZE
+#else
+       l1_info t3, t9, MIPS_CONF1_DA_SHIFT
+#endif
+
+#ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
+
+       /* Determine the largest L1 cache size */
+#if defined(CONFIG_SYS_ICACHE_SIZE) && defined(CONFIG_SYS_DCACHE_SIZE)
+#if CONFIG_SYS_ICACHE_SIZE > CONFIG_SYS_DCACHE_SIZE
+       li      v0, CONFIG_SYS_ICACHE_SIZE
+#else
+       li      v0, CONFIG_SYS_DCACHE_SIZE
+#endif
+#else
+       move    v0, t2
+       sltu    t1, t2, t3
+       movn    v0, t3, t1
+#endif
+       /*
+        * Now clear that much memory starting from zero.
+        */
+       PTR_LI          a0, CKSEG1
+       PTR_ADDU        a1, a0, v0
+2:     PTR_ADDIU       a0, 64
+       f_fill64        a0, -64, zero
+       bne             a0, a1, 2b
+
+#endif /* CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD */
+
+       /*
+        * The TagLo registers used depend upon the CPU implementation, but the
+        * architecture requires that it is safe for software to write to both
+        * TagLo selects 0 & 2 covering supported cases.
+        */
+       mtc0            zero, CP0_TAGLO
+       mtc0            zero, CP0_TAGLO, 2
+
+       /*
+        * The caches are probably in an indeterminate state, so we force good
+        * parity into them by doing an invalidate for each line. If
+        * CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD is set then we'll proceed to
+        * perform a load/fill & a further invalidate for each line, assuming
+        * that the bottom of RAM (having just been cleared) will generate good
+        * parity for the cache.
+        */
+
+       /*
+        * Initialize the I-cache first,
+        */
+       blez            t2, 1f
+       PTR_LI          t0, INDEX_BASE
+       PTR_ADDU        t1, t0, t2
+       /* clear tag to invalidate */
+       cache_loop      t0, t1, t8, INDEX_STORE_TAG_I
+#ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
+       /* fill once, so data field parity is correct */
+       PTR_LI          t0, INDEX_BASE
+       cache_loop      t0, t1, t8, FILL
+       /* invalidate again - prudent but not strictly neccessary */
+       PTR_LI          t0, INDEX_BASE
+       cache_loop      t0, t1, t8, INDEX_STORE_TAG_I
+#endif
+
+       /*
+        * then initialize D-cache.
+        */
+1:     blez            t3, 3f
+       PTR_LI          t0, INDEX_BASE
+       PTR_ADDU        t1, t0, t3
+       /* clear all tags */
+       cache_loop      t0, t1, t9, INDEX_STORE_TAG_D
+#ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
+       /* load from each line (in cached space) */
+       PTR_LI          t0, INDEX_BASE
+2:     LONG_L          zero, 0(t0)
+       PTR_ADDU        t0, t9
+       bne             t0, t1, 2b
+       /* clear all tags */
+       PTR_LI          t0, INDEX_BASE
+       cache_loop      t0, t1, t9, INDEX_STORE_TAG_D
+#endif
+
+3:     jr      ra
+       END(mips_cache_reset)
+
+/*
+ * dcache_status - get cache status
+ *
+ * RETURNS: 0 - cache disabled; 1 - cache enabled
+ *
+ */
+LEAF(dcache_status)
+       mfc0    t0, CP0_CONFIG
+       li      t1, CONF_CM_UNCACHED
+       andi    t0, t0, CONF_CM_CMASK
+       move    v0, zero
+       beq     t0, t1, 2f
+       li      v0, 1
+2:     jr      ra
+       END(dcache_status)
+
+/*
+ * dcache_disable - disable cache
+ *
+ * RETURNS: N/A
+ *
+ */
+LEAF(dcache_disable)
+       mfc0    t0, CP0_CONFIG
+       li      t1, -8
+       and     t0, t0, t1
+       ori     t0, t0, CONF_CM_UNCACHED
+       mtc0    t0, CP0_CONFIG
+       jr      ra
+       END(dcache_disable)
+
+/*
+ * dcache_enable - enable cache
+ *
+ * RETURNS: N/A
+ *
+ */
+LEAF(dcache_enable)
+       mfc0    t0, CP0_CONFIG
+       ori     t0, CONF_CM_CMASK
+       xori    t0, CONF_CM_CMASK
+       ori     t0, CONFIG_SYS_MIPS_CACHE_MODE
+       mtc0    t0, CP0_CONFIG
+       jr      ra
+       END(dcache_enable)
diff --git a/arch/mips/mach-au1x00/Makefile b/arch/mips/mach-au1x00/Makefile
new file mode 100644 (file)
index 0000000..c5643e7
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2011
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o au1x00_ide.o
diff --git a/arch/mips/mach-au1x00/au1x00_eth.c b/arch/mips/mach-au1x00/au1x00_eth.c
new file mode 100644 (file)
index 0000000..39c5b6b
--- /dev/null
@@ -0,0 +1,302 @@
+/* Only eth0 supported for now
+ *
+ * (C) Copyright 2003
+ * Thomas.Lange@corelatus.se
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <config.h>
+
+#if defined(CONFIG_SYS_DISCOVER_PHY)
+#error "PHY not supported yet"
+/* We just assume that we are running 100FD for now */
+/* We all use switches, right? ;-) */
+#endif
+
+/* I assume ethernet behaves like au1000 */
+
+#ifdef CONFIG_SOC_AU1000
+/* Base address differ between cpu:s */
+#define ETH0_BASE AU1000_ETH0_BASE
+#define MAC0_ENABLE AU1000_MAC0_ENABLE
+#else
+#ifdef CONFIG_SOC_AU1100
+#define ETH0_BASE AU1100_ETH0_BASE
+#define MAC0_ENABLE AU1100_MAC0_ENABLE
+#else
+#ifdef CONFIG_SOC_AU1500
+#define ETH0_BASE AU1500_ETH0_BASE
+#define MAC0_ENABLE AU1500_MAC0_ENABLE
+#else
+#ifdef CONFIG_SOC_AU1550
+#define ETH0_BASE AU1550_ETH0_BASE
+#define MAC0_ENABLE AU1550_MAC0_ENABLE
+#else
+#error "No valid cpu set"
+#endif
+#endif
+#endif
+#endif
+
+#include <common.h>
+#include <malloc.h>
+#include <net.h>
+#include <command.h>
+#include <asm/io.h>
+#include <asm/au1x00.h>
+
+#if defined(CONFIG_CMD_MII)
+#include <miiphy.h>
+#endif
+
+/* Ethernet Transmit and Receive Buffers */
+#define DBUF_LENGTH  1520
+#define PKT_MAXBUF_SIZE                1518
+
+static char txbuf[DBUF_LENGTH];
+
+static int next_tx;
+static int next_rx;
+
+/* 4 rx and 4 tx fifos */
+#define NO_OF_FIFOS 4
+
+typedef struct{
+       u32 status;
+       u32 addr;
+       u32 len; /* Only used for tx */
+       u32 not_used;
+} mac_fifo_t;
+
+mac_fifo_t mac_fifo[NO_OF_FIFOS];
+
+#define MAX_WAIT 1000
+
+#if defined(CONFIG_CMD_MII)
+int  au1x00_miiphy_read(const char *devname, unsigned char addr,
+               unsigned char reg, unsigned short * value)
+{
+       volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
+       volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
+       u32 mii_control;
+       unsigned int timedout = 20;
+
+       while (*mii_control_reg & MAC_MII_BUSY) {
+               udelay(1000);
+               if (--timedout == 0) {
+                       printf("au1x00_eth: miiphy_read busy timeout!!\n");
+                       return -1;
+               }
+       }
+
+       mii_control = MAC_SET_MII_SELECT_REG(reg) |
+               MAC_SET_MII_SELECT_PHY(addr) | MAC_MII_READ;
+
+       *mii_control_reg = mii_control;
+
+       timedout = 20;
+       while (*mii_control_reg & MAC_MII_BUSY) {
+               udelay(1000);
+               if (--timedout == 0) {
+                       printf("au1x00_eth: miiphy_read busy timeout!!\n");
+                       return -1;
+               }
+       }
+       *value = *mii_data_reg;
+       return 0;
+}
+
+int  au1x00_miiphy_write(const char *devname, unsigned char addr,
+               unsigned char reg, unsigned short value)
+{
+       volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
+       volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
+       u32 mii_control;
+       unsigned int timedout = 20;
+
+       while (*mii_control_reg & MAC_MII_BUSY) {
+               udelay(1000);
+               if (--timedout == 0) {
+                       printf("au1x00_eth: miiphy_write busy timeout!!\n");
+                       return -1;
+               }
+       }
+
+       mii_control = MAC_SET_MII_SELECT_REG(reg) |
+               MAC_SET_MII_SELECT_PHY(addr) | MAC_MII_WRITE;
+
+       *mii_data_reg = value;
+       *mii_control_reg = mii_control;
+       return 0;
+}
+#endif
+
+static int au1x00_send(struct eth_device *dev, void *packet, int length)
+{
+       volatile mac_fifo_t *fifo_tx =
+               (volatile mac_fifo_t*)(MAC0_TX_DMA_ADDR+MAC_TX_BUFF0_STATUS);
+       int i;
+       int res;
+
+       /* tx fifo should always be idle */
+       fifo_tx[next_tx].len = length;
+       fifo_tx[next_tx].addr = (virt_to_phys(packet))|TX_DMA_ENABLE;
+       au_sync();
+
+       udelay(1);
+       i=0;
+       while(!(fifo_tx[next_tx].addr&TX_T_DONE)){
+               if(i>MAX_WAIT){
+                       printf("TX timeout\n");
+                       break;
+               }
+               udelay(1);
+               i++;
+       }
+
+       /* Clear done bit */
+       fifo_tx[next_tx].addr = 0;
+       fifo_tx[next_tx].len = 0;
+       au_sync();
+
+       res = fifo_tx[next_tx].status;
+
+       next_tx++;
+       if(next_tx>=NO_OF_FIFOS){
+               next_tx=0;
+       }
+       return(res);
+}
+
+static int au1x00_recv(struct eth_device* dev){
+       volatile mac_fifo_t *fifo_rx =
+               (volatile mac_fifo_t*)(MAC0_RX_DMA_ADDR+MAC_RX_BUFF0_STATUS);
+
+       int length;
+       u32 status;
+
+       for(;;){
+               if(!(fifo_rx[next_rx].addr&RX_T_DONE)){
+                       /* Nothing has been received */
+                       return(-1);
+               }
+
+               status = fifo_rx[next_rx].status;
+
+               length = status&0x3FFF;
+
+               if(status&RX_ERROR){
+                       printf("Rx error 0x%x\n", status);
+               }
+               else{
+                       /* Pass the packet up to the protocol layers. */
+                       NetReceive(NetRxPackets[next_rx], length - 4);
+               }
+
+               fifo_rx[next_rx].addr = (virt_to_phys(NetRxPackets[next_rx]))|RX_DMA_ENABLE;
+
+               next_rx++;
+               if(next_rx>=NO_OF_FIFOS){
+                       next_rx=0;
+               }
+       } /* for */
+
+       return(0); /* Does anyone use this? */
+}
+
+static int au1x00_init(struct eth_device* dev, bd_t * bd){
+
+       volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
+       volatile u32 *mac_ctrl = (volatile u32*)(ETH0_BASE+MAC_CONTROL);
+       volatile u32 *mac_addr_high = (volatile u32*)(ETH0_BASE+MAC_ADDRESS_HIGH);
+       volatile u32 *mac_addr_low = (volatile u32*)(ETH0_BASE+MAC_ADDRESS_LOW);
+       volatile u32 *mac_mcast_high = (volatile u32*)(ETH0_BASE+MAC_MCAST_HIGH);
+       volatile u32 *mac_mcast_low = (volatile u32*)(ETH0_BASE+MAC_MCAST_LOW);
+       volatile mac_fifo_t *fifo_tx =
+               (volatile mac_fifo_t*)(MAC0_TX_DMA_ADDR+MAC_TX_BUFF0_STATUS);
+       volatile mac_fifo_t *fifo_rx =
+               (volatile mac_fifo_t*)(MAC0_RX_DMA_ADDR+MAC_RX_BUFF0_STATUS);
+       int i;
+
+       next_tx = TX_GET_DMA_BUFFER(fifo_tx[0].addr);
+       next_rx = RX_GET_DMA_BUFFER(fifo_rx[0].addr);
+
+       /* We have to enable clocks before releasing reset */
+       *macen = MAC_EN_CLOCK_ENABLE;
+       udelay(10);
+
+       /* Enable MAC0 */
+       /* We have to release reset before accessing registers */
+       *macen = MAC_EN_CLOCK_ENABLE|MAC_EN_RESET0|
+               MAC_EN_RESET1|MAC_EN_RESET2;
+       udelay(10);
+
+       for(i=0;i<NO_OF_FIFOS;i++){
+               fifo_tx[i].len = 0;
+               fifo_tx[i].addr = virt_to_phys(&txbuf[0]);
+               fifo_rx[i].addr = (virt_to_phys(NetRxPackets[i]))|RX_DMA_ENABLE;
+       }
+
+       /* Put mac addr in little endian */
+#define ea eth_get_dev()->enetaddr
+       *mac_addr_high  =       (ea[5] <<  8) | (ea[4]      ) ;
+       *mac_addr_low   =       (ea[3] << 24) | (ea[2] << 16) |
+               (ea[1] <<  8) | (ea[0]      ) ;
+#undef ea
+       *mac_mcast_low = 0;
+       *mac_mcast_high = 0;
+
+       /* Make sure the MAC buffer is in the correct endian mode */
+#ifdef __LITTLE_ENDIAN
+       *mac_ctrl = MAC_FULL_DUPLEX;
+       udelay(1);
+       *mac_ctrl = MAC_FULL_DUPLEX|MAC_RX_ENABLE|MAC_TX_ENABLE;
+#else
+       *mac_ctrl = MAC_BIG_ENDIAN|MAC_FULL_DUPLEX;
+       udelay(1);
+       *mac_ctrl = MAC_BIG_ENDIAN|MAC_FULL_DUPLEX|MAC_RX_ENABLE|MAC_TX_ENABLE;
+#endif
+
+       return(1);
+}
+
+static void au1x00_halt(struct eth_device* dev){
+       volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
+
+       /* Put MAC0 in reset */
+       *macen = 0;
+}
+
+int au1x00_enet_initialize(bd_t *bis){
+       struct eth_device* dev;
+
+       if ((dev = (struct eth_device*)malloc(sizeof *dev)) == NULL) {
+               puts ("malloc failed\n");
+               return -1;
+       }
+
+       memset(dev, 0, sizeof *dev);
+
+       sprintf(dev->name, "Au1X00 ethernet");
+       dev->iobase = 0;
+       dev->priv   = 0;
+       dev->init   = au1x00_init;
+       dev->halt   = au1x00_halt;
+       dev->send   = au1x00_send;
+       dev->recv   = au1x00_recv;
+
+       eth_register(dev);
+
+#if defined(CONFIG_CMD_MII)
+       miiphy_register(dev->name,
+               au1x00_miiphy_read, au1x00_miiphy_write);
+#endif
+
+       return 1;
+}
+
+int cpu_eth_init(bd_t *bis)
+{
+       au1x00_enet_initialize(bis);
+       return 0;
+}
diff --git a/arch/mips/mach-au1x00/au1x00_ide.c b/arch/mips/mach-au1x00/au1x00_ide.c
new file mode 100644 (file)
index 0000000..ba0b35d
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * (C) Copyright 2000-2011
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <ide.h>
+
+/* AU1X00 swaps data in big-endian mode, enforce little-endian function */
+void ide_input_swap_data(int dev, ulong *sect_buf, int words)
+{
+       ide_input_data(dev, sect_buf, words);
+}
diff --git a/arch/mips/mach-au1x00/au1x00_serial.c b/arch/mips/mach-au1x00/au1x00_serial.c
new file mode 100644 (file)
index 0000000..0463508
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * AU1X00 UART support
+ *
+ * Hardcoded to UART 0 for now
+ * Speed and options also hardcoded to 115200 8N1
+ *
+ *  Copyright (c) 2003 Thomas.Lange@corelatus.se
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+#include <common.h>
+#include <asm/au1x00.h>
+#include <serial.h>
+#include <linux/compiler.h>
+
+/******************************************************************************
+*
+* serial_init - initialize a channel
+*
+* This routine initializes the number of data bits, parity
+* and set the selected baud rate. Interrupts are disabled.
+* Set the modem control signals if the option is selected.
+*
+* RETURNS: N/A
+*/
+
+static int au1x00_serial_init(void)
+{
+       volatile u32 *uart_fifoctl = (volatile u32*)(UART0_ADDR+UART_FCR);
+       volatile u32 *uart_enable = (volatile u32*)(UART0_ADDR+UART_ENABLE);
+
+       /* Enable clocks first */
+       *uart_enable = UART_EN_CE;
+
+       /* Then release reset */
+       /* Must release reset before setting other regs */
+       *uart_enable = UART_EN_CE|UART_EN_E;
+
+       /* Activate fifos, reset tx and rx */
+       /* Set tx trigger level to 12 */
+       *uart_fifoctl = UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|
+               UART_FCR_CLEAR_XMIT|UART_FCR_T_TRIGGER_12;
+
+       serial_setbrg();
+
+       return 0;
+}
+
+
+static void au1x00_serial_setbrg(void)
+{
+       volatile u32 *uart_clk = (volatile u32*)(UART0_ADDR+UART_CLK);
+       volatile u32 *uart_lcr = (volatile u32*)(UART0_ADDR+UART_LCR);
+       volatile u32 *sys_powerctrl = (u32 *)SYS_POWERCTRL;
+       int sd;
+       int divisorx2;
+
+       /* sd is system clock divisor                   */
+       /* see section 10.4.5 in au1550 datasheet       */
+       sd = (*sys_powerctrl & 0x03) + 2;
+
+       /* calulate 2x baudrate and round */
+       divisorx2 = ((CONFIG_SYS_MIPS_TIMER_FREQ/(sd * 16 * CONFIG_BAUDRATE)));
+
+       if (divisorx2 & 0x01)
+               divisorx2 = divisorx2 + 1;
+
+       *uart_clk = divisorx2 / 2;
+
+       /* Set parity, stop bits and word length to 8N1 */
+       *uart_lcr = UART_LCR_WLEN8;
+}
+
+static void au1x00_serial_putc(const char c)
+{
+       volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
+       volatile u32 *uart_tx = (volatile u32*)(UART0_ADDR+UART_TX);
+
+       if (c == '\n')
+               au1x00_serial_putc('\r');
+
+       /* Wait for fifo to shift out some bytes */
+       while((*uart_lsr&UART_LSR_THRE)==0);
+
+       *uart_tx = (u32)c;
+}
+
+static int au1x00_serial_getc(void)
+{
+       volatile u32 *uart_rx = (volatile u32*)(UART0_ADDR+UART_RX);
+       char c;
+
+       while (!serial_tstc());
+
+       c = (*uart_rx&0xFF);
+       return c;
+}
+
+static int au1x00_serial_tstc(void)
+{
+       volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
+
+       if(*uart_lsr&UART_LSR_DR){
+               /* Data in rfifo */
+               return(1);
+       }
+       return 0;
+}
+
+static struct serial_device au1x00_serial_drv = {
+       .name   = "au1x00_serial",
+       .start  = au1x00_serial_init,
+       .stop   = NULL,
+       .setbrg = au1x00_serial_setbrg,
+       .putc   = au1x00_serial_putc,
+       .puts   = default_serial_puts,
+       .getc   = au1x00_serial_getc,
+       .tstc   = au1x00_serial_tstc,
+};
+
+void au1x00_serial_initialize(void)
+{
+       serial_register(&au1x00_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+       return &au1x00_serial_drv;
+}
diff --git a/arch/mips/mach-au1x00/au1x00_usb_ohci.c b/arch/mips/mach-au1x00/au1x00_usb_ohci.c
new file mode 100644 (file)
index 0000000..74bdb77
--- /dev/null
@@ -0,0 +1,1609 @@
+/*
+ * URB OHCI HCD (Host Controller Driver) for USB on the AU1x00.
+ *
+ * (C) Copyright 2003
+ * Gary Jennejohn, DENX Software Engineering <garyj@denx.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ * Note: Part of this code has been derived from linux
+ *
+ */
+/*
+ * IMPORTANT NOTES
+ * 1 - this driver is intended for use with USB Mass Storage Devices
+ *     (BBB) ONLY. There is NO support for Interrupt or Isochronous pipes!
+ */
+
+#include <config.h>
+
+#ifdef CONFIG_USB_OHCI
+
+/* #include <pci.h> no PCI on the AU1x00 */
+
+#include <common.h>
+#include <malloc.h>
+#include <asm/io.h>
+#include <asm/au1x00.h>
+#include <usb.h>
+#include "au1x00_usb_ohci.h"
+
+#define OHCI_USE_NPS           /* force NoPowerSwitching mode */
+#define OHCI_VERBOSE_DEBUG     /* not always helpful */
+#define OHCI_FILL_TRACE
+
+#define USBH_ENABLE_BE (1<<0)
+#define USBH_ENABLE_C  (1<<1)
+#define USBH_ENABLE_E  (1<<2)
+#define USBH_ENABLE_CE (1<<3)
+#define USBH_ENABLE_RD (1<<4)
+
+#ifdef __LITTLE_ENDIAN
+#define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C)
+#else
+#define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C | USBH_ENABLE_BE)
+#endif
+
+
+/* For initializing controller (mask in an HCFS mode too) */
+#define OHCI_CONTROL_INIT \
+       (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
+
+#undef readl
+#undef writel
+
+#define readl(a)     au_readl((long)(a))
+#define writel(v,a)  au_writel((v),(int)(a))
+
+#define DEBUG
+#ifdef DEBUG
+#define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
+#else
+#define dbg(format, arg...) do {} while(0)
+#endif /* DEBUG */
+#define err(format, arg...) printf("ERROR: " format "\n", ## arg)
+#define SHOW_INFO
+#ifdef SHOW_INFO
+#define info(format, arg...) printf("INFO: " format "\n", ## arg)
+#else
+#define info(format, arg...) do {} while(0)
+#endif
+
+#define m16_swap(x) swap_16(x)
+#define m32_swap(x) swap_32(x)
+
+/* global ohci_t */
+static ohci_t gohci;
+/* this must be aligned to a 256 byte boundary */
+struct ohci_hcca ghcca[1];
+/* a pointer to the aligned storage */
+struct ohci_hcca *phcca;
+/* this allocates EDs for all possible endpoints */
+struct ohci_device ohci_dev;
+/* urb_priv */
+urb_priv_t urb_priv;
+/* RHSC flag */
+int got_rhsc;
+/* device which was disconnected */
+struct usb_device *devgone;
+
+/*-------------------------------------------------------------------------*/
+
+/* AMD-756 (D2 rev) reports corrupt register contents in some cases.
+ * The erratum (#4) description is incorrect.  AMD's workaround waits
+ * till some bits (mostly reserved) are clear; ok for all revs.
+ */
+#define OHCI_QUIRK_AMD756 0xabcd
+#define read_roothub(hc, register, mask) ({ \
+       u32 temp = readl (&hc->regs->roothub.register); \
+       if (hc->flags & OHCI_QUIRK_AMD756) \
+               while (temp & mask) \
+                       temp = readl (&hc->regs->roothub.register); \
+       temp; })
+
+static u32 roothub_a (struct ohci *hc)
+       { return read_roothub (hc, a, 0xfc0fe000); }
+static inline u32 roothub_b (struct ohci *hc)
+       { return readl (&hc->regs->roothub.b); }
+static inline u32 roothub_status (struct ohci *hc)
+       { return readl (&hc->regs->roothub.status); }
+static u32 roothub_portstatus (struct ohci *hc, int i)
+       { return read_roothub (hc, portstatus [i], 0xffe0fce0); }
+
+
+/* forward declaration */
+static int hc_interrupt (void);
+static void
+td_submit_job (struct usb_device * dev, unsigned long pipe, void * buffer,
+       int transfer_len, struct devrequest * setup, urb_priv_t * urb, int interval);
+
+/*-------------------------------------------------------------------------*
+ * URB support functions
+ *-------------------------------------------------------------------------*/
+
+/* free HCD-private data associated with this URB */
+
+static void urb_free_priv (urb_priv_t * urb)
+{
+       int             i;
+       int             last;
+       struct td       * td;
+
+       last = urb->length - 1;
+       if (last >= 0) {
+               for (i = 0; i <= last; i++) {
+                       td = urb->td[i];
+                       if (td) {
+                               td->usb_dev = NULL;
+                               urb->td[i] = NULL;
+                       }
+               }
+       }
+}
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef DEBUG
+static int sohci_get_current_frame_number (struct usb_device * dev);
+
+/* debug| print the main components of an URB
+ * small: 0) header + data packets 1) just header */
+
+static void pkt_print (struct usb_device * dev, unsigned long pipe, void * buffer,
+       int transfer_len, struct devrequest * setup, char * str, int small)
+{
+       urb_priv_t * purb = &urb_priv;
+
+       dbg("%s URB:[%4x] dev:%2d,ep:%2d-%c,type:%s,len:%d/%d stat:%#lx",
+                       str,
+                       sohci_get_current_frame_number (dev),
+                       usb_pipedevice (pipe),
+                       usb_pipeendpoint (pipe),
+                       usb_pipeout (pipe)? 'O': 'I',
+                       usb_pipetype (pipe) < 2? (usb_pipeint (pipe)? "INTR": "ISOC"):
+                               (usb_pipecontrol (pipe)? "CTRL": "BULK"),
+                       purb->actual_length,
+                       transfer_len, dev->status);
+#ifdef OHCI_VERBOSE_DEBUG
+       if (!small) {
+               int i, len;
+
+               if (usb_pipecontrol (pipe)) {
+                       printf (__FILE__ ": cmd(8):");
+                       for (i = 0; i < 8 ; i++)
+                               printf (" %02x", ((__u8 *) setup) [i]);
+                       printf ("\n");
+               }
+               if (transfer_len > 0 && buffer) {
+                       printf (__FILE__ ": data(%d/%d):",
+                               purb->actual_length,
+                               transfer_len);
+                       len = usb_pipeout (pipe)?
+                                       transfer_len: purb->actual_length;
+                       for (i = 0; i < 16 && i < len; i++)
+                               printf (" %02x", ((__u8 *) buffer) [i]);
+                       printf ("%s\n", i < len? "...": "");
+               }
+       }
+#endif
+}
+
+/* just for debugging; prints non-empty branches of the int ed tree inclusive iso eds*/
+void ep_print_int_eds (ohci_t *ohci, char * str) {
+       int i, j;
+        __u32 * ed_p;
+       for (i= 0; i < 32; i++) {
+               j = 5;
+               ed_p = &(ohci->hcca->int_table [i]);
+               if (*ed_p == 0)
+                   continue;
+               printf (__FILE__ ": %s branch int %2d(%2x):", str, i, i);
+               while (*ed_p != 0 && j--) {
+                       ed_t *ed = (ed_t *)m32_swap(ed_p);
+                       printf (" ed: %4x;", ed->hwINFO);
+                       ed_p = &ed->hwNextED;
+               }
+               printf ("\n");
+       }
+}
+
+static void ohci_dump_intr_mask (char *label, __u32 mask)
+{
+       dbg ("%s: 0x%08x%s%s%s%s%s%s%s%s%s",
+               label,
+               mask,
+               (mask & OHCI_INTR_MIE) ? " MIE" : "",
+               (mask & OHCI_INTR_OC) ? " OC" : "",
+               (mask & OHCI_INTR_RHSC) ? " RHSC" : "",
+               (mask & OHCI_INTR_FNO) ? " FNO" : "",
+               (mask & OHCI_INTR_UE) ? " UE" : "",
+               (mask & OHCI_INTR_RD) ? " RD" : "",
+               (mask & OHCI_INTR_SF) ? " SF" : "",
+               (mask & OHCI_INTR_WDH) ? " WDH" : "",
+               (mask & OHCI_INTR_SO) ? " SO" : ""
+               );
+}
+
+static void maybe_print_eds (char *label, __u32 value)
+{
+       ed_t *edp = (ed_t *)value;
+
+       if (value) {
+               dbg ("%s %08x", label, value);
+               dbg ("%08x", edp->hwINFO);
+               dbg ("%08x", edp->hwTailP);
+               dbg ("%08x", edp->hwHeadP);
+               dbg ("%08x", edp->hwNextED);
+       }
+}
+
+static char * hcfs2string (int state)
+{
+       switch (state) {
+               case OHCI_USB_RESET:    return "reset";
+               case OHCI_USB_RESUME:   return "resume";
+               case OHCI_USB_OPER:     return "operational";
+               case OHCI_USB_SUSPEND:  return "suspend";
+       }
+       return "?";
+}
+
+/* dump control and status registers */
+static void ohci_dump_status (ohci_t *controller)
+{
+       struct ohci_regs        *regs = controller->regs;
+       __u32                   temp;
+
+       temp = readl (&regs->revision) & 0xff;
+       if (temp != 0x10)
+               dbg ("spec %d.%d", (temp >> 4), (temp & 0x0f));
+
+       temp = readl (&regs->control);
+       dbg ("control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d", temp,
+               (temp & OHCI_CTRL_RWE) ? " RWE" : "",
+               (temp & OHCI_CTRL_RWC) ? " RWC" : "",
+               (temp & OHCI_CTRL_IR) ? " IR" : "",
+               hcfs2string (temp & OHCI_CTRL_HCFS),
+               (temp & OHCI_CTRL_BLE) ? " BLE" : "",
+               (temp & OHCI_CTRL_CLE) ? " CLE" : "",
+               (temp & OHCI_CTRL_IE) ? " IE" : "",
+               (temp & OHCI_CTRL_PLE) ? " PLE" : "",
+               temp & OHCI_CTRL_CBSR
+               );
+
+       temp = readl (&regs->cmdstatus);
+       dbg ("cmdstatus: 0x%08x SOC=%d%s%s%s%s", temp,
+               (temp & OHCI_SOC) >> 16,
+               (temp & OHCI_OCR) ? " OCR" : "",
+               (temp & OHCI_BLF) ? " BLF" : "",
+               (temp & OHCI_CLF) ? " CLF" : "",
+               (temp & OHCI_HCR) ? " HCR" : ""
+               );
+
+       ohci_dump_intr_mask ("intrstatus", readl (&regs->intrstatus));
+       ohci_dump_intr_mask ("intrenable", readl (&regs->intrenable));
+
+       maybe_print_eds ("ed_periodcurrent", readl (&regs->ed_periodcurrent));
+
+       maybe_print_eds ("ed_controlhead", readl (&regs->ed_controlhead));
+       maybe_print_eds ("ed_controlcurrent", readl (&regs->ed_controlcurrent));
+
+       maybe_print_eds ("ed_bulkhead", readl (&regs->ed_bulkhead));
+       maybe_print_eds ("ed_bulkcurrent", readl (&regs->ed_bulkcurrent));
+
+       maybe_print_eds ("donehead", readl (&regs->donehead));
+}
+
+static void ohci_dump_roothub (ohci_t *controller, int verbose)
+{
+       __u32                   temp, ndp, i;
+
+       temp = roothub_a (controller);
+       ndp = (temp & RH_A_NDP);
+
+       if (verbose) {
+               dbg ("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d", temp,
+                       ((temp & RH_A_POTPGT) >> 24) & 0xff,
+                       (temp & RH_A_NOCP) ? " NOCP" : "",
+                       (temp & RH_A_OCPM) ? " OCPM" : "",
+                       (temp & RH_A_DT) ? " DT" : "",
+                       (temp & RH_A_NPS) ? " NPS" : "",
+                       (temp & RH_A_PSM) ? " PSM" : "",
+                       ndp
+                       );
+               temp = roothub_b (controller);
+               dbg ("roothub.b: %08x PPCM=%04x DR=%04x",
+                       temp,
+                       (temp & RH_B_PPCM) >> 16,
+                       (temp & RH_B_DR)
+                       );
+               temp = roothub_status (controller);
+               dbg ("roothub.status: %08x%s%s%s%s%s%s",
+                       temp,
+                       (temp & RH_HS_CRWE) ? " CRWE" : "",
+                       (temp & RH_HS_OCIC) ? " OCIC" : "",
+                       (temp & RH_HS_LPSC) ? " LPSC" : "",
+                       (temp & RH_HS_DRWE) ? " DRWE" : "",
+                       (temp & RH_HS_OCI) ? " OCI" : "",
+                       (temp & RH_HS_LPS) ? " LPS" : ""
+                       );
+       }
+
+       for (i = 0; i < ndp; i++) {
+               temp = roothub_portstatus (controller, i);
+               dbg ("roothub.portstatus [%d] = 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s",
+                       i,
+                       temp,
+                       (temp & RH_PS_PRSC) ? " PRSC" : "",
+                       (temp & RH_PS_OCIC) ? " OCIC" : "",
+                       (temp & RH_PS_PSSC) ? " PSSC" : "",
+                       (temp & RH_PS_PESC) ? " PESC" : "",
+                       (temp & RH_PS_CSC) ? " CSC" : "",
+
+                       (temp & RH_PS_LSDA) ? " LSDA" : "",
+                       (temp & RH_PS_PPS) ? " PPS" : "",
+                       (temp & RH_PS_PRS) ? " PRS" : "",
+                       (temp & RH_PS_POCI) ? " POCI" : "",
+                       (temp & RH_PS_PSS) ? " PSS" : "",
+
+                       (temp & RH_PS_PES) ? " PES" : "",
+                       (temp & RH_PS_CCS) ? " CCS" : ""
+                       );
+       }
+}
+
+static void ohci_dump (ohci_t *controller, int verbose)
+{
+       dbg ("OHCI controller usb-%s state", controller->slot_name);
+
+       /* dumps some of the state we know about */
+       ohci_dump_status (controller);
+       if (verbose)
+               ep_print_int_eds (controller, "hcca");
+       dbg ("hcca frame #%04x", controller->hcca->frame_no);
+       ohci_dump_roothub (controller, 1);
+}
+
+
+#endif /* DEBUG */
+
+/*-------------------------------------------------------------------------*
+ * Interface functions (URB)
+ *-------------------------------------------------------------------------*/
+
+/* get a transfer request */
+
+int sohci_submit_job(struct usb_device *dev, unsigned long pipe, void *buffer,
+               int transfer_len, struct devrequest *setup, int interval)
+{
+       ohci_t *ohci;
+       ed_t * ed;
+       urb_priv_t *purb_priv;
+       int i, size = 0;
+
+       ohci = &gohci;
+
+       /* when controller's hung, permit only roothub cleanup attempts
+        * such as powering down ports */
+       if (ohci->disabled) {
+               err("sohci_submit_job: EPIPE");
+               return -1;
+       }
+
+       /* every endpoint has a ed, locate and fill it */
+       if (!(ed = ep_add_ed (dev, pipe))) {
+               err("sohci_submit_job: ENOMEM");
+               return -1;
+       }
+
+       /* for the private part of the URB we need the number of TDs (size) */
+       switch (usb_pipetype (pipe)) {
+               case PIPE_BULK: /* one TD for every 4096 Byte */
+                       size = (transfer_len - 1) / 4096 + 1;
+                       break;
+               case PIPE_CONTROL: /* 1 TD for setup, 1 for ACK and 1 for every 4096 B */
+                       size = (transfer_len == 0)? 2:
+                                               (transfer_len - 1) / 4096 + 3;
+                       break;
+       }
+
+       if (size >= (N_URB_TD - 1)) {
+               err("need %d TDs, only have %d", size, N_URB_TD);
+               return -1;
+       }
+       purb_priv = &urb_priv;
+       purb_priv->pipe = pipe;
+
+       /* fill the private part of the URB */
+       purb_priv->length = size;
+       purb_priv->ed = ed;
+       purb_priv->actual_length = 0;
+
+       /* allocate the TDs */
+       /* note that td[0] was allocated in ep_add_ed */
+       for (i = 0; i < size; i++) {
+               purb_priv->td[i] = td_alloc (dev);
+               if (!purb_priv->td[i]) {
+                       purb_priv->length = i;
+                       urb_free_priv (purb_priv);
+                       err("sohci_submit_job: ENOMEM");
+                       return -1;
+               }
+       }
+
+       if (ed->state == ED_NEW || (ed->state & ED_DEL)) {
+               urb_free_priv (purb_priv);
+               err("sohci_submit_job: EINVAL");
+               return -1;
+       }
+
+       /* link the ed into a chain if is not already */
+       if (ed->state != ED_OPER)
+               ep_link (ohci, ed);
+
+       /* fill the TDs and link it to the ed */
+       td_submit_job(dev, pipe, buffer, transfer_len, setup, purb_priv, interval);
+
+       return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+#ifdef DEBUG
+/* tell us the current USB frame number */
+
+static int sohci_get_current_frame_number (struct usb_device *usb_dev)
+{
+       ohci_t *ohci = &gohci;
+
+       return m16_swap (ohci->hcca->frame_no);
+}
+#endif
+
+/*-------------------------------------------------------------------------*
+ * ED handling functions
+ *-------------------------------------------------------------------------*/
+
+/* link an ed into one of the HC chains */
+
+static int ep_link (ohci_t *ohci, ed_t *edi)
+{
+       volatile ed_t *ed = edi;
+
+       ed->state = ED_OPER;
+
+       switch (ed->type) {
+       case PIPE_CONTROL:
+               ed->hwNextED = 0;
+               if (ohci->ed_controltail == NULL) {
+                       writel ((long)ed, &ohci->regs->ed_controlhead);
+               } else {
+                       ohci->ed_controltail->hwNextED = m32_swap (ed);
+               }
+               ed->ed_prev = ohci->ed_controltail;
+               if (!ohci->ed_controltail && !ohci->ed_rm_list[0] &&
+                       !ohci->ed_rm_list[1] && !ohci->sleeping) {
+                       ohci->hc_control |= OHCI_CTRL_CLE;
+                       writel (ohci->hc_control, &ohci->regs->control);
+               }
+               ohci->ed_controltail = edi;
+               break;
+
+       case PIPE_BULK:
+               ed->hwNextED = 0;
+               if (ohci->ed_bulktail == NULL) {
+                       writel ((long)ed, &ohci->regs->ed_bulkhead);
+               } else {
+                       ohci->ed_bulktail->hwNextED = m32_swap (ed);
+               }
+               ed->ed_prev = ohci->ed_bulktail;
+               if (!ohci->ed_bulktail && !ohci->ed_rm_list[0] &&
+                       !ohci->ed_rm_list[1] && !ohci->sleeping) {
+                       ohci->hc_control |= OHCI_CTRL_BLE;
+                       writel (ohci->hc_control, &ohci->regs->control);
+               }
+               ohci->ed_bulktail = edi;
+               break;
+       }
+       return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* unlink an ed from one of the HC chains.
+ * just the link to the ed is unlinked.
+ * the link from the ed still points to another operational ed or 0
+ * so the HC can eventually finish the processing of the unlinked ed */
+
+static int ep_unlink (ohci_t *ohci, ed_t *ed)
+{
+       ed->hwINFO |= m32_swap (OHCI_ED_SKIP);
+
+       switch (ed->type) {
+       case PIPE_CONTROL:
+               if (ed->ed_prev == NULL) {
+                       if (!ed->hwNextED) {
+                               ohci->hc_control &= ~OHCI_CTRL_CLE;
+                               writel (ohci->hc_control, &ohci->regs->control);
+                       }
+                       writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_controlhead);
+               } else {
+                       ed->ed_prev->hwNextED = ed->hwNextED;
+               }
+               if (ohci->ed_controltail == ed) {
+                       ohci->ed_controltail = ed->ed_prev;
+               } else {
+                       ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
+               }
+               break;
+
+       case PIPE_BULK:
+               if (ed->ed_prev == NULL) {
+                       if (!ed->hwNextED) {
+                               ohci->hc_control &= ~OHCI_CTRL_BLE;
+                               writel (ohci->hc_control, &ohci->regs->control);
+                       }
+                       writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_bulkhead);
+               } else {
+                       ed->ed_prev->hwNextED = ed->hwNextED;
+               }
+               if (ohci->ed_bulktail == ed) {
+                       ohci->ed_bulktail = ed->ed_prev;
+               } else {
+                       ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
+               }
+               break;
+       }
+       ed->state = ED_UNLINK;
+       return 0;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+/* add/reinit an endpoint; this should be done once at the usb_set_configuration command,
+ * but the USB stack is a little bit stateless so we do it at every transaction
+ * if the state of the ed is ED_NEW then a dummy td is added and the state is changed to ED_UNLINK
+ * in all other cases the state is left unchanged
+ * the ed info fields are setted anyway even though most of them should not change */
+
+static ed_t * ep_add_ed (struct usb_device *usb_dev, unsigned long pipe)
+{
+       td_t *td;
+       ed_t *ed_ret;
+       volatile ed_t *ed;
+
+       ed = ed_ret = &ohci_dev.ed[(usb_pipeendpoint (pipe) << 1) |
+                       (usb_pipecontrol (pipe)? 0: usb_pipeout (pipe))];
+
+       if ((ed->state & ED_DEL) || (ed->state & ED_URB_DEL)) {
+               err("ep_add_ed: pending delete");
+               /* pending delete request */
+               return NULL;
+       }
+
+       if (ed->state == ED_NEW) {
+               ed->hwINFO = m32_swap (OHCI_ED_SKIP); /* skip ed */
+               /* dummy td; end of td list for ed */
+               td = td_alloc (usb_dev);
+               ed->hwTailP = m32_swap (td);
+               ed->hwHeadP = ed->hwTailP;
+               ed->state = ED_UNLINK;
+               ed->type = usb_pipetype (pipe);
+               ohci_dev.ed_cnt++;
+       }
+
+       ed->hwINFO = m32_swap (usb_pipedevice (pipe)
+                       | usb_pipeendpoint (pipe) << 7
+                       | (usb_pipeisoc (pipe)? 0x8000: 0)
+                       | (usb_pipecontrol (pipe)? 0: (usb_pipeout (pipe)? 0x800: 0x1000))
+                       | (usb_dev->speed == USB_SPEED_LOW) << 13
+                       | usb_maxpacket (usb_dev, pipe) << 16);
+
+       return ed_ret;
+}
+
+/*-------------------------------------------------------------------------*
+ * TD handling functions
+ *-------------------------------------------------------------------------*/
+
+/* enqueue next TD for this URB (OHCI spec 5.2.8.2) */
+
+static void td_fill (ohci_t *ohci, unsigned int info,
+       void *data, int len,
+       struct usb_device *dev, int index, urb_priv_t *urb_priv)
+{
+       volatile td_t  *td, *td_pt;
+#ifdef OHCI_FILL_TRACE
+       int i;
+#endif
+
+       if (index > urb_priv->length) {
+               err("index > length");
+               return;
+       }
+       /* use this td as the next dummy */
+       td_pt = urb_priv->td [index];
+       td_pt->hwNextTD = 0;
+
+       /* fill the old dummy TD */
+       td = urb_priv->td [index] = (td_t *)(m32_swap (urb_priv->ed->hwTailP) & ~0xf);
+
+       td->ed = urb_priv->ed;
+       td->next_dl_td = NULL;
+       td->index = index;
+       td->data = (__u32)data;
+#ifdef OHCI_FILL_TRACE
+       if (1 || (usb_pipebulk(urb_priv->pipe) &&
+                               usb_pipeout(urb_priv->pipe))) {
+               for (i = 0; i < len; i++)
+               printf("td->data[%d] %#2x\n",i, ((unsigned char *)(td->data+0x80000000))[i]);
+       }
+#endif
+       if (!len)
+               data = 0;
+
+       td->hwINFO = m32_swap (info);
+       td->hwCBP = m32_swap (data);
+       if (data)
+               td->hwBE = m32_swap (data + len - 1);
+       else
+               td->hwBE = 0;
+       td->hwNextTD = m32_swap (td_pt);
+       td->hwPSW [0] = m16_swap (((__u32)data & 0x0FFF) | 0xE000);
+
+       /* append to queue */
+       td->ed->hwTailP = td->hwNextTD;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* prepare all TDs of a transfer */
+
+#define kseg_to_phys(x)          ((void *)((__u32)(x) - 0x80000000))
+
+static void td_submit_job (struct usb_device *dev, unsigned long pipe, void *buffer,
+       int transfer_len, struct devrequest *setup, urb_priv_t *urb, int interval)
+{
+       ohci_t *ohci = &gohci;
+       int data_len = transfer_len;
+       void *data;
+       int cnt = 0;
+       __u32 info = 0;
+       unsigned int toggle = 0;
+
+       /* OHCI handles the DATA-toggles itself, we just use the USB-toggle bits for reseting */
+       if(usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe))) {
+               toggle = TD_T_TOGGLE;
+       } else {
+               toggle = TD_T_DATA0;
+               usb_settoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe), 1);
+       }
+       urb->td_cnt = 0;
+       if (data_len)
+               data = kseg_to_phys(buffer);
+       else
+               data = 0;
+
+       switch (usb_pipetype (pipe)) {
+       case PIPE_BULK:
+               info = usb_pipeout (pipe)?
+                       TD_CC | TD_DP_OUT : TD_CC | TD_DP_IN ;
+               while(data_len > 4096) {
+                       td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, 4096, dev, cnt, urb);
+                       data += 4096; data_len -= 4096; cnt++;
+               }
+               info = usb_pipeout (pipe)?
+                       TD_CC | TD_DP_OUT : TD_CC | TD_R | TD_DP_IN ;
+               td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, data_len, dev, cnt, urb);
+               cnt++;
+
+               if (!ohci->sleeping)
+                       writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */
+               break;
+
+       case PIPE_CONTROL:
+               info = TD_CC | TD_DP_SETUP | TD_T_DATA0;
+               td_fill (ohci, info, kseg_to_phys(setup), 8, dev, cnt++, urb);
+               if (data_len > 0) {
+                       info = usb_pipeout (pipe)?
+                               TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 : TD_CC | TD_R | TD_DP_IN | TD_T_DATA1;
+                       /* NOTE:  mishandles transfers >8K, some >4K */
+                       td_fill (ohci, info, data, data_len, dev, cnt++, urb);
+               }
+               info = usb_pipeout (pipe)?
+                       TD_CC | TD_DP_IN | TD_T_DATA1: TD_CC | TD_DP_OUT | TD_T_DATA1;
+               td_fill (ohci, info, data, 0, dev, cnt++, urb);
+               if (!ohci->sleeping)
+                       writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */
+               break;
+       }
+       if (urb->length != cnt)
+               dbg("TD LENGTH %d != CNT %d", urb->length, cnt);
+}
+
+/*-------------------------------------------------------------------------*
+ * Done List handling functions
+ *-------------------------------------------------------------------------*/
+
+
+/* calculate the transfer length and update the urb */
+
+static void dl_transfer_length(td_t * td)
+{
+       __u32 tdINFO, tdBE, tdCBP;
+       urb_priv_t *lurb_priv = &urb_priv;
+
+       tdINFO = m32_swap (td->hwINFO);
+       tdBE   = m32_swap (td->hwBE);
+       tdCBP  = m32_swap (td->hwCBP);
+
+
+       if (!(usb_pipecontrol(lurb_priv->pipe) &&
+           ((td->index == 0) || (td->index == lurb_priv->length - 1)))) {
+               if (tdBE != 0) {
+                       if (td->hwCBP == 0)
+                               lurb_priv->actual_length += tdBE - td->data + 1;
+                       else
+                               lurb_priv->actual_length += tdCBP - td->data;
+               }
+       }
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* replies to the request have to be on a FIFO basis so
+ * we reverse the reversed done-list */
+
+static td_t * dl_reverse_done_list (ohci_t *ohci)
+{
+       __u32 td_list_hc;
+       td_t *td_rev = NULL;
+       td_t *td_list = NULL;
+       urb_priv_t *lurb_priv = NULL;
+
+       td_list_hc = m32_swap (ohci->hcca->done_head) & 0xfffffff0;
+       ohci->hcca->done_head = 0;
+
+       while (td_list_hc) {
+               td_list = (td_t *)td_list_hc;
+
+               if (TD_CC_GET (m32_swap (td_list->hwINFO))) {
+                       lurb_priv = &urb_priv;
+                       dbg(" USB-error/status: %x : %p",
+                                       TD_CC_GET (m32_swap (td_list->hwINFO)), td_list);
+                       if (td_list->ed->hwHeadP & m32_swap (0x1)) {
+                               if (lurb_priv && ((td_list->index + 1) < lurb_priv->length)) {
+                                       td_list->ed->hwHeadP =
+                                               (lurb_priv->td[lurb_priv->length - 1]->hwNextTD & m32_swap (0xfffffff0)) |
+                                                                       (td_list->ed->hwHeadP & m32_swap (0x2));
+                                       lurb_priv->td_cnt += lurb_priv->length - td_list->index - 1;
+                               } else
+                                       td_list->ed->hwHeadP &= m32_swap (0xfffffff2);
+                       }
+               }
+
+               td_list->next_dl_td = td_rev;
+               td_rev = td_list;
+               td_list_hc = m32_swap (td_list->hwNextTD) & 0xfffffff0;
+       }
+       return td_list;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* td done list */
+static int dl_done_list (ohci_t *ohci, td_t *td_list)
+{
+       td_t *td_list_next = NULL;
+       ed_t *ed;
+       int cc = 0;
+       int stat = 0;
+       /* urb_t *urb; */
+       urb_priv_t *lurb_priv;
+       __u32 tdINFO, edHeadP, edTailP;
+
+       while (td_list) {
+               td_list_next = td_list->next_dl_td;
+
+               lurb_priv = &urb_priv;
+               tdINFO = m32_swap (td_list->hwINFO);
+
+               ed = td_list->ed;
+
+               dl_transfer_length(td_list);
+
+               /* error code of transfer */
+               cc = TD_CC_GET (tdINFO);
+               if (cc != 0) {
+                       dbg("ConditionCode %#x", cc);
+                       stat = cc_to_error[cc];
+               }
+
+               if (ed->state != ED_NEW) {
+                       edHeadP = m32_swap (ed->hwHeadP) & 0xfffffff0;
+                       edTailP = m32_swap (ed->hwTailP);
+
+                       /* unlink eds if they are not busy */
+                       if ((edHeadP == edTailP) && (ed->state == ED_OPER))
+                               ep_unlink (ohci, ed);
+               }
+
+               td_list = td_list_next;
+       }
+       return stat;
+}
+
+/*-------------------------------------------------------------------------*
+ * Virtual Root Hub
+ *-------------------------------------------------------------------------*/
+
+#include <usbroothubdes.h>
+
+/* Hub class-specific descriptor is constructed dynamically */
+
+
+/*-------------------------------------------------------------------------*/
+
+#define OK(x)                  len = (x); break
+#ifdef DEBUG
+#define WR_RH_STAT(x)          {info("WR:status %#8x", (x));writel((x), &gohci.regs->roothub.status);}
+#define WR_RH_PORTSTAT(x)      {info("WR:portstatus[%d] %#8x", wIndex-1, (x));writel((x), &gohci.regs->roothub.portstatus[wIndex-1]);}
+#else
+#define WR_RH_STAT(x)          writel((x), &gohci.regs->roothub.status)
+#define WR_RH_PORTSTAT(x)      writel((x), &gohci.regs->roothub.portstatus[wIndex-1])
+#endif
+#define RD_RH_STAT             roothub_status(&gohci)
+#define RD_RH_PORTSTAT         roothub_portstatus(&gohci,wIndex-1)
+
+/* request to virtual root hub */
+
+int rh_check_port_status(ohci_t *controller)
+{
+       __u32 temp, ndp, i;
+       int res;
+
+       res = -1;
+       temp = roothub_a (controller);
+       ndp = (temp & RH_A_NDP);
+       for (i = 0; i < ndp; i++) {
+               temp = roothub_portstatus (controller, i);
+               /* check for a device disconnect */
+               if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
+                       (RH_PS_PESC | RH_PS_CSC)) &&
+                       ((temp & RH_PS_CCS) == 0)) {
+                       res = i;
+                       break;
+               }
+       }
+       return res;
+}
+
+static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
+               void *buffer, int transfer_len, struct devrequest *cmd)
+{
+       void * data = buffer;
+       int leni = transfer_len;
+       int len = 0;
+       int stat = 0;
+       __u32 datab[4];
+       __u8 *data_buf = (__u8 *)datab;
+       __u16 bmRType_bReq;
+       __u16 wValue;
+       __u16 wIndex;
+       __u16 wLength;
+
+#ifdef DEBUG
+urb_priv.actual_length = 0;
+pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
+#else
+       mdelay(1);
+#endif
+       if (usb_pipeint(pipe)) {
+               info("Root-Hub submit IRQ: NOT implemented");
+               return 0;
+       }
+
+       bmRType_bReq  = cmd->requesttype | (cmd->request << 8);
+       wValue        = m16_swap (cmd->value);
+       wIndex        = m16_swap (cmd->index);
+       wLength       = m16_swap (cmd->length);
+
+       info("Root-Hub: adr: %2x cmd(%1x): %08x %04x %04x %04x",
+               dev->devnum, 8, bmRType_bReq, wValue, wIndex, wLength);
+
+       switch (bmRType_bReq) {
+       /* Request Destination:
+          without flags: Device,
+          RH_INTERFACE: interface,
+          RH_ENDPOINT: endpoint,
+          RH_CLASS means HUB here,
+          RH_OTHER | RH_CLASS  almost ever means HUB_PORT here
+       */
+
+       case RH_GET_STATUS:
+                       *(__u16 *) data_buf = m16_swap (1); OK (2);
+       case RH_GET_STATUS | RH_INTERFACE:
+                       *(__u16 *) data_buf = m16_swap (0); OK (2);
+       case RH_GET_STATUS | RH_ENDPOINT:
+                       *(__u16 *) data_buf = m16_swap (0); OK (2);
+       case RH_GET_STATUS | RH_CLASS:
+                       *(__u32 *) data_buf = m32_swap (
+                               RD_RH_STAT & ~(RH_HS_CRWE | RH_HS_DRWE));
+                       OK (4);
+       case RH_GET_STATUS | RH_OTHER | RH_CLASS:
+                       *(__u32 *) data_buf = m32_swap (RD_RH_PORTSTAT); OK (4);
+
+       case RH_CLEAR_FEATURE | RH_ENDPOINT:
+               switch (wValue) {
+                       case (RH_ENDPOINT_STALL): OK (0);
+               }
+               break;
+
+       case RH_CLEAR_FEATURE | RH_CLASS:
+               switch (wValue) {
+                       case RH_C_HUB_LOCAL_POWER:
+                               OK(0);
+                       case (RH_C_HUB_OVER_CURRENT):
+                                       WR_RH_STAT(RH_HS_OCIC); OK (0);
+               }
+               break;
+
+       case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
+               switch (wValue) {
+                       case (RH_PORT_ENABLE):
+                                       WR_RH_PORTSTAT (RH_PS_CCS ); OK (0);
+                       case (RH_PORT_SUSPEND):
+                                       WR_RH_PORTSTAT (RH_PS_POCI); OK (0);
+                       case (RH_PORT_POWER):
+                                       WR_RH_PORTSTAT (RH_PS_LSDA); OK (0);
+                       case (RH_C_PORT_CONNECTION):
+                                       WR_RH_PORTSTAT (RH_PS_CSC ); OK (0);
+                       case (RH_C_PORT_ENABLE):
+                                       WR_RH_PORTSTAT (RH_PS_PESC); OK (0);
+                       case (RH_C_PORT_SUSPEND):
+                                       WR_RH_PORTSTAT (RH_PS_PSSC); OK (0);
+                       case (RH_C_PORT_OVER_CURRENT):
+                                       WR_RH_PORTSTAT (RH_PS_OCIC); OK (0);
+                       case (RH_C_PORT_RESET):
+                                       WR_RH_PORTSTAT (RH_PS_PRSC); OK (0);
+               }
+               break;
+
+       case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
+               switch (wValue) {
+                       case (RH_PORT_SUSPEND):
+                                       WR_RH_PORTSTAT (RH_PS_PSS ); OK (0);
+                       case (RH_PORT_RESET): /* BUG IN HUP CODE *********/
+                                       if (RD_RH_PORTSTAT & RH_PS_CCS)
+                                           WR_RH_PORTSTAT (RH_PS_PRS);
+                                       OK (0);
+                       case (RH_PORT_POWER):
+                                       WR_RH_PORTSTAT (RH_PS_PPS ); OK (0);
+                       case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
+                                       if (RD_RH_PORTSTAT & RH_PS_CCS)
+                                           WR_RH_PORTSTAT (RH_PS_PES );
+                                       OK (0);
+               }
+               break;
+
+       case RH_SET_ADDRESS: gohci.rh.devnum = wValue; OK(0);
+
+       case RH_GET_DESCRIPTOR:
+               switch ((wValue & 0xff00) >> 8) {
+                       case (0x01): /* device descriptor */
+                               len = min_t(unsigned int,
+                                         leni,
+                                         min_t(unsigned int,
+                                             sizeof (root_hub_dev_des),
+                                             wLength));
+                               data_buf = root_hub_dev_des; OK(len);
+                       case (0x02): /* configuration descriptor */
+                               len = min_t(unsigned int,
+                                         leni,
+                                         min_t(unsigned int,
+                                             sizeof (root_hub_config_des),
+                                             wLength));
+                               data_buf = root_hub_config_des; OK(len);
+                       case (0x03): /* string descriptors */
+                               if(wValue==0x0300) {
+                                       len = min_t(unsigned int,
+                                                 leni,
+                                                 min_t(unsigned int,
+                                                     sizeof (root_hub_str_index0),
+                                                     wLength));
+                                       data_buf = root_hub_str_index0;
+                                       OK(len);
+                               }
+                               if(wValue==0x0301) {
+                                       len = min_t(unsigned int,
+                                                 leni,
+                                                 min_t(unsigned int,
+                                                     sizeof (root_hub_str_index1),
+                                                     wLength));
+                                       data_buf = root_hub_str_index1;
+                                       OK(len);
+                       }
+                       default:
+                               stat = USB_ST_STALLED;
+               }
+               break;
+
+       case RH_GET_DESCRIPTOR | RH_CLASS:
+           {
+                   __u32 temp = roothub_a (&gohci);
+
+                   data_buf [0] = 9;           /* min length; */
+                   data_buf [1] = 0x29;
+                   data_buf [2] = temp & RH_A_NDP;
+                   data_buf [3] = 0;
+                   if (temp & RH_A_PSM)        /* per-port power switching? */
+                       data_buf [3] |= 0x1;
+                   if (temp & RH_A_NOCP)       /* no overcurrent reporting? */
+                       data_buf [3] |= 0x10;
+                   else if (temp & RH_A_OCPM)  /* per-port overcurrent reporting? */
+                       data_buf [3] |= 0x8;
+
+                   /* corresponds to data_buf[4-7] */
+                   datab [1] = 0;
+                   data_buf [5] = (temp & RH_A_POTPGT) >> 24;
+                   temp = roothub_b (&gohci);
+                   data_buf [7] = temp & RH_B_DR;
+                   if (data_buf [2] < 7) {
+                       data_buf [8] = 0xff;
+                   } else {
+                       data_buf [0] += 2;
+                       data_buf [8] = (temp & RH_B_DR) >> 8;
+                       data_buf [10] = data_buf [9] = 0xff;
+                   }
+
+                   len = min_t(unsigned int, leni,
+                             min_t(unsigned int, data_buf [0], wLength));
+                   OK (len);
+               }
+
+       case RH_GET_CONFIGURATION:      *(__u8 *) data_buf = 0x01; OK (1);
+
+       case RH_SET_CONFIGURATION:      WR_RH_STAT (0x10000); OK (0);
+
+       default:
+               dbg ("unsupported root hub command");
+               stat = USB_ST_STALLED;
+       }
+
+#ifdef DEBUG
+       ohci_dump_roothub (&gohci, 1);
+#else
+       mdelay(1);
+#endif
+
+       len = min_t(int, len, leni);
+       if (data != data_buf)
+           memcpy (data, data_buf, len);
+       dev->act_len = len;
+       dev->status = stat;
+
+#ifdef DEBUG
+       if (transfer_len)
+               urb_priv.actual_length = transfer_len;
+       pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
+#else
+       mdelay(1);
+#endif
+
+       return stat;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* common code for handling submit messages - used for all but root hub */
+/* accesses. */
+int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+               int transfer_len, struct devrequest *setup, int interval)
+{
+       int stat = 0;
+       int maxsize = usb_maxpacket(dev, pipe);
+       int timeout;
+
+       /* device pulled? Shortcut the action. */
+       if (devgone == dev) {
+               dev->status = USB_ST_CRC_ERR;
+               return 0;
+       }
+
+#ifdef DEBUG
+       urb_priv.actual_length = 0;
+       pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
+#else
+       mdelay(1);
+#endif
+       if (!maxsize) {
+               err("submit_common_message: pipesize for pipe %lx is zero",
+                       pipe);
+               return -1;
+       }
+
+       if (sohci_submit_job(dev, pipe, buffer, transfer_len, setup, interval) < 0) {
+               err("sohci_submit_job failed");
+               return -1;
+       }
+
+       mdelay(10);
+       /* ohci_dump_status(&gohci); */
+
+       /* allow more time for a BULK device to react - some are slow */
+#define BULK_TO         5000   /* timeout in milliseconds */
+       if (usb_pipebulk(pipe))
+               timeout = BULK_TO;
+       else
+               timeout = 100;
+
+       timeout *= 4;
+       /* wait for it to complete */
+       for (;;) {
+               /* check whether the controller is done */
+               stat = hc_interrupt();
+               if (stat < 0) {
+                       stat = USB_ST_CRC_ERR;
+                       break;
+               }
+               if (stat >= 0 && stat != 0xff) {
+                       /* 0xff is returned for an SF-interrupt */
+                       break;
+               }
+               if (--timeout) {
+                       udelay(250); /* mdelay(1); */
+               } else {
+                       err("CTL:TIMEOUT ");
+                       stat = USB_ST_CRC_ERR;
+                       break;
+               }
+       }
+       /* we got an Root Hub Status Change interrupt */
+       if (got_rhsc) {
+#ifdef DEBUG
+               ohci_dump_roothub (&gohci, 1);
+#endif
+               got_rhsc = 0;
+               /* abuse timeout */
+               timeout = rh_check_port_status(&gohci);
+               if (timeout >= 0) {
+#if 0 /* this does nothing useful, but leave it here in case that changes */
+                       /* the called routine adds 1 to the passed value */
+                       usb_hub_port_connect_change(gohci.rh.dev, timeout - 1);
+#endif
+                       /*
+                        * XXX
+                        * This is potentially dangerous because it assumes
+                        * that only one device is ever plugged in!
+                        */
+                       devgone = dev;
+               }
+       }
+
+       dev->status = stat;
+       dev->act_len = transfer_len;
+
+#ifdef DEBUG
+       pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe));
+#else
+       mdelay(1);
+#endif
+
+       /* free TDs in urb_priv */
+       urb_free_priv (&urb_priv);
+       return 0;
+}
+
+/* submit routines called from usb.c */
+int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+               int transfer_len)
+{
+       info("submit_bulk_msg");
+       return submit_common_msg(dev, pipe, buffer, transfer_len, NULL, 0);
+}
+
+int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+               int transfer_len, struct devrequest *setup)
+{
+       int maxsize = usb_maxpacket(dev, pipe);
+
+       info("submit_control_msg");
+#ifdef DEBUG
+       urb_priv.actual_length = 0;
+       pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
+#else
+       mdelay(1);
+#endif
+       if (!maxsize) {
+               err("submit_control_message: pipesize for pipe %lx is zero",
+                       pipe);
+               return -1;
+       }
+       if (((pipe >> 8) & 0x7f) == gohci.rh.devnum) {
+               gohci.rh.dev = dev;
+               /* root hub - redirect */
+               return ohci_submit_rh_msg(dev, pipe, buffer, transfer_len,
+                       setup);
+       }
+
+       return submit_common_msg(dev, pipe, buffer, transfer_len, setup, 0);
+}
+
+int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+               int transfer_len, int interval)
+{
+       info("submit_int_msg");
+       return -1;
+}
+
+/*-------------------------------------------------------------------------*
+ * HC functions
+ *-------------------------------------------------------------------------*/
+
+/* reset the HC and BUS */
+
+static int hc_reset (ohci_t *ohci)
+{
+       int timeout = 30;
+       int smm_timeout = 50; /* 0,5 sec */
+
+       if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */
+               writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
+               info("USB HC TakeOver from SMM");
+               while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
+                       mdelay (10);
+                       if (--smm_timeout == 0) {
+                               err("USB HC TakeOver failed!");
+                               return -1;
+                       }
+               }
+       }
+
+       /* Disable HC interrupts */
+       writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
+
+       dbg("USB HC reset_hc usb-%s: ctrl = 0x%X ;",
+               ohci->slot_name,
+               readl (&ohci->regs->control));
+
+       /* Reset USB (needed by some controllers) */
+       writel (0, &ohci->regs->control);
+
+       /* HC Reset requires max 10 us delay */
+       writel (OHCI_HCR,  &ohci->regs->cmdstatus);
+       while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
+               if (--timeout == 0) {
+                       err("USB HC reset timed out!");
+                       return -1;
+               }
+               udelay (1);
+       }
+       return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* Start an OHCI controller, set the BUS operational
+ * enable interrupts
+ * connect the virtual root hub */
+
+static int hc_start (ohci_t * ohci)
+{
+       __u32 mask;
+       unsigned int fminterval;
+
+       ohci->disabled = 1;
+
+       /* Tell the controller where the control and bulk lists are
+        * The lists are empty now. */
+
+       writel (0, &ohci->regs->ed_controlhead);
+       writel (0, &ohci->regs->ed_bulkhead);
+
+       writel ((__u32)ohci->hcca, &ohci->regs->hcca); /* a reset clears this */
+
+       fminterval = 0x2edf;
+       writel ((fminterval * 9) / 10, &ohci->regs->periodicstart);
+       fminterval |= ((((fminterval - 210) * 6) / 7) << 16);
+       writel (fminterval, &ohci->regs->fminterval);
+       writel (0x628, &ohci->regs->lsthresh);
+
+       /* start controller operations */
+       ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
+       ohci->disabled = 0;
+       writel (ohci->hc_control, &ohci->regs->control);
+
+       /* disable all interrupts */
+       mask = (OHCI_INTR_SO | OHCI_INTR_WDH | OHCI_INTR_SF | OHCI_INTR_RD |
+                       OHCI_INTR_UE | OHCI_INTR_FNO | OHCI_INTR_RHSC |
+                       OHCI_INTR_OC | OHCI_INTR_MIE);
+       writel (mask, &ohci->regs->intrdisable);
+       /* clear all interrupts */
+       mask &= ~OHCI_INTR_MIE;
+       writel (mask, &ohci->regs->intrstatus);
+       /* Choose the interrupts we care about now  - but w/o MIE */
+       mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
+       writel (mask, &ohci->regs->intrenable);
+
+#ifdef OHCI_USE_NPS
+       /* required for AMD-756 and some Mac platforms */
+       writel ((roothub_a (ohci) | RH_A_NPS) & ~RH_A_PSM,
+               &ohci->regs->roothub.a);
+       writel (RH_HS_LPSC, &ohci->regs->roothub.status);
+#endif /* OHCI_USE_NPS */
+
+       /* POTPGT delay is bits 24-31, in 2 ms units. */
+       mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
+
+       /* connect the virtual root hub */
+       ohci->rh.devnum = 0;
+
+       return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* an interrupt happens */
+
+static int
+hc_interrupt (void)
+{
+       ohci_t *ohci = &gohci;
+       struct ohci_regs *regs = ohci->regs;
+       int ints;
+       int stat = -1;
+
+       if ((ohci->hcca->done_head != 0) && !(m32_swap (ohci->hcca->done_head) & 0x01)) {
+               ints =  OHCI_INTR_WDH;
+       } else {
+               ints = readl (&regs->intrstatus);
+       }
+
+       /* dbg("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no)); */
+
+       if (ints & OHCI_INTR_RHSC) {
+               got_rhsc = 1;
+       }
+
+       if (ints & OHCI_INTR_UE) {
+               ohci->disabled++;
+               err ("OHCI Unrecoverable Error, controller usb-%s disabled",
+                       ohci->slot_name);
+               /* e.g. due to PCI Master/Target Abort */
+
+#ifdef DEBUG
+               ohci_dump (ohci, 1);
+#else
+       mdelay(1);
+#endif
+               /* FIXME: be optimistic, hope that bug won't repeat often. */
+               /* Make some non-interrupt context restart the controller. */
+               /* Count and limit the retries though; either hardware or */
+               /* software errors can go forever... */
+               hc_reset (ohci);
+               return -1;
+       }
+
+       if (ints & OHCI_INTR_WDH) {
+               mdelay(1);
+               writel (OHCI_INTR_WDH, &regs->intrdisable);
+               stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
+               writel (OHCI_INTR_WDH, &regs->intrenable);
+       }
+
+       if (ints & OHCI_INTR_SO) {
+               dbg("USB Schedule overrun\n");
+               writel (OHCI_INTR_SO, &regs->intrenable);
+               stat = -1;
+       }
+
+       /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
+       if (ints & OHCI_INTR_SF) {
+               unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1;
+               mdelay(1);
+               writel (OHCI_INTR_SF, &regs->intrdisable);
+               if (ohci->ed_rm_list[frame] != NULL)
+                       writel (OHCI_INTR_SF, &regs->intrenable);
+               stat = 0xff;
+       }
+
+       writel (ints, &regs->intrstatus);
+       return stat;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/*-------------------------------------------------------------------------*/
+
+/* De-allocate all resources.. */
+
+static void hc_release_ohci (ohci_t *ohci)
+{
+       dbg ("USB HC release ohci usb-%s", ohci->slot_name);
+
+       if (!ohci->disabled)
+               hc_reset (ohci);
+}
+
+/*-------------------------------------------------------------------------*/
+
+#define __read_32bit_c0_register(source, sel)                          \
+({ int __res;                                                          \
+       if (sel == 0)                                                   \
+               __asm__ __volatile__(                                   \
+                       "mfc0\t%0, " #source "\n\t"                     \
+                       : "=r" (__res));                                \
+       else                                                            \
+               __asm__ __volatile__(                                   \
+                       ".set\tmips32\n\t"                              \
+                       "mfc0\t%0, " #source ", " #sel "\n\t"           \
+                       ".set\tmips0\n\t"                               \
+                       : "=r" (__res));                                \
+       __res;                                                          \
+})
+
+#define read_c0_prid()         __read_32bit_c0_register($15, 0)
+
+/*
+ * low level initalisation routine, called from usb.c
+ */
+static char ohci_inited = 0;
+
+int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
+{
+       u32 pin_func;
+       u32 sys_freqctrl, sys_clksrc;
+       u32 prid = read_c0_prid();
+
+       dbg("in usb_lowlevel_init\n");
+
+       /* zero and disable FREQ2 */
+       sys_freqctrl = au_readl(SYS_FREQCTRL0);
+       sys_freqctrl &= ~0xFFF00000;
+       au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+       /* zero and disable USBH/USBD clocks */
+       sys_clksrc = au_readl(SYS_CLKSRC);
+       sys_clksrc &= ~0x00007FE0;
+       au_writel(sys_clksrc, SYS_CLKSRC);
+
+       sys_freqctrl = au_readl(SYS_FREQCTRL0);
+       sys_freqctrl &= ~0xFFF00000;
+
+       sys_clksrc = au_readl(SYS_CLKSRC);
+       sys_clksrc &= ~0x00007FE0;
+
+       switch (prid & 0x000000FF) {
+       case 0x00: /* DA */
+       case 0x01: /* HA */
+       case 0x02: /* HB */
+               /* CPU core freq to 48MHz to slow it way down... */
+               au_writel(4, SYS_CPUPLL);
+
+               /*
+                * Setup 48MHz FREQ2 from CPUPLL for USB Host
+                */
+               /* FRDIV2=3 -> div by 8 of 384MHz -> 48MHz */
+               sys_freqctrl |= ((3<<22) | (1<<21) | (0<<20));
+               au_writel(sys_freqctrl, SYS_FREQCTRL0);
+
+               /* CPU core freq to 384MHz */
+               au_writel(0x20, SYS_CPUPLL);
+
+               printf("Au1000: 48MHz OHCI workaround enabled\n");
+               break;
+
+       default:  /* HC and newer */
+               /* FREQ2 = aux/2 = 48 MHz */
+               sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
+               au_writel(sys_freqctrl, SYS_FREQCTRL0);
+               break;
+       }
+
+       /*
+        * Route 48MHz FREQ2 into USB Host and/or Device
+        */
+       sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
+       au_writel(sys_clksrc, SYS_CLKSRC);
+
+       /* configure pins GPIO[14:9] as GPIO */
+       pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8080);
+
+       au_writel(pin_func, SYS_PINFUNC);
+       au_writel(0x2800, SYS_TRIOUTCLR);
+       au_writel(0x0030, SYS_OUTPUTCLR);
+
+       dbg("OHCI board setup complete\n");
+
+       /* enable host controller */
+       au_writel(USBH_ENABLE_CE, USB_HOST_CONFIG);
+       udelay(1000);
+       au_writel(USBH_ENABLE_INIT, USB_HOST_CONFIG);
+       udelay(1000);
+
+       /* wait for reset complete (read register twice; see au1500 errata) */
+       while (au_readl(USB_HOST_CONFIG),
+              !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD))
+               udelay(1000);
+
+       dbg("OHCI clock running\n");
+
+       memset (&gohci, 0, sizeof (ohci_t));
+       memset (&urb_priv, 0, sizeof (urb_priv_t));
+
+       /* align the storage */
+       if ((__u32)&ghcca[0] & 0xff) {
+               err("HCCA not aligned!!");
+               return -1;
+       }
+       phcca = &ghcca[0];
+       info("aligned ghcca %p", phcca);
+       memset(&ohci_dev, 0, sizeof(struct ohci_device));
+       if ((__u32)&ohci_dev.ed[0] & 0x7) {
+               err("EDs not aligned!!");
+               return -1;
+       }
+       memset(gtd, 0, sizeof(td_t) * (NUM_TD + 1));
+       if ((__u32)gtd & 0x7) {
+               err("TDs not aligned!!");
+               return -1;
+       }
+       ptd = gtd;
+       gohci.hcca = phcca;
+       memset (phcca, 0, sizeof (struct ohci_hcca));
+
+       gohci.disabled = 1;
+       gohci.sleeping = 0;
+       gohci.irq = -1;
+       gohci.regs = (struct ohci_regs *)(USB_OHCI_BASE | 0xA0000000);
+
+       gohci.flags = 0;
+       gohci.slot_name = "au1x00";
+
+       dbg("OHCI revision: 0x%08x\n"
+              "  RH: a: 0x%08x b: 0x%08x\n",
+              readl(&gohci.regs->revision),
+              readl(&gohci.regs->roothub.a), readl(&gohci.regs->roothub.b));
+
+       if (hc_reset (&gohci) < 0)
+               goto errout;
+
+       /* FIXME this is a second HC reset; why?? */
+       writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
+       mdelay (10);
+
+       if (hc_start (&gohci) < 0)
+               goto errout;
+
+#ifdef DEBUG
+       ohci_dump (&gohci, 1);
+#else
+       mdelay(1);
+#endif
+       ohci_inited = 1;
+       return 0;
+
+  errout:
+       err("OHCI initialization error\n");
+       hc_release_ohci (&gohci);
+       /* Initialization failed */
+       au_writel(readl(USB_HOST_CONFIG) & ~USBH_ENABLE_CE, USB_HOST_CONFIG);
+       return -1;
+}
+
+int usb_lowlevel_stop(int index)
+{
+       /* this gets called really early - before the controller has */
+       /* even been initialized! */
+       if (!ohci_inited)
+               return 0;
+       /* TODO release any interrupts, etc. */
+       /* call hc_release_ohci() here ? */
+       hc_reset (&gohci);
+       /* may not want to do this */
+       /* Disable clock */
+       au_writel(readl(USB_HOST_CONFIG) & ~USBH_ENABLE_CE, USB_HOST_CONFIG);
+       return 0;
+}
+
+#endif /* CONFIG_USB_OHCI */
diff --git a/arch/mips/mach-au1x00/au1x00_usb_ohci.h b/arch/mips/mach-au1x00/au1x00_usb_ohci.h
new file mode 100644 (file)
index 0000000..bb9f351
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * URB OHCI HCD (Host Controller Driver) for USB.
+ *
+ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
+ * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
+ *
+ * usb-ohci.h
+ */
+
+
+static int cc_to_error[16] = {
+
+/* mapping of the OHCI CC status to error codes */
+       /* No  Error  */        0,
+       /* CRC Error  */        USB_ST_CRC_ERR,
+       /* Bit Stuff  */        USB_ST_BIT_ERR,
+       /* Data Togg  */        USB_ST_CRC_ERR,
+       /* Stall      */        USB_ST_STALLED,
+       /* DevNotResp */        -1,
+       /* PIDCheck   */        USB_ST_BIT_ERR,
+       /* UnExpPID   */        USB_ST_BIT_ERR,
+       /* DataOver   */        USB_ST_BUF_ERR,
+       /* DataUnder  */        USB_ST_BUF_ERR,
+       /* reservd    */        -1,
+       /* reservd    */        -1,
+       /* BufferOver */        USB_ST_BUF_ERR,
+       /* BuffUnder  */        USB_ST_BUF_ERR,
+       /* Not Access */        -1,
+       /* Not Access */        -1
+};
+
+/* ED States */
+
+#define ED_NEW         0x00
+#define ED_UNLINK      0x01
+#define ED_OPER                0x02
+#define ED_DEL         0x04
+#define ED_URB_DEL     0x08
+
+/* usb_ohci_ed */
+struct ed {
+       __u32 hwINFO;
+       __u32 hwTailP;
+       __u32 hwHeadP;
+       __u32 hwNextED;
+
+       struct ed *ed_prev;
+       __u8 int_period;
+       __u8 int_branch;
+       __u8 int_load;
+       __u8 int_interval;
+       __u8 state;
+       __u8 type;
+       __u16 last_iso;
+       struct ed *ed_rm_list;
+
+       struct usb_device *usb_dev;
+       __u32 unused[3];
+} __attribute__((aligned(16)));
+typedef struct ed ed_t;
+
+
+/* TD info field */
+#define TD_CC                  0xf0000000
+#define TD_CC_GET(td_p)                ((td_p >>28) & 0x0f)
+#define TD_CC_SET(td_p, cc)    (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28)
+#define TD_EC                  0x0C000000
+#define TD_T                   0x03000000
+#define TD_T_DATA0             0x02000000
+#define TD_T_DATA1             0x03000000
+#define TD_T_TOGGLE            0x00000000
+#define TD_R                   0x00040000
+#define TD_DI                  0x00E00000
+#define TD_DI_SET(X)           (((X) & 0x07)<< 21)
+#define TD_DP                  0x00180000
+#define TD_DP_SETUP            0x00000000
+#define TD_DP_IN               0x00100000
+#define TD_DP_OUT              0x00080000
+
+#define TD_ISO                 0x00010000
+#define TD_DEL                 0x00020000
+
+/* CC Codes */
+#define TD_CC_NOERROR          0x00
+#define TD_CC_CRC              0x01
+#define TD_CC_BITSTUFFING      0x02
+#define TD_CC_DATATOGGLEM      0x03
+#define TD_CC_STALL            0x04
+#define TD_DEVNOTRESP          0x05
+#define TD_PIDCHECKFAIL                0x06
+#define TD_UNEXPECTEDPID       0x07
+#define TD_DATAOVERRUN         0x08
+#define TD_DATAUNDERRUN                0x09
+#define TD_BUFFEROVERRUN       0x0C
+#define TD_BUFFERUNDERRUN      0x0D
+#define TD_NOTACCESSED         0x0F
+
+
+#define MAXPSW 1
+
+struct td {
+       __u32 hwINFO;
+       __u32 hwCBP;            /* Current Buffer Pointer */
+       __u32 hwNextTD;         /* Next TD Pointer */
+       __u32 hwBE;             /* Memory Buffer End Pointer */
+
+       __u16 hwPSW[MAXPSW];
+       __u8 unused;
+       __u8 index;
+       struct ed *ed;
+       struct td *next_dl_td;
+       struct usb_device *usb_dev;
+       int transfer_len;
+       __u32 data;
+
+       __u32 unused2[2];
+} __attribute__((aligned(32)));
+typedef struct td td_t;
+
+#define OHCI_ED_SKIP   (1 << 14)
+
+/*
+ * The HCCA (Host Controller Communications Area) is a 256 byte
+ * structure defined in the OHCI spec. that the host controller is
+ * told the base address of.  It must be 256-byte aligned.
+ */
+
+#define NUM_INTS 32    /* part of the OHCI standard */
+struct ohci_hcca {
+       __u32   int_table[NUM_INTS];    /* Interrupt ED table */
+       __u16   frame_no;               /* current frame number */
+       __u16   pad1;                   /* set to 0 on each frame_no change */
+       __u32   done_head;              /* info returned for an interrupt */
+       u8              reserved_for_hc[116];
+} __attribute__((aligned(256)));
+
+
+/*
+ * Maximum number of root hub ports.
+ */
+#define MAX_ROOT_PORTS 15      /* maximum OHCI root hub ports */
+
+/*
+ * This is the structure of the OHCI controller's memory mapped I/O
+ * region.  This is Memory Mapped I/O. You must use the readl() and
+ * writel() macros defined in asm/io.h to access these!!
+ */
+struct ohci_regs {
+       /* control and status registers */
+       __u32   revision;
+       __u32   control;
+       __u32   cmdstatus;
+       __u32   intrstatus;
+       __u32   intrenable;
+       __u32   intrdisable;
+       /* memory pointers */
+       __u32   hcca;
+       __u32   ed_periodcurrent;
+       __u32   ed_controlhead;
+       __u32   ed_controlcurrent;
+       __u32   ed_bulkhead;
+       __u32   ed_bulkcurrent;
+       __u32   donehead;
+       /* frame counters */
+       __u32   fminterval;
+       __u32   fmremaining;
+       __u32   fmnumber;
+       __u32   periodicstart;
+       __u32   lsthresh;
+       /* Root hub ports */
+       struct  ohci_roothub_regs {
+               __u32   a;
+               __u32   b;
+               __u32   status;
+               __u32   portstatus[MAX_ROOT_PORTS];
+       } roothub;
+} __attribute__((aligned(32)));
+
+
+/* OHCI CONTROL AND STATUS REGISTER MASKS */
+
+/*
+ * HcControl (control) register masks
+ */
+#define OHCI_CTRL_CBSR (3 << 0)        /* control/bulk service ratio */
+#define OHCI_CTRL_PLE  (1 << 2)        /* periodic list enable */
+#define OHCI_CTRL_IE   (1 << 3)        /* isochronous enable */
+#define OHCI_CTRL_CLE  (1 << 4)        /* control list enable */
+#define OHCI_CTRL_BLE  (1 << 5)        /* bulk list enable */
+#define OHCI_CTRL_HCFS (3 << 6)        /* host controller functional state */
+#define OHCI_CTRL_IR   (1 << 8)        /* interrupt routing */
+#define OHCI_CTRL_RWC  (1 << 9)        /* remote wakeup connected */
+#define OHCI_CTRL_RWE  (1 << 10)       /* remote wakeup enable */
+
+/* pre-shifted values for HCFS */
+#      define OHCI_USB_RESET   (0 << 6)
+#      define OHCI_USB_RESUME  (1 << 6)
+#      define OHCI_USB_OPER    (2 << 6)
+#      define OHCI_USB_SUSPEND (3 << 6)
+
+/*
+ * HcCommandStatus (cmdstatus) register masks
+ */
+#define OHCI_HCR       (1 << 0)        /* host controller reset */
+#define OHCI_CLF       (1 << 1)        /* control list filled */
+#define OHCI_BLF       (1 << 2)        /* bulk list filled */
+#define OHCI_OCR       (1 << 3)        /* ownership change request */
+#define OHCI_SOC       (3 << 16)       /* scheduling overrun count */
+
+/*
+ * masks used with interrupt registers:
+ * HcInterruptStatus (intrstatus)
+ * HcInterruptEnable (intrenable)
+ * HcInterruptDisable (intrdisable)
+ */
+#define OHCI_INTR_SO   (1 << 0)        /* scheduling overrun */
+#define OHCI_INTR_WDH  (1 << 1)        /* writeback of done_head */
+#define OHCI_INTR_SF   (1 << 2)        /* start frame */
+#define OHCI_INTR_RD   (1 << 3)        /* resume detect */
+#define OHCI_INTR_UE   (1 << 4)        /* unrecoverable error */
+#define OHCI_INTR_FNO  (1 << 5)        /* frame number overflow */
+#define OHCI_INTR_RHSC (1 << 6)        /* root hub status change */
+#define OHCI_INTR_OC   (1 << 30)       /* ownership change */
+#define OHCI_INTR_MIE  (1 << 31)       /* master interrupt enable */
+
+
+/* Virtual Root HUB */
+struct virt_root_hub {
+       int devnum; /* Address of Root Hub endpoint */
+       void *dev;  /* was urb */
+       void *int_addr;
+       int send;
+       int interval;
+};
+
+/* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
+
+/* destination of request */
+#define RH_INTERFACE           0x01
+#define RH_ENDPOINT            0x02
+#define RH_OTHER               0x03
+
+#define RH_CLASS               0x20
+#define RH_VENDOR              0x40
+
+/* Requests: bRequest << 8 | bmRequestType */
+#define RH_GET_STATUS          0x0080
+#define RH_CLEAR_FEATURE       0x0100
+#define RH_SET_FEATURE         0x0300
+#define RH_SET_ADDRESS         0x0500
+#define RH_GET_DESCRIPTOR      0x0680
+#define RH_SET_DESCRIPTOR      0x0700
+#define RH_GET_CONFIGURATION   0x0880
+#define RH_SET_CONFIGURATION   0x0900
+#define RH_GET_STATE           0x0280
+#define RH_GET_INTERFACE       0x0A80
+#define RH_SET_INTERFACE       0x0B00
+#define RH_SYNC_FRAME          0x0C80
+/* Our Vendor Specific Request */
+#define RH_SET_EP              0x2000
+
+
+/* Hub port features */
+#define RH_PORT_CONNECTION     0x00
+#define RH_PORT_ENABLE         0x01
+#define RH_PORT_SUSPEND                0x02
+#define RH_PORT_OVER_CURRENT   0x03
+#define RH_PORT_RESET          0x04
+#define RH_PORT_POWER          0x08
+#define RH_PORT_LOW_SPEED      0x09
+
+#define RH_C_PORT_CONNECTION   0x10
+#define RH_C_PORT_ENABLE       0x11
+#define RH_C_PORT_SUSPEND      0x12
+#define RH_C_PORT_OVER_CURRENT 0x13
+#define RH_C_PORT_RESET                0x14
+
+/* Hub features */
+#define RH_C_HUB_LOCAL_POWER   0x00
+#define RH_C_HUB_OVER_CURRENT  0x01
+
+#define RH_DEVICE_REMOTE_WAKEUP 0x00
+#define RH_ENDPOINT_STALL      0x01
+
+#define RH_ACK                 0x01
+#define RH_REQ_ERR             -1
+#define RH_NACK                        0x00
+
+
+/* OHCI ROOT HUB REGISTER MASKS */
+
+/* roothub.portstatus [i] bits */
+#define RH_PS_CCS              0x00000001      /* current connect status */
+#define RH_PS_PES              0x00000002      /* port enable status*/
+#define RH_PS_PSS              0x00000004      /* port suspend status */
+#define RH_PS_POCI             0x00000008      /* port over current indicator */
+#define RH_PS_PRS              0x00000010      /* port reset status */
+#define RH_PS_PPS              0x00000100      /* port power status */
+#define RH_PS_LSDA             0x00000200      /* low speed device attached */
+#define RH_PS_CSC              0x00010000      /* connect status change */
+#define RH_PS_PESC             0x00020000      /* port enable status change */
+#define RH_PS_PSSC             0x00040000      /* port suspend status change */
+#define RH_PS_OCIC             0x00080000      /* over current indicator change */
+#define RH_PS_PRSC             0x00100000      /* port reset status change */
+
+/* roothub.status bits */
+#define RH_HS_LPS              0x00000001      /* local power status */
+#define RH_HS_OCI              0x00000002      /* over current indicator */
+#define RH_HS_DRWE             0x00008000      /* device remote wakeup enable */
+#define RH_HS_LPSC             0x00010000      /* local power status change */
+#define RH_HS_OCIC             0x00020000      /* over current indicator change */
+#define RH_HS_CRWE             0x80000000      /* clear remote wakeup enable */
+
+/* roothub.b masks */
+#define RH_B_DR                        0x0000ffff      /* device removable flags */
+#define RH_B_PPCM              0xffff0000      /* port power control mask */
+
+/* roothub.a masks */
+#define        RH_A_NDP                (0xff << 0)     /* number of downstream ports */
+#define        RH_A_PSM                (1 << 8)        /* power switching mode */
+#define        RH_A_NPS                (1 << 9)        /* no power switching */
+#define        RH_A_DT                 (1 << 10)       /* device type (mbz) */
+#define        RH_A_OCPM               (1 << 11)       /* over current protection mode */
+#define        RH_A_NOCP               (1 << 12)       /* no over current protection */
+#define        RH_A_POTPGT             (0xff << 24)    /* power on to power good time */
+
+/* urb */
+#define N_URB_TD 48
+typedef struct
+{
+       ed_t *ed;
+       __u16 length;           /* number of tds associated with this request */
+       __u16 td_cnt;           /* number of tds already serviced */
+       int   state;
+       unsigned long pipe;
+       int actual_length;
+       td_t *td[N_URB_TD];     /* list pointer to all corresponding TDs associated with this request */
+} urb_priv_t;
+#define URB_DEL 1
+
+/*
+ * This is the full ohci controller description
+ *
+ * Note how the "proper" USB information is just
+ * a subset of what the full implementation needs. (Linus)
+ */
+
+
+typedef struct ohci {
+       struct ohci_hcca *hcca;         /* hcca */
+       /*dma_addr_t hcca_dma;*/
+
+       int irq;
+       int disabled;                   /* e.g. got a UE, we're hung */
+       int sleeping;
+       unsigned long flags;            /* for HC bugs */
+
+       struct ohci_regs *regs;         /* OHCI controller's memory */
+
+       ed_t *ed_rm_list[2];            /* lists of all endpoints to be removed */
+       ed_t *ed_bulktail;              /* last endpoint of bulk list */
+       ed_t *ed_controltail;           /* last endpoint of control list */
+       int intrstatus;
+       __u32 hc_control;               /* copy of the hc control reg */
+       struct usb_device *dev[32];
+       struct virt_root_hub rh;
+
+       const char      *slot_name;
+} ohci_t;
+
+#define NUM_EDS 8              /* num of preallocated endpoint descriptors */
+
+struct ohci_device {
+       ed_t    ed[NUM_EDS];
+       int ed_cnt;
+};
+
+/* hcd */
+/* endpoint */
+static int ep_link(ohci_t * ohci, ed_t * ed);
+static int ep_unlink(ohci_t * ohci, ed_t * ed);
+static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe);
+
+/*-------------------------------------------------------------------------*/
+
+/* we need more TDs than EDs */
+#define NUM_TD 64
+
+/* +1 so we can align the storage */
+td_t gtd[NUM_TD+1];
+/* pointers to aligned storage */
+td_t *ptd;
+
+/* TDs ... */
+static inline struct td *
+td_alloc (struct usb_device *usb_dev)
+{
+       int i;
+       struct td       *td;
+
+       td = NULL;
+       for (i = 0; i < NUM_TD; i++) {
+               if (ptd[i].usb_dev == NULL) {
+                       td = &ptd[i];
+                       td->usb_dev = usb_dev;
+                       break;
+               }
+       }
+       return td;
+}
+
+static inline void
+ed_free (struct ed *ed)
+{
+       ed->usb_dev = NULL;
+}
diff --git a/arch/mips/mach-au1x00/config.mk b/arch/mips/mach-au1x00/config.mk
new file mode 100644 (file)
index 0000000..5c89129
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2011
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+PLATFORM_CPPFLAGS += -mtune=4kc
index 7a50301f7c200bb7397e81af094a979366a6dcd5..8e5a3e2074d31d8c7a386f071a78a0630deb4f2c 100644 (file)
@@ -7,9 +7,6 @@ config SYS_ARCH
 choice
        prompt "CPU select"
 
-config 74xx_7xx
-       bool "74xx"
-
 config MPC512X
        bool "MPC512X"
 
@@ -39,7 +36,6 @@ config 4xx
 
 endchoice
 
-source "arch/powerpc/cpu/74xx_7xx/Kconfig"
 source "arch/powerpc/cpu/mpc512x/Kconfig"
 source "arch/powerpc/cpu/mpc5xx/Kconfig"
 source "arch/powerpc/cpu/mpc5xxx/Kconfig"
diff --git a/arch/powerpc/cpu/74xx_7xx/Kconfig b/arch/powerpc/cpu/74xx_7xx/Kconfig
deleted file mode 100644 (file)
index b2f1a59..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-menu "74xx_7xx CPU"
-       depends on 74xx_7xx
-
-config SYS_CPU
-       default "74xx_7xx"
-
-choice
-       prompt "Target select"
-
-config TARGET_P3G4
-       bool "Support P3G4"
-
-config TARGET_ZUMA
-       bool "Support ZUMA"
-
-config TARGET_PPMC7XX
-       bool "Support ppmc7xx"
-
-config TARGET_ELPPC
-       bool "Support ELPPC"
-
-config TARGET_MPC7448HPC2
-       bool "Support mpc7448hpc2"
-
-endchoice
-
-source "board/eltec/elppc/Kconfig"
-source "board/evb64260/Kconfig"
-source "board/freescale/mpc7448hpc2/Kconfig"
-source "board/ppmc7xx/Kconfig"
-
-endmenu
diff --git a/arch/powerpc/cpu/74xx_7xx/Makefile b/arch/powerpc/cpu/74xx_7xx/Makefile
deleted file mode 100644 (file)
index f31fe75..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# (C) Copyright 2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# (C) Copyright 2001
-# Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-extra-y        = start.o
-obj-y  = cache.o kgdb.o io.o
-obj-y  += traps.o cpu.o cpu_init.o speed.o interrupts.o
diff --git a/arch/powerpc/cpu/74xx_7xx/cache.S b/arch/powerpc/cpu/74xx_7xx/cache.S
deleted file mode 100644 (file)
index 66c7298..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-#include <config.h>
-#include <74xx_7xx.h>
-#include <version.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-#include <asm/cache.h>
-#include <asm/mmu.h>
-
-#ifndef CACHE_LINE_SIZE
-# define CACHE_LINE_SIZE L1_CACHE_BYTES
-#endif
-
-#if CACHE_LINE_SIZE == 128
-#define LG_CACHE_LINE_SIZE 7
-#elif CACHE_LINE_SIZE == 32
-#define LG_CACHE_LINE_SIZE 5
-#elif CACHE_LINE_SIZE == 16
-#define LG_CACHE_LINE_SIZE 4
-#elif CACHE_LINE_SIZE == 8
-#define LG_CACHE_LINE_SIZE 3
-#else
-# error "Invalid cache line size!"
-#endif
-
-/*
- * Invalidate L1 instruction cache.
- */
-_GLOBAL(invalidate_l1_instruction_cache)
-       mfspr   r3,PVR
-       rlwinm  r3,r3,16,16,31
-       cmpi    0,r3,1
-       beqlr                   /* for 601, do nothing */
-       /* 603/604 processor - use invalidate-all bit in HID0 */
-       mfspr   r3,HID0
-       ori     r3,r3,HID0_ICFI
-       mtspr   HID0,r3
-       isync
-       blr
-
-/*
- * Invalidate L1 data cache.
- */
-_GLOBAL(invalidate_l1_data_cache)
-       mfspr   r3,HID0
-       ori     r3,r3,HID0_DCFI
-       mtspr   HID0,r3
-       isync
-       blr
-
-/*
- * Flush data cache.
- */
-_GLOBAL(flush_dcache)
-       lis     r3,0
-       lis     r5,CACHE_LINE_SIZE
-flush:
-       cmp     0,1,r3,r5
-       bge     done
-       lwz     r5,0(r3)
-       lis     r5,CACHE_LINE_SIZE
-       addi    r3,r3,0x4
-       b       flush
-done:
-       blr
-/*
- * Write any modified data cache blocks out to memory
- * and invalidate the corresponding instruction cache blocks.
- * This is a no-op on the 601.
- *
- * flush_icache_range(unsigned long start, unsigned long stop)
- */
-_GLOBAL(flush_icache_range)
-       mfspr   r5,PVR
-       rlwinm  r5,r5,16,16,31
-       cmpi    0,r5,1
-       beqlr                           /* for 601, do nothing */
-       li      r5,CACHE_LINE_SIZE-1
-       andc    r3,r3,r5
-       subf    r4,r3,r4
-       add     r4,r4,r5
-       srwi.   r4,r4,LG_CACHE_LINE_SIZE
-       beqlr
-       mtctr   r4
-       mr      r6,r3
-1:     dcbst   0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbst's to get to ram */
-       mtctr   r4
-2:     icbi    0,r6
-       addi    r6,r6,CACHE_LINE_SIZE
-       bdnz    2b
-       sync                            /* additional sync needed on g4 */
-       isync
-       blr
-/*
- * Write any modified data cache blocks out to memory.
- * Does not invalidate the corresponding cache lines (especially for
- * any corresponding instruction cache).
- *
- * clean_dcache_range(unsigned long start, unsigned long stop)
- */
-_GLOBAL(clean_dcache_range)
-       li      r5,CACHE_LINE_SIZE-1
-       andc    r3,r3,r5        /* align r3 down to cache line */
-       subf    r4,r3,r4        /* r4 = offset of stop from start of cache line */
-       add     r4,r4,r5        /* r4 += cache_line_size-1 */
-       srwi.   r4,r4,LG_CACHE_LINE_SIZE  /* r4 = number of cache lines to flush */
-       beqlr                             /* if r4 == 0 return */
-       mtctr   r4                        /* ctr = r4 */
-
-       sync
-1:     dcbst   0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbst's to get to ram */
-       blr
-
-/*
- * Write any modified data cache blocks out to memory
- * and invalidate the corresponding instruction cache blocks.
- *
- * flush_dcache_range(unsigned long start, unsigned long stop)
- */
-_GLOBAL(flush_dcache_range)
-       li      r5,CACHE_LINE_SIZE-1
-       andc    r3,r3,r5
-       subf    r4,r3,r4
-       add     r4,r4,r5
-       srwi.   r4,r4,LG_CACHE_LINE_SIZE
-       beqlr
-       mtctr   r4
-
-       sync
-1:     dcbf    0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbf's to get to ram */
-       blr
-
-/*
- * Like above, but invalidate the D-cache.  This is used by the 8xx
- * to invalidate the cache so the PPC core doesn't get stale data
- * from the CPM (no cache snooping here :-).
- *
- * invalidate_dcache_range(unsigned long start, unsigned long stop)
- */
-_GLOBAL(invalidate_dcache_range)
-       li      r5,CACHE_LINE_SIZE-1
-       andc    r3,r3,r5
-       subf    r4,r3,r4
-       add     r4,r4,r5
-       srwi.   r4,r4,LG_CACHE_LINE_SIZE
-       beqlr
-       mtctr   r4
-
-       sync
-1:     dcbi    0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbi's to get to ram */
-       blr
-
-/*
- * Flush a particular page from the data cache to RAM.
- * Note: this is necessary because the instruction cache does *not*
- * snoop from the data cache.
- * This is a no-op on the 601 which has a unified cache.
- *
- *     void __flush_page_to_ram(void *page)
- */
-_GLOBAL(__flush_page_to_ram)
-       mfspr   r5,PVR
-       rlwinm  r5,r5,16,16,31
-       cmpi    0,r5,1
-       beqlr                           /* for 601, do nothing */
-       rlwinm  r3,r3,0,0,19            /* Get page base address */
-       li      r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
-       mtctr   r4
-       mr      r6,r3
-0:     dcbst   0,r3                    /* Write line to ram */
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    0b
-       sync
-       mtctr   r4
-1:     icbi    0,r6
-       addi    r6,r6,CACHE_LINE_SIZE
-       bdnz    1b
-       sync
-       isync
-       blr
-
-/*
- * Flush a particular page from the instruction cache.
- * Note: this is necessary because the instruction cache does *not*
- * snoop from the data cache.
- * This is a no-op on the 601 which has a unified cache.
- *
- *     void __flush_icache_page(void *page)
- */
-_GLOBAL(__flush_icache_page)
-       mfspr   r5,PVR
-       rlwinm  r5,r5,16,16,31
-       cmpi    0,r5,1
-       beqlr                           /* for 601, do nothing */
-       li      r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
-       mtctr   r4
-1:     icbi    0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       sync
-       isync
-       blr
-
-/*
- * Clear a page using the dcbz instruction, which doesn't cause any
- * memory traffic (except to write out any cache lines which get
- * displaced).  This only works on cacheable memory.
- */
-_GLOBAL(clear_page)
-       li      r0,4096/CACHE_LINE_SIZE
-       mtctr   r0
-1:     dcbz    0,r3
-       addi    r3,r3,CACHE_LINE_SIZE
-       bdnz    1b
-       blr
-
-/*
- * Enable L1 Instruction cache
- */
-_GLOBAL(icache_enable)
-       mfspr   r3, HID0
-       li      r5, HID0_ICFI|HID0_ILOCK
-       andc    r3, r3, r5
-       ori     r3, r3, HID0_ICE
-       ori     r5, r3, HID0_ICFI
-       mtspr   HID0, r5
-       mtspr   HID0, r3
-       isync
-       blr
-
-/*
- * Disable L1 Instruction cache
- */
-_GLOBAL(icache_disable)
-       mflr    r4
-       bl      invalidate_l1_instruction_cache         /* uses r3 */
-       sync
-       mtlr    r4
-       mfspr   r3, HID0
-       li      r5, 0
-       ori     r5, r5, HID0_ICE
-       andc    r3, r3, r5
-       mtspr   HID0, r3
-       isync
-       blr
-
-/*
- * Is instruction cache enabled?
- */
-_GLOBAL(icache_status)
-       mfspr   r3, HID0
-       andi.   r3, r3, HID0_ICE
-       blr
-
-
-_GLOBAL(l1dcache_enable)
-       mfspr   r3, HID0
-       li      r5, HID0_DCFI|HID0_DLOCK
-       andc    r3, r3, r5
-       mtspr   HID0, r3                /* no invalidate, unlock */
-       ori     r3, r3, HID0_DCE
-       ori     r5, r3, HID0_DCFI
-       mtspr   HID0, r5                /* enable + invalidate */
-       mtspr   HID0, r3                /* enable */
-       sync
-       blr
-
-/*
- * Enable data cache(s) - L1 and optionally L2
- * Calls l2cache_enable. LR saved in r5
- */
-_GLOBAL(dcache_enable)
-       mfspr   r3, HID0
-       li      r5, HID0_DCFI|HID0_DLOCK
-       andc    r3, r3, r5
-       mtspr   HID0, r3                /* no invalidate, unlock */
-       ori     r3, r3, HID0_DCE
-       ori     r5, r3, HID0_DCFI
-       mtspr   HID0, r5                /* enable + invalidate */
-       mtspr   HID0, r3                /* enable */
-       sync
-#ifdef CONFIG_SYS_L2
-       mflr    r5
-       bl      l2cache_enable          /* uses r3 and r4 */
-       sync
-       mtlr    r5
-#endif
-       blr
-
-
-/*
- * Disable data cache(s) - L1 and optionally L2
- * Calls flush_dcache and l2cache_disable_no_flush.
- * LR saved in r4
- */
-_GLOBAL(dcache_disable)
-       mflr    r4                      /* save link register */
-       bl      flush_dcache    /* uses r3 and r5 */
-       sync
-       mfspr   r3, HID0
-       li      r5, HID0_DCFI|HID0_DLOCK
-       andc    r3, r3, r5
-       mtspr   HID0, r3                /* no invalidate, unlock */
-       li      r5, HID0_DCE|HID0_DCFI
-       andc    r3, r3, r5              /* no enable, no invalidate */
-       mtspr   HID0, r3
-       sync
-#ifdef CONFIG_SYS_L2
-       bl      l2cache_disable_no_flush /* uses r3 */
-#endif
-       mtlr    r4                      /* restore link register */
-       blr
-
-/*
- * Is data cache enabled?
- */
-_GLOBAL(dcache_status)
-       mfspr   r3, HID0
-       andi.   r3, r3, HID0_DCE
-       blr
-
-/*
- * Invalidate L2 cache using L2I and polling L2IP or L2I
- */
-_GLOBAL(l2cache_invalidate)
-       sync
-       mfspr r3, l2cr
-       oris    r3, r3, L2CR_L2I@h
-       sync
-       mtspr   l2cr, r3
-       sync
-       mfspr r3, PVR
-       sync
-       rlwinm r3, r3, 16,16,31
-       cmpli 0,r3,0x8000  /* 7451, 7441 */
-       beq 0,inv_7450
-       cmpli 0,r3,0x8001  /* 7455, 7445 */
-       beq 0,inv_7450
-       cmpli 0,r3,0x8002  /* 7457, 7447 */
-       beq 0,inv_7450
-       cmpli 0,r3,0x8003  /* 7447A */
-       beq 0,inv_7450
-       cmpli 0,r3,0x8004  /* 7448 */
-       beq 0,inv_7450
-invl2:
-       mfspr   r3, l2cr
-       andi.   r3, r3, L2CR_L2IP
-       bne     invl2
-       /* turn off the global invalidate bit */
-       mfspr   r3, l2cr
-       rlwinm  r3, r3, 0, 11, 9
-       sync
-       mtspr   l2cr, r3
-       sync
-       blr
-inv_7450:
-       mfspr   r3, l2cr
-       andis. r3, r3, L2CR_L2I@h
-       bne inv_7450
-       blr
-
-/*
- * Enable L2 cache
- * Calls l2cache_invalidate. LR is saved in r4
- */
-_GLOBAL(l2cache_enable)
-       mflr    r4                      /* save link register */
-       bl      l2cache_invalidate      /* uses r3 */
-       sync
-       lis     r3, L2_ENABLE@h
-       ori     r3, r3, L2_ENABLE@l
-       mtspr   l2cr, r3
-       isync
-       mtlr    r4                      /* restore link register */
-       blr
-
-/*
- * Disable L2 cache
- * Calls flush_dcache. LR is saved in r4
- */
-_GLOBAL(l2cache_disable)
-       mflr    r4                      /* save link register */
-       bl      flush_dcache            /* uses r3 and r5 */
-       sync
-       mtlr    r4                      /* restore link register */
-l2cache_disable_no_flush:              /* provide way to disable L2 w/o flushing */
-       lis     r3, L2_INIT@h
-       ori     r3, r3, L2_INIT@l
-       mtspr   l2cr, r3
-       isync
-       blr
diff --git a/arch/powerpc/cpu/74xx_7xx/config.mk b/arch/powerpc/cpu/74xx_7xx/config.mk
deleted file mode 100644 (file)
index 4cd1a26..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2001
-# Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -mstring
diff --git a/arch/powerpc/cpu/74xx_7xx/cpu.c b/arch/powerpc/cpu/74xx_7xx/cpu.c
deleted file mode 100644 (file)
index 6cd54bf..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * cpu.c
- *
- * CPU specific code
- *
- * written or collected and sometimes rewritten by
- * Magnus Damm <damm@bitsmart.com>
- *
- * minor modifications by
- * Wolfgang Denk <wd@denx.de>
- *
- * more modifications by
- * Josh Huber <huber@mclx.com>
- * added support for the 74xx series of cpus
- * added support for the 7xx series of cpus
- * made the code a little less hard-coded, and more auto-detectish
- */
-
-#include <common.h>
-#include <command.h>
-#include <74xx_7xx.h>
-#include <asm/cache.h>
-
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#include <fdt_support.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-cpu_t
-get_cpu_type(void)
-{
-       uint pvr = get_pvr();
-       cpu_t type;
-
-       type = CPU_UNKNOWN;
-
-       switch (PVR_VER(pvr)) {
-       case 0x000c:
-               type = CPU_7400;
-               break;
-       case 0x0008:
-               type = CPU_750;
-
-               if (((pvr >> 8) & 0xff) == 0x01) {
-                       type = CPU_750CX;       /* old CX (80100 and 8010x?)*/
-               } else if (((pvr >> 8) & 0xff) == 0x22) {
-                       type = CPU_750CX;       /* CX (82201,82202) and CXe (82214) */
-               } else if (((pvr >> 8) & 0xff) == 0x33) {
-                       type = CPU_750CX;       /* CXe (83311) */
-               } else if (((pvr >> 12) & 0xF) == 0x3) {
-                       type = CPU_755;
-               }
-               break;
-
-       case 0x7000:
-               type = CPU_750FX;
-               break;
-
-       case 0x7002:
-               type = CPU_750GX;
-               break;
-
-       case 0x800C:
-               type = CPU_7410;
-               break;
-
-       case 0x8000:
-               type = CPU_7450;
-               break;
-
-       case 0x8001:
-               type = CPU_7455;
-               break;
-
-       case 0x8002:
-               type = CPU_7457;
-               break;
-
-       case 0x8003:
-               type = CPU_7447A;
-               break;
-
-       case 0x8004:
-               type = CPU_7448;
-               break;
-
-       default:
-               break;
-       }
-
-       return type;
-}
-
-/* ------------------------------------------------------------------------- */
-
-#if !defined(CONFIG_BAB7xx)
-int checkcpu (void)
-{
-       uint type   = get_cpu_type();
-       uint pvr    = get_pvr();
-       ulong clock = gd->cpu_clk;
-       char buf[32];
-       char *str;
-
-       puts ("CPU:   ");
-
-       switch (type) {
-       case CPU_750CX:
-               printf ("750CX%s v%d.%d", (pvr&0xf0)?"e":"",
-                       (pvr>>8) & 0xf,
-                       pvr & 0xf);
-               goto    PR_CLK;
-
-       case CPU_750:
-               str = "750";
-               break;
-
-       case CPU_750FX:
-               str = "750FX";
-               break;
-
-       case CPU_750GX:
-               str = "750GX";
-               break;
-
-       case CPU_755:
-               str = "755";
-               break;
-
-       case CPU_7400:
-               str = "MPC7400";
-               break;
-
-       case CPU_7410:
-               str = "MPC7410";
-               break;
-
-       case CPU_7447A:
-               str = "MPC7447A";
-               break;
-
-       case CPU_7448:
-               str = "MPC7448";
-               break;
-
-       case CPU_7450:
-               str = "MPC7450";
-               break;
-
-       case CPU_7455:
-               str = "MPC7455";
-               break;
-
-       case CPU_7457:
-               str = "MPC7457";
-               break;
-
-       default:
-               printf("Unknown CPU -- PVR: 0x%08x\n", pvr);
-               return -1;
-       }
-
-       printf ("%s v%d.%d", str, (pvr >> 8) & 0xFF, pvr & 0xFF);
-PR_CLK:
-       printf (" @ %s MHz\n", strmhz(buf, clock));
-
-       return (0);
-}
-#endif
-/* these two functions are unimplemented currently [josh] */
-
-/* -------------------------------------------------------------------- */
-/* L1 i-cache                                                          */
-
-int
-checkicache(void)
-{
-       return 0; /* XXX */
-}
-
-/* -------------------------------------------------------------------- */
-/* L1 d-cache                                                          */
-
-int
-checkdcache(void)
-{
-       return 0; /* XXX */
-}
-
-/* -------------------------------------------------------------------- */
-
-static inline void
-soft_restart(unsigned long addr)
-{
-       /* SRR0 has system reset vector, SRR1 has default MSR value */
-       /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
-
-       __asm__ __volatile__ ("mtspr    26, %0"         :: "r" (addr));
-       __asm__ __volatile__ ("li       4, (1 << 6)"    ::: "r4");
-       __asm__ __volatile__ ("mtspr    27, 4");
-       __asm__ __volatile__ ("rfi");
-
-       while(1);       /* not reached */
-}
-
-
-#if !defined(CONFIG_BAB7xx)  && \
-    !defined(CONFIG_ELPPC)   && \
-    !defined(CONFIG_PPMC7XX)
-/* no generic way to do board reset. simply call soft_reset. */
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       ulong addr;
-       /* flush and disable I/D cache */
-       __asm__ __volatile__ ("mfspr    3, 1008"        ::: "r3");
-       __asm__ __volatile__ ("ori      5, 5, 0xcc00"   ::: "r5");
-       __asm__ __volatile__ ("ori      4, 3, 0xc00"    ::: "r4");
-       __asm__ __volatile__ ("andc     5, 3, 5"        ::: "r5");
-       __asm__ __volatile__ ("sync");
-       __asm__ __volatile__ ("mtspr    1008, 4");
-       __asm__ __volatile__ ("isync");
-       __asm__ __volatile__ ("sync");
-       __asm__ __volatile__ ("mtspr    1008, 5");
-       __asm__ __volatile__ ("isync");
-       __asm__ __volatile__ ("sync");
-
-#ifdef CONFIG_SYS_RESET_ADDRESS
-       addr = CONFIG_SYS_RESET_ADDRESS;
-#else
-       /*
-        * note: when CONFIG_SYS_MONITOR_BASE points to a RAM address,
-        * CONFIG_SYS_MONITOR_BASE - sizeof (ulong) is usually a valid
-        * address. Better pick an address known to be invalid on your
-        * system and assign it to CONFIG_SYS_RESET_ADDRESS.
-        */
-       addr = CONFIG_SYS_MONITOR_BASE - sizeof (ulong);
-#endif
-       soft_restart(addr);
-
-       /* not reached */
-       while(1)
-               ;
-
-       return 1;
-}
-#endif
-
-/* ------------------------------------------------------------------------- */
-
-/*
- * For the 7400 the TB clock runs at 1/4 the cpu bus speed.
- */
-#ifndef CONFIG_SYS_BUS_CLK
-#define        CONFIG_SYS_BUS_CLK gd->bus_clk
-#endif
-
-unsigned long get_tbclk(void)
-{
-       return CONFIG_SYS_BUS_CLK / 4;
-}
-
-/* ------------------------------------------------------------------------- */
-
-#if defined(CONFIG_WATCHDOG)
-#if !defined(CONFIG_BAB7xx)
-void
-watchdog_reset(void)
-{
-
-}
-#endif  /* !CONFIG_BAB7xx */
-#endif /* CONFIG_WATCHDOG */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef CONFIG_OF_LIBFDT
-void ft_cpu_setup(void *blob, bd_t *bd)
-{
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "timebase-frequency", bd->bi_busfreq / 4, 1);
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "bus-frequency", bd->bi_busfreq, 1);
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "clock-frequency", bd->bi_intfreq, 1);
-
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       fdt_fixup_ethernet(blob);
-}
-#endif
-/* ------------------------------------------------------------------------- */
diff --git a/arch/powerpc/cpu/74xx_7xx/cpu_init.c b/arch/powerpc/cpu/74xx_7xx/cpu_init.c
deleted file mode 100644 (file)
index a6a8788..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * cpu_init.c - low level cpu init
- *
- * there's really nothing going on here yet.  future work area?
- */
-
-#include <common.h>
-#include <74xx_7xx.h>
-
-/*
- * Breath some life into the CPU...
- *
- * there's basically nothing to do here since the memory controller
- * isn't on the CPU in this case.
- */
-void
-cpu_init_f (void)
-{
-       switch (get_cpu_type()) {
-       case CPU_7450:
-       case CPU_7455:
-       case CPU_7457:
-       case CPU_7447A:
-       case CPU_7448:
-               /* enable the timebase bit in HID0 */
-               set_hid0(get_hid0() | 0x4000000);
-               break;
-       default:
-               /* do nothing */
-               break;
-       }
-}
-
-/*
- * initialize higher level parts of CPU like timers
- */
-int cpu_init_r (void)
-{
-       return (0);
-}
diff --git a/arch/powerpc/cpu/74xx_7xx/interrupts.c b/arch/powerpc/cpu/74xx_7xx/interrupts.c
deleted file mode 100644 (file)
index a906243..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * interrupts.c - just enough support for the decrementer/timer
- */
-
-#include <common.h>
-#include <mpc8xx.h>
-#include <mpc8xx_irq.h>
-#include <asm/processor.h>
-#include <commproc.h>
-#include <command.h>
-
-int interrupt_init_cpu (unsigned *decrementer_count)
-{
-       debug("interrupt_init: GT main cause reg: %08x:%08x\n",
-              GTREGREAD(LOW_INTERRUPT_CAUSE_REGISTER),
-              GTREGREAD(HIGH_INTERRUPT_CAUSE_REGISTER));
-       debug("interrupt_init: ethernet cause regs: %08x %08x %08x\n",
-              GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER),
-              GTREGREAD(ETHERNET1_INTERRUPT_CAUSE_REGISTER),
-              GTREGREAD(ETHERNET2_INTERRUPT_CAUSE_REGISTER));
-       debug("interrupt_init: ethernet mask regs:  %08x %08x %08x\n",
-              GTREGREAD(ETHERNET0_INTERRUPT_MASK_REGISTER),
-              GTREGREAD(ETHERNET1_INTERRUPT_MASK_REGISTER),
-              GTREGREAD(ETHERNET2_INTERRUPT_MASK_REGISTER));
-       debug("interrupt_init: setting decrementer_count\n");
-
-       *decrementer_count = get_tbclk() / CONFIG_SYS_HZ;
-
-       return (0);
-}
-
-/****************************************************************************/
-
-/*
- * Handle external interrupts
- */
-void
-external_interrupt(struct pt_regs *regs)
-{
-       puts("external_interrupt (oops!)\n");
-}
-
-volatile ulong timestamp = 0;
-
-/*
- * timer_interrupt - gets called when the decrementer overflows,
- * with interrupts disabled.
- * Trivial implementation - no need to be really accurate.
- */
-void
-timer_interrupt_cpu (struct pt_regs *regs)
-{
-       /* nothing to do here */
-       return;
-}
-
-/****************************************************************************/
-
-/*
- * Install and free a interrupt handler.
- */
-
-void
-irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
-{
-
-}
-
-void
-irq_free_handler(int vec)
-{
-
-}
-
-/****************************************************************************/
-
-void
-do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[])
-{
-       puts("IRQ related functions are unimplemented currently.\n");
-}
diff --git a/arch/powerpc/cpu/74xx_7xx/io.S b/arch/powerpc/cpu/74xx_7xx/io.S
deleted file mode 100644 (file)
index 3b4b08a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *  Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
- *  Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
- *  Copyright (C) 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- *                     Andreas Heppel <aheppel@sysgo.de>
- *  Copyright (C) 2002 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <ppc_asm.tmpl>
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     in8 */
-/*  Description:  Input 8 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  in8
-in8:
-       lbz     r3,0(r3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     in16 */
-/*  Description:  Input 16 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  in16
-in16:
-       lhz     r3,0(r3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     in16r */
-/*  Description:  Input 16 bits and byte reverse */
-/* ------------------------------------------------------------------------------- */
-       .globl  in16r
-in16r:
-       lhbrx   r3,0,r3
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     in32 */
-/*  Description:  Input 32 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  in32
-in32:
-       lwz     3,0(3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     in32r */
-/*  Description:  Input 32 bits and byte reverse */
-/* ------------------------------------------------------------------------------- */
-    .globl  in32r
-in32r:
-       lwbrx   r3,0,r3
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     out8 */
-/*  Description:  Output 8 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  out8
-out8:
-       stb     r4,0(r3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     out16 */
-/*  Description:  Output 16 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  out16
-out16:
-       sth     r4,0(r3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     out16r */
-/*  Description:  Byte reverse and output 16 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  out16r
-out16r:
-       sthbrx  r4,0,r3
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     out32 */
-/*  Description:  Output 32 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  out32
-out32:
-       stw     r4,0(r3)
-       sync
-       blr
-
-/* ------------------------------------------------------------------------------- */
-/*  Function:     out32r */
-/*  Description:  Byte reverse and output 32 bits */
-/* ------------------------------------------------------------------------------- */
-       .globl  out32r
-out32r:
-       stwbrx  r4,0,r3
-       sync
-       blr
diff --git a/arch/powerpc/cpu/74xx_7xx/kgdb.S b/arch/powerpc/cpu/74xx_7xx/kgdb.S
deleted file mode 100644 (file)
index 42b3a76..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  Copyright (C) 2000 Murray Jensen <Murray.Jensen@cmst.csiro.au>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <command.h>
-#include <74xx_7xx.h>
-#include <version.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-#include <asm/cache.h>
-#include <asm/mmu.h>
-
-#if defined(CONFIG_CMD_KGDB)
-
- /*
- * cache flushing routines for kgdb
- */
-
-       .globl  kgdb_flush_cache_all
-kgdb_flush_cache_all:
-       lis     r3,0
-       addis   r4,r0,0x0040
-kgdb_flush_loop:
-       lwz     r5,0(r3)
-       addi    r3,r3,CONFIG_SYS_CACHELINE_SIZE
-       cmp     0,0,r3,r4
-       bne     kgdb_flush_loop
-       SYNC
-       mfspr   r3,1008
-       ori     r3,r3,0x8800
-       mtspr   1008,r3
-       sync
-       blr
-
-       .globl  kgdb_flush_cache_range
-kgdb_flush_cache_range:
-       li      r5,CONFIG_SYS_CACHELINE_SIZE-1
-       andc    r3,r3,r5
-       subf    r4,r3,r4
-       add     r4,r4,r5
-       srwi.   r4,r4,CONFIG_SYS_CACHELINE_SHIFT
-       beqlr
-       mtctr   r4
-       mr      r6,r3
-1:     dcbst   0,r3
-       addi    r3,r3,CONFIG_SYS_CACHELINE_SIZE
-       bdnz    1b
-       sync                            /* wait for dcbst's to get to ram */
-       mtctr   r4
-2:     icbi    0,r6
-       addi    r6,r6,CONFIG_SYS_CACHELINE_SIZE
-       bdnz    2b
-       SYNC
-       blr
-
-#endif
diff --git a/arch/powerpc/cpu/74xx_7xx/speed.c b/arch/powerpc/cpu/74xx_7xx/speed.c
deleted file mode 100644 (file)
index 5ffa41c..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * (C) Copyright 2000-2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <74xx_7xx.h>
-#include <asm/processor.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-extern unsigned long get_board_bus_clk (void);
-
-static const int hid1_multipliers_x_10[] = {
-       25,     /* 0000 - 2.5x */
-       75,     /* 0001 - 7.5x */
-       70,     /* 0010 - 7x */
-       10,     /* 0011 - bypass */
-       20,     /* 0100 - 2x */
-       65,     /* 0101 - 6.5x */
-       100,    /* 0110 - 10x */
-       45,     /* 0111 - 4.5x */
-       30,     /* 1000 - 3x */
-       55,     /* 1001 - 5.5x */
-       40,     /* 1010 - 4x */
-       50,     /* 1011 - 5x */
-       80,     /* 1100 - 8x */
-       60,     /* 1101 - 6x */
-       35,     /* 1110 - 3.5x */
-       0       /* 1111 - off */
-};
-
-/* PLL_CFG[0:4] table for cpu 7448/7447A/7455/7457 */
-static const int hid1_74xx_multipliers_x_10[] = {
-       115,    /* 00000 - 11.5x  */
-       170,    /* 00001 - 17x    */
-       75,     /* 00010 -  7.5x  */
-       150,    /* 00011 - 15x    */
-       70,     /* 00100 -  7x    */
-       180,    /* 00101 - 18x    */
-       10,     /* 00110 - bypass */
-       200,    /* 00111 - 20x    */
-       20,     /* 01000 -  2x    */
-       210,    /* 01001 - 21x    */
-       65,     /* 01010 -  6.5x  */
-       130,    /* 01011 - 13x    */
-       85,     /* 01100 -  8.5x  */
-       240,    /* 01101 - 24x    */
-       95,     /* 01110 -  9.5x  */
-       90,     /* 01111 -  9x    */
-       30,     /* 10000 -  3x    */
-       105,    /* 10001 - 10.5x  */
-       55,     /* 10010 -  5.5x  */
-       110,    /* 10011 - 11x    */
-       40,     /* 10100 -  4x    */
-       100,    /* 10101 - 10x    */
-       50,     /* 10110 -  5x    */
-       120,    /* 10111 - 12x    */
-       80,     /* 11000 -  8x    */
-       140,    /* 11001 - 14x    */
-       60,     /* 11010 -  6x    */
-       160,    /* 11011 - 16x    */
-       135,    /* 11100 - 13.5x  */
-       280,    /* 11101 - 28x    */
-       0,      /* 11110 - off    */
-       125     /* 11111 - 12.5x  */
-};
-
-static const int hid1_fx_multipliers_x_10[] = {
-       00,     /* 0000 - off */
-       00,     /* 0001 - off */
-       10,     /* 0010 - bypass */
-       10,     /* 0011 - bypass */
-       20,     /* 0100 - 2x */
-       25,     /* 0101 - 2.5x */
-       30,     /* 0110 - 3x */
-       35,     /* 0111 - 3.5x */
-       40,     /* 1000 - 4x */
-       45,     /* 1001 - 4.5x */
-       50,     /* 1010 - 5x */
-       55,     /* 1011 - 5.5x */
-       60,     /* 1100 - 6x */
-       65,     /* 1101 - 6.5x */
-       70,     /* 1110 - 7x */
-       75,     /* 1111 - 7.5 */
-       80,     /* 10000 - 8x */
-       85,     /* 10001 - 8.5x */
-       90,     /* 10010 - 9x */
-       95,     /* 10011 - 9.5x */
-       100,    /* 10100 - 10x */
-       110,    /* 10101 - 11x */
-       120,    /* 10110 - 12x */
-};
-
-
-/* ------------------------------------------------------------------------- */
-
-/*
- * Measure CPU clock speed (core clock GCLK1, GCLK2)
- *
- * (Approx. GCLK frequency in Hz)
- */
-
-int get_clocks (void)
-{
-       ulong clock = 0;
-
-#ifdef CONFIG_SYS_BUS_CLK
-       gd->bus_clk = CONFIG_SYS_BUS_CLK;       /* bus clock is a fixed frequency */
-#else
-       gd->bus_clk = get_board_bus_clk ();     /* bus clock is configurable */
-#endif
-
-       /* calculate the clock frequency based upon the CPU type */
-       switch (get_cpu_type()) {
-       case CPU_7447A:
-       case CPU_7448:
-       case CPU_7455:
-       case CPU_7457:
-               /*
-                * Make sure division is done before multiplication to prevent 32-bit
-                * arithmetic overflows which will cause a negative number
-                */
-               clock = (gd->bus_clk / 10) *
-                       hid1_74xx_multipliers_x_10[(get_hid1 () >> 12) & 0x1F];
-               break;
-
-       case CPU_750GX:
-       case CPU_750FX:
-               clock = (gd->bus_clk / 10) *
-                       hid1_fx_multipliers_x_10[get_hid1 () >> 27];
-               break;
-
-       case CPU_7450:
-       case CPU_740:
-       case CPU_740P:
-       case CPU_745:
-       case CPU_750CX:
-       case CPU_750:
-       case CPU_750P:
-       case CPU_755:
-       case CPU_7400:
-       case CPU_7410:
-               /*
-                * Make sure division is done before multiplication to prevent 32-bit
-                * arithmetic overflows which will cause a negative number
-                */
-               clock = (gd->bus_clk / 10) *
-                       hid1_multipliers_x_10[get_hid1 () >> 28];
-               break;
-
-       case CPU_UNKNOWN:
-              printf ("get_gclk_freq(): unknown CPU type\n");
-              clock = 0;
-              return (1);
-       }
-
-       gd->cpu_clk = clock;
-
-       return (0);
-}
-
-/* ------------------------------------------------------------------------- */
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
deleted file mode 100644 (file)
index 8393781..0000000
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- *  Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
- *  Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
- *  Copyright (C) 2000,2001,2002 Wolfgang Denk <wd@denx.de>
- *  Copyright (C) 2001  Josh Huber <huber@mclx.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*  U-Boot - Startup Code for PowerPC based Embedded Boards
- *
- *
- *  The processor starts at 0xfff00100 and the code is executed
- *  from flash. The code is organized to be at an other address
- *  in memory, but as long we don't jump around before relocating.
- *  board_init lies at a quite high address and when the cpu has
- *  jumped there, everything is ok.
- */
-#include <asm-offsets.h>
-#include <config.h>
-#include <74xx_7xx.h>
-#include <version.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-#include <asm/cache.h>
-#include <asm/mmu.h>
-#include <asm/u-boot.h>
-
-/* We don't want the  MMU yet.
-*/
-#undef MSR_KERNEL
-/* Machine Check and Recoverable Interr. */
-#define MSR_KERNEL ( MSR_ME | MSR_RI )
-
-/*
- * Set up GOT: Global Offset Table
- *
- * Use r12 to access the GOT
- */
-       START_GOT
-       GOT_ENTRY(_GOT2_TABLE_)
-       GOT_ENTRY(_FIXUP_TABLE_)
-
-       GOT_ENTRY(_start)
-       GOT_ENTRY(_start_of_vectors)
-       GOT_ENTRY(_end_of_vectors)
-       GOT_ENTRY(transfer_to_handler)
-
-       GOT_ENTRY(__init_end)
-       GOT_ENTRY(__bss_end)
-       GOT_ENTRY(__bss_start)
-       END_GOT
-
-/*
- * r3 - 1st arg to board_init(): IMMP pointer
- * r4 - 2nd arg to board_init(): boot flag
- */
-       .text
-       .long   0x27051956              /* U-Boot Magic Number          */
-       .globl  version_string
-version_string:
-       .ascii U_BOOT_VERSION_STRING, "\0"
-
-       . = EXC_OFF_SYS_RESET
-       .globl  _start
-_start:
-       b       boot_cold
-
-       /* the boot code is located below the exception table */
-
-       .globl  _start_of_vectors
-_start_of_vectors:
-
-/* Machine check */
-       STD_EXCEPTION(0x200, MachineCheck, MachineCheckException)
-
-/* Data Storage exception.  "Never" generated on the 860. */
-       STD_EXCEPTION(0x300, DataStorage, UnknownException)
-
-/* Instruction Storage exception.  "Never" generated on the 860. */
-       STD_EXCEPTION(0x400, InstStorage, UnknownException)
-
-/* External Interrupt exception. */
-       STD_EXCEPTION(0x500, ExtInterrupt, external_interrupt)
-
-/* Alignment exception. */
-       . = 0x600
-Alignment:
-       EXCEPTION_PROLOG(SRR0, SRR1)
-       mfspr   r4,DAR
-       stw     r4,_DAR(r21)
-       mfspr   r5,DSISR
-       stw     r5,_DSISR(r21)
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       EXC_XFER_TEMPLATE(Alignment, AlignmentException, MSR_KERNEL, COPY_EE)
-
-/* Program check exception */
-       . = 0x700
-ProgramCheck:
-       EXCEPTION_PROLOG(SRR0, SRR1)
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       EXC_XFER_TEMPLATE(ProgramCheck, ProgramCheckException,
-               MSR_KERNEL, COPY_EE)
-
-       /* No FPU on MPC8xx.  This exception is not supposed to happen.
-       */
-       STD_EXCEPTION(0x800, FPUnavailable, UnknownException)
-
-       /* I guess we could implement decrementer, and may have
-        * to someday for timekeeping.
-        */
-       STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
-       STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
-       STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
-       STD_EXCEPTION(0xc00, SystemCall, UnknownException)
-       STD_EXCEPTION(0xd00, SingleStep, UnknownException)
-
-       STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
-       STD_EXCEPTION(0xf00, Trap_0f, UnknownException)
-
-       /*
-        * On the MPC8xx, this is a software emulation interrupt. It
-        * occurs for all unimplemented and illegal instructions.
-        */
-       STD_EXCEPTION(0x1000, SoftEmu, SoftEmuException)
-
-       STD_EXCEPTION(0x1100, InstructionTLBMiss, UnknownException)
-       STD_EXCEPTION(0x1200, DataTLBMiss, UnknownException)
-       STD_EXCEPTION(0x1300, InstructionTLBError, UnknownException)
-       STD_EXCEPTION(0x1400, DataTLBError, UnknownException)
-
-       STD_EXCEPTION(0x1500, Reserved5, UnknownException)
-       STD_EXCEPTION(0x1600, Reserved6, UnknownException)
-       STD_EXCEPTION(0x1700, Reserved7, UnknownException)
-       STD_EXCEPTION(0x1800, Reserved8, UnknownException)
-       STD_EXCEPTION(0x1900, Reserved9, UnknownException)
-       STD_EXCEPTION(0x1a00, ReservedA, UnknownException)
-       STD_EXCEPTION(0x1b00, ReservedB, UnknownException)
-
-       STD_EXCEPTION(0x1c00, DataBreakpoint, UnknownException)
-       STD_EXCEPTION(0x1d00, InstructionBreakpoint, UnknownException)
-       STD_EXCEPTION(0x1e00, PeripheralBreakpoint, UnknownException)
-       STD_EXCEPTION(0x1f00, DevPortBreakpoint, UnknownException)
-
-       .globl  _end_of_vectors
-_end_of_vectors:
-
-       . = 0x2000
-
-boot_cold:
-       /* disable everything */
-       li      r0, 0
-       mtspr   HID0, r0
-       sync
-       mtmsr   0
-       bl      invalidate_bats
-       sync
-
-#ifdef CONFIG_SYS_L2
-       /* init the L2 cache */
-       addis   r3, r0, L2_INIT@h
-       ori     r3, r3, L2_INIT@l
-       sync
-       mtspr   l2cr, r3
-#endif
-#if defined(CONFIG_ALTIVEC) && defined(CONFIG_74xx)
-       .long   0x7e00066c
-               /*
-                * dssall instruction, gas doesn't have it yet
-                * ...for altivec, data stream stop all this probably
-                * isn't needed unless we warm (software) reboot U-Boot
-                */
-#endif
-
-#ifdef CONFIG_SYS_L2
-       /* invalidate the L2 cache */
-       bl      l2cache_invalidate
-       sync
-#endif
-#ifdef CONFIG_SYS_BOARD_ASM_INIT
-       /* do early init */
-       bl      board_asm_init
-#endif
-
-       /*
-        * Calculate absolute address in FLASH and jump there
-        *------------------------------------------------------*/
-       lis     r3, CONFIG_SYS_MONITOR_BASE@h
-       ori     r3, r3, CONFIG_SYS_MONITOR_BASE@l
-       addi    r3, r3, in_flash - _start + EXC_OFF_SYS_RESET
-       mtlr    r3
-       blr
-
-in_flash:
-       /* let the C-code set up the rest                       */
-       /*                                                      */
-       /* Be careful to keep code relocatable !                */
-       /*------------------------------------------------------*/
-
-       /* perform low-level init */
-       /* sdram init, galileo init, etc */
-       /* r3:  NHR bit from HID0 */
-
-       /* setup the bats */
-       bl      setup_bats
-       sync
-
-       /*
-        * Cache must be enabled here for stack-in-cache trick.
-        * This means we need to enable the BATS.
-        * This means:
-        *   1) for the EVB, original gt regs need to be mapped
-        *   2) need to have an IBAT for the 0xf region,
-        *      we are running there!
-        * Cache should be turned on after BATs, since by default
-        * everything is write-through.
-        * The init-mem BAT can be reused after reloc. The old
-        * gt-regs BAT can be reused after board_init_f calls
-        * board_early_init_f (EVB only).
-        */
-#if !defined(CONFIG_BAB7xx) && !defined(CONFIG_ELPPC) && !defined(CONFIG_P3Mx)
-       /* enable address translation */
-       bl      enable_addr_trans
-       sync
-
-       /* enable and invalidate the data cache */
-       bl      l1dcache_enable
-       sync
-#endif
-#ifdef CONFIG_SYS_INIT_RAM_LOCK
-       bl      lock_ram_in_cache
-       sync
-#endif
-
-       /* set up the stack pointer in our newly created
-        * cache-ram (r1) */
-       lis     r1, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@h
-       ori     r1, r1, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@l
-
-       li      r0, 0           /* Make room for stack frame header and */
-       stwu    r0, -4(r1)      /* clear final stack frame so that      */
-       stwu    r0, -4(r1)      /* stack backtraces terminate cleanly   */
-
-       GET_GOT                 /* initialize GOT access        */
-
-       /* run low-level CPU init code     (from Flash) */
-       bl      cpu_init_f
-       sync
-
-       /* run 1st part of board init code (from Flash)   */
-       bl      board_init_f
-       sync
-
-       /* NOTREACHED - board_init_f() does not return */
-
-       .globl  invalidate_bats
-invalidate_bats:
-       /* invalidate BATs */
-       mtspr   IBAT0U, r0
-       mtspr   IBAT1U, r0
-       mtspr   IBAT2U, r0
-       mtspr   IBAT3U, r0
-#ifdef CONFIG_HIGH_BATS
-       mtspr   IBAT4U, r0
-       mtspr   IBAT5U, r0
-       mtspr   IBAT6U, r0
-       mtspr   IBAT7U, r0
-#endif
-       isync
-       mtspr   DBAT0U, r0
-       mtspr   DBAT1U, r0
-       mtspr   DBAT2U, r0
-       mtspr   DBAT3U, r0
-#ifdef CONFIG_HIGH_BATS
-       mtspr   DBAT4U, r0
-       mtspr   DBAT5U, r0
-       mtspr   DBAT6U, r0
-       mtspr   DBAT7U, r0
-#endif
-       isync
-       sync
-       blr
-
-       /* setup_bats - set them up to some initial state */
-       .globl  setup_bats
-setup_bats:
-       addis   r0, r0, 0x0000
-
-       /* IBAT 0 */
-       addis   r4, r0, CONFIG_SYS_IBAT0L@h
-       ori     r4, r4, CONFIG_SYS_IBAT0L@l
-       addis   r3, r0, CONFIG_SYS_IBAT0U@h
-       ori     r3, r3, CONFIG_SYS_IBAT0U@l
-       mtspr   IBAT0L, r4
-       mtspr   IBAT0U, r3
-       isync
-
-       /* DBAT 0 */
-       addis   r4, r0, CONFIG_SYS_DBAT0L@h
-       ori     r4, r4, CONFIG_SYS_DBAT0L@l
-       addis   r3, r0, CONFIG_SYS_DBAT0U@h
-       ori     r3, r3, CONFIG_SYS_DBAT0U@l
-       mtspr   DBAT0L, r4
-       mtspr   DBAT0U, r3
-       isync
-
-       /* IBAT 1 */
-       addis   r4, r0, CONFIG_SYS_IBAT1L@h
-       ori     r4, r4, CONFIG_SYS_IBAT1L@l
-       addis   r3, r0, CONFIG_SYS_IBAT1U@h
-       ori     r3, r3, CONFIG_SYS_IBAT1U@l
-       mtspr   IBAT1L, r4
-       mtspr   IBAT1U, r3
-       isync
-
-       /* DBAT 1 */
-       addis   r4, r0, CONFIG_SYS_DBAT1L@h
-       ori     r4, r4, CONFIG_SYS_DBAT1L@l
-       addis   r3, r0, CONFIG_SYS_DBAT1U@h
-       ori     r3, r3, CONFIG_SYS_DBAT1U@l
-       mtspr   DBAT1L, r4
-       mtspr   DBAT1U, r3
-       isync
-
-       /* IBAT 2 */
-       addis   r4, r0, CONFIG_SYS_IBAT2L@h
-       ori     r4, r4, CONFIG_SYS_IBAT2L@l
-       addis   r3, r0, CONFIG_SYS_IBAT2U@h
-       ori     r3, r3, CONFIG_SYS_IBAT2U@l
-       mtspr   IBAT2L, r4
-       mtspr   IBAT2U, r3
-       isync
-
-       /* DBAT 2 */
-       addis   r4, r0, CONFIG_SYS_DBAT2L@h
-       ori     r4, r4, CONFIG_SYS_DBAT2L@l
-       addis   r3, r0, CONFIG_SYS_DBAT2U@h
-       ori     r3, r3, CONFIG_SYS_DBAT2U@l
-       mtspr   DBAT2L, r4
-       mtspr   DBAT2U, r3
-       isync
-
-       /* IBAT 3 */
-       addis   r4, r0, CONFIG_SYS_IBAT3L@h
-       ori     r4, r4, CONFIG_SYS_IBAT3L@l
-       addis   r3, r0, CONFIG_SYS_IBAT3U@h
-       ori     r3, r3, CONFIG_SYS_IBAT3U@l
-       mtspr   IBAT3L, r4
-       mtspr   IBAT3U, r3
-       isync
-
-       /* DBAT 3 */
-       addis   r4, r0, CONFIG_SYS_DBAT3L@h
-       ori     r4, r4, CONFIG_SYS_DBAT3L@l
-       addis   r3, r0, CONFIG_SYS_DBAT3U@h
-       ori     r3, r3, CONFIG_SYS_DBAT3U@l
-       mtspr   DBAT3L, r4
-       mtspr   DBAT3U, r3
-       isync
-
-#ifdef CONFIG_HIGH_BATS
-       /* IBAT 4 */
-       addis   r4, r0, CONFIG_SYS_IBAT4L@h
-       ori     r4, r4, CONFIG_SYS_IBAT4L@l
-       addis   r3, r0, CONFIG_SYS_IBAT4U@h
-       ori     r3, r3, CONFIG_SYS_IBAT4U@l
-       mtspr   IBAT4L, r4
-       mtspr   IBAT4U, r3
-       isync
-
-       /* DBAT 4 */
-       addis   r4, r0, CONFIG_SYS_DBAT4L@h
-       ori     r4, r4, CONFIG_SYS_DBAT4L@l
-       addis   r3, r0, CONFIG_SYS_DBAT4U@h
-       ori     r3, r3, CONFIG_SYS_DBAT4U@l
-       mtspr   DBAT4L, r4
-       mtspr   DBAT4U, r3
-       isync
-
-       /* IBAT 5 */
-       addis   r4, r0, CONFIG_SYS_IBAT5L@h
-       ori     r4, r4, CONFIG_SYS_IBAT5L@l
-       addis   r3, r0, CONFIG_SYS_IBAT5U@h
-       ori     r3, r3, CONFIG_SYS_IBAT5U@l
-       mtspr   IBAT5L, r4
-       mtspr   IBAT5U, r3
-       isync
-
-       /* DBAT 5 */
-       addis   r4, r0, CONFIG_SYS_DBAT5L@h
-       ori     r4, r4, CONFIG_SYS_DBAT5L@l
-       addis   r3, r0, CONFIG_SYS_DBAT5U@h
-       ori     r3, r3, CONFIG_SYS_DBAT5U@l
-       mtspr   DBAT5L, r4
-       mtspr   DBAT5U, r3
-       isync
-
-       /* IBAT 6 */
-       addis   r4, r0, CONFIG_SYS_IBAT6L@h
-       ori     r4, r4, CONFIG_SYS_IBAT6L@l
-       addis   r3, r0, CONFIG_SYS_IBAT6U@h
-       ori     r3, r3, CONFIG_SYS_IBAT6U@l
-       mtspr   IBAT6L, r4
-       mtspr   IBAT6U, r3
-       isync
-
-       /* DBAT 6 */
-       addis   r4, r0, CONFIG_SYS_DBAT6L@h
-       ori     r4, r4, CONFIG_SYS_DBAT6L@l
-       addis   r3, r0, CONFIG_SYS_DBAT6U@h
-       ori     r3, r3, CONFIG_SYS_DBAT6U@l
-       mtspr   DBAT6L, r4
-       mtspr   DBAT6U, r3
-       isync
-
-       /* IBAT 7 */
-       addis   r4, r0, CONFIG_SYS_IBAT7L@h
-       ori     r4, r4, CONFIG_SYS_IBAT7L@l
-       addis   r3, r0, CONFIG_SYS_IBAT7U@h
-       ori     r3, r3, CONFIG_SYS_IBAT7U@l
-       mtspr   IBAT7L, r4
-       mtspr   IBAT7U, r3
-       isync
-
-       /* DBAT 7 */
-       addis   r4, r0, CONFIG_SYS_DBAT7L@h
-       ori     r4, r4, CONFIG_SYS_DBAT7L@l
-       addis   r3, r0, CONFIG_SYS_DBAT7U@h
-       ori     r3, r3, CONFIG_SYS_DBAT7U@l
-       mtspr   DBAT7L, r4
-       mtspr   DBAT7U, r3
-       isync
-#endif
-
-       /* bats are done, now invalidate the TLBs */
-
-       addis   r3, 0, 0x0000
-       addis   r5, 0, 0x4    /* upper bound of 0x00040000 for 7400/750 */
-
-       isync
-
-tlblp:
-       tlbie   r3
-       sync
-       addi    r3, r3, 0x1000
-       cmp     0, 0, r3, r5
-       blt tlblp
-
-       blr
-
-       .globl enable_addr_trans
-enable_addr_trans:
-       /* enable address translation */
-       mfmsr   r5
-       ori     r5, r5, (MSR_IR | MSR_DR)
-       mtmsr   r5
-       isync
-       blr
-
-       .globl disable_addr_trans
-disable_addr_trans:
-       /* disable address translation */
-       mflr    r4
-       mfmsr   r3
-       andi.   r0, r3, (MSR_IR | MSR_DR)
-       beqlr
-       andc    r3, r3, r0
-       mtspr   SRR0, r4
-       mtspr   SRR1, r3
-       rfi
-
-/*
- * This code finishes saving the registers to the exception frame
- * and jumps to the appropriate handler for the exception.
- * Register r21 is pointer into trap frame, r1 has new stack pointer.
- */
-       .globl  transfer_to_handler
-transfer_to_handler:
-       stw     r22,_NIP(r21)
-       lis     r22,MSR_POW@h
-       andc    r23,r23,r22
-       stw     r23,_MSR(r21)
-       SAVE_GPR(7, r21)
-       SAVE_4GPRS(8, r21)
-       SAVE_8GPRS(12, r21)
-       SAVE_8GPRS(24, r21)
-       mflr    r23
-       andi.   r24,r23,0x3f00          /* get vector offset */
-       stw     r24,TRAP(r21)
-       li      r22,0
-       stw     r22,RESULT(r21)
-       mtspr   SPRG2,r22               /* r1 is now kernel sp */
-       lwz     r24,0(r23)              /* virtual address of handler */
-       lwz     r23,4(r23)              /* where to go when done */
-       mtspr   SRR0,r24
-       mtspr   SRR1,r20
-       mtlr    r23
-       SYNC
-       rfi                             /* jump to handler, enable MMU */
-
-int_return:
-       mfmsr   r28             /* Disable interrupts */
-       li      r4,0
-       ori     r4,r4,MSR_EE
-       andc    r28,r28,r4
-       SYNC                    /* Some chip revs need this... */
-       mtmsr   r28
-       SYNC
-       lwz     r2,_CTR(r1)
-       lwz     r0,_LINK(r1)
-       mtctr   r2
-       mtlr    r0
-       lwz     r2,_XER(r1)
-       lwz     r0,_CCR(r1)
-       mtspr   XER,r2
-       mtcrf   0xFF,r0
-       REST_10GPRS(3, r1)
-       REST_10GPRS(13, r1)
-       REST_8GPRS(23, r1)
-       REST_GPR(31, r1)
-       lwz     r2,_NIP(r1)     /* Restore environment */
-       lwz     r0,_MSR(r1)
-       mtspr   SRR0,r2
-       mtspr   SRR1,r0
-       lwz     r0,GPR0(r1)
-       lwz     r2,GPR2(r1)
-       lwz     r1,GPR1(r1)
-       SYNC
-       rfi
-
-       .globl  dc_read
-dc_read:
-       blr
-
-       .globl get_pvr
-get_pvr:
-       mfspr   r3, PVR
-       blr
-
-/*-----------------------------------------------------------------------*/
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- * r3 = dest
- * r4 = src
- * r5 = length in bytes
- * r6 = cachelinesize
- */
-       .globl  relocate_code
-relocate_code:
-       mr      r1,  r3         /* Set new stack pointer                */
-       mr      r9,  r4         /* Save copy of Global Data pointer     */
-       mr      r10, r5         /* Save copy of Destination Address     */
-
-       GET_GOT
-       mr      r3,  r5                         /* Destination Address  */
-       lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
-       ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
-       lwz     r5, GOT(__init_end)
-       sub     r5, r5, r4
-       li      r6, CONFIG_SYS_CACHELINE_SIZE           /* Cache Line Size      */
-
-       /*
-        * Fix GOT pointer:
-        *
-        * New GOT-PTR = (old GOT-PTR - CONFIG_SYS_MONITOR_BASE) + Destination Address
-        *
-        * Offset:
-        */
-       sub     r15, r10, r4
-
-       /* First our own GOT */
-       add     r12, r12, r15
-       /* then the one used by the C code */
-       add     r30, r30, r15
-
-       /*
-        * Now relocate code
-        */
-#ifdef CONFIG_ECC
-       bl      board_relocate_rom
-       sync
-       mr      r3, r10                         /* Destination Address  */
-       lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
-       ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l
-       lwz     r5, GOT(__init_end)
-       sub     r5, r5, r4
-       li      r6, CONFIG_SYS_CACHELINE_SIZE           /* Cache Line Size      */
-#else
-       cmplw   cr1,r3,r4
-       addi    r0,r5,3
-       srwi.   r0,r0,2
-       beq     cr1,4f          /* In place copy is not necessary       */
-       beq     7f              /* Protect against 0 count              */
-       mtctr   r0
-       bge     cr1,2f
-
-       la      r8,-4(r4)
-       la      r7,-4(r3)
-1:     lwzu    r0,4(r8)
-       stwu    r0,4(r7)
-       bdnz    1b
-       b       4f
-
-2:     slwi    r0,r0,2
-       add     r8,r4,r0
-       add     r7,r3,r0
-3:     lwzu    r0,-4(r8)
-       stwu    r0,-4(r7)
-       bdnz    3b
-#endif
-/*
- * Now flush the cache: note that we must start from a cache aligned
- * address. Otherwise we might miss one cache line.
- */
-4:     cmpwi   r6,0
-       add     r5,r3,r5
-       beq     7f              /* Always flush prefetch queue in any case */
-       subi    r0,r6,1
-       andc    r3,r3,r0
-       mr      r4,r3
-5:     dcbst   0,r4
-       add     r4,r4,r6
-       cmplw   r4,r5
-       blt     5b
-       sync                    /* Wait for all dcbst to complete on bus */
-       mr      r4,r3
-6:     icbi    0,r4
-       add     r4,r4,r6
-       cmplw   r4,r5
-       blt     6b
-7:     sync                    /* Wait for all icbi to complete on bus */
-       isync
-
-/*
- * We are done. Do not return, instead branch to second part of board
- * initialization, now running from RAM.
- */
-       addi    r0, r10, in_ram - _start + EXC_OFF_SYS_RESET
-       mtlr    r0
-       blr
-
-in_ram:
-#ifdef CONFIG_ECC
-       bl      board_init_ecc
-#endif
-       /*
-        * Relocation Function, r12 point to got2+0x8000
-        *
-        * Adjust got2 pointers, no need to check for 0, this code
-        * already puts a few entries in the table.
-        */
-       li      r0,__got2_entries@sectoff@l
-       la      r3,GOT(_GOT2_TABLE_)
-       lwz     r11,GOT(_GOT2_TABLE_)
-       mtctr   r0
-       sub     r11,r3,r11
-       addi    r3,r3,-4
-1:     lwzu    r0,4(r3)
-       cmpwi   r0,0
-       beq-    2f
-       add     r0,r0,r11
-       stw     r0,0(r3)
-2:     bdnz    1b
-
-       /*
-        * Now adjust the fixups and the pointers to the fixups
-        * in case we need to move ourselves again.
-        */
-       li      r0,__fixup_entries@sectoff@l
-       lwz     r3,GOT(_FIXUP_TABLE_)
-       cmpwi   r0,0
-       mtctr   r0
-       addi    r3,r3,-4
-       beq     4f
-3:     lwzu    r4,4(r3)
-       lwzux   r0,r4,r11
-       cmpwi   r0,0
-       add     r0,r0,r11
-       stw     r4,0(r3)
-       beq-    5f
-       stw     r0,0(r4)
-5:     bdnz    3b
-4:
-/* clear_bss: */
-       /*
-        * Now clear BSS segment
-        */
-       lwz     r3,GOT(__bss_start)
-       lwz     r4,GOT(__bss_end)
-
-       cmplw   0, r3, r4
-       beq     6f
-
-       li      r0, 0
-5:
-       stw     r0, 0(r3)
-       addi    r3, r3, 4
-       cmplw   0, r3, r4
-       bne     5b
-6:
-       mr      r3, r10         /* Destination Address          */
-#if defined(CONFIG_PPMC7XX)
-       mr      r4, r9          /* Use RAM copy of the global data */
-#endif
-       bl      after_reloc
-
-       /* not reached - end relocate_code */
-/*-----------------------------------------------------------------------*/
-
-       /*
-        * Copy exception vector code to low memory
-        *
-        * r3: dest_addr
-        * r7: source address, r8: end address, r9: target address
-        */
-       .globl  trap_init
-trap_init:
-       mflr    r4                      /* save link register           */
-       GET_GOT
-       lwz     r7, GOT(_start)
-       lwz     r8, GOT(_end_of_vectors)
-
-       li      r9, 0x100               /* reset vector always at 0x100 */
-
-       cmplw   0, r7, r8
-       bgelr                           /* return if r7>=r8 - just in case */
-1:
-       lwz     r0, 0(r7)
-       stw     r0, 0(r9)
-       addi    r7, r7, 4
-       addi    r9, r9, 4
-       cmplw   0, r7, r8
-       bne     1b
-
-       /*
-        * relocate `hdlr' and `int_return' entries
-        */
-       li      r7, .L_MachineCheck - _start + EXC_OFF_SYS_RESET
-       li      r8, Alignment - _start + EXC_OFF_SYS_RESET
-2:
-       bl      trap_reloc
-       addi    r7, r7, 0x100           /* next exception vector        */
-       cmplw   0, r7, r8
-       blt     2b
-
-       li      r7, .L_Alignment - _start + EXC_OFF_SYS_RESET
-       bl      trap_reloc
-
-       li      r7, .L_ProgramCheck - _start + EXC_OFF_SYS_RESET
-       bl      trap_reloc
-
-       li      r7, .L_FPUnavailable - _start + EXC_OFF_SYS_RESET
-       li      r8, SystemCall - _start + EXC_OFF_SYS_RESET
-3:
-       bl      trap_reloc
-       addi    r7, r7, 0x100           /* next exception vector        */
-       cmplw   0, r7, r8
-       blt     3b
-
-       li      r7, .L_SingleStep - _start + EXC_OFF_SYS_RESET
-       li      r8, _end_of_vectors - _start + EXC_OFF_SYS_RESET
-4:
-       bl      trap_reloc
-       addi    r7, r7, 0x100           /* next exception vector        */
-       cmplw   0, r7, r8
-       blt     4b
-
-       /* enable execptions from RAM vectors */
-       mfmsr   r7
-       li      r8,MSR_IP
-       andc    r7,r7,r8
-       mtmsr   r7
-
-       mtlr    r4                      /* restore link register        */
-       blr
-
-#ifdef CONFIG_SYS_INIT_RAM_LOCK
-lock_ram_in_cache:
-       /* Allocate Initial RAM in data cache.
-        */
-       lis     r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h
-       ori     r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l
-       li      r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \
-                    (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32
-       mtctr   r4
-1:
-       dcbz    r0, r3
-       addi    r3, r3, 32
-       bdnz    1b
-
-       /* Lock the data cache */
-       mfspr   r0, HID0
-       ori     r0, r0, 0x1000
-       sync
-       mtspr   HID0, r0
-       sync
-       blr
-
-.globl unlock_ram_in_cache
-unlock_ram_in_cache:
-       /* invalidate the INIT_RAM section */
-       lis     r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h
-       ori     r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l
-       li      r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \
-                    (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32
-       mtctr   r4
-1:     icbi    r0, r3
-       addi    r3, r3, 32
-       bdnz    1b
-       sync                    /* Wait for all icbi to complete on bus */
-       isync
-
-       /* Unlock the data cache and invalidate it */
-       mfspr   r0, HID0
-       li      r3,0x1000
-       andc    r0,r0,r3
-       li      r3,0x0400
-       or      r0,r0,r3
-       sync
-       mtspr   HID0, r0
-       sync
-       blr
-#endif
diff --git a/arch/powerpc/cpu/74xx_7xx/traps.c b/arch/powerpc/cpu/74xx_7xx/traps.c
deleted file mode 100644 (file)
index 111c86c..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * linux/arch/powerpc/kernel/traps.c
- *
- * Copyright (C) 1995-1996  Gary Thomas (gdt@linuxppc.org)
- *
- * Modified by Cort Dougan (cort@cs.nmt.edu)
- * and Paul Mackerras (paulus@cs.anu.edu.au)
- *
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * This file handles the architecture-dependent parts of hardware exceptions
- */
-
-#include <common.h>
-#include <command.h>
-#include <kgdb.h>
-#include <asm/processor.h>
-
-/* Returns 0 if exception not found and fixup otherwise.  */
-extern unsigned long search_exception_table(unsigned long);
-
-/* THIS NEEDS CHANGING to use the board info structure.
-*/
-#define END_OF_MEM     0x02000000
-
-/*
- * Trap & Exception support
- */
-
-static void print_backtrace(unsigned long *sp)
-{
-       int cnt = 0;
-       unsigned long i;
-
-       printf("Call backtrace: ");
-       while (sp) {
-               if ((uint)sp > END_OF_MEM)
-                       break;
-
-               i = sp[1];
-               if (cnt++ % 7 == 0)
-                       printf("\n");
-               printf("%08lX ", i);
-               if (cnt > 32) break;
-               sp = (unsigned long *)*sp;
-       }
-       printf("\n");
-}
-
-void show_regs(struct pt_regs *regs)
-{
-       int i;
-
-       printf("NIP: %08lX XER: %08lX LR: %08lX REGS:"
-              " %p TRAP: %04lx DAR: %08lX\n",
-              regs->nip, regs->xer, regs->link, regs, regs->trap, regs->dar);
-       printf("MSR: %08lx EE: %01x PR: %01x FP:"
-              " %01x ME: %01x IR/DR: %01x%01x\n",
-              regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0,
-              regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,
-              regs->msr&MSR_IR ? 1 : 0,
-              regs->msr&MSR_DR ? 1 : 0);
-
-       printf("\n");
-       for (i = 0;  i < 32;  i++) {
-               if ((i % 8) == 0)
-               {
-                       printf("GPR%02d: ", i);
-               }
-
-               printf("%08lX ", regs->gpr[i]);
-               if ((i % 8) == 7)
-               {
-                       printf("\n");
-               }
-       }
-}
-
-
-static void _exception(int signr, struct pt_regs *regs)
-{
-       show_regs(regs);
-       print_backtrace((unsigned long *)regs->gpr[1]);
-       panic("Exception in kernel pc %lx signal %d",regs->nip,signr);
-}
-
-void MachineCheckException(struct pt_regs *regs)
-{
-       unsigned long fixup;
-
-       /* Probing PCI using config cycles cause this exception
-        * when a device is not present.  Catch it and return to
-        * the PCI exception handler.
-        */
-       if ((fixup = search_exception_table(regs->nip)) != 0) {
-               regs->nip = fixup;
-               return;
-       }
-
-#if defined(CONFIG_CMD_KGDB)
-       if (debugger_exception_handler && (*debugger_exception_handler)(regs))
-               return;
-#endif
-
-       printf("Machine check in kernel mode.\n");
-       printf("Caused by (from msr): ");
-       printf("regs %p ",regs);
-       switch( regs->msr & 0x000F0000) {
-       case (0x80000000>>12):
-               printf("Machine check signal - probably due to mm fault\n"
-                       "with mmu off\n");
-               break;
-       case (0x80000000>>13):
-               printf("Transfer error ack signal\n");
-               break;
-       case (0x80000000>>14):
-               printf("Data parity signal\n");
-               break;
-       case (0x80000000>>15):
-               printf("Address parity signal\n");
-               break;
-       default:
-               printf("Unknown values in msr\n");
-       }
-       show_regs(regs);
-       print_backtrace((unsigned long *)regs->gpr[1]);
-       panic("machine check");
-}
-
-void AlignmentException(struct pt_regs *regs)
-{
-#if defined(CONFIG_CMD_KGDB)
-       if (debugger_exception_handler && (*debugger_exception_handler)(regs))
-               return;
-#endif
-       show_regs(regs);
-       print_backtrace((unsigned long *)regs->gpr[1]);
-       panic("Alignment Exception");
-}
-
-void ProgramCheckException(struct pt_regs *regs)
-{
-       unsigned char *p = regs ? (unsigned char *)(regs->nip) : NULL;
-       int i, j;
-
-#if defined(CONFIG_CMD_KGDB)
-       if (debugger_exception_handler && (*debugger_exception_handler)(regs))
-               return;
-#endif
-       show_regs(regs);
-
-       p = (unsigned char *) ((unsigned long)p & 0xFFFFFFE0);
-       p -= 32;
-       for (i = 0; i < 256; i+=16) {
-               printf("%08x: ", (unsigned int)p+i);
-               for (j = 0; j < 16; j++) {
-                       printf("%02x ", p[i+j]);
-               }
-               printf("\n");
-       }
-
-       print_backtrace((unsigned long *)regs->gpr[1]);
-       panic("Program Check Exception");
-}
-
-void SoftEmuException(struct pt_regs *regs)
-{
-#if defined(CONFIG_CMD_KGDB)
-       if (debugger_exception_handler && (*debugger_exception_handler)(regs))
-               return;
-#endif
-       show_regs(regs);
-       print_backtrace((unsigned long *)regs->gpr[1]);
-       panic("Software Emulation Exception");
-}
-
-void UnknownException(struct pt_regs *regs)
-{
-#if defined(CONFIG_CMD_KGDB)
-       if (debugger_exception_handler && (*debugger_exception_handler)(regs))
-               return;
-#endif
-       printf("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
-              regs->nip, regs->msr, regs->trap);
-       _exception(0, regs);
-}
-
-/* Probe an address by reading.  If not present, return -1, otherwise
- * return 0.
- */
-int addr_probe(uint *addr)
-{
-#if 0
-       int     retval;
-
-       __asm__ __volatile__(                   \
-               "1:     lwz %0,0(%1)\n"         \
-               "       eieio\n"                \
-               "       li %0,0\n"              \
-               "2:\n"                          \
-               ".section .fixup,\"ax\"\n"      \
-               "3:     li %0,-1\n"             \
-               "       b 2b\n"                 \
-               ".section __ex_table,\"a\"\n"   \
-               "       .align 2\n"             \
-               "       .long 1b,3b\n"          \
-               ".text"                         \
-               : "=r" (retval) : "r"(addr));
-
-       return (retval);
-#endif
-       return 0;
-}
diff --git a/arch/powerpc/cpu/74xx_7xx/u-boot.lds b/arch/powerpc/cpu/74xx_7xx/u-boot.lds
deleted file mode 100644 (file)
index c099849..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * (C) Copyright 2010 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-OUTPUT_ARCH(powerpc)
-
-SECTIONS
-{
-  .text      :
-  {
-    arch/powerpc/cpu/74xx_7xx/start.o  (.text*)
-
-    *(.text*)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    _GOT2_TABLE_ = .;
-    KEEP(*(.got2))
-    KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
-    _FIXUP_TABLE_ = .;
-    KEEP(*(.fixup))
-  }
-  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data*)
-    *(.sdata*)
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-
-  . = ALIGN(4);
-  .u_boot_list : {
-       KEEP(*(SORT(.u_boot_list*)));
-  }
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.bss*)
-   *(.sbss*)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end = . ;
-  PROVIDE (end = .);
-}
index e2e9cb77b0a7bf47cdd665e916de86266365ba1e..9da00dad735d77294d1090a154924a55ae1e7774 100644 (file)
@@ -26,9 +26,6 @@ config TARGET_CM5200
 config TARGET_GALAXY5200
        bool "Support galaxy5200"
 
-config TARGET_ICECUBE
-       bool "Support IceCube"
-
 config TARGET_INKA4X0
        bool "Support inka4x0"
 
@@ -44,24 +41,9 @@ config TARGET_MOTIONPRO
 config TARGET_MUNICES
        bool "Support munices"
 
-config TARGET_PM520
-       bool "Support PM520"
-
-config TARGET_TOTAL5200
-       bool "Support Total5200"
-
 config TARGET_V38B
        bool "Support v38b"
 
-config TARGET_CPCI5200
-       bool "Support cpci5200"
-
-config TARGET_MECP5200
-       bool "Support mecp5200"
-
-config TARGET_PF5200
-       bool "Support pf5200"
-
 config TARGET_O2D
        bool "Support O2D"
 
@@ -105,11 +87,7 @@ source "board/a4m072/Kconfig"
 source "board/bc3450/Kconfig"
 source "board/canmb/Kconfig"
 source "board/cm5200/Kconfig"
-source "board/esd/cpci5200/Kconfig"
-source "board/esd/mecp5200/Kconfig"
-source "board/esd/pf5200/Kconfig"
 source "board/galaxy5200/Kconfig"
-source "board/icecube/Kconfig"
 source "board/ifm/o2dnt2/Kconfig"
 source "board/inka4x0/Kconfig"
 source "board/intercontrol/digsy_mtc/Kconfig"
@@ -118,8 +96,6 @@ source "board/jupiter/Kconfig"
 source "board/motionpro/Kconfig"
 source "board/munices/Kconfig"
 source "board/phytec/pcm030/Kconfig"
-source "board/pm520/Kconfig"
-source "board/total5200/Kconfig"
 source "board/tqc/tqm5200/Kconfig"
 source "board/v38b/Kconfig"
 
index a89d5fd7a64cfe9faeac18f6f7d63bb4a66bae53..70b7e6e6cb4e00aa78ca74c9c8cee39abc5dcae0 100644 (file)
@@ -33,21 +33,7 @@ static int mpc5200_read_config_dword(struct pci_controller *hose,
        *(volatile u32 *)MPC5XXX_PCI_CAR = (1 << 31) | dev | offset;
        eieio();
        udelay(10);
-#if (defined CONFIG_PF5200 || defined CONFIG_CPCI5200)
-       if (dev & 0x00ff0000) {
-               u32 val;
-               val  = in_le16((volatile u16 *)(CONFIG_PCI_IO_PHYS+2));
-               udelay(10);
-               val = val << 16;
-               val |= in_le16((volatile u16 *)(CONFIG_PCI_IO_PHYS+0));
-               *value = val;
-       } else {
-               *value = in_le32((volatile u32 *)CONFIG_PCI_IO_PHYS);
-       }
-       udelay(10);
-#else
        *value = in_le32((volatile u32 *)CONFIG_PCI_IO_PHYS);
-#endif
        eieio();
        *(volatile u32 *)MPC5XXX_PCI_CAR = 0;
        udelay(10);
index 69a600cc4237c25e82a34db4955cad385cd70670..4d6cb0964bad2364cf064c59c78092993ee5279b 100644 (file)
@@ -41,12 +41,6 @@ config TARGET_MPC8349EMDS
 config TARGET_MPC8349ITX
        bool "Support MPC8349ITX"
 
-config TARGET_MPC8360EMDS
-       bool "Support MPC8360EMDS"
-
-config TARGET_MPC8360ERDK
-       bool "Support MPC8360ERDK"
-
 config TARGET_MPC837XEMDS
        bool "Support MPC837XEMDS"
 
@@ -81,8 +75,6 @@ source "board/freescale/mpc8323erdb/Kconfig"
 source "board/freescale/mpc832xemds/Kconfig"
 source "board/freescale/mpc8349emds/Kconfig"
 source "board/freescale/mpc8349itx/Kconfig"
-source "board/freescale/mpc8360emds/Kconfig"
-source "board/freescale/mpc8360erdk/Kconfig"
 source "board/freescale/mpc837xemds/Kconfig"
 source "board/freescale/mpc837xerdb/Kconfig"
 source "board/ids/ids8313/Kconfig"
index 7501eb4b82c5dff55d1f64b902bcb1c9353d104b..adb5bd378ce5a56eac394122263de1b3c5eba937 100644 (file)
@@ -85,11 +85,6 @@ config TARGET_P1022DS
 config TARGET_P1023RDB
        bool "Support P1023RDB"
 
-config TARGET_P1_P2_RDB
-       bool "Support P1_P2_RDB"
-       select SUPPORT_SPL
-       select SUPPORT_TPL
-
 config TARGET_P1_P2_RDB_PC
        bool "Support p1_p2_rdb_pc"
        select SUPPORT_SPL
@@ -98,12 +93,6 @@ config TARGET_P1_P2_RDB_PC
 config TARGET_P1_TWR
        bool "Support p1_twr"
 
-config TARGET_P2020COME
-       bool "Support P2020COME"
-
-config TARGET_P2020DS
-       bool "Support P2020DS"
-
 config TARGET_P2041RDB
        bool "Support P2041RDB"
 
@@ -184,11 +173,8 @@ source "board/freescale/mpc8572ds/Kconfig"
 source "board/freescale/p1010rdb/Kconfig"
 source "board/freescale/p1022ds/Kconfig"
 source "board/freescale/p1023rdb/Kconfig"
-source "board/freescale/p1_p2_rdb/Kconfig"
 source "board/freescale/p1_p2_rdb_pc/Kconfig"
 source "board/freescale/p1_twr/Kconfig"
-source "board/freescale/p2020come/Kconfig"
-source "board/freescale/p2020ds/Kconfig"
 source "board/freescale/p2041rdb/Kconfig"
 source "board/freescale/qemu-ppce500/Kconfig"
 source "board/freescale/t102xqds/Kconfig"
index 598f7bd92ee960c75e62628df52ec51634e79869..fd7f5fa7e135c165db7146f0fcc46dffc107704a 100644 (file)
@@ -57,7 +57,7 @@ struct liodn_id_table liodn_tbl[] = {
 
        SET_USB_LIODN(1, "fsl-usb2-dr", 553),
 
-       SET_PCI_LIODN(CONFIG_SYS_FSL_PCIE_COMPAT, 1, 148),
+       SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 1, 148),
 
        SET_DMA_LIODN(1, "fsl,elo3-dma", 147),
        SET_DMA_LIODN(2, "fsl,elo3-dma", 227),
index 85d32fc6128558ac8e169dc391b40b54c8d7b7e4..4cf8853b723af3093bf3db16145fb78b70376763 100644 (file)
@@ -424,7 +424,6 @@ void fsl_erratum_a007212_workaround(void)
 
 ulong cpu_init_f(void)
 {
-       ulong flag = 0;
        extern void m8560_cpm_reset (void);
 #if defined(CONFIG_SYS_DCSRBAR_PHYS) || \
        (defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET))
@@ -499,18 +498,11 @@ ulong cpu_init_f(void)
        in_be32(&gur->dcsrcr);
 #endif
 
-#ifdef CONFIG_SYS_DCSRBAR_PHYS
-#ifdef CONFIG_DEEP_SLEEP
-       /* disable the console if boot from deep sleep */
-       if (in_be32(&gur->scrtsr[0]) & (1 << 3))
-               flag = GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
-#endif
-#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
        fsl_erratum_a007212_workaround();
 #endif
 
-       return flag;
+       return 0;
 }
 
 /* Implement a dummy function for those platforms w/o SERDES */
index 5cfae470697ea1877f65d5795a5bc0ee892676a1..acb1353e5d207360e8f7c4e7caaeb25219d5f2ea 100644 (file)
 #include "fsl_corenet2_serdes.h"
 
 #ifdef CONFIG_SYS_FSL_SRDS_1
-static u64 serdes1_prtcl_map;
+static u8 serdes1_prtcl_map[SERDES_PRCTL_COUNT];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_2
-static u64 serdes2_prtcl_map;
+static u8 serdes2_prtcl_map[SERDES_PRCTL_COUNT];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_3
-static u64 serdes3_prtcl_map;
+static u8 serdes3_prtcl_map[SERDES_PRCTL_COUNT];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_4
-static u64 serdes4_prtcl_map;
+static u8 serdes4_prtcl_map[SERDES_PRCTL_COUNT];
 #endif
 
 #ifdef DEBUG
@@ -78,24 +78,30 @@ static const char *serdes_prtcl_str[] = {
        [INTERLAKEN] = "INTERLAKEN",
        [QSGMII_SW1_A] = "QSGMII_SW1_A",
        [QSGMII_SW1_B] = "QSGMII_SW1_B",
+       [SGMII_SW1_MAC1] = "SGMII_SW1_MAC1",
+       [SGMII_SW1_MAC2] = "SGMII_SW1_MAC2",
+       [SGMII_SW1_MAC3] = "SGMII_SW1_MAC3",
+       [SGMII_SW1_MAC4] = "SGMII_SW1_MAC4",
+       [SGMII_SW1_MAC5] = "SGMII_SW1_MAC5",
+       [SGMII_SW1_MAC6] = "SGMII_SW1_MAC6",
 };
 #endif
 
 int is_serdes_configured(enum srds_prtcl device)
 {
-       u64 ret = 0;
+       int ret = 0;
 
 #ifdef CONFIG_SYS_FSL_SRDS_1
-       ret |= (1ULL << device) & serdes1_prtcl_map;
+       ret |= serdes1_prtcl_map[device];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_2
-       ret |= (1ULL << device) & serdes2_prtcl_map;
+       ret |= serdes2_prtcl_map[device];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_3
-       ret |= (1ULL << device) & serdes3_prtcl_map;
+       ret |= serdes3_prtcl_map[device];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_4
-       ret |= (1ULL << device) & serdes4_prtcl_map;
+       ret |= serdes4_prtcl_map[device];
 #endif
 
        return !!ret;
@@ -171,12 +177,14 @@ int serdes_get_first_lane(u32 sd, enum srds_prtcl device)
 #define BCAP_OVD_MASK          0x10000000
 #define BYP_CAL_MASK           0x02000000
 
-u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift)
+void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
+               u8 serdes_prtcl_map[SERDES_PRCTL_COUNT])
 {
        ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       u64 serdes_prtcl_map = 0;
        u32 cfg;
        int lane;
+
+       memset(serdes_prtcl_map, 0, sizeof(serdes_prtcl_map));
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007186
        struct ccsr_sfp_regs  __iomem *sfp_regs =
                        (struct ccsr_sfp_regs __iomem *)(CONFIG_SYS_SFP_ADDR);
@@ -312,38 +320,43 @@ u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift)
 
        for (lane = 0; lane < SRDS_MAX_LANES; lane++) {
                enum srds_prtcl lane_prtcl = serdes_get_prtcl(sd, cfg, lane);
-               serdes_prtcl_map |= (1ULL << lane_prtcl);
+               if (unlikely(lane_prtcl >= SERDES_PRCTL_COUNT))
+                       debug("Unknown SerDes lane protocol %d\n", lane_prtcl);
+               else
+                       serdes_prtcl_map[lane_prtcl] = 1;
        }
-
-       return serdes_prtcl_map;
 }
 
 void fsl_serdes_init(void)
 {
 
 #ifdef CONFIG_SYS_FSL_SRDS_1
-       serdes1_prtcl_map = serdes_init(FSL_SRDS_1,
-               CONFIG_SYS_FSL_CORENET_SERDES_ADDR,
-               FSL_CORENET2_RCWSR4_SRDS1_PRTCL,
-               FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT);
+       serdes_init(FSL_SRDS_1,
+                   CONFIG_SYS_FSL_CORENET_SERDES_ADDR,
+                   FSL_CORENET2_RCWSR4_SRDS1_PRTCL,
+                   FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT,
+                   serdes1_prtcl_map);
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_2
-       serdes2_prtcl_map = serdes_init(FSL_SRDS_2,
-               CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_2 * 0x1000,
-               FSL_CORENET2_RCWSR4_SRDS2_PRTCL,
-               FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT);
+       serdes_init(FSL_SRDS_2,
+                   CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_2 * 0x1000,
+                   FSL_CORENET2_RCWSR4_SRDS2_PRTCL,
+                   FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT,
+                   serdes2_prtcl_map);
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_3
-       serdes3_prtcl_map = serdes_init(FSL_SRDS_3,
-               CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_3 * 0x1000,
-               FSL_CORENET2_RCWSR4_SRDS3_PRTCL,
-               FSL_CORENET2_RCWSR4_SRDS3_PRTCL_SHIFT);
+       serdes_init(FSL_SRDS_3,
+                   CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_3 * 0x1000,
+                   FSL_CORENET2_RCWSR4_SRDS3_PRTCL,
+                   FSL_CORENET2_RCWSR4_SRDS3_PRTCL_SHIFT,
+                   serdes3_prtcl_map);
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_4
-       serdes4_prtcl_map = serdes_init(FSL_SRDS_4,
-               CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_4 * 0x1000,
-               FSL_CORENET2_RCWSR4_SRDS4_PRTCL,
-               FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT);
+       serdes_init(FSL_SRDS_4,
+                   CONFIG_SYS_FSL_CORENET_SERDES_ADDR + FSL_SRDS_4 * 0x1000,
+                   FSL_CORENET2_RCWSR4_SRDS4_PRTCL,
+                   FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT,
+                   serdes4_prtcl_map);
 #endif
 
 }
index 7dc8385aa6a59297d5ac067c00696cbb2bc16074..2ba314a7f67043c5774c6e269efff25cb66a7f05 100644 (file)
@@ -11,6 +11,7 @@
 
 
 static u8 serdes_cfg_tbl[][4] = {
+       [0x40] = {PCIE1, PCIE1, PCIE1, PCIE1},
        [0xD5] = {QSGMII_FM1_A, PCIE3, PCIE2, PCIE1},
        [0xD6] = {QSGMII_FM1_A, PCIE3, PCIE2, SATA1},
        [0x95] = {XFI_FM1_MAC1, PCIE3, PCIE2, PCIE1},
@@ -20,6 +21,7 @@ static u8 serdes_cfg_tbl[][4] = {
        [0x56] = {PCIE1, PCIE3, PCIE2, SATA1},
        [0x5A] = {PCIE1, PCIE3, SGMII_FM1_DTSEC2, SATA1},
        [0x5B] = {PCIE1, PCIE3, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC1},
+       [0x5F] = {PCIE1, PCIE3, SGMII_2500_FM1_DTSEC2, SGMII_2500_FM1_DTSEC1},
        [0x6A] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC2, SATA1},
        [0x6B] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC1},
        [0x6F] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_2500_FM1_DTSEC2,
index d86bb2737246201e14a63508f2a6c8b3ab0b4015..d5dccd5cf22c7e957831944bcb260c60486f9dd7 100644 (file)
@@ -33,10 +33,10 @@ static u8 serdes_cfg_tbl[][SRDS_MAX_LANES] = {
                PCIE2, PCIE2, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5},
        [0x87] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2,
                PCIE2, PCIE3, PCIE4, SGMII_FM1_DTSEC5},
-       [0x89] = {PCIE1, QSGMII_SW1_A, QSGMII_SW1_A, QSGMII_SW1_A,
-               PCIE2, PCIE3, QSGMII_SW1_B, SATA1},
-       [0x8D] = {PCIE1, QSGMII_SW1_A, QSGMII_SW1_A, QSGMII_SW1_A,
-               PCIE2, QSGMII_SW1_B, QSGMII_SW1_B, QSGMII_SW1_B},
+       [0x89] = {PCIE1, SGMII_SW1_MAC3, SGMII_SW1_MAC1, SGMII_SW1_MAC2,
+               PCIE2, PCIE3, SGMII_SW1_MAC4, SATA1},
+       [0x8D] = {PCIE1, SGMII_SW1_MAC3, SGMII_SW1_MAC1, SGMII_SW1_MAC2,
+               PCIE2, SGMII_SW1_MAC6, SGMII_SW1_MAC4, SGMII_SW1_MAC5},
        [0x8F] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2,
                AURORA, NONE, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5},
        [0xA5] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2,
diff --git a/arch/powerpc/cpu/mpc8xx/u-boot.lds b/arch/powerpc/cpu/mpc8xx/u-boot.lds
deleted file mode 100644 (file)
index 0eb2fba..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * (C) Copyright 2000-2010
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-OUTPUT_ARCH(powerpc)
-
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .text      :
-  {
-    arch/powerpc/cpu/mpc8xx/start.o    (.text*)
-    arch/powerpc/cpu/mpc8xx/traps.o    (.text*)
-
-    *(.text*)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    _GOT2_TABLE_ = .;
-    KEEP(*(.got2))
-    KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
-    _FIXUP_TABLE_ = .;
-    KEEP(*(.fixup))
-  }
-  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data*)
-    *(.sdata*)
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-
-  . = ALIGN(4);
-  .u_boot_list : {
-       KEEP(*(SORT(.u_boot_list*)));
-  }
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.bss*)
-   *(.sbss*)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end = . ;
-  PROVIDE (end = .);
-}
index 2d28eb26552af73833018bd17660910dd9df1245..c92589fb9dd50e992fa02a83b5bfbd0fc8581d8d 100644 (file)
@@ -15,6 +15,7 @@
 #include <netdev.h>
 #include <asm/cache.h>
 #include <asm/io.h>
+#include <vsc9953.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -271,5 +272,9 @@ int cpu_eth_init(bd_t *bis)
 #ifdef CONFIG_FMAN_ENET
        fm_standard_init(bis);
 #endif
+
+#ifdef CONFIG_VSC9953
+       vsc9953_init(bis);
+#endif
        return 0;
 }
index 1c63f93f4d45c46c07ea14de0fab61ff141a9e50..9cc1676b6029494679b6d8c9ab5bd367bebee54f 100644 (file)
@@ -73,176 +73,6 @@ void ft_fixup_num_cores(void *blob) {
 }
 #endif /* defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) */
 
-/*
- * update crypto node properties to a specified revision of the SEC
- * called with sec_rev == 0 if not on an E processor
- */
-#if CONFIG_SYS_FSL_SEC_COMPAT == 2 /* SEC 2.x/3.x */
-void fdt_fixup_crypto_node(void *blob, int sec_rev)
-{
-       static const struct sec_rev_prop {
-               u32 sec_rev;
-               u32 num_channels;
-               u32 channel_fifo_len;
-               u32 exec_units_mask;
-               u32 descriptor_types_mask;
-       } sec_rev_prop_list [] = {
-               { 0x0200, 4, 24, 0x07e, 0x01010ebf }, /* SEC 2.0 */
-               { 0x0201, 4, 24, 0x0fe, 0x012b0ebf }, /* SEC 2.1 */
-               { 0x0202, 1, 24, 0x04c, 0x0122003f }, /* SEC 2.2 */
-               { 0x0204, 4, 24, 0x07e, 0x012b0ebf }, /* SEC 2.4 */
-               { 0x0300, 4, 24, 0x9fe, 0x03ab0ebf }, /* SEC 3.0 */
-               { 0x0301, 4, 24, 0xbfe, 0x03ab0ebf }, /* SEC 3.1 */
-               { 0x0303, 4, 24, 0x97c, 0x03a30abf }, /* SEC 3.3 */
-       };
-       static char compat_strlist[ARRAY_SIZE(sec_rev_prop_list) *
-                                  sizeof("fsl,secX.Y")];
-       int crypto_node, sec_idx, err;
-       char *p;
-       u32 val;
-
-       /* locate crypto node based on lowest common compatible */
-       crypto_node = fdt_node_offset_by_compatible(blob, -1, "fsl,sec2.0");
-       if (crypto_node == -FDT_ERR_NOTFOUND)
-               return;
-
-       /* delete it if not on an E-processor */
-       if (crypto_node > 0 && !sec_rev) {
-               fdt_del_node(blob, crypto_node);
-               return;
-       }
-
-       /* else we got called for possible uprev */
-       for (sec_idx = 0; sec_idx < ARRAY_SIZE(sec_rev_prop_list); sec_idx++)
-               if (sec_rev_prop_list[sec_idx].sec_rev == sec_rev)
-                       break;
-
-       if (sec_idx == ARRAY_SIZE(sec_rev_prop_list)) {
-               puts("warning: unknown SEC revision number\n");
-               return;
-       }
-
-       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].num_channels);
-       err = fdt_setprop(blob, crypto_node, "fsl,num-channels", &val, 4);
-       if (err < 0)
-               printf("WARNING: could not set crypto property: %s\n",
-                      fdt_strerror(err));
-
-       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].descriptor_types_mask);
-       err = fdt_setprop(blob, crypto_node, "fsl,descriptor-types-mask", &val, 4);
-       if (err < 0)
-               printf("WARNING: could not set crypto property: %s\n",
-                      fdt_strerror(err));
-
-       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].exec_units_mask);
-       err = fdt_setprop(blob, crypto_node, "fsl,exec-units-mask", &val, 4);
-       if (err < 0)
-               printf("WARNING: could not set crypto property: %s\n",
-                      fdt_strerror(err));
-
-       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].channel_fifo_len);
-       err = fdt_setprop(blob, crypto_node, "fsl,channel-fifo-len", &val, 4);
-       if (err < 0)
-               printf("WARNING: could not set crypto property: %s\n",
-                      fdt_strerror(err));
-
-       val = 0;
-       while (sec_idx >= 0) {
-               p = compat_strlist + val;
-               val += sprintf(p, "fsl,sec%d.%d",
-                       (sec_rev_prop_list[sec_idx].sec_rev & 0xff00) >> 8,
-                       sec_rev_prop_list[sec_idx].sec_rev & 0x00ff) + 1;
-               sec_idx--;
-       }
-       err = fdt_setprop(blob, crypto_node, "compatible", &compat_strlist, val);
-       if (err < 0)
-               printf("WARNING: could not set crypto property: %s\n",
-                      fdt_strerror(err));
-}
-#elif CONFIG_SYS_FSL_SEC_COMPAT >= 4  /* SEC4 */
-static u8 caam_get_era(void)
-{
-       static const struct {
-               u16 ip_id;
-               u8 maj_rev;
-               u8 era;
-       } caam_eras[] = {
-               {0x0A10, 1, 1},
-               {0x0A10, 2, 2},
-               {0x0A12, 1, 3},
-               {0x0A14, 1, 3},
-               {0x0A14, 2, 4},
-               {0x0A16, 1, 4},
-               {0x0A10, 3, 4},
-               {0x0A11, 1, 4},
-               {0x0A18, 1, 4},
-               {0x0A11, 2, 5},
-               {0x0A12, 2, 5},
-               {0x0A13, 1, 5},
-               {0x0A1C, 1, 5}
-       };
-
-       ccsr_sec_t __iomem *sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
-       u32 secvid_ms = sec_in32(&sec->secvid_ms);
-       u32 ccbvid = sec_in32(&sec->ccbvid);
-       u16 ip_id = (secvid_ms & SEC_SECVID_MS_IPID_MASK) >>
-                               SEC_SECVID_MS_IPID_SHIFT;
-       u8 maj_rev = (secvid_ms & SEC_SECVID_MS_MAJ_REV_MASK) >>
-                               SEC_SECVID_MS_MAJ_REV_SHIFT;
-       u8 era = (ccbvid & SEC_CCBVID_ERA_MASK) >> SEC_CCBVID_ERA_SHIFT;
-
-       int i;
-
-       if (era)        /* This is '0' prior to CAAM ERA-6 */
-               return era;
-
-       for (i = 0; i < ARRAY_SIZE(caam_eras); i++)
-               if (caam_eras[i].ip_id == ip_id &&
-                   caam_eras[i].maj_rev == maj_rev)
-                       return caam_eras[i].era;
-
-       return 0;
-}
-
-static void fdt_fixup_crypto_era(void *blob, u32 era)
-{
-       int err;
-       int crypto_node;
-
-       crypto_node = fdt_path_offset(blob, "crypto");
-       if (crypto_node < 0) {
-               printf("WARNING: Missing crypto node\n");
-               return;
-       }
-
-       err = fdt_setprop(blob, crypto_node, "fsl,sec-era", &era,
-                         sizeof(era));
-       if (err < 0) {
-               printf("ERROR: could not set fsl,sec-era property: %s\n",
-                      fdt_strerror(err));
-       }
-}
-
-void fdt_fixup_crypto_node(void *blob, int sec_rev)
-{
-       u8 era;
-
-       if (!sec_rev) {
-               fdt_del_node_and_alias(blob, "crypto");
-               return;
-       }
-
-       /* Add SEC ERA information in compatible */
-       era = caam_get_era();
-       if (era) {
-               fdt_fixup_crypto_era(blob, era);
-       } else {
-               printf("WARNING: Unable to get ERA for CAAM rev: %d\n",
-                       sec_rev);
-       }
-}
-#endif
-
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
        return fdt_setprop_string(blob, offset, "phy-connection-type",
index 33dc72585cb22b5737051d9b1d5d590ca500352f..b26ec2a611a7f9f373e09d08758c18390d234d87 100644 (file)
@@ -63,10 +63,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP)
 
-#if defined(CONFIG_PMC405)
-ushort pmc405_pci_subsys_deviceid(void);
-#endif
-
 /*#define DEBUG*/
 
 /*
index a40ae3b38af5d000f713f2c3a17a1ab5bf444eb9..5db5e346271d54f71e220315dd5e660112306bdf 100644 (file)
@@ -101,12 +101,6 @@ config TARGET_FX12MM
 config TARGET_V5FX30TEVAL
        bool "Support v5fx30teval"
 
-config TARGET_CATCENTER
-       bool "Support CATcenter"
-
-config TARGET_PPCHAMELEONEVB
-       bool "Support PPChameleonEVB"
-
 config TARGET_CPCI2DP
        bool "Support CPCI2DP"
 
@@ -199,7 +193,6 @@ source "board/avnet/fx12mm/Kconfig"
 source "board/avnet/v5fx30teval/Kconfig"
 source "board/csb272/Kconfig"
 source "board/csb472/Kconfig"
-source "board/dave/PPChameleonEVB/Kconfig"
 source "board/esd/cpci2dp/Kconfig"
 source "board/esd/cpci405/Kconfig"
 source "board/esd/plu405/Kconfig"
diff --git a/arch/powerpc/include/asm/arch-mpc85xx/gpio.h b/arch/powerpc/include/asm/arch-mpc85xx/gpio.h
new file mode 100644 (file)
index 0000000..8beed30
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Dummy header file to enable CONFIG_OF_CONTROL.
+ * If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
+ * It includes <asm/arch/gpio.h> via <asm/gpio.h>, so those SoCs that enable
+ * OF_CONTROL must have arch/gpio.h.
+ */
+
+#ifndef __ASM_ARCH_MX85XX_GPIO_H
+#define __ASM_ARCH_MX85XX_GPIO_H
+
+#endif
index 423a6fb8dc6419d3ef4020086777a9a3510a2011..65496d0d90a9a5c9a34e660257fca8bf6200ccae 100644 (file)
@@ -75,6 +75,7 @@
  * SEC (crypto unit) major compatible version determination
  */
 #if defined(CONFIG_MPC83xx)
+#define CONFIG_SYS_FSL_SEC_BE
 #define CONFIG_SYS_FSL_SEC_COMPAT      2
 #endif
 
index 14c6fc3cfec2eba879a9c0ed3d3b0faa84f92a5e..b4c0c99b39d68f0d812e91fff94f291cc9cbffe4 100644 (file)
@@ -12,6 +12,8 @@
 #define CONFIG_SYS_PBI_FLASH_BASE              0xc0000000
 #elif defined(CONFIG_BSC9132QDS)
 #define CONFIG_SYS_PBI_FLASH_BASE              0xc8000000
+#elif defined(CONFIG_C29XPCIE)
+#define CONFIG_SYS_PBI_FLASH_BASE              0xcc000000
 #else
 #define CONFIG_SYS_PBI_FLASH_BASE              0xce000000
 #endif
index 8e0e190003872928bc3814e028388a9b6e025029..45e248eba18e4713d1454ab99159339463ce18e1 100644 (file)
@@ -87,6 +87,13 @@ enum srds_prtcl {
        SGMII_2500_FM2_DTSEC6,
        SGMII_2500_FM2_DTSEC9,
        SGMII_2500_FM2_DTSEC10,
+       SGMII_SW1_MAC1,
+       SGMII_SW1_MAC2,
+       SGMII_SW1_MAC3,
+       SGMII_SW1_MAC4,
+       SGMII_SW1_MAC5,
+       SGMII_SW1_MAC6,
+       SERDES_PRCTL_COUNT      /* Keep this item the last one */
 };
 
 enum srds {
index 4430477f9aa6138d1453ff7f162fa087f7d2ca7d..c57d9c0fafbf1da2fe101525512fea78e29cae26 100644 (file)
@@ -100,9 +100,6 @@ struct arch_global_data {
 #if defined(CONFIG_4xx)
        u32 uart_clk;
 #endif /* CONFIG_4xx */
-#if defined(CONFIG_SYS_GT_6426x)
-       unsigned int mirror_hack[16];
-#endif
 #ifdef CONFIG_SYS_FPGA_COUNT
        unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
 #endif
index e6d5355f261fd9b6e4bd521fa141ccd61db22860..91645d36ee9afcaad5138d55bfaa5ac407fd969b 100644 (file)
@@ -346,13 +346,6 @@ void board_init_f(ulong bootflag)
 #ifdef CONFIG_PRAM
        ulong reg;
 #endif
-#ifdef CONFIG_DEEP_SLEEP
-       const ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       struct ccsr_scfg *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
-       u32 start_addr;
-       typedef void (*func_t)(void);
-       func_t kernel_resume;
-#endif
 
        /* Pointer is writable since we allocated a register for it */
        gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
@@ -372,20 +365,6 @@ void board_init_f(ulong bootflag)
                if ((*init_fnc_ptr) () != 0)
                        hang();
 
-#ifdef CONFIG_DEEP_SLEEP
-       /* Jump to kernel in deep sleep case */
-       if (in_be32(&gur->scrtsr[0]) & (1 << 3)) {
-               l2cache_init();
-#if defined(CONFIG_RAMBOOT_PBL)
-               disable_cpc_sram();
-#endif
-               enable_cpc();
-               start_addr = in_be32(&scfg->sparecr[1]);
-               kernel_resume = (func_t)start_addr;
-               kernel_resume();
-       }
-#endif
-
 #ifdef CONFIG_POST
        post_bootmode_init();
        post_run(NULL, POST_ROM | post_bootmode_get(NULL));
index 42353d80a847bc51eade86f414e72238a8a4916f..097f29a2901b7348171359c596ba53036a738d0f 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <os.h>
 #include <cli.h>
+#include <malloc.h>
 #include <asm/getopt.h>
 #include <asm/io.h>
 #include <asm/sections.h>
@@ -102,6 +103,25 @@ static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
 }
 SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
 
+static int sandbox_cmdline_cb_default_fdt(struct sandbox_state *state,
+                                         const char *arg)
+{
+       const char *fmt = "%s.dtb";
+       char *fname;
+       int len;
+
+       len = strlen(state->argv[0]) + strlen(fmt) + 1;
+       fname = os_malloc(len);
+       if (!fname)
+               return -ENOMEM;
+       snprintf(fname, len, fmt, state->argv[0]);
+       state->fdt_fname = fname;
+
+       return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(default_fdt, 'D', 0,
+               "Use the default u-boot.dtb control FDT in U-Boot directory");
+
 static int sandbox_cmdline_cb_interactive(struct sandbox_state *state,
                                          const char *arg)
 {
index 11748aec7990e1ff40f9d625842a154d8d278cc1..9ce31bf075832af6d62248a9bc05184969231093 100644 (file)
@@ -19,6 +19,7 @@
                colour = "cyan";
                sides = <3>;
                character = <83>;
+               light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
        };
        square {
                compatible = "demo-shape";
 
        cros-ec-keyb {
                compatible = "google,cros-ec-keyb";
-               google,key-rows = <8>;
-               google,key-columns = <13>;
-               google,repeat-delay-ms = <240>;
-               google,repeat-rate-ms = <30>;
+               keypad,num-rows = <8>;
+               keypad,num-columns = <13>;
                google,ghost-filter;
                /*
                 * Keymap entries take the form of 0xRRCCKKKK where
                        0x070b0067 0x070c0069>;
        };
 
-       gpio_a: gpios {
+       gpio_a: gpios@0 {
                gpio-controller;
                compatible = "sandbox,gpio";
                #gpio-cells = <1>;
                num-gpios = <20>;
        };
 
+       gpio_b: gpios@1 {
+               gpio-controller;
+               compatible = "sandbox,gpio";
+               #gpio-cells = <2>;
+               gpio-bank-name = "b";
+               num-gpios = <10>;
+       };
+
        i2c@0 {
                #address-cells = <1>;
                #size-cells = <0>;
index 35e6cdd74164fde67a1f95a06a0fe831927842ba..b6e870a7cbd4a95234a37eeca1acdd69ffc40037 100644 (file)
@@ -16,7 +16,6 @@
 obj-y += car.o
 obj-y += coreboot.o
 obj-y += tables.o
-obj-y += ipchecksum.o
 obj-y += sdram.o
 obj-y += timestamp.o
 obj-$(CONFIG_PCI) += pci.o
index 6d06d5af19e5f7f38ce19676f97a0ac25d1803cc..4cdd0d403530a17d3ac8dd9135d2564563aacf21 100644 (file)
@@ -99,3 +99,8 @@ void panic_puts(const char *str)
        while (*str)
                NS16550_putc(port, *str++);
 }
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/arch/x86/cpu/coreboot/ipchecksum.c b/arch/x86/cpu/coreboot/ipchecksum.c
deleted file mode 100644 (file)
index 3340872..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of the libpayload project.
- *
- * It has originally been taken from the FreeBSD project.
- *
- * Copyright (c) 2001 Charles Mott <cm@linktel.net>
- * Copyright (c) 2008 coresystems GmbH
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <linux/types.h>
-#include <linux/compiler.h>
-#include <asm/arch/ipchecksum.h>
-
-unsigned short ipchksum(const void *vptr, unsigned long nbytes)
-{
-       int sum, oddbyte;
-       const unsigned short *ptr = vptr;
-
-       sum = 0;
-       while (nbytes > 1) {
-               sum += *ptr++;
-               nbytes -= 2;
-       }
-       if (nbytes == 1) {
-               oddbyte = 0;
-               ((u8 *)&oddbyte)[0] = *(u8 *) ptr;
-               ((u8 *)&oddbyte)[1] = 0;
-               sum += oddbyte;
-       }
-       sum = (sum >> 16) + (sum & 0xffff);
-       sum += (sum >> 16);
-       return ~sum;
-}
index 92b75286b188f3e9f383582e05efb96cf578cc7c..2b12b19ba27750f41eca97201d1f41f5fabfda5c 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/ipchecksum.h>
+#include <net.h>
 #include <asm/arch/sysinfo.h>
 #include <asm/arch/tables.h>
 
@@ -131,11 +131,11 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
                return 0;
 
        /* Make sure the checksums match. */
-       if (ipchksum((u16 *) header, sizeof(*header)) != 0)
+       if (!ip_checksum_ok(header, sizeof(*header)))
                return -1;
 
-       if (ipchksum((u16 *) (ptr + sizeof(*header)),
-                    header->table_bytes) != header->table_checksum)
+       if (compute_ip_checksum(ptr + sizeof(*header), header->table_bytes) !=
+           header->table_checksum)
                return -1;
 
        /* Now, walk the tables. */
index 30e50696984eb7be9778b571b3c32fc586a2a302..ed7905c1d7cf24c9ad9350bcd38b3ff9c9c9c727 100644 (file)
@@ -223,6 +223,11 @@ static bool has_cpuid(void)
        return flag_is_changeable_p(X86_EFLAGS_ID);
 }
 
+static bool has_mtrr(void)
+{
+       return cpuid_edx(0x00000001) & (1 << 12) ? true : false;
+}
+
 static int build_vendor_name(char *vendor_name)
 {
        struct cpuid_result result;
@@ -318,6 +323,8 @@ int x86_cpu_init_f(void)
                gd->arch.x86_model = c.x86_model;
                gd->arch.x86_mask = c.x86_mask;
                gd->arch.x86_device = cpu.device;
+
+               gd->arch.has_mtrr = has_mtrr();
        }
 
        return 0;
index afca9579da29065bab64312c429b6a073039311f..e4595be3aeba81a9efee5d786929c0037143c1b1 100644 (file)
@@ -26,20 +26,6 @@ config CACHE_MRC_SIZE_KB
        int
        default 256
 
-config MRC_CACHE_BASE
-       hex
-       default 0xff800000
-
-config MRC_CACHE_LOCATION
-       hex
-       depends on !CHROMEOS
-       default 0x1ec000
-
-config MRC_CACHE_SIZE
-       hex
-       depends on !CHROMEOS
-       default 0x10000
-
 config DCACHE_RAM_BASE
        hex
        default 0xff7f0000
@@ -64,20 +50,6 @@ config CACHE_MRC_SIZE_KB
        int
        default 512
 
-config MRC_CACHE_BASE
-       hex
-       default 0xff800000
-
-config MRC_CACHE_LOCATION
-       hex
-       depends on !CHROMEOS
-       default 0x370000
-
-config MRC_CACHE_SIZE
-       hex
-       depends on !CHROMEOS
-       default 0x10000
-
 config DCACHE_RAM_BASE
        hex
        default 0xff7e0000
index 0c7efaec7ceed9c9d43aeb40b4cb5c2470d5d646..3576b83266b5b19e598408218920a21eec5a0f13 100644 (file)
@@ -14,6 +14,7 @@ obj-y += lpc.o
 obj-y += me_status.o
 obj-y += model_206ax.o
 obj-y += microcode_intel.o
+obj-y += mrccache.o
 obj-y += northbridge.o
 obj-y += pch.o
 obj-y += pci.o
diff --git a/arch/x86/cpu/ivybridge/mrccache.c b/arch/x86/cpu/ivybridge/mrccache.c
new file mode 100644 (file)
index 0000000..0f1a64b
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * From Coreboot src/southbridge/intel/bd82x6x/mrccache.c
+ *
+ * Copyright (C) 2014 Google Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <fdtdec.h>
+#include <net.h>
+#include <spi.h>
+#include <spi_flash.h>
+#include <asm/arch/mrccache.h>
+#include <asm/arch/sandybridge.h>
+
+static struct mrc_data_container *next_mrc_block(
+       struct mrc_data_container *mrc_cache)
+{
+       /* MRC data blocks are aligned within the region */
+       u32 mrc_size = sizeof(*mrc_cache) + mrc_cache->data_size;
+       if (mrc_size & (MRC_DATA_ALIGN - 1UL)) {
+               mrc_size &= ~(MRC_DATA_ALIGN - 1UL);
+               mrc_size += MRC_DATA_ALIGN;
+       }
+
+       u8 *region_ptr = (u8 *)mrc_cache;
+       region_ptr += mrc_size;
+       return (struct mrc_data_container *)region_ptr;
+}
+
+static int is_mrc_cache(struct mrc_data_container *cache)
+{
+       return cache && (cache->signature == MRC_DATA_SIGNATURE);
+}
+
+/*
+ * Find the largest index block in the MRC cache. Return NULL if none is
+ * found.
+ */
+struct mrc_data_container *mrccache_find_current(struct fmap_entry *entry)
+{
+       struct mrc_data_container *cache, *next;
+       ulong base_addr, end_addr;
+       uint id;
+
+       base_addr = (1ULL << 32) - CONFIG_ROM_SIZE + entry->offset;
+       end_addr = base_addr + entry->length;
+       cache = NULL;
+
+       /* Search for the last filled entry in the region */
+       for (id = 0, next = (struct mrc_data_container *)base_addr;
+            is_mrc_cache(next);
+            id++) {
+               cache = next;
+               next = next_mrc_block(next);
+               if ((ulong)next >= end_addr)
+                       break;
+       }
+
+       if (id-- == 0) {
+               debug("%s: No valid MRC cache found.\n", __func__);
+               return NULL;
+       }
+
+       /* Verify checksum */
+       if (cache->checksum != compute_ip_checksum(cache->data,
+                                                  cache->data_size)) {
+               printf("%s: MRC cache checksum mismatch\n", __func__);
+               return NULL;
+       }
+
+       debug("%s: picked entry %u from cache block\n", __func__, id);
+
+       return cache;
+}
+
+/**
+ * find_next_mrc_cache() - get next cache entry
+ *
+ * @entry:     MRC cache flash area
+ * @cache:     Entry to start from
+ *
+ * @return next cache entry if found, NULL if we got to the end
+ */
+static struct mrc_data_container *find_next_mrc_cache(struct fmap_entry *entry,
+               struct mrc_data_container *cache)
+{
+       ulong base_addr, end_addr;
+
+       base_addr = (1ULL << 32) - CONFIG_ROM_SIZE + entry->offset;
+       end_addr = base_addr + entry->length;
+
+       cache = next_mrc_block(cache);
+       if ((ulong)cache >= end_addr) {
+               /* Crossed the boundary */
+               cache = NULL;
+               debug("%s: no available entries found\n", __func__);
+       } else {
+               debug("%s: picked next entry from cache block at %p\n",
+                     __func__, cache);
+       }
+
+       return cache;
+}
+
+int mrccache_update(struct spi_flash *sf, struct fmap_entry *entry,
+                   struct mrc_data_container *cur)
+{
+       struct mrc_data_container *cache;
+       ulong offset;
+       ulong base_addr;
+       int ret;
+
+       /* Find the last used block */
+       base_addr = (1ULL << 32) - CONFIG_ROM_SIZE + entry->offset;
+       debug("Updating MRC cache data\n");
+       cache = mrccache_find_current(entry);
+       if (cache && (cache->data_size == cur->data_size) &&
+           (!memcmp(cache, cur, cache->data_size + sizeof(*cur)))) {
+               debug("MRC data in flash is up to date. No update\n");
+               return -EEXIST;
+       }
+
+       /* Move to the next block, which will be the first unused block */
+       if (cache)
+               cache = find_next_mrc_cache(entry, cache);
+
+       /*
+        * If we have got to the end, erase the entire mrc-cache area and start
+        * again at block 0.
+        */
+       if (!cache) {
+               debug("Erasing the MRC cache region of %x bytes at %x\n",
+                     entry->length, entry->offset);
+
+               ret = spi_flash_erase(sf, entry->offset, entry->length);
+               if (ret) {
+                       debug("Failed to erase flash region\n");
+                       return ret;
+               }
+               cache = (struct mrc_data_container *)base_addr;
+       }
+
+       /* Write the data out */
+       offset = (ulong)cache - base_addr + entry->offset;
+       debug("Write MRC cache update to flash at %lx\n", offset);
+       ret = spi_flash_write(sf, offset, cur->data_size + sizeof(*cur), cur);
+       if (ret) {
+               debug("Failed to write to SPI flash\n");
+               return ret;
+       }
+
+       return 0;
+}
index 95047359ffaca080dfaf3820d0d8c16ceefc9dfe..49634485f3e249cdba4ac793537506baac1ba2bb 100644 (file)
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
+#include <net.h>
+#include <rtc.h>
+#include <spi.h>
+#include <spi_flash.h>
 #include <asm/processor.h>
 #include <asm/gpio.h>
 #include <asm/global_data.h>
 #include <asm/mtrr.h>
 #include <asm/pci.h>
 #include <asm/arch/me.h>
+#include <asm/arch/mrccache.h>
 #include <asm/arch/pei_data.h>
 #include <asm/arch/pch.h>
 #include <asm/post.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define CMOS_OFFSET_MRC_SEED           152
+#define CMOS_OFFSET_MRC_SEED_S3                156
+#define CMOS_OFFSET_MRC_SEED_CHK       160
+
 /*
  * This function looks for the highest region of memory lower than 4GB which
  * has enough space for U-Boot where U-Boot is aligned on a page boundary.
@@ -80,6 +89,202 @@ void dram_init_banksize(void)
        }
 }
 
+static int get_mrc_entry(struct spi_flash **sfp, struct fmap_entry *entry)
+{
+       const void *blob = gd->fdt_blob;
+       int node, spi_node, mrc_node;
+       int upto;
+
+       /* Find the flash chip within the SPI controller node */
+       upto = 0;
+       spi_node = fdtdec_next_alias(blob, "spi", COMPAT_INTEL_ICH_SPI, &upto);
+       if (spi_node < 0)
+               return -ENOENT;
+       node = fdt_first_subnode(blob, spi_node);
+       if (node < 0)
+               return -ECHILD;
+
+       /* Find the place where we put the MRC cache */
+       mrc_node = fdt_subnode_offset(blob, node, "rw-mrc-cache");
+       if (mrc_node < 0)
+               return -EPERM;
+
+       if (fdtdec_read_fmap_entry(blob, mrc_node, "rm-mrc-cache", entry))
+               return -EINVAL;
+
+       if (sfp) {
+               *sfp = spi_flash_probe_fdt(blob, node, spi_node);
+               if (!*sfp)
+                       return -EBADF;
+       }
+
+       return 0;
+}
+
+static int read_seed_from_cmos(struct pei_data *pei_data)
+{
+       u16 c1, c2, checksum, seed_checksum;
+
+       /*
+        * Read scrambler seeds from CMOS RAM. We don't want to store them in
+        * SPI flash since they change on every boot and that would wear down
+        * the flash too much. So we store these in CMOS and the large MRC
+        * data in SPI flash.
+        */
+       pei_data->scrambler_seed = rtc_read32(CMOS_OFFSET_MRC_SEED);
+       debug("Read scrambler seed    0x%08x from CMOS 0x%02x\n",
+             pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED);
+
+       pei_data->scrambler_seed_s3 = rtc_read32(CMOS_OFFSET_MRC_SEED_S3);
+       debug("Read S3 scrambler seed 0x%08x from CMOS 0x%02x\n",
+             pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3);
+
+       /* Compute seed checksum and compare */
+       c1 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed,
+                                sizeof(u32));
+       c2 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed_s3,
+                                sizeof(u32));
+       checksum = add_ip_checksums(sizeof(u32), c1, c2);
+
+       seed_checksum = rtc_read8(CMOS_OFFSET_MRC_SEED_CHK);
+       seed_checksum |= rtc_read8(CMOS_OFFSET_MRC_SEED_CHK + 1) << 8;
+
+       if (checksum != seed_checksum) {
+               debug("%s: invalid seed checksum\n", __func__);
+               pei_data->scrambler_seed = 0;
+               pei_data->scrambler_seed_s3 = 0;
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static int prepare_mrc_cache(struct pei_data *pei_data)
+{
+       struct mrc_data_container *mrc_cache;
+       struct fmap_entry entry;
+       int ret;
+
+       ret = read_seed_from_cmos(pei_data);
+       if (ret)
+               return ret;
+       ret = get_mrc_entry(NULL, &entry);
+       if (ret)
+               return ret;
+       mrc_cache = mrccache_find_current(&entry);
+       if (!mrc_cache)
+               return -ENOENT;
+
+       /*
+        * TODO(sjg@chromium.org): Skip this for now as it causes boot
+        * problems
+        */
+       if (0) {
+               pei_data->mrc_input = mrc_cache->data;
+               pei_data->mrc_input_len = mrc_cache->data_size;
+       }
+       debug("%s: at %p, size %x checksum %04x\n", __func__,
+             pei_data->mrc_input, pei_data->mrc_input_len,
+             mrc_cache->checksum);
+
+       return 0;
+}
+
+static int build_mrc_data(struct mrc_data_container **datap)
+{
+       struct mrc_data_container *data;
+       int orig_len;
+       int output_len;
+
+       orig_len = gd->arch.mrc_output_len;
+       output_len = ALIGN(orig_len, 16);
+       data = malloc(output_len + sizeof(*data));
+       if (!data)
+               return -ENOMEM;
+       data->signature = MRC_DATA_SIGNATURE;
+       data->data_size = output_len;
+       data->reserved = 0;
+       memcpy(data->data, gd->arch.mrc_output, orig_len);
+
+       /* Zero the unused space in aligned buffer. */
+       if (output_len > orig_len)
+               memset(data->data + orig_len, 0, output_len - orig_len);
+
+       data->checksum = compute_ip_checksum(data->data, output_len);
+       *datap = data;
+
+       return 0;
+}
+
+static int write_seeds_to_cmos(struct pei_data *pei_data)
+{
+       u16 c1, c2, checksum;
+
+       /* Save the MRC seed values to CMOS */
+       rtc_write32(CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed);
+       debug("Save scrambler seed    0x%08x to CMOS 0x%02x\n",
+             pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED);
+
+       rtc_write32(CMOS_OFFSET_MRC_SEED_S3, pei_data->scrambler_seed_s3);
+       debug("Save s3 scrambler seed 0x%08x to CMOS 0x%02x\n",
+             pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3);
+
+       /* Save a simple checksum of the seed values */
+       c1 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed,
+                                sizeof(u32));
+       c2 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed_s3,
+                                sizeof(u32));
+       checksum = add_ip_checksums(sizeof(u32), c1, c2);
+
+       rtc_write8(CMOS_OFFSET_MRC_SEED_CHK, checksum & 0xff);
+       rtc_write8(CMOS_OFFSET_MRC_SEED_CHK + 1, (checksum >> 8) & 0xff);
+
+       return 0;
+}
+
+static int sdram_save_mrc_data(void)
+{
+       struct mrc_data_container *data;
+       struct fmap_entry entry;
+       struct spi_flash *sf;
+       int ret;
+
+       if (!gd->arch.mrc_output_len)
+               return 0;
+       debug("Saving %d bytes of MRC output data to SPI flash\n",
+             gd->arch.mrc_output_len);
+
+       ret = get_mrc_entry(&sf, &entry);
+       if (ret)
+               goto err_entry;
+       ret = build_mrc_data(&data);
+       if (ret)
+               goto err_data;
+       ret = mrccache_update(sf, &entry, data);
+       if (!ret)
+               debug("Saved MRC data with checksum %04x\n", data->checksum);
+
+       free(data);
+err_data:
+       spi_flash_free(sf);
+err_entry:
+       if (ret)
+               debug("%s: Failed: %d\n", __func__, ret);
+       return ret;
+}
+
+/* Use this hook to save our SDRAM parameters */
+int misc_init_r(void)
+{
+       int ret;
+
+       ret = sdram_save_mrc_data();
+       if (ret)
+               printf("Unable to save MRC data: %d\n", ret);
+
+       return 0;
+}
+
 static const char *const ecc_decoder[] = {
        "inactive",
        "active on IO",
@@ -142,6 +347,11 @@ static asmlinkage void console_tx_byte(unsigned char byte)
 #endif
 }
 
+static int recovery_mode_enabled(void)
+{
+       return false;
+}
+
 /**
  * Find the PEI executable in the ROM and execute it.
  *
@@ -166,6 +376,17 @@ int sdram_initialise(struct pei_data *pei_data)
 
        debug("Starting UEFI PEI System Agent\n");
 
+       /*
+        * Do not pass MRC data in for recovery mode boot,
+        * Always pass it in for S3 resume.
+        */
+       if (!recovery_mode_enabled() ||
+           pei_data->boot_mode == PEI_BOOT_RESUME) {
+               ret = prepare_mrc_cache(pei_data);
+               if (ret)
+                       debug("prepare_mrc_cache failed: %d\n", ret);
+       }
+
        /* If MRC data is not found we cannot continue S3 resume. */
        if (pei_data->boot_mode == PEI_BOOT_RESUME && !pei_data->mrc_input) {
                debug("Giving up in sdram_initialize: No MRC data\n");
@@ -216,6 +437,8 @@ int sdram_initialise(struct pei_data *pei_data)
        debug("System Agent Version %d.%d.%d Build %d\n",
              version >> 24 , (version >> 16) & 0xff,
              (version >> 8) & 0xff, version & 0xff);
+       debug("MCR output data length %#x at %p\n", pei_data->mrc_output_len,
+             pei_data->mrc_output);
 
        /*
         * Send ME init done for SandyBridge here.  This is done inside the
@@ -231,6 +454,36 @@ int sdram_initialise(struct pei_data *pei_data)
        post_system_agent_init(pei_data);
        report_memory_config();
 
+       /* S3 resume: don't save scrambler seed or MRC data */
+       if (pei_data->boot_mode != PEI_BOOT_RESUME) {
+               /*
+                * This will be copied to SDRAM in reserve_arch(), then written
+                * to SPI flash in sdram_save_mrc_data()
+                */
+               gd->arch.mrc_output = (char *)pei_data->mrc_output;
+               gd->arch.mrc_output_len = pei_data->mrc_output_len;
+               ret = write_seeds_to_cmos(pei_data);
+               if (ret)
+                       debug("Failed to write seeds to CMOS: %d\n", ret);
+       }
+
+       return 0;
+}
+
+int reserve_arch(void)
+{
+       u16 checksum;
+
+       checksum = compute_ip_checksum(gd->arch.mrc_output,
+                                      gd->arch.mrc_output_len);
+       debug("Saving %d bytes for MRC output data, checksum %04x\n",
+             gd->arch.mrc_output_len, checksum);
+       gd->start_addr_sp -= gd->arch.mrc_output_len;
+       memcpy((void *)gd->start_addr_sp, gd->arch.mrc_output,
+              gd->arch.mrc_output_len);
+       gd->arch.mrc_output = (char *)gd->start_addr_sp;
+       gd->start_addr_sp &= ~0xf;
+
        return 0;
 }
 
index d5a825d1815edbee282d4b12a7c90b4dedc3c09c..5d36b3e0204d63cd9a15d2829cd9c96d48100fe2 100644 (file)
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Prepare to adjust MTRRs */
 void mtrr_open(struct mtrr_state *state)
 {
+       if (!gd->arch.has_mtrr)
+               return;
+
        state->enable_cache = dcache_status();
 
        if (state->enable_cache)
@@ -31,6 +36,9 @@ void mtrr_open(struct mtrr_state *state)
 /* Clean up after adjusting MTRRs, and enable them */
 void mtrr_close(struct mtrr_state *state)
 {
+       if (!gd->arch.has_mtrr)
+               return;
+
        wrmsrl(MTRR_DEF_TYPE_MSR, state->deftype | MTRR_DEF_TYPE_EN);
        if (state->enable_cache)
                enable_caches();
@@ -43,6 +51,9 @@ int mtrr_commit(bool do_caches)
        uint64_t mask;
        int i;
 
+       if (!gd->arch.has_mtrr)
+               return -ENOSYS;
+
        mtrr_open(&state);
        for (i = 0; i < gd->arch.mtrr_req_count; i++, req++) {
                mask = ~(req->size - 1);
@@ -64,6 +75,9 @@ int mtrr_add_request(int type, uint64_t start, uint64_t size)
        struct mtrr_request *req;
        uint64_t mask;
 
+       if (!gd->arch.has_mtrr)
+               return -ENOSYS;
+
        if (gd->arch.mtrr_req_count == MAX_MTRR_REQUESTS)
                return -ENOSPC;
        req = &gd->arch.mtrr_req[gd->arch.mtrr_req_count++];
index 9550502e9ae8f58e79f24929945058a006924d4a..826e2b43615dbfd6775cd22ec08d58266a26913b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  U-boot - x86 Startup Code
+ *  U-Boot - x86 Startup Code
  *
  * (C) Copyright 2008-2011
  * Graeme Russ, <graeme.russ@gmail.com>
@@ -28,7 +28,7 @@ start16:
        movl    $GD_FLG_COLD_BOOT, %ebx
 
        xorl    %eax, %eax
-       movl    %eax, %cr3    /* Invalidate TLB */
+       movl    %eax, %cr3      /* Invalidate TLB */
 
        /* Turn off cache (this might require a 486-class CPU) */
        movl    %cr0, %eax
@@ -49,7 +49,7 @@ o32 cs        lgdt    gdt_ptr
        jmp     ff
 ff:
 
-       /* Finally restore BIST and jump to the 32bit initialization code */
+       /* Finally restore BIST and jump to the 32-bit initialization code */
        movw    $code32start, %ax
        movw    %ax, %bp
        movl    %ecx, %eax
@@ -64,17 +64,17 @@ idt_ptr:
        .word   0               /* limit */
        .long   0               /* base */
 
-/*
- * The following Global Descriptor Table is just enough to get us into
- * 'Flat Protected Mode' - It will be discarded as soon as the final
- * GDT is setup in a safe location in RAM
- */
+       /*
       * The following Global Descriptor Table is just enough to get us into
       * 'Flat Protected Mode' - It will be discarded as soon as the final
       * GDT is setup in a safe location in RAM
       */
 gdt_ptr:
        .word   0x1f            /* limit (31 bytes = 4 GDT entries - 1) */
        .long   BOOT_SEG + gdt  /* base */
 
-/* Some CPUs are picky about GDT alignment... */
-.align 16
+       /* Some CPUs are picky about GDT alignment... */
+       .align  16
 gdt:
        /*
         * The GDT table ...
index 9490b169fb52a3e30c48adca4bef6ffdb148d1f3..45ada610b348e84fd2b80f463a3aaedd6d6ebc88 100644 (file)
@@ -7,6 +7,10 @@
        model = "Google Link";
        compatible = "google,link", "intel,celeron-ivybridge";
 
+       aliases {
+               spi0 = "/spi";
+       };
+
        config {
               silent_console = <0>;
        };
        spi {
                #address-cells = <1>;
                #size-cells = <0>;
-               compatible = "intel,ich9";
+               compatible = "intel,ich-spi";
                spi-flash@0 {
+                       #size-cells = <1>;
+                       #address-cells = <1>;
                        reg = <0>;
                        compatible = "winbond,w25q64", "spi-flash";
                        memory-map = <0xff800000 0x00800000>;
+                       rw-mrc-cache {
+                               label = "rw-mrc-cache";
+                               /* Alignment: 4k (for updating) */
+                               reg = <0x003e0000 0x00010000>;
+                               type = "wiped";
+                               wipe-value = [ff];
+                       };
                };
        };
 
diff --git a/arch/x86/include/asm/arch-coreboot/ipchecksum.h b/arch/x86/include/asm/arch-coreboot/ipchecksum.h
deleted file mode 100644 (file)
index 1d73b4d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of the libpayload project.
- *
- * It has originally been taken from the FreeBSD project.
- *
- * Copyright (c) 2001 Charles Mott <cm@linktel.net>
- * Copyright (c) 2008 coresystems GmbH
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _COREBOOT_IPCHECKSUM_H
-#define _COREBOOT_IPCHECKSUM_H
-
-unsigned short ipchksum(const void *vptr, unsigned long nbytes);
-
-#endif
diff --git a/arch/x86/include/asm/arch-ivybridge/mrccache.h b/arch/x86/include/asm/arch-ivybridge/mrccache.h
new file mode 100644 (file)
index 0000000..968b2ef
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _ASM_ARCH_MRCCACHE_H
+#define _ASM_ARCH_MRCCACHE_H
+
+#define MRC_DATA_ALIGN         0x1000
+#define MRC_DATA_SIGNATURE     (('M' << 0) | ('R' << 8) | ('C' << 16) | \
+                                       ('D'<<24))
+
+__packed struct mrc_data_container {
+       u32     signature;      /* "MRCD" */
+       u32     data_size;      /* Size of the 'data' field */
+       u32     checksum;       /* IP style checksum */
+       u32     reserved;       /* For header alignment */
+       u8      data[0];        /* Variable size, platform/run time dependent */
+};
+
+struct fmap_entry;
+struct spi_flash;
+
+/**
+ * mrccache_find_current() - find the latest MRC cache record
+ *
+ * This searches the MRC cache region looking for the latest record to use
+ * for setting up SDRAM
+ *
+ * @entry:     Information about the position and size of the MRC cache
+ * @return pointer to latest record, or NULL if none
+ */
+struct mrc_data_container *mrccache_find_current(struct fmap_entry *entry);
+
+/**
+ * mrccache_update() - update the MRC cache with a new record
+ *
+ * This writes a new record to the end of the MRC cache. If the new record is
+ * the same as the latest record then the write is skipped
+ *
+ * @sf:                SPI flash to write to
+ * @entry:     Position and size of MRC cache in SPI flash
+ * @cur:       Record to write
+ * @return 0 if updated, -EEXIST if the record is the same as the latest
+ * record, other error if SPI write failed
+ */
+int mrccache_update(struct spi_flash *sf, struct fmap_entry *entry,
+                   struct mrc_data_container *cur);
+
+#endif
index 24e305239b2164c5a91cdbd73b8bbadd655557f3..5ee06eb70d97da4323ed00e66a3d718f759c9631 100644 (file)
@@ -44,11 +44,11 @@ struct mtrr_request {
 
 /* Architecture-specific global data */
 struct arch_global_data {
-       struct global_data *gd_addr;            /* Location of Global Data */
-       uint8_t  x86;                   /* CPU family */
-       uint8_t  x86_vendor;            /* CPU vendor */
-       uint8_t  x86_model;
-       uint8_t  x86_mask;
+       struct global_data *gd_addr;    /* Location of Global Data */
+       uint8_t x86;                    /* CPU family */
+       uint8_t x86_vendor;             /* CPU vendor */
+       uint8_t x86_model;
+       uint8_t x86_mask;
        uint32_t x86_device;
        uint64_t tsc_base;              /* Initial value returned by rdtsc() */
        uint32_t tsc_base_kclocks;      /* Initial tsc as a kclocks value */
@@ -60,10 +60,14 @@ struct arch_global_data {
        const struct pch_gpio_map *gpio_map;    /* board GPIO map */
        struct memory_info meminfo;     /* Memory information */
 #ifdef CONFIG_HAVE_FSP
-       void    *hob_list;              /* FSP HOB list */
+       void *hob_list;                 /* FSP HOB list */
 #endif
        struct mtrr_request mtrr_req[MAX_MTRR_REQUESTS];
        int mtrr_req_count;
+       int has_mtrr;
+       /* MRC training data to save for the next boot */
+       char *mrc_output;
+       unsigned int mrc_output_len;
 };
 
 #endif
index 3c1174043cf6f1c62c60db6cdce5d13ec6d887b3..fda4eae10d8f1262a67ed46aae5e6656b679bba2 100644 (file)
@@ -65,7 +65,6 @@ void mtrr_open(struct mtrr_state *state);
  *
  * @state:     Structure from mtrr_open()
  */
-/*  */
 void mtrr_close(struct mtrr_state *state);
 
 /**
@@ -76,6 +75,8 @@ void mtrr_close(struct mtrr_state *state);
  * @type:      Requested type (MTRR_TYPE_)
  * @start:     Start address
  * @size:      Size
+ *
+ * @return:    0 on success, non-zero on failure
  */
 int mtrr_add_request(int type, uint64_t start, uint64_t size);
 
@@ -86,6 +87,8 @@ int mtrr_add_request(int type, uint64_t start, uint64_t size);
  * It must be called with caches disabled.
  *
  * @do_caches: true if caches are currently on
+ *
+ * @return:    0 on success, non-zero on failure
  */
 int mtrr_commit(bool do_caches);
 
index 36145cb0a81552fe78aa5409100b22d93d097cb1..b98afa801d3a60849c58d01d3955965bbc5bc99d 100644 (file)
@@ -70,4 +70,6 @@ uint64_t timer_get_tsc(void);
 
 void quick_ram_check(void);
 
+#define PCI_VGA_RAM_IMAGE_START                0xc0000
+
 #endif /* _U_BOOT_I386_H_ */
index fc211d9d5c4924e6ed924154777e534c60177322..5097ca274a147f0965fc0935db69301945bc092a 100644 (file)
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <spi.h>
+#include <asm/errno.h>
 #include <asm/mtrr.h>
 #include <asm/sections.h>
 
@@ -71,7 +72,8 @@ int init_cache_f_r(void)
        int ret;
 
        ret = mtrr_commit(false);
-       if (ret)
+       /* If MTRR MSR is not implemented by the processor, just ignore it */
+       if (ret && ret != -ENOSYS)
                return ret;
 #endif
        /* Initialise the CPU cache(s) */
index 6bb22d25e8d8edd69f880abb2469ed6b6232e750..146ad11fb5373f3223d4ece682af0cf4ce4f8f83 100644 (file)
@@ -130,7 +130,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        printf("Interrupt-Information:\n");
        printf("Nr  Routine   Arg       Count\n");
 
-       for (irq = 0; irq <= CONFIG_SYS_NUM_IRQS; irq++) {
+       for (irq = 0; irq < CONFIG_SYS_NUM_IRQS; irq++) {
                if (irq_handlers[irq].handler != NULL) {
                        printf("%02d  %08lx  %08lx  %d\n",
                                        irq,
index 5e4778e97881dd35f6793ae108c3e82019938108..76ad7c443bb9285db808c6df97d02461e94a62ed 100644 (file)
@@ -98,7 +98,7 @@ int misc_init_r(void)
                                puts("Error: invalid MAC at EEPROM\n");
                }
        }
-       gd->jt[XF_do_reset] = (void *) do_reset;
+       gd->jt->do_reset = do_reset;
 
 #ifdef CONFIG_STATUS_LED
        status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
index 7ebea6317f70f320928a9d7705bfed878330a10f..7d5e7bee8b9a9c4c9a9bfc0280a898e9dfff6986 100644 (file)
@@ -1,4 +1,30 @@
-if TARGET_VEXPRESS_AEMV8A
+if TARGET_VEXPRESS64_AEMV8A
+
+config SYS_BOARD
+       default "vexpress64"
+
+config SYS_VENDOR
+       default "armltd"
+
+config SYS_CONFIG_NAME
+       default "vexpress_aemv8a"
+
+endif
+
+if TARGET_VEXPRESS64_BASE_FVP
+
+config SYS_BOARD
+       default "vexpress64"
+
+config SYS_VENDOR
+       default "armltd"
+
+config SYS_CONFIG_NAME
+       default "vexpress_aemv8a"
+
+endif
+
+if TARGET_VEXPRESS64_JUNO
 
 config SYS_BOARD
        default "vexpress64"
index 66c8dffa163420a647a5c65ae2f3d9817039a196..0ba044d7ff8711816df1ba8028de0df3aacc41bb 100644 (file)
@@ -9,3 +9,8 @@ VEXPRESS_AEMV8A_SEMI BOARD
 M:     Linus Walleij <linus.walleij@linaro.org>
 S:     Maintained
 F:     configs/vexpress_aemv8a_semi_defconfig
+
+JUNO DEVELOPMENT PLATFORM BOARD
+M:     Linus Walleij <linus.walleij@linaro.org>
+S:     Maintained
+F:     configs/vexpress_aemv8a_juno_defconfig
index 2758c5cbcd6ff777d6ca923a8cf092fbf689894b..1c5b92c8b580b7d5a433e95505e98fe1ed4117cc 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/atmel_usba_udc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
@@ -294,6 +295,9 @@ int board_init(void)
 #ifdef CONFIG_CMD_USB
        sama5d4_xplained_usb_hw_init();
 #endif
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+       at91_udp_hw_init();
+#endif
 
        return 0;
 }
@@ -313,5 +317,12 @@ int board_eth_init(bd_t *bis)
        rc = macb_eth_initialize(0, (void *)ATMEL_BASE_GMAC0, 0x00);
 #endif
 
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+       usba_udc_probe(&pdata);
+#ifdef CONFIG_USB_ETH_RNDIS
+       usb_eth_initialize(bis);
+#endif
+#endif
+
        return rc;
 }
index d3039c021af08f2724c63567b2016a0802bf3234..d8ff648957413c2ee618ea231d7a3a4aa96dfb41 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/atmel_usba_udc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
@@ -293,6 +294,9 @@ int board_init(void)
 #ifdef CONFIG_CMD_USB
        sama5d4ek_usb_hw_init();
 #endif
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+       at91_udp_hw_init();
+#endif
 
        return 0;
 }
@@ -312,5 +316,12 @@ int board_eth_init(bd_t *bis)
        rc = macb_eth_initialize(0, (void *)ATMEL_BASE_GMAC0, 0x00);
 #endif
 
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+       usba_udc_probe(&pdata);
+#ifdef CONFIG_USB_ETH_RNDIS
+       usb_eth_initialize(bis);
+#endif
+#endif
+
        return rc;
 }
index 86a0844273d64a28bb361709ed1107871c9d6c99..1704627112642027a42bf1f8f13bfd8436808d09 100644 (file)
@@ -55,12 +55,12 @@ void pmu_write(uchar reg, uchar data)
        struct udevice *dev;
        int ret;
 
-       ret = i2c_get_chip_for_busnum(4, PMU_I2C_ADDRESS, &dev);
+       ret = i2c_get_chip_for_busnum(4, PMU_I2C_ADDRESS, 1, &dev);
        if (ret) {
                debug("%s: Cannot find PMIC I2C chip\n", __func__);
                return;
        }
-       i2c_write(dev, reg, &data, 1);
+       dm_i2c_write(dev, reg, &data, 1);
 }
 
 /*
index 6fe937b4180fba98add32988d9820cc73d96680f..5b4b76f5b7329ca7b99e2da04272848a10f01fb4 100644 (file)
@@ -313,7 +313,6 @@ void board_init_f(ulong dummy)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
 
-       gd = &gdata;
        /*
         * We don't use DMA in SPL, but we do need it in U-Boot. U-Boot
         * initializes DMA very early (before all board code), so the only
diff --git a/board/dave/PPChameleonEVB/Kconfig b/board/dave/PPChameleonEVB/Kconfig
deleted file mode 100644 (file)
index bfe0011..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-if TARGET_CATCENTER
-
-config SYS_BOARD
-       default "PPChameleonEVB"
-
-config SYS_VENDOR
-       default "dave"
-
-config SYS_CONFIG_NAME
-       default "CATcenter"
-
-endif
-
-if TARGET_PPCHAMELEONEVB
-
-config SYS_BOARD
-       default "PPChameleonEVB"
-
-config SYS_VENDOR
-       default "dave"
-
-config SYS_CONFIG_NAME
-       default "PPChameleonEVB"
-
-endif
diff --git a/board/dave/PPChameleonEVB/MAINTAINERS b/board/dave/PPChameleonEVB/MAINTAINERS
deleted file mode 100644 (file)
index d43c6d0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-PPCHAMELEONEVB BOARD
-#M:    -
-S:     Maintained
-F:     board/dave/PPChameleonEVB/
-F:     include/configs/CATcenter.h
-F:     configs/CATcenter_defconfig
-F:     configs/CATcenter_25_defconfig
-F:     configs/CATcenter_33_defconfig
-
-PPCHAMELEONEVB BOARD
-M:     Andrea "llandre" Marson <andrea.marson@dave-tech.it>
-S:     Maintained
-F:     include/configs/PPChameleonEVB.h
-F:     configs/PPChameleonEVB_defconfig
-F:     configs/PPChameleonEVB_BA_25_defconfig
-F:     configs/PPChameleonEVB_BA_33_defconfig
-F:     configs/PPChameleonEVB_HI_25_defconfig
-F:     configs/PPChameleonEVB_HI_33_defconfig
-F:     configs/PPChameleonEVB_ME_25_defconfig
-F:     configs/PPChameleonEVB_ME_33_defconfig
diff --git a/board/dave/PPChameleonEVB/Makefile b/board/dave/PPChameleonEVB/Makefile
deleted file mode 100644 (file)
index 31edc4a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2000-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  = PPChameleonEVB.o flash.o nand.o
diff --git a/board/dave/PPChameleonEVB/PPChameleonEVB.c b/board/dave/PPChameleonEVB/PPChameleonEVB.c
deleted file mode 100644 (file)
index c9ab50e..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * (C) Copyright 2003
- * DAVE Srl
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:info@wawnet.biz
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/processor.h>
-#include <command.h>
-#include <malloc.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/* ------------------------------------------------------------------------- */
-
-int board_early_init_f (void)
-{
-       out32(GPIO0_OR, CONFIG_SYS_NAND0_CE);                 /* set initial outputs     */
-       out32(GPIO0_OR, CONFIG_SYS_NAND1_CE);                 /* set initial outputs     */
-
-       /*
-        * IRQ 0-15  405GP internally generated; active high; level sensitive
-        * IRQ 16    405GP internally generated; active low; level sensitive
-        * IRQ 17-24 RESERVED
-        * IRQ 25 (EXT IRQ 0)
-        * IRQ 26 (EXT IRQ 1)
-        * IRQ 27 (EXT IRQ 2)
-        * IRQ 28 (EXT IRQ 3)
-        * IRQ 29 (EXT IRQ 4)
-        * IRQ 30 (EXT IRQ 5)
-        * IRQ 31 (EXT IRQ 6)
-        */
-       mtdcr(UIC0SR, 0xFFFFFFFF);       /* clear all ints */
-       mtdcr(UIC0ER, 0x00000000);       /* disable all ints */
-       mtdcr(UIC0CR, 0x00000000);       /* set all to be non-critical*/
-       mtdcr(UIC0PR, 0xFFFFFF80);       /* set int polarities */
-       mtdcr(UIC0TR, 0x10000000);       /* set int trigger levels */
-       mtdcr(UIC0VCR, 0x00000001);      /* set vect base=0,INT0 highest priority*/
-       mtdcr(UIC0SR, 0xFFFFFFFF);       /* clear all ints */
-
-       /*
-        * EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
-        */
-#if 1 /* test-only */
-       mtebc (EBC0_CFG, 0xa8400000); /* ebc always driven */
-#else
-       mtebc (EBC0_CFG, 0x28400000); /* ebc in high-z */
-#endif
-       return 0;
-}
-
-/* ------------------------------------------------------------------------- */
-
-int misc_init_f (void)
-{
-       return 0;  /* dummy implementation */
-}
-
-extern flash_info_t flash_info[];      /* info for FLASH chips */
-
-int misc_init_r (void)
-{
-       /* adjust flash start and size as well as the offset */
-       gd->bd->bi_flashstart = 0 - flash_info[0].size;
-       gd->bd->bi_flashoffset= flash_info[0].size - CONFIG_SYS_MONITOR_LEN;
-#if 0
-       volatile unsigned short *fpga_mode =
-               (unsigned short *)((ulong)CONFIG_SYS_FPGA_BASE_ADDR + CONFIG_SYS_FPGA_CTRL);
-       volatile unsigned char *duart0_mcr =
-               (unsigned char *)((ulong)DUART0_BA + 4);
-       volatile unsigned char *duart1_mcr =
-               (unsigned char *)((ulong)DUART1_BA + 4);
-
-       bd_t *bd = gd->bd;
-       char *  tmp;                    /* Temporary char pointer      */
-       unsigned char *dst;
-       ulong len = sizeof(fpgadata);
-       int status;
-       int index;
-       int i;
-       unsigned long CPC0_CR0Reg;
-
-       dst = malloc(CONFIG_SYS_FPGA_MAX_SIZE);
-       if (gunzip (dst, CONFIG_SYS_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
-               printf ("GUNZIP ERROR - must RESET board to recover\n");
-               do_reset (NULL, 0, 0, NULL);
-       }
-
-       status = fpga_boot(dst, len);
-       if (status != 0) {
-               printf("\nFPGA: Booting failed ");
-               switch (status) {
-               case ERROR_FPGA_PRG_INIT_LOW:
-                       printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
-                       break;
-               case ERROR_FPGA_PRG_INIT_HIGH:
-                       printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
-                       break;
-               case ERROR_FPGA_PRG_DONE:
-                       printf("(Timeout: DONE not high after programming FPGA)\n ");
-                       break;
-               }
-
-               /* display infos on fpgaimage */
-               index = 15;
-               for (i=0; i<4; i++) {
-                       len = dst[index];
-                       printf("FPGA: %s\n", &(dst[index+1]));
-                       index += len+3;
-               }
-               putc ('\n');
-               /* delayed reboot */
-               for (i=20; i>0; i--) {
-                       printf("Rebooting in %2d seconds \r",i);
-                       for (index=0;index<1000;index++)
-                               udelay(1000);
-               }
-               putc ('\n');
-               do_reset(NULL, 0, 0, NULL);
-       }
-
-       puts("FPGA:  ");
-
-       /* display infos on fpgaimage */
-       index = 15;
-       for (i=0; i<4; i++) {
-               len = dst[index];
-               printf("%s ", &(dst[index+1]));
-               index += len+3;
-       }
-       putc ('\n');
-
-       free(dst);
-
-       /*
-        * Reset FPGA via FPGA_DATA pin
-        */
-       SET_FPGA(FPGA_PRG | FPGA_CLK);
-       udelay(1000); /* wait 1ms */
-       SET_FPGA(FPGA_PRG | FPGA_CLK | FPGA_DATA);
-       udelay(1000); /* wait 1ms */
-#endif
-
-#if 0
-       /*
-        * Enable power on PS/2 interface
-        */
-       *fpga_mode |= CONFIG_SYS_FPGA_CTRL_PS2_RESET;
-
-       /*
-        * Enable interrupts in exar duart mcr[3]
-        */
-       *duart0_mcr = 0x08;
-       *duart1_mcr = 0x08;
-#endif
-       return (0);
-}
-
-/*
- * Check Board Identity:
- */
-
-int checkboard (void)
-{
-       char str[64];
-       int i = getenv_f("serial#", str, sizeof(str));
-
-       puts ("Board: ");
-
-       if (i == -1) {
-               puts ("### No HW ID - assuming PPChameleonEVB");
-       } else {
-               puts(str);
-       }
-
-       putc ('\n');
-
-       return 0;
-}
-
-/* ------------------------------------------------------------------------- */
-
-int testdram (void)
-{
-       /* TODO: XXX XXX XXX */
-       printf ("test: 16 MB - ok\n");
-
-       return (0);
-}
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef CONFIG_CFB_CONSOLE
-# ifdef CONFIG_CONSOLE_EXTRA_INFO
-# include <video_fb.h>
-extern GraphicDevice smi;
-
-void video_get_info_str (int line_number, char *info)
-{
-       uint pvr = get_pvr ();
-
-       /* init video info strings for graphic console */
-       switch (line_number) {
-       case 1:
-               switch (pvr) {
-               case PVR_405EP_RB:
-                       sprintf (info, " AMCC PowerPC 405EP Rev. B");
-                       break;
-               default:
-                       sprintf (info, " AMCC PowerPC 405EP Rev. <unknown>");
-                       break;
-               }
-               return;
-       case 2:
-               sprintf (info, " DAVE Srl PPChameleonEVB - www.dave-tech.it");
-               return;
-       case 3:
-               sprintf (info, " %s", smi.modeIdent);
-               return;
-       }
-
-       /* no more info lines */
-       *info = 0;
-       return;
-}
-# endif        /* CONFIG_CONSOLE_EXTRA_INFO */
-#endif /* CONFIG_CFB_CONSOLE */
diff --git a/board/dave/PPChameleonEVB/flash.c b/board/dave/PPChameleonEVB/flash.c
deleted file mode 100644 (file)
index 771151b..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * (C) Copyright 2001
- * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/ppc4xx.h>
-#include <asm/processor.h>
-
-/*
- * include common flash code (for esd boards)
- */
-#include "../common/flash.c"
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-static ulong flash_get_size (vu_long * addr, flash_info_t * info);
-static void flash_get_offsets (ulong base, flash_info_t * info);
-
-/*-----------------------------------------------------------------------
- */
-
-unsigned long flash_init (void)
-{
-#ifdef __DEBUG_START_FROM_SRAM__
-       return CONFIG_SYS_DUMMY_FLASH_SIZE;
-#else
-       unsigned long size;
-       int i;
-       uint pbcr;
-       unsigned long base;
-       int size_val = 0;
-
-       debug("[%s, %d] Entering ...\n", __FUNCTION__, __LINE__);
-       debug("[%s, %d] flash_info = 0x%p ...\n", __func__, __LINE__,
-                                               flash_info);
-
-       /* Init: no FLASHes known */
-       for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-       }
-
-       /* Static FLASH Bank configuration here - FIXME XXX */
-
-       debug("[%s, %d] Calling flash_get_size ...\n", __FUNCTION__, __LINE__);
-       size = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
-
-       if (flash_info[0].flash_id == FLASH_UNKNOWN) {
-               printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-                       size, size<<20);
-       }
-
-       debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
-
-       /* Setup offsets */
-       flash_get_offsets (-size, &flash_info[0]);
-       debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
-
-       /* Re-do sizing to get full correct info */
-       mtdcr(EBC0_CFGADDR, PB0CR);
-       pbcr = mfdcr(EBC0_CFGDATA);
-       mtdcr(EBC0_CFGADDR, PB0CR);
-       base = -size;
-       switch (size) {
-       case 1 << 20:
-               size_val = 0;
-               break;
-       case 2 << 20:
-               size_val = 1;
-               break;
-       case 4 << 20:
-               size_val = 2;
-               break;
-       case 8 << 20:
-               size_val = 3;
-               break;
-       case 16 << 20:
-               size_val = 4;
-               break;
-       }
-       pbcr = (pbcr & 0x0001ffff) | base | (size_val << 17);
-       mtdcr(EBC0_CFGDATA, pbcr);
-       debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
-
-       /* Monitor protection ON by default */
-       (void)flash_protect(FLAG_PROTECT_SET,
-                           -CONFIG_SYS_MONITOR_LEN,
-                           0xffffffff,
-                           &flash_info[0]);
-
-       debug("[%s, %d] Test point ...\n", __FUNCTION__, __LINE__);
-       flash_info[0].size  = size;
-
-       return (size);
-#endif
-}
diff --git a/board/dave/PPChameleonEVB/nand.c b/board/dave/PPChameleonEVB/nand.c
deleted file mode 100644 (file)
index a191a0c..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * (C) Copyright 2006 DENX Software Engineering
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/io.h>
-
-#if defined(CONFIG_CMD_NAND)
-
-#include <nand.h>
-
-/*
- * hardware specific access to control-lines
- * function borrowed from Linux 2.6 (drivers/mtd/nand/ppchameleonevb.c)
- */
-static void ppchameleonevb_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-       struct nand_chip *this = mtd->priv;
-       ulong base = (ulong) this->IO_ADDR_W;
-
-       if (ctrl & NAND_CTRL_CHANGE) {
-               if ( ctrl & NAND_CLE )
-                       MACRO_NAND_CTL_SETCLE((unsigned long)base);
-               else
-                       MACRO_NAND_CTL_CLRCLE((unsigned long)base);
-               if ( ctrl & NAND_ALE )
-                       MACRO_NAND_CTL_CLRCLE((unsigned long)base);
-               else
-                       MACRO_NAND_CTL_CLRALE((unsigned long)base);
-               if ( ctrl & NAND_NCE )
-                       MACRO_NAND_ENABLE_CE((unsigned long)base);
-               else
-                       MACRO_NAND_DISABLE_CE((unsigned long)base);
-       }
-
-       if (cmd != NAND_CMD_NONE)
-               writeb(cmd, this->IO_ADDR_W);
-}
-
-
-/*
- * read device ready pin
- * function +/- borrowed from Linux 2.6 (drivers/mtd/nand/ppchameleonevb.c)
- */
-static int ppchameleonevb_device_ready(struct mtd_info *mtdinfo)
-{
-       struct nand_chip *this = mtdinfo->priv;
-       ulong rb_gpio_pin;
-
-       /* use the base addr to find out which chip are we dealing with */
-       switch((ulong) this->IO_ADDR_W) {
-       case CONFIG_SYS_NAND0_BASE:
-               rb_gpio_pin = CONFIG_SYS_NAND0_RDY;
-               break;
-       case CONFIG_SYS_NAND1_BASE:
-               rb_gpio_pin = CONFIG_SYS_NAND1_RDY;
-               break;
-       default: /* this should never happen */
-               return 0;
-               break;
-       }
-
-       if (in32(GPIO0_IR) & rb_gpio_pin)
-               return 1;
-       return 0;
-}
-
-
-/*
- * Board-specific NAND initialization. The following members of the
- * argument are board-specific (per include/linux/mtd/nand.h):
- * - IO_ADDR_R?: address to read the 8 I/O lines of the flash device
- * - IO_ADDR_W?: address to write the 8 I/O lines of the flash device
- * - cmd_ctrl: hardwarespecific function for accesing control-lines
- * - dev_ready: hardwarespecific function for  accesing device ready/busy line
- * - enable_hwecc?: function to enable (reset)  hardware ecc generator. Must
- *   only be provided if a hardware ECC is available
- * - ecc.mode: mode of ecc, see defines
- * - chip_delay: chip dependent delay for transfering data from array to
- *   read regs (tR)
- * - options: various chip options. They can partly be set to inform
- *   nand_scan about special functionality. See the defines for further
- *   explanation
- * Members with a "?" were not set in the merged testing-NAND branch,
- * so they are not set here either.
- */
-int board_nand_init(struct nand_chip *nand)
-{
-
-       nand->cmd_ctrl = ppchameleonevb_hwcontrol;
-       nand->dev_ready = ppchameleonevb_device_ready;
-       nand->ecc.mode = NAND_ECC_SOFT;
-       nand->chip_delay = NAND_BIG_DELAY_US;
-       nand->options = NAND_SAMSUNG_LP_OPTIONS;
-       return 0;
-}
-#endif
diff --git a/board/dave/PPChameleonEVB/u-boot.lds b/board/dave/PPChameleonEVB/u-boot.lds
deleted file mode 100644 (file)
index 94b7076..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2007-2009 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include "config.h"
-
-#ifndef RESET_VECTOR_ADDRESS
-#define RESET_VECTOR_ADDRESS   0xfffffffc
-#endif
-
-OUTPUT_ARCH(powerpc)
-
-PHDRS
-{
-  text PT_LOAD;
-  bss PT_LOAD;
-}
-
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .text      :
-  {
-    *(.text*)
-   } :text
-    _etext = .;
-    PROVIDE (etext = .);
-    .rodata    :
-   {
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  } :text
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    _GOT2_TABLE_ = .;
-    KEEP(*(.got2))
-    KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
-    _FIXUP_TABLE_ = .;
-    KEEP(*(.fixup))
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data*)
-    *(.sdata*)
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-
-  . = ALIGN(4);
-  .u_boot_list : {
-       KEEP(*(SORT(.u_boot_list*)));
-  }
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  ppcenv_assert = ASSERT(. < 0xFFFF8000, ".bss section too big, overlaps .ppcenv section. Please update your confguration: CONFIG_SYS_MONITOR_BASE, CONFIG_SYS_MONITOR_LEN and CONFIG_SYS_TEXT_BASE may need to be modified.");
-  . = 0xFFFF8000;
-  .ppcenv :
-  {
-    common/env_embedded.o(.ppcenv);
-  }
-
-  .resetvec RESET_VECTOR_ADDRESS :
-  {
-    KEEP(*(.resetvec))
-  } :text = 0xffff
-
-  . = RESET_VECTOR_ADDRESS + 0x4;
-
-  /*
-   * Make sure that the bss segment isn't linked at 0x0, otherwise its
-   * address won't be updated during relocation fixups.  Note that
-   * this is a temporary fix.  Code to dynamically the fixup the bss
-   * location will be added in the future.  When the bss relocation
-   * fixup code is present this workaround should be removed.
-   */
-#if (RESET_VECTOR_ADDRESS == 0xfffffffc)
-  . |= 0x10;
-#endif
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.bss*)
-   *(.sbss*)
-   *(COMMON)
-  } :bss
-
-  . = ALIGN(4);
-  __bss_end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/eltec/elppc/Kconfig b/board/eltec/elppc/Kconfig
deleted file mode 100644 (file)
index d4003e5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_ELPPC
-
-config SYS_BOARD
-       default "elppc"
-
-config SYS_VENDOR
-       default "eltec"
-
-config SYS_CONFIG_NAME
-       default "ELPPC"
-
-endif
diff --git a/board/eltec/elppc/MAINTAINERS b/board/eltec/elppc/MAINTAINERS
deleted file mode 100644 (file)
index e3b35f1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-ELPPC BOARD
-#M:    -
-S:     Maintained
-F:     board/eltec/elppc/
-F:     include/configs/ELPPC.h
-F:     configs/ELPPC_defconfig
diff --git a/board/eltec/elppc/Makefile b/board/eltec/elppc/Makefile
deleted file mode 100644 (file)
index 791f2fb..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  = elppc.o flash.o pci.o misc.o mpc107_i2c.o eepro100_srom.o
-obj-y  += asm_init.o
diff --git a/board/eltec/elppc/asm_init.S b/board/eltec/elppc/asm_init.S
deleted file mode 100644 (file)
index 10fdfa2..0000000
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- * (C) Copyright 2001 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * ELTEC ELPPC RAM initialization
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <asm/processor.h>
-#include <version.h>
-#include <mpc106.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-.globl board_asm_init
-board_asm_init:
-
-/*
- * setup pointer to message block
- */
-    mflr    r13                 /* save away link register */
-    bl      get_lnk_reg         /* r3=addr of next instruction */
-    subi    r4, r3, 8           /* r4=board_asm_init addr */
-    addi    r29, r4, (MessageBlock-board_asm_init)
-
-/*
- * dcache_disable
- */
-    mfspr   r3, HID0
-    li      r4, HID0_DCE
-    andc    r3, r3, r4
-    mr      r2, r3
-    ori     r3, r3, HID0_DCI
-    sync
-    mtspr   HID0, r3
-    mtspr   HID0, r2
-    isync
-    sync
-/*
- * icache_disable
- */
-    mfspr   r3, HID0
-    li      r4, 0
-    ori     r4, r4, HID0_ICE
-    andc    r3, r3, r4
-    sync
-    mtspr   HID0, r3
-/*
- * invalidate caches
- */
-    ori     r3, r3, (HID0_ICE | HID0_ICFI | HID0_DCI | HID0_DCE)
-    or      r4, r4, r3
-    isync
-    mtspr   HID0, r4
-    andc    r4, r4, r3
-    isync
-    mtspr   HID0, r4
-    isync
-/*
- * icache_enable
- */
-    mfspr   r3, HID0
-    ori     r3, r3, (HID0_ICE | HID0_ICFI)
-    sync
-    mtspr   HID0, r3
-
-
-/*
- * setup memory controller
- */
-    lis     r1, MPC106_REG_ADDR@h
-    ori     r1, r1, MPC106_REG_ADDR@l
-    lis     r2, MPC106_REG_DATA@h
-    ori     r2, r2, MPC106_REG_DATA@l
-
-    /* Configure PICR1 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, PCI_PICR1
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0xFF14
-    ori     r3, r3, 0x1CC8
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure PICR2 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, PCI_PICR2
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0000
-    ori     r3, r3, 0x0000
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure EUMBAR */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, 0x0078      /* offest of EUMBAR in PCI config space */
-    stwbrx  r3, 0, r1
-    lis     r3, MPC107_EUMB_ADDR@h
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure Address Map B Option Reg */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, 0x00e0      /* offest of AMBOR in PCI config space */
-    stwbrx  r3, 0, r1
-    lis     r3, 0
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure I2C Controller */
-    lis     r14, MPC107_I2C_ADDR@h  /* base of I2C controller */
-    ori     r14, r14, MPC107_I2C_ADDR@l
-    lis     r3, 0x2b10          /* I2C clock = 100MHz/1024 */
-    stw     r3, 4(r14)
-    li      r3, 0               /* clear arbitration */
-    eieio
-    stw     r3, 12(r14)
-
-    /* Configure MCCR1 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR1
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0660      /* don't set MEMGO now ! */
-    ori     r3, r3, 0x0000
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure MCCR2 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR2
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0400
-    ori     r3, r3, 0x1800
-    eieio
-    stwbrx  r3, 0, r2
-
-
-    /* Configure MCCR3 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR3
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0230
-    ori     r3, r3, 0x0000
-    eieio
-    stwbrx  r3, 0, r2
-
-    /* Configure MCCR4 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR4
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x2532
-    ori     r3, r3, 0x2220
-    eieio
-    stwbrx  r3, 0, r2
-
-/*
- * configure memory interface (MICRs)
- */
-    addis   r3, r0, 0x8000      /* ADDR_80 */
-    ori     r3, r3, 0x0080      /* SMEMADD1 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0xFFFF
-    ori     r3, r3, 0x4000
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_84 */
-    ori     r3, r3, 0x0084      /* SMEMADD2 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0xFFFF
-    ori     r3, r3, 0xFFFF
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_88 */
-    ori     r3, r3, 0x0088      /* EXTSMEM1 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0303
-    ori     r3, r3, 0x0000
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_8C */
-    ori     r3, r3, 0x008c      /* EXTSMEM2 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0303
-    ori     r3, r3, 0x0303
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_90 */
-    ori     r3, r3, 0x0090      /* EMEMADD1 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0xFFFF
-    ori     r3, r3, 0x7F3F
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_94 */
-    ori     r3, r3, 0x0094      /* EMEMADD2 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0xFFFF
-    ori     r3, r3, 0xFFFF
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_98 */
-    ori     r3, r3, 0x0098      /* EXTEMEM1 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0303
-    ori     r3, r3, 0x0000
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_9C */
-    ori     r3, r3, 0x009c      /* EXTEMEM2 */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0303
-    ori     r3, r3, 0x0303
-    eieio
-    stwbrx  r3, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_A0 */
-    ori     r3, r3, 0x00a0      /* MEMBNKEN */
-    stwbrx  r3, 0, r1
-    addis   r3, r0, 0x0000
-    ori     r3, r3, 0x0003
-    eieio
-    stwbrx  r3, 0, r2
-
-/*
- * must wait at least 100us after HRESET to issue a MEMGO
- */
-    lis     r0, 1
-    mtctr   r0
-memStartWait:
-    bdnz    memStartWait
-
-/*
- * enable RAM Operations through MCCR1 (MEMGO)
- */
-    lis     r3, 0x8000
-    ori     r3, r3, 0x00f0
-    stwbrx  r3, r0, r1
-    sync
-    lwbrx   r3, 0, r2
-    lis     r0, 0x0008
-    or      r3, r0, r3
-    stwbrx  r3, 0, r2
-    sync
-
-/*
- * set LEDs first time
- */
-    li      r3, 0x1
-    lis     r30, CONFIG_SYS_USR_LED_BASE@h
-    stb     r3, 2(r30)
-    sync
-
-/*
- * init COM1 for polled output
- */
-    lis     r8, CONFIG_SYS_NS16550_COM1@h  /* COM1 base address*/
-    ori     r8, r8, CONFIG_SYS_NS16550_COM1@l
-    li      r9, 0x00
-    stb     r9, 1(r8)           /* int disabled */
-    eieio
-    li      r9, 0x00
-    stb     r9, 4(r8)           /* modem ctrl */
-    eieio
-    li      r9, 0x80
-    stb     r9, 3(r8)           /* link ctrl */
-    eieio
-    li      r9, (CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE)
-    stb     r9, 0(r8)           /* baud rate (LSB)*/
-    eieio
-    li      r9, ((CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE) >> 8)
-    stb     r9, 1(r8)           /* baud rate (MSB) */
-    eieio
-    li      r9, 0x07
-    stb     r9, 3(r8)           /* 8 data bits, 2 stop bit, no parity */
-    eieio
-    li      r9, 0x0b
-    stb     r9, 4(r8)           /* enable the receiver and transmitter (modem ctrl) */
-    eieio
-waitEmpty:
-    lbz     r9, 5(r8)           /* transmit empty */
-    andi.   r9, r9, 0x40
-    beq     waitEmpty
-    li      r9, 0x47
-    stb     r9, 3(r8)           /* send break, 8 data bits, 2 stop bit, no parity */
-    eieio
-
-    lis     r0, 0x0001
-    mtctr   r0
-waitCOM1:
-    lwz     r0, 5(r8)           /* load from port for delay */
-    bdnz    waitCOM1
-
-waitEmpty1:
-    lbz     r9, 5(r8)           /* transmit empty */
-    andi.   r9, r9, 0x40
-    beq     waitEmpty1
-    li      r9, 0x07
-    stb     r9, 3(r8)           /* 8 data bits, 2 stop bit, no parity */
-    eieio
-
-/*
- * intro message from message block
- */
-    addi    r3, r29, (MnewLine-MessageBlock)
-    bl      Printf
-    addi    r3, r29, (MinitLogo-MessageBlock)
-    bl      Printf
-
-/*
- * memory cofiguration using SPD information stored on the SODIMMs
- */
-    addi    r3, r29, (Mspd01-MessageBlock)
-    bl      Printf
-
-    li      r17, 0
-
-    li      r3, 0x0002          /* get RAM type from spd for bank0/1 */
-    bl      spdRead
-
-    cmpi    0, 0, r3, -1        /* error ? */
-    bne     noSpdError
-
-    addi    r3, r29, (Mfail-MessageBlock)
-    bl      Printf
-
-    li      r6, 0xe             /* error codes in r6 and r7  */
-    li      r7, 0x0
-    b       toggleError         /* fail - loop forever */
-
-noSpdError:
-    mr      r15, r3             /* save r3 */
-
-    addi    r3, r29, (Mok-MessageBlock)
-    bl      Printf
-
-    cmpli   0, 0, r15, 0x0004   /* SDRAM ? */
-    beq     isSDRAM
-
-    addi    r3, r29, (MramTyp-MessageBlock)
-    bl      Printf
-
-    li      r6, 0xd             /* error codes in r6 and r7  */
-    li      r7, 0x0
-    b       toggleError         /* fail - loop forever */
-
-isSDRAM:
-    li      r3, 0x0012          /* get supported CAS latencies from byte 18 */
-    bl      spdRead
-    mr      r15, r3
-    li      r3, 0x09
-    andi.   r0, r15, 0x04
-    bne     maxCLis3
-    li      r3, 0x17
-maxCLis3:
-    andi.   r0, r15, 0x02
-    bne     CL2
-
-    addi    r3, r29, (MramTyp-MessageBlock)
-    bl      Printf
-
-    li      r6, 0xc             /* error codes in r6 and r7  */
-    li      r7, 0x0
-    b       toggleError         /* fail - loop forever */
-CL2:
-    bl      spdRead
-    cmpli   0, 0, r3, 0xa1      /* cycle time must be 10ns max. */
-    blt     speedOk
-
-    addi    r3, r29, (MramTyp-MessageBlock)
-    bl      Printf
-
-    li      r6, 0xb             /* error codes in r6 and r7  */
-    li      r7, 0x0
-    b       toggleError         /* fail - loop forever */
-speedOk:
-    lis     r20, 0x06e8         /* preset MCR1 value */
-
-    li      r3, 0x0011          /* get number of internal banks from spd for bank0/1 */
-    bl      spdRead
-
-    cmpli   0, 0, r3, 0x02
-    beq     SD_2B
-    cmpli   0, 0, r3, 0x04
-    beq     SD_4B
-memConfErr:
-    addi    r3, r29, (MramConfErr-MessageBlock)
-    bl      Printf
-
-    li      r6, 0xa             /* error codes in r6 and r7  */
-    li      r7, 0x0
-    b       toggleError         /* fail - loop forever */
-
-SD_2B:
-    li      r3, 0x0003          /* get number of row bits from spd for bank0/1 */
-    bl      spdRead
-    cmpli   0, 0, r3, 0x0b
-    beq     row11x2
-    cmpli   0, 0, r3, 0x0c
-    beq     row12x2or13x2
-    cmpli   0, 0, r3, 0x0d
-    beq     row12x2or13x2
-    b       memConfErr
-SD_4B:
-    li      r3, 0x0003          /* get number of row bits from spd for bank0/1 */
-    bl      spdRead
-    cmpli   0, 0, r3, 0x0b
-    beq     row11x4or12x4
-    cmpli   0, 0, r3, 0x0c
-    beq     row11x4or12x4
-    cmpli   0, 0, r3, 0x0d
-    beq     row13x4
-    b       memConfErr
-row12x2or13x2:
-    ori     r20, r20, 0x05
-    b       row11x4or12x4
-row13x4:
-    ori     r20, r20, 0x0a
-    b       row11x4or12x4
-row11x2:
-    ori     r20, r20, 0x0f
-row11x4or12x4:
-    /* get the size of bank 0-1 */
-
-    li      r3, 0x001f          /* get bank size from spd for bank0/1 */
-    bl      spdRead
-
-    rlwinm  r16, r3, 2, 24, 29  /* calculate size in MByte (128 MB max.) */
-
-    li      r3, 0x0005          /* get number of banks from spd for bank0/1 */
-    bl      spdRead
-
-    cmpi    0, 0, r3, 2         /* 2 banks ? */
-    bne     SDRAMnobank1
-
-    mr      r17, r16
-
-SDRAMnobank1:
-    li      r3, 0x000c          /* get refresh from spd for bank0/1 */
-    bl      spdRead
-    andi.   r3, r3, 0x007f      /* mask selfrefresh bit */
-    li      r4, 0x1800          /* refesh cycle 1536 clocks left shifted 2 */
-    cmpli   0, 0, r3, 0x0000    /* 15.6 us ? */
-    beq     writeRefresh
-
-    li      r4, 0x0c00          /* refesh cycle 768 clocks left shifted 2 */
-    cmpli   0, 0, r3, 0x0002    /* 7.8 us ? */
-    beq     writeRefresh
-
-    li      r4, 0x3000          /* refesh cycle 3072 clocks left shifted 2 */
-    cmpli   0, 0, r3, 0x0003    /* 31.3 us ? */
-    beq     writeRefresh
-
-    li      r4, 0x6000          /* refesh cycle 6144 clocks left shifted 2 */
-    cmpli   0, 0, r3, 0x0004    /* 62.5 us ? */
-    beq     writeRefresh
-
-    li      r4, 0
-    ori     r4, r4, 0xc000      /* refesh cycle 8224 clocks left shifted 2 */
-    cmpli   0, 0, r3, 0x0005    /* 125 us ? */
-    beq     writeRefresh
-
-    b       memConfErr
-
-writeRefresh:
-    lis     r21, 0x0400         /* preset MCCR2 value */
-    or      r21, r21, r4
-
-    /* Overwrite MCCR1 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR1
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r20, 0, r2
-
-    /* Overwrite MCCR2 */
-    lis     r3, MPC106_REG@h
-    ori     r3, r3, MPC106_MCCR2
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r21, 0, r2
-
-    /* set the memory boundary registers for bank 0-3 */
-    li      r20, 0
-    lis     r23, 0x0303
-    lis     r24, 0x0303
-    subi    r21, r16, 1         /* calculate end address bank0 */
-    li      r22, 1
-
-    cmpi    0, 0, r17, 0        /* bank1 present ? */
-    beq     nobank1
-
-    andi.   r3, r16, 0x00ff     /* calculate start address of bank1 */
-    andi.   r4, r16, 0x0300
-    rlwinm  r3, r3, 8, 16, 23
-    or      r20, r20, r3
-    or      r23, r23, r4
-
-    add     r16, r16, r17       /* add to total memory size */
-
-    subi    r3, r16, 1          /* calculate end address of bank1 */
-    andi.   r4, r3, 0x0300
-    andi.   r3, r3, 0x00ff
-    rlwinm  r3, r3, 8, 16, 23
-    or      r21, r21, r3
-    or      r24, r24, r4
-
-    ori     r22, r22, 2         /* enable bank1 */
-    b       bankOk
-nobank1:
-    ori     r23, r23, 0x0300    /* set bank1 start to unused area */
-    ori     r24, r24, 0x0300    /* set bank1 end to unused area */
-bankOk:
-    addi    r3, r29, (Mactivate-MessageBlock)
-    bl      Printf
-    mr      r3, r16
-    bl      OutDec
-    addi    r3, r29, (Mact0123e-MessageBlock)
-    bl      Printf
-
-/*
- * overwrite MSAR1, MEAR1, EMSAR1, and EMEAR1
- */
-    addis   r3, r0, 0x8000      /* ADDR_80 */
-    ori     r3, r3, 0x0080      /* MSAR1 */
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r20, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_88 */
-    ori     r3, r3, 0x0088      /* EMSAR1 */
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r23, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_90 */
-    ori     r3, r3, 0x0090      /* MEAR1 */
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r21, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_98 */
-    ori     r3, r3, 0x0098      /* EMEAR1 */
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r24, 0, r2
-
-    addis   r3, r0, 0x8000      /* ADDR_A0 */
-    ori     r3, r3, 0x00a0      /* MBER */
-    stwbrx  r3, 0, r1
-    eieio
-    stwbrx  r22, 0, r2
-
-/*
- * delay to let SDRAM go through several initialization/refresh cycles
- */
-    lis     r3, 3
-    mtctr   r3
-memStartWait_1:
-    bdnz    memStartWait_1
-    eieio
-
-/*
- * set LEDs end
- */
-    li      r3, 0xf
-    lis     r30, CONFIG_SYS_USR_LED_BASE@h
-    stb     r3, 2(r30)
-    sync
-
-    mtlr    r13
-    blr                         /* EXIT board_asm_init ... */
-
-/*----------------------------------------------------------------------------*/
-/*
- * print a message to COM1 in polling mode (r10=COM1 port, r3=(char*)string)
- */
-
-Printf:
-    lis     r10, CONFIG_SYS_NS16550_COM1@h /* COM1 base address*/
-    ori     r10, r10, CONFIG_SYS_NS16550_COM1@l
-WaitChr:
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, WaitChr        /* wait till empty */
-    lbzx    r0, r0, r3          /* get char */
-    stb     r0, 0(r10)          /* write to transmit reg */
-    eieio
-    addi    r3, r3, 1           /* next char */
-    lbzx    r0, r0, r3          /* get char */
-    cmpwi   cr1, r0, 0          /* end of string ? */
-    bne     cr1, WaitChr
-    blr
-
-/*
- * print a char to COM1 in polling mode (r10=COM1 port, r3=char)
- */
-OutChr:
-    lis     r10, CONFIG_SYS_NS16550_COM1@h /* COM1 base address*/
-    ori     r10, r10, CONFIG_SYS_NS16550_COM1@l
-OutChr1:
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, OutChr1        /* wait till empty */
-    stb     r3, 0(r10)          /* write to transmit reg */
-    eieio
-    blr
-
-/*
- * print 8/4/2 digits hex value to COM1 in polling mode (r10=COM1 port, r3=val)
- */
-OutHex2:
-    li      r9, 4               /* shift reg for 2 digits */
-    b       OHstart
-OutHex4:
-    li      r9, 12              /* shift reg for 4 digits */
-    b       OHstart
-OutHex:
-    li      r9, 28              /* shift reg for 8 digits */
-OHstart:
-    lis     r10, CONFIG_SYS_NS16550_COM1@h /* COM1 base address*/
-    ori     r10, r10, CONFIG_SYS_NS16550_COM1@l
-OutDig:
-    lbz     r0, 0(r29)          /* slow down dummy read */
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, OutDig
-    sraw    r0, r3, r9
-    clrlwi  r0, r0, 28
-    cmpwi   cr1, r0, 9
-    ble     cr1, digIsNum
-    addic   r0, r0, 55
-    b       nextDig
-digIsNum:
-    addic   r0, r0, 48
-nextDig:
-    stb     r0, 0(r10)          /* write to transmit reg */
-    eieio
-    addic.  r9, r9, -4
-    bge     OutDig
-    blr
-
-/*
- * print 3 digits hdec value to COM1 in polling mode
- * (r10=COM1 port, r3=val, r7=x00, r8=x0, r9=x, r0, r6=scratch)
- */
-OutDec:
-    li      r6, 10
-    divwu   r0, r3, r6          /* r0 = r3 / 10, r9 = r3 mod 10 */
-    mullw   r10, r0, r6
-    subf    r9, r10, r3
-    mr      r3, r0
-    divwu   r0, r3, r6          /* r0 = r3 / 10, r8 = r3 mod 10 */
-    mullw   r10, r0, r6
-    subf    r8, r10, r3
-    mr      r3, r0
-    divwu   r0, r3, r6          /* r0 = r3 / 10, r7 = r3 mod 10 */
-    mullw   r10, r0, r6
-    subf    r7, r10, r3
-    lis     r10, CONFIG_SYS_NS16550_COM1@h /* COM1 base address*/
-    ori     r10, r10, CONFIG_SYS_NS16550_COM1@l
-    or.     r7, r7, r7
-    bne     noblank1
-    li      r3, 0x20
-    b       OutDec4
-noblank1:
-    addi    r3, r7, 48          /* convert to ASCII */
-OutDec4:
-    lbz     r0, 0(r29)          /* slow down dummy read */
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, OutDec4
-    stb     r3, 0(r10)          /* x00 to transmit */
-    eieio
-    or.     r7, r7, r8
-    beq     OutDec5
-    addi    r3, r8, 48          /* convert to ASCII */
-OutDec5:
-    lbz     r0, 0(r29)          /* slow down dummy read */
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, OutDec5
-    stb     r3, 0(r10)          /* x0  to transmit */
-    eieio
-    addi    r3, r9, 48          /* convert to ASCII */
-OutDec6:
-    lbz     r0, 0(r29)          /* slow down dummy read */
-    lbz     r0, 5(r10)          /* read link status */
-    eieio
-    andi.   r0, r0, 0x40        /* mask transmitter empty bit */
-    beq     cr0, OutDec6
-    stb     r3, 0(r10)          /* x   to transmit */
-    eieio
-    blr
-
-/*
- * hang endless loop
- */
-toggleError:                    /* fail type in r6, r7=0xff, toggle LEDs */
-    stb     r7, 2(r30)          /* r7 to LED */
-    li      r0, 0
-    lis     r9, 127
-    ori     r9, r9, 65535
-toggleError1:
-    addic   r0, r0, 1
-    cmpw    cr1, r0, r9
-    ble     cr1, toggleError1
-    stb     r6, 2(r30)          /* r6 to LED */
-    li      r0, 0
-    lis     r9, 127
-    ori     r9, r9, 65535
-toggleError2:
-    addic   r0, r0, 1
-    cmpw    cr1, r0, r9
-    ble     cr1, toggleError2
-    b       toggleError
-
-/*
- * routines to read from ram spd
- */
-spdWaitIdle:
-    lis     r0, 0x1             /* timeout for about 100us */
-    mtctr   r0
-iSpd:
-    lbz     r10, 12(r14)
-    andi.   r10, r10, 0x20      /* mask and test MBB */
-    beq     idle
-    bdnz    iSpd
-    orc.    r10, r0, r0         /* return -1 to caller */
-idle:
-    bclr    20, 0               /* return to caller */
-
-waitSpd:
-    lis     r0, 0x10            /* timeout for about 1.5ms */
-    mtctr   r0
-wSpd:
-    lbz     r10, 12(r14)
-    andi.   r10, r10, 0x82
-    cmpli   0, 0, r10, 0x82     /* test MCF and MIF set */
-    beq     wend
-    bdnz    wSpd
-    orc.    r10, r0, r0         /* return -1 to caller */
-    bclr    20, 0               /* return to caller */
-
-wend:
-    li      r10, 0
-    stb     r10, 12(r14)        /* clear status */
-    bclr    20, 0               /* return to caller */
-
-/*
- * spdread
- * in:  r3 adr to read
- * out: r3 val or -1 for error
- * uses r10, assumes that r14 points to I2C controller
- */
-spdRead:
-    mfspr   r25, 8              /* save link register */
-
-    bl      spdWaitIdle
-    bne     spdErr
-
-    li      r10, 0x80           /* start with MEN */
-    stb     r10, 8(r14)
-    eieio
-
-    li      r10, 0xb0           /* start as master */
-    stb     r10, 8(r14)
-    eieio
-
-    li      r10, 0xa0           /* write device 0xA0 */
-    stb     r10, 16(r14)
-    eieio
-    bl      waitSpd
-    bne     spdErr
-
-    lbz     r10, 12(r14)        /* test ACK */
-    andi.   r10, r10, 0x01
-    bne     gotNoAck
-
-    stb     r3, 16(r14)         /* data address */
-    eieio
-    bl      waitSpd
-    bne     spdErr
-
-
-    li      r10, 0xb4           /* switch to read - restart */
-    stb     r10, 8(r14)
-    eieio
-
-    li      r10, 0xa1           /* read device 0xA0 */
-    stb     r10, 16(r14)
-    eieio
-    bl      waitSpd
-    bne     spdErr
-
-    li      r10, 0xa8           /* no ACK */
-    stb     r10, 8(r14)
-    eieio
-
-    lbz     r10, 16(r14)        /* trigger read next byte */
-    eieio
-    bl      waitSpd
-    bne     spdErr
-
-    li      r10, 0x88           /* generate STOP condition */
-    stb     r10, 8(r14)
-    eieio
-
-    lbz     r3, 16(r14)         /* return read byte */
-
-    mtspr   8, r25              /* restore link register */
-    blr
-
-gotNoAck:
-    li      r10, 0x80           /* generate STOP condition */
-    stb     r10, 8(r14)
-    eieio
-spdErr:
-    orc     r3, r0, r0          /* return -1 */
-    mtspr   8, r25              /* restore link register */
-    blr
-
-get_lnk_reg:
-    mflr    r3                  /* return link reg */
-    blr
-
-MessageBlock:
-
-MinitLogo:
-    .ascii  "\015\012*** ELTEC Elektronik, Mainz ***\015\012"
-    .ascii  "\015\012Initialising RAM\015\012\000"
-Mspd01:
-    .ascii  "       Reading SPD of SODIMM ...... \000"
-MramTyp:
-    .ascii  "\015\012\SDRAM with CL=2 at 100 MHz required!\015\012\000"
-MramConfErr:
-    .ascii  "\015\012\Unsupported SODIMM Configuration!\015\012\000"
-Mactivate:
-    .ascii  "       Activating \000"
-Mact0123e:
-    .ascii  " MByte.\015\012\000"
-Mok:
-    .ascii  "OK \015\012\000"
-Mfail:
-    .ascii  "FAILED \015\012\000"
-MnewLine:
-    .ascii  "\015\012\000"
-    .align 4
diff --git a/board/eltec/elppc/eepro100_srom.c b/board/eltec/elppc/eepro100_srom.c
deleted file mode 100644 (file)
index 05ba9c4..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * Local network srom writing for first time run
- */
-
-/* includes */
-#include <common.h>
-#include <pci.h>
-#include <net.h>
-#include "srom.h"
-
-extern int eepro100_write_eeprom (struct eth_device *dev,
-                                 int location, int addr_len,
-                                 unsigned short data);
-
-/*----------------------------------------------------------------------------*/
-
-unsigned short eepro100_srom_checksum (unsigned short *sromdata)
-{
-       unsigned short sum = 0;
-       unsigned int i;
-
-       for (i = 0; i < (EE_SIZE - 1); i++) {
-               sum += sromdata[i];
-       }
-       return (EE_CHECKSUM - sum);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int eepro100_srom_store (unsigned short *source)
-{
-       int count;
-       struct eth_device onboard_dev;
-
-       /* get onboard network iobase */
-       pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
-                              (unsigned int *) &onboard_dev.iobase);
-       onboard_dev.iobase &= ~0xf;
-
-       source[63] = eepro100_srom_checksum (source);
-
-       for (count = 0; count < EE_SIZE; count++) {
-               if (eepro100_write_eeprom ((struct eth_device *) &onboard_dev,
-                                          count, EE_ADDR_BITS,
-                                          SROM_SHORT (source)) == -1) {
-                       return -1;
-               }
-               source++;
-       }
-       return 0;
-}
-
-/*----------------------------------------------------------------------------*/
-
-#ifdef EEPRO100_SROM_CHECK
-
-extern int read_eeprom (struct eth_device *dev, int location, int addr_len);
-
-void eepro100_srom_load (unsigned short *destination)
-{
-       int count;
-       struct eth_device onboard_dev;
-
-#ifdef DEBUG
-       int lr = 0;
-
-       printf ("eepro100_srom_download:\n");
-#endif
-
-       /* get onboard network iobase */
-       pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
-                              &onboard_dev.iobase);
-       onboard_dev.iobase &= ~0xf;
-
-       memset (destination, 0x65, 128);
-
-       for (count = 0; count < 0x40; count++) {
-               *destination++ = read_eeprom ((struct eth_device *) &onboard_dev,
-                                             count, EE_ADDR_BITS);
-#ifdef DEBUG
-               printf ("%04x ", *(destination - 1));
-               if (lr++ == 7) {
-                       printf ("\n");
-                       lr = 0;
-               }
-#endif
-       }
-}
-#endif /* EEPRO100_SROM_CHECK */
-
-/*----------------------------------------------------------------------------*/
diff --git a/board/eltec/elppc/elppc.c b/board/eltec/elppc/elppc.c
deleted file mode 100644 (file)
index ac814b8..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <mpc106.h>
-#include <video_fb.h>
-#include <netdev.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/* ------------------------------------------------------------------------- */
-
-int checkboard (void)
-{
-       puts ("Board: ELTEC PowerPC\n");
-       return (0);
-}
-
-/* ------------------------------------------------------------------------- */
-
-int checkflash (void)
-{
-       /* TODO */
-       printf ("Test not implemented !\n");
-       return (0);
-}
-
-/* ------------------------------------------------------------------------- */
-
-static unsigned int mpc106_read_cfg_dword (unsigned int reg)
-{
-       unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
-
-       out32r (MPC106_REG_ADDR, reg_addr);
-
-       return (in32r (MPC106_REG_DATA | (reg & 0x3)));
-}
-
-/* ------------------------------------------------------------------------- */
-
-long int dram_size (int board_type)
-{
-       /*
-        * No actual initialisation to do - done when setting up
-        * PICRs MCCRs ME/SARs etc in asm_init.S.
-        */
-
-       register unsigned long i, msar1, mear1, memSize;
-
-#if defined(CONFIG_SYS_MEMTEST)
-       register unsigned long reg;
-
-       printf ("Testing DRAM\n");
-
-       /* write each mem addr with it's address */
-       for (reg = CONFIG_SYS_MEMTEST_START; reg < CONFIG_SYS_MEMTEST_END; reg += 4)
-               *reg = reg;
-
-       for (reg = CONFIG_SYS_MEMTEST_START; reg < CONFIG_SYS_MEMTEST_END; reg += 4) {
-               if (*reg != reg)
-                       return -1;
-       }
-#endif
-
-       /*
-        * Since MPC107 memory controller chip has already been set to
-        * control all memory, just read and interpret its memory boundery register.
-        */
-       memSize = 0;
-       msar1 = mpc106_read_cfg_dword (MPC106_MSAR1);
-       mear1 = mpc106_read_cfg_dword (MPC106_MEAR1);
-       i = mpc106_read_cfg_dword (MPC106_MBER) & 0xf;
-
-       do {
-               if (i & 0x01)                   /* is bank enabled ? */
-                       memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
-               msar1 >>= 8;
-               mear1 >>= 8;
-               i >>= 1;
-       } while (i);
-
-       return (memSize * 0x100000);
-}
-
-/* ------------------------------------------------------------------------- */
-
-phys_size_t initdram (int board_type)
-{
-       return dram_size (board_type);
-}
-
-/* ------------------------------------------------------------------------- */
-
-/*
- * The BAB 911 can be reset by writing bit 0 of the Processor Initialization
- * Register PI in the MPC 107 (at offset 0x41090 of the Embedded Utilities
- * Memory Block).
- */
-int do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
-{
-       out8 (MPC107_EUMB_PI, 1);
-       return (0);
-}
-
-/* ------------------------------------------------------------------------- */
-
-#if defined(CONFIG_WATCHDOG)
-
-/*
- * Since the 7xx CPUs don't have an internal watchdog, this function is
- * board specific.
- */
-void watchdog_reset (void)
-{
-}
-#endif                                                 /* CONFIG_WATCHDOG */
-
-/* ------------------------------------------------------------------------- */
-
-void after_reloc (ulong dest_addr)
-{
-       /*
-        * Jump to the main U-Boot board init code
-        */
-       board_init_r ((gd_t *)gd, dest_addr);
-}
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef CONFIG_CONSOLE_EXTRA_INFO
-extern GraphicDevice smi;
-
-void video_get_info_str (int line_number, char *info)
-{
-       /* init video info strings for graphic console */
-       switch (line_number) {
-       case 1:
-               sprintf (info, " MPC7xx V%d.%d at %d / %d MHz",
-                                (get_pvr () >> 8) & 0xFF, get_pvr () & 0xFF, 400, 100);
-               return;
-       case 2:
-               sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
-                                dram_size (0) / 0x100000, flash_init () / 0x100000);
-               return;
-       case 3:
-               sprintf (info, " %s", smi.modeIdent);
-               return;
-       }
-
-       /* no more info lines */
-       *info = 0;
-       return;
-}
-#endif
-
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
-}
diff --git a/board/eltec/elppc/flash.c b/board/eltec/elppc/flash.c
deleted file mode 100644 (file)
index 2b41685..0000000
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * 07-10-2002 Frank Gottschling: added 29F032 flash (ELPPC).
- *        fixed monitor protection part
- *
- * 09-18-2001 Andreas Heppel: Reduced the code in here to the usage
- *        of AMD's 29F040 and 29F016 flashes, since the BAB7xx does use
- *        any other.
- */
-
-#include <common.h>
-#include <asm/processor.h>
-#include <asm/pci_io.h>
-
-flash_info_t    flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
-
-ulong flash_get_size (vu_long *addr, flash_info_t *info);
-static int write_word (flash_info_t *info, ulong dest, ulong data);
-
-/*flash command address offsets*/
-
-#define ADDR0           (0x555)
-#define ADDR1           (0x2AA)
-#define ADDR3           (0x001)
-
-#define FLASH_WORD_SIZE unsigned char
-
-/*----------------------------------------------------------------------------*/
-
-unsigned long flash_init (void)
-{
-    unsigned long size1, size2;
-    int i;
-
-    /* Init: no FLASHes known */
-    for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i)
-    {
-       flash_info[i].flash_id = FLASH_UNKNOWN;
-    }
-
-    /* initialise 1st flash */
-    size1 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
-
-    if (flash_info[0].flash_id == FLASH_UNKNOWN)
-    {
-       printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-           size1, size1<<20);
-    }
-
-    /* initialise 2nd flash */
-    size2 = flash_get_size((vu_long *)FLASH_BASE1_PRELIM, &flash_info[1]);
-
-    if (flash_info[1].flash_id == FLASH_UNKNOWN)
-    {
-       printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
-           size2, size2<<20);
-    }
-
-    /* monitor protection ON by default */
-    if (size1 == 512*1024)
-    {
-       (void)flash_protect(FLAG_PROTECT_SET,
-               FLASH_BASE0_PRELIM,
-               FLASH_BASE0_PRELIM+monitor_flash_len-1,
-               &flash_info[0]);
-    }
-    if (size2 == 512*1024)
-    {
-       (void)flash_protect(FLAG_PROTECT_SET,
-               FLASH_BASE1_PRELIM,
-               FLASH_BASE1_PRELIM+monitor_flash_len-1,
-               &flash_info[1]);
-    }
-    if (size2 == 4*1024*1024)
-    {
-       (void)flash_protect(FLAG_PROTECT_SET,
-               CONFIG_SYS_FLASH_BASE,
-               CONFIG_SYS_FLASH_BASE+monitor_flash_len-1,
-               &flash_info[1]);
-    }
-
-    return (size1 + size2);
-}
-
-/*----------------------------------------------------------------------------*/
-
-void flash_print_info  (flash_info_t *info)
-{
-    int i;
-    int k;
-    int size;
-    int erased;
-    volatile unsigned long *flash;
-
-    if (info->flash_id == FLASH_UNKNOWN) {
-       printf ("missing or unknown FLASH type\n");
-       flash_init();
-    }
-
-    if (info->flash_id == FLASH_UNKNOWN) {
-       printf ("missing or unknown FLASH type\n");
-       return;
-    }
-
-    switch (info->flash_id & FLASH_VENDMASK) {
-    case FLASH_MAN_AMD:
-       printf ("AMD ");
-       break;
-    default:
-       printf ("Unknown Vendor ");
-       break;
-    }
-
-    switch (info->flash_id & FLASH_TYPEMASK) {
-    case AMD_ID_F040B:
-       printf ("AM29F040B (4 Mbit)\n");
-       break;
-    case AMD_ID_F016D:
-       printf ("AM29F016D (16 Mbit)\n");
-       break;
-    case AMD_ID_F032B:
-       printf ("AM29F032B (32 Mbit)\n");
-       break;
-   default:
-       printf ("Unknown Chip Type\n");
-       break;
-    }
-
-    if (info->size >= (1 << 20)) {
-       printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
-    } else {
-       printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
-    }
-
-    printf ("  Sector Start Addresses:");
-    for (i=0; i<info->sector_count; ++i) {
-       /*
-       * Check if whole sector is erased
-       */
-       if (i != (info->sector_count-1))
-           size = info->start[i+1] - info->start[i];
-       else
-           size = info->start[0] + info->size - info->start[i];
-
-       erased = 1;
-       flash = (volatile unsigned long *)info->start[i];
-       size = size >> 2;        /* divide by 4 for longword access */
-       for (k=0; k<size; k++) {
-           if (*flash++ != 0xffffffff) {
-               erased = 0;
-               break;
-           }
-       }
-
-       if ((i % 5) == 0)
-           printf ("\n   ");
-
-       printf (" %08lX%s%s",
-           info->start[i],
-           erased ? " E" : "  ",
-           info->protect[i] ? "RO " : "   ");
-    }
-    printf ("\n");
-}
-
-/*----------------------------------------------------------------------------*/
-/*
- * The following code cannot be run from FLASH!
- */
-ulong flash_get_size (vu_long *addr, flash_info_t *info)
-{
-    short i;
-    ulong vendor, devid;
-    ulong base = (ulong)addr;
-    volatile unsigned char *caddr = (unsigned char *)addr;
-
-#ifdef DEBUG
-    printf("flash_get_size for address 0x%lx: \n", (unsigned long)caddr);
-#endif
-
-    /* Write auto select command: read Manufacturer ID */
-    caddr[0] = 0xF0;   /* reset bank */
-    udelay(10);
-
-    eieio();
-    caddr[0x555] = 0xAA;
-    udelay(10);
-    caddr[0x2AA] = 0x55;
-    udelay(10);
-    caddr[0x555] = 0x90;
-
-    udelay(10);
-
-    vendor = caddr[0];
-    devid = caddr[1];
-
-#ifdef DEBUG
-    printf("Manufacturer: 0x%lx\n", vendor);
-#endif
-
-    vendor &= 0xff;
-    devid &= 0xff;
-
-    /* We accept only two AMD types */
-    switch (vendor) {
-    case (FLASH_WORD_SIZE)AMD_MANUFACT:
-       info->flash_id = FLASH_MAN_AMD;
-       break;
-    default:
-       info->flash_id = FLASH_UNKNOWN;
-       info->sector_count = 0;
-       info->size = 0;
-       return (0);         /* no or unknown flash  */
-    }
-
-    switch (devid) {
-    case (FLASH_WORD_SIZE)AMD_ID_F040B:
-       info->flash_id |= AMD_ID_F040B;
-       info->sector_count = 8;
-       info->size = 0x00080000;
-       break;              /* => 0.5 MB      */
-
-    case (FLASH_WORD_SIZE)AMD_ID_F016D:
-       info->flash_id |= AMD_ID_F016D;
-       info->sector_count = 32;
-       info->size         = 0x00200000;
-       break;              /* => 2 MB      */
-
-    case (FLASH_WORD_SIZE)AMD_ID_F032B:
-       info->flash_id |= AMD_ID_F032B;
-       info->sector_count = 64;
-       info->size         = 0x00400000;
-       break;              /* => 4 MB      */
-
-    default:
-       info->flash_id = FLASH_UNKNOWN;
-       return (0);         /* => no or unknown flash */
-
-    }
-
-#ifdef DEBUG
-    printf("flash id 0x%lx; sector count 0x%x, size 0x%lx\n", info->flash_id, info->sector_count, info->size);
-#endif
-
-    /* check for protected sectors */
-    for (i = 0; i < info->sector_count; i++) {
-       /* sector base address */
-       info->start[i] = base + i * (info->size / info->sector_count);
-       /* read sector protection at sector address, (A7 .. A0) = 0x02 */
-       /* D0 = 1 if protected */
-       caddr = (volatile unsigned char *)(info->start[i]);
-       info->protect[i] = caddr[2] & 1;
-    }
-
-    /*
-     * Prevent writes to uninitialized FLASH.
-     */
-    if (info->flash_id != FLASH_UNKNOWN) {
-       caddr = (volatile unsigned char *)info->start[0];
-       caddr[0] = 0xF0;   /* reset bank */
-    }
-
-    return (info->size);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-    volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]);
-    int flag, prot, sect, l_sect;
-    ulong start, now, last;
-    int rc = 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;
-    }
-
-    if ((info->flash_id == FLASH_UNKNOWN) ||
-       (info->flash_id > FLASH_AMD_COMP)) {
-       printf ("Can't erase unknown flash type - aborted\n");
-       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");
-    }
-
-    l_sect = -1;
-
-    /* Disable interrupts which might cause a timeout here */
-    flag = disable_interrupts();
-
-    addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-    addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-    addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
-    addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-    addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-
-    /* Start erase on unprotected sectors */
-    for (sect = s_first; sect<=s_last; sect++) {
-       if (info->protect[sect] == 0) { /* not protected */
-           addr = (FLASH_WORD_SIZE *)(info->start[sect]);
-           if (info->flash_id & FLASH_MAN_SST) {
-               addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-               addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-               addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
-               addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-               addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-               addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
-               udelay(30000);  /* wait 30 ms */
-           }
-           else
-               addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
-           l_sect = sect;
-       }
-    }
-
-    /* re-enable interrupts if necessary */
-    if (flag)
-       enable_interrupts();
-
-    /* wait at least 80us - let's wait 1 ms */
-    udelay (1000);
-
-    /*
-     * We wait for the last triggered sector
-     */
-    if (l_sect < 0)
-       goto DONE;
-
-    start = get_timer (0);
-    last  = start;
-    addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
-    while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
-       if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-           printf ("Timeout\n");
-           return 1;
-       }
-       /* show that we're waiting */
-       if ((now - last) > 1000) {  /* every second */
-           serial_putc ('.');
-           last = now;
-       }
-    }
-
-DONE:
-    /* reset to read mode */
-    addr = (FLASH_WORD_SIZE *)info->start[0];
-    addr[0] = (FLASH_WORD_SIZE)0x00F000F0;  /* reset bank */
-
-    printf (" done\n");
-    return rc;
-}
-
-/*----------------------------------------------------------------------------*/
-/*
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-    ulong cp, wp, data;
-    int i, l, rc;
-
-    wp = (addr & ~3);   /* get lower word aligned address */
-
-    /*
-     * 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<4 && cnt>0; ++i) {
-           data = (data << 8) | *src++;
-           --cnt;
-           ++cp;
-       }
-       for (; cnt==0 && i<4; ++i, ++cp) {
-           data = (data << 8) | (*(uchar *)cp);
-       }
-
-       if ((rc = write_word(info, wp, data)) != 0) {
-           return (rc);
-       }
-       wp += 4;
-    }
-
-    /*
-     * handle word aligned part
-     */
-    while (cnt >= 4) {
-       data = 0;
-       for (i=0; i<4; ++i) {
-           data = (data << 8) | *src++;
-       }
-       if ((rc = write_word(info, wp, data)) != 0) {
-           return (rc);
-       }
-       wp  += 4;
-       cnt -= 4;
-    }
-
-    if (cnt == 0) {
-       return (0);
-    }
-
-    /*
-     * handle unaligned tail bytes
-     */
-    data = 0;
-    for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-       data = (data << 8) | *src++;
-       --cnt;
-    }
-    for (; i<4; ++i, ++cp) {
-       data = (data << 8) | (*(uchar *)cp);
-    }
-
-    return (write_word(info, wp, data));
-}
-
-/*----------------------------------------------------------------------------*/
-/* Write a word to Flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_word (flash_info_t *info, ulong dest, ulong data)
-{
-       volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
-       volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
-       volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
-    ulong start;
-    int flag;
-       int i;
-
-    /* Check if Flash is (sufficiently) erased */
-    if ((*((volatile FLASH_WORD_SIZE *)dest) &
-            (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
-       return (2);
-    }
-    /* Disable interrupts which might cause a timeout here */
-    flag = disable_interrupts();
-
-       for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
-         {
-           addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-           addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-           addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
-
-           dest2[i] = data2[i];
-
-           /* re-enable interrupts if necessary */
-           if (flag)
-             enable_interrupts();
-
-           /* data polling for D7 */
-           start = get_timer (0);
-           while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
-                  (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
-             if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-               return (1);
-             }
-           }
-         }
-
-    return (0);
-}
-
-/*----------------------------------------------------------------------------*/
diff --git a/board/eltec/elppc/misc.c b/board/eltec/elppc/misc.c
deleted file mode 100644 (file)
index 2acf800..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/* includes */
-#include <common.h>
-#include <cli.h>
-#include <linux/ctype.h>
-#include <pci.h>
-#include <net.h>
-#include "srom.h"
-
-/* imports  */
-extern int l2_cache_enable (int l2control);
-extern int eepro100_write_eeprom (struct eth_device *dev, int location,
-                                 int addr_len, unsigned short data);
-extern int read_eeprom (struct eth_device *dev, int location, int addr_len);
-
-/*----------------------------------------------------------------------------*/
-/*
- * read/write to nvram is only byte access
- */
-void *nvram_read (void *dest, const long src, size_t count)
-{
-       uchar *d = (uchar *) dest;
-       uchar *s = (uchar *) (CONFIG_ENV_MAP_ADRS + src);
-
-       while (count--)
-               *d++ = *s++;
-
-       return dest;
-}
-
-void nvram_write (long dest, const void *src, size_t count)
-{
-       uchar *d = (uchar *) (CONFIG_ENV_MAP_ADRS + dest);
-       uchar *s = (uchar *) src;
-
-       while (count--)
-               *d++ = *s++;
-}
-
-/*----------------------------------------------------------------------------*/
-/*
- * handle sroms on ELPPC
- * fix ether address
- * set serial console as default
- */
-int misc_init_r (void)
-{
-       revinfo eerev;
-       u_char *ptr;
-       u_int i, l, initSrom, copyNv;
-       char buf[256];
-       char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
-               0, 0, 0, 0, 10, 11, 12, 13, 14, 15
-       };
-
-       /* Clock setting for MPC107 i2c */
-       mpc107_i2c_init (MPC107_EUMB_ADDR, 0x2b);
-
-       /* Reset the EPIC */
-       out32r (MPC107_EUMB_GCR, 0xa0000000);
-       while (in32r (MPC107_EUMB_GCR) & 0x80000000);   /* Wait for reset to complete */
-       out32r (MPC107_EUMB_GCR, 0x20000000);   /* Put into into mixed mode */
-       while (in32r (MPC107_EUMB_IACKR) != 0xff);      /* Clear all pending interrupts */
-
-       /*
-        * Check/Remake revision info
-        */
-       initSrom = 0;
-       copyNv = 0;
-
-       /* read out current revision srom contens */
-       mpc107_srom_load (0x0000, (u_char *) & eerev, sizeof (revinfo),
-                         SECOND_DEVICE, FIRST_BLOCK);
-
-       /* read out current nvram shadow image */
-       nvram_read (buf, CONFIG_SYS_NV_SROM_COPY_ADDR, CONFIG_SYS_SROM_SIZE);
-
-       if (strcmp (eerev.magic, "ELTEC") != 0) {
-               /* srom is not initialized -> create a default revision info */
-               for (i = 0, ptr = (u_char *) & eerev; i < sizeof (revinfo);
-                    i++)
-                       *ptr++ = 0x00;
-               strcpy (eerev.magic, "ELTEC");
-               eerev.revrev[0] = 1;
-               eerev.revrev[1] = 0;
-               eerev.size = 0x00E0;
-               eerev.category[0] = 0x01;
-
-               /* node id from dead e128 as default */
-               eerev.etheraddr[0] = 0x00;
-               eerev.etheraddr[1] = 0x00;
-               eerev.etheraddr[2] = 0x5B;
-               eerev.etheraddr[3] = 0x00;
-               eerev.etheraddr[4] = 0x2E;
-               eerev.etheraddr[5] = 0x4D;
-
-               /* cache config word for ELPPC */
-               memset(&eerev.res[0], 0, 4);
-
-               initSrom = 1;   /* force dialog */
-               copyNv = 1;     /* copy to nvram */
-       }
-
-       if ((copyNv == 0)
-           && (el_srom_checksum ((u_char *) & eerev, CONFIG_SYS_SROM_SIZE) !=
-               el_srom_checksum ((u_char *) buf, CONFIG_SYS_SROM_SIZE))) {
-               printf ("Invalid revision info copy in nvram !\n");
-               printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
-               printf ("  <r> to reenter revision info.\n");
-               printf ("=> ");
-               if (0 != cli_readline(NULL)) {
-                       switch ((char) toupper (console_buffer[0])) {
-                       case 'C':
-                               copyNv = 1;
-                               break;
-                       case 'R':
-                               copyNv = 1;
-                               initSrom = 1;
-                               break;
-                       }
-               }
-       }
-
-       if (initSrom) {
-               memcpy (buf, &eerev.revision[0][0], 14);        /* save all revision info */
-               printf ("Enter revision number (0-9): %c  ",
-                       eerev.revision[0][0]);
-               if (0 != cli_readline(NULL)) {
-                       eerev.revision[0][0] =
-                               (char) toupper (console_buffer[0]);
-                       memcpy (&eerev.revision[1][0], buf, 12);        /* shift rest of rev info */
-               }
-
-               printf ("Enter revision character (A-Z): %c  ",
-                       eerev.revision[0][1]);
-               if (1 == cli_readline(NULL)) {
-                       eerev.revision[0][1] =
-                               (char) toupper (console_buffer[0]);
-               }
-
-               printf ("Enter board name (V-XXXX-XXXX): %s  ",
-                       (char *) &eerev.board);
-               if (11 == cli_readline(NULL)) {
-                       for (i = 0; i < 11; i++)
-                               eerev.board[i] =
-                                       (char) toupper (console_buffer[i]);
-                       eerev.board[11] = '\0';
-               }
-
-               printf ("Enter serial number: %s ", (char *) &eerev.serial);
-               if (6 == cli_readline(NULL)) {
-                       for (i = 0; i < 6; i++)
-                               eerev.serial[i] = console_buffer[i];
-                       eerev.serial[6] = '\0';
-               }
-
-               printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ", eerev.etheraddr[0], eerev.etheraddr[1], eerev.etheraddr[2], eerev.etheraddr[3], eerev.etheraddr[4], eerev.etheraddr[5]);
-               if (12 == cli_readline(NULL)) {
-                       for (i = 0; i < 12; i += 2)
-                               eerev.etheraddr[i >> 1] =
-                                       (char) (16 *
-                                               hex[toupper
-                                                   (console_buffer[i]) -
-                                                   '0'] +
-                                               hex[toupper
-                                                   (console_buffer[i + 1]) -
-                                                   '0']);
-               }
-
-               l = strlen ((char *) &eerev.text);
-               printf ("Add to text section (max 64 chr): %s ",
-                       (char *) &eerev.text);
-               if (0 != cli_readline(NULL)) {
-                       for (i = l; i < 63; i++)
-                               eerev.text[i] = console_buffer[i - l];
-                       eerev.text[63] = '\0';
-               }
-
-               /* prepare network eeprom */
-               memset (buf, 0, 128);
-
-               buf[0] = eerev.etheraddr[1];
-               buf[1] = eerev.etheraddr[0];
-               buf[2] = eerev.etheraddr[3];
-               buf[3] = eerev.etheraddr[2];
-               buf[4] = eerev.etheraddr[5];
-               buf[5] = eerev.etheraddr[4];
-
-               buf[20] = 0x48;
-               buf[21] = 0xB2;
-
-               buf[22] = 0x00;
-               buf[23] = 0x04;
-
-               buf[24] = 0x14;
-               buf[25] = 0x33;
-
-               printf ("\nSRom:  Writing i82559 info ........ ");
-               if (eepro100_srom_store ((unsigned short *) buf) == -1)
-                       printf ("FAILED\n");
-               else
-                       printf ("OK\n");
-
-               /* update CRC */
-               eerev.crc =
-                       el_srom_checksum ((u_char *) eerev.board, eerev.size);
-
-               /* write new values */
-               printf ("\nSRom:  Writing revision info ...... ");
-               if (mpc107_srom_store
-                   ((BLOCK_SIZE - sizeof (revinfo)), (u_char *) & eerev,
-                    sizeof (revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
-                       printf ("FAILED\n\n");
-               else
-                       printf ("OK\n\n");
-
-               /* write new values as shadow image to nvram */
-               nvram_write (CONFIG_SYS_NV_SROM_COPY_ADDR, (void *) &eerev,
-                            CONFIG_SYS_SROM_SIZE);
-
-       }
-
-       /*if (initSrom) */
-       /* copy current values as shadow image to nvram */
-       if (initSrom == 0 && copyNv == 1)
-               nvram_write (CONFIG_SYS_NV_SROM_COPY_ADDR, (void *) &eerev,
-                            CONFIG_SYS_SROM_SIZE);
-
-       /* update environment */
-       sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
-                eerev.etheraddr[0], eerev.etheraddr[1],
-                eerev.etheraddr[2], eerev.etheraddr[3],
-                eerev.etheraddr[4], eerev.etheraddr[5]);
-       setenv ("ethaddr", buf);
-
-       /* print actual board identification */
-       printf ("Ident: %s  Ser %s  Rev %c%c\n",
-               eerev.board, (char *) &eerev.serial,
-               eerev.revision[0][0], eerev.revision[0][1]);
-
-       return (0);
-}
-
-/*----------------------------------------------------------------------------*/
diff --git a/board/eltec/elppc/mpc107_i2c.c b/board/eltec/elppc/mpc107_i2c.c
deleted file mode 100644 (file)
index 4f95703..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/* includes */
-#include <common.h>
-#include "srom.h"
-
-/* locals */
-static unsigned long mpc107_eumb_addr = 0;
-
-/*----------------------------------------------------------------------------*/
-
-/*
- * calculate checksum for ELTEC revision srom
- */
-unsigned long el_srom_checksum (ptr, size)
-register unsigned char *ptr;
-unsigned long size;
-{
-    u_long f, accu = 0;
-    u_int  i;
-    u_char byte;
-
-    for (; size; size--)
-    {
-       byte = *ptr++;
-       for (i = 8; i; i--)
-       {
-           f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
-           accu >>= 1; accu ^= f;
-           byte >>= 1;
-       }
-    }
-    return(accu);
-}
-
-/*----------------------------------------------------------------------------*/
-
-static int mpc107_i2c_wait ( unsigned long timeout )
-{
-    unsigned long x;
-
-    while (((x = in32r(MPC107_I2CSR)) & 0x82) != 0x82)
-    {
-       if (!timeout--)
-           return -1;
-    }
-
-    if (x & 0x10)
-    {
-       return -1;
-    }
-    out32r(MPC107_I2CSR, 0);
-
-    return 0;
-}
-
-/*----------------------------------------------------------------------------*/
-
-static int mpc107_i2c_wait_idle ( unsigned long timeout )
-{
-    while (in32r(MPC107_I2CSR) & 0x20)
-    {
-       if (!timeout--)
-           return -1;
-    }
-    return 0;
-}
-
-
-/*----------------------------------------------------------------------------*/
-
-int mpc107_i2c_read_byte (
-    unsigned char device,
-    unsigned char block,
-    unsigned char offset )
-{
-    unsigned long timeout = MPC107_I2C_TIMEOUT;
-    int data;
-
-    if (!mpc107_eumb_addr)
-       return -6;
-
-    mpc107_i2c_wait_idle (timeout);
-
-    /* Start with MEN */
-    out32r(MPC107_I2CCR, 0x80);
-
-    /* Start as master */
-    out32r(MPC107_I2CCR, 0xB0);
-    out32r(MPC107_I2CDR, (0xA0 | device | block));
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_read Error 1\n");
-       return -2;
-    }
-
-    if (in32r(MPC107_I2CSR)&0x1)
-    {
-       /* Generate STOP condition; device busy or not existing */
-       out32r(MPC107_I2CCR, 0x80);
-       return -1;
-    }
-
-    /* Data address */
-    out32r(MPC107_I2CDR, offset);
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_read Error 2\n");
-       return -3;
-    }
-
-    /* Switch to read - restart */
-    out32r(MPC107_I2CCR, 0xB4);
-    out32r(MPC107_I2CDR, (0xA1 | device | block));
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_read Error 3\n");
-       return -4;
-    }
-
-    out32r(MPC107_I2CCR, 0xA8); /* no ACK */
-    in32r(MPC107_I2CDR);
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_read Error 4\n");
-       return -5;
-    }
-    /* Generate STOP condition */
-    out32r(MPC107_I2CCR, 0x88);
-
-    /* read */
-    data = in32r(MPC107_I2CDR);
-
-    return (data);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int mpc107_i2c_write_byte (
-    unsigned char device,
-    unsigned char block,
-    unsigned char offset,
-    unsigned char val )
-{
-
-    unsigned long timeout = MPC107_I2C_TIMEOUT;
-
-    if (!mpc107_eumb_addr)
-       return -6;
-
-    mpc107_i2c_wait_idle(timeout);
-
-    /* Start with MEN */
-    out32r(MPC107_I2CCR, 0x80);
-
-    /* Start as master */
-    out32r(MPC107_I2CCR, 0xB0);
-    out32r(MPC107_I2CDR, (0xA0 | device | block));
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_write Error 1\n");
-       return -1;
-    }
-
-    /* Data address */
-    out32r(MPC107_I2CDR, offset);
-
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_write Error 2\n");
-       return -1;
-    }
-
-    /* Write */
-    out32r(MPC107_I2CDR, val);
-    if (mpc107_i2c_wait(timeout) < 0)
-    {
-       printf("mpc107_i2c_write Error 3\n");
-       return -1;
-    }
-
-    /* Generate Stop Condition */
-    out32r(MPC107_I2CCR, 0x80);
-
-    /* Return ACK or no ACK */
-    return (in32r(MPC107_I2CSR) & 0x01);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int mpc107_srom_load (
-    unsigned char addr,
-    unsigned char *pBuf,
-    int          cnt,
-    unsigned char device,
-    unsigned char block )
-{
-    register int i;
-    int val;
-    int timeout;
-
-    for (i = 0; i < cnt; i++)
-    {
-       timeout=100;
-       do
-       {
-           val = mpc107_i2c_read_byte (device, block, addr);
-           if (val < -1)
-           {
-           printf("i2c_read_error %d at dev %x block %x addr %x\n",
-                  val, device, block, addr);
-           return -1;
-           }
-           else if (timeout==0)
-           {
-               printf ("i2c_read_error: timeout at dev %x block %x addr %x\n",
-                       device, block, addr);
-               return -1;
-           }
-           timeout--;
-       } while (val == -1); /* if no ack: try again! */
-
-       *pBuf++ = (unsigned char)val;
-       addr++;
-
-       if ((addr == 0) && (i != cnt-1))    /* is it the same block ? */
-       {
-           if (block == FIRST_BLOCK)
-               block = SECOND_BLOCK;
-           else
-           {
-               printf ("ic2_read_error: read beyond 2. block !\n");
-               return -1;
-           }
-       }
-    }
-    udelay(100000);
-    return (cnt);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int mpc107_srom_store (
-    unsigned char addr,
-    unsigned char *pBuf,
-    int          cnt,
-    unsigned char device,
-    unsigned char block )
-{
-    register int i;
-
-    for (i = 0; i < cnt; i++)
-    {
-       while (mpc107_i2c_write_byte (device,block,addr,*pBuf) == 1);
-       addr++;
-       pBuf++;
-
-       if ((addr == 0) && (i != cnt-1))     /* is it the same block ? */
-       {
-           if (block == FIRST_BLOCK)
-               block = SECOND_BLOCK;
-           else
-           {
-               printf ("ic2_write_error: write beyond 2. block !\n");
-               return -1;
-           }
-       }
-    }
-    udelay(100000);
-    return(cnt);
-}
-
-/*----------------------------------------------------------------------------*/
-
-int mpc107_i2c_init ( unsigned long eumb_addr, unsigned long divider )
-{
-    unsigned long x;
-
-    if (eumb_addr)
-       mpc107_eumb_addr = eumb_addr;
-    else
-       return -1;
-
-    /* Set I2C clock */
-    x = in32r(MPC107_I2CFDR) & 0xffffff00;
-    out32r(MPC107_I2CFDR, (x | divider));
-
-    /* Clear arbitration */
-    out32r(MPC107_I2CSR, 0);
-
-    return mpc107_eumb_addr;
-}
-
-/*----------------------------------------------------------------------------*/
diff --git a/board/eltec/elppc/pci.c b/board/eltec/elppc/pci.c
deleted file mode 100644 (file)
index d81a41a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * PCI initialisation for the MPC10x.
- */
-
-#include <common.h>
-#include <pci.h>
-#include <mpc106.h>
-
-#ifdef CONFIG_PCI
-
-struct pci_controller local_hose;
-
-void pci_init_board(void)
-{
-    struct pci_controller* hose = (struct pci_controller *)&local_hose;
-    u16 reg16;
-
-    hose->first_busno = 0;
-    hose->last_busno = 0xff;
-
-    pci_set_region(hose->regions + 0,
-       CONFIG_SYS_PCI_MEMORY_BUS,
-       CONFIG_SYS_PCI_MEMORY_PHYS,
-       CONFIG_SYS_PCI_MEMORY_SIZE,
-       PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
-
-    /* PCI memory space */
-    pci_set_region(hose->regions + 1,
-       CONFIG_SYS_PCI_MEM_BUS,
-       CONFIG_SYS_PCI_MEM_PHYS,
-       CONFIG_SYS_PCI_MEM_SIZE,
-       PCI_REGION_MEM);
-
-    /* ISA/PCI memory space */
-    pci_set_region(hose->regions + 2,
-       CONFIG_SYS_ISA_MEM_BUS,
-       CONFIG_SYS_ISA_MEM_PHYS,
-       CONFIG_SYS_ISA_MEM_SIZE,
-       PCI_REGION_MEM);
-
-    /* PCI I/O space */
-    pci_set_region(hose->regions + 3,
-       CONFIG_SYS_PCI_IO_BUS,
-       CONFIG_SYS_PCI_IO_PHYS,
-       CONFIG_SYS_PCI_IO_SIZE,
-       PCI_REGION_IO);
-
-    /* ISA/PCI I/O space */
-    pci_set_region(hose->regions + 4,
-       CONFIG_SYS_ISA_IO_BUS,
-       CONFIG_SYS_ISA_IO_PHYS,
-       CONFIG_SYS_ISA_IO_SIZE,
-       PCI_REGION_IO);
-
-    hose->region_count = 5;
-
-    pci_setup_indirect(hose,
-       MPC106_REG_ADDR,
-       MPC106_REG_DATA);
-
-    pci_register_hose(hose);
-
-    hose->last_busno = pci_hose_scan(hose);
-
-    /* Initialises the MPC10x PCI Configuration regs. */
-    pci_read_config_word (PCI_BDF(0,0,0), PCI_COMMAND, &reg16);
-    reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
-    pci_write_config_word(PCI_BDF(0,0,0), PCI_COMMAND, reg16);
-
-    /* Clear non-reserved bits in status register */
-    pci_write_config_word(PCI_BDF(0,0,0), PCI_STATUS, 0xffff);
-}
-
-#endif /* CONFIG_PCI */
diff --git a/board/eltec/elppc/srom.h b/board/eltec/elppc/srom.h
deleted file mode 100644 (file)
index 662daf8..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/* common srom defs */
-#define FIRST_DEVICE            0x00
-#define SECOND_DEVICE           0x04
-#define FIRST_BLOCK             0x00
-#define SECOND_BLOCK            0x02
-#define BLOCK_SIZE              0x100
-#define ERROR                   (-1)
-
-#define CLK2P0TO1_1MB_PB_0P5DH  0x79000100
-#define CLK2P5TO1_1MB_PB_0P5DH  0x7B000100
-
-#define CPU_TYPE_740            0x08
-#define CPU_TYPE_750            0x08
-#define CPU_TYPE                ((get_pvr()>>16)&0xffff)
-
-#define ABS(x)                  ((x<0)?-x:x)
-#define SROM_SHORT(pX)          (*(u8 *)(pX) | *((u8 *)(pX)+1) << 8)
-
-/* bab7xx ELTEC srom */
-#define I2C_BUS_DAT             (CONFIG_SYS_ISA_IO + 0x220)
-#define I2C_BUS_DIR             (CONFIG_SYS_ISA_IO + 0x221)
-
-/* srom at mpc107 */
-#define MPC107_I2CADDR          (mpc107_eumb_addr + 0x3000)     /* address      */
-#define MPC107_I2CFDR           (mpc107_eumb_addr + 0x3004)     /* freq divider */
-#define MPC107_I2CCR            (mpc107_eumb_addr + 0x3008)     /* control      */
-#define MPC107_I2CSR            (mpc107_eumb_addr + 0x300c)     /* status       */
-#define MPC107_I2CDR            (mpc107_eumb_addr + 0x3010)     /* data         */
-#define MPC107_I2C_TIMEOUT      10000000
-
-/* i82559 */
-#define EE_ADDR_BITS            6
-#define EE_SIZE                 0x40                            /* 0x40 words */
-#define EE_CHECKSUM             0xBABA
-
-/* dc21143 */
-#define DEC_SROM_SIZE           128
-
-
-/*
- * structure of revision srom
- */
-typedef struct  {
-    char    magic[8];           /* 000 - Magic number */
-    char    revrev[2];          /* 008 - Revision of structure */
-    unsigned short size;        /* 00A - Size of CRC area */
-    unsigned long  crc;         /* 00C - CRC */
-    char    board[16];          /* 010 - Board Revision information */
-    char    option[4][16];      /* 020 - Option Revision information */
-    char    serial[8];          /* 060 - Board serial number */
-    char    etheraddr[6];       /* 068 - Ethernet node addresse */
-    char    reserved[2];        /* 06E - Reserved */
-    char    revision[7][2];     /* 070 - Revision codes */
-    char    category[2];        /* 07E - Category codes */
-    char    text[64];           /* 080 - Text field */
-    char    res[64];            /* 0C0 - Reserved */
-} revinfo;
-
-unsigned long el_srom_checksum (unsigned char *ptr, unsigned long size);
-int el_srom_load  (unsigned char addr, unsigned char *buf, int cnt,
-                  unsigned char device, unsigned char block);
-int el_srom_store (unsigned char addr, unsigned char *buf, int cnt,
-                  unsigned char device, unsigned char block);
-
-int mpc107_i2c_init (unsigned long eumb_addr, unsigned long divider);
-int mpc107_i2c_read_byte (unsigned char device, unsigned char block, unsigned char offset);
-int mpc107_i2c_write_byte (unsigned char device, unsigned char block,
-                          unsigned char offset, unsigned char val);
-int mpc107_srom_load (unsigned char addr, unsigned char *pBuf, int cnt,
-                     unsigned char device, unsigned char block);
-int mpc107_srom_store (unsigned char addr, unsigned char *pBuf, int cnt,
-                      unsigned char device, unsigned char block);
-
-int dc_srom_load (unsigned short *dest);
-int dc_srom_store (unsigned short *src);
-
-unsigned short eepro100_srom_checksum (unsigned short *sromdata);
-void eepro100_srom_load (unsigned short *destination);
-int  eepro100_srom_store (unsigned short *source);
diff --git a/board/esd/cpci5200/Kconfig b/board/esd/cpci5200/Kconfig
deleted file mode 100644 (file)
index ddd9418..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_CPCI5200
-
-config SYS_BOARD
-       default "cpci5200"
-
-config SYS_VENDOR
-       default "esd"
-
-config SYS_CONFIG_NAME
-       default "cpci5200"
-
-endif
diff --git a/board/esd/cpci5200/MAINTAINERS b/board/esd/cpci5200/MAINTAINERS
deleted file mode 100644 (file)
index 184d3cc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CPCI5200 BOARD
-M:     Reinhard Arlt <reinhard.arlt@esd-electronics.com>
-S:     Maintained
-F:     board/esd/cpci5200/
-F:     include/configs/cpci5200.h
-F:     configs/cpci5200_defconfig
diff --git a/board/esd/cpci5200/Makefile b/board/esd/cpci5200/Makefile
deleted file mode 100644 (file)
index 8421f54..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-# Objects for Xilinx JTAG programming (CPLD)
-# CPLD  = ../common/xilinx_jtag/lenval.o \
-#        ../common/xilinx_jtag/micro.o \
-#        ../common/xilinx_jtag/ports.o
-
-# obj-y        = cpci5200.o flash.o $(CPLD)
-obj-y  = cpci5200.o strataflash.o
diff --git a/board/esd/cpci5200/cpci5200.c b/board/esd/cpci5200/cpci5200.c
deleted file mode 100644 (file)
index 8bded0b..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * cpci5200.c - main board support/init for the esd cpci5200.
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <command.h>
-#include <netdev.h>
-
-#include "mt46v16m16-75.h"
-
-void init_ata_reset(void);
-
-static void sdram_start(int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register: extended mode */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-       __asm__ volatile ("sync");
-
-       /* set mode register: reset DLL */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-phys_size_t initdram(int board_type)
-{
-       ulong dramsize = 0;
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x80000000; /* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-       __asm__ volatile ("sync");
-
-       /* set tap delay */
-       *(vu_long *) MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-       __asm__ volatile ("sync");
-
-       /* find RAM size using SDRAM CS0 only */
-       sdram_start(0);
-       test1 = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE, 0x80000000);
-
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20)) {
-               dramsize = 0;
-       }
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(dramsize >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-       } else {
-#if 0
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0;  /* disabled */
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-#else
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(0x08000000 >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x08000000 + 0x0000001e;    /* 2G */
-#endif
-       }
-
-#if 0
-       /* find RAM size using SDRAM CS1 only */
-       sdram_start(0);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(1);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(0);
-#endif
-       /* set SDRAM CS1 size according to the amount of RAM found */
-
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize;   /* disabled */
-
-       init_ata_reset();
-       return (dramsize);
-}
-
-int checkboard(void)
-{
-       puts("Board: esd CPCI5200 (cpci5200)\n");
-       return 0;
-}
-
-void flash_preinit(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write
-        * access for detection process.
-        * Note that CS_BOOT cannot be cleared when
-        * executing in flash.
-        */
-       *(vu_long *) MPC5XXX_BOOTCS_CFG &= ~0x1;        /* clear RO */
-}
-
-void flash_afterinit(ulong size)
-{
-       if (size == 0x02000000) {
-               /* adjust mapping */
-               *(vu_long *) MPC5XXX_BOOTCS_START =
-                   *(vu_long *) MPC5XXX_CS0_START =
-                   START_REG(CONFIG_SYS_BOOTCS_START | size);
-               *(vu_long *) MPC5XXX_BOOTCS_STOP =
-                   *(vu_long *) MPC5XXX_CS0_STOP =
-                   STOP_REG(CONFIG_SYS_BOOTCS_START | size, size);
-       }
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void) {
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET)
-
-void init_ide_reset(void)
-{
-       debug("init_ide_reset\n");
-
-       /* Configure PSC1_4 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
-}
-
-void ide_set_reset(int idereset)
-{
-       debug("ide_reset(%d)\n", idereset);
-
-       if (idereset) {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_PSC1_4;
-       } else {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
-       }
-}
-#endif
-
-#define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
-#define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT  (MPC5XXX_GPIO + 0x0010)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_INPUT   (MPC5XXX_GPIO + 0x0014)
-
-#define MPC5XXX_INTERRUPT_GPIO_ENABLE      (MPC5XXX_GPIO + 0x0020)
-#define MPC5XXX_INTERRUPT_GPIO_DIR         (MPC5XXX_GPIO + 0x0028)
-#define MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT (MPC5XXX_GPIO + 0x002C)
-#define MPC5XXX_INTERRUPT_GPIO_STATUS      (MPC5XXX_GPIO + 0x003C)
-
-#define GPIO_WU6       0x40000000UL
-#define GPIO_USB0       0x00010000UL
-#define GPIO_USB9       0x08000000UL
-#define GPIO_USB9S      0x00080000UL
-
-void init_ata_reset(void)
-{
-       debug("init_ata_reset\n");
-
-       /* Configure GPIO_WU6 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_WU6;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT &= ~GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_ENABLE |= GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DIR |= GPIO_USB0;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT &= ~GPIO_USB9;
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_ENABLE &= ~GPIO_USB9;
-       __asm__ volatile ("sync");
-
-       if ((*(vu_long *) MPC5XXX_INTERRUPT_GPIO_STATUS & GPIO_USB9S) == 0) {
-               *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |= GPIO_USB0;
-               __asm__ volatile ("sync");
-       }
-}
-
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
-}
-
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
-{
-       unsigned int addr;
-       unsigned int size;
-       int i;
-       volatile unsigned long *ptr;
-
-       addr = simple_strtol(argv[1], NULL, 16);
-       size = simple_strtol(argv[2], NULL, 16);
-
-       printf("\nWriting at addr %08x, size %08x.\n", addr, size);
-
-       while (1) {
-               ptr = (volatile unsigned long *)addr;
-               for (i = 0; i < (size >> 2); i++) {
-                       *ptr++ = i;
-               }
-
-               /* Abort if ctrl-c was pressed */
-               if (ctrlc()) {
-                       puts("\nAbort\n");
-                       return 0;
-               }
-               putc('.');
-       }
-       return 0;
-}
-
-U_BOOT_CMD(writepci, 3, 1, do_writepci,
-          "Write some data to pcibus",
-          "<addr> <size>\n"
-          ""
-);
diff --git a/board/esd/cpci5200/mt46v16m16-75.h b/board/esd/cpci5200/mt46v16m16-75.h
deleted file mode 100644 (file)
index 63a4032..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1       /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x705f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/esd/cpci5200/strataflash.c b/board/esd/cpci5200/strataflash.c
deleted file mode 100644 (file)
index 7dc2e58..0000000
+++ /dev/null
@@ -1,786 +0,0 @@
-/*
- * (C) Copyright 2002
- * Brad Kemp, Seranoa Networks, Brad.Kemp@seranoa.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/processor.h>
-#include <asm/cache.h>
-
-#undef  DEBUG_FLASH
-/*
- * This file implements a Common Flash Interface (CFI) driver for U-Boot.
- * The width of the port and the width of the chips are determined at initialization.
- * These widths are used to calculate the address for access CFI data structures.
- * It has been tested on an Intel Strataflash implementation.
- *
- * References
- * JEDEC Standard JESD68 - Common Flash Interface (CFI)
- * JEDEC Standard JEP137-A Common Flash Interface (CFI) ID Codes
- * Intel Application Note 646 Common Flash Interface (CFI) and Command Sets
- * Intel 290667-008 3 Volt Intel StrataFlash Memory datasheet
- *
- * TODO
- * Use Primary Extended Query table (PRI) and Alternate Algorithm Query Table (ALT) to determine if protection is available
- * Add support for other command sets Use the PRI and ALT to determine command set
- * Verify erase and program timeouts.
- */
-
-#define FLASH_CMD_CFI                  0x98
-#define FLASH_CMD_READ_ID              0x90
-#define FLASH_CMD_RESET                        0xff
-#define FLASH_CMD_BLOCK_ERASE          0x20
-#define FLASH_CMD_ERASE_CONFIRM                0xD0
-#define FLASH_CMD_WRITE                        0x40
-#define FLASH_CMD_PROTECT              0x60
-#define FLASH_CMD_PROTECT_SET          0x01
-#define FLASH_CMD_PROTECT_CLEAR                0xD0
-#define FLASH_CMD_CLEAR_STATUS         0x50
-#define FLASH_CMD_WRITE_TO_BUFFER       0xE8
-#define FLASH_CMD_WRITE_BUFFER_CONFIRM  0xD0
-
-#define FLASH_STATUS_DONE              0x80
-#define FLASH_STATUS_ESS               0x40
-#define FLASH_STATUS_ECLBS             0x20
-#define FLASH_STATUS_PSLBS             0x10
-#define FLASH_STATUS_VPENS             0x08
-#define FLASH_STATUS_PSS               0x04
-#define FLASH_STATUS_DPS               0x02
-#define FLASH_STATUS_R                 0x01
-#define FLASH_STATUS_PROTECT           0x01
-
-#define FLASH_OFFSET_CFI               0x55
-#define FLASH_OFFSET_CFI_RESP          0x10
-#define FLASH_OFFSET_WTOUT             0x1F
-#define FLASH_OFFSET_WBTOUT             0x20
-#define FLASH_OFFSET_ETOUT             0x21
-#define FLASH_OFFSET_CETOUT             0x22
-#define FLASH_OFFSET_WMAX_TOUT         0x23
-#define FLASH_OFFSET_WBMAX_TOUT         0x24
-#define FLASH_OFFSET_EMAX_TOUT         0x25
-#define FLASH_OFFSET_CEMAX_TOUT         0x26
-#define FLASH_OFFSET_SIZE              0x27
-#define FLASH_OFFSET_INTERFACE          0x28
-#define FLASH_OFFSET_BUFFER_SIZE        0x2A
-#define FLASH_OFFSET_NUM_ERASE_REGIONS 0x2C
-#define FLASH_OFFSET_ERASE_REGIONS     0x2D
-#define FLASH_OFFSET_PROTECT           0x02
-#define FLASH_OFFSET_USER_PROTECTION    0x85
-#define FLASH_OFFSET_INTEL_PROTECTION   0x81
-
-#define FLASH_MAN_CFI                  0x01000000
-
-typedef union {
-       unsigned char c;
-       unsigned short w;
-       unsigned long l;
-} cfiword_t;
-
-typedef union {
-       unsigned char *cp;
-       unsigned short *wp;
-       unsigned long *lp;
-} cfiptr_t;
-
-#define NUM_ERASE_REGIONS 4
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips        */
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-
-static void flash_add_byte(flash_info_t * info, cfiword_t * cword, uchar c);
-static void flash_make_cmd(flash_info_t * info, uchar cmd, void *cmdbuf);
-static void flash_write_cmd(flash_info_t * info, int sect, uchar offset,
-                           uchar cmd);
-static int flash_isequal(flash_info_t * info, int sect, uchar offset,
-                        uchar cmd);
-static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd);
-static int flash_detect_cfi(flash_info_t * info);
-static ulong flash_get_size(ulong base, int banknum);
-static int flash_write_cfiword(flash_info_t * info, ulong dest,
-                              cfiword_t cword);
-static int flash_full_status_check(flash_info_t * info, ulong sector,
-                                  ulong tout, char *prompt);
-#ifdef CONFIG_SYS_FLASH_USE_BUFFER_WRITE
-static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp,
-                                int len);
-#endif
-/*-----------------------------------------------------------------------
- * create an address based on the offset and the port width
- */
-inline uchar *flash_make_addr(flash_info_t * info, int sect, int offset)
-{
-       return ((uchar *) (info->start[sect] + (offset * info->portwidth)));
-}
-
-/*-----------------------------------------------------------------------
- * read a character at a port width address
- */
-inline uchar flash_read_uchar(flash_info_t * info, uchar offset)
-{
-       uchar *cp;
-       cp = flash_make_addr(info, 0, offset);
-       return (cp[info->portwidth - 1]);
-}
-
-/*-----------------------------------------------------------------------
- * read a short word by swapping for ppc format.
- */
-ushort flash_read_ushort(flash_info_t * info, int sect, uchar offset)
-{
-       uchar *addr;
-
-       addr = flash_make_addr(info, sect, offset);
-       return ((addr[(2 * info->portwidth) - 1] << 8) |
-               addr[info->portwidth - 1]);
-
-}
-
-/*-----------------------------------------------------------------------
- * read a long word by picking the least significant byte of each maiximum
- * port size word. Swap for ppc format.
- */
-ulong flash_read_long(flash_info_t * info, int sect, uchar offset)
-{
-       uchar *addr;
-
-       addr = flash_make_addr(info, sect, offset);
-       return ((addr[(2 * info->portwidth) - 1] << 24) |
-               (addr[(info->portwidth) - 1] << 16) |
-               (addr[(4 * info->portwidth) - 1] << 8) |
-               addr[(3 * info->portwidth) - 1]);
-
-}
-
-/*-----------------------------------------------------------------------
- */
-unsigned long flash_init(void)
-{
-       unsigned long size;
-       int i;
-       unsigned long address;
-
-       /* The flash is positioned back to back, with the demultiplexing of the chip
-        * based on the A24 address line.
-        *
-        */
-
-       address = CONFIG_SYS_FLASH_BASE;
-       size = 0;
-
-       /* Init: no FLASHes known */
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-               size += flash_info[i].size = flash_get_size(address, i);
-               address += CONFIG_SYS_FLASH_INCREMENT;
-               if (flash_info[i].flash_id == FLASH_UNKNOWN) {
-                       printf
-                           ("## Unknown FLASH on Bank %d - Size = 0x%08lx = %ld MB\n",
-                            i, flash_info[0].size, flash_info[i].size << 20);
-               }
-       }
-
-#if 0                          /* test-only */
-       /* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE)
-       for (i = 0;
-            flash_info[0].start[i] < CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1;
-            i++)
-               (void)flash_real_protect(&flash_info[0], i, 1);
-#endif
-#endif
-
-       return (size);
-}
-
-/*-----------------------------------------------------------------------
- */
-int flash_erase(flash_info_t * info, int s_first, int s_last)
-{
-       int rcode = 0;
-       int prot;
-       int sect;
-
-       if (info->flash_id != FLASH_MAN_CFI) {
-               printf("Can't erase unknown flash type - aborted\n");
-               return 1;
-       }
-       if ((s_first < 0) || (s_first > s_last)) {
-               printf("- no sectors to erase\n");
-               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");
-       }
-
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_CLEAR_STATUS);
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_BLOCK_ERASE);
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_ERASE_CONFIRM);
-
-                       if (flash_full_status_check
-                           (info, sect, info->erase_blk_tout, "erase")) {
-                               rcode = 1;
-                       } else
-                               printf(".");
-               }
-       }
-       printf(" done\n");
-       return rcode;
-}
-
-/*-----------------------------------------------------------------------
- */
-void flash_print_info(flash_info_t * info)
-{
-       int i;
-
-       if (info->flash_id != FLASH_MAN_CFI) {
-               printf("missing or unknown FLASH type\n");
-               return;
-       }
-
-       printf("CFI conformant FLASH (%d x %d)",
-              (info->portwidth << 3), (info->chipwidth << 3));
-       printf("  Size: %ld MB in %d Sectors\n",
-              info->size >> 20, info->sector_count);
-       printf
-           (" Erase timeout %ld ms, write timeout %ld ms, buffer write timeout %ld ms, buffer size %d\n",
-            info->erase_blk_tout, info->write_tout, info->buffer_write_tout,
-            info->buffer_size);
-
-       printf("  Sector Start Addresses:");
-       for (i = 0; i < info->sector_count; ++i) {
-               if ((i % 5) == 0)
-                       printf("\n");
-               printf(" %08lX%5s",
-                      info->start[i], info->protect[i] ? " (RO)" : " ");
-       }
-       printf("\n");
-       return;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-       ulong wp;
-       ulong cp;
-       int aln;
-       cfiword_t cword;
-       int i, rc;
-
-       /* get lower aligned address */
-       wp = (addr & ~(info->portwidth - 1));
-
-       /* handle unaligned start */
-       if ((aln = addr - wp) != 0) {
-               cword.l = 0;
-               cp = wp;
-               for (i = 0; i < aln; ++i, ++cp)
-                       flash_add_byte(info, &cword, (*(uchar *) cp));
-
-               for (; (i < info->portwidth) && (cnt > 0); i++) {
-                       flash_add_byte(info, &cword, *src++);
-                       cnt--;
-                       cp++;
-               }
-               for (; (cnt == 0) && (i < info->portwidth); ++i, ++cp)
-                       flash_add_byte(info, &cword, (*(uchar *) cp));
-               if ((rc = flash_write_cfiword(info, wp, cword)) != 0)
-                       return rc;
-               wp = cp;
-       }
-#ifdef CONFIG_SYS_FLASH_USE_BUFFER_WRITE
-       while (cnt >= info->portwidth) {
-               i = info->buffer_size > cnt ? cnt : info->buffer_size;
-               if ((rc = flash_write_cfibuffer(info, wp, src, i)) != ERR_OK)
-                       return rc;
-               wp += i;
-               src += i;
-               cnt -= i;
-       }
-#else
-       /* handle the aligned part */
-       while (cnt >= info->portwidth) {
-               cword.l = 0;
-               for (i = 0; i < info->portwidth; i++) {
-                       flash_add_byte(info, &cword, *src++);
-               }
-               if ((rc = flash_write_cfiword(info, wp, cword)) != 0)
-                       return rc;
-               wp += info->portwidth;
-               cnt -= info->portwidth;
-       }
-#endif                         /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
-       if (cnt == 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       cword.l = 0;
-       for (i = 0, cp = wp; (i < info->portwidth) && (cnt > 0); ++i, ++cp) {
-               flash_add_byte(info, &cword, *src++);
-               --cnt;
-       }
-       for (; i < info->portwidth; ++i, ++cp) {
-               flash_add_byte(info, &cword, (*(uchar *) cp));
-       }
-
-       return flash_write_cfiword(info, wp, cword);
-}
-
-/*-----------------------------------------------------------------------
- */
-int flash_real_protect(flash_info_t * info, long sector, int prot)
-{
-       int retcode = 0;
-
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
-       if (prot)
-               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
-       else
-               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
-
-       if ((retcode =
-            flash_full_status_check(info, sector, info->erase_blk_tout,
-                                    prot ? "protect" : "unprotect")) == 0) {
-
-               info->protect[sector] = prot;
-               /* Intel's unprotect unprotects all locking */
-               if (prot == 0) {
-                       int i;
-                       for (i = 0; i < info->sector_count; i++) {
-                               if (info->protect[i])
-                                       flash_real_protect(info, i, 1);
-                       }
-               }
-       }
-
-       return retcode;
-}
-
-/*-----------------------------------------------------------------------
- *  wait for XSR.7 to be set. Time out with an error if it does not.
- *  This routine does not set the flash to read-array mode.
- */
-static int flash_status_check(flash_info_t * info, ulong sector, ulong tout,
-                             char *prompt)
-{
-       ulong start;
-
-       /* Wait for command completion */
-       start = get_timer(0);
-       while (!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
-               if (get_timer(start) > info->erase_blk_tout) {
-                       printf("Flash %s timeout at address %lx\n", prompt,
-                              info->start[sector]);
-                       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
-                       return ERR_TIMOUT;
-               }
-       }
-       return ERR_OK;
-}
-
-/*-----------------------------------------------------------------------
- * Wait for XSR.7 to be set, if it times out print an error, otherwise do a full status check.
- * This routine sets the flash to read-array mode.
- */
-static int flash_full_status_check(flash_info_t * info, ulong sector,
-                                  ulong tout, char *prompt)
-{
-       int retcode;
-       retcode = flash_status_check(info, sector, tout, prompt);
-       if ((retcode == ERR_OK)
-           && !flash_isequal(info, sector, 0, FLASH_STATUS_DONE)) {
-               retcode = ERR_INVAL;
-               printf("Flash %s error at address %lx\n", prompt,
-                      info->start[sector]);
-               if (flash_isset
-                   (info, sector, 0,
-                    FLASH_STATUS_ECLBS | FLASH_STATUS_PSLBS)) {
-                       printf("Command Sequence Error.\n");
-               } else if (flash_isset(info, sector, 0, FLASH_STATUS_ECLBS)) {
-                       printf("Block Erase Error.\n");
-                       retcode = ERR_NOT_ERASED;
-               } else if (flash_isset(info, sector, 0, FLASH_STATUS_PSLBS)) {
-                       printf("Locking Error\n");
-               }
-               if (flash_isset(info, sector, 0, FLASH_STATUS_DPS)) {
-                       printf("Block locked.\n");
-                       retcode = ERR_PROTECTED;
-               }
-               if (flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
-                       printf("Vpp Low Error.\n");
-       }
-       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
-       return retcode;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_add_byte(flash_info_t * info, cfiword_t * cword, uchar c)
-{
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               cword->c = c;
-               break;
-       case FLASH_CFI_16BIT:
-               cword->w = (cword->w << 8) | c;
-               break;
-       case FLASH_CFI_32BIT:
-               cword->l = (cword->l << 8) | c;
-       }
-}
-
-/*-----------------------------------------------------------------------
- * make a proper sized command based on the port and chip widths
- */
-static void flash_make_cmd(flash_info_t * info, uchar cmd, void *cmdbuf)
-{
-       int i;
-       uchar *cp = (uchar *) cmdbuf;
-       for (i = 0; i < info->portwidth; i++)
-               *cp++ = ((i + 1) % info->chipwidth) ? '\0' : cmd;
-}
-
-/*
- * Write a proper sized command to the correct address
- */
-static void flash_write_cmd(flash_info_t * info, int sect, uchar offset,
-                           uchar cmd)
-{
-
-       volatile cfiptr_t addr;
-       cfiword_t cword;
-       addr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               *addr.cp = cword.c;
-               break;
-       case FLASH_CFI_16BIT:
-               *addr.wp = cword.w;
-               break;
-       case FLASH_CFI_32BIT:
-               *addr.lp = cword.l;
-               break;
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-static int flash_isequal(flash_info_t * info, int sect, uchar offset, uchar cmd)
-{
-       cfiptr_t cptr;
-       cfiword_t cword;
-       int retval;
-       cptr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               retval = (cptr.cp[0] == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               retval = (cptr.wp[0] == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               retval = (cptr.lp[0] == cword.l);
-               break;
-       default:
-               retval = 0;
-               break;
-       }
-       return retval;
-}
-
-/*-----------------------------------------------------------------------
- */
-static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd)
-{
-       cfiptr_t cptr;
-       cfiword_t cword;
-       int retval;
-       cptr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               retval = ((cptr.cp[0] & cword.c) == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               retval = ((cptr.wp[0] & cword.w) == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               retval = ((cptr.lp[0] & cword.l) == cword.l);
-               break;
-       default:
-               retval = 0;
-               break;
-       }
-       return retval;
-}
-
-/*-----------------------------------------------------------------------
- * detect if flash is compatible with the Common Flash Interface (CFI)
- * http://www.jedec.org/download/search/jesd68.pdf
- *
- */
-static int flash_detect_cfi(flash_info_t * info)
-{
-
-       for (info->portwidth = FLASH_CFI_8BIT;
-            info->portwidth <= FLASH_CFI_32BIT; info->portwidth <<= 1) {
-               for (info->chipwidth = FLASH_CFI_BY8;
-                    info->chipwidth <= info->portwidth;
-                    info->chipwidth <<= 1) {
-                       flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
-                       flash_write_cmd(info, 0, FLASH_OFFSET_CFI,
-                                       FLASH_CMD_CFI);
-                       if (flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP, 'Q')
-                           && flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 1,
-                                            'R')
-                           && flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 2,
-                                            'Y'))
-                               return 1;
-               }
-       }
-       return 0;
-}
-
-/*
- * The following code cannot be run from FLASH!
- *
- */
-static ulong flash_get_size(ulong base, int banknum)
-{
-       flash_info_t *info = &flash_info[banknum];
-       int i, j;
-       int sect_cnt;
-       unsigned long sector;
-       unsigned long tmp;
-       int size_ratio = 0;
-       uchar num_erase_regions;
-       int erase_region_size;
-       int erase_region_count;
-
-       info->start[0] = base;
-#if 0
-       invalidate_dcache_range(base, base + 0x400);
-#endif
-       if (flash_detect_cfi(info)) {
-
-               size_ratio = info->portwidth / info->chipwidth;
-               num_erase_regions =
-                   flash_read_uchar(info, FLASH_OFFSET_NUM_ERASE_REGIONS);
-
-               sect_cnt = 0;
-               sector = base;
-               for (i = 0; i < num_erase_regions; i++) {
-                       if (i > NUM_ERASE_REGIONS) {
-                               printf("%d erase regions found, only %d used\n",
-                                      num_erase_regions, NUM_ERASE_REGIONS);
-                               break;
-                       }
-                       tmp =
-                           flash_read_long(info, 0,
-                                           FLASH_OFFSET_ERASE_REGIONS);
-                       erase_region_size =
-                           (tmp & 0xffff) ? ((tmp & 0xffff) * 256) : 128;
-                       tmp >>= 16;
-                       erase_region_count = (tmp & 0xffff) + 1;
-                       for (j = 0; j < erase_region_count; j++) {
-                               info->start[sect_cnt] = sector;
-                               sector += (erase_region_size * size_ratio);
-                               info->protect[sect_cnt] =
-                                   flash_isset(info, sect_cnt,
-                                               FLASH_OFFSET_PROTECT,
-                                               FLASH_STATUS_PROTECT);
-                               sect_cnt++;
-                       }
-               }
-
-               info->sector_count = sect_cnt;
-               /* multiply the size by the number of chips */
-               info->size =
-                   (1 << flash_read_uchar(info, FLASH_OFFSET_SIZE)) *
-                   size_ratio;
-               info->buffer_size =
-                   (1 << flash_read_ushort(info, 0, FLASH_OFFSET_BUFFER_SIZE));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_ETOUT);
-               info->erase_blk_tout =
-                   (tmp *
-                    (1 << flash_read_uchar(info, FLASH_OFFSET_EMAX_TOUT)));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WBTOUT);
-               info->buffer_write_tout =
-                   (tmp *
-                    (1 << flash_read_uchar(info, FLASH_OFFSET_WBMAX_TOUT)));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WTOUT);
-               info->write_tout =
-                   (tmp *
-                    (1 << flash_read_uchar(info, FLASH_OFFSET_WMAX_TOUT))) /
-                   1000;
-               info->flash_id = FLASH_MAN_CFI;
-       }
-
-       flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
-#ifdef DEBUG_FLASH
-       printf("portwidth=%d chipwidth=%d\n", info->portwidth, info->chipwidth);        /* test-only */
-#endif
-#ifdef DEBUG_FLASH
-       printf("found %d erase regions\n", num_erase_regions);
-#endif
-#ifdef DEBUG_FLASH
-       printf("size=%08x sectors=%08x \n", info->size, info->sector_count);
-#endif
-       return (info->size);
-}
-
-/*-----------------------------------------------------------------------
- */
-static int flash_write_cfiword(flash_info_t * info, ulong dest, cfiword_t cword)
-{
-
-       cfiptr_t cptr;
-       int flag;
-
-       cptr.cp = (uchar *)dest;
-
-       /* Check if Flash is (sufficiently) erased */
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               flag = ((cptr.cp[0] & cword.c) == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               flag = ((cptr.wp[0] & cword.w) == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               flag = ((cptr.lp[0] & cword.l) == cword.l);
-               break;
-       default:
-               return 2;
-       }
-       if (!flag)
-               return 2;
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       flash_write_cmd(info, 0, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, 0, 0, FLASH_CMD_WRITE);
-
-       switch (info->portwidth) {
-       case FLASH_CFI_8BIT:
-               cptr.cp[0] = cword.c;
-               break;
-       case FLASH_CFI_16BIT:
-               cptr.wp[0] = cword.w;
-               break;
-       case FLASH_CFI_32BIT:
-               cptr.lp[0] = cword.l;
-               break;
-       }
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-
-       return flash_full_status_check(info, 0, info->write_tout, "write");
-}
-
-#ifdef CONFIG_SYS_FLASH_USE_BUFFER_WRITE
-
-/* loop through the sectors from the highest address
- * when the passed address is greater or equal to the sector address
- * we have a match
- */
-static int find_sector(flash_info_t * info, ulong addr)
-{
-       int sector;
-       for (sector = info->sector_count - 1; sector >= 0; sector--) {
-               if (addr >= info->start[sector])
-                       break;
-       }
-       return sector;
-}
-
-static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp,
-                                int len)
-{
-
-       int sector;
-       int cnt;
-       int retcode;
-       volatile cfiptr_t src;
-       volatile cfiptr_t dst;
-
-       src.cp = cp;
-       dst.cp = (uchar *) dest;
-       sector = find_sector(info, dest);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_WRITE_TO_BUFFER);
-       if ((retcode = flash_status_check(info, sector, info->buffer_write_tout,
-                                         "write to buffer")) == ERR_OK) {
-               switch (info->portwidth) {
-               case FLASH_CFI_8BIT:
-                       cnt = len;
-                       break;
-               case FLASH_CFI_16BIT:
-                       cnt = len >> 1;
-                       break;
-               case FLASH_CFI_32BIT:
-                       cnt = len >> 2;
-                       break;
-               default:
-                       return ERR_INVAL;
-                       break;
-               }
-               flash_write_cmd(info, sector, 0, (uchar) cnt - 1);
-               while (cnt-- > 0) {
-                       switch (info->portwidth) {
-                       case FLASH_CFI_8BIT:
-                               *dst.cp++ = *src.cp++;
-                               break;
-                       case FLASH_CFI_16BIT:
-                               *dst.wp++ = *src.wp++;
-                               break;
-                       case FLASH_CFI_32BIT:
-                               *dst.lp++ = *src.lp++;
-                               break;
-                       default:
-                               return ERR_INVAL;
-                               break;
-                       }
-               }
-               flash_write_cmd(info, sector, 0,
-                               FLASH_CMD_WRITE_BUFFER_CONFIRM);
-               retcode =
-                   flash_full_status_check(info, sector,
-                                           info->buffer_write_tout,
-                                           "buffer write");
-       }
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       return retcode;
-}
-#endif                         /* CONFIG_SYS_USE_FLASH_BUFFER_WRITE */
diff --git a/board/esd/mecp5200/Kconfig b/board/esd/mecp5200/Kconfig
deleted file mode 100644 (file)
index cfd5307..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_MECP5200
-
-config SYS_BOARD
-       default "mecp5200"
-
-config SYS_VENDOR
-       default "esd"
-
-config SYS_CONFIG_NAME
-       default "mecp5200"
-
-endif
diff --git a/board/esd/mecp5200/MAINTAINERS b/board/esd/mecp5200/MAINTAINERS
deleted file mode 100644 (file)
index 05b7824..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-MECP5200 BOARD
-M:     Reinhard Arlt <reinhard.arlt@esd-electronics.com>
-S:     Maintained
-F:     board/esd/mecp5200/
-F:     include/configs/mecp5200.h
-F:     configs/mecp5200_defconfig
diff --git a/board/esd/mecp5200/Makefile b/board/esd/mecp5200/Makefile
deleted file mode 100644 (file)
index 3d66c9f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  = mecp5200.o
diff --git a/board/esd/mecp5200/mecp5200.c b/board/esd/mecp5200/mecp5200.c
deleted file mode 100644 (file)
index 17a70a9..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * pf5200.c - main board support/init for the esd pf5200.
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <command.h>
-#include <netdev.h>
-
-#include "mt46v16m16-75.h"
-
-void init_power_switch(void);
-
-static void sdram_start(int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register: extended mode */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-       __asm__ volatile ("sync");
-
-       /* set mode register: reset DLL */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-phys_size_t initdram(int board_type)
-{
-       ulong dramsize = 0;
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x80000000; /* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-       __asm__ volatile ("sync");
-
-       /* set tap delay */
-       *(vu_long *) MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-       __asm__ volatile ("sync");
-
-       /* find RAM size using SDRAM CS0 only */
-       sdram_start(0);
-       test1 = get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x80000000);
-
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20))
-               dramsize = 0;
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(dramsize >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-       } else {
-#if 0
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0;  /* disabled */
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-#else
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(0x08000000 >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x08000000 + 0x0000001e;    /* 2G */
-#endif
-       }
-
-#if 0
-       /* find RAM size using SDRAM CS1 only */
-       sdram_start(0);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(1);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(0);
-#endif
-       /* set SDRAM CS1 size according to the amount of RAM found */
-
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize;   /* disabled */
-
-       init_power_switch();
-       return (dramsize);
-}
-
-int checkboard(void)
-{
-       puts("Board: esd CPX CPU5200 (mecp5200)\n");
-       return 0;
-}
-
-void flash_preinit(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write
-        * access for detection process.
-        * Note that CS_BOOT cannot be cleared when
-        * executing in flash.
-        */
-       *(vu_long *) MPC5XXX_BOOTCS_CFG &= ~0x1;        /* clear RO */
-}
-
-void flash_afterinit(ulong size)
-{
-       if (size == CONFIG_SYS_FLASH_SIZE) {
-               /* adjust mapping */
-               *(vu_long *) MPC5XXX_BOOTCS_START =
-                   *(vu_long *) MPC5XXX_CS0_START =
-                   START_REG(CONFIG_SYS_BOOTCS_START | size);
-               *(vu_long *) MPC5XXX_BOOTCS_STOP =
-                   *(vu_long *) MPC5XXX_CS0_STOP =
-                   STOP_REG(CONFIG_SYS_BOOTCS_START | size, size);
-       }
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void)
-{
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
-
-#define GPIO_PSC1_4    0x01000000UL
-
-void init_ide_reset(void)
-{
-       debug("init_ide_reset\n");
-
-       /* Configure PSC1_4 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
-}
-
-void ide_set_reset(int idereset)
-{
-       debug("ide_reset(%d)\n", idereset);
-
-       if (idereset)
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_PSC1_4;
-       else
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
-}
-#endif
-
-#define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
-#define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT  (MPC5XXX_GPIO + 0x0010)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_INPUT   (MPC5XXX_GPIO + 0x0014)
-
-#define MPC5XXX_INTERRUPT_GPIO_ENABLE      (MPC5XXX_GPIO + 0x0020)
-#define MPC5XXX_INTERRUPT_GPIO_DIR         (MPC5XXX_GPIO + 0x0028)
-#define MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT (MPC5XXX_GPIO + 0x002C)
-#define MPC5XXX_INTERRUPT_GPIO_STATUS      (MPC5XXX_GPIO + 0x003C)
-
-#define GPIO_WU6       0x40000000UL
-#define GPIO_USB0       0x00010000UL
-#define GPIO_USB9       0x08000000UL
-#define GPIO_USB9S      0x00080000UL
-
-void init_power_switch(void)
-{
-       debug("init_power_switch\n");
-
-       /* Configure GPIO_WU6 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_WU6;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT &= ~GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_ENABLE |= GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DIR |= GPIO_USB0;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT &= ~GPIO_USB9;
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_ENABLE &= ~GPIO_USB9;
-       __asm__ volatile ("sync");
-
-       if ((*(vu_long *) MPC5XXX_INTERRUPT_GPIO_STATUS & GPIO_USB9S) == 0) {
-               *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |= GPIO_USB0;
-               __asm__ volatile ("sync");
-       }
-}
-
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
-}
diff --git a/board/esd/mecp5200/mt46v16m16-75.h b/board/esd/mecp5200/mt46v16m16-75.h
deleted file mode 100644 (file)
index 63a4032..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1       /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x705f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/esd/pf5200/Kconfig b/board/esd/pf5200/Kconfig
deleted file mode 100644 (file)
index c596e7a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_PF5200
-
-config SYS_BOARD
-       default "pf5200"
-
-config SYS_VENDOR
-       default "esd"
-
-config SYS_CONFIG_NAME
-       default "pf5200"
-
-endif
diff --git a/board/esd/pf5200/MAINTAINERS b/board/esd/pf5200/MAINTAINERS
deleted file mode 100644 (file)
index b6e624e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-PF5200 BOARD
-M:     Reinhard Arlt <reinhard.arlt@esd-electronics.com>
-S:     Maintained
-F:     board/esd/pf5200/
-F:     include/configs/pf5200.h
-F:     configs/pf5200_defconfig
diff --git a/board/esd/pf5200/Makefile b/board/esd/pf5200/Makefile
deleted file mode 100644 (file)
index a54289c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-# Objects for Xilinx JTAG programming (CPLD)
-# CPLD  = ../common/xilinx_jtag/lenval.o \
-#        ../common/xilinx_jtag/micro.o \
-#        ../common/xilinx_jtag/ports.o
-
-# obj-y        = pf5200.o flash.o $(CPLD)
-obj-y  = pf5200.o flash.o
diff --git a/board/esd/pf5200/flash.c b/board/esd/pf5200/flash.c
deleted file mode 100644 (file)
index e1b13bf..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips */
-
-typedef unsigned short FLASH_PORT_WIDTH;
-typedef volatile unsigned short FLASH_PORT_WIDTHV;
-
-#define FLASH_ID_MASK           0x00FF
-
-#define FPW                     FLASH_PORT_WIDTH
-#define FPWV                    FLASH_PORT_WIDTHV
-
-#define FLASH_CYCLE1            0x0555
-#define FLASH_CYCLE2            0x0aaa
-#define FLASH_ID1               0x00
-#define FLASH_ID2               0x01
-#define FLASH_ID3               0x0E
-#define FLASH_ID4               0x0F
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-static ulong flash_get_size(FPWV * addr, flash_info_t * info);
-static void flash_reset(flash_info_t * info);
-static int write_word_amd(flash_info_t * info, FPWV * dest, FPW data);
-static flash_info_t *flash_get_info(ulong base);
-
-/*-----------------------------------------------------------------------
- * flash_init()
- *
- * sets up flash_info and returns size of FLASH (bytes)
- */
-unsigned long flash_init(void)
-{
-       unsigned long size = 0;
-       int i = 0;
-       extern void flash_preinit(void);
-       extern void flash_afterinit(uint, ulong, ulong);
-
-       ulong flashbase = CONFIG_SYS_FLASH_BASE;
-
-       flash_preinit();
-
-       /* There is only ONE FLASH device */
-       memset(&flash_info[i], 0, sizeof(flash_info_t));
-       flash_info[i].size = flash_get_size((FPW *) flashbase, &flash_info[i]);
-       size += flash_info[i].size;
-
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-       /* monitor protection ON by default */
-       flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE,
-                     CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
-                     flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
-#ifdef  CONFIG_ENV_IS_IN_FLASH
-       /* ENV protection ON by default */
-       flash_protect(FLAG_PROTECT_SET, CONFIG_ENV_ADDR,
-                     CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
-                     flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
-       flash_afterinit(i, flash_info[i].start[0], flash_info[i].size);
-       return size ? size : 1;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_reset(flash_info_t * info) {
-       FPWV *base = (FPWV *) (info->start[0]);
-
-       /* Put FLASH back in read mode */
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
-               *base = (FPW) 0x00FF00FF;       /* Intel Read Mode */
-       } else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD) {
-               *base = (FPW) 0x00F000F0;       /* AMD Read Mode */
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-
-static flash_info_t *flash_get_info(ulong base) {
-       int i;
-       flash_info_t *info;
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
-               info = &flash_info[i];
-               if ((info->size) && (info->start[0] <= base)
-                   && (base <= info->start[0] + info->size - 1)) {
-                       break;
-               }
-       }
-       return (i == CONFIG_SYS_MAX_FLASH_BANKS ? 0 : info);
-}
-
-/*-----------------------------------------------------------------------
- */
-
-void flash_print_info(flash_info_t * info) {
-       int i;
-       char *fmt;
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               printf("missing or unknown FLASH type\n");
-               return;
-       }
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case FLASH_MAN_AMD:
-               printf("AMD ");
-               break;
-       default:
-               printf("Unknown Vendor ");
-               break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AMLV256U:
-               fmt = "29LV256M (256 Mbit)\n";
-               break;
-       default:
-               fmt = "Unknown Chip Type\n";
-               break;
-       }
-
-       printf(fmt);
-       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) {
-               ulong size;
-               int erased;
-               ulong *flash = (unsigned long *)info->start[i];
-
-               if ((i % 5) == 0) {
-                       printf("\n   ");
-               }
-
-               /*
-                * Check if whole sector is erased
-                */
-               size =
-                   (i !=
-                    (info->sector_count - 1)) ? (info->start[i + 1] -
-                                                 info->start[i]) >> 2 : (info->
-                                                                         start
-                                                                         [0] +
-                                                                         info->
-                                                                         size -
-                                                                         info->
-                                                                         start
-                                                                         [i])
-                   >> 2;
-
-               for (flash = (unsigned long *)info->start[i], erased = 1;
-                    (flash != (unsigned long *)info->start[i] + size)
-                    && erased; flash++) {
-                       erased = *flash == ~0x0UL;
-               }
-               printf(" %08lX %s %s", info->start[i], erased ? "E" : " ",
-                      info->protect[i] ? "(RO)" : "    ");
-       }
-
-       printf("\n");
-}
-
-/*-----------------------------------------------------------------------
- */
-
-/*
- * The following code cannot be run from FLASH!
- */
-
-ulong flash_get_size(FPWV * addr, flash_info_t * info) {
-       int i;
-
-       /* Write auto select command: read Manufacturer ID                     */
-       /* Write auto select command sequence and test FLASH answer            */
-       addr[FLASH_CYCLE1] = (FPW) 0x00AA00AA;  /* for AMD, Intel ignores this */
-       addr[FLASH_CYCLE2] = (FPW) 0x00550055;  /* for AMD, Intel ignores this */
-       addr[FLASH_CYCLE1] = (FPW) 0x00900090;  /* selects Intel or AMD        */
-
-       /* The manufacturer codes are only 1 byte, so just use 1 byte.         */
-       /* This works for any bus width and any FLASH device width.            */
-       udelay(100);
-       switch (addr[FLASH_ID1] & 0x00ff) {
-       case (uchar) AMD_MANUFACT:
-               info->flash_id = FLASH_MAN_AMD;
-               break;
-       default:
-               printf("unknown vendor=%x ", addr[FLASH_ID1] & 0xff);
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               break;
-       }
-
-       /* Check 16 bits or 32 bits of ID so work on 32 or 16 bit bus.     */
-       if (info->flash_id != FLASH_UNKNOWN) {
-               switch ((FPW) addr[FLASH_ID2]) {
-               case (FPW) AMD_ID_MIRROR:
-                       /* MIRROR BIT FLASH, read more ID bytes */
-                       if ((FPW) addr[FLASH_ID3] == (FPW) AMD_ID_LV256U_2
-                           && (FPW) addr[FLASH_ID4] == (FPW) AMD_ID_LV256U_3) {
-                               /* attention: only the first 16 MB will be used in u-boot */
-                               info->flash_id += FLASH_AMLV256U;
-                               info->sector_count = 512;
-                               info->size = 0x02000000;
-                               for (i = 0; i < info->sector_count; i++) {
-                                       info->start[i] =
-                                           (ulong) addr + 0x10000 * i;
-                               }
-                               break;
-                       }
-                       /* fall thru to here ! */
-               default:
-                       printf("unknown AMD device=%x %x %x",
-                              (FPW) addr[FLASH_ID2], (FPW) addr[FLASH_ID3],
-                              (FPW) addr[FLASH_ID4]);
-                       info->flash_id = FLASH_UNKNOWN;
-                       info->sector_count = 0;
-                       info->size = 0x800000;
-                       break;
-               }
-
-               /* Put FLASH back in read mode */
-               flash_reset(info);
-       }
-       return (info->size);
-}
-
-/*-----------------------------------------------------------------------
- */
-
-int flash_erase(flash_info_t * info, int s_first, int s_last) {
-       FPWV *addr;
-       int flag, prot, sect;
-       int intel = (info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL;
-       ulong start, now, last;
-       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;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AMLV256U:
-               break;
-       case FLASH_UNKNOWN:
-       default:
-               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");
-       }
-
-       last = get_timer(0);
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect <= s_last && rcode == 0; sect++) {
-               if (info->protect[sect] != 0) { /* protected, skip it */
-                       continue;
-               }
-               /* Disable interrupts which might cause a timeout here */
-               flag = disable_interrupts();
-
-               addr = (FPWV *) (info->start[sect]);
-               if (intel) {
-                       *addr = (FPW) 0x00500050;       /* clear status register */
-                       *addr = (FPW) 0x00200020;       /* erase setup */
-                       *addr = (FPW) 0x00D000D0;       /* erase confirm */
-               } else {
-                       /* must be AMD style if not Intel */
-                       FPWV *base;     /* first address in bank */
-
-                       base = (FPWV *) (info->start[0]);
-                       base[FLASH_CYCLE1] = (FPW) 0x00AA00AA;  /* unlock */
-                       base[FLASH_CYCLE2] = (FPW) 0x00550055;  /* unlock */
-                       base[FLASH_CYCLE1] = (FPW) 0x00800080;  /* erase mode */
-                       base[FLASH_CYCLE1] = (FPW) 0x00AA00AA;  /* unlock */
-                       base[FLASH_CYCLE2] = (FPW) 0x00550055;  /* unlock */
-                       *addr = (FPW) 0x00300030;       /* erase sector */
-               }
-
-               /* re-enable interrupts if necessary */
-               if (flag) {
-                       enable_interrupts();
-               }
-               start = get_timer(0);
-
-               /* wait at least 50us for AMD, 80us for Intel. */
-               /* Let's wait 1 ms.                            */
-               udelay(1000);
-
-               while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
-                       if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                               printf("Timeout\n");
-                               if (intel) {
-                                       /* suspend erase        */
-                                       *addr = (FPW) 0x00B000B0;
-                               }
-                               flash_reset(info);      /* reset to read mode */
-                               rcode = 1;      /* failed */
-                               break;
-                       }
-                       /* show that we're waiting */
-                       if ((get_timer(last)) > CONFIG_SYS_HZ) {
-                               /* every second */
-                               putc('.');
-                               last = get_timer(0);
-                       }
-               }
-               /* show that we're waiting */
-               if ((get_timer(last)) > CONFIG_SYS_HZ) {
-                       /* every second */
-                       putc('.');
-                       last = get_timer(0);
-               }
-               flash_reset(info);      /* reset to read mode */
-       }
-       printf(" done\n");
-       return (rcode);
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-       FPW data = 0;           /* 16 or 32 bit word, matches flash bus width on MPC8XX */
-       int bytes;              /* number of bytes to program in current word         */
-       int left;               /* number of bytes left to program                    */
-       int i, res;
-
-       for (left = cnt, res = 0;
-            left > 0 && res == 0;
-            addr += sizeof(data), left -= sizeof(data) - bytes) {
-
-               bytes = addr & (sizeof(data) - 1);
-               addr &= ~(sizeof(data) - 1);
-
-               /* combine source and destination data so can program
-                * an entire word of 16 or 32 bits
-                */
-               for (i = 0; i < sizeof(data); i++) {
-                       data <<= 8;
-                       if (i < bytes || i - bytes >= left)
-                               data += *((uchar *) addr + i);
-                       else
-                               data += *src++;
-               }
-
-               /* write one word to the flash */
-               switch (info->flash_id & FLASH_VENDMASK) {
-               case FLASH_MAN_AMD:
-                       res = write_word_amd(info, (FPWV *) addr, data);
-                       break;
-               default:
-                       /* unknown flash type, error! */
-                       printf("missing or unknown FLASH type\n");
-                       res = 1;        /* not really a timeout, but gives error */
-                       break;
-               }
-       }
-       return (res);
-}
-
-/*-----------------------------------------------------------------------
- * Write a word to Flash for AMD FLASH
- * A word is 16 or 32 bits, whichever the bus width of the flash bank
- * (not an individual chip) is.
- *
- * returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_word_amd(flash_info_t * info, FPWV * dest, FPW data) {
-       ulong start;
-       int flag;
-       int res = 0;            /* result, assume success       */
-       FPWV *base;             /* first address in flash bank  */
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*dest & data) != data) {
-               return (2);
-       }
-
-       base = (FPWV *) (info->start[0]);
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       base[FLASH_CYCLE1] = (FPW) 0x00AA00AA;  /* unlock */
-       base[FLASH_CYCLE2] = (FPW) 0x00550055;  /* unlock */
-       base[FLASH_CYCLE1] = (FPW) 0x00A000A0;  /* selects program mode */
-
-       *dest = data;           /* start programming the data   */
-
-       /* re-enable interrupts if necessary */
-       if (flag) {
-               enable_interrupts();
-       }
-       start = get_timer(0);
-
-       /* data polling for D7 */
-       while (res == 0
-              && (*dest & (FPW) 0x00800080) != (data & (FPW) 0x00800080)) {
-               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       *dest = (FPW) 0x00F000F0;       /* reset bank */
-                       res = 1;
-               }
-       }
-       return (res);
-}
diff --git a/board/esd/pf5200/mt46v16m16-75.h b/board/esd/pf5200/mt46v16m16-75.h
deleted file mode 100644 (file)
index 63a4032..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1       /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x705f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/esd/pf5200/pf5200.c b/board/esd/pf5200/pf5200.c
deleted file mode 100644 (file)
index 7a9ed22..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * pf5200.c - main board support/init for the esd pf5200.
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <command.h>
-#include <netdev.h>
-
-#include "mt46v16m16-75.h"
-
-void init_power_switch(void);
-
-static void sdram_start(int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register: extended mode */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-       __asm__ volatile ("sync");
-
-       /* set mode register: reset DLL */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL =
-           SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *) MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *) MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-phys_size_t initdram(int board_type)
-{
-       ulong dramsize = 0;
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x80000000; /* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *) MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-       __asm__ volatile ("sync");
-
-       /* set tap delay */
-       *(vu_long *) MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-       __asm__ volatile ("sync");
-
-       /* find RAM size using SDRAM CS0 only */
-       sdram_start(0);
-       test1 = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE, 0x80000000);
-
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20)) {
-               dramsize = 0;
-       }
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(dramsize >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-       } else {
-#if 0
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG = 0;  /* disabled */
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;      /* 2G */
-#else
-               *(vu_long *) MPC5XXX_SDRAM_CS0CFG =
-                   0x13 + __builtin_ffs(0x08000000 >> 20) - 1;
-               /* let SDRAM CS1 start right after CS0 */
-               *(vu_long *) MPC5XXX_SDRAM_CS1CFG = 0x08000000 + 0x0000001e;    /* 2G */
-#endif
-       }
-
-#if 0
-       /* find RAM size using SDRAM CS1 only */
-       sdram_start(0);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(1);
-       get_ram_size((ulong *) (CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       sdram_start(0);
-#endif
-       /* set SDRAM CS1 size according to the amount of RAM found */
-
-       *(vu_long *) MPC5XXX_SDRAM_CS1CFG = dramsize;   /* disabled */
-
-       init_power_switch();
-       return (dramsize);
-}
-
-int checkboard(void)
-{
-       puts("Board: esd ParaFinder (pf5200)\n");
-       return 0;
-}
-
-void flash_preinit(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write
-        * access for detection process.
-        * Note that CS_BOOT cannot be cleared when
-        * executing in flash.
-        */
-       *(vu_long *) MPC5XXX_BOOTCS_CFG &= ~0x1;        /* clear RO */
-}
-
-void flash_afterinit(ulong size)
-{
-       if (size == 0x02000000) {
-               /* adjust mapping */
-               *(vu_long *) MPC5XXX_BOOTCS_START =
-                   *(vu_long *) MPC5XXX_CS0_START =
-                   START_REG(CONFIG_SYS_BOOTCS_START | size);
-               *(vu_long *) MPC5XXX_BOOTCS_STOP =
-                   *(vu_long *) MPC5XXX_CS0_STOP =
-                   STOP_REG(CONFIG_SYS_BOOTCS_START | size, size);
-       }
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void) {
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
-
-void init_ide_reset(void)
-{
-       debug("init_ide_reset\n");
-
-       /* Configure PSC1_4 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
-}
-
-void ide_set_reset(int idereset)
-{
-       debug("ide_reset(%d)\n", idereset);
-
-       if (idereset) {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_PSC1_4;
-       } else {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
-       }
-}
-#endif
-
-#define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
-#define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT  (MPC5XXX_GPIO + 0x0010)
-#define MPC5XXX_SIMPLEIO_GPIO_DATA_INPUT   (MPC5XXX_GPIO + 0x0014)
-
-#define MPC5XXX_INTERRUPT_GPIO_ENABLE      (MPC5XXX_GPIO + 0x0020)
-#define MPC5XXX_INTERRUPT_GPIO_DIR         (MPC5XXX_GPIO + 0x0028)
-#define MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT (MPC5XXX_GPIO + 0x002C)
-#define MPC5XXX_INTERRUPT_GPIO_STATUS      (MPC5XXX_GPIO + 0x003C)
-
-#define GPIO_WU6       0x40000000UL
-#define GPIO_USB0       0x00010000UL
-#define GPIO_USB9       0x08000000UL
-#define GPIO_USB9S      0x00080000UL
-
-void init_power_switch(void)
-{
-       debug("init_power_switch\n");
-
-       /* Configure GPIO_WU6 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_WU6;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_WU6;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT &= ~GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_ENABLE |= GPIO_USB0;
-       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DIR |= GPIO_USB0;
-       __asm__ volatile ("sync");
-
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT &= ~GPIO_USB9;
-       *(vu_long *) MPC5XXX_INTERRUPT_GPIO_ENABLE &= ~GPIO_USB9;
-       __asm__ volatile ("sync");
-
-       if ((*(vu_long *) MPC5XXX_INTERRUPT_GPIO_STATUS & GPIO_USB9S) == 0) {
-               *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |= GPIO_USB0;
-               __asm__ volatile ("sync");
-       }
-       *(vu_char *) CONFIG_SYS_CS1_START = 0x02;       /* Red Power LED on */
-       __asm__ volatile ("sync");
-
-       *(vu_char *) (CONFIG_SYS_CS1_START + 1) = 0x02; /* Disable driver for KB11 */
-       __asm__ volatile ("sync");
-}
-
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
-}
-
-void power_set_reset(int power)
-{
-       debug("ide_set_reset(%d)\n", power);
-
-       if (power) {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_WU6;
-               *(vu_long *) MPC5XXX_INTERRUPT_GPIO_DATA_OUTPUT &= ~GPIO_USB9;
-       } else {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_WU6;
-               if ((*(vu_long *) MPC5XXX_INTERRUPT_GPIO_STATUS & GPIO_USB9S) ==
-                   0) {
-                       *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |=
-                           GPIO_USB0;
-               }
-
-       }
-}
-
-int do_poweroff(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
-{
-       power_set_reset(1);
-       return (0);
-}
-
-U_BOOT_CMD(poweroff, 1, 1, do_poweroff, "Switch off power", "");
-
-int phypower(int flag)
-{
-       u32 addr;
-       vu_long *reg;
-       int status;
-       pci_dev_t dev;
-
-       dev = PCI_BDF(0, 0x18, 0);
-       status = pci_read_config_dword(dev, PCI_BASE_ADDRESS_1, &addr);
-       if (status == 0) {
-               reg = (vu_long *) (addr + 0x00000040);
-               *reg |= 0x40000000;
-               __asm__ volatile ("sync");
-
-               reg = (vu_long *) (addr + 0x001000c);
-               *reg |= 0x20000000;
-               __asm__ volatile ("sync");
-
-               reg = (vu_long *) (addr + 0x0010004);
-               if (flag != 0) {
-                       *reg &= ~0x20000000;
-               } else {
-                       *reg |= 0x20000000;
-               }
-               __asm__ volatile ("sync");
-       }
-       return (status);
-}
-
-int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
-{
-       if (argv[1][0] == '0')
-               (void)phypower(0);
-       else
-               (void)phypower(1);
-
-       return (0);
-}
-
-U_BOOT_CMD(phypower, 2, 2, do_phypower,
-          "Switch power of ethernet phy", "");
-
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
-{
-       unsigned int addr;
-       unsigned int size;
-       int i;
-       volatile unsigned long *ptr;
-
-       addr = simple_strtol(argv[1], NULL, 16);
-       size = simple_strtol(argv[2], NULL, 16);
-
-       printf("\nWriting at addr %08x, size %08x.\n", addr, size);
-
-       while (1) {
-               ptr = (volatile unsigned long *)addr;
-               for (i = 0; i < (size >> 2); i++) {
-                       *ptr++ = i;
-               }
-
-               /* Abort if ctrl-c was pressed */
-               if (ctrlc()) {
-                       puts("\nAbort\n");
-                       return 0;
-               }
-               putc('.');
-       }
-       return 0;
-}
-
-U_BOOT_CMD(writepci, 3, 1, do_writepci,
-       "Write some data to pcibus",
-       "<addr> <size>\n"
-       ""
-);
diff --git a/board/evb64260/64260.h b/board/evb64260/64260.h
deleted file mode 100644 (file)
index d106ced..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __64260_H__
-#define __64260_H__
-
-/* CPU Configuration bits */
-#define CPU_CONF_ADDR_MISS_EN  (1 << 8)
-#define        CPU_CONF_AACK_DELAY     (1 << 11)
-#define        CPU_CONF_ENDIANESS      (1 << 12)
-#define CPU_CONF_PIPELINE      (1 << 13)
-#define CPU_CONF_TA_DELAY      (1 << 15)
-#define CPU_CONF_RD_OOO                (1 << 16)
-#define CPU_CONF_STOP_RETRY    (1 << 17)
-#define CPU_CONF_MULTI_DECODE  (1 << 18)
-#define CPU_CONF_DP_VALID      (1 << 19)
-#define CPU_CONF_PERR_PROP     (1 << 22)
-#define CPU_CONF_FAST_CLK      (1 << 23)
-#define CPU_CONF_AACK_DELAY_2  (1 << 25)
-#define CPU_CONF_AP_VALID      (1 << 26)
-#define CPU_CONF_REMAP_WR_DIS  (1 << 27)
-#define CPU_CONF_CONF_SB_DIS   (1 << 28)
-#define CPU_CONF_IO_SB_DIS     (1 << 29)
-#define CPU_CONF_CLK_SYNC      (1 << 30)
-
-/* CPU Master Control bits */
-#define CPU_MAST_CTL_ARB_EN    (1 << 8)
-#define CPU_MAST_CTL_MASK_BR_1 (1 << 9)
-#define CPU_MAST_CTL_M_WR_TRIG (1 << 10)
-#define CPU_MAST_CTL_M_RD_TRIG (1 << 11)
-#define CPU_MAST_CTL_CLEAN_BLK (1 << 12)
-#define CPU_MAST_CTL_FLUSH_BLK (1 << 13)
-
-#endif /* __64260_H__ */
diff --git a/board/evb64260/Kconfig b/board/evb64260/Kconfig
deleted file mode 100644 (file)
index 933e6d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-if TARGET_P3G4
-
-config SYS_BOARD
-       default "evb64260"
-
-config SYS_CONFIG_NAME
-       default "P3G4"
-
-endif
-
-if TARGET_ZUMA
-
-config SYS_BOARD
-       default "evb64260"
-
-config SYS_CONFIG_NAME
-       default "ZUMA"
-
-endif
diff --git a/board/evb64260/MAINTAINERS b/board/evb64260/MAINTAINERS
deleted file mode 100644 (file)
index d50dda5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-EVB64260 BOARD
-M:     Wolfgang Denk <wd@denx.de>
-S:     Maintained
-F:     board/evb64260/
-F:     include/configs/P3G4.h
-F:     configs/P3G4_defconfig
-
-ZUMA BOARD
-#M:    Nye Liu <nyet@zumanetworks.com>
-S:     Orphan (since 2014-04)
-F:     include/configs/ZUMA.h
-F:     configs/ZUMA_defconfig
diff --git a/board/evb64260/Makefile b/board/evb64260/Makefile
deleted file mode 100644 (file)
index ae2ebed..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# (C) Copyright 2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# (C) Copyright 2001
-# Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  = misc.o
-obj-y  += evb64260.o flash.o serial.o memory.o pci.o \
-         eth.o eth_addrtbl.o mpsc.o i2c.o \
-         sdram_init.o zuma_pbb.o intel_flash.o zuma_pbb_mbox.o
diff --git a/board/evb64260/README b/board/evb64260/README
deleted file mode 100644 (file)
index 74211de..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-This file contains status information for the port of U-Boot to the
-Galileo Evaluation Board.
-
-Author: Josh Huber <huber@mclx.com>
-       Mission Critical Linux, Inc.
-
-The support for the Galileo Evaluation board is fairly minimal now.
-It's sufficient to boot Linux, but doesn't provide too much more than
-what's required to do this.
-
-Both DUART channels are supported (to use the second one, you have to
-modify the board -- see the schematics for where to solder on the
-devices module).  The ethernet ports are supported, and the MPSC is
-supported as a console driver. (keep in mind that the kernel has no
-support for this yet)
-
-There are still occaisonal lockups with the MPSC console driver due to
-(we think!) overrun problems.  If you're looking for something stable
-to use for Linux development, consider sticking with the DUART console
-for now.
-
-Automatic memory sizing mostly works.  We've had problems with some
-combinations of memory.  Please send us email if you're having trouble
-with respect to the memory detection.
-
-Right now, only the 512k boot flash is supported.  Support for the
-16MB flash on the devices module is forthcoming.  Right now the flash
-is stored at the 256k boundry in flash, wasting a whole sector (64k!)
-for environment data.  This isn't really a big deal since we're not
-using the 512k for anything else. (Just U-Boot and the environment)
-
-Finally, here is a sample output session:
-
-U-Boot 1.0.0-pre1 (Jun  6 2001 - 12:45:11)
-
-Initializing...
-  CPU:   MPC7400 (altivec enabled) v2.9
-  Board: EVB64260
-  DRAM:  256 MB
-  FLASH: 512 kB
-  In:    serial
-  Out:   serial
-  Err:   serial
-
-=>
-
-The default configuration should be correct for the evaluation board,
-as it's shipped from Galileo.  Keep in mind that the default baudrate
-is set to 38400, 8N1.
-
-Good luck, and make sure to send any bugreports to us (or the
-u-boot-users list).
-
-Josh
diff --git a/board/evb64260/README.EVB-64260-750CX b/board/evb64260/README.EVB-64260-750CX
deleted file mode 100644 (file)
index 5ea38ea..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-The EVB-64260-750CX is quite similar to the EVB-64260-BP already
-supported except the following differences:
-* It has an IBM-750CXe soldiered on board instead of the slot-1 in the
-   BP.
-* It has a single PCI male connector instead of the 4 PCI female
-   connectors on the BP. It also gets power trough the PCI connector.
-* It has only a single DIMM slot instead of the 2 slots in the BP.
diff --git a/board/evb64260/bootseq.txt b/board/evb64260/bootseq.txt
deleted file mode 100644 (file)
index 6cae9ea..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-(cpu/mpc7xxx/start.S)
-
-start:
-    b boot_cold
-
-start_warm:
-    b boot_warm
-
-
-boot_cold:
-boot_warm:
-    clear bats
-    init l2 (if enabled)
-    init altivec (if enabled)
-    invalidate l2 (if enabled)
-    setup bats (from defines in config_EVB)
-    enable_addr_trans: (if MMU enabled)
-       enable MSR_IR and MSR_DR
-    jump to in_flash
-
-in_flash:
-    enable l1 dcache
-    gal_low_init: (board/evb64260/sdram_init.S)
-       config SDRAM (CFG, TIMING, DECODE)
-       init scratch regs (810 + 814)
-
-       detect DIMM0 (bank 0 only)
-       config SDRAM_PARA0 to 256/512Mbit
-       bl sdram_op_mode
-       detect bank0 width
-           write scratch reg 810
-       config SDRAM_PARA0 with results
-       config SDRAM_PARA1 with results
-
-       detect DIMM1 (bank 2 only)
-       config SDRAM_PARA2 to 256/512Mbit
-       detect bank2 width
-           write scratch reg 814
-       config SDRAM_PARA2 with results
-       config SDRAM_PARA3 with results
-
-       setup device bus timings/width
-       setup boot device timings/width
-
-       setup CPU_CONF (0x0)
-       setup cpu master control register 0x160
-       setup PCI0 TIMEOUT
-       setup PCI1 TIMEOUT
-       setup PCI0 BAR
-       setup PCI1 BAR
-
-       setup MPP control 0-3
-       setup GPP level control
-       setup Serial ports multiplex
-
-    setup stack pointer (r1)
-    setup GOT
-    call cpu_init_f
-       debug leds
-    board_init_f: (common/board.c)
-       board_early_init_f:
-           remap gt regs?
-           map PCI mem/io
-           map device space
-           clear out interrupts
-       init_timebase
-       env_init
-       serial_init
-       console_init_f
-       display_options
-       initdram: (board/evb64260/evb64260.c)
-           detect memory
-           for each bank:
-               dram_size()
-               setup PCI slave memory mappings
-               setup SCS
-       setup monitor
-       alloc board info struct
-       init bd struct
-       relocate_code: (cpu/mpc7xxx/start.S)
-           copy,got,clearbss
-           board_init_r(bd, dest_addr) (common/board.c)
-               setup bd function pointers
-               trap_init
-               flash_init: (board/evb64260/flash.c)
-               setup bd flash info
-               cpu_init_r: (cpu/mpc7xxx/cpu_init.c)
-                   nothing
-               mem_malloc_init
-               malloc_bin_reloc
-               spi_init (r or f)??? (CONFIG_ENV_IS_IN_EEPROM)
-               env_relocated
-               misc_init_r(bd): (board/evb64260/evb64260.c)
-                   mpsc_init2
diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c
deleted file mode 100644 (file)
index d7f63bd..0000000
+++ /dev/null
@@ -1,805 +0,0 @@
-/**************************************************************************
-Etherboot -  BOOTP/TFTP Bootstrap Program
-Skeleton NIC driver for Etherboot
-***************************************************************************/
-
-/*
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * This file is a modified version from the Galileo polled mode
- * network driver for the ethernet contained within the GT64260
- * chip. It has been modified to fit into the U-Boot framework, from
- * the original (etherboot) setup.  Also, additional cleanup and features
- * were added.
- *
- * - Josh Huber <huber@mclx.com>
- */
-
-#include <common.h>
-#include <malloc.h>
-#include <galileo/gt64260R.h>
-#include <galileo/core.h>
-#include <asm/cache.h>
-#include <miiphy.h>
-#include <net.h>
-#include <netdev.h>
-
-#include "eth.h"
-#include "eth_addrtbl.h"
-
-#if defined(CONFIG_CMD_NET)
-
-#define GT6426x_ETH_BUF_SIZE   1536
-
-/* if you like verbose output, turn this on! */
-#undef DEBUG
-
-/* Restart autoneg if we detect link is up on phy init. */
-
-/*
- * The GT doc's say that after Rst is deasserted, and the PHY
- * reports autoneg complete, it runs through its autoneg
- * procedures. This doesn't seem to be the case for MII
- * PHY's. To work around this check for link up && autoneg
- * complete when initilizing the port. If they are both set,
- * then restart PHY autoneg. Of course, it may be something
- * completly different.
- */
-#ifdef CONFIG_ETHER_PORT_MII
-# define RESTART_AUTONEG
-#endif
-
-/* do this if you dont want to use snooping */
-#define USE_SOFTWARE_CACHE_MANAGEMENT
-
-#ifdef USE_SOFTWARE_CACHE_MANAGEMENT
-#define FLUSH_DCACHE(a,b)                if(dcache_status()){clean_dcache_range((u32)(a),(u32)(b));}
-#define FLUSH_AND_INVALIDATE_DCACHE(a,b) if(dcache_status()){flush_dcache_range((u32)(a),(u32)(b));}
-#define INVALIDATE_DCACHE(a,b)           if(dcache_status()){invalidate_dcache_range((u32)(a),(u32)(b));}
-#else
-/* bummer - w/o flush, nothing works, even with snooping - FIXME */
-/* #define FLUSH_DCACHE(a,b) */
-#define FLUSH_DCACHE(a,b)                if(dcache_status()){clean_dcache_range((u32)(a),(u32)(b));}
-#define FLUSH_AND_INVALIDATE_DCACHE(a,b)
-#define INVALIDATE_DCACHE(a,b)
-#endif
-struct eth_dev_s {
-       eth0_tx_desc_single *eth_tx_desc;
-       eth0_rx_desc_single *eth_rx_desc;
-       char *eth_tx_buffer;
-       char *eth_rx_buffer[NR];
-       int tdn, rdn;
-       int dev;
-       unsigned int reg_base;
-};
-
-
-#ifdef CONFIG_INTEL_LXT97X
-/* for intel LXT972 */
-static const char ether_port_phy_addr[3]={0,1,2};
-#else
-static const char ether_port_phy_addr[3]={4,5,6};
-#endif
-
-/* MII PHY access routines are common for all i/f, use gal_ent0 */
-#define GT6426x_MII_DEVNAME    "gal_enet0"
-
-int gt6426x_miiphy_read(const char *devname, unsigned char phy,
-               unsigned char reg, unsigned short *val);
-
-static inline unsigned short
-miiphy_read_ret(unsigned short phy, unsigned short reg)
-{
-    unsigned short val;
-    gt6426x_miiphy_read(GT6426x_MII_DEVNAME,phy,reg,&val);
-    return val;
-}
-
-
-/**************************************************************************
-RESET - Reset adapter
-***************************************************************************/
-void
-gt6426x_eth_reset(void *v)
-{
-       /*  we should do something here...
-       struct eth_device *wp = (struct eth_device *)v;
-       struct eth_dev_s *p = wp->priv;
-       */
-
-       printf ("RESET\n");
-       /* put the card in its initial state */
-}
-
-static void gt6426x_handle_SMI(struct eth_dev_s *p, unsigned int icr)
-{
-#ifdef DEBUG
-    printf("SMI interrupt: ");
-
-    if(icr&0x20000000) {
-       printf("SMI done\n");
-    }
-#endif
-
-    if(icr&0x10000000) {
-#ifdef DEBUG
-       unsigned int psr;
-
-       psr=GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + p->reg_base);
-       printf("PHY state change:\n"
-              "  GT:%s:%s:%s:%s\n",
-               psr & 1 ? "100" : " 10",
-               psr & 8 ? " Link" : "nLink",
-               psr & 2 ? "FD" : "HD",
-               psr & 4 ? " FC" : "nFC");
-
-#ifdef CONFIG_INTEL_LXT97X /* non-standard mii reg (intel lxt972a) */
-       {
-               unsigned short mii_11;
-               mii_11 = miiphy_read_ret(ether_port_phy_addr[p->dev], 0x11);
-
-               printf(" mii:%s:%s:%s:%s %s:%s %s\n",
-                       mii_11 & (1 << 14) ? "100" : " 10",
-                       mii_11 & (1 << 10) ? " Link" : "nLink",
-                       mii_11 & (1 << 9) ? "FD" : "HD",
-                       mii_11 & (1 << 4) ? " FC" : "nFC",
-
-                       mii_11 & (1 << 7) ? "ANc" : "ANnc",
-                       mii_11 & (1 << 8) ? "AN" : "Manual",
-                       ""
-                       );
-       }
-#endif /* CONFIG_INTEL_LXT97X */
-#endif /* DEBUG */
-    }
-}
-
-static int
-gt6426x_eth_receive(struct eth_dev_s *p,unsigned int icr)
-{
-       int eth_len=0;
-       char *eth_data;
-
-       eth0_rx_desc_single *rx = &p->eth_rx_desc[(p->rdn)];
-
-       INVALIDATE_DCACHE((unsigned int)rx,(unsigned int)(rx+1));
-
-       if (rx->command_status & 0x80000000) {
-               return 0; /* No packet received */
-       }
-
-       eth_len = (unsigned int)
-               (rx->buff_size_byte_count) & 0x0000ffff;
-       eth_data = (char *) p->eth_rx_buffer[p->rdn];
-
-#ifdef DEBUG
-       if (eth_len) {
-               printf ("%s: Recived %d byte Packet @ 0x%p\n",
-                       __FUNCTION__, eth_len, eth_data);
-       }
-#endif
-       /*
-        * packet is now in:
-        * eth0_rx_buffer[RDN_ETH0];
-        */
-
-       /* let the upper layer handle the packet */
-       NetReceive ((uchar *)eth_data, eth_len);
-
-       rx->buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
-
-
-       /* GT96100 Owner */
-       rx->command_status = 0x80000000;
-
-       FLUSH_DCACHE((unsigned int)rx,(unsigned int)(rx+1));
-
-       p->rdn ++;
-       if (p->rdn == NR) {p->rdn = 0;}
-
-       sync();
-
-       /* Start Rx*/
-       GT_REG_WRITE (ETHERNET0_SDMA_COMMAND_REGISTER + p->reg_base, 0x00000080);
-
-#ifdef DEBUG
-       {
-           int i;
-           for (i=0;i<12;i++) {
-               printf(" %02x", eth_data[i]);
-           }
-       }
-       printf(": %d bytes\n", eth_len);
-#endif
-       INVALIDATE_DCACHE((unsigned int)eth_data,
-               (unsigned int)eth_data+eth_len);
-       return eth_len;
-}
-
-/**************************************************************************
-POLL - look for an rx frame, handle other conditions
-***************************************************************************/
-int
-gt6426x_eth_poll(void *v)
-{
-       struct eth_device *wp = (struct eth_device *)v;
-       struct eth_dev_s *p = wp->priv;
-       unsigned int icr=GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER + p->reg_base);
-
-       if(icr) {
-           GT_REG_WRITE(ETHERNET0_INTERRUPT_CAUSE_REGISTER +p->reg_base, 0);
-#ifdef DEBUG
-           printf("poll got ICR %08x\n", icr);
-#endif
-           /* SMI done or PHY state change*/
-           if(icr&0x30000000) gt6426x_handle_SMI(p, icr);
-       }
-       /* always process. We aren't using RX interrupts */
-       return gt6426x_eth_receive(p, icr);
-}
-
-/**************************************************************************
-TRANSMIT - Transmit a frame
-***************************************************************************/
-int gt6426x_eth_transmit(void *v, char *p, unsigned int s)
-{
-       struct eth_device *wp = (struct eth_device *)v;
-       struct eth_dev_s *dev = (struct eth_dev_s *)wp->priv;
-#ifdef DEBUG
-       unsigned int old_command_stat,old_psr;
-#endif
-       eth0_tx_desc_single *tx = &dev->eth_tx_desc[dev->tdn];
-
-       /* wait for tx to be ready */
-       INVALIDATE_DCACHE((unsigned int)tx,(unsigned int)(tx+1));
-       while (tx->command_status & 0x80000000) {
-           int i;
-           for(i=0;i<1000;i++);
-                       INVALIDATE_DCACHE((unsigned int)tx,(unsigned int)(tx+1));
-       }
-
-       GT_REG_WRITE (ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER0 + dev->reg_base,
-                     (unsigned int)tx);
-
-#ifdef DEBUG
-       printf("copying to tx_buffer [%p], length %x, desc = %p\n",
-              dev->eth_tx_buffer, s, dev->eth_tx_desc);
-#endif
-       memcpy(dev->eth_tx_buffer, (char *) p, s);
-
-       tx->buff_pointer = (uchar *)dev->eth_tx_buffer;
-       tx->bytecount_reserved = ((__u16)s) << 16;
-
-       /*    31 - own
-        *    22 - gencrc
-        * 18:16 - pad, last, first */
-       tx->command_status = (1<<31) | (1<<22) | (7<<16);
-#if 0
-       /* FEr #18 */
-       tx->next_desc = NULL;
-#else
-       tx->next_desc =
-               (struct eth0_tx_desc_struct *)
-               &dev->eth_tx_desc[(dev->tdn+1)%NT].bytecount_reserved;
-
-       /* cpu owned */
-       dev->eth_tx_desc[(dev->tdn+1)%NT].command_status = (7<<16);     /* pad, last, first */
-#endif
-
-#ifdef DEBUG
-       old_command_stat=tx->command_status,
-       old_psr=GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + dev->reg_base);
-#endif
-
-       FLUSH_DCACHE((unsigned int)tx,
-               (unsigned int)&dev->eth_tx_desc[(dev->tdn+2)%NT]);
-
-       FLUSH_DCACHE((unsigned int)dev->eth_tx_buffer,(unsigned int)dev->eth_tx_buffer+s);
-
-       GT_REG_WRITE(ETHERNET0_SDMA_COMMAND_REGISTER + dev->reg_base, 0x01000000);
-
-#ifdef DEBUG
-       {
-           unsigned int command_stat=0;
-           printf("cmd_stat: %08x PSR: %08x\n", old_command_stat, old_psr);
-           /* wait for tx to be ready */
-           do {
-               unsigned int psr=GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + dev->reg_base);
-               command_stat=tx->command_status;
-               if(command_stat!=old_command_stat || psr !=old_psr) {
-                   printf("cmd_stat: %08x PSR: %08x\n", command_stat, psr);
-                   old_command_stat = command_stat;
-                   old_psr = psr;
-               }
-               /* gt6426x_eth0_poll(); */
-           } while (command_stat & 0x80000000);
-
-           printf("sent %d byte frame\n", s);
-
-           if((command_stat & (3<<15)) == 3) {
-               printf("frame had error (stat=%08x)\n", command_stat);
-           }
-       }
-#endif
-       return 0;
-}
-
-/**************************************************************************
-DISABLE - Turn off ethernet interface
-***************************************************************************/
-void
-gt6426x_eth_disable(void *v)
-{
-       struct eth_device *wp = (struct eth_device *)v;
-       struct eth_dev_s *p = (struct eth_dev_s *)wp->priv;
-
-       GT_REG_WRITE(ETHERNET0_SDMA_COMMAND_REGISTER + p->reg_base, 0x80008000);
-}
-
-/**************************************************************************
-MII utilities - write: write to an MII register via SMI
-***************************************************************************/
-int
-gt6426x_miiphy_write(const char *devname, unsigned char phy,
-               unsigned char reg, unsigned short data)
-{
-    unsigned int temp= (reg<<21) | (phy<<16) | data;
-
-    while(GTREGREAD(ETHERNET_SMI_REGISTER) & (1<<28)); /* wait for !Busy */
-
-    GT_REG_WRITE(ETHERNET_SMI_REGISTER, temp);
-    return 0;
-}
-
-/**************************************************************************
-MII utilities - read: read from an MII register via SMI
-***************************************************************************/
-int
-gt6426x_miiphy_read(const char *devname, unsigned char phy,
-               unsigned char reg, unsigned short *val)
-{
-    unsigned int temp= (reg<<21) | (phy<<16) | 1<<26;
-
-    while(GTREGREAD(ETHERNET_SMI_REGISTER) & (1<<28)); /* wait for !Busy */
-
-    GT_REG_WRITE(ETHERNET_SMI_REGISTER, temp);
-
-    while(1) {
-       temp=GTREGREAD(ETHERNET_SMI_REGISTER);
-       if(temp & (1<<27)) break;               /* wait for ReadValid */
-    }
-    *val = temp & 0xffff;
-
-    return 0;
-}
-
-#ifdef DEBUG
-/**************************************************************************
-MII utilities - dump mii registers
-***************************************************************************/
-static void
-gt6426x_dump_mii(bd_t *bis, unsigned short phy)
-{
-       printf("mii reg 0 - 3:   %04x %04x %04x %04x\n",
-               miiphy_read_ret(phy, 0x0),
-               miiphy_read_ret(phy, 0x1),
-               miiphy_read_ret(phy, 0x2),
-               miiphy_read_ret(phy, 0x3)
-               );
-       printf("        4 - 7:   %04x %04x %04x %04x\n",
-               miiphy_read_ret(phy, 0x4),
-               miiphy_read_ret(phy, 0x5),
-               miiphy_read_ret(phy, 0x6),
-               miiphy_read_ret(phy, 0x7)
-               );
-       printf("        8:       %04x\n",
-               miiphy_read_ret(phy, 0x8)
-               );
-       printf("        16-19:   %04x %04x %04x %04x\n",
-               miiphy_read_ret(phy, 0x10),
-               miiphy_read_ret(phy, 0x11),
-               miiphy_read_ret(phy, 0x12),
-               miiphy_read_ret(phy, 0x13)
-               );
-       printf("        20,30:   %04x %04x\n",
-               miiphy_read_ret(phy, 20),
-               miiphy_read_ret(phy, 30)
-               );
-}
-#endif
-
-#ifdef RESTART_AUTONEG
-
-/* If link is up && autoneg compleate, and if
- * GT and PHY disagree about link capabilitys,
- * restart autoneg - something screwy with FD/HD
- * unless we do this. */
-static void
-check_phy_state(struct eth_dev_s *p)
-{
-       int bmsr = miiphy_read_ret(ether_port_phy_addr[p->dev], MII_BMSR);
-       int psr = GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + p->reg_base);
-
-       if ((psr & 1<<3) && (bmsr & BMSR_LSTATUS)) {
-               int nego = miiphy_read_ret(ether_port_phy_addr[p->dev], MII_ADVERTISE) &
-                               miiphy_read_ret(ether_port_phy_addr[p->dev], MII_LPA);
-               int want;
-
-               if (nego & LPA_100FULL) {
-                       want = 0x3;
-                       printf("MII: 100Base-TX, Full Duplex\n");
-               } else if (nego & LPA_100HALF) {
-                       want = 0x1;
-                       printf("MII: 100Base-TX, Half Duplex\n");
-               } else if (nego & LPA_10FULL) {
-                       want = 0x2;
-                       printf("MII: 10Base-T, Full Duplex\n");
-               } else if (nego & LPA_10HALF) {
-                       want = 0x0;
-                       printf("MII: 10Base-T, Half Duplex\n");
-               } else {
-                       printf("MII: Unknown link-foo! %x\n", nego);
-                       return;
-               }
-
-               if ((psr & 0x3) != want) {
-                       printf("MII: GT thinks %x, PHY thinks %x, restarting autoneg..\n",
-                                       psr & 0x3, want);
-                       miiphy_write(GT6426x_MII_DEVNAME,ether_port_phy_addr[p->dev],0,
-                                       miiphy_read_ret(ether_port_phy_addr[p->dev],0) | (1<<9));
-                       udelay(10000);  /* the EVB's GT takes a while to notice phy
-                                          went down and up */
-               }
-       }
-}
-#endif
-
-/**************************************************************************
-PROBE - Look for an adapter, this routine's visible to the outside
-***************************************************************************/
-int
-gt6426x_eth_probe(void *v, bd_t *bis)
-{
-       struct eth_device *wp = (struct eth_device *)v;
-       struct eth_dev_s *p = (struct eth_dev_s *)wp->priv;
-       int dev = p->dev;
-       unsigned int reg_base = p->reg_base;
-       unsigned long temp;
-       int i;
-
-       if (( dev < 0 ) || ( dev >= GAL_ETH_DEVS ))
-       {       /* This should never happen */
-               printf("%s: Invalid device %d\n", __FUNCTION__, dev );
-               return 0;
-       }
-
-#ifdef DEBUG
-       printf ("%s: initializing %s\n", __FUNCTION__, wp->name );
-       printf ("\nCOMM_CONTROL = %08x , COMM_CONF = %08x\n",
-               GTREGREAD(COMM_UNIT_ARBITER_CONTROL),
-               GTREGREAD(COMM_UNIT_ARBITER_CONFIGURATION_REGISTER));
-#endif
-
-       /* clear MIB counters */
-       for(i=0;i<255; i++)
-           temp=GTREGREAD(ETHERNET0_MIB_COUNTER_BASE + reg_base +i);
-
-#ifdef CONFIG_INTEL_LXT97X
-       /* for intel LXT972 */
-
-       /* led 1: 0x1=txact
-          led 2: 0xc=link/rxact
-          led 3: 0x2=rxact (N/C)
-          strch: 0,2=30 ms, enable */
-       miiphy_write(GT6426x_MII_DEVNAME,ether_port_phy_addr[p->dev], 20, 0x1c22);
-
-       /* 2.7ns port rise time */
-       /*miiphy_write(ether_port_phy_addr[p->dev], 30, 0x0<<10); */
-#else
-       /* already set up in mpsc.c */
-       /*GT_REG_WRITE(MAIN_ROUTING_REGISTER, 0x7ffe38);        /  b400 */
-
-       /* already set up in sdram_init.S... */
-       /* MPSC0, MPSC1, RMII */
-       /*GT_REG_WRITE(SERIAL_PORT_MULTIPLEX, 0x1102);          /  f010 */
-#endif
-       GT_REG_WRITE(ETHERNET_PHY_ADDRESS_REGISTER,
-            ether_port_phy_addr[0]     |
-           (ether_port_phy_addr[1]<<5) |
-           (ether_port_phy_addr[2]<<10));                      /* 2000 */
-
-       /* 13:12 -   10: 4x64bit burst  (cache line size = 32 bytes)
-        *    9  -    1: RIFB - interrupt on frame boundaries only
-        *  6:7  -   00: big endian rx and tx
-        *  5:2  - 1111: 15 retries */
-       GT_REG_WRITE(ETHERNET0_SDMA_CONFIGURATION_REGISTER + reg_base,
-               (2<<12) | (1<<9) | (0xf<<2) );                  /* 2440 */
-
-#ifndef USE_SOFTWARE_CACHE_MANAGEMENT
-       /* enable rx/tx desc/buffer cache snoop */
-       GT_REG_READ(ETHERNET_0_ADDRESS_CONTROL_LOW + dev*0x20,
-               &temp);                                         /* f200 */
-       temp|= (1<<6)| (1<<14)| (1<<22)| (1<<30);
-       GT_REG_WRITE(ETHERNET_0_ADDRESS_CONTROL_LOW + dev*0x20,
-               temp);
-#endif
-
-       /* 31  28 27  24 23  20 19  16
-        *  0000   0000   0000   0000   [0004]
-        * 15  12 11  8   7  4   3  0
-        *  1000   1101   0000   0000   [4d00]
-        *    20 - 0=MII 1=RMII
-        *    19 - 0=speed autoneg
-        * 15:14 - framesize 1536 (GT6426x_ETH_BUF_SIZE)
-        *    11 - no force link pass
-        *    10 - 1=disable fctl autoneg
-        *     8 - override prio ?? */
-       temp = 0x00004d00;
-#ifndef CONFIG_ETHER_PORT_MII
-       temp |= (1<<20);        /* RMII */
-#endif
-       /* set En */
-       GT_REG_WRITE(ETHERNET0_PORT_CONFIGURATION_EXTEND_REGISTER + reg_base,
-                    temp);                             /* 2408 */
-
-       /* hardcode E1 also? */
-       /* -- according to dox, this is safer due to extra pulldowns? */
-       if (dev<2) {
-       GT_REG_WRITE(ETHERNET0_PORT_CONFIGURATION_EXTEND_REGISTER + (dev+1) * 0x400,
-                    temp);                             /* 2408 */
-       }
-
-       /* wake up MAC */                                /* 2400 */
-       GT_REG_READ(ETHERNET0_PORT_CONFIGURATION_REGISTER + reg_base, &temp);
-       temp |= (1<<7);         /* enable port */
-#ifdef CONFIG_GT_USE_MAC_HASH_TABLE
-       temp |= (1<<12);        /* hash size 1/2k */
-#else
-       temp |= 1;              /* promisc */
-#endif
-       GT_REG_WRITE(ETHERNET0_PORT_CONFIGURATION_REGISTER + reg_base, temp);
-                                                       /* 2400 */
-
-#ifdef RESTART_AUTONEG
-       check_phy_state(p);
-#endif
-
-       printf("%s: Waiting for link up..\n", wp->name);
-       temp = 10 * 1000;
-       /* wait for link back up */
-       while(!(GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + reg_base) & 8)
-                       && (--temp > 0)){
-           udelay(1000);       /* wait 1 ms */
-       }
-       if ( temp == 0) {
-               printf("%s: Failed!\n", wp->name);
-               return (0);
-       }
-
-       printf("%s: OK!\n", wp->name);
-
-       p->tdn = 0;
-       p->rdn = 0;
-       p->eth_tx_desc[p->tdn].command_status = 0;
-
-       /* Initialize Rx Side */
-       for (temp = 0; temp < NR; temp++) {
-               p->eth_rx_desc[temp].buff_pointer = (uchar *)p->eth_rx_buffer[temp];
-               p->eth_rx_desc[temp].buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
-
-               /* GT96100 Owner */
-               p->eth_rx_desc[temp].command_status = 0x80000000;
-               p->eth_rx_desc[temp].next_desc =
-                       (struct eth0_rx_desc_struct *)
-                       &p->eth_rx_desc[(temp+1)%NR].buff_size_byte_count;
-       }
-
-       FLUSH_DCACHE((unsigned int)&p->eth_tx_desc[0],
-                    (unsigned int)&p->eth_tx_desc[NR]);
-       FLUSH_DCACHE((unsigned int)&p->eth_rx_desc[0],
-                    (unsigned int)&p->eth_rx_desc[NR]);
-
-       GT_REG_WRITE(ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER0 + reg_base,
-                     (unsigned int) p->eth_tx_desc);
-       GT_REG_WRITE(ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER0 + reg_base,
-                     (unsigned int) p->eth_rx_desc);
-       GT_REG_WRITE(ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER0 + reg_base,
-                     (unsigned int) p->eth_rx_desc);
-
-#ifdef DEBUG
-       printf ("\nRx descriptor pointer is %08x %08x\n",
-               GTREGREAD(ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER0 + reg_base),
-               GTREGREAD(ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER0 + reg_base));
-       printf ("\n\n%08x %08x\n",
-               (unsigned int)p->eth_rx_desc,p->eth_rx_desc[0].command_status);
-
-       printf ("Descriptor dump:\n");
-       printf ("cmd status: %08x\n",p->eth_rx_desc[0].command_status);
-       printf ("byte_count: %08x\n",p->eth_rx_desc[0].buff_size_byte_count);
-       printf ("buff_ptr: %08x\n",(unsigned int)p->eth_rx_desc[0].buff_pointer);
-       printf ("next_desc: %08x\n\n",(unsigned int)p->eth_rx_desc[0].next_desc);
-       printf ("%08x\n",*(unsigned int *) ((unsigned int)p->eth_rx_desc + 0x0));
-       printf ("%08x\n",*(unsigned int *) ((unsigned int)p->eth_rx_desc + 0x4));
-       printf ("%08x\n",*(unsigned int *) ((unsigned int)p->eth_rx_desc + 0x8));
-       printf ("%08x\n\n",
-               *(unsigned int *) ((unsigned int)p->eth_rx_desc + 0xc));
-#endif
-
-#ifdef DEBUG
-       gt6426x_dump_mii(bis,ether_port_phy_addr[p->dev]);
-#endif
-
-#ifdef CONFIG_GT_USE_MAC_HASH_TABLE
-       {
-               unsigned int hashtable_base;
-           u8 *b = (u8 *)(wp->enetaddr);
-               u32 macH, macL;
-
-               /* twist the MAC up into the way the discovery wants it */
-               macH= (b[0]<<8) | b[1];
-           macL= (b[2]<<24) | (b[3]<<16) | (b[4]<<8) | b[5];
-
-           /* mode 0, size 0x800 */
-           hashtable_base =initAddressTable(dev,0,1);
-
-           if(!hashtable_base) {
-                       printf("initAddressTable failed\n");
-                       return 0;
-           }
-
-           addAddressTableEntry(dev, macH, macL, 1, 0);
-           GT_REG_WRITE(ETHERNET0_HASH_TABLE_POINTER_REGISTER + reg_base,
-                   hashtable_base);
-       }
-#endif
-
-       /* Start Rx*/
-       GT_REG_WRITE(ETHERNET0_SDMA_COMMAND_REGISTER + reg_base, 0x00000080);
-       printf("%s: gt6426x eth device %d init success \n", wp->name, dev );
-       return 1;
-}
-
-/* enter all the galileo ethernet devs into MULTI-BOOT */
-void
-gt6426x_eth_initialize(bd_t *bis)
-{
-       struct eth_device *dev;
-       struct eth_dev_s *p;
-       int devnum, x, temp;
-       char *s, *e, buf[64];
-
-#ifdef DEBUG
-       printf( "\n%s\n", __FUNCTION );
-#endif
-
-       for (devnum = 0; devnum < GAL_ETH_DEVS; devnum++) {
-               dev = calloc(sizeof(*dev), 1);
-               if (!dev) {
-                       printf( "%s: gal_enet%d allocation failure, %s\n",
-                                       __FUNCTION__, devnum, "eth_device structure");
-                       return;
-               }
-
-               /* must be less than sizeof(dev->name) */
-               sprintf(dev->name, "gal_enet%d", devnum);
-
-#ifdef DEBUG
-               printf( "Initializing %s\n", dev->name );
-#endif
-
-               /* Extract the MAC address from the environment */
-               switch (devnum)
-               {
-                       case 0: s = "ethaddr"; break;
-#if (GAL_ETH_DEVS > 1)
-                       case 1: s = "eth1addr"; break;
-#endif
-#if (GAL_ETH_DEVS > 2)
-                       case 2: s = "eth2addr"; break;
-#endif
-                       default: /* this should never happen */
-                               printf( "%s: Invalid device number %d\n",
-                                               __FUNCTION__, devnum );
-                               return;
-               }
-
-               temp = getenv_f(s, buf, sizeof(buf));
-               s = (temp > 0) ? buf : NULL;
-
-#ifdef DEBUG
-               printf ("Setting MAC %d to %s\n", devnum, s );
-#endif
-               for (x = 0; x < 6; ++x) {
-                       dev->enetaddr[x] = s ? simple_strtoul(s, &e, 16) : 0;
-                       if (s)
-                               s = (*e) ? e+1 : e;
-               }
-
-               dev->init = (void*)gt6426x_eth_probe;
-               dev->halt = (void*)gt6426x_eth_reset;
-               dev->send = (void*)gt6426x_eth_transmit;
-               dev->recv = (void*)gt6426x_eth_poll;
-
-               p = calloc( sizeof(*p), 1 );
-               dev->priv = (void*)p;
-               if (!p)
-               {
-                       printf( "%s: %s allocation failure, %s\n",
-                                       __FUNCTION__, dev->name, "Private Device Structure");
-                       free(dev);
-                       return;
-               }
-
-               p->dev = devnum;
-               p->tdn=0;
-               p->rdn=0;
-               p->reg_base = devnum * ETHERNET_PORTS_DIFFERENCE_OFFSETS;
-
-               p->eth_tx_desc =
-                       (eth0_tx_desc_single *)
-                       (((unsigned int) malloc(sizeof (eth0_tx_desc_single) *
-                                               (NT+1)) & 0xfffffff0) + 0x10);
-               if (!p)
-               {
-                       printf( "%s: %s allocation failure, %s\n",
-                                       __FUNCTION__, dev->name, "Tx Descriptor");
-                       free(dev);
-                       return;
-               }
-
-               p->eth_rx_desc =
-                       (eth0_rx_desc_single *)
-                       (((unsigned int) malloc(sizeof (eth0_rx_desc_single) *
-                                               (NR+1)) & 0xfffffff0) + 0x10);
-               if (!p->eth_rx_desc)
-               {
-                       printf( "%s: %s allocation failure, %s\n",
-                                       __FUNCTION__, dev->name, "Rx Descriptor");
-                       free(dev);
-                       free(p);
-                       return;
-               }
-
-               p->eth_tx_buffer =
-                       (char *) (((unsigned int) malloc(GT6426x_ETH_BUF_SIZE) & 0xfffffff0) + 0x10);
-               if (!p->eth_tx_buffer)
-               {
-                       printf( "%s: %s allocation failure, %s\n",
-                                       __FUNCTION__, dev->name, "Tx Bufffer");
-                       free(dev);
-                       free(p);
-                       free(p->eth_rx_desc);
-                       return;
-               }
-
-               for (temp = 0 ; temp < NR ; temp ++) {
-                       p->eth_rx_buffer[temp] =
-                               (char *)
-                               (((unsigned int) malloc(GT6426x_ETH_BUF_SIZE) & 0xfffffff0) + 0x10);
-                       if (!p->eth_rx_buffer[temp])
-                       {
-                               printf( "%s: %s allocation failure, %s\n",
-                                               __FUNCTION__, dev->name, "Rx Buffers");
-                               free(dev);
-                               free(p);
-                               free(p->eth_tx_buffer);
-                               free(p->eth_rx_desc);
-                               free(p->eth_tx_desc);
-                               while (temp >= 0)
-                                       free(p->eth_rx_buffer[--temp]);
-                               return;
-                       }
-               }
-
-
-               eth_register(dev);
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
-               miiphy_register(dev->name,
-                               gt6426x_miiphy_read, gt6426x_miiphy_write);
-#endif
-       }
-
-}
-#endif
diff --git a/board/evb64260/eth.h b/board/evb64260/eth.h
deleted file mode 100644 (file)
index 99581f0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * eth.h - header file for the polled mode GT ethernet driver
- */
-
-#ifndef __GT6426x_ETH_H__
-#define __GT6426x_ETH_H__
-
-#include <asm/types.h>
-#include <asm/io.h>
-#include <asm/byteorder.h>
-#include <common.h>
-
-typedef struct eth0_tx_desc_struct {
-       volatile __u32 bytecount_reserved;
-       volatile __u32 command_status;
-       volatile struct eth0_tx_desc_struct * next_desc;
-       /* Note - the following will not work for 64 bit addressing */
-       volatile unsigned char * buff_pointer;
-} __attribute__ ((packed)) eth0_tx_desc_single;
-
-typedef struct eth0_rx_desc_struct {
-  volatile __u32 buff_size_byte_count;
-  volatile __u32 command_status;
-  volatile struct eth0_rx_desc_struct * next_desc;
-  volatile unsigned char * buff_pointer;
-} __attribute__ ((packed)) eth0_rx_desc_single;
-
-#define NT 20 /* Number of Transmit buffers */
-#define NR 20 /* Number of Receive buffers */
-#define MAX_BUFF_SIZE (1536+2*CACHE_LINE_SIZE) /* 1600 */
-#define ETHERNET_PORTS_DIFFERENCE_OFFSETS 0x400
-
-unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/
-unsigned int EVB64260_ETH0_irq;
-
-#define CLOSED 0
-#define OPENED 1
-
-#define PORT_ETH0 0
-
-extern eth0_tx_desc_single *eth0_tx_desc;
-extern eth0_rx_desc_single *eth0_rx_desc;
-extern char *eth0_tx_buffer;
-extern char *eth0_rx_buffer[NR];
-extern char *eth_data;
-
-extern int gt6426x_eth_poll(void *v);
-extern int gt6426x_eth_transmit(void *v, char *p, unsigned int s);
-extern void gt6426x_eth_disable(void *v);
-extern int gt6426x_eth_probe(void *v, bd_t *bis);
-
-#endif  /* __GT64260x_ETH_H__ */
diff --git a/board/evb64260/eth_addrtbl.c b/board/evb64260/eth_addrtbl.c
deleted file mode 100644 (file)
index 8c2c17f..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#include <common.h>
-#include <malloc.h>
-#include <galileo/gt64260R.h>
-#include <galileo/core.h>
-#include <asm/cache.h>
-#include "eth.h"
-#include "eth_addrtbl.h"
-
-#define PRINTF printf
-
-#ifdef CONFIG_GT_USE_MAC_HASH_TABLE
-
-static u32 addressTableHashMode[GAL_ETH_DEVS] = { 0, };
-static u32 addressTableHashSize[GAL_ETH_DEVS] = { 0, };
-static addrTblEntry *addressTableBase[GAL_ETH_DEVS] = { 0, };
-static void *realAddrTableBase[GAL_ETH_DEVS] = { 0, };
-
-static const u32 hashLength[2] = {
-       (0x8000),               /* 8K * 4 entries */
-       (0x8000 / 16),          /* 512 * 4 entries */
-};
-
-/* Initialize the address table for a port, if needed */
-unsigned int initAddressTable (u32 port, u32 hashMode, u32 hashSizeSelector)
-{
-       unsigned int tableBase;
-
-       if (port < 0 || port >= GAL_ETH_DEVS) {
-               printf ("%s: Invalid port number %d\n", __FUNCTION__, port);
-               return 0;
-       }
-
-       if (hashMode > 1) {
-               printf ("%s: Invalid Hash Mode %d\n", __FUNCTION__, port);
-               return 0;
-       }
-
-       if (realAddrTableBase[port] &&
-           (addressTableHashSize[port] != hashSizeSelector)) {
-               /* we have been here before,
-                * but now we want a different sized table
-                */
-               free (realAddrTableBase[port]);
-               realAddrTableBase[port] = 0;
-               addressTableBase[port] = 0;
-
-       }
-
-       tableBase = (unsigned int) addressTableBase[port];
-       /* we get called for every probe, so only do this once */
-       if (!tableBase) {
-               int bytes =
-                       hashLength[hashSizeSelector] * sizeof (addrTblEntry);
-
-               realAddrTableBase[port] =
-                       malloc (bytes + 64);
-               tableBase = (unsigned int)realAddrTableBase;
-
-               if (!tableBase) {
-                       printf ("%s: alloc memory failed \n", __FUNCTION__);
-                       return 0;
-               }
-
-               /* align to octal byte */
-               if (tableBase & 63)
-                       tableBase = (tableBase + 63) & ~63;
-
-               addressTableHashMode[port] = hashMode;
-               addressTableHashSize[port] = hashSizeSelector;
-               addressTableBase[port] = (addrTblEntry *) tableBase;
-
-               memset ((void *) tableBase, 0, bytes);
-       }
-
-       return tableBase;
-}
-
-/*
- * ----------------------------------------------------------------------------
- * This function will calculate the hash function of the address.
- * depends on the hash mode and hash size.
- * Inputs
- * macH             - the 2 most significant bytes of the MAC address.
- * macL             - the 4 least significant bytes of the MAC address.
- * hashMode         - hash mode 0 or hash mode 1.
- * hashSizeSelector - indicates number of hash table entries (0=0x8000,1=0x800)
- * Outputs
- * return the calculated entry.
- */
-u32 hashTableFunction (u32 macH, u32 macL, u32 HashSize, u32 hash_mode)
-{
-       u32 hashResult;
-       u32 addrH;
-       u32 addrL;
-       u32 addr0;
-       u32 addr1;
-       u32 addr2;
-       u32 addr3;
-       u32 addrHSwapped;
-       u32 addrLSwapped;
-
-
-       addrH = NIBBLE_SWAPPING_16_BIT (macH);
-       addrL = NIBBLE_SWAPPING_32_BIT (macL);
-
-       addrHSwapped = FLIP_4_BITS (addrH & 0xf)
-               + ((FLIP_4_BITS ((addrH >> 4) & 0xf)) << 4)
-               + ((FLIP_4_BITS ((addrH >> 8) & 0xf)) << 8)
-               + ((FLIP_4_BITS ((addrH >> 12) & 0xf)) << 12);
-
-       addrLSwapped = FLIP_4_BITS (addrL & 0xf)
-               + ((FLIP_4_BITS ((addrL >> 4) & 0xf)) << 4)
-               + ((FLIP_4_BITS ((addrL >> 8) & 0xf)) << 8)
-               + ((FLIP_4_BITS ((addrL >> 12) & 0xf)) << 12)
-               + ((FLIP_4_BITS ((addrL >> 16) & 0xf)) << 16)
-               + ((FLIP_4_BITS ((addrL >> 20) & 0xf)) << 20)
-               + ((FLIP_4_BITS ((addrL >> 24) & 0xf)) << 24)
-               + ((FLIP_4_BITS ((addrL >> 28) & 0xf)) << 28);
-
-       addrH = addrHSwapped;
-       addrL = addrLSwapped;
-
-       if (hash_mode == 0) {
-               addr0 = (addrL >> 2) & 0x03f;
-               addr1 = (addrL & 0x003) | ((addrL >> 8) & 0x7f) << 2;
-               addr2 = (addrL >> 15) & 0x1ff;
-               addr3 = ((addrL >> 24) & 0x0ff) | ((addrH & 1) << 8);
-       } else {
-               addr0 = FLIP_6_BITS (addrL & 0x03f);
-               addr1 = FLIP_9_BITS (((addrL >> 6) & 0x1ff));
-               addr2 = FLIP_9_BITS ((addrL >> 15) & 0x1ff);
-               addr3 = FLIP_9_BITS ((((addrL >> 24) & 0x0ff) |
-                                     ((addrH & 0x1) << 8)));
-       }
-
-       hashResult = (addr0 << 9) | (addr1 ^ addr2 ^ addr3);
-
-       if (HashSize == _8K_TABLE) {
-               hashResult = hashResult & 0xffff;
-       } else {
-               hashResult = hashResult & 0x07ff;
-       }
-
-       return (hashResult);
-}
-
-
-/*
- * ----------------------------------------------------------------------------
- * This function will add an entry to the address table.
- * depends on the hash mode and hash size that was initialized.
- * Inputs
- * port - ETHERNET port number.
- * macH - the 2 most significant bytes of the MAC address.
- * macL - the 4 least significant bytes of the MAC address.
- * skip - if 1, skip this address.
- * rd   - the RD field in the address table.
- * Outputs
- * address table entry is added.
- * true if success.
- * false if table full
- */
-int addAddressTableEntry (u32 port, u32 macH, u32 macL, u32 rd, u32 skip)
-{
-       addrTblEntry *entry;
-       u32 newHi;
-       u32 newLo;
-       u32 i;
-
-       newLo = (((macH >> 4) & 0xf) << 15)
-               | (((macH >> 0) & 0xf) << 11)
-               | (((macH >> 12) & 0xf) << 7)
-               | (((macH >> 8) & 0xf) << 3)
-               | (((macL >> 20) & 0x1) << 31)
-               | (((macL >> 16) & 0xf) << 27)
-               | (((macL >> 28) & 0xf) << 23)
-               | (((macL >> 24) & 0xf) << 19)
-               | (skip << SKIP_BIT) | (rd << 2) | VALID;
-
-       newHi = (((macL >> 4) & 0xf) << 15)
-               | (((macL >> 0) & 0xf) << 11)
-               | (((macL >> 12) & 0xf) << 7)
-               | (((macL >> 8) & 0xf) << 3)
-               | (((macL >> 21) & 0x7) << 0);
-
-       /*
-        * Pick the appropriate table, start scanning for free/reusable
-        * entries at the index obtained by hashing the specified MAC address
-        */
-       entry = addressTableBase[port];
-       entry += hashTableFunction (macH, macL, addressTableHashSize[port],
-                                   addressTableHashMode[port]);
-       for (i = 0; i < HOP_NUMBER; i++, entry++) {
-               if (!(entry->lo & VALID) /*|| (entry->lo & SKIP) */ ) {
-                       break;
-               } else {        /* if same address put in same position */
-                       if (((entry->lo & 0xfffffff8) == (newLo & 0xfffffff8))
-                           && (entry->hi == newHi)) {
-                               break;
-                       }
-               }
-       }
-
-       if (i == HOP_NUMBER) {
-               PRINTF ("addGT64260addressTableEntry: table section is full\n");
-               return false;
-       }
-
-       /*
-        * Update the selected entry
-        */
-       entry->hi = newHi;
-       entry->lo = newLo;
-       DCACHE_FLUSH_N_SYNC ((u32) entry, MAC_ENTRY_SIZE);
-       return true;
-}
-
-#endif /* CONFIG_GT_USE_MAC_HASH_TABLE */
diff --git a/board/evb64260/eth_addrtbl.h b/board/evb64260/eth_addrtbl.h
deleted file mode 100644 (file)
index 5a62c67..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef _ADDRESS_TABLE_H
-#define _ADDRESS_TABLE_H 1
-
-/*
- * ----------------------------------------------------------------------------
- * addressTable.h - this file has all the declarations of the address table
- */
-
-#define _8K_TABLE                           0
-#define ADDRESS_TABLE_ALIGNMENT             8
-#define HASH_DEFAULT_MODE                   14
-#define HASH_MODE                           13
-#define HASH_SIZE                           12
-#define HOP_NUMBER                          12
-#define MAC_ADDRESS_STRING_SIZE             12
-#define MAC_ENTRY_SIZE                      sizeof(addrTblEntry)
-#define MAX_NUMBER_OF_ADDRESSES_TO_STORE    1000
-#define PROMISCUOUS_MODE                    0
-#define SKIP                                1<<1
-#define SKIP_BIT                            1
-#define VALID                               1
-
-/*
- * ----------------------------------------------------------------------------
- * XXX_MIKE - potential sign-extension bugs lurk here...
- */
-#define NIBBLE_SWAPPING_32_BIT(X) ( (((X) & 0xf0f0f0f0) >> 4) \
-                                 | (((X) & 0x0f0f0f0f) << 4) )
-
-#define NIBBLE_SWAPPING_16_BIT(X) ( (((X) & 0x0000f0f0) >> 4) \
-                                 | (((X) & 0x00000f0f) << 4) )
-
-#define FLIP_4_BITS(X)  ( (((X) & 0x01) << 3) | (((X) & 0x002) << 1) \
-                       | (((X) & 0x04) >> 1) | (((X) & 0x008) >> 3) )
-
-#define FLIP_6_BITS(X)  ( (((X) & 0x01) << 5) | (((X) & 0x020) >> 5) \
-                       | (((X) & 0x02) << 3) | (((X) & 0x010) >> 3) \
-                       | (((X) & 0x04) << 1) | (((X) & 0x008) >> 1) )
-
-#define FLIP_9_BITS(X)  ( (((X) & 0x01) << 8) | (((X) & 0x100) >> 8) \
-                       | (((X) & 0x02) << 6) | (((X) & 0x080) >> 6) \
-                       | (((X) & 0x04) << 4) | (((X) & 0x040) >> 4) \
-        | ((X) & 0x10) | (((X) & 0x08) << 2) | (((X) & 0x020) >> 2) )
-
-/*
- * V: value we're operating on
- * O: offset of rightmost bit in field
- * W: width of field to shift
- * S: distance to shift left
- */
-#define MASK( fieldWidth )                            ((1 << (fieldWidth)) - 1)
-#define leftShiftedBitfield( V,O,W,S)        (((V) & (MASK(W) << (O)))  << (S))
-#define rightShiftedBitfield(V,O,W,S)  (((u32)((V) & (MASK(W) << (O)))) >> (S))
-
-
-/*
- * Push to main memory all cache lines associated with
- * the specified range of virtual memory addresses
- *
- * A: Address of first byte in range to flush
- * N: Number of bytes to flush
- * Note - flush_dcache_range() does a "sync", does NOT invalidate
- */
-#define DCACHE_FLUSH_N_SYNC( A, N )        flush_dcache_range( (A), ((A)+(N)) )
-
-
-typedef struct addressTableEntryStruct  {
-    u32 hi;
-    u32 lo;
-} addrTblEntry;
-
-u32
-uncachedPages( u32 pages  );
-u32
-hashTableFunction( u32 macH, u32 macL, u32 HashSize, u32 hash_mode );
-
-unsigned int
-initAddressTable( u32 port, u32 hashMode, u32 hashSize );
-
-int
-addAddressTableEntry( u32 port, u32 macH, u32 macL, u32 rd, u32 skip          );
-
-#endif                                           /* #ifndef _ADDRESS_TABLE_H */
diff --git a/board/evb64260/evb64260.c b/board/evb64260/evb64260.c
deleted file mode 100644 (file)
index 74f8819..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * evb64260.c - main board support/init for the Galileo Eval board.
- */
-
-#include <common.h>
-#include <74xx_7xx.h>
-#include <galileo/memory.h>
-#include <galileo/pci.h>
-#include <galileo/gt64260R.h>
-#include <net.h>
-#include <netdev.h>
-#include <linux/compiler.h>
-
-#include <asm/io.h>
-#include "eth.h"
-#include "mpsc.h"
-#include "i2c.h"
-#include "64260.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CONFIG_ZUMA_V2
-extern void zuma_mbox_init(void);
-#endif
-
-#undef DEBUG
-#define        MAP_PCI
-
-#ifdef DEBUG
-#define DP(x) x
-#else
-#define DP(x)
-#endif
-
-/* ------------------------------------------------------------------------- */
-
-/* this is the current GT register space location */
-/* it starts at CONFIG_SYS_DFL_GT_REGS but moves later to CONFIG_SYS_GT_REGS */
-
-/* Unfortunately, we cant change it while we are in flash, so we initialize it
- * to the "final" value. This means that any debug_led calls before
- * board_early_init_f wont work right (like in cpu_init_f).
- * See also my_remap_gt_regs below. (NTL)
- */
-
-unsigned int INTERNAL_REG_BASE_ADDR = CONFIG_SYS_GT_REGS;
-
-/* ------------------------------------------------------------------------- */
-
-/*
- * This is a version of the GT register space remapping function that
- * doesn't touch globals (meaning, it's ok to run from flash.)
- *
- * Unfortunately, this has the side effect that a writable
- * INTERNAL_REG_BASE_ADDR is impossible. Oh well.
- */
-
-void
-my_remap_gt_regs(u32 cur_loc, u32 new_loc)
-{
-       u32 temp;
-
-       /* check and see if it's already moved */
-       temp = in_le32((u32 *)(new_loc + INTERNAL_SPACE_DECODE));
-       if ((temp & 0xffff) == new_loc >> 20)
-               return;
-
-       temp = (in_le32((u32 *)(cur_loc + INTERNAL_SPACE_DECODE)) &
-               0xffff0000) | (new_loc >> 20);
-
-       out_le32((u32 *)(cur_loc + INTERNAL_SPACE_DECODE), temp);
-
-       while (GTREGREAD(INTERNAL_SPACE_DECODE) != temp);
-}
-
-static void
-gt_pci_config(void)
-{
-       /* move PCI stuff out of the way - NTL */
-       /* map PCI Host 0 */
-       pciMapSpace(PCI_HOST0, PCI_REGION0, CONFIG_SYS_PCI0_0_MEM_SPACE,
-               CONFIG_SYS_PCI0_0_MEM_SPACE, CONFIG_SYS_PCI0_MEM_SIZE);
-
-       pciMapSpace(PCI_HOST0, PCI_REGION1, 0, 0, 0);
-       pciMapSpace(PCI_HOST0, PCI_REGION2, 0, 0, 0);
-       pciMapSpace(PCI_HOST0, PCI_REGION3, 0, 0, 0);
-
-       pciMapSpace(PCI_HOST0, PCI_IO, CONFIG_SYS_PCI0_IO_SPACE_PCI,
-               CONFIG_SYS_PCI0_IO_SPACE, CONFIG_SYS_PCI0_IO_SIZE);
-
-       /* map PCI Host 1 */
-       pciMapSpace(PCI_HOST1, PCI_REGION0, CONFIG_SYS_PCI1_0_MEM_SPACE,
-               CONFIG_SYS_PCI1_0_MEM_SPACE, CONFIG_SYS_PCI1_MEM_SIZE);
-
-       pciMapSpace(PCI_HOST1, PCI_REGION1, 0, 0, 0);
-       pciMapSpace(PCI_HOST1, PCI_REGION2, 0, 0, 0);
-       pciMapSpace(PCI_HOST1, PCI_REGION3, 0, 0, 0);
-
-       pciMapSpace(PCI_HOST1, PCI_IO, CONFIG_SYS_PCI1_IO_SPACE_PCI,
-               CONFIG_SYS_PCI1_IO_SPACE, CONFIG_SYS_PCI1_IO_SIZE);
-
-       /* PCI interface settings */
-       GT_REG_WRITE(PCI_0TIMEOUT_RETRY, 0xffff);
-       GT_REG_WRITE(PCI_1TIMEOUT_RETRY, 0xffff);
-       GT_REG_WRITE(PCI_0BASE_ADDRESS_REGISTERS_ENABLE, 0xfffff80e);
-       GT_REG_WRITE(PCI_1BASE_ADDRESS_REGISTERS_ENABLE, 0xfffff80e);
-
-
-}
-
-/* Setup CPU interface paramaters */
-static void
-gt_cpu_config(void)
-{
-       cpu_t cpu = get_cpu_type();
-       ulong tmp;
-
-       /* cpu configuration register */
-       tmp = GTREGREAD(CPU_CONFIGURATION);
-
-       /* set the AACK delay bit
-        * see Res#14 */
-       tmp |= CPU_CONF_AACK_DELAY;
-       tmp &= ~CPU_CONF_AACK_DELAY_2; /* New RGF */
-
-       /* Galileo claims this is necessary for all busses >= 100 MHz */
-       tmp |= CPU_CONF_FAST_CLK;
-
-       if (cpu == CPU_750CX) {
-               tmp &= ~CPU_CONF_DP_VALID; /* Safer, needed for CXe. RGF */
-               tmp &= ~CPU_CONF_AP_VALID;
-       } else {
-               tmp |= CPU_CONF_DP_VALID;
-               tmp |= CPU_CONF_AP_VALID;
-       }
-
-       /* this only works with the MPX bus */
-       tmp &= ~CPU_CONF_RD_OOO; /* Safer RGF */
-       tmp |= CPU_CONF_PIPELINE;
-       tmp |= CPU_CONF_TA_DELAY;
-
-       GT_REG_WRITE(CPU_CONFIGURATION, tmp);
-
-       /* CPU master control register */
-       tmp = GTREGREAD(CPU_MASTER_CONTROL);
-
-       tmp |= CPU_MAST_CTL_ARB_EN;
-
-       if ((cpu == CPU_7400) ||
-           (cpu == CPU_7410) ||
-           (cpu == CPU_7450)) {
-
-               tmp |= CPU_MAST_CTL_CLEAN_BLK;
-               tmp |= CPU_MAST_CTL_FLUSH_BLK;
-
-       } else {
-               /* cleanblock must be cleared for CPUs
-                * that do not support this command
-                * see Res#1 */
-               tmp &= ~CPU_MAST_CTL_CLEAN_BLK;
-               tmp &= ~CPU_MAST_CTL_FLUSH_BLK;
-       }
-       GT_REG_WRITE(CPU_MASTER_CONTROL, tmp);
-}
-
-/*
- * board_early_init_f.
- *
- * set up gal. device mappings, etc.
- */
-int board_early_init_f (void)
-{
-       uchar sram_boot = 0;
-
-       /*
-        * set up the GT the way the kernel wants it
-        * the call to move the GT register space will obviously
-        * fail if it has already been done, but we're going to assume
-        * that if it's not at the power-on location, it's where we put
-        * it last time. (huber)
-        */
-       my_remap_gt_regs(CONFIG_SYS_DFL_GT_REGS, CONFIG_SYS_GT_REGS);
-
-       gt_pci_config();
-
-       /* mask all external interrupt sources */
-       GT_REG_WRITE(CPU_INTERRUPT_MASK_REGISTER_LOW, 0);
-       GT_REG_WRITE(CPU_INTERRUPT_MASK_REGISTER_HIGH, 0);
-       GT_REG_WRITE(PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
-       GT_REG_WRITE(PCI_0INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
-       GT_REG_WRITE(PCI_1INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
-       GT_REG_WRITE(PCI_1INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
-       GT_REG_WRITE(CPU_INT_0_MASK, 0);
-       GT_REG_WRITE(CPU_INT_1_MASK, 0);
-       GT_REG_WRITE(CPU_INT_2_MASK, 0);
-       GT_REG_WRITE(CPU_INT_3_MASK, 0);
-
-       /* now, onto the configuration */
-       GT_REG_WRITE(SDRAM_CONFIGURATION, CONFIG_SYS_SDRAM_CONFIG);
-
-       /* ----- DEVICE BUS SETTINGS ------ */
-
-       /*
-        * EVB
-        * 0 - SRAM
-        * 1 - RTC
-        * 2 - UART
-        * 3 - Flash
-        * boot - BootCS
-        *
-        * Zuma
-        * 0 - Flash
-        * boot - BootCS
-        */
-
-       /*
-        * the dual 7450 module requires burst access to the boot
-        * device, so the serial rom copies the boot device to the
-        * on-board sram on the eval board, and updates the correct
-        * registers to boot from the sram. (device0)
-        */
-#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
-       /* Zuma has no SRAM */
-       sram_boot = 0;
-#else
-       if (memoryGetDeviceBaseAddress(DEVICE0) && 0xfff00000 == CONFIG_SYS_MONITOR_BASE)
-               sram_boot = 1;
-#endif
-
-               memoryMapDeviceSpace(DEVICE0, CONFIG_SYS_DEV0_SPACE, CONFIG_SYS_DEV0_SIZE);
-
-       memoryMapDeviceSpace(DEVICE1, CONFIG_SYS_DEV1_SPACE, CONFIG_SYS_DEV1_SIZE);
-       memoryMapDeviceSpace(DEVICE2, CONFIG_SYS_DEV2_SPACE, CONFIG_SYS_DEV2_SIZE);
-       memoryMapDeviceSpace(DEVICE3, CONFIG_SYS_DEV3_SPACE, CONFIG_SYS_DEV3_SIZE);
-
-       /* configure device timing */
-#ifdef CONFIG_SYS_DEV0_PAR
-       if (!sram_boot)
-               GT_REG_WRITE(DEVICE_BANK0PARAMETERS, CONFIG_SYS_DEV0_PAR);
-#endif
-
-#ifdef CONFIG_SYS_DEV1_PAR
-       GT_REG_WRITE(DEVICE_BANK1PARAMETERS, CONFIG_SYS_DEV1_PAR);
-#endif
-#ifdef CONFIG_SYS_DEV2_PAR
-       GT_REG_WRITE(DEVICE_BANK2PARAMETERS, CONFIG_SYS_DEV2_PAR);
-#endif
-
-#ifdef CONFIG_EVB64260
-#ifdef CONFIG_SYS_32BIT_BOOT_PAR
-       /* detect if we are booting from the 32 bit flash */
-       if (GTREGREAD(DEVICE_BOOT_BANK_PARAMETERS) & (0x3 << 20)) {
-               /* 32 bit boot flash */
-               GT_REG_WRITE(DEVICE_BANK3PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);
-               GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_32BIT_BOOT_PAR);
-       } else {
-               /* 8 bit boot flash */
-               GT_REG_WRITE(DEVICE_BANK3PARAMETERS, CONFIG_SYS_32BIT_BOOT_PAR);
-               GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);
-       }
-#else
-       /* 8 bit boot flash only */
-       GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);
-#endif
-#else /* CONFIG_EVB64260 not defined */
-               /* We are booting from 16-bit flash.
-                */
-       GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_16BIT_BOOT_PAR);
-#endif
-
-       gt_cpu_config();
-
-       /* MPP setup */
-       GT_REG_WRITE(MPP_CONTROL0, CONFIG_SYS_MPP_CONTROL_0);
-       GT_REG_WRITE(MPP_CONTROL1, CONFIG_SYS_MPP_CONTROL_1);
-       GT_REG_WRITE(MPP_CONTROL2, CONFIG_SYS_MPP_CONTROL_2);
-       GT_REG_WRITE(MPP_CONTROL3, CONFIG_SYS_MPP_CONTROL_3);
-
-       GT_REG_WRITE(GPP_LEVEL_CONTROL, CONFIG_SYS_GPP_LEVEL_CONTROL);
-       GT_REG_WRITE(SERIAL_PORT_MULTIPLEX, CONFIG_SYS_SERIAL_PORT_MUX);
-
-       return 0;
-}
-
-/* various things to do after relocation */
-
-int misc_init_r (void)
-{
-       icache_enable();
-#ifdef CONFIG_SYS_L2
-       l2cache_enable();
-#endif
-
-#ifdef CONFIG_MPSC
-       mpsc_init2();
-#endif
-
-#ifdef CONFIG_ZUMA_V2
-       zuma_mbox_init();
-#endif
-       return (0);
-}
-
-void
-after_reloc(ulong dest_addr)
-{
-       /* check to see if we booted from the sram.  If so, move things
-        * back to the way they should be. (we're running from main
-        * memory at this point now */
-
-       if (memoryGetDeviceBaseAddress(DEVICE0) == CONFIG_SYS_MONITOR_BASE) {
-               memoryMapDeviceSpace(DEVICE0, CONFIG_SYS_DEV0_SPACE, CONFIG_SYS_DEV0_SIZE);
-               memoryMapDeviceSpace(BOOT_DEVICE, CONFIG_SYS_FLASH_BASE, _1M);
-       }
-
-       /* now, jump to the main U-Boot board init code */
-       board_init_r ((gd_t *)gd, dest_addr);
-
-       /* NOTREACHED */
-}
-
-/* ------------------------------------------------------------------------- */
-
-/*
- * Check Board Identity:
- */
-
-int
-checkboard (void)
-{
-       puts ("Board: " CONFIG_SYS_BOARD_NAME "\n");
-       return (0);
-}
-
-/* utility functions */
-void
-debug_led(int led, int mode)
-{
-#if !defined(CONFIG_ZUMA_V2) && !defined(CONFIG_P3G4)
-       volatile int *addr = NULL;
-       __maybe_unused int dummy;
-
-       if (mode == 1) {
-               switch (led) {
-               case 0:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x08000);
-                       break;
-
-               case 1:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x0c000);
-                       break;
-
-               case 2:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x10000);
-                       break;
-               }
-       } else if (mode == 0) {
-               switch (led) {
-               case 0:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x14000);
-                       break;
-
-               case 1:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x18000);
-                       break;
-
-               case 2:
-                       addr = (int *)((unsigned int)CONFIG_SYS_DEV1_SPACE | 0x1c000);
-                       break;
-               }
-       }
-       WRITE_CHAR(addr, 0);
-       dummy = *addr;
-#endif /* CONFIG_ZUMA_V2 */
-}
-
-void
-display_mem_map(void)
-{
-    int i,j;
-    unsigned int base,size,width;
-    /* SDRAM */
-    printf("SDRAM\n");
-    for(i=0;i<=BANK3;i++) {
-       base = memoryGetBankBaseAddress(i);
-       size = memoryGetBankSize(i);
-       if(size !=0)
-       {
-           printf("BANK%d: base - 0x%08x\tsize - %dM bytes\n",i,base,size>>20);
-       }
-    }
-
-    /* CPU's PCI windows */
-    for(i=0;i<=PCI_HOST1;i++) {
-       printf("\nCPU's PCI %d windows\n", i);
-       base=pciGetSpaceBase(i,PCI_IO);
-       size=pciGetSpaceSize(i,PCI_IO);
-       printf("      IO: base - 0x%08x\tsize - %dM bytes\n",base,size>>20);
-       for(j=0;j<=PCI_REGION3;j++) {
-           base = pciGetSpaceBase(i,j);
-           size = pciGetSpaceSize(i,j);
-           printf("MEMORY %d: base - 0x%08x\tsize - %dM bytes\n",j,base,
-                   size>>20);
-       }
-    }
-
-    /* Devices */
-    printf("\nDEVICES\n");
-       for(i=0;i<=DEVICE3;i++) {
-       base = memoryGetDeviceBaseAddress(i);
-       size = memoryGetDeviceSize(i);
-       width= memoryGetDeviceWidth(i) * 8;
-       printf("DEV %d:  base - 0x%08x\tsize - %dM bytes\twidth - %d bits\n",
-              i, base, size>>20, width);
-    }
-
-    /* Bootrom */
-    base = memoryGetDeviceBaseAddress(BOOT_DEVICE); /* Boot */
-    size = memoryGetDeviceSize(BOOT_DEVICE);
-    width= memoryGetDeviceWidth(BOOT_DEVICE) * 8;
-    printf(" BOOT:  base - 0x%08x\tsize - %dM bytes\twidth - %d bits\n",
-          base, size>>20, width);
-}
-
-int board_eth_init(bd_t *bis)
-{
-       gt6426x_eth_initialize(bis);
-       return 0;
-}
diff --git a/board/evb64260/flash.c b/board/evb64260/flash.c
deleted file mode 100644 (file)
index f3b0074..0000000
+++ /dev/null
@@ -1,837 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * flash.c - flash support for the 512k, 8bit boot flash on the GEVB
- *           most of this file was based on the existing U-Boot
- *           flash drivers.
- */
-
-#include <common.h>
-#include <mpc8xx.h>
-#include <galileo/gt64260R.h>
-#include <galileo/memory.h>
-#include "intel_flash.h"
-
-#define FLASH_ROM       0xFFFD       /* unknown flash type                   */
-#define FLASH_RAM       0xFFFE       /* unknown flash type                   */
-#define FLASH_MAN_UNKNOWN 0xFFFF0000
-
-/* #define DEBUG */
-/* #define FLASH_ID_OVERRIDE */        /* Hack to set type to 040B if ROM emulator is installed.
-                                * Can be used to program a ROM in circuit if a programmer
-                                * is not available by swapping the rom out. */
-
-/* Intel flash commands */
-int flash_erase_intel(flash_info_t *info, int s_first, int s_last);
-int write_word_intel(bank_addr_t addr, bank_word_t value);
-
-flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-static ulong flash_get_size (int portwidth, vu_long *addr, flash_info_t *info);
-static int write_word (flash_info_t *info, ulong dest, ulong data);
-static void flash_get_offsets (ulong base, flash_info_t *info);
-
-/*-----------------------------------------------------------------------
- */
-
-unsigned long
-flash_init (void)
-{
-       unsigned int i;
-       unsigned long size_b0 = 0, size_b1 = 0;
-       unsigned long base, flash_size;
-
-       /* Init: no FLASHes known */
-       for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-       }
-
-       /* the boot flash */
-       base = CONFIG_SYS_FLASH_BASE;
-#ifndef CONFIG_SYS_BOOT_FLASH_WIDTH
-#define CONFIG_SYS_BOOT_FLASH_WIDTH    1
-#endif
-       size_b0 = flash_get_size(CONFIG_SYS_BOOT_FLASH_WIDTH, (vu_long *)base,
-                                &flash_info[0]);
-
-#ifndef CONFIG_P3G4
-       printf("[");
-       print_size (size_b0, "");
-       printf("@%08lX] ", base);
-#endif
-
-       if (flash_info[0].flash_id == FLASH_UNKNOWN) {
-               printf ("## Unknown FLASH at %08lx: Size = 0x%08lx = %ld MB\n",
-                       base, size_b0, size_b0<<20);
-       }
-
-       base = memoryGetDeviceBaseAddress(CONFIG_SYS_EXTRA_FLASH_DEVICE);
-       for(i=1;i<CONFIG_SYS_MAX_FLASH_BANKS;i++) {
-           unsigned long size = flash_get_size(CONFIG_SYS_EXTRA_FLASH_WIDTH, (vu_long *)base, &flash_info[i]);
-
-#ifndef CONFIG_P3G4
-           printf("[");
-           print_size (size, "");
-           printf("@%08lX] ", base);
-#endif
-
-           if (flash_info[i].flash_id == FLASH_UNKNOWN) {
-               if(i==1) {
-                   printf ("## Unknown FLASH at %08lx: Size = 0x%08lx = %ld MB\n",
-                           base, size_b1, size_b1<<20);
-               }
-               break;
-           }
-           size_b1+=size;
-           base+=size;
-       }
-
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-       /* monitor protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_SYS_MONITOR_BASE,
-                     CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
-                     flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
-#ifdef  CONFIG_ENV_IS_IN_FLASH
-       /* ENV protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_ENV_ADDR,
-                     CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
-                     flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
-       flash_size = size_b0 + size_b1;
-       return flash_size;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void
-flash_get_offsets (ulong base, flash_info_t *info)
-{
-       int i;
-       int sector_size;
-
-       if(!info->sector_count) return;
-
-       /* set up sector start address table */
-       switch(info->flash_id & FLASH_TYPEMASK) {
-           case FLASH_AM040:
-           case FLASH_28F128J3A:
-           case FLASH_28F640J3A:
-           case FLASH_RAM:
-               /* this chip has uniformly spaced sectors */
-               sector_size=info->size/info->sector_count;
-               for (i = 0; i < info->sector_count; i++)
-                       info->start[i] = base + (i * sector_size);
-               break;
-           default:
-               if (info->flash_id & FLASH_BTYPE) {
-                   /* set sector offsets for bottom boot block type    */
-                   info->start[0] = base + 0x00000000;
-                   info->start[1] = base + 0x00008000;
-                   info->start[2] = base + 0x0000C000;
-                   info->start[3] = base + 0x00010000;
-                   for (i = 4; i < info->sector_count; i++) {
-                           info->start[i] = base + (i * 0x00020000) - 0x00060000;
-                   }
-               } else {
-                   /* set sector offsets for top boot block type               */
-                   i = info->sector_count - 1;
-                   info->start[i--] = base + info->size - 0x00008000;
-                   info->start[i--] = base + info->size - 0x0000C000;
-                   info->start[i--] = base + info->size - 0x00010000;
-                   for (; i >= 0; i--) {
-                           info->start[i] = base + i * 0x00020000;
-                   }
-               }
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-
-flash_info_t *flash_get_info(ulong base)
-{
-       int i;
-       flash_info_t * info;
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i ++) {
-               info = & flash_info[i];
-               if (info->start[0] <= base && base <= info->start[0] + info->size - 1)
-                       break;
-       }
-
-       return i == CONFIG_SYS_MAX_FLASH_BANKS ? 0 : info;
-}
-
-/*-----------------------------------------------------------------------
- */
-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_AMD:     printf ("AMD ");                break;
-       case FLASH_MAN_FUJ:     printf ("FUJITSU ");            break;
-       case FLASH_MAN_INTEL:   printf ("INTEL ");              break;
-       default:                printf ("Unknown Vendor ");     break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AM040:
-               printf ("AM29LV040B (4 Mbit, bottom boot sect)\n");
-               break;
-       case FLASH_AM400B:
-               printf ("AM29LV400B (4 Mbit, bottom boot sect)\n");
-               break;
-       case FLASH_AM400T:
-               printf ("AM29LV400T (4 Mbit, top boot sector)\n");
-               break;
-       case FLASH_AM800B:
-               printf ("AM29LV800B (8 Mbit, bottom boot sect)\n");
-               break;
-       case FLASH_AM800T:
-               printf ("AM29LV800T (8 Mbit, top boot sector)\n");
-               break;
-       case FLASH_AM160B:
-               printf ("AM29LV160B (16 Mbit, bottom boot sect)\n");
-               break;
-       case FLASH_AM160T:
-               printf ("AM29LV160T (16 Mbit, top boot sector)\n");
-               break;
-       case FLASH_AM320B:
-               printf ("AM29LV320B (32 Mbit, bottom boot sect)\n");
-               break;
-       case FLASH_AM320T:
-               printf ("AM29LV320T (32 Mbit, top boot sector)\n");
-               break;
-       case FLASH_28F640J3A:
-               printf ("28F640J3A (64 Mbit)\n");
-               break;
-       case FLASH_28F128J3A:
-               printf ("28F128J3A (128 Mbit)\n");
-               break;
-       case FLASH_ROM:
-               printf ("ROM\n");
-               break;
-       case FLASH_RAM:
-               printf ("RAM\n");
-               break;
-       default:
-               printf ("Unknown Chip Type\n");
-               break;
-       }
-
-       puts ("  Size: ");
-       print_size (info->size, "");
-       printf (" in %d Sectors\n", 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 inline void flash_cmd(int width, volatile unsigned char *addr, int offset, unsigned char cmd)
-{
-       /* supports 1x8, 1x16, and 2x16 */
-       /* 2x8 and 4x8 are not supported */
-       if(width==4) {
-           /* assuming chips are in 16 bit mode */
-           /* 2x16 */
-           unsigned long cmd32=(cmd<<16)|cmd;
-           *(volatile unsigned long *)(addr+offset*2)=cmd32;
-       } else if (width == 2) {
-           /* 1x16 */
-           *(volatile unsigned short *)((unsigned short*)addr+offset)=cmd;
-       } else {
-           /* 1x8 */
-           *(volatile unsigned char *)(addr+offset)=cmd;
-       }
-}
-
-static ulong
-flash_get_size (int portwidth, vu_long *addr, flash_info_t *info)
-{
-       short i;
-       volatile unsigned char *caddr = (unsigned char *)addr;
-       volatile unsigned short *saddr = (unsigned short *)addr;
-       volatile unsigned long *laddr = (unsigned long *)addr;
-       char old[2], save;
-       ulong id, manu, base = (ulong)addr;
-
-       info->portwidth=portwidth;
-
-       save = *caddr;
-
-       flash_cmd(portwidth,caddr,0,0xf0);
-       flash_cmd(portwidth,caddr,0,0xf0);
-
-       udelay(10);
-
-       old[0] = caddr[0];
-       old[1] = caddr[1];
-
-
-       if(old[0]!=0xf0) {
-           flash_cmd(portwidth,caddr,0,0xf0);
-           flash_cmd(portwidth,caddr,0,0xf0);
-
-           udelay(10);
-
-           if(*caddr==0xf0) {
-               /* this area is ROM */
-               *caddr=save;
-#ifndef FLASH_ID_OVERRIDE
-               info->flash_id = FLASH_ROM + FLASH_MAN_UNKNOWN;
-               info->sector_count = 8;
-               info->size = 0x80000;
-#else
-               info->flash_id = FLASH_MAN_AMD + FLASH_AM040;
-               info->sector_count = 8;
-               info->size = 0x80000;
-               info->chipwidth=1;
-#endif
-               flash_get_offsets(base, info);
-               return info->size;
-           }
-       } else {
-           *caddr=0;
-
-           udelay(10);
-
-           if(*caddr==0) {
-               /* this area is RAM */
-               *caddr=save;
-               info->flash_id = FLASH_RAM + FLASH_MAN_UNKNOWN;
-               info->sector_count = 8;
-               info->size = 0x80000;
-               flash_get_offsets(base, info);
-               return info->size;
-           }
-           flash_cmd(portwidth,caddr,0,0xf0);
-
-           udelay(10);
-       }
-
-       /* Write auto select command: read Manufacturer ID */
-       flash_cmd(portwidth,caddr,0x555,0xAA);
-       flash_cmd(portwidth,caddr,0x2AA,0x55);
-       flash_cmd(portwidth,caddr,0x555,0x90);
-
-       udelay(10);
-
-       if ((caddr[0] == old[0]) &&
-           (caddr[1] == old[1])) {
-
-           /* this area is ROM */
-#ifndef FLASH_ID_OVERRIDE
-           info->flash_id = FLASH_ROM + FLASH_MAN_UNKNOWN;
-           info->sector_count = 8;
-           info->size = 0x80000;
-#else
-               info->flash_id = FLASH_MAN_AMD + FLASH_AM040;
-               info->sector_count = 8;
-               info->size = 0x80000;
-               info->chipwidth=1;
-#endif
-           flash_get_offsets(base, info);
-           return info->size;
-#ifdef DEBUG
-       } else {
-           printf("%px%d: %02x:%02x -> %02x:%02x\n",
-                   caddr, portwidth, old[0], old[1],
-                   caddr[0], caddr[1]);
-#endif
-       }
-
-       switch(portwidth) {
-           case 1:
-               manu = caddr[0];
-               manu |= manu<<16;
-               id = caddr[1];
-               break;
-           case 2:
-               manu = saddr[0];
-               manu |= manu<<16;
-               id = saddr[1];
-               id |= id<<16;
-               break;
-           case 4:
-               manu = laddr[0];
-               id = laddr[1];
-               break;
-       default:
-               id = manu = -1;
-               break;
-       }
-
-#ifdef DEBUG
-       printf("\n%08lx:%08lx:%08lx\n", base, manu, id);
-       printf("%08lx %08lx %08lx %08lx\n",
-               laddr[0],laddr[1],laddr[2],laddr[3]);
-#endif
-
-       switch (manu) {
-           case AMD_MANUFACT:
-                   info->flash_id = FLASH_MAN_AMD;
-                   break;
-           case FUJ_MANUFACT:
-                   info->flash_id = FLASH_MAN_FUJ;
-                   break;
-           case INTEL_MANUFACT:
-                   info->flash_id = FLASH_MAN_INTEL;
-                   break;
-           default:
-                   printf("Unknown Mfr [%08lx]:%08lx\n", manu, id);
-                   info->flash_id = FLASH_UNKNOWN;
-                   info->sector_count = 0;
-                   info->size = 0;
-                   return (0);                 /* no or unknown flash  */
-       }
-
-       switch (id) {
-           case AMD_ID_LV400T:
-                   info->flash_id += FLASH_AM400T;
-                   info->sector_count = 11;
-                   info->size = 0x00100000;
-                   info->chipwidth=1;
-                   break;                              /* => 1 MB      */
-
-           case AMD_ID_LV400B:
-                   info->flash_id += FLASH_AM400B;
-                   info->sector_count = 11;
-                   info->size = 0x00100000;
-                   info->chipwidth=1;
-                   break;                              /* => 1 MB      */
-
-           case AMD_ID_LV800T:
-                   info->flash_id += FLASH_AM800T;
-                   info->sector_count = 19;
-                   info->size = 0x00200000;
-                   info->chipwidth=1;
-                   break;                              /* => 2 MB      */
-
-           case AMD_ID_LV800B:
-                   info->flash_id += FLASH_AM800B;
-                   info->sector_count = 19;
-                   info->size = 0x00200000;
-                   info->chipwidth=1;
-                   break;                              /* => 2 MB      */
-
-           case AMD_ID_LV160T:
-                   info->flash_id += FLASH_AM160T;
-                   info->sector_count = 35;
-                   info->size = 0x00400000;
-                   info->chipwidth=1;
-                   break;                              /* => 4 MB      */
-
-           case AMD_ID_LV160B:
-                   info->flash_id += FLASH_AM160B;
-                   info->sector_count = 35;
-                   info->size = 0x00400000;
-                   info->chipwidth=1;
-                   break;                              /* => 4 MB      */
-#if 0  /* enable when device IDs are available */
-           case AMD_ID_LV320T:
-                   info->flash_id += FLASH_AM320T;
-                   info->sector_count = 67;
-                   info->size = 0x00800000;
-                   break;                              /* => 8 MB      */
-
-           case AMD_ID_LV320B:
-                   info->flash_id += FLASH_AM320B;
-                   info->sector_count = 67;
-                   info->size = 0x00800000;
-                   break;                              /* => 8 MB      */
-#endif
-           case AMD_ID_LV040B:
-                   info->flash_id += FLASH_AM040;
-                   info->sector_count = 8;
-                   info->size = 0x80000;
-                   info->chipwidth=1;
-                   break;
-
-           case INTEL_ID_28F640J3A:
-                   info->flash_id += FLASH_28F640J3A;
-                   info->sector_count = 64;
-                   info->size = 128*1024 * 64; /* 128kbytes x 64 blocks */
-                   info->chipwidth=2;
-                   if(portwidth==4) info->size*=2;     /* 2x16 */
-                   break;
-
-           case INTEL_ID_28F128J3A:
-                   info->flash_id += FLASH_28F128J3A;
-                   info->sector_count = 128;
-                   info->size = 128*1024 * 128; /* 128kbytes x 128 blocks */
-                   info->chipwidth=2;
-                   if(portwidth==4) info->size*=2;     /* 2x16 */
-                   break;
-
-           default:
-                   printf("Unknown id %lx:[%lx]\n", manu, id);
-                   info->flash_id = FLASH_UNKNOWN;
-                   info->chipwidth=1;
-                   return (0);                 /* => no or unknown flash */
-
-       }
-
-       flash_get_offsets(base, info);
-
-#if 0
-       /* set up sector start address table */
-       if (info->flash_id & FLASH_AM040) {
-               /* this chip has uniformly spaced sectors */
-               for (i = 0; i < info->sector_count; i++)
-                       info->start[i] = base + (i * 0x00010000);
-
-       } else if (info->flash_id & FLASH_BTYPE) {
-               /* set sector offsets for bottom boot block type        */
-               info->start[0] = base + 0x00000000;
-               info->start[1] = base + 0x00008000;
-               info->start[2] = base + 0x0000C000;
-               info->start[3] = base + 0x00010000;
-               for (i = 4; i < info->sector_count; i++) {
-                       info->start[i] = base + (i * 0x00020000) - 0x00060000;
-               }
-       } else {
-               /* set sector offsets for top boot block type           */
-               i = info->sector_count - 1;
-               info->start[i--] = base + info->size - 0x00008000;
-               info->start[i--] = base + info->size - 0x0000C000;
-               info->start[i--] = base + info->size - 0x00010000;
-               for (; i >= 0; i--) {
-                       info->start[i] = base + i * 0x00020000;
-               }
-       }
-#endif
-
-       /* check for protected sectors */
-       for (i = 0; i < info->sector_count; i++) {
-               /* read sector protection at sector address, (A7 .. A0)=0x02 */
-               /* D0 = 1 if protected */
-               caddr = (volatile unsigned char *)(info->start[i]);
-               saddr = (volatile unsigned short *)(info->start[i]);
-               laddr = (volatile unsigned long *)(info->start[i]);
-               if(portwidth==1)
-                   info->protect[i] = caddr[2] & 1;
-               else if(portwidth==2)
-                   info->protect[i] = saddr[2] & 1;
-               else
-                   info->protect[i] = laddr[2] & 1;
-       }
-
-       /*
-        * Prevent writes to uninitialized FLASH.
-        */
-       if (info->flash_id != FLASH_UNKNOWN) {
-               caddr = (volatile unsigned char *)info->start[0];
-
-               flash_cmd(portwidth,caddr,0,0xF0);      /* reset bank */
-       }
-
-       return (info->size);
-}
-
-/* TODO: 2x16 unsupported */
-int
-flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-       volatile unsigned char *addr = (uchar *)(info->start[0]);
-       int flag, prot, sect, l_sect;
-       ulong start, now, last;
-
-       /* TODO: 2x16 unsupported */
-       if(info->portwidth==4) return 1;
-
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_ROM) return 1;
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_RAM) {
-           for (sect = s_first; sect<=s_last; sect++) {
-               int sector_size=info->size/info->sector_count;
-               addr = (uchar *)(info->start[sect]);
-               memset((void *)addr, 0, sector_size);
-           }
-           return 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;
-       }
-
-       if ((info->flash_id&FLASH_VENDMASK) == FLASH_MAN_INTEL)  {
-               return flash_erase_intel(info,
-                               (unsigned short)s_first,
-                               (unsigned short)s_last);
-       }
-
-#if 0
-       if ((info->flash_id == FLASH_UNKNOWN) ||
-           (info->flash_id > FLASH_AMD_COMP)) {
-               printf ("Can't erase unknown flash type %08lx - aborted\n",
-                       info->flash_id);
-               return 1;
-       }
-#endif
-
-       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");
-       }
-
-       l_sect = -1;
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       flash_cmd(info->portwidth,addr,0x555,0xAA);
-       flash_cmd(info->portwidth,addr,0x2AA,0x55);
-       flash_cmd(info->portwidth,addr,0x555,0x80);
-       flash_cmd(info->portwidth,addr,0x555,0xAA);
-       flash_cmd(info->portwidth,addr,0x2AA,0x55);
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect<=s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       addr = (uchar *)(info->start[sect]);
-                       flash_cmd(info->portwidth,addr,0,0x30);
-                       l_sect = sect;
-               }
-       }
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-
-       /* wait at least 80us - let's wait 1 ms */
-       udelay (1000);
-
-       /*
-        * We wait for the last triggered sector
-        */
-       if (l_sect < 0)
-               goto DONE;
-
-       start = get_timer (0);
-       last  = start;
-       addr = (volatile unsigned char *)(info->start[l_sect]);
-       /* broken for 2x16: TODO */
-       while ((addr[0] & 0x80) != 0x80) {
-               if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                       printf ("Timeout\n");
-                       return 1;
-               }
-               /* show that we're waiting */
-               if ((now - last) > 1000) {      /* every second */
-                       putc ('.');
-                       last = now;
-               }
-       }
-
-DONE:
-       /* reset to read mode */
-       addr = (volatile unsigned char *)info->start[0];
-       flash_cmd(info->portwidth,addr,0,0xf0);
-       flash_cmd(info->portwidth,addr,0,0xf0);
-
-       printf (" done\n");
-       return 0;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-
-/* broken for 2x16: TODO */
-int
-write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-       ulong cp, wp, data;
-       int i, l, rc;
-
-       if(info->portwidth==4) return 1;
-
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_ROM) return 0;
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_RAM) {
-           memcpy((void *)addr, src, cnt);
-           return 0;
-       }
-
-       wp = (addr & ~3);       /* get lower word aligned address */
-
-       /*
-        * 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<4 && cnt>0; ++i) {
-                       data = (data << 8) | *src++;
-                       --cnt;
-                       ++cp;
-               }
-               for (; cnt==0 && i<4; ++i, ++cp) {
-                       data = (data << 8) | (*(uchar *)cp);
-               }
-
-               if ((rc = write_word(info, wp, data)) != 0) {
-                       return (rc);
-               }
-               wp += 4;
-       }
-
-       /*
-        * handle word aligned part
-        */
-       while (cnt >= 4) {
-               data = 0;
-               for (i=0; i<4; ++i) {
-                       data = (data << 8) | *src++;
-               }
-               if ((rc = write_word(info, wp, data)) != 0) {
-                       return (rc);
-               }
-               wp  += 4;
-               cnt -= 4;
-       }
-
-       if (cnt == 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       data = 0;
-       for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-               data = (data << 8) | *src++;
-               --cnt;
-       }
-       for (; i<4; ++i, ++cp) {
-               data = (data << 8) | (*(uchar *)cp);
-       }
-
-       return (write_word(info, wp, data));
-}
-
-/*-----------------------------------------------------------------------
- * Write a word to Flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-/* broken for 2x16: TODO */
-static int
-write_word (flash_info_t *info, ulong dest, ulong data)
-{
-       volatile unsigned char *addr = (uchar *)(info->start[0]);
-       ulong start;
-       int flag, i;
-
-       if(info->portwidth==4) return 1;
-
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_ROM) return 1;
-       if((info->flash_id & FLASH_TYPEMASK) == FLASH_RAM) {
-           *(unsigned long *)dest=data;
-           return 0;
-       }
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL)  {
-               unsigned short low = data & 0xffff;
-               unsigned short hi  = (data >> 16) & 0xffff;
-               int ret = write_word_intel((bank_addr_t)dest, hi);
-
-               if (!ret) ret = write_word_intel((bank_addr_t)(dest+2), low);
-
-               return ret;
-       }
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*((vu_long *)dest) & data) != data) {
-               return (2);
-       }
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       /* first, perform an unlock bypass command to speed up flash writes */
-       addr[0x555] = 0xAA;
-       addr[0x2AA] = 0x55;
-       addr[0x555] = 0x20;
-
-       /* write each byte out */
-       for (i = 0; i < 4; i++) {
-               char *data_ch = (char *)&data;
-               addr[0] = 0xA0;
-               *(((char *)dest)+i) = data_ch[i];
-               udelay(10); /* XXX */
-       }
-
-       /* we're done, now do an unlock bypass reset */
-       addr[0] = 0x90;
-       addr[0] = 0x00;
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-
-       /* data polling for D7 */
-       start = get_timer (0);
-       while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
-               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       return (1);
-               }
-       }
-       return (0);
-}
diff --git a/board/evb64260/i2c.c b/board/evb64260/i2c.c
deleted file mode 100644 (file)
index 8119fce..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-#include <common.h>
-#include <mpc8xx.h>
-#include <malloc.h>
-#include <galileo/gt64260R.h>
-#include <galileo/core.h>
-
-#define MAX_I2C_RETRYS     10
-#define I2C_DELAY          1000  /* Should be at least the # of MHz of Tclk */
-#undef DEBUG_I2C
-
-#ifdef DEBUG_I2C
-#define DP(x) x
-#else
-#define DP(x)
-#endif
-
-/* Assuming that there is only one master on the bus (us) */
-
-static void
-i2c_init(int speed, int slaveaddr)
-{
-       unsigned int n, m, freq, margin, power;
-       unsigned int actualn = 0, actualm = 0;
-       unsigned int control, status;
-       unsigned int minmargin = 0xffffffff;
-       unsigned int tclk = 125000000;
-
-       DP(puts("i2c_init\n"));
-
-       for (n = 0 ; n < 8 ; n++) {
-               for (m = 0 ; m < 16 ; m++) {
-                       power = 2 << n; /* power = 2^(n+1) */
-                       freq = tclk / (10 * (m + 1) * power);
-                       if (speed > freq)
-                               margin = speed - freq;
-                       else
-                               margin = freq - speed;
-                       if (margin < minmargin) {
-                               minmargin   = margin;
-                               actualn     = n;
-                               actualm     = m;
-                       }
-               }
-       }
-
-       DP(puts("setup i2c bus\n"));
-
-       /* Setup bus */
-
-       GT_REG_WRITE(I2C_SOFT_RESET, 0);
-
-       DP(puts("udelay...\n"));
-
-       udelay(I2C_DELAY);
-
-       DP(puts("set baudrate\n"));
-
-       GT_REG_WRITE(I2C_STATUS_BAUDE_RATE, (actualm << 3) | actualn);
-       GT_REG_WRITE(I2C_CONTROL, (0x1 << 2) | (0x1 << 6));
-
-       udelay(I2C_DELAY * 10);
-
-       DP(puts("read control, baudrate\n"));
-
-       GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-       GT_REG_READ(I2C_CONTROL, &control);
-}
-
-static uchar
-i2c_start(void)
-{
-       unsigned int control, status;
-       int count = 0;
-
-       DP(puts("i2c_start\n"));
-
-       /* Set the start bit */
-
-       GT_REG_READ(I2C_CONTROL, &control);
-       control |= (0x1 << 5);
-       GT_REG_WRITE(I2C_CONTROL, control);
-
-       GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-
-       count = 0;
-       while ((status & 0xff) != 0x08) {
-               udelay(I2C_DELAY);
-               if (count > 20) {
-                       GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /*stop*/
-                       return status;
-               }
-               GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-               count++;
-       }
-
-       return 0;
-}
-
-static uchar
-i2c_select_device(uchar dev_addr, uchar read, int ten_bit)
-{
-       unsigned int status, data, bits = 7;
-       int count = 0;
-
-       DP(puts("i2c_select_device\n"));
-
-       /* Output slave address */
-
-       if (ten_bit)
-               bits = 10;
-
-       data = (dev_addr << 1);
-       /* set the read bit */
-       data |= read;
-       GT_REG_WRITE(I2C_DATA, data);
-       /* assert the address */
-       RESET_REG_BITS(I2C_CONTROL, BIT3);
-
-       udelay(I2C_DELAY);
-
-       GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-       count = 0;
-       while (((status & 0xff) != 0x40) && ((status & 0xff) != 0x18)) {
-               udelay(I2C_DELAY);
-               if (count > 20) {
-                       GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /*stop*/
-                       return status;
-               }
-               GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-               count++;
-       }
-
-       if (bits == 10) {
-               printf("10 bit I2C addressing not yet implemented\n");
-               return 0xff;
-       }
-
-       return 0;
-}
-
-static uchar
-i2c_get_data(uchar *return_data, int len) {
-
-       unsigned int data, status = 0;
-       int count = 0;
-
-       DP(puts("i2c_get_data\n"));
-
-       while (len) {
-
-               /* Get and return the data */
-
-               RESET_REG_BITS(I2C_CONTROL, (0x1 << 3));
-
-               udelay(I2C_DELAY * 5);
-
-               GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-               count++;
-               while ((status & 0xff) != 0x50) {
-                       udelay(I2C_DELAY);
-                       if (count > 2) {
-                               GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /*stop*/
-                               return 0;
-                       }
-                       GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-                       count++;
-               }
-               GT_REG_READ(I2C_DATA, &data);
-               len--;
-               *return_data = (uchar)data;
-               return_data++;
-       }
-       RESET_REG_BITS(I2C_CONTROL, BIT2|BIT3);
-       while ((status & 0xff) != 0x58) {
-               udelay(I2C_DELAY);
-               if (count > 200) {
-                       GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /*stop*/
-                       return status;
-               }
-               GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-               count++;
-       }
-       GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /* stop */
-
-       return 0;
-}
-
-static uchar
-i2c_write_data(unsigned int data, int len)
-{
-       unsigned int status;
-       int count = 0;
-
-       DP(puts("i2c_write_data\n"));
-
-       if (len > 4)
-               return -1;
-
-       while (len) {
-               /* Set and assert the data */
-
-               GT_REG_WRITE(I2C_DATA, (unsigned int)data);
-               RESET_REG_BITS(I2C_CONTROL, (0x1 << 3));
-
-               udelay(I2C_DELAY);
-
-               GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-               count++;
-               while ((status & 0xff) != 0x28) {
-                       udelay(I2C_DELAY);
-                       if (count > 20) {
-                               GT_REG_WRITE(I2C_CONTROL, (0x1 << 4)); /*stop*/
-                               return status;
-                       }
-                       GT_REG_READ(I2C_STATUS_BAUDE_RATE, &status);
-                       count++;
-               }
-               len--;
-       }
-       GT_REG_WRITE(I2C_CONTROL, (0x1 << 3) | (0x1 << 4));
-       GT_REG_WRITE(I2C_CONTROL, (0x1 << 4));
-
-       udelay(I2C_DELAY * 10);
-
-       return 0;
-}
-
-static uchar
-i2c_set_dev_offset(uchar dev_addr, unsigned int offset, int ten_bit)
-{
-       uchar status;
-
-       DP(puts("i2c_set_dev_offset\n"));
-
-       status = i2c_select_device(dev_addr, 0, ten_bit);
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Failed to select device setting offset: 0x%02x\n",
-                      status);
-#endif
-               return status;
-       }
-
-       status = i2c_write_data(offset, 1);
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Failed to write data: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       return 0;
-}
-
-uchar
-i2c_read(uchar dev_addr, unsigned int offset, int len, uchar *data,
-        int ten_bit)
-{
-       uchar status = 0;
-       unsigned int i2cfreq = 400000;
-
-       DP(puts("i2c_read\n"));
-
-       i2c_init(i2cfreq, 0);
-
-       status = i2c_start();
-
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Transaction start failed: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       status = i2c_set_dev_offset(dev_addr, 0, 0);
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Failed to set offset: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       i2c_init(i2cfreq, 0);
-
-       status = i2c_start();
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Transaction restart failed: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       status = i2c_select_device(dev_addr, 1, ten_bit);
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Address not acknowledged: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       status = i2c_get_data(data, len);
-       if (status) {
-#ifdef DEBUG_I2C
-               printf("Data not received: 0x%02x\n", status);
-#endif
-               return status;
-       }
-
-       return 0;
-}
diff --git a/board/evb64260/i2c.h b/board/evb64260/i2c.h
deleted file mode 100644 (file)
index 9c21992..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __I2C_H__
-#define __I2C_H__
-
-/* function declarations */
-uchar i2c_read(uchar, unsigned int, int, uchar*, int);
-
-#endif
diff --git a/board/evb64260/intel_flash.c b/board/evb64260/intel_flash.c
deleted file mode 100644 (file)
index 9acc3a0..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- * Hacked for the Hymod board by Murray.Jensen@cmst.csiro.au, 20-Oct-00
- */
-
-#include <common.h>
-#include <mpc8xx.h>
-#include <galileo/gt64260R.h>
-#include <galileo/memory.h>
-#include "intel_flash.h"
-
-
-/*-----------------------------------------------------------------------
- * Protection Flags:
- */
-#define FLAG_PROTECT_SET       0x01
-#define FLAG_PROTECT_CLEAR     0x02
-
-static void
-bank_reset(flash_info_t *info, int sect)
-{
-       bank_addr_t addrw, eaddrw;
-
-       addrw = (bank_addr_t)info->start[sect];
-       eaddrw = BANK_ADDR_NEXT_WORD(addrw);
-
-       while (addrw < eaddrw) {
-#ifdef FLASH_DEBUG
-               printf("  writing reset cmd to addr 0x%08lx\n",
-                       (unsigned long)addrw);
-#endif
-               *addrw = BANK_CMD_RST;
-               addrw++;
-       }
-}
-
-static void
-bank_erase_init(flash_info_t *info, int sect)
-{
-       bank_addr_t addrw, saddrw, eaddrw;
-       int flag;
-
-#ifdef FLASH_DEBUG
-       printf("0x%08x BANK_CMD_PROG\n", BANK_CMD_PROG);
-       printf("0x%08x BANK_CMD_ERASE1\n", BANK_CMD_ERASE1);
-       printf("0x%08x BANK_CMD_ERASE2\n", BANK_CMD_ERASE2);
-       printf("0x%08x BANK_CMD_CLR_STAT\n", BANK_CMD_CLR_STAT);
-       printf("0x%08x BANK_CMD_RST\n", BANK_CMD_RST);
-       printf("0x%08x BANK_STAT_RDY\n", BANK_STAT_RDY);
-       printf("0x%08x BANK_STAT_ERR\n", BANK_STAT_ERR);
-#endif
-
-       saddrw = (bank_addr_t)info->start[sect];
-       eaddrw = BANK_ADDR_NEXT_WORD(saddrw);
-
-#ifdef FLASH_DEBUG
-       printf("erasing sector %d, start addr = 0x%08lx "
-               "(bank next word addr = 0x%08lx)\n", sect,
-               (unsigned long)saddrw, (unsigned long)eaddrw);
-#endif
-
-       /* Disable intrs which might cause a timeout here */
-       flag = disable_interrupts();
-
-       for (addrw = saddrw; addrw < eaddrw; addrw++) {
-#ifdef FLASH_DEBUG
-               printf("  writing erase cmd to addr 0x%08lx\n",
-                       (unsigned long)addrw);
-#endif
-               *addrw = BANK_CMD_ERASE1;
-               *addrw = BANK_CMD_ERASE2;
-       }
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-}
-
-static int
-bank_erase_poll(flash_info_t *info, int sect)
-{
-       bank_addr_t addrw, saddrw, eaddrw;
-       int sectdone, haderr;
-
-       saddrw = (bank_addr_t)info->start[sect];
-       eaddrw = BANK_ADDR_NEXT_WORD(saddrw);
-
-       sectdone = 1;
-       haderr = 0;
-
-       for (addrw = saddrw; addrw < eaddrw; addrw++) {
-               bank_word_t stat = *addrw;
-
-#ifdef FLASH_DEBUG
-               printf("  checking status at addr "
-                       "0x%08x [0x%08x]\n",
-                       (unsigned long)addrw, stat);
-#endif
-               if ((stat & BANK_STAT_RDY) != BANK_STAT_RDY)
-                       sectdone = 0;
-               else if ((stat & BANK_STAT_ERR) != 0) {
-                       printf(" failed on sector %d "
-                               "(stat = 0x%08x) at "
-                               "address 0x%p\n",
-                               sect, stat, addrw);
-                       *addrw = BANK_CMD_CLR_STAT;
-                       haderr = 1;
-               }
-       }
-
-       if (haderr)
-               return (-1);
-       else
-               return (sectdone);
-}
-
-int
-write_word_intel(bank_addr_t addr, bank_word_t value)
-{
-       bank_word_t stat;
-       ulong start;
-       int flag, retval;
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       *addr = BANK_CMD_PROG;
-
-       *addr = value;
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-
-       retval = 0;
-
-       /* data polling for D7 */
-       start = get_timer (0);
-       do {
-               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       retval = 1;
-                       goto done;
-               }
-               stat = *addr;
-       } while ((stat & BANK_STAT_RDY) != BANK_STAT_RDY);
-
-       if ((stat & BANK_STAT_ERR) != 0) {
-               printf("flash program failed (stat = 0x%08lx) "
-                       "at address 0x%08lx\n", (ulong)stat, (ulong)addr);
-               *addr = BANK_CMD_CLR_STAT;
-               retval = 3;
-       }
-
-done:
-       /* reset to read mode */
-       *addr = BANK_CMD_RST;
-
-       return (retval);
-}
-
-/*-----------------------------------------------------------------------
- */
-
-int
-flash_erase_intel(flash_info_t *info, int s_first, int s_last)
-{
-       int prot, sect, haderr;
-       ulong start, now, last;
-
-#ifdef FLASH_DEBUG
-       printf("\nflash_erase: erase %d sectors (%d to %d incl.) from\n"
-               "  Bank # %d: ", s_last - s_first + 1, s_first, s_last,
-               (info - flash_info) + 1);
-       flash_print_info(info);
-#endif
-
-       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;
-       }
-
-       prot = 0;
-       for (sect=s_first; sect<=s_last; ++sect) {
-               if (info->protect[sect]) {
-                       prot++;
-               }
-       }
-
-       if (prot) {
-               printf("- Warning: %d protected sector%s will not be erased!\n",
-                       prot, (prot > 1 ? "s" : ""));
-       }
-
-       start = get_timer (0);
-       last = 0;
-       haderr = 0;
-
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       ulong estart;
-                       int sectdone;
-
-                       bank_erase_init(info, sect);
-
-                       /* wait at least 80us - let's wait 1 ms */
-                       udelay (1000);
-
-                       estart = get_timer(start);
-
-                       do {
-                               now = get_timer(start);
-
-                               if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                                       printf ("Timeout (sect %d)\n", sect);
-                                       haderr = 1;
-                                       break;
-                               }
-
-#ifndef FLASH_DEBUG
-                               /* show that we're waiting */
-                               if ((now - last) > 1000) { /* every second */
-                                       putc ('.');
-                                       last = now;
-                               }
-#endif
-
-                               sectdone = bank_erase_poll(info, sect);
-
-                               if (sectdone < 0) {
-                                       haderr = 1;
-                                       break;
-                               }
-
-                       } while (!sectdone);
-
-                       if (haderr)
-                               break;
-               }
-       }
-
-       if (haderr > 0)
-               printf (" failed\n");
-       else
-               printf (" done\n");
-
-       /* reset to read mode */
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       bank_reset(info, sect);
-               }
-       }
-       return haderr;
-}
diff --git a/board/evb64260/intel_flash.h b/board/evb64260/intel_flash.h
deleted file mode 100644 (file)
index cc3a339..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*************** DEFINES for Intel StrataFlash FLASH chip ********************/
-
-/*
- * acceptable chips types are:
- *
- *     28F320J5, 28F640J5, 28F320J3A, 28F640J3A and 28F128J3A
- */
-
-/* register addresses, valid only following an CHIP_CMD_RD_ID command */
-#define CHIP_ADDR_REG_MAN      0x000000        /* manufacturer's id */
-#define CHIP_ADDR_REG_DEV      0x000001        /* device id */
-#define CHIP_ADDR_REG_CFGM     0x000003        /* master lock config */
-#define CHIP_ADDR_REG_CFG(b)   (((b)<<16)|2)   /* lock config for block b */
-
-/* Commands */
-#define CHIP_CMD_RST           0xFF            /* reset flash */
-#define CHIP_CMD_RD_ID         0x90            /* read the id and lock bits */
-#define CHIP_CMD_RD_QUERY      0x98            /* read device capabilities */
-#define CHIP_CMD_RD_STAT       0x70            /* read the status register */
-#define CHIP_CMD_CLR_STAT      0x50            /* clear the staus register */
-#define CHIP_CMD_WR_BUF                0xE8            /* clear the staus register */
-#define CHIP_CMD_PROG          0x40            /* program word command */
-#define CHIP_CMD_ERASE1                0x20            /* 1st word for block erase */
-#define CHIP_CMD_ERASE2                0xD0            /* 2nd word for block erase */
-#define CHIP_CMD_ERASE_SUSP    0xB0            /* suspend block erase */
-#define CHIP_CMD_LOCK          0x60            /* 1st word for all lock cmds */
-#define CHIP_CMD_SET_LOCK_BLK  0x01            /* 2nd wrd set block lock bit */
-#define CHIP_CMD_SET_LOCK_MSTR 0xF1            /* 2nd wrd set master lck bit */
-#define CHIP_CMD_CLR_LOCK_BLK  0xD0            /* 2nd wrd clear blk lck bit */
-
-/* status register bits */
-#define CHIP_STAT_DPS          0x02            /* Device Protect Status */
-#define CHIP_STAT_VPPS         0x08            /* VPP Status */
-#define CHIP_STAT_PSLBS                0x10            /* Program+Set Lock Bit Stat */
-#define CHIP_STAT_ECLBS                0x20            /* Erase+Clr Lock Bit Stat */
-#define CHIP_STAT_ESS          0x40            /* Erase Suspend Status */
-#define CHIP_STAT_RDY          0x80            /* WSM Mach Status, 1=rdy */
-
-#define CHIP_STAT_ERR          (CHIP_STAT_VPPS | CHIP_STAT_DPS | \
-                                   CHIP_STAT_ECLBS | CHIP_STAT_PSLBS)
-
-/* ID and Lock Configuration */
-#define CHIP_RD_ID_LOCK                0x01            /* Bit 0 of each byte */
-#define CHIP_RD_ID_MAN         0x89            /* Manufacturer code = 0x89 */
-#define CHIP_RD_ID_DEV         CONFIG_SYS_FLASH_ID
-
-/* dimensions */
-#define CHIP_WIDTH             2               /* chips are in 16 bit mode */
-#define CHIP_WSHIFT            1               /* (log2 of CHIP_WIDTH) */
-#define CHIP_NBLOCKS           128
-#define CHIP_BLKSZ             (128 * 1024)    /* of 128Kbytes each */
-#define CHIP_SIZE              (CHIP_BLKSZ * CHIP_NBLOCKS)
-
-/********************** DEFINES for Hymod Flash ******************************/
-
-/*
- * The hymod board has 2 x 28F320J5 chips running in
- * 16 bit mode, for a 32 bit wide bank.
- */
-
-typedef unsigned short bank_word_t;            /* 8/16/32/64bit unsigned int */
-typedef volatile bank_word_t *bank_addr_t;
-typedef unsigned long bank_size_t;             /* want this big - >= 32 bit */
-
-#define BANK_CHIP_WIDTH                1               /* each bank is 1 chip wide */
-#define BANK_CHIP_WSHIFT       0               /* (log2 of BANK_CHIP_WIDTH) */
-
-#define BANK_WIDTH             (CHIP_WIDTH * BANK_CHIP_WIDTH)
-#define BANK_WSHIFT            (CHIP_WSHIFT + BANK_CHIP_WSHIFT)
-#define BANK_NBLOCKS           CHIP_NBLOCKS
-#define BANK_BLKSZ             (CHIP_BLKSZ * BANK_CHIP_WIDTH)
-#define BANK_SIZE              (CHIP_SIZE * BANK_CHIP_WIDTH)
-
-#define MAX_BANKS              1               /* only one bank possible */
-
-/* align bank addresses and sizes to bank word boundaries */
-#define BANK_ADDR_WORD_ALIGN(a)        ((bank_addr_t)((bank_size_t)(a) \
-                                   & ~(BANK_WIDTH - 1)))
-#define BANK_SIZE_WORD_ALIGN(s)        ((bank_size_t)BANK_ADDR_WORD_ALIGN( \
-                                   (bank_size_t)(s) + (BANK_WIDTH - 1)))
-
-/* align bank addresses and sizes to bank block boundaries */
-#define BANK_ADDR_BLK_ALIGN(a) ((bank_addr_t)((bank_size_t)(a) \
-                                   & ~(BANK_BLKSZ - 1)))
-#define BANK_SIZE_BLK_ALIGN(s) ((bank_size_t)BANK_ADDR_BLK_ALIGN( \
-                                   (bank_size_t)(s) + (BANK_BLKSZ - 1)))
-
-/* align bank addresses and sizes to bank boundaries */
-#define BANK_ADDR_BANK_ALIGN(a)        ((bank_addr_t)((bank_size_t)(a) \
-                                   & ~(BANK_SIZE - 1)))
-#define BANK_SIZE_BANK_ALIGN(s)        ((bank_size_t)BANK_ADDR_BANK_ALIGN( \
-                                   (bank_size_t)(s) + (BANK_SIZE - 1)))
-
-/* add an offset to a bank address */
-#define BANK_ADDR_OFFSET(a, o) (bank_addr_t)((bank_size_t)(a) + \
-                                   (bank_size_t)(o))
-
-/* get base address of bank b, given flash base address a */
-#define BANK_ADDR_BASE(a, b)   BANK_ADDR_OFFSET(BANK_ADDR_BANK_ALIGN(a), \
-                                   (bank_size_t)(b) * BANK_SIZE)
-
-/* adjust a bank address to start of next word, block or bank */
-#define BANK_ADDR_NEXT_WORD(a) BANK_ADDR_OFFSET(BANK_ADDR_WORD_ALIGN(a), \
-                                   BANK_WIDTH)
-#define BANK_ADDR_NEXT_BLK(a)  BANK_ADDR_OFFSET(BANK_ADDR_BLK_ALIGN(a), \
-                                   BANK_BLKSZ)
-#define BANK_ADDR_NEXT_BANK(a) BANK_ADDR_OFFSET(BANK_ADDR_BANK_ALIGN(a), \
-                                   BANK_SIZE)
-
-/* get bank address of chip register r given a bank base address a */
-#define BANK_ADDR_REG(a, r)    BANK_ADDR_OFFSET(BANK_ADDR_BANK_ALIGN(a), \
-                                   ((bank_size_t)(r) << BANK_WSHIFT))
-
-/* make a bank address for each chip register address */
-
-#define BANK_ADDR_REG_MAN(a)   BANK_ADDR_REG((a), CHIP_ADDR_REG_MAN)
-#define BANK_ADDR_REG_DEV(a)   BANK_ADDR_REG((a), CHIP_ADDR_REG_DEV)
-#define BANK_ADDR_REG_CFGM(a)  BANK_ADDR_REG((a), CHIP_ADDR_REG_CFGM)
-#define BANK_ADDR_REG_CFG(b,a) BANK_ADDR_REG((a), CHIP_ADDR_REG_CFG(b))
-
-/*
- * replicate a chip cmd/stat/rd value into each byte position within a word
- * so that multiple chips are accessed in a single word i/o operation
- *
- * this must be as wide as the bank_word_t type, and take into account the
- * chip width and bank layout
- */
-
-#define BANK_FILL_WORD(o)      ((bank_word_t)(o))
-
-/* make a bank word value for each chip cmd/stat/rd value */
-
-/* Commands */
-#define BANK_CMD_RST           BANK_FILL_WORD(CHIP_CMD_RST)
-#define BANK_CMD_RD_ID         BANK_FILL_WORD(CHIP_CMD_RD_ID)
-#define BANK_CMD_RD_STAT       BANK_FILL_WORD(CHIP_CMD_RD_STAT)
-#define BANK_CMD_CLR_STAT      BANK_FILL_WORD(CHIP_CMD_CLR_STAT)
-#define BANK_CMD_ERASE1                BANK_FILL_WORD(CHIP_CMD_ERASE1)
-#define BANK_CMD_ERASE2                BANK_FILL_WORD(CHIP_CMD_ERASE2)
-#define BANK_CMD_PROG          BANK_FILL_WORD(CHIP_CMD_PROG)
-#define BANK_CMD_LOCK          BANK_FILL_WORD(CHIP_CMD_LOCK)
-#define BANK_CMD_SET_LOCK_BLK  BANK_FILL_WORD(CHIP_CMD_SET_LOCK_BLK)
-#define BANK_CMD_SET_LOCK_MSTR BANK_FILL_WORD(CHIP_CMD_SET_LOCK_MSTR)
-#define BANK_CMD_CLR_LOCK_BLK  BANK_FILL_WORD(CHIP_CMD_CLR_LOCK_BLK)
-
-/* status register bits */
-#define BANK_STAT_DPS          BANK_FILL_WORD(CHIP_STAT_DPS)
-#define BANK_STAT_PSS          BANK_FILL_WORD(CHIP_STAT_PSS)
-#define BANK_STAT_VPPS         BANK_FILL_WORD(CHIP_STAT_VPPS)
-#define BANK_STAT_PSLBS                BANK_FILL_WORD(CHIP_STAT_PSLBS)
-#define BANK_STAT_ECLBS                BANK_FILL_WORD(CHIP_STAT_ECLBS)
-#define BANK_STAT_ESS          BANK_FILL_WORD(CHIP_STAT_ESS)
-#define BANK_STAT_RDY          BANK_FILL_WORD(CHIP_STAT_RDY)
-
-#define BANK_STAT_ERR          BANK_FILL_WORD(CHIP_STAT_ERR)
-
-/* ID and Lock Configuration */
-#define BANK_RD_ID_LOCK                BANK_FILL_WORD(CHIP_RD_ID_LOCK)
-#define BANK_RD_ID_MAN         BANK_FILL_WORD(CHIP_RD_ID_MAN)
-#define BANK_RD_ID_DEV         BANK_FILL_WORD(CHIP_RD_ID_DEV)
diff --git a/board/evb64260/local.h b/board/evb64260/local.h
deleted file mode 100644 (file)
index 8a3f4b2..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * include/local.h - local configuration options, board specific
- */
-
-#ifndef __LOCAL_H
-#define __LOCAL_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-/* This tells U-Boot that the config options are compiled in */
-/* #undef ENV_IS_EMBEDDED */
-/* Don't touch this! U-Boot figures this out  based on other
- * magic. */
-
-/* Uncomment and define any of the below options */
-
-/* #define CONFIG_750CX */ /* The 750CX doesn't support as many things in L2CR */
-                       /* Note: If you defined CONFIG_EVB64260_750CX this */
-                       /* gets defined automatically. */
-
-/* These want string arguments */
-/* #define CONFIG_BOOTARGS */
-/* #define CONFIG_BOOTCOMMAND */
-/* #define CONFIG_RAMBOOTCOMMAND */
-/* #define CONFIG_NFSBOOTCOMMAND */
-/* #define CONFIG_SYS_AUTOLOAD */
-/* #define CONFIG_PREBOOT */
-
-/* These don't */
-
-/* #define CONFIG_BOOTDELAY  */
-/* #define CONFIG_BAUDRATE */
-/* #define CONFIG_LOADS_ECHO */
-/* #define CONFIG_ETHADDR */
-/* #define CONFIG_ETH2ADDR */
-/* #define CONFIG_ETH3ADDR */
-/* #define CONFIG_IPADDR */
-/* #define CONFIG_SERVERIP */
-/* #define CONFIG_ROOTPATH */
-/* #define CONFIG_GATEWAYIP */
-/* #define CONFIG_NETMASK */
-/* #define CONFIG_HOSTNAME */
-/* #define CONFIG_BOOTFILE */
-/* #define CONFIG_LOADADDR */
-
-/* these hardware addresses are pretty bogus, please change them to
-   suit your needs */
-
-/* first ethernet */
-#define CONFIG_ETHADDR          00:11:22:33:44:55
-
-/* next two ethernet hwaddrs */
-#define CONFIG_HAS_ETH1
-#define CONFIG_ETH1ADDR                00:11:22:33:44:66
-#define CONFIG_HAS_ETH2
-#define CONFIG_ETH2ADDR                00:11:22:33:44:77
-
-#define CONFIG_ENV_OVERWRITE
-#endif /* __CONFIG_H */
diff --git a/board/evb64260/memory.c b/board/evb64260/memory.c
deleted file mode 100644 (file)
index e339854..0000000
+++ /dev/null
@@ -1,457 +0,0 @@
-/* Memory.c - Memory mappings and remapping functions */
-
-/* Copyright - Galileo technology. */
-
-/* modified by Josh Huber to clean some things up, and
- * fit it into the U-Boot framework */
-
-#include <galileo/core.h>
-#include <galileo/memory.h>
-
-/********************************************************************
-* memoryGetBankBaseAddress - Gets the base address of a memory bank
-*      - If the memory bank size is 0 then this base address has no meaning!!!
-*
-*
-* INPUTS:   MEMORY_BANK bank - The bank we ask for its base Address.
-* OUTPUT:   N/A
-* RETURNS: Memory bank base address.
-*********************************************************************/
-static unsigned long memoryGetBankRegOffset(MEMORY_BANK bank)
-{
-    switch (bank)
-    {
-       case BANK0:
-           return SCS_0_LOW_DECODE_ADDRESS;
-       case BANK1:
-           return SCS_1_LOW_DECODE_ADDRESS;
-       case BANK2:
-           return SCS_2_LOW_DECODE_ADDRESS;
-       case BANK3:
-           return SCS_3_LOW_DECODE_ADDRESS;
-    }
-    return SCS_0_LOW_DECODE_ADDRESS; /* default value */
-}
-
-unsigned int memoryGetBankBaseAddress(MEMORY_BANK bank)
-{
-    unsigned int base;
-    unsigned int regOffset=memoryGetBankRegOffset(bank);
-
-    GT_REG_READ(regOffset,&base);
-    base = base << 20;
-    return base;
-}
-
-/********************************************************************
-* memoryGetDeviceBaseAddress - Gets the base address of a device.
-*           - If the device size is 0 then this base address has no meaning!!!
-*
-*
-* INPUT:   DEVICE device - The device we ask for its base address.
-* OUTPUT:   N/A
-* RETURNS: Device base address.
-*********************************************************************/
-static unsigned int memoryGetDeviceRegOffset(DEVICE device)
-{
-    switch (device)
-    {
-       case DEVICE0:
-           return CS_0_LOW_DECODE_ADDRESS;
-       case DEVICE1:
-           return CS_1_LOW_DECODE_ADDRESS;
-       case DEVICE2:
-           return CS_2_LOW_DECODE_ADDRESS;
-       case DEVICE3:
-           return CS_3_LOW_DECODE_ADDRESS;
-       case BOOT_DEVICE:
-           return BOOTCS_LOW_DECODE_ADDRESS;
-    }
-    return CS_0_LOW_DECODE_ADDRESS; /* default value */
-}
-
-unsigned int memoryGetDeviceBaseAddress(DEVICE device)
-{
-    unsigned int regBase;
-    unsigned int regEnd;
-    unsigned int regOffset=memoryGetDeviceRegOffset(device);
-
-    GT_REG_READ(regOffset, &regBase);
-    GT_REG_READ(regOffset+8, &regEnd);
-
-    if(regEnd<=regBase) return 0xffffffff;     /* ERROR !!! */
-
-    regBase = regBase << 20;
-    return regBase;
-}
-
-/********************************************************************
-* memoryGetBankSize - Returns the size of a memory bank.
-*
-*
-* INPUT:    MEMORY_BANK bank - The bank we ask for its size.
-* OUTPUT:   N/A
-* RETURNS: Memory bank size.
-*********************************************************************/
-unsigned int memoryGetBankSize(MEMORY_BANK bank)
-{
-    unsigned int size,base;
-    unsigned int highValue;
-    unsigned int highAddress=memoryGetBankRegOffset(bank)+8;
-
-    base = memoryGetBankBaseAddress(bank);
-    GT_REG_READ(highAddress,&highValue);
-    highValue = (highValue + 1) << 20;
-    if(base > highValue)
-       size=0;
-    else
-       size = highValue - base;
-    return size;
-}
-
-/********************************************************************
-* memoryGetDeviceSize - Returns the size of a device memory space
-*
-*
-* INPUT:    DEVICE device - The device we ask for its base address.
-* OUTPUT:   N/A
-* RETURNS:  Size of a device memory space.
-*********************************************************************/
-unsigned int memoryGetDeviceSize(DEVICE device)
-{
-    unsigned int size,base;
-    unsigned int highValue;
-    unsigned int highAddress=memoryGetDeviceRegOffset(device)+8;
-
-    base = memoryGetDeviceBaseAddress(device);
-    GT_REG_READ(highAddress,&highValue);
-    if (highValue == 0xfff)
-    {
-       size = (~base) + 1;     /* what the heck is this? */
-       return size;
-    }
-    else
-       highValue = (highValue + 1) << 20;
-
-    if(base > highValue)
-       size=0;
-    else
-       size = highValue - base;
-    return size;
-}
-
-/********************************************************************
-* memoryGetDeviceWidth - A device can be with: 1,2,4 or 8 Bytes data width.
-*                  The width is determine in registers: 'Device Parameters'
-*                  registers (0x45c, 0x460, 0x464, 0x468, 0x46c - for each device.
-*                  at bits: [21:20].
-*
-* INPUT:    DEVICE device - Device number
-* OUTPUT:   N/A
-* RETURNS:  Device width in Bytes (1,2,4 or 8), 0 if error had occurred.
-*********************************************************************/
-unsigned int memoryGetDeviceWidth(DEVICE device)
-{
-    unsigned int width;
-    unsigned int regValue;
-
-    GT_REG_READ(DEVICE_BANK0PARAMETERS + device*4,&regValue);
-    width =  (regValue & 0x00300000) >> 20;
-    switch (width)
-    {
-       case 0:
-           return 1;
-       case 1:
-           return 2;
-       case 2:
-           return 4;
-       case 3:
-           return 8;
-       default:
-           return 0;
-    }
-}
-
-bool memoryMapBank(MEMORY_BANK bank, unsigned int bankBase,unsigned int bankLength)
-{
-    unsigned int low=0xfff;
-    unsigned int high=0x0;
-    unsigned int regOffset=memoryGetBankRegOffset(bank);
-
-    if(bankLength!=0) {
-       low = (bankBase >> 20) & 0xffff;
-       high=((bankBase+bankLength)>>20)-1;
-    }
-
-#ifdef DEBUG
-    {
-       unsigned int oldLow, oldHigh;
-       GT_REG_READ(regOffset,&oldLow);
-       GT_REG_READ(regOffset+8,&oldHigh);
-
-       printf("b%d %x-%x->%x-%x\n", bank, oldLow, oldHigh, low, high);
-    }
-#endif
-
-    GT_REG_WRITE(regOffset,low);
-    GT_REG_WRITE(regOffset+8,high);
-
-    return true;
-}
-bool memoryMapDeviceSpace(DEVICE device, unsigned int deviceBase,unsigned int deviceLength)
-{
-    /* TODO: what are appropriate "unmapped" values? */
-    unsigned int low=0xfff;
-    unsigned int high=0x0;
-    unsigned int regOffset=memoryGetDeviceRegOffset(device);
-
-    if(deviceLength != 0) {
-       low=deviceBase>>20;
-       high=((deviceBase+deviceLength)>>20)-1;
-    } else {
-       /* big problems in here... */
-       /* this will HANG */
-    }
-
-    GT_REG_WRITE(regOffset,low);
-    GT_REG_WRITE(regOffset+8,high);
-
-    return true;
-}
-
-
-/********************************************************************
-* memoryMapInternalRegistersSpace - Sets new base address for the internals
-*                                   registers.
-*
-* INPUTS:  unsigned int internalRegBase - The new base address.
-* RETURNS: true on success, false on failure
-*********************************************************************/
-bool memoryMapInternalRegistersSpace(unsigned int internalRegBase)
-{
-    unsigned int currentValue;
-    unsigned int internalValue = internalRegBase;
-
-    internalRegBase = (internalRegBase >> 20);
-    GT_REG_READ(INTERNAL_SPACE_DECODE,&currentValue);
-    internalRegBase = (currentValue & 0xffff0000) | internalRegBase;
-    GT_REG_WRITE(INTERNAL_SPACE_DECODE,internalRegBase);
-    INTERNAL_REG_BASE_ADDR = internalValue;
-    return true;
-}
-
-/********************************************************************
-* memoryGetInternalRegistersSpace - Gets internal registers Base Address.
-*
-* INPUTS:  unsigned int internalRegBase - The new base address.
-* RETURNS: true on success, false on failure
-*********************************************************************/
-unsigned int memoryGetInternalRegistersSpace(void)
-{
-    return INTERNAL_REG_BASE_ADDR;
-}
-
-/********************************************************************
-* memorySetProtectRegion - This function modifys one of the 8 regions with
-*                          one of the three protection mode.
-*                        - Be advised to check the spec before modifying them.
-*
-*
-* Inputs: CPU_PROTECT_REGION - one of the eight regions.
-*         CPU_ACCESS - general access.
-*         CPU_WRITE - read only access.
-*         CPU_CACHE_PROTECT - chache access.
-*      we defining CPU because there is another protect from the pci SIDE.
-* Returns: false if one of the parameters is wrong and true else
-*********************************************************************/
-bool memorySetProtectRegion(MEMORY_PROTECT_REGION region,
-                           MEMORY_ACCESS memAccess,
-                           MEMORY_ACCESS_WRITE memWrite,
-                           MEMORY_CACHE_PROTECT cacheProtection,
-                           unsigned int baseAddress,
-                           unsigned int regionLength)
-{
-    unsigned int protectHigh = baseAddress + regionLength;
-
-    if(regionLength == 0) /* closing the region */
-    {
-       GT_REG_WRITE(CPU_LOW_PROTECT_ADDRESS_0 + 0x10*region,0x0000ffff);
-       GT_REG_WRITE(CPU_HIGH_PROTECT_ADDRESS_0 + 0x10*region,0);
-       return true;
-    }
-    baseAddress =  (baseAddress & 0xfff00000) >> 20;
-    baseAddress = baseAddress | memAccess << 16 |  memWrite << 17
-                    | cacheProtection << 18;
-    GT_REG_WRITE(CPU_LOW_PROTECT_ADDRESS_0 + 0x10*region,baseAddress);
-    protectHigh = (protectHigh & 0xfff00000) >> 20;
-    GT_REG_WRITE(CPU_HIGH_PROTECT_ADDRESS_0 + 0x10*region,protectHigh - 1);
-    return true;
-}
-
-/********************************************************************
-* memorySetRegionSnoopMode - This function modifys one of the 4 regions which
-*                            supports Cache Coherency.
-*
-*
-* Inputs: SNOOP_REGION region - One of the four regions.
-*         SNOOP_TYPE snoopType - There is four optional Types:
-*                               1. No Snoop.
-*                               2. Snoop to WT region.
-*                               3. Snoop to WB region.
-*                               4. Snoop & Invalidate to WB region.
-*         unsigned int baseAddress - Base Address of this region.
-*         unsigned int topAddress - Top Address of this region.
-* Returns: false if one of the parameters is wrong and true else
-*********************************************************************/
-bool memorySetRegionSnoopMode(MEMORY_SNOOP_REGION region,
-                             MEMORY_SNOOP_TYPE snoopType,
-                             unsigned int baseAddress,
-                             unsigned int regionLength)
-{
-    unsigned int snoopXbaseAddress;
-    unsigned int snoopXtopAddress;
-    unsigned int data;
-    unsigned int snoopHigh = baseAddress + regionLength;
-
-    if( (region > MEM_SNOOP_REGION3) || (snoopType > MEM_SNOOP_WB) )
-       return false;
-    snoopXbaseAddress = SNOOP_BASE_ADDRESS_0 + 0x10 * region;
-    snoopXtopAddress = SNOOP_TOP_ADDRESS_0 + 0x10 * region;
-    if(regionLength == 0) /* closing the region */
-    {
-       GT_REG_WRITE(snoopXbaseAddress,0x0000ffff);
-       GT_REG_WRITE(snoopXtopAddress,0);
-       return true;
-    }
-    baseAddress = baseAddress & 0xffff0000;
-    data = (baseAddress >> 16) | snoopType << 16;
-    GT_REG_WRITE(snoopXbaseAddress,data);
-    snoopHigh = (snoopHigh & 0xfff00000) >> 20;
-    GT_REG_WRITE(snoopXtopAddress,snoopHigh - 1);
-    return true;
-}
-
-/********************************************************************
-* memoryRemapAddress - This fubction used for address remapping.
-*
-*
-* Inputs: regOffset: remap register
-*         remapValue :
-* Returns: false if one of the parameters is erroneous,true otherwise.
-*********************************************************************/
-bool memoryRemapAddress(unsigned int remapReg, unsigned int remapValue)
-{
-    unsigned int valueForReg;
-    valueForReg = (remapValue & 0xfff00000) >> 20;
-    GT_REG_WRITE(remapReg, valueForReg);
-    return true;
-}
-
-/********************************************************************
-* memoryGetDeviceParam - This function used for getting device parameters from
-*                        DEVICE BANK PARAMETERS REGISTER
-*
-*
-* Inputs:        - deviceParam: STRUCT with paramiters for DEVICE BANK
-*                  PARAMETERS REGISTER
-*                - deviceNum : number of device
-* Returns: false if one of the parameters is erroneous,true otherwise.
-*********************************************************************/
-bool memoryGetDeviceParam(DEVICE_PARAM *deviceParam, DEVICE deviceNum)
-{
-    unsigned int valueOfReg;
-    unsigned int calcData;
-
-    GT_REG_READ(DEVICE_BANK0PARAMETERS + 4 * deviceNum, &valueOfReg);
-    calcData = (0x7 & valueOfReg) + ((0x400000 & valueOfReg) >> 19);
-    deviceParam -> turnOff = calcData;          /* Turn Off */
-
-    calcData = ((0x78 & valueOfReg) >> 3) + ((0x800000 & valueOfReg) >> 19);
-    deviceParam -> acc2First = calcData;        /* Access To First */
-
-    calcData = ((0x780 & valueOfReg) >> 7) + ((0x1000000 & valueOfReg) >> 20);
-    deviceParam -> acc2Next = calcData;         /* Access To Next */
-
-    calcData = ((0x3800 & valueOfReg) >> 11) + ((0x2000000 & valueOfReg) >> 22);
-    deviceParam -> ale2Wr = calcData;           /* Ale To Write */
-
-    calcData = ((0x1c000 & valueOfReg) >> 14) + ((0x4000000 & valueOfReg) >> 23);
-    deviceParam -> wrLow = calcData;            /* Write Active */
-
-    calcData = ((0xe0000 & valueOfReg) >> 17) + ((0x8000000 & valueOfReg) >> 24);
-    deviceParam -> wrHigh = calcData;           /* Write High */
-
-    calcData = ((0x300000 & valueOfReg) >> 20);
-    switch (calcData)
-    {
-    case 0:
-       deviceParam -> deviceWidth = 1;         /* one Byte - 8-bit */
-       break;
-    case 1:
-       deviceParam -> deviceWidth = 2;         /* two Bytes - 16-bit */
-       break;
-    case 2:
-       deviceParam -> deviceWidth = 4;         /* four Bytes - 32-bit */
-       break;
-    case 3:
-       deviceParam -> deviceWidth = 8;         /* eight Bytes - 64-bit */
-       break;
-    default:
-       deviceParam -> deviceWidth = 1;
-       break;
-    }
-    return true;
-}
-
-/********************************************************************
-* memorySetDeviceParam - This function used for setting device parameters to
-*                        DEVICE BANK PARAMETERS REGISTER
-*
-*
-* Inputs:        - deviceParam: STRUCT for store paramiters from DEVICE BANK
-*                  PARAMETERS REGISTER
-*                - deviceNum : number of device
-* Returns: false if one of the parameters is erroneous,true otherwise.
-*********************************************************************/
-bool memorySetDeviceParam(DEVICE_PARAM *deviceParam, DEVICE deviceNum)
-{
-    unsigned int valueForReg;
-
-    if((deviceParam -> turnOff >= 0xf) || (deviceParam -> acc2First >= 0x1f) ||
-       (deviceParam -> acc2Next >= 0x1f) || (deviceParam -> ale2Wr >= 0xf) ||
-       (deviceParam -> wrLow >= 0xf) || (deviceParam -> wrHigh >= 0xf))
-       return false;
-    valueForReg = (((deviceParam -> turnOff) & 0x7) |
-                  (((deviceParam -> turnOff) & 0x8) << 19) |
-                  (((deviceParam -> acc2First) & 0xf) << 3) |
-                  (((deviceParam -> acc2First) & 0x10) << 19) |
-                  (((deviceParam -> acc2Next) & 0xf) << 7) |
-                  (((deviceParam -> acc2Next) & 0x10) << 20) |
-                  (((deviceParam -> ale2Wr) & 0x7) << 11) |
-                  (((deviceParam -> ale2Wr) & 0xf) << 22) |
-                  (((deviceParam -> wrLow) & 0x7) << 14) |
-                  (((deviceParam -> wrLow) & 0xf) << 23) |
-                  (((deviceParam -> wrHigh) & 0x7) << 17) |
-                  (((deviceParam -> wrHigh) & 0xf) << 24));
-    /* insert the device width: */
-    switch(deviceParam->deviceWidth)
-    {
-    case 1:
-       valueForReg = valueForReg | _8BIT;
-       break;
-    case 2:
-       valueForReg = valueForReg | _16BIT;
-       break;
-    case 4:
-       valueForReg = valueForReg | _32BIT;
-       break;
-    case 8:
-       valueForReg = valueForReg | _64BIT;
-       break;
-    default:
-       valueForReg = valueForReg | _8BIT;
-       break;
-    }
-    GT_REG_WRITE(DEVICE_BANK0PARAMETERS + 4 * deviceNum, valueForReg);
-    return true;
-}
diff --git a/board/evb64260/misc.S b/board/evb64260/misc.S
deleted file mode 100644 (file)
index f09528d..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-#include <config.h>
-#include <74xx_7xx.h>
-#include <version.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-
-#include <asm/cache.h>
-#include <asm/mmu.h>
-
-#include <galileo/gt64260R.h>
-
-#ifdef CONFIG_ECC
-       /* Galileo specific asm code for initializing ECC */
-       .globl board_relocate_rom
-board_relocate_rom:
-       mflr    r7
-       /* update the location of the GT registers */
-       lis     r11, CONFIG_SYS_GT_REGS@h
-       /* if we're using ECC, we must use the DMA engine to copy ourselves */
-       bl      start_idma_transfer_0
-       bl      wait_for_idma_0
-       bl      stop_idma_engine_0
-
-       mtlr    r7
-       blr
-
-       .globl board_init_ecc
-board_init_ecc:
-       mflr    r7
-       /* NOTE: r10 still contains the location we've been relocated to
-        * which happens to be TOP_OF_RAM - CONFIG_SYS_MONITOR_LEN */
-
-       /* now that we're running from ram, init the rest of main memory
-        * for ECC use */
-       lis     r8, CONFIG_SYS_MONITOR_LEN@h
-       ori     r8, r8, CONFIG_SYS_MONITOR_LEN@l
-
-       divw    r3, r10, r8
-
-       /* set up the counter, and init the starting address */
-       mtctr   r3
-       li      r12, 0
-
-       /* bytes per transfer */
-       mr      r5, r8
-about_to_init_ecc:
-1:     mr      r3, r12
-       mr      r4, r12
-       bl      start_idma_transfer_0
-       bl      wait_for_idma_0
-       bl      stop_idma_engine_0
-       add     r12, r12, r8
-       bdnz    1b
-
-       mtlr    r7
-       blr
-
-       /* r3:  dest addr
-        * r4:  source addr
-        * r5:  byte count
-        * r11: gt regbase
-        * trashes:      r6, r5
-        */
-start_idma_transfer_0:
-       /* set the byte count, including the OWN bit */
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0_DMA_BYTE_COUNT
-       stwbrx  r5, 0, (r6)
-
-       /* set the source address */
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0_DMA_SOURCE_ADDRESS
-       stwbrx  r4, 0, (r6)
-
-       /* set the dest address */
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0_DMA_DESTINATION_ADDRESS
-       stwbrx  r3, 0, (r6)
-
-       /* set the next record pointer */
-       li      r5, 0
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0NEXT_RECORD_POINTER
-       stwbrx  r5, 0, (r6)
-
-       /* set the low control register */
-       /* bit 9 is NON chained mode, bit 31 is new style descriptors.
-          bit 12 is channel enable */
-       ori     r5, r5, (1 << 12) | (1 << 12) | (1 << 11)
-       /* 15 shifted by 16 (oris) == bit 31 */
-       oris    r5, r5, (1 << 15)
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0CONTROL
-       stwbrx  r5, 0, (r6)
-
-       blr
-
-       /* this waits for the bytecount to return to zero, indicating
-        * that the trasfer is complete */
-wait_for_idma_0:
-       mr      r5, r11
-       lis     r6, 0xff
-       ori     r6, r6, 0xffff
-       ori     r5, r5, CHANNEL0_DMA_BYTE_COUNT
-1:     lwbrx   r4, 0, (r5)
-       and.    r4, r4, r6
-       bne     1b
-
-       blr
-
-       /* this turns off channel 0 of the idma engine */
-stop_idma_engine_0:
-       /* shut off the DMA engine */
-       li      r5, 0
-       mr      r6, r11
-       ori     r6, r6, CHANNEL0CONTROL
-       stwbrx  r5, 0, (r6)
-
-       blr
-#endif
-
-#ifdef CONFIG_SYS_BOARD_ASM_INIT
-       /* NOTE: trashes r3-r7 */
-       .globl board_asm_init
-board_asm_init:
-       /* just move the GT registers to where they belong */
-       lis     r3, CONFIG_SYS_DFL_GT_REGS@h
-       ori     r3, r3, CONFIG_SYS_DFL_GT_REGS@l
-       lis     r4, CONFIG_SYS_GT_REGS@h
-       ori     r4, r4, CONFIG_SYS_GT_REGS@l
-       li      r5, INTERNAL_SPACE_DECODE
-
-       /* test to see if we've already moved */
-       lwbrx   r6, r5, r4
-       andi.   r6, r6, 0xffff
-       rlwinm  r7, r4, 12, 16, 31
-       cmp     cr0, r7, r6
-       beqlr
-
-       /* nope, have to move the registers */
-       lwbrx   r6, r5, r3
-       andis.  r6, r6, 0xffff
-       or      r6, r6, r7
-       stwbrx  r6, r5, r3
-
-       /* now, poll for the change */
-1:     lwbrx   r7, r5, r4
-       cmp     cr0, r7, r6
-       bne     1b
-
-       /* done! */
-       blr
-#endif
-
-/* For use of the debug LEDs */
-       .global led_on0
-led_on0:
-       xor     r18, r18, r18
-       lis     r18, 0x1c80
-       ori     r18, r18, 0x8000
-       stw     r18, 0x0(r18)
-       sync
-       blr
-
-       .global led_on1
-led_on1:
-       xor     r18, r18, r18
-       lis     r18, 0x1c80
-       ori     r18, r18, 0xc000
-       stw     r18, 0x0(r18)
-       sync
-       blr
-
-       .global led_on2
-led_on2:
-       xor     r18, r18, r18
-       lis     r18, 0x1c81
-       ori     r18, r18, 0x0000
-       stw     r18, 0x0(r18)
-       sync
-       blr
diff --git a/board/evb64260/mpsc.c b/board/evb64260/mpsc.c
deleted file mode 100644 (file)
index c9da57c..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * (C) Copyright 2001
- * John Clemens <clemens@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * mpsc.c - driver for console over the MPSC.
- */
-
-#include <common.h>
-#include <config.h>
-#include <asm/cache.h>
-
-#include <malloc.h>
-#include "mpsc.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int (*mpsc_putchar)(char ch) = mpsc_putchar_early;
-
-static volatile unsigned int *rx_desc_base=NULL;
-static unsigned int rx_desc_index=0;
-static volatile unsigned int *tx_desc_base=NULL;
-static unsigned int tx_desc_index=0;
-
-/* local function declarations */
-static int galmpsc_connect(int channel, int connect);
-static int galmpsc_route_serial(int channel, int connect);
-static int galmpsc_route_rx_clock(int channel, int brg);
-static int galmpsc_route_tx_clock(int channel, int brg);
-static int galmpsc_write_config_regs(int mpsc, int mode);
-static int galmpsc_config_channel_regs(int mpsc);
-static int galmpsc_set_char_length(int mpsc, int value);
-static int galmpsc_set_stop_bit_length(int mpsc, int value);
-static int galmpsc_set_parity(int mpsc, int value);
-static int galmpsc_enter_hunt(int mpsc);
-static int galmpsc_set_brkcnt(int mpsc, int value);
-static int galmpsc_set_tcschar(int mpsc, int value);
-static int galmpsc_set_snoop(int mpsc, int value);
-static int galmpsc_shutdown(int mpsc);
-
-static int galsdma_set_RFT(int channel);
-static int galsdma_set_SFM(int channel);
-static int galsdma_set_rxle(int channel);
-static int galsdma_set_txle(int channel);
-static int galsdma_set_burstsize(int channel, unsigned int value);
-static int galsdma_set_RC(int channel, unsigned int value);
-
-static int galbrg_set_CDV(int channel, int value);
-static int galbrg_enable(int channel);
-static int galbrg_disable(int channel);
-static int galbrg_set_clksrc(int channel, int value);
-static int galbrg_set_CUV(int channel, int value);
-
-static void galsdma_enable_rx(void);
-
-/* static int galbrg_reset(int channel); */
-
-#define SOFTWARE_CACHE_MANAGEMENT
-
-#ifdef SOFTWARE_CACHE_MANAGEMENT
-#define FLUSH_DCACHE(a,b)               if(dcache_status()){clean_dcache_range((u32)(a),(u32)(b));}
-#define FLUSH_AND_INVALIDATE_DCACHE(a,b) if(dcache_status()){flush_dcache_range((u32)(a),(u32)(b));}
-#define INVALIDATE_DCACHE(a,b)          if(dcache_status()){invalidate_dcache_range((u32)(a),(u32)(b));}
-#else
-#define FLUSH_DCACHE(a,b)
-#define FLUSH_AND_INVALIDATE_DCACHE(a,b)
-#define INVALIDATE_DCACHE(a,b)
-#endif
-
-
-/* GT64240A errata: cant read MPSC/BRG registers... so make mirrors in ram for read/modify write */
-#define MIRROR_HACK ((struct _tag_mirror_hack *)&(gd->arch.mirror_hack[0]))
-
-#define GT_REG_WRITE_MIRROR_G(a,d) {MIRROR_HACK->a ## _M = d; GT_REG_WRITE(a,d);}
-#define GTREGREAD_MIRROR_G(a) (MIRROR_HACK->a ## _M)
-
-#define GT_REG_WRITE_MIRROR(a,i,g,d) {MIRROR_HACK->a ## _M[i] = d; GT_REG_WRITE(a + (i*g),d);}
-#define GTREGREAD_MIRROR(a,i,g) (MIRROR_HACK->a ## _M[i])
-
-/* make sure this isn't bigger than 16 long words (u-boot.h) */
-struct _tag_mirror_hack {
-    unsigned GALMPSC_PROTOCONF_REG_M[2];       /* 8008 */
-    unsigned GALMPSC_CHANNELREG_1_M[2];                /* 800c */
-    unsigned GALMPSC_CHANNELREG_2_M[2];                /* 8010 */
-    unsigned GALBRG_0_CONFREG_M[2];            /* b200 */
-
-    unsigned GALMPSC_ROUTING_REGISTER_M;       /* b400 */
-    unsigned GALMPSC_RxC_ROUTE_M;              /* b404 */
-    unsigned GALMPSC_TxC_ROUTE_M;              /* b408 */
-
-    unsigned int baudrate;                     /* current baudrate, for tsc delay calc */
-};
-
-/* static struct _tag_mirror_hack *mh = NULL;   */
-
-/* special function for running out of flash.  doesn't modify any
- * global variables [josh] */
-int
-mpsc_putchar_early(char ch)
-{
-       int mpsc=CHANNEL;
-       int temp=GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
-       galmpsc_set_tcschar(mpsc,ch);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_2+(mpsc*GALMPSC_REG_GAP), temp|0x200);
-
-#define MAGIC_FACTOR   (10*1000000)
-
-       udelay(MAGIC_FACTOR / MIRROR_HACK->baudrate);
-       return 0;
-}
-
-/* This is used after relocation, see serial.c and mpsc_init2 */
-static int
-mpsc_putchar_sdma(char ch)
-{
-       volatile unsigned int *p;
-       unsigned int temp;
-
-
-       /* align the descriptor */
-       p = tx_desc_base;
-       memset((void *)p, 0, 8 * sizeof(unsigned int));
-
-       /* fill one 64 bit buffer */
-       /* word swap, pad with 0 */
-       p[4] = 0;                                               /* x */
-       p[5] = (unsigned int)ch;                                /* x */
-
-       /* CHANGED completely according to GT64260A dox - NTL */
-       p[0] = 0x00010001;                                      /* 0 */
-       p[1] = DESC_OWNER | DESC_FIRST | DESC_LAST;             /* 4 */
-       p[2] = 0;                                               /* 8 */
-       p[3] = (unsigned int)&p[4];                             /* c */
-
-#if 0
-       p[9] = DESC_FIRST | DESC_LAST;
-       p[10] = (unsigned int)&p[0];
-       p[11] = (unsigned int)&p[12];
-#endif
-
-       FLUSH_DCACHE(&p[0], &p[8]);
-
-       GT_REG_WRITE(GALSDMA_0_CUR_TX_PTR+(CHANNEL*GALSDMA_REG_DIFF),
-                    (unsigned int)&p[0]);
-       GT_REG_WRITE(GALSDMA_0_FIR_TX_PTR+(CHANNEL*GALSDMA_REG_DIFF),
-                    (unsigned int)&p[0]);
-
-       temp = GTREGREAD(GALSDMA_0_COM_REG+(CHANNEL*GALSDMA_REG_DIFF));
-       temp |= (TX_DEMAND | TX_STOP);
-       GT_REG_WRITE(GALSDMA_0_COM_REG+(CHANNEL*GALSDMA_REG_DIFF), temp);
-
-       INVALIDATE_DCACHE(&p[1], &p[2]);
-
-       while(p[1] & DESC_OWNER) {
-           udelay(100);
-           INVALIDATE_DCACHE(&p[1], &p[2]);
-       }
-
-       return 0;
-}
-
-char mpsc_getchar (void)
-{
-       static unsigned int done = 0;
-       volatile char ch;
-       unsigned int len = 0, idx = 0, temp;
-
-       volatile unsigned int *p;
-
-
-       do {
-               p = &rx_desc_base[rx_desc_index * 8];
-
-               INVALIDATE_DCACHE (&p[0], &p[1]);
-               /* Wait for character */
-               while (p[1] & DESC_OWNER) {
-                       udelay (100);
-                       INVALIDATE_DCACHE (&p[0], &p[1]);
-               }
-
-               /* Handle error case */
-               if (p[1] & (1 << 15)) {
-                       printf ("oops, error: %08x\n", p[1]);
-
-                       temp = GTREGREAD_MIRROR (GALMPSC_CHANNELREG_2,
-                                                CHANNEL, GALMPSC_REG_GAP);
-                       temp |= (1 << 23);
-                       GT_REG_WRITE_MIRROR (GALMPSC_CHANNELREG_2, CHANNEL,
-                                            GALMPSC_REG_GAP, temp);
-
-                       /* Can't poll on abort bit, so we just wait. */
-                       udelay (100);
-
-                       galsdma_enable_rx ();
-               }
-
-               /* Number of bytes left in this descriptor */
-               len = p[0] & 0xffff;
-
-               if (len) {
-                       /* Where to look */
-                       idx = 5;
-                       if (done > 3)
-                               idx = 4;
-                       if (done > 7)
-                               idx = 7;
-                       if (done > 11)
-                               idx = 6;
-
-                       INVALIDATE_DCACHE (&p[idx], &p[idx + 1]);
-                       ch = p[idx] & 0xff;
-                       done++;
-               }
-
-               if (done < len) {
-                       /* this descriptor has more bytes still
-                        * shift down the char we just read, and leave the
-                        * buffer in place for the next time around
-                        */
-                       p[idx] = p[idx] >> 8;
-                       FLUSH_DCACHE (&p[idx], &p[idx + 1]);
-               }
-
-               if (done == len) {
-                       /* nothing left in this descriptor.
-                        * go to next one
-                        */
-                       p[1] = DESC_OWNER | DESC_FIRST | DESC_LAST;
-                       p[0] = 0x00100000;
-                       FLUSH_DCACHE (&p[0], &p[1]);
-                       /* Next descriptor */
-                       rx_desc_index = (rx_desc_index + 1) % RX_DESC;
-                       done = 0;
-               }
-       } while (len == 0);     /* galileo bug.. len might be zero */
-
-       return ch;
-}
-
-int
-mpsc_test_char(void)
-{
-       volatile unsigned int *p = &rx_desc_base[rx_desc_index*8];
-
-       INVALIDATE_DCACHE(&p[1], &p[2]);
-
-       if (p[1] & DESC_OWNER) return 0;
-       else return 1;
-}
-
-int
-mpsc_init(int baud)
-{
-       memset(MIRROR_HACK, 0, sizeof(struct _tag_mirror_hack));
-       MIRROR_HACK->GALMPSC_ROUTING_REGISTER_M=0x3fffffff;
-
-       /* BRG CONFIG */
-       galbrg_set_baudrate(CHANNEL, baud);
-#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
-       galbrg_set_clksrc(CHANNEL,0x8); /* connect TCLK -> BRG */
-#else
-       galbrg_set_clksrc(CHANNEL,0);
-#endif
-       galbrg_set_CUV(CHANNEL, 0);
-       galbrg_enable(CHANNEL);
-
-       /* Set up clock routing */
-       galmpsc_connect(CHANNEL, GALMPSC_CONNECT);
-       galmpsc_route_serial(CHANNEL, GALMPSC_CONNECT);
-       galmpsc_route_rx_clock(CHANNEL, CHANNEL);
-       galmpsc_route_tx_clock(CHANNEL, CHANNEL);
-
-       /* reset MPSC state */
-       galmpsc_shutdown(CHANNEL);
-
-       /* SDMA CONFIG */
-       galsdma_set_burstsize(CHANNEL, L1_CACHE_BYTES/8);       /* in 64 bit words (8 bytes) */
-       galsdma_set_txle(CHANNEL);
-       galsdma_set_rxle(CHANNEL);
-       galsdma_set_RC(CHANNEL, 0xf);
-       galsdma_set_SFM(CHANNEL);
-       galsdma_set_RFT(CHANNEL);
-
-       /* MPSC CONFIG */
-       galmpsc_write_config_regs(CHANNEL, GALMPSC_UART);
-       galmpsc_config_channel_regs(CHANNEL);
-       galmpsc_set_char_length(CHANNEL, GALMPSC_CHAR_LENGTH_8);       /* 8 */
-       galmpsc_set_parity(CHANNEL, GALMPSC_PARITY_NONE);              /* N */
-       galmpsc_set_stop_bit_length(CHANNEL, GALMPSC_STOP_BITS_1);     /* 1 */
-
-       /* COMM_MPSC CONFIG */
-#ifdef SOFTWARE_CACHE_MANAGEMENT
-       galmpsc_set_snoop(CHANNEL, 0);                          /* disable snoop */
-#else
-       galmpsc_set_snoop(CHANNEL, 1);                          /* enable snoop */
-#endif
-
-       return 0;
-}
-
-void
-mpsc_init2(void)
-{
-       int i;
-
-       mpsc_putchar = mpsc_putchar_sdma;
-
-       /* RX descriptors */
-       rx_desc_base = (unsigned int *)malloc(((RX_DESC+1)*8) *
-               sizeof(unsigned int));
-
-       /* align descriptors */
-       rx_desc_base = (unsigned int *)
-               (((unsigned int)rx_desc_base+32) & 0xFFFFFFF0);
-
-       rx_desc_index = 0;
-
-       memset((void *)rx_desc_base, 0, (RX_DESC*8)*sizeof(unsigned int));
-
-       for (i = 0; i < RX_DESC; i++) {
-               rx_desc_base[i*8 + 3] = (unsigned int)&rx_desc_base[i*8 + 4]; /* Buffer */
-               rx_desc_base[i*8 + 2] = (unsigned int)&rx_desc_base[(i+1)*8]; /* Next descriptor */
-               rx_desc_base[i*8 + 1] = DESC_OWNER | DESC_FIRST | DESC_LAST;  /* Command & control */
-               rx_desc_base[i*8] = 0x00100000;
-       }
-       rx_desc_base[(i-1)*8 + 2] = (unsigned int)&rx_desc_base[0];
-
-       FLUSH_DCACHE(&rx_desc_base[0], &rx_desc_base[RX_DESC*8]);
-       GT_REG_WRITE(GALSDMA_0_CUR_RX_PTR+(CHANNEL*GALSDMA_REG_DIFF),
-                    (unsigned int)&rx_desc_base[0]);
-
-       /* TX descriptors */
-       tx_desc_base = (unsigned int *)malloc(((TX_DESC+1)*8) *
-               sizeof(unsigned int));
-
-       /* align descriptors */
-       tx_desc_base = (unsigned int *)
-               (((unsigned int)tx_desc_base+32) & 0xFFFFFFF0);
-
-       tx_desc_index = -1;
-
-       memset((void *)tx_desc_base, 0, (TX_DESC*8)*sizeof(unsigned int));
-
-       for (i = 0; i < TX_DESC; i++) {
-               tx_desc_base[i*8 + 5] = (unsigned int)0x23232323;
-               tx_desc_base[i*8 + 4] = (unsigned int)0x23232323;
-               tx_desc_base[i*8 + 3] = (unsigned int)&tx_desc_base[i*8 + 4];
-               tx_desc_base[i*8 + 2] = (unsigned int)&tx_desc_base[(i+1)*8];
-               tx_desc_base[i*8 + 1] = DESC_OWNER | DESC_FIRST | DESC_LAST;
-
-               /* set sbytecnt and shadow byte cnt to 1 */
-               tx_desc_base[i*8] = 0x00010001;
-       }
-       tx_desc_base[(i-1)*8 + 2] = (unsigned int)&tx_desc_base[0];
-
-       FLUSH_DCACHE(&tx_desc_base[0], &tx_desc_base[TX_DESC*8]);
-
-       udelay(100);
-
-       galsdma_enable_rx();
-
-       return;
-}
-
-int
-galbrg_set_baudrate(int channel, int rate)
-{
-       int clock;
-
-       galbrg_disable(channel);
-
-#if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4)
-       /* from tclk */
-       clock = (CONFIG_SYS_BUS_CLK/(16*rate)) - 1;
-#else
-       clock = (3686400/(16*rate)) - 1;
-#endif
-
-       galbrg_set_CDV(channel, clock);
-
-       galbrg_enable(channel);
-
-       MIRROR_HACK->baudrate = rate;
-
-       return 0;
-}
-
-/* ------------------------------------------------------------------ */
-
-/* Below are all the private functions that no one else needs */
-
-static int
-galbrg_set_CDV(int channel, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
-       temp &= 0xFFFF0000;
-       temp |= (value & 0x0000FFFF);
-       GT_REG_WRITE_MIRROR(GALBRG_0_CONFREG,channel,GALBRG_REG_GAP, temp);
-
-       return 0;
-}
-
-static int
-galbrg_enable(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
-       temp |= 0x00010000;
-       GT_REG_WRITE_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP,temp);
-
-       return 0;
-}
-
-static int
-galbrg_disable(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
-       temp &= 0xFFFEFFFF;
-       GT_REG_WRITE_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP,temp);
-
-       return 0;
-}
-
-static int
-galbrg_set_clksrc(int channel, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG,channel, GALBRG_REG_GAP);
-       temp &= 0xFF83FFFF;
-       temp |= (value << 18);
-       GT_REG_WRITE_MIRROR(GALBRG_0_CONFREG,channel, GALBRG_REG_GAP,temp);
-
-       return 0;
-}
-
-static int
-galbrg_set_CUV(int channel, int value)
-{
-       GT_REG_WRITE(GALBRG_0_BTREG + (channel * GALBRG_REG_GAP), value);
-
-       return 0;
-}
-
-#if 0
-static int
-galbrg_reset(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALBRG_0_CONFREG + (channel * GALBRG_REG_GAP));
-       temp |= 0x20000;
-       GT_REG_WRITE(GALBRG_0_CONFREG + (channel * GALBRG_REG_GAP), temp);
-
-       return 0;
-}
-#endif
-
-static int
-galsdma_set_RFT(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp |= 0x00000001;
-       GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF), temp);
-
-       return 0;
-}
-
-static int
-galsdma_set_SFM(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp |= 0x00000002;
-       GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF), temp);
-
-       return 0;
-}
-
-static int
-galsdma_set_rxle(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp |= 0x00000040;
-       GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF), temp);
-
-       return 0;
-}
-
-static int
-galsdma_set_txle(int channel)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp |= 0x00000080;
-       GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF), temp);
-
-       return 0;
-}
-
-static int
-galsdma_set_RC(int channel, unsigned int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp &= ~0x0000003c;
-       temp |= (value << 2);
-       GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF), temp);
-
-       return 0;
-}
-
-static int
-galsdma_set_burstsize(int channel, unsigned int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF));
-       temp &= 0xFFFFCFFF;
-       switch (value) {
-        case 8:
-               GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF),
-                            (temp | (0x3 << 12)));
-               break;
-
-        case 4:
-               GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF),
-                            (temp | (0x2 << 12)));
-               break;
-
-        case 2:
-               GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF),
-                            (temp | (0x1 << 12)));
-               break;
-
-        case 1:
-               GT_REG_WRITE(GALSDMA_0_CONF_REG+(channel*GALSDMA_REG_DIFF),
-                            (temp | (0x0 << 12)));
-               break;
-
-        default:
-               return -1;
-               break;
-       }
-
-       return 0;
-}
-
-static int
-galmpsc_connect(int channel, int connect)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR_G(GALMPSC_ROUTING_REGISTER);
-
-       if ((channel == 0) && connect)
-               temp &= ~0x00000007;
-       else if ((channel == 1) && connect)
-               temp &= ~(0x00000007 << 6);
-       else if ((channel == 0) && !connect)
-               temp |= 0x00000007;
-       else
-               temp |= (0x00000007 << 6);
-
-       /* Just in case... */
-       temp &= 0x3fffffff;
-
-       GT_REG_WRITE_MIRROR_G(GALMPSC_ROUTING_REGISTER, temp);
-
-       return 0;
-}
-
-static int
-galmpsc_route_serial(int channel, int connect)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD(GALMPSC_SERIAL_MULTIPLEX);
-
-       if ((channel == 0) && connect)
-               temp |= 0x00000100;
-       else if ((channel == 1) && connect)
-               temp |= 0x00001000;
-       else if ((channel == 0) && !connect)
-               temp &= ~0x00000100;
-       else
-               temp &= ~0x00001000;
-
-       GT_REG_WRITE(GALMPSC_SERIAL_MULTIPLEX,temp);
-
-       return 0;
-}
-
-static int
-galmpsc_route_rx_clock(int channel, int brg)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR_G(GALMPSC_RxC_ROUTE);
-
-       if (channel == 0)
-               temp |= brg;
-       else
-               temp |= (brg << 8);
-
-       GT_REG_WRITE_MIRROR_G(GALMPSC_RxC_ROUTE,temp);
-
-       return 0;
-}
-
-static int
-galmpsc_route_tx_clock(int channel, int brg)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR_G(GALMPSC_TxC_ROUTE);
-
-       if (channel == 0)
-               temp |= brg;
-       else
-               temp |= (brg << 8);
-
-       GT_REG_WRITE_MIRROR_G(GALMPSC_TxC_ROUTE,temp);
-
-       return 0;
-}
-
-static int
-galmpsc_write_config_regs(int mpsc, int mode)
-{
-       if (mode == GALMPSC_UART) {
-               /* Main config reg Low (Null modem, Enable Tx/Rx, UART mode) */
-               GT_REG_WRITE(GALMPSC_MCONF_LOW + (mpsc*GALMPSC_REG_GAP),
-                            0x000004c4);
-
-               /* Main config reg High (32x Rx/Tx clock mode, width=8bits */
-               GT_REG_WRITE(GALMPSC_MCONF_HIGH +(mpsc*GALMPSC_REG_GAP),
-                            0x024003f8);
-               /*        22 2222 1111 */
-               /*        54 3210 9876 */
-               /* 0000 0010 0000 0000 */
-               /*       1 */
-               /*       098 7654 3210 */
-               /* 0000 0011 1111 1000 */
-       } else
-               return -1;
-
-       return 0;
-}
-
-static int
-galmpsc_config_channel_regs(int mpsc)
-{
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP, 0);
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP, 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_3+(mpsc*GALMPSC_REG_GAP), 1);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_4+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_5+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_6+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_7+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_8+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_9+(mpsc*GALMPSC_REG_GAP), 0);
-       GT_REG_WRITE(GALMPSC_CHANNELREG_10+(mpsc*GALMPSC_REG_GAP), 0);
-
-       galmpsc_set_brkcnt(mpsc, 0x3);
-       galmpsc_set_tcschar(mpsc, 0xab);
-
-       return 0;
-}
-
-static int
-galmpsc_set_brkcnt(int mpsc, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP);
-       temp &= 0x0000FFFF;
-       temp |= (value << 16);
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP, temp);
-
-       return 0;
-}
-
-static int
-galmpsc_set_tcschar(int mpsc, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP);
-       temp &= 0xFFFF0000;
-       temp |= value;
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP, temp);
-
-       return 0;
-}
-
-static int
-galmpsc_set_char_length(int mpsc, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP);
-       temp &= 0xFFFFCFFF;
-       temp |= (value << 12);
-       GT_REG_WRITE_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP, temp);
-
-       return 0;
-}
-
-static int
-galmpsc_set_stop_bit_length(int mpsc, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP);
-       temp |= (value << 14);
-       GT_REG_WRITE_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP,temp);
-
-       return 0;
-}
-
-static int
-galmpsc_set_parity(int mpsc, int value)
-{
-       unsigned int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
-       if (value != -1) {
-               temp &= 0xFFF3FFF3;
-               temp |= ((value << 18) | (value << 2));
-               temp |= ((value << 17) | (value << 1));
-       } else {
-               temp &= 0xFFF1FFF1;
-       }
-
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP, temp);
-
-       return 0;
-}
-
-static int
-galmpsc_enter_hunt(int mpsc)
-{
-       int temp;
-
-       temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
-       temp |= 0x80000000;
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP, temp);
-
-       /* Should Poll on Enter Hunt bit, but the register is write-only */
-       /* errata suggests pausing 100 system cycles */
-       udelay(100);
-
-       return 0;
-}
-
-
-static int
-galmpsc_shutdown(int mpsc)
-{
-#if 0
-       unsigned int temp;
-
-       /* cause RX abort (clears RX) */
-       temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
-       temp |= MPSC_RX_ABORT | MPSC_TX_ABORT;
-       temp &= ~MPSC_ENTER_HUNT;
-       GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP,temp);
-#endif
-
-       GT_REG_WRITE(GALSDMA_0_COM_REG + CHANNEL * GALSDMA_REG_DIFF, 0);
-       GT_REG_WRITE(GALSDMA_0_COM_REG + CHANNEL * GALSDMA_REG_DIFF,
-                    SDMA_TX_ABORT | SDMA_RX_ABORT);
-
-       /* shut down the MPSC */
-       GT_REG_WRITE(GALMPSC_MCONF_LOW, 0);
-       GT_REG_WRITE(GALMPSC_MCONF_HIGH, 0);
-       GT_REG_WRITE_MIRROR(GALMPSC_PROTOCONF_REG, mpsc, GALMPSC_REG_GAP,0);
-
-       udelay(100);
-
-       /* shut down the sdma engines. */
-       /* reset config to default */
-       GT_REG_WRITE(GALSDMA_0_CONF_REG + CHANNEL * GALSDMA_REG_DIFF,
-                    0x000000fc);
-
-       udelay(100);
-
-       /* clear the SDMA current and first TX and RX pointers */
-       GT_REG_WRITE(GALSDMA_0_CUR_RX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
-       GT_REG_WRITE(GALSDMA_0_CUR_TX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
-       GT_REG_WRITE(GALSDMA_0_FIR_TX_PTR + CHANNEL * GALSDMA_REG_DIFF, 0);
-
-       udelay(100);
-
-       return 0;
-}
-
-static void
-galsdma_enable_rx(void)
-{
-       int temp;
-
-       /* Enable RX processing */
-       temp = GTREGREAD(GALSDMA_0_COM_REG+(CHANNEL*GALSDMA_REG_DIFF));
-       temp |= RX_ENABLE;
-       GT_REG_WRITE(GALSDMA_0_COM_REG+(CHANNEL*GALSDMA_REG_DIFF), temp);
-
-       galmpsc_enter_hunt(CHANNEL);
-}
-
-static int
-galmpsc_set_snoop(int mpsc, int value)
-{
-       int reg = mpsc ? MPSC_1_ADDRESS_CONTROL_LOW : MPSC_0_ADDRESS_CONTROL_LOW;
-       int temp=GTREGREAD(reg);
-       if(value)
-           temp |= (1<< 6) | (1<<14) | (1<<22) | (1<<30);
-       else
-           temp &= ~((1<< 6) | (1<<14) | (1<<22) | (1<<30));
-       GT_REG_WRITE(reg, temp);
-       return 0;
-}
diff --git a/board/evb64260/mpsc.h b/board/evb64260/mpsc.h
deleted file mode 100644 (file)
index 0747477..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * John Clemens <clemens@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * mpsc.h - header file for MPSC in uart mode (console driver)
- */
-
-#ifndef __MPSC_H__
-#define __MPSC_H__
-
-/* include actual Galileo defines */
-#include <galileo/gt64260R.h>
-
-/* driver related defines */
-
-int mpsc_init(int baud);
-void mpsc_init2(void);
-char mpsc_getchar(void);
-int mpsc_test_char(void);
-int galbrg_set_baudrate(int channel, int rate);
-
-int mpsc_putchar_early(char ch);
-extern int (*mpsc_putchar)(char ch);
-
-#define CHANNEL CONFIG_MPSC_PORT
-
-#define TX_DESC     5
-#define RX_DESC     20
-
-#define DESC_FIRST  0x00010000
-#define DESC_LAST   0x00020000
-#define DESC_OWNER  0x80000000
-
-#define TX_DEMAND   0x00800000
-#define TX_STOP     0x00010000
-#define RX_ENABLE   0x00000080
-
-#define SDMA_RX_ABORT            (1 << 15)
-#define SDMA_TX_ABORT            (1 << 31)
-#define MPSC_TX_ABORT            (1 << 7)
-#define MPSC_RX_ABORT             (1 << 23)
-#define MPSC_ENTER_HUNT           (1 << 31)
-
-/* MPSC defines */
-
-#define GALMPSC_CONNECT            0x1
-#define GALMPSC_DISCONNECT         0x0
-
-#define GALMPSC_UART               0x1
-
-#define GALMPSC_STOP_BITS_1        0x0
-#define GALMPSC_STOP_BITS_2        0x1
-#define GALMPSC_CHAR_LENGTH_8      0x3
-#define GALMPSC_CHAR_LENGTH_7      0x2
-
-#define GALMPSC_PARITY_ODD         0x0
-#define GALMPSC_PARITY_EVEN        0x2
-#define GALMPSC_PARITY_MARK        0x3
-#define GALMPSC_PARITY_SPACE       0x1
-#define GALMPSC_PARITY_NONE        -1
-
-#define GALMPSC_SERIAL_MULTIPLEX   SERIAL_PORT_MULTIPLEX           /* 0xf010 */
-#define GALMPSC_ROUTING_REGISTER   MAIN_ROUTING_REGISTER           /* 0xb400 */
-#define GALMPSC_RxC_ROUTE          RECEIVE_CLOCK_ROUTING_REGISTER  /* 0xb404 */
-#define GALMPSC_TxC_ROUTE          TRANSMIT_CLOCK_ROUTING_REGISTER /* 0xb408 */
-#define GALMPSC_MCONF_LOW          MPSC0_MAIN_CONFIGURATION_LOW    /* 0x8000 */
-#define GALMPSC_MCONF_HIGH         MPSC0_MAIN_CONFIGURATION_HIGH   /* 0x8004 */
-#define GALMPSC_PROTOCONF_REG      MPSC0_PROTOCOL_CONFIGURATION    /* 0x8008 */
-
-#define GALMPSC_REG_GAP            0x1000
-
-#define GALMPSC_MCONF_CHREG_BASE   CHANNEL0_REGISTER1  /* 0x800c */
-#define GALMPSC_CHANNELREG_1       CHANNEL0_REGISTER1  /* 0x800c */
-#define GALMPSC_CHANNELREG_2       CHANNEL0_REGISTER2  /* 0x8010 */
-#define GALMPSC_CHANNELREG_3       CHANNEL0_REGISTER3  /* 0x8014 */
-#define GALMPSC_CHANNELREG_4       CHANNEL0_REGISTER4  /* 0x8018 */
-#define GALMPSC_CHANNELREG_5       CHANNEL0_REGISTER5  /* 0x801c */
-#define GALMPSC_CHANNELREG_6       CHANNEL0_REGISTER6  /* 0x8020 */
-#define GALMPSC_CHANNELREG_7       CHANNEL0_REGISTER7  /* 0x8024 */
-#define GALMPSC_CHANNELREG_8       CHANNEL0_REGISTER8  /* 0x8028 */
-#define GALMPSC_CHANNELREG_9       CHANNEL0_REGISTER9  /* 0x802c */
-#define GALMPSC_CHANNELREG_10      CHANNEL0_REGISTER10 /* 0x8030 */
-#define GALMPSC_CHANNELREG_11      CHANNEL0_REGISTER11 /* 0x8034 */
-
-#define GALSDMA_COMMAND_FIRST     (1 << 16)
-#define GALSDMA_COMMAND_LAST      (1 << 17)
-#define GALSDMA_COMMAND_ENABLEINT (1 << 23)
-#define GALSDMA_COMMAND_AUTO      (1 << 30)
-#define GALSDMA_COMMAND_OWNER     (1 << 31)
-
-#define GALSDMA_RX                 0
-#define GALSDMA_TX                 1
-
-/* CHANNEL2 should be CHANNEL1, according to documentation,
- * but to work with the current GTREGS file...
- */
-#define GALSDMA_0_CONF_REG         CHANNEL0_CONFIGURATION_REGISTER   /* 0x4000 */
-#define GALSDMA_1_CONF_REG         CHANNEL2_CONFIGURATION_REGISTER   /* 0x6000 */
-#define GALSDMA_0_COM_REG          CHANNEL0_COMMAND_REGISTER         /* 0x4008 */
-#define GALSDMA_1_COM_REG          CHANNEL2_COMMAND_REGISTER         /* 0x6008 */
-#define GALSDMA_0_CUR_RX_PTR       CHANNEL0_CURRENT_RX_DESCRIPTOR_POINTER  /* 0x4810 */
-#define GALSDMA_0_CUR_TX_PTR       CHANNEL0_CURRENT_TX_DESCRIPTOR_POINTER  /* 0x4c10 */
-#define GALSDMA_0_FIR_TX_PTR       CHANNEL0_FIRST_TX_DESCRIPTOR_POINTER    /* 0x4c14 */
-#define GALSDMA_1_CUR_RX_PTR       CHANNEL2_CURRENT_RX_DESCRIPTOR_POINTER  /* 0x6810 */
-#define GALSDMA_1_CUR_TX_PTR       CHANNEL2_CURRENT_TX_DESCRIPTOR_POINTER  /* 0x6c10 */
-#define GALSDMA_1_FIR_TX_PTR       CHANNEL2_FIRST_TX_DESCRIPTOR_POINTER    /* 0x6c14 */
-#define GALSDMA_REG_DIFF           0x2000
-
-/* WRONG in gt64260R.h */
-#define GALSDMA_INT_CAUSE          0xb800   /* SDMA_CAUSE */
-#define GALSDMA_INT_MASK           0xb880   /* SDMA_MASK  */
-
-#define GALSDMA_MODE_UART          0
-#define GALSDMA_MODE_BISYNC        1
-#define GALSDMA_MODE_HDLC          2
-#define GALSDMA_MODE_TRANSPARENT   3
-
-#define GALBRG_0_CONFREG           BRG0_CONFIGURATION_REGISTER  /*  0xb200  */
-#define GALBRG_REG_GAP             0x0008
-#define GALBRG_0_BTREG             BRG0_BAUDE_TUNING_REGISTER   /*  0xb204  */
-
-#endif /* __MPSC_H__ */
diff --git a/board/evb64260/pci.c b/board/evb64260/pci.c
deleted file mode 100644 (file)
index 582f24c..0000000
+++ /dev/null
@@ -1,760 +0,0 @@
-/* PCI.c - PCI functions */
-
-/* Copyright - Galileo technology. */
-
-#include <common.h>
-#include <pci.h>
-
-#include <galileo/pci.h>
-
-static const unsigned char pci_irq_swizzle[2][PCI_MAX_DEVICES] = {
-#ifdef CONFIG_ZUMA_V2
-       {0, 0, 0, 0, 0, 0, 0, 29,[8 ... PCI_MAX_DEVICES - 1] = 0},
-       {0, 0, 0, 0, 0, 0, 0, 28,[8 ... PCI_MAX_DEVICES - 1] = 0}
-#else                          /* EVB??? This is a guess */
-       {0, 0, 0, 0, 0, 0, 0, 27, 27,[9 ... PCI_MAX_DEVICES - 1] = 0},
-       {0, 0, 0, 0, 0, 0, 0, 29, 29,[9 ... PCI_MAX_DEVICES - 1] = 0}
-#endif
-};
-
-static const unsigned int pci_p2p_configuration_reg[] = {
-       PCI_0P2P_CONFIGURATION, PCI_1P2P_CONFIGURATION
-};
-
-static const unsigned int pci_configuration_address[] = {
-       PCI_0CONFIGURATION_ADDRESS, PCI_1CONFIGURATION_ADDRESS
-};
-
-static const unsigned int pci_configuration_data[] = {
-       PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
-       PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER
-};
-
-static const unsigned int pci_error_cause_reg[] = {
-       PCI_0ERROR_CAUSE, PCI_1ERROR_CAUSE
-};
-
-static const unsigned int pci_arbiter_control[] = {
-       PCI_0ARBITER_CONTROL, PCI_1ARBITER_CONTROL
-};
-
-static const unsigned int pci_snoop_control_base_0_low[] = {
-       PCI_0SNOOP_CONTROL_BASE_0_LOW, PCI_1SNOOP_CONTROL_BASE_0_LOW
-};
-static const unsigned int pci_snoop_control_top_0[] = {
-       PCI_0SNOOP_CONTROL_TOP_0, PCI_1SNOOP_CONTROL_TOP_0
-};
-
-static const unsigned int pci_access_control_base_0_low[] = {
-       PCI_0ACCESS_CONTROL_BASE_0_LOW, PCI_1ACCESS_CONTROL_BASE_0_LOW
-};
-static const unsigned int pci_access_control_top_0[] = {
-       PCI_0ACCESS_CONTROL_TOP_0, PCI_1ACCESS_CONTROL_TOP_0
-};
-
-static const unsigned int pci_scs_bank_size[2][4] = {
-       {PCI_0SCS_0_BANK_SIZE, PCI_0SCS_1_BANK_SIZE,
-        PCI_0SCS_2_BANK_SIZE, PCI_0SCS_3_BANK_SIZE},
-       {PCI_1SCS_0_BANK_SIZE, PCI_1SCS_1_BANK_SIZE,
-        PCI_1SCS_2_BANK_SIZE, PCI_1SCS_3_BANK_SIZE}
-};
-
-static const unsigned int pci_p2p_configuration[] = {
-       PCI_0P2P_CONFIGURATION, PCI_1P2P_CONFIGURATION
-};
-
-static unsigned int local_buses[] = { 0, 0 };
-
-/********************************************************************
-* pciWriteConfigReg - Write to a PCI configuration register
-*                    - Make sure the GT is configured as a master before writing
-*                      to another device on the PCI.
-*                    - The function takes care of Big/Little endian conversion.
-*
-*
-* Inputs:   unsigned int regOffset: The register offset as it apears in the GT spec
-*                   (or any other PCI device spec)
-*           pciDevNum: The device number needs to be addressed.
-*
-*  Configuration Address 0xCF8:
-*
-*       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
-*  |congif|Reserved|  Bus |Device|Function|Register|00|
-*  |Enable|        |Number|Number| Number | Number |  |    <=field Name
-*
-*********************************************************************/
-void pciWriteConfigReg (PCI_HOST host, unsigned int regOffset,
-                       unsigned int pciDevNum, unsigned int data)
-{
-       volatile unsigned int DataForAddrReg;
-       unsigned int functionNum;
-       unsigned int busNum = PCI_BUS (pciDevNum);
-       unsigned int addr;
-
-       if (pciDevNum > 32)     /* illegal device Number */
-               return;
-       if (pciDevNum == SELF) {        /* configure our configuration space. */
-               pciDevNum =
-                       (GTREGREAD (pci_p2p_configuration_reg[host]) >> 24) &
-                       0x1f;
-               busNum = GTREGREAD (pci_p2p_configuration_reg[host]) &
-                       0xff0000;
-       }
-       functionNum = regOffset & 0x00000700;
-       pciDevNum = pciDevNum << 11;
-       regOffset = regOffset & 0xfc;
-       DataForAddrReg =
-               (regOffset | pciDevNum | functionNum | busNum) | BIT31;
-       GT_REG_WRITE (pci_configuration_address[host], DataForAddrReg);
-       GT_REG_READ (pci_configuration_address[host], &addr);
-       if (addr != DataForAddrReg)
-               return;
-       GT_REG_WRITE (pci_configuration_data[host], data);
-}
-
-/********************************************************************
-* pciReadConfigReg  - Read from a PCI0 configuration register
-*                    - Make sure the GT is configured as a master before reading
-*                     from another device on the PCI.
-*                   - The function takes care of Big/Little endian conversion.
-* INPUTS:   regOffset: The register offset as it apears in the GT spec (or PCI
-*                        spec)
-*           pciDevNum: The device number needs to be addressed.
-* RETURNS: data , if the data == 0xffffffff check the master abort bit in the
-*                 cause register to make sure the data is valid
-*
-*  Configuration Address 0xCF8:
-*
-*       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
-*  |congif|Reserved|  Bus |Device|Function|Register|00|
-*  |Enable|        |Number|Number| Number | Number |  |    <=field Name
-*
-*********************************************************************/
-unsigned int pciReadConfigReg (PCI_HOST host, unsigned int regOffset,
-                              unsigned int pciDevNum)
-{
-       volatile unsigned int DataForAddrReg;
-       unsigned int data;
-       unsigned int functionNum;
-       unsigned int busNum = PCI_BUS (pciDevNum);
-
-       if (pciDevNum > 32)     /* illegal device Number */
-               return 0xffffffff;
-       if (pciDevNum == SELF) {        /* configure our configuration space. */
-               pciDevNum =
-                       (GTREGREAD (pci_p2p_configuration_reg[host]) >> 24) &
-                       0x1f;
-               busNum = GTREGREAD (pci_p2p_configuration_reg[host]) &
-                       0xff0000;
-       }
-       functionNum = regOffset & 0x00000700;
-       pciDevNum = pciDevNum << 11;
-       regOffset = regOffset & 0xfc;
-       DataForAddrReg =
-               (regOffset | pciDevNum | functionNum | busNum) | BIT31;
-       GT_REG_WRITE (pci_configuration_address[host], DataForAddrReg);
-       GT_REG_READ (pci_configuration_address[host], &data);
-       if (data != DataForAddrReg)
-               return 0xffffffff;
-       GT_REG_READ (pci_configuration_data[host], &data);
-       return data;
-}
-
-/********************************************************************
-* pciOverBridgeWriteConfigReg - Write to a PCI configuration register where
-*                               the agent is placed on another Bus. For more
-*                               information read P2P in the PCI spec.
-*
-* Inputs:   unsigned int regOffset - The register offset as it apears in the
-*           GT spec (or any other PCI device spec).
-*           unsigned int pciDevNum - The device number needs to be addressed.
-*           unsigned int busNum - On which bus does the Target agent connect
-*                                 to.
-*           unsigned int data - data to be written.
-*
-*  Configuration Address 0xCF8:
-*
-*       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
-*  |congif|Reserved|  Bus |Device|Function|Register|01|
-*  |Enable|        |Number|Number| Number | Number |  |    <=field Name
-*
-*  The configuration Address is configure as type-I (bits[1:0] = '01') due to
-*   PCI spec referring to P2P.
-*
-*********************************************************************/
-void pciOverBridgeWriteConfigReg (PCI_HOST host,
-                                 unsigned int regOffset,
-                                 unsigned int pciDevNum,
-                                 unsigned int busNum, unsigned int data)
-{
-       unsigned int DataForReg;
-       unsigned int functionNum;
-
-       functionNum = regOffset & 0x00000700;
-       pciDevNum = pciDevNum << 11;
-       regOffset = regOffset & 0xff;
-       busNum = busNum << 16;
-       if (pciDevNum == SELF) {        /* This board */
-               DataForReg = (regOffset | pciDevNum | functionNum) | BIT0;
-       } else {
-               DataForReg = (regOffset | pciDevNum | functionNum | busNum) |
-                       BIT31 | BIT0;
-       }
-       GT_REG_WRITE (pci_configuration_address[host], DataForReg);
-       if (pciDevNum == SELF) {        /* This board */
-               GT_REG_WRITE (pci_configuration_data[host], data);
-       } else {                /* configuration Transaction over the pci. */
-
-               /* The PCI is working in LE Mode So it swap the Data. */
-               GT_REG_WRITE (pci_configuration_data[host], WORD_SWAP (data));
-       }
-}
-
-
-/********************************************************************
-* pciOverBridgeReadConfigReg  - Read from a PCIn configuration register where
-*                               the agent target locate on another PCI bus.
-*                             - Make sure the GT is configured as a master
-*                               before reading from another device on the PCI.
-*                             - The function takes care of Big/Little endian
-*                               conversion.
-* INPUTS:   regOffset: The register offset as it apears in the GT spec (or PCI
-*                        spec). (configuration register offset.)
-*           pciDevNum: The device number needs to be addressed.
-*           busNum: the Bus number where the agent is place.
-* RETURNS: data , if the data == 0xffffffff check the master abort bit in the
-*                 cause register to make sure the data is valid
-*
-*  Configuration Address 0xCF8:
-*
-*       31 30    24 23  16 15  11 10     8 7      2  0     <=bit Number
-*  |congif|Reserved|  Bus |Device|Function|Register|01|
-*  |Enable|        |Number|Number| Number | Number |  |    <=field Name
-*
-*********************************************************************/
-unsigned int pciOverBridgeReadConfigReg (PCI_HOST host,
-                                        unsigned int regOffset,
-                                        unsigned int pciDevNum,
-                                        unsigned int busNum)
-{
-       unsigned int DataForReg;
-       unsigned int data;
-       unsigned int functionNum;
-
-       functionNum = regOffset & 0x00000700;
-       pciDevNum = pciDevNum << 11;
-       regOffset = regOffset & 0xff;
-       busNum = busNum << 16;
-       if (pciDevNum == SELF) {        /* This board */
-               DataForReg = (regOffset | pciDevNum | functionNum) | BIT31;
-       } else {                /* agent on another bus */
-
-               DataForReg = (regOffset | pciDevNum | functionNum | busNum) |
-                       BIT0 | BIT31;
-       }
-       GT_REG_WRITE (pci_configuration_address[host], DataForReg);
-       if (pciDevNum == SELF) {        /* This board */
-               GT_REG_READ (pci_configuration_data[host], &data);
-               return data;
-       } else {                /* The PCI is working in LE Mode So it swap the Data. */
-
-               GT_REG_READ (pci_configuration_data[host], &data);
-               return WORD_SWAP (data);
-       }
-}
-
-/********************************************************************
-* pciGetRegOffset - Gets the register offset for this region config.
-*
-* INPUT:   Bus, Region - The bus and region we ask for its base address.
-* OUTPUT:   N/A
-* RETURNS: PCI register base address
-*********************************************************************/
-static unsigned int pciGetRegOffset (PCI_HOST host, PCI_REGION region)
-{
-       switch (host) {
-       case PCI_HOST0:
-               switch (region) {
-               case PCI_IO:
-                       return PCI_0I_O_LOW_DECODE_ADDRESS;
-               case PCI_REGION0:
-                       return PCI_0MEMORY0_LOW_DECODE_ADDRESS;
-               case PCI_REGION1:
-                       return PCI_0MEMORY1_LOW_DECODE_ADDRESS;
-               case PCI_REGION2:
-                       return PCI_0MEMORY2_LOW_DECODE_ADDRESS;
-               case PCI_REGION3:
-                       return PCI_0MEMORY3_LOW_DECODE_ADDRESS;
-               }
-       case PCI_HOST1:
-               switch (region) {
-               case PCI_IO:
-                       return PCI_1I_O_LOW_DECODE_ADDRESS;
-               case PCI_REGION0:
-                       return PCI_1MEMORY0_LOW_DECODE_ADDRESS;
-               case PCI_REGION1:
-                       return PCI_1MEMORY1_LOW_DECODE_ADDRESS;
-               case PCI_REGION2:
-                       return PCI_1MEMORY2_LOW_DECODE_ADDRESS;
-               case PCI_REGION3:
-                       return PCI_1MEMORY3_LOW_DECODE_ADDRESS;
-               }
-       }
-       return PCI_0MEMORY0_LOW_DECODE_ADDRESS;
-}
-
-static unsigned int pciGetRemapOffset (PCI_HOST host, PCI_REGION region)
-{
-       switch (host) {
-       case PCI_HOST0:
-               switch (region) {
-               case PCI_IO:
-                       return PCI_0I_O_ADDRESS_REMAP;
-               case PCI_REGION0:
-                       return PCI_0MEMORY0_ADDRESS_REMAP;
-               case PCI_REGION1:
-                       return PCI_0MEMORY1_ADDRESS_REMAP;
-               case PCI_REGION2:
-                       return PCI_0MEMORY2_ADDRESS_REMAP;
-               case PCI_REGION3:
-                       return PCI_0MEMORY3_ADDRESS_REMAP;
-               }
-       case PCI_HOST1:
-               switch (region) {
-               case PCI_IO:
-                       return PCI_1I_O_ADDRESS_REMAP;
-               case PCI_REGION0:
-                       return PCI_1MEMORY0_ADDRESS_REMAP;
-               case PCI_REGION1:
-                       return PCI_1MEMORY1_ADDRESS_REMAP;
-               case PCI_REGION2:
-                       return PCI_1MEMORY2_ADDRESS_REMAP;
-               case PCI_REGION3:
-                       return PCI_1MEMORY3_ADDRESS_REMAP;
-               }
-       }
-       return PCI_0MEMORY0_ADDRESS_REMAP;
-}
-
-bool pciMapSpace (PCI_HOST host, PCI_REGION region, unsigned int remapBase,
-                 unsigned int bankBase, unsigned int bankLength)
-{
-       unsigned int low = 0xfff;
-       unsigned int high = 0x0;
-       unsigned int regOffset = pciGetRegOffset (host, region);
-       unsigned int remapOffset = pciGetRemapOffset (host, region);
-
-       if (bankLength != 0) {
-               low = (bankBase >> 20) & 0xfff;
-               high = ((bankBase + bankLength) >> 20) - 1;
-       }
-
-       GT_REG_WRITE (regOffset, low | (1 << 24));      /* no swapping */
-       GT_REG_WRITE (regOffset + 8, high);
-
-       if (bankLength != 0) {  /* must do AFTER writing maps */
-               GT_REG_WRITE (remapOffset, remapBase >> 20);    /* sorry, 32 bits only.
-                                                                  dont support upper 32
-                                                                  in this driver */
-       }
-       return true;
-}
-
-unsigned int pciGetSpaceBase (PCI_HOST host, PCI_REGION region)
-{
-       unsigned int low;
-       unsigned int regOffset = pciGetRegOffset (host, region);
-
-       GT_REG_READ (regOffset, &low);
-       return (low & 0xfff) << 20;
-}
-
-unsigned int pciGetSpaceSize (PCI_HOST host, PCI_REGION region)
-{
-       unsigned int low, high;
-       unsigned int regOffset = pciGetRegOffset (host, region);
-
-       GT_REG_READ (regOffset, &low);
-       GT_REG_READ (regOffset + 8, &high);
-       high &= 0xfff;
-       low &= 0xfff;
-       if (high <= low)
-               return 0;
-       return (high + 1 - low) << 20;
-}
-
-/********************************************************************
-* pciMapMemoryBank - Maps PCI_host memory bank "bank" for the slave.
-*
-* Inputs: base and size of PCI SCS
-*********************************************************************/
-void pciMapMemoryBank (PCI_HOST host, MEMORY_BANK bank,
-                      unsigned int pciDramBase, unsigned int pciDramSize)
-{
-       pciDramBase = pciDramBase & 0xfffff000;
-       pciDramBase = pciDramBase | (pciReadConfigReg (host,
-                                                      PCI_SCS_0_BASE_ADDRESS
-                                                      + 4 * bank,
-                                                      SELF) & 0x00000fff);
-       pciWriteConfigReg (host, PCI_SCS_0_BASE_ADDRESS + 4 * bank, SELF,
-                          pciDramBase);
-       if (pciDramSize == 0)
-               pciDramSize++;
-       GT_REG_WRITE (pci_scs_bank_size[host][bank], pciDramSize - 1);
-}
-
-
-/********************************************************************
-* pciSetRegionFeatures - This function modifys one of the 8 regions with
-*                         feature bits given as an input.
-*                       - Be advised to check the spec before modifying them.
-* Inputs: PCI_PROTECT_REGION region - one of the eight regions.
-*         unsigned int features - See file: pci.h there are defintion for those
-*                                 region features.
-*         unsigned int baseAddress - The region base Address.
-*         unsigned int topAddress - The region top Address.
-* Returns: false if one of the parameters is erroneous true otherwise.
-*********************************************************************/
-bool pciSetRegionFeatures (PCI_HOST host, PCI_ACCESS_REGIONS region,
-                          unsigned int features, unsigned int baseAddress,
-                          unsigned int regionLength)
-{
-       unsigned int accessLow;
-       unsigned int accessHigh;
-       unsigned int accessTop = baseAddress + regionLength;
-
-       if (regionLength == 0) {        /* close the region. */
-               pciDisableAccessRegion (host, region);
-               return true;
-       }
-       /* base Address is store is bits [11:0] */
-       accessLow = (baseAddress & 0xfff00000) >> 20;
-       /* All the features are update according to the defines in pci.h (to be on
-          the safe side we disable bits: [11:0] */
-       accessLow = accessLow | (features & 0xfffff000);
-       /* write to the Low Access Region register */
-       GT_REG_WRITE (pci_access_control_base_0_low[host] + 0x10 * region,
-                     accessLow);
-
-       accessHigh = (accessTop & 0xfff00000) >> 20;
-
-       /* write to the High Access Region register */
-       GT_REG_WRITE (pci_access_control_top_0[host] + 0x10 * region,
-                     accessHigh - 1);
-       return true;
-}
-
-/********************************************************************
-* pciDisableAccessRegion - Disable The given Region by writing MAX size
-*                           to its low Address and MIN size to its high Address.
-*
-* Inputs:   PCI_ACCESS_REGIONS region - The region we to be Disabled.
-* Returns:  N/A.
-*********************************************************************/
-void pciDisableAccessRegion (PCI_HOST host, PCI_ACCESS_REGIONS region)
-{
-       /* writing back the registers default values. */
-       GT_REG_WRITE (pci_access_control_base_0_low[host] + 0x10 * region,
-                     0x01001fff);
-       GT_REG_WRITE (pci_access_control_top_0[host] + 0x10 * region, 0);
-}
-
-/********************************************************************
-* pciArbiterEnable - Enables PCI-0`s Arbitration mechanism.
-*
-* Inputs:   N/A
-* Returns:  true.
-*********************************************************************/
-bool pciArbiterEnable (PCI_HOST host)
-{
-       unsigned int regData;
-
-       GT_REG_READ (pci_arbiter_control[host], &regData);
-       GT_REG_WRITE (pci_arbiter_control[host], regData | BIT31);
-       return true;
-}
-
-/********************************************************************
-* pciArbiterDisable - Disable PCI-0`s Arbitration mechanism.
-*
-* Inputs:   N/A
-* Returns:  true
-*********************************************************************/
-bool pciArbiterDisable (PCI_HOST host)
-{
-       unsigned int regData;
-
-       GT_REG_READ (pci_arbiter_control[host], &regData);
-       GT_REG_WRITE (pci_arbiter_control[host], regData & 0x7fffffff);
-       return true;
-}
-
-/********************************************************************
-* pciParkingDisable - Park on last option disable, with this function you can
-*                      disable the park on last mechanism for each agent.
-*                      disabling this option for all agents results parking
-*                      on the internal master.
-*
-* Inputs: PCI_AGENT_PARK internalAgent -  parking Disable for internal agent.
-*         PCI_AGENT_PARK externalAgent0 - parking Disable for external#0 agent.
-*         PCI_AGENT_PARK externalAgent1 - parking Disable for external#1 agent.
-*         PCI_AGENT_PARK externalAgent2 - parking Disable for external#2 agent.
-*         PCI_AGENT_PARK externalAgent3 - parking Disable for external#3 agent.
-*         PCI_AGENT_PARK externalAgent4 - parking Disable for external#4 agent.
-*         PCI_AGENT_PARK externalAgent5 - parking Disable for external#5 agent.
-* Returns:  true
-*********************************************************************/
-bool pciParkingDisable (PCI_HOST host, PCI_AGENT_PARK internalAgent,
-                       PCI_AGENT_PARK externalAgent0,
-                       PCI_AGENT_PARK externalAgent1,
-                       PCI_AGENT_PARK externalAgent2,
-                       PCI_AGENT_PARK externalAgent3,
-                       PCI_AGENT_PARK externalAgent4,
-                       PCI_AGENT_PARK externalAgent5)
-{
-       unsigned int regData;
-       unsigned int writeData;
-
-       GT_REG_READ (pci_arbiter_control[host], &regData);
-       writeData = (internalAgent << 14) + (externalAgent0 << 15) +
-               (externalAgent1 << 16) + (externalAgent2 << 17) +
-               (externalAgent3 << 18) + (externalAgent4 << 19) +
-               (externalAgent5 << 20);
-       regData = (regData & ~(0x7f << 14)) | writeData;
-       GT_REG_WRITE (pci_arbiter_control[host], regData);
-       return true;
-}
-
-/********************************************************************
-* pciSetRegionSnoopMode - This function modifys one of the 4 regions which
-*                          supports Cache Coherency in the PCI_n interface.
-* Inputs: region - One of the four regions.
-*         snoopType - There is four optional Types:
-*                        1. No Snoop.
-*                        2. Snoop to WT region.
-*                        3. Snoop to WB region.
-*                        4. Snoop & Invalidate to WB region.
-*         baseAddress - Base Address of this region.
-*         regionLength - Region length.
-* Returns: false if one of the parameters is wrong otherwise return true.
-*********************************************************************/
-bool pciSetRegionSnoopMode (PCI_HOST host, PCI_SNOOP_REGION region,
-                           PCI_SNOOP_TYPE snoopType,
-                           unsigned int baseAddress,
-                           unsigned int regionLength)
-{
-       unsigned int snoopXbaseAddress;
-       unsigned int snoopXtopAddress;
-       unsigned int data;
-       unsigned int snoopHigh = baseAddress + regionLength;
-
-       if ((region > PCI_SNOOP_REGION3) || (snoopType > PCI_SNOOP_WB))
-               return false;
-       snoopXbaseAddress =
-               pci_snoop_control_base_0_low[host] + 0x10 * region;
-       snoopXtopAddress = pci_snoop_control_top_0[host] + 0x10 * region;
-       if (regionLength == 0) {        /* closing the region */
-               GT_REG_WRITE (snoopXbaseAddress, 0x0000ffff);
-               GT_REG_WRITE (snoopXtopAddress, 0);
-               return true;
-       }
-       baseAddress = baseAddress & 0xfff00000; /* Granularity of 1MByte */
-       data = (baseAddress >> 20) | snoopType << 12;
-       GT_REG_WRITE (snoopXbaseAddress, data);
-       snoopHigh = (snoopHigh & 0xfff00000) >> 20;
-       GT_REG_WRITE (snoopXtopAddress, snoopHigh - 1);
-       return true;
-}
-
-/*
- *
- */
-
-static int gt_read_config_dword (struct pci_controller *hose,
-                                pci_dev_t dev, int offset, u32 * value)
-{
-       int bus = PCI_BUS (dev);
-
-       if ((bus == local_buses[0]) || (bus == local_buses[1])) {
-               *value = pciReadConfigReg ((PCI_HOST) hose->cfg_addr, offset,
-                                          PCI_DEV (dev));
-       } else {
-               *value = pciOverBridgeReadConfigReg ((PCI_HOST) hose->
-                                                    cfg_addr, offset,
-                                                    PCI_DEV (dev), bus);
-       }
-       return 0;
-}
-
-static int gt_write_config_dword (struct pci_controller *hose,
-                                 pci_dev_t dev, int offset, u32 value)
-{
-       int bus = PCI_BUS (dev);
-
-       if ((bus == local_buses[0]) || (bus == local_buses[1])) {
-               pciWriteConfigReg ((PCI_HOST) hose->cfg_addr, offset,
-                                  PCI_DEV (dev), value);
-       } else {
-               pciOverBridgeWriteConfigReg ((PCI_HOST) hose->cfg_addr,
-                                            offset, PCI_DEV (dev), value,
-                                            bus);
-       }
-       return 0;
-}
-
-/*
- *
- */
-
-static void gt_setup_ide (struct pci_controller *hose,
-                         pci_dev_t dev, struct pci_config_table *entry)
-{
-       static const int ide_bar[] = { 8, 4, 8, 4, 0, 0 };
-       u32 bar_response, bar_value;
-       int bar;
-
-       for (bar = 0; bar < 6; bar++) {
-               pci_write_config_dword (dev, PCI_BASE_ADDRESS_0 + bar * 4,
-                                       0x0);
-               pci_read_config_dword (dev, PCI_BASE_ADDRESS_0 + bar * 4,
-                                      &bar_response);
-
-               pciauto_region_allocate (bar_response &
-                                        PCI_BASE_ADDRESS_SPACE_IO ? hose->
-                                        pci_io : hose->pci_mem, ide_bar[bar],
-                                        &bar_value);
-
-               pci_write_config_dword (dev, PCI_BASE_ADDRESS_0 + bar * 4,
-                                       bar_value);
-       }
-}
-
-#ifndef CONFIG_P3G4
-static void gt_fixup_irq (struct pci_controller *hose, pci_dev_t dev)
-{
-       unsigned char pin, irq;
-
-       pci_read_config_byte (dev, PCI_INTERRUPT_PIN, &pin);
-
-       if (pin == 1) {         /* only allow INT A */
-               irq = pci_irq_swizzle[(PCI_HOST) hose->
-                                     cfg_addr][PCI_DEV (dev)];
-               if (irq)
-                       pci_write_config_byte (dev, PCI_INTERRUPT_LINE, irq);
-       }
-}
-#endif
-
-struct pci_config_table gt_config_table[] = {
-       {PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE,
-        PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, gt_setup_ide},
-
-       {}
-};
-
-struct pci_controller pci0_hose = {
-#ifndef CONFIG_P3G4
-       fixup_irq:gt_fixup_irq,
-#endif
-       config_table:gt_config_table,
-};
-
-struct pci_controller pci1_hose = {
-#ifndef CONFIG_P3G4
-       fixup_irq:gt_fixup_irq,
-#endif
-       config_table:gt_config_table,
-};
-
-void pci_init_board (void)
-{
-       unsigned int command;
-
-       pci0_hose.first_busno = 0;
-       pci0_hose.last_busno = 0xff;
-       local_buses[0] = pci0_hose.first_busno;
-       /* PCI memory space */
-       pci_set_region (pci0_hose.regions + 0,
-                       CONFIG_SYS_PCI0_0_MEM_SPACE,
-                       CONFIG_SYS_PCI0_0_MEM_SPACE,
-                       CONFIG_SYS_PCI0_MEM_SIZE, PCI_REGION_MEM);
-
-       /* PCI I/O space */
-       pci_set_region (pci0_hose.regions + 1,
-                       CONFIG_SYS_PCI0_IO_SPACE_PCI,
-                       CONFIG_SYS_PCI0_IO_SPACE, CONFIG_SYS_PCI0_IO_SIZE, PCI_REGION_IO);
-
-       pci_set_ops (&pci0_hose,
-                    pci_hose_read_config_byte_via_dword,
-                    pci_hose_read_config_word_via_dword,
-                    gt_read_config_dword,
-                    pci_hose_write_config_byte_via_dword,
-                    pci_hose_write_config_word_via_dword,
-                    gt_write_config_dword);
-
-       pci0_hose.region_count = 2;
-
-       pci0_hose.cfg_addr = (unsigned int *) PCI_HOST0;
-
-       pci_register_hose (&pci0_hose);
-
-#ifndef CONFIG_P3G4
-       pciArbiterEnable (PCI_HOST0);
-       pciParkingDisable (PCI_HOST0, 1, 1, 1, 1, 1, 1, 1);
-#endif
-
-       command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
-       command |= PCI_COMMAND_MASTER;
-       pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
-
-       pci0_hose.last_busno = pci_hose_scan (&pci0_hose);
-
-       command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
-       command |= PCI_COMMAND_MEMORY;
-       pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
-
-       pci1_hose.first_busno = pci0_hose.last_busno + 1;
-       pci1_hose.last_busno = 0xff;
-       pci1_hose.current_busno = pci0_hose.current_busno;
-       local_buses[1] = pci1_hose.first_busno;
-
-       /* PCI memory space */
-       pci_set_region (pci1_hose.regions + 0,
-                       CONFIG_SYS_PCI1_0_MEM_SPACE,
-                       CONFIG_SYS_PCI1_0_MEM_SPACE,
-                       CONFIG_SYS_PCI1_MEM_SIZE, PCI_REGION_MEM);
-
-       /* PCI I/O space */
-       pci_set_region (pci1_hose.regions + 1,
-                       CONFIG_SYS_PCI1_IO_SPACE_PCI,
-                       CONFIG_SYS_PCI1_IO_SPACE, CONFIG_SYS_PCI1_IO_SIZE, PCI_REGION_IO);
-
-       pci_set_ops (&pci1_hose,
-                    pci_hose_read_config_byte_via_dword,
-                    pci_hose_read_config_word_via_dword,
-                    gt_read_config_dword,
-                    pci_hose_write_config_byte_via_dword,
-                    pci_hose_write_config_word_via_dword,
-                    gt_write_config_dword);
-
-       pci1_hose.region_count = 2;
-
-       pci1_hose.cfg_addr = (unsigned int *) PCI_HOST1;
-
-       pci_register_hose (&pci1_hose);
-
-#ifndef CONFIG_P3G4
-       pciArbiterEnable (PCI_HOST1);
-       pciParkingDisable (PCI_HOST1, 1, 1, 1, 1, 1, 1, 1);
-#endif
-
-       command = pciReadConfigReg (PCI_HOST1, PCI_COMMAND, SELF);
-       command |= PCI_COMMAND_MASTER;
-       pciWriteConfigReg (PCI_HOST1, PCI_COMMAND, SELF, command);
-
-       pci1_hose.last_busno = pci_hose_scan (&pci1_hose);
-
-       command = pciReadConfigReg (PCI_HOST1, PCI_COMMAND, SELF);
-       command |= PCI_COMMAND_MEMORY;
-       pciWriteConfigReg (PCI_HOST1, PCI_COMMAND, SELF, command);
-}
diff --git a/board/evb64260/sdram_init.c b/board/evb64260/sdram_init.c
deleted file mode 100644 (file)
index 12b1308..0000000
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/* sdram_init.c - automatic memory sizing */
-
-#include <common.h>
-#include <74xx_7xx.h>
-#include <galileo/memory.h>
-#include <galileo/pci.h>
-#include <galileo/gt64260R.h>
-#include <net.h>
-#include <linux/compiler.h>
-
-#include "eth.h"
-#include "mpsc.h"
-#include "i2c.h"
-#include "64260.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/* #define     DEBUG */
-#define        MAP_PCI
-
-#ifdef DEBUG
-#define DP(x) x
-#else
-#define DP(x)
-#endif
-
-#define GB         (1 << 30)
-
-/* structure to store the relevant information about an sdram bank */
-typedef struct sdram_info {
-       uchar drb_size;
-       uchar registered, ecc;
-       uchar tpar;
-       uchar tras_clocks;
-       uchar burst_len;
-       uchar banks, slot;
-       int size;               /* detected size, not from I2C but from dram_size() */
-} sdram_info_t;
-
-#ifdef DEBUG
-void dump_dimm_info (struct sdram_info *d)
-{
-       static const char *ecc_legend[] = { "", " Parity", " ECC" };
-
-       printf ("dimm%s %sDRAM: %dMibytes:\n",
-               ecc_legend[d->ecc],
-               d->registered ? "R" : "", (d->size >> 20));
-       printf ("  drb=%d tpar=%d tras=%d burstlen=%d banks=%d slot=%d\n",
-               d->drb_size, d->tpar, d->tras_clocks, d->burst_len,
-               d->banks, d->slot);
-}
-#endif
-
-static int
-memory_map_bank (unsigned int bankNo,
-                unsigned int bankBase, unsigned int bankLength)
-{
-#ifdef DEBUG
-       if (bankLength > 0) {
-               printf ("mapping bank %d at %08x - %08x\n",
-                       bankNo, bankBase, bankBase + bankLength - 1);
-       } else {
-               printf ("unmapping bank %d\n", bankNo);
-       }
-#endif
-
-       memoryMapBank (bankNo, bankBase, bankLength);
-
-       return 0;
-}
-
-#ifdef MAP_PCI
-static int
-memory_map_bank_pci (unsigned int bankNo,
-                    unsigned int bankBase, unsigned int bankLength)
-{
-       PCI_HOST host;
-
-       for (host = PCI_HOST0; host <= PCI_HOST1; host++) {
-               const int features =
-                       PREFETCH_ENABLE |
-                       DELAYED_READ_ENABLE |
-                       AGGRESSIVE_PREFETCH |
-                       READ_LINE_AGGRESSIVE_PREFETCH |
-                       READ_MULTI_AGGRESSIVE_PREFETCH |
-                       MAX_BURST_4 | PCI_NO_SWAP;
-
-               pciMapMemoryBank (host, bankNo, bankBase, bankLength);
-
-               pciSetRegionSnoopMode (host, bankNo, PCI_SNOOP_WB, bankBase,
-                                      bankLength);
-
-               pciSetRegionFeatures (host, bankNo, features, bankBase,
-                                     bankLength);
-       }
-       return 0;
-}
-#endif
-
-/* ------------------------------------------------------------------------- */
-
-/* much of this code is based on (or is) the code in the pip405 port */
-/* thanks go to the authors of said port - Josh */
-
-
-/*
- * translate ns.ns/10 coding of SPD timing values
- * into 10 ps unit values
- */
-static inline unsigned short NS10to10PS (unsigned char spd_byte)
-{
-       unsigned short ns, ns10;
-
-       /* isolate upper nibble */
-       ns = (spd_byte >> 4) & 0x0F;
-       /* isolate lower nibble */
-       ns10 = (spd_byte & 0x0F);
-
-       return (ns * 100 + ns10 * 10);
-}
-
-/*
- * translate ns coding of SPD timing values
- * into 10 ps unit values
- */
-static inline unsigned short NSto10PS (unsigned char spd_byte)
-{
-       return (spd_byte * 100);
-}
-
-#ifdef CONFIG_ZUMA_V2
-static int check_dimm (uchar slot, sdram_info_t * info)
-{
-       /* assume 2 dimms, 2 banks each 256M - we dont have an
-        * dimm i2c so rely on the detection routines later */
-
-       memset (info, 0, sizeof (*info));
-
-       info->slot = slot;
-       info->banks = 2;        /* Detect later */
-       info->registered = 0;
-       info->drb_size = 32;    /* 16 - 256MBit, 32 - 512MBit
-                                  but doesn't matter, both do same
-                                  thing in setup_sdram() */
-       info->tpar = 3;
-       info->tras_clocks = 5;
-       info->burst_len = 4;
-#ifdef CONFIG_ECC
-       info->ecc = 0;          /* Detect later */
-#endif /* CONFIG_ECC */
-       return 0;
-}
-
-#elif defined(CONFIG_P3G4)
-
-static int check_dimm (uchar slot, sdram_info_t * info)
-{
-       memset (info, 0, sizeof (*info));
-
-       if (slot)
-               return 0;
-
-       info->slot = slot;
-       info->banks = 1;
-       info->registered = 0;
-       info->drb_size = 4;
-       info->tpar = 3;
-       info->tras_clocks = 6;
-       info->burst_len = 4;
-#ifdef CONFIG_ECC
-       info->ecc = 2;
-#endif
-       return 0;
-}
-
-#else  /* ! CONFIG_ZUMA_V2 && ! CONFIG_P3G4 */
-
-/* This code reads the SPD chip on the sdram and populates
- * the array which is passed in with the relevant information */
-static int check_dimm (uchar slot, sdram_info_t * info)
-{
-       uchar addr = slot == 0 ? DIMM0_I2C_ADDR : DIMM1_I2C_ADDR;
-       int ret;
-       uchar rows, cols, sdram_banks, supp_cal, width, cal_val;
-       ulong tmemclk;
-       uchar trp_clocks, trcd_clocks;
-       uchar data[128];
-
-       get_clocks ();
-
-       tmemclk = 1000000000 / (gd->bus_clk / 100);     /* in 10 ps units */
-
-#ifdef CONFIG_EVB64260_750CX
-       if (0 != slot) {
-               printf ("check_dimm: The EVB-64260-750CX only has 1 DIMM,");
-               printf ("            called with slot=%d insetad!\n", slot);
-               return 0;
-       }
-#endif
-       DP (puts ("before i2c read\n"));
-
-       ret = i2c_read (addr, 0, 128, data, 0);
-
-       DP (puts ("after i2c read\n"));
-
-       /* zero all the values */
-       memset (info, 0, sizeof (*info));
-
-       if (ret) {
-               DP (printf ("No DIMM in slot %d [err = %x]\n", slot, ret));
-               return 0;
-       }
-
-       /* first, do some sanity checks */
-       if (data[2] != 0x4) {
-               printf ("Not SDRAM in slot %d\n", slot);
-               return 0;
-       }
-
-       /* get various information */
-       rows = data[3];
-       cols = data[4];
-       info->banks = data[5];
-       sdram_banks = data[17];
-       width = data[13] & 0x7f;
-
-       DP (printf
-           ("sdram_banks: %d, banks: %d\n", sdram_banks, info->banks));
-
-       /* check if the memory is registered */
-       if (data[21] & (BIT1 | BIT4))
-               info->registered = 1;
-
-#ifdef CONFIG_ECC
-       /* check for ECC/parity [0 = none, 1 = parity, 2 = ecc] */
-       info->ecc = (data[11] & 2) >> 1;
-#endif
-
-       /* bit 1 is CL2, bit 2 is CL3 */
-       supp_cal = (data[18] & 0x6) >> 1;
-
-       /* compute the relevant clock values */
-       trp_clocks = (NSto10PS (data[27]) + (tmemclk - 1)) / tmemclk;
-       trcd_clocks = (NSto10PS (data[29]) + (tmemclk - 1)) / tmemclk;
-       info->tras_clocks = (NSto10PS (data[30]) + (tmemclk - 1)) / tmemclk;
-
-       DP (printf ("trp = %d\ntrcd_clocks = %d\ntras_clocks = %d\n",
-                   trp_clocks, trcd_clocks, info->tras_clocks));
-
-       /* try a CAS latency of 3 first... */
-       cal_val = 0;
-       if (supp_cal & 3) {
-               if (NS10to10PS (data[9]) <= tmemclk)
-                       cal_val = 3;
-       }
-
-       /* then 2... */
-       if (supp_cal & 2) {
-               if (NS10to10PS (data[23]) <= tmemclk)
-                       cal_val = 2;
-       }
-
-       DP (printf ("cal_val = %d\n", cal_val));
-
-       /* bummer, did't work... */
-       if (cal_val == 0) {
-               DP (printf ("Couldn't find a good CAS latency\n"));
-               return 0;
-       }
-
-       /* get the largest delay -- these values need to all be the same
-        * see Res#6 */
-       info->tpar = cal_val;
-       if (trp_clocks > info->tpar)
-               info->tpar = trp_clocks;
-       if (trcd_clocks > info->tpar)
-               info->tpar = trcd_clocks;
-
-       DP (printf ("tpar set to: %d\n", info->tpar));
-
-#ifdef CONFIG_SYS_BROKEN_CL2
-       if (info->tpar == 2) {
-               info->tpar = 3;
-               DP (printf ("tpar fixed-up to: %d\n", info->tpar));
-       }
-#endif
-       /* compute the module DRB size */
-       info->drb_size =
-               (((1 << (rows + cols)) * sdram_banks) * width) / _16M;
-
-       DP (printf ("drb_size set to: %d\n", info->drb_size));
-
-       /* find the burst len */
-       info->burst_len = data[16] & 0xf;
-       if ((info->burst_len & 8) == 8) {
-               info->burst_len = 1;
-       } else if ((info->burst_len & 4) == 4) {
-               info->burst_len = 0;
-       } else {
-               return 0;
-       }
-
-       info->slot = slot;
-       return 0;
-}
-#endif /* ! CONFIG_ZUMA_V2 */
-
-static int setup_sdram_common (sdram_info_t info[2])
-{
-       ulong tmp;
-       int tpar = 2, tras_clocks = 5, registered = 1;
-       __maybe_unused int ecc = 2;
-
-       if (!info[0].banks && !info[1].banks)
-               return 0;
-
-       if (info[0].banks) {
-               if (info[0].tpar > tpar)
-                       tpar = info[0].tpar;
-               if (info[0].tras_clocks > tras_clocks)
-                       tras_clocks = info[0].tras_clocks;
-               if (!info[0].registered)
-                       registered = 0;
-               if (info[0].ecc != 2)
-                       ecc = 0;
-       }
-
-       if (info[1].banks) {
-               if (info[1].tpar > tpar)
-                       tpar = info[1].tpar;
-               if (info[1].tras_clocks > tras_clocks)
-                       tras_clocks = info[1].tras_clocks;
-               if (!info[1].registered)
-                       registered = 0;
-               if (info[1].ecc != 2)
-                       ecc = 0;
-       }
-
-       /* SDRAM configuration */
-       tmp = GTREGREAD (SDRAM_CONFIGURATION);
-
-       /* Turn on physical interleave if both DIMMs
-        * have even numbers of banks. */
-       if ((info[0].banks == 0 || info[0].banks == 2) &&
-           (info[1].banks == 0 || info[1].banks == 2)) {
-               /* physical interleave on */
-               tmp &= ~(1 << 15);
-       } else {
-               /* physical interleave off */
-               tmp |= (1 << 15);
-       }
-
-       tmp |= (registered << 17);
-
-       /* Use buffer 1 to return read data to the CPU
-        * See Res #12 */
-       tmp |= (1 << 26);
-
-       GT_REG_WRITE (SDRAM_CONFIGURATION, tmp);
-       DP (printf ("SDRAM config: %08x\n", GTREGREAD (SDRAM_CONFIGURATION)));
-
-       /* SDRAM timing */
-       tmp = (((tpar == 3) ? 2 : 1) |
-              (((tpar == 3) ? 2 : 1) << 2) |
-              (((tpar == 3) ? 2 : 1) << 4) | (tras_clocks << 8));
-
-#ifdef CONFIG_ECC
-       /* Setup ECC */
-       if (ecc == 2)
-               tmp |= 1 << 13;
-#endif /* CONFIG_ECC */
-
-       GT_REG_WRITE (SDRAM_TIMING, tmp);
-       DP (printf ("SDRAM timing: %08x (%d,%d,%d,%d)\n",
-                   GTREGREAD (SDRAM_TIMING), tpar, tpar, tpar, tras_clocks));
-
-       /* SDRAM address decode register */
-       /* program this with the default value */
-       GT_REG_WRITE (SDRAM_ADDRESS_DECODE, 0x2);
-       DP (printf ("SDRAM decode: %08x\n",
-                   GTREGREAD (SDRAM_ADDRESS_DECODE)));
-
-       return 0;
-}
-
-/* sets up the GT properly with information passed in */
-static int setup_sdram (sdram_info_t * info)
-{
-       ulong tmp;
-       ulong *addr = 0;
-       __maybe_unused ulong check;
-       int i;
-
-       /* sanity checking */
-       if (!info->banks)
-               return 0;
-
-       /* ---------------------------- */
-       /* Program the GT with the discovered data */
-
-       /* bank parameters */
-       tmp = (0xf << 16);      /* leave all virt bank pages open */
-
-       DP (printf ("drb_size: %d\n", info->drb_size));
-       switch (info->drb_size) {
-       case 1:
-               tmp |= (1 << 14);
-               break;
-       case 4:
-       case 8:
-               tmp |= (2 << 14);
-               break;
-       case 16:
-       case 32:
-               tmp |= (3 << 14);
-               break;
-       default:
-               printf ("Error in dram size calculation\n");
-               return 1;
-       }
-
-       /* SDRAM bank parameters */
-       /* the param registers for slot 1 (banks 2+3) are offset by 0x8 */
-       GT_REG_WRITE (SDRAM_BANK0PARAMETERS + (info->slot * 0x8), tmp);
-       GT_REG_WRITE (SDRAM_BANK1PARAMETERS + (info->slot * 0x8), tmp);
-       DP (printf
-           ("SDRAM bankparam slot %d (bank %d+%d): %08lx\n", info->slot,
-            info->slot * 2, (info->slot * 2) + 1, tmp));
-
-       /* set the SDRAM configuration for each bank */
-       for (i = info->slot * 2; i < ((info->slot * 2) + info->banks); i++) {
-               DP (printf ("*** Running a MRS cycle for bank %d ***\n", i));
-
-               /* map the bank */
-               memory_map_bank (i, 0, GB / 4);
-
-               /* set SDRAM mode */
-               GT_REG_WRITE (SDRAM_OPERATION_MODE, 0x3);
-               check = GTREGREAD (SDRAM_OPERATION_MODE);
-
-               /* dummy write */
-               *addr = 0;
-
-               /* wait for the command to complete */
-               while ((GTREGREAD (SDRAM_OPERATION_MODE) & (1 << 31)) == 0);
-
-               /* switch back to normal operation mode */
-               GT_REG_WRITE (SDRAM_OPERATION_MODE, 0);
-               check = GTREGREAD (SDRAM_OPERATION_MODE);
-
-               /* unmap the bank */
-               memory_map_bank (i, 0, 0);
-               DP (printf ("*** MRS cycle for bank %d done ***\n", i));
-       }
-
-       return 0;
-}
-
-/*
- * Check memory range for valid RAM. A simple memory test determines
- * the actually available RAM size between addresses `base' and
- * `base + maxsize'. Some (not all) hardware errors are detected:
- * - short between address lines
- * - short between data lines
- */
-static long int dram_size (long int *base, long int maxsize)
-{
-       volatile long int *addr, *b = base;
-       long int cnt, val, save1, save2;
-
-#define STARTVAL (1<<20)       /* start test at 1M */
-       for (cnt = STARTVAL / sizeof (long); cnt < maxsize / sizeof (long);
-            cnt <<= 1) {
-               addr = base + cnt;      /* pointer arith! */
-
-               save1 = *addr;  /* save contents of addr */
-               save2 = *b;     /* save contents of base */
-
-               *addr = cnt;    /* write cnt to addr */
-               *b = 0;         /* put null at base */
-
-               /* check at base address */
-               if ((*b) != 0) {
-                       *addr = save1;  /* restore *addr */
-                       *b = save2;     /* restore *b */
-                       return (0);
-               }
-               val = *addr;    /* read *addr */
-
-               *addr = save1;
-               *b = save2;
-
-               if (val != cnt) {
-                       /* fix boundary condition.. STARTVAL means zero */
-                       if (cnt == STARTVAL / sizeof (long))
-                               cnt = 0;
-                       return (cnt * sizeof (long));
-               }
-       }
-       return maxsize;
-}
-
-/* ------------------------------------------------------------------------- */
-
-/* U-Boot interface function to SDRAM init - this is where all the
- * controlling logic happens */
-phys_size_t initdram (int board_type)
-{
-       ulong checkbank[4] = {[0 ... 3] = 0 };
-       int bank_no;
-       ulong total;
-       int nhr;
-       sdram_info_t dimm_info[2];
-
-
-       /* first, use the SPD to get info about the SDRAM */
-
-       /* check the NHR bit and skip mem init if it's already done */
-       nhr = get_hid0 () & (1 << 16);
-
-       if (nhr) {
-               printf ("Skipping SDRAM setup due to NHR bit being set\n");
-       } else {
-               /* DIMM0 */
-               check_dimm (0, &dimm_info[0]);
-
-               /* DIMM1 */
-#ifndef CONFIG_EVB64260_750CX  /* EVB64260_750CX has only 1 DIMM */
-               check_dimm (1, &dimm_info[1]);
-#else  /* CONFIG_EVB64260_750CX */
-               memset (&dimm_info[1], 0, sizeof (sdram_info_t));
-#endif
-
-               /* unmap all banks */
-               memory_map_bank (0, 0, 0);
-               memory_map_bank (1, 0, 0);
-               memory_map_bank (2, 0, 0);
-               memory_map_bank (3, 0, 0);
-
-               /* Now, program the GT with the correct values */
-               if (setup_sdram_common (dimm_info)) {
-                       printf ("Setup common failed.\n");
-               }
-
-               if (setup_sdram (&dimm_info[0])) {
-                       printf ("Setup for DIMM1 failed.\n");
-               }
-
-               if (setup_sdram (&dimm_info[1])) {
-                       printf ("Setup for DIMM2 failed.\n");
-               }
-
-               /* set the NHR bit */
-               set_hid0 (get_hid0 () | (1 << 16));
-       }
-       /* next, size the SDRAM banks */
-
-       total = 0;
-       if (dimm_info[0].banks > 0)
-               checkbank[0] = 1;
-       if (dimm_info[0].banks > 1)
-               checkbank[1] = 1;
-       if (dimm_info[0].banks > 2)
-               printf ("Error, SPD claims DIMM1 has >2 banks\n");
-
-       if (dimm_info[1].banks > 0)
-               checkbank[2] = 1;
-       if (dimm_info[1].banks > 1)
-               checkbank[3] = 1;
-       if (dimm_info[1].banks > 2)
-               printf ("Error, SPD claims DIMM2 has >2 banks\n");
-
-       /* Generic dram sizer: works even if we don't have i2c DIMMs,
-        * as long as the timing settings are more or less correct */
-
-       /*
-        * pass 1: size all the banks, using first bat (0-256M)
-        *         limitation: we only support 256M per bank due to
-        *         us only having 1 BAT for all DRAM
-        */
-       for (bank_no = 0; bank_no < CONFIG_SYS_DRAM_BANKS; bank_no++) {
-               /* skip over banks that are not populated */
-               if (!checkbank[bank_no])
-                       continue;
-
-               DP (printf ("checking bank %d\n", bank_no));
-
-               memory_map_bank (bank_no, 0, GB / 4);
-               checkbank[bank_no] = dram_size (NULL, GB / 4);
-               memory_map_bank (bank_no, 0, 0);
-
-               DP (printf ("bank %d %08lx\n", bank_no, checkbank[bank_no]));
-       }
-
-       /*
-        * pass 2: contiguously map each bank into physical address
-        *         space.
-        */
-       dimm_info[0].banks = dimm_info[1].banks = 0;
-       for (bank_no = 0; bank_no < CONFIG_SYS_DRAM_BANKS; bank_no++) {
-               if (!checkbank[bank_no])
-                       continue;
-
-               dimm_info[bank_no / 2].banks++;
-               dimm_info[bank_no / 2].size += checkbank[bank_no];
-
-               memory_map_bank (bank_no, total, checkbank[bank_no]);
-#ifdef MAP_PCI
-               memory_map_bank_pci (bank_no, total, checkbank[bank_no]);
-#endif
-               total += checkbank[bank_no];
-       }
-
-#ifdef CONFIG_ECC
-#ifdef CONFIG_ZUMA_V2
-       /*
-        * We always enable ECC when bank 2 and 3 are unpopulated
-        * If we 2 or 3 are populated, we CAN'T support ECC.
-        * (Zuma boards only support ECC in banks 0 and 1; assume that
-        * in that configuration, ECC chips are mounted, even for stacked
-        * chips)
-        */
-       if (checkbank[2] == 0 && checkbank[3] == 0) {
-               dimm_info[0].ecc = 2;
-               GT_REG_WRITE (SDRAM_TIMING,
-                             GTREGREAD (SDRAM_TIMING) | (1 << 13));
-               /* TODO: do we have to run MRS cycles again? */
-       }
-#endif /* CONFIG_ZUMA_V2 */
-
-       if (GTREGREAD (SDRAM_TIMING) & (1 << 13)) {
-               puts ("[ECC] ");
-       }
-#endif /* CONFIG_ECC */
-
-#ifdef DEBUG
-       dump_dimm_info (&dimm_info[0]);
-       dump_dimm_info (&dimm_info[1]);
-#endif
-       /* TODO: return at MOST 256M? */
-       /* return total > GB/4 ? GB/4 : total; */
-       return total;
-}
diff --git a/board/evb64260/serial.c b/board/evb64260/serial.c
deleted file mode 100644 (file)
index 83a4217..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * serial.c - serial support for the gal ev board
- */
-
-/* supports both the 16650 duart and the MPSC */
-
-#include <common.h>
-#include <command.h>
-#include <galileo/memory.h>
-#include <serial.h>
-#include <linux/compiler.h>
-
-#if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
-#include <ns16550.h>
-#endif
-
-#include "mpsc.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
-const NS16550_t COM_PORTS[] = { (NS16550_t) CONFIG_SYS_NS16550_COM1,
-                               (NS16550_t) CONFIG_SYS_NS16550_COM2 };
-#endif
-
-#ifdef CONFIG_MPSC
-
-static int evb64260_serial_init(void)
-{
-#if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
-       int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
-#endif
-
-       mpsc_init(gd->baudrate);
-
-       /* init the DUART chans so that KGDB in the kernel can use them */
-#ifdef CONFIG_SYS_INIT_CHAN1
-       NS16550_reinit(COM_PORTS[0], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_INIT_CHAN2
-       NS16550_reinit(COM_PORTS[1], clock_divisor);
-#endif
-       return (0);
-}
-
-static void evb64260_serial_putc(const char c)
-{
-       if (c == '\n')
-               mpsc_putchar('\r');
-
-       mpsc_putchar(c);
-}
-
-static int evb64260_serial_getc(void)
-{
-       return mpsc_getchar();
-}
-
-static int evb64260_serial_tstc(void)
-{
-       return mpsc_test_char();
-}
-
-static void evb64260_serial_setbrg(void)
-{
-       galbrg_set_baudrate(CONFIG_MPSC_PORT, gd->baudrate);
-}
-
-#else /* ! CONFIG_MPSC */
-
-static int evb64260_serial_init(void)
-{
-       int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
-
-#ifdef CONFIG_SYS_INIT_CHAN1
-       (void)NS16550_init(COM_PORTS[0], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_INIT_CHAN2
-       (void)NS16550_init(COM_PORTS[1], clock_divisor);
-#endif
-
-       return (0);
-}
-
-static void evb64260_serial_putc(const char c)
-{
-       if (c == '\n')
-               NS16550_putc(COM_PORTS[CONFIG_SYS_DUART_CHAN], '\r');
-
-       NS16550_putc(COM_PORTS[CONFIG_SYS_DUART_CHAN], c);
-}
-
-static int evb64260_serial_getc(void)
-{
-       return NS16550_getc(COM_PORTS[CONFIG_SYS_DUART_CHAN]);
-}
-
-static int evb64260_serial_tstc(void)
-{
-       return NS16550_tstc(COM_PORTS[CONFIG_SYS_DUART_CHAN]);
-}
-
-static void evb64260_serial_setbrg(void)
-{
-       int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
-
-#ifdef CONFIG_SYS_INIT_CHAN1
-       NS16550_reinit(COM_PORTS[0], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_INIT_CHAN2
-       NS16550_reinit(COM_PORTS[1], clock_divisor);
-#endif
-}
-
-#endif /* CONFIG_MPSC */
-
-static struct serial_device evb64260_serial_drv = {
-       .name   = "evb64260_serial",
-       .start  = evb64260_serial_init,
-       .stop   = NULL,
-       .setbrg = evb64260_serial_setbrg,
-       .putc   = evb64260_serial_putc,
-       .puts   = default_serial_puts,
-       .getc   = evb64260_serial_getc,
-       .tstc   = evb64260_serial_tstc,
-};
-
-void evb64260_serial_initialize(void)
-{
-       serial_register(&evb64260_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
-       return &evb64260_serial_drv;
-}
-
-#if defined(CONFIG_CMD_KGDB)
-void
-kgdb_serial_init(void)
-{
-}
-
-void
-putDebugChar (int c)
-{
-       serial_putc (c);
-}
-
-void
-putDebugStr (const char *str)
-{
-       serial_puts (str);
-}
-
-int
-getDebugChar (void)
-{
-       return serial_getc();
-}
-
-void
-kgdb_interruptible (int yes)
-{
-       return;
-}
-#endif
diff --git a/board/evb64260/u-boot.lds b/board/evb64260/u-boot.lds
deleted file mode 100644 (file)
index 712df6d..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * u-boot.lds - linker script for U-Boot on the Galileo Eval Board.
- */
-
-OUTPUT_ARCH(powerpc)
-
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  .text      :
-  {
-    arch/powerpc/cpu/74xx_7xx/start.o  (.text*)
-    *(.text*)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o      (.ppcenv*)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    _GOT2_TABLE_ = .;
-    KEEP(*(.got2))
-    KEEP(*(.got))
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
-    _FIXUP_TABLE_ = .;
-    KEEP(*(.fixup))
-  }
-  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data*)
-    *(.sdata*)
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-
-  . = ALIGN(4);
-  .u_boot_list : {
-       KEEP(*(SORT(.u_boot_list*)));
-  }
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.bss*)
-   *(.sbss*)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/evb64260/zuma_pbb.c b/board/evb64260/zuma_pbb.c
deleted file mode 100644 (file)
index aa15fa0..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-#include <common.h>
-#include <malloc.h>
-
-#if defined(CONFIG_CMD_BSP)
-#include <command.h>
-#endif
-
-#include <pci.h>
-#include <galileo/pci.h>
-#include "zuma_pbb.h"
-
-#undef DEBUG
-
-#define PAT_LO 0x00010203
-#define PAT_HI 0x04050607
-
-static PBB_DMA_REG_MAP *zuma_pbb_reg = NULL;
-static char test_buf1[2048];
-static char test_buf2[2048];
-void zuma_init_pbb(void);
-int zuma_mbox_init(void);
-int zuma_test_dma(int cmd, int size);
-
-int zuma_test_dma (int cmd, int size)
-{
-       static const char *const test_legend[] = {
-               "write", "verify",
-               "copy", "compare",
-               "write inc", "verify inc"
-       };
-       register int i, j;
-       unsigned int p1 = ((unsigned int) test_buf1 + 0xff) & (~0xff);
-       unsigned int p2 = ((unsigned int) test_buf2 + 0xff) & (~0xff);
-       volatile unsigned int *ps = (unsigned int *) p1;
-       volatile unsigned int *pd = (unsigned int *) p2;
-       unsigned int funct, pat_lo = PAT_LO, pat_hi = PAT_HI;
-       DMA_INT_STATUS stat;
-       int ret = 0;
-
-       if (!zuma_pbb_reg) {
-               printf ("not initted\n");
-               return -1;
-       }
-
-       if (cmd < 0 || cmd > 5) {
-               printf ("inv cmd %d\n", cmd);
-               return -1;
-       }
-
-       if (cmd == 2 || cmd == 3) {
-               /* not implemented */
-               return 0;
-       }
-
-       if (size <= 0 || size > 1024)
-               size = 1024;
-
-       size &= (~7);                           /* throw away bottom 3 bits */
-
-       p1 = ((unsigned int) test_buf1 + 0xff) & (~0xff);
-       p2 = ((unsigned int) test_buf2 + 0xff) & (~0xff);
-
-       memset ((void *) p1, 0, size);
-       memset ((void *) p2, 0, size);
-
-       for (i = 0; i < size / 4; i += 2) {
-               ps[i] = pat_lo;
-               ps[i + 1] = pat_hi;
-               if (cmd == 4 || cmd == 5) {
-                       unsigned char *pl = (unsigned char *) &pat_lo;
-                       unsigned char *ph = (unsigned char *) &pat_hi;
-
-                       for (j = 0; j < 4; j++) {
-                               pl[j] += 8;
-                               ph[j] += 8;
-                       }
-               }
-       }
-
-       funct = (1 << 31) | (cmd << 24) | (size);
-
-       zuma_pbb_reg->int_mask.pci_bits.chan0 =
-                       EOF_RX_FLAG | EOF_TX_FLAG | EOB_TX_FLAG;
-
-       zuma_pbb_reg->debug_57 = PAT_LO;        /* patl */
-       zuma_pbb_reg->debug_58 = PAT_HI;        /* path */
-
-       zuma_pbb_reg->debug_54 = cpu_to_le32 (p1);      /* src 0x01b0 */
-       zuma_pbb_reg->debug_55 = cpu_to_le32 (p2);      /* dst 0x01b8 */
-       zuma_pbb_reg->debug_56 = cpu_to_le32 (funct);   /* func, 0x01c0 */
-
-       /* give DMA time to chew on things.. dont use DRAM or PCI */
-       /* if you can avoid it. */
-       do {
-               for (i = 0; i < 1000 * 10; i++);
-       } while (le32_to_cpu (zuma_pbb_reg->debug_56) & (1 << 31));
-
-       stat.word = zuma_pbb_reg->status.word;
-       zuma_pbb_reg->int_mask.word = 0;
-
-       printf ("stat: %08x (%x)\n", stat.word, stat.pci_bits.chan0);
-
-       printf ("func: %08x\n", le32_to_cpu (zuma_pbb_reg->debug_56));
-       printf ("src @%08x: %08x %08x %08x %08x\n", p1, ps[0], ps[1], ps[2],
-                       ps[3]);
-       printf ("dst @%08x: %08x %08x %08x %08x\n", p2, pd[0], pd[1], pd[2],
-                       pd[3]);
-       printf ("func: %08x\n", le32_to_cpu (zuma_pbb_reg->debug_56));
-
-
-       if (cmd == 0 || cmd == 4) {
-               /* this is a write */
-               if (!(stat.pci_bits.chan0 & EOF_RX_FLAG) ||     /* not done */
-                       (memcmp ((void *) ps, (void *) pd, size) != 0)) {       /* cmp error */
-                       for (i = 0; i < size / 4; i += 2) {
-                               if ((ps[i] != pd[i]) || (ps[i + 1] != pd[i + 1])) {
-                                       printf ("s @%p:%08x %08x\n", &ps[i], ps[i], ps[i + 1]);
-                                       printf ("d @%p:%08x %08x\n", &pd[i], pd[i], pd[i + 1]);
-                               }
-                       }
-                       ret = -1;
-               }
-       } else {
-               /* this is a verify */
-               if (!(stat.pci_bits.chan0 & EOF_TX_FLAG) ||     /* not done */
-                       (stat.pci_bits.chan0 & EOB_TX_FLAG)) {  /* cmp error */
-                       printf ("%08x: %08x %08x\n",
-                                       le32_to_cpu (zuma_pbb_reg->debug_63),
-                                       zuma_pbb_reg->debug_61, zuma_pbb_reg->debug_62);
-                       ret = -1;
-               }
-       }
-
-       printf ("%s cmd %d, %d bytes: %s!\n", test_legend[cmd], cmd, size,
-                       (ret == 0) ? "PASSED" : "FAILED");
-       return 0;
-}
-
-void zuma_init_pbb (void)
-{
-       unsigned int iobase;
-       pci_dev_t dev =
-                       pci_find_device (VENDOR_ID_ZUMA, DEVICE_ID_ZUMA_PBB, 0);
-
-       if (dev == -1) {
-               printf ("no zuma pbb\n");
-               return;
-       }
-
-       pci_read_config_dword (dev, PCI_BASE_ADDRESS_0, &iobase);
-
-       iobase &= PCI_BASE_ADDRESS_MEM_MASK;
-
-       zuma_pbb_reg = (PBB_DMA_REG_MAP *)iobase;
-
-
-       if (!zuma_pbb_reg) {
-               printf ("zuma pbb bar none! (hah hah, get it?)\n");
-               return;
-       }
-
-       zuma_pbb_reg->int_mask.word = 0;
-
-       printf ("pbb @ %p v%d.%d, timestamp %08x\n", zuma_pbb_reg,
-                       zuma_pbb_reg->version.pci_bits.rev_major,
-                       zuma_pbb_reg->version.pci_bits.rev_minor,
-                       zuma_pbb_reg->timestamp);
-
-}
-
-#if defined(CONFIG_CMD_BSP)
-
-static int last_cmd = 4;               /* write increment */
-static int last_size = 64;
-
-int
-do_zuma_init_pbb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       zuma_init_pbb ();
-       return 0;
-}
-
-int
-do_zuma_test_dma (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       if (argc > 1) {
-               last_cmd = simple_strtoul (argv[1], NULL, 10);
-       }
-       if (argc > 2) {
-               last_size = simple_strtoul (argv[2], NULL, 10);
-       }
-       zuma_test_dma (last_cmd, last_size);
-       return 0;
-}
-
-int
-do_zuma_init_mbox (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       zuma_mbox_init ();
-       return 0;
-}
-
-U_BOOT_CMD(
-       zinit,   1,      0,      do_zuma_init_pbb,
-       "init zuma pbb",
-       "\n"
-);
-U_BOOT_CMD(
-       zdtest,   3,      1,      do_zuma_test_dma,
-       "run dma test",
-       "[cmd [count]]\n"
-       "    - run dma cmd (w=0,v=1,cp=2,cmp=3,wi=4,vi=5), count bytes"
-);
-U_BOOT_CMD(
-       zminit,   1,      0,      do_zuma_init_mbox,
-       "init zuma mbox",
-       "\n"
-);
-
-#endif
diff --git a/board/evb64260/zuma_pbb.h b/board/evb64260/zuma_pbb.h
deleted file mode 100644 (file)
index 300b2fe..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-#ifndef ZUMA_PBB_H
-#define ZUMA_PBB_H
-
-#define MAX_NUM_BUFFER_PER_RING        32
-
-#ifdef __BIG_ENDIAN
-#define cpu_bits _be_s_bits    /* use with le32_to_cpu only */
-#define pci_bits _be_bits      /* may contain swapped bytes,
-                                  but dont need le32_to_cpu */
-#endif
-
-#ifdef __LITTLE_ENDIAN
-#define cpu_bits _le_bits
-#define pci_bits _le_bits
-#endif
-
-#define VENDOR_ID_ZUMA         0x1172
-#define DEVICE_ID_ZUMA_PBB     0x0004
-
-#define RXDBP(chan)            (&sip->rx_desc[chan].base)      /* ch*8      */
-#define RXDP(chan)             (&sip->rx_desc[chan].current)   /* ch*8 +  4 */
-#define TXDBP(chan)            (&sip->tx_desc[chan].base)      /* ch*8 + 64 */
-#define TXDP(chan)             (&sip->tx_desc[chan].current)   /* ch*8 + 68 */
-
-#define PBB_DMA_OWN_BIT                0x80000000
-#define PBB_DMA_LAST_BIT       0x40000000
-
-#define EOF_RX_FLAG            1       /* bit 0 */
-#define EOB_RX_FLAG            2       /* bit 1 */
-#define EOF_TX_FLAG            4       /* bit 2 */
-#define EOB_TX_FLAG            8       /* bit 3 */
-
-#define TX_MODE(m)             (((m)&7) << 16)
-
-#define RX_DESC(i)             (cs->rx_desc[i])
-#define TX_DESC(i)             (cs->tx_desc[i])
-
-#define RX_CONTROL(i)          (RX_DESC(i).control.word)
-#define RX_CONTROL_SIZE(i)     (RX_DESC(i).control.rx.size)
-#define TX_CONTROL(i)          (TX_DESC(i).control.word)
-
-#define RX_DATA_P(i)           (&RX_DESC(i).ptr)
-#define TX_DATA_P(i)           (&TX_DESC(i).ptr)
-
-typedef volatile unsigned char V8;
-typedef volatile unsigned short V16;
-typedef volatile unsigned int V32;
-
-/* RAM descriptor layout */
-typedef struct _tag_dma_descriptor {
-    V32 ptr;
-    union {
-       struct {
-           V32 owner:1;
-           V32 last:1;
-           V32 reserved0: 10;
-           V32 tx_mode: 4;
-
-           V32 reserved1: 5;
-           V32 size: 11;
-       } tx;
-       struct {
-           V32 owner:1;
-           V32 last:1;
-           V32 reserved0: 14;
-
-           V32 reserved1: 5;
-           V32 size: 11;
-       } rx;
-       V32 word;
-    } control;
-} DMA_DESCRIPTOR;
-
-/*
- * NOTE: DO NOT USE structure to write non-word values... all registers
- * MUST be written 4 bytes at a time in SI version 0.
- * Non-word writes will result in "unaccessed" bytes written as zero.
- *
- * Byte reads are allowed.
- *
- * V32 pads are because the registers are spaced every 8 bytes (64 bits)
- *
- */
-
-/* NOTE!!! 4 dwords */
-typedef struct _tag_dma_descriptor_ring {
-    DMA_DESCRIPTOR *base;
-    V32 pad1;  /* skip high dword */
-    volatile DMA_DESCRIPTOR *current;
-    V32 pad3;  /* skip high dword */
-} DMA_DESCRIPTOR_RING;
-
-/* 1 dword */
-typedef union _tag_dma_generic {
-    struct {   /* byte 3 2 1 0 */
-       V32 chan7:4;    /* bits 31-28 */
-       V32 chan6:4;    /* bits 27-24 */
-       V32 chan5:4;    /* bits 23-20 */
-       V32 chan4:4;    /* bits 19-16 */
-       V32 chan3:4;    /* bits 15-12 */
-       V32 chan2:4;    /* bits 11-8 */
-       V32 chan1:4;    /* bits 7-4 */
-       V32 chan0:4;    /* bits 3-0 */
-    } _be_s_bits;
-    struct {   /* byte 0 1 2 3 */
-       V32 chan1:4;    /* bits 7-4 */
-       V32 chan0:4;    /* bits 3-0 */
-       V32 chan3:4;    /* bits 15-12 */
-       V32 chan2:4;    /* bits 11-8 */
-       V32 chan5:4;    /* bits 23-20 */
-       V32 chan4:4;    /* bits 19-16 */
-       V32 chan7:4;    /* bits 31-28 */
-       V32 chan6:4;    /* bits 27-24 */
-    } _be_bits;
-    struct {   /* byte 0 1 2 3 */
-       V32 chan0:4;    /* bits 0-3 */
-       V32 chan1:4;    /* bits 4-7 */
-       V32 chan2:4;    /* bits 8-11 */
-       V32 chan3:4;    /* bits 12-15 */
-       V32 chan4:4;    /* bits 16-19 */
-       V32 chan5:4;    /* bits 20-23 */
-       V32 chan6:4;    /* bits 24-27 */
-       V32 chan7:4;    /* bits 28-31 */
-    } _le_bits;
-    V8 byte[4];
-    V32 word;
-} DMA_RXTX_ENABLE, DMA_RX_DELETE,
-  DMA_INT_STATUS, DMA_INT_MASK,
-  DMA_RX_LEVEL_STATUS, DMA_RX_LEVEL_INT_MASK;
-
-/* 1 dword */
-typedef union _tag_dma_rx_timer{
-    struct {
-       V32 res0:8;     /* bits 32-24 */
-       V32 res1:7;     /* bits 23-17 */
-       V32 enable:1;   /* bit 16 */
-       V32 value:16;   /* bits 15-0 */
-    } _be_s_bits;
-    struct {
-       /* crosses byte boundary. must use swap. */
-       V32 s_value:16; /* bits 7-0,15-8 */
-       V32 enable:1;   /* bit 16 */
-       V32 res1:7;     /* bits 23-17 */
-       V32 res0:8;     /* bits 32-24 */
-    } _be_bits;
-    struct {
-       V32 value:16;   /* bits 0-15 */
-       V32 enable:1;   /* bit 16 */
-       V32 res1:7;     /* bits 17-23 */
-       V32 res0:8;     /* bits 24-32 */
-    } _le_bits;
-    V8 byte[4];
-    V32 word;
-} DMA_RX_TIMER;
-
-/* NOTE!!!: 2 dwords */
-typedef struct _tag_dma_desc_level{
-    union {
-       struct {
-           V32 res1:8; /* bits 31-24 */
-           V32 res0:7; /* bits 23-17 */
-           V32 write:1;        /* bit 16 */
-           V32 thresh:8;       /* bits 15-8 */
-           V32 level:8;        /* bits 7-0 */
-       } _be_s_bits;
-       struct {
-           V32 level:8;        /* bits 7-0 */
-           V32 thresh:8;       /* bits 15-8 */
-           V32 res0:7; /* bits 30-17 */
-           V32 write:1;        /* bit 16 */
-           V32 res1:8; /* bits 31-24 */
-       } _be_bits;
-       struct {
-           V32 level:8;        /* bits 0-7 */
-           V32 thresh:8;       /* bits 8-15 */
-           V32 write:1;        /* bit 16 */
-           V32 res0:7; /* bit 17-30 */
-           V32 res1:8; /* bits 24-31 */
-       } _le_bits;
-       V8 byte[4];
-       V32 word;
-    } desc;
-    V32 pad1;
-} DMA_DESC_LEVEL;
-
-typedef struct _tag_pbb_dma_reg_map {
-    /* 0-15 (0x000-0x078) */
-    DMA_DESCRIPTOR_RING rx_desc[8];    /* 4 dwords each, 128 bytes tot. */
-
-    /* 16-31 (0x080-0x0f8) */
-    DMA_DESCRIPTOR_RING tx_desc[8];    /* 4 dwords each, 128 bytes tot. */
-
-    /* 32/33 (0x100/0x108) */
-    V32 reserved_32;
-    V32 pad_32;
-    V32 reserved_33;
-    V32 pad_33;
-
-    /* 34 (0x110) */
-    DMA_RXTX_ENABLE rxtx_enable;
-    V32 pad_34;
-
-    /* 35 (0x118) */
-    DMA_RX_DELETE rx_delete;
-    V32 pad_35;
-
-    /* 36-38 (0x120-0x130) */
-    DMA_INT_STATUS status;
-    V32 pad_36;
-    DMA_INT_STATUS last_status;
-    V32 pad_37;
-    DMA_INT_MASK int_mask;
-    V32 pad_38;
-
-    /* 39/40 (0x138/0x140) */
-    union {
-       /* NOTE!! 4 dwords */
-       struct {
-           V32 channel_3:8;
-           V32 channel_2:8;
-           V32 channel_1:8;
-           V32 channel_0:8;
-           V32 pad1;
-           V32 channel_7:8;
-           V32 channel_6:8;
-           V32 channel_5:8;
-           V32 channel_4:8;
-           V32 pad3;
-       } _be_s_bits;
-       struct {
-           V32 channel_0:8;
-           V32 channel_1:8;
-           V32 channel_2:8;
-           V32 channel_3:8;
-           V32 pad1;
-           V32 channel_4:8;
-           V32 channel_5:8;
-           V32 channel_6:8;
-           V32 channel_7:8;
-           V32 pad3;
-       } _be_bits, _le_bits;
-       V8 byte[16];
-       V32 word[4];
-    } rx_size;
-
-    /* 41/42 (0x148/0x150) */
-    V32 reserved_41;
-    V32 pad_41;
-    V32 reserved_42;
-    V32 pad_42;
-
-    /* 43/44 (0x158/0x160) */
-    DMA_RX_LEVEL_STATUS rx_level_status;
-    V32 pad_43;
-    DMA_RX_LEVEL_INT_MASK rx_level_int_mask;
-    V32 pad_44;
-
-    /* 45 (0x168) */
-    DMA_RX_TIMER rx_timer;
-    V32 pad_45;
-
-    /* 46 (0x170) */
-    V32 reserved_46;
-    V32 pad_46;
-
-    /* 47 (0x178) */
-    V32 mbox_status;
-    V32 pad_47;
-
-    /* 48/49 (0x180/0x188) */
-    V32 mbox_out;
-    V32 pad_48;
-    V32 mbox_in;
-    V32 pad_49;
-
-    /* 50 (0x190) */
-    V32 config;
-    V32 pad_50;
-
-    /* 51/52 (0x198/0x1a0) */
-    V32 c2a_ctr;
-    V32 pad_51;
-    V32 a2c_ctr;
-    V32 pad_52;
-
-    /* 53 (0x1a8) */
-    union {
-       struct {
-           V32 rev_major:8;    /* bits 31-24 */
-           V32 rev_minor:8;    /* bits 23-16 */
-           V32 reserved:16;    /* bits 15-0 */
-       } _be_s_bits;
-       struct {
-           V32 s_reserved:16;  /* bits 7-0, 15-8 */
-           V32 rev_minor:8;    /* bits 23-16 */
-           V32 rev_major:8;    /* bits 31-24 */
-       } _be_bits;
-       struct {
-           V32 reserved:16;    /* bits 0-15 */
-           V32 rev_minor:8;    /* bits 16-23 */
-           V32 rev_major:8;    /* bits 24-31 */
-       } _le_bits;
-       V8 byte[4];
-       V32 word;
-    } version;
-    V32 pad_53;
-
-    /* 54-59 (0x1b0-0x1d8) */
-    V32 debug_54;
-    V32 pad_54;
-    V32 debug_55;
-    V32 pad_55;
-    V32 debug_56;
-    V32 pad_56;
-    V32 debug_57;
-    V32 pad_57;
-    V32 debug_58;
-    V32 pad_58;
-    V32 debug_59;
-    V32 pad_59;
-
-    /* 60 (0x1e0) */
-    V32 timestamp;
-    V32 pad_60;
-
-    /* 61-63 (0x1e8-0x1f8) */
-    V32 debug_61;
-    V32 pad_61;
-    V32 debug_62;
-    V32 pad_62;
-    V32 debug_63;
-    V32 pad_63;
-
-    /* 64-71 (0x200 - 0x238) */
-    DMA_DESC_LEVEL rx_desc_level[8];   /* 2 dwords each, 32 bytes tot. */
-
-    /* 72-98 (0x240 - 0x2f8) */
-    /* reserved */
-
-    /* 96-127 (0x300 - 0x3f8) */
-    /* mirrors (0x100 - 0x1f8) */
-
-} PBB_DMA_REG_MAP;
-
-
-#endif /* ZUMA_PBB_H */
diff --git a/board/evb64260/zuma_pbb_mbox.c b/board/evb64260/zuma_pbb_mbox.c
deleted file mode 100644 (file)
index 621c64c..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-#include <common.h>
-#include <galileo/pci.h>
-#include <net.h>
-#include <pci.h>
-
-#include "zuma_pbb.h"
-#include "zuma_pbb_mbox.h"
-
-
-struct _zuma_mbox_dev zuma_mbox_dev;
-
-
-static int zuma_mbox_write(struct _zuma_mbox_dev *dev, unsigned int data)
-{
-       unsigned int status, count = 0, i;
-
-       status = (volatile int) le32_to_cpu(dev->sip->mbox_status);
-
-       while ((status & OUT_PENDING) && count < 1000) {
-               count++;
-               for (i = 0; i < 1000; i++)
-                       ;
-               status = (volatile int) le32_to_cpu(dev->sip->mbox_status);
-       }
-       if (count < 1000) {
-               /* if SET it means msg pending */
-               /* printf("mbox real write %08x\n",data); */
-               dev->sip->mbox_out = cpu_to_le32(data);
-               return 4;
-       }
-
-       printf("mbox tx timeout\n");
-       return 0;
-}
-
-static int zuma_mbox_read(struct _zuma_mbox_dev *dev, unsigned int *data)
-{
-       unsigned int status, count = 0, i;
-
-       status = (volatile int) le32_to_cpu(dev->sip->mbox_status);
-
-       while (!(status & IN_VALID) && count < 1000) {
-               count++;
-               for (i = 0; i < 1000; i++)
-                       ;
-               status = (volatile int) le32_to_cpu(dev->sip->mbox_status);
-       }
-       if (count < 1000) {
-               /* if SET it means msg pending */
-               *data = le32_to_cpu(dev->sip->mbox_in);
-               /*printf("mbox real read %08x\n", *data); */
-               return 4;
-       }
-       printf("mbox rx timeout\n");
-       return 0;
-}
-
-static int zuma_mbox_do_one_mailbox(unsigned int out, unsigned int *in)
-{
-       int ret;
-
-       ret = zuma_mbox_write(&zuma_mbox_dev, out);
-       /*printf("write 0x%08x (%d bytes)\n", out, ret); */
-       if (ret != 4)
-               return -1;
-       ret = zuma_mbox_read(&zuma_mbox_dev, in);
-       /*printf("read 0x%08x (%d bytes)\n", *in, ret); */
-       if (ret != 4)
-               return -1;
-       return 0;
-}
-
-
-#define RET_IF_FAILED(x)       if ((x) == -1) return -1
-
-static int zuma_mbox_do_all_mailbox(void)
-{
-       unsigned int data_in;
-       unsigned short sdata_in;
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_START, &data_in));
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_MACL, &data_in));
-       memcpy(zuma_acc_mac + 2, &data_in, 4);
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_MACH, &data_in));
-       sdata_in = data_in & 0xffff;
-       memcpy(zuma_acc_mac, &sdata_in, 2);
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_IP, &data_in));
-       zuma_ip = data_in;
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_SLOT, &data_in));
-       zuma_slot_bac = data_in >> 3;
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_BAUD, &data_in));
-       zuma_console_baud = data_in & 0xffff;
-       zuma_debug_baud = data_in >> 16;
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox
-                     (ZUMA_MBOXMSG_ENG_PRV_MACL, &data_in));
-       memcpy(zuma_prv_mac + 2, &data_in, 4);
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox
-                     (ZUMA_MBOXMSG_ENG_PRV_MACH, &data_in));
-       sdata_in = data_in & 0xffff;
-       memcpy(zuma_prv_mac, &sdata_in, 2);
-
-       RET_IF_FAILED(zuma_mbox_do_one_mailbox(ZUMA_MBOXMSG_DONE, &data_in));
-
-       return 0;
-}
-
-
-static void zuma_mbox_dump(void)
-{
-       unsigned short s;
-       unsigned int i;
-
-       memcpy(&s, &zuma_acc_mac,    sizeof(s));
-       memcpy(&i, &zuma_acc_mac[2], sizeof(i));
-       printf("ACC MAC=%04x%08x\n", s, i);
-
-       memcpy(&s, &zuma_prv_mac,    sizeof(s));
-       memcpy(&s, &zuma_prv_mac[2], sizeof(i));
-       printf("PRV MAC=%04x%08x\n", s, i);
-
-       printf("slot:bac=%d:%d\n",
-               (zuma_slot_bac >> 2) & 0xf,
-               zuma_slot_bac & 0x3);
-
-       printf("BAUD1=%d BAUD2=%d\n",
-               zuma_console_baud,
-               zuma_debug_baud);
-}
-
-
-static void zuma_mbox_setenv(void)
-{
-       char *data, buf[32];
-       unsigned char save = 0;
-
-       data = getenv("baudrate");
-
-       if (!data || (zuma_console_baud != simple_strtoul(data, NULL, 10))) {
-               sprintf(buf, "%6d", zuma_console_baud);
-               setenv("baudrate", buf);
-               save = 1;
-               printf("baudrate doesn't match from mbox\n");
-       }
-
-       ip_to_string(zuma_ip, buf);
-       setenv("ipaddr", buf);
-
-       sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x",
-               zuma_prv_mac[0],
-               zuma_prv_mac[1],
-               zuma_prv_mac[2],
-               zuma_prv_mac[3], zuma_prv_mac[4], zuma_prv_mac[5]);
-       setenv("ethaddr", buf);
-
-       sprintf(buf, "%02x", zuma_slot_bac);
-       setenv("bacslot", buf);
-
-       if (save)
-               saveenv();
-}
-
-/**
- *     zuma_mbox_init:
- */
-
-int zuma_mbox_init(void)
-{
-       unsigned int iobase;
-
-       memset(&zuma_mbox_dev, 0, sizeof(struct _zuma_mbox_dev));
-
-       zuma_mbox_dev.dev =
-               pci_find_device(VENDOR_ID_ZUMA, DEVICE_ID_ZUMA_PBB, 0);
-
-       if (zuma_mbox_dev.dev == -1) {
-               printf("no zuma pbb\n");
-               return -1;
-       }
-
-       pci_read_config_dword(zuma_mbox_dev.dev, PCI_BASE_ADDRESS_0, &iobase);
-
-       iobase &= PCI_BASE_ADDRESS_MEM_MASK;
-
-       zuma_mbox_dev.sip = (PBB_DMA_REG_MAP *) iobase;
-
-       zuma_mbox_dev.sip->int_mask.word = 0;
-
-       printf("pbb @ %p v%d.%d, timestamp %08x\n", zuma_mbox_dev.sip,
-              zuma_mbox_dev.sip->version.pci_bits.rev_major,
-              zuma_mbox_dev.sip->version.pci_bits.rev_minor,
-              zuma_mbox_dev.sip->timestamp);
-
-       if (zuma_mbox_do_all_mailbox() == -1) {
-               printf("mailbox failed.. no ACC?\n");
-               return -1;
-       }
-
-       zuma_mbox_dump();
-
-       zuma_mbox_setenv();
-
-       return 0;
-}
diff --git a/board/evb64260/zuma_pbb_mbox.h b/board/evb64260/zuma_pbb_mbox.h
deleted file mode 100644 (file)
index b4a4c0c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#define IN_VALID 1
-#define OUT_PENDING 2
-
-enum {
-       ZUMA_MBOXMSG_DONE,
-       ZUMA_MBOXMSG_MACL,
-       ZUMA_MBOXMSG_MACH,
-       ZUMA_MBOXMSG_IP,
-       ZUMA_MBOXMSG_SLOT,
-       ZUMA_MBOXMSG_RESET,
-       ZUMA_MBOXMSG_BAUD,
-       ZUMA_MBOXMSG_START,
-       ZUMA_MBOXMSG_ENG_PRV_MACL,
-       ZUMA_MBOXMSG_ENG_PRV_MACH,
-
-       MBOXMSG_LAST
-};
-
-struct zuma_mailbox_info {
-       unsigned char acc_mac[6];
-       unsigned char prv_mac[6];
-       unsigned int ip;
-       unsigned int slot_bac;
-       unsigned int console_baud;
-       unsigned int debug_baud;
-};
-
-struct _zuma_mbox_dev {
-       pci_dev_t dev;
-       PBB_DMA_REG_MAP *sip;
-       struct zuma_mailbox_info mailbox;
-};
-
-#define zuma_prv_mac           zuma_mbox_dev.mailbox.prv_mac
-#define zuma_acc_mac           zuma_mbox_dev.mailbox.acc_mac
-#define zuma_ip                 zuma_mbox_dev.mailbox.ip
-#define zuma_slot_bac          zuma_mbox_dev.mailbox.slot_bac
-#define zuma_console_baud      zuma_mbox_dev.mailbox.console_baud
-#define zuma_debug_baud                zuma_mbox_dev.mailbox.debug_baud
-
-
-extern struct _zuma_mbox_dev zuma_mbox_dev;
-extern int zuma_mbox_init (void);
index db2e5e3bd321c33fddbd5f7e92e620347810bde2..33088396f572f790df27f4f358478dcf524f11d2 100644 (file)
@@ -6,3 +6,5 @@ F:      include/configs/C29XPCIE.h
 F:     configs/C29XPCIE_defconfig
 F:     configs/C29XPCIE_NAND_defconfig
 F:     configs/C29XPCIE_SPIFLASH_defconfig
+F:     configs/C29XPCIE_NOR_SECBOOT_defconfig
+F:     configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig
index 5f7a67d057d57938c66145c2d522a803d619257a..1eb37866e3d0d2f815f81519feca8a11f6870f3c 100644 (file)
@@ -63,7 +63,7 @@ int pib_init(void)
 #endif
 
 #if defined(CONFIG_PQ_MDS_PIB_ATM)
-#if defined(CONFIG_MPC8360EMDS) || defined(CONFIG_MPC8569MDS)
+#if defined(CONFIG_MPC8569MDS)
        val8 = 0;
        i2c_write(0x20, 0x6, 1, &val8, 1);
        i2c_write(0x20, 0x7, 1, &val8, 1);
index c8ca6746f19164a27caabbf72c007b5ae4f99e91..745847cdbaa34802faffe39f64e2660db5ebd417 100644 (file)
@@ -27,3 +27,4 @@ F:    configs/P5040DS_defconfig
 F:     configs/P5040DS_NAND_defconfig
 F:     configs/P5040DS_SDCARD_defconfig
 F:     configs/P5040DS_SPIFLASH_defconfig
+F:     configs/P5040DS_SECURE_BOOT_defconfig
index 638833dc4126fd0a8dbdfde9fbedd020bcc1b736..661526b99330ecb5093ae2b0bcd55b6d3d40ca47 100644 (file)
@@ -6,6 +6,7 @@ F:      include/configs/ls1021aqds.h
 F:     configs/ls1021aqds_nor_defconfig
 F:     configs/ls1021aqds_ddr4_nor_defconfig
 F:     configs/ls1021aqds_nor_SECURE_BOOT_defconfig
+F:     configs/ls1021aqds_nor_lpuart_defconfig
 F:     configs/ls1021aqds_sdcard_defconfig
 F:     configs/ls1021aqds_qspi_defconfig
 F:     configs/ls1021aqds_nand_defconfig
index 3b6903c83bcd8b64bda657f041fe778d3687d4d2..ab0234412cb88b7d3c9537eea771c327190383ea 100644 (file)
@@ -7,3 +7,4 @@
 obj-y += ls1021aqds.o
 obj-y += ddr.o
 obj-y += eth.o
+obj-$(CONFIG_FSL_DCU_FB) += dcu.o
diff --git a/board/freescale/ls1021aqds/dcu.c b/board/freescale/ls1021aqds/dcu.c
new file mode 100644 (file)
index 0000000..90f5bc0
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * FSL DCU Framebuffer driver
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm/io.h>
+#include <common.h>
+#include <fsl_dcu_fb.h>
+#include <i2c.h>
+#include "div64.h"
+#include "../common/diu_ch7301.h"
+#include "ls1021aqds_qixis.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int select_i2c_ch_pca9547(u8 ch)
+{
+       int ret;
+
+       ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+       if (ret) {
+               puts("PCA: failed to select proper channel\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+unsigned int dcu_set_pixel_clock(unsigned int pixclock)
+{
+       unsigned long long div;
+
+       div = (unsigned long long)(gd->bus_clk / 1000);
+       div *= (unsigned long long)pixclock;
+       do_div(div, 1000000000);
+
+       return div;
+}
+
+int platform_dcu_init(unsigned int xres, unsigned int yres,
+                     const char *port,
+                     struct fb_videomode *dcu_fb_videomode)
+{
+       const char *name;
+       unsigned int pixel_format;
+       int ret;
+       u8 ch;
+
+       /* Mux I2C3+I2C4 as HSYNC+VSYNC */
+       ret = i2c_read(CONFIG_SYS_I2C_QIXIS_ADDR, QIXIS_DCU_BRDCFG5,
+                      1, &ch, 1);
+       if (ret) {
+               printf("Error: failed to read I2C @%02x\n",
+                      CONFIG_SYS_I2C_QIXIS_ADDR);
+               return ret;
+       }
+       ch &= 0x1F;
+       ch |= 0xA0;
+       ret = i2c_write(CONFIG_SYS_I2C_QIXIS_ADDR, QIXIS_DCU_BRDCFG5,
+                       1, &ch, 1);
+       if (ret) {
+               printf("Error: failed to write I2C @%02x\n",
+                      CONFIG_SYS_I2C_QIXIS_ADDR);
+               return ret;
+       }
+
+       if (strncmp(port, "hdmi", 4) == 0) {
+               unsigned long pixval;
+
+               name = "HDMI";
+
+               pixval = 1000000000 / dcu_fb_videomode->pixclock;
+               pixval *= 1000;
+
+               i2c_set_bus_num(CONFIG_SYS_I2C_DVI_BUS_NUM);
+               select_i2c_ch_pca9547(I2C_MUX_CH_CH7301);
+               diu_set_dvi_encoder(pixval);
+               select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       } else {
+               return 0;
+       }
+
+       printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
+
+       pixel_format = 32;
+       fsl_dcu_init(xres, yres, pixel_format);
+
+       return 0;
+}
index a539ff97913ded4a98b3e95ca0ea9cafc8f05175..6435bf9ad18f2db0da555004f3ca7808f47edf32 100644 (file)
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
+#include <asm/io.h>
 #include "ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -149,6 +150,17 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm,
 }
 #endif
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+       void __iomem *qixis_base = (void *)QIXIS_BASE;
+
+       /* does not provide HW signals for power management */
+       clrbits_8(qixis_base + 0x21, 0x2);
+       udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
        phys_size_t dram_size;
@@ -159,6 +171,11 @@ phys_size_t initdram(int board_type)
 #else
        dram_size =  fsl_ddr_sdram_size();
 #endif
+
+#if defined(CONFIG_DEEP_SLEEP) && !defined(CONFIG_SPL_BUILD)
+       fsl_dp_resume();
+#endif
+
        return dram_size;
 }
 
index f08e54f178605f8ee7b867aea2eaf3988cb9917c..20eade46514114ee6432f0bedf4e10af7c99b060 100644 (file)
@@ -20,6 +20,7 @@
 #include <fsl_sec.h>
 #include <spl.h>
 
+#include "../common/sleep.h"
 #include "../common/qixis.h"
 #include "ls1021aqds_qixis.h"
 #ifdef CONFIG_U_QE
@@ -48,6 +49,12 @@ enum {
        MUX_TYPE_SD_PC_SG_SG,
 };
 
+enum {
+       GE0_CLK125,
+       GE2_CLK125,
+       GE1_CLK125,
+};
+
 int checkboard(void)
 {
 #ifndef CONFIG_QSPI_BOOT
@@ -177,7 +184,6 @@ int board_early_init_f(void)
 
 #ifdef CONFIG_TSEC_ENET
        out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
-       out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125);
 #endif
 
 #ifdef CONFIG_FSL_IFC
@@ -188,6 +194,24 @@ int board_early_init_f(void)
        out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
 #endif
 
+#ifdef CONFIG_FSL_DCU_FB
+       out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN);
+#endif
+
+       /*
+        * Enable snoop requests and DVM message requests for
+        * Slave insterface S4 (A7 core cluster)
+        */
+       out_le32(&cci->slave[4].snoop_ctrl,
+                CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
+
+       /*
+        * Set CCI-400 Slave interface S1, S2 Shareable Override Register
+        * All transactions are treated as non-shareable
+        */
+       out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+       out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+
        /* Workaround for the issue that DDR could not respond to
         * barrier transaction which is generated by executing DSB/ISB
         * instruction. Set CCI-400 control override register to
@@ -195,6 +219,11 @@ int board_early_init_f(void)
         * allow barrier transaction to DDR again */
        out_le32(&cci->ctrl_ord, CCI400_CTRLORD_TERM_BARRIER);
 
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
        return 0;
 }
 
@@ -219,9 +248,6 @@ void board_init_f(ulong dummy)
                 pinctl);
 #endif
 
-       /* Set global data pointer */
-       gd = &gdata;
-
        /* Clear the BSS */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -231,6 +257,11 @@ void board_init_f(ulong dummy)
 
        get_clocks();
 
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
        preloader_console_init();
 
 #ifdef CONFIG_SPL_I2C_SUPPORT
@@ -244,6 +275,32 @@ void board_init_f(ulong dummy)
 }
 #endif
 
+void config_etseccm_source(int etsec_gtx_125_mux)
+{
+       struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+
+       switch (etsec_gtx_125_mux) {
+       case GE0_CLK125:
+               out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE0_CLK125);
+               debug("etseccm set to GE0_CLK125\n");
+               break;
+
+       case GE2_CLK125:
+               out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125);
+               debug("etseccm set to GE2_CLK125\n");
+               break;
+
+       case GE1_CLK125:
+               out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE1_CLK125);
+               debug("etseccm set to GE1_CLK125\n");
+               break;
+
+       default:
+               printf("Error! trying to set etseccm to invalid value\n");
+               break;
+       }
+}
+
 int config_board_mux(int ctrl_type)
 {
        u8 reg12, reg14;
@@ -253,6 +310,7 @@ int config_board_mux(int ctrl_type)
 
        switch (ctrl_type) {
        case MUX_TYPE_CAN:
+               config_etseccm_source(GE2_CLK125);
                reg14 = SET_EC_MUX_SEL(reg14, PIN_MUX_SEL_CAN);
                break;
        case MUX_TYPE_IIC2:
@@ -262,6 +320,7 @@ int config_board_mux(int ctrl_type)
                reg14 = SET_EC_MUX_SEL(reg14, PIN_MUX_SEL_RGMII);
                break;
        case MUX_TYPE_SAI:
+               config_etseccm_source(GE2_CLK125);
                reg14 = SET_EC_MUX_SEL(reg14, PIN_MUX_SEL_SAI);
                break;
        case MUX_TYPE_SDHC:
@@ -474,13 +533,6 @@ int board_init(void)
        /* Set CCI-400 control override register to
         * enable barrier transaction */
        out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
-       /*
-        * Set CCI-400 Slave interface S0, S1, S2 Shareable Override Register
-        * All transactions are treated as non-shareable
-        */
-       out_le32(&cci->slave[0].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-       out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-       out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
 
        select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
 
@@ -503,6 +555,21 @@ int board_init(void)
        return 0;
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_sleep_prepare(void)
+{
+       struct ccsr_cci400 __iomem *cci = (void *)CONFIG_SYS_CCI400_ADDR;
+
+       /* Set CCI-400 control override register to
+        * enable barrier transaction */
+       out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
+
+#ifdef CONFIG_LS102XA_NS_ACCESS
+       enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev));
+#endif
+}
+#endif
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
index 09b3be2f9c2447a48b20a23553a9f2cba4af4f04..8e482eb0b075f07e7a197c08bb75c7549ec4bfce 100644 (file)
@@ -32,4 +32,6 @@
 
 #define QIXIS_SRDS1CLK_100             0x0
 
+#define QIXIS_DCU_BRDCFG5              0x55
+
 #endif
index 91767065faa36f0f2540d2263ea882305020fb55..e9f6f0a973a15ea6761a734b4690a0b3b028eb79 100644 (file)
@@ -5,5 +5,6 @@ F:      board/freescale/ls1021atwr/
 F:     include/configs/ls1021atwr.h
 F:     configs/ls1021atwr_nor_defconfig
 F:     configs/ls1021atwr_nor_SECURE_BOOT_defconfig
+F:     configs/ls1021atwr_nor_lpuart_defconfig
 F:     configs/ls1021atwr_sdcard_defconfig
 F:     configs/ls1021atwr_qspi_defconfig
index 8ab229ddf09040eafdb1a4289fac1d5504aa8fb1..bc8b00686c7c79831f6cf1ceb6b27ec04458909c 100644 (file)
@@ -263,6 +263,7 @@ int config_serdes_mux(void)
 int board_early_init_f(void)
 {
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
 
 #ifdef CONFIG_TSEC_ENET
        out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
@@ -281,15 +282,26 @@ int board_early_init_f(void)
        out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
 #endif
 
+       /*
+        * Enable snoop requests and DVM message requests for
+        * Slave insterface S4 (A7 core cluster)
+        */
+       out_le32(&cci->slave[4].snoop_ctrl,
+                CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
+
+       /*
+        * Set CCI-400 Slave interface S1, S2 Shareable Override Register
+        * All transactions are treated as non-shareable
+        */
+       out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+       out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+
        return 0;
 }
 
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
 {
-       /* Set global data pointer */
-       gd = &gdata;
-
        /* Clear the BSS */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -408,16 +420,6 @@ struct smmu_stream_id dev_stream_id[] = {
 
 int board_init(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
-
-       /*
-        * Set CCI-400 Slave interface S0, S1, S2 Shareable Override Register
-        * All transactions are treated as non-shareable
-        */
-       out_le32(&cci->slave[0].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-       out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-       out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-
 #ifndef CONFIG_SYS_FSL_NO_SERDES
        fsl_serdes_init();
 #ifndef CONFIG_QSPI_BOOT
diff --git a/board/freescale/mpc7448hpc2/Kconfig b/board/freescale/mpc7448hpc2/Kconfig
deleted file mode 100644 (file)
index 3e7f6e8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_MPC7448HPC2
-
-config SYS_BOARD
-       default "mpc7448hpc2"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "mpc7448hpc2"
-
-endif
diff --git a/board/freescale/mpc7448hpc2/MAINTAINERS b/board/freescale/mpc7448hpc2/MAINTAINERS
deleted file mode 100644 (file)
index 9966b55..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-MPC7448HPC2 BOARD
-M:     Roy Zang <tie-fei.zang@freescale.com>
-S:     Maintained
-F:     board/freescale/mpc7448hpc2/
-F:     include/configs/mpc7448hpc2.h
-F:     configs/mpc7448hpc2_defconfig
diff --git a/board/freescale/mpc7448hpc2/Makefile b/board/freescale/mpc7448hpc2/Makefile
deleted file mode 100644 (file)
index 2cc211b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2000
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  := mpc7448hpc2.o tsi108_init.o
-obj-y  += asm_init.o
diff --git a/board/freescale/mpc7448hpc2/README b/board/freescale/mpc7448hpc2/README
deleted file mode 100644 (file)
index cbb043e..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-Freescale MPC7448hpc2 (Taiga) board
-===================================
-
-Created 08/11/2006 Roy Zang
---------------------------
-MPC7448hpc2 (Taiga) board is a high-performance PowerPC server reference
-design, which is optimized for high speed throughput between the processor and
-the memory, disk drive and Ethernet port subsystems.
-
-MPC7448hpc2(Taiga) is designed to the micro-ATX chassis, allowing it to be
-used in 1U or 2U rack-mount chassis¡¯, as well as in standard ATX/Micro-ATX
-chassis.
-
-Building U-Boot
-------------------
-The mpc7448hpc2 code base is known to compile using:
-       Binutils 2.15, Gcc 3.4.3, Glibc 2.3.3
-
-       $ make mpc7448hpc2_config
-       Configuring for mpc7448hpc2 board...
-
-       $ make
-
-Memory Map
-----------
-
-The memory map is setup for Linux to operate properly.
-
-The mapping is:
-
-       Range Start     Range End       Definition                      Size
-
-       0x0000_0000     0x7fff_ffff     DDR                             2G
-       0xe000_0000     0xe7ff_ffff     PCI Memory                      128M
-       0xfa00_0000     0xfaff_ffff     PCI IO                          16M
-       0xfb00_0000     0xfbff_ffff     PCI Config                      16M
-       0xfc00_0000     0xfc0f_ffff     NVRAM/CADMUS                    1M
-       0xfe00_0000     0xfeff_ffff     PromJet                         16M
-       0xff00_0000     0xff80_0000     FLASH (boot flash)              8M
-       0xff80_0000     0xffff_ffff     FLASH (second half flash)       8M
-
-Using Flash
------------
-
-The MPC7448hpc2 board has two "banks" of flash, each 8MB in size
-(2^23 = 0x00800000).
-
-Note: the "bank" here refers to half of the flash. In fact, there is only one
-bank of flash, which is divided into low and high half. Each is controlled by
-the most significant bit of the address bus. The so called "bank" is only for
-convenience.
-
-There is a switch which allows the "bank" to be selected.  The switch
-settings for updating flash are given below.
-
-The u-boot commands for copying the boot-bank into the secondary bank are
-as follows:
-
-       erase ff800000 ff880000
-       cp.b ff000000 ff800000 80000
-
-U-boot commands for downloading an image via tftp and flashing
-it into the secondary bank:
-
-       tftp 10000 <u-boot.bin.image>
-       erase ff000000 ff080000
-       cp.b 10000 ff000000 80000
-
-After copying the image into the second bank of flash, be sure to toggle
-SW3[4] on board before resetting the board in order to set the
-secondary bank as the boot-bank.
-
-Board Switches
-----------------------
-
-Most switches on the board should not be changed.  The most frequent
-user-settable switches on the board are used to configure
-the flash banks and determining the PCI frequency.
-
-SW1[1-5]: Processor core voltage
-
-       12345           Core Voltage
-       -----
-       SW1=01111       1.000V.
-       SW1=01101       1.100V.
-       SW1=01011       1.200V.
-       SW1=01001       1.300V only for MPC7447A.
-
-
-SW2[1-6]: CPU core frequency
-
-               CPU Core Frequency (MHz)
-                       Bus Frequency
-       123456          100     133     167     200     Ratio
-
-       ------
-       SW2=101100      500     667     833     1000    5x
-       SW2=100100      550     733     917     1100    5.5x
-       SW2=110100      600     800     1000    1200    6x
-       SW2=010100      650     866     1083    1300    6.5x
-       SW2=001000      700     930     1167    1400    7x
-       SW2=000100      750     1000    1250    1500    7.5x
-       SW2=110000      800     1066    1333    1600    8x
-       SW2=011000      850     1333    1417    1700    8.5x only for MPC7447A
-       SW2=011110      900     1200    1500    1800    9x
-
-This table shows only a subset of available frequency options; see the CPU
-hardware specifications for more information.
-
-SW2[7-8]: Bus Protocol and CPU Reset Option
-
-       7
-       -
-       SW2=0           System bus uses MPX bus protocol
-       SW2=1           System bus uses 60x bus protocol
-
-       8
-       -
-       SW2=0           TSI108 can cause CPU reset
-       SW2=1           TSI108 can not cause CPU reset
-
-SW3[1-8] system options
-
-       123
-       ---
-       SW3=xxx         Connected to GPIO[0:2] on TSI108
-
-       4
-       -
-       SW3=0           CPU boots from low half of flash
-       SW3=1           CPU boots from high half of flash
-
-       5
-       -
-       SW3=0           SATA and slot2 connected to PCI bus
-       SW3=1           Only slot1 connected to PCI bus
-
-       6
-       -
-       SW3=0           USB connected to PCI bus
-       SW3=1           USB disconnected from PCI bus
-
-       7
-       -
-       SW3=0           Flash is write protected
-       SW3=1           Flash is NOT write protected
-
-       8
-       -
-       SW3=0           CPU will boot from flash
-       SW3=1           CPU will boot from PromJet
-
-SW4[1-3]: System bus frequency
-
-                       Bus Frequency (MHz)
-       ---
-       SW4=010                 183
-       SW4=011                 100
-       SW4=100                 133
-       SW4=101                 166 only for MPC7447A
-       SW4=110                 200 only for MPC7448
-       others                  reserved
-
-SW4[4-6]: DDR2 SDRAM frequency
-
-                       Bus Frequency (MHz)
-       ---
-       SW4=000         external clock
-       SW4=011         system clock
-       SW4=100         133
-       SW4=101         166
-       SW4=110         200
-       others          reserved
-
-SW4[7-8]: PCI/PCI-X frequency control
-       7
-       -
-       SW4=0           PCI/PCI-X bus operates normally
-       SW4=1           PCI bus forced to PCI-33 mode
-
-       8
-       -
-       SW4=0           PCI-X mode at 133 MHz allowed
-       SW4=1           PCI-X mode limited to 100 MHz
diff --git a/board/freescale/mpc7448hpc2/asm_init.S b/board/freescale/mpc7448hpc2/asm_init.S
deleted file mode 100644 (file)
index 70315c3..0000000
+++ /dev/null
@@ -1,905 +0,0 @@
-/*
- * (C) Copyright 2004-05;  Tundra Semiconductor Corp.
- *
- * Added automatic detect of SDC settings
- * Copyright (c) 2005 Freescale Semiconductor, Inc.
- * Maintainer tie-fei.zang@freescale.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * FILENAME: asm_init.s
- *
- * Originator: Alex Bounine
- *
- * DESCRIPTION:
- * Initialization code for the Tundra Tsi108 bridge chip
- *
- */
-
-#include <config.h>
-#include <version.h>
-
-#include <ppc_asm.tmpl>
-#include <ppc_defs.h>
-#include <asm/processor.h>
-
-#include <tsi108.h>
-
-/*
- * Build Configuration Options
- */
-
-/* #define DISABLE_PBM         disables usage of PB Master */
-/* #define SDC_HARDCODED_INIT  config SDRAM controller with hardcoded values */
-/* #define SDC_AUTOPRECH_EN    enable SDRAM auto precharge */
-
-/*
- * Hardcoded SDC settings
- */
-
-#ifdef SDC_HARDCODED_INIT
-
-/* Micron MT9HTF6472AY-40EA1 : Unbuffered, 512MB, 400, CL3, Single Rank */
-
-#define VAL_SD_REFRESH (0x61A)
-#define VAL_SD_TIMING  (0x0308336b)
-#define VAL_SD_D0_CTRL (0x07100021)    /* auto-precharge disabled */
-#define VAL_SD_D0_BAR  (0x0FE00000)    /* 512MB @ 0x00000000 */
-#define VAL_SD_D1_CTRL (0x07100021)    /* auto-precharge disabled */
-#define VAL_SD_D1_BAR  (0x0FE00200)    /* 512MB @ 0x20000000 */
-
-#endif /* SDC_HARDCODED_INIT */
-
-/*
- CPU Configuration:
-
- CPU Address and Data Parity enables.
-
-#define CPU_AP
-#define CPU_DP
-*/
-
-/*
- * Macros
- * !!! Attention !!! Macros LOAD_PTR, LOAD_U32 and LOAD_MEM defined below are
- * expected to work correctly for the CSR space within 32KB range.
- *
- * LOAD_PTR and LOAD_U32 - load specified register with a 32 bit constant.
- * These macros are absolutely identical except their names. This difference
- * is provided intentionally for better readable code.
- */
-
-#define LOAD_PTR(reg,const32) \
-       addis reg,r0,const32@h; ori reg,reg,const32@l
-
-#define LOAD_U32(reg,const32) \
-       addis reg,r0,const32@h; ori reg,reg,const32@l
-
-/* LOADMEM initializes a register with the contents of a specified 32-bit
- * memory location, usually a CSR value.
- */
-
-#define LOAD_MEM(reg,addr32) \
-       addis reg,r0,addr32@ha; lwz reg,addr32@l(reg)
-
-#ifndef SDC_HARDCODED_INIT
-sdc_clk_sync:
-       /* MHz: 0,0,183,100,133,167,200,233 */
-       .long   0, 0, 6, 10, 8, 6, 5, 4         /* nSec */
-#endif
-
-/*
- * board_asm_init() - early initialization function. Coded to be portable to
- * dual-CPU configuration.
- * Checks CPU number and performs board HW initialization if called for CPU0.
- * Registers used: r3,r4,r5,r6,r19,r29
- *
- * NOTE: For dual-CPU configuration only CPU0 is allowed to configure Tsi108
- * and the rest of the board. Current implementation demonstrates two
- * possible ways to identify CPU number:
- * - for MPC74xx platform: uses MSSCR0[ID] bit as defined in UM.
- * - for PPC750FX/GX boards: uses WHO_AM_I bit reported by Tsi108.
- */
-
-       .globl board_asm_init
-board_asm_init:
-       mflr    r19     /* Save LR to be able return later. */
-       bl      icache_enable   /* Enable icache to reduce reads from flash. */
-
-/* Initialize pointer to Tsi108 register space */
-
-       LOAD_PTR(r29,CONFIG_SYS_TSI108_CSR_RST_BASE)/* r29 - pointer to tsi108 CSR space */
-       ori r4,r29,TSI108_PB_REG_OFFSET
-
-/* Check Processor Version Number */
-
-       mfspr   r3, PVR
-       rlwinm  r3,r3,16,16,23  /* get ((Processor Version Number) & 0xFF00) */
-
-       cmpli   0,0,r3,0x8000   /* MPC74xx */
-       bne     cont_brd_init
-
-       /*
-        * For MPC744x/5x enable extended BATs[4-7]
-        * Sri: Set HIGH_BAT_EN and XBSEN, and SPD =1
-        * to disable prefetch
-        */
-
-       mfspr   r5, HID0
-       oris    r5, r5, 0x0080  /* Set HID0[HIGH_BAT_EN] bit #8 */
-       ori     r5, r5, 0x0380  /* Set SPD,XBSEN,SGE bits #22,23,24 */
-       mtspr   HID0, r5
-       isync
-       sync
-
-       /* Adding code to disable external interventions in MPX bus mode */
-       mfspr   r3, 1014
-       oris    r3, r3, 0x0100  /* Set the EIDIS bit in MSSCR0:  bit 7 */
-       mtspr   1014, r3
-       isync
-       sync
-
-       /* Sri: code to enable FP unit */
-       mfmsr   r3
-       ori     r3, r3, 0x2000
-       mtmsr   r3
-       isync
-       sync
-
-       /* def CONFIG_DUAL_CPU
-        * For MPC74xx processor, use MSSCR0[ID] bit to identify CPU number.
-        */
-#if(1)
-       mfspr   r3,1014         /* read MSSCR0 */
-       rlwinm. r3,r3,27,31,31  /* get processor ID number */
-       mtspr   SPRN_PIR,r3     /* Save CPU ID */
-       sync
-       bne     init_done
-       b       do_tsi108_init
-
-cont_brd_init:
-
-       /* An alternative method of checking the processor number (in addition
-        * to configuration using MSSCR0[ID] bit on MPC74xx).
-        * Good for IBM PPC750FX/GX.
-        */
-
-       lwz     r3,PB_BUS_MS_SELECT(r4) /* read PB_ID register */
-       rlwinm. r3,r3,24,31,31          /* get processor ID number */
-       bne init_done
-#else
-
-cont_brd_init:
-
-#endif /* CONFIG_DUAL_CPU */
-
-       /* Initialize Tsi108 chip */
-
-do_tsi108_init:
-
-       /*
-        * Adjust HLP/Flash parameters. By default after reset the HLP port is
-        * set to support slow devices. Better performance can be achived when
-        * an optimal parameters are used for specific EPROM device.
-        * NOTE: This should be performed ASAP for the emulation platform
-        * because it has 5MHz HLP clocking.
-        */
-
-#ifdef CONFIG_TSI108EMU
-       ori     r4,r29,TSI108_HLP_REG_OFFSET
-       LOAD_U32(r5,0x434422c0)
-       stw     r5,0x08(r4)     /* set HLP B0_CTRL0 */
-       sync
-       LOAD_U32(r5,0xd0012000)
-       stw     r5,0x0c(r4)             /* set HLP B0_CTRL1 */
-       sync
-#endif
-
-       /* Initialize PB interface. */
-
-       ori r4,r29,TSI108_PB_REG_OFFSET
-
-#if (CONFIG_SYS_TSI108_CSR_BASE != CONFIG_SYS_TSI108_CSR_RST_BASE)
-       /* Relocate (if required) Tsi108 registers. Set new value for
-        * PB_REG_BAR:
-        * Note we are in the 32-bit address mode.
-        */
-       LOAD_U32(r5,(CONFIG_SYS_TSI108_CSR_BASE | 0x01)) /* PB_REG_BAR: BA + EN */
-       stw     r5,PB_REG_BAR(r4)
-       andis.  r29,r5,0xFFFF
-       sync
-       ori     r4,r29,TSI108_PB_REG_OFFSET
-#endif
-
-       /* Set PB Slave configuration register */
-
-       LOAD_U32(r5,0x00002481) /* PB_SCR: TEA enabled,AACK delay = 1 */
-       lwz     r3, PB_RSR(r4)  /* get PB bus mode */
-       xori    r3,r3,0x0001    /* mask PB_BMODE: r3 -> (0 = 60X, 1 = MPX) */
-       rlwimi  r5,r3,14,17,17  /* for MPX: set DTI_MODE bit */
-       stw     r5,PB_SCR(r4)
-       sync
-
-       /* Configure PB Arbiter */
-
-       lwz     r5,PB_ARB_CTRL(r4)      /* Read PB Arbiter Control Register */
-       li      r3, 0x00F0              /* ARB_PIPELINE_DEP mask */
-#ifdef DISABLE_PBM
-       ori     r3,r3,0x1000    /* add PBM_EN to clear (enabled by default) */
-#endif
-       andc    r5,r5,r3        /* Clear the masked bit fields */
-       ori     r5,r5,0x0001    /* Set pipeline depth */
-       stw     r5,PB_ARB_CTRL(r4)
-
-#if (0)        /* currently using the default settings for PBM after reset */
-       LOAD_U32(r5,0x)         /* value for PB_MCR */
-       stw     r5,PB_MCR(r4)
-       sync
-
-       LOAD_U32(r5,0x)         /* value for PB_MCMD */
-       stw     r5,PB_MCMD(r4)
-       sync
-#endif
-
-       /* Disable or enable PVT based on processor bus frequency
-        * 1. Read CG_PWRUP_STATUS register field bits 18,17,16
-        * 2. See if the value is < or > 133mhz (18:16 = 100)
-        * 3. If > enable PVT
-        */
-
-       LOAD_U32(r3,0xC0002234)
-       lwz     r3,0(r3)
-       rlwinm  r3,r3,16,29,31
-
-       cmpi    0,0,r3,0x0004
-       bgt     sdc_init
-
-#ifndef CONFIG_TSI108EMU
-       /* FIXME: Disable PB calibration control for any real Tsi108 board */
-       li      r5,0x0101       /* disable calibration control */
-       stw     r5,PB_PVT_CTRL2(r4)
-       sync
-#endif
-
-       /* Initialize SDRAM controller. */
-
-sdc_init:
-
-#ifndef SDC_HARDCODED_INIT
-       /* get SDC clock prior doing sdram controller autoconfig */
-       ori     r4,r29,TSI108_CLK_REG_OFFSET    /* r4 - ptr to CG registers */
-       lwz     r3, CG_PWRUP_STATUS(r4)         /* get CG configuration */
-       rlwinm  r3,r3,12,29,31                  /* r3 - SD clk */
-       lis     r5,sdc_clk_sync@h
-       ori     r5,r5,sdc_clk_sync@l
-       /* Sri:  At this point check if r3 = 001. If yes,
-        * the memory frequency should be same as the
-        * MPX bus frequency
-        */
-       cmpi    0,0,r3,0x0001
-       bne     get_nsec
-       lwz     r6, CG_PWRUP_STATUS(r4)
-       rlwinm  r6,r6,16,29,31
-       mr      r3,r6
-
-get_nsec:
-       rlwinm  r3,r3,2,0,31
-       lwzx    r9,r5,r3        /* get SD clk rate in nSec */
-       /* ATTN: r9 will be used by SPD routine */
-#endif /* !SDC_HARDCODED_INIT */
-
-       ori     r4,r29,TSI108_SD_REG_OFFSET /* r4 - ptr to SDRAM registers */
-
-       /* Initialize SDRAM controller. SDRAM Size = 512MB, One DIMM. */
-
-       LOAD_U32(r5,0x00)
-       stw     r5,SD_INT_ENABLE(r4) /* Ensure that interrupts are disabled */
-#ifdef ENABLE_SDRAM_ECC
-       li      r5, 0x01
-#endif /* ENABLE_SDRAM_ECC */
-       stw     r5,SD_ECC_CTRL(r4)      /* Enable/Disable ECC */
-       sync
-
-#ifdef SDC_HARDCODED_INIT /* config sdram controller with hardcoded values */
-
-       /* First read the CG_PWRUP_STATUS register to get the
-        * memory speed from bits 22,21,20
-        */
-
-       LOAD_U32(r3,0xC0002234)
-       lwz     r3,0(r3)
-       rlwinm  r3,r3,12,29,31
-
-       /* Now first check for 166, then 200, or default */
-
-       cmpi    0,0,r3,0x0005
-       bne     check_for_200mhz
-
-       /* set values for 166 Mhz memory speed
-        * Set refresh rate and timing parameters
-        */
-       LOAD_U32(r5,0x00000515)
-       stw     r5,SD_REFRESH(r4)
-       LOAD_U32(r5,0x03073368)
-       stw     r5,SD_TIMING(r4)
-       sync
-
-       /* Initialize DIMM0 control and BAR registers */
-       LOAD_U32(r5,VAL_SD_D0_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001            /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D0_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D0_BAR)
-       stw     r5,SD_D0_BAR(r4)
-       sync
-
-       /* Initialize DIMM1 control and BAR registers
-        * (same as dimm 0, next 512MB, disabled)
-        */
-       LOAD_U32(r5,VAL_SD_D1_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001    /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D1_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D1_BAR)
-       stw     r5,SD_D1_BAR(r4)
-       sync
-
-       b       sdc_init_done
-
-check_for_200mhz:
-
-       cmpi    0,0,r3,0x0006
-       bne     set_default_values
-
-       /* set values for 200Mhz memory speed
-        * Set refresh rate and timing parameters
-        */
-       LOAD_U32(r5,0x0000061a)
-       stw     r5,SD_REFRESH(r4)
-       LOAD_U32(r5,0x03083348)
-       stw     r5,SD_TIMING(r4)
-       sync
-
-       /* Initialize DIMM0 control and BAR registers */
-       LOAD_U32(r5,VAL_SD_D0_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001            /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D0_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D0_BAR)
-       stw     r5,SD_D0_BAR(r4)
-       sync
-
-       /* Initialize DIMM1 control and BAR registers
-        * (same as dimm 0, next 512MB, disabled)
-        */
-       LOAD_U32(r5,VAL_SD_D1_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001            /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D1_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D1_BAR)
-       stw     r5,SD_D1_BAR(r4)
-       sync
-
-       b       sdc_init_done
-
-set_default_values:
-
-       /* Set refresh rate and timing parameters */
-       LOAD_U32(r5,VAL_SD_REFRESH)
-       stw     r5,SD_REFRESH(r4)
-       LOAD_U32(r5,VAL_SD_TIMING)
-       stw     r5,SD_TIMING(r4)
-       sync
-
-       /* Initialize DIMM0 control and BAR registers */
-       LOAD_U32(r5,VAL_SD_D0_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001            /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D0_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D0_BAR)
-       stw     r5,SD_D0_BAR(r4)
-       sync
-
-       /* Initialize DIMM1 control and BAR registers
-        * (same as dimm 0, next 512MB, disabled)
-        */
-       LOAD_U32(r5,VAL_SD_D1_CTRL)     /* auto-precharge disabled */
-#ifdef SDC_AUTOPRECH_EN
-       oris    r5,r5,0x0001            /* set auto precharge EN bit */
-#endif
-       stw     r5,SD_D1_CTRL(r4)
-       LOAD_U32(r5,VAL_SD_D1_BAR)
-       stw     r5,SD_D1_BAR(r4)
-       sync
-#else /* !SDC_HARDCODED_INIT */
-       bl      tsi108_sdram_spd        /* automatically detect SDC settings */
-#endif /* SDC_HARDCODED_INIT */
-
-sdc_init_done:
-
-#ifdef DISABLE_PBM
-       LOAD_U32(r5,0x00000030)         /* PB_EN + OCN_EN */
-#else
-       LOAD_U32(r5,0x00000230)         /* PB_EN + OCN_EN + PB/OCN=80/20 */
-#endif /* DISABLE_PBM */
-
-#ifdef CONFIG_TSI108EMU
-       oris    r5,r5,0x0010            /* set EMULATION_MODE bit */
-#endif
-
-       stw     r5,SD_CTRL(r4)
-       eieio
-       sync
-
-       /* Enable SDRAM access */
-
-       oris    r5,r5,0x8000            /* start SDC: set SD_CTRL[ENABLE] bit */
-       stw     r5,SD_CTRL(r4)
-       sync
-
-wait_init_complete:
-       lwz     r5,SD_STATUS(r4)
-       andi.   r5,r5,0x0001
-       /* wait until SDRAM initialization is complete */
-       beq     wait_init_complete
-
-       /* Map SDRAM into the processor bus address space */
-
-       ori     r4,r29,TSI108_PB_REG_OFFSET
-
-       /* Setup BARs associated with direct path PB<->SDRAM */
-
-       /* PB_SDRAM_BAR1:
-        * provides a direct path to the main system memory (cacheable SDRAM)
-        */
-
-       /* BA=0,Size=512MB, ENable, No Addr.Translation */
-       LOAD_U32(r5, 0x00000011)
-       stw     r5,PB_SDRAM_BAR1(r4)
-       sync
-
-       /* Make sure that PB_SDRAM_BAR1 decoder is set
-        * (to allow following immediate read from SDRAM)
-        */
-       lwz     r5,PB_SDRAM_BAR1(r4)
-       sync
-
-       /* PB_SDRAM_BAR2:
-        * provides non-cacheable alias (via the direct path) to main
-        * system memory.
-        * Size = 512MB, ENable, Addr.Translation - ON,
-        * BA = 0x0_40000000, TA = 0x0_00000000
-        */
-
-       LOAD_U32(r5, 0x40010011)
-       stw     r5,PB_SDRAM_BAR2(r4)
-       sync
-
-       /* Make sure that PB_SDRAM_BAR2 decoder is set
-        * (to allow following immediate read from SDRAM)
-        */
-       lwz     r5,PB_SDRAM_BAR2(r4)
-       sync
-
-init_done:
-
-       /* All done. Restore LR and return. */
-       mtlr    r19
-       blr
-
-#if (0)
-       /*
-        * init_cpu1
-        * This routine enables CPU1 on the dual-processor system.
-        * Now there is only one processor in the system
-        */
-
-       .global enable_cpu1
-enable_cpu1:
-
-       lis     r3,Tsi108_Base@ha       /* Get Grendel CSR Base Addr */
-       addi    r3,r3,Tsi108_Base@l
-       lwz     r3,0(r3)                /* R3 = CSR Base Addr */
-       ori     r4,r3,TSI108_PB_REG_OFFSET
-       lwz     r3,PB_ARB_CTRL(r4)      /* Read PB Arbiter Control Register */
-       ori     r3,r3,0x0200            /* Set M1_EN bit */
-       stw     r3,PB_ARB_CTRL(r4)
-
-       blr
-#endif
-
-       /*
-        * enable_EI
-        * Enable CPU core external interrupt
-        */
-
-       .global enable_EI
-enable_EI:
-       mfmsr   r3
-       ori     r3,r3,0x8000    /* set EE bit */
-       mtmsr   r3
-       blr
-
-       /*
-        * disable_EI
-        * Disable CPU core external interrupt
-        */
-
-       .global disable_EI
-disable_EI:
-       mfmsr   r3
-       li      r4,-32768       /* aka "li  r4,0x8000" */
-       andc    r3,r3,r4        /* clear EE bit */
-       mtmsr   r3
-       blr
-
-#ifdef ENABLE_SDRAM_ECC
-       /* enables SDRAM ECC  */
-
-       .global enable_ECC
-enable_ECC:
-       ori     r4,r29,TSI108_SD_REG_OFFSET
-       lwz     r3,SD_ECC_CTRL(r4)      /* Read SDRAM ECC Control Register */
-       ori     r3,r3,0x0001            /* Set ECC_EN bit */
-       stw     r3,SD_ECC_CTRL(r4)
-       blr
-
-       /*
-        * clear_ECC_err
-        * Clears all pending SDRAM ECC errors
-        * (normally after SDRAM scrubbing/initialization)
-        */
-
-       .global clear_ECC_err
-clear_ECC_err:
-       ori r4,r29,TSI108_SD_REG_OFFSET
-       ori r3,r0,0x0030        /* ECC_UE_INT + ECC_CE_INT bits */
-       stw r3,SD_INT_STATUS(r4)
-       blr
-
-#endif /* ENABLE_SDRAM_ECC */
-
-#ifndef SDC_HARDCODED_INIT
-
-       /* SDRAM SPD Support */
-#define        SD_I2C_CTRL1    (0x400)
-#define        SD_I2C_CTRL2    (0x404)
-#define SD_I2C_RD_DATA (0x408)
-#define SD_I2C_WR_DATA (0x40C)
-
-       /*
-        * SDRAM SPD Support Macros
-        */
-
-#define SPD_DIMM0      (0x00000100)
-#define SPD_DIMM1      (0x00000200)    /* SPD_DIMM1 was 0x00000000 */
-
-#define SPD_RDIMM                      (0x01)
-#define SPD_UDIMM                      (0x02)
-
-#define SPD_CAS_3                      0x8
-#define SPD_CAS_4                      0x10
-#define SPD_CAS_5                      0x20
-
-#define ERR_NO_DIMM_FOUND              (0xdb0)
-#define ERR_TRAS_FAIL                  (0xdb1)
-#define ERR_TRCD_FAIL                  (0xdb2)
-#define ERR_TRP_FAIL                   (0xdb3)
-#define ERR_TWR_FAIL                   (0xdb4)
-#define ERR_UNKNOWN_PART               (0xdb5)
-#define ERR_NRANK_INVALID              (0xdb6)
-#define ERR_DIMM_SIZE                  (0xdb7)
-#define ERR_ADDR_MODE                  (0xdb8)
-#define ERR_RFRSH_RATE                 (0xdb9)
-#define ERR_DIMM_TYPE                  (0xdba)
-#define ERR_CL_VALUE                   (0xdbb)
-#define ERR_TRFC_FAIL                  (0xdbc)
-
-/* READ_SPD requirements:
- * byte - byte address in SPD device (0 - 255)
- * r3 = will return data read from I2C Byte location
- * r4 - unchanged (SDC base addr)
- * r5 - clobbered in routine (I2C status)
- * r10 - number of DDR slot where first SPD device is detected
- */
-
-#define READ_SPD(byte_num)             \
-       addis   r3, 0, byte_num@l;      \
-       or      r3, r3, r10;            \
-       ori     r3, r3, 0x0A;           \
-       stw     r3, SD_I2C_CTRL1(r4);   \
-       li      r3, I2C_CNTRL2_START;   \
-       stw     r3, SD_I2C_CTRL2(r4);   \
-       eieio;                          \
-       sync;                           \
-       li      r3, 0x100;              \
-1:;                                    \
-       addic.  r3, r3, -1;             \
-       bne     1b;                     \
-2:;                                    \
-       lwz     r5, SD_I2C_CTRL2(r4);   \
-       rlwinm. r3,r5,0,23,23;          \
-       bne     2b;                     \
-       rlwinm. r3,r5,0,3,3;            \
-       lwz     r3,SD_I2C_RD_DATA(r4)
-
-#define SPD_MIN_RFRSH  (0x80)
-#define SPD_MAX_RFRSH  (0x85)
-
-refresh_rates: /* in nSec */
-       .long   15625   /* Normal (0x80) */
-       .long   3900    /* Reduced 0.25x (0x81) */
-       .long   7800    /* Reduced 0.5x (0x82) */
-       .long   31300   /* Extended 2x (0x83) */
-       .long   62500   /* Extended 4x (0x84) */
-       .long   125000  /* Extended 8x (0x85) */
-
-/*
- * tsi108_sdram_spd
- *
- * Inittializes SDRAM Controller using DDR2 DIMM Serial Presence Detect data
- * Uses registers: r4 - SDC base address (not changed)
- *                                r9 - SDC clocking period in nSec
- * Changes registers: r3,r5,r6,r7,r8,r10,r11
- */
-
-tsi108_sdram_spd:
-
-       li      r10,SPD_DIMM0
-       xor     r11,r11,r11             /* DIMM Base Address: starts from 0 */
-
-do_first_dimm:
-
-       /* Program Refresh Rate Register */
-
-       READ_SPD(12)                    /* get Refresh Rate */
-       beq     check_next_slot
-       li      r5, ERR_RFRSH_RATE
-       cmpi    0,0,r3,SPD_MIN_RFRSH
-       ble     spd_fail
-       cmpi    0,0,r3,SPD_MAX_RFRSH
-       bgt     spd_fail
-       addi    r3,r3,-SPD_MIN_RFRSH
-       rlwinm  r3,r3,2,0,31
-       lis     r5,refresh_rates@h
-       ori     r5,r5,refresh_rates@l
-       lwzx    r5,r5,r3                /* get refresh rate in nSec */
-       divwu   r5,r5,r9                /* calculate # of SDC clocks */
-       stw     r5,SD_REFRESH(r4)       /* Set refresh rate */
-       sync
-
-       /* Program SD Timing Register */
-
-       li      r7, 0           /* clear r7 prior parameter collection */
-
-       READ_SPD(20)            /* get DIMM type: Registered or Unbuffered */
-       beq     spd_read_fail
-       li      r5, ERR_DIMM_TYPE
-       cmpi    0,0,r3,SPD_UDIMM
-       beq     do_cl
-       cmpi    0,0,r3,SPD_RDIMM
-       bne     spd_fail
-       oris    r7,r7,0x1000    /* set SD_TIMING[DIMM_TYPE] bit */
-
-do_cl:
-       READ_SPD(18)            /* Get CAS Latency */
-       beq     spd_read_fail
-       li      r5,ERR_CL_VALUE
-       andi.   r6,r3,SPD_CAS_3
-       beq     cl_4
-       li      r6,3
-       b       set_cl
-cl_4:
-       andi.   r6,r3,SPD_CAS_4
-       beq     cl_5
-       li      r6,4
-       b       set_cl
-cl_5:
-       andi.   r6,r3,SPD_CAS_5
-       beq     spd_fail
-       li      r6,5
-set_cl:
-       rlwimi  r7,r6,24,5,7
-
-       READ_SPD(30)            /* Get tRAS */
-       beq     spd_read_fail
-       divwu   r6,r3,r9
-       mullw   r8,r6,r9
-       subf.   r8,r8,r3
-       beq     set_tras
-       addi    r6,r6,1
-set_tras:
-       li r5,ERR_TRAS_FAIL
-       cmpi    0,0,r6,0x0F     /* max supported value */
-       bgt     spd_fail
-       rlwimi  r7,r6,16,12,15
-
-       READ_SPD(29)    /* Get tRCD */
-       beq     spd_read_fail
-       /* right shift tRCD by 2 bits as per DDR2 spec */
-       rlwinm  r3,r3,30,2,31
-       divwu   r6,r3,r9
-       mullw   r8,r6,r9
-       subf.   r8,r8,r3
-       beq     set_trcd
-       addi    r6,r6,1
-set_trcd:
-       li      r5,ERR_TRCD_FAIL
-       cmpi    0,0,r6,0x07     /* max supported value */
-       bgt     spd_fail
-       rlwimi  r7,r6,12,17,19
-
-       READ_SPD(27)    /* Get tRP value */
-       beq     spd_read_fail
-       rlwinm  r3,r3,30,2,31   /* right shift tRP by 2 bits as per DDR2 spec */
-       divwu   r6,r3,r9
-       mullw   r8,r6,r9
-       subf.   r8,r8,r3
-       beq     set_trp
-       addi    r6,r6,1
-set_trp:
-       li      r5,ERR_TRP_FAIL
-       cmpi    0,0,r6,0x07     /* max supported value */
-       bgt     spd_fail
-       rlwimi  r7,r6,8,21,23
-
-       READ_SPD(36)    /* Get tWR value */
-       beq     spd_read_fail
-       rlwinm  r3,r3,30,2,31   /* right shift tWR by 2 bits as per DDR2 spec */
-       divwu   r6,r3,r9
-       mullw   r8,r6,r9
-       subf.   r8,r8,r3
-       beq     set_twr
-       addi    r6,r6,1
-set_twr:
-       addi    r6,r6,-1        /* Tsi108 SDC always gives one extra clock */
-       li      r5,ERR_TWR_FAIL
-       cmpi    0,0,r6,0x07     /* max supported value */
-       bgt     spd_fail
-       rlwimi  r7,r6,5,24,26
-
-       READ_SPD(42)    /* Get tRFC */
-       beq     spd_read_fail
-       li      r5, ERR_TRFC_FAIL
-       /* Tsi108 spec: tRFC=(tRFC + 1)/2 */
-       addi    r3,r3,1
-       rlwinm. r3,r3,31,1,31   /* divide by 2 */
-       beq     spd_fail
-       divwu   r6,r3,r9
-       mullw   r8,r6,r9
-       subf.   r8,r8,r3
-       beq     set_trfc
-       addi    r6,r6,1
-set_trfc:
-       cmpi    0,0,r6,0x1F     /* max supported value */
-       bgt     spd_fail
-       rlwimi  r7,r6,0,27,31
-
-       stw     r7,SD_TIMING(r4)
-       sync
-
-       /*
-        * The following two registers are set on per-DIMM basis.
-        * The SD_REFRESH and SD_TIMING settings are common for both DIMMS
-        */
-
-do_each_dimm:
-
-       /* Program SDRAM DIMM Control Register */
-
-       li      r7, 0           /* clear r7 prior parameter collection */
-
-       READ_SPD(13)            /* Get Primary SDRAM Width */
-       beq     spd_read_fail
-       cmpi    0,0,r3,4        /* Check for 4-bit SDRAM */
-       beq     do_nbank
-       oris    r7,r7,0x0010    /* Set MEM_WIDTH bit */
-
-do_nbank:
-       READ_SPD(17)            /* Get Number of banks on SDRAM device */
-       beq     spd_read_fail
-       /* Grendel only distinguish betw. 4 or 8-bank memory parts */
-       li      r5,ERR_UNKNOWN_PART     /* non-supported memory part */
-       cmpi    0,0,r3,4
-       beq     do_nrank
-       cmpi    0,0,r3,8
-       bne     spd_fail
-       ori     r7,r7,0x1000
-
-do_nrank:
-       READ_SPD(5)             /* Get # of Ranks */
-       beq     spd_read_fail
-       li      r5,ERR_NRANK_INVALID
-       andi.   r6,r3,0x7       /* Use bits [2..0] only */
-       beq     do_addr_mode
-       cmpi    0,0,r6,1
-       bgt     spd_fail
-       rlwimi  r7,r6,8,23,23
-
-do_addr_mode:
-       READ_SPD(4)             /* Get # of Column Addresses */
-       beq     spd_read_fail
-       li      r5, ERR_ADDR_MODE
-       andi.   r3,r3,0x0f      /* cut off reserved bits */
-       cmpi    0,0,r3,8
-       ble     spd_fail
-       cmpi    0,0,r3,15
-       bgt     spd_fail
-       addi    r6,r3,-8        /* calculate ADDR_MODE parameter */
-       rlwimi  r7,r6,4,24,27   /* set ADDR_MODE field */
-
-set_dimm_ctrl:
-#ifdef SDC_AUTOPRECH_EN
-       oris    r7,r7,0x0001    /* set auto precharge EN bit */
-#endif
-       ori     r7,r7,1         /* set ENABLE bit */
-       cmpi    0,0,r10,SPD_DIMM0
-       bne     1f
-       stw     r7,SD_D0_CTRL(r4)
-       sync
-       b       set_dimm_bar
-1:
-       stw     r7,SD_D1_CTRL(r4)
-       sync
-
-
-       /* Program SDRAM DIMMx Base Address Register */
-
-set_dimm_bar:
-       READ_SPD(5)             /* get # of Ranks */
-       beq     spd_read_fail
-       andi.   r7,r3,0x7
-       addi    r7,r7,1
-       READ_SPD(31)            /* Read DIMM rank density */
-       beq     spd_read_fail
-       rlwinm  r5,r3,27,29,31
-       rlwinm  r6,r3,3,24,28
-       or      r5,r6,r5        /* r5 = Normalized Rank Density byte */
-       lis     r8, 0x0080      /* 128MB >> 4 */
-       mullw   r8,r8,r5        /* r8 = (rank_size >> 4) */
-       mullw   r8,r8,r7        /* r8 = (DIMM_size >> 4) */
-       neg     r7,r8
-       rlwinm  r7,r7,28,4,31
-       or      r7,r7,r11       /* set ADDR field */
-       rlwinm  r8,r8,12,20,31
-       add     r11,r11,r8      /* set Base Addr for next DIMM */
-
-       cmpi    0,0,r10,SPD_DIMM0
-       bne     set_dimm1_size
-       stw     r7,SD_D0_BAR(r4)
-       sync
-       li      r10,SPD_DIMM1
-       READ_SPD(0)
-       bne do_each_dimm
-       b spd_done
-
-set_dimm1_size:
-       stw     r7,SD_D1_BAR(r4)
-       sync
-spd_done:
-       blr
-
-check_next_slot:
-       cmpi    0,0,r10,SPD_DIMM1
-       beq     spd_read_fail
-       li      r10,SPD_DIMM1
-       b       do_first_dimm
-spd_read_fail:
-       ori     r3,r0,0xdead
-       b       err_hung
-spd_fail:
-       li      r3,0x0bad
-       sync
-err_hung:      /* hang here for debugging */
-       nop
-       nop
-       b       err_hung
-
-#endif /* !SDC_HARDCODED_INIT */
diff --git a/board/freescale/mpc7448hpc2/config.mk b/board/freescale/mpc7448hpc2/config.mk
deleted file mode 100644 (file)
index b2d6f76..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Copyright (c) 2005 Freescale Semiconductor, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -maltivec -mabi=altivec -msoft-float
diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
deleted file mode 100644 (file)
index 11747ca..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * (C) Copyright 2005 Freescale Semiconductor, Inc.
- *
- * Roy Zang <tie-fei.zang@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- *
- * modifications for the Tsi108 Emul Board by avb@Tundra
- */
-
-/*
- * board support/init functions for the
- * Freescale MPC7448 HPC2 (High-Performance Computing 2 Platform).
- */
-
-#include <common.h>
-#include <74xx_7xx.h>
-#include <fdt_support.h>
-#include <netdev.h>
-
-#undef DEBUG
-
-DECLARE_GLOBAL_DATA_PTR;
-
-extern void tsi108_init_f (void);
-
-int display_mem_map (void);
-
-void after_reloc (ulong dest_addr)
-{
-       /*
-        * Jump to the main U-Boot board init code
-        */
-       board_init_r ((gd_t *) gd, dest_addr);
-       /* NOTREACHED */
-}
-
-/*
- * Check Board Identity:
- * report board type
- */
-
-int checkboard (void)
-{
-       int l_type = 0;
-
-       printf ("BOARD: %s\n", CONFIG_SYS_BOARD_NAME);
-       return (l_type);
-}
-
-/*
- * Read Processor ID:
- *
- * report calling processor number
- */
-
-int read_pid (void)
-{
-       return 0;               /* we are on single CPU platform for a while */
-}
-
-long int dram_size (int board_type)
-{
-       return 0x20000000;      /* 256M bytes */
-}
-
-phys_size_t initdram (int board_type)
-{
-       return dram_size (board_type);
-}
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       return 0;
-}
-#endif
-
-int board_eth_init(bd_t *bis)
-{
-       int rc = 0;
-#if defined(CONFIG_TSI108_ETH)
-       rc = tsi108_eth_initialize(bis);
-#endif
-       return rc;
-}
diff --git a/board/freescale/mpc7448hpc2/tsi108_init.c b/board/freescale/mpc7448hpc2/tsi108_init.c
deleted file mode 100644 (file)
index 9a1e407..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-/*****************************************************************************
- * (C) Copyright 2003;  Tundra Semiconductor Corp.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- *****************************************************************************/
-
-/*----------------------------------------------------------------------------
- * FILENAME: tsi108_init.c
- *
- * Originator: Alex Bounine
- *
- * DESCRIPTION:
- * Initialization code for the Tundra Tsi108 bridge chip
- *---------------------------------------------------------------------------*/
-
-#include <common.h>
-#include <74xx_7xx.h>
-#include <config.h>
-#include <version.h>
-#include <asm/processor.h>
-#include <tsi108.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-extern void mpicInit (int verbose);
-
-/*
- * Configuration Options
- */
-
-typedef struct {
-       ulong upper;
-       ulong lower;
-} PB2OCN_LUT_ENTRY;
-
-PB2OCN_LUT_ENTRY pb2ocn_lut1[32] = {
-       /* 0 - 7 */
-       {0x00000000, 0x00000201}, /* PBA=0xE000_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE100_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE200_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE300_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE400_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE500_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE600_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE700_0000 -> PCI/X (Byte-Swap) */
-
-       /* 8 - 15 */
-       {0x00000000, 0x00000201}, /* PBA=0xE800_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xE900_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xEA00_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xEB00_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xEC00_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xED00_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xEE00_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xEF00_0000 -> PCI/X (Byte-Swap) */
-
-       /* 16 - 23 */
-       {0x00000000, 0x00000201}, /* PBA=0xF000_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF100_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF200_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF300_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF400_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF500_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF600_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF700_0000 -> PCI/X (Byte-Swap) */
-       /* 24 - 31 */
-       {0x00000000, 0x00000201}, /* PBA=0xF800_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000201}, /* PBA=0xF900_0000 -> PCI/X (Byte-Swap) */
-       {0x00000000, 0x00000241}, /* PBA=0xFA00_0000 -> PCI/X  PCI I/O (Byte-Swap + Translate) */
-       {0x00000000, 0x00000201}, /* PBA=0xFB00_0000 -> PCI/X  PCI Config (Byte-Swap) */
-
-       {0x00000000, 0x02000240}, /* PBA=0xFC00_0000 -> HLP */
-       {0x00000000, 0x01000240}, /* PBA=0xFD00_0000 -> HLP */
-       {0x00000000, 0x03000240}, /* PBA=0xFE00_0000 -> HLP */
-       {0x00000000, 0x00000240}  /* PBA=0xFF00_0000 -> HLP : (Translation Enabled + Byte-Swap)*/
-};
-
-#ifdef CONFIG_SYS_CLK_SPREAD
-typedef struct {
-       ulong ctrl0;
-       ulong ctrl1;
-} PLL_CTRL_SET;
-
-/*
- * Clock Generator SPLL0 initialization values
- * PLL0 configuration table for various PB_CLKO freq.
- * Uses pre-calculated values for Fs = 30 kHz, D = 0.5%
- * Fout depends on required PB_CLKO. Based on Fref = 33 MHz
- */
-
-static PLL_CTRL_SET pll0_config[8] = {
-       {0x00000000, 0x00000000},       /* 0: bypass */
-       {0x00000000, 0x00000000},       /* 1: reserved */
-       {0x00430044, 0x00000043},       /* 2: CG_PB_CLKO = 183 MHz */
-       {0x005c0044, 0x00000039},       /* 3: CG_PB_CLKO = 100 MHz */
-       {0x005c0044, 0x00000039},       /* 4: CG_PB_CLKO = 133 MHz */
-       {0x004a0044, 0x00000040},       /* 5: CG_PB_CLKO = 167 MHz */
-       {0x005c0044, 0x00000039},       /* 6: CG_PB_CLKO = 200 MHz */
-       {0x004f0044, 0x0000003e}        /* 7: CG_PB_CLKO = 233 MHz */
-};
-#endif /* CONFIG_SYS_CLK_SPREAD */
-
-/*
- * Prosessor Bus Clock (in MHz) defined by CG_PB_SELECT
- * (based on recommended Tsi108 reference clock 33MHz)
- */
-static int pb_clk_sel[8] = { 0, 0, 183, 100, 133, 167, 200, 233 };
-
-/*
- * get_board_bus_clk ()
- *
- * returns the bus clock in Hz.
- */
-unsigned long get_board_bus_clk (void)
-{
-       ulong i;
-
-       /* Detect PB clock freq. */
-       i = in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PWRUP_STATUS);
-       i = (i >> 16) & 0x07;   /* Get PB PLL multiplier */
-
-       return pb_clk_sel[i] * 1000000;
-}
-
-/*
- * board_early_init_f ()
- *
- * board-specific initialization executed from flash
- */
-
-int board_early_init_f (void)
-{
-       ulong i;
-
-       gd->mem_clk = 0;
-       i = in32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET +
-                       CG_PWRUP_STATUS);
-       i = (i >> 20) & 0x07;   /* Get GD PLL multiplier */
-       switch (i) {
-       case 0: /* external clock */
-               printf ("Using external clock\n");
-               break;
-       case 1: /* system clock */
-               gd->mem_clk = gd->bus_clk;
-               break;
-       case 4: /* 133 MHz */
-       case 5: /* 166 MHz */
-       case 6: /* 200 MHz */
-               gd->mem_clk = pb_clk_sel[i] * 1000000;
-               break;
-       default:
-               printf ("Invalid DDR2 clock setting\n");
-               return -1;
-       }
-       printf ("BUS: %lu MHz\n", get_board_bus_clk() / 1000000);
-       printf ("MEM: %lu MHz\n", gd->mem_clk / 1000000);
-       return 0;
-}
-
-/*
- * board_early_init_r() - Tsi108 initialization function executed right after
- * relocation. Contains code that cannot be executed from flash.
- */
-
-int board_early_init_r (void)
-{
-       ulong temp, i;
-       ulong reg_val;
-       volatile ulong *reg_ptr;
-
-       reg_ptr =
-               (ulong *) (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + 0x900);
-
-       for (i = 0; i < 32; i++) {
-               *reg_ptr++ = 0x00000201;        /* SWAP ENABLED */
-               *reg_ptr++ = 0x00;
-       }
-
-       __asm__ __volatile__ ("eieio");
-       __asm__ __volatile__ ("sync");
-
-       /* Setup PB_OCN_BAR2: size 256B + ENable @ 0x0_80000000 */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_OCN_BAR2,
-               0x80000001);
-       __asm__ __volatile__ ("sync");
-
-       /* Make sure that OCN_BAR2 decoder is set (to allow following immediate
-        * read from SDRAM)
-        */
-
-       temp = in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_OCN_BAR2);
-       __asm__ __volatile__ ("sync");
-
-       /*
-        * Remap PB_OCN_BAR1 to accomodate PCI-bus aperture and EPROM into the
-        * processor bus address space. Immediately after reset LUT and address
-        * translation are disabled for this BAR. Now we have to initialize LUT
-        * and switch from the BOOT mode to the normal operation mode.
-        *
-        * The aperture defined by PB_OCN_BAR1 startes at address 0xE0000000
-        * and covers 512MB of address space. To allow larger aperture we also
-        * have to relocate register window of Tsi108
-        *
-        * Initialize LUT (32-entries) prior switching PB_OCN_BAR1 from BOOT
-        * mode.
-        *
-        * initialize pointer to LUT associated with PB_OCN_BAR1
-        */
-       reg_ptr =
-               (ulong *) (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + 0x800);
-
-       for (i = 0; i < 32; i++) {
-               *reg_ptr++ = pb2ocn_lut1[i].lower;
-               *reg_ptr++ = pb2ocn_lut1[i].upper;
-       }
-
-       __asm__ __volatile__ ("sync");
-
-       /* Base addresses for CS0, CS1, CS2, CS3 */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_ADDR,
-               0x00000000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B1_ADDR,
-               0x00100000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B2_ADDR,
-               0x00200000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B3_ADDR,
-               0x00300000);
-       __asm__ __volatile__ ("sync");
-
-       /* Masks for HLP banks */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_MASK,
-               0xFFF00000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B1_MASK,
-               0xFFF00000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B2_MASK,
-               0xFFF00000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B3_MASK,
-               0xFFF00000);
-       __asm__ __volatile__ ("sync");
-
-       /* Set CTRL0 values for banks */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_CTRL0,
-               0x7FFC44C2);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B1_CTRL0,
-               0x7FFC44C0);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B2_CTRL0,
-               0x7FFC44C0);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B3_CTRL0,
-               0x7FFC44C2);
-       __asm__ __volatile__ ("sync");
-
-       /* Set banks to latched mode, enabled, and other default settings */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_CTRL1,
-               0x7C0F2000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B1_CTRL1,
-               0x7C0F2000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B2_CTRL1,
-               0x7C0F2000);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B3_CTRL1,
-               0x7C0F2000);
-       __asm__ __volatile__ ("sync");
-
-       /*
-        * Set new value for PB_OCN_BAR1: switch from BOOT to LUT mode.
-        * value for PB_OCN_BAR1: (BA-0xE000_0000 + size 512MB + ENable)
-        */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_OCN_BAR1,
-               0xE0000011);
-       __asm__ __volatile__ ("sync");
-
-       /* Make sure that OCN_BAR2 decoder is set (to allow following
-        * immediate read from SDRAM)
-        */
-
-       temp = in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_OCN_BAR1);
-       __asm__ __volatile__ ("sync");
-
-       /*
-        * SRI: At this point we have enabled the HLP banks. That means we can
-        * now read from the NVRAM and initialize the environment variables.
-        * We will over-ride the env_init called in board_init_f
-        * This is really a work-around because, the HLP bank 1
-        * where NVRAM resides is not visible during board_init_f
-        * (arch/powerpc/lib/board.c)
-        * Alternatively, we could use the I2C EEPROM at start-up to configure
-        * and enable all HLP banks and not just HLP 0 as is being done for
-        * Taiga Rev. 2.
-        */
-
-       env_init ();
-
-#ifndef DISABLE_PBM
-
-       /*
-        * For IBM processors we have to set Address-Only commands generated
-        * by PBM that are different from ones set after reset.
-        */
-
-       temp = get_cpu_type ();
-
-       if ((CPU_750FX == temp) || (CPU_750GX == temp))
-               out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_MCMD,
-                       0x00009955);
-#endif /* DISABLE_PBM */
-
-#ifdef CONFIG_PCI
-       /*
-        * Initialize PCI/X block
-        */
-
-       /* Map PCI/X Configuration Space (16MB @ 0x0_FE000000) */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET +
-               PCI_PFAB_BAR0_UPPER, 0);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_PFAB_BAR0,
-               0xFB000001);
-       __asm__ __volatile__ ("sync");
-
-       /* Set Bus Number for the attached PCI/X bus (we will use 0 for NB) */
-
-       temp =  in32(CONFIG_SYS_TSI108_CSR_BASE +
-               TSI108_PCI_REG_OFFSET + PCI_PCIX_STAT);
-
-       temp &= ~0xFF00;        /* Clear the BUS_NUM field */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_PCIX_STAT,
-               temp);
-
-       /* Map PCI/X IO Space (64KB @ 0x0_FD000000) takes one 16MB LUT entry */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_PFAB_IO_UPPER,
-               0);
-       __asm__ __volatile__ ("sync");
-
-       /* This register is on the PCI side to interpret the address it receives
-        * and maps it as a IO address.
-        */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_PFAB_IO,
-               0x00000001);
-       __asm__ __volatile__ ("sync");
-
-       /*
-        * Map PCI/X Memory Space
-        *
-        * Transactions directed from OCM to PCI Memory Space are directed
-        * from PB to PCI
-        * unchanged (as defined by PB_OCN_BAR1,2 and LUT settings).
-        * If address remapping is required the corresponding PCI_PFAB_MEM32
-        * and PCI_PFAB_PFMx register groups have to be configured.
-        *
-        * Map the path from the PCI/X bus into the system memory
-        *
-        * The memory mapped window assotiated with PCI P2O_BAR2 provides
-        * access to the system memory without address remapping.
-        * All system memory is opened for accesses initiated by PCI/X bus
-        * masters.
-        *
-        * Initialize LUT associated with PCI P2O_BAR2
-        *
-        * set pointer to LUT associated with PCI P2O_BAR2
-        */
-
-       reg_ptr =
-               (ulong *) (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + 0x500);
-
-#ifdef DISABLE_PBM
-
-       /* In case when PBM is disabled (no HW supported cache snoopng on PB)
-        * P2O_BAR2 is directly mapped into the system memory without address
-        * translation.
-        */
-
-       reg_val = 0x00000004;   /* SDRAM port + NO Addr_Translation */
-
-       for (i = 0; i < 32; i++) {
-               *reg_ptr++ = reg_val;   /* P2O_BAR2_LUTx */
-               *reg_ptr++ = 0;         /* P2O_BAR2_LUT_UPPERx */
-       }
-
-       /* value for PCI BAR2 (size = 512MB, Enabled, No Addr. Translation) */
-       reg_val = 0x00007500;
-#else
-
-       reg_val = 0x00000002;   /* Destination port = PBM */
-
-       for (i = 0; i < 32; i++) {
-               *reg_ptr++ = reg_val;   /* P2O_BAR2_LUTx */
-/* P2O_BAR2_LUT_UPPERx : Set data swapping mode for PBM (byte swapping) */
-               *reg_ptr++ = 0x40000000;
-/* offset = 16MB, address translation is enabled to allow byte swapping */
-               reg_val += 0x01000000;
-       }
-
-/* value for PCI BAR2 (size = 512MB, Enabled, Address Translation Enabled) */
-       reg_val = 0x00007100;
-#endif
-
-       __asm__ __volatile__ ("eieio");
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_PAGE_SIZES,
-               reg_val);
-       __asm__ __volatile__ ("sync");
-
-       /* Set 64-bit PCI bus address for system memory
-        * ( 0 is the best choice for easy mapping)
-        */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR2,
-               0x00000000);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR2_UPPER,
-               0x00000000);
-       __asm__ __volatile__ ("sync");
-
-#ifndef DISABLE_PBM
-       /*
-        *  The memory mapped window assotiated with PCI P2O_BAR3 provides
-        *  access to the system memory using SDRAM OCN port and address
-        *  translation. This is alternative way to access SDRAM from PCI
-        *  required for Tsi108 emulation testing.
-        *  All system memory is opened for accesses initiated by
-        *  PCI/X bus masters.
-        *
-        *  Initialize LUT associated with PCI P2O_BAR3
-        *
-        *  set pointer to LUT associated with PCI P2O_BAR3
-        */
-       reg_ptr =
-               (ulong *) (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + 0x600);
-
-       reg_val = 0x00000004;   /* Destination port = SDC */
-
-       for (i = 0; i < 32; i++) {
-               *reg_ptr++ = reg_val;   /* P2O_BAR3_LUTx */
-
-/* P2O_BAR3_LUT_UPPERx : Set data swapping mode for PBM (byte swapping) */
-               *reg_ptr++ = 0;
-
-/* offset = 16MB, address translation is enabled to allow byte swapping */
-               reg_val += 0x01000000;
-       }
-
-       __asm__ __volatile__ ("eieio");
-       __asm__ __volatile__ ("sync");
-
-       /* Configure PCI P2O_BAR3 (size = 512MB, Enabled) */
-
-       reg_val =
-               in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET +
-                PCI_P2O_PAGE_SIZES);
-       reg_val &= ~0x00FF;
-       reg_val |= 0x0071;
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_PAGE_SIZES,
-               reg_val);
-       __asm__ __volatile__ ("sync");
-
-       /* Set 64-bit base PCI bus address for window (0x20000000) */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR3_UPPER,
-               0x00000000);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR3,
-               0x20000000);
-       __asm__ __volatile__ ("sync");
-
-#endif /* !DISABLE_PBM */
-
-#ifdef ENABLE_PCI_CSR_BAR
-       /* open if required access to Tsi108 CSRs from the PCI/X bus */
-       /* enable BAR0 on the PCI/X bus */
-       reg_val = in32(CONFIG_SYS_TSI108_CSR_BASE +
-               TSI108_PCI_REG_OFFSET + PCI_MISC_CSR);
-       reg_val |= 0x02;
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_MISC_CSR,
-               reg_val);
-       __asm__ __volatile__ ("sync");
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR0_UPPER,
-               0x00000000);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_P2O_BAR0,
-               CONFIG_SYS_TSI108_CSR_BASE);
-       __asm__ __volatile__ ("sync");
-
-#endif
-
-       /*
-        * Finally enable PCI/X Bus Master and Memory Space access
-        */
-
-       reg_val = in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_CSR);
-       reg_val |= 0x06;
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_CSR, reg_val);
-       __asm__ __volatile__ ("sync");
-
-#endif /* CONFIG_PCI */
-
-       /*
-        * Initialize MPIC outputs (interrupt pins):
-        * Interrupt routing on the Grendel Emul. Board:
-        * PB_INT[0] -> INT (CPU0)
-        * PB_INT[1] -> INT (CPU1)
-        * PB_INT[2] -> MCP (CPU0)
-        * PB_INT[3] -> MCP (CPU1)
-        * Set interrupt controller outputs as Level_Sensitive/Active_Low
-        */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_MPIC_REG_OFFSET + MPIC_CSR(0), 0x02);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_MPIC_REG_OFFSET + MPIC_CSR(1), 0x02);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_MPIC_REG_OFFSET + MPIC_CSR(2), 0x02);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_MPIC_REG_OFFSET + MPIC_CSR(3), 0x02);
-       __asm__ __volatile__ ("sync");
-
-       /*
-        * Ensure that Machine Check exception is enabled
-        * We need it to support PCI Bus probing (configuration reads)
-        */
-
-       reg_val = mfmsr ();
-       mtmsr(reg_val | MSR_ME);
-
-       return 0;
-}
-
-/*
- * Needed to print out L2 cache info
- * used in the misc_init_r function
- */
-
-unsigned long get_l2cr (void)
-{
-       unsigned long l2controlreg;
-       asm volatile ("mfspr %0, 1017":"=r" (l2controlreg):);
-       return l2controlreg;
-}
-
-/*
- * misc_init_r()
- *
- * various things to do after relocation
- *
- */
-
-int misc_init_r (void)
-{
-#ifdef CONFIG_SYS_CLK_SPREAD   /* Initialize Spread-Spectrum Clock generation */
-       ulong i;
-
-       /* Ensure that Spread-Spectrum is disabled */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PLL0_CTRL0, 0);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PLL1_CTRL0, 0);
-
-       /* Initialize PLL1: CG_PCI_CLK , internal OCN_CLK
-        * Uses pre-calculated value for Fout = 800 MHz, Fs = 30 kHz, D = 0.5%
-        */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PLL1_CTRL0,
-               0x002e0044);    /* D = 0.25% */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PLL1_CTRL1,
-               0x00000039);    /* BWADJ */
-
-       /* Initialize PLL0: CG_PB_CLKO  */
-       /* Detect PB clock freq. */
-       i = in32(CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PWRUP_STATUS);
-       i = (i >> 16) & 0x07;   /* Get PB PLL multiplier */
-
-       out32 (CONFIG_SYS_TSI108_CSR_BASE +
-               TSI108_CLK_REG_OFFSET + CG_PLL0_CTRL0, pll0_config[i].ctrl0);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE +
-               TSI108_CLK_REG_OFFSET + CG_PLL0_CTRL1, pll0_config[i].ctrl1);
-
-       /* Wait and set SSEN for both PLL0 and 1 */
-       udelay (1000);
-       out32 (CONFIG_SYS_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PLL1_CTRL0,
-               0x802e0044);    /* D=0.25% */
-       out32 (CONFIG_SYS_TSI108_CSR_BASE +
-               TSI108_CLK_REG_OFFSET + CG_PLL0_CTRL0,
-               0x80000000 | pll0_config[i].ctrl0);
-#endif /* CONFIG_SYS_CLK_SPREAD */
-
-#ifdef CONFIG_SYS_L2
-       l2cache_enable ();
-#endif
-       printf ("BUS:   %lu MHz\n", gd->bus_clk / 1000000);
-       printf ("MEM:   %lu MHz\n", gd->mem_clk / 1000000);
-
-       /*
-        * All the information needed to print the cache details is avaiblable
-        * at this point i.e. above call to l2cache_enable is the very last
-        * thing done with regards to enabling diabling the cache.
-        * So this seems like a good place to print all this information
-        */
-
-       printf ("CACHE: ");
-       switch (get_cpu_type()) {
-       case CPU_7447A:
-               printf ("L1 Instruction cache - 32KB 8-way");
-               (get_hid0 () & (1 << 15)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               printf ("L1 Data cache - 32KB 8-way");
-               (get_hid0 () & (1 << 14)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               printf ("Unified L2 cache - 512KB 8-way");
-               (get_l2cr () & (1 << 31)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               printf ("\n");
-               break;
-
-       case CPU_7448:
-               printf ("L1 Instruction cache - 32KB 8-way");
-               (get_hid0 () & (1 << 15)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               printf ("L1 Data cache - 32KB 8-way");
-               (get_hid0 () & (1 << 14)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               printf ("Unified L2 cache - 1MB 8-way");
-               (get_l2cr () & (1 << 31)) ? printf (" ENABLED\n") :
-                       printf (" DISABLED\n");
-               break;
-       default:
-               break;
-       }
-       return 0;
-}
diff --git a/board/freescale/mpc8360emds/Kconfig b/board/freescale/mpc8360emds/Kconfig
deleted file mode 100644 (file)
index 3f4f95c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_MPC8360EMDS
-
-config SYS_BOARD
-       default "mpc8360emds"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "MPC8360EMDS"
-
-endif
diff --git a/board/freescale/mpc8360emds/MAINTAINERS b/board/freescale/mpc8360emds/MAINTAINERS
deleted file mode 100644 (file)
index 91ff2ef..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-MPC8360EMDS BOARD
-M:     Dave Liu <daveliu@freescale.com>
-S:     Maintained
-F:     board/freescale/mpc8360emds/
-F:     include/configs/MPC8360EMDS.h
-F:     configs/MPC8360EMDS_33_defconfig
-F:     configs/MPC8360EMDS_33_ATM_defconfig
-F:     configs/MPC8360EMDS_33_HOST_33_defconfig
-F:     configs/MPC8360EMDS_33_HOST_66_defconfig
-F:     configs/MPC8360EMDS_33_SLAVE_defconfig
-F:     configs/MPC8360EMDS_66_defconfig
-F:     configs/MPC8360EMDS_66_ATM_defconfig
-F:     configs/MPC8360EMDS_66_HOST_33_defconfig
-F:     configs/MPC8360EMDS_66_HOST_66_defconfig
-F:     configs/MPC8360EMDS_66_SLAVE_defconfig
diff --git a/board/freescale/mpc8360emds/Makefile b/board/freescale/mpc8360emds/Makefile
deleted file mode 100644 (file)
index e8332ce..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y += mpc8360emds.o
-obj-$(CONFIG_PCI) += pci.o
diff --git a/board/freescale/mpc8360emds/README b/board/freescale/mpc8360emds/README
deleted file mode 100644 (file)
index 6afa753..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-Freescale MPC8360EMDS Board
------------------------------------------
-1.     Board Switches and Jumpers
-1.0    There are four Dual-In-Line Packages(DIP) Switches on MPC8360EMDS board
-       For some reason, the HW designers describe the switch settings
-       in terms of 0 and 1, and then map that to physical switches where
-       the label "On" refers to logic 0 and "Off" is logic 1.
-
-       Switch bits are numbered 1 through, like, 4 6 8 or 10, but the
-       bits may contribute to signals that are numbered based at 0,
-       and some of those signals may be high-bit-number-0 too.  Heed
-       well the names and labels and do not get confused.
-
-               "Off" == 1
-               "On"  == 0
-
-       SW18 is switch 18 as silk-screened onto the board.
-       SW4[8] is the bit labeled 8 on Switch 4.
-       SW2[1:6] refers to bits labeled 1 through 6 in order on switch 2.
-       SW3[7:1] refers to bits labeled 7 through 1 in order on switch 3.
-       SW3[1:8]= 0000_0001 refers to bits labeled 1 through 6 is set as "On"
-               and bits labeled 8 is set as "Off".
-
-1.1    There are three type boards for MPC8360E silicon up to now, They are
-
-       * MPC8360E-MDS-PB PROTO (a.k.a 8360SYS PROTOTYPE)
-       * MPC8360E-MDS-PB PILOT (a.k.a 8360SYS PILOT)
-       * MPC8360EA-MDS-PB PROTO (a.k.a 8360SYS2 PROTOTYPE)
-
-1.2    For all the MPC8360EMDS Board
-
-       First, make sure the board default setting is consistent with the
-       document shipped with your board. Then apply the following setting:
-       SW3[1-8]= 0000_0100  (HRCW setting value is performed on local bus)
-       SW4[1-8]= 0011_0000  (Flash boot on local bus)
-       SW9[1-8]= 0110_0110  (PCI Mode enabled. HRCW is read from FLASH)
-       SW10[1-8]= 0000_1000  (core PLL setting)
-       SW11[1-8]= 0000_0100 (SW11 is on the another side of the board)
-       JP6 1-2
-       on board Oscillator: 66M
-
-1.3    Since different board/chip rev. combinations have AC timing issues,
-       u-boot forces RGMII-ID (RGMII with Internal Delay) mode on by default
-       by the patch (mpc83xx: Disable G1TXCLK, G2TXCLK h/w buffers).
-
-       When the rev2.x silicon mount on these boards, and if you are using
-       u-boot version after this patch, to make the ethernet interfaces usable,
-       and to enable RGMII-ID on your board, you have to setup the jumpers
-       correctly.
-
-       * MPC8360E-MDS-PB PROTO
-         nothing to do
-       * MPC8360E-MDS-PB PILOT
-         JP9 and JP8 should be ON
-       * MPC8360EA-MDS-PB PROTO
-         JP2 and JP3 should be ON
-
-2.     Memory Map
-
-2.1.   The memory map should look pretty much like this:
-
-       0x0000_0000     0x7fff_ffff     DDR                     2G
-       0x8000_0000     0x8fff_ffff     PCI MEM prefetch        256M
-       0x9000_0000     0x9fff_ffff     PCI MEM non-prefetch    256M
-       0xc000_0000     0xdfff_ffff     Empty                   512M
-       0xe000_0000     0xe01f_ffff     Int Mem Reg Space       2M
-       0xe020_0000     0xe02f_ffff     Empty                   1M
-       0xe030_0000     0xe03f_ffff     PCI IO                  1M
-       0xe040_0000     0xefff_ffff     Empty                   252M
-       0xf000_0000     0xf3ff_ffff     Local Bus SDRAM         64M
-       0xf400_0000     0xf7ff_ffff     Empty                   64M
-       0xf800_0000     0xf800_7fff     BCSR on CS1             32K
-       0xf800_8000     0xf800_ffff     PIB CS4                 32K
-       0xf801_0000     0xf801_7fff     PIB CS5                 32K
-       0xfe00_0000     0xfeff_ffff     FLASH on CS0            16M
-
-
-3. Definitions
-
-3.1 Explanation of NEW definitions in:
-
-       include/configs/MPC8360EMDS.h
-
-    CONFIG_MPC83xx         MPC83xx family for both MPC8349 and MPC8360
-    CONFIG_MPC8360         MPC8360 specific
-    CONFIG_MPC8360EMDS     MPC8360EMDS board specific
-
-4. Compilation
-
-       MPC8360EMDS shipped with 33.33MHz or 66MHz oscillator(check U41 chip).
-
-       Assuming you're using BASH shell:
-
-               export CROSS_COMPILE=your-cross-compile-prefix
-               cd u-boot
-               make distclean
-               make MPC8360EMDS_XX_config
-               make
-
-       MPC8360EMDS support ATM, PCI in host and slave mode.
-
-       To make u-boot support ATM :
-       1) Make MPC8360EMDS_XX_ATM_config
-
-       To make u-boot support PCI host 66M :
-       1) DIP SW support PCI mode as described in Section 1.1.
-       2) Make MPC8360EMDS_XX_HOST_66_config
-
-       To make u-boot support PCI host 33M :
-       1) DIP SW setting is similar as Section 1.1, except for SW3[4] is 1
-       2) Make MPC8360EMDS_XX_HOST_33_config
-
-       To make u-boot support PCI slave 66M :
-       1) DIP SW setting is similar as Section 1.1, except for SW9[3] is 1
-       2) Make MPC8360EMDS_XX_SLAVE_config
-
-       (where XX is:
-          33 - 33.33MHz oscillator
-          66 - 66MHz oscillator)
-
-5. Downloading and Flashing Images
-
-5.0 Download over serial line using Kermit:
-
-       loadb
-       [Drop to kermit:
-           ^\c
-           send <u-boot-bin-image>
-           c
-       ]
-
-
-    Or via tftp:
-
-       tftp 10000 u-boot.bin
-
-5.1 Reflash U-boot Image using U-boot
-
-       tftp 20000 u-boot.bin
-       protect off fef00000 fef3ffff
-       erase fef00000 fef3ffff
-
-       cp.b 20000 fef00000 xxxx
-
-       or
-
-       cp.b 20000 fef00000 3ffff
-
-
-You have to supply the correct byte count with 'xxxx' from the TFTP result log.
-Maybe 3ffff will work too, that corresponds to the erased sectors.
-
-
-6. Notes
-       1) The console baudrate for MPC8360EMDS is 115200bps.
diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c
deleted file mode 100644 (file)
index f0a55f8..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (C) 2006,2010-2011 Freescale Semiconductor, Inc.
- * Dave Liu <daveliu@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <ioports.h>
-#include <mpc83xx.h>
-#include <i2c.h>
-#include <miiphy.h>
-#include <phy.h>
-#include <fsl_mdio.h>
-#if defined(CONFIG_PCI)
-#include <pci.h>
-#endif
-#include <spd_sdram.h>
-#include <asm/mmu.h>
-#include <asm/io.h>
-#include <asm/mmu.h>
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#endif
-#include <hwconfig.h>
-#include <fdt_support.h>
-#if defined(CONFIG_PQ_MDS_PIB)
-#include "../common/pq-mds-pib.h"
-#endif
-#include "../../../drivers/qe/uec.h"
-
-const qe_iop_conf_t qe_iop_conf_tab[] = {
-       /* GETH1 */
-       {0,  3, 1, 0, 1}, /* TxD0 */
-       {0,  4, 1, 0, 1}, /* TxD1 */
-       {0,  5, 1, 0, 1}, /* TxD2 */
-       {0,  6, 1, 0, 1}, /* TxD3 */
-       {1,  6, 1, 0, 3}, /* TxD4 */
-       {1,  7, 1, 0, 1}, /* TxD5 */
-       {1,  9, 1, 0, 2}, /* TxD6 */
-       {1, 10, 1, 0, 2}, /* TxD7 */
-       {0,  9, 2, 0, 1}, /* RxD0 */
-       {0, 10, 2, 0, 1}, /* RxD1 */
-       {0, 11, 2, 0, 1}, /* RxD2 */
-       {0, 12, 2, 0, 1}, /* RxD3 */
-       {0, 13, 2, 0, 1}, /* RxD4 */
-       {1,  1, 2, 0, 2}, /* RxD5 */
-       {1,  0, 2, 0, 2}, /* RxD6 */
-       {1,  4, 2, 0, 2}, /* RxD7 */
-       {0,  7, 1, 0, 1}, /* TX_EN */
-       {0,  8, 1, 0, 1}, /* TX_ER */
-       {0, 15, 2, 0, 1}, /* RX_DV */
-       {0, 16, 2, 0, 1}, /* RX_ER */
-       {0,  0, 2, 0, 1}, /* RX_CLK */
-       {2,  9, 1, 0, 3}, /* GTX_CLK - CLK10 */
-       {2,  8, 2, 0, 1}, /* GTX125 - CLK9 */
-       /* GETH2 */
-       {0, 17, 1, 0, 1}, /* TxD0 */
-       {0, 18, 1, 0, 1}, /* TxD1 */
-       {0, 19, 1, 0, 1}, /* TxD2 */
-       {0, 20, 1, 0, 1}, /* TxD3 */
-       {1,  2, 1, 0, 1}, /* TxD4 */
-       {1,  3, 1, 0, 2}, /* TxD5 */
-       {1,  5, 1, 0, 3}, /* TxD6 */
-       {1,  8, 1, 0, 3}, /* TxD7 */
-       {0, 23, 2, 0, 1}, /* RxD0 */
-       {0, 24, 2, 0, 1}, /* RxD1 */
-       {0, 25, 2, 0, 1}, /* RxD2 */
-       {0, 26, 2, 0, 1}, /* RxD3 */
-       {0, 27, 2, 0, 1}, /* RxD4 */
-       {1, 12, 2, 0, 2}, /* RxD5 */
-       {1, 13, 2, 0, 3}, /* RxD6 */
-       {1, 11, 2, 0, 2}, /* RxD7 */
-       {0, 21, 1, 0, 1}, /* TX_EN */
-       {0, 22, 1, 0, 1}, /* TX_ER */
-       {0, 29, 2, 0, 1}, /* RX_DV */
-       {0, 30, 2, 0, 1}, /* RX_ER */
-       {0, 31, 2, 0, 1}, /* RX_CLK */
-       {2,  2, 1, 0, 2}, /* GTX_CLK = CLK10 */
-       {2,  3, 2, 0, 1}, /* GTX125 - CLK4 */
-
-       {0,  1, 3, 0, 2}, /* MDIO */
-       {0,  2, 1, 0, 1}, /* MDC */
-
-       {5,  0, 1, 0, 2}, /* UART2_SOUT */
-       {5,  1, 2, 0, 3}, /* UART2_CTS */
-       {5,  2, 1, 0, 1}, /* UART2_RTS */
-       {5,  3, 2, 0, 2}, /* UART2_SIN */
-
-       {0,  0, 0, 0, QE_IOP_TAB_END}, /* END of table */
-};
-
-/* Handle "mpc8360ea rev.2.1 erratum 2: RGMII Timing"? */
-static int board_handle_erratum2(void)
-{
-       const immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
-
-       return REVID_MAJOR(immr->sysconf.spridr) == 2 &&
-              REVID_MINOR(immr->sysconf.spridr) == 1;
-}
-
-int board_early_init_f(void)
-{
-       const immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
-       u8 *bcsr = (u8 *)CONFIG_SYS_BCSR;
-
-       /* Enable flash write */
-       bcsr[0xa] &= ~0x04;
-
-       /* Disable G1TXCLK, G2TXCLK h/w buffers (rev.2.x h/w bug workaround) */
-       if (REVID_MAJOR(immr->sysconf.spridr) == 2)
-               bcsr[0xe] = 0x30;
-
-       /* Enable second UART */
-       bcsr[0x9] &= ~0x01;
-
-       if (board_handle_erratum2()) {
-               void *immap = (immap_t *)(CONFIG_SYS_IMMR + 0x14a8);
-
-               /*
-                * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2)
-                * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1)
-                */
-               setbits_be32(immap, 0x0c003000);
-
-               /*
-                * IMMR + 0x14AC[20:27] = 10101010
-                * (data delay for both UCC's)
-                */
-               clrsetbits_be32(immap + 4, 0xff0, 0xaa0);
-       }
-       return 0;
-}
-
-int board_early_init_r(void)
-{
-       gd_t *gd;
-#ifdef CONFIG_PQ_MDS_PIB
-       pib_init();
-#endif
-       /*
-        * BAT6 is used for SDRAM when DDR size is 512MB or larger than 256MB
-        * So re-setup PCI MEM space used BAT5 after relocated to DDR
-        */
-       gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
-       if (gd->ram_size > CONFIG_MAX_MEM_MAPPED) {
-               write_bat(DBAT5, CONFIG_SYS_DBAT6U, CONFIG_SYS_DBAT6L);
-               write_bat(IBAT5, CONFIG_SYS_IBAT6U, CONFIG_SYS_IBAT6L);
-       }
-
-       return 0;
-}
-
-#ifdef CONFIG_UEC_ETH
-static uec_info_t uec_info[] = {
-#ifdef CONFIG_UEC_ETH1
-       STD_UEC_INFO(1),
-#endif
-#ifdef CONFIG_UEC_ETH2
-       STD_UEC_INFO(2),
-#endif
-};
-
-int board_eth_init(bd_t *bd)
-{
-       if (board_handle_erratum2()) {
-               int i;
-
-               for (i = 0; i < ARRAY_SIZE(uec_info); i++) {
-                       uec_info[i].enet_interface_type =
-                               PHY_INTERFACE_MODE_RGMII_RXID;
-                       uec_info[i].speed = SPEED_1000;
-               }
-       }
-       return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info));
-}
-#endif /* CONFIG_UEC_ETH */
-
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-extern void ddr_enable_ecc(unsigned int dram_size);
-#endif
-int fixed_sdram(void);
-static int sdram_init(unsigned int base);
-
-phys_size_t initdram(int board_type)
-{
-       volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
-       u32 msize = 0;
-       u32 lbc_sdram_size;
-
-       if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
-               return -1;
-
-       /* DDR SDRAM - Main SODIMM */
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
-#if defined(CONFIG_SPD_EEPROM)
-       msize = spd_sdram();
-#else
-       msize = fixed_sdram();
-#endif
-
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       /*
-        * Initialize DDR ECC byte
-        */
-       ddr_enable_ecc(msize * 1024 * 1024);
-#endif
-       /*
-        * Initialize SDRAM if it is on local bus.
-        */
-       lbc_sdram_size = sdram_init(msize * 1024 * 1024);
-       if (!msize)
-               msize = lbc_sdram_size;
-
-       /* return total bus SDRAM size(bytes)  -- DDR */
-       return (msize * 1024 * 1024);
-}
-
-#if !defined(CONFIG_SPD_EEPROM)
-/*************************************************************************
- *  fixed sdram init -- doesn't use serial presence detect.
- ************************************************************************/
-int fixed_sdram(void)
-{
-       volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
-       u32 msize = CONFIG_SYS_DDR_SIZE;
-       u32 ddr_size = msize << 20;
-       u32 ddr_size_log2 = __ilog2(ddr_size);
-       u32 half_ddr_size = ddr_size >> 1;
-
-       im->sysconf.ddrlaw[0].bar =
-               CONFIG_SYS_DDR_SDRAM_BASE & 0xfffff000;
-       im->sysconf.ddrlaw[0].ar =
-               LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE);
-#if (CONFIG_SYS_DDR_SIZE != 256)
-#warning Currenly any ddr size other than 256 is not supported
-#endif
-#ifdef CONFIG_DDR_II
-       im->ddr.csbnds[0].csbnds = CONFIG_SYS_DDR_CS0_BNDS;
-       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
-       im->ddr.timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
-       im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
-       im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-       im->ddr.timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
-       im->ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG;
-       im->ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2;
-       im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE;
-       im->ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2;
-       im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-       im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL;
-#else
-
-#if ((CONFIG_SYS_DDR_SDRAM_BASE & 0x00FFFFFF) != 0)
-#warning Chip select bounds is only configurable in 16MB increments
-#endif
-       im->ddr.csbnds[0].csbnds =
-               ((CONFIG_SYS_DDR_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) |
-               (((CONFIG_SYS_DDR_SDRAM_BASE + half_ddr_size - 1) >>
-                               CSBNDS_EA_SHIFT) & CSBNDS_EA);
-       im->ddr.csbnds[1].csbnds =
-               (((CONFIG_SYS_DDR_SDRAM_BASE + half_ddr_size) >>
-                               CSBNDS_SA_SHIFT) & CSBNDS_SA) |
-               (((CONFIG_SYS_DDR_SDRAM_BASE + ddr_size - 1) >>
-                               CSBNDS_EA_SHIFT) & CSBNDS_EA);
-
-       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
-       im->ddr.cs_config[1] = CONFIG_SYS_DDR_CS1_CONFIG;
-
-       im->ddr.cs_config[2] = 0;
-       im->ddr.cs_config[3] = 0;
-
-       im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
-       im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-       im->ddr.sdram_cfg = CONFIG_SYS_DDR_CONTROL;
-
-       im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE;
-       im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-#endif
-       udelay(200);
-       im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
-
-       return msize;
-}
-#endif                         /*!CONFIG_SYS_SPD_EEPROM */
-
-int checkboard(void)
-{
-       puts("Board: Freescale MPC8360EMDS\n");
-       return 0;
-}
-
-/*
- * if MPC8360EMDS is soldered with SDRAM
- */
-#ifdef CONFIG_SYS_LB_SDRAM
-/*
- * Initialize SDRAM memory on the Local Bus.
- */
-
-static int sdram_init(unsigned int base)
-{
-       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
-       fsl_lbc_t *lbc = LBC_BASE_ADDR;
-       const int sdram_size = CONFIG_SYS_LBC_SDRAM_SIZE * 1024 * 1024;
-       int rem = base % sdram_size;
-       uint *sdram_addr;
-
-       /* window base address should be aligned to the window size */
-       if (rem)
-               base = base - rem + sdram_size;
-
-       /*
-        * Setup BAT6 for SDRAM when DDR size is 512MB or larger than 256MB
-        * After relocated to DDR, reuse BAT5 for PCI MEM space
-        */
-       if (base > CONFIG_MAX_MEM_MAPPED) {
-               unsigned long batl = base | BATL_PP_10 | BATL_MEMCOHERENCE;
-               unsigned long batu = base | BATU_BL_64M | BATU_VS | BATU_VP;
-
-               /* Setup the BAT6 for SDRAM */
-               write_bat(DBAT6, batu, batl);
-               write_bat(IBAT6, batu, batl);
-       }
-
-       sdram_addr = (uint *)base;
-       /*
-        * Setup SDRAM Base and Option Registers
-        */
-       set_lbc_br(2, base | CONFIG_SYS_BR2);
-       set_lbc_or(2, CONFIG_SYS_OR2);
-       immap->sysconf.lblaw[2].bar = base;
-       immap->sysconf.lblaw[2].ar = CONFIG_SYS_LBLAWAR2;
-
-       /*setup mtrpt, lsrt and lbcr for LB bus */
-       lbc->lbcr = CONFIG_SYS_LBC_LBCR;
-       lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
-       lbc->lsrt = CONFIG_SYS_LBC_LSRT;
-       asm("sync");
-
-       /*
-        * Configure the SDRAM controller Machine Mode Register.
-        */
-       lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_5;    /* Normal Operation */
-       lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_1;    /* Precharge All Banks */
-       asm("sync");
-       *sdram_addr = 0xff;
-       udelay(100);
-
-       /*
-        * We need do 8 times auto refresh operation.
-        */
-       lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_2;
-       asm("sync");
-       *sdram_addr = 0xff;     /* 1 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 2 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 3 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 4 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 5 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 6 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 7 times */
-       udelay(100);
-       *sdram_addr = 0xff;     /* 8 times */
-       udelay(100);
-
-       /* Mode register write operation */
-       lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_4;
-       asm("sync");
-       *(sdram_addr + 0xcc) = 0xff;
-       udelay(100);
-
-       /* Normal operation */
-       lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_5 | 0x40000000;
-       asm("sync");
-       *sdram_addr = 0xff;
-       udelay(100);
-
-       /*
-        * In non-aligned case we don't [normally] use that memory because
-        * there is a hole.
-        */
-       if (rem)
-               return 0;
-       return CONFIG_SYS_LBC_SDRAM_SIZE;
-}
-#else
-static int sdram_init(unsigned int base) { return 0; }
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-static void ft_board_fixup_qe_usb(void *blob, bd_t *bd)
-{
-       if (!hwconfig_subarg_cmp("qe_usb", "mode", "peripheral"))
-               return;
-
-       do_fixup_by_compat(blob, "fsl,mpc8323-qe-usb", "mode",
-                          "peripheral", sizeof("peripheral"), 1);
-}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-#ifdef CONFIG_PCI
-       ft_pci_setup(blob, bd);
-#endif
-       ft_board_fixup_qe_usb(blob, bd);
-       /*
-        * mpc8360ea pb mds errata 2: RGMII timing
-        * if on mpc8360ea rev. 2.1,
-        * change both ucc phy-connection-types from rgmii-id to rgmii-rxid
-        */
-       if (board_handle_erratum2()) {
-               int nodeoffset;
-               const char *prop;
-               int path;
-
-               nodeoffset = fdt_path_offset(blob, "/aliases");
-               if (nodeoffset >= 0) {
-#if defined(CONFIG_HAS_ETH0)
-                       /* fixup UCC 1 if using rgmii-id mode */
-                       prop = fdt_getprop(blob, nodeoffset, "ethernet0", NULL);
-                       if (prop) {
-                               path = fdt_path_offset(blob, prop);
-                               prop = fdt_getprop(blob, path,
-                                                  "phy-connection-type", 0);
-                               if (prop && (strcmp(prop, "rgmii-id") == 0))
-                                       fdt_fixup_phy_connection(blob, path,
-                                               PHY_INTERFACE_MODE_RGMII_RXID);
-                       }
-#endif
-#if defined(CONFIG_HAS_ETH1)
-                       /* fixup UCC 2 if using rgmii-id mode */
-                       prop = fdt_getprop(blob, nodeoffset, "ethernet1", NULL);
-                       if (prop) {
-                               path = fdt_path_offset(blob, prop);
-                               prop = fdt_getprop(blob, path,
-                                                  "phy-connection-type", 0);
-                               if (prop && (strcmp(prop, "rgmii-id") == 0))
-                                       fdt_fixup_phy_connection(blob, path,
-                                               PHY_INTERFACE_MODE_RGMII_RXID);
-                       }
-#endif
-               }
-       }
-
-       return 0;
-}
-#endif
diff --git a/board/freescale/mpc8360emds/pci.c b/board/freescale/mpc8360emds/pci.c
deleted file mode 100644 (file)
index 71244df..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2006-2009 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * PCI Configuration space access support for MPC83xx PCI Bridge
- */
-
-#include <asm/mmu.h>
-#include <asm/io.h>
-#include <common.h>
-#include <mpc83xx.h>
-#include <pci.h>
-#include <i2c.h>
-#include <asm/fsl_i2c.h>
-#include "../common/pq-mds-pib.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static struct pci_region pci1_regions[] = {
-       {
-               bus_start: CONFIG_SYS_PCI1_MEM_BASE,
-               phys_start: CONFIG_SYS_PCI1_MEM_PHYS,
-               size: CONFIG_SYS_PCI1_MEM_SIZE,
-               flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
-       },
-       {
-               bus_start: CONFIG_SYS_PCI1_IO_BASE,
-               phys_start: CONFIG_SYS_PCI1_IO_PHYS,
-               size: CONFIG_SYS_PCI1_IO_SIZE,
-               flags: PCI_REGION_IO
-       },
-       {
-               bus_start: CONFIG_SYS_PCI1_MMIO_BASE,
-               phys_start: CONFIG_SYS_PCI1_MMIO_PHYS,
-               size: CONFIG_SYS_PCI1_MMIO_SIZE,
-               flags: PCI_REGION_MEM
-       },
-};
-
-#ifdef CONFIG_MPC83XX_PCI2
-static struct pci_region pci2_regions[] = {
-       {
-               bus_start: CONFIG_SYS_PCI2_MEM_BASE,
-               phys_start: CONFIG_SYS_PCI2_MEM_PHYS,
-               size: CONFIG_SYS_PCI2_MEM_SIZE,
-               flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
-       },
-       {
-               bus_start: CONFIG_SYS_PCI2_IO_BASE,
-               phys_start: CONFIG_SYS_PCI2_IO_PHYS,
-               size: CONFIG_SYS_PCI2_IO_SIZE,
-               flags: PCI_REGION_IO
-       },
-       {
-               bus_start: CONFIG_SYS_PCI2_MMIO_BASE,
-               phys_start: CONFIG_SYS_PCI2_MMIO_PHYS,
-               size: CONFIG_SYS_PCI2_MMIO_SIZE,
-               flags: PCI_REGION_MEM
-       },
-};
-#endif
-
-void pci_init_board(void)
-#ifdef CONFIG_PCISLAVE
-{
-       volatile immap_t *immr = (volatile immap_t *)CONFIG_SYS_IMMR;
-       volatile law83xx_t *pci_law = immr->sysconf.pcilaw;
-       volatile pcictrl83xx_t *pci_ctrl = &immr->pci_ctrl[0];
-       struct pci_region *reg[] = { pci1_regions };
-
-       /* Configure PCI Local Access Windows */
-       pci_law[0].bar = CONFIG_SYS_PCI1_MEM_PHYS & LAWBAR_BAR;
-       pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M;
-
-       pci_law[1].bar = CONFIG_SYS_PCI1_IO_PHYS & LAWBAR_BAR;
-       pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_1M;
-
-       mpc83xx_pci_init(1, reg);
-
-       /*
-        * Configure PCI Inbound Translation Windows
-        */
-       pci_ctrl[0].pitar0 = 0x0;
-       pci_ctrl[0].pibar0 = 0x0;
-       pci_ctrl[0].piwar0 = PIWAR_EN | PIWAR_RTT_SNOOP |
-           PIWAR_WTT_SNOOP | PIWAR_IWS_4K;
-
-       pci_ctrl[0].pitar1 = 0x0;
-       pci_ctrl[0].pibar1 = 0x0;
-       pci_ctrl[0].piebar1 = 0x0;
-       pci_ctrl[0].piwar1 &= ~PIWAR_EN;
-
-       pci_ctrl[0].pitar2 = 0x0;
-       pci_ctrl[0].pibar2 = 0x0;
-       pci_ctrl[0].piebar2 = 0x0;
-       pci_ctrl[0].piwar2 &= ~PIWAR_EN;
-
-       /* Unlock the configuration bit */
-       mpc83xx_pcislave_unlock(0);
-       printf("PCI:   Agent mode enabled\n");
-}
-#else
-{
-       volatile immap_t *immr = (volatile immap_t *)CONFIG_SYS_IMMR;
-       volatile clk83xx_t *clk = (volatile clk83xx_t *)&immr->clk;
-       volatile law83xx_t *pci_law = immr->sysconf.pcilaw;
-#ifndef CONFIG_MPC83XX_PCI2
-       struct pci_region *reg[] = { pci1_regions };
-#else
-       struct pci_region *reg[] = { pci1_regions, pci2_regions };
-#endif
-
-       /* initialize the PCA9555PW IO expander on the PIB board */
-       pib_init();
-
-#if defined(CONFIG_PCI_66M)
-       clk->occr = OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2;
-       printf("PCI clock is 66MHz\n");
-#elif defined(CONFIG_PCI_33M)
-       clk->occr = OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2 |
-           OCCR_PCICD0 | OCCR_PCICD1 | OCCR_PCICD2 | OCCR_PCICR;
-       printf("PCI clock is 33MHz\n");
-#else
-       clk->occr = OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2;
-       printf("PCI clock is 66MHz\n");
-#endif
-       udelay(2000);
-
-       /* Configure PCI Local Access Windows */
-       pci_law[0].bar = CONFIG_SYS_PCI1_MEM_PHYS & LAWBAR_BAR;
-       pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M;
-
-       pci_law[1].bar = CONFIG_SYS_PCI1_IO_PHYS & LAWBAR_BAR;
-       pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_1M;
-
-       udelay(2000);
-
-#ifndef CONFIG_MPC83XX_PCI2
-       mpc83xx_pci_init(1, reg);
-#else
-       mpc83xx_pci_init(2, reg);
-#endif
-}
-#endif                         /* CONFIG_PCISLAVE */
diff --git a/board/freescale/mpc8360erdk/Kconfig b/board/freescale/mpc8360erdk/Kconfig
deleted file mode 100644 (file)
index 5c9be7c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_MPC8360ERDK
-
-config SYS_BOARD
-       default "mpc8360erdk"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "MPC8360ERDK"
-
-endif
diff --git a/board/freescale/mpc8360erdk/MAINTAINERS b/board/freescale/mpc8360erdk/MAINTAINERS
deleted file mode 100644 (file)
index e5b5995..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-MPC8360ERDK BOARD
-#M:    Anton Vorontsov <avorontsov@ru.mvista.com>
-S:     Orphan (since 2014-03)
-F:     board/freescale/mpc8360erdk/
-F:     include/configs/MPC8360ERDK.h
-F:     configs/MPC8360ERDK_defconfig
-F:     configs/MPC8360ERDK_33_defconfig
diff --git a/board/freescale/mpc8360erdk/Makefile b/board/freescale/mpc8360erdk/Makefile
deleted file mode 100644 (file)
index e2235c2..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y += mpc8360erdk.o
-obj-$(CONFIG_CMD_NAND) += nand.o
diff --git a/board/freescale/mpc8360erdk/mpc8360erdk.c b/board/freescale/mpc8360erdk/mpc8360erdk.c
deleted file mode 100644 (file)
index 478f820..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <daveliu@freescale.com>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <peterb@logicpd.com>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <ioports.h>
-#include <mpc83xx.h>
-#include <i2c.h>
-#include <miiphy.h>
-#include <asm/io.h>
-#include <asm/mmu.h>
-#include <pci.h>
-#include <libfdt.h>
-
-const qe_iop_conf_t qe_iop_conf_tab[] = {
-       /* MDIO */
-       {0,  1, 3, 0, 2}, /* MDIO */
-       {0,  2, 1, 0, 1}, /* MDC */
-
-       /* UCC1 - UEC (Gigabit) */
-       {0,  3, 1, 0, 1}, /* TxD0 */
-       {0,  4, 1, 0, 1}, /* TxD1 */
-       {0,  5, 1, 0, 1}, /* TxD2 */
-       {0,  6, 1, 0, 1}, /* TxD3 */
-       {0,  9, 2, 0, 1}, /* RxD0 */
-       {0, 10, 2, 0, 1}, /* RxD1 */
-       {0, 11, 2, 0, 1}, /* RxD2 */
-       {0, 12, 2, 0, 1}, /* RxD3 */
-       {0,  7, 1, 0, 1}, /* TX_EN */
-       {0,  8, 1, 0, 1}, /* TX_ER */
-       {0, 15, 2, 0, 1}, /* RX_DV */
-       {0,  0, 2, 0, 1}, /* RX_CLK */
-       {2,  9, 1, 0, 3}, /* GTX_CLK - CLK10 */
-       {2,  8, 2, 0, 1}, /* GTX125 - CLK9 */
-
-       /* UCC2 - UEC (Gigabit) */
-       {0, 17, 1, 0, 1}, /* TxD0 */
-       {0, 18, 1, 0, 1}, /* TxD1 */
-       {0, 19, 1, 0, 1}, /* TxD2 */
-       {0, 20, 1, 0, 1}, /* TxD3 */
-       {0, 23, 2, 0, 1}, /* RxD0 */
-       {0, 24, 2, 0, 1}, /* RxD1 */
-       {0, 25, 2, 0, 1}, /* RxD2 */
-       {0, 26, 2, 0, 1}, /* RxD3 */
-       {0, 21, 1, 0, 1}, /* TX_EN */
-       {0, 22, 1, 0, 1}, /* TX_ER */
-       {0, 29, 2, 0, 1}, /* RX_DV */
-       {0, 31, 2, 0, 1}, /* RX_CLK */
-       {2,  2, 1, 0, 2}, /* GTX_CLK - CLK10 */
-       {2,  3, 2, 0, 1}, /* GTX125 - CLK4 */
-
-       /* UCC7 - UEC */
-       {4,  0, 1, 0, 1}, /* TxD0 */
-       {4,  1, 1, 0, 1}, /* TxD1 */
-       {4,  2, 1, 0, 1}, /* TxD2 */
-       {4,  3, 1, 0, 1}, /* TxD3 */
-       {4,  6, 2, 0, 1}, /* RxD0 */
-       {4,  7, 2, 0, 1}, /* RxD1 */
-       {4,  8, 2, 0, 1}, /* RxD2 */
-       {4,  9, 2, 0, 1}, /* RxD3 */
-       {4,  4, 1, 0, 1}, /* TX_EN */
-       {4,  5, 1, 0, 1}, /* TX_ER */
-       {4, 12, 2, 0, 1}, /* RX_DV */
-       {4, 13, 2, 0, 1}, /* RX_ER */
-       {4, 10, 2, 0, 1}, /* COL */
-       {4, 11, 2, 0, 1}, /* CRS */
-       {2, 18, 2, 0, 1}, /* TX_CLK - CLK19 */
-       {2, 19, 2, 0, 1}, /* RX_CLK - CLK20 */
-
-       /* UCC4 - UEC */
-       {1, 14, 1, 0, 1}, /* TxD0 */
-       {1, 15, 1, 0, 1}, /* TxD1 */
-       {1, 16, 1, 0, 1}, /* TxD2 */
-       {1, 17, 1, 0, 1}, /* TxD3 */
-       {1, 20, 2, 0, 1}, /* RxD0 */
-       {1, 21, 2, 0, 1}, /* RxD1 */
-       {1, 22, 2, 0, 1}, /* RxD2 */
-       {1, 23, 2, 0, 1}, /* RxD3 */
-       {1, 18, 1, 0, 1}, /* TX_EN */
-       {1, 19, 1, 0, 2}, /* TX_ER */
-       {1, 26, 2, 0, 1}, /* RX_DV */
-       {1, 27, 2, 0, 1}, /* RX_ER */
-       {1, 24, 2, 0, 1}, /* COL */
-       {1, 25, 2, 0, 1}, /* CRS */
-       {2,  6, 2, 0, 1}, /* TX_CLK - CLK7 */
-       {2,  7, 2, 0, 1}, /* RX_CLK - CLK8 */
-
-       /* PCI1 */
-       {5,  4, 2, 0, 3}, /* PCI_M66EN */
-       {5,  5, 1, 0, 3}, /* PCI_INTA */
-       {5,  6, 1, 0, 3}, /* PCI_RSTO */
-       {5,  7, 3, 0, 3}, /* PCI_C_BE0 */
-       {5,  8, 3, 0, 3}, /* PCI_C_BE1 */
-       {5,  9, 3, 0, 3}, /* PCI_C_BE2 */
-       {5, 10, 3, 0, 3}, /* PCI_C_BE3 */
-       {5, 11, 3, 0, 3}, /* PCI_PAR */
-       {5, 12, 3, 0, 3}, /* PCI_FRAME */
-       {5, 13, 3, 0, 3}, /* PCI_TRDY */
-       {5, 14, 3, 0, 3}, /* PCI_IRDY */
-       {5, 15, 3, 0, 3}, /* PCI_STOP */
-       {5, 16, 3, 0, 3}, /* PCI_DEVSEL */
-       {5, 17, 0, 0, 0}, /* PCI_IDSEL */
-       {5, 18, 3, 0, 3}, /* PCI_SERR */
-       {5, 19, 3, 0, 3}, /* PCI_PERR */
-       {5, 20, 3, 0, 3}, /* PCI_REQ0 */
-       {5, 21, 2, 0, 3}, /* PCI_REQ1 */
-       {5, 22, 2, 0, 3}, /* PCI_GNT2 */
-       {5, 23, 3, 0, 3}, /* PCI_GNT0 */
-       {5, 24, 1, 0, 3}, /* PCI_GNT1 */
-       {5, 25, 1, 0, 3}, /* PCI_GNT2 */
-       {5, 26, 0, 0, 0}, /* PCI_CLK0 */
-       {5, 27, 0, 0, 0}, /* PCI_CLK1 */
-       {5, 28, 0, 0, 0}, /* PCI_CLK2 */
-       {5, 29, 0, 0, 3}, /* PCI_SYNC_OUT */
-       {6,  0, 3, 0, 3}, /* PCI_AD0 */
-       {6,  1, 3, 0, 3}, /* PCI_AD1 */
-       {6,  2, 3, 0, 3}, /* PCI_AD2 */
-       {6,  3, 3, 0, 3}, /* PCI_AD3 */
-       {6,  4, 3, 0, 3}, /* PCI_AD4 */
-       {6,  5, 3, 0, 3}, /* PCI_AD5 */
-       {6,  6, 3, 0, 3}, /* PCI_AD6 */
-       {6,  7, 3, 0, 3}, /* PCI_AD7 */
-       {6,  8, 3, 0, 3}, /* PCI_AD8 */
-       {6,  9, 3, 0, 3}, /* PCI_AD9 */
-       {6, 10, 3, 0, 3}, /* PCI_AD10 */
-       {6, 11, 3, 0, 3}, /* PCI_AD11 */
-       {6, 12, 3, 0, 3}, /* PCI_AD12 */
-       {6, 13, 3, 0, 3}, /* PCI_AD13 */
-       {6, 14, 3, 0, 3}, /* PCI_AD14 */
-       {6, 15, 3, 0, 3}, /* PCI_AD15 */
-       {6, 16, 3, 0, 3}, /* PCI_AD16 */
-       {6, 17, 3, 0, 3}, /* PCI_AD17 */
-       {6, 18, 3, 0, 3}, /* PCI_AD18 */
-       {6, 19, 3, 0, 3}, /* PCI_AD19 */
-       {6, 20, 3, 0, 3}, /* PCI_AD20 */
-       {6, 21, 3, 0, 3}, /* PCI_AD21 */
-       {6, 22, 3, 0, 3}, /* PCI_AD22 */
-       {6, 23, 3, 0, 3}, /* PCI_AD23 */
-       {6, 24, 3, 0, 3}, /* PCI_AD24 */
-       {6, 25, 3, 0, 3}, /* PCI_AD25 */
-       {6, 26, 3, 0, 3}, /* PCI_AD26 */
-       {6, 27, 3, 0, 3}, /* PCI_AD27 */
-       {6, 28, 3, 0, 3}, /* PCI_AD28 */
-       {6, 29, 3, 0, 3}, /* PCI_AD29 */
-       {6, 30, 3, 0, 3}, /* PCI_AD30 */
-       {6, 31, 3, 0, 3}, /* PCI_AD31 */
-
-       /* NAND */
-       {4, 18, 2, 0, 0}, /* NAND_RYnBY */
-
-       /* DUART - UART2 */
-       {5,  0, 1, 0, 2}, /* UART2_SOUT */
-       {5,  2, 1, 0, 1}, /* UART2_RTS */
-       {5,  3, 2, 0, 2}, /* UART2_SIN */
-       {5,  1, 2, 0, 3}, /* UART2_CTS */
-
-       /* UCC5 - UART3 */
-       {3,  0, 1, 0, 1}, /* UART3_TX */
-       {3,  4, 1, 0, 1}, /* UART3_RTS */
-       {3,  6, 2, 0, 1}, /* UART3_RX */
-       {3, 12, 2, 0, 0}, /* UART3_CTS */
-       {3, 13, 2, 0, 0}, /* UCC5_CD */
-
-       /* UCC6 - UART4 */
-       {3, 14, 1, 0, 1}, /* UART4_TX */
-       {3, 18, 1, 0, 1}, /* UART4_RTS */
-       {3, 20, 2, 0, 1}, /* UART4_RX */
-       {3, 26, 2, 0, 0}, /* UART4_CTS */
-       {3, 27, 2, 0, 0}, /* UCC6_CD */
-
-       /* Fujitsu MB86277 (MINT) graphics controller */
-       {0, 30, 1, 0, 0}, /* nSRESET_GRAPHICS */
-       {1,  5, 1, 0, 0}, /* nXRST_GRAPHICS */
-       {1,  7, 1, 0, 0}, /* LVDS_BKLT_CTR */
-       {2, 16, 1, 0, 0}, /* LVDS_BKLT_EN */
-
-       /* AD7843 ADC/Touchscreen controller */
-       {4, 14, 1, 0, 0}, /* SPI_nCS0 */
-       {4, 28, 3, 0, 3}, /* SPI_MOSI */
-       {4, 29, 3, 0, 3}, /* SPI_MISO */
-       {4, 30, 3, 0, 3}, /* SPI_CLK */
-
-       /* Freescale QUICC Engine USB Host Controller (FHCI) */
-       {1,  2, 1, 0, 3}, /* USBOE */
-       {1,  3, 1, 0, 3}, /* USBTP */
-       {1,  8, 1, 0, 1}, /* USBTN */
-       {1,  9, 2, 1, 3}, /* USBRP */
-       {1, 10, 2, 0, 3}, /* USBRXD */
-       {1, 11, 2, 1, 3}, /* USBRN */
-       {2, 20, 2, 0, 1}, /* CLK21 */
-       {4, 20, 1, 0, 0}, /* SPEED */
-       {4, 21, 1, 0, 0}, /* SUSPND */
-
-       /* END of table */
-       {0,  0, 0, 0, QE_IOP_TAB_END},
-};
-
-int board_early_init_r(void)
-{
-       void *reg = (void *)(CONFIG_SYS_IMMR + 0x14a8);
-       u32 val;
-
-       /*
-        * Because of errata in the UCCs, we have to write to the reserved
-        * registers to slow the clocks down.
-        */
-       val = in_be32(reg);
-       /* UCC1 */
-       val |= 0x00003000;
-       /* UCC2 */
-       val |= 0x0c000000;
-       out_be32(reg, val);
-
-       return 0;
-}
-
-int fixed_sdram(void)
-{
-       volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
-       u32 msize = 0;
-       u32 ddr_size;
-       u32 ddr_size_log2;
-
-       msize = CONFIG_SYS_DDR_SIZE;
-       for (ddr_size = msize << 20, ddr_size_log2 = 0;
-            (ddr_size > 1); ddr_size = ddr_size >> 1, ddr_size_log2++) {
-               if (ddr_size & 1)
-                       return -1;
-       }
-
-       im->sysconf.ddrlaw[0].ar =
-           LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE);
-
-       im->ddr.csbnds[0].csbnds = CONFIG_SYS_DDR_CS0_BNDS;
-       im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG;
-       im->ddr.timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
-       im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
-       im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-       im->ddr.timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
-       im->ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG;
-       im->ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2;
-       im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE;
-       im->ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2;
-       im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-       im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL;
-       udelay(200);
-       im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
-
-       return msize;
-}
-
-phys_size_t initdram(int board_type)
-{
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       extern void ddr_enable_ecc(unsigned int dram_size);
-#endif
-       volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
-       u32 msize = 0;
-
-       if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
-               return -1;
-
-       /* DDR SDRAM - Main SODIMM */
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
-       msize = fixed_sdram();
-
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       /*
-        * Initialize DDR ECC byte
-        */
-       ddr_enable_ecc(msize * 1024 * 1024);
-#endif
-
-       /* return total bus SDRAM size(bytes)  -- DDR */
-       return (msize * 1024 * 1024);
-}
-
-int checkboard(void)
-{
-       puts("Board: Freescale/Logic MPC8360ERDK\n");
-       return 0;
-}
-
-static struct pci_region pci_regions[] = {
-       {
-               .bus_start = CONFIG_SYS_PCI1_MEM_BASE,
-               .phys_start = CONFIG_SYS_PCI1_MEM_PHYS,
-               .size = CONFIG_SYS_PCI1_MEM_SIZE,
-               .flags = PCI_REGION_MEM | PCI_REGION_PREFETCH,
-       },
-       {
-               .bus_start = CONFIG_SYS_PCI1_MMIO_BASE,
-               .phys_start = CONFIG_SYS_PCI1_MMIO_PHYS,
-               .size = CONFIG_SYS_PCI1_MMIO_SIZE,
-               .flags = PCI_REGION_MEM,
-       },
-       {
-               .bus_start = CONFIG_SYS_PCI1_IO_BASE,
-               .phys_start = CONFIG_SYS_PCI1_IO_PHYS,
-               .size = CONFIG_SYS_PCI1_IO_SIZE,
-               .flags = PCI_REGION_IO,
-       },
-};
-
-void pci_init_board(void)
-{
-       volatile immap_t *immr = (volatile immap_t *)CONFIG_SYS_IMMR;
-       volatile clk83xx_t *clk = (volatile clk83xx_t *)&immr->clk;
-       volatile law83xx_t *pci_law = immr->sysconf.pcilaw;
-       struct pci_region *reg[] = { pci_regions, };
-
-#if defined(CONFIG_PCI_33M)
-       clk->occr = OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2 |
-                   OCCR_PCICD0 | OCCR_PCICD1 | OCCR_PCICD2 | OCCR_PCICR;
-       printf("PCI clock is 33MHz\n");
-#else
-       clk->occr = OCCR_PCICOE0 | OCCR_PCICOE1 | OCCR_PCICOE2;
-       printf("PCI clock is 66MHz\n");
-#endif
-
-       udelay(2000);
-
-       /* Configure PCI Local Access Windows */
-       pci_law[0].bar = CONFIG_SYS_PCI1_MEM_PHYS & LAWBAR_BAR;
-       pci_law[0].ar = LBLAWAR_EN | LBLAWAR_512MB;
-
-       pci_law[1].bar = CONFIG_SYS_PCI1_IO_PHYS & LAWBAR_BAR;
-       pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
-
-       mpc83xx_pci_init(1, reg);
-}
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-       ft_pci_setup(blob, bd);
-
-       return 0;
-}
-#endif
diff --git a/board/freescale/mpc8360erdk/nand.c b/board/freescale/mpc8360erdk/nand.c
deleted file mode 100644 (file)
index 237c0c4..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * MPC8360E-RDK support for the NAND on FSL UPM
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <config.h>
-#include <common.h>
-#include <asm/io.h>
-#include <asm/immap_83xx.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/fsl_upm.h>
-#include <nand.h>
-
-static struct immap *im = (struct immap *)CONFIG_SYS_IMMR;
-
-static const u32 upm_array[] = {
-       0x0ff03c30, 0x0ff03c30, 0x0ff03c34, 0x0ff33c30, /* Words  0 to  3 */
-       0xfff33c31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words  4 to  7 */
-       0x0faf3c30, 0x0faf3c30, 0x0faf3c30, 0x0fff3c34, /* Words  8 to 11 */
-       0xffff3c31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words 12 to 15 */
-       0x0fa3fc30, 0x0fa3fc30, 0x0fa3fc30, 0x0ff3fc34, /* Words 16 to 19 */
-       0xfff3fc31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words 20 to 23 */
-       0x0ff33c30, 0x0fa33c30, 0x0fa33c34, 0x0ff33c30, /* Words 24 to 27 */
-       0xfff33c31, 0xfff0fc30, 0xfff0fc30, 0xfff0fc30, /* Words 28 to 31 */
-       0xfff3fc30, 0xfff3fc30, 0xfff6fc30, 0xfffcfc30, /* Words 32 to 35 */
-       0xfffcfc30, 0xfffcfc30, 0xfffcfc30, 0xfffcfc30, /* Words 36 to 39 */
-       0xfffcfc30, 0xfffcfc30, 0xfffcfc30, 0xfffcfc30, /* Words 40 to 43 */
-       0xfffdfc30, 0xfffffc30, 0xfffffc30, 0xfffffc31, /* Words 44 to 47 */
-       0xfffffc30, 0xfffffc00, 0xfffffc00, 0xfffffc00, /* Words 48 to 51 */
-       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00, /* Words 52 to 55 */
-       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01, /* Words 56 to 59 */
-       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01, /* Words 60 to 63 */
-};
-
-static void upm_setup(struct fsl_upm *upm)
-{
-       int i;
-
-       /* write upm array */
-       out_be32(upm->mxmr, MxMR_OP_WARR);
-
-       for (i = 0; i < 64; i++) {
-               out_be32(upm->mdr, upm_array[i]);
-               out_8(upm->io_addr, 0x0);
-       }
-
-       /* normal operation */
-       out_be32(upm->mxmr, MxMR_OP_NORM);
-       while (in_be32(upm->mxmr) != MxMR_OP_NORM)
-               eieio();
-}
-
-static int dev_ready(int chip_nr)
-{
-       if (in_be32(&im->qepio.ioport[4].pdat) & 0x00002000) {
-               debug("nand ready\n");
-               return 1;
-       }
-
-       debug("nand busy\n");
-       return 0;
-}
-
-static struct fsl_upm_nand fun = {
-       .upm = {
-               .io_addr = (void *)CONFIG_SYS_NAND_BASE,
-       },
-       .width = 8,
-       .upm_cmd_offset = 8,
-       .upm_addr_offset = 16,
-       .dev_ready = dev_ready,
-       .wait_flags = FSL_UPM_WAIT_RUN_PATTERN,
-       .chip_delay = 50,
-};
-
-int board_nand_init(struct nand_chip *nand)
-{
-       fun.upm.mxmr = &im->im_lbc.mamr;
-       fun.upm.mdr = &im->im_lbc.mdr;
-       fun.upm.mar = &im->im_lbc.mar;
-
-       upm_setup(&fun.upm);
-
-       return fsl_upm_nand_init(nand, &fun);
-}
index 8592a2c3c1852d2ce551fde351d18e2085083fca..81b4eed5edea8f535f4ea614254348f58a617540 100644 (file)
@@ -1,6 +1,6 @@
 MPC837XERDB BOARD
-#M:    Joe D'Abbraccio <ljd015@freescale.com>
-S:     Orphan (since 2014-06)
+M:     Sinan Akman <sinan@writeme.com>
+S:     Maintained
 F:     board/freescale/mpc837xerdb/
 F:     include/configs/MPC837XERDB.h
 F:     configs/MPC837XERDB_defconfig
diff --git a/board/freescale/p1_p2_rdb/Kconfig b/board/freescale/p1_p2_rdb/Kconfig
deleted file mode 100644 (file)
index d7ad35d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_P1_P2_RDB
-
-config SYS_BOARD
-       default "p1_p2_rdb"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "P1_P2_RDB"
-
-endif
diff --git a/board/freescale/p1_p2_rdb/MAINTAINERS b/board/freescale/p1_p2_rdb/MAINTAINERS
deleted file mode 100644 (file)
index aabf587..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-P1_P2_RDB BOARD
-#M:    -
-S:     Maintained
-F:     board/freescale/p1_p2_rdb/
-F:     include/configs/P1_P2_RDB.h
-F:     configs/P1011RDB_defconfig
-F:     configs/P1011RDB_36BIT_defconfig
-F:     configs/P1011RDB_36BIT_SDCARD_defconfig
-F:     configs/P1011RDB_36BIT_SPIFLASH_defconfig
-F:     configs/P1011RDB_NAND_defconfig
-F:     configs/P1011RDB_SDCARD_defconfig
-F:     configs/P1011RDB_SPIFLASH_defconfig
-F:     configs/P1020RDB_defconfig
-F:     configs/P1020RDB_36BIT_defconfig
-F:     configs/P1020RDB_36BIT_SDCARD_defconfig
-F:     configs/P1020RDB_36BIT_SPIFLASH_defconfig
-F:     configs/P1020RDB_NAND_defconfig
-F:     configs/P1020RDB_SDCARD_defconfig
-F:     configs/P1020RDB_SPIFLASH_defconfig
-F:     configs/P2010RDB_defconfig
-F:     configs/P2010RDB_36BIT_defconfig
-F:     configs/P2010RDB_36BIT_SDCARD_defconfig
-F:     configs/P2010RDB_36BIT_SPIFLASH_defconfig
-F:     configs/P2010RDB_NAND_defconfig
-F:     configs/P2010RDB_SDCARD_defconfig
-F:     configs/P2010RDB_SPIFLASH_defconfig
-F:     configs/P2020RDB_36BIT_defconfig
-F:     configs/P2020RDB_36BIT_SDCARD_defconfig
-F:     configs/P2020RDB_36BIT_SPIFLASH_defconfig
-F:     configs/P2020RDB_NAND_defconfig
-F:     configs/P2020RDB_SDCARD_defconfig
-F:     configs/P2020RDB_SPIFLASH_defconfig
-
-P2020RDB BOARD
-M:     Poonam Aggrwal <poonam.aggrwal@freescale.com>
-S:     Maintained
-F:     configs/P2020RDB_defconfig
diff --git a/board/freescale/p1_p2_rdb/Makefile b/board/freescale/p1_p2_rdb/Makefile
deleted file mode 100644 (file)
index a97bf45..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2009 Freescale Semiconductor, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-MINIMAL=
-
-ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_INIT_MINIMAL
-MINIMAL=y
-endif
-endif
-
-ifdef MINIMAL
-
-obj-y  += spl_minimal.o tlb.o law.o
-
-else
-ifdef CONFIG_SPL_BUILD
-obj-y += spl.o
-else
-obj-y  += p1_p2_rdb.o
-obj-$(CONFIG_PCI)  += pci.o
-endif
-obj-y  += ddr.o
-obj-y  += law.o
-obj-y  += tlb.o
-
-endif
diff --git a/board/freescale/p1_p2_rdb/README b/board/freescale/p1_p2_rdb/README
deleted file mode 100644 (file)
index cd66e58..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-Overview
---------
-P2020RDB is a Low End Dual core platform supporting the P2020 processor
-of QorIQ series. P2020 is an e500 based dual core SOC.
-
-Building U-boot
------------
-To build the u-boot for P2020RDB:
-       make P2020RDB_config
-       make
-
-NOR Flash Banks
------------
-RDB board for P2020 has two flash banks. They are both present on boot.
-
-Booting by default is always from the boot bank at 0xef00_0000.
-
-Memory Map
-----------
-0xef00_0000 - 0xef7f_ffff      Alternate bank          8MB
-0xe800_0000 - 0xefff_ffff      Boot bank               8MB
-
-0xef74_0000 - 0xef7f_ffff      Alternate u-boot address        768KB
-0xeff4_0000 - 0xefff_ffff      Boot u-boot address             768KB
-
-Switch settings to boot from the NOR flash banks
-------------------------------------------------
-SW4[8]=0 default NOR Flash bank
-SW4[8]=1 Alternate NOR Flash bank
-
-Flashing Images
----------------
-To place a new u-boot image in the alternate flash bank and then boot
-with that new image temporarily, use this:
-       tftp 1000000 u-boot.bin
-       erase ef740000 ef7fffff
-       cp.b 1000000 ef740000 c0000
-
-Now to boot from the alternate bank change the SW4[8] from 0 to 1.
-
-To program the image in the boot flash bank:
-       tftp 1000000 u-boot.bin
-       protect off all
-       erase eff40000 ffffffff
-       cp.b 1000000 eff40000 c0000
-
-Using the Device Tree Source File
----------------------------------
-To create the DTB (Device Tree Binary) image file,
-use a command similar to this:
-
-       dtc -b 0 -f -I dts -O dtb p2020rdb.dts > p2020rdb.dtb
-
-Likely, that .dts file will come from here;
-
-       linux-2.6/arch/powerpc/boot/dts/p2020rdb.dts
-
-Booting Linux
--------------
-Place a linux uImage in the TFTP disk area.
-
-       tftp 1000000 uImage.p2020rdb
-       tftp 2000000 rootfs.ext2.gz.uboot
-       tftp c00000 p2020rdb.dtb
-       bootm 1000000 2000000 c00000
-
-Implementing AMP(Asymmetric MultiProcessing)
----------------------------------------------
-1. Build kernel image for core0:
-
-       a. $ make 85xx/p1_p2_rdb_defconfig
-
-       b. $ make menuconfig
-          - un-select "Processor support"->
-               "Symetric multi-processing support"
-
-       c. $ make uImage
-
-       d. $ cp arch/powerpc/boot/uImage /tftpboot/uImage.core0
-
-2. Build kernel image for core1:
-
-       a. $ make 85xx/p1_p2_rdb_defconfig
-
-       b. $ make menuconfig
-          - Un-select "Processor support"->
-               "Symetric multi-processing support"
-          - Select "Advanced setup" ->
-               "Prompt for advanced kernel configuration options"
-               - Select
-                       "Set physical address where the kernel is loaded"
-                       and set it to 0x20000000, assuming core1 will
-                       start from 512MB.
-               - Select "Set custom page offset address"
-               - Select "Set custom kernel base address"
-               - Select "Set maximum low memory"
-          - "Exit" and save the selection.
-
-       c. $ make uImage
-
-       d. $ cp arch/powerpc/boot/uImage /tftpboot/uImage.core1
-
-3. Create dtb for core0:
-
-       $ dtc -I dts -O dtb -f -b 0
-                arch/powerpc/boot/dts/p2020rdb_camp_core0.dts >
-                /tftpboot/p2020rdb_camp_core0.dtb
-
-4. Create dtb for core1:
-
-       $ dtc -I dts -O dtb -f -b 1
-                arch/powerpc/boot/dts/p2020rdb_camp_core1.dts >
-                /tftpboot/p2020rdb_camp_core1.dtb
-
-5. Bring up two cores separately:
-
-       a. Power on the board, under u-boot prompt:
-               => setenv <serverip>
-               => setenv <ipaddr>
-               => setenv bootargs root=/dev/ram rw console=ttyS0,115200
-       b. Bring up core1's kernel first:
-               => setenv bootm_low 0x20000000
-               => setenv bootm_size 0x10000000
-               => tftp 21000000 uImage.core1
-               => tftp 22000000 ramdiskfile
-               => tftp 20c00000 p2020rdb_camp_core1.dtb
-               => interrupts off
-               => bootm start 21000000 22000000 20c00000
-               => bootm loados
-               => bootm ramdisk
-               => bootm fdt
-               => fdt boardsetup
-               => fdt chosen $initrd_start $initrd_end
-               => bootm prep
-               => cpu 1 release $bootm_low - $fdtaddr -
-       c. Bring up core0's kernel(on the same u-boot console):
-               => setenv bootm_low 0
-               => setenv bootm_size 0x20000000
-               => tftp 1000000 uImage.core0
-               => tftp 2000000 ramdiskfile
-               => tftp c00000 p2020rdb_camp_core0.dtb
-               => bootm 1000000 2000000 c00000
-
-Please note only core0 will run u-boot, core1 starts kernel directly
-after "cpu release" command is issued.
diff --git a/board/freescale/p1_p2_rdb/ddr.c b/board/freescale/p1_p2_rdb/ddr.c
deleted file mode 100644 (file)
index 98ee5f1..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2009, 2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mmu.h>
-#include <asm/immap_85xx.h>
-#include <asm/processor.h>
-#include <fsl_ddr_sdram.h>
-#include <asm/io.h>
-#include <asm/fsl_law.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define CONFIG_SYS_DDR_CS0_BNDS                0x0000003F
-#define CONFIG_SYS_DDR_CS0_CONFIG      0x80014202
-#define CONFIG_SYS_DDR_CS0_CONFIG_2    0x00000000
-#define CONFIG_SYS_DDR_INIT_ADDR       0x00000000
-#define CONFIG_SYS_DDR_INIT_EXT_ADDR   0x00000000
-#define CONFIG_SYS_DDR_MODE_CONTROL    0x00000000
-#define CONFIG_SYS_DDR_ZQ_CONTROL      0x00000000
-#define CONFIG_SYS_DDR_WRLVL_CONTROL   0x00000000
-#define CONFIG_SYS_DDR_SR_CNTR         0x00000000
-#define CONFIG_SYS_DDR_RCW_1           0x00000000
-#define CONFIG_SYS_DDR_RCW_2           0x00000000
-#define CONFIG_SYS_DDR_CONTROL         0x43000000      /* Type = DDR2*/
-#define CONFIG_SYS_DDR_CONTROL_2       0x24401000
-#define CONFIG_SYS_DDR_TIMING_4                0x00000000
-#define CONFIG_SYS_DDR_TIMING_5                0x00000000
-
-#define CONFIG_SYS_DDR_TIMING_3_400    0x00010000
-#define CONFIG_SYS_DDR_TIMING_0_400    0x00260802
-#define CONFIG_SYS_DDR_TIMING_1_400    0x39355322
-#define CONFIG_SYS_DDR_TIMING_2_400    0x1f9048ca
-#define CONFIG_SYS_DDR_CLK_CTRL_400    0x02800000
-#define CONFIG_SYS_DDR_MODE_1_400      0x00480432
-#define CONFIG_SYS_DDR_MODE_2_400      0x00000000
-#define CONFIG_SYS_DDR_INTERVAL_400    0x06180100
-
-#define CONFIG_SYS_DDR_TIMING_3_533    0x00020000
-#define CONFIG_SYS_DDR_TIMING_0_533    0x00260802
-#define CONFIG_SYS_DDR_TIMING_1_533    0x4c47c432
-#define CONFIG_SYS_DDR_TIMING_2_533    0x0f9848ce
-#define CONFIG_SYS_DDR_CLK_CTRL_533    0x02800000
-#define CONFIG_SYS_DDR_MODE_1_533      0x00040642
-#define CONFIG_SYS_DDR_MODE_2_533      0x00000000
-#define CONFIG_SYS_DDR_INTERVAL_533    0x08200100
-
-#define CONFIG_SYS_DDR_TIMING_3_667    0x00030000
-#define CONFIG_SYS_DDR_TIMING_0_667    0x55770802
-#define CONFIG_SYS_DDR_TIMING_1_667    0x5f599543
-#define CONFIG_SYS_DDR_TIMING_2_667    0x0fa074d1
-#define CONFIG_SYS_DDR_CLK_CTRL_667    0x03000000
-#define CONFIG_SYS_DDR_MODE_1_667      0x00040852
-#define CONFIG_SYS_DDR_MODE_2_667      0x00000000
-#define CONFIG_SYS_DDR_INTERVAL_667    0x0a280100
-
-#define CONFIG_SYS_DDR_TIMING_3_800    0x00040000
-#define CONFIG_SYS_DDR_TIMING_0_800    0x00770802
-#define CONFIG_SYS_DDR_TIMING_1_800    0x6f6b6543
-#define CONFIG_SYS_DDR_TIMING_2_800    0x0fa074d1
-#define CONFIG_SYS_DDR_CLK_CTRL_800    0x02800000
-#define CONFIG_SYS_DDR_MODE_1_800      0x00040852
-#define CONFIG_SYS_DDR_MODE_2_800      0x00000000
-#define CONFIG_SYS_DDR_INTERVAL_800    0x0c300100
-
-fsl_ddr_cfg_regs_t ddr_cfg_regs_400 = {
-       .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS,
-       .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG,
-       .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2,
-       .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3_400,
-       .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0_400,
-       .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_400,
-       .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_400,
-       .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL,
-       .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2,
-       .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1_400,
-       .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2_400,
-       .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL,
-       .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL_400,
-       .ddr_data_init = CONFIG_MEM_INIT_VALUE,
-       .ddr_sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL_400,
-       .ddr_init_addr = CONFIG_SYS_DDR_INIT_ADDR,
-       .ddr_init_ext_addr = CONFIG_SYS_DDR_INIT_EXT_ADDR,
-       .timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4,
-       .timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5,
-       .ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CONTROL,
-       .ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CONTROL,
-       .ddr_sr_cntr = CONFIG_SYS_DDR_SR_CNTR,
-       .ddr_sdram_rcw_1 = CONFIG_SYS_DDR_RCW_1,
-       .ddr_sdram_rcw_2 = CONFIG_SYS_DDR_RCW_2
-};
-
-fsl_ddr_cfg_regs_t ddr_cfg_regs_533 = {
-       .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS,
-       .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG,
-       .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2,
-       .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3_533,
-       .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0_533,
-       .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_533,
-       .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_533,
-       .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL,
-       .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2,
-       .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1_533,
-       .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2_533,
-       .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL,
-       .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL_533,
-       .ddr_data_init = CONFIG_MEM_INIT_VALUE,
-       .ddr_sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL_533,
-       .ddr_init_addr = CONFIG_SYS_DDR_INIT_ADDR,
-       .ddr_init_ext_addr = CONFIG_SYS_DDR_INIT_EXT_ADDR,
-       .timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4,
-       .timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5,
-       .ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CONTROL,
-       .ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CONTROL,
-       .ddr_sr_cntr = CONFIG_SYS_DDR_SR_CNTR,
-       .ddr_sdram_rcw_1 = CONFIG_SYS_DDR_RCW_1,
-       .ddr_sdram_rcw_2 = CONFIG_SYS_DDR_RCW_2
-};
-
-fsl_ddr_cfg_regs_t ddr_cfg_regs_667 = {
-       .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS,
-       .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG,
-       .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2,
-       .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3_667,
-       .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0_667,
-       .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_667,
-       .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_667,
-       .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL,
-       .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2,
-       .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1_667,
-       .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2_667,
-       .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL,
-       .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL_667,
-       .ddr_data_init = CONFIG_MEM_INIT_VALUE,
-       .ddr_sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL_667,
-       .ddr_init_addr = CONFIG_SYS_DDR_INIT_ADDR,
-       .ddr_init_ext_addr = CONFIG_SYS_DDR_INIT_EXT_ADDR,
-       .timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4,
-       .timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5,
-       .ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CONTROL,
-       .ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CONTROL,
-       .ddr_sr_cntr = CONFIG_SYS_DDR_SR_CNTR,
-       .ddr_sdram_rcw_1 = CONFIG_SYS_DDR_RCW_1,
-       .ddr_sdram_rcw_2 = CONFIG_SYS_DDR_RCW_2
-};
-
-fsl_ddr_cfg_regs_t ddr_cfg_regs_800 = {
-       .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS,
-       .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG,
-       .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2,
-       .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3_800,
-       .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0_800,
-       .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_800,
-       .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_800,
-       .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL,
-       .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2,
-       .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1_800,
-       .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2_800,
-       .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL,
-       .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL_800,
-       .ddr_data_init = CONFIG_MEM_INIT_VALUE,
-       .ddr_sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL_800,
-       .ddr_init_addr = CONFIG_SYS_DDR_INIT_ADDR,
-       .ddr_init_ext_addr = CONFIG_SYS_DDR_INIT_EXT_ADDR,
-       .timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4,
-       .timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5,
-       .ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CONTROL,
-       .ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CONTROL,
-       .ddr_sr_cntr = CONFIG_SYS_DDR_SR_CNTR,
-       .ddr_sdram_rcw_1 = CONFIG_SYS_DDR_RCW_1,
-       .ddr_sdram_rcw_2 = CONFIG_SYS_DDR_RCW_2
-};
-
-/*
- * Fixed sdram init -- doesn't use serial presence detect.
- */
-
-phys_size_t fixed_sdram (void)
-{
-       fsl_ddr_cfg_regs_t ddr_cfg_regs;
-       size_t ddr_size;
-       struct cpu_type *cpu;
-       ulong ddr_freq, ddr_freq_mhz;
-
-       cpu = gd->arch.cpu;
-
-       ddr_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
-
-#if defined(CONFIG_SYS_RAMBOOT)
-       return ddr_size;
-#endif
-       ddr_freq = get_ddr_freq(0);
-       ddr_freq_mhz = ddr_freq / 1000000;
-
-       printf("Configuring DDR for %ld T/s data rate\n", ddr_freq);
-
-       if(ddr_freq_mhz <= 400)
-               memcpy(&ddr_cfg_regs, &ddr_cfg_regs_400, sizeof(ddr_cfg_regs));
-       else if(ddr_freq_mhz <= 533)
-               memcpy(&ddr_cfg_regs, &ddr_cfg_regs_533, sizeof(ddr_cfg_regs));
-       else if(ddr_freq_mhz <= 667)
-               memcpy(&ddr_cfg_regs, &ddr_cfg_regs_667, sizeof(ddr_cfg_regs));
-       else if(ddr_freq_mhz <= 800)
-               memcpy(&ddr_cfg_regs, &ddr_cfg_regs_800, sizeof(ddr_cfg_regs));
-       else
-               panic("Unsupported DDR data rate %ld T/s\n", ddr_freq);
-
-       /* P1020 and it's derivatives support max 32bit DDR width */
-       if (cpu->soc_ver == SVR_P1020 || cpu->soc_ver == SVR_P1011) {
-               ddr_cfg_regs.ddr_sdram_cfg |= SDRAM_CFG_32_BE;
-               ddr_cfg_regs.cs[0].bnds = 0x0000001F;
-       }
-
-       fsl_ddr_set_memctl_regs(&ddr_cfg_regs, 0, 0);
-
-       set_ddr_laws(0, ddr_size, LAW_TRGT_IF_DDR_1);
-       return ddr_size;
-}
diff --git a/board/freescale/p1_p2_rdb/law.c b/board/freescale/p1_p2_rdb/law.c
deleted file mode 100644 (file)
index b60a27f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/fsl_law.h>
-#include <asm/mmu.h>
-
-struct law_entry law_table[] = {
-       SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_LBC),
-       SET_LAW(CONFIG_SYS_VSC7385_BASE_PHYS, LAW_SIZE_128K, LAW_TRGT_IF_LBC),
-       SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
-};
-
-int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
deleted file mode 100644 (file)
index 61ed466..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <asm/processor.h>
-#include <asm/mmu.h>
-#include <asm/cache.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_serdes.h>
-#include <asm/io.h>
-#include <miiphy.h>
-#include <libfdt.h>
-#include <fdt_support.h>
-#include <fsl_mdio.h>
-#include <tsec.h>
-#include <vsc7385.h>
-#include <netdev.h>
-#include <rtc.h>
-#include <i2c.h>
-#include <hwconfig.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define VSC7385_RST_SET                0x00080000
-#define SLIC_RST_SET           0x00040000
-#define SGMII_PHY_RST_SET      0x00020000
-#define PCIE_RST_SET           0x00010000
-#define RGMII_PHY_RST_SET      0x02000000
-
-#define USB_RST_CLR            0x04000000
-#define USB2_PORT_OUT_EN        0x01000000
-
-#define GPIO_DIR               0x060f0000
-
-#define BOARD_PERI_RST_SET     VSC7385_RST_SET | SLIC_RST_SET | \
-                               SGMII_PHY_RST_SET | PCIE_RST_SET | \
-                               RGMII_PHY_RST_SET
-
-#define SYSCLK_MASK    0x00200000
-#define BOARDREV_MASK  0x10100000
-#define BOARDREV_C     0x00100000
-#define BOARDREV_D     0x00000000
-
-#define SYSCLK_66      66666666
-#define SYSCLK_100     100000000
-
-unsigned long get_board_sys_clk(ulong dummy)
-{
-       volatile ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
-       u32 val_gpdat, sysclk_gpio;
-
-       val_gpdat = in_be32(&pgpio->gpdat);
-       sysclk_gpio = val_gpdat & SYSCLK_MASK;
-
-       if(sysclk_gpio == 0)
-               return SYSCLK_66;
-       else
-               return SYSCLK_100;
-
-       return 0;
-}
-
-#ifdef CONFIG_MMC
-int board_early_init_f (void)
-{
-       volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-
-       setbits_be32(&gur->pmuxcr,
-                       (MPC85xx_PMUXCR_SDHC_CD |
-                        MPC85xx_PMUXCR_SDHC_WP));
-       return 0;
-}
-#endif
-
-int checkboard (void)
-{
-       u32 val_gpdat, board_rev_gpio;
-       volatile ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
-       char board_rev = 0;
-       struct cpu_type *cpu;
-
-       val_gpdat = in_be32(&pgpio->gpdat);
-       board_rev_gpio = val_gpdat & BOARDREV_MASK;
-       if (board_rev_gpio == BOARDREV_C)
-               board_rev = 'C';
-       else if (board_rev_gpio == BOARDREV_D)
-               board_rev = 'D';
-       else
-               panic ("Unexpected Board REV %x detected!!\n", board_rev_gpio);
-
-       cpu = gd->arch.cpu;
-       printf ("Board: %sRDB Rev%c\n", cpu->name, board_rev);
-
-       setbits_be32(&pgpio->gpdir, GPIO_DIR);
-
-/*
- * Bringing the following peripherals out of reset via GPIOs
- * 0 = reset and 1 = out of reset
- * GPIO12 - Reset to Ethernet Switch
- * GPIO13 - Reset to SLIC/SLAC devices
- * GPIO14 - Reset to SGMII_PHY_N
- * GPIO15 - Reset to PCIe slots
- * GPIO6  - Reset to RGMII PHY
- * GPIO5  - Reset to USB3300 devices 1 = reset and 0 = out of reset
- */
-       clrsetbits_be32(&pgpio->gpdat, USB_RST_CLR, BOARD_PERI_RST_SET);
-
-       return 0;
-}
-
-int misc_init_r(void)
-{
-#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
-       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
-       ccsr_gpio_t *gpio = (void *)CONFIG_SYS_MPC85xx_GPIO_ADDR;
-
-       setbits_be32(&gpio->gpdir, USB2_PORT_OUT_EN);
-       setbits_be32(&gpio->gpdat, USB2_PORT_OUT_EN);
-       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_ELBC_OFF_USB2_ON);
-#endif
-       return 0;
-}
-
-int board_early_init_r(void)
-{
-       const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-       int flash_esel = find_tlb_idx((void *)flashbase, 1);
-       volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       unsigned int orig_bus = i2c_get_bus_num();
-       u8 i2c_data;
-
-       i2c_set_bus_num(1);
-       if (i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 0,
-               1, &i2c_data, sizeof(i2c_data)) == 0) {
-               if (i2c_data & 0x2)
-                       puts("NOR Flash Bank : Secondary\n");
-               else
-                       puts("NOR Flash Bank : Primary\n");
-
-               if (i2c_data & 0x1) {
-                       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_SD_DATA);
-                       puts("SD/MMC : 8-bit Mode\n");
-                       puts("eSPI : Disabled\n");
-               } else {
-                       puts("SD/MMC : 4-bit Mode\n");
-                       puts("eSPI : Enabled\n");
-               }
-       } else {
-               puts("Failed reading I2C Chip 0x18 on bus 1\n");
-       }
-       i2c_set_bus_num(orig_bus);
-
-       /*
-        * Remap Boot flash region to caching-inhibited
-        * so that flash can be erased properly.
-        */
-
-       /* Flush d-cache and invalidate i-cache of any FLASH data */
-       flush_dcache();
-       invalidate_icache();
-
-       if (flash_esel == -1) {
-               /* very unlikely unless something is messed up */
-               puts("Error: Could not find TLB for FLASH BASE\n");
-               flash_esel = 2; /* give our best effort to continue */
-       } else {
-               /* invalidate existing TLB entry for flash */
-               disable_tlb(flash_esel);
-       }
-
-       set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, flash_esel, BOOKE_PAGESZ_16M, 1);
-       rtc_reset();
-       return 0;
-}
-
-
-#ifdef CONFIG_TSEC_ENET
-int board_eth_init(bd_t *bis)
-{
-       struct fsl_pq_mdio_info mdio_info;
-       struct tsec_info_struct tsec_info[4];
-       int num = 0;
-       char *tmp;
-       unsigned int vscfw_addr;
-
-#ifdef CONFIG_TSEC1
-       SET_STD_TSEC_INFO(tsec_info[num], 1);
-       num++;
-#endif
-#ifdef CONFIG_TSEC2
-       SET_STD_TSEC_INFO(tsec_info[num], 2);
-       num++;
-#endif
-#ifdef CONFIG_TSEC3
-       SET_STD_TSEC_INFO(tsec_info[num], 3);
-       if (is_serdes_configured(SGMII_TSEC3)) {
-               puts("eTSEC3 is in sgmii mode.\n");
-               tsec_info[num].flags |= TSEC_SGMII;
-       }
-       num++;
-#endif
-       if (!num) {
-               printf("No TSECs initialized\n");
-               return 0;
-       }
-#ifdef CONFIG_VSC7385_ENET
-/* If a VSC7385 microcode image is present, then upload it. */
-       if ((tmp = getenv ("vscfw_addr")) != NULL) {
-               vscfw_addr = simple_strtoul (tmp, NULL, 16);
-               printf("uploading VSC7385 microcode from %x\n", vscfw_addr);
-               if (vsc7385_upload_firmware((void *) vscfw_addr,
-                                       CONFIG_VSC7385_IMAGE_SIZE))
-                       puts("Failure uploading VSC7385 microcode.\n");
-       } else
-               puts("No address specified for VSC7385 microcode.\n");
-#endif
-
-       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
-       mdio_info.name = DEFAULT_MII_NAME;
-       fsl_pq_mdio_init(bis, &mdio_info);
-
-       tsec_eth_init(bis, tsec_info, num);
-
-       return pci_eth_init(bis);
-}
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-extern void ft_pci_board_setup(void *blob);
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       const char *soc_usb_compat = "fsl-usb2-dr";
-       int err, usb1_off, usb2_off;
-       phys_addr_t base;
-       phys_size_t size;
-
-       ft_cpu_setup(blob, bd);
-
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
-
-#if defined(CONFIG_PCI)
-       ft_pci_board_setup(blob);
-#endif /* #if defined(CONFIG_PCI) */
-
-       fdt_fixup_memory(blob, (u64)base, (u64)size);
-
-#if defined(CONFIG_HAS_FSL_DR_USB)
-       fdt_fixup_dr_usb(blob, bd);
-#endif
-
-#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
-       /* Delete eLBC node as it is muxed with USB2 controller */
-       if (hwconfig("usb2")) {
-               const char *soc_elbc_compat = "fsl,p1020-elbc";
-               int off = fdt_node_offset_by_compatible(blob, -1,
-                       soc_elbc_compat);
-               if (off < 0) {
-                       printf("WARNING: could not find compatible node %s\n",
-                              soc_elbc_compat);
-                       return off;
-               }
-               err = fdt_del_node(blob, off);
-               if (err < 0) {
-                       printf("WARNING: could not remove %s\n",
-                              soc_elbc_compat);
-                       return err;
-               }
-               return 0;
-       }
-#endif
-       /* Delete USB2 node as it is muxed with eLBC */
-       usb1_off = fdt_node_offset_by_compatible(blob, -1,
-               soc_usb_compat);
-       if (usb1_off < 0) {
-               printf("WARNING: could not find compatible node %s\n",
-                      soc_usb_compat);
-               return usb1_off;
-       }
-       usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,
-                       soc_usb_compat);
-       if (usb2_off < 0) {
-               printf("WARNING: could not find compatible node %s\n",
-                      soc_usb_compat);
-               return usb2_off;
-       }
-       err = fdt_del_node(blob, usb2_off);
-       if (err < 0) {
-               printf("WARNING: could not remove %s\n", soc_usb_compat);
-               return err;
-       }
-
-       return 0;
-}
-
-#endif
diff --git a/board/freescale/p1_p2_rdb/pci.c b/board/freescale/p1_p2_rdb/pci.c
deleted file mode 100644 (file)
index 745ebb1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2009-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <pci.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_serdes.h>
-#include <asm/io.h>
-#include <asm/fsl_pci.h>
-#include <libfdt.h>
-#include <fdt_support.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void pci_init_board(void)
-{
-       fsl_pcie_init_board(0);
-}
-
-void ft_pci_board_setup(void *blob)
-{
-       FT_FSL_PCI_SETUP;
-}
diff --git a/board/freescale/p1_p2_rdb/spl.c b/board/freescale/p1_p2_rdb/spl.c
deleted file mode 100644 (file)
index f30c5fe..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <ns16550.h>
-#include <malloc.h>
-#include <mmc.h>
-#include <nand.h>
-#include <i2c.h>
-#include <fsl_esdhc.h>
-#include <spi_flash.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define SYSCLK_MASK    0x00200000
-#define BOARDREV_MASK  0x10100000
-
-#define SYSCLK_66      66666666
-#define SYSCLK_100     100000000
-
-unsigned long get_board_sys_clk(ulong dummy)
-{
-       ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
-       u32 val_gpdat, sysclk_gpio;
-
-       val_gpdat = in_be32(&pgpio->gpdat);
-       sysclk_gpio = val_gpdat & SYSCLK_MASK;
-
-       if (sysclk_gpio == 0)
-               return SYSCLK_66;
-       else
-               return SYSCLK_100;
-
-       return 0;
-}
-
-phys_size_t get_effective_memsize(void)
-{
-       return CONFIG_SYS_L2_SIZE;
-}
-
-void board_init_f(ulong bootflag)
-{
-       u32 plat_ratio, bus_clk;
-       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
-
-       console_init_f();
-
-       /* Set pmuxcr to allow both i2c1 and i2c2 */
-       setbits_be32(&gur->pmuxcr, in_be32(&gur->pmuxcr) | 0x1000);
-       setbits_be32(&gur->pmuxcr,
-                    in_be32(&gur->pmuxcr) | MPC85xx_PMUXCR_SD_DATA);
-
-       /* Read back the register to synchronize the write. */
-       in_be32(&gur->pmuxcr);
-
-#ifdef CONFIG_SPL_SPI_BOOT
-       clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_SD_DATA);
-#endif
-
-       /* initialize selected port with appropriate baud rate */
-       plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
-       plat_ratio >>= 1;
-       bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
-       gd->bus_clk = bus_clk;
-
-       NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
-                    bus_clk / 16 / CONFIG_BAUDRATE);
-#ifdef CONFIG_SPL_MMC_BOOT
-       puts("\nSD boot...\n");
-#elif defined(CONFIG_SPL_SPI_BOOT)
-       puts("\nSPI Flash boot...\n");
-#endif
-
-       /* copy code to RAM and jump to it - this should not return */
-       /* NOTE - code has to be copied out of NAND buffer before
-        * other blocks can be read.
-        */
-       relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
-}
-
-void board_init_r(gd_t *gd, ulong dest_addr)
-{
-       /* Pointer is writable since we allocated a register for it */
-       gd = (gd_t *)CONFIG_SPL_GD_ADDR;
-       bd_t *bd;
-
-       memset(gd, 0, sizeof(gd_t));
-       bd = (bd_t *)(CONFIG_SPL_GD_ADDR + sizeof(gd_t));
-       memset(bd, 0, sizeof(bd_t));
-       gd->bd = bd;
-       bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR;
-       bd->bi_memsize = CONFIG_SYS_L2_SIZE;
-
-       probecpu();
-       get_clocks();
-       mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR,
-                       CONFIG_SPL_RELOC_MALLOC_SIZE);
-
-#ifdef CONFIG_SPL_MMC_BOOT
-       mmc_initialize(bd);
-#endif
-       /* relocate environment function pointers etc. */
-#ifdef CONFIG_SPL_NAND_BOOT
-       nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                           (uchar *)CONFIG_ENV_ADDR);
-#endif
-#ifdef CONFIG_SPL_NAND_BOOT
-       nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                           (uchar *)CONFIG_ENV_ADDR);
-#endif
-#ifdef CONFIG_SPL_MMC_BOOT
-       mmc_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
-#endif
-#ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
-#endif
-
-       gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
-       gd->env_valid = 1;
-
-       gd->ram_size = initdram(0);
-#ifdef CONFIG_SPL_NAND_BOOT
-       puts("Tertiary program loader running in sram...");
-#else
-       puts("Second program loader running in sram...\n");
-#endif
-
-#ifdef CONFIG_SPL_MMC_BOOT
-       mmc_boot();
-#elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
-#elif defined(CONFIG_SPL_NAND_BOOT)
-       nand_boot();
-#endif
-}
diff --git a/board/freescale/p1_p2_rdb/spl_minimal.c b/board/freescale/p1_p2_rdb/spl_minimal.c
deleted file mode 100644 (file)
index 96a4d1c..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <ns16550.h>
-#include <asm/io.h>
-#include <nand.h>
-#include <linux/compiler.h>
-#include <asm/fsl_law.h>
-#include <fsl_ddr_sdram.h>
-#include <asm/global_data.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-#define SYSCLK_MASK    0x00200000
-#define BOARDREV_MASK  0x10100000
-
-#define SYSCLK_66      66666666
-#define SYSCLK_100     100000000
-
-unsigned long get_board_sys_clk(ulong dummy)
-{
-       ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
-       u32 val_gpdat, sysclk_gpio;
-
-       val_gpdat = in_be32(&pgpio->gpdat);
-       sysclk_gpio = val_gpdat & SYSCLK_MASK;
-
-       if (sysclk_gpio == 0)
-               return SYSCLK_66;
-       else
-               return SYSCLK_100;
-
-       return 0;
-}
-
-void board_init_f(ulong bootflag)
-{
-       u32 plat_ratio;
-       ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
-
-#if defined(CONFIG_SYS_NAND_BR_PRELIM) && defined(CONFIG_SYS_NAND_OR_PRELIM)
-       set_lbc_br(0, CONFIG_SYS_NAND_BR_PRELIM);
-       set_lbc_or(0, CONFIG_SYS_NAND_OR_PRELIM);
-#endif
-
-       /* initialize selected port with appropriate baud rate */
-       plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
-       plat_ratio >>= 1;
-       gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
-
-       NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
-                    gd->bus_clk / 16 / CONFIG_BAUDRATE);
-
-       puts("\nNAND boot... ");
-
-       /* copy code to RAM and jump to it - this should not return */
-       /* NOTE - code has to be copied out of NAND buffer before
-        * other blocks can be read.
-        */
-       relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
-}
-
-void board_init_r(gd_t *gd, ulong dest_addr)
-{
-       puts("\nSecond program loader running in sram...");
-       nand_boot();
-}
-
-void putc(char c)
-{
-       if (c == '\n')
-               NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
-
-       NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
-}
-
-void puts(const char *str)
-{
-       while (*str)
-               putc(*str++);
-}
diff --git a/board/freescale/p1_p2_rdb/tlb.c b/board/freescale/p1_p2_rdb/tlb.c
deleted file mode 100644 (file)
index 73f5729..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mmu.h>
-
-struct fsl_e_tlb_entry tlb_table[] = {
-       /* TLB 0 - for temp stack in cache */
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
-                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
-                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
-                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-
-       /* TLB 1 */
-       /* *I*** - Covers boot page */
-       SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 0, BOOKE_PAGESZ_4K, 1),
-
-       /* *I*G* - CCSRBAR */
-       SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 1, BOOKE_PAGESZ_1M, 1),
-
-#ifndef CONFIG_SPL_BUILD
-       /* W**G* - Flash/promjet, localbus */
-       /* This will be changed to *I*G* after relocation to RAM. */
-       SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
-                       MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
-                       0, 2, BOOKE_PAGESZ_16M, 1),
-
-#if defined(CONFIG_PCI)
-       /* *I*G* - PCI */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 3, BOOKE_PAGESZ_1G, 1),
-
-       /* *I*G* - PCI I/O */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 4, BOOKE_PAGESZ_256K, 1),
-
-#endif /* #if defined(CONFIG_PCI) */
-#endif
-       /* *I*G - NAND */
-       SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 5, BOOKE_PAGESZ_1M, 1),
-
-       /* *I*G - VSC7385 Switch */
-       SET_TLB_ENTRY(1, CONFIG_SYS_VSC7385_BASE, CONFIG_SYS_VSC7385_BASE_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 6, BOOKE_PAGESZ_1M, 1),
-
-#ifdef CONFIG_SYS_INIT_L2_ADDR
-       /* *I*G - L2SRAM */
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_G,
-                     0, 11, BOOKE_PAGESZ_256K, 1),
-#if CONFIG_SYS_L2_SIZE >= (256 << 10)
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
-                     CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 12, BOOKE_PAGESZ_256K, 1),
-#endif
-#endif
-
-#if defined(CONFIG_SYS_RAMBOOT) || \
-       (defined(CONFIG_SPL) && !defined(CONFIG_SPL_COMMON_INIT_DDR))
-       SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
-                       MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                       0, 7, BOOKE_PAGESZ_1G, 1)
-#endif
-};
-
-int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/board/freescale/p2020come/Kconfig b/board/freescale/p2020come/Kconfig
deleted file mode 100644 (file)
index 8ce5cf1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_P2020COME
-
-config SYS_BOARD
-       default "p2020come"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "P2020COME"
-
-endif
diff --git a/board/freescale/p2020come/MAINTAINERS b/board/freescale/p2020come/MAINTAINERS
deleted file mode 100644 (file)
index ab3ef94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-P2020COME BOARD
-M:     Ira W. Snyder <iws@ovro.caltech.edu>
-S:     Maintained
-F:     board/freescale/p2020come/
-F:     include/configs/P2020COME.h
-F:     configs/P2020COME_SDCARD_defconfig
-F:     configs/P2020COME_SPIFLASH_defconfig
diff --git a/board/freescale/p2020come/Makefile b/board/freescale/p2020come/Makefile
deleted file mode 100644 (file)
index 4857136..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright 2009 Freescale Semiconductor, Inc.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y                  += p2020come.o
-obj-y                  += ddr.o
-obj-y                  += law.o
-obj-y                  += tlb.o
diff --git a/board/freescale/p2020come/ddr.c b/board/freescale/p2020come/ddr.c
deleted file mode 100644 (file)
index b642e12..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2009, 2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-#include <common.h>
-
-#include <fsl_ddr_sdram.h>
-#include <fsl_ddr_dimm_params.h>
-
-void fsl_ddr_board_options(memctl_options_t *popts,
-                               dimm_params_t *pdimm,
-                               unsigned int ctrl_num)
-{
-       if (ctrl_num) {
-               printf("Wrong parameter for controller number %d", ctrl_num);
-               return;
-       }
-
-       if (!pdimm->n_ranks)
-               return;
-
-       /*
-        * Set DDR_SDRAM_CLK_CNTL = 0x02800000
-        *
-        * Clock is launched 5/8 applied cycle after address/command
-        */
-       popts->clk_adjust = 5;
-}
diff --git a/board/freescale/p2020come/law.c b/board/freescale/p2020come/law.c
deleted file mode 100644 (file)
index 7048a08..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2009 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/fsl_law.h>
-#include <asm/mmu.h>
-
-/*
- * Create a dummy LAW entry for the DDR SDRAM which will be replaced when
- * the DDR SPD setup code runs.
- *
- * This table would be empty, except that it is used before the BSS section is
- * initialized, and therefore must have at least one entry to push it into
- * the DATA section.
- */
-struct law_entry law_table[] = {
-       SET_LAW(CONFIG_SYS_SDRAM_BASE, LAW_SIZE_4K, LAW_TRGT_IF_DDR),
-};
-
-int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/p2020come/p2020come.c b/board/freescale/p2020come/p2020come.c
deleted file mode 100644 (file)
index 1db37e3..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright 2009,2012 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <hwconfig.h>
-#include <command.h>
-#include <asm/processor.h>
-#include <asm/mmu.h>
-#include <asm/cache.h>
-#include <asm/immap_85xx.h>
-#include <asm/mpc85xx_gpio.h>
-#include <asm/fsl_serdes.h>
-#include <asm/io.h>
-#include <miiphy.h>
-#include <libfdt.h>
-#include <fdt_support.h>
-#include <fsl_mdio.h>
-#include <tsec.h>
-#include <vsc7385.h>
-#include <netdev.h>
-#include <mmc.h>
-#include <malloc.h>
-#include <i2c.h>
-
-#if defined(CONFIG_PCI)
-#include <asm/fsl_pci.h>
-#include <pci.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#if defined(CONFIG_PCI)
-void pci_init_board(void)
-{
-       fsl_pcie_init_board(0);
-}
-
-void ft_pci_board_setup(void *blob)
-{
-       FT_FSL_PCI_SETUP;
-}
-#endif
-
-#define BOARD_PERI_RST_SET     (VSC7385_RST_SET | SLIC_RST_SET | \
-                                SGMII_PHY_RST_SET | PCIE_RST_SET | \
-                                RGMII_PHY_RST_SET)
-
-#define SYSCLK_MASK    0x00200000
-#define BOARDREV_MASK  0x10100000
-#define BOARDREV_B     0x10100000
-#define BOARDREV_C     0x00100000
-#define BOARDREV_D     0x00000000
-
-#define SYSCLK_66      66666666
-#define SYSCLK_50      50000000
-#define SYSCLK_100     100000000
-
-unsigned long get_board_sys_clk(ulong dummy)
-{
-       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       u32 ddr_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO;
-
-       ddr_ratio >>= MPC85xx_PORPLLSR_DDR_RATIO_SHIFT;
-       switch (ddr_ratio) {
-       case 0x0C:
-               return SYSCLK_66;
-       case 0x0A:
-       case 0x08:
-               return SYSCLK_100;
-       default:
-               puts("ERROR: unknown DDR ratio\n");
-               return SYSCLK_100;
-       }
-}
-
-unsigned long get_board_ddr_clk(ulong dummy)
-{
-       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       u32 ddr_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO;
-
-       ddr_ratio >>= MPC85xx_PORPLLSR_DDR_RATIO_SHIFT;
-       switch (ddr_ratio) {
-       case 0x0C:
-       case 0x0A:
-               return SYSCLK_66;
-       case 0x08:
-               return SYSCLK_100;
-       default:
-               puts("ERROR: unknown DDR ratio\n");
-               return SYSCLK_100;
-       }
-}
-
-#ifdef CONFIG_MMC
-int board_early_init_f(void)
-{
-       ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-
-       setbits_be32(&gur->pmuxcr,
-                       (MPC85xx_PMUXCR_SDHC_CD |
-                        MPC85xx_PMUXCR_SDHC_WP));
-
-       /* All the device are enable except for SRIO12 */
-       setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_SRIO);
-       return 0;
-}
-#endif
-
-#define GPIO_DIR               0x0f3a0000
-#define GPIO_ODR               0x00000000
-#define GPIO_DAT               0x001a0000
-
-int checkboard(void)
-{
-       ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xC00);
-
-       /*
-        * GPIO
-        * 0 - 3: CarryBoard Input;
-        * 4 - 7: CarryBoard Output;
-        * 8 : Mux as SDHC_CD (card detection)
-        * 9 : Mux as SDHC_WP
-        * 10 : Clear Watchdog timer
-        * 11 : LED Input
-        * 12 : Output to 1
-        * 13 : Open Drain
-        * 14 : LED Output
-        * 15 : Switch Input
-        *
-        * Set GPIOs 11, 12, 14 to 1.
-        */
-       out_be32(&pgpio->gpodr, GPIO_ODR);
-       mpc85xx_gpio_set(0xffffffff, GPIO_DIR, GPIO_DAT);
-
-       puts("Board: Freescale COM Express P2020\n");
-       return 0;
-}
-
-#define M41ST85W_I2C_BUS       1
-#define M41ST85W_I2C_ADDR      0x68
-#define M41ST85W_ERROR(fmt, args...) printf("ERROR: M41ST85W: " fmt, ##args)
-
-static void m41st85w_clear_bit(u8 reg, u8 mask, const char *name)
-{
-       u8 data;
-
-       if (i2c_read(M41ST85W_I2C_ADDR, reg, 1, &data, 1)) {
-               M41ST85W_ERROR("unable to read %s bit\n", name);
-               return;
-       }
-
-       if (data & mask) {
-               data &= ~mask;
-               if (i2c_write(M41ST85W_I2C_ADDR, reg, 1, &data, 1)) {
-                       M41ST85W_ERROR("unable to clear %s bit\n", name);
-                       return;
-               }
-       }
-}
-
-#define M41ST85W_REG_SEC2      0x01
-#define M41ST85W_REG_SEC2_ST   0x80
-
-#define M41ST85W_REG_ALHOUR    0x0c
-#define M41ST85W_REG_ALHOUR_HT 0x40
-
-/*
- * The P2020COME board has a STMicro M41ST85W RTC/watchdog
- * at i2c bus 1 address 0x68.
- */
-static void start_rtc(void)
-{
-       unsigned int bus = i2c_get_bus_num();
-
-       if (i2c_set_bus_num(M41ST85W_I2C_BUS)) {
-               M41ST85W_ERROR("unable to set i2c bus\n");
-               goto out;
-       }
-
-       /* ensure ST (stop) and HT (halt update) bits are cleared */
-       m41st85w_clear_bit(M41ST85W_REG_SEC2, M41ST85W_REG_SEC2_ST, "ST");
-       m41st85w_clear_bit(M41ST85W_REG_ALHOUR, M41ST85W_REG_ALHOUR_HT, "HT");
-
-out:
-       /* reset the i2c bus */
-       i2c_set_bus_num(bus);
-}
-
-int board_early_init_r(void)
-{
-       start_rtc();
-       return 0;
-}
-
-#define M41ST85W_REG_WATCHDOG          0x09
-#define M41ST85W_REG_WATCHDOG_WDS      0x80
-#define M41ST85W_REG_WATCHDOG_BMB0     0x04
-
-void board_reset(void)
-{
-       u8 data = M41ST85W_REG_WATCHDOG_WDS | M41ST85W_REG_WATCHDOG_BMB0;
-
-       /* set the hardware watchdog timeout to 1/16 second, then hang */
-       i2c_set_bus_num(M41ST85W_I2C_BUS);
-       i2c_write(M41ST85W_I2C_ADDR, M41ST85W_REG_WATCHDOG, 1, &data, 1);
-
-       while (1)
-               /* hang */;
-}
-
-#ifdef CONFIG_TSEC_ENET
-int board_eth_init(bd_t *bis)
-{
-       struct fsl_pq_mdio_info mdio_info;
-       struct tsec_info_struct tsec_info[4];
-       int num = 0;
-
-#ifdef CONFIG_TSEC1
-       SET_STD_TSEC_INFO(tsec_info[num], 1);
-       num++;
-#endif
-#ifdef CONFIG_TSEC2
-       SET_STD_TSEC_INFO(tsec_info[num], 2);
-       num++;
-#endif
-#ifdef CONFIG_TSEC3
-       SET_STD_TSEC_INFO(tsec_info[num], 3);
-       if (is_serdes_configured(SGMII_TSEC3)) {
-               puts("eTSEC3 is in sgmii mode.");
-               tsec_info[num].flags |= TSEC_SGMII;
-       }
-       num++;
-#endif
-       if (!num) {
-               printf("No TSECs initialized\n");
-               return 0;
-       }
-
-       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
-       mdio_info.name = DEFAULT_MII_NAME;
-       fsl_pq_mdio_init(bis, &mdio_info);
-
-       tsec_eth_init(bis, tsec_info, num);
-
-       return pci_eth_init(bis);
-}
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       phys_addr_t base;
-       phys_size_t size;
-
-       ft_cpu_setup(blob, bd);
-
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
-
-#if defined(CONFIG_PCI)
-       ft_pci_board_setup(blob);
-#endif
-
-       fdt_fixup_memory(blob, (u64)base, (u64)size);
-
-#ifdef CONFIG_HAS_FSL_DR_USB
-       fdt_fixup_dr_usb(blob, bd);
-#endif
-
-       return 0;
-}
-#endif
diff --git a/board/freescale/p2020come/tlb.c b/board/freescale/p2020come/tlb.c
deleted file mode 100644 (file)
index 08a1e34..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mmu.h>
-
-struct fsl_e_tlb_entry tlb_table[] = {
-       /* TLB 0 - for temp stack in cache */
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS,
-                       MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
-                       MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
-                       MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 ,
-                       CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
-                       MAS3_SW|MAS3_SR, 0,
-                       0, 0, BOOKE_PAGESZ_4K, 0),
-
-       /* TLB 1 */
-       /* *I*** - Covers boot page */
-       SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 0, BOOKE_PAGESZ_4K, 1),
-
-       /* *I*G* - CCSRBAR */
-       SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
-                       MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 1, BOOKE_PAGESZ_1M, 1),
-
-#if defined(CONFIG_PCI)
-       /* *I*G* - PCI3 - PCI2 0x8000,0000 - 0xbfff,ffff, size = 1G */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT, CONFIG_SYS_PCIE3_MEM_PHYS,
-                       MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 2, BOOKE_PAGESZ_1G, 1),
-
-       /* *I*G* - PCI1 0xC000,0000 - 0xcfff,ffff, size = 256M */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_VIRT,
-                       MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 3, BOOKE_PAGESZ_256M, 1),
-
-       /* *I*G* - PCI1  0xD000,0000 - 0xDFFF,FFFF, size = 256M */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT + 0x10000000,
-                       CONFIG_SYS_PCIE1_MEM_PHYS + 0x10000000,
-                       MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 4, BOOKE_PAGESZ_256M, 1),
-
-       /*
-        * *I*G* - PCI I/O
-        *
-        * PCI3 => 0xFFC10000
-        * PCI2 => 0xFFC2,0000
-        * PCI1 => 0xFFC3,0000
-        */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_IO_VIRT, CONFIG_SYS_PCIE3_IO_PHYS,
-                       MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 5, BOOKE_PAGESZ_256K, 1),
-#endif /* #if defined(CONFIG_PCI) */
-
-#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
-       /* *I*G - DDR3  2G     Part 1: 0 - 0x3fff,ffff , size = 1G */
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 6, BOOKE_PAGESZ_256K, 1),
-
-       /*        DDR3  2G     Part 2: 0x4000,0000 - 0x7fff,ffff , size = 1G */
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
-                       CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, 7, BOOKE_PAGESZ_256K, 1),
-#endif
-};
-
-int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/board/freescale/p2020ds/Kconfig b/board/freescale/p2020ds/Kconfig
deleted file mode 100644 (file)
index e527ec9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_P2020DS
-
-config SYS_BOARD
-       default "p2020ds"
-
-config SYS_VENDOR
-       default "freescale"
-
-config SYS_CONFIG_NAME
-       default "P2020DS"
-
-endif
diff --git a/board/freescale/p2020ds/MAINTAINERS b/board/freescale/p2020ds/MAINTAINERS
deleted file mode 100644 (file)
index cb61fc5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-P2020DS BOARD
-#M:    -
-S:     Maintained
-F:     board/freescale/p2020ds/
-F:     include/configs/P2020DS.h
-F:     configs/P2020DS_defconfig
-F:     configs/P2020DS_36BIT_defconfig
-F:     configs/P2020DS_DDR2_defconfig
-F:     configs/P2020DS_SDCARD_defconfig
-F:     configs/P2020DS_SPIFLASH_defconfig
diff --git a/board/freescale/p2020ds/Makefile b/board/freescale/p2020ds/Makefile
deleted file mode 100644 (file)
index ee00806..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright 2007-2009 Freescale Semiconductor, Inc.
-# (C) Copyright 2001-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  += p2020ds.o
-obj-y  += ddr.o
-obj-y  += law.o
-obj-y  += tlb.o
diff --git a/board/freescale/p2020ds/ddr.c b/board/freescale/p2020ds/ddr.c
deleted file mode 100644 (file)
index debe70b..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- */
-
-#include <common.h>
-
-#include <fsl_ddr_sdram.h>
-#include <fsl_ddr_dimm_params.h>
-
-struct board_specific_parameters {
-       u32 n_ranks;
-       u32 datarate_mhz_high;
-       u32 clk_adjust;
-       u32 cpo;
-       u32 write_data_delay;
-       u32 force_2t;
-};
-
-
-/*
- * This table contains all valid speeds we want to override with board
- * specific parameters. datarate_mhz_high values need to be in ascending order
- * for each n_ranks group.
- *
- * ranges for parameters:
- *  wr_data_delay = 0-6
- *  clk adjust = 0-8
- *  cpo 2-0x1E (30)
- */
-static const struct board_specific_parameters dimm0[] = {
-       /*
-        * memory controller 0
-        *   num|  hi|  clk| cpo|wrdata|2T
-        * ranks| mhz|adjst|    | delay|
-        */
-#ifdef CONFIG_SYS_FSL_DDR2
-       {2,  549,    4,   0x1f,    2,  0},
-       {2,  680,    4,   0x1f,    3,  0},
-       {2,  850,    4,   0x1f,    4,  0},
-       {1,  549,    4,   0x1f,    2,  0},
-       {1,  680,    4,   0x1f,    3,  0},
-       {1,  850,    4,   0x1f,    4,  0},
-#else
-       {2,  850,    6,   0x1f,    4,  0},
-       {1,  850,    4,   0x1f,    4,  0},
-#endif
-       {}
-};
-
-void fsl_ddr_board_options(memctl_options_t *popts,
-                               dimm_params_t *pdimm,
-                               unsigned int ctrl_num)
-{
-       const struct board_specific_parameters *pbsp, *pbsp_highest = NULL;
-       ulong ddr_freq;
-       int i;
-
-       if (ctrl_num) {
-               printf("Wrong parameter for controller number %d", ctrl_num);
-               return;
-       }
-       if (!pdimm->n_ranks)
-               return;
-
-       /*
-        * set odt_rd_cfg and odt_wr_cfg. If the there is only one dimm in
-        * that controller, set odt_wr_cfg to 4 for CS0, and 0 to CS1. If
-        * there are two dimms in the controller, set odt_rd_cfg to 3 and
-        * odt_wr_cfg to 3 for the even CS, 0 for the odd CS.
-        */
-       for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
-               popts->cs_local_opts[i].odt_rd_cfg = 0;
-               popts->cs_local_opts[i].odt_wr_cfg = 1;
-       }
-
-       pbsp = dimm0;
-
-       /* Get clk_adjust, cpo, write_data_delay,2T, according to the board ddr
-        * freqency and n_banks specified in board_specific_parameters table.
-        */
-       ddr_freq = get_ddr_freq(0) / 1000000;
-       while (pbsp->datarate_mhz_high) {
-               if (pbsp->n_ranks == pdimm->n_ranks) {
-                       if (ddr_freq <= pbsp->datarate_mhz_high) {
-                               popts->clk_adjust = pbsp->clk_adjust;
-                               popts->cpo_override = pbsp->cpo;
-                               popts->write_data_delay =
-                                       pbsp->write_data_delay;
-                               popts->twot_en = pbsp->force_2t;
-                               goto found;
-                       }
-                       pbsp_highest = pbsp;
-               }
-               pbsp++;
-       }
-
-       if (pbsp_highest) {
-               printf("Error: board specific timing not found "
-                       "for data rate %lu MT/s!\n"
-                       "Trying to use the highest speed (%u) parameters\n",
-                       ddr_freq, pbsp_highest->datarate_mhz_high);
-               popts->clk_adjust = pbsp_highest->clk_adjust;
-               popts->cpo_override = pbsp_highest->cpo;
-               popts->write_data_delay = pbsp_highest->write_data_delay;
-               popts->twot_en = pbsp_highest->force_2t;
-       } else {
-               panic("DIMM is not supported by this board");
-       }
-
-found:
-       /*
-        * Factors to consider for half-strength driver enable:
-        *      - number of DIMMs installed
-        */
-       popts->half_strength_driver_enable = 0;
-       popts->wrlvl_en = 1;
-       /* Write leveling override */
-       popts->wrlvl_override = 1;
-       popts->wrlvl_sample = 0xa;
-       popts->wrlvl_start = 0x8;
-       /* Rtt and Rtt_WR override */
-       popts->rtt_override = 1;
-       popts->rtt_override_value = DDR3_RTT_120_OHM;
-       popts->rtt_wr_override_value = 0; /* Rtt_WR= dynamic ODT off */
-}
diff --git a/board/freescale/p2020ds/law.c b/board/freescale/p2020ds/law.c
deleted file mode 100644 (file)
index 9cd4da9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
- *
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/fsl_law.h>
-#include <asm/mmu.h>
-
-struct law_entry law_table[] = {
-       SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-       SET_LAW(PIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_LBC),
-       SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
-};
-
-int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c
deleted file mode 100644 (file)
index 5d18e8d..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright 2007-2012 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <pci.h>
-#include <asm/processor.h>
-#include <asm/mmu.h>
-#include <asm/cache.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_pci.h>
-#include <fsl_ddr_sdram.h>
-#include <asm/io.h>
-#include <asm/fsl_serdes.h>
-#include <miiphy.h>
-#include <libfdt.h>
-#include <fdt_support.h>
-#include <fsl_mdio.h>
-#include <tsec.h>
-#include <asm/fsl_law.h>
-#include <netdev.h>
-
-#include "../common/ngpixis.h"
-#include "../common/sgmii_riser.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int board_early_init_f(void)
-{
-#ifdef CONFIG_MMC
-       ccsr_gur_t *gur = (ccsr_gur_t *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-
-       setbits_be32(&gur->pmuxcr,
-                        (MPC85xx_PMUXCR_SDHC_CD |
-                        MPC85xx_PMUXCR_SDHC_WP));
-#endif
-
-       return 0;
-}
-
-int checkboard(void)
-{
-       u8 sw;
-
-       printf("Board: P2020DS Sys ID: 0x%02x, "
-              "Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
-               in_8(&pixis->id), in_8(&pixis->arch), in_8(&pixis->scver));
-
-       sw = in_8(&PIXIS_SW(PIXIS_LBMAP_SWITCH));
-       sw = (sw & PIXIS_LBMAP_MASK) >> PIXIS_LBMAP_SHIFT;
-
-       if (sw < 0x8)
-               /* The lower two bits are the actual vbank number */
-               printf("vBank: %d\n", sw & 3);
-       else
-               puts("Promjet\n");
-
-       return 0;
-}
-
-#if !defined(CONFIG_DDR_SPD)
-/*
- * Fixed sdram init -- doesn't use serial presence detect.
- */
-
-phys_size_t fixed_sdram(void)
-{
-       struct ccsr_ddr __iomem *ddr =
-               (struct ccsr_ddr __iomem *)CONFIG_SYS_FSL_DDR_ADDR;
-       uint d_init;
-
-       ddr->cs0_config = CONFIG_SYS_DDR_CS0_CONFIG;
-       ddr->timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3;
-       ddr->timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0;
-       ddr->sdram_mode = CONFIG_SYS_DDR_MODE_1;
-       ddr->sdram_mode_2 = CONFIG_SYS_DDR_MODE_2;
-       ddr->sdram_md_cntl = CONFIG_SYS_DDR_MODE_CTRL;
-       ddr->sdram_interval = CONFIG_SYS_DDR_INTERVAL;
-       ddr->sdram_data_init = CONFIG_SYS_DDR_DATA_INIT;
-       ddr->sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL;
-       ddr->sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL2;
-       ddr->ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CNTL;
-       ddr->ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CNTL;
-       ddr->ddr_cdr1 = CONFIG_SYS_DDR_CDR1;
-       ddr->timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4;
-       ddr->timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5;
-
-       if (!strcmp("performance", getenv("perf_mode"))) {
-               /* Performance Mode Values */
-
-               ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG_PERF;
-               ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS_PERF;
-               ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS_PERF;
-               ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1_PERF;
-               ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2_PERF;
-
-               asm("sync;isync");
-
-               udelay(500);
-
-               ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL_PERF;
-       } else {
-               /* Stable Mode Values */
-
-               ddr->cs1_config = CONFIG_SYS_DDR_CS1_CONFIG;
-               ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS;
-               ddr->cs1_bnds = CONFIG_SYS_DDR_CS1_BNDS;
-               ddr->timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1;
-               ddr->timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2;
-
-               /* ECC will be assumed in stable mode */
-               ddr->err_int_en = CONFIG_SYS_DDR_ERR_INT_EN;
-               ddr->err_disable = CONFIG_SYS_DDR_ERR_DIS;
-               ddr->err_sbe = CONFIG_SYS_DDR_SBE;
-
-               asm("sync;isync");
-
-               udelay(500);
-
-               ddr->sdram_cfg = CONFIG_SYS_DDR_CONTROL;
-       }
-
-#if defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       d_init = 1;
-       debug("DDR - 1st controller: memory initializing\n");
-       /*
-        * Poll until memory is initialized.
-        * 512 Meg at 400 might hit this 200 times or so.
-        */
-       while ((ddr->sdram_cfg_2 & (d_init << 4)) != 0)
-               udelay(1000);
-       debug("DDR: memory initialized\n\n");
-       asm("sync; isync");
-       udelay(500);
-#endif
-
-       if (set_ddr_laws(CONFIG_SYS_DDR_SDRAM_BASE,
-                        CONFIG_SYS_SDRAM_SIZE * 1024 * 1024,
-                        LAW_TRGT_IF_DDR) < 0) {
-               printf("ERROR setting Local Access Windows for DDR\n");
-               return 0;
-       };
-
-       return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
-}
-
-#endif
-
-#ifdef CONFIG_PCI
-void pci_init_board(void)
-{
-       fsl_pcie_init_board(0);
-}
-#endif
-
-int board_early_init_r(void)
-{
-       const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-       int flash_esel = find_tlb_idx((void *)flashbase, 1);
-
-       /*
-        * Remap Boot flash + PROMJET region to caching-inhibited
-        * so that flash can be erased properly.
-        */
-
-       /* Flush d-cache and invalidate i-cache of any FLASH data */
-       flush_dcache();
-       invalidate_icache();
-
-       if (flash_esel == -1) {
-               /* very unlikely unless something is messed up */
-               puts("Error: Could not find TLB for FLASH BASE\n");
-               flash_esel = 2; /* give our best effort to continue */
-       } else {
-               /* invalidate existing TLB entry for flash + promjet */
-               disable_tlb(flash_esel);
-       }
-
-       set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
-                       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                       0, flash_esel, BOOKE_PAGESZ_256M, 1);
-
-       return 0;
-}
-
-#ifdef CONFIG_TSEC_ENET
-int board_eth_init(bd_t *bis)
-{
-       struct fsl_pq_mdio_info mdio_info;
-       struct tsec_info_struct tsec_info[4];
-       int num = 0;
-
-#ifdef CONFIG_TSEC1
-       SET_STD_TSEC_INFO(tsec_info[num], 1);
-       num++;
-#endif
-#ifdef CONFIG_TSEC2
-       SET_STD_TSEC_INFO(tsec_info[num], 2);
-       if (is_serdes_configured(SGMII_TSEC2)) {
-               puts("eTSEC2 is in sgmii mode.\n");
-               tsec_info[num].flags |= TSEC_SGMII;
-       }
-       num++;
-#endif
-#ifdef CONFIG_TSEC3
-       SET_STD_TSEC_INFO(tsec_info[num], 3);
-       if (is_serdes_configured(SGMII_TSEC3)) {
-               puts("eTSEC3 is in sgmii mode.\n");
-               tsec_info[num].flags |= TSEC_SGMII;
-}
-       num++;
-#endif
-
-       if (!num) {
-               printf("No TSECs initialized\n");
-
-               return 0;
-       }
-
-#ifdef CONFIG_FSL_SGMII_RISER
-       fsl_sgmii_riser_init(tsec_info, num);
-#endif
-
-       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
-       mdio_info.name = DEFAULT_MII_NAME;
-
-       fsl_pq_mdio_init(bis, &mdio_info);
-
-       tsec_eth_init(bis, tsec_info, num);
-
-       return pci_eth_init(bis);
-}
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       phys_addr_t base;
-       phys_size_t size;
-
-       ft_cpu_setup(blob, bd);
-
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
-
-       fdt_fixup_memory(blob, (u64)base, (u64)size);
-
-#ifdef CONFIG_HAS_FSL_DR_USB
-       fdt_fixup_dr_usb(blob, bd);
-#endif
-
-       FT_FSL_PCI_SETUP;
-
-#ifdef CONFIG_FSL_SGMII_RISER
-       fsl_sgmii_riser_fdt_fixup(blob);
-#endif
-
-       return 0;
-}
-#endif
diff --git a/board/freescale/p2020ds/tlb.c b/board/freescale/p2020ds/tlb.c
deleted file mode 100644 (file)
index 02da6e8..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2008-2011 Freescale Semiconductor, Inc.
- *
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/mmu.h>
-
-struct fsl_e_tlb_entry tlb_table[] = {
-       /* TLB 0 - for temp stack in cache */
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                     0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
-                     CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
-                     MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                     0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
-                     CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
-                     MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                     0, 0, BOOKE_PAGESZ_4K, 0),
-       SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
-                     CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
-                     MAS3_SX|MAS3_SW|MAS3_SR, 0,
-                     0, 0, BOOKE_PAGESZ_4K, 0),
-
-       /* TLB 1 */
-       /* *I*** - Covers boot page */
-       SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 0, BOOKE_PAGESZ_4K, 1),
-
-       /* *I*G* - CCSRBAR */
-       SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 1, BOOKE_PAGESZ_1M, 1),
-
-       /* W**G* - Flash/promjet, localbus */
-       /* This will be changed to *I*G* after relocation to RAM. */
-       SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
-                     MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
-                     0, 2, BOOKE_PAGESZ_256M, 1),
-
-       /* *I*G* - PCI */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT, CONFIG_SYS_PCIE3_MEM_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 3, BOOKE_PAGESZ_1G, 1),
-
-       /* *I*G* - PCI */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x40000000,
-                     CONFIG_SYS_PCIE3_MEM_PHYS + 0x40000000,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 4, BOOKE_PAGESZ_256M, 1),
-
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x50000000,
-                     CONFIG_SYS_PCIE3_MEM_PHYS + 0x50000000,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 5, BOOKE_PAGESZ_256M, 1),
-
-       /* *I*G* - PCI I/O */
-       SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_IO_VIRT, CONFIG_SYS_PCIE3_IO_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 6, BOOKE_PAGESZ_256K, 1),
-
-       /* *I*G - NAND */
-       SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 7, BOOKE_PAGESZ_1M, 1),
-
-       SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 8, BOOKE_PAGESZ_4K, 1),
-
-#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
-       /* *I*G - L2SRAM */
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 9, BOOKE_PAGESZ_256K, 1),
-       SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
-                     CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
-                     MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-                     0, 10, BOOKE_PAGESZ_256K, 1),
-#endif
-};
-
-int num_tlb_entries = ARRAY_SIZE(tlb_table);
index 46fc64e5280343e36a09c07d4f13fd98ee987d35..2d4d10f351a1082a8eabc47ce19fc132e6314829 100644 (file)
@@ -11,6 +11,7 @@
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
 #include <asm/fsl_law.h>
+#include <asm/mpc85xx_gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -152,6 +153,19 @@ found:
 #endif
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+       void __iomem *qixis_base = (void *)QIXIS_BASE;
+
+       /* does not provide HW signals for power management */
+       clrbits_8(qixis_base + 0x21, 0x2);
+       /* Disable MCKE isolation */
+       gpio_set_value(2, 0);
+       udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
        phys_size_t dram_size;
@@ -166,5 +180,10 @@ phys_size_t initdram(int board_type)
        /* DDR has been initialised by first stage boot loader */
        dram_size =  fsl_ddr_sdram_size();
 #endif
+
+#if defined(CONFIG_DEEP_SLEEP) && !defined(CONFIG_SPL_BUILD)
+       fsl_dp_resume();
+#endif
+
        return dram_size;
 }
index f3141b58e8d05f9a7726c317236dfbcdc9345709..708afcaebfacb4cb22ae214027e264fcb4b4c15d 100644 (file)
 #include <asm/fsl_liodn.h>
 #include <fm_eth.h>
 #include <hwconfig.h>
-#include <asm/mpc85xx_gpio.h>
 #include "../common/qixis.h"
 #include "t102xqds.h"
 #include "t102xqds_qixis.h"
+#include "../common/sleep.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -242,6 +242,16 @@ void board_retimer_ds125df111_init(void)
        i2c_write(I2C_RETIMER_ADDR, 0x64, 1, &reg, 1);
 }
 
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
+       return 0;
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
@@ -395,14 +405,3 @@ void qixis_dump_switch(void)
                printf("SW%d = (0x%02x)\n", i, QIXIS_READ(cms[1]));
        }
 }
-
-#ifdef CONFIG_DEEP_SLEEP
-void board_mem_sleep_setup(void)
-{
-       /* does not provide HW signals for power management */
-       QIXIS_WRITE(pwr_ctl[1], (QIXIS_READ(pwr_ctl[1]) & ~0x2));
-       /* Disable MCKE isolation */
-       gpio_set_value(2, 0);
-       udelay(1);
-}
-#endif
index 5a3100f6070e29babc627cafe332861b4763f68c..db50f818fbb6606aebfd2f5e692906b448195ca7 100644 (file)
@@ -43,3 +43,7 @@ void cpld_write(unsigned int reg, u8 value);
 #define CPLD_LBMAP_RESET       0xFF
 #define CPLD_LBMAP_SHIFT       0x03
 #define CPLD_BOOT_SEL     0x80
+
+#define CPLD_PCIE_SGMII_MUX    0x80
+#define CPLD_OVERRIDE_BOOT_EN  0x01
+#define CPLD_OVERRIDE_MUX_EN   0x02 /* PCIE/2.5G-SGMII mux override enable */
index a20330b1d013c21a9dca54f3f9987c59b9c41372..a2a8f4ccf0417f9932ebdbe38ea87e160e2dfe5b 100644 (file)
@@ -11,6 +11,7 @@
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
 #include <asm/fsl_law.h>
+#include <asm/mpc85xx_gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -136,6 +137,19 @@ found:
 #endif
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+       void __iomem *cpld_base = (void *)CONFIG_SYS_CPLD_BASE;
+
+       /* does not provide HW signals for power management */
+       clrbits_8(cpld_base + 0x17, 0x40);
+       /* Disable MCKE isolation */
+       gpio_set_value(2, 0);
+       udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
        phys_size_t dram_size;
@@ -150,5 +164,10 @@ phys_size_t initdram(int board_type)
        /* DDR has been initialised by first stage boot loader */
        dram_size =  fsl_ddr_sdram_size();
 #endif
+
+#if defined(CONFIG_DEEP_SLEEP) && !defined(CONFIG_SPL_BUILD)
+       fsl_dp_resume();
+#endif
+
        return dram_size;
 }
index 2e400c4ebf1e12f3dfc04a6c33e942f7d5d34c3a..f611ff07e98cb8858995f5d67c10257ea6b44c2b 100644 (file)
@@ -21,6 +21,7 @@
 #include <phy.h>
 #include <asm/fsl_dtsec.h>
 #include <asm/fsl_serdes.h>
+#include "../common/fman.h"
 
 int board_eth_init(bd_t *bis)
 {
@@ -51,15 +52,22 @@ int board_eth_init(bd_t *bis)
        /* Register the 10G MDIO bus */
        fm_memac_mdio_init(bis, &tgec_mdio_info);
 
-       /* Set the two on-board RGMII PHY address */
-       fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY2_ADDR);
+       /* Set the on-board RGMII PHY address */
        fm_info_set_phy_address(FM1_DTSEC4, RGMII_PHY1_ADDR);
 
        switch (srds_s1) {
        case 0x95:
-               /* 10G XFI with Aquantia PHY */
+               /* set the on-board RGMII2  PHY */
+               fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY2_ADDR);
+
+               /* set 10G XFI with Aquantia AQR105 PHY */
                fm_info_set_phy_address(FM1_10GEC1, FM1_10GEC1_PHY_ADDR);
                break;
+       case 0x77:
+       case 0x135:
+               /* set the on-board 2.5G SGMII AQR105 PHY */
+               fm_info_set_phy_address(FM1_DTSEC3, SGMII_PHY1_ADDR);
+               break;
        default:
                printf("SerDes protocol 0x%x is not supported on T102xRDB\n",
                       srds_s1);
@@ -73,6 +81,10 @@ int board_eth_init(bd_t *bis)
                        dev = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
                        fm_info_set_mdio(i, dev);
                        break;
+               case PHY_INTERFACE_MODE_SGMII_2500:
+                       dev = miiphy_get_dev_by_name(DEFAULT_FM_TGEC_MDIO_NAME);
+                       fm_info_set_mdio(i, dev);
+                       break;
                default:
                        break;
                }
@@ -95,6 +107,18 @@ int board_eth_init(bd_t *bis)
        return pci_eth_init(bis);
 }
 
+void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
+                             enum fm_port port, int offset)
+{
+       if ((fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII_2500) &&
+           (port == FM1_DTSEC3)) {
+               fdt_set_phy_handle(fdt, compat, addr, "sg_2500_aqr105_phy4");
+               fdt_setprop(fdt, offset, "phy-connection-type",
+                           "sgmii-2500", 10);
+               fdt_status_disabled_by_alias(fdt, "xg_aqr105_phy3");
+       }
+}
+
 void fdt_fixup_board_enet(void *fdt)
 {
 }
index dd2dec4412101948b00cad99ea9efbea0b6fc829..1a3a996439646ef53e932b3139fe532abea9c0fc 100644 (file)
@@ -11,6 +11,7 @@
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/sleep.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,6 +43,12 @@ void board_init_f(ulong bootflag)
 
        console_init_f();
 
+#ifdef CONFIG_DEEP_SLEEP
+       /* disable the console if boot from deep sleep */
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
        /* initialize selected port with appropriate baud rate */
        sys_clk = get_board_sys_clk();
        plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
index f5c438ded3b0aafb5171e257121d3eb204c7a7c9..e196f12ac7a16844a3633a9691b40b24dc79eb0a 100644 (file)
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
-#include <asm/mpc85xx_gpio.h>
 #include <fm_eth.h>
 #include "t102xrdb.h"
 #include "cpld.h"
+#include "../common/sleep.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -27,6 +27,11 @@ int checkboard(void)
 {
        struct cpu_type *cpu = gd->arch.cpu;
        static const char *freq[3] = {"100.00MHZ", "125.00MHz", "156.25MHZ"};
+       ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+       u32 srds_s1;
+
+       srds_s1 = in_be32(&gur->rcwsr[4]) & FSL_CORENET2_RCWSR4_SRDS1_PRTCL;
+       srds_s1 >>= FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT;
 
        printf("Board: %sRDB, ", cpu->name);
        printf("Board rev: 0x%02x CPLD ver: 0x%02x, boot from ",
@@ -50,7 +55,40 @@ int checkboard(void)
 #endif
 
        puts("SERDES Reference Clocks:\n");
-       printf("SD1_CLK1=%s, SD1_CLK2=%s\n", freq[2], freq[0]);
+       if (srds_s1 == 0x95)
+               printf("SD1_CLK1=%s, SD1_CLK2=%s\n", freq[2], freq[0]);
+       else
+               printf("SD1_CLK1=%s, SD1_CLK2=%s\n", freq[0], freq[0]);
+
+       return 0;
+}
+
+static void board_mux_lane(void)
+{
+       ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+       u32 srds_prtcl_s1;
+       u8 reg = CPLD_READ(misc_ctl_status);
+
+       srds_prtcl_s1 = in_be32(&gur->rcwsr[4]) &
+                               FSL_CORENET2_RCWSR4_SRDS1_PRTCL;
+       srds_prtcl_s1 >>= FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT;
+
+       if (srds_prtcl_s1 == 0x95) {
+               /* Route Lane B to PCIE */
+               CPLD_WRITE(misc_ctl_status, reg & ~CPLD_PCIE_SGMII_MUX);
+       } else {
+               /* Route Lane B to SGMII */
+               CPLD_WRITE(misc_ctl_status, reg | CPLD_PCIE_SGMII_MUX);
+       }
+       CPLD_WRITE(boot_override, CPLD_OVERRIDE_MUX_EN);
+}
+
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
 
        return 0;
 }
@@ -86,6 +124,7 @@ int board_early_init_r(void)
 #ifdef CONFIG_SYS_DPAA_QBMAN
        setup_portals();
 #endif
+       board_mux_lane();
 
        return 0;
 }
@@ -131,14 +170,3 @@ int ft_board_setup(void *blob, bd_t *bd)
 
        return 0;
 }
-
-#ifdef CONFIG_DEEP_SLEEP
-void board_mem_sleep_setup(void)
-{
-       /* does not provide HW signals for power management */
-       CPLD_WRITE(misc_ctl_status, (CPLD_READ(misc_ctl_status) & ~0x40));
-       /* Disable MCKE isolation */
-       gpio_set_value(2, 0);
-       udelay(1);
-}
-#endif
index 43f952f9c03b4e8fc21d5854adf5e48a510993a7..82402408a74b7090326854bd7872704f2cb7b8db 100644 (file)
@@ -11,6 +11,7 @@
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
 #include <asm/fsl_law.h>
+#include <asm/mpc85xx_gpio.h>
 #include "ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -100,6 +101,19 @@ found:
 #endif
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+       void __iomem *qixis_base = (void *)QIXIS_BASE;
+
+       /* does not provide HW signals for power management */
+       clrbits_8(qixis_base + 0x21, 0x2);
+       /* Disable MCKE isolation */
+       gpio_set_value(2, 0);
+       udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
        phys_size_t dram_size;
@@ -112,5 +126,10 @@ phys_size_t initdram(int board_type)
        dram_size *= 0x100000;
 
        puts("    DDR: ");
+
+#if defined(CONFIG_DEEP_SLEEP) && !defined(CONFIG_SPL_BUILD)
+       fsl_dp_resume();
+#endif
+
        return dram_size;
 }
index 06d908658dad62098a8e39602d3d2d6cffbd6fe0..8c8293426bb622428bca78ffbd2e7c885f1afc2e 100644 (file)
@@ -18,6 +18,7 @@
 #include <fsl_mdio.h>
 #include <malloc.h>
 #include <asm/fsl_dtsec.h>
+#include <vsc9953.h>
 
 #include "../common/fman.h"
 #include "../common/qixis.h"
@@ -216,6 +217,7 @@ static void initialize_lane_to_slot(void)
                lane_to_slot[1] = 7;
                lane_to_slot[2] = 7;
                lane_to_slot[3] = 7;
+               lane_to_slot[6] = 7;
                lane_to_slot[7] = 7;
                break;
        case 0x8d:
@@ -438,6 +440,12 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_FMAN_ENET
        struct memac_mdio_info memac_mdio_info;
        unsigned int i;
+#ifdef CONFIG_VSC9953
+       int lane;
+       int phy_addr;
+       phy_interface_t phy_int;
+       struct mii_dev *bus;
+#endif
 
        printf("Initializing Fman\n");
        set_brdcfg9_for_gtx_clk();
@@ -477,6 +485,7 @@ int board_eth_init(bd_t *bis)
        for (i = FM1_DTSEC1; i < FM1_DTSEC1 + CONFIG_SYS_NUM_FM1_DTSEC; i++) {
                switch (fm_info_get_enet_if(i)) {
                case PHY_INTERFACE_MODE_QSGMII:
+                       fm_info_set_mdio(i, NULL);
                        break;
                case PHY_INTERFACE_MODE_SGMII:
                        t1040_handle_phy_interface_sgmii(i);
@@ -491,6 +500,90 @@ int board_eth_init(bd_t *bis)
                }
        }
 
+#ifdef CONFIG_VSC9953
+       for (i = 0; i < VSC9953_MAX_PORTS; i++) {
+               lane = -1;
+               phy_addr = 0;
+               phy_int = PHY_INTERFACE_MODE_NONE;
+               switch (i) {
+               case 0:
+               case 1:
+               case 2:
+               case 3:
+                       lane = serdes_get_first_lane(FSL_SRDS_1, QSGMII_SW1_A);
+                       /* PHYs connected over QSGMII */
+                       if (lane >= 0) {
+                               phy_addr = CONFIG_SYS_FM1_QSGMII21_PHY_ADDR +
+                                               i;
+                               phy_int = PHY_INTERFACE_MODE_QSGMII;
+                               break;
+                       }
+                       lane = serdes_get_first_lane(FSL_SRDS_1,
+                                       SGMII_SW1_MAC1 + i);
+
+                       if (lane < 0)
+                               break;
+
+                       /* PHYs connected over QSGMII */
+                       if (i != 3 || lane_to_slot[lane] == 7)
+                               phy_addr = CONFIG_SYS_FM1_DTSEC1_RISER_PHY_ADDR
+                                       + i;
+                       else
+                               phy_addr = CONFIG_SYS_FM1_DTSEC1_RISER_PHY_ADDR;
+                       phy_int = PHY_INTERFACE_MODE_SGMII;
+                       break;
+               case 4:
+               case 5:
+               case 6:
+               case 7:
+                       lane = serdes_get_first_lane(FSL_SRDS_1, QSGMII_SW1_B);
+                       /* PHYs connected over QSGMII */
+                       if (lane >= 0) {
+                               phy_addr = CONFIG_SYS_FM1_QSGMII11_PHY_ADDR +
+                                               i - 4;
+                               phy_int = PHY_INTERFACE_MODE_QSGMII;
+                               break;
+                       }
+                       lane = serdes_get_first_lane(FSL_SRDS_1,
+                                       SGMII_SW1_MAC1 + i);
+                       /* PHYs connected over SGMII */
+                       if (lane >= 0) {
+                               phy_addr = CONFIG_SYS_FM1_DTSEC1_RISER_PHY_ADDR
+                                               + i - 3;
+                               phy_int = PHY_INTERFACE_MODE_SGMII;
+                       }
+                       break;
+               case 8:
+                       if (serdes_get_first_lane(FSL_SRDS_1,
+                                                 SGMII_FM1_DTSEC1) < 0)
+                               /* FM1@DTSEC1 is connected to SW1@PORT8 */
+                               vsc9953_port_enable(i);
+                       break;
+               case 9:
+                       if (serdes_get_first_lane(FSL_SRDS_1,
+                                                 SGMII_FM1_DTSEC2) < 0) {
+                               /* Enable L2 On MAC2 using SCFG */
+                               struct ccsr_scfg *scfg = (struct ccsr_scfg *)
+                                               CONFIG_SYS_MPC85xx_SCFG;
+
+                               out_be32(&scfg->esgmiiselcr,
+                                        in_be32(&scfg->esgmiiselcr) |
+                                        (0x80000000));
+                               vsc9953_port_enable(i);
+                       }
+                       break;
+               }
+
+               if (lane >= 0) {
+                       bus = mii_dev_for_muxval(lane_to_slot[lane]);
+                       vsc9953_port_info_set_mdio(i, bus);
+                       vsc9953_port_enable(i);
+               }
+               vsc9953_port_info_set_phy_address(i, phy_addr);
+               vsc9953_port_info_set_phy_int(i, phy_int);
+       }
+
+#endif
        cpu_eth_init(bis);
 #endif
 
index 13285be42cf394a3b711e24a79cf8df969319286..eaca57fc5dfe05efd65b49de70d6e51edf0cfff6 100644 (file)
@@ -19,8 +19,8 @@
 #include <asm/fsl_liodn.h>
 #include <fm_eth.h>
 #include <hwconfig.h>
-#include <asm/mpc85xx_gpio.h>
 
+#include "../common/sleep.h"
 #include "../common/qixis.h"
 #include "t1040qds.h"
 #include "t1040qds_qixis.h"
@@ -115,6 +115,16 @@ static void qe_board_setup(void)
        }
 }
 
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
+       return 0;
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
@@ -281,14 +291,3 @@ int board_need_mem_reset(void)
 {
        return 1;
 }
-
-#ifdef CONFIG_DEEP_SLEEP
-void board_mem_sleep_setup(void)
-{
-       /* does not provide HW signals for power management */
-       QIXIS_WRITE(pwr_ctl[1], (QIXIS_READ(pwr_ctl[1]) & ~0x2));
-       /* Disable MCKE isolation */
-       gpio_set_value(2, 0);
-       udelay(1);
-}
-#endif
index b61e1c025404d673f9c6e0056055868225b66635..13d9be9da8f808096cc76db409c856360e1d752c 100644 (file)
@@ -21,3 +21,4 @@ T1040RDB_SECURE_BOOT BOARD
 M:     Aneesh Bansal  <aneesh.bansal@freescale.com>
 S:     Maintained
 F:     configs/T1040RDB_SECURE_BOOT_defconfig
+F:     configs/T1042RDB_SECURE_BOOT_defconfig
index c8b6c672a683a2e5b19213e792a575e621003457..7581a4cdd44b95a685720a3c052064116742ba7b 100644 (file)
@@ -6,11 +6,13 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/fsl_serdes.h>
 #include <asm/immap_85xx.h>
 #include <fm_eth.h>
 #include <fsl_mdio.h>
 #include <malloc.h>
 #include <asm/fsl_dtsec.h>
+#include <vsc9953.h>
 
 #include "../common/fman.h"
 
@@ -20,6 +22,11 @@ int board_eth_init(bd_t *bis)
        struct memac_mdio_info memac_mdio_info;
        unsigned int i;
        int phy_addr = 0;
+#ifdef CONFIG_VSC9953
+       phy_interface_t phy_int;
+       struct mii_dev *bus;
+#endif
+
        printf("Initializing Fman\n");
 
        memac_mdio_info.regs =
@@ -72,10 +79,58 @@ int board_eth_init(bd_t *bis)
                        fm_info_set_phy_address(i, 0);
                        break;
                }
-               fm_info_set_mdio(i,
-                                miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME));
+               if (fm_info_get_enet_if(i) == PHY_INTERFACE_MODE_QSGMII ||
+                   fm_info_get_enet_if(i) == PHY_INTERFACE_MODE_NONE)
+                       fm_info_set_mdio(i, NULL);
+               else
+                       fm_info_set_mdio(i,
+                                        miiphy_get_dev_by_name(
+                                                       DEFAULT_FM_MDIO_NAME));
+       }
+
+#ifdef CONFIG_VSC9953
+       /* SerDes configured for QSGMII */
+       if (serdes_get_first_lane(FSL_SRDS_1, QSGMII_SW1_A) >= 0) {
+               for (i = 0; i < 4; i++) {
+                       bus = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
+                       phy_addr = CONFIG_SYS_FM1_QSGMII11_PHY_ADDR + i;
+                       phy_int = PHY_INTERFACE_MODE_QSGMII;
+
+                       vsc9953_port_info_set_mdio(i, bus);
+                       vsc9953_port_info_set_phy_address(i, phy_addr);
+                       vsc9953_port_info_set_phy_int(i, phy_int);
+                       vsc9953_port_enable(i);
+               }
+       }
+       if (serdes_get_first_lane(FSL_SRDS_1, QSGMII_SW1_B) >= 0) {
+               for (i = 4; i < 8; i++) {
+                       bus = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
+                       phy_addr = CONFIG_SYS_FM1_QSGMII21_PHY_ADDR + i - 4;
+                       phy_int = PHY_INTERFACE_MODE_QSGMII;
+
+                       vsc9953_port_info_set_mdio(i, bus);
+                       vsc9953_port_info_set_phy_address(i, phy_addr);
+                       vsc9953_port_info_set_phy_int(i, phy_int);
+                       vsc9953_port_enable(i);
+               }
        }
 
+       /* Connect DTSEC1 to L2 switch if it doesn't have a PHY */
+       if (serdes_get_first_lane(FSL_SRDS_1, SGMII_FM1_DTSEC1) < 0)
+               vsc9953_port_enable(8);
+
+       /* Connect DTSEC2 to L2 switch if it doesn't have a PHY */
+       if (serdes_get_first_lane(FSL_SRDS_1, SGMII_FM1_DTSEC2) < 0) {
+               /* Enable L2 On MAC2 using SCFG */
+               struct ccsr_scfg *scfg = (struct ccsr_scfg *)
+                               CONFIG_SYS_MPC85xx_SCFG;
+
+               out_be32(&scfg->esgmiiselcr, in_be32(&scfg->esgmiiselcr) |
+                        (0x80000000));
+               vsc9953_port_enable(9);
+       }
+#endif
+
        cpu_eth_init(bis);
 #endif
 
index 142c6a877bb641545fe2e8cfff81d425c4285101..879bd1a347b55697f34919d379bd446b6b79d77f 100644 (file)
@@ -101,7 +101,7 @@ int board_eth_init(bd_t *bis)
        }
 
 #if (CONFIG_SYS_NUM_FMAN == 2)
-       if (srds_prtcl_s2 == 56) {
+       if ((srds_prtcl_s2 == 56) || (srds_prtcl_s2 == 55)) {
                /* SGMII && XFI */
                fm_info_set_phy_address(FM2_DTSEC1, SGMII_PHY_ADDR5);
                fm_info_set_phy_address(FM2_DTSEC2, SGMII_PHY_ADDR6);
index fdbbe5ef6593b25b43b068bedf7f2b01d3a662bf..e46c7b25a55c0098530410ba649c43aabd957c62 100644 (file)
@@ -1,7 +1,7 @@
 #PBL preamble and RCW header
 aa55aa55 010e0100
-#serdes protocol  27_56_1_9
+#serdes protocol  27_55_1_9
 16070019 18101916 00000000 00000000
-6c700848 00448c00 6c020000 f5000000
+6c6e0848 00448c00 6c020000 f5000000
 00000000 ee0000ee 00000000 000287fc
 00000000 50000000 00000000 00000028
diff --git a/board/icecube/Kconfig b/board/icecube/Kconfig
deleted file mode 100644 (file)
index e5b2153..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-if TARGET_ICECUBE
-
-config SYS_BOARD
-       default "icecube"
-
-config SYS_CONFIG_NAME
-       default "IceCube"
-
-endif
diff --git a/board/icecube/MAINTAINERS b/board/icecube/MAINTAINERS
deleted file mode 100644 (file)
index 8a24eb4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-ICECUBE BOARD
-M:     Wolfgang Denk <wd@denx.de>
-S:     Maintained
-F:     board/icecube/
-F:     include/configs/IceCube.h
-F:     configs/icecube_5200_defconfig
-
-ICECUBE_5200_DDR BOARD
-#M:    -
-S:     Maintained
-F:     configs/icecube_5200_DDR_defconfig
-F:     configs/icecube_5200_DDR_LOWBOOT_defconfig
-F:     configs/icecube_5200_DDR_LOWBOOT08_defconfig
-F:     configs/icecube_5200_LOWBOOT_defconfig
-F:     configs/icecube_5200_LOWBOOT08_defconfig
-F:     configs/Lite5200_defconfig
-F:     configs/Lite5200_LOWBOOT_defconfig
-F:     configs/Lite5200_LOWBOOT08_defconfig
-F:     configs/lite5200b_defconfig
-F:     configs/lite5200b_LOWBOOT_defconfig
-F:     configs/lite5200b_PM_defconfig
diff --git a/board/icecube/Makefile b/board/icecube/Makefile
deleted file mode 100644 (file)
index c3c2cd1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  := icecube.o flash.o
diff --git a/board/icecube/README b/board/icecube/README
deleted file mode 100644 (file)
index 5252bc9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
----------------------------------------------------------------------------
-Build target                Flash address | BDI "go" command | Reset Vector
----------------------------------------------------------------------------
-Lite5200                     0xFFF00000   |    0xFFF00100    |   0xFFF00100
-Lite5200_LOWBOOT             0xFF000000   |    0xFF000100    |   0x00000100
-Lite5200_LOWBOOT08           0xFF800000   |    0xFF800100    |   0x00000100
-icecube_5200                 0xFFF00000   |    0xFFF00100    |   0xFFF00100
-icecube_5200_LOWBOOT         0xFF000000   |    0xFF000100    |   0x00000100
-icecube_5200_LOWBOOT08       0xFF800000   |    0xFF800100    |   0x00000100
-icecube_5200_DDR             0xFFF00000   |    0xFFF00100    |   0xFFF00100
-icecube_5200_DDR_LOWBOOT     0xFF800000   |    0xFF800100    |   0x00000100
-icecube_5200_DDR_LOWBOOT08   0xFF800000   |    0xFF800100    |   0x00000100
----------------------------------------------------------------------------
diff --git a/board/icecube/README.Lite5200B_low_power b/board/icecube/README.Lite5200B_low_power
deleted file mode 100644 (file)
index 5b04fbb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Lite5200B wakeup from low-power mode (CONFIG_LITE5200B_PM)
-----------------------------------------------------------
-
-Low-power mode as described in Lite5200B User's Manual, means that
-with support of MC68HLC908QT1 microcontroller (refered to as QT),
-everything but the SDRAM can be powered down. This brings
-maximum power saving, while one can still restore previous state
-quickly.
-
-Quick overview where U-Boot comes into the picture:
-- OS saves device states
-- OS saves wakeup handler address to physical 0x0, puts SDRAM into
-  self-refresh and signals to QT, it should power down the board
-- / board is sleeping here /
-- someone presses SW4 (connected to QT)
-- U-Boot checks PSC2_4 pin, if QT drives it down, then we woke up,
-  so get SDRAM out of self-refresh and transfer control to OS
-  wakeup handler
-- OS restores device states
-
-This was tested on Linux with USB and Ethernet in use. Adding
-support for other devices is an OS issue.
diff --git a/board/icecube/flash.c b/board/icecube/flash.c
deleted file mode 100644 (file)
index a044e8f..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-#ifndef CONFIG_FLASH_CFI_DRIVER
-flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
-
-/* NOTE - CONFIG_FLASH_16BIT means the CPU interface is 16-bit, it
- *        has nothing to do with the flash chip being 8-bit or 16-bit.
- */
-#ifdef CONFIG_FLASH_16BIT
-typedef unsigned short FLASH_PORT_WIDTH;
-typedef volatile unsigned short FLASH_PORT_WIDTHV;
-#define        FLASH_ID_MASK   0xFFFF
-#else
-typedef unsigned char FLASH_PORT_WIDTH;
-typedef volatile unsigned char FLASH_PORT_WIDTHV;
-#define        FLASH_ID_MASK   0xFF
-#endif
-
-#define FPW    FLASH_PORT_WIDTH
-#define FPWV   FLASH_PORT_WIDTHV
-
-#define ORMASK(size) ((-size) & OR_AM_MSK)
-
-#define FLASH_CYCLE1   0x0555
-#define FLASH_CYCLE2   0x02aa
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-static ulong flash_get_size(FPWV *addr, flash_info_t *info);
-static void flash_reset(flash_info_t *info);
-static int write_word_amd(flash_info_t *info, FPWV *dest, FPW data);
-static flash_info_t *flash_get_info(ulong base);
-
-/*-----------------------------------------------------------------------
- * flash_init()
- *
- * sets up flash_info and returns size of FLASH (bytes)
- */
-unsigned long flash_init (void)
-{
-       unsigned long size = 0;
-       int i;
-       extern void flash_preinit(void);
-       extern void flash_afterinit(ulong);
-       ulong flashbase = CONFIG_SYS_FLASH_BASE;
-
-       flash_preinit();
-
-       /* Init: no FLASHes known */
-       for (i=0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               memset(&flash_info[i], 0, sizeof(flash_info_t));
-
-               flash_info[i].size =
-                       flash_get_size((FPW *)flashbase, &flash_info[i]);
-
-               size += flash_info[i].size;
-               flashbase += 0x800000;
-       }
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-       /* monitor protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_SYS_MONITOR_BASE,
-                     CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
-                     flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
-#ifdef CONFIG_ENV_IS_IN_FLASH
-       /* ENV protection ON by default */
-       flash_protect(FLAG_PROTECT_SET,
-                     CONFIG_ENV_ADDR,
-                     CONFIG_ENV_ADDR+CONFIG_ENV_SIZE-1,
-                     flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
-
-       flash_afterinit(size);
-       return size ? size : 1;
-}
-
-/*-----------------------------------------------------------------------
- */
-static void flash_reset(flash_info_t *info)
-{
-       FPWV *base = (FPWV *)(info->start[0]);
-
-       /* Put FLASH back in read mode */
-       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL)
-               *base = (FPW)0x00FF00FF;        /* Intel Read Mode */
-       else if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_AMD)
-               *base = (FPW)0x00F000F0;        /* AMD Read Mode */
-}
-
-/*-----------------------------------------------------------------------
- */
-
-static flash_info_t *flash_get_info(ulong base)
-{
-       int i;
-       flash_info_t * info;
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i ++) {
-               info = & flash_info[i];
-               if (info->size &&
-                       info->start[0] <= base && base <= info->start[0] + info->size - 1)
-                       break;
-       }
-
-       return i == CONFIG_SYS_MAX_FLASH_BANKS ? 0 : info;
-}
-
-/*-----------------------------------------------------------------------
- */
-
-void flash_print_info (flash_info_t *info)
-{
-       int i;
-       uchar *boottype;
-       uchar *bootletter;
-       char *fmt;
-       uchar botbootletter[] = "B";
-       uchar topbootletter[] = "T";
-       uchar botboottype[] = "bottom boot sector";
-       uchar topboottype[] = "top boot sector";
-
-       if (info->flash_id == FLASH_UNKNOWN) {
-               printf ("missing or unknown FLASH type\n");
-               return;
-       }
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case FLASH_MAN_AMD:     printf ("AMD ");                break;
-       case FLASH_MAN_BM:      printf ("BRIGHT MICRO ");       break;
-       case FLASH_MAN_FUJ:     printf ("FUJITSU ");            break;
-       case FLASH_MAN_SST:     printf ("SST ");                break;
-       case FLASH_MAN_STM:     printf ("STM ");                break;
-       case FLASH_MAN_INTEL:   printf ("INTEL ");              break;
-       default:                printf ("Unknown Vendor ");     break;
-       }
-
-       /* check for top or bottom boot, if it applies */
-       if (info->flash_id & FLASH_BTYPE) {
-               boottype = botboottype;
-               bootletter = botbootletter;
-       }
-       else {
-               boottype = topboottype;
-               bootletter = topbootletter;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AMDLV065D:
-               fmt = "29LV065 (64 Mbit, uniform sectors)\n";
-               break;
-       default:
-               fmt = "Unknown Chip Type\n";
-               break;
-       }
-
-       printf (fmt, bootletter, boottype);
-
-       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");
-}
-
-/*-----------------------------------------------------------------------
- */
-
-/*
- * The following code cannot be run from FLASH!
- */
-
-ulong flash_get_size (FPWV *addr, flash_info_t *info)
-{
-       int i;
-       FPWV* addr2;
-
-       /* Write auto select command: read Manufacturer ID */
-       /* Write auto select command sequence and test FLASH answer */
-       addr[FLASH_CYCLE1] = (FPW)0x00AA00AA;   /* for AMD, Intel ignores this */
-       addr[FLASH_CYCLE2] = (FPW)0x00550055;   /* for AMD, Intel ignores this */
-       addr[FLASH_CYCLE1] = (FPW)0x00900090;   /* selects Intel or AMD */
-
-       /* The manufacturer codes are only 1 byte, so just use 1 byte.
-        * This works for any bus width and any FLASH device width.
-        */
-       udelay(100);
-       switch (addr[0] & 0xff) {
-
-       case (uchar)AMD_MANUFACT:
-               info->flash_id = FLASH_MAN_AMD;
-               break;
-
-       case (uchar)INTEL_MANUFACT:
-               info->flash_id = FLASH_MAN_INTEL;
-               break;
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               break;
-       }
-
-       /* Check 16 bits or 32 bits of ID so work on 32 or 16 bit bus. */
-       if (info->flash_id != FLASH_UNKNOWN) switch ((FPW)addr[1]) {
-
-       case (FPW)AMD_ID_LV065D:
-               info->flash_id += FLASH_AMDLV065D;
-               info->sector_count = 128;
-               info->size = 0x00800000;
-               for( i = 0; i < info->sector_count; i++ )
-                       info->start[i] = (ulong)addr + (i * 0x10000);
-               break;                          /* => 8 or 16 MB        */
-
-       default:
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               return (0);                     /* => no or unknown flash */
-       }
-
-       /* test for real flash at bank 1 */
-       addr2 = (FPW *)((ulong)addr | 0x800000);
-       if (addr2 != addr &&
-               ((addr2[0] & 0xff) == (addr[0] & 0xff)) && ((FPW)addr2[1] == (FPW)addr[1])) {
-               /* Seems 2 banks are the same space (8Mb chip is installed,
-                * J24 in default position (CS0)). Disable this (first) bank.
-                */
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-       }
-       /* Put FLASH back in read mode */
-       flash_reset(info);
-
-       return (info->size);
-}
-
-/*-----------------------------------------------------------------------
- */
-
-int    flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-       FPWV *addr;
-       int flag, prot, sect;
-       int intel = (info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL;
-       ulong start, now, last;
-       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;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AMDLV065D:
-               break;
-       case FLASH_UNKNOWN:
-       default:
-               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");
-       }
-
-       last  = get_timer(0);
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
-
-               if (info->protect[sect] != 0)   /* protected, skip it */
-                       continue;
-
-               /* Disable interrupts which might cause a timeout here */
-               flag = disable_interrupts();
-
-               addr = (FPWV *)(info->start[sect]);
-               if (intel) {
-                       *addr = (FPW)0x00500050; /* clear status register */
-                       *addr = (FPW)0x00200020; /* erase setup */
-                       *addr = (FPW)0x00D000D0; /* erase confirm */
-               }
-               else {
-                       /* must be AMD style if not Intel */
-                       FPWV *base;             /* first address in bank */
-
-                       base = (FPWV *)(info->start[0]);
-                       base[FLASH_CYCLE1] = (FPW)0x00AA00AA;   /* unlock */
-                       base[FLASH_CYCLE2] = (FPW)0x00550055;   /* unlock */
-                       base[FLASH_CYCLE1] = (FPW)0x00800080;   /* erase mode */
-                       base[FLASH_CYCLE1] = (FPW)0x00AA00AA;   /* unlock */
-                       base[FLASH_CYCLE2] = (FPW)0x00550055;   /* unlock */
-                       *addr = (FPW)0x00300030;        /* erase sector */
-               }
-
-               /* re-enable interrupts if necessary */
-               if (flag)
-                       enable_interrupts();
-
-               start = get_timer(0);
-
-               /* wait at least 50us for AMD, 80us for Intel.
-                * Let's wait 1 ms.
-                */
-               udelay (1000);
-
-               while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
-                       if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                               printf ("Timeout\n");
-
-                               if (intel) {
-                                       /* suspend erase        */
-                                       *addr = (FPW)0x00B000B0;
-                               }
-
-                               flash_reset(info);      /* reset to read mode */
-                               rcode = 1;              /* failed */
-                               break;
-                       }
-
-                       /* show that we're waiting */
-                       if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
-                               putc ('.');
-                               last = get_timer(0);
-                       }
-               }
-
-               /* show that we're waiting */
-               if ((get_timer(last)) > CONFIG_SYS_HZ) {        /* every second */
-                       putc ('.');
-                       last = get_timer(0);
-               }
-
-               flash_reset(info);      /* reset to read mode   */
-       }
-
-       printf (" done\n");
-       return rcode;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-       FPW data = 0; /* 16 or 32 bit word, matches flash bus width on MPC8XX */
-       int bytes;        /* number of bytes to program in current word         */
-       int left;         /* number of bytes left to program                    */
-       int i, res;
-
-       for (left = cnt, res = 0;
-                left > 0 && res == 0;
-                addr += sizeof(data), left -= sizeof(data) - bytes) {
-
-               bytes = addr & (sizeof(data) - 1);
-               addr &= ~(sizeof(data) - 1);
-
-               /* combine source and destination data so can program
-                * an entire word of 16 or 32 bits
-                */
-               for (i = 0; i < sizeof(data); i++) {
-                       data <<= 8;
-                       if (i < bytes || i - bytes >= left )
-                               data += *((uchar *)addr + i);
-                       else
-                               data += *src++;
-               }
-
-               /* write one word to the flash */
-               switch (info->flash_id & FLASH_VENDMASK) {
-               case FLASH_MAN_AMD:
-                       res = write_word_amd(info, (FPWV *)addr, data);
-                       break;
-               default:
-                       /* unknown flash type, error! */
-                       printf ("missing or unknown FLASH type\n");
-                       res = 1;        /* not really a timeout, but gives error */
-                       break;
-               }
-       }
-
-       return (res);
-}
-
-/*-----------------------------------------------------------------------
- * Write a word to Flash for AMD FLASH
- * A word is 16 or 32 bits, whichever the bus width of the flash bank
- * (not an individual chip) is.
- *
- * returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
-{
-       ulong start;
-       int flag;
-       int res = 0;    /* result, assume success       */
-       FPWV *base;             /* first address in flash bank  */
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*dest & data) != data) {
-               return (2);
-       }
-
-
-       base = (FPWV *)(info->start[0]);
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       base[FLASH_CYCLE1] = (FPW)0x00AA00AA;   /* unlock */
-       base[FLASH_CYCLE2] = (FPW)0x00550055;   /* unlock */
-       base[FLASH_CYCLE1] = (FPW)0x00A000A0;   /* selects program mode */
-
-       *dest = data;           /* start programming the data   */
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts();
-
-       start = get_timer (0);
-
-       /* data polling for D7 */
-       while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
-               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       *dest = (FPW)0x00F000F0;        /* reset bank */
-                       res = 1;
-               }
-       }
-
-       return (res);
-}
-#endif /*CONFIG_FLASH_CFI_DRIVER*/
diff --git a/board/icecube/icecube.c b/board/icecube/icecube.c
deleted file mode 100644 (file)
index f0af24a..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <asm/processor.h>
-#include <libfdt.h>
-#include <netdev.h>
-
-#if defined(CONFIG_LITE5200B)
-#include "mt46v32m16.h"
-#else
-# if defined(CONFIG_MPC5200_DDR)
-#  include "mt46v16m16-75.h"
-# else
-#include "mt48lc16m16a2-75.h"
-# endif
-#endif
-
-#ifdef CONFIG_LITE5200B_PM
-/* u-boot part of low-power mode implementation */
-#define SAVED_ADDR (*(void **)0x00000000)
-#define PSC2_4 0x02
-
-void lite5200b_wakeup(void)
-{
-       unsigned char wakeup_pin;
-       void (*linux_wakeup)(void);
-
-       /* check PSC2_4, if it's down "QT" is signaling we have a wakeup
-        * from low power mode */
-       *(vu_char *)MPC5XXX_WU_GPIO_ENABLE = PSC2_4;
-       __asm__ volatile ("sync");
-
-       wakeup_pin = *(vu_char *)MPC5XXX_WU_GPIO_DATA_I;
-       if (wakeup_pin & PSC2_4)
-               return;
-
-       /* acknowledge to "QT"
-        * by holding pin at 1 for 10 uS */
-       *(vu_char *)MPC5XXX_WU_GPIO_DIR = PSC2_4;
-       __asm__ volatile ("sync");
-       *(vu_char *)MPC5XXX_WU_GPIO_DATA_O = PSC2_4;
-       __asm__ volatile ("sync");
-       udelay(10);
-
-       /* put ram out of self-refresh */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL |= 0x80000000;   /* mode_en */
-       __asm__ volatile ("sync");
-       *(vu_long *)MPC5XXX_SDRAM_CTRL |= 0x50000000;   /* cke ref_en */
-       __asm__ volatile ("sync");
-       *(vu_long *)MPC5XXX_SDRAM_CTRL &= ~0x80000000;  /* !mode_en */
-       __asm__ volatile ("sync");
-       udelay(10); /* wait a bit */
-
-       /* jump back to linux kernel code */
-       linux_wakeup = SAVED_ADDR;
-       printf("\n\nLooks like we just woke, transferring control to 0x%08lx\n",
-                       (unsigned long)linux_wakeup);
-       linux_wakeup();
-}
-#else
-#define lite5200b_wakeup()
-#endif
-
-#ifndef CONFIG_SYS_RAMBOOT
-static void sdram_start (int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-#if SDRAM_DDR
-       /* set mode register: extended mode */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-       __asm__ volatile ("sync");
-
-       /* set mode register: reset DLL */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
-       __asm__ volatile ("sync");
-#endif
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-#endif
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-phys_size_t initdram (int board_type)
-{
-       ulong dramsize = 0;
-       ulong dramsize2 = 0;
-       uint svr, pvr;
-
-#ifndef CONFIG_SYS_RAMBOOT
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-       __asm__ volatile ("sync");
-
-#if SDRAM_DDR
-       /* set tap delay */
-       *(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-       __asm__ volatile ("sync");
-#endif
-
-       /* find RAM size using SDRAM CS0 only */
-       sdram_start(0);
-       test1 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20)) {
-               dramsize = 0;
-       }
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1;
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
-       }
-
-       /* let SDRAM CS1 start right after CS0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;/* 2G */
-
-       /* find RAM size using SDRAM CS1 only */
-       if (!dramsize)
-               sdram_start(0);
-       test2 = test1 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       if (!dramsize) {
-               sdram_start(1);
-               test2 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       }
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize2 = test1;
-       } else {
-               dramsize2 = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize2 < (1 << 20)) {
-               dramsize2 = 0;
-       }
-
-       /* set SDRAM CS1 size according to the amount of RAM found */
-       if (dramsize2 > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
-                       | (0x13 + __builtin_ffs(dramsize2 >> 20) - 1);
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
-       }
-
-#else /* CONFIG_SYS_RAMBOOT */
-
-       /* retrieve size of memory connected to SDRAM CS0 */
-       dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
-       if (dramsize >= 0x13) {
-               dramsize = (1 << (dramsize - 0x13)) << 20;
-       } else {
-               dramsize = 0;
-       }
-
-       /* retrieve size of memory connected to SDRAM CS1 */
-       dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF;
-       if (dramsize2 >= 0x13) {
-               dramsize2 = (1 << (dramsize2 - 0x13)) << 20;
-       } else {
-               dramsize2 = 0;
-       }
-
-#endif /* CONFIG_SYS_RAMBOOT */
-
-       /*
-        * On MPC5200B we need to set the special configuration delay in the
-        * DDR controller. Please refer to Freescale's AN3221 "MPC5200B SDRAM
-        * Initialization and Configuration", 3.3.1 SDelay--MBAR + 0x0190:
-        *
-        * "The SDelay should be written to a value of 0x00000004. It is
-        * required to account for changes caused by normal wafer processing
-        * parameters."
-        */
-       svr = get_svr();
-       pvr = get_pvr();
-       if ((SVR_MJREV(svr) >= 2) &&
-           (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) {
-
-               *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
-               __asm__ volatile ("sync");
-       }
-
-       lite5200b_wakeup();
-
-       return dramsize + dramsize2;
-}
-
-int checkboard (void)
-{
-#if defined (CONFIG_LITE5200B)
-       puts ("Board: Freescale Lite5200B\n");
-#else
-       puts ("Board: Motorola MPC5200 (IceCube)\n");
-#endif
-       return 0;
-}
-
-void flash_preinit(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write
-        * access for detection process.
-        * Note that CS_BOOT cannot be cleared when
-        * executing in flash.
-        */
-       *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
-}
-
-void flash_afterinit(ulong size)
-{
-       if (size == 0x800000) { /* adjust mapping */
-               *(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
-                       START_REG(CONFIG_SYS_BOOTCS_START | size);
-               *(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
-                       STOP_REG(CONFIG_SYS_BOOTCS_START | size, size);
-       }
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void)
-{
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
-
-void init_ide_reset (void)
-{
-       debug ("init_ide_reset\n");
-
-       /* Configure PSC1_4 as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
-       *(vu_long *) MPC5XXX_WU_GPIO_DIR    |= GPIO_PSC1_4;
-       /* Deassert reset */
-       *(vu_long *) MPC5XXX_WU_GPIO_DATA_O   |= GPIO_PSC1_4;
-}
-
-void ide_set_reset (int idereset)
-{
-       debug ("ide_reset(%d)\n", idereset);
-
-       if (idereset) {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_PSC1_4;
-               /* Make a delay. MPC5200 spec says 25 usec min */
-               udelay(500000);
-       } else {
-               *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
-       }
-}
-#endif
-
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-
-       return 0;
-}
-#endif
-
-int board_eth_init(bd_t *bis)
-{
-       cpu_eth_init(bis); /* Built in FEC comes first */
-       return pci_eth_init(bis);
-}
diff --git a/board/icecube/mt46v16m16-75.h b/board/icecube/mt46v16m16-75.h
deleted file mode 100644 (file)
index 919876f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1               /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x705f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/icecube/mt46v32m16.h b/board/icecube/mt46v32m16.h
deleted file mode 100644 (file)
index a200bc7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1               /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x704f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/icecube/mt48lc16m16a2-75.h b/board/icecube/mt48lc16m16a2-75.h
deleted file mode 100644 (file)
index 0133eaa..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      0               /* is SDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x00CD0000
-#define SDRAM_CONTROL  0x504F0000
-#define SDRAM_CONFIG1  0xD2322800
-#define SDRAM_CONFIG2  0x8AD70000
index 78c4bd4efe7114767e9c52ef07a42c6fe8c1460c..79562f79a80c6f93acb134e3a9d342957a3807c8 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <ide.h>
 #include <netdev.h>
 #include <pci.h>
 #include <pci_gt64120.h>
@@ -123,6 +124,7 @@ void _machine_restart(void)
 
        reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE);
        __raw_writel(GORESET, reset_base);
+       mdelay(1000);
 }
 
 int board_early_init_f(void)
@@ -217,4 +219,22 @@ void pci_init_board(void)
        pci_read_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, &val8);
        val8 |= PCI_CFG_PIIX4_SERIRQC_EN | PCI_CFG_PIIX4_SERIRQC_CONT;
        pci_write_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, val8);
+
+       bdf = pci_find_device(PCI_VENDOR_ID_INTEL,
+                             PCI_DEVICE_ID_INTEL_82371AB, 0);
+       if (bdf == -1)
+               panic("Failed to find PIIX4 IDE controller\n");
+
+       /* enable bus master & IO access */
+       val32 |= PCI_COMMAND_MASTER | PCI_COMMAND_IO;
+       pci_write_config_dword(bdf, PCI_COMMAND, val32);
+
+       /* set latency */
+       pci_write_config_byte(bdf, PCI_LATENCY_TIMER, 0x40);
+
+       /* enable IDE/ATA */
+       pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_PRI,
+                              PCI_CFG_PIIX4_IDETIM_IDE);
+       pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_SEC,
+                              PCI_CFG_PIIX4_IDETIM_IDE);
 }
index 3c63a03d3f4659327ff72ac22ea283e23c234102..f4260fa5043c3bd96bfde2b81ca8ad17dd512644 100644 (file)
@@ -20,7 +20,7 @@ NAND_PAGE_SIZE        0x0800
 # Configure RGMII-0 interface pad voltage to 1.8V
 DATA 0xffd100e0 0x1b1b1b9b
 
-#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+# Dram initalization for SINGLE x16 CL=5 @ 400MHz
 DATA 0xffd01400 0x43000c30     # DDR Configuration register
 # bit13-0:  0xc30, (3120 DDR2 clks refresh rate)
 # bit23-14: 0x0,
@@ -87,7 +87,7 @@ DATA 0xffd0141c 0x00000c52    # DDR Mode
 # bit6-4:   0x4, CL=5
 # bit7:     0x0, TestMode=0 normal
 # bit8:     0x0, DLL reset=0 normal
-# bit11-9:  0x6, auto-precharge write recovery ????????????
+# bit11-9:  0x6, auto-precharge write recovery
 # bit12:    0x0, PD must be zero
 # bit31-13: 0x0, required
 
index 95c4ff25092b7272860d1770c25d239ab27b50b0..1540526a61348eb1959a6f6864b135c648adcbd6 100644 (file)
@@ -46,7 +46,7 @@ void board_sdmmc_voltage_init(void)
        int ret;
        int i;
 
-       ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
+       ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, 1, &dev);
        if (ret) {
                debug("%s: Cannot find PMIC I2C chip\n", __func__);
                return;
@@ -57,7 +57,7 @@ void board_sdmmc_voltage_init(void)
        reg = 0x32;
 
        for (i = 0; i < MAX_I2C_RETRY; ++i) {
-               if (i2c_write(dev, reg, data_buffer, 1))
+               if (dm_i2c_write(dev, reg, data_buffer, 1))
                        udelay(100);
        }
 
@@ -66,7 +66,7 @@ void board_sdmmc_voltage_init(void)
        reg = 0x67;
 
        for (i = 0; i < MAX_I2C_RETRY; ++i) {
-               if (i2c_write(dev, reg, data_buffer, 1))
+               if (dm_i2c_write(dev, reg, data_buffer, 1))
                        udelay(100);
        }
 }
@@ -94,7 +94,7 @@ int tegra_pcie_board_init(void)
        u8 addr, data[1];
        int err;
 
-       err = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
+       err = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, 1, &dev);
        if (err) {
                debug("failed to find PMU bus\n");
                return err;
@@ -104,7 +104,7 @@ int tegra_pcie_board_init(void)
        data[0] = 0x15;
        addr = 0x30;
 
-       err = i2c_write(dev, addr, data, 1);
+       err = dm_i2c_write(dev, addr, data, 1);
        if (err) {
                debug("failed to set VDD supply\n");
                return err;
@@ -121,7 +121,7 @@ int tegra_pcie_board_init(void)
        data[0] = 0x15;
        addr = 0x31;
 
-       err = i2c_write(dev, addr, data, 1);
+       err = dm_i2c_write(dev, addr, data, 1);
        if (err) {
                debug("failed to set AVDD supply\n");
                return err;
index 2a737468ddc4fce7411f2f9d183596c9edadf6c6..d7c1a695ff804562459791b2dd28d67d64609300 100644 (file)
@@ -55,7 +55,7 @@ void board_sdmmc_voltage_init(void)
        uchar reg, data_buffer[1];
        int ret;
 
-       ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
+       ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, 1, &dev);
        if (ret) {
                debug("%s: Cannot find PMIC I2C chip\n", __func__);
                return;
@@ -65,7 +65,7 @@ void board_sdmmc_voltage_init(void)
        data_buffer[0] = 0x31;
        reg = 0x61;
 
-       ret = i2c_write(dev, reg, data_buffer, 1);
+       ret = dm_i2c_write(dev, reg, data_buffer, 1);
        if (ret)
                printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
                        __func__, reg, data_buffer[0], ret);
@@ -74,7 +74,7 @@ void board_sdmmc_voltage_init(void)
        data_buffer[0] = 0x01;
        reg = 0x60;
 
-       ret = i2c_write(dev, reg, data_buffer, 1);
+       ret = dm_i2c_write(dev, reg, data_buffer, 1);
        if (ret)
                printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
                        __func__, reg, data_buffer[0], ret);
@@ -83,12 +83,12 @@ void board_sdmmc_voltage_init(void)
        data_buffer[0] = 0x03;
        reg = 0x14;
 
-       ret = i2c_get_chip_for_busnum(0, BAT_I2C_ADDRESS, &dev);
+       ret = i2c_get_chip_for_busnum(0, BAT_I2C_ADDRESS, 1, &dev);
        if (ret) {
                debug("%s: Cannot find charger I2C chip\n", __func__);
                return;
        }
-       ret = i2c_write(dev, reg, data_buffer, 1);
+       ret = dm_i2c_write(dev, reg, data_buffer, 1);
        if (ret)
                printf("%s: BAT i2c_write %02X<-%02X returned %d\n",
                        __func__, reg, data_buffer[0], ret);
index 3114b20be0245602db4c6e7a46d55107b1a0258a..3476f1159feadc70ca214bb72af914143ef15153 100644 (file)
@@ -27,21 +27,21 @@ void pin_mux_mmc(void)
        int ret;
 
        /* Turn on MAX8907B LDO12 to 2.8V for J40 power */
-       ret = i2c_get_chip_for_busnum(0, 0x3c, &dev);
+       ret = i2c_get_chip_for_busnum(0, 0x3c, 1, &dev);
        if (ret) {
                printf("%s: Cannot find MAX8907B I2C chip\n", __func__);
                return;
        }
        val = 0x29;
-       ret = i2c_write(dev, 0x46, &val, 1);
+       ret = dm_i2c_write(dev, 0x46, &val, 1);
        if (ret)
                printf("i2c_write 0 0x3c 0x46 failed: %d\n", ret);
        val = 0x00;
-       ret = i2c_write(dev, 0x45, &val, 1);
+       ret = dm_i2c_write(dev, 0x45, &val, 1);
        if (ret)
                printf("i2c_write 0 0x3c 0x45 failed: %d\n", ret);
        val = 0x1f;
-       ret = i2c_write(dev, 0x44, &val, 1);
+       ret = dm_i2c_write(dev, 0x44, &val, 1);
        if (ret)
                printf("i2c_write 0 0x3c 0x44 failed: %d\n", ret);
 
@@ -64,17 +64,17 @@ void pin_mux_usb(void)
         */
 
        /* Turn on TAC6416's GPIO 0+1 for USB1/3's VBUS */
-       ret = i2c_get_chip_for_busnum(0, 0x20, &dev);
+       ret = i2c_get_chip_for_busnum(0, 0x20, 1, &dev);
        if (ret) {
                printf("%s: Cannot find TAC6416 I2C chip\n", __func__);
                return;
        }
        val = 0x03;
-       ret = i2c_write(dev, 2, &val, 1);
+       ret = dm_i2c_write(dev, 2, &val, 1);
        if (ret)
                printf("i2c_write 0 0x20 2 failed: %d\n", ret);
        val = 0xfc;
-       ret = i2c_write(dev, 6, &val, 1);
+       ret = dm_i2c_write(dev, 6, &val, 1);
        if (ret)
                printf("i2c_write 0 0x20 6 failed: %d\n", ret);
 }
diff --git a/board/pm520/Kconfig b/board/pm520/Kconfig
deleted file mode 100644 (file)
index 3f0a258..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-if TARGET_PM520
-
-config SYS_BOARD
-       default "pm520"
-
-config SYS_CONFIG_NAME
-       default "PM520"
-
-endif
diff --git a/board/pm520/MAINTAINERS b/board/pm520/MAINTAINERS
deleted file mode 100644 (file)
index 7b255bc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-PM520 BOARD
-M:     Josef Wagner <Wagner@Microsys.de>
-S:     Maintained
-F:     board/pm520/
-F:     include/configs/PM520.h
-F:     configs/PM520_defconfig
-F:     configs/PM520_DDR_defconfig
-F:     configs/PM520_ROMBOOT_defconfig
-F:     configs/PM520_ROMBOOT_DDR_defconfig
diff --git a/board/pm520/Makefile b/board/pm520/Makefile
deleted file mode 100644 (file)
index 8b5a7eb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  := pm520.o flash.o
diff --git a/board/pm520/flash.c b/board/pm520/flash.c
deleted file mode 100644 (file)
index 89c9f02..0000000
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * (C) Copyright 2001
- * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
- *
- * (C) Copyright 2001-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <linux/byteorder/swab.h>
-
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips    */
-
-/* Board support for 1 or 2 flash devices */
-#define FLASH_PORT_WIDTH32
-#undef FLASH_PORT_WIDTH16
-
-#ifdef FLASH_PORT_WIDTH16
-#define FLASH_PORT_WIDTH       ushort
-#define FLASH_PORT_WIDTHV      vu_short
-#define SWAP(x)                        (x)
-#else
-#define FLASH_PORT_WIDTH       ulong
-#define FLASH_PORT_WIDTHV      vu_long
-#define SWAP(x)                        (x)
-#endif
-
-/* Intel-compatible flash ID */
-#define INTEL_COMPAT           0x00890089
-#define INTEL_ALT              0x00B000B0
-
-/* Intel-compatible flash commands */
-#define INTEL_PROGRAM          0x00100010
-#define INTEL_ERASE            0x00200020
-#define INTEL_CLEAR            0x00500050
-#define INTEL_LOCKBIT          0x00600060
-#define INTEL_PROTECT          0x00010001
-#define INTEL_STATUS           0x00700070
-#define INTEL_READID           0x00900090
-#define INTEL_CONFIRM          0x00D000D0
-#define INTEL_RESET            0xFFFFFFFF
-
-/* Intel-compatible flash status bits */
-#define INTEL_FINISHED         0x00800080
-#define INTEL_OK               0x00800080
-
-#define FPW    FLASH_PORT_WIDTH
-#define FPWV   FLASH_PORT_WIDTHV
-
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-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);
-static void flash_sync_real_protect (flash_info_t * info);
-static unsigned char intel_sector_protected (flash_info_t *info, ushort sector);
-
-/*-----------------------------------------------------------------------
- */
-
-unsigned long flash_init (void)
-{
-       int i;
-       ulong size = 0;
-       extern void flash_preinit(void);
-       extern void flash_afterinit(ulong, ulong);
-       ulong flashbase = CONFIG_SYS_FLASH_BASE;
-
-       flash_preinit();
-
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
-               switch (i) {
-               case 0:
-                       memset(&flash_info[i], 0, sizeof(flash_info_t));
-                       flash_get_size ((FPW *) flashbase, &flash_info[i]);
-                       flash_get_offsets (flash_info[i].start[0], &flash_info[i]);
-                       break;
-               default:
-                       panic ("configured to many flash banks!\n");
-                       break;
-               }
-               size += flash_info[i].size;
-
-               /* get the h/w and s/w protection status in sync */
-               flash_sync_real_protect(&flash_info[i]);
-       }
-
-       /* Protect monitor and environment sectors
-        */
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-#ifndef CONFIG_BOOT_ROM
-       flash_protect ( FLAG_PROTECT_SET,
-                       CONFIG_SYS_MONITOR_BASE,
-                       CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
-                       &flash_info[0] );
-#endif
-#endif
-
-#ifdef CONFIG_ENV_IS_IN_FLASH
-       flash_protect ( FLAG_PROTECT_SET,
-                       CONFIG_ENV_ADDR,
-                       CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0] );
-#endif
-
-       flash_afterinit(flash_info[0].start[0], flash_info[0].size);
-
-       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++) {
-                       info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
-               }
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-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_28F256J3A:
-               printf ("28F256J3A\n");
-               break;
-
-       case FLASH_28F128J3A:
-               printf ("28F128J3A\n");
-               break;
-
-       case FLASH_28F640J3A:
-               printf ("28F640J3A\n");
-               break;
-
-       case FLASH_28F320J3A:
-               printf ("28F320J3A\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 ();
-       udelay(100);
-
-       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_28F256J3A:
-               info->flash_id += FLASH_28F256J3A;
-               /* In U-Boot we support only 32 MB (no bank-switching) */
-               info->sector_count = 256 / 2;
-               info->size =  0x04000000 / 2;
-               info->start[0] = CONFIG_SYS_FLASH_BASE + 0x02000000;
-               break;                          /* => 32 MB     */
-
-       case (FPW) INTEL_ID_28F128J3A:
-               info->flash_id += FLASH_28F128J3A;
-               info->sector_count = 128;
-               info->size = 0x02000000;
-               info->start[0] = CONFIG_SYS_FLASH_BASE + 0x02000000;
-               break;                          /* => 32 MB     */
-
-       case (FPW) INTEL_ID_28F640J3A:
-               info->flash_id += FLASH_28F640J3A;
-               info->sector_count = 64;
-               info->size = 0x01000000;
-               info->start[0] = CONFIG_SYS_FLASH_BASE + 0x03000000;
-               break;                          /* => 16 MB     */
-
-       case (FPW) INTEL_ID_28F320J3A:
-               info->flash_id += FLASH_28F320J3A;
-               info->sector_count = 32;
-               info->size = 0x800000;
-               info->start[0] = CONFIG_SYS_FLASH_BASE + 0x03800000;
-               break;                          /* => 8 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);
-}
-
-
-/*
- * This function gets the u-boot flash sector protection status
- * (flash_info_t.protect[]) in sync with the sector protection
- * status stored in hardware.
- */
-static void flash_sync_real_protect (flash_info_t * info)
-{
-       int i;
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-
-       case FLASH_28F256J3A:
-       case FLASH_28F128J3A:
-       case FLASH_28F640J3A:
-       case FLASH_28F320J3A:
-               for (i = 0; i < info->sector_count; ++i) {
-                       info->protect[i] = intel_sector_protected(info, i);
-               }
-               break;
-       default:
-               /* no h/w protect support */
-               break;
-       }
-}
-
-
-/*
- * checks if "sector" in bank "info" is protected. Should work on intel
- * strata flash chips 28FxxxJ3x in 8-bit mode.
- * Returns 1 if sector is protected (or timed-out while trying to read
- * protection status), 0 if it is not.
- */
-static unsigned char intel_sector_protected (flash_info_t *info, ushort sector)
-{
-       FPWV *addr;
-       FPWV *lock_conf_addr;
-       ulong start;
-       unsigned char ret;
-
-       /*
-        * first, wait for the WSM to be finished. The rationale for
-        * waiting for the WSM to become idle for at most
-        * CONFIG_SYS_FLASH_ERASE_TOUT is as follows. The WSM can be busy
-        * because of: (1) erase, (2) program or (3) lock bit
-        * configuration. So we just wait for the longest timeout of
-        * the (1)-(3), i.e. the erase timeout.
-        */
-
-       /* wait at least 35ns (W12) before issuing Read Status Register */
-       udelay(1);
-       addr = (FPWV *) info->start[sector];
-       *addr = (FPW) INTEL_STATUS;
-
-       start = get_timer (0);
-       while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
-               if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                       *addr = (FPW) INTEL_RESET; /* restore read mode */
-                       printf("WSM busy too long, can't get prot status\n");
-                       return 1;
-               }
-       }
-
-       /* issue the Read Identifier Codes command */
-       *addr = (FPW) INTEL_READID;
-
-       /* wait at least 35ns (W12) before reading */
-       udelay(1);
-
-       /* Intel example code uses offset of 2 for 16 bit flash */
-       lock_conf_addr = (FPWV *) info->start[sector] + 2;
-       ret = (*lock_conf_addr & (FPW) INTEL_PROTECT) ? 1 : 0;
-
-       /* put flash back in read mode */
-       *addr = (FPW) INTEL_RESET;
-
-       return ret;
-}
-
-/*-----------------------------------------------------------------------
- */
-
-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");
-       }
-
-       start = get_timer (0);
-
-       /* 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);
-
-                       /* 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");
-                                       *addr = (FPW) 0x00B000B0;       /* suspend erase     */
-                                       *addr = (FPW) 0x00FF00FF;       /* reset to read mode */
-                                       rcode = 1;
-                                       break;
-                               }
-                       }
-
-                       *addr = 0x00500050;     /* clear status register cmd.   */
-                       *addr = 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;
-       ulong start;
-       int flag;
-       int rcode = 0;
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*addr & data) != data) {
-               printf ("not erased at %08lx (%lx)\n", (ulong) addr, *addr);
-               return (2);
-       }
-       /* 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) {
-                       rcode = 1;
-                       break;
-               }
-       }
-
-       *addr = (FPW) 0x00FF00FF;       /* restore read mode */
-
-       if (flag)
-               enable_interrupts();
-
-       return rcode;
-}
-
-void inline spin_wheel (void)
-{
-       static int p = 0;
-       static char w[] = "\\/-";
-
-       printf ("\010%c", w[p]);
-       (++p == 3) ? (p = 0) : 0;
-}
-
-/*-----------------------------------------------------------------------
- * Set/Clear sector's lock bit, returns:
- * 0 - OK
- * 1 - Error (timeout, voltage problems, etc.)
- */
-int flash_real_protect (flash_info_t *info, long sector, int prot)
-{
-       ulong start;
-       int i;
-       int rc = 0;
-       vu_long *addr = (vu_long *)(info->start[sector]);
-       int flag = disable_interrupts();
-
-       *addr = INTEL_CLEAR;    /* Clear status register */
-       if (prot) {                     /* Set sector lock bit */
-               *addr = INTEL_LOCKBIT;  /* Sector lock bit */
-               *addr = INTEL_PROTECT;  /* set */
-       }
-       else {                          /* Clear sector lock bit */
-               *addr = INTEL_LOCKBIT;  /* All sectors lock bits */
-               *addr = INTEL_CONFIRM;  /* clear */
-       }
-
-       start = get_timer(0);
-
-       while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
-               if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
-                       printf("Flash lock bit operation timed out\n");
-                       rc = 1;
-                       break;
-               }
-       }
-
-       if (*addr != INTEL_OK) {
-               printf("Flash lock bit operation failed at %08X, CSR=%08X\n",
-                      (uint)addr, (uint)*addr);
-               rc = 1;
-       }
-
-       if (!rc)
-               info->protect[sector] = prot;
-
-       /*
-        * Clear lock bit command clears all sectors lock bits, so
-        * we have to restore lock bits of protected sectors.
-        * WARNING: code below re-locks sectors only for one bank (info).
-        * This causes problems on boards where several banks share
-        * the same chip, as sectors in othere banks will be unlocked
-        * but not re-locked. It works fine on pm520 though, as there
-        * is only one chip and one bank.
-        */
-       if (!prot)
-       {
-               for (i = 0; i < info->sector_count; i++)
-               {
-                       if (info->protect[i])
-                       {
-                               start = get_timer(0);
-                               addr = (vu_long *)(info->start[i]);
-                               *addr = INTEL_LOCKBIT;  /* Sector lock bit */
-                               *addr = INTEL_PROTECT;  /* set */
-                               while ((*addr & INTEL_FINISHED) != INTEL_FINISHED)
-                               {
-                                       if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT)
-                                       {
-                                               printf("Flash lock bit operation timed out\n");
-                                               rc = 1;
-                                               break;
-                                       }
-                               }
-                       }
-               }
-               /*
-                * get the s/w sector protection status in sync with the h/w,
-                * in case something went wrong during the re-locking.
-                */
-               flash_sync_real_protect(info); /* resets flash to read  mode */
-       }
-
-       if (flag)
-               enable_interrupts();
-
-       *addr = INTEL_RESET;            /* Reset to read array mode */
-
-       return rc;
-}
diff --git a/board/pm520/mt46v16m16-75.h b/board/pm520/mt46v16m16-75.h
deleted file mode 100644 (file)
index 9068fbf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      1               /* is DDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x018D0000
-#define SDRAM_EMODE    0x40090000
-#define SDRAM_CONTROL  0x714f0f00
-#define SDRAM_CONFIG1  0x73722930
-#define SDRAM_CONFIG2  0x47770000
-#define SDRAM_TAPDELAY 0x10000000
diff --git a/board/pm520/mt48lc16m16a2-75.h b/board/pm520/mt48lc16m16a2-75.h
deleted file mode 100644 (file)
index 0133eaa..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      0               /* is SDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x00CD0000
-#define SDRAM_CONTROL  0x504F0000
-#define SDRAM_CONFIG1  0xD2322800
-#define SDRAM_CONFIG2  0x8AD70000
diff --git a/board/pm520/pm520.c b/board/pm520/pm520.c
deleted file mode 100644 (file)
index 4ec4505..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <netdev.h>
-
-#if defined(CONFIG_MPC5200_DDR)
-#include "mt46v16m16-75.h"
-#else
-#include "mt48lc16m16a2-75.h"
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifndef CONFIG_SYS_RAMBOOT
-static void sdram_start (int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-#if SDRAM_DDR
-       /* set mode register: extended mode */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
-       __asm__ volatile ("sync");
-
-       /* set mode register: reset DLL */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
-       __asm__ volatile ("sync");
-#endif
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-#endif
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-phys_size_t initdram (int board_type)
-{
-       ulong dramsize = 0;
-       ulong dramsize2 = 0;
-#ifndef CONFIG_SYS_RAMBOOT
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-       __asm__ volatile ("sync");
-
-#if SDRAM_DDR
-       /* set tap delay */
-       *(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
-       __asm__ volatile ("sync");
-#endif
-
-       /* find RAM size using SDRAM CS0 only */
-       sdram_start(0);
-       test1 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20)) {
-               dramsize = 0;
-       }
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1;
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
-       }
-
-       /* let SDRAM CS1 start right after CS0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;/* 2G */
-
-       /* find RAM size using SDRAM CS1 only */
-       if (!dramsize)
-               sdram_start(0);
-       test2 = test1 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       if (!dramsize) {
-               sdram_start(1);
-               test2 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       }
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize2 = test1;
-       } else {
-               dramsize2 = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize2 < (1 << 20)) {
-               dramsize2 = 0;
-       }
-
-       /* set SDRAM CS1 size according to the amount of RAM found */
-       if (dramsize2 > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
-                       | (0x13 + __builtin_ffs(dramsize2 >> 20) - 1);
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
-       }
-
-#else /* CONFIG_SYS_RAMBOOT */
-
-       /* retrieve size of memory connected to SDRAM CS0 */
-       dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
-       if (dramsize >= 0x13) {
-               dramsize = (1 << (dramsize - 0x13)) << 20;
-       } else {
-               dramsize = 0;
-       }
-
-       /* retrieve size of memory connected to SDRAM CS1 */
-       dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF;
-       if (dramsize2 >= 0x13) {
-               dramsize2 = (1 << (dramsize2 - 0x13)) << 20;
-       } else {
-               dramsize2 = 0;
-       }
-
-#endif /* CONFIG_SYS_RAMBOOT */
-
-       return dramsize + dramsize2;
-}
-
-int checkboard (void)
-{
-       puts ("Board: MicroSys PM520 \n");
-       return 0;
-}
-
-void flash_preinit(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write
-        * access for detection process.
-        * Note that CS_BOOT cannot be cleared when
-        * executing in flash.
-        */
-       *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
-}
-
-void flash_afterinit(ulong start, ulong size)
-{
-#if defined(CONFIG_BOOT_ROM)
-       /* adjust mapping */
-       *(vu_long *)MPC5XXX_CS1_START =
-                       START_REG(start);
-       *(vu_long *)MPC5XXX_CS1_STOP =
-                       STOP_REG(start, size);
-#else
-       /* adjust mapping */
-       *(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
-                       START_REG(start);
-       *(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
-                       STOP_REG(start, size);
-#endif
-}
-
-
-extern flash_info_t flash_info[];      /* info for FLASH chips */
-
-int misc_init_r (void)
-{
-       /* adjust flash start */
-       gd->bd->bi_flashstart = flash_info[0].start[0];
-       return (0);
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void)
-{
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
-
-void init_ide_reset (void)
-{
-       debug ("init_ide_reset\n");
-
-}
-
-void ide_set_reset (int idereset)
-{
-       debug ("ide_reset(%d)\n", idereset);
-
-}
-#endif
-
-#if defined(CONFIG_CMD_DOC)
-void doc_init (void)
-{
-       doc_probe (CONFIG_SYS_DOC_BASE);
-}
-#endif
-
-int board_eth_init(bd_t *bis)
-{
-       cpu_eth_init(bis); /* Built in FEC comes first */
-       return pci_eth_init(bis);
-}
diff --git a/board/ppmc7xx/Kconfig b/board/ppmc7xx/Kconfig
deleted file mode 100644 (file)
index f101940..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-if TARGET_PPMC7XX
-
-config SYS_BOARD
-       default "ppmc7xx"
-
-config SYS_CONFIG_NAME
-       default "ppmc7xx"
-
-endif
diff --git a/board/ppmc7xx/MAINTAINERS b/board/ppmc7xx/MAINTAINERS
deleted file mode 100644 (file)
index a0c1f44..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-PPMC7XX BOARD
-#M:    -
-S:     Maintained
-F:     board/ppmc7xx/
-F:     include/configs/ppmc7xx.h
-F:     configs/ppmc7xx_defconfig
diff --git a/board/ppmc7xx/Makefile b/board/ppmc7xx/Makefile
deleted file mode 100644 (file)
index f8957f3..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  := init.o
-obj-y  += ppmc7xx.o pci.o flash.o
diff --git a/board/ppmc7xx/flash.c b/board/ppmc7xx/flash.c
deleted file mode 100644 (file)
index e724227..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * flash.c
- * -------
- *
- * Flash programming routines for the Wind River PPMC 74xx/7xx
- * based on flash.c from the TQM8260 board.
- *
- * By Richard Danter (richard.danter@windriver.com)
- * Copyright (C) 2005 Wind River Systems
- */
-
-#include <common.h>
-#include <asm/processor.h>
-#include <74xx_7xx.h>
-
-#define DWORD unsigned long long
-
-/* Local function prototypes */
-static int     write_dword (flash_info_t* info, ulong dest, unsigned char *pdata);
-static void    write_via_fpu (volatile DWORD* addr, DWORD* data);
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
-
-/*-----------------------------------------------------------------------
- */
-void flash_reset (void)
-{
-       unsigned long msr;
-       DWORD cmd_reset = 0x00F000F000F000F0LL;
-
-       if (flash_info[0].flash_id != FLASH_UNKNOWN) {
-               msr = get_msr ();
-               set_msr (msr | MSR_FP);
-
-               write_via_fpu ((DWORD*)flash_info[0].start[0], &cmd_reset );
-
-               set_msr (msr);
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-ulong flash_get_size (ulong baseaddr, flash_info_t * info)
-{
-       int i;
-       unsigned long msr;
-       DWORD flashtest;
-       DWORD cmd_select[3] = { 0x00AA00AA00AA00AALL, 0x0055005500550055LL,
-                                                       0x0090009000900090LL };
-
-       /* Enable FPU */
-       msr = get_msr ();
-       set_msr (msr | MSR_FP);
-
-       /* Write auto-select command sequence */
-       write_via_fpu ((DWORD*)(baseaddr + (0x0555 << 3)), &cmd_select[0] );
-       write_via_fpu ((DWORD*)(baseaddr + (0x02AA << 3)), &cmd_select[1] );
-       write_via_fpu ((DWORD*)(baseaddr + (0x0555 << 3)), &cmd_select[2] );
-
-       /* Restore FPU */
-       set_msr (msr);
-
-       /* Read manufacturer ID */
-       flashtest = *(volatile DWORD*)baseaddr;
-       switch ((int)flashtest) {
-       case AMD_MANUFACT:
-               info->flash_id = FLASH_MAN_AMD;
-               break;
-       case FUJ_MANUFACT:
-               info->flash_id = FLASH_MAN_FUJ;
-               break;
-       default:
-               /* No, faulty or unknown flash */
-               info->flash_id = FLASH_UNKNOWN;
-               info->sector_count = 0;
-               info->size = 0;
-               return (0);
-       }
-
-       /* Read device ID */
-       flashtest = *(volatile DWORD*)(baseaddr + 8);
-       switch ((long)flashtest) {
-       case AMD_ID_LV800T:
-               info->flash_id += FLASH_AM800T;
-               info->sector_count = 19;
-               info->size = 0x00400000;
-               break;
-       case AMD_ID_LV800B:
-               info->flash_id += FLASH_AM800B;
-               info->sector_count = 19;
-               info->size = 0x00400000;
-               break;
-       case AMD_ID_LV160T:
-               info->flash_id += FLASH_AM160T;
-               info->sector_count = 35;
-               info->size = 0x00800000;
-               break;
-       case AMD_ID_LV160B:
-               info->flash_id += FLASH_AM160B;
-               info->sector_count = 35;
-               info->size = 0x00800000;
-               break;
-       case AMD_ID_DL322T:
-               info->flash_id += FLASH_AMDL322T;
-               info->sector_count = 71;
-               info->size = 0x01000000;
-               break;
-       case AMD_ID_DL322B:
-               info->flash_id += FLASH_AMDL322B;
-               info->sector_count = 71;
-               info->size = 0x01000000;
-               break;
-       case AMD_ID_DL323T:
-               info->flash_id += FLASH_AMDL323T;
-               info->sector_count = 71;
-               info->size = 0x01000000;
-               break;
-       case AMD_ID_DL323B:
-               info->flash_id += FLASH_AMDL323B;
-               info->sector_count = 71;
-               info->size = 0x01000000;
-               break;
-       case AMD_ID_LV640U:
-               info->flash_id += FLASH_AM640U;
-               info->sector_count = 128;
-               info->size = 0x02000000;
-               break;
-       default:
-               /* Unknown flash type */
-               info->flash_id = FLASH_UNKNOWN;
-               return (0);
-       }
-
-       if ((long)flashtest == AMD_ID_LV640U) {
-               /* set up sector start adress table (uniform sector type) */
-               for (i = 0; i < info->sector_count; i++)
-                       info->start[i] = baseaddr + (i * 0x00040000);
-       } else if (info->flash_id & FLASH_BTYPE) {
-               /* set up sector start adress table (bottom sector type) */
-               info->start[0] = baseaddr + 0x00000000;
-               info->start[1] = baseaddr + 0x00010000;
-               info->start[2] = baseaddr + 0x00018000;
-               info->start[3] = baseaddr + 0x00020000;
-               for (i = 4; i < info->sector_count; i++) {
-                       info->start[i] = baseaddr + (i * 0x00040000) - 0x000C0000;
-               }
-       } else {
-               /* set up sector start adress table (top sector type) */
-               i = info->sector_count - 1;
-               info->start[i--] = baseaddr + info->size - 0x00010000;
-               info->start[i--] = baseaddr + info->size - 0x00018000;
-               info->start[i--] = baseaddr + info->size - 0x00020000;
-               for (; i >= 0; i--) {
-                       info->start[i] = baseaddr + i * 0x00040000;
-               }
-       }
-
-       /* check for protected sectors */
-       for (i = 0; i < info->sector_count; i++) {
-               /* read sector protection at sector address, (A7 .. A0) = 0x02 */
-               if (*(volatile DWORD*)(info->start[i] + 16) & 0x0001000100010001LL) {
-                       info->protect[i] = 1;   /* D0 = 1 if protected */
-               } else {
-                       info->protect[i] = 0;
-               }
-       }
-
-       flash_reset ();
-       return (info->size);
-}
-
-/*-----------------------------------------------------------------------
- */
-unsigned long flash_init (void)
-{
-       unsigned long size_b0 = 0;
-       int i;
-
-       /* Init: no FLASHes known */
-       for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-       }
-
-       /* Static FLASH Bank configuration here (only one bank) */
-       size_b0 = flash_get_size (CONFIG_SYS_FLASH_BASE, &flash_info[0]);
-       if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {
-               printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-                               size_b0, size_b0 >> 20);
-       }
-
-       /*
-        * protect monitor and environment sectors
-        */
-#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE
-       flash_protect (FLAG_PROTECT_SET,
-                      CONFIG_SYS_MONITOR_BASE,
-                      CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
-#endif
-
-#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
-# ifndef  CONFIG_ENV_SIZE
-#  define CONFIG_ENV_SIZE      CONFIG_ENV_SECT_SIZE
-# endif
-       flash_protect (FLAG_PROTECT_SET,
-                      CONFIG_ENV_ADDR,
-                      CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
-#endif
-
-       return (size_b0);
-}
-
-/*-----------------------------------------------------------------------
- */
-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_AMD:
-               printf ("AMD ");
-               break;
-       case FLASH_MAN_FUJ:
-               printf ("FUJITSU ");
-               break;
-       default:
-               printf ("Unknown Vendor ");
-               break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case FLASH_AM800T:
-               printf ("29LV800T (8 M, top sector)\n");
-               break;
-       case FLASH_AM800B:
-               printf ("29LV800T (8 M, bottom sector)\n");
-               break;
-       case FLASH_AM160T:
-               printf ("29LV160T (16 M, top sector)\n");
-               break;
-       case FLASH_AM160B:
-               printf ("29LV160B (16 M, bottom sector)\n");
-               break;
-       case FLASH_AMDL322T:
-               printf ("29DL322T (32 M, top sector)\n");
-               break;
-       case FLASH_AMDL322B:
-               printf ("29DL322B (32 M, bottom sector)\n");
-               break;
-       case FLASH_AMDL323T:
-               printf ("29DL323T (32 M, top sector)\n");
-               break;
-       case FLASH_AMDL323B:
-               printf ("29DL323B (32 M, bottom sector)\n");
-               break;
-       case FLASH_AM640U:
-               printf ("29LV640D (64 M, uniform sector)\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;
-}
-
-/*-----------------------------------------------------------------------
- */
-int flash_erase (flash_info_t * info, int s_first, int s_last)
-{
-       int flag, prot, sect, l_sect;
-       ulong start, now, last;
-       unsigned long msr;
-       DWORD cmd_erase[6] = { 0x00AA00AA00AA00AALL, 0x0055005500550055LL,
-                                                  0x0080008000800080LL, 0x00AA00AA00AA00AALL,
-                                                  0x0055005500550055LL, 0x0030003000300030LL };
-
-       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;
-       }
-
-       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");
-       }
-
-       l_sect = -1;
-
-       /* Enable FPU */
-       msr = get_msr();
-       set_msr ( msr | MSR_FP );
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts ();
-
-       write_via_fpu ((DWORD*)(info->start[0] + (0x0555 << 3)), &cmd_erase[0] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x02AA << 3)), &cmd_erase[1] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x0555 << 3)), &cmd_erase[2] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x0555 << 3)), &cmd_erase[3] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x02AA << 3)), &cmd_erase[4] );
-       udelay (1000);
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect <= s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       write_via_fpu ((DWORD*)info->start[sect], &cmd_erase[5] );
-                       l_sect = sect;
-               }
-       }
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts ();
-
-       /* Restore FPU */
-       set_msr (msr);
-
-       /* wait at least 80us - let's wait 1 ms */
-       udelay (1000);
-
-       /*
-        * We wait for the last triggered sector
-        */
-       if (l_sect < 0)
-               goto DONE;
-
-       start = get_timer (0);
-       last = start;
-       while ((*(volatile DWORD*)info->start[l_sect] & 0x0080008000800080LL )
-                               != 0x0080008000800080LL )
-       {
-               if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                       printf ("Timeout\n");
-                       return 1;
-               }
-               /* show that we're waiting */
-               if ((now - last) > 1000) {      /* every second */
-                       serial_putc ('.');
-                       last = now;
-               }
-       }
-
-  DONE:
-       /* reset to read mode */
-       flash_reset ();
-
-       printf (" done\n");
-       return 0;
-}
-
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-
-int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-       ulong dp;
-       static unsigned char bb[8];
-       int i, l, rc, cc = cnt;
-
-       dp = (addr & ~7);               /* get lower dword aligned address */
-
-       /*
-        * handle unaligned start bytes
-        */
-       if ((l = addr - dp) != 0) {
-               for (i = 0; i < 8; i++)
-                       bb[i] = (i < l || (i - l) >= cc) ? *(char*)(dp + i) : *src++;
-               if ((rc = write_dword (info, dp, bb)) != 0) {
-                       return (rc);
-               }
-               dp += 8;
-               cc -= 8 - l;
-       }
-
-       /*
-        * handle word aligned part
-        */
-       while (cc >= 8) {
-               if ((rc = write_dword (info, dp, src)) != 0) {
-                       return (rc);
-               }
-               dp += 8;
-               src += 8;
-               cc -= 8;
-       }
-
-       if (cc <= 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       for (i = 0; i < 8; i++) {
-               bb[i] = (i < cc) ? *src++ : *(char*)(dp + i);
-       }
-       return (write_dword (info, dp, bb));
-}
-
-/*-----------------------------------------------------------------------
- * Write a dword to Flash, returns:
- * 0 - OK
- * 1 - write timeout
- * 2 - Flash not erased
- */
-static int write_dword (flash_info_t * info, ulong dest, unsigned char *pdata)
-{
-       ulong start;
-       unsigned long msr;
-       int flag, i;
-       DWORD data;
-       DWORD cmd_write[3] = { 0x00AA00AA00AA00AALL, 0x0055005500550055LL,
-                                                  0x00A000A000A000A0LL };
-
-       for (data = 0, i = 0; i < 8; i++)
-               data = (data << 8) + *pdata++;
-
-       /* Check if Flash is (sufficiently) erased */
-       if ((*(DWORD*)dest & data) != data) {
-               return (2);
-       }
-
-       /* Enable FPU */
-       msr = get_msr();
-       set_msr( msr | MSR_FP );
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts ();
-
-       write_via_fpu ((DWORD*)(info->start[0] + (0x0555 << 3)), &cmd_write[0] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x02AA << 3)), &cmd_write[1] );
-       write_via_fpu ((DWORD*)(info->start[0] + (0x0555 << 3)), &cmd_write[2] );
-       write_via_fpu ((DWORD*)dest, &data );
-
-       /* re-enable interrupts if necessary */
-       if (flag)
-               enable_interrupts ();
-
-       /* Restore FPU */
-       set_msr(msr);
-
-       /* data polling for D7 */
-       start = get_timer (0);
-       while (*(volatile DWORD*)dest != data ) {
-               if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
-                       return (1);
-               }
-       }
-       return (0);
-}
-
-/*-----------------------------------------------------------------------
- */
-static void write_via_fpu (volatile DWORD* addr, DWORD* data)
-{
-       __asm__ __volatile__ ("lfd  1, 0(%0)"::"r" (data));
-       __asm__ __volatile__ ("stfd 1, 0(%0)"::"r" (addr));
-       __asm__ __volatile__ ("eieio");
-}
diff --git a/board/ppmc7xx/init.S b/board/ppmc7xx/init.S
deleted file mode 100644 (file)
index 99a818a..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * init.S
- * ------
- *
- * Wind River PPMC 7xx/74xx init code.
- *
- * By Richard Danter (richard.danter@windriver.com)
- * Copyright (C) 2005 Wind River Systems
- *
- * NOTE: The following code was generated automatically by Workbench
- *       from the ppmc7400_107.reg register file.
- */
-
-#include <ppc_asm.tmpl>
-
-
-.globl board_asm_init
-board_asm_init:
-
-      lis    r4,0xFEC0
-      ori    r4,r4,0x0000
-      lis    r5,0xFEE0
-      ori    r5,r5,0x0000
-      lis    r3,0x8000          # ADDR_00
-      ori    r3,r3,0x0000
-      stwbrx    r3,0,r4
-      li     r3,0x1057          # VENDOR
-      li    r8, 0x0
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_02
-      ori    r3,r3,0x0002
-      stwbrx    r3,0,r4
-      li     r3,0x0004          # ID
-      li    r8, 0x2
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_04
-      ori    r3,r3,0x0004
-      stwbrx    r3,0,r4
-      li     r3,0x0006          # PCICMD
-      li    r8, 0x0
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_06
-      ori    r3,r3,0x0006
-      stwbrx    r3,0,r4
-      li     r3,0x00A0          # PCISTAT
-      li    r8, 0x2
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_08
-      ori    r3,r3,0x0008
-      stwbrx    r3,0,r4
-      li     r3,0x10            # REVID
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_09
-      ori    r3,r3,0x0009
-      stwbrx    r3,0,r4
-      li     r3,0x00            # PROGIR
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_0A
-      ori    r3,r3,0x000A
-      stwbrx    r3,0,r4
-      li     r3,0x00            # SUBCCODE
-      stb    r3,0x2(r5)
-      lis    r3,0x8000          # ADDR_0B
-      ori    r3,r3,0x000B
-      stwbrx    r3,0,r4
-      li     r3,0x06            # PBCCR
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_0C
-      ori    r3,r3,0x000C
-      stwbrx    r3,0,r4
-      li     r3,0x08            # PCLSR
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_0D
-      ori    r3,r3,0x000D
-      stwbrx    r3,0,r4
-      li     r3,0x00            # PLTR
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_0E
-      ori    r3,r3,0x000E
-      stwbrx    r3,0,r4
-      li     r3,0x00            # HEADTYPE
-      stb    r3,0x2(r5)
-      lis    r3,0x8000          # ADDR_0F
-      ori    r3,r3,0x000F
-      stwbrx    r3,0,r4
-      li     r3,0x00            # BISTCTRL
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_10
-      ori    r3,r3,0x0010
-      stwbrx    r3,0,r4
-      lis    r3,0x0000          # LMBAR
-      ori    r3,r3,0x0008
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_14
-      ori    r3,r3,0x0014
-      stwbrx    r3,0,r4
-      lis    r3,0xF000          # PCSRBAR
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_3C
-      ori    r3,r3,0x003C
-      stwbrx    r3,0,r4
-      li     r3,0x00            # ILR
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_3D
-      ori    r3,r3,0x003D
-      stwbrx    r3,0,r4
-      li     r3,0x01            # INTPIN
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_3E
-      ori    r3,r3,0x003E
-      stwbrx    r3,0,r4
-      li     r3,0x00            # MIN_GNT
-      stb    r3,0x2(r5)
-      lis    r3,0x8000          # ADDR_3F
-      ori    r3,r3,0x003F
-      stwbrx    r3,0,r4
-      li     r3,0x00            # MAX_LAT
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_40
-      ori    r3,r3,0x0040
-      stwbrx    r3,0,r4
-      li     r3,0x00            # BUSNB
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_41
-      ori    r3,r3,0x0041
-      stwbrx    r3,0,r4
-      li     r3,0x00            # SBUSNB
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_46
-      ori    r3,r3,0x0046
-      stwbrx    r3,0,r4
-#      li     r3,0xE080          # PCIARB
-      li     r3,-0x1F80          # PCIARB
-      li    r8, 0x2
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_70
-      ori    r3,r3,0x0070
-      stwbrx    r3,0,r4
-      li     r3,0x0000          # PMCR1
-      li    r8, 0x0
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_72
-      ori    r3,r3,0x0072
-      stwbrx    r3,0,r4
-      li     r3,0xC0            # PMCR2
-      stb    r3,0x2(r5)
-      lis    r3,0x8000          # ADDR_73
-      ori    r3,r3,0x0073
-      stwbrx    r3,0,r4
-      li     r3,0xEF            # ODCR
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_74
-      ori    r3,r3,0x0074
-      stwbrx    r3,0,r4
-      li     r3,0x7D00          # CLKDCR
-      li    r8, 0x0
-      sthbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_76
-      ori    r3,r3,0x0076
-      stwbrx    r3,0,r4
-      li     r3,0x00            # MDCR
-      stb    r3,0x2(r5)
-      lis    r6,0xFCE0
-      ori    r6,r6,0x0000       # r6 is the EUMBAR Base Address
-      lis    r3,0x8000          # ADDR_78
-      ori    r3,r3,0x0078
-      stwbrx    r3,0,r4
-      lis    r3,0xFCE0          # EUMBBAR
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_80
-      ori    r3,r3,0x0080
-      stwbrx    r3,0,r4
-      lis    r3,0xFFFF          # MSADDR1
-      ori    r3,r3,0x4000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_84
-      ori    r3,r3,0x0084
-      stwbrx    r3,0,r4
-      lis    r3,0xFFFF          # MSADDR2
-      ori    r3,r3,0xFFFF
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_88
-      ori    r3,r3,0x0088
-      stwbrx    r3,0,r4
-      lis    r3,0x0303          # EMSADDR1
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_8C
-      ori    r3,r3,0x008C
-      stwbrx    r3,0,r4
-      lis    r3,0x0303          # EMSADDR2
-      ori    r3,r3,0x0303
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_90
-      ori    r3,r3,0x0090
-      stwbrx    r3,0,r4
-      lis    r3,0xFFFF          # EMEADDR1
-      ori    r3,r3,0x7F3F
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_94
-      ori    r3,r3,0x0094
-      stwbrx    r3,0,r4
-      lis    r3,0xFFFF          # EMEADDR2
-      ori    r3,r3,0xFFFF
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_98
-      ori    r3,r3,0x0098
-      stwbrx    r3,0,r4
-      lis    r3,0x0303          # EXTEMEM1
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_9C
-      ori    r3,r3,0x009C
-      stwbrx    r3,0,r4
-      lis    r3,0x0303          # EXTEMEM2
-      ori    r3,r3,0x0303
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_A0
-      ori    r3,r3,0x00A0
-      stwbrx    r3,0,r4
-      li     r3,0x03            # MEMBNKEN
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_A3
-      ori    r3,r3,0x00A3
-      stwbrx    r3,0,r4
-      li     r3,0x00            # MEMPMODE
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_B8
-      ori    r3,r3,0x00B8
-      stwbrx    r3,0,r4
-      li     r3,0x00            # ECCCNT
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_B9
-      ori    r3,r3,0x00B9
-      stwbrx    r3,0,r4
-      li     r3,0x00            # ECCTRG
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_C0
-      ori    r3,r3,0x00C0
-      stwbrx    r3,0,r4
-      li     r3,0xFF            # ERRENR1
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_C1
-      ori    r3,r3,0x00C1
-      stwbrx    r3,0,r4
-      li     r3,0x00            # ERRDR1
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_C3
-      ori    r3,r3,0x00C3
-      stwbrx    r3,0,r4
-      li     r3,0x50            # IPBESR
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_C4
-      ori    r3,r3,0x00C4
-      stwbrx    r3,0,r4
-      li     r3,0xBF            # ERRENR2
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_C5
-      ori    r3,r3,0x00C5
-      stwbrx    r3,0,r4
-      li     r3,0x00            # ERRDR2
-      stb    r3,0x1(r5)
-      lis    r3,0x8000          # ADDR_C7
-      ori    r3,r3,0x00C7
-      stwbrx    r3,0,r4
-      li     r3,0x00            # PCIBESR
-      stb    r3,0x3(r5)
-      lis    r3,0x8000          # ADDR_C8
-      ori    r3,r3,0x00C8
-      stwbrx    r3,0,r4
-      lis    r3,0x0000          # BERRADDR
-      ori    r3,r3,0xE0FE
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_E0
-      ori    r3,r3,0x00E0
-      stwbrx    r3,0,r4
-      li     r3,0xC0            # AMBOR
-      stb    r3,0x0(r5)
-      lis    r3,0x8000          # ADDR_F4
-      ori    r3,r3,0x00F4
-      stwbrx    r3,0,r4
-      lis    r3,0x0000          # MCCR2
-      ori    r3,r3,0x020C
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_F8
-      ori    r3,r3,0x00F8
-      stwbrx    r3,0,r4
-      lis    r3,0x0230          # MCCR3
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_FC
-      ori    r3,r3,0x00FC
-      stwbrx    r3,0,r4
-      lis    r3,0x2532          # MCCR4
-      ori    r3,r3,0x2220
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_F0
-      ori    r3,r3,0x00F0
-      stwbrx    r3,0,r4
-      lis    r3,0xFFC8          # MCCR1
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_A8
-      ori    r3,r3,0x00A8
-      stwbrx    r3,0,r4
-      lis    r3,0xFF14          # PICR1
-      ori    r3,r3,0x1CC8
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-      lis    r3,0x8000          # ADDR_AC
-      ori    r3,r3,0x00AC
-      stwbrx    r3,0,r4
-      lis    r3,0x0000          # PICR2
-      ori    r3,r3,0x0000
-      li    r8, 0x0
-      stwbrx    r3,r8,r5
-
-      blr
diff --git a/board/ppmc7xx/pci.c b/board/ppmc7xx/pci.c
deleted file mode 100644 (file)
index d81a41a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * PCI initialisation for the MPC10x.
- */
-
-#include <common.h>
-#include <pci.h>
-#include <mpc106.h>
-
-#ifdef CONFIG_PCI
-
-struct pci_controller local_hose;
-
-void pci_init_board(void)
-{
-    struct pci_controller* hose = (struct pci_controller *)&local_hose;
-    u16 reg16;
-
-    hose->first_busno = 0;
-    hose->last_busno = 0xff;
-
-    pci_set_region(hose->regions + 0,
-       CONFIG_SYS_PCI_MEMORY_BUS,
-       CONFIG_SYS_PCI_MEMORY_PHYS,
-       CONFIG_SYS_PCI_MEMORY_SIZE,
-       PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
-
-    /* PCI memory space */
-    pci_set_region(hose->regions + 1,
-       CONFIG_SYS_PCI_MEM_BUS,
-       CONFIG_SYS_PCI_MEM_PHYS,
-       CONFIG_SYS_PCI_MEM_SIZE,
-       PCI_REGION_MEM);
-
-    /* ISA/PCI memory space */
-    pci_set_region(hose->regions + 2,
-       CONFIG_SYS_ISA_MEM_BUS,
-       CONFIG_SYS_ISA_MEM_PHYS,
-       CONFIG_SYS_ISA_MEM_SIZE,
-       PCI_REGION_MEM);
-
-    /* PCI I/O space */
-    pci_set_region(hose->regions + 3,
-       CONFIG_SYS_PCI_IO_BUS,
-       CONFIG_SYS_PCI_IO_PHYS,
-       CONFIG_SYS_PCI_IO_SIZE,
-       PCI_REGION_IO);
-
-    /* ISA/PCI I/O space */
-    pci_set_region(hose->regions + 4,
-       CONFIG_SYS_ISA_IO_BUS,
-       CONFIG_SYS_ISA_IO_PHYS,
-       CONFIG_SYS_ISA_IO_SIZE,
-       PCI_REGION_IO);
-
-    hose->region_count = 5;
-
-    pci_setup_indirect(hose,
-       MPC106_REG_ADDR,
-       MPC106_REG_DATA);
-
-    pci_register_hose(hose);
-
-    hose->last_busno = pci_hose_scan(hose);
-
-    /* Initialises the MPC10x PCI Configuration regs. */
-    pci_read_config_word (PCI_BDF(0,0,0), PCI_COMMAND, &reg16);
-    reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
-    pci_write_config_word(PCI_BDF(0,0,0), PCI_COMMAND, reg16);
-
-    /* Clear non-reserved bits in status register */
-    pci_write_config_word(PCI_BDF(0,0,0), PCI_STATUS, 0xffff);
-}
-
-#endif /* CONFIG_PCI */
diff --git a/board/ppmc7xx/ppmc7xx.c b/board/ppmc7xx/ppmc7xx.c
deleted file mode 100644 (file)
index 432d366..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * ppmc7xx.c
- * ---------
- *
- * Main board-specific routines for Wind River PPMC 7xx/74xx board.
- *
- * By Richard Danter (richard.danter@windriver.com)
- * Copyright (C) 2005 Wind River Systems
- */
-
-#include <common.h>
-#include <command.h>
-#include <netdev.h>
-
-
-/* Define some MPC107 (memory controller) registers */
-#define MPC107_EUMB_GCR         0xfce41020
-#define MPC107_EUMB_IACKR       0xfce600a0
-
-
-/* Function prototypes */
-extern void _start(void);
-
-
-/*
- * initdram()
- *
- * This function normally initialises the (S)DRAM of the system. For this board
- * the SDRAM was already initialised by board_asm_init (see init.S) so we just
- * return the size of RAM.
- */
-phys_size_t initdram( int board_type )
-{
-    return CONFIG_SYS_SDRAM_SIZE;
-}
-
-
-/*
- * after_reloc()
- *
- * This is called after U-Boot has been copied from Flash/ROM to RAM. It gives
- * us an opportunity to do some additional setup before the rest of the system
- * is initialised. We don't need to do anything, so we just call board_init_r()
- * which should never return.
- */
-void after_reloc( ulong dest_addr, gd_t* gd )
-{
-       /* Jump to the main U-Boot board init code */
-       board_init_r( gd, dest_addr );
-}
-
-
-/*
- * checkboard()
- *
- * We could do some board level checks here, such as working out what version
- * it is, but for this board we simply display it's name (on the console).
- */
-int checkboard( void )
-{
-    puts( "Board: Wind River PPMC 7xx/74xx\n" );
-    return 0;
-}
-
-
-/*
- * misc_init_r
- *
- * Used for other setup which needs to be done late in the bring-up phase.
- */
-int misc_init_r( void )
-{
-       /* Reset the EPIC and clear pending interrupts */
-       out32r(MPC107_EUMB_GCR, 0xa0000000);
-       while( in32r( MPC107_EUMB_GCR ) & 0x80000000 );
-       out32r( MPC107_EUMB_GCR, 0x20000000 );
-       while( in32r( MPC107_EUMB_IACKR ) != 0xff );
-
-       /* Enable the I-Cache */
-       icache_enable();
-
-       return 0;
-}
-
-
-/*
- * do_reset()
- *
- * Shell command to reset the board.
- */
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       printf( "Resetting...\n" );
-
-       /* Disabe and invalidate cache */
-       icache_disable();
-       dcache_disable();
-
-       /* Jump to cold reset point (in RAM) */
-       _start();
-
-       /* Should never get here */
-       while(1)
-               ;
-
-       return 1;
-}
-
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
-}
index 596071f9b358383d0df52e6742e26be627240027..ec00c15af3d6e62bc84bcd44a2861b48063f2ee8 100644 (file)
@@ -11,7 +11,7 @@
 #
 
 # Boot Media configurations
-BOOT_FROM      nand    # change from nand to uart if building UART image
+BOOT_FROM      nand
 NAND_ECC_MODE  default
 NAND_PAGE_SIZE 0x0800
 
@@ -21,12 +21,12 @@ NAND_PAGE_SIZE      0x0800
 # Configure RGMII-0 interface pad voltage to 1.8V
 DATA 0xffd100e0 0x1b1b1b9b
 
-#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+# Dram initalization for SINGLE x16 CL=5 @ 400MHz
 DATA 0xffd01400 0x43000c30     # DDR Configuration register
 # bit13-0:  0xc30, (3120 DDR2 clks refresh rate)
 # bit23-14: 0x0,
-# bit24:    0x1,     enable exit self refresh mode on DDR access
-# bit25:    0x1,     required
+# bit24:    0x1,   enable exit self refresh mode on DDR access
+# bit25:    0x1,   required
 # bit29-26: 0x0,
 # bit31-30: 0x1,
 
@@ -64,10 +64,10 @@ DATA 0xffd01410 0x0000000c  # DDR Address Control
 # bit3-2:   11,  Cs0size (1Gb)
 # bit5-4:   00,  Cs1width (x8)
 # bit7-6:   11,  Cs1size (1Gb)
-# bit9-8:   00,  Cs2width (nonexistent
-# bit11-10: 00,  Cs2size  (nonexistent
-# bit13-12: 00,  Cs3width (nonexistent
-# bit15-14: 00,  Cs3size  (nonexistent
+# bit9-8:   00,  Cs2width (nonexistent)
+# bit11-10: 00,  Cs2size (nonexistent)
+# bit13-12: 00,  Cs3width (nonexistent)
+# bit15-14: 00,  Cs3size (nonexistent)
 # bit16:    0,   Cs0AddrSel
 # bit17:    0,   Cs1AddrSel
 # bit18:    0,   Cs2AddrSel
@@ -88,7 +88,7 @@ DATA 0xffd0141c 0x00000c52    # DDR Mode
 # bit6-4:   0x4, CL=5
 # bit7:     0x0, TestMode=0 normal
 # bit8:     0x0, DLL reset=0 normal
-# bit11-9:  0x6, auto-precharge write recovery ????????????
+# bit11-9:  0x6, auto-precharge write recovery
 # bit12:    0x0, PD must be zero
 # bit31-13: 0x0, required
 
@@ -148,8 +148,8 @@ DATA 0xffd0149c 0x0000e803  # CPU ODT Control
 DATA 0xffd01480 0x00000001     # DDR Initialization Control
 # bit0: 0x1, enable DDR init upon this register write
 
-DATA 0xFFD20134 0x66666666      # L2 RAM Timing 0 Register
-DATA 0xFFD20138 0x66666666      # L2 RAM Timing 1 Register
+DATA 0xffd20134 0x66666666     # L2 RAM Timing 0 Register
+DATA 0xffd20138 0x66666666     # L2 RAM Timing 1 Register
 
 # End of Header extension
 DATA 0x0 0x0
index b7d23817e143016688d332fbf1da1acd925fe6c2..e3517f2eb24101f8614b53c120d30f37ea5caa06 100644 (file)
@@ -415,15 +415,6 @@ static int pmic_init_max77686(void)
        return 0;
 }
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-static void board_init_i2c(void)
-{
-       /* I2C_0 */
-       if (exynos_pinmux_config(PERIPH_ID_I2C0, PINMUX_FLAG_NONE))
-               debug("I2C%d not configured\n", (I2C_0));
-}
-#endif
-
 int exynos_early_init_f(void)
 {
        board_clock_init();
@@ -444,10 +435,7 @@ int exynos_init(void)
 
 int exynos_power_init(void)
 {
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       board_init_i2c();
-#endif
-       pmic_init(I2C_0);
+       pmic_init(0);
        pmic_init_max77686();
 
        return 0;
index 5f879f55065255d31ec152fde745190f60d4fe2f..3c0df1784553a85222660061c5b570c40823684a 100644 (file)
@@ -18,8 +18,8 @@ create unit tests which we can run to test this upper level code.
 
 CONFIG_SANDBOX is defined when building a native board.
 
-The chosen vendor and board names are also 'sandbox', so there is a single
-board in board/sandbox.
+The board name is 'sandbox' but the vendor name is unset, so there is a
+single board in board/sandbox.
 
 CONFIG_SANDBOX_BIG_ENDIAN should be defined when running on big-endian
 machines.
index 0a11540cca01d316db4b7eb6f71fd234a2cc9360..f3f6dae459af3ba6a74bfa49e544a73106db6b3f 100644 (file)
@@ -43,13 +43,13 @@ static void corvus_nand_hw_init(void)
        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),
+       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(3) | AT91_SMC_PULSE_NCS_RD(2),
+       writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(4) |
+              AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(4),
               &smc->cs[3].pulse);
-       writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(4),
+       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 |
@@ -62,9 +62,11 @@ static void corvus_nand_hw_init(void)
               &smc->cs[3].mode);
 
        at91_periph_clk_enable(ATMEL_ID_PIOC);
+       at91_periph_clk_enable(ATMEL_ID_PIOA);
 
        /* Enable NandFlash */
        at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 }
 
 #if defined(CONFIG_SPL_BUILD)
index b8ff478110287c89bbd3fa274ff4e3eae28e5298..013dac2e2fb131baa83ae883c1eb514c26f55ef1 100644 (file)
@@ -68,6 +68,7 @@ static void taurus_nand_hw_init(void)
 #if defined(CONFIG_SPL_BUILD)
 #include <spl.h>
 #include <nand.h>
+#include <spi_flash.h>
 
 void matrix_init(void)
 {
@@ -81,23 +82,28 @@ void matrix_init(void)
 void at91_spl_board_init(void)
 {
        taurus_nand_hw_init();
+       at91_spi0_hw_init(TAURUS_SPI_MASK);
 
        /* Configure recovery button PINs */
        at91_set_gpio_input(AT91_PIN_PA31, 1);
 
        /* check if button is pressed */
        if (at91_get_gpio_value(AT91_PIN_PA31) == 0) {
-               u32 boot_device;
+               struct spi_flash *flash;
 
                debug("Recovery button pressed\n");
-               boot_device = spl_boot_device();
-               switch (boot_device) {
-#ifdef CONFIG_SPL_NAND_SUPPORT
-               case BOOT_DEVICE_NAND:
-                       nand_init();
-                       spl_nand_erase_one(0, 0);
-                       break;
-#endif
+               nand_init();
+               spl_nand_erase_one(0, 0);
+               flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
+                                       0,
+                                       CONFIG_SF_DEFAULT_SPEED,
+                                       SPI_MODE_3);
+               if (!flash) {
+                       puts("no flash\n");
+               } else {
+                       puts("erase spi flash sector 0\n");
+                       spi_flash_erase(flash, 0,
+                                       CONFIG_SYS_NAND_U_BOOT_SIZE);
                }
        }
 }
index 6a4d764b7c9a94eaa4efe0d49f79d2bcbaf23a07..4a2158988fc9bce0d1991d51e72586e7c2af5615 100644 (file)
@@ -33,21 +33,103 @@ config MACH_SUN8I
 
 endchoice
 
-if MACH_SUN6I || MACH_SUN8I
-
 config DRAM_CLK
-       int "sun6i dram clock speed"
-       default 312
+       int "sunxi dram clock speed"
+       default 312 if MACH_SUN6I || MACH_SUN8I
+       default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
        ---help---
        Set the dram clock speed, valid range 240 - 480, must be a multiple
        of 24.
 
+if MACH_SUN5I || MACH_SUN7I
+config DRAM_MBUS_CLK
+       int "sunxi mbus clock speed"
+       default 300
+       ---help---
+       Set the mbus clock speed. The maximum on sun5i hardware is 300MHz.
+
+endif
+
 config DRAM_ZQ
-       int "sun6i dram zq value"
-       default 123
+       int "sunxi dram zq value"
+       default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
+       default 127 if MACH_SUN7I
        ---help---
        Set the dram zq value.
 
+if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
+config DRAM_EMR1
+       int "sunxi dram emr1 value"
+       default 0 if MACH_SUN4I
+       default 4 if MACH_SUN5I || MACH_SUN7I
+       ---help---
+       Set the dram controller emr1 value.
+
+config DRAM_ODT_EN
+       int "sunxi dram odt_en value"
+       default 0
+       ---help---
+       Set the dram controller odt_en parameter. This can be used to
+       enable/disable the ODT feature.
+
+config DRAM_TPR3
+       hex "sunxi dram tpr3 value"
+       default 0
+       ---help---
+       Set the dram controller tpr3 parameter. This parameter configures
+       the delay on the command lane and also phase shifts, which are
+       applied for sampling incoming read data. The default value 0
+       means that no phase/delay adjustments are necessary. Properly
+       configuring this parameter increases reliability at high DRAM
+       clock speeds.
+
+config DRAM_DQS_GATING_DELAY
+       hex "sunxi dram dqs_gating_delay value"
+       default 0
+       ---help---
+       Set the dram controller dqs_gating_delay parmeter. Each byte
+       encodes the DQS gating delay for each byte lane. The delay
+       granularity is 1/4 cycle. For example, the value 0x05060606
+       means that the delay is 5 quarter-cycles for one lane (1.25
+       cycles) and 6 quarter-cycles (1.5 cycles) for 3 other lanes.
+       The default value 0 means autodetection. The results of hardware
+       autodetection are not very reliable and depend on the chip
+       temperature (sometimes producing different results on cold start
+       and warm reboot). But the accuracy of hardware autodetection
+       is usually good enough, unless running at really high DRAM
+       clocks speeds (up to 600MHz). If unsure, keep as 0.
+
+choice
+       prompt "sunxi dram timings"
+       default DRAM_TIMINGS_VENDOR_MAGIC
+       ---help---
+       Select the timings of the DDR3 chips.
+
+config DRAM_TIMINGS_VENDOR_MAGIC
+       bool "Magic vendor timings from Android"
+       ---help---
+       The same DRAM timings as in the Allwinner boot0 bootloader.
+
+config DRAM_TIMINGS_DDR3_1066F_1333H
+       bool "JEDEC DDR3-1333H with down binning to DDR3-1066F"
+       ---help---
+       Use the timings of the standard JEDEC DDR3-1066F speed bin for
+       DRAM_CLK <= 533MHz and the timings of the DDR3-1333H speed bin
+       for DRAM_CLK > 533MHz. This covers the majority of DDR3 chips
+       used in Allwinner A10/A13/A20 devices. In the case of DDR3-1333
+       or DDR3-1600 chips, be sure to check the DRAM datasheet to confirm
+       that down binning to DDR3-1066F is supported (because DDR3-1066F
+       uses a bit faster timings than DDR3-1333H).
+
+config DRAM_TIMINGS_DDR3_800E_1066G_1333J
+       bool "JEDEC DDR3-800E / DDR3-1066G / DDR3-1333J"
+       ---help---
+       Use the timings of the slowest possible JEDEC speed bin for the
+       selected DRAM_CLK. Depending on the DRAM_CLK value, it may be
+       DDR3-800E, DDR3-1066G or DDR3-1333J.
+
+endchoice
+
 endif
 
 config SYS_CONFIG_NAME
@@ -57,149 +139,6 @@ config SYS_CONFIG_NAME
        default "sun7i" if MACH_SUN7I
        default "sun8i" if MACH_SUN8I
 
-choice
-       prompt "Board"
-
-config TARGET_A10_OLINUXINO_L
-       bool "A10_OLINUXINO_L"
-       depends on MACH_SUN4I
-
-config TARGET_A10S_OLINUXINO_M
-       bool "A10S_OLINUXINO_M"
-       depends on MACH_SUN5I
-
-config TARGET_A13_OLINUXINOM
-       bool "A13_OLINUXINOM"
-       depends on MACH_SUN5I
-
-config TARGET_A13_OLINUXINO
-       bool "A13_OLINUXINO"
-       depends on MACH_SUN5I
-
-config TARGET_A20_OLINUXINO_L2
-       bool "A20_OLINUXINO_L2"
-       depends on MACH_SUN7I
-
-config TARGET_A20_OLINUXINO_L
-       bool "A20_OLINUXINO_L"
-       depends on MACH_SUN7I
-
-config TARGET_A20_OLINUXINO_M
-       bool "A20_OLINUXINO_M"
-       depends on MACH_SUN7I
-
-config TARGET_AUXTEK_T004
-       bool "AUXTEK_T004"
-       depends on MACH_SUN5I
-
-config TARGET_BANANAPI
-       bool "BANANAPI"
-       depends on MACH_SUN7I
-
-config TARGET_BANANAPRO
-       bool "BANANAPRO"
-       depends on MACH_SUN7I
-
-config TARGET_COLOMBUS
-       bool "COLOMBUS"
-       depends on MACH_SUN6I
-
-config TARGET_CUBIEBOARD2
-       bool "CUBIEBOARD2"
-       depends on MACH_SUN7I
-
-config TARGET_CUBIEBOARD
-       bool "CUBIEBOARD"
-       depends on MACH_SUN4I
-
-config TARGET_CUBIETRUCK
-       bool "CUBIETRUCK"
-       depends on MACH_SUN7I
-
-config TARGET_HUMMINGBIRD_A31
-       bool "HUMMINGBIRD_A31"
-       depends on MACH_SUN6I
-
-config TARGET_IPPO_Q8H_V5
-       bool "IPPO_Q8H_V5"
-       depends on MACH_SUN8I
-
-config TARGET_PCDUINO
-       bool "PCDUINO"
-       depends on MACH_SUN4I
-
-config TARGET_PCDUINO3
-       bool "PCDUINO3"
-       depends on MACH_SUN7I
-
-config TARGET_MELE_A1000G
-       bool "MELE_A1000G"
-       depends on MACH_SUN4I
-
-config TARGET_MELE_A1000
-       bool "MELE_A1000"
-       depends on MACH_SUN4I
-
-config TARGET_MELE_M3
-       bool "MELE_M3"
-       depends on MACH_SUN7I
-
-config TARGET_MELE_M9
-       bool "MELE_M9"
-       depends on MACH_SUN6I
-
-config TARGET_MINI_X_1GB
-       bool "MINI_X_1GB"
-       depends on MACH_SUN4I
-
-config TARGET_MINI_X
-       bool "MINI_X"
-       depends on MACH_SUN4I
-
-config TARGET_MSI_PRIMO73
-       bool "MSI Primo73 (7\" tablet)"
-       depends on MACH_SUN7I
-       ---help---
-       The MSI Primo73 is an A20 based tablet, with 1G RAM, 16G NAND,
-       1024x600 TN LCD display, mono speaker, 0.3 MP front camera, 2.0 MP
-       rear camera, 3000 mAh battery, gt911 touchscreen, mma8452 accelerometer
-       and rtl8188etv usb wifi. Has "power", "volume+" and "volume-" buttons
-       (both volume buttons are also connected to the UBOOT_SEL pin). The
-       external connectors are represented by MicroSD slot, MiniHDMI, MicroUSB
-       OTG and 3.5mm headphone jack. More details are available at
-           http://linux-sunxi.org/MSI_Primo73
-
-config TARGET_MSI_PRIMO81
-       bool "MSI Primo81 (7.85\" tablet)"
-       depends on MACH_SUN6I
-       ---help---
-       The MSI Primo81 is an A31s based tablet, with 1G RAM, 16G NAND,
-       1024x768 IPS LCD display, mono speaker, 0.3 MP front camera, 2.0 MP
-       rear camera, 3500 mAh battery, gt911 touchscreen, mma8452 accelerometer
-       and rtl8188etv usb wifi. Has "power", "volume+" and "volume-" buttons
-       (both volume buttons are also connected to the UBOOT_SEL pin). The
-       external connectors are represented by MicroSD slot, MiniHDMI, MicroUSB
-       OTG and 3.5mm headphone jack. More details are available at
-           http://linux-sunxi.org/MSI_Primo81
-
-config TARGET_BA10_TV_BOX
-       bool "BA10_TV_BOX"
-       depends on MACH_SUN4I
-
-config TARGET_I12_TVBOX
-       bool "I12_TVBOX"
-       depends on MACH_SUN7I
-
-config TARGET_QT840A
-       bool "QT840A"
-       depends on MACH_SUN7I
-
-config TARGET_R7DONGLE
-       bool "R7DONGLE"
-       depends on MACH_SUN5I
-
-endchoice
-
 config SYS_BOARD
        default "sunxi"
 
@@ -321,6 +260,16 @@ config VIDEO_VGA_VIA_LCD
        LCD interface driving a VGA connector, such as found on the
        Olimex A13 boards.
 
+config VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
+       boolean "Force sync active high for VGA via LCD controller support"
+       depends on VIDEO_VGA_VIA_LCD
+       default n
+       ---help---
+       Say Y here if you've a board which uses opendrain drivers for the vga
+       hsync and vsync signals. Opendrain drivers cannot generate steep enough
+       positive edges for a stable video output, so on boards with opendrain
+       drivers the sync signals must always be active high.
+
 config VIDEO_VGA_EXTERNAL_DAC_EN
        string "LCD panel power enable pin"
        depends on VIDEO_VGA_VIA_LCD
@@ -338,6 +287,13 @@ config VIDEO_LCD_MODE
        This is in drivers/video/videomodes.c: video_get_params() format, e.g.
        x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:0,vmode:0
 
+config VIDEO_LCD_DCLK_PHASE
+       int "LCD panel display clock phase"
+       depends on VIDEO
+       default 1
+       ---help---
+       Select LCD panel display clock phase shift, range 0-3.
+
 config VIDEO_LCD_POWER
        string "LCD panel power enable pin"
        depends on VIDEO
@@ -363,6 +319,13 @@ config VIDEO_LCD_BL_PWM
        Set the backlight pwm pin for the LCD panel. This takes a string in the
        format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
 
+config VIDEO_LCD_BL_PWM_ACTIVE_LOW
+       bool "LCD panel backlight pwm is inverted"
+       depends on VIDEO
+       default y
+       ---help---
+       Set this if the backlight pwm output is active low.
+
 
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
@@ -387,9 +350,32 @@ config VIDEO_LCD_PANEL_LVDS
        bool "Generic lvds interface LCD panel"
        select VIDEO_LCD_IF_LVDS
 
+config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828
+       bool "MIPI 4-lane, 513Mbps LCD panel via SSD2828 bridge chip"
+       select VIDEO_LCD_SSD2828
+       select VIDEO_LCD_IF_PARALLEL
+       ---help---
+        7.85" 768x1024 LCD panels, such as LG LP079X01 or AUO B079XAN01.0
+
+config VIDEO_LCD_PANEL_HITACHI_TX18D42VM
+       bool "Hitachi tx18d42vm LCD panel"
+       select VIDEO_LCD_HITACHI_TX18D42VM
+       select VIDEO_LCD_IF_LVDS
+       ---help---
+       7.85" 1024x768 Hitachi tx18d42vm LCD panel support
+
 endchoice
 
 
+config USB_MUSB_SUNXI
+       bool "Enable sunxi OTG / DRC USB controller in host mode"
+       default n
+       ---help---
+       Say y here to enable support for the sunxi OTG / DRC USB controller
+       used on almost all sunxi boards. Note currently u-boot can only have
+       one usb host controller enabled at a time, so enabling this on boards
+       which also use the ehci host controller will result in build errors.
+
 config USB_KEYBOARD
        boolean "Enable USB keyboard support"
        default y
@@ -397,4 +383,10 @@ config USB_KEYBOARD
        Say Y here to add support for using a USB keyboard (typically used
        in combination with a graphical console).
 
+config GMAC_TX_DELAY
+       int "GMAC Transmit Clock Delay Chain"
+       default 0
+       ---help---
+       Set the GMAC Transmit Clock Delay Chain value.
+
 endif
index 3a09be92de553482adc9b44c86b7a600e3911995..faa413cb0660678d50162e97f60a1ac36be789de 100644 (file)
@@ -5,17 +5,20 @@ F:    board/sunxi/
 F:     include/configs/sun4i.h
 F:     configs/A10-OLinuXino-Lime_defconfig
 F:     configs/ba10_tv_box_defconfig
+F:     configs/Chuwi_V7_CW0825_defconfig
 F:     configs/Cubieboard_defconfig
+F:     configs/Hyundai_A7HD_defconfig
 F:     configs/Mele_A1000_defconfig
-F:     configs/Mele_A1000G_defconfig
 F:     configs/Mele_M3_defconfig
 F:     configs/Mini-X_defconfig
-F:     configs/Mini-X-1Gb_defconfig
+F:     configs/mk802_defconfig
+F:     configs/mk802ii_defconfig
 F:     include/configs/sun5i.h
 F:     configs/A10s-OLinuXino-M_defconfig
 F:     configs/A13-OLinuXino_defconfig
 F:     configs/A13-OLinuXinoM_defconfig
 F:     configs/Auxtek-T004_defconfig
+F:     configs/mk802_a10s_defconfig
 F:     configs/r7-tv-dongle_defconfig
 F:     include/configs/sun6i.h
 F:     configs/CSQ_CS908_defconfig
@@ -31,16 +34,6 @@ F:   configs/qt840a_defconfig
 F:     include/configs/sun8i.h
 F:     configs/Ippo_q8h_v1_2_defconfig
 
-CUBIEBOARD2 BOARD
-M:     Ian Campbell <ijc@hellion.org.uk>
-M:     Hans de Goede <hdegoede@redhat.com>
-S:     Maintained
-F:     include/configs/sun7i.h
-F:     configs/Cubieboard2_defconfig
-F:     configs/Cubieboard2_FEL_defconfig
-F:     configs/Cubietruck_defconfig
-F:     configs/Cubietruck_FEL_defconfig
-
 A20-OLINUXINO-LIME BOARD
 M:     FUKAUMI Naoki <naobsd@gmail.com>
 S:     Maintained
@@ -58,16 +51,57 @@ M:  Maxime Ripard <maxime.ripard@free-electrons.com>
 S:     Maintained
 F:     configs/Colombus_defconfig
 
-HUMMINIGBIRD-A31 BOARD
+CUBIEBOARD2 BOARD
+M:     Ian Campbell <ijc@hellion.org.uk>
+M:     Hans de Goede <hdegoede@redhat.com>
+S:     Maintained
+F:     include/configs/sun7i.h
+F:     configs/Cubieboard2_defconfig
+F:     configs/Cubieboard2_FEL_defconfig
+F:     configs/Cubietruck_defconfig
+F:     configs/Cubietruck_FEL_defconfig
+
+GEMEI-G9 TABLET
+M:     Priit Laes <plaes@plaes.org>
+S:     Maintained
+F:     configs/sunxi_Gemei_G9_defconfig
+
+HUMMINGBIRD-A31 BOARD
 M:     Chen-Yu Tsai <wens@csie.org>
 S:     Maintained
 F:     configs/Hummingbird_A31_defconfig
 
+INET-86VS BOARD
+M:     Michal Suchanek <hramrach@gmail.com>
+S:     Maintained
+F:     board/sunxi/dram_inet_86vs.c
+F:     configs/Inet_86VS_defconfig
+
 IPPO-Q8H-V5 BOARD
 M:     Chen-Yu Tsai <wens@csie.org>
 S:     Maintained
 F:     configs/Ippo_q8h_v5_defconfig
 
+LINKSPRITE-PCDUINO BOARD
+M:     Zoltan Herpai <wigyori@uid0.hu>
+S:     Maintained
+F:     configs/Linksprite_pcDuino_defconfig
+
+LINKSPRITE-PCDUINO3-NANO BOARD
+M:     Adam Sampson <ats@offog.org>
+S:     Maintained
+F:     configs/Linksprite_pcDuino3_Nano_defconfig
+
+MARSBOARD-A10 BOARD
+M:     Aleksei Mamlin <mamlinav@gmail.com>
+S:     Maintained
+F:     configs/Marsboard_A10_defconfig
+
+MELE M5 BOARD
+M:     Ian Campbell <ijc@hellion.org.uk>
+S:     Maintained
+F:     configs/Mele_M5_defconfig
+
 MSI-PRIMO73 BOARD
 M:     Siarhei Siamashka <siarhei.siamashka@gmail.com>
 S:     Maintained
@@ -78,7 +112,7 @@ M:   Siarhei Siamashka <siarhei.siamashka@gmail.com>
 S:     Maintained
 F:     configs/MSI_Primo81_defconfig
 
-LINKSPRITE-PCDUINO BOARD
-M:     Zoltan Herpai <wigyori@uid0.hu>
+TZX-Q8-713B7 BOARD
+M:     Paul Kocialkowski <contact@paulk.fr>
 S:     Maintained
-F:     configs/Linksprite_pcDuino_defconfig
+F:     configs/TZX-Q8-713B7_defconfig
index fab0877a54df5aa0a73aa578205874e08eb0e464..43766e0ef482b54c1fc42fb17fa9c1bf2033f7f1 100644 (file)
 obj-y  += board.o
 obj-$(CONFIG_SUNXI_GMAC)       += gmac.o
 obj-$(CONFIG_SUNXI_AHCI)       += ahci.o
-obj-$(CONFIG_TARGET_A10_OLINUXINO_L)   += dram_a10_olinuxino_l.o
-obj-$(CONFIG_TARGET_A10S_OLINUXINO_M)  += dram_a10s_olinuxino_m.o
-obj-$(CONFIG_TARGET_A13_OLINUXINO)     += dram_a13_olinuxino.o
-obj-$(CONFIG_TARGET_A13_OLINUXINOM)    += dram_a13_oli_micro.o
-obj-$(CONFIG_TARGET_A20_OLINUXINO_L)   += dram_a20_olinuxino_l.o
-obj-$(CONFIG_TARGET_A20_OLINUXINO_L2)  += dram_a20_olinuxino_l2.o
-obj-$(CONFIG_TARGET_A20_OLINUXINO_M)   += dram_sun7i_384_1024_iow16.o
-# This is not a typo, uses the same mem settings as the a10s-olinuxino-m
-obj-$(CONFIG_TARGET_AUXTEK_T004)       += dram_a10s_olinuxino_m.o
-obj-$(CONFIG_TARGET_BA10_TV_BOX)       += dram_sun4i_384_1024_iow8.o
-obj-$(CONFIG_TARGET_BANANAPI)          += dram_bananapi.o
-obj-$(CONFIG_TARGET_BANANAPRO)         += dram_bananapi.o
-obj-$(CONFIG_TARGET_CUBIEBOARD)                += dram_cubieboard.o
-obj-$(CONFIG_TARGET_CUBIEBOARD2)       += dram_cubieboard2.o
-obj-$(CONFIG_TARGET_CUBIETRUCK)                += dram_cubietruck.o
-obj-$(CONFIG_TARGET_I12_TVBOX)         += dram_sun7i_384_1024_iow16.o
-obj-$(CONFIG_TARGET_MELE_A1000)                += dram_sun4i_360_512.o
-obj-$(CONFIG_TARGET_MELE_A1000G)       += dram_sun4i_360_1024_iow8.o
-obj-$(CONFIG_TARGET_MELE_M3)           += dram_sun7i_384_1024_iow16.o
-obj-$(CONFIG_TARGET_MINI_X)            += dram_sun4i_360_512.o
-obj-$(CONFIG_TARGET_MINI_X_1GB)                += dram_sun4i_360_1024_iow16.o
-obj-$(CONFIG_TARGET_MSI_PRIMO73)       += dram_sun7i_384_1024_iow16.o
-obj-$(CONFIG_TARGET_PCDUINO)           += dram_sun4i_408_1024_iow8.o
-obj-$(CONFIG_TARGET_PCDUINO3)          += dram_linksprite_pcduino3.o
-obj-$(CONFIG_TARGET_QT840A)            += dram_sun7i_384_512_busw16_iow16.o
-obj-$(CONFIG_TARGET_R7DONGLE)          += dram_r7dongle.o
+obj-$(CONFIG_MACH_SUN4I)       += dram_sun4i_auto.o
+obj-$(CONFIG_MACH_SUN5I)       += dram_sun5i_auto.o
+obj-$(CONFIG_MACH_SUN7I)       += dram_sun5i_auto.o
index 7d6d075f145ee93d4e3463544b7ccd3694ec9771..b70e00ce6bced72c405554e4951a076a48338069 100644 (file)
@@ -28,7 +28,9 @@
 #include <asm/arch/dram.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/usbc.h>
 #include <asm/io.h>
+#include <linux/usb/musb.h>
 #include <net.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -189,6 +191,7 @@ void sunxi_board_init(void)
        power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT);
        power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT);
        power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT);
+       power_failed |= axp221_set_eldo(3, CONFIG_AXP221_ELDO3_VOLT);
 #endif
 
        printf("DRAM:");
@@ -208,6 +211,26 @@ void sunxi_board_init(void)
 }
 #endif
 
+#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
+static struct musb_hdrc_config musb_config = {
+       .multipoint     = 1,
+       .dyn_fifo       = 1,
+       .num_eps        = 6,
+       .ram_bits       = 11,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_MUSB_HOST)
+       .mode           = MUSB_HOST,
+#else
+       .mode           = MUSB_PERIPHERAL,
+#endif
+       .config         = &musb_config,
+       .power          = 250,
+       .platform_ops   = &sunxi_musb_ops,
+};
+#endif
+
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
@@ -227,6 +250,9 @@ int misc_init_r(void)
                eth_setenv_enetaddr("ethaddr", mac_addr);
        }
 
+#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
+       musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+#endif
        return 0;
 }
 #endif
diff --git a/board/sunxi/dram_a10_olinuxino_l.c b/board/sunxi/dram_a10_olinuxino_l.c
deleted file mode 100644 (file)
index 24a1bd9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 16,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_a10s_olinuxino_m.c b/board/sunxi/dram_a10s_olinuxino_m.c
deleted file mode 100644 (file)
index 8900539..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 432,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 16,
-       .cas = 9,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_a13_oli_micro.c b/board/sunxi/dram_a13_oli_micro.c
deleted file mode 100644 (file)
index 8154ea2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 408,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 16,
-       .bus_width = 16,
-       .cas = 9,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 256,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0x10,
-       .emr3 = 0,
-
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_a13_olinuxino.c b/board/sunxi/dram_a13_olinuxino.c
deleted file mode 100644 (file)
index ca96260..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 408,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 8,
-       .bus_width = 16,
-       .cas = 9,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_a20_olinuxino_l.c b/board/sunxi/dram_a20_olinuxino_l.c
deleted file mode 100644 (file)
index 2c74999..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include "common.h"
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 16,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_a20_olinuxino_l2.c b/board/sunxi/dram_a20_olinuxino_l2.c
deleted file mode 100644 (file)
index 2115d37..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_bananapi.c b/board/sunxi/dram_bananapi.c
deleted file mode 100644 (file)
index 0ed7943..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 432,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0x0,
-       .tpr4 = 0x1,
-       .tpr5 = 0x0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0x0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_cubieboard.c b/board/sunxi/dram_cubieboard.c
deleted file mode 100644 (file)
index 399028c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_cubieboard2.c b/board/sunxi/dram_cubieboard2.c
deleted file mode 100644 (file)
index 9e75367..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0x0,
-       .tpr4 = 0x1,
-       .tpr5 = 0x0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0x0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_cubietruck.c b/board/sunxi/dram_cubietruck.c
deleted file mode 100644 (file)
index fbcd687..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 432,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 8,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 2048,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0x0,
-       .tpr4 = 0x1,
-       .tpr5 = 0x0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0x0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_linksprite_pcduino3.c b/board/sunxi/dram_linksprite_pcduino3.c
deleted file mode 100644 (file)
index 9cc6e19..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 480,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7a,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0x0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_r7dongle.c b/board/sunxi/dram_r7dongle.c
deleted file mode 100644 (file)
index 59343cb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 384,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 8,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x04,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_360_1024_iow16.c b/board/sunxi/dram_sun4i_360_1024_iow16.c
deleted file mode 100644 (file)
index 3763713..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 360,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_360_1024_iow8.c b/board/sunxi/dram_sun4i_360_1024_iow8.c
deleted file mode 100644 (file)
index 2a5c9ed..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 360,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 8,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_360_512.c b/board/sunxi/dram_sun4i_360_512.c
deleted file mode 100644 (file)
index 48aa6e2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 360,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_384_1024_iow8.c b/board/sunxi/dram_sun4i_384_1024_iow8.c
deleted file mode 100644 (file)
index b0fcc55..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 384,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 8,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_408_1024_iow8.c b/board/sunxi/dram_sun4i_408_1024_iow8.c
deleted file mode 100644 (file)
index c6d87d2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include <common.h>
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 408,
-       .type = 3,
-       .rank_num = 1,
-       .density = 2048,
-       .io_width = 8,
-       .bus_width = 32,
-       .cas = 6,
-       .zq = 123,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x30926692,
-       .tpr1 = 0x1090,
-       .tpr2 = 0x1a0c8,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0,
-       .emr2 = 0,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun4i_auto.c b/board/sunxi/dram_sun4i_auto.c
new file mode 100644 (file)
index 0000000..09e0c9a
--- /dev/null
@@ -0,0 +1,35 @@
+#include <common.h>
+#include <asm/arch/dram.h>
+
+static struct dram_para dram_para = {
+       .clock = CONFIG_DRAM_CLK,
+       .type = 3,
+       .rank_num = 1,
+       .density = 0,
+       .io_width = 0,
+       .bus_width = 0,
+       .zq = CONFIG_DRAM_ZQ,
+       .odt_en = CONFIG_DRAM_ODT_EN,
+       .size = 0,
+#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
+       .cas = 6,
+       .tpr0 = 0x30926692,
+       .tpr1 = 0x1090,
+       .tpr2 = 0x1a0c8,
+       .emr2 = 0,
+#else
+#      include "dram_timings_sun4i.h"
+       .active_windowing = 1,
+#endif
+       .tpr3 = CONFIG_DRAM_TPR3,
+       .tpr4 = 0,
+       .tpr5 = 0,
+       .emr1 = CONFIG_DRAM_EMR1,
+       .emr3 = 0,
+       .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
+};
+
+unsigned long sunxi_dram_init(void)
+{
+       return dramc_init(&dram_para);
+}
diff --git a/board/sunxi/dram_sun5i_auto.c b/board/sunxi/dram_sun5i_auto.c
new file mode 100644 (file)
index 0000000..e52d54c
--- /dev/null
@@ -0,0 +1,38 @@
+/* DRAM parameters for auto dram configuration on sun5i and sun7i */
+
+#include <common.h>
+#include <asm/arch/dram.h>
+
+static struct dram_para dram_para = {
+       .clock = CONFIG_DRAM_CLK,
+       .mbus_clock = CONFIG_DRAM_MBUS_CLK,
+       .type = 3,
+       .rank_num = 1,
+       .density = 0,
+       .io_width = 0,
+       .bus_width = 0,
+       .zq = CONFIG_DRAM_ZQ,
+       .odt_en = CONFIG_DRAM_ODT_EN,
+       .size = 0,
+#ifdef CONFIG_DRAM_TIMINGS_VENDOR_MAGIC
+       .cas = 9,
+       .tpr0 = 0x42d899b7,
+       .tpr1 = 0xa090,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x10,
+#else
+#      include "dram_timings_sun4i.h"
+       .active_windowing = 1,
+#endif
+       .tpr3 = 0,
+       .tpr4 = 0,
+       .tpr5 = 0,
+       .emr1 = CONFIG_DRAM_EMR1,
+       .emr3 = 0,
+       .dqs_gating_delay = CONFIG_DRAM_DQS_GATING_DELAY,
+};
+
+unsigned long sunxi_dram_init(void)
+{
+       return dramc_init(&dram_para);
+}
diff --git a/board/sunxi/dram_sun7i_384_1024_iow16.c b/board/sunxi/dram_sun7i_384_1024_iow16.c
deleted file mode 100644 (file)
index 04e4b1e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include "common.h"
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 384,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 32,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 1024,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_sun7i_384_512_busw16_iow16.c b/board/sunxi/dram_sun7i_384_512_busw16_iow16.c
deleted file mode 100644 (file)
index 2e36011..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* this file is generated, don't edit it yourself */
-
-#include "common.h"
-#include <asm/arch/dram.h>
-
-static struct dram_para dram_para = {
-       .clock = 384,
-       .type = 3,
-       .rank_num = 1,
-       .density = 4096,
-       .io_width = 16,
-       .bus_width = 16,
-       .cas = 9,
-       .zq = 0x7f,
-       .odt_en = 0,
-       .size = 512,
-       .tpr0 = 0x42d899b7,
-       .tpr1 = 0xa090,
-       .tpr2 = 0x22a00,
-       .tpr3 = 0,
-       .tpr4 = 0,
-       .tpr5 = 0,
-       .emr1 = 0x4,
-       .emr2 = 0x10,
-       .emr3 = 0,
-};
-
-unsigned long sunxi_dram_init(void)
-{
-       return dramc_init(&dram_para);
-}
diff --git a/board/sunxi/dram_timings_sun4i.h b/board/sunxi/dram_timings_sun4i.h
new file mode 100644 (file)
index 0000000..29b934d
--- /dev/null
@@ -0,0 +1,205 @@
+/* This file is automatically generated, do not edit */
+
+#if defined(CONFIG_DRAM_TIMINGS_DDR3_1066F_1333H)
+# if CONFIG_DRAM_CLK <= 360 /* DDR3-1066F @360MHz, timings: 6-5-5-14 */
+       .cas  = 6,
+       .tpr0 = 0x268e5590,
+       .tpr1 = 0xa090,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 384 /* DDR3-1066F @384MHz, timings: 6-6-6-15 */
+       .cas  = 6,
+       .tpr0 = 0x288f6690,
+       .tpr1 = 0xa0a0,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 396 /* DDR3-1066F @396MHz, timings: 6-6-6-15 */
+       .cas  = 6,
+       .tpr0 = 0x2a8f6690,
+       .tpr1 = 0xa0a0,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 408 /* DDR3-1066F @408MHz, timings: 7-6-6-16 */
+       .cas  = 7,
+       .tpr0 = 0x2ab06690,
+       .tpr1 = 0xa0a8,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 432 /* DDR3-1066F @432MHz, timings: 7-6-6-17 */
+       .cas  = 7,
+       .tpr0 = 0x2cb16690,
+       .tpr1 = 0xa0b0,
+       .tpr2 = 0x22e00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 456 /* DDR3-1066F @456MHz, timings: 7-6-6-18 */
+       .cas  = 7,
+       .tpr0 = 0x30b26690,
+       .tpr1 = 0xa0b8,
+       .tpr2 = 0x22e00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 468 /* DDR3-1066F @468MHz, timings: 7-7-7-18 */
+       .cas  = 7,
+       .tpr0 = 0x30b27790,
+       .tpr1 = 0xa0c0,
+       .tpr2 = 0x23200,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 480 /* DDR3-1066F @480MHz, timings: 7-7-7-18 */
+       .cas  = 7,
+       .tpr0 = 0x32b27790,
+       .tpr1 = 0xa0c0,
+       .tpr2 = 0x23200,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 504 /* DDR3-1066F @504MHz, timings: 7-7-7-19 */
+       .cas  = 7,
+       .tpr0 = 0x34d37790,
+       .tpr1 = 0xa0d0,
+       .tpr2 = 0x23600,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 528 /* DDR3-1066F @528MHz, timings: 7-7-7-20 */
+       .cas  = 7,
+       .tpr0 = 0x36d47790,
+       .tpr1 = 0xa0d8,
+       .tpr2 = 0x23600,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 540 /* DDR3-1333H @540MHz, timings: 9-8-8-20 */
+       .cas  = 9,
+       .tpr0 = 0x36b488b4,
+       .tpr1 = 0xa0c8,
+       .tpr2 = 0x2b600,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 552 /* DDR3-1333H @552MHz, timings: 9-8-8-20 */
+       .cas  = 9,
+       .tpr0 = 0x38b488b4,
+       .tpr1 = 0xa0c8,
+       .tpr2 = 0x2ba00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 576 /* DDR3-1333H @576MHz, timings: 9-8-8-21 */
+       .cas  = 9,
+       .tpr0 = 0x3ab588b4,
+       .tpr1 = 0xa0d0,
+       .tpr2 = 0x2ba00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 600 /* DDR3-1333H @600MHz, timings: 9-9-9-22 */
+       .cas  = 9,
+       .tpr0 = 0x3cb699b4,
+       .tpr1 = 0xa0d8,
+       .tpr2 = 0x2be00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 624 /* DDR3-1333H @624MHz, timings: 9-9-9-23 */
+       .cas  = 9,
+       .tpr0 = 0x3eb799b4,
+       .tpr1 = 0xa0e8,
+       .tpr2 = 0x2be00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 648 /* DDR3-1333H @648MHz, timings: 9-9-9-24 */
+       .cas  = 9,
+       .tpr0 = 0x42b899b4,
+       .tpr1 = 0xa0f0,
+       .tpr2 = 0x2c200,
+       .emr2 = 0x10,
+# else
+#   error CONFIG_DRAM_CLK is set too high
+# endif
+#elif defined(CONFIG_DRAM_TIMINGS_DDR3_800E_1066G_1333J)
+# if CONFIG_DRAM_CLK <= 360 /* DDR3-800E @360MHz, timings: 6-6-6-14 */
+       .cas  = 6,
+       .tpr0 = 0x268e6690,
+       .tpr1 = 0xa090,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 384 /* DDR3-800E @384MHz, timings: 6-6-6-15 */
+       .cas  = 6,
+       .tpr0 = 0x2a8f6690,
+       .tpr1 = 0xa0a0,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 396 /* DDR3-800E @396MHz, timings: 6-6-6-15 */
+       .cas  = 6,
+       .tpr0 = 0x2a8f6690,
+       .tpr1 = 0xa0a0,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x0,
+# elif CONFIG_DRAM_CLK <= 408 /* DDR3-1066G @408MHz, timings: 8-7-7-16 */
+       .cas  = 8,
+       .tpr0 = 0x2cb07790,
+       .tpr1 = 0xa0a8,
+       .tpr2 = 0x22a00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 432 /* DDR3-1066G @432MHz, timings: 8-7-7-17 */
+       .cas  = 8,
+       .tpr0 = 0x2eb17790,
+       .tpr1 = 0xa0b0,
+       .tpr2 = 0x22e00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 456 /* DDR3-1066G @456MHz, timings: 8-7-7-18 */
+       .cas  = 8,
+       .tpr0 = 0x30b27790,
+       .tpr1 = 0xa0b8,
+       .tpr2 = 0x22e00,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 468 /* DDR3-1066G @468MHz, timings: 8-8-8-18 */
+       .cas  = 8,
+       .tpr0 = 0x32b28890,
+       .tpr1 = 0xa0c0,
+       .tpr2 = 0x23200,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 480 /* DDR3-1066G @480MHz, timings: 8-8-8-18 */
+       .cas  = 8,
+       .tpr0 = 0x34b28890,
+       .tpr1 = 0xa0c0,
+       .tpr2 = 0x23200,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 504 /* DDR3-1066G @504MHz, timings: 8-8-8-19 */
+       .cas  = 8,
+       .tpr0 = 0x36d38890,
+       .tpr1 = 0xa0d0,
+       .tpr2 = 0x23600,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 528 /* DDR3-1066G @528MHz, timings: 8-8-8-20 */
+       .cas  = 8,
+       .tpr0 = 0x38d48890,
+       .tpr1 = 0xa0d8,
+       .tpr2 = 0x23600,
+       .emr2 = 0x8,
+# elif CONFIG_DRAM_CLK <= 540 /* DDR3-1333J @540MHz, timings: 10-9-9-20 */
+       .cas  = 10,
+       .tpr0 = 0x38b499b4,
+       .tpr1 = 0xa0c8,
+       .tpr2 = 0x2b600,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 552 /* DDR3-1333J @552MHz, timings: 10-9-9-20 */
+       .cas  = 10,
+       .tpr0 = 0x3ab499b4,
+       .tpr1 = 0xa0c8,
+       .tpr2 = 0x2ba00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 576 /* DDR3-1333J @576MHz, timings: 10-9-9-21 */
+       .cas  = 10,
+       .tpr0 = 0x3cb599b4,
+       .tpr1 = 0xa0d0,
+       .tpr2 = 0x2ba00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 600 /* DDR3-1333J @600MHz, timings: 10-9-9-22 */
+       .cas  = 10,
+       .tpr0 = 0x3eb699b4,
+       .tpr1 = 0xa0d8,
+       .tpr2 = 0x2be00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 624 /* DDR3-1333J @624MHz, timings: 10-10-10-23 */
+       .cas  = 10,
+       .tpr0 = 0x40b7aab4,
+       .tpr1 = 0xa0e8,
+       .tpr2 = 0x2be00,
+       .emr2 = 0x10,
+# elif CONFIG_DRAM_CLK <= 648 /* DDR3-1333J @648MHz, timings: 10-10-10-24 */
+       .cas  = 10,
+       .tpr0 = 0x44b8aab4,
+       .tpr1 = 0xa0f0,
+       .tpr2 = 0x2c200,
+       .emr2 = 0x10,
+# else
+#   error CONFIG_DRAM_CLK is set too high
+# endif
+#else
+# error CONFIG_DRAM_TIMINGS_* is not defined
+#endif
index 4e4615e12f654fed06c8200ce5061e1ba76e2493..884913262792900bb58fd258050e496921f93804 100644 (file)
@@ -24,20 +24,13 @@ int sunxi_gmac_initialize(bd_t *bis)
 #ifdef CONFIG_RGMII
        setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
                CCM_GMAC_CTRL_GPIT_RGMII);
+       setbits_le32(&ccm->gmac_clk_cfg,
+                    CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY));
 #else
        setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII |
                CCM_GMAC_CTRL_GPIT_MII);
 #endif
 
-       /*
-        * In order for the gmac nic to work reliable on the Bananapi, we
-        * need to set bits 10-12 GTXDC "GMAC Transmit Clock Delay Chain"
-        * of the GMAC clk register to 3.
-        */
-#if defined CONFIG_TARGET_BANANAPI || defined CONFIG_TARGET_BANANAPRO
-       setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
-#endif
-
 #ifndef CONFIG_MACH_SUN6I
        /* Configure pin mux settings for GMAC */
        for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
index a54d3dfde367cdb154a8d04ec9fb6f770287a833..f614f88cc611444be2b05e24c9d454525605a68b 100644 (file)
@@ -1,8 +1,5 @@
 if TARGET_ARCANGEL4
 
-config SYS_CPU
-       default "arc700"
-
 config SYS_VENDOR
        default "synopsys"
 
@@ -13,9 +10,6 @@ endif
 
 if TARGET_ARCANGEL4_BE
 
-config SYS_CPU
-       default "arc700"
-
 config SYS_VENDOR
        default "synopsys"
 
index 8448265888076bc9cb9b521a1dc5f0e8e6b44ca4..79e5400ea86b14f3d6af0c598be8b7c54f07ef58 100644 (file)
@@ -1,8 +1,5 @@
 if TARGET_AXS101
 
-config SYS_CPU
-       default "arc700"
-
 config SYS_BOARD
        default "axs101"
 
index a1c3c17fed2ed56d69b05574381d5be76eba238c..67036709f1f556b1378b419210dffd5909abc0f7 100644 (file)
@@ -21,6 +21,7 @@
 #include "board.h"
 #include <power/pmic.h>
 #include <power/tps65218.h>
+#include <power/tps62362.h>
 #include <miiphy.h>
 #include <cpsw.h>
 
@@ -81,12 +82,12 @@ static int read_eeprom(struct am43xx_board_id *header)
 
 const struct dpll_params dpll_mpu[NUM_CRYSTAL_FREQ][NUM_OPPS] = {
        {       /* 19.2 MHz */
-               {-1, -1, -1, -1, -1, -1, -1},   /* OPP 50 */
+               {125, 3, 2, -1, -1, -1, -1},    /* OPP 50 */
                {-1, -1, -1, -1, -1, -1, -1},   /* OPP RESERVED */
-               {-1, -1, -1, -1, -1, -1, -1},   /* OPP 100 */
-               {-1, -1, -1, -1, -1, -1, -1},   /* OPP 120 */
-               {-1, -1, -1, -1, -1, -1, -1},   /* OPP TB */
-               {-1, -1, -1, -1, -1, -1, -1}    /* OPP NT */
+               {125, 3, 1, -1, -1, -1, -1},    /* OPP 100 */
+               {150, 3, 1, -1, -1, -1, -1},    /* OPP 120 */
+               {125, 2, 1, -1, -1, -1, -1},    /* OPP TB */
+               {625, 11, 1, -1, -1, -1, -1}    /* OPP NT */
        },
        {       /* 24 MHz */
                {300, 23, 1, -1, -1, -1, -1},   /* OPP 50 */
@@ -115,24 +116,32 @@ const struct dpll_params dpll_mpu[NUM_CRYSTAL_FREQ][NUM_OPPS] = {
 };
 
 const struct dpll_params dpll_core[NUM_CRYSTAL_FREQ] = {
-               {-1, -1, -1, -1, -1, -1, -1},   /* 19.2 MHz */
+               {625, 11, -1, -1, 10, 8, 4},    /* 19.2 MHz */
                {1000, 23, -1, -1, 10, 8, 4},   /* 24 MHz */
                {1000, 24, -1, -1, 10, 8, 4},   /* 25 MHz */
                {1000, 25, -1, -1, 10, 8, 4}    /* 26 MHz */
 };
 
 const struct dpll_params dpll_per[NUM_CRYSTAL_FREQ] = {
-               {-1, -1, -1, -1, -1, -1, -1},   /* 19.2 MHz */
-               {960, 23, 5, -1, -1, -1, -1},   /* 24 MHz */
-               {960, 24, 5, -1, -1, -1, -1},   /* 25 MHz */
-               {960, 25, 5, -1, -1, -1, -1}    /* 26 MHz */
+               {400, 7, 5, -1, -1, -1, -1},    /* 19.2 MHz */
+               {400, 9, 5, -1, -1, -1, -1},    /* 24 MHz */
+               {384, 9, 5, -1, -1, -1, -1},    /* 25 MHz */
+               {480, 12, 5, -1, -1, -1, -1}    /* 26 MHz */
 };
 
-const struct dpll_params epos_evm_dpll_ddr = {
-               266, 24, 1, -1, 1, -1, -1};
+const struct dpll_params epos_evm_dpll_ddr[NUM_CRYSTAL_FREQ] = {
+               {665, 47, 1, -1, 4, -1, -1}, /*19.2*/
+               {133, 11, 1, -1, 4, -1, -1}, /* 24 MHz */
+               {266, 24, 1, -1, 4, -1, -1}, /* 25 MHz */
+               {133, 12, 1, -1, 4, -1, -1}  /* 26 MHz */
+};
 
 const struct dpll_params gp_evm_dpll_ddr = {
-               400, 23, 1, -1, 1, -1, -1};
+               50, 2, 1, -1, 2, -1, -1};
+
+static const struct dpll_params idk_dpll_ddr = {
+       400, 23, 1, -1, 2, -1, -1
+};
 
 const struct ctrl_ioregs ioregs_lpddr2 = {
        .cm0ioctl               = LPDDR2_ADDRCTRL_IOCTRL_VALUE,
@@ -157,7 +166,7 @@ const struct emif_regs emif_regs_lpddr2 = {
        .emif_rd_wr_lvl_rmp_win         = 0x0,
        .emif_rd_wr_lvl_rmp_ctl         = 0x0,
        .emif_rd_wr_lvl_ctl             = 0x0,
-       .emif_ddr_phy_ctlr_1            = 0x0E084006,
+       .emif_ddr_phy_ctlr_1            = 0x0E284006,
        .emif_rd_wr_exec_thresh         = 0x80000405,
        .emif_ddr_ext_phy_ctrl_1        = 0x04010040,
        .emif_ddr_ext_phy_ctrl_2        = 0x00500050,
@@ -170,29 +179,6 @@ const struct emif_regs emif_regs_lpddr2 = {
        .emif_cos_config                        = 0x000FFFFF
 };
 
-const u32 ext_phy_ctrl_const_base_lpddr2[] = {
-       0x00500050,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x40001000,
-       0x08102040
-};
-
 const struct ctrl_ioregs ioregs_ddr3 = {
        .cm0ioctl               = DDR3_ADDRCTRL_IOCTRL_VALUE,
        .cm1ioctl               = DDR3_ADDRCTRL_WD0_IOCTRL_VALUE,
@@ -201,7 +187,7 @@ const struct ctrl_ioregs ioregs_ddr3 = {
        .dt1ioctl               = DDR3_DATA0_IOCTRL_VALUE,
        .dt2ioctrl              = DDR3_DATA0_IOCTRL_VALUE,
        .dt3ioctrl              = DDR3_DATA0_IOCTRL_VALUE,
-       .emif_sdram_config_ext  = 0x0143,
+       .emif_sdram_config_ext  = 0xc163,
 };
 
 const struct emif_regs ddr3_emif_regs_400Mhz = {
@@ -301,150 +287,32 @@ static const struct emif_regs ddr3_sk_emif_regs_400Mhz = {
        .emif_cos_config                = 0x000FFFFF
 };
 
-const u32 ext_phy_ctrl_const_base_ddr3[] = {
-       0x00400040,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00340034,
-       0x00340034,
-       0x00340034,
-       0x00340034,
-       0x00340034,
-       0x0,
-       0x0,
-       0x40000000,
-       0x08102040
-};
-
-const u32 ext_phy_ctrl_const_base_ddr3_beta[] = {
-       0x00000000,
-       0x00000045,
-       0x00000046,
-       0x00000048,
-       0x00000047,
-       0x00000000,
-       0x0000004C,
-       0x00000070,
-       0x00000085,
-       0x000000A3,
-       0x00000000,
-       0x0000000C,
-       0x00000030,
-       0x00000045,
-       0x00000063,
-       0x00000000,
-       0x0,
-       0x0,
-       0x40000000,
-       0x08102040
-};
-
-const u32 ext_phy_ctrl_const_base_ddr3_production[] = {
-       0x00000000,
-       0x00000044,
-       0x00000044,
-       0x00000046,
-       0x00000046,
-       0x00000000,
-       0x00000059,
-       0x00000077,
-       0x00000093,
-       0x000000A8,
-       0x00000000,
-       0x00000019,
-       0x00000037,
-       0x00000053,
-       0x00000068,
-       0x00000000,
-       0x0,
-       0x0,
-       0x40000000,
-       0x08102040
-};
-
-static const u32 ext_phy_ctrl_const_base_ddr3_sk[] = {
-       /* first 5 are taken care by emif_regs */
-       0x00700070,
-
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-       0x00350035,
-
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-
-       0x00150015,
-       0x00150015,
-       0x00150015,
-       0x00150015,
-       0x00150015,
-
-       0x00800080,
-       0x00800080,
-
-       0x40000000,
-
-       0x08102040,
-
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
-       0x00000000,
+static const struct emif_regs ddr3_idk_emif_regs_400Mhz = {
+       .sdram_config                   = 0x61a11b32,
+       .sdram_config2                  = 0x00000000,
+       .ref_ctrl                       = 0x00000c30,
+       .sdram_tim1                     = 0xeaaad4db,
+       .sdram_tim2                     = 0x266b7fda,
+       .sdram_tim3                     = 0x107f8678,
+       .read_idle_ctrl                 = 0x00050000,
+       .zq_config                      = 0x50074be4,
+       .temp_alert_config              = 0x00000000,
+       .emif_ddr_phy_ctlr_1            = 0x00008009,
+       .emif_ddr_ext_phy_ctrl_1        = 0x08020080,
+       .emif_ddr_ext_phy_ctrl_2        = 0x00000040,
+       .emif_ddr_ext_phy_ctrl_3        = 0x0000003e,
+       .emif_ddr_ext_phy_ctrl_4        = 0x00000051,
+       .emif_ddr_ext_phy_ctrl_5        = 0x00000051,
+       .emif_rd_wr_lvl_rmp_win         = 0x00000000,
+       .emif_rd_wr_lvl_rmp_ctl         = 0x00000000,
+       .emif_rd_wr_lvl_ctl             = 0x00000000,
+       .emif_rd_wr_exec_thresh         = 0x00000405,
+       .emif_prio_class_serv_map       = 0x00000000,
+       .emif_connect_id_serv_1_map     = 0x00000000,
+       .emif_connect_id_serv_2_map     = 0x00000000,
+       .emif_cos_config                = 0x00ffffff
 };
 
-void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size)
-{
-       if (board_is_eposevm()) {
-               *regs = ext_phy_ctrl_const_base_lpddr2;
-               *size = ARRAY_SIZE(ext_phy_ctrl_const_base_lpddr2);
-       } else if (board_is_evm_14_or_later()) {
-               *regs = ext_phy_ctrl_const_base_ddr3_production;
-               *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3_production);
-       } else if (board_is_evm_12_or_later()) {
-               *regs = ext_phy_ctrl_const_base_ddr3_beta;
-               *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3_beta);
-       } else if (board_is_gpevm()) {
-               *regs = ext_phy_ctrl_const_base_ddr3;
-               *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3);
-       } else if (board_is_sk()) {
-               *regs = ext_phy_ctrl_const_base_ddr3_sk;
-               *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3_sk);
-       }
-
-       return;
-}
-
-const struct dpll_params *get_dpll_ddr_params(void)
-{
-       if (board_is_eposevm())
-               return &epos_evm_dpll_ddr;
-       else if (board_is_gpevm() || board_is_sk())
-               return &gp_evm_dpll_ddr;
-
-       printf(" Board '%s' not supported\n", am43xx_board_name);
-       return NULL;
-}
-
 /*
  * get_sys_clk_index : returns the index of the sys_clk read from
  *                     ctrl status register. This value is either
@@ -464,6 +332,22 @@ static u32 get_sys_clk_index(void)
                        CTRL_SYSBOOT_15_14_SHIFT);
 }
 
+const struct dpll_params *get_dpll_ddr_params(void)
+{
+       int ind = get_sys_clk_index();
+
+       if (board_is_eposevm())
+               return &epos_evm_dpll_ddr[ind];
+       else if (board_is_gpevm() || board_is_sk())
+               return &gp_evm_dpll_ddr;
+       else if (board_is_idk())
+               return &idk_dpll_ddr;
+
+       printf(" Board '%s' not supported\n", am43xx_board_name);
+       return NULL;
+}
+
+
 /*
  * get_opp_offset:
  * Returns the index for safest OPP of the device to boot.
@@ -513,28 +397,30 @@ const struct dpll_params *get_dpll_per_params(void)
        return &dpll_per[ind];
 }
 
-void scale_vcores(void)
+void scale_vcores_generic(u32 m)
 {
-       const struct dpll_params *mpu_params;
        int mpu_vdd;
-       struct am43xx_board_id header;
-
-       enable_i2c0_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-       if (read_eeprom(&header) < 0)
-               puts("Could not get board ID.\n");
-
-       /* Get the frequency */
-       mpu_params = get_dpll_mpu_params();
 
        if (i2c_probe(TPS65218_CHIP_PM))
                return;
 
-       if (mpu_params->m == 1000) {
+       switch (m) {
+       case 1000:
                mpu_vdd = TPS65218_DCDC_VOLT_SEL_1330MV;
-       } else if (mpu_params->m == 600) {
+               break;
+       case 800:
+               mpu_vdd = TPS65218_DCDC_VOLT_SEL_1260MV;
+               break;
+       case 720:
+               mpu_vdd = TPS65218_DCDC_VOLT_SEL_1200MV;
+               break;
+       case 600:
                mpu_vdd = TPS65218_DCDC_VOLT_SEL_1100MV;
-       } else {
+               break;
+       case 300:
+               mpu_vdd = TPS65218_DCDC_VOLT_SEL_0950MV;
+               break;
+       default:
                puts("Unknown MPU clock, not scaling\n");
                return;
        }
@@ -542,17 +428,71 @@ void scale_vcores(void)
        /* Set DCDC1 (CORE) voltage to 1.1V */
        if (tps65218_voltage_update(TPS65218_DCDC1,
                                    TPS65218_DCDC_VOLT_SEL_1100MV)) {
-               puts("tps65218_voltage_update failure\n");
+               printf("%s failure\n", __func__);
                return;
        }
 
        /* Set DCDC2 (MPU) voltage */
        if (tps65218_voltage_update(TPS65218_DCDC2, mpu_vdd)) {
-               puts("tps65218_voltage_update failure\n");
+               printf("%s failure\n", __func__);
                return;
        }
 }
 
+void scale_vcores_idk(u32 m)
+{
+       int mpu_vdd;
+
+       if (i2c_probe(TPS62362_I2C_ADDR))
+               return;
+
+       switch (m) {
+       case 1000:
+               mpu_vdd = TPS62362_DCDC_VOLT_SEL_1330MV;
+               break;
+       case 800:
+               mpu_vdd = TPS62362_DCDC_VOLT_SEL_1260MV;
+               break;
+       case 720:
+               mpu_vdd = TPS62362_DCDC_VOLT_SEL_1200MV;
+               break;
+       case 600:
+               mpu_vdd = TPS62362_DCDC_VOLT_SEL_1100MV;
+               break;
+       case 300:
+               mpu_vdd = TPS62362_DCDC_VOLT_SEL_1330MV;
+               break;
+       default:
+               puts("Unknown MPU clock, not scaling\n");
+               return;
+       }
+
+       /* Set VDD_MPU voltage */
+       if (tps62362_voltage_update(TPS62362_SET3, mpu_vdd)) {
+               printf("%s failure\n", __func__);
+               return;
+       }
+}
+
+void scale_vcores(void)
+{
+       const struct dpll_params *mpu_params;
+       struct am43xx_board_id header;
+
+       enable_i2c0_pin_mux();
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       if (read_eeprom(&header) < 0)
+               puts("Could not get board ID.\n");
+
+       /* Get the frequency */
+       mpu_params = get_dpll_mpu_params();
+
+       if (board_is_idk())
+               scale_vcores_idk(mpu_params->m);
+       else
+               scale_vcores_generic(mpu_params->m);
+}
+
 void set_uart_mux_conf(void)
 {
        enable_uart0_pin_mux();
@@ -602,6 +542,9 @@ void sdram_init(void)
        } else if (board_is_sk()) {
                config_ddr(400, &ioregs_ddr3, NULL, NULL,
                           &ddr3_sk_emif_regs_400Mhz, 0);
+       } else if (board_is_idk()) {
+               config_ddr(400, &ioregs_ddr3, NULL, NULL,
+                          &ddr3_idk_emif_regs_400Mhz, 0);
        }
 }
 #endif
@@ -611,10 +554,17 @@ int power_init_board(void)
 {
        struct pmic *p;
 
-       power_tps65218_init(I2C_PMIC);
-       p = pmic_get("TPS65218_PMIC");
-       if (p && !pmic_probe(p))
-               puts("PMIC:  TPS65218\n");
+       if (board_is_idk()) {
+               power_tps62362_init(I2C_PMIC);
+               p = pmic_get("TPS62362");
+               if (p && !pmic_probe(p))
+                       puts("PMIC:  TPS62362\n");
+       } else {
+               power_tps65218_init(I2C_PMIC);
+               p = pmic_get("TPS65218_PMIC");
+               if (p && !pmic_probe(p))
+                       puts("PMIC:  TPS65218\n");
+       }
 
        return 0;
 }
@@ -771,6 +721,10 @@ int board_eth_init(bd_t *bis)
                cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
                cpsw_slaves[0].phy_addr = 4;
                cpsw_slaves[1].phy_addr = 5;
+       } else if (board_is_idk()) {
+               writel(RGMII_MODE_ENABLE, &cdev->miisel);
+               cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
+               cpsw_slaves[0].phy_addr = 0;
        } else {
                writel(RGMII_MODE_ENABLE, &cdev->miisel);
                cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
index 8e121914e38fdfe145c1681bdff01207b2b14ce8..eb9493e191c66e53e31b71a662fc5249e87ac3d6 100644 (file)
@@ -53,6 +53,11 @@ static inline int board_is_sk(void)
        return !strncmp(am43xx_board_name, "AM43__SK", HDR_NAME_LEN);
 }
 
+static inline int board_is_idk(void)
+{
+       return !strncmp(am43xx_board_name, "AM43_IDK", HDR_NAME_LEN);
+}
+
 static inline int board_is_evm_14_or_later(void)
 {
        return (board_is_gpevm() && strncmp("1.4", am43xx_board_rev, 3) <= 0);
index a670b0b2ff441e2b64951e8d0edc5ece1612ed83..510477dad9e29f8e3419ccf5f89c199d4d9e4000 100644 (file)
@@ -131,7 +131,7 @@ void enable_board_pin_mux(void)
 #if defined(CONFIG_NAND)
                configure_module_pin_mux(nand_pin_mux);
 #endif
-       } else if (board_is_sk()) {
+       } else if (board_is_sk() || board_is_idk()) {
                configure_module_pin_mux(rgmii1_pin_mux);
 #if defined(CONFIG_NAND)
                printf("Error: NAND flash not present on this board\n");
index b97804413101f54c64a8009607eaa00b8b629231..4d073134328195101e2455065b76ab32717b8c39 100644 (file)
@@ -17,6 +17,8 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
+#include <dm.h>
+#include <ns16550.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mmc_host_def.h>
@@ -43,6 +45,17 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = {
        0
 };
 
+static const struct ns16550_platdata devkit8000_serial = {
+       OMAP34XX_UART3,
+       2,
+       V_NS16550_CLK
+};
+
+U_BOOT_DEVICE(devkit8000_uart) = {
+       "serial_omap",
+       &devkit8000_serial
+};
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
index 5d2c024e890b9ffab6401517ce75bd33a759b70a..624421496a408fe72128bdf31083ab249559da8f 100644 (file)
@@ -42,7 +42,7 @@ int tegra_pcie_board_init(void)
        u8 addr, data[1];
        int err;
 
-       err = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
+       err = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, 1, &dev);
        if (err) {
                debug("%s: Cannot find PMIC I2C chip\n", __func__);
                return err;
@@ -51,7 +51,7 @@ int tegra_pcie_board_init(void)
        data[0] = 0x27;
        addr = 0x25;
 
-       err = i2c_write(dev, addr, data, 1);
+       err = dm_i2c_write(dev, addr, data, 1);
        if (err) {
                debug("failed to set VDD supply\n");
                return err;
@@ -61,7 +61,7 @@ int tegra_pcie_board_init(void)
        data[0] = 0x0D;
        addr = 0x24;
 
-       err = i2c_write(dev, addr, data, 1);
+       err = dm_i2c_write(dev, addr, data, 1);
        if (err) {
                debug("failed to enable VDD supply\n");
                return err;
@@ -71,7 +71,7 @@ int tegra_pcie_board_init(void)
        data[0] = 0x0D;
        addr = 0x35;
 
-       err = i2c_write(dev, addr, data, 1);
+       err = dm_i2c_write(dev, addr, data, 1);
        if (err) {
                debug("failed to set AVDD supply\n");
                return err;
diff --git a/board/total5200/Kconfig b/board/total5200/Kconfig
deleted file mode 100644 (file)
index ffa9516..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-if TARGET_TOTAL5200
-
-config SYS_BOARD
-       default "total5200"
-
-config SYS_CONFIG_NAME
-       default "Total5200"
-
-endif
diff --git a/board/total5200/MAINTAINERS b/board/total5200/MAINTAINERS
deleted file mode 100644 (file)
index afb0058..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-TOTAL5200 BOARD
-#M:    -
-S:     Maintained
-F:     board/total5200/
-F:     include/configs/Total5200.h
-F:     configs/Total5200_defconfig
-F:     configs/Total5200_lowboot_defconfig
-F:     configs/Total5200_Rev2_defconfig
-F:     configs/Total5200_Rev2_lowboot_defconfig
diff --git a/board/total5200/Makefile b/board/total5200/Makefile
deleted file mode 100644 (file)
index 527557c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-obj-y  := total5200.o sdram.o
diff --git a/board/total5200/mt48lc16m16a2-75.h b/board/total5200/mt48lc16m16a2-75.h
deleted file mode 100644 (file)
index 068a9a6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#define SDRAM_DDR      0               /* is SDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x00CD0000
-#define SDRAM_CONTROL  0x504F0000
-#define SDRAM_CONFIG1  0xD2322800
-#define SDRAM_CONFIG2  0x8AD70000
diff --git a/board/total5200/mt48lc32m16a2-75.h b/board/total5200/mt48lc32m16a2-75.h
deleted file mode 100644 (file)
index 0377417..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * Micron MT48LC32M16A2-75 is compatible to:
- *  - Infineon HYB39S512160AT-75
- */
-
-#define SDRAM_DDR      0               /* is SDR */
-
-/* Settings for XLB = 132 MHz */
-#define SDRAM_MODE     0x00CD0000
-#define SDRAM_CONTROL  0x514F0000
-#define SDRAM_CONFIG1  0xD2322800
-#define SDRAM_CONFIG2  0x8AD70000
diff --git a/board/total5200/sdram.c b/board/total5200/sdram.c
deleted file mode 100644 (file)
index dbe3587..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-
-#include "sdram.h"
-
-#ifndef CONFIG_SYS_RAMBOOT
-static void mpc5xxx_sdram_start (sdram_conf_t *sdram_conf, int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = sdram_conf->control | 0x80000000 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = sdram_conf->control | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       if (sdram_conf->ddr) {
-               /* set mode register: extended mode */
-               *(vu_long *)MPC5XXX_SDRAM_MODE = sdram_conf->emode;
-               __asm__ volatile ("sync");
-
-               /* set mode register: reset DLL */
-               *(vu_long *)MPC5XXX_SDRAM_MODE = sdram_conf->mode | 0x04000000;
-               __asm__ volatile ("sync");
-       }
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = sdram_conf->control | 0x80000002 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* auto refresh */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = sdram_conf->control | 0x80000004 | hi_addr_bit;
-       __asm__ volatile ("sync");
-
-       /* set mode register */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = sdram_conf->mode;
-       __asm__ volatile ("sync");
-
-       /* normal operation */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = sdram_conf->control | hi_addr_bit;
-       __asm__ volatile ("sync");
-}
-#endif
-
-/*
- * ATTENTION: Although partially referenced initdram does NOT make real use
- *            use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
- *            is something else than 0x00000000.
- */
-
-long int mpc5xxx_sdram_init (sdram_conf_t *sdram_conf)
-{
-       ulong dramsize = 0;
-       ulong dramsize2 = 0;
-#ifndef CONFIG_SYS_RAMBOOT
-       ulong test1, test2;
-
-       /* setup SDRAM chip selects */
-       *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
-       __asm__ volatile ("sync");
-
-       /* setup config registers */
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = sdram_conf->config1;
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = sdram_conf->config2;
-       __asm__ volatile ("sync");
-
-       if (sdram_conf->ddr) {
-               /* set tap delay */
-               *(vu_long *)MPC5XXX_CDM_PORCFG = sdram_conf->tapdelay;
-               __asm__ volatile ("sync");
-       }
-
-       /* find RAM size using SDRAM CS0 only */
-       mpc5xxx_sdram_start(sdram_conf, 0);
-       test1 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       mpc5xxx_sdram_start(sdram_conf, 1);
-       test2 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
-       if (test1 > test2) {
-               mpc5xxx_sdram_start(sdram_conf, 0);
-               dramsize = test1;
-       } else {
-               dramsize = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20)) {
-               dramsize = 0;
-       }
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1;
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
-       }
-
-       /* let SDRAM CS1 start right after CS0 */
-       *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;/* 2G */
-
-       /* find RAM size using SDRAM CS1 only */
-       mpc5xxx_sdram_start(sdram_conf, 0);
-       test1 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       mpc5xxx_sdram_start(sdram_conf, 1);
-       test2 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
-       if (test1 > test2) {
-               mpc5xxx_sdram_start(sdram_conf, 0);
-               dramsize2 = test1;
-       } else {
-               dramsize2 = test2;
-       }
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize2 < (1 << 20)) {
-               dramsize2 = 0;
-       }
-
-       /* set SDRAM CS1 size according to the amount of RAM found */
-       if (dramsize2 > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
-                       | (0x13 + __builtin_ffs(dramsize2 >> 20) - 1);
-       } else {
-               *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
-       }
-
-#else /* CONFIG_SYS_RAMBOOT */
-
-       /* retrieve size of memory connected to SDRAM CS0 */
-       dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
-       if (dramsize >= 0x13) {
-               dramsize = (1 << (dramsize - 0x13)) << 20;
-       } else {
-               dramsize = 0;
-       }
-
-       /* retrieve size of memory connected to SDRAM CS1 */
-       dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF;
-       if (dramsize2 >= 0x13) {
-               dramsize2 = (1 << (dramsize2 - 0x13)) << 20;
-       } else {
-               dramsize2 = 0;
-       }
-
-#endif /* CONFIG_SYS_RAMBOOT */
-
-       return dramsize + dramsize2;
-}
diff --git a/board/total5200/sdram.h b/board/total5200/sdram.h
deleted file mode 100644 (file)
index 3758f5c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-typedef struct {
-       ulong ddr;
-       ulong mode;
-       ulong emode;
-       ulong control;
-       ulong config1;
-       ulong config2;
-       ulong tapdelay;
-} sdram_conf_t;
-
-long int mpc5xxx_sdram_init (sdram_conf_t *sdram_conf);
diff --git a/board/total5200/total5200.c b/board/total5200/total5200.c
deleted file mode 100644 (file)
index 345a186..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <netdev.h>
-
-#include "sdram.h"
-
-#if CONFIG_TOTAL5200_REV==2
-#include "mt48lc32m16a2-75.h"
-#else
-#include "mt48lc16m16a2-75.h"
-#endif
-
-phys_size_t initdram (int board_type)
-{
-       sdram_conf_t sdram_conf;
-
-       sdram_conf.ddr = SDRAM_DDR;
-       sdram_conf.mode = SDRAM_MODE;
-       sdram_conf.emode = 0;
-       sdram_conf.control = SDRAM_CONTROL;
-       sdram_conf.config1 = SDRAM_CONFIG1;
-       sdram_conf.config2 = SDRAM_CONFIG2;
-       sdram_conf.tapdelay = 0;
-       return mpc5xxx_sdram_init (&sdram_conf);
-}
-
-int checkboard (void)
-{
-#if CONFIG_TOTAL5200_REV==2
-       puts ("Board: Total5200 Rev.2 ");
-#else
-       puts ("Board: Total5200 ");
-#endif
-
-       /*
-        * Retrieve FPGA Revision.
-        */
-       printf ("(FPGA %08lX)\n", *(vu_long *) (CONFIG_SYS_FPGA_BASE + 0x400));
-
-       /*
-        * Take all peripherals in power-up mode.
-        */
-#if CONFIG_TOTAL5200_REV==2
-       *(vu_char *) (CONFIG_SYS_CPLD_BASE + 0x46) = 0x70;
-#else
-       *(vu_long *) (CONFIG_SYS_CPLD_BASE + 0x400) = 0x70;
-#endif
-
-       return 0;
-}
-
-#ifdef CONFIG_PCI
-static struct pci_controller hose;
-
-extern void pci_mpc5xxx_init(struct pci_controller *);
-
-void pci_init_board(void)
-{
-       pci_mpc5xxx_init(&hose);
-}
-#endif
-
-#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
-
-/* IRDA_1 aka PSC6_3 (pin C13) */
-#define GPIO_IRDA_1    0x20000000UL
-
-void init_ide_reset (void)
-{
-       debug ("init_ide_reset\n");
-
-       /* Configure IRDA_1 (PSC6_3) as GPIO output for ATA reset */
-       *(vu_long *) MPC5XXX_GPIO_ENABLE |= GPIO_IRDA_1;
-       *(vu_long *) MPC5XXX_GPIO_DIR    |= GPIO_IRDA_1;
-}
-
-void ide_set_reset (int idereset)
-{
-       debug ("ide_reset(%d)\n", idereset);
-
-       if (idereset) {
-               *(vu_long *) MPC5XXX_GPIO_DATA_O &= ~GPIO_IRDA_1;
-       } else {
-               *(vu_long *) MPC5XXX_GPIO_DATA_O |=  GPIO_IRDA_1;
-       }
-}
-#endif
-
-#ifdef CONFIG_VIDEO_SED13806
-#include <sed13806.h>
-
-#define DISPLAY_WIDTH   640
-#define DISPLAY_HEIGHT  480
-
-#ifdef CONFIG_VIDEO_SED13806_8BPP
-#error CONFIG_VIDEO_SED13806_8BPP not supported.
-#endif /* CONFIG_VIDEO_SED13806_8BPP */
-
-#ifdef CONFIG_VIDEO_SED13806_16BPP
-static const S1D_REGS init_regs [] =
-{
-    {0x0001,0x00},   /* Miscellaneous Register */
-    {0x01FC,0x00},   /* Display Mode Register */
-    {0x0004,0x00},   /* General IO Pins Configuration Register 0 */
-    {0x0005,0x00},   /* General IO Pins Configuration Register 1 */
-    {0x0008,0x00},   /* General IO Pins Control Register 0 */
-    {0x0009,0x00},   /* General IO Pins Control Register 1 */
-    {0x0010,0x02},   /* Memory Clock Configuration Register */
-    {0x0014,0x02},   /* LCD Pixel Clock Configuration Register */
-    {0x0018,0x02},   /* CRT/TV Pixel Clock Configuration Register */
-    {0x001C,0x02},   /* MediaPlug Clock Configuration Register */
-    {0x001E,0x01},   /* CPU To Memory Wait State Select Register */
-    {0x0021,0x03},   /* DRAM Refresh Rate Register */
-    {0x002A,0x00},   /* DRAM Timings Control Register 0 */
-    {0x002B,0x01},   /* DRAM Timings Control Register 1 */
-    {0x0020,0x80},   /* Memory Configuration Register */
-    {0x0030,0x25},   /* Panel Type Register */
-    {0x0031,0x00},   /* MOD Rate Register */
-    {0x0032,0x4F},   /* LCD Horizontal Display Width Register */
-    {0x0034,0x13},   /* LCD Horizontal Non-Display Period Register */
-    {0x0035,0x01},   /* TFT FPLINE Start Position Register */
-    {0x0036,0x0B},   /* TFT FPLINE Pulse Width Register */
-    {0x0038,0xDF},   /* LCD Vertical Display Height Register 0 */
-    {0x0039,0x01},   /* LCD Vertical Display Height Register 1 */
-    {0x003A,0x2C},   /* LCD Vertical Non-Display Period Register */
-    {0x003B,0x0A},   /* TFT FPFRAME Start Position Register */
-    {0x003C,0x01},   /* TFT FPFRAME Pulse Width Register */
-    {0x0040,0x05},   /* LCD Display Mode Register */
-    {0x0041,0x00},   /* LCD Miscellaneous Register */
-    {0x0042,0x00},   /* LCD Display Start Address Register 0 */
-    {0x0043,0x00},   /* LCD Display Start Address Register 1 */
-    {0x0044,0x00},   /* LCD Display Start Address Register 2 */
-    {0x0046,0x80},   /* LCD Memory Address Offset Register 0 */
-    {0x0047,0x02},   /* LCD Memory Address Offset Register 1 */
-    {0x0048,0x00},   /* LCD Pixel Panning Register */
-    {0x004A,0x00},   /* LCD Display FIFO High Threshold Control Register */
-    {0x004B,0x00},   /* LCD Display FIFO Low Threshold Control Register */
-    {0x0050,0x4F},   /* CRT/TV Horizontal Display Width Register */
-    {0x0052,0x13},   /* CRT/TV Horizontal Non-Display Period Register */
-    {0x0053,0x01},   /* CRT/TV HRTC Start Position Register */
-    {0x0054,0x0B},   /* CRT/TV HRTC Pulse Width Register */
-    {0x0056,0xDF},   /* CRT/TV Vertical Display Height Register 0 */
-    {0x0057,0x01},   /* CRT/TV Vertical Display Height Register 1 */
-    {0x0058,0x2B},   /* CRT/TV Vertical Non-Display Period Register */
-    {0x0059,0x09},   /* CRT/TV VRTC Start Position Register */
-    {0x005A,0x01},   /* CRT/TV VRTC Pulse Width Register */
-    {0x005B,0x10},   /* TV Output Control Register */
-    {0x0060,0x05},   /* CRT/TV Display Mode Register */
-    {0x0062,0x00},   /* CRT/TV Display Start Address Register 0 */
-    {0x0063,0x00},   /* CRT/TV Display Start Address Register 1 */
-    {0x0064,0x00},   /* CRT/TV Display Start Address Register 2 */
-    {0x0066,0x80},   /* CRT/TV Memory Address Offset Register 0 */
-    {0x0067,0x02},   /* CRT/TV Memory Address Offset Register 1 */
-    {0x0068,0x00},   /* CRT/TV Pixel Panning Register */
-    {0x006A,0x00},   /* CRT/TV Display FIFO High Threshold Control Register */
-    {0x006B,0x00},   /* CRT/TV Display FIFO Low Threshold Control Register */
-    {0x0070,0x00},   /* LCD Ink/Cursor Control Register */
-    {0x0071,0x01},   /* LCD Ink/Cursor Start Address Register */
-    {0x0072,0x00},   /* LCD Cursor X Position Register 0 */
-    {0x0073,0x00},   /* LCD Cursor X Position Register 1 */
-    {0x0074,0x00},   /* LCD Cursor Y Position Register 0 */
-    {0x0075,0x00},   /* LCD Cursor Y Position Register 1 */
-    {0x0076,0x00},   /* LCD Ink/Cursor Blue Color 0 Register */
-    {0x0077,0x00},   /* LCD Ink/Cursor Green Color 0 Register */
-    {0x0078,0x00},   /* LCD Ink/Cursor Red Color 0 Register */
-    {0x007A,0x1F},   /* LCD Ink/Cursor Blue Color 1 Register */
-    {0x007B,0x3F},   /* LCD Ink/Cursor Green Color 1 Register */
-    {0x007C,0x1F},   /* LCD Ink/Cursor Red Color 1 Register */
-    {0x007E,0x00},   /* LCD Ink/Cursor FIFO Threshold Register */
-    {0x0080,0x00},   /* CRT/TV Ink/Cursor Control Register */
-    {0x0081,0x01},   /* CRT/TV Ink/Cursor Start Address Register */
-    {0x0082,0x00},   /* CRT/TV Cursor X Position Register 0 */
-    {0x0083,0x00},   /* CRT/TV Cursor X Position Register 1 */
-    {0x0084,0x00},   /* CRT/TV Cursor Y Position Register 0 */
-    {0x0085,0x00},   /* CRT/TV Cursor Y Position Register 1 */
-    {0x0086,0x00},   /* CRT/TV Ink/Cursor Blue Color 0 Register */
-    {0x0087,0x00},   /* CRT/TV Ink/Cursor Green Color 0 Register */
-    {0x0088,0x00},   /* CRT/TV Ink/Cursor Red Color 0 Register */
-    {0x008A,0x1F},   /* CRT/TV Ink/Cursor Blue Color 1 Register */
-    {0x008B,0x3F},   /* CRT/TV Ink/Cursor Green Color 1 Register */
-    {0x008C,0x1F},   /* CRT/TV Ink/Cursor Red Color 1 Register */
-    {0x008E,0x00},   /* CRT/TV Ink/Cursor FIFO Threshold Register */
-    {0x0100,0x00},   /* BitBlt Control Register 0 */
-    {0x0101,0x00},   /* BitBlt Control Register 1 */
-    {0x0102,0x00},   /* BitBlt ROP Code/Color Expansion Register */
-    {0x0103,0x00},   /* BitBlt Operation Register */
-    {0x0104,0x00},   /* BitBlt Source Start Address Register 0 */
-    {0x0105,0x00},   /* BitBlt Source Start Address Register 1 */
-    {0x0106,0x00},   /* BitBlt Source Start Address Register 2 */
-    {0x0108,0x00},   /* BitBlt Destination Start Address Register 0 */
-    {0x0109,0x00},   /* BitBlt Destination Start Address Register 1 */
-    {0x010A,0x00},   /* BitBlt Destination Start Address Register 2 */
-    {0x010C,0x00},   /* BitBlt Memory Address Offset Register 0 */
-    {0x010D,0x00},   /* BitBlt Memory Address Offset Register 1 */
-    {0x0110,0x00},   /* BitBlt Width Register 0 */
-    {0x0111,0x00},   /* BitBlt Width Register 1 */
-    {0x0112,0x00},   /* BitBlt Height Register 0 */
-    {0x0113,0x00},   /* BitBlt Height Register 1 */
-    {0x0114,0x00},   /* BitBlt Background Color Register 0 */
-    {0x0115,0x00},   /* BitBlt Background Color Register 1 */
-    {0x0118,0x00},   /* BitBlt Foreground Color Register 0 */
-    {0x0119,0x00},   /* BitBlt Foreground Color Register 1 */
-    {0x01E0,0x00},   /* Look-Up Table Mode Register */
-    {0x01E2,0x00},   /* Look-Up Table Address Register */
-    {0x01E4,0x00},   /* Look-Up Table Data Register */
-    {0x01F0,0x00},   /* Power Save Configuration Register */
-    {0x01F1,0x00},   /* Power Save Status Register */
-    {0x01F4,0x00},   /* CPU-to-Memory Access Watchdog Timer Register */
-    {0x01FC,0x01},   /* Display Mode Register */
-    {0, 0}
-};
-#endif /* CONFIG_VIDEO_SED13806_16BPP */
-
-#ifdef CONFIG_CONSOLE_EXTRA_INFO
-/* Return text to be printed besides the logo. */
-void video_get_info_str (int line_number, char *info)
-{
-       if (line_number == 1) {
-#if CONFIG_TOTAL5200_REV==1
-               strcpy (info, " Total5200");
-#elif CONFIG_TOTAL5200_REV==2
-               strcpy (info, " Total5200 Rev.2");
-#else
-#error CONFIG_TOTAL5200_REV must be 1 or 2.
-#endif
-       } else {
-               info [0] = '\0';
-       }
-}
-#endif
-
-/* Returns  SED13806 base address. First thing called in the driver. */
-unsigned int board_video_init (void)
-{
-       return CONFIG_SYS_LCD_BASE;
-}
-
-/* Called after initializing the SED13806 and before clearing the screen. */
-void board_validate_screen (unsigned int base)
-{
-}
-
-/* Return a pointer to the initialization sequence. */
-const S1D_REGS *board_get_regs (void)
-{
-       return init_regs;
-}
-
-int board_get_width (void)
-{
-       return DISPLAY_WIDTH;
-}
-
-int board_get_height (void)
-{
-       return DISPLAY_HEIGHT;
-}
-
-#endif /* CONFIG_VIDEO_SED13806 */
-
-int board_eth_init(bd_t *bis)
-{
-       cpu_eth_init(bis); /* Built in FEC comes first */
-       return pci_eth_init(bis);
-}
index 2744514435fccba72fc204d300db8276211abaff..3da61a4c3d333b4b750effdd9fe63e584cc35937 100644 (file)
@@ -137,9 +137,6 @@ void board_init_f(ulong dummy)
        /* Clear the BSS. */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
-       /* Set global data pointer. */
-       gd = &gdata;
-
        preloader_console_init();
        timer_init();
 
index 258632e52b0b602cad9c7368f66e01d87aa04ccb..738c31c6ee1f568cc95a6dd47ce34579f2853b64 100644 (file)
@@ -24,6 +24,7 @@ static xilinx_desc fpga010 = XILINX_XC7Z010_DESC(0x10);
 static xilinx_desc fpga015 = XILINX_XC7Z015_DESC(0x15);
 static xilinx_desc fpga020 = XILINX_XC7Z020_DESC(0x20);
 static xilinx_desc fpga030 = XILINX_XC7Z030_DESC(0x30);
+static xilinx_desc fpga035 = XILINX_XC7Z035_DESC(0x35);
 static xilinx_desc fpga045 = XILINX_XC7Z045_DESC(0x45);
 static xilinx_desc fpga100 = XILINX_XC7Z100_DESC(0x100);
 #endif
@@ -49,6 +50,9 @@ int board_init(void)
        case XILINX_ZYNQ_7030:
                fpga = fpga030;
                break;
+       case XILINX_ZYNQ_7035:
+               fpga = fpga035;
+               break;
        case XILINX_ZYNQ_7045:
                fpga = fpga045;
                break;
@@ -87,6 +91,14 @@ int board_late_init(void)
        return 0;
 }
 
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+       puts("Board:\tXilinx Zynq\n");
+       return 0;
+}
+#endif
+
 int board_eth_init(bd_t *bis)
 {
        u32 ret = 0;
@@ -111,11 +123,13 @@ int board_eth_init(bd_t *bis)
 #if defined(CONFIG_ZYNQ_GEM)
 # if defined(CONFIG_ZYNQ_GEM0)
        ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0,
-                                               CONFIG_ZYNQ_GEM_PHY_ADDR0, 0);
+                                  CONFIG_ZYNQ_GEM_PHY_ADDR0,
+                                  CONFIG_ZYNQ_GEM_EMIO0);
 # endif
 # if defined(CONFIG_ZYNQ_GEM1)
        ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1,
-                                               CONFIG_ZYNQ_GEM_PHY_ADDR1, 0);
+                                  CONFIG_ZYNQ_GEM_PHY_ADDR1,
+                                  CONFIG_ZYNQ_GEM_EMIO1);
 # endif
 #endif
        return ret;
index 94554f2939e5361179842fef3777d7ee6c06165d..9579ab4c982287f6913beeff41b92b3a85731cae 100644 (file)
@@ -27,6 +27,8 @@ endif
 # boards
 obj-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
 obj-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
+obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
+obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o
 
 # core command
 obj-y += cmd_boot.o
index 3a4b32c29dc1dbccb6f181297ce0686b4dcf990b..79531377a78b6d4b304c3f9bff7590b2ae0fa20f 100644 (file)
@@ -807,6 +807,12 @@ static int initf_dm(void)
        return 0;
 }
 
+/* Architecture-specific memory reservation */
+__weak int reserve_arch(void)
+{
+       return 0;
+}
+
 static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
        setup_ram_buf,
@@ -888,7 +894,7 @@ static init_fnc_t init_sequence_f[] = {
        prt_mpc5xxx_clks,
 #endif /* CONFIG_MPC5xxx */
 #if defined(CONFIG_DISPLAY_BOARDINFO)
-       checkboard,             /* display board info */
+       show_board_info,
 #endif
        INIT_FUNC_WATCHDOG_INIT
 #if defined(CONFIG_MISC_INIT_F)
@@ -970,6 +976,7 @@ static init_fnc_t init_sequence_f[] = {
        setup_machine,
        reserve_global_data,
        reserve_fdt,
+       reserve_arch,
        reserve_stacks,
        setup_dram_config,
        show_dram_config,
diff --git a/common/board_info.c b/common/board_info.c
new file mode 100644 (file)
index 0000000..42d0641
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <libfdt.h>
+#include <linux/compiler.h>
+
+int __weak checkboard(void)
+{
+       printf("Board: Unknown\n");
+       return 0;
+}
+
+/*
+ * If the root node of the DTB has a "model" property, show it.
+ * If CONFIG_OF_CONTROL is disabled or the "model" property is missing,
+ * fall back to checkboard().
+ */
+int show_board_info(void)
+{
+#ifdef CONFIG_OF_CONTROL
+       DECLARE_GLOBAL_DATA_PTR;
+       const char *model;
+
+       model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+
+       if (model) {
+               printf("Model: %s\n", model);
+               return 0;
+       }
+#endif
+
+       return checkboard();
+}
index a301cc226f1e69fb4f6229382391c80218f12460..68a9448b5549da7f0e9b1d0db843dbd7f3de0486 100644 (file)
@@ -476,22 +476,6 @@ static int initr_api(void)
 }
 #endif
 
-#ifdef CONFIG_DISPLAY_BOARDINFO_LATE
-static int show_model_r(void)
-{
-       /* Put this here so it appears on the LCD, now it is ready */
-# ifdef CONFIG_OF_CONTROL
-       const char *model;
-
-       model = (char *)fdt_getprop(gd->fdt_blob, 0, "model", NULL);
-       printf("Model: %s\n", model ? model : "<unknown>");
-# else
-       checkboard();
-# endif
-       return 0;
-}
-#endif
-
 /* enable exceptions */
 #ifdef CONFIG_ARM
 static int initr_enable_interrupts(void)
@@ -801,7 +785,7 @@ init_fnc_t init_sequence_r[] = {
 #endif
        console_init_r,         /* fully init console as a device */
 #ifdef CONFIG_DISPLAY_BOARDINFO_LATE
-       show_model_r,
+       show_board_info,
 #endif
 #ifdef CONFIG_ARCH_MISC_INIT
        arch_misc_init,         /* miscellaneous arch-dependent init */
index 67233600b157244409c2710afa606337d2ebaf80..48199bfff3ed75a232ba3905cb4fe8662b09e321 100644 (file)
@@ -185,6 +185,9 @@ static char bootm_help_text[] =
        "\tcmdline - OS specific command line processing/setup\n"
        "\tbdt     - OS specific bd_t processing\n"
        "\tprep    - OS specific prep before relocation or go\n"
+#if defined(CONFIG_TRACE)
+       "\tfake    - OS specific fake start without go\n"
+#endif
        "\tgo      - start OS";
 #endif
 
index 652c61c70779bdab10116e80bca99e554f20a786..bcb34d904569d98612317dcc4e0712db6edd6410 100644 (file)
@@ -39,6 +39,26 @@ static int do_demo_status(cmd_tbl_t *cmdtp, int flag, int argc,
        return 0;
 }
 
+static int do_demo_light(cmd_tbl_t *cmdtp, int flag, int argc,
+                        char * const argv[])
+{
+       int light;
+       int ret;
+
+       if (argc) {
+               light = simple_strtoul(argv[0], NULL, 16);
+               ret = demo_set_light(demo_dev, light);
+       } else {
+               ret = demo_get_light(demo_dev);
+               if (ret >= 0) {
+                       printf("Light: %x\n", ret);
+                       ret = 0;
+               }
+       }
+
+       return ret;
+}
+
 int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        struct udevice *dev;
@@ -61,6 +81,7 @@ int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 static cmd_tbl_t demo_commands[] = {
        U_BOOT_CMD_MKENT(list, 0, 1, do_demo_list, "", ""),
        U_BOOT_CMD_MKENT(hello, 2, 1, do_demo_hello, "", ""),
+       U_BOOT_CMD_MKENT(light, 2, 1, do_demo_light, "", ""),
        U_BOOT_CMD_MKENT(status, 1, 1, do_demo_status, "", ""),
 };
 
@@ -86,6 +107,10 @@ static int do_demo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        return cmd_process_error(cmdtp, ret);
                argc--;
                argv++;
+       } else {
+               demo_dev = NULL;
+               if (demo_cmd->cmd != do_demo_list)
+                       return CMD_RET_USAGE;
        }
 
        ret = demo_cmd->cmd(demo_cmd, flag, argc, argv);
@@ -98,5 +123,7 @@ U_BOOT_CMD(
        "Driver model (dm) demo operations",
        "list                     List available demo devices\n"
        "demo hello <num> [<char>]     Say hello\n"
-       "demo status <num>             Get demo device status"
+       "demo light [<num>]            Set or get the lights\n"
+       "demo status <num>             Get demo device status\n"
+       "demo list                     List available demo devices"
 );
index 8c5bf440fbb0903e9798242dcc131e630ba51e7f..7f99aabf8a5c69454a19fced5a71c596b043dddc 100644 (file)
@@ -211,6 +211,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 
                                comp = image_get_comp(hdr);
                                if (comp == IH_COMP_GZIP) {
+#if defined(CONFIG_GZIP)
                                        ulong image_buf = image_get_data(hdr);
                                        data = image_get_load(hdr);
                                        ulong image_size = ~0UL;
@@ -222,6 +223,10 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                                                return 1;
                                        }
                                        data_size = image_size;
+#else
+                                       puts("Gunzip image is not supported\n");
+                                       return 1;
+#endif
                                } else {
                                        data = (ulong)image_get_data(hdr);
                                        data_size = image_get_data_size(hdr);
@@ -341,7 +346,7 @@ U_BOOT_CMD(fpga, 6, 1, do_fpga,
           "loadable FPGA image support",
           "[operation type] [device number] [image address] [image size]\n"
           "fpga operations:\n"
-          "  dump\t[dev]\t\t\tLoad device to memory buffer\n"
+          "  dump\t[dev] [address] [size]\tLoad device to memory buffer\n"
           "  info\t[dev]\t\t\tlist known device information\n"
           "  load\t[dev] [address] [size]\tLoad device from memory buffer\n"
 #if defined(CONFIG_CMD_FPGA_LOADP)
index 0d9da113bf0c1305bc64e7e67368d6eba800b5e0..e146254f6d68367d8dc2650c409f24a1676362dd 100644 (file)
@@ -81,3 +81,18 @@ U_BOOT_CMD(
        "    - List files in directory 'directory' of partition 'part' on\n"
        "      device type 'interface' instance 'dev'."
 )
+
+static int do_fstype_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+                               char * const argv[])
+{
+       return do_fs_type(cmdtp, flag, argc, argv);
+}
+
+U_BOOT_CMD(
+       fstype, 4, 1, do_fstype_wrapper,
+       "Look up a filesystem type",
+       "<interface> <dev>:<part>\n"
+       "- print filesystem type\n"
+       "fstype <interface> <dev>:<part> <varname>\n"
+       "- set environment variable to filesystem type\n"
+);
index 320ff709fafba3a6abe2f5f1cb6b12a152788df1..c48baad9a106ab9ec0cdfc1e1544cbd437231ff8 100644 (file)
@@ -35,6 +35,6 @@ static int do_gettime(cmd_tbl_t *cmdtp, int flag, int argc,
 
 U_BOOT_CMD(
        gettime,        1,      1,      do_gettime,
-       "get timer val elapsed,\n",
-       "get time elapsed from uboot start\n"
+       "get timer val elapsed",
+       "get time elapsed from uboot start"
 );
index 22db1bb47c137fd4fe08fc20e3e2f75fba72f16f..7c3ad00fdf03f30ee358cf4501717d6e657e5d18 100644 (file)
@@ -83,12 +83,12 @@ DECLARE_GLOBAL_DATA_PTR;
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
-static uchar   i2c_dp_last_chip;
+static uint    i2c_dp_last_chip;
 static uint    i2c_dp_last_addr;
 static uint    i2c_dp_last_alen;
 static uint    i2c_dp_last_length = 0x10;
 
-static uchar   i2c_mm_last_chip;
+static uint    i2c_mm_last_chip;
 static uint    i2c_mm_last_addr;
 static uint    i2c_mm_last_alen;
 
@@ -133,7 +133,7 @@ static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
 #ifdef CONFIG_DM_I2C
 static struct udevice *i2c_cur_bus;
 
-static int i2c_set_bus_num(unsigned int busnum)
+static int cmd_i2c_set_bus_num(unsigned int busnum)
 {
        struct udevice *bus;
        int ret;
@@ -168,7 +168,7 @@ static int i2c_get_cur_bus_chip(uint chip_addr, struct udevice **devp)
        if (ret)
                return ret;
 
-       return i2c_get_chip(bus, chip_addr, devp);
+       return i2c_get_chip(bus, chip_addr, 1, devp);
 }
 
 #endif
@@ -282,7 +282,7 @@ static int i2c_report_err(int ret, enum i2c_err_op op)
  */
 static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       u_char  chip;
+       uint    chip;
        uint    devaddr, length;
        int alen;
        u_char  *memaddr;
@@ -323,7 +323,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
        if (!ret && alen != -1)
                ret = i2c_set_chip_offset_len(dev, alen);
        if (!ret)
-               ret = i2c_read(dev, devaddr, memaddr, length);
+               ret = dm_i2c_read(dev, devaddr, memaddr, length);
 #else
        ret = i2c_read(chip, devaddr, alen, memaddr, length);
 #endif
@@ -335,7 +335,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 
 static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       u_char  chip;
+       uint    chip;
        uint    devaddr, length;
        int alen;
        u_char  *memaddr;
@@ -381,7 +381,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
 
        while (length-- > 0) {
 #ifdef CONFIG_DM_I2C
-               ret = i2c_write(dev, devaddr++, memaddr++, 1);
+               ret = dm_i2c_write(dev, devaddr++, memaddr++, 1);
 #else
                ret = i2c_write(chip, devaddr++, alen, memaddr++, 1);
 #endif
@@ -444,7 +444,7 @@ static int do_i2c_flags(cmd_tbl_t *cmdtp, int flag, int argc,
  */
 static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       u_char  chip;
+       uint    chip;
        uint    addr, length;
        int alen;
        int     j, nbytes, linebytes;
@@ -513,7 +513,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
                linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
 
 #ifdef CONFIG_DM_I2C
-               ret = i2c_read(dev, addr, linebuf, linebytes);
+               ret = dm_i2c_read(dev, addr, linebuf, linebytes);
 #else
                ret = i2c_read(chip, addr, alen, linebuf, linebytes);
 #endif
@@ -563,7 +563,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
  */
 static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       uchar   chip;
+       uint    chip;
        ulong   addr;
        int     alen;
        uchar   byte;
@@ -611,7 +611,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 
        while (count-- > 0) {
 #ifdef CONFIG_DM_I2C
-               ret = i2c_write(dev, addr++, &byte, 1);
+               ret = dm_i2c_write(dev, addr++, &byte, 1);
 #else
                ret = i2c_write(chip, addr++, alen, &byte, 1);
 #endif
@@ -649,7 +649,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
  */
 static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       uchar   chip;
+       uint    chip;
        ulong   addr;
        int     alen;
        int     count;
@@ -698,7 +698,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
        err = 0;
        while (count-- > 0) {
 #ifdef CONFIG_DM_I2C
-               ret = i2c_read(dev, addr, &byte, 1);
+               ret = dm_i2c_read(dev, addr, &byte, 1);
 #else
                ret = i2c_read(chip, addr, alen, &byte, 1);
 #endif
@@ -734,7 +734,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 static int
 mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 {
-       uchar   chip;
+       uint    chip;
        ulong   addr;
        int     alen;
        ulong   data;
@@ -793,7 +793,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
        do {
                printf("%08lx:", addr);
 #ifdef CONFIG_DM_I2C
-               ret = i2c_read(dev, addr, (uchar *)&data, size);
+               ret = dm_i2c_read(dev, addr, (uchar *)&data, size);
 #else
                ret = i2c_read(chip, addr, alen, (uchar *)&data, size);
 #endif
@@ -841,8 +841,8 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
                                 */
                                bootretry_reset_cmd_timeout();
 #ifdef CONFIG_DM_I2C
-                               ret = i2c_write(dev, addr, (uchar *)&data,
-                                               size);
+                               ret = dm_i2c_write(dev, addr, (uchar *)&data,
+                                                  size);
 #else
                                ret = i2c_write(chip, addr, alen,
                                                (uchar *)&data, size);
@@ -917,7 +917,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                        continue;
 #endif
 #ifdef CONFIG_DM_I2C
-               ret = i2c_probe(bus, j, 0, &dev);
+               ret = dm_i2c_probe(bus, j, 0, &dev);
 #else
                ret = i2c_probe(j);
 #endif
@@ -957,7 +957,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
  */
 static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       u_char  chip;
+       uint    chip;
        int alen;
        uint    addr;
        uint    length;
@@ -1010,7 +1010,7 @@ static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
         */
        while (1) {
 #ifdef CONFIG_DM_I2C
-               ret = i2c_read(dev, addr, bytes, length);
+               ret = dm_i2c_read(dev, addr, bytes, length);
 #else
                ret = i2c_read(chip, addr, alen, bytes, length);
 #endif
@@ -1085,7 +1085,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        enum { unknown, EDO, SDRAM, DDR2 } type;
 
-       u_char  chip;
+       uint    chip;
        u_char  data[128];
        u_char  cksum;
        int     j;
@@ -1563,7 +1563,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 #if defined(CONFIG_I2C_EDID)
 int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
-       u_char chip;
+       uint chip;
        struct edid1_info edid;
        int ret;
 #ifdef CONFIG_DM_I2C
@@ -1579,7 +1579,7 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 #ifdef CONFIG_DM_I2C
        ret = i2c_get_cur_bus_chip(chip, &dev);
        if (!ret)
-               ret = i2c_read(dev, 0, (uchar *)&edid, sizeof(edid));
+               ret = dm_i2c_read(dev, 0, (uchar *)&edid, sizeof(edid));
 #else
        ret = i2c_read(chip, 0, 1, (uchar *)&edid, sizeof(edid));
 #endif
@@ -1696,7 +1696,11 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
                }
 #endif
                printf("Setting bus to %d\n", bus_no);
+#ifdef CONFIG_DM_I2C
+               ret = cmd_i2c_set_bus_num(bus_no);
+#else
                ret = i2c_set_bus_num(bus_no);
+#endif
                if (ret)
                        printf("Failure changing bus number (%d)\n", ret);
        }
index f6e522cbb3482bf48eeae51cfe0d2e1467404de3..d043e6d7bcf2d6368ead958a89574720ce6c37d4 100644 (file)
@@ -222,7 +222,7 @@ static int read_record(char *buf, ulong len)
                }
 
            /* Check for the console hangup (if any different from serial) */
-           if (gd->jt[XF_getc] != getc) {
+           if (gd->jt->getc != getc) {
                if (ctrlc()) {
                    return (-1);
                }
index 96478e45c14039cd88a1a59427d0ec7f1a44d07e..4e28c9d7a4d6541f0c1633ee494b77e476b5e776 100644 (file)
@@ -73,6 +73,8 @@ U_BOOT_CMD(
 
 static void print_mmcinfo(struct mmc *mmc)
 {
+       int i;
+
        printf("Device: %s\n", mmc->cfg->name);
        printf("Manufacturer ID: %x\n", mmc->cid[0] >> 24);
        printf("OEM: %x\n", (mmc->cid[0] >> 8) & 0xffff);
@@ -92,6 +94,48 @@ static void print_mmcinfo(struct mmc *mmc)
 
        printf("Bus Width: %d-bit%s\n", mmc->bus_width,
                        mmc->ddr_mode ? " DDR" : "");
+
+       puts("Erase Group Size: ");
+       print_size(((u64)mmc->erase_grp_size) << 9, "\n");
+
+       if (!IS_SD(mmc) && mmc->version >= MMC_VERSION_4_41) {
+               bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0;
+               bool usr_enh = has_enh && (mmc->part_attr & EXT_CSD_ENH_USR);
+
+               puts("HC WP Group Size: ");
+               print_size(((u64)mmc->hc_wp_grp_size) << 9, "\n");
+
+               puts("User Capacity: ");
+               print_size(mmc->capacity_user, usr_enh ? " ENH" : "");
+               if (mmc->wr_rel_set & EXT_CSD_WR_DATA_REL_USR)
+                       puts(" WRREL\n");
+               else
+                       putc('\n');
+               if (usr_enh) {
+                       puts("User Enhanced Start: ");
+                       print_size(mmc->enh_user_start, "\n");
+                       puts("User Enhanced Size: ");
+                       print_size(mmc->enh_user_size, "\n");
+               }
+               puts("Boot Capacity: ");
+               print_size(mmc->capacity_boot, has_enh ? " ENH\n" : "\n");
+               puts("RPMB Capacity: ");
+               print_size(mmc->capacity_rpmb, has_enh ? " ENH\n" : "\n");
+
+               for (i = 0; i < ARRAY_SIZE(mmc->capacity_gp); i++) {
+                       bool is_enh = has_enh &&
+                               (mmc->part_attr & EXT_CSD_ENH_GP(i));
+                       if (mmc->capacity_gp[i]) {
+                               printf("GP%i Capacity: ", i+1);
+                               print_size(mmc->capacity_gp[i],
+                                          is_enh ? " ENH" : "");
+                               if (mmc->wr_rel_set & EXT_CSD_WR_DATA_REL_GP(i))
+                                       puts(" WRREL\n");
+                               else
+                                       putc('\n');
+                       }
+               }
+       }
 }
 static struct mmc *init_mmc_device(int dev, bool force_init)
 {
@@ -444,6 +488,157 @@ static int do_mmc_list(cmd_tbl_t *cmdtp, int flag,
        print_mmc_devices('\n');
        return CMD_RET_SUCCESS;
 }
+
+static int parse_hwpart_user(struct mmc_hwpart_conf *pconf,
+                            int argc, char * const argv[])
+{
+       int i = 0;
+
+       memset(&pconf->user, 0, sizeof(pconf->user));
+
+       while (i < argc) {
+               if (!strcmp(argv[i], "enh")) {
+                       if (i + 2 >= argc)
+                               return -1;
+                       pconf->user.enh_start =
+                               simple_strtoul(argv[i+1], NULL, 10);
+                       pconf->user.enh_size =
+                               simple_strtoul(argv[i+2], NULL, 10);
+                       i += 3;
+               } else if (!strcmp(argv[i], "wrrel")) {
+                       if (i + 1 >= argc)
+                               return -1;
+                       pconf->user.wr_rel_change = 1;
+                       if (!strcmp(argv[i+1], "on"))
+                               pconf->user.wr_rel_set = 1;
+                       else if (!strcmp(argv[i+1], "off"))
+                               pconf->user.wr_rel_set = 0;
+                       else
+                               return -1;
+                       i += 2;
+               } else {
+                       break;
+               }
+       }
+       return i;
+}
+
+static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx,
+                          int argc, char * const argv[])
+{
+       int i;
+
+       memset(&pconf->gp_part[pidx], 0, sizeof(pconf->gp_part[pidx]));
+
+       if (1 >= argc)
+               return -1;
+       pconf->gp_part[pidx].size = simple_strtoul(argv[0], NULL, 10);
+
+       i = 1;
+       while (i < argc) {
+               if (!strcmp(argv[i], "enh")) {
+                       pconf->gp_part[pidx].enhanced = 1;
+                       i += 1;
+               } else if (!strcmp(argv[i], "wrrel")) {
+                       if (i + 1 >= argc)
+                               return -1;
+                       pconf->gp_part[pidx].wr_rel_change = 1;
+                       if (!strcmp(argv[i+1], "on"))
+                               pconf->gp_part[pidx].wr_rel_set = 1;
+                       else if (!strcmp(argv[i+1], "off"))
+                               pconf->gp_part[pidx].wr_rel_set = 0;
+                       else
+                               return -1;
+                       i += 2;
+               } else {
+                       break;
+               }
+       }
+       return i;
+}
+
+static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag,
+                             int argc, char * const argv[])
+{
+       struct mmc *mmc;
+       struct mmc_hwpart_conf pconf = { };
+       enum mmc_hwpart_conf_mode mode = MMC_HWPART_CONF_CHECK;
+       int i, r, pidx;
+
+       mmc = init_mmc_device(curr_device, false);
+       if (!mmc)
+               return CMD_RET_FAILURE;
+
+       if (argc < 1)
+               return CMD_RET_USAGE;
+       i = 1;
+       while (i < argc) {
+               if (!strcmp(argv[i], "user")) {
+                       i++;
+                       r = parse_hwpart_user(&pconf, argc-i, &argv[i]);
+                       if (r < 0)
+                               return CMD_RET_USAGE;
+                       i += r;
+               } else if (!strncmp(argv[i], "gp", 2) &&
+                          strlen(argv[i]) == 3 &&
+                          argv[i][2] >= '1' && argv[i][2] <= '4') {
+                       pidx = argv[i][2] - '1';
+                       i++;
+                       r = parse_hwpart_gp(&pconf, pidx, argc-i, &argv[i]);
+                       if (r < 0)
+                               return CMD_RET_USAGE;
+                       i += r;
+               } else if (!strcmp(argv[i], "check")) {
+                       mode = MMC_HWPART_CONF_CHECK;
+                       i++;
+               } else if (!strcmp(argv[i], "set")) {
+                       mode = MMC_HWPART_CONF_SET;
+                       i++;
+               } else if (!strcmp(argv[i], "complete")) {
+                       mode = MMC_HWPART_CONF_COMPLETE;
+                       i++;
+               } else {
+                       return CMD_RET_USAGE;
+               }
+       }
+
+       puts("Partition configuration:\n");
+       if (pconf.user.enh_size) {
+               puts("\tUser Enhanced Start: ");
+               print_size(((u64)pconf.user.enh_start) << 9, "\n");
+               puts("\tUser Enhanced Size: ");
+               print_size(((u64)pconf.user.enh_size) << 9, "\n");
+       } else {
+               puts("\tNo enhanced user data area\n");
+       }
+       if (pconf.user.wr_rel_change)
+               printf("\tUser partition write reliability: %s\n",
+                      pconf.user.wr_rel_set ? "on" : "off");
+       for (pidx = 0; pidx < 4; pidx++) {
+               if (pconf.gp_part[pidx].size) {
+                       printf("\tGP%i Capacity: ", pidx+1);
+                       print_size(((u64)pconf.gp_part[pidx].size) << 9,
+                                  pconf.gp_part[pidx].enhanced ?
+                                  " ENH\n" : "\n");
+               } else {
+                       printf("\tNo GP%i partition\n", pidx+1);
+               }
+               if (pconf.gp_part[pidx].wr_rel_change)
+                       printf("\tGP%i write reliability: %s\n", pidx+1,
+                              pconf.gp_part[pidx].wr_rel_set ? "on" : "off");
+       }
+
+       if (!mmc_hwpart_config(mmc, &pconf, mode)) {
+               if (mode == MMC_HWPART_CONF_COMPLETE)
+                       puts("Partitioning successful, "
+                            "power-cycle to make effective\n");
+               return CMD_RET_SUCCESS;
+       } else {
+               puts("Failed!\n");
+               return CMD_RET_FAILURE;
+       }
+}
+
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
                          int argc, char * const argv[])
@@ -601,6 +796,7 @@ static cmd_tbl_t cmd_mmc[] = {
        U_BOOT_CMD_MKENT(part, 1, 1, do_mmc_part, "", ""),
        U_BOOT_CMD_MKENT(dev, 3, 0, do_mmc_dev, "", ""),
        U_BOOT_CMD_MKENT(list, 1, 1, do_mmc_list, "", ""),
+       U_BOOT_CMD_MKENT(hwpartition, 28, 0, do_mmc_hwpartition, "", ""),
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
        U_BOOT_CMD_MKENT(bootbus, 5, 0, do_mmc_bootbus, "", ""),
        U_BOOT_CMD_MKENT(bootpart-resize, 4, 0, do_mmc_boot_resize, "", ""),
@@ -640,7 +836,7 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 
 U_BOOT_CMD(
-       mmc, 7, 1, do_mmcops,
+       mmc, 29, 1, do_mmcops,
        "MMC sub system",
        "info - display info of the current MMC device\n"
        "mmc read addr blk# cnt\n"
@@ -650,6 +846,13 @@ U_BOOT_CMD(
        "mmc part - lists available partition on current mmc device\n"
        "mmc dev [dev] [part] - show or set current mmc device [partition]\n"
        "mmc list - lists available devices\n"
+       "mmc hwpartition [args...] - does hardware partitioning\n"
+       "  arguments (sizes in 512-byte blocks):\n"
+       "    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes\n"
+       "    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition\n"
+       "    [check|set|complete] - mode, complete set partitioning completed\n"
+       "  WARNING: Partitioning is a write-once setting once it is set to complete.\n"
+       "  Power cycling is required to initialize partitions after set to complete.\n"
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
        "mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode\n"
        " - Set the BOOT_BUS_WIDTH field of the specified device\n"
index 39e8666b774a4b0d45c2a0f9b06295ac975a20b5..c99f52735f057c92b556bf49a7c0559f1ef66575 100644 (file)
@@ -54,13 +54,31 @@ static int do_part_list(int argc, char * const argv[])
        int ret;
        block_dev_desc_t *desc;
 
-       if (argc != 2)
+       if (argc < 2 || argc > 3)
                return CMD_RET_USAGE;
 
        ret = get_device(argv[0], argv[1], &desc);
        if (ret < 0)
                return 1;
 
+       if (argc == 3) {
+               int p;
+               char str[512] = { 0, };
+         disk_partition_t info;
+
+               for (p = 1; p < 128; p++) {
+                       int r = get_partition_info(desc, p, &info);
+
+                       if (r == 0) {
+                               char t[5];
+                               sprintf(t, "%s%d", str[0] ? " " : "", p);
+                               strcat(str, t);
+                       }
+               }
+               setenv(argv[2], str);
+               return 0;
+       }
+
        print_part(desc);
 
        return 0;
@@ -87,5 +105,7 @@ U_BOOT_CMD(
        "part uuid <interface> <dev>:<part> <varname>\n"
        "    - set environment variable to partition UUID\n"
        "part list <interface> <dev>\n"
-       "    - print a device's partition table"
+       "    - print a device's partition table\n"
+       "part list <interface> <dev> <varname>\n"
+       "    - set environment variable to the list of partitions"
 );
index c192498257fe8f60fed0f41e4c4f97b8fcd0d986..27813f0d7af680fffa67b0dba509da1ba020e43a 100644 (file)
@@ -441,6 +441,26 @@ static int do_usb_stop_keyboard(int force)
        return 0;
 }
 
+static void do_usb_start(void)
+{
+       bootstage_mark_name(BOOTSTAGE_ID_USB_START, "usb_start");
+
+       if (usb_init() < 0)
+               return;
+
+#ifdef CONFIG_USB_STORAGE
+       /* try to recognize storage devices immediately */
+       usb_stor_curr_dev = usb_stor_scan(1);
+#endif
+#ifdef CONFIG_USB_HOST_ETHER
+       /* try to recognize ethernet devices immediately */
+       usb_ether_curr_dev = usb_host_eth_scan(1);
+#endif
+#ifdef CONFIG_USB_KEYBOARD
+       drv_usb_kbd_init();
+#endif
+}
+
 /******************************************************************************
  * usb command intepreter
  */
@@ -457,26 +477,20 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (argc < 2)
                return CMD_RET_USAGE;
 
-       if ((strncmp(argv[1], "reset", 5) == 0) ||
-                (strncmp(argv[1], "start", 5) == 0)) {
-               bootstage_mark_name(BOOTSTAGE_ID_USB_START, "usb_start");
+       if (strncmp(argv[1], "start", 5) == 0) {
+               if (usb_started)
+                       return 0; /* Already started */
+               printf("starting USB...\n");
+               do_usb_start();
+               return 0;
+       }
+
+       if (strncmp(argv[1], "reset", 5) == 0) {
+               printf("resetting USB...\n");
                if (do_usb_stop_keyboard(1) != 0)
                        return 1;
                usb_stop();
-               printf("(Re)start USB...\n");
-               if (usb_init() >= 0) {
-#ifdef CONFIG_USB_STORAGE
-                       /* try to recognize storage devices immediately */
-                       usb_stor_curr_dev = usb_stor_scan(1);
-#endif
-#ifdef CONFIG_USB_HOST_ETHER
-                       /* try to recognize ethernet devices immediately */
-                       usb_ether_curr_dev = usb_host_eth_scan(1);
-#endif
-#ifdef CONFIG_USB_KEYBOARD
-                       drv_usb_kbd_init();
-#endif
-               }
+               do_usb_start();
                return 0;
        }
        if (strncmp(argv[1], "stop", 4) == 0) {
index ae2714d3728021bdc0d262f2bbe3b4cb54fcfe52..64b9186d738920dabf3e8573dcebaecdbb3ee562 100644 (file)
@@ -247,6 +247,8 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
                puts("OK\n");
        }
 
+       flush_cache(dest, len);
+
        setenv_hex("fileaddr", data);
        setenv_hex("filesize", len);
 
index fc1963b2a978a1be548f07e98108e1b817432e0c..3f25e76fe79ea3c94a85d0306d668233320e2d47 100644 (file)
@@ -125,13 +125,13 @@ static int console_setfile(int file, struct stdio_dev * dev)
                 */
                switch (file) {
                case stdin:
-                       gd->jt[XF_getc] = getc;
-                       gd->jt[XF_tstc] = tstc;
+                       gd->jt->getc = getc;
+                       gd->jt->tstc = tstc;
                        break;
                case stdout:
-                       gd->jt[XF_putc] = putc;
-                       gd->jt[XF_puts] = puts;
-                       gd->jt[XF_printf] = printf;
+                       gd->jt->putc  = putc;
+                       gd->jt->puts  = puts;
+                       gd->jt->printf = printf;
                        break;
                }
                break;
@@ -758,11 +758,11 @@ int console_init_r(void)
 #endif
 
        /* set default handlers at first */
-       gd->jt[XF_getc] = serial_getc;
-       gd->jt[XF_tstc] = serial_tstc;
-       gd->jt[XF_putc] = serial_putc;
-       gd->jt[XF_puts] = serial_puts;
-       gd->jt[XF_printf] = serial_printf;
+       gd->jt->getc  = serial_getc;
+       gd->jt->tstc  = serial_tstc;
+       gd->jt->putc  = serial_putc;
+       gd->jt->puts  = serial_puts;
+       gd->jt->printf = serial_printf;
 
        /* stdin stdout and stderr are in environment */
        /* scan for it */
index 88fcfc8cb6fc652e8fb5242869ebdb4c0813f5dd..333107c74c3c68f9244eea3cdbd44a6f0c1c2802 100644 (file)
@@ -1,6 +1,7 @@
 #include <common.h>
 #include <exports.h>
 #include <spi.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -13,33 +14,10 @@ unsigned long get_version(void)
        return XF_VERSION;
 }
 
-/* Reuse _exports.h with a little trickery to avoid bitrot */
-#define EXPORT_FUNC(sym) gd->jt[XF_##sym] = (void *)sym;
-
-#if !defined(CONFIG_X86) && !defined(CONFIG_PPC)
-# define install_hdlr      dummy
-# define free_hdlr         dummy
-#else /* kludge for non-standard function naming */
-# define install_hdlr      irq_install_handler
-# define free_hdlr         irq_free_handler
-#endif
-#ifndef CONFIG_CMD_I2C
-# define i2c_write         dummy
-# define i2c_read          dummy
-#endif
-#if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI)
-# define spi_init          dummy
-# define spi_setup_slave   dummy
-# define spi_free_slave    dummy
-#endif
-#ifndef CONFIG_CMD_SPI
-# define spi_claim_bus     dummy
-# define spi_release_bus   dummy
-# define spi_xfer          dummy
-#endif
+#define EXPORT_FUNC(f, a, x, ...)  gd->jt->x = f;
 
 void jumptable_init(void)
 {
-       gd->jt = malloc(XF_MAX * sizeof(void *));
+       gd->jt = malloc(sizeof(struct jt_funcs));
 #include <_exports.h>
 }
index aceabc5caddb12d1c52d9b4c4028981ff01670b0..d154d029e9c32466979bdc93116b70778402bb78 100644 (file)
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#ifndef USE_HOSTCC
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
 #include <hw_sha.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#else
+#include "mkimage.h"
+#include <time.h>
+#include <image.h>
+#endif /* !USE_HOSTCC*/
+
 #include <hash.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha1.h>
 #include <u-boot/sha256.h>
-#include <asm/io.h>
-#include <asm/errno.h>
+#include <u-boot/md5.h>
 
-#ifdef CONFIG_CMD_SHA1SUM
+#ifdef CONFIG_SHA1
 static int hash_init_sha1(struct hash_algo *algo, void **ctxp)
 {
        sha1_context *ctx = malloc(sizeof(sha1_context));
@@ -125,12 +134,7 @@ static struct hash_algo hash_algo[] = {
                CHUNKSZ_SHA256,
        },
 #endif
-       /*
-        * This is CONFIG_CMD_SHA1SUM instead of CONFIG_SHA1 since otherwise
-        * it bloats the code for boards which use SHA1 but not the 'hash'
-        * or 'sha1sum' commands.
-        */
-#ifdef CONFIG_CMD_SHA1SUM
+#ifdef CONFIG_SHA1
        {
                "sha1",
                SHA1_SUM_LEN,
@@ -140,7 +144,6 @@ static struct hash_algo hash_algo[] = {
                hash_update_sha1,
                hash_finish_sha1,
        },
-#define MULTI_HASH
 #endif
 #ifdef CONFIG_SHA256
        {
@@ -152,7 +155,6 @@ static struct hash_algo hash_algo[] = {
                hash_update_sha256,
                hash_finish_sha256,
        },
-#define MULTI_HASH
 #endif
        {
                "crc32",
@@ -165,6 +167,10 @@ static struct hash_algo hash_algo[] = {
        },
 };
 
+#if defined(CONFIG_SHA256) || defined(CONFIG_CMD_SHA1SUM)
+#define MULTI_HASH
+#endif
+
 #if defined(CONFIG_HASH_VERIFY) || defined(CONFIG_CMD_HASH)
 #define MULTI_HASH
 #endif
@@ -176,6 +182,40 @@ static struct hash_algo hash_algo[] = {
 #define multi_hash()   0
 #endif
 
+int hash_lookup_algo(const char *algo_name, struct hash_algo **algop)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
+               if (!strcmp(algo_name, hash_algo[i].name)) {
+                       *algop = &hash_algo[i];
+                       return 0;
+               }
+       }
+
+       debug("Unknown hash algorithm '%s'\n", algo_name);
+       return -EPROTONOSUPPORT;
+}
+
+int hash_progressive_lookup_algo(const char *algo_name,
+                                struct hash_algo **algop)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
+               if (!strcmp(algo_name, hash_algo[i].name)) {
+                       if (hash_algo[i].hash_init) {
+                               *algop = &hash_algo[i];
+                               return 0;
+                       }
+               }
+       }
+
+       debug("Unknown hash algorithm '%s'\n", algo_name);
+       return -EPROTONOSUPPORT;
+}
+
+#ifndef USE_HOSTCC
 /**
  * store_result: Store the resulting sum to an address or variable
  *
@@ -296,21 +336,6 @@ static int parse_verify_sum(struct hash_algo *algo, char *verify_str,
        return 0;
 }
 
-int hash_lookup_algo(const char *algo_name, struct hash_algo **algop)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
-               if (!strcmp(algo_name, hash_algo[i].name)) {
-                       *algop = &hash_algo[i];
-                       return 0;
-               }
-       }
-
-       debug("Unknown hash algorithm '%s'\n", algo_name);
-       return -EPROTONOSUPPORT;
-}
-
 void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *output)
 {
        int i;
@@ -424,3 +449,4 @@ int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
 
        return 0;
 }
+#endif
index 1589ee3e4fb811ccb9bc8f31fbc094533abcd093..b47d11024f2beb007d049bc0cb54a43268d8bde1 100644 (file)
@@ -112,6 +112,33 @@ static void fit_get_debug(const void *fit, int noffset,
              fdt_strerror(err));
 }
 
+/**
+ * fit_get_subimage_count - get component (sub-image) count
+ * @fit: pointer to the FIT format image header
+ * @images_noffset: offset of images node
+ *
+ * returns:
+ *     number of image components
+ */
+int fit_get_subimage_count(const void *fit, int images_noffset)
+{
+       int noffset;
+       int ndepth;
+       int count = 0;
+
+       /* Process its subnodes, print out component images details */
+       for (ndepth = 0, count = 0,
+               noffset = fdt_next_node(fit, images_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node(fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       count++;
+               }
+       }
+
+       return count;
+}
+
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_FIT_SPL_PRINT)
 /**
  * fit_print_contents - prints out the contents of the FIT format image
@@ -423,7 +450,8 @@ void fit_image_print(const void *fit, int image_noffset, const char *p)
                }
        }
 }
-#endif
+
+#endif /* !defined(CONFIG_SPL_BUILD) || defined(CONFIG_FIT_SPL_PRINT) */
 
 /**
  * fit_get_desc - get node description property
index 8601edaca35f41d0c996e15fb7f447179a8255b3..2c9f0cdf7ae3996b5c57bbe74b9ff7ee5cea58d7 100644 (file)
@@ -38,7 +38,7 @@ struct checksum_algo checksum_algos[] = {
 #if IMAGE_ENABLE_SIGN
                EVP_sha1,
 #endif
-               sha1_calculate,
+               hash_calculate,
                padding_sha1_rsa2048,
        },
        {
@@ -48,7 +48,7 @@ struct checksum_algo checksum_algos[] = {
 #if IMAGE_ENABLE_SIGN
                EVP_sha256,
 #endif
-               sha256_calculate,
+               hash_calculate,
                padding_sha256_rsa2048,
        },
        {
@@ -58,7 +58,7 @@ struct checksum_algo checksum_algos[] = {
 #if IMAGE_ENABLE_SIGN
                EVP_sha256,
 #endif
-               sha256_calculate,
+               hash_calculate,
                padding_sha256_rsa4096,
        }
 
index ad7a46d08d827fb18f7005132342d19c7d97cf5d..a911aa9b4d128227520fba77555c4879e5e93ff3 100644 (file)
@@ -756,7 +756,7 @@ int genimg_get_format(const void *img_addr)
  * genimg_get_image - get image from special storage (if necessary)
  * @img_addr: image start address
  *
- * genimg_get_image() checks if provided image start adddress is located
+ * genimg_get_image() checks if provided image start address is located
  * in a dataflash storage. If so, image is moved to a system RAM memory.
  *
  * returns:
index cc34b8aee4c484c123d6770d778331b9c8b6e880..1195a54efcc742837f3cb703b4c8ad6f5d356569 100644 (file)
@@ -268,6 +268,7 @@ void lcd_clear(void)
        console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
 #endif
        console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
+       lcd_init_console(lcd_base, console_rows, console_cols);
        lcd_init_console(lcd_logo(), console_rows, console_cols);
        lcd_sync();
 }
index 1826c47a99c464bd0023f3c173cab788de49acb0..daaeb507c467b14cf0f80ecaab46e48064e58672 100644 (file)
@@ -231,7 +231,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 #endif
        default:
 #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-               printf("SPL: Unsupported Boot Device %d\n", boot_device);
+               puts("SPL: Unsupported Boot Device!\n");
 #endif
                hang();
        }
index 736cd9f00950929c3a269987d8c9c2e32cc80f7e..32e15cd8ddb93320c5758635268daac68e7196f7 100644 (file)
@@ -59,6 +59,7 @@ int usb_init(void)
        void *ctrl;
        struct usb_device *dev;
        int i, start_index = 0;
+       int controllers_initialized = 0;
        int ret;
 
        dev_index = 0;
@@ -78,6 +79,7 @@ int usb_init(void)
                ret = usb_lowlevel_init(i, USB_INIT_HOST, &ctrl);
                if (ret == -ENODEV) {   /* No such device. */
                        puts("Port not available.\n");
+                       controllers_initialized++;
                        continue;
                }
 
@@ -89,6 +91,7 @@ int usb_init(void)
                 * lowlevel init is OK, now scan the bus for devices
                 * i.e. search HUBs and configure them
                 */
+               controllers_initialized++;
                start_index = dev_index;
                printf("scanning bus %d for devices... ", i);
                dev = usb_alloc_new_device(ctrl);
@@ -110,12 +113,10 @@ int usb_init(void)
 
        debug("scan end\n");
        /* if we were not able to find at least one working bus, bail out */
-       if (!usb_started) {
+       if (controllers_initialized == 0)
                puts("USB error: all controllers failed lowlevel init\n");
-               return -1;
-       }
 
-       return 0;
+       return usb_started ? 0 : -1;
 }
 
 /******************************************************************************
@@ -969,6 +970,8 @@ int usb_new_device(struct usb_device *dev)
                        printf("\n     Couldn't reset port %i\n", dev->portnr);
                        return 1;
                }
+       } else {
+               usb_reset_root_port();
        }
 #endif
 
index bc7145ea79d38b87ce173b2b14dc9bf444f40826..ecc3085cc0811b5471cab07415904221153abf33 100644 (file)
@@ -332,7 +332,8 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev)
                /* We've consumed all queued int packets, create new */
                destroy_int_queue(dev, data->intq);
                data->intq = create_int_queue(dev, data->intpipe, 1,
-                                     USB_KBD_BOOT_REPORT_SIZE, data->new);
+                                     USB_KBD_BOOT_REPORT_SIZE, data->new,
+                                     data->intinterval);
        }
 #endif
 }
@@ -453,7 +454,8 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
        debug("USB KBD: enable interrupt pipe...\n");
 #ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
        data->intq = create_int_queue(dev, data->intpipe, 1,
-                                     USB_KBD_BOOT_REPORT_SIZE, data->new);
+                                     USB_KBD_BOOT_REPORT_SIZE, data->new,
+                                     data->intinterval);
        if (!data->intq) {
 #else
        if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize,
@@ -542,6 +544,10 @@ int usb_kbd_deregister(int force)
                data = usb_kbd_dev->privptr;
                if (stdio_deregister_dev(dev, force) != 0)
                        return 1;
+#ifdef CONFIG_CONSOLE_MUX
+               if (iomux_doenv(stdin, getenv("stdin")) != 0)
+                       return 1;
+#endif
 #ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
                destroy_int_queue(usb_kbd_dev, data->intq);
 #endif
index f0cbf21025afefaecc05eb2af5527dfae1b0e61d..8fa1a330cd34e1a8202892595c549971b3275169 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun4i-a10-olinuxino-lime.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_A10_OLINUXINO_L=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index 94fafa6b97c2edfdab573279fcf877f7df385648..b5f0a0f782e1166e42680ec61326635be9edc3d7 100644 (file)
@@ -8,4 +8,6 @@ CONFIG_USB1_VBUS_PIN="PB10"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
-+S:CONFIG_TARGET_A10S_OLINUXINO_M=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index 1a994180b5427b6ed099de520962d5a985d1b20d..a04f2b3362d2e695e98e1520303c0ae96a39095f 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_FDTFILE="sun5i-a13-olinuxino-micro.dtb"
 CONFIG_USB1_VBUS_PIN="PG11"
 CONFIG_VIDEO_HDMI=n
 CONFIG_VIDEO_VGA_VIA_LCD=y
+CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y
 # For use with the Olimex 7" LCD module, adjust timings for other displays
 # Set video-mode=sunxi:800x600-24@60,monitor=lcd in the env. to enable
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
@@ -12,4 +13,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
-+S:CONFIG_TARGET_A13_OLINUXINOM=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
index 7df69517f6b26cc7191845004cfe13ff82fca4ca..806d5b7bd5346f93518494393324581c2809e0cc 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_FDTFILE="sun5i-a13-olinuxino.dtb"
 CONFIG_USB1_VBUS_PIN="PG11"
 CONFIG_VIDEO_HDMI=n
 CONFIG_VIDEO_VGA_VIA_LCD=y
+CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y
 # For use with the Olimex 7" LCD module, adjust timings for other displays
 # Set video-mode=sunxi:800x600-24@60,monitor=lcd in the env. to enable
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
@@ -12,4 +13,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
-+S:CONFIG_TARGET_A13_OLINUXINO=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
index f80b98ae90a2d37df500d941fc402b4e5f01ca83..ff94e77200a39d77ea008098d65cfbcaebd7d385 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun7i-a20-olinuxino-lime2.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_A20_OLINUXINO_L2=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index d9e66b715514830da86073f7316f2c846482810f..5442f645f87165c34bbed8ba3e6cde3d8a8b87e8 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun7i-a20-olinuxino-lime.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_A20_OLINUXINO_L=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index 1c5a6f7a9faf1703a8d9d04dce5201647d2dc0db..97a21ee534702eaf133b450a331a9a6ee13f2d06 100644 (file)
@@ -8,4 +8,6 @@ CONFIG_VIDEO_VGA=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_A20_OLINUXINO_M=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index 7fe9059179eb88116caa659e9033a221316a1029..03ec3dbdc410d633ae2eb503938a0218fca4c50f 100644 (file)
@@ -5,4 +5,6 @@ CONFIG_USB1_VBUS_PIN="PG13"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
-+S:CONFIG_TARGET_AUXTEK_T004=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index 196f6824cb422c6f43c137fb10baf0fd83fec61a..5aba9382769411f5cf89a26db0a54937a74e29c6 100644 (file)
@@ -1,7 +1,10 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI,USB_EHCI"
 CONFIG_FDTFILE="sun7i-a20-bananapi.dtb"
+CONFIG_GMAC_TX_DELAY=3
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_BANANAPI=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index 7f9ce13e20e586f7836556af73734f5cd68d766f..e501b5c95c5fca8e9cb9886679e09b5ab7b78e3b 100644 (file)
@@ -3,7 +3,10 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHC
 CONFIG_FDTFILE="sun7i-a20-bananapro.dtb"
 CONFIG_USB1_VBUS_PIN="PH0"
 CONFIG_USB2_VBUS_PIN="PH1"
+CONFIG_GMAC_TX_DELAY=3
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_BANANAPRO=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/C29XPCIE_NOR_SECBOOT_defconfig b/configs/C29XPCIE_NOR_SECBOOT_defconfig
new file mode 100644 (file)
index 0000000..86751cf
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="C29XPCIE,36BIT,SECURE_BOOT"
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_C29XPCIE=y
diff --git a/configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig b/configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig
new file mode 100644 (file)
index 0000000..d1a42b2
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="C29XPCIE,36BIT,SPIFLASH,SECURE_BOOT"
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_C29XPCIE=y
diff --git a/configs/CATcenter_25_defconfig b/configs/CATcenter_25_defconfig
deleted file mode 100644 (file)
index 1a8903c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=1,PPCHAMELEON_CLK_25"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_CATCENTER=y
diff --git a/configs/CATcenter_33_defconfig b/configs/CATcenter_33_defconfig
deleted file mode 100644 (file)
index 4b0eb8d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=1,PPCHAMELEON_CLK_33"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_CATCENTER=y
diff --git a/configs/CATcenter_defconfig b/configs/CATcenter_defconfig
deleted file mode 100644 (file)
index 53e00ad..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=1"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_CATCENTER=y
index 1b6cdbf811b3bfdb4f9fece099b69d5174b4275f..4040beea69e4dfb7ccf89c29f3d1346ccd4d74d4 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_FDTFILE="sun6i-a31s-cs908.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
-+S:CONFIG_TARGET_CSQ_CS908=y
 +S:CONFIG_DRAM_CLK=432
 +S:CONFIG_DRAM_ZQ=123
 # Ethernet phy power
diff --git a/configs/Chuwi_V7_CW0825_defconfig b/configs/Chuwi_V7_CW0825_defconfig
new file mode 100644 (file)
index 0000000..680b631
--- /dev/null
@@ -0,0 +1,19 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER"
+CONFIG_FDTFILE="sun4i-a10-chuwi-v7-cw0825.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="PB9"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:24,pclk_khz:51000,le:19,ri:300,up:6,lo:31,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="PH8"
+CONFIG_VIDEO_LCD_BL_EN="PH7"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
+CONFIG_VIDEO_LCD_SPI_CS="PA0"
+CONFIG_VIDEO_LCD_SPI_SCLK="PA1"
+CONFIG_VIDEO_LCD_SPI_MOSI="PA2"
+CONFIG_VIDEO_LCD_PANEL_HITACHI_TX18D42VM=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index f42ae5222e17022a6ccddd604c4915a0fe25df37..33edcc4205d66b332cd26d1ca89bd396fced28db 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_FDTFILE="sun6i-a31-colombus.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
-+S:CONFIG_TARGET_COLOMBUS=y
 +S:CONFIG_DRAM_CLK=240
 +S:CONFIG_DRAM_ZQ=251
 # Wifi power
index 7e7a1ca3981cd4edeca132a71a9c1716fc011149..7704a0ef8108f86a97d8b60b018137ec12090d30 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun7i-a20-cubieboard2.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_CUBIEBOARD2=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index 0bc45fd2cb28af8c559d68371e1e3b82b821be9d..4efc6e147e88c0b4f8d263f531db5f1c49ee22c9 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun4i-a10-cubieboard.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_CUBIEBOARD=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
index bc4441082b379669cb5edbd8a5b972de8ac92f19..b64f84f2b8d2d48bed3130aecd31d220013061f0 100644 (file)
@@ -5,4 +5,6 @@ CONFIG_VIDEO_VGA=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_CUBIETRUCK=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/ELPPC_defconfig b/configs/ELPPC_defconfig
deleted file mode 100644 (file)
index c4694ef..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_74xx_7xx=y
-CONFIG_TARGET_ELPPC=y
index 8896999e1e38a37086a29f5c0f3e1baf2b0bc740..027546391f16638184dede90512798c0b8b89f43 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_VIDEO_VGA_EXTERNAL_DAC_EN="PH25"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
-+S:CONFIG_TARGET_HUMMINGBIRD_A31=y
 +S:CONFIG_DRAM_CLK=312
 +S:CONFIG_DRAM_ZQ=251
 # Wifi power
diff --git a/configs/Hyundai_A7HD_defconfig b/configs/Hyundai_A7HD_defconfig
new file mode 100644 (file)
index 0000000..204640e
--- /dev/null
@@ -0,0 +1,23 @@
+# The Hyundai A7HD is a 7" 16:9 A10 powered tablet featuring 1G RAM, 8G
+# nand, 1024x600 IPS screen, a mini hdmi port, mini usb receptacle and a
+# headphones port for details see: http://linux-sunxi.org/Hyundai_A7HD
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER"
+CONFIG_FDTFILE="sun4i-a10-hyundai-a7hd.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="PB09"
+CONFIG_USB1_VBUS_PIN=""
+CONFIG_USB2_VBUS_PIN="PH6"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:45,ri:274,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=1
+CONFIG_VIDEO_LCD_POWER="PH2"
+CONFIG_VIDEO_LCD_BL_EN="PH9"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
+CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW=n
+CONFIG_VIDEO_LCD_PANEL_LVDS=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/Inet_86VS_defconfig b/configs/Inet_86VS_defconfig
new file mode 100644 (file)
index 0000000..ce9985a
--- /dev/null
@@ -0,0 +1,15 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER"
+CONFIG_FDTFILE="sun5i-a13-inet-86vs.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="PG12"
+CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:45,ri:209,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="AXP0-0"
+CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN5I=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index 0447b06c2b178bf546917bf72b1eb39d4a94b80f..192a461f55f6462c3519a9d5aade9b1be0020b15 100644 (file)
@@ -1,11 +1,13 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
 CONFIG_FDTFILE="sun8i-a23-ippo-q8h-v1.2.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="axp_drivebus"
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN8I=y
index 4e82bf93653e371b85d7c8421b150b43b20ee82a..4786202e16710c5d6511c46b8ba97b5ad4411fc6 100644 (file)
@@ -1,15 +1,16 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
 CONFIG_FDTFILE="sun8i-a23-ippo-q8h-v5.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="axp_drivebus"
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:168,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN8I=y
-+S:CONFIG_TARGET_IPPO_Q8H_V5=y
 +S:CONFIG_DRAM_CLK=480
 # zq = 0xf777
 +S:CONFIG_DRAM_ZQ=63351
diff --git a/configs/Linksprite_pcDuino3_Nano_defconfig b/configs/Linksprite_pcDuino3_Nano_defconfig
new file mode 100644 (file)
index 0000000..4baba14
--- /dev/null
@@ -0,0 +1,11 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(2),USB_EHCI"
+CONFIG_FDTFILE="sun7i-a20-pcduino3-nano.dtb"
+CONFIG_GMAC_TX_DELAY=3
+CONFIG_USB1_VBUS_PIN="PH11"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN7I=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=122
++S:CONFIG_DRAM_EMR1=4
index a26ff0a70f40efcb2fc9cdac035d49465c0f90c9..45d88f301576106940b020a4d9c32ddd595adf2a 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun7i-a20-pcduino3.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_PCDUINO3=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=122
++S:CONFIG_DRAM_EMR1=4
index a33f3a7981faa8723989d4b88ee0eda21bf84265..3b6dfa6fa691e9ac717609a268115e40e9772aac 100644 (file)
@@ -8,4 +8,6 @@ CONFIG_OF_SEPARATE=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_PCDUINO3=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=122
++S:CONFIG_DRAM_EMR1=4
index f5b0ca9877f6277ad241631fb62cb85e3324517c..1ba37bb3fbdd1d9a00c74053143512ffec648a9d 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun4i-a10-pcduino.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_PCDUINO=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/Lite5200_LOWBOOT08_defconfig b/configs/Lite5200_LOWBOOT08_defconfig
deleted file mode 100644 (file)
index 9f0cbd8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF800000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/Lite5200_LOWBOOT_defconfig b/configs/Lite5200_LOWBOOT_defconfig
deleted file mode 100644 (file)
index ff1552f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF000000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/Lite5200_defconfig b/configs/Lite5200_defconfig
deleted file mode 100644 (file)
index 49fdb3b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/MPC8360EMDS_33_ATM_defconfig b/configs/MPC8360EMDS_33_ATM_defconfig
deleted file mode 100644 (file)
index dc325b1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ,PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_33_HOST_33_defconfig b/configs/MPC8360EMDS_33_HOST_33_defconfig
deleted file mode 100644 (file)
index fba273d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ,PCI,PCI_33M,PQ_MDS_PIB=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_33_HOST_66_defconfig b/configs/MPC8360EMDS_33_HOST_66_defconfig
deleted file mode 100644 (file)
index e0cf6da..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ,PCI,PCI_66M,PQ_MDS_PIB=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_33_SLAVE_defconfig b/configs/MPC8360EMDS_33_SLAVE_defconfig
deleted file mode 100644 (file)
index c3f74fc..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ,PCI,PCISLAVE"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_33_defconfig b/configs/MPC8360EMDS_33_defconfig
deleted file mode 100644 (file)
index 60c6ddb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_66_ATM_defconfig b/configs/MPC8360EMDS_66_ATM_defconfig
deleted file mode 100644 (file)
index 16f12fb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_66MHZ,PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_66_HOST_33_defconfig b/configs/MPC8360EMDS_66_HOST_33_defconfig
deleted file mode 100644 (file)
index 797a584..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_66MHZ,PCI,PCI_33M,PQ_MDS_PIB=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_66_HOST_66_defconfig b/configs/MPC8360EMDS_66_HOST_66_defconfig
deleted file mode 100644 (file)
index a887c29..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_66MHZ,PCI,PCI_66M,PQ_MDS_PIB=1"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_66_SLAVE_defconfig b/configs/MPC8360EMDS_66_SLAVE_defconfig
deleted file mode 100644 (file)
index 4442c61..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_66MHZ,PCI,PCISLAVE"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360EMDS_66_defconfig b/configs/MPC8360EMDS_66_defconfig
deleted file mode 100644 (file)
index fce95dd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_66MHZ"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360EMDS=y
diff --git a/configs/MPC8360ERDK_33_defconfig b/configs/MPC8360ERDK_33_defconfig
deleted file mode 100644 (file)
index 91c47b7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="CLKIN_33MHZ"
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360ERDK=y
diff --git a/configs/MPC8360ERDK_defconfig b/configs/MPC8360ERDK_defconfig
deleted file mode 100644 (file)
index 7e9fa59..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8360ERDK=y
index ef1adc5623136c5d0cf3bc654f1d309df6174fc3..c6fb7e65d0f94f1e0de6e4a0558bf83326714a0d 100644 (file)
@@ -1,7 +1,16 @@
+# The MSI Primo73 is an A20 based tablet, with 1G RAM, 16G NAND,
+# 1024x600 TN LCD display, mono speaker, 0.3 MP front camera, 2.0 MP
+# rear camera, 3000 mAh battery, gt911 touchscreen, mma8452 accelerometer
+# and rtl8188etv usb wifi. Has "power", "volume+" and "volume-" buttons
+# (both volume buttons are also connected to the UBOOT_SEL pin). The
+# external connectors are represented by MicroSD slot, MiniHDMI, MicroUSB
+# OTG and 3.5mm headphone jack. More details are available at
+#    http://linux-sunxi.org/MSI_Primo73
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER"
 CONFIG_FDTFILE="sun7i-a20-primo73.dtb"
 CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:60000,le:60,ri:160,up:13,lo:12,hs:100,vs:10,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PH8"
 CONFIG_VIDEO_LCD_BL_EN="PH7"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
@@ -9,4 +18,6 @@ CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_MSI_PRIMO73=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
index b4b0f6d0e2362de0fa4720fa168fe748d4ee6b74..6657ad66c9727ac4ceb2bb5bad3a6f16d09f1b2f 100644 (file)
@@ -1,11 +1,29 @@
+# The MSI Primo81 is an A31s based tablet, with 1G RAM, 16G NAND,
+# 1024x768 IPS LCD display, mono speaker, 0.3 MP front camera, 2.0 MP
+# rear camera, 3500 mAh battery, gt911 touchscreen, mma8452 accelerometer
+# and rtl8188etv usb wifi. Has "power", "volume+" and "volume-" buttons
+# (both volume buttons are also connected to the UBOOT_SEL pin). The
+# external connectors are represented by MicroSD slot, MiniHDMI, MicroUSB
+# OTG and 3.5mm headphone jack. More details are available at
+#     http://linux-sunxi.org/MSI_Primo81
+
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS=""
 CONFIG_FDTFILE="sun6i-a31s-primo81.dtb"
+CONFIG_VIDEO_LCD_MODE="x:768,y:1024,depth:18,pclk_khz:66000,le:56,ri:60,up:30,lo:36,hs:64,vs:50,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
+CONFIG_VIDEO_LCD_SSD2828_TX_CLK=27
+CONFIG_VIDEO_LCD_SSD2828_RESET="PA26"
+CONFIG_VIDEO_LCD_SPI_CS="PH9"
+CONFIG_VIDEO_LCD_SPI_SCLK="PH10"
+CONFIG_VIDEO_LCD_SPI_MOSI="PH11"
+CONFIG_VIDEO_LCD_SPI_MISO="PH12"
+CONFIG_VIDEO_LCD_BL_EN="PA25"
+CONFIG_VIDEO_LCD_BL_PWM="PH13"
 CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
-+S:CONFIG_TARGET_MSI_PRIMO81=y
 +S:CONFIG_DRAM_CLK=360
 +S:CONFIG_DRAM_ZQ=122
 # Wifi power
diff --git a/configs/Marsboard_A10_defconfig b/configs/Marsboard_A10_defconfig
new file mode 100644 (file)
index 0000000..653cb01
--- /dev/null
@@ -0,0 +1,9 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,AHCI,USB_EHCI"
+CONFIG_FDTFILE="sun4i-a10-marsboard.dtb"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/Mele_A1000G_defconfig b/configs/Mele_A1000G_defconfig
deleted file mode 100644 (file)
index 9cb3285..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_EMAC,MACPWR=SUNXI_GPH(15),AHCI,USB_EHCI"
-CONFIG_FDTFILE="sun4i-a10-a1000.dtb"
-CONFIG_VIDEO_VGA=y
-+S:CONFIG_ARM=y
-+S:CONFIG_ARCH_SUNXI=y
-+S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_MELE_A1000G=y
index 97d94542d348efa2138116e309e0339909cf326b..1a0a025bd9eaa3b67ea6f3fb6c626b0af6f71076 100644 (file)
@@ -5,4 +5,6 @@ CONFIG_VIDEO_VGA=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_MELE_A1000=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
index 141d565cf8cfa6e1aa25224f562431fb2669c024..723a72a2efb1d68f49e8cdd78ca2eb07eb331ac4 100644 (file)
@@ -7,4 +7,6 @@ CONFIG_VIDEO_VGA=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_MELE_M3=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/Mele_M5_defconfig b/configs/Mele_M5_defconfig
new file mode 100644 (file)
index 0000000..2e1f80d
--- /dev/null
@@ -0,0 +1,13 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,USB_EHCI,STATUSLED=234"
+CONFIG_FDTFILE="sun7i-a20-m5.dtb"
+CONFIG_VIDEO_HDMI=y
++S:CONFIG_MMC0_CD_PIN="PH1"
++S:CONFIG_USB1_VBUS_PIN="PH6"
++S:CONFIG_USB2_VBUS_PIN="PH3"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN7I=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=122
++S:CONFIG_DRAM_EMR1=4
index e5ab0ec3029c62b478f06c76556feb969988c674..eaf9a7e349b3c765228398ccbbe4f3f34aff807a 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_FDTFILE="sun6i-a31-m9.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
-+S:CONFIG_TARGET_MELE_M9=y
 +S:CONFIG_DRAM_CLK=312
 +S:CONFIG_DRAM_ZQ=120
 # The Mele M9 uses 3.3V for general IO
diff --git a/configs/Mini-X-1Gb_defconfig b/configs/Mini-X-1Gb_defconfig
deleted file mode 100644 (file)
index b8fea01..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,USB_EHCI"
-CONFIG_FDTFILE="sun4i-a10-mini-xplus.dtb"
-+S:CONFIG_ARM=y
-+S:CONFIG_ARCH_SUNXI=y
-+S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_MINI_X_1GB=y
index 0f6bbe06b2c5d09585a334403b3dd97e91594dd3..6aea77716d35e62f608e67dc8fd20fb40e99e665 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun4i-a10-mini-xplus.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_MINI_X=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/P1011RDB_36BIT_SDCARD_defconfig b/configs/P1011RDB_36BIT_SDCARD_defconfig
deleted file mode 100644 (file)
index 7205bef..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,36BIT,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_36BIT_SPIFLASH_defconfig b/configs/P1011RDB_36BIT_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 8b3806e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,36BIT,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_36BIT_defconfig b/configs/P1011RDB_36BIT_defconfig
deleted file mode 100644 (file)
index c47f2e2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,36BIT"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_NAND_defconfig b/configs/P1011RDB_NAND_defconfig
deleted file mode 100644 (file)
index aac0190..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_SPL=y
-CONFIG_TPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,NAND"
-+ST:CONFIG_PPC=y
-+ST:CONFIG_MPC85xx=y
-+ST:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_SDCARD_defconfig b/configs/P1011RDB_SDCARD_defconfig
deleted file mode 100644 (file)
index 16e872f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_SPIFLASH_defconfig b/configs/P1011RDB_SPIFLASH_defconfig
deleted file mode 100644 (file)
index d14820f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1011RDB_defconfig b/configs/P1011RDB_defconfig
deleted file mode 100644 (file)
index d14868a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P1011RDB"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_36BIT_SDCARD_defconfig b/configs/P1020RDB_36BIT_SDCARD_defconfig
deleted file mode 100644 (file)
index a18563e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,36BIT,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_36BIT_SPIFLASH_defconfig b/configs/P1020RDB_36BIT_SPIFLASH_defconfig
deleted file mode 100644 (file)
index aa145fc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,36BIT,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_36BIT_defconfig b/configs/P1020RDB_36BIT_defconfig
deleted file mode 100644 (file)
index 844651f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,36BIT"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_NAND_defconfig b/configs/P1020RDB_NAND_defconfig
deleted file mode 100644 (file)
index 441241b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_SPL=y
-CONFIG_TPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,NAND"
-+ST:CONFIG_PPC=y
-+ST:CONFIG_MPC85xx=y
-+ST:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_SDCARD_defconfig b/configs/P1020RDB_SDCARD_defconfig
deleted file mode 100644 (file)
index 1349bea..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_SPIFLASH_defconfig b/configs/P1020RDB_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 7eb8696..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P1020RDB_defconfig b/configs/P1020RDB_defconfig
deleted file mode 100644 (file)
index fc58ac9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P1020RDB"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_36BIT_SDCARD_defconfig b/configs/P2010RDB_36BIT_SDCARD_defconfig
deleted file mode 100644 (file)
index 1381e8e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,36BIT,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_36BIT_SPIFLASH_defconfig b/configs/P2010RDB_36BIT_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 53ebca1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,36BIT,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_36BIT_defconfig b/configs/P2010RDB_36BIT_defconfig
deleted file mode 100644 (file)
index de29dcb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,36BIT"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_NAND_defconfig b/configs/P2010RDB_NAND_defconfig
deleted file mode 100644 (file)
index bc91a67..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_SPL=y
-CONFIG_TPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,NAND"
-+ST:CONFIG_PPC=y
-+ST:CONFIG_MPC85xx=y
-+ST:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_SDCARD_defconfig b/configs/P2010RDB_SDCARD_defconfig
deleted file mode 100644 (file)
index fd4ade7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_SPIFLASH_defconfig b/configs/P2010RDB_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 9631864..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2010RDB_defconfig b/configs/P2010RDB_defconfig
deleted file mode 100644 (file)
index 3b3352a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P2010RDB"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020COME_SDCARD_defconfig b/configs/P2020COME_SDCARD_defconfig
deleted file mode 100644 (file)
index c186fcb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SDCARD"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020COME=y
diff --git a/configs/P2020COME_SPIFLASH_defconfig b/configs/P2020COME_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 17ce136..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020COME=y
diff --git a/configs/P2020DS_36BIT_defconfig b/configs/P2020DS_36BIT_defconfig
deleted file mode 100644 (file)
index 359c446..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="36BIT"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020DS=y
diff --git a/configs/P2020DS_DDR2_defconfig b/configs/P2020DS_DDR2_defconfig
deleted file mode 100644 (file)
index 00b6731..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="DDR2"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020DS=y
diff --git a/configs/P2020DS_SDCARD_defconfig b/configs/P2020DS_SDCARD_defconfig
deleted file mode 100644 (file)
index 89aef3a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SDCARD"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020DS=y
diff --git a/configs/P2020DS_SPIFLASH_defconfig b/configs/P2020DS_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 503328c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020DS=y
diff --git a/configs/P2020DS_defconfig b/configs/P2020DS_defconfig
deleted file mode 100644 (file)
index f2ac6d9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P2020DS=y
diff --git a/configs/P2020RDB_36BIT_SDCARD_defconfig b/configs/P2020RDB_36BIT_SDCARD_defconfig
deleted file mode 100644 (file)
index 43cc2e3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,36BIT,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_36BIT_SPIFLASH_defconfig b/configs/P2020RDB_36BIT_SPIFLASH_defconfig
deleted file mode 100644 (file)
index f1199b6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,36BIT,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_36BIT_defconfig b/configs/P2020RDB_36BIT_defconfig
deleted file mode 100644 (file)
index 87490fd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,36BIT"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_NAND_defconfig b/configs/P2020RDB_NAND_defconfig
deleted file mode 100644 (file)
index 70ee084..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_SPL=y
-CONFIG_TPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,NAND"
-+ST:CONFIG_PPC=y
-+ST:CONFIG_MPC85xx=y
-+ST:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_SDCARD_defconfig b/configs/P2020RDB_SDCARD_defconfig
deleted file mode 100644 (file)
index 2bf5773..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,SDCARD"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_SPIFLASH_defconfig b/configs/P2020RDB_SPIFLASH_defconfig
deleted file mode 100644 (file)
index 290ebd2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB,SPIFLASH"
-+S:CONFIG_PPC=y
-+S:CONFIG_MPC85xx=y
-+S:CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P2020RDB_defconfig b/configs/P2020RDB_defconfig
deleted file mode 100644 (file)
index cc39735..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="P2020RDB"
-CONFIG_PPC=y
-CONFIG_MPC85xx=y
-CONFIG_TARGET_P1_P2_RDB=y
diff --git a/configs/P3G4_defconfig b/configs/P3G4_defconfig
deleted file mode 100644 (file)
index 3d219ef..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_74xx_7xx=y
-CONFIG_TARGET_P3G4=y
diff --git a/configs/P5040DS_SECURE_BOOT_defconfig b/configs/P5040DS_SECURE_BOOT_defconfig
new file mode 100644 (file)
index 0000000..8e21ca5
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="SECURE_BOOT"
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_P5040DS=y
diff --git a/configs/PM520_DDR_defconfig b/configs/PM520_DDR_defconfig
deleted file mode 100644 (file)
index 6d6a59d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_PM520=y
diff --git a/configs/PM520_ROMBOOT_DDR_defconfig b/configs/PM520_ROMBOOT_DDR_defconfig
deleted file mode 100644 (file)
index f5a40d9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR,BOOT_ROM"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_PM520=y
diff --git a/configs/PM520_ROMBOOT_defconfig b/configs/PM520_ROMBOOT_defconfig
deleted file mode 100644 (file)
index d9f9ea0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="BOOT_ROM"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_PM520=y
diff --git a/configs/PM520_defconfig b/configs/PM520_defconfig
deleted file mode 100644 (file)
index 2737a8c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_PM520=y
diff --git a/configs/PPChameleonEVB_BA_25_defconfig b/configs/PPChameleonEVB_BA_25_defconfig
deleted file mode 100644 (file)
index e367299..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=0,PPCHAMELEON_CLK_25"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_BA_33_defconfig b/configs/PPChameleonEVB_BA_33_defconfig
deleted file mode 100644 (file)
index f4041c9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=0,PPCHAMELEON_CLK_33"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_HI_25_defconfig b/configs/PPChameleonEVB_HI_25_defconfig
deleted file mode 100644 (file)
index a9de221..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=2,PPCHAMELEON_CLK_25"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_HI_33_defconfig b/configs/PPChameleonEVB_HI_33_defconfig
deleted file mode 100644 (file)
index 882262b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=2,PPCHAMELEON_CLK_33"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_ME_25_defconfig b/configs/PPChameleonEVB_ME_25_defconfig
deleted file mode 100644 (file)
index f9a0440..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=1,PPCHAMELEON_CLK_25"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_ME_33_defconfig b/configs/PPChameleonEVB_ME_33_defconfig
deleted file mode 100644 (file)
index 8ee09b8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="PPCHAMELEON_MODULE_MODEL=1,PPCHAMELEON_CLK_33"
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/PPChameleonEVB_defconfig b/configs/PPChameleonEVB_defconfig
deleted file mode 100644 (file)
index 2d83330..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_4xx=y
-CONFIG_TARGET_PPCHAMELEONEVB=y
diff --git a/configs/T1024QDS_defconfig b/configs/T1024QDS_defconfig
new file mode 100644 (file)
index 0000000..94a76ba
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="PPC_T1024"
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_T102XQDS=y
diff --git a/configs/T1042RDB_SECURE_BOOT_defconfig b/configs/T1042RDB_SECURE_BOOT_defconfig
new file mode 100644 (file)
index 0000000..c8dd5c2
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="PPC_T1042,SECURE_BOOT,T1042RDB"
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_T104XRDB=y
diff --git a/configs/TZX-Q8-713B7_defconfig b/configs/TZX-Q8-713B7_defconfig
new file mode 100644 (file)
index 0000000..7b7b9dd
--- /dev/null
@@ -0,0 +1,15 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER"
+CONFIG_FDTFILE="sun5i-a13-tzx-q8-713b7.dtb"
+CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB0_VBUS_PIN="PG12"
+CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="AXP0-0"
+CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN5I=y
++S:CONFIG_DRAM_CLK=408
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/Total5200_Rev2_defconfig b/configs/Total5200_Rev2_defconfig
deleted file mode 100644 (file)
index 9f27734..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="TOTAL5200_REV=2"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_TOTAL5200=y
diff --git a/configs/Total5200_Rev2_lowboot_defconfig b/configs/Total5200_Rev2_lowboot_defconfig
deleted file mode 100644 (file)
index 15b27b3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="TOTAL5200_REV=2,SYS_TEXT_BASE=0xFE000000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_TOTAL5200=y
diff --git a/configs/Total5200_defconfig b/configs/Total5200_defconfig
deleted file mode 100644 (file)
index 5aaae49..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="TOTAL5200_REV=1"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_TOTAL5200=y
diff --git a/configs/Total5200_lowboot_defconfig b/configs/Total5200_lowboot_defconfig
deleted file mode 100644 (file)
index 4c9195e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="TOTAL5200_REV=1,SYS_TEXT_BASE=0xFE000000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_TOTAL5200=y
diff --git a/configs/ZUMA_defconfig b/configs/ZUMA_defconfig
deleted file mode 100644 (file)
index 536f8bb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_74xx_7xx=y
-CONFIG_TARGET_ZUMA=y
index 5837a0a4da75bfb9750fcf416194a58977a5ee90..51bf370364a3e10981c7a874ba89417daca604d2 100644 (file)
@@ -4,3 +4,7 @@ CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT,ENABLE_VBOOT"
 +S:CONFIG_TARGET_AM335X_EVM=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index c0e8da2c12ace80ce671431e4adb23980332c3ad..076ad0fe8d9c99e592373953931b951aeef7428d 100644 (file)
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2068,BOARD_AXM"
-CONFIG_ARM=y
-CONFIG_TARGET_TAURUS=y
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_TAURUS=y
index 6ca7c57186af556755b8293dbab6640ce3a30933..400906d3779408f423517985b06ac7b950999328 100644 (file)
@@ -1,8 +1,10 @@
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_EMAC,USB_EHCI"
 CONFIG_FDTFILE="sun4i-a10-ba10-tvbox.dtb"
-CONFIG_USB1_VBUS_PIN="PH12"
+CONFIG_USB2_VBUS_PIN="PH12"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN4I=y
-+S:CONFIG_TARGET_BA10_TV_BOX=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index e956835dc6d7ef39848388d3cbbc0c08ab60b22c..2f0c714e59f779e0c5743d2ffacd4d1060591cbb 100644 (file)
@@ -6,6 +6,6 @@ CONFIG_OF_SEPARATE=y
 CONFIG_DEFAULT_DEVICE_TREE="chromebook_link"
 CONFIG_HAVE_MRC=y
 CONFIG_SMM_TSEG_SIZE=0x800000
-CONFIG_VIDEO_X86=y
+CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
diff --git a/configs/cpci5200_defconfig b/configs/cpci5200_defconfig
deleted file mode 100644 (file)
index bdbf4fc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_CPCI5200=y
index 5f5037e6982e8a095e2fe1b8e4702ed10ff7a0bb..41192fc73fee3bfa345930fa5b8dfe5fbfde489e 100644 (file)
@@ -4,4 +4,6 @@ CONFIG_FDTFILE="sun7i-a20-i12-tvbox.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_I12_TVBOX=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/icecube_5200_DDR_LOWBOOT08_defconfig b/configs/icecube_5200_DDR_LOWBOOT08_defconfig
deleted file mode 100644 (file)
index 79f8598..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF800000,MPC5200_DDR"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/icecube_5200_DDR_LOWBOOT_defconfig b/configs/icecube_5200_DDR_LOWBOOT_defconfig
deleted file mode 100644 (file)
index 79f8598..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF800000,MPC5200_DDR"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/icecube_5200_DDR_defconfig b/configs/icecube_5200_DDR_defconfig
deleted file mode 100644 (file)
index 19d9637..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/icecube_5200_LOWBOOT08_defconfig b/configs/icecube_5200_LOWBOOT08_defconfig
deleted file mode 100644 (file)
index 9f0cbd8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF800000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/icecube_5200_LOWBOOT_defconfig b/configs/icecube_5200_LOWBOOT_defconfig
deleted file mode 100644 (file)
index ff1552f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFF000000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/icecube_5200_defconfig b/configs/icecube_5200_defconfig
deleted file mode 100644 (file)
index 49fdb3b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
index 1c665aab943bda9ee911b40127dc85a561f2847e..0950ec8b77847b72ebfec4119da1be41a3d0b51e 100644 (file)
@@ -1,4 +1,7 @@
 CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFFF00000"
 CONFIG_PPC=y
 CONFIG_MPC83xx=y
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
 CONFIG_TARGET_IDS8313=y
+CONFIG_DM=y
diff --git a/configs/lite5200b_LOWBOOT_defconfig b/configs/lite5200b_LOWBOOT_defconfig
deleted file mode 100644 (file)
index 9ceb834..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR,LITE5200B,SYS_TEXT_BASE=0xFF000000"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/lite5200b_PM_defconfig b/configs/lite5200b_PM_defconfig
deleted file mode 100644 (file)
index 35b2aa3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR,LITE5200B,LITE5200B_PM"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/lite5200b_defconfig b/configs/lite5200b_defconfig
deleted file mode 100644 (file)
index c7d4030..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_SYS_EXTRA_OPTIONS="MPC5200_DDR,LITE5200B"
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_ICECUBE=y
diff --git a/configs/ls1021aqds_nor_lpuart_defconfig b/configs/ls1021aqds_nor_lpuart_defconfig
new file mode 100644 (file)
index 0000000..29335ee
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="LPUART"
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_LS1021AQDS=y
diff --git a/configs/ls1021atwr_nor_lpuart_defconfig b/configs/ls1021atwr_nor_lpuart_defconfig
new file mode 100644 (file)
index 0000000..bdab6d9
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="LPUART"
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_LS1021ATWR=y
diff --git a/configs/mecp5200_defconfig b/configs/mecp5200_defconfig
deleted file mode 100644 (file)
index a30e224..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_MECP5200=y
diff --git a/configs/mk802_a10s_defconfig b/configs/mk802_a10s_defconfig
new file mode 100644 (file)
index 0000000..cafcbaa
--- /dev/null
@@ -0,0 +1,10 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP152_POWER,USB_EHCI"
+CONFIG_FDTFILE="sun5i-a10s-mk802.dtb"
+CONFIG_USB1_VBUS_PIN="PB10"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN5I=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/mk802_defconfig b/configs/mk802_defconfig
new file mode 100644 (file)
index 0000000..d6b51a5
--- /dev/null
@@ -0,0 +1,10 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI"
+CONFIG_FDTFILE="sun4i-a10-mk802.dtb"
+CONFIG_USB2_VBUS_PIN="PH12"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/mk802ii_defconfig b/configs/mk802ii_defconfig
new file mode 100644 (file)
index 0000000..500f4df
--- /dev/null
@@ -0,0 +1,9 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,USB_EHCI"
+CONFIG_FDTFILE="sun4i-a10-mk802ii.dtb"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=360
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=0
diff --git a/configs/mpc7448hpc2_defconfig b/configs/mpc7448hpc2_defconfig
deleted file mode 100644 (file)
index f2777dc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_74xx_7xx=y
-CONFIG_TARGET_MPC7448HPC2=y
diff --git a/configs/pf5200_defconfig b/configs/pf5200_defconfig
deleted file mode 100644 (file)
index fe926a0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_MPC5xxx=y
-CONFIG_TARGET_PF5200=y
index 2e9dd00c1d8baef2c5dc0e9fcc94f11130b8211f..86b4b15724b1da02bd7019ac360f4ec2b01a0f79 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 5dca64bf88ea42472d07cd352b02a05ee2acb31c..242bcf926359cd0f962aea04f0061fb84f1ad50e 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 2a6e334506a6e84722e7fac1cab8cb424b7b0248..8e95f17e6d101a200776f35adc3400ff7506e9d9 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_LOADS=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_ECHO=y
 CONFIG_CMD_ITEST=y
@@ -34,6 +35,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_DM_SERIAL=y
 CONFIG_UNIPHIER_SERIAL=y
+CONFIG_DM_I2C=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/ppmc7xx_defconfig b/configs/ppmc7xx_defconfig
deleted file mode 100644 (file)
index feefe49..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_PPC=y
-CONFIG_74xx_7xx=y
-CONFIG_TARGET_PPMC7XX=y
diff --git a/configs/qt840a_defconfig b/configs/qt840a_defconfig
deleted file mode 100644 (file)
index 70f8159..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,MACPWR=SUNXI_GPH(21),USB_EHCI"
-CONFIG_FDTFILE="sun7i-a20-i12-tvbox.dtb"
-+S:CONFIG_ARM=y
-+S:CONFIG_ARCH_SUNXI=y
-+S:CONFIG_MACH_SUN7I=y
-+S:CONFIG_TARGET_QT840A=y
index b9fd59c16a70aafcebbe64e44218c83e65758356..e99e57d505a5fa642fabfd58b0a8baa11e5c5b2e 100644 (file)
@@ -5,4 +5,6 @@ CONFIG_USB1_VBUS_PIN="PG13"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
-+S:CONFIG_TARGET_R7DONGLE=y
++S:CONFIG_DRAM_CLK=384
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index 47d8400acece08586f535fad3b51e3872b3ed161..660063ebf333ae666ff7f1898a67d036c20909ad 100644 (file)
@@ -1,3 +1,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_OF_HOSTFILE=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
diff --git a/configs/sunxi_Gemei_G9_defconfig b/configs/sunxi_Gemei_G9_defconfig
new file mode 100644 (file)
index 0000000..a85db2a
--- /dev/null
@@ -0,0 +1,20 @@
+# Gemei G9 is an A10 based tablet, with 1G RAM, 16G NAND,
+# 1024x768 IPS LCD display, stereo speakers, 1.3MP front camera and 5 MP
+# rear camera, 8000mAh battery, GT901 2+1 touchscreen, Bosch BMA250
+# accelerometer and RTL8188CUS USB wifi. It also has MicroSD slot, MiniHDMI,
+# 1 x MicroUSB OTG port and 1 x MicroUSB host port and 3.5mm headphone jack.
+# More details are available at: http://linux-sunxi.org/Gemei_G9
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,USB_EHCI"
+CONFIG_FDTFILE="sun4i-gemei-g9.dtb"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:18,pclk_khz:100000,le:799,ri:260,up:15,lo:16,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_PANEL_LVDS=y
+CONFIG_VIDEO_LCD_POWER="PH8"
+CONFIG_VIDEO_LCD_BL_EN="PH7"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN4I=y
++S:CONFIG_DRAM_CLK=432
++S:CONFIG_DRAM_ZQ=123
++S:CONFIG_DRAM_EMR1=4
index b463a333bc6bb10cd84c040fad6ae38c98732a0f..9f4b876556137aefa8270fc0da776378b045f2a1 100644 (file)
@@ -1,3 +1,3 @@
 CONFIG_ARM=y
-CONFIG_TARGET_VEXPRESS_AEMV8A=y
+CONFIG_TARGET_VEXPRESS64_AEMV8A=y
 CONFIG_DEFAULT_DEVICE_TREE="vexpress64"
diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig
new file mode 100644 (file)
index 0000000..d28a428
--- /dev/null
@@ -0,0 +1,5 @@
+# ARM Ltd. Juno Board Reference Design
+CONFIG_ARM=y
+CONFIG_TARGET_VEXPRESS64_JUNO=y
+CONFIG_DEFAULT_DEVICE_TREE="vexpress64"
+CONFIG_SHOW_BOOT_PROGRESS=y
index 0035ccdaecd4596e557c1d38b9deaf254053577f..26cf7db47f845ab9dff99bdb30c6cb3ce568dcb9 100644 (file)
@@ -1,4 +1,4 @@
-CONFIG_SYS_EXTRA_OPTIONS="SEMIHOSTING,BASE_FVP"
+# Semihosted FVP fast model
 CONFIG_ARM=y
-CONFIG_TARGET_VEXPRESS_AEMV8A=y
+CONFIG_TARGET_VEXPRESS64_BASE_FVP=y
 CONFIG_DEFAULT_DEVICE_TREE="vexpress64"
index 9588849bb5c0f7c78694fc90a52fb46daed1286f..8b985fe5a4294b0867f5a4ef95efe3ae40d2d177 100644 (file)
@@ -3,4 +3,8 @@ CONFIG_SPL=y
 +S:CONFIG_ZYNQ=y
 +S:CONFIG_TARGET_ZYNQ_MICROZED=y
 CONFIG_OF_CONTROL=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed"
index cf507308e95d209540ad5442df87abdb01632549..cceb32199da1b6291a65cc62fb155c17ee0bcb9e 100644 (file)
@@ -4,3 +4,7 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_ZYNQ_ZC70X=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index 8bb405d1808907756610f7ebd8ade97227615ec9..2935c0dff783fac32b6c0dda91917878e94b7c96 100644 (file)
@@ -5,3 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM010"
 +S:CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm010"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index 0ba5da589e95db553b682393db5348fdcdf00ceb..0401739652fc361d75b073faa1825223a375f780 100644 (file)
@@ -5,3 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM012"
 +S:CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm012"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index 13f8112a1b627139c8fc980370759c8cd0d0f36a..a95970a917cece43f64ceca2c95f719049558ee9 100644 (file)
@@ -5,3 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM013"
 +S:CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm013"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index eb057fae35c738332163e8693997c8667376124a..0fbc41ab8a8faca00138233a2be3db17eb9eb45a 100644 (file)
@@ -4,3 +4,7 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_ZYNQ_ZED=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zed"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
index 12311cd83b5011f35ff2b69737ad24c7b1fb9f9f..4e66760750c53bb6df093674aa6c60c8c79b3dde 100644 (file)
@@ -4,3 +4,7 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_ZYNQ_ZYBO=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_DM=y
diff --git a/doc/README.distro b/doc/README.distro
new file mode 100644 (file)
index 0000000..dd0f1c7
--- /dev/null
@@ -0,0 +1,341 @@
+/*
+ * (C) Copyright 2014 Red Hat Inc.
+ * Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+Generic Distro Configuration Concept
+====================================
+
+Linux distributions are faced with supporting a variety of boot mechanisms,
+environments or bootloaders (PC BIOS, EFI, U-Boot, Barebox, ...). This makes
+life complicated. Worse, bootloaders such as U-Boot have a configurable set
+of features, and each board chooses to enable a different set of features.
+Hence, distros typically need to have board-specific knowledge in order to
+set up a bootable system.
+
+This document defines a common set of U-Boot features that are required for
+a distro to support the board in a generic fashion. Any board wishing to
+allow distros to install and boot in an out-of-the-box fashion should enable
+all these features. Linux distros can then create a single set of boot
+support/install logic that targets these features. This will allow distros
+to install on many boards without the need for board-specific logic.
+
+In fact, some of these features can be implemented by any bootloader, thus
+decoupling distro install/boot logic from any knowledge of the bootloader.
+
+This model assumes that boards will load boot configuration files from a
+regular storage mechanism (eMMC, SD card, USB Disk, SATA disk, etc.) with
+a standard partitioning scheme (MBR, GPT). Boards that cannnot support this
+storage model are outside the scope of this document, and may still need
+board-specific installer/boot-configuration support in a distro.
+
+To some extent, this model assumes that a board has a separate boot flash
+that contains U-Boot, and that the user has somehow installed U-Boot to this
+flash before running the distro installer. Even on boards that do not conform
+to this aspect of the model, the extent of the board-specific support in the
+distro installer logic would be to install a board-specific U-Boot package to
+the boot partition partition during installation. This distro-supplied U-Boot
+can still implement the same features as on any other board, and hence the
+distro's boot configuration file generation logic can still be board-agnostic.
+
+Locating Bootable Disks
+-----------------------
+
+Typical desktop/server PCs search all (or a user-defined subset of) attached
+storage devices for a bootable partition, then load the bootloader or boot
+configuration files from there. A U-Boot board port that enables the features
+mentioned in this document will search for boot configuration files in the
+same way.
+
+Thus, distros do not need to manipulate any kind of bootloader-specific
+configuration data to indicate which storage device the system should boot
+from.
+
+Distros simply need to install the boot configuration files (see next
+section) in an ext2/3/4 or FAT partition, mark the partition bootable (via
+the MBR bootable flag, or GPT legacy_bios_bootable attribute), and U-Boot (or
+any other bootloader) will find those boot files and execute them. This is
+conceptually identical to creating a grub2 configuration file on a desktop
+PC.
+
+Note that in the absense of any partition that is explicitly marked bootable,
+U-Boot falls back to searching the first valid partition of a disk for boot
+configuration files. Other bootloaders are recommended to do the same, since
+I believe that partition table bootable flags aren't so commonly used outside
+the realm of x86 PCs.
+
+U-Boot can also search for boot configuration files from a TFTP server.
+
+Boot Configuration Files
+------------------------
+
+The standard format for boot configuration files is that of extlinux.conf, as
+handled by U-Boot's "syslinux" (disk) or "pxe boot" (network). This is roughly
+as specified at:
+
+http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/
+
+... with the exceptions that the BootLoaderSpec document:
+
+* Prescribes a separate configuration per boot menu option, whereas U-Boot
+  lumps all options into a single extlinux.conf file. Hence, U-Boot searches
+  for /extlinux/extlinux.conf then /boot/extlinux/extlinux.conf on disk, or
+  pxelinux.cfg/default over the network.
+
+* Does not document the fdtdir option, which automatically selects the DTB to
+  pass to the kernel.
+
+One example extlinux.conf generated by the Fedora installer is:
+
+------------------------------------------------------------
+# extlinux.conf generated by anaconda
+
+ui menu.c32
+
+menu autoboot Welcome to Fedora. Automatic boot in # second{,s}. Press a key for options.
+menu title Fedora Boot Options.
+menu hidden
+
+timeout 50
+#totaltimeout 9000
+
+default Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae) 22 (Rawhide)
+
+label Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl) 22 (Rawhide)
+       kernel /boot/vmlinuz-3.17.0-0.rc4.git2.1.fc22.armv7hl
+       append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8 LANG=en_US.UTF-8 drm.debug=0xf
+       fdtdir /boot/dtb-3.17.0-0.rc4.git2.1.fc22.armv7hl
+       initrd /boot/initramfs-3.17.0-0.rc4.git2.1.fc22.armv7hl.img
+
+label Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae) 22 (Rawhide)
+       kernel /boot/vmlinuz-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae
+       append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8 LANG=en_US.UTF-8 drm.debug=0xf
+       fdtdir /boot/dtb-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae
+       initrd /boot/initramfs-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae.img
+
+label Fedora-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc (0-rescue-8f6ba7b039524e0eb957d2c9203f04bc)
+       kernel /boot/vmlinuz-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc
+       initrd /boot/initramfs-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc.img
+       append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8
+       fdtdir /boot/dtb-3.16.0-0.rc6.git1.1.fc22.armv7hl+lpae
+------------------------------------------------------------
+
+Another hand-crafted network boot configuration file is:
+
+------------------------------------------------------------
+TIMEOUT 100
+
+MENU TITLE TFTP boot options
+
+LABEL jetson-tk1-emmc
+        MENU LABEL ../zImage root on Jetson TK1 eMMC
+        LINUX ../zImage
+        FDTDIR ../
+        APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=80a5a8e9-c744-491a-93c1-4f4194fd690b
+
+LABEL venice2-emmc
+        MENU LABEL ../zImage root on Venice2 eMMC
+        LINUX ../zImage
+        FDTDIR ../
+        APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=5f71e06f-be08-48ed-b1ef-ee4800cc860f
+
+LABEL sdcard
+        MENU LABEL ../zImage, root on 2GB sdcard
+        LINUX ../zImage
+        FDTDIR ../
+        APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=b2f82cda-2535-4779-b467-094a210fbae7
+
+LABEL fedora-installer-fk
+        MENU LABEL Fedora installer w/ Fedora kernel
+        LINUX fedora-installer/vmlinuz
+        INITRD fedora-installer/initrd.img.orig
+        FDTDIR fedora-installer/dtb
+        APPEND loglevel=8 ip=dhcp inst.repo=http://10.0.0.2/mirrors/fedora/linux/development/rawhide/armhfp/os/ rd.shell cma=64M
+------------------------------------------------------------
+
+U-Boot Implementation
+=====================
+
+Enabling the distro options
+---------------------------
+
+In your board configuration file, include the following:
+
+------------------------------------------------------------
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#include <config_distro_bootcmd.h>
+#endif
+------------------------------------------------------------
+
+The first of those headers primarily enables a core set of U-Boot features,
+such as support for MBR and GPT partitions, ext* and FAT filesystems, booting
+raw zImage and initrd (rather than FIT- or uImage-wrapped files), etc. Network
+boot support is also enabled here, which is useful in order to boot distro
+installers given that distros do not commonly distribute bootable install
+media for non-PC targets at present.
+
+Finally, a few options that are mostly relevant only when using U-Boot-
+specific boot.scr scripts are enabled. This enables distros to generate a
+U-Boot-specific boot.scr script rather than extlinux.conf as the boot
+configuration file. While doing so is fully supported, and
+<config_distro_defaults.h> exposes enough parameterization to boot.scr to
+allow for board-agnostic boot.scr content, this document recommends that
+distros generate extlinux.conf rather than boot.scr. extlinux.conf is intended
+to work across multiple bootloaders, whereas boot.scr will only work with
+U-Boot. TODO: document the contract between U-Boot and boot.scr re: which
+environment variables a generic boot.scr may rely upon.
+
+The second of those headers sets up the default environment so that $bootcmd
+is defined in a way that searches attached disks for boot configuration files,
+and executes them if found.
+
+Required Environment Variables
+------------------------------
+
+The U-Boot "syslinux" and "pxe boot" commands require a number of environment
+variables be set. Default values for these variables are often hard-coded into
+CONFIG_EXTRA_ENV_SETTINGS in the board's U-Boot configuration file, so that
+the user doesn't have to configure them.
+
+fdt_addr:
+
+  Mandatory for any system that provides the DTB in HW (e.g. ROM) and wishes
+  to pass that DTB to Linux, rather than loading a DTB from the boot
+  filesystem. Prohibited for any other system.
+
+  If specified a DTB to boot the system must be available at the given
+  address.
+
+fdt_addr_r:
+
+  Mandatory. The location in RAM where the DTB will be loaded or copied to when
+  processing the fdtdir/devicetreedir or fdt/devicetree options in
+  extlinux.conf.
+
+  This is mandatory even when fdt_addr is provided, since extlinux.conf must
+  always be able to provide a DTB which overrides any copy provided by the HW.
+
+  A size of 1MB for the FDT/DTB seems reasonable.
+
+ramdisk_addr_r:
+
+  Mandatory. The location in RAM where the initial ramdisk will be loaded to
+  when processing the initrd option in extlinux.conf.
+
+  It is recommended that this location be highest in RAM out of fdt_addr_,
+  kernel_addr_r, and ramdisk_addr_r, so that the RAM disk can vary in size
+  and use any available RAM.
+
+kernel_addr_r:
+
+  Mandatory. The location in RAM where the kernel will be loaded to when
+  processing the kernel option in the extlinux.conf.
+
+  The kernel should be located within the first 128M of RAM in order for the
+  kernel CONFIG_AUTO_ZRELADDR option to work, which is likely enabled on any
+  distro kernel. Since the kernel will decompress itself to 0x8000 after the
+  start of RAM, kernel_addr_rshould not overlap that area, or the kernel will
+  have to copy itself somewhere else first before decompression.
+
+  A size of 16MB for the kernel is likely adequate.
+
+pxe_addr_r:
+
+  Mandatory. The location in RAM where extlinux.conf will be loaded to prior
+  to processing.
+
+  A size of 1MB for extlinux.conf is more than adequate.
+
+scriptaddr:
+
+  Mandatory, if the boot script is boot.scr rather than extlinux.conf. The
+  location in RAM where boot.scr will be loaded to prior to execution.
+
+  A size of 1MB for extlinux.conf is more than adequate.
+
+For suggestions on memory locations for ARM systems, you must follow the
+guidelines specified in Documentation/arm/Booting in the Linux kernel tree.
+
+For a commented example of setting these values, please see the definition of
+MEM_LAYOUT_ENV_SETTINGS in include/configs/tegra124-common.h.
+
+Boot Target Configuration
+-------------------------
+
+<config_distro_bootcmd.h> defines $bootcmd and many helper command variables
+that automatically search attached disks for boot configuration files and
+execute them. Boards must provide configure <config_distro_bootcmd.h> so that
+it supports the correct set of possible boot device types. To provide this
+configuration, simply define macro BOOT_TARGET_DEVICES prior to including
+<config_distro_bootcmd.h>. For example:
+
+------------------------------------------------------------
+#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_DEVICES(func) \
+        func(MMC, mmc, 1) \
+        func(MMC, mmc, 0) \
+        func(USB, usb, 0) \
+        func(PXE, pxe, na) \
+        func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+#endif
+------------------------------------------------------------
+
+Each entry in the macro defines a single boot device (e.g. a specific eMMC
+device or SD card) or type of boot device (e.g. USB disk). The parameters to
+the func macro (passed in by the internal implementation of the header) are:
+
+- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE).
+- Lower-case disk type (same options as above).
+- ID of the specific disk (MMC only) or ignored for other types.
+
+User Configuration
+==================
+
+Once the user has installed U-Boot, it is expected that the environment will
+be reset to the default values in order to enable $bootcmd and friends, as set
+up by <config_distro_bootcmd.h>. After this, various environment variables may
+be altered to influence the boot process:
+
+boot_targets:
+
+  The list of boot locations searched.
+
+  Example: mmc0, mmc1, usb, pxe
+
+  Entries may be removed or re-ordered in this list to affect the boot order.
+
+boot_prefixes:
+
+  For disk-based booting, the list of directories within a partition that are
+  searched for boot configuration files (extlinux.conf, boot.scr).
+
+  Example: / /boot/
+
+  Entries may be removed or re-ordered in this list to affect the set of
+  directories which are searched.
+
+boot_scripts:
+
+  The name of U-Boot style boot.scr files that $bootcmd searches for.
+
+  Example: boot.scr.uimg boot.scr
+
+  (Typically we expect extlinux.conf to be used, but execution of boot.scr is
+  maintained for backwards-compatibility.)
+
+  Entries may be removed or re-ordered in this list to affect the set of
+  filenames which are supported.
+
+scan_dev_for_extlinux:
+
+  If you want to disable extlinux.conf on all disks, set the value to something
+  innocuous, e.g. setenv scan_dev_for_extlinux true.
+
+scan_dev_for_scripts:
+
+  If you want to disable boot.scr on all disks, set the value to something
+  innocuous, e.g. setenv scan_dev_for_scripts true.
index e29188f1ec0cd4dd97a38ddb4bb7ed85645f83fe..dee0e00a61708825f347104a4acf9a8d4de9bb9c 100644 (file)
@@ -304,6 +304,11 @@ Platform specific options
                Thus BCH16 can be supported on 4K page NAND.
 
 
+    CONFIG_NAND_OMAP_GPMC_PREFETCH
+       On OMAP platforms that use the GPMC controller
+       (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
+       uses the prefetch mode to speed up read operations.
+
 NOTE:
 =====
 
index e1a81d3fd3da152e300d021a23078c752ae4dc16..952ab871c298f8484fddfa63039128dc1335a938 100644 (file)
@@ -12,6 +12,28 @@ The list should be sorted in reverse chronological order.
 
 Board            Arch        CPU            Commit      Removed     Last known maintainer/contact
 =================================================================================================
+icecube_5200     powerpc     mpc5xxx        -           -           Wolfgang Denk <wd@denx.de>
+Lite5200         powerpc     mpc5xxx        -           -
+cpci5200         powerpc     mpc5xxx        -           -           Reinhard Arlt <reinhard.arlt@esd-electronics.com>
+mecp5200         powerpc     mpc5xxx        -           -           Reinhard Arlt <reinhard.arlt@esd-electronics.com>
+pf5200           powerpc     mpc5xxx        -           -           Reinhard Arlt <reinhard.arlt@esd-electronics.com>
+PM520            powerpc     mpc5xxx        -           -           Josef Wagner <Wagner@Microsys.de>
+Total5200        powerpc     mpc5xxx        -           -
+CATcenter        powerpc     ppc4xx         -           -
+PPChameleonEVB   powerpc     ppc4xx         -           -           Andrea "llandre" Marson <andrea.marson@dave-tech.it>
+P2020DS          powerpc     mpc85xx        -           -
+P2020COME        powerpc     mpc85xx        -           -           Ira W. Snyder <iws@ovro.caltech.edu>
+P2020RDB         powerpc     mpc85xx        -           -           Poonam Aggrwal <poonam.aggrwal@freescale.com>
+P2010RDB         powerpc     mpc85xx        -           -
+P1020RDB         powerpc     mpc85xx        -           -
+P1011RDB         powerpc     mpc85xx        -           -
+MPC8360EMDS      powerpc     mpc83xx        -           -           Dave Liu <daveliu@freescale.com>
+MPC8360ERDK      powerpc     mpc83xx        -           -           Anton Vorontsov <avorontsov@ru.mvista.com>
+P3G4             powerpc     74xx_7xx       d928664f    2015-01-16  Wolfgang Denk <wd@denx.de>
+ZUMA             powerpc     74xx_7xx       d928664f    2015-01-16  Nye Liu <nyet@zumanetworks.com>
+ppmc7xx          powerpc     74xx_7xx       d928664f    2015-01-16
+ELPPC            powerpc     74xx_7xx       d928664f    2015-01-16
+mpc7448hpc2      powerpc     74xx_7xx       d928664f    2015-01-16  Roy Zang <tie-fei.zang@freescale.com>
 CPCI405          ppc4xx      405gp          5f1459dc    2015-01-13  Matthias Fuchs <matthias.fuchs@esd.eu>
 CPCI405DT        ppc4xx      405gpr         5f1459dc    2015-01-13  Matthias Fuchs <matthias.fuchs@esd.eu>
 CPCI405AB        ppc4xx      405gpr         5f1459dc    2015-01-13  Matthias Fuchs <matthias.fuchs@esd.eu>
index e3000efcc62177962809e7972ecba8fece4aefe2..659a12f6cb70b05cccf1110bddd365cdf31363e8 100644 (file)
@@ -5,18 +5,18 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
    table is allocated and initialized in the jumptable_init() routine
    (common/exports.c). Other routines may also modify the jump table,
    however. The jump table can be accessed as the 'jt' field of the
-   'global_data' structure. The slot numbers for the jump table are
+   'global_data' structure. The struct members for the jump table are
    defined in the <include/exports.h> header. E.g., to substitute the
    malloc() and free() functions that will be available to standalone
    applications, one should do the following:
 
        DECLARE_GLOBAL_DATA_PTR;
 
-       gd->jt[XF_malloc]       = my_malloc;
-       gd->jt[XF_free]         = my_free;
+       gd->jt->malloc  = my_malloc;
+       gd->jt->free = my_free;
 
-   Note that the pointers to the functions all have 'void *' type and
-   thus the compiler cannot perform type checks on these assignments.
+   Note that the pointers to the functions are real function pointers
+   so the compiler can perform type checks on these assignments.
 
 2. The pointer to the jump table is passed to the application in a
    machine-dependent way. PowerPC, ARM, MIPS, Blackfin and Nios II
@@ -65,27 +65,46 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
    => tftp 0x40000 hello_world.bin
    => go 0x40004
 
-5. To export some additional function foobar(), the following steps
+5. To export some additional function long foobar(int i,char c), the following steps
    should be undertaken:
 
    - Append the following line at the end of the include/_exports.h
      file:
 
-       EXPORT_FUNC(foobar)
+       EXPORT_FUNC(foobar, long, foobar, int, char)
+
+       Parameters to EXPORT_FUNC:
+        - the first parameter is the function that is exported (default implementation)
+        - the second parameter is the return value type
+        - the third  parameter is the name of the member in struct jt_funcs
+          this is also the name that the standalone application will used.
+          the rest of the parameters are the function arguments
 
    - Add the prototype for this function to the include/exports.h
      file:
 
-       void foobar(void);
+       long foobar(int i, char c);
+
+       Initialization with the default implementation is done in jumptable_init()
+
+       You can override the default implementation using:
 
-   - Add the initialization of the jump table slot wherever
-     appropriate (most likely, to the jumptable_init() function):
+       gd->jt->foobar = another_foobar;
 
-       gd->jt[XF_foobar] = foobar;
+       The signature of another_foobar must then match the declaration of foobar.
 
    - Increase the XF_VERSION value by one in the include/exports.h
      file
 
+   - If you want to export a function which depends on a CONFIG_XXX
+       use 2 lines like this:
+       #ifdef CONFIG_FOOBAR
+               EXPORT_FUNC(foobar, long, foobar, int, char)
+       #else
+               EXPORT_FUNC(dummy, void, foobar, void)
+       #endif
+
+
 6. The code for exporting the U-Boot functions to applications is
    mostly machine-independent. The only places written in assembly
    language are stub functions that perform the jump through the jump
diff --git a/doc/README.t1040-l2switch b/doc/README.t1040-l2switch
new file mode 100644 (file)
index 0000000..14dbf31
--- /dev/null
@@ -0,0 +1,48 @@
+This file contains information for VSC9953, a Vitesse L2 Switch IP
+which is integrated in the T1040/T1020 Freescale SoCs.
+
+About Device:
+=============
+VSC9953 is an 8-port Gigabit Ethernet switch supports the following features:
+       -       8192 MAC addresses
+       -       Static Address provisioning
+       -       Dynamic learning of MAC addresses and aging
+       -       4096 VLANs
+       -       Independent and shared VLAN learning (IVL, SVL)
+       -       Policing with storm control and MC/BC protection
+       -       IPv4 and IPv6 multicast
+       -       Jumbo frames (9.6 KB)
+       -       Access Control List
+       -       VLAN editing, translation and remarking
+       -       RMON counters per port
+
+Switch interfaces:
+       -       8 Gigabit switch ports (ports 0 to 7) are external and are connected to external PHYs
+       -       2 switch ports (ports 8 and 9) of 2.5 G are connected (fixed links)
+               to FMan ports (FM1@DTSEC1 and FM1@DTSEC2)
+
+Commands Overview:
+=============
+Commands supported
+       - enable/disable a port
+       - check a port's link speed, duplexity and status.
+
+Commands syntax
+       ethsw port <port_nr> enable|disable             - enable/disable an l2 switch port
+       ethsw port <port_nr> show                       - show an l2 switch port's configuration
+
+       port_nr=0..9; use "all" for all ports
+
+=> ethsw port all show
+    Port   Status     Link    Speed   Duplex
+       0  enabled     down       10     half
+       1  enabled     down       10     half
+       2  enabled     down       10     half
+       3  enabled       up     1000     full
+       4 disabled     down        -     half
+       5 disabled     down        -     half
+       6 disabled     down        -     half
+       7 disabled     down        -     half
+       8  enabled       up     2500     full
+       9  enabled       up     2500     full
+=>
diff --git a/doc/device-tree-bindings/gpio/gpio-samsung.txt b/doc/device-tree-bindings/gpio/gpio-samsung.txt
new file mode 100644 (file)
index 0000000..5375625
--- /dev/null
@@ -0,0 +1,41 @@
+Samsung Exynos4 GPIO Controller
+
+Required properties:
+- compatible: Compatible property value should be "samsung,exynos4-gpio>".
+
+- reg: Physical base address of the controller and length of memory mapped
+  region.
+
+- #gpio-cells: Should be 4. The syntax of the gpio specifier used by client nodes
+  should be the following with values derived from the SoC user manual.
+     <[phandle of the gpio controller node]
+      [pin number within the gpio controller]
+      [mux function]
+      [flags and pull up/down]
+      [drive strength]>
+
+  Values for gpio specifier:
+  - Pin number: is a value between 0 to 7.
+  - Flags and Pull Up/Down: 0 - Pull Up/Down Disabled.
+                            1 - Pull Down Enabled.
+                            3 - Pull Up Enabled.
+          Bit 16 (0x00010000) - Input is active low.
+  - Drive Strength: 0 - 1x,
+                    1 - 3x,
+                    2 - 2x,
+                    3 - 4x
+
+- gpio-controller: Specifies that the node is a gpio controller.
+- #address-cells: should be 1.
+- #size-cells: should be 1.
+
+Example:
+
+       gpa0: gpio-controller@11400000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "samsung,exynos4-gpio";
+               reg = <0x11400000 0x20>;
+               #gpio-cells = <4>;
+               gpio-controller;
+       };
diff --git a/doc/device-tree-bindings/gpio/gpio.txt b/doc/device-tree-bindings/gpio/gpio.txt
new file mode 100644 (file)
index 0000000..b9bd1d6
--- /dev/null
@@ -0,0 +1,211 @@
+Specifying GPIO information for devices
+============================================
+
+1) gpios property
+-----------------
+
+Nodes that makes use of GPIOs should specify them using one or more
+properties, each containing a 'gpio-list':
+
+       gpio-list ::= <single-gpio> [gpio-list]
+       single-gpio ::= <gpio-phandle> <gpio-specifier>
+       gpio-phandle : phandle to gpio controller node
+       gpio-specifier : Array of #gpio-cells specifying specific gpio
+                        (controller specific)
+
+GPIO properties should be named "[<name>-]gpios", with <name> being the purpose
+of this GPIO for the device. While a non-existent <name> is considered valid
+for compatibility reasons (resolving to the "gpios" property), it is not allowed
+for new bindings.
+
+GPIO properties can contain one or more GPIO phandles, but only in exceptional
+cases should they contain more than one. If your device uses several GPIOs with
+distinct functions, reference each of them under its own property, giving it a
+meaningful name. The only case where an array of GPIOs is accepted is when
+several GPIOs serve the same function (e.g. a parallel data line).
+
+The exact purpose of each gpios property must be documented in the device tree
+binding of the device.
+
+The following example could be used to describe GPIO pins used as device enable
+and bit-banged data signals:
+
+       gpio1: gpio1 {
+               gpio-controller
+                #gpio-cells = <2>;
+       };
+       gpio2: gpio2 {
+               gpio-controller
+                #gpio-cells = <1>;
+       };
+       [...]
+
+       enable-gpios = <&gpio2 2>;
+       data-gpios = <&gpio1 12 0>,
+                    <&gpio1 13 0>,
+                    <&gpio1 14 0>,
+                    <&gpio1 15 0>;
+
+Note that gpio-specifier length is controller dependent.  In the
+above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2
+only uses one.
+
+gpio-specifier may encode: bank, pin position inside the bank,
+whether pin is open-drain and whether pin is logically inverted.
+Exact meaning of each specifier cell is controller specific, and must
+be documented in the device tree binding for the device. Use the macros
+defined in include/dt-bindings/gpio/gpio.h whenever possible:
+
+Example of a node using GPIOs:
+
+       node {
+               enable-gpios = <&qe_pio_e 18 GPIO_ACTIVE_HIGH>;
+       };
+
+GPIO_ACTIVE_HIGH is 0, so in this example gpio-specifier is "18 0" and encodes
+GPIO pin number, and GPIO flags as accepted by the "qe_pio_e" gpio-controller.
+
+1.1) GPIO specifier best practices
+----------------------------------
+
+A gpio-specifier should contain a flag indicating the GPIO polarity; active-
+high or active-low. If it does, the follow best practices should be followed:
+
+The gpio-specifier's polarity flag should represent the physical level at the
+GPIO controller that achieves (or represents, for inputs) a logically asserted
+value at the device. The exact definition of logically asserted should be
+defined by the binding for the device. If the board inverts the signal between
+the GPIO controller and the device, then the gpio-specifier will represent the
+opposite physical level than the signal at the device's pin.
+
+When the device's signal polarity is configurable, the binding for the
+device must either:
+
+a) Define a single static polarity for the signal, with the expectation that
+any software using that binding would statically program the device to use
+that signal polarity.
+
+The static choice of polarity may be either:
+
+a1) (Preferred) Dictated by a binding-specific DT property.
+
+or:
+
+a2) Defined statically by the DT binding itself.
+
+In particular, the polarity cannot be derived from the gpio-specifier, since
+that would prevent the DT from separately representing the two orthogonal
+concepts of configurable signal polarity in the device, and possible board-
+level signal inversion.
+
+or:
+
+b) Pick a single option for device signal polarity, and document this choice
+in the binding. The gpio-specifier should represent the polarity of the signal
+(at the GPIO controller) assuming that the device is configured for this
+particular signal polarity choice. If software chooses to program the device
+to generate or receive a signal of the opposite polarity, software will be
+responsible for correctly interpreting (inverting) the GPIO signal at the GPIO
+controller.
+
+2) gpio-controller nodes
+------------------------
+
+Every GPIO controller node must contain both an empty "gpio-controller"
+property, and a #gpio-cells integer property, which indicates the number of
+cells in a gpio-specifier.
+
+Example of two SOC GPIO banks defined as gpio-controller nodes:
+
+       qe_pio_a: gpio-controller@1400 {
+               compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
+               reg = <0x1400 0x18>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+       qe_pio_e: gpio-controller@1460 {
+               compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
+               reg = <0x1460 0x18>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+2.1) gpio- and pin-controller interaction
+-----------------------------------------
+
+Some or all of the GPIOs provided by a GPIO controller may be routed to pins
+on the package via a pin controller. This allows muxing those pins between
+GPIO and other functions.
+
+It is useful to represent which GPIOs correspond to which pins on which pin
+controllers. The gpio-ranges property described below represents this, and
+contains information structures as follows:
+
+       gpio-range-list ::= <single-gpio-range> [gpio-range-list]
+       single-gpio-range ::= <numeric-gpio-range> | <named-gpio-range>
+       numeric-gpio-range ::=
+                       <pinctrl-phandle> <gpio-base> <pinctrl-base> <count>
+       named-gpio-range ::= <pinctrl-phandle> <gpio-base> '<0 0>'
+       gpio-phandle : phandle to pin controller node.
+       gpio-base : Base GPIO ID in the GPIO controller
+       pinctrl-base : Base pinctrl pin ID in the pin controller
+       count : The number of GPIOs/pins in this range
+
+The "pin controller node" mentioned above must conform to the bindings
+described in ../pinctrl/pinctrl-bindings.txt.
+
+In case named gpio ranges are used (ranges with both <pinctrl-base> and
+<count> set to 0), the property gpio-ranges-group-names contains one string
+for every single-gpio-range in gpio-ranges:
+       gpiorange-names-list ::= <gpiorange-name> [gpiorange-names-list]
+       gpiorange-name : Name of the pingroup associated to the GPIO range in
+                       the respective pin controller.
+
+Elements of gpiorange-names-list corresponding to numeric ranges contain
+the empty string. Elements of gpiorange-names-list corresponding to named
+ranges contain the name of a pin group defined in the respective pin
+controller. The number of pins/GPIOs in the range is the number of pins in
+that pin group.
+
+Previous versions of this binding required all pin controller nodes that
+were referenced by any gpio-ranges property to contain a property named
+#gpio-range-cells with value <3>. This requirement is now deprecated.
+However, that property may still exist in older device trees for
+compatibility reasons, and would still be required even in new device
+trees that need to be compatible with older software.
+
+Example 1:
+
+       qe_pio_e: gpio-controller@1460 {
+               #gpio-cells = <2>;
+               compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
+               reg = <0x1460 0x18>;
+               gpio-controller;
+               gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>;
+       };
+
+Here, a single GPIO controller has GPIOs 0..9 routed to pin controller
+pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's
+pins 50..59.
+
+Example 2:
+
+       gpio_pio_i: gpio-controller@14B0 {
+               #gpio-cells = <2>;
+               compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
+               reg = <0x1480 0x18>;
+               gpio-controller;
+               gpio-ranges =                   <&pinctrl1 0 20 10>,
+                                               <&pinctrl2 10 0 0>,
+                                               <&pinctrl1 15 0 10>,
+                                               <&pinctrl2 25 0 0>;
+               gpio-ranges-group-names =       "",
+                                               "foo",
+                                               "",
+                                               "bar";
+       };
+
+Here, three GPIO ranges are defined wrt. two pin controllers. pinctrl1 GPIO
+ranges are defined using pin numbers whereas the GPIO ranges wrt. pinctrl2
+are named "foo" and "bar".
diff --git a/doc/device-tree-bindings/gpio/nvidia,tegra20-gpio.txt b/doc/device-tree-bindings/gpio/nvidia,tegra20-gpio.txt
new file mode 100644 (file)
index 0000000..023c952
--- /dev/null
@@ -0,0 +1,40 @@
+NVIDIA Tegra GPIO controller
+
+Required properties:
+- compatible : "nvidia,tegra<chip>-gpio"
+- reg : Physical base address and length of the controller's registers.
+- interrupts : The interrupt outputs from the controller. For Tegra20,
+  there should be 7 interrupts specified, and for Tegra30, there should
+  be 8 interrupts specified.
+- #gpio-cells : Should be two. The first cell is the pin number and the
+  second cell is used to specify optional parameters:
+  - bit 0 specifies polarity (0 for normal, 1 for inverted)
+- gpio-controller : Marks the device node as a GPIO controller.
+- #interrupt-cells : Should be 2.
+  The first cell is the GPIO number.
+  The second cell is used to specify flags:
+    bits[3:0] trigger type and level flags:
+      1 = low-to-high edge triggered.
+      2 = high-to-low edge triggered.
+      4 = active high level-sensitive.
+      8 = active low level-sensitive.
+      Valid combinations are 1, 2, 3, 4, 8.
+- interrupt-controller : Marks the device node as an interrupt controller.
+
+Example:
+
+gpio: gpio@6000d000 {
+       compatible = "nvidia,tegra20-gpio";
+       reg = < 0x6000d000 0x1000 >;
+       interrupts = < 0 32 0x04
+                      0 33 0x04
+                      0 34 0x04
+                      0 35 0x04
+                      0 55 0x04
+                      0 87 0x04
+                      0 89 0x04 >;
+       #gpio-cells = <2>;
+       gpio-controller;
+       #interrupt-cells = <2>;
+       interrupt-controller;
+};
diff --git a/doc/device-tree-bindings/i2c/i2c.txt b/doc/device-tree-bindings/i2c/i2c.txt
new file mode 100644 (file)
index 0000000..ea918dd
--- /dev/null
@@ -0,0 +1,28 @@
+U-Boot I2C
+----------
+
+U-Boot's I2C model has the concept of an offset within a chip (I2C target
+device). The offset can be up to 4 bytes long, but is normally 1 byte,
+meaning that offsets from 0 to 255 are supported by the chip. This often
+corresponds to register numbers.
+
+Apart from the controller-specific I2C bindings, U-Boot supports a special
+property which allows the chip offset length to be selected.
+
+Optional properties:
+- u-boot,i2c-offset-len - length of chip offset in bytes. If omitted the
+    default value of 1 is used.
+
+
+Example
+-------
+
+i2c4: i2c@12ca0000 {
+       cros-ec@1e {
+               reg = <0x1e>;
+               compatible = "google,cros-ec";
+               i2c-max-frequency = <100000>;
+               u-boot,i2c-offset-len = <0>;
+               ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
+       };
+};
index eafa825ab44a00969f27dd805a4a504b59b74720..f83264d615da5390d34ed52b0a2394f6d2a6fcf6 100644 (file)
@@ -363,6 +363,10 @@ can leave out platdata_auto_alloc_size. In this case you can use malloc
 in your ofdata_to_platdata (or probe) method to allocate the required memory,
 and you should free it in the remove method.
 
+The driver model tree is intended to mirror that of the device tree. The
+root driver is at device tree offset 0 (the root node, '/'), and its
+children are the children of the root node.
+
 
 Declaring Uclasses
 ------------------
@@ -384,12 +388,12 @@ Device Sequence Numbers
 U-Boot numbers devices from 0 in many situations, such as in the command
 line for I2C and SPI buses, and the device names for serial ports (serial0,
 serial1, ...). Driver model supports this numbering and permits devices
-to be locating by their 'sequence'. This numbering unique identifies a
+to be locating by their 'sequence'. This numbering uniquely identifies a
 device in its uclass, so no two devices within a particular uclass can have
 the same sequence number.
 
 Sequence numbers start from 0 but gaps are permitted. For example, a board
-may have I2C buses 0, 1, 4, 5 but no 2 or 3. The choice of how devices are
+may have I2C buses 1, 4, 5 but no 0, 2 or 3. The choice of how devices are
 numbered is up to a particular board, and may be set by the SoC in some
 cases. While it might be tempting to automatically renumber the devices
 where there are gaps in the sequence, this can lead to confusion and is
@@ -399,7 +403,7 @@ Each device can request a sequence number. If none is required then the
 device will be automatically allocated the next available sequence number.
 
 To specify the sequence number in the device tree an alias is typically
-used.
+used. Make sure that the uclass has the DM_UC_FLAG_SEQ_ALIAS flag set.
 
 aliases {
        serial2 = "/serial@22230000";
@@ -409,43 +413,18 @@ This indicates that in the uclass called "serial", the named node
 ("/serial@22230000") will be given sequence number 2. Any command or driver
 which requests serial device 2 will obtain this device.
 
-Some devices represent buses where the devices on the bus are numbered or
-addressed. For example, SPI typically numbers its slaves from 0, and I2C
-uses a 7-bit address. In these cases the 'reg' property of the subnode is
-used, for example:
-
-{
-       aliases {
-               spi2 = "/spi@22300000";
-       };
-
-       spi@22300000 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               spi-flash@0 {
-                       reg = <0>;
-                       ...
-               }
-               eeprom@1 {
-                       reg = <1>;
-               };
-       };
-
-In this case we have a SPI bus with two slaves at 0 and 1. The SPI bus
-itself is numbered 2. So we might access the SPI flash with:
-
-       sf probe 2:0
+More commonly you can use node references, which expand to the full path:
 
-and the eeprom with
-
-       sspi 2:1 32 ef
-
-These commands simply need to look up the 2nd device in the SPI uclass to
-find the right SPI bus. Then, they look at the children of that bus for the
-right sequence number (0 or 1 in this case).
+aliases {
+       serial2 = &serial_2;
+};
+...
+serial_2: serial@22230000 {
+...
+};
 
-Typically the alias method is used for top-level nodes and the 'reg' method
-is used only for buses.
+The alias resolves to the same string in this case, but this version is
+easier to read.
 
 Device sequence numbers are resolved when a device is probed. Before then
 the sequence number is only a request which may or may not be honoured,
@@ -462,11 +441,18 @@ access to other devices. Example of buses include SPI and I2C. Typically
 the bus provides some sort of transport or translation that makes it
 possible to talk to the devices on the bus.
 
-Driver model provides a few useful features to help with implementing
-buses. Firstly, a bus can request that its children store some 'parent
-data' which can be used to keep track of child state. Secondly, the bus can
-define methods which are called when a child is probed or removed. This is
-similar to the methods the uclass driver provides.
+Driver model provides some useful features to help with implementing buses.
+Firstly, a bus can request that its children store some 'parent data' which
+can be used to keep track of child state. Secondly, the bus can define
+methods which are called when a child is probed or removed. This is similar
+to the methods the uclass driver provides. Thirdly, per-child platform data
+can be provided to specify things like the child's address on the bus. This
+persists across child probe()/remove() cycles.
+
+For consistency and ease of implementation, the bus uclass can specify the
+per-child platform data, so that it can be the same for all children of buses
+in that uclass. There are also uclass methods which can be called when
+children are bound and probed.
 
 Here an explanation of how a bus fits with a uclass may be useful. Consider
 a USB bus with several devices attached to it, each from a different (made
@@ -481,15 +467,23 @@ Each of the devices is connected to a different address on the USB bus.
 The bus device wants to store this address and some other information such
 as the bus speed for each device.
 
-To achieve this, the bus device can use dev->parent_priv in each of its
-three children. This can be auto-allocated if the bus driver has a non-zero
-value for per_child_auto_alloc_size. If not, then the bus device can
-allocate the space itself before the child device is probed.
+To achieve this, the bus device can use dev->parent_platdata in each of its
+three children. This can be auto-allocated if the bus driver (or bus uclass)
+has a non-zero value for per_child_platdata_auto_alloc_size. If not, then
+the bus device or uclass can allocate the space itself before the child
+device is probed.
 
 Also the bus driver can define the child_pre_probe() and child_post_remove()
 methods to allow it to do some processing before the child is activated or
 after it is deactivated.
 
+Similarly the bus uclass can define the child_post_bind() method to obtain
+the per-child platform data from the device tree and set it up for the child.
+The bus uclass can also provide a child_pre_probe() method. Very often it is
+the bus uclass that controls these features, since it avoids each driver
+having to do the same processing. Of course the driver can still tweak and
+override these activities.
+
 Note that the information that controls this behaviour is in the bus's
 driver, not the child's. In fact it is possible that child has no knowledge
 that it is connected to a bus. The same child device may even be used on two
@@ -516,7 +510,8 @@ bus device, regardless of its own views on the matter.
 The uclass for the device can also contain data private to that uclass.
 But note that each device on the bus may be a memeber of a different
 uclass, and this data has nothing to do with the child data for each child
-on the bus.
+on the bus. It is the bus' uclass that controls the child with respect to
+the bus.
 
 
 Driver Lifecycle
index 719dbd5cdd24e9156769d9be6c1adf747d623964..5bc29ad65ce145b7dbea4fb7fbd4928e8b7395e6 100644 (file)
@@ -3,7 +3,8 @@ How to port a SPI driver to driver model
 
 Here is a rough step-by-step guide. It is based around converting the
 exynos SPI driver to driver model (DM) and the example code is based
-around U-Boot v2014.10-rc2 (commit be9f643).
+around U-Boot v2014.10-rc2 (commit be9f643). This has been updated for
+v2015.04.
 
 It is quite long since it includes actual code examples.
 
@@ -262,8 +263,8 @@ U_BOOT_DEVICE(board_spi0) = {
        .platdata = &platdata_spi0,
 };
 
-You will unfortunately need to put the struct into a header file in this
-case so that your board file can use it.
+You will unfortunately need to put the struct definition into a header file
+in this case so that your board file can use it.
 
 
 9. Add the device private data
@@ -592,3 +593,36 @@ board.
 
 You can use 'tools/patman/patman' to prepare, check and send patches for
 your work. See the README for details.
+
+20. A little note about SPI uclass features:
+
+The SPI uclass keeps some information about each device 'dev' on the bus:
+
+   struct dm_spi_slave_platdata - this is device_get_parent_platdata(dev)
+               This is where the chip select number is stored, along with
+               the default bus speed and mode. It is automatically read
+               from the device tree in spi_child_post_bind(). It must not
+               be changed at run-time after being set up because platform
+               data is supposed to be immutable at run-time.
+   struct spi_slave - this is device_get_parentdata(dev)
+               Already mentioned above. It holds run-time information about
+               the device.
+
+There are also some SPI uclass methods that get called behind the scenes:
+
+   spi_post_bind() - called when a new bus is bound
+               This scans the device tree for devices on the bus, and binds
+               each one. This in turn causes spi_child_post_bind() to be
+               called for each, which reads the device tree information
+               into the parent (per-child) platform data.
+   spi_child_post_bind() - called when a new child is bound
+               As mentioned above this reads the device tree information
+               into the per-child platform data
+   spi_child_pre_probe() - called before a new child is probed
+               This sets up the mode and speed in struct spi_slave by
+               copying it from the parent's platform data for this child.
+               It also sets the 'dev' pointer, needed to permit passing
+               'struct spi_slave' around the place without needing a
+               separate 'struct udevice' pointer.
+
+The above housekeeping makes it easier to write your SPI driver.
index d90793a6a64ec00c48f0db269d16e16719fef764..8ba599cd9d360b01a1af6317bce4cc2bbddc1afb 100644 (file)
@@ -98,8 +98,6 @@ alias mpc83xx        uboot, kimphill
 alias mpc85xx        uboot, afleming, galak
 alias mpc86xx        uboot, afleming, galak
 alias ppc4xx         uboot, stroese
-alias ppc7xx         uboot, wd
-alias ppc74xx        uboot, wd
 
 alias sandbox        sjg
 alias sb             sandbox
index b47ce73b8323a4034bbd58c77ce50d49f5492b38..427ea498b498793f3af51bdad51dbf3ab351349c 100644 (file)
@@ -159,17 +159,17 @@ the '/images' node should have the following layout:
   - description : Textual description of the component sub-image
   - type : Name of component sub-image type, supported types are:
     "standalone", "kernel", "ramdisk", "firmware", "script", "filesystem",
-    "flat_dt" and others (see uimage_type in common/images.c).
+    "flat_dt" and others (see uimage_type in common/image.c).
   - data : Path to the external file which contains this node's binary data.
   - compression : Compression used by included data. Supported compressions
     are "gzip" and "bzip2". If no compression is used compression property
     should be set to "none".
 
   Conditionally mandatory property:
-  - os : OS name, mandatory for type="kernel", valid OS names are: "openbsd",
-    "netbsd", "freebsd", "4_4bsd", "linux", "svr4", "esix", "solaris", "irix",
-    "sco", "dell", "ncr", "lynxos", "vxworks", "psos", "qnx", "u_boot",
-    "rtems", "unity", "integrity".
+  - os : OS name, mandatory for types "kernel" and "ramdisk". Valid OS names
+    are: "openbsd", "netbsd", "freebsd", "4_4bsd", "linux", "svr4", "esix",
+    "solaris", "irix", "sco", "dell", "ncr", "lynxos", "vxworks", "psos", "qnx",
+    "u_boot", "rtems", "unity", "integrity".
   - arch : Architecture name, mandatory for types: "standalone", "kernel",
     "firmware", "ramdisk" and "fdt". Valid architecture names are: "alpha",
     "arm", "i386", "ia64", "mips", "mips64", "ppc", "s390", "sh", "sparc",
index 3c83fbc2c16744c2387e3c4271971b14489aa124..e639e7ae71a1e6bbe0f421630959369ec15fcf3a 100644 (file)
@@ -64,7 +64,7 @@ software from updatable memory.
 
 It is critical that the public key be secure and cannot be tampered with.
 It can be stored in read-only memory, or perhaps protected by other on-chip
-crypto provided by some modern SOCs. If the public key can ben changed, then
+crypto provided by some modern SOCs. If the public key can be changed, then
 the verification is worthless.
 
 
@@ -87,7 +87,7 @@ affect the whole change.
 
 Flattened Image Tree (FIT)
 --------------------------
-The FIT format is alreay widely used in U-Boot. It is a flattened device
+The FIT format is already widely used in U-Boot. It is a flattened device
 tree (FDT) in a particular format, with images contained within. FITs
 include hashes to verify images, so it is relatively straightforward to
 add signatures as well.
index 93b815ccb497d7c81eb0491a441fa082e3c703f6..7ea5fa622472ca38a8256e97cc82c6a2cf883d93 100644 (file)
@@ -62,40 +62,158 @@ static u32 saveBaseAddress14;
 static u32 saveBaseAddress18;
 static u32 saveBaseAddress20;
 
-static void atibios_set_vesa_mode(RMREGS *regs, int vesa_mode,
-                                 struct vbe_mode_info *mode_info)
+/* Addres im memory of VBE region */
+const int vbe_offset = 0x2000;
+
+static const void *bios_ptr(const void *buf, BE_VGAInfo *vga_info,
+                           u32 x86_dword_ptr)
+{
+       u32 seg_ofs, flat;
+
+       seg_ofs = le32_to_cpu(x86_dword_ptr);
+       flat = ((seg_ofs & 0xffff0000) >> 12) | (seg_ofs & 0xffff);
+       if (flat >= 0xc0000)
+               return vga_info->BIOSImage + flat - 0xc0000;
+       else
+               return buf + (flat - vbe_offset);
+}
+
+static int atibios_debug_mode(BE_VGAInfo *vga_info, RMREGS *regs,
+                             int vesa_mode, struct vbe_mode_info *mode_info)
+{
+       void *buffer = (void *)(M.mem_base + vbe_offset);
+       u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00;
+       u16 buffer_adr = ((unsigned long)vbe_offset) & 0xffff;
+       struct vesa_mode_info *vm;
+       struct vbe_info *info;
+       const u16 *modes_bios, *ptr;
+       u16 *modes;
+       int size;
+
+       debug("VBE: Getting information\n");
+       regs->e.eax = VESA_GET_INFO;
+       regs->e.esi = buffer_seg;
+       regs->e.edi = buffer_adr;
+       info = buffer;
+       memset(info, '\0', sizeof(*info));
+       strcpy(info->signature, "VBE2");
+       BE_int86(0x10, regs, regs);
+       if (regs->e.eax != 0x4f) {
+               debug("VESA_GET_INFO: error %x\n", regs->e.eax);
+               return -ENOSYS;
+       }
+       debug("version %x\n", le16_to_cpu(info->version));
+       debug("oem '%s'\n", (char *)bios_ptr(buffer, vga_info,
+                                            info->oem_string_ptr));
+       debug("vendor '%s'\n", (char *)bios_ptr(buffer, vga_info,
+                                               info->vendor_name_ptr));
+       debug("product '%s'\n", (char *)bios_ptr(buffer, vga_info,
+                                                info->product_name_ptr));
+       debug("rev '%s'\n", (char *)bios_ptr(buffer, vga_info,
+                                            info->product_rev_ptr));
+       modes_bios = bios_ptr(buffer, vga_info, info->modes_ptr);
+       debug("Modes: ");
+       for (ptr = modes_bios; *ptr != 0xffff; ptr++)
+               debug("%x ", le16_to_cpu(*ptr));
+       debug("\nmemory %dMB\n", le16_to_cpu(info->total_memory) >> 4);
+       size = (ptr - modes_bios) * sizeof(u16) + 2;
+       modes = malloc(size);
+       if (!modes)
+               return -ENOMEM;
+       memcpy(modes, modes_bios, size);
+
+       regs->e.eax = VESA_GET_CUR_MODE;
+       BE_int86(0x10, regs, regs);
+       if (regs->e.eax != 0x4f) {
+               debug("VESA_GET_CUR_MODE: error %x\n", regs->e.eax);
+               return -ENOSYS;
+       }
+       debug("Current mode %x\n", regs->e.ebx);
+
+       for (ptr = modes; *ptr != 0xffff; ptr++) {
+               int mode = le16_to_cpu(*ptr);
+               bool linear_ok;
+               int attr;
+
+               break;
+               debug("Mode %x: ", mode);
+               memset(buffer, '\0', sizeof(struct vbe_mode_info));
+               regs->e.eax = VESA_GET_MODE_INFO;
+               regs->e.ebx = 0;
+               regs->e.ecx = mode;
+               regs->e.edx = 0;
+               regs->e.esi = buffer_seg;
+               regs->e.edi = buffer_adr;
+               BE_int86(0x10, regs, regs);
+               if (regs->e.eax != 0x4f) {
+                       debug("VESA_GET_MODE_INFO: error %x\n", regs->e.eax);
+                       continue;
+               }
+               memcpy(mode_info->mode_info_block, buffer,
+                      sizeof(struct vesa_mode_info));
+               mode_info->valid = true;
+               vm = &mode_info->vesa;
+               attr = le16_to_cpu(vm->mode_attributes);
+               linear_ok = attr & 0x80;
+               debug("res %d x %d, %d bpp, mm %d, (Linear %s, attr %02x)\n",
+                     le16_to_cpu(vm->x_resolution),
+                     le16_to_cpu(vm->y_resolution),
+                     vm->bits_per_pixel, vm->memory_model,
+                     linear_ok ? "OK" : "not available",
+                     attr);
+               debug("\tRGB pos=%d,%d,%d, size=%d,%d,%d\n",
+                     vm->red_mask_pos, vm->green_mask_pos, vm->blue_mask_pos,
+                     vm->red_mask_size, vm->green_mask_size,
+                     vm->blue_mask_size);
+       }
+
+       return 0;
+}
+
+static int atibios_set_vesa_mode(RMREGS *regs, int vesa_mode,
+                                struct vbe_mode_info *mode_info)
 {
+       void *buffer = (void *)(M.mem_base + vbe_offset);
+       u16 buffer_seg = (((unsigned long)vbe_offset) >> 4) & 0xff00;
+       u16 buffer_adr = ((unsigned long)vbe_offset) & 0xffff;
+       struct vesa_mode_info *vm;
+
        debug("VBE: Setting VESA mode %#04x\n", vesa_mode);
-       /* request linear framebuffer mode */
-       vesa_mode |= (1 << 14);
-       /* request clearing of framebuffer */
-       vesa_mode &= ~(1 << 15);
        regs->e.eax = VESA_SET_MODE;
        regs->e.ebx = vesa_mode;
+       /* request linear framebuffer mode and don't clear display */
+       regs->e.ebx |= (1 << 14) | (1 << 15);
        BE_int86(0x10, regs, regs);
+       if (regs->e.eax != 0x4f) {
+               debug("VESA_SET_MODE: error %x\n", regs->e.eax);
+               return -ENOSYS;
+       }
 
-       int offset = 0x2000;
-       void *buffer = (void *)(M.mem_base + offset);
-
-       u16 buffer_seg = (((unsigned long)offset) >> 4) & 0xff00;
-       u16 buffer_adr = ((unsigned long)offset) & 0xffff;
+       memset(buffer, '\0', sizeof(struct vbe_mode_info));
+       debug("VBE: Geting info for VESA mode %#04x\n", vesa_mode);
        regs->e.eax = VESA_GET_MODE_INFO;
-       regs->e.ebx = 0;
        regs->e.ecx = vesa_mode;
-       regs->e.edx = 0;
        regs->e.esi = buffer_seg;
        regs->e.edi = buffer_adr;
        BE_int86(0x10, regs, regs);
+       if (regs->e.eax != 0x4f) {
+               debug("VESA_GET_MODE_INFO: error %x\n", regs->e.eax);
+               return -ENOSYS;
+       }
+
        memcpy(mode_info->mode_info_block, buffer,
-              sizeof(struct vbe_mode_info));
+               sizeof(struct vesa_mode_info));
        mode_info->valid = true;
+       mode_info->video_mode = vesa_mode;
+       vm = &mode_info->vesa;
+       vm->x_resolution = le16_to_cpu(vm->x_resolution);
+       vm->y_resolution = le16_to_cpu(vm->y_resolution);
+       vm->bytes_per_scanline = le16_to_cpu(vm->bytes_per_scanline);
+       vm->phys_base_ptr = le32_to_cpu(vm->phys_base_ptr);
+       vm->mode_attributes = le16_to_cpu(vm->mode_attributes);
+       debug("VBE: Init complete\n");
 
-       vesa_mode |= (1 << 14);
-       /* request clearing of framebuffer */
-       vesa_mode &= ~(1 << 15);
-       regs->e.eax = VESA_SET_MODE;
-       regs->e.ebx = vesa_mode;
-       BE_int86(0x10, regs, regs);
+       return 0;
 }
 
 /****************************************************************************
@@ -132,6 +250,9 @@ static void PCI_doBIOSPOST(pci_dev_t pcidev, BE_VGAInfo *vga_info,
        /*Cleanup and exit*/
        BE_getVGA(vga_info);
 
+       /* Useful for debugging */
+       if (0)
+               atibios_debug_mode(vga_info, &regs, vesa_mode, mode_info);
        if (vesa_mode != -1)
                atibios_set_vesa_mode(&regs, vesa_mode, mode_info);
 }
index 304b2bf007095aa8a926965c73d1e4dabcfd86d3..4962a2acaf1ca8f4394a4f538c7d5d012e78c101 100644 (file)
 # define ERR_PRINTF(x)         printf(x)
 # define ERR_PRINTF2(x, y)     printf(x, y)
 
-#ifdef CONFIG_X86EMU_DEBUG103
+#ifdef CONFIG_X86EMU_DEBUG
 
 
 # define DECODE_PRINTF(x)      if (DEBUG_DECODE()) \
index 2bb5e2d9d508112124275397cd48d41e3fc845fc..5752fee1cdac80369090fe0cc1cf8d58234a7866 100644 (file)
@@ -179,7 +179,7 @@ void x86emuOp_illegal_op(
 {
     START_OF_INSTR();
     if (M.x86.R_SP != 0) {
-       ERR_PRINTF("ILLEGAL X86 OPCODE\n");
+       DB(printf("ILLEGAL X86 OPCODE\n"));
        TRACE_REGS();
        DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
            M.x86.R_CS, M.x86.R_IP-1,op1));
index 37d2d2a28eef53bbd2477b7bb06b37f415e68735..c908fab4506e5c6400dc91150cbc23234c0ed9e3 100644 (file)
@@ -513,6 +513,20 @@ static void ahci_set_feature(u8 port)
 }
 #endif
 
+static int wait_spinup(volatile u8 *port_mmio)
+{
+       ulong start;
+       u32 tf_data;
+
+       start = get_timer(0);
+       do {
+               tf_data = readl(port_mmio + PORT_TFDATA);
+               if (!(tf_data & ATA_BUSY))
+                       return 0;
+       } while (get_timer(start) < WAIT_MS_SPINUP);
+
+       return -ETIMEDOUT;
+}
 
 static int ahci_port_start(u8 port)
 {
@@ -579,7 +593,11 @@ static int ahci_port_start(u8 port)
 
        debug("Exit start port %d\n", port);
 
-       return 0;
+       /*
+        * Make sure interface is not busy based on error and status
+        * information from task file data register before proceeding
+        */
+       return wait_spinup(port_mmio);
 }
 
 
index 8fc6b7108427add4a2f8f3a1047eee7e5e440073..3a5f48df7a27511a5bf9231e547360f11facdd7b 100644 (file)
@@ -88,6 +88,14 @@ int device_unbind(struct udevice *dev)
        if (ret)
                return ret;
 
+       if (dev->flags & DM_FLAG_ALLOC_PDATA) {
+               free(dev->platdata);
+               dev->platdata = NULL;
+       }
+       if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) {
+               free(dev->parent_platdata);
+               dev->parent_platdata = NULL;
+       }
        ret = uclass_unbind_device(dev);
        if (ret)
                return ret;
@@ -111,10 +119,6 @@ void device_free(struct udevice *dev)
                free(dev->priv);
                dev->priv = NULL;
        }
-       if (dev->flags & DM_FLAG_ALLOC_PDATA) {
-               free(dev->platdata);
-               dev->platdata = NULL;
-       }
        size = dev->uclass->uc_drv->per_device_auto_alloc_size;
        if (size) {
                free(dev->uclass_priv);
@@ -122,6 +126,10 @@ void device_free(struct udevice *dev)
        }
        if (dev->parent) {
                size = dev->parent->driver->per_child_auto_alloc_size;
+               if (!size) {
+                       size = dev->parent->uclass->uc_drv->
+                                       per_child_auto_alloc_size;
+               }
                if (size) {
                        free(dev->parent_priv);
                        dev->parent_priv = NULL;
index 963b16f26f0dc015a7f676891e0d845b42ec6594..b73d3b8961de337c1ec871d3d4ed2c1b24285e59 100644 (file)
@@ -53,27 +53,47 @@ int device_bind(struct udevice *parent, struct driver *drv, const char *name,
        dev->driver = drv;
        dev->uclass = uc;
 
-       /*
-        * For some devices, such as a SPI or I2C bus, the 'reg' property
-        * is a reasonable indicator of the sequence number. But if there is
-        * an alias, we use that in preference. In any case, this is just
-        * a 'requested' sequence, and will be resolved (and ->seq updated)
-        * when the device is probed.
-        */
        dev->seq = -1;
+       dev->req_seq = -1;
 #ifdef CONFIG_OF_CONTROL
-       dev->req_seq = fdtdec_get_int(gd->fdt_blob, of_offset, "reg", -1);
-       if (!IS_ERR_VALUE(dev->req_seq))
-               dev->req_seq &= INT_MAX;
-       if (uc->uc_drv->name && of_offset != -1) {
-               fdtdec_get_alias_seq(gd->fdt_blob, uc->uc_drv->name, of_offset,
-                                    &dev->req_seq);
+       /*
+        * Some devices, such as a SPI bus, I2C bus and serial ports are
+        * numbered using aliases.
+        *
+        * This is just a 'requested' sequence, and will be
+        * resolved (and ->seq updated) when the device is probed.
+        */
+       if (uc->uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS) {
+               if (uc->uc_drv->name && of_offset != -1) {
+                       fdtdec_get_alias_seq(gd->fdt_blob, uc->uc_drv->name,
+                                            of_offset, &dev->req_seq);
+               }
        }
-#else
-       dev->req_seq = -1;
 #endif
-       if (!dev->platdata && drv->platdata_auto_alloc_size)
+       if (!dev->platdata && drv->platdata_auto_alloc_size) {
                dev->flags |= DM_FLAG_ALLOC_PDATA;
+               dev->platdata = calloc(1, drv->platdata_auto_alloc_size);
+               if (!dev->platdata) {
+                       ret = -ENOMEM;
+                       goto fail_alloc1;
+               }
+       }
+       if (parent) {
+               int size = parent->driver->per_child_platdata_auto_alloc_size;
+
+               if (!size) {
+                       size = parent->uclass->uc_drv->
+                                       per_child_platdata_auto_alloc_size;
+               }
+               if (size) {
+                       dev->flags |= DM_FLAG_ALLOC_PARENT_PDATA;
+                       dev->parent_platdata = calloc(1, size);
+                       if (!dev->parent_platdata) {
+                               ret = -ENOMEM;
+                               goto fail_alloc2;
+                       }
+               }
+       }
 
        /* put dev into parent's successor list */
        if (parent)
@@ -81,28 +101,51 @@ int device_bind(struct udevice *parent, struct driver *drv, const char *name,
 
        ret = uclass_bind_device(dev);
        if (ret)
-               goto fail_bind;
+               goto fail_uclass_bind;
 
        /* if we fail to bind we remove device from successors and free it */
        if (drv->bind) {
                ret = drv->bind(dev);
-               if (ret) {
-                       if (uclass_unbind_device(dev)) {
-                               dm_warn("Failed to unbind dev '%s' on error path\n",
-                                       dev->name);
-                       }
+               if (ret)
                        goto fail_bind;
-               }
        }
+       if (parent && parent->driver->child_post_bind) {
+               ret = parent->driver->child_post_bind(dev);
+               if (ret)
+                       goto fail_child_post_bind;
+       }
+
        if (parent)
                dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
        *devp = dev;
 
        return 0;
 
+fail_child_post_bind:
+       if (drv->unbind && drv->unbind(dev)) {
+               dm_warn("unbind() method failed on dev '%s' on error path\n",
+                       dev->name);
+       }
+
 fail_bind:
+       if (uclass_unbind_device(dev)) {
+               dm_warn("Failed to unbind dev '%s' on error path\n",
+                       dev->name);
+       }
+fail_uclass_bind:
        list_del(&dev->sibling_node);
+       if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) {
+               free(dev->parent_platdata);
+               dev->parent_platdata = NULL;
+       }
+fail_alloc2:
+       if (dev->flags & DM_FLAG_ALLOC_PDATA) {
+               free(dev->platdata);
+               dev->platdata = NULL;
+       }
+fail_alloc1:
        free(dev);
+
        return ret;
 }
 
@@ -137,7 +180,7 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
        drv = dev->driver;
        assert(drv);
 
-       /* Allocate private data and platdata if requested */
+       /* Allocate private data if requested */
        if (drv->priv_auto_alloc_size) {
                dev->priv = calloc(1, drv->priv_auto_alloc_size);
                if (!dev->priv) {
@@ -146,13 +189,6 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
                }
        }
        /* Allocate private data if requested */
-       if (dev->flags & DM_FLAG_ALLOC_PDATA) {
-               dev->platdata = calloc(1, drv->platdata_auto_alloc_size);
-               if (!dev->platdata) {
-                       ret = -ENOMEM;
-                       goto fail;
-               }
-       }
        size = dev->uclass->uc_drv->per_device_auto_alloc_size;
        if (size) {
                dev->uclass_priv = calloc(1, size);
@@ -165,6 +201,10 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
        /* Ensure all parents are probed */
        if (dev->parent) {
                size = dev->parent->driver->per_child_auto_alloc_size;
+               if (!size) {
+                       size = dev->parent->uclass->uc_drv->
+                                       per_child_auto_alloc_size;
+               }
                if (size) {
                        dev->parent_priv = calloc(1, size);
                        if (!dev->parent_priv) {
@@ -187,6 +227,10 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
        }
        dev->seq = seq;
 
+       ret = uclass_pre_probe_child(dev);
+       if (ret)
+               goto fail;
+
        if (dev->parent && dev->parent->driver->child_pre_probe) {
                ret = dev->parent->driver->child_pre_probe(dev);
                if (ret)
@@ -241,6 +285,16 @@ void *dev_get_platdata(struct udevice *dev)
        return dev->platdata;
 }
 
+void *dev_get_parent_platdata(struct udevice *dev)
+{
+       if (!dev) {
+               dm_warn("%s: null device", __func__);
+               return NULL;
+       }
+
+       return dev->parent_platdata;
+}
+
 void *dev_get_priv(struct udevice *dev)
 {
        if (!dev) {
@@ -390,3 +444,8 @@ ulong dev_get_of_data(struct udevice *dev)
 {
        return dev->of_id->data;
 }
+
+enum uclass_id device_get_uclass_id(struct udevice *dev)
+{
+       return dev->uclass->uc_drv->id;
+}
index 47b3acfbe981da9fcfe5ca6d7c20e60dd63b0285..73e3c7228e300e67da317098160d9c9c988446b3 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <fdtdec.h>
 #include <malloc.h>
 #include <libfdt.h>
 #include <dm/device.h>
@@ -49,6 +50,9 @@ int dm_init(void)
        ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
        if (ret)
                return ret;
+#ifdef CONFIG_OF_CONTROL
+       DM_ROOT_NON_CONST->of_offset = 0;
+#endif
        ret = device_probe(DM_ROOT_NON_CONST);
        if (ret)
                return ret;
@@ -89,6 +93,10 @@ int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
                if (pre_reloc_only &&
                    !fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL))
                        continue;
+               if (!fdtdec_get_is_enabled(blob, offset)) {
+                       dm_dbg("   - ignoring disabled device\n");
+                       continue;
+               }
                err = lists_bind_fdt(parent, blob, offset, NULL);
                if (err && !ret)
                        ret = err;
index 901b06ed2baaf5f4b0cbdb71d3ca40170de33991..289a5d2d53dfc7af75c19cc1dcc21aa88e8cd0cf 100644 (file)
@@ -319,18 +319,29 @@ int uclass_bind_device(struct udevice *dev)
        int ret;
 
        uc = dev->uclass;
-
        list_add_tail(&dev->uclass_node, &uc->dev_head);
 
+       if (dev->parent) {
+               struct uclass_driver *uc_drv = dev->parent->uclass->uc_drv;
+
+               if (uc_drv->child_post_bind) {
+                       ret = uc_drv->child_post_bind(dev);
+                       if (ret)
+                               goto err;
+               }
+       }
        if (uc->uc_drv->post_bind) {
                ret = uc->uc_drv->post_bind(dev);
-               if (ret) {
-                       list_del(&dev->uclass_node);
-                       return ret;
-               }
+               if (ret)
+                       goto err;
        }
 
        return 0;
+err:
+       /* There is no need to undo the parent's post_bind call */
+       list_del(&dev->uclass_node);
+
+       return ret;
 }
 
 int uclass_unbind_device(struct udevice *dev)
@@ -380,6 +391,19 @@ int uclass_resolve_seq(struct udevice *dev)
        return seq;
 }
 
+int uclass_pre_probe_child(struct udevice *dev)
+{
+       struct uclass_driver *uc_drv;
+
+       if (!dev->parent)
+               return 0;
+       uc_drv = dev->parent->uclass->uc_drv;
+       if (uc_drv->child_pre_probe)
+               return uc_drv->child_pre_probe(dev);
+
+       return 0;
+}
+
 int uclass_post_probe_device(struct udevice *dev)
 {
        struct uclass_driver *uc_drv = dev->uclass->uc_drv;
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bd26a2bcfa286d9fd6b80b60cbd7ee9cc4c63ac8 100644 (file)
@@ -0,0 +1 @@
+source drivers/crypto/fsl/Kconfig
index 7b792371811eb37e7dadcf39310e65f955237678..fb8c10b38c2fd4537a1fa94dfc75faf737b5cfef 100644 (file)
@@ -6,4 +6,5 @@
 #
 
 obj-$(CONFIG_EXYNOS_ACE_SHA)   += ace_sha.o
+obj-y += rsa_mod_exp/
 obj-y += fsl/
diff --git a/drivers/crypto/fsl/Kconfig b/drivers/crypto/fsl/Kconfig
new file mode 100644 (file)
index 0000000..86b2f2f
--- /dev/null
@@ -0,0 +1,6 @@
+config FSL_CAAM
+       bool "Freescale Crypto Driver Support"
+       help
+         Enables the Freescale's Cryptographic Accelerator and Assurance
+         Module (CAAM), also known as the SEC version 4 (SEC4). The driver uses
+         Job Ring as interface to communicate with CAAM.
index cb13d2e0ae65c6c80009730890448a12681e14eb..c0cf64229ebe513688c6a85e61dac16689cdcb83 100644 (file)
@@ -6,5 +6,7 @@
 # Version 2 as published by the Free Software Foundation.
 #
 
+obj-y += sec.o
 obj-$(CONFIG_FSL_CAAM) += jr.o fsl_hash.o jobdesc.o error.o
 obj-$(CONFIG_CMD_BLOB) += fsl_blob.o
+obj-$(CONFIG_RSA_FREESCALE_EXP) += fsl_rsa.o
diff --git a/drivers/crypto/fsl/fsl_rsa.c b/drivers/crypto/fsl/fsl_rsa.c
new file mode 100644 (file)
index 0000000..cf1c4c1
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright 2014 Freescale Semiconductor, Inc.
+ * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+#include <common.h>
+#include <dm.h>
+#include <asm/types.h>
+#include <malloc.h>
+#include "jobdesc.h"
+#include "desc.h"
+#include "jr.h"
+#include "rsa_caam.h"
+#include <u-boot/rsa-mod-exp.h>
+
+int fsl_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *prop, uint8_t *out)
+{
+       uint32_t keylen;
+       struct pk_in_params pkin;
+       uint32_t desc[MAX_CAAM_DESCSIZE];
+       int ret;
+
+       /* Length in bytes */
+       keylen = prop->num_bits / 8;
+
+       pkin.a = sig;
+       pkin.a_siz = sig_len;
+       pkin.n = prop->modulus;
+       pkin.n_siz = keylen;
+       pkin.e = prop->public_exponent;
+       pkin.e_siz = prop->exp_len;
+
+       inline_cnstr_jobdesc_pkha_rsaexp(desc, &pkin, out, sig_len);
+
+       ret = run_descriptor_jr(desc);
+       if (ret) {
+               debug("%s: RSA failed to verify: %d\n", __func__, ret);
+               return -EFAULT;
+       }
+
+       return 0;
+}
+
+static const struct mod_exp_ops fsl_mod_exp_ops = {
+       .mod_exp        = fsl_mod_exp,
+};
+
+U_BOOT_DRIVER(fsl_rsa_mod_exp) = {
+       .name   = "fsl_rsa_mod_exp",
+       .id     = UCLASS_MOD_EXP,
+       .ops    = &fsl_mod_exp_ops,
+};
+
+U_BOOT_DEVICE(fsl_rsa) = {
+       .name = "fsl_rsa_mod_exp",
+};
index 1386baec0fda45a54e7d9664a92cef90d3c6e150..cc0dcede7b787ed19cd815a2b73a18a5334f75cb 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include "desc_constr.h"
 #include "jobdesc.h"
+#include "rsa_caam.h"
 
 #define KEY_BLOB_SIZE                  32
 #define MAC_SIZE                       16
@@ -123,3 +124,30 @@ void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc)
        append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG |
                         OP_ALG_RNG4_SK);
 }
+
+/* Change key size to bytes form bits in calling function*/
+void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
+                                     struct pk_in_params *pkin, uint8_t *out,
+                                     uint32_t out_siz)
+{
+       dma_addr_t dma_addr_e, dma_addr_a, dma_addr_n, dma_addr_out;
+
+       dma_addr_e = virt_to_phys((void *)pkin->e);
+       dma_addr_a = virt_to_phys((void *)pkin->a);
+       dma_addr_n = virt_to_phys((void *)pkin->n);
+       dma_addr_out = virt_to_phys((void *)out);
+
+       init_job_desc(desc, 0);
+       append_key(desc, dma_addr_e, pkin->e_siz, KEY_DEST_PKHA_E | CLASS_1);
+
+       append_fifo_load(desc, dma_addr_a,
+                        pkin->a_siz, LDST_CLASS_1_CCB | FIFOLD_TYPE_PK_A);
+
+       append_fifo_load(desc, dma_addr_n,
+                        pkin->n_siz, LDST_CLASS_1_CCB | FIFOLD_TYPE_PK_N);
+
+       append_operation(desc, OP_TYPE_PK | OP_ALG_PK | OP_ALG_PKMODE_MOD_EXPO);
+
+       append_fifo_store(desc, dma_addr_out, out_siz,
+                         LDST_CLASS_1_CCB | FIFOST_TYPE_PKHA_B);
+}
index 3cf7226de23b7d47ebfa8d7f4aad2a4af9eb40e5..84b3edd6e2f9ab5ad4b49e1da105143fc654400e 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include "rsa_caam.h"
 
 #define KEY_IDNFR_SZ_BYTES             16
 
@@ -26,4 +27,8 @@ void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr,
                                     uint32_t out_sz);
 
 void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc);
+
+void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
+                                     struct pk_in_params *pkin, uint8_t *out,
+                                     uint32_t out_siz);
 #endif
diff --git a/drivers/crypto/fsl/rsa_caam.h b/drivers/crypto/fsl/rsa_caam.h
new file mode 100644 (file)
index 0000000..4ff87ef
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __RSA_CAAM_H
+#define __RSA_CAAM_H
+
+#include <common.h>
+
+/**
+ * struct pk_in_params - holder for input to PKHA block in CAAM
+ * These parameters are required to perform Modular Exponentiation
+ * using PKHA Block in CAAM
+ */
+struct pk_in_params {
+       const uint8_t *e;       /* public exponent as byte array */
+       uint32_t e_siz;         /* size of e[] in number of bytes */
+       const uint8_t *n;       /* modulus as byte array */
+       uint32_t n_siz;         /* size of n[] in number of bytes */
+       const uint8_t *a;               /* Signature as byte array */
+       uint32_t a_siz;         /* size of a[] in number of bytes */
+       uint8_t *b;             /* Result exp. modulus in number of bytes */
+       uint32_t b_siz;         /* size of b[] in number of bytes */
+};
+
+#endif
diff --git a/drivers/crypto/fsl/sec.c b/drivers/crypto/fsl/sec.c
new file mode 100644 (file)
index 0000000..443ee96
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <libfdt.h>
+#include <fdt_support.h>
+#if CONFIG_SYS_FSL_SEC_COMPAT == 2 || CONFIG_SYS_FSL_SEC_COMPAT >= 4
+#include <fsl_sec.h>
+#endif
+
+/*
+ * update crypto node properties to a specified revision of the SEC
+ * called with sec_rev == 0 if not on an E processor
+ */
+#if CONFIG_SYS_FSL_SEC_COMPAT == 2 /* SEC 2.x/3.x */
+void fdt_fixup_crypto_node(void *blob, int sec_rev)
+{
+       static const struct sec_rev_prop {
+               u32 sec_rev;
+               u32 num_channels;
+               u32 channel_fifo_len;
+               u32 exec_units_mask;
+               u32 descriptor_types_mask;
+       } sec_rev_prop_list[] = {
+               { 0x0200, 4, 24, 0x07e, 0x01010ebf }, /* SEC 2.0 */
+               { 0x0201, 4, 24, 0x0fe, 0x012b0ebf }, /* SEC 2.1 */
+               { 0x0202, 1, 24, 0x04c, 0x0122003f }, /* SEC 2.2 */
+               { 0x0204, 4, 24, 0x07e, 0x012b0ebf }, /* SEC 2.4 */
+               { 0x0300, 4, 24, 0x9fe, 0x03ab0ebf }, /* SEC 3.0 */
+               { 0x0301, 4, 24, 0xbfe, 0x03ab0ebf }, /* SEC 3.1 */
+               { 0x0303, 4, 24, 0x97c, 0x03a30abf }, /* SEC 3.3 */
+       };
+       static char compat_strlist[ARRAY_SIZE(sec_rev_prop_list) *
+                                  sizeof("fsl,secX.Y")];
+       int crypto_node, sec_idx, err;
+       char *p;
+       u32 val;
+
+       /* locate crypto node based on lowest common compatible */
+       crypto_node = fdt_node_offset_by_compatible(blob, -1, "fsl,sec2.0");
+       if (crypto_node == -FDT_ERR_NOTFOUND)
+               return;
+
+       /* delete it if not on an E-processor */
+       if (crypto_node > 0 && !sec_rev) {
+               fdt_del_node(blob, crypto_node);
+               return;
+       }
+
+       /* else we got called for possible uprev */
+       for (sec_idx = 0; sec_idx < ARRAY_SIZE(sec_rev_prop_list); sec_idx++)
+               if (sec_rev_prop_list[sec_idx].sec_rev == sec_rev)
+                       break;
+
+       if (sec_idx == ARRAY_SIZE(sec_rev_prop_list)) {
+               puts("warning: unknown SEC revision number\n");
+               return;
+       }
+
+       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].num_channels);
+       err = fdt_setprop(blob, crypto_node, "fsl,num-channels", &val, 4);
+       if (err < 0)
+               printf("WARNING: could not set crypto property: %s\n",
+                      fdt_strerror(err));
+
+       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].descriptor_types_mask);
+       err = fdt_setprop(blob, crypto_node, "fsl,descriptor-types-mask",
+                         &val, 4);
+       if (err < 0)
+               printf("WARNING: could not set crypto property: %s\n",
+                      fdt_strerror(err));
+
+       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].exec_units_mask);
+       err = fdt_setprop(blob, crypto_node, "fsl,exec-units-mask", &val, 4);
+       if (err < 0)
+               printf("WARNING: could not set crypto property: %s\n",
+                      fdt_strerror(err));
+
+       val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].channel_fifo_len);
+       err = fdt_setprop(blob, crypto_node, "fsl,channel-fifo-len", &val, 4);
+       if (err < 0)
+               printf("WARNING: could not set crypto property: %s\n",
+                      fdt_strerror(err));
+
+       val = 0;
+       while (sec_idx >= 0) {
+               p = compat_strlist + val;
+               val += sprintf(p, "fsl,sec%d.%d",
+                       (sec_rev_prop_list[sec_idx].sec_rev & 0xff00) >> 8,
+                       sec_rev_prop_list[sec_idx].sec_rev & 0x00ff) + 1;
+               sec_idx--;
+       }
+       err = fdt_setprop(blob, crypto_node, "compatible", &compat_strlist,
+                         val);
+       if (err < 0)
+               printf("WARNING: could not set crypto property: %s\n",
+                      fdt_strerror(err));
+}
+#elif CONFIG_SYS_FSL_SEC_COMPAT >= 4  /* SEC4 */
+static u8 caam_get_era(void)
+{
+       static const struct {
+               u16 ip_id;
+               u8 maj_rev;
+               u8 era;
+       } caam_eras[] = {
+               {0x0A10, 1, 1},
+               {0x0A10, 2, 2},
+               {0x0A12, 1, 3},
+               {0x0A14, 1, 3},
+               {0x0A14, 2, 4},
+               {0x0A16, 1, 4},
+               {0x0A10, 3, 4},
+               {0x0A11, 1, 4},
+               {0x0A18, 1, 4},
+               {0x0A11, 2, 5},
+               {0x0A12, 2, 5},
+               {0x0A13, 1, 5},
+               {0x0A1C, 1, 5}
+       };
+
+       ccsr_sec_t __iomem *sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
+       u32 secvid_ms = sec_in32(&sec->secvid_ms);
+       u32 ccbvid = sec_in32(&sec->ccbvid);
+       u16 ip_id = (secvid_ms & SEC_SECVID_MS_IPID_MASK) >>
+                               SEC_SECVID_MS_IPID_SHIFT;
+       u8 maj_rev = (secvid_ms & SEC_SECVID_MS_MAJ_REV_MASK) >>
+                               SEC_SECVID_MS_MAJ_REV_SHIFT;
+       u8 era = (ccbvid & SEC_CCBVID_ERA_MASK) >> SEC_CCBVID_ERA_SHIFT;
+
+       int i;
+
+       if (era)        /* This is '0' prior to CAAM ERA-6 */
+               return era;
+
+       for (i = 0; i < ARRAY_SIZE(caam_eras); i++)
+               if (caam_eras[i].ip_id == ip_id &&
+                   caam_eras[i].maj_rev == maj_rev)
+                       return caam_eras[i].era;
+
+       return 0;
+}
+
+static void fdt_fixup_crypto_era(void *blob, u32 era)
+{
+       int err;
+       int crypto_node;
+
+       crypto_node = fdt_path_offset(blob, "crypto");
+       if (crypto_node < 0) {
+               printf("WARNING: Missing crypto node\n");
+               return;
+       }
+
+       err = fdt_setprop(blob, crypto_node, "fsl,sec-era", &era,
+                         sizeof(era));
+       if (err < 0) {
+               printf("ERROR: could not set fsl,sec-era property: %s\n",
+                      fdt_strerror(err));
+       }
+}
+
+void fdt_fixup_crypto_node(void *blob, int sec_rev)
+{
+       u8 era;
+
+       if (!sec_rev) {
+               fdt_del_node_and_alias(blob, "crypto");
+               return;
+       }
+
+       /* Add SEC ERA information in compatible */
+       era = caam_get_era();
+       if (era) {
+               fdt_fixup_crypto_era(blob, era);
+       } else {
+               printf("WARNING: Unable to get ERA for CAAM rev: %d\n",
+                      sec_rev);
+       }
+}
+#endif
diff --git a/drivers/crypto/rsa_mod_exp/Kconfig b/drivers/crypto/rsa_mod_exp/Kconfig
new file mode 100644 (file)
index 0000000..6dcb39a
--- /dev/null
@@ -0,0 +1,5 @@
+config DM_MOD_EXP
+       bool "Enable Driver Model for RSA Modular Exponentiation"
+       depends on DM
+       help
+         If you want to use driver model for RSA Modular Exponentiation, say Y.
diff --git a/drivers/crypto/rsa_mod_exp/Makefile b/drivers/crypto/rsa_mod_exp/Makefile
new file mode 100644 (file)
index 0000000..915b751
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2014 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-$(CONFIG_RSA) += mod_exp_uclass.o mod_exp_sw.o
diff --git a/drivers/crypto/rsa_mod_exp/mod_exp_sw.c b/drivers/crypto/rsa_mod_exp/mod_exp_sw.c
new file mode 100644 (file)
index 0000000..dc6c064
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2014 Freescale Semiconductor, Inc.
+ * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+#include <common.h>
+#include <dm.h>
+#include <u-boot/rsa-mod-exp.h>
+
+int mod_exp_sw(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *prop, uint8_t *out)
+{
+       int ret = 0;
+
+       ret = rsa_mod_exp_sw(sig, sig_len, prop, out);
+       if (ret) {
+               debug("%s: RSA failed to verify: %d\n", __func__, ret);
+               return ret;
+       }
+
+       return 0;
+}
+
+static const struct mod_exp_ops mod_exp_ops_sw = {
+       .mod_exp        = mod_exp_sw,
+};
+
+U_BOOT_DRIVER(mod_exp_sw) = {
+       .name   = "mod_exp_sw",
+       .id     = UCLASS_MOD_EXP,
+       .ops    = &mod_exp_ops_sw,
+};
+
+U_BOOT_DEVICE(mod_exp_sw) = {
+       .name = "mod_exp_sw",
+};
diff --git a/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c b/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
new file mode 100644 (file)
index 0000000..266f094
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * (C) Copyright 2014 Freescale Semiconductor, Inc
+ * Author: Ruchika Gupta <ruchika.gupta@freescale.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <u-boot/rsa-mod-exp.h>
+#include <errno.h>
+#include <fdtdec.h>
+#include <malloc.h>
+#include <asm/io.h>
+#include <linux/list.h>
+
+int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *node, uint8_t *out)
+{
+       const struct mod_exp_ops *ops = device_get_ops(dev);
+
+       if (!ops->mod_exp)
+               return -ENOSYS;
+
+       return ops->mod_exp(dev, sig, sig_len, node, out);
+}
+
+UCLASS_DRIVER(mod_exp) = {
+       .id             = UCLASS_MOD_EXP,
+       .name           = "rsa_mod_exp",
+};
index a3c01e7f1e2ffa5e977a9d8c3b77c6d033467b44..4eef0473439a98028395d7403fa8980eb21e8ed0 100644 (file)
@@ -171,6 +171,14 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
                        ddr_out32(&ddr->debug[i], regs->debug[i]);
                }
        }
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008378
+       /* Erratum applies when accumulated ECC is used, or DBI is enabled */
+#define IS_ACC_ECC_EN(v) ((v) & 0x4)
+#define IS_DBI(v) ((((v) >> 12) & 0x3) == 0x2)
+       if (IS_ACC_ECC_EN(regs->ddr_sdram_cfg) ||
+           IS_DBI(regs->ddr_sdram_cfg_3))
+               ddr_setbits32(ddr->debug[28], 0x9 << 20);
+#endif
 
        /*
         * For RDIMMs, JEDEC spec requires clocks to be stable before reset is
index 3fa9c5994703d473494a4d2199ecae3e34a0c9c0..d908736cffe31e2acb1bfa787bc12b05265543b7 100644 (file)
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <dm-demo.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -20,6 +21,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 struct shape_data {
        int num_chars;  /* Number of non-space characters output so far */
+       struct gpio_desc gpio_desc[8];
+       int gpio_count;
 };
 
 /* Crazy little function to draw shapes on the console */
@@ -89,9 +92,52 @@ static int shape_status(struct udevice *dev, int *status)
        return 0;
 }
 
+static int set_light(struct udevice *dev, int light)
+{
+       struct shape_data *priv = dev_get_priv(dev);
+       struct gpio_desc *desc;
+       int ret;
+       int i;
+
+       desc = priv->gpio_desc;
+       for (i = 0; i < priv->gpio_count; i++, desc++) {
+               uint mask = 1 << i;
+
+               ret = dm_gpio_set_value(desc, light & mask);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int get_light(struct udevice *dev)
+{
+       struct shape_data *priv = dev_get_priv(dev);
+       struct gpio_desc *desc;
+       uint value = 0;
+       int ret;
+       int i;
+
+       desc = priv->gpio_desc;
+       for (i = 0; i < priv->gpio_count; i++, desc++) {
+               uint mask = 1 << i;
+
+               ret = dm_gpio_get_value(desc);
+               if (ret < 0)
+                       return ret;
+               if (ret)
+                       value |= mask;
+       }
+
+       return value;
+}
+
 static const struct demo_ops shape_ops = {
        .hello = shape_hello,
        .status = shape_status,
+       .get_light = get_light,
+       .set_light = set_light,
 };
 
 static int shape_ofdata_to_platdata(struct udevice *dev)
@@ -111,6 +157,29 @@ static int shape_ofdata_to_platdata(struct udevice *dev)
        return 0;
 }
 
+static int dm_shape_probe(struct udevice *dev)
+{
+       struct shape_data *priv = dev_get_priv(dev);
+       int ret;
+
+       ret = gpio_request_list_by_name(dev, "light-gpios", priv->gpio_desc,
+                                       ARRAY_SIZE(priv->gpio_desc),
+                                       GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+       if (ret < 0)
+               return ret;
+       priv->gpio_count = ret;
+       debug("%s: %d GPIOs\n", __func__, priv->gpio_count);
+
+       return 0;
+}
+
+static int dm_shape_remove(struct udevice *dev)
+{
+       struct shape_data *priv = dev_get_priv(dev);
+
+       return gpio_free_list(dev, priv->gpio_desc, priv->gpio_count);
+}
+
 static const struct udevice_id demo_shape_id[] = {
        { "demo-shape", 0 },
        { },
@@ -122,6 +191,8 @@ U_BOOT_DRIVER(demo_shape_drv) = {
        .id     = UCLASS_DEMO,
        .ofdata_to_platdata = shape_ofdata_to_platdata,
        .ops    = &shape_ops,
+       .probe = dm_shape_probe,
+       .remove = dm_shape_remove,
        .priv_auto_alloc_size = sizeof(struct shape_data),
        .platdata_auto_alloc_size = sizeof(struct dm_demo_pdata),
 };
index f6510d602c83472695065b66c0f01e55f75b881b..725f06898f33deb8d7e827f016d1a63da90b71aa 100644 (file)
@@ -43,6 +43,26 @@ int demo_status(struct udevice *dev, int *status)
        return ops->status(dev, status);
 }
 
+int demo_get_light(struct udevice *dev)
+{
+       const struct demo_ops *ops = device_get_ops(dev);
+
+       if (!ops->get_light)
+               return -ENOSYS;
+
+       return ops->get_light(dev);
+}
+
+int demo_set_light(struct udevice *dev, int light)
+{
+       const struct demo_ops *ops = device_get_ops(dev);
+
+       if (!ops->set_light)
+               return -ENOSYS;
+
+       return ops->set_light(dev, light);
+}
+
 int demo_parse_dt(struct udevice *dev)
 {
        struct dm_demo_pdata *pdata = dev_get_platdata(dev);
index 37946d5e183a73d07bff9da4f324c8357a72a89c..d94eb5cc25c4fce6c4df48bd22c39a659b709378 100644 (file)
@@ -38,7 +38,7 @@ static void fpga_no_sup(char *fn, char *msg)
 /* fpga_get_desc
  *     map a device number to a descriptor
  */
-static const fpga_desc *const fpga_get_desc(int devnum)
+const fpga_desc *const fpga_get_desc(int devnum)
 {
        fpga_desc *desc = (fpga_desc *)NULL;
 
index adb4b8cd25fdcce540f9d73c1aee49a920c09e7a..c765a74a25e0f17895b8010cfcbb646f735a5093 100644 (file)
@@ -139,6 +139,11 @@ int xilinx_load(xilinx_desc *desc, const void *buf, size_t bsize,
                return FPGA_FAIL;
        }
 
+       if (!desc->operations || !desc->operations->load) {
+               printf("%s: Missing load operation\n", __func__);
+               return FPGA_FAIL;
+       }
+
        return desc->operations->load(desc, buf, bsize, bstype);
 }
 
@@ -151,8 +156,10 @@ int xilinx_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
                return FPGA_FAIL;
        }
 
-       if (!desc->operations->loadfs)
+       if (!desc->operations || !desc->operations->loadfs) {
+               printf("%s: Missing loadfs operation\n", __func__);
                return FPGA_FAIL;
+       }
 
        return desc->operations->loadfs(desc, buf, bsize, fpga_fsinfo);
 }
@@ -165,6 +172,11 @@ int xilinx_dump(xilinx_desc *desc, const void *buf, size_t bsize)
                return FPGA_FAIL;
        }
 
+       if (!desc->operations || !desc->operations->dump) {
+               printf("%s: Missing dump operation\n", __func__);
+               return FPGA_FAIL;
+       }
+
        return desc->operations->dump(desc, buf, bsize);
 }
 
@@ -226,12 +238,14 @@ int xilinx_info(xilinx_desc *desc)
                if (desc->name)
                        printf("Device name:   \t%s\n", desc->name);
 
-               if (desc->iface_fns) {
+               if (desc->iface_fns)
                        printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
-                       desc->operations->info(desc);
-               } else
+               else
                        printf ("No Device Function Table.\n");
 
+               if (desc->operations && desc->operations->info)
+                       desc->operations->info(desc);
+
                ret_val = FPGA_SUCCESS;
        } else {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
index 255700ab18d2d93cf107fcbf3b5a10b2e66e855f..a69bbd2002e9f62c06f75cb1f1b4b755140eecc2 100644 (file)
@@ -7,20 +7,25 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <fdtdec.h>
 #include <malloc.h>
 #include <asm/gpio.h>
 #include <linux/ctype.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /**
  * gpio_to_device() - Convert global GPIO number to device, number
- * gpio:       The numeric representation of the GPIO
  *
  * Convert the GPIO number to an entry in the list of GPIOs
  * or GPIO blocks registered with the GPIO controller. Returns
  * entry on success, NULL on error.
+ *
+ * @gpio:      The numeric representation of the GPIO
+ * @desc:      Returns description (desc->flags will always be 0)
+ * @return 0 if found, -ENOENT if not found
  */
-static int gpio_to_device(unsigned int gpio, struct udevice **devp,
-                         unsigned int *offset)
+static int gpio_to_device(unsigned int gpio, struct gpio_desc *desc)
 {
        struct gpio_dev_priv *uc_priv;
        struct udevice *dev;
@@ -32,14 +37,15 @@ static int gpio_to_device(unsigned int gpio, struct udevice **devp,
                uc_priv = dev->uclass_priv;
                if (gpio >= uc_priv->gpio_base &&
                    gpio < uc_priv->gpio_base + uc_priv->gpio_count) {
-                       *devp = dev;
-                       *offset = gpio - uc_priv->gpio_base;
+                       desc->dev = dev;
+                       desc->offset = gpio - uc_priv->gpio_base;
+                       desc->flags = 0;
                        return 0;
                }
        }
 
        /* No such GPIO */
-       return ret ? ret : -EINVAL;
+       return ret ? ret : -ENOENT;
 }
 
 int gpio_lookup_name(const char *name, struct udevice **devp,
@@ -88,6 +94,57 @@ int gpio_lookup_name(const char *name, struct udevice **devp,
        return 0;
 }
 
+static int gpio_find_and_xlate(struct gpio_desc *desc,
+                              struct fdtdec_phandle_args *args)
+{
+       struct dm_gpio_ops *ops = gpio_get_ops(desc->dev);
+
+       /* Use the first argument as the offset by default */
+       if (args->args_count > 0)
+               desc->offset = args->args[0];
+       else
+               desc->offset = -1;
+       desc->flags = 0;
+
+       return ops->xlate ? ops->xlate(desc->dev, desc, args) : 0;
+}
+
+static int dm_gpio_request(struct gpio_desc *desc, const char *label)
+{
+       struct udevice *dev = desc->dev;
+       struct gpio_dev_priv *uc_priv;
+       char *str;
+       int ret;
+
+       uc_priv = dev->uclass_priv;
+       if (uc_priv->name[desc->offset])
+               return -EBUSY;
+       str = strdup(label);
+       if (!str)
+               return -ENOMEM;
+       if (gpio_get_ops(dev)->request) {
+               ret = gpio_get_ops(dev)->request(dev, desc->offset, label);
+               if (ret) {
+                       free(str);
+                       return ret;
+               }
+       }
+       uc_priv->name[desc->offset] = str;
+
+       return 0;
+}
+
+static int dm_gpio_requestf(struct gpio_desc *desc, const char *fmt, ...)
+{
+       va_list args;
+       char buf[40];
+
+       va_start(args, fmt);
+       vscnprintf(buf, sizeof(buf), fmt, args);
+       va_end(args);
+       return dm_gpio_request(desc, buf);
+}
+
 /**
  * gpio_request() - [COMPAT] Request GPIO
  * gpio:       GPIO number
@@ -102,32 +159,14 @@ int gpio_lookup_name(const char *name, struct udevice **devp,
  */
 int gpio_request(unsigned gpio, const char *label)
 {
-       struct gpio_dev_priv *uc_priv;
-       unsigned int offset;
-       struct udevice *dev;
-       char *str;
+       struct gpio_desc desc;
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
+       ret = gpio_to_device(gpio, &desc);
        if (ret)
                return ret;
 
-       uc_priv = dev->uclass_priv;
-       if (uc_priv->name[offset])
-               return -EBUSY;
-       str = strdup(label);
-       if (!str)
-               return -ENOMEM;
-       if (gpio_get_ops(dev)->request) {
-               ret = gpio_get_ops(dev)->request(dev, offset, label);
-               if (ret) {
-                       free(str);
-                       return ret;
-               }
-       }
-       uc_priv->name[offset] = str;
-
-       return 0;
+       return dm_gpio_request(&desc, label);
 }
 
 /**
@@ -151,25 +190,11 @@ int gpio_requestf(unsigned gpio, const char *fmt, ...)
        return gpio_request(gpio, buf);
 }
 
-/**
- * gpio_free() - [COMPAT] Relinquish GPIO
- * gpio:       GPIO number
- *
- * This function implements the API that's compatible with current
- * GPIO API used in U-Boot. The request is forwarded to particular
- * GPIO driver. Returns 0 on success, negative value on error.
- */
-int gpio_free(unsigned gpio)
+int _dm_gpio_free(struct udevice *dev, uint offset)
 {
        struct gpio_dev_priv *uc_priv;
-       unsigned int offset;
-       struct udevice *dev;
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
-       if (ret)
-               return ret;
-
        uc_priv = dev->uclass_priv;
        if (!uc_priv->name[offset])
                return -ENXIO;
@@ -185,15 +210,35 @@ int gpio_free(unsigned gpio)
        return 0;
 }
 
-static int check_reserved(struct udevice *dev, unsigned offset,
-                         const char *func)
+/**
+ * gpio_free() - [COMPAT] Relinquish GPIO
+ * gpio:       GPIO number
+ *
+ * This function implements the API that's compatible with current
+ * GPIO API used in U-Boot. The request is forwarded to particular
+ * GPIO driver. Returns 0 on success, negative value on error.
+ */
+int gpio_free(unsigned gpio)
 {
-       struct gpio_dev_priv *uc_priv = dev->uclass_priv;
+       struct gpio_desc desc;
+       int ret;
+
+       ret = gpio_to_device(gpio, &desc);
+       if (ret)
+               return ret;
+
+       return _dm_gpio_free(desc.dev, desc.offset);
+}
+
+static int check_reserved(struct gpio_desc *desc, const char *func)
+{
+       struct gpio_dev_priv *uc_priv = desc->dev->uclass_priv;
 
-       if (!uc_priv->name[offset]) {
+       if (!uc_priv->name[desc->offset]) {
                printf("%s: %s: error: gpio %s%d not reserved\n",
-                      dev->name, func,
-                      uc_priv->bank_name ? uc_priv->bank_name : "", offset);
+                      desc->dev->name, func,
+                      uc_priv->bank_name ? uc_priv->bank_name : "",
+                      desc->offset);
                return -EBUSY;
        }
 
@@ -210,16 +255,17 @@ static int check_reserved(struct udevice *dev, unsigned offset,
  */
 int gpio_direction_input(unsigned gpio)
 {
-       unsigned int offset;
-       struct udevice *dev;
+       struct gpio_desc desc;
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
+       ret = gpio_to_device(gpio, &desc);
+       if (ret)
+               return ret;
+       ret = check_reserved(&desc, "dir_input");
        if (ret)
                return ret;
-       ret = check_reserved(dev, offset, "dir_input");
 
-       return ret ? ret : gpio_get_ops(dev)->direction_input(dev, offset);
+       return gpio_get_ops(desc.dev)->direction_input(desc.dev, desc.offset);
 }
 
 /**
@@ -233,17 +279,81 @@ int gpio_direction_input(unsigned gpio)
  */
 int gpio_direction_output(unsigned gpio, int value)
 {
-       unsigned int offset;
-       struct udevice *dev;
+       struct gpio_desc desc;
+       int ret;
+
+       ret = gpio_to_device(gpio, &desc);
+       if (ret)
+               return ret;
+       ret = check_reserved(&desc, "dir_output");
+       if (ret)
+               return ret;
+
+       return gpio_get_ops(desc.dev)->direction_output(desc.dev,
+                                                       desc.offset, value);
+}
+
+int dm_gpio_get_value(struct gpio_desc *desc)
+{
+       int value;
+       int ret;
+
+       ret = check_reserved(desc, "get_value");
+       if (ret)
+               return ret;
+
+       value = gpio_get_ops(desc->dev)->get_value(desc->dev, desc->offset);
+
+       return desc->flags & GPIOD_ACTIVE_LOW ? !value : value;
+}
+
+int dm_gpio_set_value(struct gpio_desc *desc, int value)
+{
+       int ret;
+
+       ret = check_reserved(desc, "set_value");
+       if (ret)
+               return ret;
+
+       if (desc->flags & GPIOD_ACTIVE_LOW)
+               value = !value;
+       gpio_get_ops(desc->dev)->set_value(desc->dev, desc->offset, value);
+       return 0;
+}
+
+int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags)
+{
+       struct udevice *dev = desc->dev;
+       struct dm_gpio_ops *ops = gpio_get_ops(dev);
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
+       ret = check_reserved(desc, "set_dir");
+       if (ret)
+               return ret;
+
+       if (flags & GPIOD_IS_OUT) {
+               int value = flags & GPIOD_IS_OUT_ACTIVE ? 1 : 0;
+
+               if (flags & GPIOD_ACTIVE_LOW)
+                       value = !value;
+               ret = ops->direction_output(dev, desc->offset, value);
+       } else  if (flags & GPIOD_IS_IN) {
+               ret = ops->direction_input(dev, desc->offset);
+       }
        if (ret)
                return ret;
-       ret = check_reserved(dev, offset, "dir_output");
+       /*
+        * Update desc->flags here, so that GPIO_ACTIVE_LOW is honoured in
+        * futures
+        */
+       desc->flags = flags;
+
+       return 0;
+}
 
-       return ret ? ret :
-               gpio_get_ops(dev)->direction_output(dev, offset, value);
+int dm_gpio_set_dir(struct gpio_desc *desc)
+{
+       return dm_gpio_set_dir_flags(desc, desc->flags);
 }
 
 /**
@@ -257,16 +367,14 @@ int gpio_direction_output(unsigned gpio, int value)
  */
 int gpio_get_value(unsigned gpio)
 {
-       unsigned int offset;
-       struct udevice *dev;
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
+       struct gpio_desc desc;
+
+       ret = gpio_to_device(gpio, &desc);
        if (ret)
                return ret;
-       ret = check_reserved(dev, offset, "get_value");
-
-       return ret ? ret : gpio_get_ops(dev)->get_value(dev, offset);
+       return dm_gpio_get_value(&desc);
 }
 
 /**
@@ -280,16 +388,13 @@ int gpio_get_value(unsigned gpio)
  */
 int gpio_set_value(unsigned gpio, int value)
 {
-       unsigned int offset;
-       struct udevice *dev;
+       struct gpio_desc desc;
        int ret;
 
-       ret = gpio_to_device(gpio, &dev, &offset);
+       ret = gpio_to_device(gpio, &desc);
        if (ret)
                return ret;
-       ret = check_reserved(dev, offset, "set_value");
-
-       return ret ? ret : gpio_get_ops(dev)->set_value(dev, offset, value);
+       return dm_gpio_set_value(&desc, value);
 }
 
 const char *gpio_get_bank_info(struct udevice *dev, int *bit_count)
@@ -409,6 +514,155 @@ unsigned gpio_get_values_as_int(const int *gpio_num_array)
        return vector;
 }
 
+static int _gpio_request_by_name_nodev(const void *blob, int node,
+                                      const char *list_name, int index,
+                                      struct gpio_desc *desc, int flags,
+                                      bool add_index)
+{
+       struct fdtdec_phandle_args args;
+       int ret;
+
+       desc->dev = NULL;
+       desc->offset = 0;
+       ret = fdtdec_parse_phandle_with_args(blob, node, list_name,
+                                            "#gpio-cells", 0, index, &args);
+       if (ret) {
+               debug("%s: fdtdec_parse_phandle_with_args failed\n", __func__);
+               goto err;
+       }
+
+       ret = uclass_get_device_by_of_offset(UCLASS_GPIO, args.node,
+                                            &desc->dev);
+       if (ret) {
+               debug("%s: uclass_get_device_by_of_offset failed\n", __func__);
+               goto err;
+       }
+       ret = gpio_find_and_xlate(desc, &args);
+       if (ret) {
+               debug("%s: gpio_find_and_xlate failed\n", __func__);
+               goto err;
+       }
+       ret = dm_gpio_requestf(desc, add_index ? "%s.%s%d" : "%s.%s",
+                              fdt_get_name(blob, node, NULL),
+                              list_name, index);
+       if (ret) {
+               debug("%s: dm_gpio_requestf failed\n", __func__);
+               goto err;
+       }
+       ret = dm_gpio_set_dir_flags(desc, flags | desc->flags);
+       if (ret) {
+               debug("%s: dm_gpio_set_dir failed\n", __func__);
+               goto err;
+       }
+
+       return 0;
+err:
+       debug("%s: Node '%s', property '%s', failed to request GPIO index %d: %d\n",
+             __func__, fdt_get_name(blob, node, NULL), list_name, index, ret);
+       return ret;
+}
+
+int gpio_request_by_name_nodev(const void *blob, int node,
+                              const char *list_name, int index,
+                              struct gpio_desc *desc, int flags)
+{
+       return _gpio_request_by_name_nodev(blob, node, list_name, index, desc,
+                                          flags, index > 0);
+}
+
+int gpio_request_by_name(struct udevice *dev,  const char *list_name, int index,
+                        struct gpio_desc *desc, int flags)
+{
+       /*
+        * This isn't ideal since we don't use dev->name in the debug()
+        * calls in gpio_request_by_name(), but we can do this until
+        * gpio_request_by_name_nodev() can be dropped.
+        */
+       return gpio_request_by_name_nodev(gd->fdt_blob, dev->of_offset,
+                                         list_name, index, desc, flags);
+}
+
+int gpio_request_list_by_name_nodev(const void *blob, int node,
+                                   const char *list_name,
+                                   struct gpio_desc *desc, int max_count,
+                                   int flags)
+{
+       int count;
+       int ret;
+
+       for (count = 0; ; count++) {
+               if (count >= max_count) {
+                       ret = -ENOSPC;
+                       goto err;
+               }
+               ret = _gpio_request_by_name_nodev(blob, node, list_name, count,
+                                                 &desc[count], flags, true);
+               if (ret == -ENOENT)
+                       break;
+               else if (ret)
+                       goto err;
+       }
+
+       /* We ran out of GPIOs in the list */
+       return count;
+
+err:
+       gpio_free_list_nodev(desc, count - 1);
+
+       return ret;
+}
+
+int gpio_request_list_by_name(struct udevice *dev, const char *list_name,
+                             struct gpio_desc *desc, int max_count,
+                             int flags)
+{
+       /*
+        * This isn't ideal since we don't use dev->name in the debug()
+        * calls in gpio_request_by_name(), but we can do this until
+        * gpio_request_list_by_name_nodev() can be dropped.
+        */
+       return gpio_request_list_by_name_nodev(gd->fdt_blob, dev->of_offset,
+                                              list_name, desc, max_count,
+                                              flags);
+}
+
+int gpio_get_list_count(struct udevice *dev, const char *list_name)
+{
+       int ret;
+
+       ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev->of_offset,
+                                            list_name, "#gpio-cells", 0, -1,
+                                            NULL);
+       if (ret) {
+               debug("%s: Node '%s', property '%s', GPIO count failed: %d\n",
+                     __func__, dev->name, list_name, ret);
+       }
+
+       return ret;
+}
+
+int dm_gpio_free(struct udevice *dev, struct gpio_desc *desc)
+{
+       /* For now, we don't do any checking of dev */
+       return _dm_gpio_free(desc->dev, desc->offset);
+}
+
+int gpio_free_list(struct udevice *dev, struct gpio_desc *desc, int count)
+{
+       int i;
+
+       /* For now, we don't do any checking of dev */
+       for (i = 0; i < count; i++)
+               dm_gpio_free(dev, &desc[i]);
+
+       return 0;
+}
+
+int gpio_free_list_nodev(struct gpio_desc *desc, int count)
+{
+       return gpio_free_list(NULL, desc, count);
+}
+
 /* We need to renumber the GPIOs when any driver is probed/removed */
 static int gpio_renumber(struct udevice *removed_dev)
 {
index 6c41a42c177351adcd0d6f96ff81ae2a0f1036ee..0a245ba18ad0eb42bdc6b67697dbdfa7fedd20a0 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <dm/device-internal.h>
+#include <dt-bindings/gpio/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -275,12 +276,22 @@ static int exynos_gpio_get_function(struct udevice *dev, unsigned offset)
                return GPIOF_FUNC;
 }
 
+static int exynos_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
+                            struct fdtdec_phandle_args *args)
+{
+       desc->offset = args->args[0];
+       desc->flags = args->args[1] & GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0;
+
+       return 0;
+}
+
 static const struct dm_gpio_ops gpio_exynos_ops = {
        .direction_input        = exynos_gpio_direction_input,
        .direction_output       = exynos_gpio_direction_output,
        .get_value              = exynos_gpio_get_value,
        .set_value              = exynos_gpio_set_value,
        .get_function           = exynos_gpio_get_function,
+       .xlate                  = exynos_gpio_xlate,
 };
 
 static int gpio_exynos_probe(struct udevice *dev)
@@ -342,7 +353,7 @@ static int gpio_exynos_bind(struct udevice *parent)
                                        plat->bank_name, plat, -1, &dev);
                if (ret)
                        return ret;
-               dev->of_offset = parent->of_offset;
+               dev->of_offset = node;
        }
 
        return 0;
index 53c80d5be65dd85c0dbe20d2e1823e0400a4937f..d564c252c7d7336d9f5bcc93d9ac306bd42eb539 100644 (file)
@@ -8,6 +8,7 @@
 #include <fdtdec.h>
 #include <malloc.h>
 #include <asm/gpio.h>
+#include <dt-bindings/gpio/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -130,12 +131,31 @@ static int sb_gpio_get_function(struct udevice *dev, unsigned offset)
        return GPIOF_INPUT;
 }
 
+static int sb_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
+                        struct fdtdec_phandle_args *args)
+{
+       desc->offset = args->args[0];
+       if (args->args_count < 2)
+               return 0;
+       if (args->args[1] & GPIO_ACTIVE_LOW)
+               desc->flags |= GPIOD_ACTIVE_LOW;
+       if (args->args[1] & 2)
+               desc->flags |= GPIOD_IS_IN;
+       if (args->args[1] & 4)
+               desc->flags |= GPIOD_IS_OUT;
+       if (args->args[1] & 8)
+               desc->flags |= GPIOD_IS_OUT_ACTIVE;
+
+       return 0;
+}
+
 static const struct dm_gpio_ops gpio_sandbox_ops = {
        .direction_input        = sb_gpio_direction_input,
        .direction_output       = sb_gpio_direction_output,
        .get_value              = sb_gpio_get_value,
        .set_value              = sb_gpio_set_value,
        .get_function           = sb_gpio_get_function,
+       .xlate                  = sb_gpio_xlate,
 };
 
 static int sandbox_gpio_ofdata_to_platdata(struct udevice *dev)
index 88f7ef5bf04d9abce9605cd7e8e161a11b135a8d..43928b8812c3aad0077b8beb4a837993c653ed59 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/arch/tegra.h>
 #include <asm/gpio.h>
 #include <dm/device-internal.h>
+#include <dt-bindings/gpio/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -251,6 +252,22 @@ static int tegra_gpio_get_function(struct udevice *dev, unsigned offset)
                return GPIOF_INPUT;
 }
 
+static int tegra_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
+                           struct fdtdec_phandle_args *args)
+{
+       int gpio, port, ret;
+
+       gpio = args->args[0];
+       port = gpio / TEGRA_GPIOS_PER_PORT;
+       ret = device_get_child(dev, port, &desc->dev);
+       if (ret)
+               return ret;
+       desc->offset = gpio % TEGRA_GPIOS_PER_PORT;
+       desc->flags = args->args[1] & GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0;
+
+       return 0;
+}
+
 static const struct dm_gpio_ops gpio_tegra_ops = {
        .request                = tegra_gpio_request,
        .direction_input        = tegra_gpio_direction_input,
@@ -258,6 +275,7 @@ static const struct dm_gpio_ops gpio_tegra_ops = {
        .get_value              = tegra_gpio_get_value,
        .set_value              = tegra_gpio_set_value,
        .get_function           = tegra_gpio_get_function,
+       .xlate                  = tegra_gpio_xlate,
 };
 
 /**
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..202ea5d67940ece1c555568794a7cfd343f0fc30 100644 (file)
@@ -0,0 +1,22 @@
+config DM_I2C
+       bool "Enable Driver Model for I2C drivers"
+       depends on DM
+       help
+         If you want to use driver model for I2C drivers, say Y.
+         To use legacy I2C drivers, say N.
+
+config SYS_I2C_UNIPHIER
+       bool "UniPhier I2C driver"
+       depends on ARCH_UNIPHIER && DM_I2C
+       default y
+       help
+         Support for Panasonic UniPhier I2C controller driver.  This I2C
+         controller is used on PH1-LD4, PH1-sLD8 or older UniPhier SoCs.
+
+config SYS_I2C_UNIPHIER_F
+       bool "UniPhier FIFO-builtin I2C driver"
+       depends on ARCH_UNIPHIER && DM_I2C
+       default y
+       help
+         Support for Panasonic UniPhier FIFO-builtin I2C controller driver.
+         This I2C controller is used on PH1-Pro4 or newer UniPhier SoCs.
index 6f3c86c03859171f940305801f564ff0c2b9e1cd..774bc94a4a7a864acfbdb6a8a5214f34637f7fe7 100644 (file)
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 obj-$(CONFIG_DM_I2C) += i2c-uclass.o
+obj-$(CONFIG_DM_I2C_COMPAT) += i2c-uclass-compat.o
 
 obj-$(CONFIG_SYS_I2C_ADI) += adi_i2c.o
 obj-$(CONFIG_I2C_MV) += mv_i2c.o
@@ -31,4 +32,6 @@ obj-$(CONFIG_SYS_I2C_SANDBOX) += sandbox_i2c.o i2c-emul-uclass.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
+obj-$(CONFIG_SYS_I2C_UNIPHIER) += i2c-uniphier.o
+obj-$(CONFIG_SYS_I2C_UNIPHIER_F) += i2c-uniphier-f.o
 obj-$(CONFIG_SYS_I2C_ZYNQ) += zynq_i2c.o
diff --git a/drivers/i2c/i2c-uclass-compat.c b/drivers/i2c/i2c-uclass-compat.c
new file mode 100644 (file)
index 0000000..223f238
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <i2c.h>
+
+static int cur_busnum;
+
+static int i2c_compat_get_device(uint chip_addr, int alen,
+                                struct udevice **devp)
+{
+       struct dm_i2c_chip *chip;
+       int ret;
+
+       ret = i2c_get_chip_for_busnum(cur_busnum, chip_addr, alen, devp);
+       if (ret)
+               return ret;
+       chip = dev_get_parent_platdata(*devp);
+       if (chip->offset_len != alen) {
+               printf("I2C chip %x: requested alen %d does not match chip offset_len %d\n",
+                      chip_addr, alen, chip->offset_len);
+               return -EADDRNOTAVAIL;
+       }
+
+       return 0;
+}
+
+int i2c_probe(uint8_t chip_addr)
+{
+       struct udevice *bus, *dev;
+       int ret;
+
+       ret = uclass_get_device_by_seq(UCLASS_I2C, cur_busnum, &bus);
+       if (ret) {
+               debug("Cannot find I2C bus %d: err=%d\n", cur_busnum, ret);
+               return ret;
+       }
+
+       if (!bus)
+               return -ENOENT;
+
+       return dm_i2c_probe(bus, chip_addr, 0, &dev);
+}
+
+int i2c_read(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer,
+            int len)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_compat_get_device(chip_addr, alen, &dev);
+       if (ret)
+               return ret;
+
+       return dm_i2c_read(dev, addr, buffer, len);
+}
+
+int i2c_write(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer,
+             int len)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_compat_get_device(chip_addr, alen, &dev);
+       if (ret)
+               return ret;
+
+       return dm_i2c_write(dev, addr, buffer, len);
+}
+
+int i2c_get_bus_num_fdt(int node)
+{
+       struct udevice *bus;
+       int ret;
+
+       ret = uclass_get_device_by_of_offset(UCLASS_I2C, node, &bus);
+       if (ret)
+               return ret;
+
+       return bus->seq;
+}
+
+unsigned int i2c_get_bus_num(void)
+{
+       return cur_busnum;
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+       cur_busnum = bus;
+
+       return 0;
+}
+
+void i2c_init(int speed, int slaveaddr)
+{
+       /* Nothing to do here - the init happens through driver model */
+}
+
+void board_i2c_init(const void *blob)
+{
+       /* Nothing to do here - the init happens through driver model */
+}
index 005bf8662f2b496c1691b36e2a6036219552e1bb..eafa457845df2371bff8a59ce8b20b7d2d32dd82 100644 (file)
@@ -50,7 +50,7 @@ static int i2c_setup_offset(struct dm_i2c_chip *chip, uint offset,
 static int i2c_read_bytewise(struct udevice *dev, uint offset,
                             uint8_t *buffer, int len)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        struct udevice *bus = dev_get_parent(dev);
        struct dm_i2c_ops *ops = i2c_get_ops(bus);
        struct i2c_msg msg[2], *ptr;
@@ -79,7 +79,7 @@ static int i2c_read_bytewise(struct udevice *dev, uint offset,
 static int i2c_write_bytewise(struct udevice *dev, uint offset,
                             const uint8_t *buffer, int len)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        struct udevice *bus = dev_get_parent(dev);
        struct dm_i2c_ops *ops = i2c_get_ops(bus);
        struct i2c_msg msg[1];
@@ -100,9 +100,9 @@ static int i2c_write_bytewise(struct udevice *dev, uint offset,
        return 0;
 }
 
-int i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
+int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        struct udevice *bus = dev_get_parent(dev);
        struct dm_i2c_ops *ops = i2c_get_ops(bus);
        struct i2c_msg msg[2], *ptr;
@@ -130,9 +130,10 @@ int i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
        return ops->xfer(bus, msg, msg_count);
 }
 
-int i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer, int len)
+int dm_i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
+                int len)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        struct udevice *bus = dev_get_parent(dev);
        struct dm_i2c_ops *ops = i2c_get_ops(bus);
        struct i2c_msg msg[1];
@@ -219,10 +220,10 @@ static int i2c_probe_chip(struct udevice *bus, uint chip_addr,
        return ops->xfer(bus, msg, 1);
 }
 
-static int i2c_bind_driver(struct udevice *bus, uint chip_addr,
+static int i2c_bind_driver(struct udevice *bus, uint chip_addr, uint offset_len,
                           struct udevice **devp)
 {
-       struct dm_i2c_chip chip;
+       struct dm_i2c_chip *chip;
        char name[30], *str;
        struct udevice *dev;
        int ret;
@@ -235,11 +236,11 @@ static int i2c_bind_driver(struct udevice *bus, uint chip_addr,
                goto err_bind;
 
        /* Tell the device what we know about it */
-       memset(&chip, '\0', sizeof(chip));
-       chip.chip_addr = chip_addr;
-       chip.offset_len = 1;    /* we assume */
-       ret = device_probe_child(dev, &chip);
-       debug("%s:  device_probe_child: ret=%d\n", __func__, ret);
+       chip = dev_get_parent_platdata(dev);
+       chip->chip_addr = chip_addr;
+       chip->offset_len = offset_len;
+       ret = device_probe(dev);
+       debug("%s:  device_probe: ret=%d\n", __func__, ret);
        if (ret)
                goto err_probe;
 
@@ -247,13 +248,18 @@ static int i2c_bind_driver(struct udevice *bus, uint chip_addr,
        return 0;
 
 err_probe:
+       /*
+        * If the device failed to probe, unbind it. There is nothing there
+        * on the bus so we don't want to leave it lying around
+        */
        device_unbind(dev);
 err_bind:
        free(str);
        return ret;
 }
 
-int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp)
+int i2c_get_chip(struct udevice *bus, uint chip_addr, uint offset_len,
+                struct udevice **devp)
 {
        struct udevice *dev;
 
@@ -261,15 +267,9 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp)
              bus->name, chip_addr);
        for (device_find_first_child(bus, &dev); dev;
                        device_find_next_child(&dev)) {
-               struct dm_i2c_chip store;
-               struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+               struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
                int ret;
 
-               if (!chip) {
-                       chip = &store;
-                       i2c_chip_ofdata_to_platdata(gd->fdt_blob,
-                                                   dev->of_offset, chip);
-               }
                if (chip->chip_addr == chip_addr) {
                        ret = device_probe(dev);
                        debug("found, ret=%d\n", ret);
@@ -280,10 +280,11 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp)
                }
        }
        debug("not found\n");
-       return i2c_bind_driver(bus, chip_addr, devp);
+       return i2c_bind_driver(bus, chip_addr, offset_len, devp);
 }
 
-int i2c_get_chip_for_busnum(int busnum, int chip_addr, struct udevice **devp)
+int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
+                           struct udevice **devp)
 {
        struct udevice *bus;
        int ret;
@@ -293,7 +294,7 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, struct udevice **devp)
                debug("Cannot find I2C bus %d\n", busnum);
                return ret;
        }
-       ret = i2c_get_chip(bus, chip_addr, devp);
+       ret = i2c_get_chip(bus, chip_addr, offset_len, devp);
        if (ret) {
                debug("Cannot find I2C chip %02x on bus %d\n", chip_addr,
                      busnum);
@@ -303,8 +304,8 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, struct udevice **devp)
        return 0;
 }
 
-int i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
-             struct udevice **devp)
+int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
+                struct udevice **devp)
 {
        int ret;
 
@@ -318,7 +319,7 @@ int i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
                return ret;
 
        /* The chip was found, see if we have a driver, and probe it */
-       ret = i2c_get_chip(bus, chip_addr, devp);
+       ret = i2c_get_chip(bus, chip_addr, 1, devp);
        debug("%s:  i2c_get_chip: ret=%d\n", __func__, ret);
 
        return ret;
@@ -364,7 +365,7 @@ int i2c_get_bus_speed(struct udevice *bus)
 int i2c_set_chip_flags(struct udevice *dev, uint flags)
 {
        struct udevice *bus = dev->parent;
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        struct dm_i2c_ops *ops = i2c_get_ops(bus);
        int ret;
 
@@ -380,7 +381,7 @@ int i2c_set_chip_flags(struct udevice *dev, uint flags)
 
 int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
 
        *flagsp = chip->flags;
 
@@ -389,7 +390,7 @@ int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
 
 int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
 {
-       struct dm_i2c_chip *chip = dev_get_parentdata(dev);
+       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
 
        if (offset_len > I2C_MAX_OFFSET_LEN)
                return -EINVAL;
@@ -419,7 +420,8 @@ int i2c_deblock(struct udevice *bus)
 int i2c_chip_ofdata_to_platdata(const void *blob, int node,
                                struct dm_i2c_chip *chip)
 {
-       chip->offset_len = 1;   /* default */
+       chip->offset_len = fdtdec_get_int(gd->fdt_blob, node,
+                                         "u-boot,i2c-offset-len", 1);
        chip->flags = 0;
        chip->chip_addr = fdtdec_get_int(gd->fdt_blob, node, "reg", -1);
        if (chip->chip_addr == -1) {
@@ -441,18 +443,31 @@ static int i2c_post_probe(struct udevice *dev)
        return i2c_set_bus_speed(dev, i2c->speed_hz);
 }
 
-int i2c_post_bind(struct udevice *dev)
+static int i2c_post_bind(struct udevice *dev)
 {
        /* Scan the bus for devices */
        return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
 }
 
+static int i2c_child_post_bind(struct udevice *dev)
+{
+       struct dm_i2c_chip *plat = dev_get_parent_platdata(dev);
+
+       if (dev->of_offset == -1)
+               return 0;
+
+       return i2c_chip_ofdata_to_platdata(gd->fdt_blob, dev->of_offset, plat);
+}
+
 UCLASS_DRIVER(i2c) = {
        .id             = UCLASS_I2C,
        .name           = "i2c",
-       .per_device_auto_alloc_size = sizeof(struct dm_i2c_bus),
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
        .post_bind      = i2c_post_bind,
        .post_probe     = i2c_post_probe,
+       .per_device_auto_alloc_size = sizeof(struct dm_i2c_bus),
+       .per_child_platdata_auto_alloc_size = sizeof(struct dm_i2c_chip),
+       .child_post_bind = i2c_child_post_bind,
 };
 
 UCLASS_DRIVER(i2c_generic) = {
diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
new file mode 100644 (file)
index 0000000..6707edd
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <dm/device.h>
+#include <dm/root.h>
+#include <i2c.h>
+#include <fdtdec.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct uniphier_fi2c_regs {
+       u32 cr;                         /* control register */
+#define I2C_CR_MST     (1 << 3)        /* master mode */
+#define I2C_CR_STA     (1 << 2)        /* start condition */
+#define I2C_CR_STO     (1 << 1)        /* stop condition */
+#define I2C_CR_NACK    (1 << 0)        /* not ACK */
+       u32 dttx;                       /* send FIFO (write-only) */
+#define dtrx           dttx            /* receive FIFO (read-only) */
+#define I2C_DTTX_CMD   (1 << 8)        /* send command (slave addr) */
+#define I2C_DTTX_RD    (1 << 0)        /* read */
+       u32 __reserved;                 /* no register at offset 0x08 */
+       u32 slad;                       /* slave address */
+       u32 cyc;                        /* clock cycle control */
+       u32 lctl;                       /* clock low period control */
+       u32 ssut;                       /* restart/stop setup time control */
+       u32 dsut;                       /* data setup time control */
+       u32 intr;                       /* interrupt status */
+       u32 ie;                         /* interrupt enable */
+       u32 ic;                         /* interrupt clear */
+#define I2C_INT_TE     (1 << 9)        /* TX FIFO empty */
+#define I2C_INT_RB     (1 << 4)        /* received specified bytes */
+#define I2C_INT_NA     (1 << 2)        /* no answer */
+#define I2C_INT_AL     (1 << 1)        /* arbitration lost */
+       u32 sr;                         /* status register */
+#define I2C_SR_DB      (1 << 12)       /* device busy */
+#define I2C_SR_BB      (1 << 8)        /* bus busy */
+#define I2C_SR_RFF     (1 << 3)        /* Rx FIFO full */
+#define I2C_SR_RNE     (1 << 2)        /* Rx FIFO not empty */
+#define I2C_SR_TNF     (1 << 1)        /* Tx FIFO not full */
+#define I2C_SR_TFE     (1 << 0)        /* Tx FIFO empty */
+       u32 __reserved2;                /* no register at offset 0x30 */
+       u32 rst;                        /* reset control */
+#define I2C_RST_TBRST  (1 << 2)        /* clear Tx FIFO */
+#define I2C_RST_RBRST  (1 << 1)        /* clear Rx FIFO */
+#define I2C_RST_RST    (1 << 0)        /* forcible bus reset */
+       u32 bm;                         /* bus monitor */
+       u32 noise;                      /* noise filter control */
+       u32 tbc;                        /* Tx byte count setting */
+       u32 rbc;                        /* Rx byte count setting */
+       u32 tbcm;                       /* Tx byte count monitor */
+       u32 rbcm;                       /* Rx byte count monitor */
+       u32 brst;                       /* bus reset */
+#define I2C_BRST_FOEN  (1 << 1)        /* normal operation */
+#define I2C_BRST_RSCLO (1 << 0)        /* release SCL low fixing */
+};
+
+#define FIOCLK 50000000
+
+struct uniphier_fi2c_dev {
+       struct uniphier_fi2c_regs __iomem *regs;        /* register base */
+       unsigned long fioclk;                   /* internal operation clock */
+       unsigned long timeout;                  /* time out (us) */
+};
+
+static int poll_status(u32 __iomem *reg, u32 flag)
+{
+       int wait = 1000000; /* 1 sec is long enough */
+
+       while (readl(reg) & flag) {
+               if (wait-- < 0)
+                       return -EREMOTEIO;
+               udelay(1);
+       }
+
+       return 0;
+}
+
+static int reset_bus(struct uniphier_fi2c_regs __iomem *regs)
+{
+       int ret;
+
+       /* bus forcible reset */
+       writel(I2C_RST_RST, &regs->rst);
+       ret = poll_status(&regs->rst, I2C_RST_RST);
+       if (ret < 0)
+               debug("error: fail to reset I2C controller\n");
+
+       return ret;
+}
+
+static int check_device_busy(struct uniphier_fi2c_regs __iomem *regs)
+{
+       int ret;
+
+       ret = poll_status(&regs->sr, I2C_SR_DB);
+       if (ret < 0) {
+               debug("error: device busy too long. reset...\n");
+               ret = reset_bus(regs);
+       }
+
+       return ret;
+}
+
+static int uniphier_fi2c_probe(struct udevice *dev)
+{
+       fdt_addr_t addr;
+       fdt_size_t size;
+       struct uniphier_fi2c_dev *priv = dev_get_priv(dev);
+       int ret;
+
+       addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg",
+                                   &size);
+
+       priv->regs = map_sysmem(addr, size);
+
+       if (!priv->regs)
+               return -ENOMEM;
+
+       priv->fioclk = FIOCLK;
+
+       /* bus forcible reset */
+       ret = reset_bus(priv->regs);
+       if (ret < 0)
+               return ret;
+
+       writel(I2C_BRST_FOEN | I2C_BRST_RSCLO, &priv->regs->brst);
+
+       return 0;
+}
+
+static int uniphier_fi2c_remove(struct udevice *dev)
+{
+       struct uniphier_fi2c_dev *priv = dev_get_priv(dev);
+
+       unmap_sysmem(priv->regs);
+
+       return 0;
+}
+
+static int wait_for_irq(struct uniphier_fi2c_dev *dev, u32 flags,
+                       bool *stop)
+{
+       u32 irq;
+       unsigned long wait = dev->timeout;
+       int ret = -EREMOTEIO;
+
+       do {
+               udelay(1);
+               irq = readl(&dev->regs->intr);
+       } while (!(irq & flags) && wait--);
+
+       if (wait < 0) {
+               debug("error: time out\n");
+               return ret;
+       }
+
+       if (irq & I2C_INT_AL) {
+               debug("error: arbitration lost\n");
+               *stop = false;
+               return ret;
+       }
+
+       if (irq & I2C_INT_NA) {
+               debug("error: no answer\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static int issue_stop(struct uniphier_fi2c_dev *dev, int old_ret)
+{
+       int ret;
+
+       debug("stop condition\n");
+       writel(I2C_CR_MST | I2C_CR_STO, &dev->regs->cr);
+
+       ret = poll_status(&dev->regs->sr, I2C_SR_DB);
+       if (ret < 0)
+               debug("error: device busy after operation\n");
+
+       return old_ret ? old_ret : ret;
+}
+
+static int uniphier_fi2c_transmit(struct uniphier_fi2c_dev *dev, uint addr,
+                                 uint len, const u8 *buf, bool *stop)
+{
+       int ret;
+       const u32 irq_flags = I2C_INT_TE | I2C_INT_NA | I2C_INT_AL;
+       struct uniphier_fi2c_regs __iomem *regs = dev->regs;
+
+       debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+
+       writel(I2C_DTTX_CMD | addr << 1, &regs->dttx);
+
+       writel(irq_flags, &regs->ie);
+       writel(irq_flags, &regs->ic);
+
+       debug("start condition\n");
+       writel(I2C_CR_MST | I2C_CR_STA, &regs->cr);
+
+       ret = wait_for_irq(dev, irq_flags, stop);
+       if (ret < 0)
+               goto error;
+
+       while (len--) {
+               debug("sending %x\n", *buf);
+               writel(*buf++, &regs->dttx);
+
+               writel(irq_flags, &regs->ic);
+
+               ret = wait_for_irq(dev, irq_flags, stop);
+               if (ret < 0)
+                       goto error;
+       }
+
+error:
+       writel(irq_flags, &regs->ic);
+
+       if (*stop)
+               ret = issue_stop(dev, ret);
+
+       return ret;
+}
+
+static int uniphier_fi2c_receive(struct uniphier_fi2c_dev *dev, uint addr,
+                                uint len, u8 *buf, bool *stop)
+{
+       int ret = 0;
+       const u32 irq_flags = I2C_INT_RB | I2C_INT_NA | I2C_INT_AL;
+       struct uniphier_fi2c_regs __iomem *regs = dev->regs;
+
+       debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+
+       /*
+        * In case 'len == 0', only the slave address should be sent
+        * for probing, which is covered by the transmit function.
+        */
+       if (len == 0)
+               return uniphier_fi2c_transmit(dev, addr, len, buf, stop);
+
+       writel(I2C_DTTX_CMD | I2C_DTTX_RD | addr << 1, &regs->dttx);
+
+       writel(0, &regs->rbc);
+       writel(irq_flags, &regs->ie);
+       writel(irq_flags, &regs->ic);
+
+       debug("start condition\n");
+       writel(I2C_CR_MST | I2C_CR_STA | (len == 1 ? I2C_CR_NACK : 0),
+              &regs->cr);
+
+       while (len--) {
+               ret = wait_for_irq(dev, irq_flags, stop);
+               if (ret < 0)
+                       goto error;
+
+               *buf++ = readl(&regs->dtrx);
+               debug("received %x\n", *(buf - 1));
+
+               if (len == 1)
+                       writel(I2C_CR_MST | I2C_CR_NACK, &regs->cr);
+
+               writel(irq_flags, &regs->ic);
+       }
+
+error:
+       writel(irq_flags, &regs->ic);
+
+       if (*stop)
+               ret = issue_stop(dev, ret);
+
+       return ret;
+}
+
+static int uniphier_fi2c_xfer(struct udevice *bus, struct i2c_msg *msg,
+                            int nmsgs)
+{
+       int ret;
+       struct uniphier_fi2c_dev *dev = dev_get_priv(bus);
+       bool stop;
+
+       ret = check_device_busy(dev->regs);
+       if (ret < 0)
+               return ret;
+
+       for (; nmsgs > 0; nmsgs--, msg++) {
+               /* If next message is read, skip the stop condition */
+               stop = nmsgs > 1 && msg[1].flags & I2C_M_RD ? false : true;
+
+               if (msg->flags & I2C_M_RD)
+                       ret = uniphier_fi2c_receive(dev, msg->addr, msg->len,
+                                                   msg->buf, &stop);
+               else
+                       ret = uniphier_fi2c_transmit(dev, msg->addr, msg->len,
+                                                    msg->buf, &stop);
+
+               if (ret < 0)
+                       break;
+       }
+
+       return ret;
+}
+
+static int uniphier_fi2c_set_bus_speed(struct udevice *bus, unsigned int speed)
+{
+       int ret;
+       unsigned int clk_count;
+       struct uniphier_fi2c_dev *dev = dev_get_priv(bus);
+       struct uniphier_fi2c_regs __iomem *regs = dev->regs;
+
+       /* max supported frequency is 400 kHz */
+       if (speed > 400000)
+               return -EINVAL;
+
+       ret = check_device_busy(dev->regs);
+       if (ret < 0)
+               return ret;
+
+       /* make sure the bus is idle when changing the frequency */
+       writel(I2C_BRST_RSCLO, &regs->brst);
+
+       clk_count = dev->fioclk / speed;
+
+       writel(clk_count, &regs->cyc);
+       writel(clk_count / 2, &regs->lctl);
+       writel(clk_count / 2, &regs->ssut);
+       writel(clk_count / 16, &regs->dsut);
+
+       writel(I2C_BRST_FOEN | I2C_BRST_RSCLO, &regs->brst);
+
+       /*
+        * Theoretically, each byte can be transferred in
+        * 1000000 * 9 / speed usec.
+        * This time out value is long enough.
+        */
+       dev->timeout = 100000000L / speed;
+
+       return 0;
+}
+
+static const struct dm_i2c_ops uniphier_fi2c_ops = {
+       .xfer = uniphier_fi2c_xfer,
+       .set_bus_speed = uniphier_fi2c_set_bus_speed,
+};
+
+static const struct udevice_id uniphier_fi2c_of_match[] = {
+       { .compatible = "panasonic,uniphier-fi2c" },
+       {},
+};
+
+U_BOOT_DRIVER(uniphier_fi2c) = {
+       .name = "uniphier-fi2c",
+       .id = UCLASS_I2C,
+       .of_match = uniphier_fi2c_of_match,
+       .probe = uniphier_fi2c_probe,
+       .remove = uniphier_fi2c_remove,
+       .priv_auto_alloc_size = sizeof(struct uniphier_fi2c_dev),
+       .ops = &uniphier_fi2c_ops,
+};
diff --git a/drivers/i2c/i2c-uniphier.c b/drivers/i2c/i2c-uniphier.c
new file mode 100644 (file)
index 0000000..64a9ed8
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <linux/types.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <dm/device.h>
+#include <dm/root.h>
+#include <i2c.h>
+#include <fdtdec.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct uniphier_i2c_regs {
+       u32 dtrm;                       /* data transmission */
+#define I2C_DTRM_STA   (1 << 10)
+#define I2C_DTRM_STO   (1 << 9)
+#define I2C_DTRM_NACK  (1 << 8)
+#define I2C_DTRM_RD    (1 << 0)
+       u32 drec;                       /* data reception */
+#define I2C_DREC_STS   (1 << 12)
+#define I2C_DREC_LRB   (1 << 11)
+#define I2C_DREC_LAB   (1 << 9)
+       u32 myad;                       /* slave address */
+       u32 clk;                        /* clock frequency control */
+       u32 brst;                       /* bus reset */
+#define I2C_BRST_FOEN  (1 << 1)
+#define I2C_BRST_BRST  (1 << 0)
+       u32 hold;                       /* hold time control */
+       u32 bsts;                       /* bus status monitor */
+       u32 noise;                      /* noise filter control */
+       u32 setup;                      /* setup time control */
+};
+
+#define IOBUS_FREQ     100000000
+
+struct uniphier_i2c_dev {
+       struct uniphier_i2c_regs __iomem *regs; /* register base */
+       unsigned long input_clk;        /* master clock (Hz) */
+       unsigned long wait_us;          /* wait for every byte transfer (us) */
+};
+
+static int uniphier_i2c_probe(struct udevice *dev)
+{
+       fdt_addr_t addr;
+       fdt_size_t size;
+       struct uniphier_i2c_dev *priv = dev_get_priv(dev);
+
+       addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", &size);
+
+       priv->regs = map_sysmem(addr, size);
+
+       if (!priv->regs)
+               return -ENOMEM;
+
+       priv->input_clk = IOBUS_FREQ;
+
+       /* deassert reset */
+       writel(0x3, &priv->regs->brst);
+
+       return 0;
+}
+
+static int uniphier_i2c_remove(struct udevice *dev)
+{
+       struct uniphier_i2c_dev *priv = dev_get_priv(dev);
+
+       unmap_sysmem(priv->regs);
+
+       return 0;
+}
+
+static int send_and_recv_byte(struct uniphier_i2c_dev *dev, u32 dtrm)
+{
+       writel(dtrm, &dev->regs->dtrm);
+
+       /*
+        * This controller only provides interruption to inform the completion
+        * of each byte transfer.  (No status register to poll it.)
+        * Unfortunately, U-Boot does not have a good support of interrupt.
+        * Wait for a while.
+        */
+       udelay(dev->wait_us);
+
+       return readl(&dev->regs->drec);
+}
+
+static int send_byte(struct uniphier_i2c_dev *dev, u32 dtrm, bool *stop)
+{
+       int ret = 0;
+       u32 drec;
+
+       drec = send_and_recv_byte(dev, dtrm);
+
+       if (drec & I2C_DREC_LAB) {
+               debug("uniphier_i2c: bus arbitration failed\n");
+               *stop = false;
+               ret = -EREMOTEIO;
+       }
+       if (drec & I2C_DREC_LRB) {
+               debug("uniphier_i2c: slave did not return ACK\n");
+               ret = -EREMOTEIO;
+       }
+       return ret;
+}
+
+static int uniphier_i2c_transmit(struct uniphier_i2c_dev *dev, uint addr,
+                                uint len, const u8 *buf, bool *stop)
+{
+       int ret;
+
+       debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+
+       ret = send_byte(dev, I2C_DTRM_STA | I2C_DTRM_NACK | addr << 1, stop);
+       if (ret < 0)
+               goto fail;
+
+       while (len--) {
+               ret = send_byte(dev, I2C_DTRM_NACK | *buf++, stop);
+               if (ret < 0)
+                       goto fail;
+       }
+
+fail:
+       if (*stop)
+               writel(I2C_DTRM_STO | I2C_DTRM_NACK, &dev->regs->dtrm);
+
+       return ret;
+}
+
+static int uniphier_i2c_receive(struct uniphier_i2c_dev *dev, uint addr,
+                               uint len, u8 *buf, bool *stop)
+{
+       int ret;
+
+       debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+
+       ret = send_byte(dev, I2C_DTRM_STA | I2C_DTRM_NACK |
+                       I2C_DTRM_RD | addr << 1, stop);
+       if (ret < 0)
+               goto fail;
+
+       while (len--)
+               *buf++ = send_and_recv_byte(dev, len ? 0 : I2C_DTRM_NACK);
+
+fail:
+       if (*stop)
+               writel(I2C_DTRM_STO | I2C_DTRM_NACK, &dev->regs->dtrm);
+
+       return ret;
+}
+
+static int uniphier_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
+                            int nmsgs)
+{
+       int ret = 0;
+       struct uniphier_i2c_dev *dev = dev_get_priv(bus);
+       bool stop;
+
+       for (; nmsgs > 0; nmsgs--, msg++) {
+               /* If next message is read, skip the stop condition */
+               stop = nmsgs > 1 && msg[1].flags & I2C_M_RD ? false : true;
+
+               if (msg->flags & I2C_M_RD)
+                       ret = uniphier_i2c_receive(dev, msg->addr, msg->len,
+                                                  msg->buf, &stop);
+               else
+                       ret = uniphier_i2c_transmit(dev, msg->addr, msg->len,
+                                                   msg->buf, &stop);
+
+               if (ret < 0)
+                       break;
+       }
+
+       return ret;
+}
+
+static int uniphier_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
+{
+       struct uniphier_i2c_dev *priv = dev_get_priv(bus);
+
+       /* max supported frequency is 400 kHz */
+       if (speed > 400000)
+               return -EINVAL;
+
+       /* bus reset: make sure the bus is idle when change the frequency */
+       writel(0x1, &priv->regs->brst);
+
+       writel((priv->input_clk / speed / 2 << 16) | (priv->input_clk / speed),
+              &priv->regs->clk);
+
+       writel(0x3, &priv->regs->brst);
+
+       /*
+        * Theoretically, each byte can be transferred in
+        * 1000000 * 9 / speed usec.  For safety, wait more than double.
+        */
+       priv->wait_us = 20000000 / speed;
+
+       return 0;
+}
+
+
+static const struct dm_i2c_ops uniphier_i2c_ops = {
+       .xfer = uniphier_i2c_xfer,
+       .set_bus_speed = uniphier_i2c_set_bus_speed,
+};
+
+static const struct udevice_id uniphier_i2c_of_match[] = {
+       { .compatible = "panasonic,uniphier-i2c" },
+       {},
+};
+
+U_BOOT_DRIVER(uniphier_i2c) = {
+       .name = "uniphier-i2c",
+       .id = UCLASS_I2C,
+       .of_match = uniphier_i2c_of_match,
+       .probe = uniphier_i2c_probe,
+       .remove = uniphier_i2c_remove,
+       .priv_auto_alloc_size = sizeof(struct uniphier_i2c_dev),
+       .ops = &uniphier_i2c_ops,
+};
index fd328f054940f3beb2214b76c4f103c9b06377a3..0dd1abcf80fcfe0e87fdb09323907244b3033e15 100644 (file)
@@ -9,8 +9,9 @@
  * as they seem to have the same I2C controller inside.
  * The different address mapping is handled by the s3c24xx.h files below.
  */
-
 #include <common.h>
+#include <errno.h>
+#include <dm.h>
 #include <fdtdec.h>
 #if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 #include <asm/arch/clk.h>
 #define CONFIG_MAX_I2C_NUM 1
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * For SPL boot some boards need i2c before SDRAM is initialised so force
  * variables to live in SRAM
  */
+#ifdef CONFIG_SYS_I2C
 static struct s3c24x0_i2c_bus i2c_bus[CONFIG_MAX_I2C_NUM]
                        __attribute__((section(".data")));
+#endif
+
+enum exynos_i2c_type {
+       EXYNOS_I2C_STD,
+       EXYNOS_I2C_HS,
+};
 
+#ifdef CONFIG_SYS_I2C
 /**
  * Get a pointer to the given bus index
  *
@@ -147,6 +158,7 @@ static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
        debug("Undefined bus: %d\n", bus_idx);
        return NULL;
 }
+#endif
 
 #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 static int GetI2CSDA(void)
@@ -251,6 +263,7 @@ static void ReadWriteByte(struct s3c24x0_i2c *i2c)
        writel(readl(&i2c->iiccon) & ~I2CCON_IRPND, &i2c->iiccon);
 }
 
+#ifdef CONFIG_SYS_I2C
 static struct s3c24x0_i2c *get_base_i2c(int bus)
 {
 #ifdef CONFIG_EXYNOS4
@@ -267,6 +280,7 @@ static struct s3c24x0_i2c *get_base_i2c(int bus)
        return s3c24x0_get_base_i2c();
 #endif
 }
+#endif
 
 static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
 {
@@ -326,7 +340,7 @@ static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)
                        return 0;
                }
        }
-       return -1;
+       return -EINVAL;
 }
 
 static void hsi2c_ch_init(struct s3c24x0_i2c_bus *i2c_bus)
@@ -398,18 +412,20 @@ static void exynos5_i2c_reset(struct s3c24x0_i2c_bus *i2c_bus)
        hsi2c_ch_init(i2c_bus);
 }
 
+#ifdef CONFIG_SYS_I2C
 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 */
        i2c = get_base_i2c(adap->hwadapnr);
+       bus = &i2c_bus[adap->hwadapnr];
+       if (!bus)
+               return;
 
        /*
         * In case the previous transfer is still going, wait to give it a
@@ -470,12 +486,13 @@ static void s3c24x0_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
 #endif
        }
 #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;
 }
+#endif /* CONFIG_SYS_I2C */
 
 /*
  * Poll the appropriate bit of the fifo status register until the interface is
@@ -698,20 +715,27 @@ static int hsi2c_read(struct exynos5_hsi2c *i2c,
        return rv;
 }
 
+#ifdef CONFIG_SYS_I2C
 static unsigned int s3c24x0_i2c_set_bus_speed(struct i2c_adapter *adap,
-                                         unsigned int speed)
+                                             unsigned int speed)
+#else
+static int s3c24x0_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
+#endif
 {
        struct s3c24x0_i2c_bus *i2c_bus;
 
+#ifdef CONFIG_SYS_I2C
        i2c_bus = get_bus(adap->hwadapnr);
        if (!i2c_bus)
-               return -1;
-
+               return -EFAULT;
+#else
+       i2c_bus = dev_get_priv(dev);
+#endif
        i2c_bus->clock_frequency = speed;
 
        if (i2c_bus->is_highspeed) {
                if (hsi2c_get_clk_details(i2c_bus))
-                       return -1;
+                       return -EFAULT;
                hsi2c_ch_init(i2c_bus);
        } else {
                i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
@@ -721,17 +745,6 @@ static unsigned int s3c24x0_i2c_set_bus_speed(struct i2c_adapter *adap,
        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.
  *
@@ -844,15 +857,23 @@ bailout:
        return result;
 }
 
+#ifdef CONFIG_SYS_I2C
 static int s3c24x0_i2c_probe(struct i2c_adapter *adap, uchar chip)
+#else
+static int s3c24x0_i2c_probe(struct udevice *dev, uint chip, uint chip_flags)
+#endif
 {
        struct s3c24x0_i2c_bus *i2c_bus;
        uchar buf[1];
        int ret;
 
+#ifdef CONFIG_SYS_I2C
        i2c_bus = get_bus(adap->hwadapnr);
        if (!i2c_bus)
-               return -1;
+               return -EFAULT;
+#else
+       i2c_bus = dev_get_priv(dev);
+#endif
        buf[0] = 0;
 
        /*
@@ -871,6 +892,7 @@ static int s3c24x0_i2c_probe(struct i2c_adapter *adap, uchar chip)
        return ret != I2C_OK;
 }
 
+#ifdef CONFIG_SYS_I2C
 static int s3c24x0_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
                            int alen, uchar *buffer, int len)
 {
@@ -878,9 +900,13 @@ static int s3c24x0_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
        uchar xaddr[4];
        int ret;
 
+       i2c_bus = get_bus(adap->hwadapnr);
+       if (!i2c_bus)
+               return -EFAULT;
+
        if (alen > 4) {
                debug("I2C read: addr len %d not supported\n", alen);
-               return 1;
+               return -EADDRNOTAVAIL;
        }
 
        if (alen > 0) {
@@ -906,10 +932,6 @@ static int s3c24x0_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
                chip |= ((addr >> (alen * 8)) &
                         CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
 #endif
-       i2c_bus = get_bus(adap->hwadapnr);
-       if (!i2c_bus)
-               return -1;
-
        if (i2c_bus->is_highspeed)
                ret = hsi2c_read(i2c_bus->hsregs, chip, &xaddr[4 - alen],
                                 alen, buffer, len);
@@ -921,7 +943,7 @@ static int s3c24x0_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
                if (i2c_bus->is_highspeed)
                        exynos5_i2c_reset(i2c_bus);
                debug("I2c read failed %d\n", ret);
-               return 1;
+               return -EIO;
        }
        return 0;
 }
@@ -933,9 +955,13 @@ static int s3c24x0_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
        uchar xaddr[4];
        int ret;
 
+       i2c_bus = get_bus(adap->hwadapnr);
+       if (!i2c_bus)
+               return -EFAULT;
+
        if (alen > 4) {
                debug("I2C write: addr len %d not supported\n", alen);
-               return 1;
+               return -EINVAL;
        }
 
        if (alen > 0) {
@@ -960,10 +986,6 @@ static int s3c24x0_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
                chip |= ((addr >> (alen * 8)) &
                         CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
 #endif
-       i2c_bus = get_bus(adap->hwadapnr);
-       if (!i2c_bus)
-               return -1;
-
        if (i2c_bus->is_highspeed)
                ret = hsi2c_write(i2c_bus->hsregs, chip, &xaddr[4 - alen],
                                  alen, buffer, len, true);
@@ -985,7 +1007,7 @@ static void process_nodes(const void *blob, int node_list[], int count,
                         int is_highspeed)
 {
        struct s3c24x0_i2c_bus *bus;
-       int i;
+       int i, flags;
 
        for (i = 0; i < count; i++) {
                int node = node_list[i];
@@ -997,12 +1019,15 @@ static void process_nodes(const void *blob, int node_list[], int count,
                bus->active = true;
                bus->is_highspeed = is_highspeed;
 
-               if (is_highspeed)
+               if (is_highspeed) {
+                       flags = PINMUX_FLAG_HS_MODE;
                        bus->hsregs = (struct exynos5_hsi2c *)
                                        fdtdec_get_addr(blob, node, "reg");
-               else
+               } else {
+                       flags = 0;
                        bus->regs = (struct s3c24x0_i2c *)
                                        fdtdec_get_addr(blob, node, "reg");
+               }
 
                bus->id = pinmux_decode_periph_id(blob, node);
                bus->clock_frequency = fdtdec_get_int(blob, node,
@@ -1010,7 +1035,7 @@ static void process_nodes(const void *blob, int node_list[], int count,
                                                CONFIG_SYS_I2C_S3C24X0_SPEED);
                bus->node = node;
                bus->bus_num = i;
-               exynos_pinmux_config(bus->id, 0);
+               exynos_pinmux_config(PERIPH_ID_I2C0 + bus->id, flags);
 
                /* Mark position as used */
                node_list[i] = -1;
@@ -1033,7 +1058,6 @@ void board_i2c_init(const void *blob)
                COMPAT_SAMSUNG_EXYNOS5_I2C, node_list,
                CONFIG_MAX_I2C_NUM);
        process_nodes(blob, node_list, count, 1);
-
 }
 
 int i2c_get_bus_num_fdt(int node)
@@ -1046,7 +1070,7 @@ int i2c_get_bus_num_fdt(int node)
        }
 
        debug("%s: Can't find any matched I2C bus\n", __func__);
-       return -1;
+       return -EINVAL;
 }
 
 int i2c_reset_port_fdt(const void *blob, int node)
@@ -1057,18 +1081,18 @@ int i2c_reset_port_fdt(const void *blob, int node)
        bus = i2c_get_bus_num_fdt(node);
        if (bus < 0) {
                debug("could not get bus for node %d\n", node);
-               return -1;
+               return bus;
        }
 
        i2c_bus = get_bus(bus);
        if (!i2c_bus) {
-               debug("get_bus() failed for node node %d\n", node);
-               return -1;
+               debug("get_bus() failed for node %d\n", node);
+               return -EFAULT;
        }
 
        if (i2c_bus->is_highspeed) {
                if (hsi2c_get_clk_details(i2c_bus))
-                       return -1;
+                       return -EINVAL;
                hsi2c_ch_init(i2c_bus);
        } else {
                i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
@@ -1077,7 +1101,17 @@ int i2c_reset_port_fdt(const void *blob, int node)
 
        return 0;
 }
-#endif
+#endif /* CONFIG_OF_CONTROL */
+
+#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))
+               error("i2c_init: failed to init bus for speed = %d", speed);
+}
+#endif /* CONFIG_EXYNOS5 */
 
 /*
  * Register s3c24x0 i2c adapters
@@ -1247,3 +1281,120 @@ U_BOOT_I2C_ADAP_COMPLETE(s3c0, s3c24x0_i2c_init, s3c24x0_i2c_probe,
                        CONFIG_SYS_I2C_S3C24X0_SPEED,
                        CONFIG_SYS_I2C_S3C24X0_SLAVE, 0)
 #endif
+#endif /* CONFIG_SYS_I2C */
+
+#ifdef CONFIG_DM_I2C
+static int i2c_write_data(struct s3c24x0_i2c_bus *i2c_bus, uchar chip,
+                         uchar *buffer, int len, bool end_with_repeated_start)
+{
+       int ret;
+
+       if (i2c_bus->is_highspeed) {
+               ret = hsi2c_write(i2c_bus->hsregs, chip, 0, 0,
+                                 buffer, len, true);
+               if (ret)
+                       exynos5_i2c_reset(i2c_bus);
+       } else {
+               ret = i2c_transfer(i2c_bus->regs, I2C_WRITE,
+                                  chip << 1, 0, 0, buffer, len);
+       }
+
+       return ret != I2C_OK;
+}
+
+static int i2c_read_data(struct s3c24x0_i2c_bus  *i2c_bus, uchar chip,
+                        uchar *buffer, int len)
+{
+       int ret;
+
+       if (i2c_bus->is_highspeed) {
+               ret = hsi2c_read(i2c_bus->hsregs, chip, 0, 0, buffer, len);
+               if (ret)
+                       exynos5_i2c_reset(i2c_bus);
+       } else {
+               ret = i2c_transfer(i2c_bus->regs, I2C_READ,
+                                  chip << 1, 0, 0, buffer, len);
+       }
+
+       return ret != I2C_OK;
+}
+
+static int s3c24x0_i2c_xfer(struct udevice *dev, struct i2c_msg *msg,
+                           int nmsgs)
+{
+       struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev);
+       int ret;
+
+       for (; nmsgs > 0; nmsgs--, msg++) {
+               bool next_is_read = nmsgs > 1 && (msg[1].flags & I2C_M_RD);
+
+               if (msg->flags & I2C_M_RD) {
+                       ret = i2c_read_data(i2c_bus, msg->addr, msg->buf,
+                                           msg->len);
+               } else {
+                       ret = i2c_write_data(i2c_bus, msg->addr, msg->buf,
+                                            msg->len, next_is_read);
+               }
+               if (ret)
+                       return -EREMOTEIO;
+       }
+
+       return 0;
+}
+
+static int s3c_i2c_ofdata_to_platdata(struct udevice *dev)
+{
+       const void *blob = gd->fdt_blob;
+       struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev);
+       int node, flags;
+
+       i2c_bus->is_highspeed = dev->of_id->data;
+       node = dev->of_offset;
+
+       if (i2c_bus->is_highspeed) {
+               flags = PINMUX_FLAG_HS_MODE;
+               i2c_bus->hsregs = (struct exynos5_hsi2c *)
+                               fdtdec_get_addr(blob, node, "reg");
+       } else {
+               flags = 0;
+               i2c_bus->regs = (struct s3c24x0_i2c *)
+                               fdtdec_get_addr(blob, node, "reg");
+       }
+
+       i2c_bus->id = pinmux_decode_periph_id(blob, node);
+
+       i2c_bus->clock_frequency = fdtdec_get_int(blob, node,
+                                               "clock-frequency",
+                                               CONFIG_SYS_I2C_S3C24X0_SPEED);
+       i2c_bus->node = node;
+       i2c_bus->bus_num = dev->seq;
+
+       exynos_pinmux_config(i2c_bus->id, flags);
+
+       i2c_bus->active = true;
+
+       return 0;
+}
+
+static const struct dm_i2c_ops s3c_i2c_ops = {
+       .xfer           = s3c24x0_i2c_xfer,
+       .probe_chip     = s3c24x0_i2c_probe,
+       .set_bus_speed  = s3c24x0_i2c_set_bus_speed,
+};
+
+static const struct udevice_id s3c_i2c_ids[] = {
+       { .compatible = "samsung,s3c2440-i2c", .data = EXYNOS_I2C_STD },
+       { .compatible = "samsung,exynos5-hsi2c", .data = EXYNOS_I2C_HS },
+       { }
+};
+
+U_BOOT_DRIVER(i2c_s3c) = {
+       .name   = "i2c_s3c",
+       .id     = UCLASS_I2C,
+       .of_match = s3c_i2c_ids,
+       .ofdata_to_platdata = s3c_i2c_ofdata_to_platdata,
+       .per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
+       .priv_auto_alloc_size = sizeof(struct s3c24x0_i2c_bus),
+       .ops    = &s3c_i2c_ops,
+};
+#endif /* CONFIG_DM_I2C */
index f0e9f51a1f28fda9822e765a5821b095f6badfef..a943aa6382142b4ebf411bc7c11ad7a9dbd9d80a 100644 (file)
@@ -25,24 +25,24 @@ struct dm_sandbox_i2c_emul_priv {
 static int get_emul(struct udevice *dev, struct udevice **devp,
                    struct dm_i2c_ops **opsp)
 {
-       struct dm_i2c_chip *priv;
+       struct dm_i2c_chip *plat;
        int ret;
 
        *devp = NULL;
        *opsp = NULL;
-       priv = dev_get_parentdata(dev);
-       if (!priv->emul) {
+       plat = dev_get_parent_platdata(dev);
+       if (!plat->emul) {
                ret = dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset,
                                       false);
                if (ret)
                        return ret;
 
-               ret = device_get_child(dev, 0, &priv->emul);
+               ret = device_get_child(dev, 0, &plat->emul);
                if (ret)
                        return ret;
        }
-       *devp = priv->emul;
-       *opsp = i2c_get_ops(priv->emul);
+       *devp = plat->emul;
+       *opsp = i2c_get_ops(plat->emul);
 
        return 0;
 }
@@ -60,7 +60,7 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
        if (msg->addr == SANDBOX_I2C_TEST_ADDR)
                return 0;
 
-       ret = i2c_get_chip(bus, msg->addr, &dev);
+       ret = i2c_get_chip(bus, msg->addr, 1, &dev);
        if (ret)
                return ret;
 
@@ -82,20 +82,6 @@ static const struct dm_i2c_ops sandbox_i2c_ops = {
        .xfer           = sandbox_i2c_xfer,
 };
 
-static int sandbox_i2c_child_pre_probe(struct udevice *dev)
-{
-       struct dm_i2c_chip *i2c_chip = dev_get_parentdata(dev);
-
-       /* Ignore our test address */
-       if (i2c_chip->chip_addr == SANDBOX_I2C_TEST_ADDR)
-               return 0;
-       if (dev->of_offset == -1)
-               return 0;
-
-       return i2c_chip_ofdata_to_platdata(gd->fdt_blob, dev->of_offset,
-                                          i2c_chip);
-}
-
 static const struct udevice_id sandbox_i2c_ids[] = {
        { .compatible = "sandbox,i2c" },
        { }
@@ -105,7 +91,5 @@ U_BOOT_DRIVER(i2c_sandbox) = {
        .name   = "i2c_sandbox",
        .id     = UCLASS_I2C,
        .of_match = sandbox_i2c_ids,
-       .per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
-       .child_pre_probe = sandbox_i2c_child_pre_probe,
        .ops    = &sandbox_i2c_ops,
 };
index 87290c3127612c3369f8e98c383118f0e3229563..f4142870b304037273cb405f36e9ad2a39819d4b 100644 (file)
@@ -484,21 +484,6 @@ static const struct dm_i2c_ops tegra_i2c_ops = {
        .set_bus_speed  = tegra_i2c_set_bus_speed,
 };
 
-static int tegra_i2c_child_pre_probe(struct udevice *dev)
-{
-       struct dm_i2c_chip *i2c_chip = dev_get_parentdata(dev);
-
-       if (dev->of_offset == -1)
-               return 0;
-       return i2c_chip_ofdata_to_platdata(gd->fdt_blob, dev->of_offset,
-                                          i2c_chip);
-}
-
-static int tegra_i2c_ofdata_to_platdata(struct udevice *dev)
-{
-       return 0;
-}
-
 static const struct udevice_id tegra_i2c_ids[] = {
        { .compatible = "nvidia,tegra114-i2c", .data = TYPE_114 },
        { .compatible = "nvidia,tegra20-i2c", .data = TYPE_STD },
@@ -510,10 +495,7 @@ U_BOOT_DRIVER(i2c_tegra) = {
        .name   = "i2c_tegra",
        .id     = UCLASS_I2C,
        .of_match = tegra_i2c_ids,
-       .ofdata_to_platdata = tegra_i2c_ofdata_to_platdata,
        .probe  = tegra_i2c_probe,
-       .per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
-       .child_pre_probe = tegra_i2c_child_pre_probe,
        .priv_auto_alloc_size = sizeof(struct i2c_bus),
        .ops    = &tegra_i2c_ops,
 };
index 9b4effb2fb56cda2fcba39d1a5ee80fe084384b8..5846e76c49525549f784ef6645834fa6b6611e5d 100644 (file)
@@ -154,7 +154,9 @@ static int prepare_proto3_response_buffer(struct cros_ec_dev *dev, int din_len)
  * @param dev          CROS-EC device
  * @param dinp          Returns pointer to response data
  * @param din_len       Maximum size of response in bytes
- * @return number of bytes of response data, or <0 if error
+ * @return number of bytes of response data, or <0 if error. Note that error
+ * codes can be from errno.h or -ve EC_RES_INVALID_CHECKSUM values (and they
+ * overlap!)
  */
 static int handle_proto3_response(struct cros_ec_dev *dev,
                                  uint8_t **dinp, int din_len)
@@ -228,7 +230,7 @@ static int send_command_proto3(struct cros_ec_dev *dev,
 
 #ifdef CONFIG_DM_CROS_EC
        ops = dm_cros_ec_get_ops(dev->dev);
-       rv = ops->packet(dev->dev, out_bytes, in_bytes);
+       rv = ops->packet ? ops->packet(dev->dev, out_bytes, in_bytes) : -ENOSYS;
 #else
        switch (dev->interface) {
 #ifdef CONFIG_CROS_EC_SPI
@@ -320,7 +322,7 @@ static int send_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
  *                     If not NULL, it will be updated to point to the data
  *                     and will always be double word aligned (64-bits)
  * @param din_len       Maximum size of response in bytes
- * @return number of bytes in response, or -1 on error
+ * @return number of bytes in response, or -ve on error
  */
 static int ec_command_inptr(struct cros_ec_dev *dev, uint8_t cmd,
                int cmd_version, const void *dout, int dout_len, uint8_t **dinp,
@@ -387,7 +389,7 @@ static int ec_command_inptr(struct cros_ec_dev *dev, uint8_t cmd,
  *                     It not NULL, it is a place for ec_command() to copy the
  *      data to.
  * @param din_len       Maximum size of response in bytes
- * @return number of bytes in response, or -1 on error
+ * @return number of bytes in response, or -ve on error
  */
 static int ec_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
                      const void *dout, int dout_len,
@@ -606,10 +608,10 @@ int cros_ec_reboot(struct cros_ec_dev *dev, enum ec_reboot_cmd cmd,
 int cros_ec_interrupt_pending(struct cros_ec_dev *dev)
 {
        /* no interrupt support : always poll */
-       if (!fdt_gpio_isvalid(&dev->ec_int))
+       if (!dm_gpio_is_valid(&dev->ec_int))
                return -ENOENT;
 
-       return !gpio_get_value(dev->ec_int.gpio);
+       return dm_gpio_get_value(&dev->ec_int);
 }
 
 int cros_ec_info(struct cros_ec_dev *dev, struct ec_response_mkbp_info *info)
@@ -1072,7 +1074,8 @@ static int cros_ec_decode_fdt(const void *blob, int node,
                return -1;
        }
 
-       fdtdec_decode_gpio(blob, node, "ec-interrupt", &dev->ec_int);
+       gpio_request_by_name_nodev(blob, node, "ec-interrupt", 0, &dev->ec_int,
+                                  GPIOD_IS_IN);
        dev->optimise_flash_write = fdtdec_get_bool(blob, node,
                                                    "optimise-flash-write");
        *devp = dev;
@@ -1090,17 +1093,11 @@ int cros_ec_register(struct udevice *dev)
        char id[MSG_BYTES];
 
        cdev->dev = dev;
-       fdtdec_decode_gpio(blob, node, "ec-interrupt", &cdev->ec_int);
+       gpio_request_by_name(dev, "ec-interrupt", 0, &cdev->ec_int,
+                            GPIOD_IS_IN);
        cdev->optimise_flash_write = fdtdec_get_bool(blob, node,
                                                     "optimise-flash-write");
 
-       /* we will poll the EC interrupt line */
-       fdtdec_setup_gpio(&cdev->ec_int);
-       if (fdt_gpio_isvalid(&cdev->ec_int)) {
-               gpio_request(cdev->ec_int.gpio, "cros-ec-irq");
-               gpio_direction_input(cdev->ec_int.gpio);
-       }
-
        if (cros_ec_check_version(cdev)) {
                debug("%s: Could not detect CROS-EC version\n", __func__);
                return -CROS_EC_ERR_CHECK_VERSION;
@@ -1184,13 +1181,6 @@ int cros_ec_init(const void *blob, struct cros_ec_dev **cros_ecp)
        }
 #endif
 
-       /* we will poll the EC interrupt line */
-       fdtdec_setup_gpio(&dev->ec_int);
-       if (fdt_gpio_isvalid(&dev->ec_int)) {
-               gpio_request(dev->ec_int.gpio, "cros-ec-irq");
-               gpio_direction_input(dev->ec_int.gpio);
-       }
-
        if (cros_ec_check_version(dev)) {
                debug("%s: Could not detect CROS-EC version\n", __func__);
                return -CROS_EC_ERR_CHECK_VERSION;
index 513cdb1cb09808be69ac6a44be2cb651ad9ac347..f9bc9750d4cb2e617eab6fb4f4dd126d64c9e2b5 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <i2c.h>
 #include <cros_ec.h>
 
 #define debug_trace(fmt, b...)
 #endif
 
-int cros_ec_i2c_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
-                    const uint8_t *dout, int dout_len,
-                    uint8_t **dinp, int din_len)
+static int cros_ec_i2c_command(struct udevice *udev, uint8_t cmd,
+                              int cmd_version, const uint8_t *dout,
+                              int dout_len, uint8_t **dinp, int din_len)
 {
-       int old_bus = 0;
+       struct cros_ec_dev *dev = udev->uclass_priv;
        /* version8, cmd8, arglen8, out8[dout_len], csum8 */
        int out_bytes = dout_len + 4;
        /* response8, arglen8, in8[din_len], checksum8 */
@@ -37,8 +38,6 @@ int cros_ec_i2c_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
        uint8_t *in_ptr;
        int len, csum, ret;
 
-       old_bus = i2c_get_bus_num();
-
        /*
         * Sanity-check I/O sizes given transaction overhead in internal
         * buffers.
@@ -86,36 +85,24 @@ int cros_ec_i2c_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
        *ptr++ = (uint8_t)
                cros_ec_calc_checksum(dev->dout, dout_len + 3);
 
-       /* Set to the proper i2c bus */
-       if (i2c_set_bus_num(dev->bus_num)) {
-               debug("%s: Cannot change to I2C bus %d\n", __func__,
-                       dev->bus_num);
-               return -1;
-       }
-
        /* Send output data */
        cros_ec_dump_data("out", -1, dev->dout, out_bytes);
-       ret = i2c_write(dev->addr, 0, 0, dev->dout, out_bytes);
+       ret = dm_i2c_write(udev, 0, dev->dout, out_bytes);
        if (ret) {
-               debug("%s: Cannot complete I2C write to 0x%x\n",
-                       __func__, dev->addr);
+               debug("%s: Cannot complete I2C write to %s\n", __func__,
+                     udev->name);
                ret = -1;
        }
 
        if (!ret) {
-               ret = i2c_read(dev->addr, 0, 0, in_ptr, in_bytes);
+               ret = dm_i2c_read(udev, 0, in_ptr, in_bytes);
                if (ret) {
-                       debug("%s: Cannot complete I2C read from 0x%x\n",
-                               __func__, dev->addr);
+                       debug("%s: Cannot complete I2C read from %s\n",
+                             __func__, udev->name);
                        ret = -1;
                }
        }
 
-       /* Return to original bus number */
-       i2c_set_bus_num(old_bus);
-       if (ret)
-               return ret;
-
        if (*in_ptr != EC_RES_SUCCESS) {
                debug("%s: Received bad result code %d\n", __func__, *in_ptr);
                return -(int)*in_ptr;
@@ -142,35 +129,24 @@ int cros_ec_i2c_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
        return din_len;
 }
 
-int cros_ec_i2c_decode_fdt(struct cros_ec_dev *dev, const void *blob)
+static int cros_ec_probe(struct udevice *dev)
 {
-       /* Decode interface-specific FDT params */
-       dev->max_frequency = fdtdec_get_int(blob, dev->node,
-                                           "i2c-max-frequency", 100000);
-       dev->bus_num = i2c_get_bus_num_fdt(dev->parent_node);
-       if (dev->bus_num == -1) {
-               debug("%s: Failed to read bus number\n", __func__);
-               return -1;
-       }
-       dev->addr = fdtdec_get_int(blob, dev->node, "reg", -1);
-       if (dev->addr == -1) {
-               debug("%s: Failed to read device address\n", __func__);
-               return -1;
-       }
-
-       return 0;
+       return cros_ec_register(dev);
 }
 
-/**
- * Initialize I2C protocol.
- *
- * @param dev          CROS_EC device
- * @param blob         Device tree blob
- * @return 0 if ok, -1 on error
- */
-int cros_ec_i2c_init(struct cros_ec_dev *dev, const void *blob)
-{
-       i2c_init(dev->max_frequency, dev->addr);
-
-       return 0;
-}
+static struct dm_cros_ec_ops cros_ec_ops = {
+       .command = cros_ec_i2c_command,
+};
+
+static const struct udevice_id cros_ec_ids[] = {
+       { .compatible = "google,cros-ec" },
+       { }
+};
+
+U_BOOT_DRIVER(cros_ec_i2c) = {
+       .name           = "cros_ec",
+       .id             = UCLASS_CROS_EC,
+       .of_match       = cros_ec_ids,
+       .probe          = cros_ec_probe,
+       .ops            = &cros_ec_ops,
+};
index e6dba298b1e9f2a37b31b4511cf9c8902c9ff227..9359c56e876d03ed2f798e137df43975afcd2f5d 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_DM_CROS_EC
 int cros_ec_spi_packet(struct udevice *udev, int out_bytes, int in_bytes)
 {
        struct cros_ec_dev *dev = udev->uclass_priv;
-#else
-int cros_ec_spi_packet(struct cros_ec_dev *dev, int out_bytes, int in_bytes)
-{
-#endif
        struct spi_slave *slave = dev_get_parentdata(dev->dev);
        int rv;
 
@@ -67,18 +62,11 @@ int cros_ec_spi_packet(struct cros_ec_dev *dev, int out_bytes, int in_bytes)
  * @param din_len      Maximum size of response in bytes
  * @return number of bytes in response, or -1 on error
  */
-#ifdef CONFIG_DM_CROS_EC
 int cros_ec_spi_command(struct udevice *udev, uint8_t cmd, int cmd_version,
                     const uint8_t *dout, int dout_len,
                     uint8_t **dinp, int din_len)
 {
        struct cros_ec_dev *dev = udev->uclass_priv;
-#else
-int cros_ec_spi_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
-                    const uint8_t *dout, int dout_len,
-                    uint8_t **dinp, int din_len)
-{
-#endif
        struct spi_slave *slave = dev_get_parentdata(dev->dev);
        int in_bytes = din_len + 4;     /* status, length, checksum, trailer */
        uint8_t *out;
@@ -166,65 +154,12 @@ int cros_ec_spi_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
        return len;
 }
 
-#ifndef CONFIG_DM_CROS_EC
-int cros_ec_spi_decode_fdt(struct cros_ec_dev *dev, const void *blob)
+static int cros_ec_probe(struct udevice *dev)
 {
-       /* Decode interface-specific FDT params */
-       dev->max_frequency = fdtdec_get_int(blob, dev->node,
-                                           "spi-max-frequency", 500000);
-       dev->cs = fdtdec_get_int(blob, dev->node, "reg", 0);
-
-       return 0;
-}
-
-/**
- * Initialize SPI protocol.
- *
- * @param dev          CROS_EC device
- * @param blob         Device tree blob
- * @return 0 if ok, -1 on error
- */
-int cros_ec_spi_init(struct cros_ec_dev *dev, const void *blob)
-{
-       int ret;
-
-       ret = spi_setup_slave_fdt(blob, dev->node, dev->parent_node,
-                                 &slave);
-       if (ret) {
-               debug("%s: Could not setup SPI slave\n", __func__);
-               return ret;
-       }
-
-       return 0;
-}
-#endif
-
-#ifdef CONFIG_DM_CROS_EC
-int cros_ec_probe(struct udevice *dev)
-{
-       struct spi_slave *slave = dev_get_parentdata(dev);
-       int ret;
-
-       /*
-        * TODO(sjg@chromium.org)
-        *
-        * This is really horrible at present. It is an artifact of removing
-        * the child_pre_probe() method for SPI. Everything here could go in
-        * an automatic function, except that spi_get_bus_and_cs() wants to
-        * set it up manually and call device_probe_child().
-        *
-        * The solution may be to re-enable the child_pre_probe() method for
-        * SPI and have it do nothing if the child is already passed in via
-        * device_probe_child().
-        */
-       slave->dev = dev;
-       ret = spi_ofdata_to_platdata(gd->fdt_blob, dev->of_offset, slave);
-       if (ret)
-               return ret;
        return cros_ec_register(dev);
 }
 
-struct dm_cros_ec_ops cros_ec_ops = {
+static struct dm_cros_ec_ops cros_ec_ops = {
        .packet = cros_ec_spi_packet,
        .command = cros_ec_spi_command,
 };
@@ -241,4 +176,3 @@ U_BOOT_DRIVER(cros_ec_spi) = {
        .probe          = cros_ec_probe,
        .ops            = &cros_ec_ops,
 };
-#endif
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7ba85a2b62c45b5f968dbddc1994d7f174163e9a 100644 (file)
@@ -0,0 +1,9 @@
+menu "MMC Host controller Support"
+
+config SH_SDHI
+       bool "SuperH/Renesas ARM SoCs on-chip SDHI host controller support"
+       depends on RMOBILE
+       help
+         Support for the on-chip SDHI host controller on SuperH/Renesas ARM SoCs platform
+
+endmenu
index 461d7d8ec1c1d626d977e18166a6fbd9cee663c6..4ba58789361f369d5b1c608d0a71d8543ff76f21 100644 (file)
@@ -30,6 +30,7 @@ obj-$(CONFIG_S3C_SDI) += s3c_sdi.o
 obj-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
 obj-$(CONFIG_SDHCI) += sdhci.o
 obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
+obj-$(CONFIG_SH_SDHI) += sh_sdhi.o
 obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
 obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
 obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
index 1eb9c2733948bf954aa00414824aa491adc4a4e3..b8039cd092abd43a14022f0a1e7a646198c30aa6 100644 (file)
@@ -486,7 +486,7 @@ static int mmc_change_freq(struct mmc *mmc)
        char cardtype;
        int err;
 
-       mmc->card_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
+       mmc->card_caps = 0;
 
        if (mmc_host_is_spi(mmc))
                return 0;
@@ -495,6 +495,8 @@ static int mmc_change_freq(struct mmc *mmc)
        if (mmc->version < MMC_VERSION_4)
                return 0;
 
+       mmc->card_caps |= MMC_MODE_4BIT | MMC_MODE_8BIT;
+
        err = mmc_send_ext_csd(mmc, ext_csd);
 
        if (err)
@@ -605,6 +607,200 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
        return ret;
 }
 
+int mmc_hwpart_config(struct mmc *mmc,
+                     const struct mmc_hwpart_conf *conf,
+                     enum mmc_hwpart_conf_mode mode)
+{
+       u8 part_attrs = 0;
+       u32 enh_size_mult;
+       u32 enh_start_addr;
+       u32 gp_size_mult[4];
+       u32 max_enh_size_mult;
+       u32 tot_enh_size_mult = 0;
+       u8 wr_rel_set;
+       int i, pidx, err;
+       ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
+
+       if (mode < MMC_HWPART_CONF_CHECK || mode > MMC_HWPART_CONF_COMPLETE)
+               return -EINVAL;
+
+       if (IS_SD(mmc) || (mmc->version < MMC_VERSION_4_41)) {
+               printf("eMMC >= 4.4 required for enhanced user data area\n");
+               return -EMEDIUMTYPE;
+       }
+
+       if (!(mmc->part_support & PART_SUPPORT)) {
+               printf("Card does not support partitioning\n");
+               return -EMEDIUMTYPE;
+       }
+
+       if (!mmc->hc_wp_grp_size) {
+               printf("Card does not define HC WP group size\n");
+               return -EMEDIUMTYPE;
+       }
+
+       /* check partition alignment and total enhanced size */
+       if (conf->user.enh_size) {
+               if (conf->user.enh_size % mmc->hc_wp_grp_size ||
+                   conf->user.enh_start % mmc->hc_wp_grp_size) {
+                       printf("User data enhanced area not HC WP group "
+                              "size aligned\n");
+                       return -EINVAL;
+               }
+               part_attrs |= EXT_CSD_ENH_USR;
+               enh_size_mult = conf->user.enh_size / mmc->hc_wp_grp_size;
+               if (mmc->high_capacity) {
+                       enh_start_addr = conf->user.enh_start;
+               } else {
+                       enh_start_addr = (conf->user.enh_start << 9);
+               }
+       } else {
+               enh_size_mult = 0;
+               enh_start_addr = 0;
+       }
+       tot_enh_size_mult += enh_size_mult;
+
+       for (pidx = 0; pidx < 4; pidx++) {
+               if (conf->gp_part[pidx].size % mmc->hc_wp_grp_size) {
+                       printf("GP%i partition not HC WP group size "
+                              "aligned\n", pidx+1);
+                       return -EINVAL;
+               }
+               gp_size_mult[pidx] = conf->gp_part[pidx].size / mmc->hc_wp_grp_size;
+               if (conf->gp_part[pidx].size && conf->gp_part[pidx].enhanced) {
+                       part_attrs |= EXT_CSD_ENH_GP(pidx);
+                       tot_enh_size_mult += gp_size_mult[pidx];
+               }
+       }
+
+       if (part_attrs && ! (mmc->part_support & ENHNCD_SUPPORT)) {
+               printf("Card does not support enhanced attribute\n");
+               return -EMEDIUMTYPE;
+       }
+
+       err = mmc_send_ext_csd(mmc, ext_csd);
+       if (err)
+               return err;
+
+       max_enh_size_mult =
+               (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT+2] << 16) +
+               (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT+1] << 8) +
+               ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT];
+       if (tot_enh_size_mult > max_enh_size_mult) {
+               printf("Total enhanced size exceeds maximum (%u > %u)\n",
+                      tot_enh_size_mult, max_enh_size_mult);
+               return -EMEDIUMTYPE;
+       }
+
+       /* The default value of EXT_CSD_WR_REL_SET is device
+        * dependent, the values can only be changed if the
+        * EXT_CSD_HS_CTRL_REL bit is set. The values can be
+        * changed only once and before partitioning is completed. */
+       wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
+       if (conf->user.wr_rel_change) {
+               if (conf->user.wr_rel_set)
+                       wr_rel_set |= EXT_CSD_WR_DATA_REL_USR;
+               else
+                       wr_rel_set &= ~EXT_CSD_WR_DATA_REL_USR;
+       }
+       for (pidx = 0; pidx < 4; pidx++) {
+               if (conf->gp_part[pidx].wr_rel_change) {
+                       if (conf->gp_part[pidx].wr_rel_set)
+                               wr_rel_set |= EXT_CSD_WR_DATA_REL_GP(pidx);
+                       else
+                               wr_rel_set &= ~EXT_CSD_WR_DATA_REL_GP(pidx);
+               }
+       }
+
+       if (wr_rel_set != ext_csd[EXT_CSD_WR_REL_SET] &&
+           !(ext_csd[EXT_CSD_WR_REL_PARAM] & EXT_CSD_HS_CTRL_REL)) {
+               puts("Card does not support host controlled partition write "
+                    "reliability settings\n");
+               return -EMEDIUMTYPE;
+       }
+
+       if (ext_csd[EXT_CSD_PARTITION_SETTING] &
+           EXT_CSD_PARTITION_SETTING_COMPLETED) {
+               printf("Card already partitioned\n");
+               return -EPERM;
+       }
+
+       if (mode == MMC_HWPART_CONF_CHECK)
+               return 0;
+
+       /* Partitioning requires high-capacity size definitions */
+       if (!(ext_csd[EXT_CSD_ERASE_GROUP_DEF] & 0x01)) {
+               err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                                EXT_CSD_ERASE_GROUP_DEF, 1);
+
+               if (err)
+                       return err;
+
+               ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1;
+
+               /* update erase group size to be high-capacity */
+               mmc->erase_grp_size =
+                       ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] * 1024;
+
+       }
+
+       /* all OK, write the configuration */
+       for (i = 0; i < 4; i++) {
+               err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                                EXT_CSD_ENH_START_ADDR+i,
+                                (enh_start_addr >> (i*8)) & 0xFF);
+               if (err)
+                       return err;
+       }
+       for (i = 0; i < 3; i++) {
+               err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                                EXT_CSD_ENH_SIZE_MULT+i,
+                                (enh_size_mult >> (i*8)) & 0xFF);
+               if (err)
+                       return err;
+       }
+       for (pidx = 0; pidx < 4; pidx++) {
+               for (i = 0; i < 3; i++) {
+                       err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                                        EXT_CSD_GP_SIZE_MULT+pidx*3+i,
+                                        (gp_size_mult[pidx] >> (i*8)) & 0xFF);
+                       if (err)
+                               return err;
+               }
+       }
+       err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                        EXT_CSD_PARTITIONS_ATTRIBUTE, part_attrs);
+       if (err)
+               return err;
+
+       if (mode == MMC_HWPART_CONF_SET)
+               return 0;
+
+       /* The WR_REL_SET is a write-once register but shall be
+        * written before setting PART_SETTING_COMPLETED. As it is
+        * write-once we can only write it when completing the
+        * partitioning. */
+       if (wr_rel_set != ext_csd[EXT_CSD_WR_REL_SET]) {
+               err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                                EXT_CSD_WR_REL_SET, wr_rel_set);
+               if (err)
+                       return err;
+       }
+
+       /* Setting PART_SETTING_COMPLETED confirms the partition
+        * configuration but it only becomes effective after power
+        * cycle, so we do not adjust the partition related settings
+        * in the mmc struct. */
+
+       err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
+                        EXT_CSD_PARTITION_SETTING,
+                        EXT_CSD_PARTITION_SETTING_COMPLETED);
+       if (err)
+               return err;
+
+       return 0;
+}
+
 int mmc_getcd(struct mmc *mmc)
 {
        int cd;
@@ -818,6 +1014,8 @@ static int mmc_startup(struct mmc *mmc)
        ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
        ALLOC_CACHE_ALIGN_BUFFER(u8, test_csd, MMC_MAX_BLOCK_LEN);
        int timeout = 1000;
+       bool has_parts = false;
+       bool part_completed;
 
 #ifdef CONFIG_MMC_SPI_CRC_ON
        if (mmc_host_is_spi(mmc)) { /* enable CRC check for spi */
@@ -970,7 +1168,9 @@ static int mmc_startup(struct mmc *mmc)
        if (!IS_SD(mmc) && (mmc->version >= MMC_VERSION_4)) {
                /* check  ext_csd version and capacity */
                err = mmc_send_ext_csd(mmc, ext_csd);
-               if (!err && (ext_csd[EXT_CSD_REV] >= 2)) {
+               if (err)
+                       return err;
+               if (ext_csd[EXT_CSD_REV] >= 2) {
                        /*
                         * According to the JEDEC Standard, the value of
                         * ext_csd's capacity is valid if the value is more
@@ -1006,13 +1206,70 @@ static int mmc_startup(struct mmc *mmc)
                        break;
                }
 
+               /* The partition data may be non-zero but it is only
+                * effective if PARTITION_SETTING_COMPLETED is set in
+                * EXT_CSD, so ignore any data if this bit is not set,
+                * except for enabling the high-capacity group size
+                * definition (see below). */
+               part_completed = !!(ext_csd[EXT_CSD_PARTITION_SETTING] &
+                                   EXT_CSD_PARTITION_SETTING_COMPLETED);
+
+               /* store the partition info of emmc */
+               mmc->part_support = ext_csd[EXT_CSD_PARTITIONING_SUPPORT];
+               if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) ||
+                   ext_csd[EXT_CSD_BOOT_MULT])
+                       mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
+               if (part_completed &&
+                   (ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & ENHNCD_SUPPORT))
+                       mmc->part_attr = ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE];
+
+               mmc->capacity_boot = ext_csd[EXT_CSD_BOOT_MULT] << 17;
+
+               mmc->capacity_rpmb = ext_csd[EXT_CSD_RPMB_MULT] << 17;
+
+               for (i = 0; i < 4; i++) {
+                       int idx = EXT_CSD_GP_SIZE_MULT + i * 3;
+                       uint mult = (ext_csd[idx + 2] << 16) +
+                               (ext_csd[idx + 1] << 8) + ext_csd[idx];
+                       if (mult)
+                               has_parts = true;
+                       if (!part_completed)
+                               continue;
+                       mmc->capacity_gp[i] = mult;
+                       mmc->capacity_gp[i] *=
+                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
+                       mmc->capacity_gp[i] *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
+                       mmc->capacity_gp[i] <<= 19;
+               }
+
+               if (part_completed) {
+                       mmc->enh_user_size =
+                               (ext_csd[EXT_CSD_ENH_SIZE_MULT+2] << 16) +
+                               (ext_csd[EXT_CSD_ENH_SIZE_MULT+1] << 8) +
+                               ext_csd[EXT_CSD_ENH_SIZE_MULT];
+                       mmc->enh_user_size *= ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
+                       mmc->enh_user_size *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
+                       mmc->enh_user_size <<= 19;
+                       mmc->enh_user_start =
+                               (ext_csd[EXT_CSD_ENH_START_ADDR+3] << 24) +
+                               (ext_csd[EXT_CSD_ENH_START_ADDR+2] << 16) +
+                               (ext_csd[EXT_CSD_ENH_START_ADDR+1] << 8) +
+                               ext_csd[EXT_CSD_ENH_START_ADDR];
+                       if (mmc->high_capacity)
+                               mmc->enh_user_start <<= 9;
+               }
+
                /*
                 * Host needs to enable ERASE_GRP_DEF bit if device is
                 * partitioned. This bit will be lost every time after a reset
                 * or power off. This will affect erase size.
                 */
+               if (part_completed)
+                       has_parts = true;
                if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) &&
-                   (ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE] & PART_ENH_ATTRIB)) {
+                   (ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE] & PART_ENH_ATTRIB))
+                       has_parts = true;
+               if (has_parts) {
                        err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
                                EXT_CSD_ERASE_GROUP_DEF, 1);
 
@@ -1020,19 +1277,18 @@ static int mmc_startup(struct mmc *mmc)
                                return err;
                        else
                                ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1;
+               }
 
+               if (ext_csd[EXT_CSD_ERASE_GROUP_DEF] & 0x01) {
                        /* Read out group size from ext_csd */
                        mmc->erase_grp_size =
-                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] *
-                                       MMC_MAX_BLOCK_LEN * 1024;
+                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] * 1024;
                        /*
                         * if high capacity and partition setting completed
                         * SEC_COUNT is valid even if it is smaller than 2 GiB
                         * JEDEC Standard JESD84-B45, 6.2.4
                         */
-                       if (mmc->high_capacity &&
-                           (ext_csd[EXT_CSD_PARTITION_SETTING] &
-                            EXT_CSD_PARTITION_SETTING_COMPLETED)) {
+                       if (mmc->high_capacity && part_completed) {
                                capacity = (ext_csd[EXT_CSD_SEC_CNT]) |
                                        (ext_csd[EXT_CSD_SEC_CNT + 1] << 8) |
                                        (ext_csd[EXT_CSD_SEC_CNT + 2] << 16) |
@@ -1049,23 +1305,11 @@ static int mmc_startup(struct mmc *mmc)
                                * (erase_gmul + 1);
                }
 
-               /* store the partition info of emmc */
-               if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) ||
-                   ext_csd[EXT_CSD_BOOT_MULT])
-                       mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
-
-               mmc->capacity_boot = ext_csd[EXT_CSD_BOOT_MULT] << 17;
-
-               mmc->capacity_rpmb = ext_csd[EXT_CSD_RPMB_MULT] << 17;
+               mmc->hc_wp_grp_size = 1024
+                       * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]
+                       * ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
 
-               for (i = 0; i < 4; i++) {
-                       int idx = EXT_CSD_GP_SIZE_MULT + i * 3;
-                       mmc->capacity_gp[i] = (ext_csd[idx + 2] << 16) +
-                               (ext_csd[idx + 1] << 8) + ext_csd[idx];
-                       mmc->capacity_gp[i] *=
-                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
-                       mmc->capacity_gp[i] *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
-               }
+               mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
        }
 
        err = mmc_set_capacity(mmc, mmc->part_num);
@@ -1107,7 +1351,8 @@ static int mmc_startup(struct mmc *mmc)
                        mmc->tran_speed = 50000000;
                else
                        mmc->tran_speed = 25000000;
-       } else {
+       } else if (mmc->version >= MMC_VERSION_4) {
+               /* Only version 4 of MMC supports wider bus widths */
                int idx;
 
                /* An array of possible bus widths in order of preference */
@@ -1138,6 +1383,18 @@ static int mmc_startup(struct mmc *mmc)
                        unsigned int extw = ext_csd_bits[idx];
                        unsigned int caps = ext_to_hostcaps[extw];
 
+                       /*
+                        * If the bus width is still not changed,
+                        * don't try to set the default again.
+                        * Otherwise, recover from switch attempts
+                        * by switching to 1-bit bus width.
+                        */
+                       if (extw == EXT_CSD_BUS_WIDTH_1 &&
+                                       mmc->bus_width == 1) {
+                               err = 0;
+                               break;
+                       }
+
                        /*
                         * Check to make sure the card and controller support
                         * these capabilities
index a5d34876bbb6d7633f4a8f3dac3c9f21a6b82753..3899372e0e44a82ab9df970fb95e0292fbc19d29 100644 (file)
@@ -102,17 +102,14 @@ struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
 
 static int do_sdhci_init(struct sdhci_host *host)
 {
-       char str[20];
        int dev_id, flag;
        int err = 0;
 
        flag = host->bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
        dev_id = host->index + PERIPH_ID_SDMMC0;
 
-       if (fdt_gpio_isvalid(&host->pwr_gpio)) {
-               sprintf(str, "sdhci%d_power", host->index & 0xf);
-               gpio_request(host->pwr_gpio.gpio, str);
-               gpio_direction_output(host->pwr_gpio.gpio, 1);
+       if (dm_gpio_is_valid(&host->pwr_gpio)) {
+               dm_gpio_set_value(&host->pwr_gpio, 1);
                err = exynos_pinmux_config(dev_id, flag);
                if (err) {
                        debug("MMC not configured\n");
@@ -120,11 +117,8 @@ static int do_sdhci_init(struct sdhci_host *host)
                }
        }
 
-       if (fdt_gpio_isvalid(&host->cd_gpio)) {
-               sprintf(str, "sdhci%d_cd", host->index & 0xf);
-               gpio_request(host->cd_gpio.gpio, str);
-               gpio_direction_input(host->cd_gpio.gpio);
-               if (gpio_get_value(host->cd_gpio.gpio))
+       if (dm_gpio_is_valid(&host->cd_gpio)) {
+               if (dm_gpio_get_value(&host->cd_gpio))
                        return -ENODEV;
 
                err = exynos_pinmux_config(dev_id, flag);
@@ -166,8 +160,10 @@ static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host)
        }
        host->ioaddr = (void *)base;
 
-       fdtdec_decode_gpio(blob, node, "pwr-gpios", &host->pwr_gpio);
-       fdtdec_decode_gpio(blob, node, "cd-gpios", &host->cd_gpio);
+       gpio_request_by_name_nodev(blob, node, "pwr-gpios", 0, &host->pwr_gpio,
+                                  GPIOD_IS_OUT);
+       gpio_request_by_name_nodev(blob, node, "cd-gpios", 0, &host->cd_gpio,
+                                  GPIOD_IS_IN);
 
        return 0;
 }
diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
new file mode 100644 (file)
index 0000000..cc62c89
--- /dev/null
@@ -0,0 +1,695 @@
+/*
+ * drivers/mmc/sh_sdhi.c
+ *
+ * SD/MMC driver for Renesas rmobile ARM SoCs.
+ *
+ * Copyright (C) 2011,2013-2014 Renesas Electronics Corporation
+ * Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+ * Copyright (C) 2008-2009 Renesas Solutions Corp.
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <mmc.h>
+#include <asm/errno.h>
+#include <asm/io.h>
+#include <asm/arch/rmobile.h>
+#include <asm/arch/sh_sdhi.h>
+
+#define DRIVER_NAME "sh-sdhi"
+
+struct sh_sdhi_host {
+       unsigned long addr;
+       int ch;
+       int bus_shift;
+       unsigned long quirks;
+       unsigned char wait_int;
+       unsigned char sd_error;
+       unsigned char detect_waiting;
+};
+static inline void sh_sdhi_writew(struct sh_sdhi_host *host, int reg, u16 val)
+{
+       writew(val, host->addr + (reg << host->bus_shift));
+}
+
+static inline u16 sh_sdhi_readw(struct sh_sdhi_host *host, int reg)
+{
+       return readw(host->addr + (reg << host->bus_shift));
+}
+
+static void *mmc_priv(struct mmc *mmc)
+{
+       return (void *)mmc->priv;
+}
+
+static void sh_sdhi_detect(struct sh_sdhi_host *host)
+{
+       sh_sdhi_writew(host, SDHI_OPTION,
+                      OPT_BUS_WIDTH_1 | sh_sdhi_readw(host, SDHI_OPTION));
+
+       host->detect_waiting = 0;
+}
+
+static int sh_sdhi_intr(void *dev_id)
+{
+       struct sh_sdhi_host *host = dev_id;
+       int state1 = 0, state2 = 0;
+
+       state1 = sh_sdhi_readw(host, SDHI_INFO1);
+       state2 = sh_sdhi_readw(host, SDHI_INFO2);
+
+       debug("%s: state1 = %x, state2 = %x\n", __func__, state1, state2);
+
+       /* CARD Insert */
+       if (state1 & INFO1_CARD_IN) {
+               sh_sdhi_writew(host, SDHI_INFO1, ~INFO1_CARD_IN);
+               if (!host->detect_waiting) {
+                       host->detect_waiting = 1;
+                       sh_sdhi_detect(host);
+               }
+               sh_sdhi_writew(host, SDHI_INFO1_MASK, INFO1M_RESP_END |
+                              INFO1M_ACCESS_END | INFO1M_CARD_IN |
+                              INFO1M_DATA3_CARD_RE | INFO1M_DATA3_CARD_IN);
+               return -EAGAIN;
+       }
+       /* CARD Removal */
+       if (state1 & INFO1_CARD_RE) {
+               sh_sdhi_writew(host, SDHI_INFO1, ~INFO1_CARD_RE);
+               if (!host->detect_waiting) {
+                       host->detect_waiting = 1;
+                       sh_sdhi_detect(host);
+               }
+               sh_sdhi_writew(host, SDHI_INFO1_MASK, INFO1M_RESP_END |
+                              INFO1M_ACCESS_END | INFO1M_CARD_RE |
+                              INFO1M_DATA3_CARD_RE | INFO1M_DATA3_CARD_IN);
+               sh_sdhi_writew(host, SDHI_SDIO_INFO1_MASK, SDIO_INFO1M_ON);
+               sh_sdhi_writew(host, SDHI_SDIO_MODE, SDIO_MODE_OFF);
+               return -EAGAIN;
+       }
+
+       if (state2 & INFO2_ALL_ERR) {
+               sh_sdhi_writew(host, SDHI_INFO2,
+                              (unsigned short)~(INFO2_ALL_ERR));
+               sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                              INFO2M_ALL_ERR |
+                              sh_sdhi_readw(host, SDHI_INFO2_MASK));
+               host->sd_error = 1;
+               host->wait_int = 1;
+               return 0;
+       }
+       /* Respons End */
+       if (state1 & INFO1_RESP_END) {
+               sh_sdhi_writew(host, SDHI_INFO1, ~INFO1_RESP_END);
+               sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                              INFO1M_RESP_END |
+                              sh_sdhi_readw(host, SDHI_INFO1_MASK));
+               host->wait_int = 1;
+               return 0;
+       }
+       /* SD_BUF Read Enable */
+       if (state2 & INFO2_BRE_ENABLE) {
+               sh_sdhi_writew(host, SDHI_INFO2, ~INFO2_BRE_ENABLE);
+               sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                              INFO2M_BRE_ENABLE | INFO2M_BUF_ILL_READ |
+                              sh_sdhi_readw(host, SDHI_INFO2_MASK));
+               host->wait_int = 1;
+               return 0;
+       }
+       /* SD_BUF Write Enable */
+       if (state2 & INFO2_BWE_ENABLE) {
+               sh_sdhi_writew(host, SDHI_INFO2, ~INFO2_BWE_ENABLE);
+               sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                              INFO2_BWE_ENABLE | INFO2M_BUF_ILL_WRITE |
+                              sh_sdhi_readw(host, SDHI_INFO2_MASK));
+               host->wait_int = 1;
+               return 0;
+       }
+       /* Access End */
+       if (state1 & INFO1_ACCESS_END) {
+               sh_sdhi_writew(host, SDHI_INFO1, ~INFO1_ACCESS_END);
+               sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                              INFO1_ACCESS_END |
+                              sh_sdhi_readw(host, SDHI_INFO1_MASK));
+               host->wait_int = 1;
+               return 0;
+       }
+       return -EAGAIN;
+}
+
+static int sh_sdhi_wait_interrupt_flag(struct sh_sdhi_host *host)
+{
+       int timeout = 10000000;
+
+       while (1) {
+               timeout--;
+               if (timeout < 0) {
+                       debug(DRIVER_NAME": %s timeout\n", __func__);
+                       return 0;
+               }
+
+               if (!sh_sdhi_intr(host))
+                       break;
+
+               udelay(1);      /* 1 usec */
+       }
+
+       return 1; /* Return value: NOT 0 = complete waiting */
+}
+
+static int sh_sdhi_clock_control(struct sh_sdhi_host *host, unsigned long clk)
+{
+       u32 clkdiv, i, timeout;
+
+       if (sh_sdhi_readw(host, SDHI_INFO2) & (1 << 14)) {
+               printf(DRIVER_NAME": Busy state ! Cannot change the clock\n");
+               return -EBUSY;
+       }
+
+       sh_sdhi_writew(host, SDHI_CLK_CTRL,
+                      ~CLK_ENABLE & sh_sdhi_readw(host, SDHI_CLK_CTRL));
+
+       if (clk == 0)
+               return -EIO;
+
+       clkdiv = 0x80;
+       i = CONFIG_SH_SDHI_FREQ >> (0x8 + 1);
+       for (; clkdiv && clk >= (i << 1); (clkdiv >>= 1))
+               i <<= 1;
+
+       sh_sdhi_writew(host, SDHI_CLK_CTRL, clkdiv);
+
+       timeout = 100000;
+       /* Waiting for SD Bus busy to be cleared */
+       while (timeout--) {
+               if ((sh_sdhi_readw(host, SDHI_INFO2) & 0x2000))
+                       break;
+       }
+
+       if (timeout)
+               sh_sdhi_writew(host, SDHI_CLK_CTRL,
+                              CLK_ENABLE | sh_sdhi_readw(host, SDHI_CLK_CTRL));
+       else
+               return -EBUSY;
+
+       return 0;
+}
+
+static int sh_sdhi_sync_reset(struct sh_sdhi_host *host)
+{
+       u32 timeout;
+       sh_sdhi_writew(host, SDHI_SOFT_RST, SOFT_RST_ON);
+       sh_sdhi_writew(host, SDHI_SOFT_RST, SOFT_RST_OFF);
+       sh_sdhi_writew(host, SDHI_CLK_CTRL,
+                      CLK_ENABLE | sh_sdhi_readw(host, SDHI_CLK_CTRL));
+
+       timeout = 100000;
+       while (timeout--) {
+               if (!(sh_sdhi_readw(host, SDHI_INFO2) & INFO2_CBUSY))
+                       break;
+               udelay(100);
+       }
+
+       if (!timeout)
+               return -EBUSY;
+
+       if (host->quirks & SH_SDHI_QUIRK_16BIT_BUF)
+               sh_sdhi_writew(host, SDHI_HOST_MODE, 1);
+
+       return 0;
+}
+
+static int sh_sdhi_error_manage(struct sh_sdhi_host *host)
+{
+       unsigned short e_state1, e_state2;
+       int ret;
+
+       host->sd_error = 0;
+       host->wait_int = 0;
+
+       e_state1 = sh_sdhi_readw(host, SDHI_ERR_STS1);
+       e_state2 = sh_sdhi_readw(host, SDHI_ERR_STS2);
+       if (e_state2 & ERR_STS2_SYS_ERROR) {
+               if (e_state2 & ERR_STS2_RES_STOP_TIMEOUT)
+                       ret = TIMEOUT;
+               else
+                       ret = -EILSEQ;
+               debug("%s: ERR_STS2 = %04x\n",
+                     DRIVER_NAME, sh_sdhi_readw(host, SDHI_ERR_STS2));
+               sh_sdhi_sync_reset(host);
+
+               sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                              INFO1M_DATA3_CARD_RE | INFO1M_DATA3_CARD_IN);
+               return ret;
+       }
+       if (e_state1 & ERR_STS1_CRC_ERROR || e_state1 & ERR_STS1_CMD_ERROR)
+               ret = -EILSEQ;
+       else
+               ret = TIMEOUT;
+
+       debug("%s: ERR_STS1 = %04x\n",
+             DRIVER_NAME, sh_sdhi_readw(host, SDHI_ERR_STS1));
+       sh_sdhi_sync_reset(host);
+       sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                      INFO1M_DATA3_CARD_RE | INFO1M_DATA3_CARD_IN);
+       return ret;
+}
+
+static int sh_sdhi_single_read(struct sh_sdhi_host *host, struct mmc_data *data)
+{
+       long time;
+       unsigned short blocksize, i;
+       unsigned short *p = (unsigned short *)data->dest;
+
+       if ((unsigned long)p & 0x00000001) {
+               debug(DRIVER_NAME": %s: The data pointer is unaligned.",
+                     __func__);
+               return -EIO;
+       }
+
+       host->wait_int = 0;
+       sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                      ~(INFO2M_BRE_ENABLE | INFO2M_BUF_ILL_READ) &
+                      sh_sdhi_readw(host, SDHI_INFO2_MASK));
+       sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                      ~INFO1M_ACCESS_END &
+                      sh_sdhi_readw(host, SDHI_INFO1_MASK));
+       time = sh_sdhi_wait_interrupt_flag(host);
+       if (time == 0 || host->sd_error != 0)
+               return sh_sdhi_error_manage(host);
+
+       host->wait_int = 0;
+       blocksize = sh_sdhi_readw(host, SDHI_SIZE);
+       for (i = 0; i < blocksize / 2; i++)
+               *p++ = sh_sdhi_readw(host, SDHI_BUF0);
+
+       time = sh_sdhi_wait_interrupt_flag(host);
+       if (time == 0 || host->sd_error != 0)
+               return sh_sdhi_error_manage(host);
+
+       host->wait_int = 0;
+       return 0;
+}
+
+static int sh_sdhi_multi_read(struct sh_sdhi_host *host, struct mmc_data *data)
+{
+       long time;
+       unsigned short blocksize, i, sec;
+       unsigned short *p = (unsigned short *)data->dest;
+
+       if ((unsigned long)p & 0x00000001) {
+               debug(DRIVER_NAME": %s: The data pointer is unaligned.",
+                     __func__);
+               return -EIO;
+       }
+
+       debug("%s: blocks = %d, blocksize = %d\n",
+             __func__, data->blocks, data->blocksize);
+
+       host->wait_int = 0;
+       for (sec = 0; sec < data->blocks; sec++) {
+               sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                              ~(INFO2M_BRE_ENABLE | INFO2M_BUF_ILL_READ) &
+                              sh_sdhi_readw(host, SDHI_INFO2_MASK));
+
+               time = sh_sdhi_wait_interrupt_flag(host);
+               if (time == 0 || host->sd_error != 0)
+                       return sh_sdhi_error_manage(host);
+
+               host->wait_int = 0;
+               blocksize = sh_sdhi_readw(host, SDHI_SIZE);
+               for (i = 0; i < blocksize / 2; i++)
+                       *p++ = sh_sdhi_readw(host, SDHI_BUF0);
+       }
+
+       return 0;
+}
+
+static int sh_sdhi_single_write(struct sh_sdhi_host *host,
+               struct mmc_data *data)
+{
+       long time;
+       unsigned short blocksize, i;
+       const unsigned short *p = (const unsigned short *)data->src;
+
+       if ((unsigned long)p & 0x00000001) {
+               debug(DRIVER_NAME": %s: The data pointer is unaligned.",
+                     __func__);
+               return -EIO;
+       }
+
+       debug("%s: blocks = %d, blocksize = %d\n",
+             __func__, data->blocks, data->blocksize);
+
+       host->wait_int = 0;
+       sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                      ~(INFO2M_BWE_ENABLE | INFO2M_BUF_ILL_WRITE) &
+                      sh_sdhi_readw(host, SDHI_INFO2_MASK));
+       sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                      ~INFO1M_ACCESS_END &
+                      sh_sdhi_readw(host, SDHI_INFO1_MASK));
+
+       time = sh_sdhi_wait_interrupt_flag(host);
+       if (time == 0 || host->sd_error != 0)
+               return sh_sdhi_error_manage(host);
+
+       host->wait_int = 0;
+       blocksize = sh_sdhi_readw(host, SDHI_SIZE);
+       for (i = 0; i < blocksize / 2; i++)
+               sh_sdhi_writew(host, SDHI_BUF0, *p++);
+
+       time = sh_sdhi_wait_interrupt_flag(host);
+       if (time == 0 || host->sd_error != 0)
+               return sh_sdhi_error_manage(host);
+
+       host->wait_int = 0;
+       return 0;
+}
+
+static int sh_sdhi_multi_write(struct sh_sdhi_host *host, struct mmc_data *data)
+{
+       long time;
+       unsigned short i, sec, blocksize;
+       const unsigned short *p = (const unsigned short *)data->src;
+
+       debug("%s: blocks = %d, blocksize = %d\n",
+             __func__, data->blocks, data->blocksize);
+
+       host->wait_int = 0;
+       for (sec = 0; sec < data->blocks; sec++) {
+               sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                              ~(INFO2M_BWE_ENABLE | INFO2M_BUF_ILL_WRITE) &
+                              sh_sdhi_readw(host, SDHI_INFO2_MASK));
+
+               time = sh_sdhi_wait_interrupt_flag(host);
+               if (time == 0 || host->sd_error != 0)
+                       return sh_sdhi_error_manage(host);
+
+               host->wait_int = 0;
+               blocksize = sh_sdhi_readw(host, SDHI_SIZE);
+               for (i = 0; i < blocksize / 2; i++)
+                       sh_sdhi_writew(host, SDHI_BUF0, *p++);
+       }
+
+       return 0;
+}
+
+static void sh_sdhi_get_response(struct sh_sdhi_host *host, struct mmc_cmd *cmd)
+{
+       unsigned short i, j, cnt = 1;
+       unsigned short resp[8];
+       unsigned long *p1, *p2;
+
+       if (cmd->resp_type & MMC_RSP_136) {
+               cnt = 4;
+               resp[0] = sh_sdhi_readw(host, SDHI_RSP00);
+               resp[1] = sh_sdhi_readw(host, SDHI_RSP01);
+               resp[2] = sh_sdhi_readw(host, SDHI_RSP02);
+               resp[3] = sh_sdhi_readw(host, SDHI_RSP03);
+               resp[4] = sh_sdhi_readw(host, SDHI_RSP04);
+               resp[5] = sh_sdhi_readw(host, SDHI_RSP05);
+               resp[6] = sh_sdhi_readw(host, SDHI_RSP06);
+               resp[7] = sh_sdhi_readw(host, SDHI_RSP07);
+
+               /* SDHI REGISTER SPECIFICATION */
+               for (i = 7, j = 6; i > 0; i--) {
+                       resp[i] = (resp[i] << 8) & 0xff00;
+                       resp[i] |= (resp[j--] >> 8) & 0x00ff;
+               }
+               resp[0] = (resp[0] << 8) & 0xff00;
+
+               /* SDHI REGISTER SPECIFICATION */
+               p1 = ((unsigned long *)resp) + 3;
+
+       } else {
+               resp[0] = sh_sdhi_readw(host, SDHI_RSP00);
+               resp[1] = sh_sdhi_readw(host, SDHI_RSP01);
+
+               p1 = ((unsigned long *)resp);
+       }
+
+       p2 = (unsigned long *)cmd->response;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       for (i = 0; i < cnt; i++) {
+               *p2++ = ((*p1 >> 16) & 0x0000ffff) |
+                               ((*p1 << 16) & 0xffff0000);
+               p1--;
+       }
+#else
+       for (i = 0; i < cnt; i++)
+               *p2++ = *p1--;
+#endif /* __BIG_ENDIAN_BITFIELD */
+}
+
+static unsigned short sh_sdhi_set_cmd(struct sh_sdhi_host *host,
+                       struct mmc_data *data, unsigned short opc)
+{
+       switch (opc) {
+       case SD_CMD_APP_SEND_OP_COND:
+       case SD_CMD_APP_SEND_SCR:
+               opc |= SDHI_APP;
+               break;
+       case SD_CMD_APP_SET_BUS_WIDTH:
+                /* SD_APP_SET_BUS_WIDTH*/
+               if (!data)
+                       opc |= SDHI_APP;
+               else /* SD_SWITCH */
+                       opc = SDHI_SD_SWITCH;
+               break;
+       default:
+               break;
+       }
+       return opc;
+}
+
+static unsigned short sh_sdhi_data_trans(struct sh_sdhi_host *host,
+                       struct mmc_data *data, unsigned short opc)
+{
+       unsigned short ret;
+
+       switch (opc) {
+       case MMC_CMD_READ_MULTIPLE_BLOCK:
+               ret = sh_sdhi_multi_read(host, data);
+               break;
+       case MMC_CMD_WRITE_MULTIPLE_BLOCK:
+               ret = sh_sdhi_multi_write(host, data);
+               break;
+       case MMC_CMD_WRITE_SINGLE_BLOCK:
+               ret = sh_sdhi_single_write(host, data);
+               break;
+       case MMC_CMD_READ_SINGLE_BLOCK:
+       case SDHI_SD_APP_SEND_SCR:
+       case SDHI_SD_SWITCH: /* SD_SWITCH */
+               ret = sh_sdhi_single_read(host, data);
+               break;
+       default:
+               printf(DRIVER_NAME": SD: NOT SUPPORT CMD = d'%04d\n", opc);
+               ret = -EINVAL;
+               break;
+       }
+       return ret;
+}
+
+static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
+                       struct mmc_data *data, struct mmc_cmd *cmd)
+{
+       long time;
+       unsigned short opc = cmd->cmdidx;
+       int ret = 0;
+       unsigned long timeout;
+
+       debug("opc = %d, arg = %x, resp_type = %x\n",
+             opc, cmd->cmdarg, cmd->resp_type);
+
+       if (opc == MMC_CMD_STOP_TRANSMISSION) {
+               /* SDHI sends the STOP command automatically by STOP reg */
+               sh_sdhi_writew(host, SDHI_INFO1_MASK, ~INFO1M_ACCESS_END &
+                              sh_sdhi_readw(host, SDHI_INFO1_MASK));
+
+               time = sh_sdhi_wait_interrupt_flag(host);
+               if (time == 0 || host->sd_error != 0)
+                       return sh_sdhi_error_manage(host);
+
+               sh_sdhi_get_response(host, cmd);
+               return 0;
+       }
+
+       if (data) {
+               if ((opc == MMC_CMD_READ_MULTIPLE_BLOCK) ||
+                   opc == MMC_CMD_WRITE_MULTIPLE_BLOCK) {
+                       sh_sdhi_writew(host, SDHI_STOP, STOP_SEC_ENABLE);
+                       sh_sdhi_writew(host, SDHI_SECCNT, data->blocks);
+               }
+               sh_sdhi_writew(host, SDHI_SIZE, data->blocksize);
+       }
+       opc = sh_sdhi_set_cmd(host, data, opc);
+
+       /*
+        *  U-boot cannot use interrupt.
+        *  So this flag may not be clear by timing
+        */
+       sh_sdhi_writew(host, SDHI_INFO1, ~INFO1_RESP_END);
+
+       sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                      INFO1M_RESP_END | sh_sdhi_readw(host, SDHI_INFO1_MASK));
+       sh_sdhi_writew(host, SDHI_ARG0,
+                      (unsigned short)(cmd->cmdarg & ARG0_MASK));
+       sh_sdhi_writew(host, SDHI_ARG1,
+                      (unsigned short)((cmd->cmdarg >> 16) & ARG1_MASK));
+
+       timeout = 100000;
+       /* Waiting for SD Bus busy to be cleared */
+       while (timeout--) {
+               if ((sh_sdhi_readw(host, SDHI_INFO2) & 0x2000))
+                       break;
+       }
+
+       sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
+
+       host->wait_int = 0;
+       sh_sdhi_writew(host, SDHI_INFO1_MASK,
+                      ~INFO1M_RESP_END & sh_sdhi_readw(host, SDHI_INFO1_MASK));
+       sh_sdhi_writew(host, SDHI_INFO2_MASK,
+                      ~(INFO2M_CMD_ERROR | INFO2M_CRC_ERROR |
+                      INFO2M_END_ERROR | INFO2M_TIMEOUT |
+                      INFO2M_RESP_TIMEOUT | INFO2M_ILA) &
+                      sh_sdhi_readw(host, SDHI_INFO2_MASK));
+
+       time = sh_sdhi_wait_interrupt_flag(host);
+       if (!time)
+               return sh_sdhi_error_manage(host);
+
+       if (host->sd_error) {
+               switch (cmd->cmdidx) {
+               case MMC_CMD_ALL_SEND_CID:
+               case MMC_CMD_SELECT_CARD:
+               case SD_CMD_SEND_IF_COND:
+               case MMC_CMD_APP_CMD:
+                       ret = TIMEOUT;
+                       break;
+               default:
+                       debug(DRIVER_NAME": Cmd(d'%d) err\n", opc);
+                       debug(DRIVER_NAME": cmdidx = %d\n", cmd->cmdidx);
+                       ret = sh_sdhi_error_manage(host);
+                       break;
+               }
+               host->sd_error = 0;
+               host->wait_int = 0;
+               return ret;
+       }
+       if (sh_sdhi_readw(host, SDHI_INFO1) & INFO1_RESP_END)
+               return -EINVAL;
+
+       if (host->wait_int) {
+               sh_sdhi_get_response(host, cmd);
+               host->wait_int = 0;
+       }
+       if (data)
+               ret = sh_sdhi_data_trans(host, data, opc);
+
+       debug("ret = %d, resp = %08x, %08x, %08x, %08x\n",
+             ret, cmd->response[0], cmd->response[1],
+             cmd->response[2], cmd->response[3]);
+       return ret;
+}
+
+static int sh_sdhi_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
+                       struct mmc_data *data)
+{
+       struct sh_sdhi_host *host = mmc_priv(mmc);
+       int ret;
+
+       host->sd_error = 0;
+
+       ret = sh_sdhi_start_cmd(host, data, cmd);
+
+       return ret;
+}
+
+static void sh_sdhi_set_ios(struct mmc *mmc)
+{
+       int ret;
+       struct sh_sdhi_host *host = mmc_priv(mmc);
+
+       ret = sh_sdhi_clock_control(host, mmc->clock);
+       if (ret)
+               return;
+
+       if (mmc->bus_width == 4)
+               sh_sdhi_writew(host, SDHI_OPTION, ~OPT_BUS_WIDTH_1 &
+                              sh_sdhi_readw(host, SDHI_OPTION));
+       else
+               sh_sdhi_writew(host, SDHI_OPTION, OPT_BUS_WIDTH_1 |
+                              sh_sdhi_readw(host, SDHI_OPTION));
+
+       debug("clock = %d, buswidth = %d\n", mmc->clock, mmc->bus_width);
+}
+
+static int sh_sdhi_initialize(struct mmc *mmc)
+{
+       struct sh_sdhi_host *host = mmc_priv(mmc);
+       int ret = sh_sdhi_sync_reset(host);
+
+       sh_sdhi_writew(host, SDHI_PORTSEL, USE_1PORT);
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+       sh_sdhi_writew(host, SDHI_EXT_SWAP, SET_SWAP);
+#endif
+
+       sh_sdhi_writew(host, SDHI_INFO1_MASK, INFO1M_RESP_END |
+                      INFO1M_ACCESS_END | INFO1M_CARD_RE |
+                      INFO1M_DATA3_CARD_RE | INFO1M_DATA3_CARD_IN);
+
+       return ret;
+}
+
+static const struct mmc_ops sh_sdhi_ops = {
+       .send_cmd       = sh_sdhi_send_cmd,
+       .set_ios        = sh_sdhi_set_ios,
+       .init           = sh_sdhi_initialize,
+};
+
+static struct mmc_config sh_sdhi_cfg = {
+       .name           = DRIVER_NAME,
+       .ops            = &sh_sdhi_ops,
+       .f_min          = CLKDEV_INIT,
+       .f_max          = CLKDEV_HS_DATA,
+       .voltages       = MMC_VDD_32_33 | MMC_VDD_33_34,
+       .host_caps      = MMC_MODE_4BIT | MMC_MODE_HS,
+       .part_type      = PART_TYPE_DOS,
+       .b_max          = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
+
+int sh_sdhi_init(unsigned long addr, int ch, unsigned long quirks)
+{
+       int ret = 0;
+       struct mmc *mmc;
+       struct sh_sdhi_host *host = NULL;
+
+       if (ch >= CONFIG_SYS_SH_SDHI_NR_CHANNEL)
+               return -ENODEV;
+
+       host = malloc(sizeof(struct sh_sdhi_host));
+       if (!host)
+               return -ENOMEM;
+
+       mmc = mmc_create(&sh_sdhi_cfg, host);
+       if (!mmc) {
+               ret = -1;
+               goto error;
+       }
+
+       host->ch = ch;
+       host->addr = addr;
+       host->quirks = quirks;
+
+       if (host->quirks & SH_SDHI_QUIRK_16BIT_BUF)
+               host->bus_shift = 1;
+
+       return ret;
+error:
+       if (host)
+               free(host);
+       return ret;
+}
index 623498187ef0255e6fd5a647819a7bdf4477f8e3..ebfec7cf079bb6f55c53c31bb8b7e2219403ebe4 100644 (file)
@@ -89,8 +89,13 @@ static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
                pll = CCM_MMC_CTRL_OSCM24;
                pll_hz = 24000000;
        } else {
+#ifdef CONFIG_MACH_SUN9I
+               pll = CCM_MMC_CTRL_PLL_PERIPH0;
+               pll_hz = clock_get_pll4_periph0();
+#else
                pll = CCM_MMC_CTRL_PLL6;
                pll_hz = clock_get_pll6();
+#endif
        }
 
        div = pll_hz / hz;
@@ -146,10 +151,16 @@ static int mmc_clk_io_on(int sdc_no)
        /* config ahb clock */
        setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MMC(sdc_no));
 
-#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
+#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \
+    defined(CONFIG_MACH_SUN9I)
        /* unassert reset */
        setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_RESET_OFFSET_MMC(sdc_no));
 #endif
+#if defined(CONFIG_MACH_SUN9I)
+       /* sun9i has a mmc-common module, also set the gate and reset there */
+       writel(SUNXI_MMC_COMMON_CLK_GATE | SUNXI_MMC_COMMON_RESET,
+              SUNXI_MMC_COMMON_BASE + 4 * sdc_no);
+#endif
 
        return mmc_set_mod_clk(mmchost, 24000000);
 }
@@ -204,7 +215,7 @@ static int mmc_config_clock(struct mmc *mmc)
        return 0;
 }
 
-static void mmc_set_ios(struct mmc *mmc)
+static void sunxi_mmc_set_ios(struct mmc *mmc)
 {
        struct sunxi_mmc_host *mmchost = mmc->priv;
 
@@ -226,7 +237,7 @@ static void mmc_set_ios(struct mmc *mmc)
                writel(0x0, &mmchost->reg->width);
 }
 
-static int mmc_core_init(struct mmc *mmc)
+static int sunxi_mmc_core_init(struct mmc *mmc)
 {
        struct sunxi_mmc_host *mmchost = mmc->priv;
 
@@ -287,8 +298,8 @@ static int mmc_rint_wait(struct mmc *mmc, unsigned int timeout_msecs,
        return 0;
 }
 
-static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
-                       struct mmc_data *data)
+static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
+                             struct mmc_data *data)
 {
        struct sunxi_mmc_host *mmchost = mmc->priv;
        unsigned int cmdval = SUNXI_MMC_CMD_START;
@@ -355,7 +366,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                }
        }
 
-       error = mmc_rint_wait(mmc, 0xfffff, SUNXI_MMC_RINT_COMMAND_DONE, "cmd");
+       error = mmc_rint_wait(mmc, 1000, SUNXI_MMC_RINT_COMMAND_DONE, "cmd");
        if (error)
                goto out;
 
@@ -421,9 +432,9 @@ static int sunxi_mmc_getcd(struct mmc *mmc)
 }
 
 static const struct mmc_ops sunxi_mmc_ops = {
-       .send_cmd       = mmc_send_cmd,
-       .set_ios        = mmc_set_ios,
-       .init           = mmc_core_init,
+       .send_cmd       = sunxi_mmc_send_cmd,
+       .set_ios        = sunxi_mmc_set_ios,
+       .init           = sunxi_mmc_core_init,
        .getcd          = sunxi_mmc_getcd,
 };
 
@@ -439,7 +450,8 @@ struct mmc *sunxi_mmc_init(int sdc_no)
        cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
        cfg->host_caps = MMC_MODE_4BIT;
        cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
-#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || defined(CONFIG_MACH_SUN8I)
+#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I) || defined(CONFIG_MACH_SUN9I)
        cfg->host_caps |= MMC_MODE_HC;
 #endif
        cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
index 2bd36b0ee704a86308bfa0d3c7faa68cc506249a..2cd8cf10aec557cc3a3579f3e292d9ee3f686e90 100644 (file)
@@ -515,8 +515,8 @@ static int tegra_mmc_getcd(struct mmc *mmc)
 
        debug("tegra_mmc_getcd called\n");
 
-       if (fdt_gpio_isvalid(&host->cd_gpio))
-               return fdtdec_get_gpio(&host->cd_gpio);
+       if (dm_gpio_is_valid(&host->cd_gpio))
+               return dm_gpio_get_value(&host->cd_gpio);
 
        return 1;
 }
@@ -531,7 +531,6 @@ static const struct mmc_ops tegra_mmc_ops = {
 static int do_mmc_init(int dev_index)
 {
        struct mmc_host *host;
-       char gpusage[12]; /* "SD/MMCn PWR" or "SD/MMCn CD" */
        struct mmc *mmc;
 
        /* DT should have been read & host config filled in */
@@ -539,27 +538,15 @@ static int do_mmc_init(int dev_index)
        if (!host->enabled)
                return -1;
 
-       debug(" do_mmc_init: index %d, bus width %d "
-               "pwr_gpio %d cd_gpio %d\n",
-               dev_index, host->width,
-               host->pwr_gpio.gpio, host->cd_gpio.gpio);
+       debug(" do_mmc_init: index %d, bus width %d pwr_gpio %d cd_gpio %d\n",
+             dev_index, host->width, gpio_get_number(&host->pwr_gpio),
+             gpio_get_number(&host->cd_gpio));
 
        host->clock = 0;
        clock_start_periph_pll(host->mmc_id, CLOCK_ID_PERIPH, 20000000);
 
-       if (fdt_gpio_isvalid(&host->pwr_gpio)) {
-               sprintf(gpusage, "SD/MMC%d PWR", dev_index);
-               gpio_request(host->pwr_gpio.gpio, gpusage);
-               gpio_direction_output(host->pwr_gpio.gpio, 1);
-               debug(" Power GPIO name = %s\n", host->pwr_gpio.name);
-       }
-
-       if (fdt_gpio_isvalid(&host->cd_gpio)) {
-               sprintf(gpusage, "SD/MMC%d CD", dev_index);
-               gpio_request(host->cd_gpio.gpio, gpusage);
-               gpio_direction_input(host->cd_gpio.gpio);
-               debug(" CD GPIO name = %s\n", host->cd_gpio.name);
-       }
+       if (dm_gpio_is_valid(&host->pwr_gpio))
+               dm_gpio_set_value(&host->pwr_gpio, 1);
 
        memset(&host->cfg, 0, sizeof(host->cfg));
 
@@ -626,9 +613,12 @@ static int mmc_get_config(const void *blob, int node, struct mmc_host *host)
                debug("%s: no sdmmc width found\n", __func__);
 
        /* These GPIOs are optional */
-       fdtdec_decode_gpio(blob, node, "cd-gpios", &host->cd_gpio);
-       fdtdec_decode_gpio(blob, node, "wp-gpios", &host->wp_gpio);
-       fdtdec_decode_gpio(blob, node, "power-gpios", &host->pwr_gpio);
+       gpio_request_by_name_nodev(blob, node, "cd-gpios", 0, &host->cd_gpio,
+                                  GPIOD_IS_IN);
+       gpio_request_by_name_nodev(blob, node, "wp-gpios", 0, &host->wp_gpio,
+                                  GPIOD_IS_IN);
+       gpio_request_by_name_nodev(blob, node, "power-gpios", 0,
+                                  &host->pwr_gpio, GPIOD_IS_OUT);
 
        debug("%s: found controller at %p, width = %d, periph_id = %d\n",
                __func__, host->reg, host->width, host->mmc_id);
index fdce2c2c10ec85c4a291532f927eae4a0b5627c9..7887f11c649b01ae7a4565c3297f68c5f068ab18 100644 (file)
@@ -13,7 +13,7 @@
 #include <sdhci.h>
 #include <asm/arch/sys_proto.h>
 
-int zynq_sdhci_init(u32 regbase)
+int zynq_sdhci_init(phys_addr_t regbase)
 {
        struct sdhci_host *host = NULL;
 
@@ -40,7 +40,7 @@ int zynq_sdhci_of_init(const void *blob)
 {
        int offset = 0;
        u32 ret = 0;
-       u32 reg;
+       phys_addr_t reg;
 
        debug("ZYNQ SDHCI: Initialization\n");
 
index 63bdf65f82c46949bce9fc975a469d3cda86311a..6db6566e733656d55a88c024bd1b07b5c6d58c3c 100644 (file)
@@ -1065,11 +1065,6 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
                }
        }
 #endif
-#ifdef PPCHAMELON_NAND_TIMER_HACK
-       time_start = get_timer(0);
-       while (get_timer(time_start) < 10)
-               ;
-#endif /*  PPCHAMELON_NAND_TIMER_HACK */
        led_trigger_event(nand_led_trigger, LED_OFF);
 
        status = (int)chip->read_byte(mtd);
index 459904d81c21a2356e353c642ef065151006c257..fc64f4814484e8052410f4769c60240ae67dc510 100644 (file)
@@ -441,6 +441,115 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
        return (err) ? err : error_count;
 }
 
+#ifdef CONFIG_NAND_OMAP_GPMC_PREFETCH
+
+#define PREFETCH_CONFIG1_CS_SHIFT      24
+#define PREFETCH_FIFOTHRESHOLD_MAX     0x40
+#define PREFETCH_FIFOTHRESHOLD(val)    ((val) << 8)
+#define PREFETCH_STATUS_COUNT(val)     (val & 0x00003fff)
+#define PREFETCH_STATUS_FIFO_CNT(val)  ((val >> 24) & 0x7F)
+#define ENABLE_PREFETCH                        (1 << 7)
+
+/**
+ * omap_prefetch_enable - configures and starts prefetch transfer
+ * @fifo_th: fifo threshold to be used for read/ write
+ * @count: number of bytes to be transferred
+ * @is_write: prefetch read(0) or write post(1) mode
+ * @cs: chip select to use
+ */
+static int omap_prefetch_enable(int fifo_th, unsigned int count, int is_write, int cs)
+{
+       uint32_t val;
+
+       if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX)
+               return -EINVAL;
+
+       if (readl(&gpmc_cfg->prefetch_control))
+               return -EBUSY;
+
+       /* Set the amount of bytes to be prefetched */
+       writel(count, &gpmc_cfg->prefetch_config2);
+
+       val = (cs << PREFETCH_CONFIG1_CS_SHIFT) | (is_write & 1) |
+               PREFETCH_FIFOTHRESHOLD(fifo_th) | ENABLE_PREFETCH;
+       writel(val, &gpmc_cfg->prefetch_config1);
+
+       /*  Start the prefetch engine */
+       writel(1, &gpmc_cfg->prefetch_control);
+
+       return 0;
+}
+
+/**
+ * omap_prefetch_reset - disables and stops the prefetch engine
+ */
+static void omap_prefetch_reset(void)
+{
+       writel(0, &gpmc_cfg->prefetch_control);
+       writel(0, &gpmc_cfg->prefetch_config1);
+}
+
+static int __read_prefetch_aligned(struct nand_chip *chip, uint32_t *buf, int len)
+{
+       int ret;
+       uint32_t cnt;
+       struct omap_nand_info *info = chip->priv;
+
+       ret = omap_prefetch_enable(PREFETCH_FIFOTHRESHOLD_MAX, len, 0, info->cs);
+       if (ret < 0)
+               return ret;
+
+       do {
+               int i;
+
+               cnt = readl(&gpmc_cfg->prefetch_status);
+               cnt = PREFETCH_STATUS_FIFO_CNT(cnt);
+
+               for (i = 0; i < cnt / 4; i++) {
+                       *buf++ = readl(CONFIG_SYS_NAND_BASE);
+                       len -= 4;
+               }
+       } while (len);
+
+       omap_prefetch_reset();
+
+       return 0;
+}
+
+static void omap_nand_read_prefetch8(struct mtd_info *mtd, uint8_t *buf, int len)
+{
+       int ret;
+       uint32_t head, tail;
+       struct nand_chip *chip = mtd->priv;
+
+       /*
+        * If the destination buffer is unaligned, start with reading
+        * the overlap byte-wise.
+        */
+       head = ((uint32_t) buf) % 4;
+       if (head) {
+               nand_read_buf(mtd, buf, head);
+               buf += head;
+               len -= head;
+       }
+
+       /*
+        * Only transfer multiples of 4 bytes in a pre-fetched fashion.
+        * If there's a residue, care for it byte-wise afterwards.
+        */
+       tail = len % 4;
+
+       ret = __read_prefetch_aligned(chip, (uint32_t *) buf, len - tail);
+       if (ret < 0) {
+               /* fallback in case the prefetch engine is busy */
+               nand_read_buf(mtd, buf, len);
+       } else if (tail) {
+               buf += len - tail;
+               nand_read_buf(mtd, buf, tail);
+       }
+}
+#endif /* CONFIG_NAND_OMAP_GPMC_PREFETCH */
+
 /**
  * omap_read_page_bch - hardware ecc based page read function
  * @mtd:       mtd info structure
@@ -880,11 +989,12 @@ int board_nand_init(struct nand_chip *nand)
        if (err)
                return err;
 
-#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_NAND_OMAP_GPMC_PREFETCH
+       /* TODO: Implement for 16-bit bus width */
        if (nand->options & NAND_BUSWIDTH_16)
                nand->read_buf = nand_read_buf16;
        else
-               nand->read_buf = nand_read_buf;
+               nand->read_buf = omap_nand_read_prefetch8;
 #endif
 
        nand->dev_ready = omap_dev_ready;
index 163cf29a3986058cfc3472241ac2865cd5f99516..b660f3b20662dfbb427dd2770765d2acd1f6a089 100644 (file)
@@ -79,7 +79,7 @@ enum {
 struct fdt_nand {
        struct nand_ctlr *reg;
        int enabled;            /* 1 to enable, 0 to disable */
-       struct fdt_gpio_state wp_gpio;  /* write-protect GPIO */
+       struct gpio_desc wp_gpio;       /* write-protect GPIO */
        s32 width;              /* bit width, normally 8 */
        u32 timing[FDT_NAND_TIMING_COUNT];
 };
@@ -945,8 +945,8 @@ static int fdt_decode_nand(const void *blob, int node, struct fdt_nand *config)
        config->reg = (struct nand_ctlr *)fdtdec_get_addr(blob, node, "reg");
        config->enabled = fdtdec_get_is_enabled(blob, node);
        config->width = fdtdec_get_int(blob, node, "nvidia,nand-width", 8);
-       err = fdtdec_decode_gpio(blob, node, "nvidia,wp-gpios",
-                                &config->wp_gpio);
+       err = gpio_request_by_name_nodev(blob, node, "nvidia,wp-gpios", 0,
+                                &config->wp_gpio, GPIOD_IS_OUT);
        if (err)
                return err;
        err = fdtdec_get_int_array(blob, node, "nvidia,timing",
@@ -1009,8 +1009,7 @@ int tegra_nand_init(struct nand_chip *nand, int devnum)
        /* Adjust timing for NAND device */
        setup_timing(config->timing, info->reg);
 
-       fdtdec_setup_gpio(&config->wp_gpio);
-       gpio_direction_output(config->wp_gpio.gpio, 1);
+       dm_gpio_set_value(&config->wp_gpio, 1);
 
        our_mtd = &nand_info[devnum];
        our_mtd->priv = nand;
index 3024b988fef904884f4d6e4920d98859714f115c..d576d31243a7a90a7213466d7b3ce600a2d1d84f 100644 (file)
@@ -141,8 +141,10 @@ static int sandbox_sf_probe(struct udevice *dev)
                assert(bus->seq != -1);
                if (bus->seq < CONFIG_SANDBOX_SPI_MAX_BUS)
                        spec = state->spi[bus->seq][cs].spec;
-               if (!spec)
-                       return -ENOENT;
+               if (!spec) {
+                       ret = -ENOENT;
+                       goto error;
+               }
 
                file = strchr(spec, ':');
                if (!file) {
@@ -196,6 +198,7 @@ static int sandbox_sf_probe(struct udevice *dev)
        return 0;
 
  error:
+       debug("%s: Got error %d\n", __func__, ret);
        return ret;
 }
 
@@ -587,6 +590,11 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
 
 void sandbox_sf_unbind_emul(struct sandbox_state *state, int busnum, int cs)
 {
+       struct udevice *dev;
+
+       dev = state->spi[busnum][cs].emul;
+       device_remove(dev);
+       device_unbind(dev);
        state->spi[busnum][cs].emul = NULL;
 }
 
index ce9987fd1a8770aeb8d948030a792553b511ed80..41037238590b650cfe12cfe59c2edd960170db27 100644 (file)
@@ -481,11 +481,12 @@ int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)
 int spi_flash_std_probe(struct udevice *dev)
 {
        struct spi_slave *slave = dev_get_parentdata(dev);
+       struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
        struct spi_flash *flash;
 
        flash = dev->uclass_priv;
        flash->dev = dev;
-       debug("%s: slave=%p, cs=%d\n", __func__, slave, slave->cs);
+       debug("%s: slave=%p, cs=%d\n", __func__, slave, plat->cs);
        return spi_flash_probe_slave(slave, flash);
 }
 
index fb0cf8c1cf172dce03a8dcea02d7522de26793a9..46c4ac697d6a6f87ae36df5788a9b69b0011de1d 100644 (file)
@@ -66,3 +66,4 @@ obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
                xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
 obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
 obj-$(CONFIG_FSL_MC_ENET) += fsl_mc/
+obj-$(CONFIG_VSC9953) += vsc9953.o
index 9ded8950b83d22aa6021ed8e81ee4141e6d85a23..c03e935e2fb7df54771bf6222b7ce816c53209b3 100644 (file)
@@ -236,8 +236,10 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 
        start = get_timer(0);
        while (readl(&dma_p->busmode) & DMAMAC_SRST) {
-               if (get_timer(start) >= CONFIG_MACRESET_TIMEOUT)
+               if (get_timer(start) >= CONFIG_MACRESET_TIMEOUT) {
+                       printf("DMA reset timeout\n");
                        return -1;
+               }
 
                mdelay(100);
        };
index 6531030463cd57c643f58be1520a8f77ef60018d..cd4422215fb0fbbd43c4aefb09e0f0652df01867 100644 (file)
@@ -4927,22 +4927,23 @@ void
 fill_rx(struct e1000_hw *hw)
 {
        struct e1000_rx_desc *rd;
-       uint32_t flush_start, flush_end;
+       unsigned long flush_start, flush_end;
 
        rx_last = rx_tail;
        rd = rx_base + rx_tail;
        rx_tail = (rx_tail + 1) % 8;
        memset(rd, 0, 16);
-       rd->buffer_addr = cpu_to_le64((u32)packet);
+       rd->buffer_addr = cpu_to_le64((unsigned long)packet);
 
        /*
         * Make sure there are no stale data in WB over this area, which
         * might get written into the memory while the e1000 also writes
         * into the same memory area.
         */
-       invalidate_dcache_range((u32)packet, (u32)packet + 4096);
+       invalidate_dcache_range((unsigned long)packet,
+                               (unsigned long)packet + 4096);
        /* Dump the DMA descriptor into RAM. */
-       flush_start = ((u32)rd) & ~(ARCH_DMA_MINALIGN - 1);
+       flush_start = ((unsigned long)rd) & ~(ARCH_DMA_MINALIGN - 1);
        flush_end = flush_start + roundup(sizeof(*rd), ARCH_DMA_MINALIGN);
        flush_dcache_range(flush_start, flush_end);
 
@@ -4963,7 +4964,7 @@ e1000_configure_tx(struct e1000_hw *hw)
        unsigned long tipg, tarc;
        uint32_t ipgr1, ipgr2;
 
-       E1000_WRITE_REG(hw, TDBAL, (u32) tx_base);
+       E1000_WRITE_REG(hw, TDBAL, (unsigned long)tx_base);
        E1000_WRITE_REG(hw, TDBAH, 0);
 
        E1000_WRITE_REG(hw, TDLEN, 128);
@@ -5107,7 +5108,7 @@ e1000_configure_rx(struct e1000_hw *hw)
                E1000_WRITE_FLUSH(hw);
        }
        /* Setup the Base and Length of the Rx Descriptor Ring */
-       E1000_WRITE_REG(hw, RDBAL, (u32) rx_base);
+       E1000_WRITE_REG(hw, RDBAL, (unsigned long)rx_base);
        E1000_WRITE_REG(hw, RDBAH, 0);
 
        E1000_WRITE_REG(hw, RDLEN, 128);
@@ -5138,14 +5139,14 @@ e1000_poll(struct eth_device *nic)
 {
        struct e1000_hw *hw = nic->priv;
        struct e1000_rx_desc *rd;
-       uint32_t inval_start, inval_end;
+       unsigned long inval_start, inval_end;
        uint32_t len;
 
        /* return true if there's an ethernet packet ready to read */
        rd = rx_base + rx_last;
 
        /* Re-load the descriptor from RAM. */
-       inval_start = ((u32)rd) & ~(ARCH_DMA_MINALIGN - 1);
+       inval_start = ((unsigned long)rd) & ~(ARCH_DMA_MINALIGN - 1);
        inval_end = inval_start + roundup(sizeof(*rd), ARCH_DMA_MINALIGN);
        invalidate_dcache_range(inval_start, inval_end);
 
@@ -5154,8 +5155,9 @@ e1000_poll(struct eth_device *nic)
        /*DEBUGOUT("recv: packet len=%d \n", rd->length); */
        /* Packet received, make sure the data are re-loaded from RAM. */
        len = le32_to_cpu(rd->length);
-       invalidate_dcache_range((u32)packet,
-                               (u32)packet + roundup(len, ARCH_DMA_MINALIGN));
+       invalidate_dcache_range((unsigned long)packet,
+                               (unsigned long)packet +
+                               roundup(len, ARCH_DMA_MINALIGN));
        NetReceive((uchar *)packet, len);
        fill_rx(hw);
        return 1;
@@ -5170,7 +5172,7 @@ static int e1000_transmit(struct eth_device *nic, void *txpacket, int length)
        struct e1000_hw *hw = nic->priv;
        struct e1000_tx_desc *txp;
        int i = 0;
-       uint32_t flush_start, flush_end;
+       unsigned long flush_start, flush_end;
 
        txp = tx_base + tx_tail;
        tx_tail = (tx_tail + 1) % 8;
@@ -5180,10 +5182,11 @@ static int e1000_transmit(struct eth_device *nic, void *txpacket, int length)
        txp->upper.data = 0;
 
        /* Dump the packet into RAM so e1000 can pick them. */
-       flush_dcache_range((u32)nv_packet,
-                          (u32)nv_packet + roundup(length, ARCH_DMA_MINALIGN));
+       flush_dcache_range((unsigned long)nv_packet,
+                          (unsigned long)nv_packet +
+                          roundup(length, ARCH_DMA_MINALIGN));
        /* Dump the descriptor into RAM as well. */
-       flush_start = ((u32)txp) & ~(ARCH_DMA_MINALIGN - 1);
+       flush_start = ((unsigned long)txp) & ~(ARCH_DMA_MINALIGN - 1);
        flush_end = flush_start + roundup(sizeof(*txp), ARCH_DMA_MINALIGN);
        flush_dcache_range(flush_start, flush_end);
 
index f1e39b982a2a01091715581ac7280370a8a41c03..1d1089d0173df0c25697044d159e5c5d23afac2b 100644 (file)
@@ -410,10 +410,15 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
        fmc_tx_port_graceful_stop_disable(fm_eth);
 
 #ifdef CONFIG_PHYLIB
-       ret = phy_startup(fm_eth->phydev);
-       if (ret) {
-               printf("%s: Could not initialize\n", fm_eth->phydev->dev->name);
-               return ret;
+       if (fm_eth->phydev) {
+               ret = phy_startup(fm_eth->phydev);
+               if (ret) {
+                       printf("%s: Could not initialize\n",
+                              fm_eth->phydev->dev->name);
+                       return ret;
+               }
+       } else {
+               return 0;
        }
 #else
        fm_eth->phydev->speed = SPEED_1000;
@@ -447,7 +452,8 @@ static void fm_eth_halt(struct eth_device *dev)
        /* disable bmi Rx port */
        bmi_rx_port_disable(fm_eth->rx_port);
 
-       phy_shutdown(fm_eth->phydev);
+       if (fm_eth->phydev)
+               phy_shutdown(fm_eth->phydev);
 }
 
 static int fm_eth_send(struct eth_device *dev, void *buf, int len)
@@ -625,11 +631,12 @@ static int init_phy(struct eth_device *dev)
        if (fm_eth->bus) {
                phydev = phy_connect(fm_eth->bus, fm_eth->phyaddr, dev,
                                        fm_eth->enet_if);
-       }
-
-       if (!phydev) {
-               printf("Failed to connect\n");
-               return -1;
+               if (!phydev) {
+                       printf("Failed to connect\n");
+                       return -1;
+               }
+       } else {
+               return 0;
        }
 
        if (fm_eth->type == FM_ETH_1G_E) {
@@ -711,8 +718,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
        if (!fm_eth_startup(fm_eth))
                return 0;
 
-       if (init_phy(dev))
-               return 0;
+       init_phy(dev);
 
        /* clear the ethernet address */
        for (i = 0; i < 6; i++)
index d2a097e0e55d0facd9ed1e1e290f27cc60a4cb09..04583661eceb496920999920e7d4de7ed30e40b4 100644 (file)
@@ -50,7 +50,8 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
        switch (port) {
        case FM1_DTSEC1:
        case FM1_DTSEC2:
-               if (is_serdes_configured(QSGMII_SW1_A + port - FM1_DTSEC1))
+               if (is_serdes_configured(QSGMII_SW1_A + port - FM1_DTSEC1) ||
+                   is_serdes_configured(SGMII_SW1_MAC1  + port - FM1_DTSEC1))
                        return PHY_INTERFACE_MODE_QSGMII;
        case FM1_DTSEC3:
        case FM1_DTSEC4:
index d9d6f4f28b932ca0c8664867a3e7155c20d42af6..d2a8ae0868dfed69f30234824bffdfe3722eac4f 100644 (file)
@@ -407,13 +407,8 @@ static int mpc5xxx_fec_init_phy(struct eth_device *dev, bd_t * bis)
         */
        if (fec->xcv_type == SEVENWIRE) {
                /*  10MBit with 7-wire operation */
-#if defined(CONFIG_TOTAL5200)
-               /* 7-wire and USB2 on Ethernet */
-               *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= 0x00030000;
-#else  /* !CONFIG_TOTAL5200 */
                /* 7-wire only */
                *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= 0x00020000;
-#endif /* CONFIG_TOTAL5200 */
        } else {
                /* 100MBit with MD operation */
                *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= 0x00050000;
index 6ef6cacb6b87940421bae8d78085eb0ebb5a6e0d..6b31a82ec40204ba60791308878900a903b9179e 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_MVGBE_PORTS
+# define CONFIG_MVGBE_PORTS {0, 0}
+#endif
+
 #define MV_PHY_ADR_REQUEST 0xee
 #define MVGBE_SMI_REG (((struct mvgbe_registers *)MVGBE0_BASE)->smi)
 
index f46bf00abe459bc726eaca97b963c7dc84ec3107..d096db87a2766a6c02c2bbb984071f71533f17e3 100644 (file)
@@ -11,6 +11,7 @@ obj-$(CONFIG_MV88E6352_SWITCH) += mv88e6352.o
 
 obj-$(CONFIG_PHYLIB) += phy.o
 obj-$(CONFIG_PHYLIB_10G) += generic_10g.o
+obj-$(CONFIG_PHY_AQUANTIA) += aquantia.o
 obj-$(CONFIG_PHY_ATHEROS) += atheros.o
 obj-$(CONFIG_PHY_BROADCOM) += broadcom.o
 obj-$(CONFIG_PHY_CORTINA) += cortina.o
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
new file mode 100644 (file)
index 0000000..ef4da4e
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Aquantia PHY drivers
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ *
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ */
+#include <config.h>
+#include <common.h>
+#include <phy.h>
+
+#ifndef CONFIG_PHYLIB_10G
+#error The Aquantia PHY needs 10G support
+#endif
+
+#define AQUNTIA_10G_CTL                0x20
+#define AQUNTIA_VENDOR_P1      0xc400
+
+#define AQUNTIA_SPEED_LSB_MASK 0x2000
+#define AQUNTIA_SPEED_MSB_MASK 0x40
+
+int aquantia_config(struct phy_device *phydev)
+{
+       u32 val = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR);
+
+       if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+               /* 1000BASE-T mode */
+               phydev->advertising = SUPPORTED_1000baseT_Full;
+               phydev->supported = phydev->advertising;
+
+               val = (val & ~AQUNTIA_SPEED_LSB_MASK) | AQUNTIA_SPEED_MSB_MASK;
+               phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val);
+       } else if (phydev->interface == PHY_INTERFACE_MODE_XGMII) {
+               /* 10GBASE-T mode */
+               phydev->advertising = SUPPORTED_10000baseT_Full;
+               phydev->supported = phydev->advertising;
+
+               if (!(val & AQUNTIA_SPEED_LSB_MASK) ||
+                   !(val & AQUNTIA_SPEED_MSB_MASK))
+                       phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR,
+                                 AQUNTIA_SPEED_LSB_MASK |
+                                 AQUNTIA_SPEED_MSB_MASK);
+       } else if (phydev->interface == PHY_INTERFACE_MODE_SGMII_2500) {
+               /* 2.5GBASE-T mode */
+               phydev->advertising = SUPPORTED_1000baseT_Full;
+               phydev->supported = phydev->advertising;
+
+               phy_write(phydev, MDIO_MMD_AN, AQUNTIA_10G_CTL, 1);
+               phy_write(phydev, MDIO_MMD_AN, AQUNTIA_VENDOR_P1, 0x9440);
+       } else if (phydev->interface == PHY_INTERFACE_MODE_MII) {
+               /* 100BASE-TX mode */
+               phydev->advertising = SUPPORTED_100baseT_Full;
+               phydev->supported = phydev->advertising;
+
+               val = (val & ~AQUNTIA_SPEED_MSB_MASK) | AQUNTIA_SPEED_LSB_MASK;
+               phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val);
+       }
+       return 0;
+}
+
+int aquantia_startup(struct phy_device *phydev)
+{
+       u32 reg, speed;
+       int i = 0;
+
+       phydev->duplex = DUPLEX_FULL;
+
+       /* if the AN is still in progress, wait till timeout. */
+       phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
+       reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
+       if (!(reg & MDIO_AN_STAT1_COMPLETE)) {
+               printf("%s Waiting for PHY auto negotiation to complete",
+                      phydev->dev->name);
+               do {
+                       udelay(1000);
+                       reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
+                       if ((i++ % 500) == 0)
+                               printf(".");
+               } while (!(reg & MDIO_AN_STAT1_COMPLETE) &&
+                        i < (4 * PHY_ANEG_TIMEOUT));
+
+               if (i > PHY_ANEG_TIMEOUT)
+                       printf(" TIMEOUT !\n");
+       }
+
+       /* Read twice because link state is latched and a
+        * read moves the current state into the register */
+       phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
+       reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
+       if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS))
+               phydev->link = 0;
+       else
+               phydev->link = 1;
+
+       speed = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR);
+       if (speed & AQUNTIA_SPEED_MSB_MASK) {
+               if (speed & AQUNTIA_SPEED_LSB_MASK)
+                       phydev->speed = SPEED_10000;
+               else
+                       phydev->speed = SPEED_1000;
+       } else {
+               if (speed & AQUNTIA_SPEED_LSB_MASK)
+                       phydev->speed = SPEED_100;
+               else
+                       phydev->speed = SPEED_10;
+       }
+
+       return 0;
+}
+
+struct phy_driver aq1202_driver = {
+       .name = "Aquantia AQ1202",
+       .uid = 0x3a1b445,
+       .mask = 0xfffffff0,
+       .features = PHY_10G_FEATURES,
+       .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
+                       MDIO_MMD_PHYXS | MDIO_MMD_AN |
+                       MDIO_MMD_VEND1),
+       .config = &aquantia_config,
+       .startup = &aquantia_startup,
+       .shutdown = &gen10g_shutdown,
+};
+
+struct phy_driver aq2104_driver = {
+       .name = "Aquantia AQ2104",
+       .uid = 0x3a1b460,
+       .mask = 0xfffffff0,
+       .features = PHY_10G_FEATURES,
+       .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
+                       MDIO_MMD_PHYXS | MDIO_MMD_AN |
+                       MDIO_MMD_VEND1),
+       .config = &aquantia_config,
+       .startup = &aquantia_startup,
+       .shutdown = &gen10g_shutdown,
+};
+
+struct phy_driver aqr105_driver = {
+       .name = "Aquantia AQR105",
+       .uid = 0x3a1b4a2,
+       .mask = 0xfffffff0,
+       .features = PHY_10G_FEATURES,
+       .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
+                       MDIO_MMD_PHYXS | MDIO_MMD_AN |
+                       MDIO_MMD_VEND1),
+       .config = &aquantia_config,
+       .startup = &aquantia_startup,
+       .shutdown = &gen10g_shutdown,
+};
+int phy_aquantia_init(void)
+{
+       phy_register(&aq1202_driver);
+       phy_register(&aq2104_driver);
+       phy_register(&aqr105_driver);
+
+       return 0;
+}
index 507b9a368be72e6d24fea6da9f169cbc2c4cb579..1815b2900ddb2ad1ec80cb9d521bda1ddaa323de 100644 (file)
@@ -22,6 +22,63 @@ static struct phy_driver KSZ804_driver = {
        .shutdown = &genphy_shutdown,
 };
 
+/**
+ * KSZ8895
+ */
+
+static unsigned short smireg_to_phy(unsigned short reg)
+{
+       return ((reg & 0xc0) >> 3) + 0x06 + ((reg & 0x20) >> 5);
+}
+
+static unsigned short smireg_to_reg(unsigned short reg)
+{
+       return reg & 0x1F;
+}
+
+static void ksz8895_write_smireg(struct phy_device *phydev, int smireg, int val)
+{
+       phydev->bus->write(phydev->bus, smireg_to_phy(smireg), MDIO_DEVAD_NONE,
+                                               smireg_to_reg(smireg), val);
+}
+
+#if 0
+static int ksz8895_read_smireg(struct phy_device *phydev, int smireg)
+{
+       return phydev->bus->read(phydev->bus, smireg_to_phy(smireg),
+                                       MDIO_DEVAD_NONE, smireg_to_reg(smireg));
+}
+#endif
+
+int ksz8895_config(struct phy_device *phydev)
+{
+       /* we are connected directly to the switch without
+        * dedicated PHY. SCONF1 == 001 */
+       phydev->link = 1;
+       phydev->duplex = DUPLEX_FULL;
+       phydev->speed = SPEED_100;
+
+       /* Force the switch to start */
+       ksz8895_write_smireg(phydev, 1, 1);
+
+       return 0;
+}
+
+static int ksz8895_startup(struct phy_device *phydev)
+{
+       return 0;
+}
+
+static struct phy_driver ksz8895_driver = {
+       .name = "Micrel KSZ8895/KSZ8864",
+       .uid  = 0x221450,
+       .mask = 0xffffe1,
+       .features = PHY_BASIC_FEATURES,
+       .config   = &ksz8895_config,
+       .startup  = &ksz8895_startup,
+       .shutdown = &genphy_shutdown,
+};
+
 #ifndef CONFIG_PHY_MICREL_KSZ9021
 /*
  * I can't believe Micrel used the exact same part number
@@ -221,5 +278,6 @@ int phy_micrel_init(void)
        phy_register(&KS8721_driver);
 #endif
        phy_register(&ksz9031_driver);
+       phy_register(&ksz8895_driver);
        return 0;
 }
index 5b04c85939040c27b832194a32f171686d6b88f6..df7e9450c2614a4040ced79d12d0e21238e5f689 100644 (file)
@@ -442,6 +442,9 @@ static LIST_HEAD(phy_drivers);
 
 int phy_init(void)
 {
+#ifdef CONFIG_PHY_AQUANTIA
+       phy_aquantia_init();
+#endif
 #ifdef CONFIG_PHY_ATHEROS
        phy_atheros_init();
 #endif
index d9135cb57dfa5b6058a1cc03a8fdc16b81fba92f..e19c491cbce7c00d3f429f9b7d009172bd0b66b5 100644 (file)
@@ -236,7 +236,36 @@ struct smc91111_priv{
                                          *(__b2 + __i) = SMC_inb((a),(r));  \
                                        };  \
                                }while(0)
-
+#elif defined(CONFIG_MS7206SE)
+#define SWAB7206(x) ({ word __x = x; ((__x << 8)|(__x >> 8)); })
+#define SMC_inw(a, r) *((volatile word*)((a)->iobase + (r)))
+#define SMC_inb(a, r) (*((volatile byte*)((a)->iobase + ((r) ^ 0x01))))
+#define SMC_insw(a, r, b, l) \
+       do { \
+               int __i; \
+               word *__b2 = (word *)(b);                 \
+               for (__i = 0; __i < (l); __i++) { \
+                       *__b2++ = SWAB7206(SMC_inw(a, r));      \
+               } \
+       } while (0)
+#define        SMC_outw(a, d, r)       (*((volatile word *)((a)->iobase+(r))) = d)
+#define        SMC_outb(a, d, r)       ({      word __d = (byte)(d);  \
+                               word __w = SMC_inw((a), ((r)&(~1)));    \
+                               if (((r) & 1)) \
+                                       __w = (__w & 0x00ff) | (__d << 8); \
+                               else \
+                                       __w = (__w & 0xff00) | (__d); \
+                               SMC_outw((a), __w, ((r)&(~1)));       \
+                       })
+#define SMC_outsw(a, r, b, l) \
+       do { \
+               int __i; \
+               word *__b2 = (word *)(b);                 \
+               for (__i = 0; __i < (l); __i++) { \
+                       SMC_outw(a, SWAB7206(*__b2), r);          \
+                       __b2++; \
+               } \
+       } while (0)
 #else                  /* if not CONFIG_CPU_PXA25X and not CONFIG_LEON */
 
 #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
index 79d656133adb4d50a7a28dfb529f81121db708ac..dcdba4ea827190759ea9ab0de43239a02024a096 100644 (file)
@@ -597,6 +597,8 @@ static int init_phy(struct eth_device *dev)
                tsec_configure_serdes(priv);
 
        phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+       if (!phydev)
+               return 0;
 
        phydev->supported &= supported;
        phydev->advertising = phydev->supported;
diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
new file mode 100644 (file)
index 0000000..9fc3c18
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ *  Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ *  SPDX-License-Identifier:      GPL-2.0+
+ *
+ *  Driver for the Vitesse VSC9953 L2 Switch
+ */
+
+#include <asm/io.h>
+#include <asm/fsl_serdes.h>
+#include <fm_eth.h>
+#include <asm/fsl_memac.h>
+#include <vsc9953.h>
+
+static struct vsc9953_info vsc9953_l2sw = {
+               .port[0] = VSC9953_PORT_INFO_INITIALIZER(0),
+               .port[1] = VSC9953_PORT_INFO_INITIALIZER(1),
+               .port[2] = VSC9953_PORT_INFO_INITIALIZER(2),
+               .port[3] = VSC9953_PORT_INFO_INITIALIZER(3),
+               .port[4] = VSC9953_PORT_INFO_INITIALIZER(4),
+               .port[5] = VSC9953_PORT_INFO_INITIALIZER(5),
+               .port[6] = VSC9953_PORT_INFO_INITIALIZER(6),
+               .port[7] = VSC9953_PORT_INFO_INITIALIZER(7),
+               .port[8] = VSC9953_PORT_INFO_INITIALIZER(8),
+               .port[9] = VSC9953_PORT_INFO_INITIALIZER(9),
+};
+
+void vsc9953_port_info_set_mdio(int port, struct mii_dev *bus)
+{
+       if (!VSC9953_PORT_CHECK(port))
+               return;
+
+       vsc9953_l2sw.port[port].bus = bus;
+}
+
+void vsc9953_port_info_set_phy_address(int port, int address)
+{
+       if (!VSC9953_PORT_CHECK(port))
+               return;
+
+       vsc9953_l2sw.port[port].phyaddr = address;
+}
+
+void vsc9953_port_info_set_phy_int(int port, phy_interface_t phy_int)
+{
+       if (!VSC9953_PORT_CHECK(port))
+               return;
+
+       vsc9953_l2sw.port[port].enet_if = phy_int;
+}
+
+void vsc9953_port_enable(int port)
+{
+       if (!VSC9953_PORT_CHECK(port))
+               return;
+
+       vsc9953_l2sw.port[port].enabled = 1;
+}
+
+void vsc9953_port_disable(int port)
+{
+       if (!VSC9953_PORT_CHECK(port))
+               return;
+
+       vsc9953_l2sw.port[port].enabled = 0;
+}
+
+static void vsc9953_mdio_write(struct vsc9953_mii_mng *phyregs, int port_addr,
+               int regnum, int value)
+{
+       int                     timeout = 50000;
+
+       out_le32(&phyregs->miimcmd, (0x1 << 31) | ((port_addr & 0x1f) << 25) |
+                       ((regnum & 0x1f) << 20) | ((value & 0xffff) << 4) |
+                       (0x1 << 1));
+       asm("sync");
+
+       while ((in_le32(&phyregs->miimstatus) & 0x8) && --timeout)
+               udelay(1);
+
+       if (timeout == 0)
+               debug("Timeout waiting for MDIO write\n");
+}
+
+static int vsc9953_mdio_read(struct vsc9953_mii_mng *phyregs, int port_addr,
+               int regnum)
+{
+       int                     value = 0xFFFF;
+       int                     timeout = 50000;
+
+       while ((in_le32(&phyregs->miimstatus) & MIIMIND_OPR_PEND) && --timeout)
+               udelay(1);
+       if (timeout == 0) {
+               debug("Timeout waiting for MDIO operation to finish\n");
+               return value;
+       }
+
+       /* Put the address of the phy, and the register
+        * number into MIICMD
+        */
+       out_le32(&phyregs->miimcmd, (0x1 << 31) | ((port_addr & 0x1f) << 25) |
+                       ((regnum & 0x1f) << 20) | ((value & 0xffff) << 4) |
+                       (0x2 << 1));
+
+       timeout = 50000;
+       /* Wait for the the indication that the read is done */
+       while ((in_le32(&phyregs->miimstatus) & 0x8) && --timeout)
+               udelay(1);
+       if (timeout == 0)
+               debug("Timeout waiting for MDIO read\n");
+
+       /* Grab the value read from the PHY */
+       value = in_le32(&phyregs->miimdata);
+
+       if ((value & 0x00030000) == 0)
+               return value & 0x0000ffff;
+
+       return value;
+}
+
+static int init_phy(struct eth_device *dev)
+{
+       struct vsc9953_port_info        *l2sw_port = dev->priv;
+       struct phy_device               *phydev = NULL;
+
+#ifdef CONFIG_PHYLIB
+       if (!l2sw_port->bus)
+               return 0;
+       phydev = phy_connect(l2sw_port->bus, l2sw_port->phyaddr, dev,
+                       l2sw_port->enet_if);
+       if (!phydev) {
+               printf("Failed to connect\n");
+               return -1;
+       }
+
+       phydev->supported &= SUPPORTED_10baseT_Half |
+                       SUPPORTED_10baseT_Full |
+                       SUPPORTED_100baseT_Half |
+                       SUPPORTED_100baseT_Full |
+                       SUPPORTED_1000baseT_Full;
+       phydev->advertising = phydev->supported;
+
+       l2sw_port->phydev = phydev;
+
+       phy_config(phydev);
+#endif
+
+       return 0;
+}
+
+static int vsc9953_port_init(int port)
+{
+       struct eth_device               *dev;
+
+       /* Internal ports never have a PHY */
+       if (VSC9953_INTERNAL_PORT_CHECK(port))
+               return 0;
+
+       /* alloc eth device */
+       dev = (struct eth_device *)calloc(1, sizeof(struct eth_device));
+       if (!dev)
+               return 1;
+
+       sprintf(dev->name, "SW@PORT%d", port);
+       dev->priv = &vsc9953_l2sw.port[port];
+       dev->init = NULL;
+       dev->halt = NULL;
+       dev->send = NULL;
+       dev->recv = NULL;
+
+       if (init_phy(dev)) {
+               free(dev);
+               return 1;
+       }
+
+       return 0;
+}
+
+void vsc9953_init(bd_t *bis)
+{
+       u32                             i, hdx_cfg = 0, phy_addr = 0;
+       int                             timeout;
+       struct vsc9953_system_reg       *l2sys_reg;
+       struct vsc9953_qsys_reg         *l2qsys_reg;
+       struct vsc9953_dev_gmii         *l2dev_gmii_reg;
+       struct vsc9953_analyzer         *l2ana_reg;
+       struct vsc9953_devcpu_gcb       *l2dev_gcb;
+
+       l2dev_gmii_reg = (struct vsc9953_dev_gmii *)(VSC9953_OFFSET +
+                       VSC9953_DEV_GMII_OFFSET);
+
+       l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
+                       VSC9953_ANA_OFFSET);
+
+       l2sys_reg = (struct vsc9953_system_reg *)(VSC9953_OFFSET +
+                       VSC9953_SYS_OFFSET);
+
+       l2qsys_reg = (struct vsc9953_qsys_reg *)(VSC9953_OFFSET +
+                       VSC9953_QSYS_OFFSET);
+
+       l2dev_gcb = (struct vsc9953_devcpu_gcb *)(VSC9953_OFFSET +
+                       VSC9953_DEVCPU_GCB);
+
+       out_le32(&l2dev_gcb->chip_regs.soft_rst,
+                CONFIG_VSC9953_SOFT_SWC_RST_ENA);
+       timeout = 50000;
+       while ((in_le32(&l2dev_gcb->chip_regs.soft_rst) &
+                       CONFIG_VSC9953_SOFT_SWC_RST_ENA) && --timeout)
+               udelay(1); /* busy wait for vsc9953 soft reset */
+       if (timeout == 0)
+               debug("Timeout waiting for VSC9953 to reset\n");
+
+       out_le32(&l2sys_reg->sys.reset_cfg, CONFIG_VSC9953_MEM_ENABLE |
+                CONFIG_VSC9953_MEM_INIT);
+
+       timeout = 50000;
+       while ((in_le32(&l2sys_reg->sys.reset_cfg) &
+               CONFIG_VSC9953_MEM_INIT) && --timeout)
+               udelay(1); /* busy wait for vsc9953 memory init */
+       if (timeout == 0)
+               debug("Timeout waiting for VSC9953 memory to initialize\n");
+
+       out_le32(&l2sys_reg->sys.reset_cfg, (in_le32(&l2sys_reg->sys.reset_cfg)
+                       | CONFIG_VSC9953_CORE_ENABLE));
+
+       /* VSC9953 Setting to be done once only */
+       out_le32(&l2qsys_reg->sys.ext_cpu_cfg, 0x00000b00);
+
+       for (i = 0; i < VSC9953_MAX_PORTS; i++) {
+               if (vsc9953_port_init(i))
+                       printf("Failed to initialize l2switch port %d\n", i);
+
+               /* Enable VSC9953 GMII Ports Port ID 0 - 7 */
+               if (VSC9953_INTERNAL_PORT_CHECK(i)) {
+                       out_le32(&l2ana_reg->pfc[i].pfc_cfg,
+                                CONFIG_VSC9953_PFC_FC_QSGMII);
+                       out_le32(&l2sys_reg->pause_cfg.mac_fc_cfg[i],
+                                CONFIG_VSC9953_MAC_FC_CFG_QSGMII);
+               } else {
+                       out_le32(&l2ana_reg->pfc[i].pfc_cfg,
+                                CONFIG_VSC9953_PFC_FC);
+                       out_le32(&l2sys_reg->pause_cfg.mac_fc_cfg[i],
+                                CONFIG_VSC9953_MAC_FC_CFG);
+               }
+               out_le32(&l2dev_gmii_reg->port_mode.clock_cfg,
+                        CONFIG_VSC9953_CLOCK_CFG);
+               out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_ena_cfg,
+                        CONFIG_VSC9953_MAC_ENA_CFG);
+               out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_mode_cfg,
+                        CONFIG_VSC9953_MAC_MODE_CFG);
+               out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_ifg_cfg,
+                        CONFIG_VSC9953_MAC_IFG_CFG);
+               /* mac_hdx_cfg varies with port id*/
+               hdx_cfg = (CONFIG_VSC9953_MAC_HDX_CFG | (i << 16));
+               out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_hdx_cfg, hdx_cfg);
+               out_le32(&l2sys_reg->sys.front_port_mode[i],
+                        CONFIG_VSC9953_FRONT_PORT_MODE);
+               out_le32(&l2qsys_reg->sys.switch_port_mode[i],
+                        CONFIG_VSC9953_PORT_ENA);
+               out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_maxlen_cfg,
+                        CONFIG_VSC9953_MAC_MAX_LEN);
+               out_le32(&l2sys_reg->pause_cfg.pause_cfg[i],
+                        CONFIG_VSC9953_PAUSE_CFG);
+               /* WAIT FOR 2 us*/
+               udelay(2);
+
+               l2dev_gmii_reg = (struct vsc9953_dev_gmii *)(
+                               (char *)l2dev_gmii_reg
+                               + T1040_SWITCH_GMII_DEV_OFFSET);
+
+               /* Initialize Lynx PHY Wrappers */
+               phy_addr = 0;
+               if (vsc9953_l2sw.port[i].enet_if ==
+                               PHY_INTERFACE_MODE_QSGMII)
+                       phy_addr = (i + 0x4) & 0x1F;
+               else if (vsc9953_l2sw.port[i].enet_if ==
+                               PHY_INTERFACE_MODE_SGMII)
+                       phy_addr = (i + 1) & 0x1F;
+
+               if (phy_addr) {
+                       /* SGMII IF mode + AN enable */
+                       vsc9953_mdio_write(&l2dev_gcb->mii_mng[0], phy_addr,
+                                          0x14, PHY_SGMII_IF_MODE_AN |
+                                          PHY_SGMII_IF_MODE_SGMII);
+                       /* Dev ability according to SGMII specification */
+                       vsc9953_mdio_write(&l2dev_gcb->mii_mng[0], phy_addr,
+                                          0x4, PHY_SGMII_DEV_ABILITY_SGMII);
+                       /* Adjust link timer for SGMII
+                        * 1.6 ms in units of 8 ns = 2 * 10^5 = 0x30d40
+                        */
+                       vsc9953_mdio_write(&l2dev_gcb->mii_mng[0], phy_addr,
+                                          0x13, 0x0003);
+                       vsc9953_mdio_write(&l2dev_gcb->mii_mng[0], phy_addr,
+                                          0x12, 0x0d40);
+                       /* Restart AN */
+                       vsc9953_mdio_write(&l2dev_gcb->mii_mng[0], phy_addr,
+                                          0x0, PHY_SGMII_CR_DEF_VAL |
+                                          PHY_SGMII_CR_RESET_AN);
+
+                       timeout = 50000;
+                       while ((vsc9953_mdio_read(&l2dev_gcb->mii_mng[0],
+                                       phy_addr, 0x01) & 0x0020) && --timeout)
+                               udelay(1); /* wait for AN to complete */
+                       if (timeout == 0)
+                               debug("Timeout waiting for AN to complete\n");
+               }
+       }
+
+       printf("VSC9953 L2 switch initialized\n");
+       return;
+}
+
+#ifdef CONFIG_VSC9953_CMD
+/* Enable/disable status of a VSC9953 port */
+static void vsc9953_port_status_set(int port_nr, u8 enabled)
+{
+       u32                     val;
+       struct vsc9953_qsys_reg *l2qsys_reg;
+
+       /* Administrative down */
+       if (vsc9953_l2sw.port[port_nr].enabled == 0)
+               return;
+
+       l2qsys_reg = (struct vsc9953_qsys_reg *)(VSC9953_OFFSET +
+                       VSC9953_QSYS_OFFSET);
+
+       val = in_le32(&l2qsys_reg->sys.switch_port_mode[port_nr]);
+       if (enabled == 1)
+               val |= (1 << 13);
+       else
+               val &= ~(1 << 13);
+
+       out_le32(&l2qsys_reg->sys.switch_port_mode[port_nr], val);
+}
+
+/* Set all VSC9953 ports' status */
+static void vsc9953_port_all_status_set(u8 enabled)
+{
+       int             i;
+
+       for (i = 0; i < VSC9953_MAX_PORTS; i++)
+               vsc9953_port_status_set(i, enabled);
+}
+
+/* Start autonegotiation for a VSC9953 PHY */
+static void vsc9953_phy_autoneg(int port_nr)
+{
+       if (!vsc9953_l2sw.port[port_nr].phydev)
+               return;
+
+       if (vsc9953_l2sw.port[port_nr].phydev->drv->startup(
+                       vsc9953_l2sw.port[port_nr].phydev))
+               printf("Failed to start PHY for port %d\n", port_nr);
+}
+
+/* Start autonegotiation for all VSC9953 PHYs */
+static void vsc9953_phy_all_autoneg(void)
+{
+       int             i;
+
+       for (i = 0; i < VSC9953_MAX_PORTS; i++)
+               vsc9953_phy_autoneg(i);
+}
+
+/* Print a VSC9953 port's configuration */
+static void vsc9953_port_config_show(int port)
+{
+       int                     speed;
+       int                     duplex;
+       int                     link;
+       u8                      enabled;
+       u32                     val;
+       struct vsc9953_qsys_reg *l2qsys_reg;
+
+       l2qsys_reg = (struct vsc9953_qsys_reg *)(VSC9953_OFFSET +
+                       VSC9953_QSYS_OFFSET);
+
+       val = in_le32(&l2qsys_reg->sys.switch_port_mode[port]);
+       enabled = vsc9953_l2sw.port[port].enabled &
+                       ((val & 0x00002000) >> 13);
+
+       /* internal ports (8 and 9) are fixed */
+       if (VSC9953_INTERNAL_PORT_CHECK(port)) {
+               link = 1;
+               speed = SPEED_2500;
+               duplex = DUPLEX_FULL;
+       } else {
+               if (vsc9953_l2sw.port[port].phydev) {
+                       link = vsc9953_l2sw.port[port].phydev->link;
+                       speed = vsc9953_l2sw.port[port].phydev->speed;
+                       duplex = vsc9953_l2sw.port[port].phydev->duplex;
+               } else {
+                       link = -1;
+                       speed = -1;
+                       duplex = -1;
+               }
+       }
+
+       printf("%8d ", port);
+       printf("%8s ", enabled == 1 ? "enabled" : "disabled");
+       printf("%8s ", link == 1 ? "up" : "down");
+
+       switch (speed) {
+       case SPEED_10:
+               printf("%8d ", 10);
+               break;
+       case SPEED_100:
+               printf("%8d ", 100);
+               break;
+       case SPEED_1000:
+               printf("%8d ", 1000);
+               break;
+       case SPEED_2500:
+               printf("%8d ", 2500);
+               break;
+       case SPEED_10000:
+               printf("%8d ", 10000);
+               break;
+       default:
+               printf("%8s ", "-");
+       }
+
+       printf("%8s\n", duplex == DUPLEX_FULL ? "full" : "half");
+}
+
+/* Print VSC9953 ports' configuration */
+static void vsc9953_port_all_config_show(void)
+{
+       int             i;
+
+       for (i = 0; i < VSC9953_MAX_PORTS; i++)
+               vsc9953_port_config_show(i);
+}
+
+/* function to interpret commands starting with "ethsw " */
+static int do_ethsw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       u8 enable;
+       u32 port;
+
+       if (argc < 4)
+               return -1;
+
+       if (strcmp(argv[1], "port"))
+               return -1;
+
+       if (!strcmp(argv[3], "show")) {
+               if (!strcmp(argv[2], "all")) {
+                       vsc9953_phy_all_autoneg();
+                       printf("%8s %8s %8s %8s %8s\n",
+                              "Port", "Status", "Link", "Speed",
+                              "Duplex");
+                       vsc9953_port_all_config_show();
+                       return 0;
+               } else {
+                       port = simple_strtoul(argv[2], NULL, 10);
+                       if (!VSC9953_PORT_CHECK(port))
+                               return -1;
+                       vsc9953_phy_autoneg(port);
+                       printf("%8s %8s %8s %8s %8s\n",
+                              "Port", "Status", "Link", "Speed",
+                              "Duplex");
+                       vsc9953_port_config_show(port);
+                       return 0;
+               }
+       } else if (!strcmp(argv[3], "enable")) {
+               enable = 1;
+       } else if (!strcmp(argv[3], "disable")) {
+               enable = 0;
+       } else {
+               return -1;
+       }
+
+       if (!strcmp(argv[2], "all")) {
+               vsc9953_port_all_status_set(enable);
+               return 0;
+       } else {
+               port = simple_strtoul(argv[2], NULL, 10);
+               if (!VSC9953_PORT_CHECK(port))
+                       return -1;
+               vsc9953_port_status_set(port, enable);
+               return 0;
+       }
+
+       return -1;
+}
+
+U_BOOT_CMD(ethsw, 5, 0, do_ethsw,
+          "vsc9953 l2 switch commands",
+          "port <port_nr> enable|disable\n"
+          "    - enable/disable an l2 switch port\n"
+          "      port_nr=0..9; use \"all\" for all ports\n"
+          "ethsw port <port_nr> show\n"
+          "    - show an l2 switch port's configuration\n"
+          "      port_nr=0..9; use \"all\" for all ports\n"
+);
+#endif /* CONFIG_VSC9953_CMD */
index dab78d073dab6185ec5445617185f794c437f5b9..7cc86571e4952e001f2d5da234795abd520d223a 100644 (file)
@@ -231,7 +231,7 @@ static int ll_temac_init(struct eth_device *dev, bd_t *bis)
        struct ll_temac *ll_temac = dev->priv;
        int ret;
 
-       printf("%s: Xilinx XPS LocalLink Tri-Mode Ether MAC #%d at 0x%08X.\n",
+       printf("%s: Xilinx XPS LocalLink Tri-Mode Ether MAC #%d at 0x%08lx.\n",
                dev->name, dev->index, dev->iobase);
 
        if (!ll_temac_setup_ctrl(dev))
index 3cadd23bb46aa77529b9a15909f20409588eb4e9..430e22821c7d5c21371b2e59a22c6a6d010ee10e 100644 (file)
@@ -489,7 +489,8 @@ static int zynq_gem_miiphy_write(const char *devname, uchar addr,
        return phywrite(dev, addr, reg, val);
 }
 
-int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr, u32 emio)
+int zynq_gem_initialize(bd_t *bis, phys_addr_t base_addr,
+                       int phy_addr, u32 emio)
 {
        struct eth_device *dev;
        struct zynq_gem_priv *priv;
@@ -521,7 +522,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr, u32 emio)
        priv->phyaddr = phy_addr;
        priv->emio = emio;
 
-       sprintf(dev->name, "Gem.%x", base_addr);
+       sprintf(dev->name, "Gem.%lx", base_addr);
 
        dev->iobase = base_addr;
 
index 83fd9a068f3635510c6596dfc45e3debc5c48e42..950a2475c500720e978ba370cfac700e08e358b9 100644 (file)
@@ -198,12 +198,7 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
                for (bus = hose->first_busno; bus <= hose->last_busno; bus++)
 #endif
                        for (bdf = PCI_BDF(bus, 0, 0);
-#if defined(CONFIG_ELPPC) || defined(CONFIG_PPMC7XX)
-                            bdf < PCI_BDF(bus, PCI_MAX_PCI_DEVICES - 1,
-                               PCI_MAX_PCI_FUNCTIONS - 1);
-#else
                             bdf < PCI_BDF(bus + 1, 0, 0);
-#endif
                             bdf += PCI_BDF(0, 0, 1)) {
                                if (pci_skip_dev(hose, bdf))
                                        continue;
index 44470fa812b0ed42ca475bb27262d1b7be0fb733..ed928574061600118a7ed8c0e83398c5c070291c 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include <common.h>
-
+#include <errno.h>
 #include <pci.h>
 
 #undef DEBUG
@@ -191,6 +191,32 @@ void pciauto_setup_device(struct pci_controller *hose,
        pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
 }
 
+int pciauto_setup_rom(struct pci_controller *hose, pci_dev_t dev)
+{
+       pci_addr_t bar_value;
+       pci_size_t bar_size;
+       u32 bar_response;
+       u16 cmdstat = 0;
+
+       pci_hose_write_config_dword(hose, dev, PCI_ROM_ADDRESS, 0xfffffffe);
+       pci_hose_read_config_dword(hose, dev, PCI_ROM_ADDRESS, &bar_response);
+       if (!bar_response)
+               return -ENOENT;
+
+       bar_size = -(bar_response & ~1);
+       DEBUGF("PCI Autoconfig: ROM, size=%#x, ", bar_size);
+       if (pciauto_region_allocate(hose->pci_mem, bar_size, &bar_value) == 0) {
+               pci_hose_write_config_dword(hose, dev, PCI_ROM_ADDRESS,
+                                           bar_value);
+       }
+       DEBUGF("\n");
+       pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
+       cmdstat |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
+       pci_hose_write_config_word(hose, dev, PCI_COMMAND, cmdstat);
+
+       return 0;
+}
+
 void pciauto_prescan_setup_bridge(struct pci_controller *hose,
                                         pci_dev_t dev, int sub_bus)
 {
index 7d25cc9f2f37d8b1a06b9cd67f2a320e013b958e..5729a152e5bb00ed759dfe90bd7750f10b7e20b7 100644 (file)
@@ -66,6 +66,7 @@ static int pci_rom_probe(pci_dev_t dev, uint class,
        struct pci_rom_header *rom_header;
        struct pci_rom_data *rom_data;
        u16 vendor, device;
+       u16 rom_vendor, rom_device;
        u32 vendev;
        u32 mapped_vendev;
        u32 rom_address;
@@ -80,7 +81,12 @@ static int pci_rom_probe(pci_dev_t dev, uint class,
 #ifdef CONFIG_X86_OPTION_ROM_ADDR
        rom_address = CONFIG_X86_OPTION_ROM_ADDR;
 #else
-       pci_write_config_dword(dev, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);
+
+       if (pciauto_setup_rom(pci_bus_to_hose(PCI_BUS(dev)), dev)) {
+               debug("Cannot find option ROM\n");
+               return -ENOENT;
+       }
+
        pci_read_config_dword(dev, PCI_ROM_ADDRESS, &rom_address);
        if (rom_address == 0x00000000 || rom_address == 0xffffffff) {
                debug("%s: rom_address=%x\n", __func__, rom_address);
@@ -92,29 +98,31 @@ static int pci_rom_probe(pci_dev_t dev, uint class,
                               rom_address | PCI_ROM_ADDRESS_ENABLE);
 #endif
        debug("Option ROM address %x\n", rom_address);
-       rom_header = (struct pci_rom_header *)rom_address;
+       rom_header = (struct pci_rom_header *)(unsigned long)rom_address;
 
        debug("PCI expansion ROM, signature %#04x, INIT size %#04x, data ptr %#04x\n",
-             le32_to_cpu(rom_header->signature),
-             rom_header->size * 512, le32_to_cpu(rom_header->data));
+             le16_to_cpu(rom_header->signature),
+             rom_header->size * 512, le16_to_cpu(rom_header->data));
 
-       if (le32_to_cpu(rom_header->signature) != PCI_ROM_HDR) {
+       if (le16_to_cpu(rom_header->signature) != PCI_ROM_HDR) {
                printf("Incorrect expansion ROM header signature %04x\n",
-                      le32_to_cpu(rom_header->signature));
+                      le16_to_cpu(rom_header->signature));
                return -EINVAL;
        }
 
-       rom_data = (((void *)rom_header) + le32_to_cpu(rom_header->data));
+       rom_data = (((void *)rom_header) + le16_to_cpu(rom_header->data));
+       rom_vendor = le16_to_cpu(rom_data->vendor);
+       rom_device = le16_to_cpu(rom_data->device);
 
        debug("PCI ROM image, vendor ID %04x, device ID %04x,\n",
-             rom_data->vendor, rom_data->device);
+             rom_vendor, rom_device);
 
        /* If the device id is mapped, a mismatch is expected */
-       if ((vendor != rom_data->vendor || device != rom_data->device) &&
+       if ((vendor != rom_vendor || device != rom_device) &&
            (vendev == mapped_vendev)) {
                printf("ID mismatch: vendor ID %04x, device ID %04x\n",
-                      rom_data->vendor, rom_data->device);
-               return -EPERM;
+                      rom_vendor, rom_device);
+               /* Continue anyway */
        }
 
        debug("PCI ROM image, Class Code %04x%02x, Code Type %02x\n",
@@ -144,17 +152,23 @@ int pci_rom_load(uint16_t class, struct pci_rom_header *rom_header,
                                                            image_size);
 
                rom_data = (struct pci_rom_data *)((void *)rom_header +
-                               le32_to_cpu(rom_header->data));
+                               le16_to_cpu(rom_header->data));
 
-               image_size = le32_to_cpu(rom_data->ilen) * 512;
-       } while ((rom_data->type != 0) && (rom_data->indicator != 0));
+               image_size = le16_to_cpu(rom_data->ilen) * 512;
+       } while ((rom_data->type != 0) && (rom_data->indicator == 0));
 
        if (rom_data->type != 0)
                return -EACCES;
 
        rom_size = rom_header->size * 512;
 
+#ifdef PCI_VGA_RAM_IMAGE_START
        target = (void *)PCI_VGA_RAM_IMAGE_START;
+#else
+       target = (void *)malloc(rom_size);
+       if (!target)
+               return -ENOMEM;
+#endif
        if (target != rom_header) {
                ulong start = get_timer(0);
 
index f9e05add19157ee885e4c97b7fe4effe052e5333..67b5fdf07c5ad833c03d00981392555a9adc9e71 100644 (file)
@@ -459,7 +459,6 @@ static int tegra_pcie_parse_port_info(const void *fdt, int node,
                                      unsigned int *lanes)
 {
        struct fdt_pci_addr addr;
-       pci_dev_t bdf;
        int err;
 
        err = fdtdec_get_int(fdt, node, "nvidia,num-lanes", 0);
@@ -470,13 +469,13 @@ static int tegra_pcie_parse_port_info(const void *fdt, int node,
 
        *lanes = err;
 
-       err = fdtdec_get_pci_bdf(fdt, node, &addr, &bdf);
+       err = fdtdec_get_pci_addr(fdt, node, 0, "reg", &addr);
        if (err < 0) {
                error("failed to parse \"reg\" property");
                return err;
        }
 
-       *index = PCI_DEV(bdf) - 1;
+       *index = PCI_DEV(addr.phys_hi) - 1;
 
        return 0;
 }
index e68e16b3211757271a27e99d0089fbf4b29fc83f..f8f0239484fd43811cbf9dc9fcff3bb6dec179ef 100644 (file)
@@ -63,3 +63,13 @@ config AXP221_ALDO3_VOLT
        Set the voltage (mV) to program the axp221 aldo3 at, set to 0 to
        disable aldo3. This is typically connected to VCC-PLL and AVCC and
        must be set to 3V.
+
+config AXP221_ELDO3_VOLT
+       int "axp221 eldo3 voltage"
+       depends on AXP221_POWER
+       default 0
+       ---help---
+       Set the voltage (mV) to program the axp221 eldo3 at, set to 0 to
+       disable eldo3. On some A31(s) tablets it might be used to supply
+       1.2V for the SSD2828 chip (converter of parallel LCD interface
+       into MIPI DSI).
index 4c6de79cd608cae49eae25bfbb4973654897ce9a..a60bb5f83fbc5cda5a5533b3893f85e47d450c0a 100644 (file)
@@ -31,7 +31,7 @@ static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
 {
        int err;
 
-       err = i2c_read(pmic, reg, value, 1);
+       err = dm_i2c_read(pmic, reg, value, 1);
        if (err < 0)
                return err;
 
@@ -42,7 +42,7 @@ static int as3722_write(struct udevice *pmic, u8 reg, u8 value)
 {
        int err;
 
-       err = i2c_write(pmic, reg, &value, 1);
+       err = dm_i2c_write(pmic, reg, &value, 1);
        if (err < 0)
                return err;
 
@@ -242,7 +242,7 @@ int as3722_init(struct udevice **devp)
        const unsigned int address = 0x40;
        int err;
 
-       err = i2c_get_chip_for_busnum(bus, address, &pmic);
+       err = i2c_get_chip_for_busnum(bus, address, 1, &pmic);
        if (err)
                return err;
        err = as3722_read_id(pmic, &id, &revision);
index 3b1a6a73aed8ecfd8f748c1ffc37db8fff747e2e..4565398b0bf37d70b55e7f403aef4c3e70877cc3 100644 (file)
@@ -16,6 +16,11 @@ enum axp209_reg {
        AXP209_DCDC3_VOLTAGE = 0x27,
        AXP209_LDO24_VOLTAGE = 0x28,
        AXP209_LDO3_VOLTAGE = 0x29,
+       AXP209_IRQ_ENABLE1 = 0x40,
+       AXP209_IRQ_ENABLE2 = 0x41,
+       AXP209_IRQ_ENABLE3 = 0x42,
+       AXP209_IRQ_ENABLE4 = 0x43,
+       AXP209_IRQ_ENABLE5 = 0x44,
        AXP209_IRQ_STATUS5 = 0x4c,
        AXP209_SHUTDOWN = 0x32,
        AXP209_GPIO0_CTRL = 0x90,
@@ -143,7 +148,7 @@ int axp209_set_ldo4(int mvolt)
 int axp209_init(void)
 {
        u8 ver;
-       int rc;
+       int i, rc;
 
        rc = axp209_read(AXP209_CHIP_VERSION, &ver);
        if (rc)
@@ -155,6 +160,13 @@ int axp209_init(void)
        if (ver != 0x1)
                return -1;
 
+       /* Mask all interrupts */
+       for (i = AXP209_IRQ_ENABLE1; i <= AXP209_IRQ_ENABLE5; i++) {
+               rc = axp209_write(i, 0);
+               if (rc)
+                       return rc;
+       }
+
        return 0;
 }
 
index 4c86f099a2df52bb8223ed17115cbbc3da3232bf..3e07f23c20c621ba9cbfc101d788462aed93026d 100644 (file)
@@ -29,9 +29,7 @@ static int pmic_bus_init(void)
 #else
        int ret;
 
-       rsb_init();
-
-       ret = rsb_set_device_mode(AXP223_DEVICE_MODE_DATA);
+       ret = rsb_init();
        if (ret)
                return ret;
 
@@ -302,6 +300,39 @@ int axp221_set_aldo3(unsigned int mvolt)
                              AXP221_OUTPUT_CTRL3_ALDO3_EN);
 }
 
+int axp221_set_eldo(int eldo_num, unsigned int mvolt)
+{
+       int ret;
+       u8 cfg = axp221_mvolt_to_cfg(mvolt, 700, 3300, 100);
+       u8 addr, bits;
+
+       switch (eldo_num) {
+       case 3:
+               addr = AXP221_ELDO3_CTRL;
+               bits = AXP221_OUTPUT_CTRL2_ELDO3_EN;
+               break;
+       case 2:
+               addr = AXP221_ELDO2_CTRL;
+               bits = AXP221_OUTPUT_CTRL2_ELDO2_EN;
+               break;
+       case 1:
+               addr = AXP221_ELDO1_CTRL;
+               bits = AXP221_OUTPUT_CTRL2_ELDO1_EN;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (mvolt == 0)
+               return axp221_clrbits(AXP221_OUTPUT_CTRL2, bits);
+
+       ret = pmic_bus_write(addr, cfg);
+       if (ret)
+               return ret;
+
+       return axp221_setbits(AXP221_OUTPUT_CTRL2, bits);
+}
+
 int axp221_init(void)
 {
        /* This cannot be 0 because it is used in SPL before BSS is ready */
index e7b07ebab49ea365d51234621ac989a8d4078e2e..985cfdb90183c7004abe42577c274b24e1b5f073 100644 (file)
@@ -14,5 +14,6 @@ obj-$(CONFIG_POWER_PFUZE100) += pmic_pfuze100.o
 obj-$(CONFIG_POWER_TPS65090_I2C) += pmic_tps65090.o
 obj-$(CONFIG_POWER_TPS65090_EC) += pmic_tps65090_ec.o
 obj-$(CONFIG_POWER_TPS65217) += pmic_tps65217.o
+obj-$(CONFIG_POWER_TPS65218) += pmic_tps62362.o
 obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
diff --git a/drivers/power/pmic/pmic_tps62362.c b/drivers/power/pmic/pmic_tps62362.c
new file mode 100644 (file)
index 0000000..2123685
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * (C) Copyright 2014 Texas Instruments Incorporated -  http://www.ti.com
+ * Author: Felipe Balbi <balbi@ti.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <asm/errno.h>
+#include <power/pmic.h>
+#include <power/tps62362.h>
+
+/**
+ * tps62362_voltage_update() - Function to change a voltage level, as this
+ *                            is a multi-step process.
+ * @reg:       Register address to write to
+ * @volt_sel:  Voltage register value to write
+ * @return:    0 on success, 1 on failure
+ */
+int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel)
+{
+       if (reg > TPS62362_NUM_REGS)
+               return 1;
+
+       return i2c_write(TPS62362_I2C_ADDR, reg, 1, &volt_sel, 1);
+}
+
+int power_tps62362_init(unsigned char bus)
+{
+       static const char name[] = "TPS62362";
+       struct pmic *p = pmic_alloc();
+
+       if (!p) {
+               printf("%s: POWER allocation error!\n", __func__);
+               return -ENOMEM;
+       }
+
+       p->name = name;
+       p->interface = PMIC_I2C;
+       p->number_of_regs = TPS62362_NUM_REGS;
+       p->hw.i2c.addr = TPS62362_I2C_ADDR;
+       p->hw.i2c.tx_num = 1;
+       p->bus = bus;
+
+       return 0;
+}
index 29bab4cc00dc7683121fc3302d65c660b9190a3f..865098386d932ae22ce5f3d781e268bede874a95 100644 (file)
@@ -37,7 +37,7 @@ static int tps6586x_read(int reg)
        int     retval = -1;
 
        for (i = 0; i < MAX_I2C_RETRY; ++i) {
-               if (!i2c_read(tps6586x_dev, reg,  &data, 1)) {
+               if (!dm_i2c_read(tps6586x_dev, reg,  &data, 1)) {
                        retval = (int)data;
                        goto exit;
                }
@@ -60,7 +60,7 @@ static int tps6586x_write(int reg, uchar *data, uint len)
        int     retval = -1;
 
        for (i = 0; i < MAX_I2C_RETRY; ++i) {
-               if (!i2c_write(tps6586x_dev, reg, data, len)) {
+               if (!dm_i2c_write(tps6586x_dev, reg, data, len)) {
                        retval = 0;
                        goto exit;
                }
index 39e6041be365ccdb9089d21ee302c9de76d429cf..c9d318c0a7eb2d83e992ded95615bd550310d1e9 100644 (file)
@@ -27,9 +27,6 @@
 /* Set this to 1 to clear the CMOS RAM */
 #define CLEAR_CMOS 0
 
-static uchar rtc_read  (uchar reg);
-static void  rtc_write (uchar reg, uchar val);
-
 #define RTC_PORT_MC146818      CONFIG_SYS_ISA_IO_BASE_ADDRESS +  0x70
 #define RTC_SECONDS            0x00
 #define RTC_SECONDS_ALARM      0x01
@@ -60,24 +57,24 @@ int rtc_get (struct rtc_time *tmp)
 {
        uchar sec, min, hour, mday, wday, mon, year;
   /* here check if rtc can be accessed */
-       while((rtc_read(RTC_CONFIG_A)&0x80)==0x80);
-       sec     = rtc_read (RTC_SECONDS);
-       min     = rtc_read (RTC_MINUTES);
-       hour    = rtc_read (RTC_HOURS);
-       mday    = rtc_read (RTC_DATE_OF_MONTH);
-       wday    = rtc_read (RTC_DAY_OF_WEEK);
-       mon     = rtc_read (RTC_MONTH);
-       year    = rtc_read (RTC_YEAR);
+       while ((rtc_read8(RTC_CONFIG_A) & 0x80) == 0x80);
+       sec     = rtc_read8(RTC_SECONDS);
+       min     = rtc_read8(RTC_MINUTES);
+       hour    = rtc_read8(RTC_HOURS);
+       mday    = rtc_read8(RTC_DATE_OF_MONTH);
+       wday    = rtc_read8(RTC_DAY_OF_WEEK);
+       mon     = rtc_read8(RTC_MONTH);
+       year    = rtc_read8(RTC_YEAR);
 #ifdef RTC_DEBUG
        printf ( "Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x "
                "hr: %02x min: %02x sec: %02x\n",
                year, mon, mday, wday,
                hour, min, sec );
        printf ( "Alarms: month: %02x hour: %02x min: %02x sec: %02x\n",
-               rtc_read (RTC_CONFIG_D) & 0x3F,
-               rtc_read (RTC_HOURS_ALARM),
-               rtc_read (RTC_MINUTES_ALARM),
-               rtc_read (RTC_SECONDS_ALARM) );
+               rtc_read8(RTC_CONFIG_D) & 0x3F,
+               rtc_read8(RTC_HOURS_ALARM),
+               rtc_read8(RTC_MINUTES_ALARM),
+               rtc_read8(RTC_SECONDS_ALARM));
 #endif
        tmp->tm_sec  = bcd2bin (sec  & 0x7F);
        tmp->tm_min  = bcd2bin (min  & 0x7F);
@@ -108,80 +105,108 @@ int rtc_set (struct rtc_time *tmp)
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
-       rtc_write(RTC_CONFIG_B,0x82); /* disables the RTC to update the regs */
+       rtc_write8(RTC_CONFIG_B, 0x82); /* disable the RTC to update the regs */
 
-       rtc_write (RTC_YEAR, bin2bcd(tmp->tm_year % 100));
-       rtc_write (RTC_MONTH, bin2bcd(tmp->tm_mon));
-       rtc_write (RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday));
-       rtc_write (RTC_DATE_OF_MONTH, bin2bcd(tmp->tm_mday));
-       rtc_write (RTC_HOURS, bin2bcd(tmp->tm_hour));
-       rtc_write (RTC_MINUTES, bin2bcd(tmp->tm_min ));
-       rtc_write (RTC_SECONDS, bin2bcd(tmp->tm_sec ));
-       rtc_write(RTC_CONFIG_B,0x02); /* enables the RTC to update the regs */
+       rtc_write8(RTC_YEAR, bin2bcd(tmp->tm_year % 100));
+       rtc_write8(RTC_MONTH, bin2bcd(tmp->tm_mon));
+       rtc_write8(RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday));
+       rtc_write8(RTC_DATE_OF_MONTH, bin2bcd(tmp->tm_mday));
+       rtc_write8(RTC_HOURS, bin2bcd(tmp->tm_hour));
+       rtc_write8(RTC_MINUTES, bin2bcd(tmp->tm_min));
+       rtc_write8(RTC_SECONDS, bin2bcd(tmp->tm_sec));
+       rtc_write8(RTC_CONFIG_B, 0x02); /* enable the RTC to update the regs */
 
        return 0;
 }
 
 void rtc_reset (void)
 {
-       rtc_write(RTC_CONFIG_B,0x82); /* disables the RTC to update the regs */
-       rtc_write(RTC_CONFIG_A,0x20); /* Normal OP */
-       rtc_write(RTC_CONFIG_B,0x00);
-       rtc_write(RTC_CONFIG_B,0x00);
-       rtc_write(RTC_CONFIG_B,0x02); /* enables the RTC to update the regs */
+       rtc_write8(RTC_CONFIG_B, 0x82); /* disable the RTC to update the regs */
+       rtc_write8(RTC_CONFIG_A, 0x20); /* Normal OP */
+       rtc_write8(RTC_CONFIG_B, 0x00);
+       rtc_write8(RTC_CONFIG_B, 0x00);
+       rtc_write8(RTC_CONFIG_B, 0x02); /* enable the RTC to update the regs */
 }
 
 /* ------------------------------------------------------------------------- */
 
-#ifdef CONFIG_SYS_RTC_REG_BASE_ADDR
 /*
  * use direct memory access
  */
-static uchar rtc_read (uchar reg)
+int rtc_read8(int reg)
 {
+#ifdef CONFIG_SYS_RTC_REG_BASE_ADDR
        return in8(CONFIG_SYS_RTC_REG_BASE_ADDR + reg);
+#else
+       int ofs = 0;
+
+       if (reg >= 128) {
+               ofs = 2;
+               reg -= 128;
+       }
+       out8(RTC_PORT_MC146818 + ofs, reg);
+
+       return in8(RTC_PORT_MC146818 + ofs + 1);
+#endif
 }
 
-static void rtc_write (uchar reg, uchar val)
+void rtc_write8(int reg, uchar val)
 {
+#ifdef CONFIG_SYS_RTC_REG_BASE_ADDR
        out8(CONFIG_SYS_RTC_REG_BASE_ADDR + reg, val);
-}
 #else
-static uchar rtc_read (uchar reg)
+       int ofs = 0;
+
+       if (reg >= 128) {
+               ofs = 2;
+               reg -= 128;
+       }
+       out8(RTC_PORT_MC146818 + ofs, reg);
+       out8(RTC_PORT_MC146818 + ofs + 1, val);
+#endif
+}
+
+u32 rtc_read32(int reg)
 {
-       out8(RTC_PORT_MC146818,reg);
-       return in8(RTC_PORT_MC146818 + 1);
+       u32 value = 0;
+       int i;
+
+       for (i = 0; i < sizeof(value); i++)
+               value |= rtc_read8(reg + i) << (i << 3);
+
+       return value;
 }
 
-static void rtc_write (uchar reg, uchar val)
+void rtc_write32(int reg, u32 value)
 {
-       out8(RTC_PORT_MC146818,reg);
-       out8(RTC_PORT_MC146818+1, val);
+       int i;
+
+       for (i = 0; i < sizeof(value); i++)
+               rtc_write8(reg + i, (value >> (i << 3)) & 0xff);
 }
-#endif
 
 void rtc_init(void)
 {
 #if CLEAR_CMOS
        int i;
 
-       rtc_write(RTC_SECONDS_ALARM, 0);
-       rtc_write(RTC_MINUTES_ALARM, 0);
-       rtc_write(RTC_HOURS_ALARM, 0);
+       rtc_write8(RTC_SECONDS_ALARM, 0);
+       rtc_write8(RTC_MINUTES_ALARM, 0);
+       rtc_write8(RTC_HOURS_ALARM, 0);
        for (i = RTC_CONFIG_A; i < RTC_REG_SIZE; i++)
-               rtc_write(i, 0);
+               rtc_write8(i, 0);
        printf("RTC: zeroing CMOS RAM\n");
 #endif
 
        /* Setup the real time clock */
-       rtc_write(RTC_CONFIG_B, RTC_CONFIG_B_24H);
+       rtc_write8(RTC_CONFIG_B, RTC_CONFIG_B_24H);
        /* Setup the frequency it operates at */
-       rtc_write(RTC_CONFIG_A, RTC_CONFIG_A_REF_CLCK_32KHZ |
+       rtc_write8(RTC_CONFIG_A, RTC_CONFIG_A_REF_CLCK_32KHZ |
                  RTC_CONFIG_A_RATE_1024HZ);
        /* Ensure all reserved bits are 0 in register D */
-       rtc_write(RTC_CONFIG_D, RTC_CONFIG_D_VALID_RAM_AND_TIME);
+       rtc_write8(RTC_CONFIG_D, RTC_CONFIG_D_VALID_RAM_AND_TIME);
 
        /* Clear any pending interrupts */
-       rtc_read(RTC_CONFIG_C);
+       rtc_read8(RTC_CONFIG_C);
 }
 #endif
index d1b5777cecda13be6191404cefe6dcf82a92f564..9131a8f93d9a5adff359d2940ddfd6a6a05c445e 100644 (file)
@@ -297,6 +297,7 @@ static int serial_pre_remove(struct udevice *dev)
 UCLASS_DRIVER(serial) = {
        .id             = UCLASS_SERIAL,
        .name           = "serial",
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
        .post_probe     = serial_post_probe,
        .pre_remove     = serial_pre_remove,
        .per_device_auto_alloc_size = sizeof(struct serial_dev_priv),
index 1ff27d5f4889a5198ac14d761559360236436f87..3e2b8dc183e467c6562d3a868a6a8147bcf48179 100644 (file)
@@ -27,14 +27,14 @@ DECLARE_GLOBAL_DATA_PTR;
 #define ZYNQ_UART_MR_PARITY_NONE       0x00000020  /* No parity mode */
 
 struct uart_zynq {
-       u32 control; /* Control Register [8:0] */
-       u32 mode; /* Mode Register [10:0] */
+       u32 control; /* 0x0 - Control Register [8:0] */
+       u32 mode; /* 0x4 - Mode Register [10:0] */
        u32 reserved1[4];
-       u32 baud_rate_gen; /* Baud Rate Generator [15:0] */
+       u32 baud_rate_gen; /* 0x18 - Baud Rate Generator [15:0] */
        u32 reserved2[4];
-       u32 channel_sts; /* Channel Status [11:0] */
-       u32 tx_rx_fifo; /* FIFO [15:0] or [7:0] */
-       u32 baud_rate_divider; /* Baud Rate Divider [7:0] */
+       u32 channel_sts; /* 0x2c - Channel Status [11:0] */
+       u32 tx_rx_fifo; /* 0x30 - FIFO [15:0] or [7:0] */
+       u32 baud_rate_divider; /* 0x34 - Baud Rate Divider [7:0] */
 };
 
 static struct uart_zynq *uart_zynq_ports[2] = {
@@ -42,29 +42,13 @@ static struct uart_zynq *uart_zynq_ports[2] = {
        [1] = (struct uart_zynq *)ZYNQ_SERIAL_BASEADDR1,
 };
 
-#if !defined(CONFIG_ZYNQ_SERIAL_BAUDRATE0)
-# define CONFIG_ZYNQ_SERIAL_BAUDRATE0  CONFIG_BAUDRATE
-#endif
-#if !defined(CONFIG_ZYNQ_SERIAL_BAUDRATE1)
-# define CONFIG_ZYNQ_SERIAL_BAUDRATE1  CONFIG_BAUDRATE
-#endif
-
-struct uart_zynq_params {
-       u32 baudrate;
-};
-
-static struct uart_zynq_params uart_zynq_ports_param[2] = {
-       [0].baudrate = CONFIG_ZYNQ_SERIAL_BAUDRATE0,
-       [1].baudrate = CONFIG_ZYNQ_SERIAL_BAUDRATE1,
-};
-
 /* Set up the baud rate in gd struct */
 static void uart_zynq_serial_setbrg(const int port)
 {
        /* Calculation results. */
        unsigned int calc_bauderror, bdiv, bgen;
        unsigned long calc_baud = 0;
-       unsigned long baud = uart_zynq_ports_param[port].baudrate;
+       unsigned long baud = gd->baudrate;
        unsigned long clock = get_uart_clk(port);
        struct uart_zynq *regs = uart_zynq_ports[port];
 
index 98ae3b808fb0a970b9e467e94bef0e336458bd19..a75fc46e95dc5f060e0e8a6a3e89ef72e4dfb6ec 100644 (file)
@@ -340,6 +340,5 @@ U_BOOT_DRIVER(cadence_spi) = {
        .ofdata_to_platdata = cadence_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct cadence_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct cadence_spi_priv),
-       .per_child_auto_alloc_size = sizeof(struct spi_slave),
        .probe = cadence_spi_probe,
 };
index 700f616ad7630608dc50136f9abf4c148714a7a3..2624844d528566bb7ed786ae06537b4cbf69b777 100644 (file)
@@ -421,6 +421,5 @@ U_BOOT_DRIVER(dw_spi) = {
        .ofdata_to_platdata = dw_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct dw_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct dw_spi_priv),
-       .per_child_auto_alloc_size = sizeof(struct spi_slave),
        .probe = dw_spi_probe,
 };
index f078973531c1d960e5635a485e50c42170b45d80..a46d8c187668cff8560eea31c7189c7dfa3b4161 100644 (file)
@@ -425,6 +425,5 @@ U_BOOT_DRIVER(exynos_spi) = {
        .ofdata_to_platdata = exynos_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct exynos_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct exynos_spi_priv),
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .probe  = exynos_spi_probe,
 };
index 0379444872e73ed413cc03ff029b08dad30d1f37..fdff158637da063a9be9967c4ae13df5b5018e21 100644 (file)
@@ -153,6 +153,13 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        return &ich->slave;
 }
 
+struct spi_slave *spi_setup_slave_fdt(const void *blob, int slave_node,
+                                     int spi_node)
+{
+       /* We only support a single SPI at present */
+       return spi_setup_slave(0, 0, 20000000, 0);
+}
+
 void spi_free_slave(struct spi_slave *slave)
 {
        struct ich_spi_slave *ich = to_ich_spi(slave);
index e717424db83a9ff7dcc15bc57074c5722b66ff11..bad56603ba6809443ee020a4f3459057f166ebf3 100644 (file)
@@ -160,6 +160,5 @@ U_BOOT_DRIVER(spi_sandbox) = {
        .name   = "spi_sandbox",
        .id     = UCLASS_SPI,
        .of_match = sandbox_spi_ids,
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .ops    = &sandbox_spi_ops,
 };
index 558803618a272cc6e0e8b880ddd89cc8950e6e68..6ae45f5377ab89ba647387029fdfa771dc1ee8ed 100644 (file)
 DECLARE_GLOBAL_DATA_PTR;
 
 struct soft_spi_platdata {
-       struct fdt_gpio_state cs;
-       struct fdt_gpio_state sclk;
-       struct fdt_gpio_state mosi;
-       struct fdt_gpio_state miso;
+       struct gpio_desc cs;
+       struct gpio_desc sclk;
+       struct gpio_desc mosi;
+       struct gpio_desc miso;
        int spi_delay_us;
 };
 
@@ -35,9 +35,8 @@ struct soft_spi_priv {
 static int soft_spi_scl(struct udevice *dev, int bit)
 {
        struct soft_spi_platdata *plat = dev->platdata;
-       struct soft_spi_priv *priv = dev_get_priv(dev);
 
-       gpio_set_value(plat->sclk.gpio, priv->mode & SPI_CPOL ? bit : !bit);
+       dm_gpio_set_value(&plat->sclk, bit);
 
        return 0;
 }
@@ -46,7 +45,7 @@ static int soft_spi_sda(struct udevice *dev, int bit)
 {
        struct soft_spi_platdata *plat = dev->platdata;
 
-       gpio_set_value(plat->mosi.gpio, bit);
+       dm_gpio_set_value(&plat->mosi, bit);
 
        return 0;
 }
@@ -54,11 +53,10 @@ static int soft_spi_sda(struct udevice *dev, int bit)
 static int soft_spi_cs_activate(struct udevice *dev)
 {
        struct soft_spi_platdata *plat = dev->platdata;
-       struct soft_spi_priv *priv = dev_get_priv(dev);
 
-       gpio_set_value(plat->cs.gpio, !(priv->mode & SPI_CS_HIGH));
-       gpio_set_value(plat->sclk.gpio, priv->mode & SPI_CPOL);
-       gpio_set_value(plat->cs.gpio, priv->mode & SPI_CS_HIGH);
+       dm_gpio_set_value(&plat->cs, 0);
+       dm_gpio_set_value(&plat->sclk, 0);
+       dm_gpio_set_value(&plat->cs, 1);
 
        return 0;
 }
@@ -66,9 +64,8 @@ static int soft_spi_cs_activate(struct udevice *dev)
 static int soft_spi_cs_deactivate(struct udevice *dev)
 {
        struct soft_spi_platdata *plat = dev->platdata;
-       struct soft_spi_priv *priv = dev_get_priv(dev);
 
-       gpio_set_value(plat->cs.gpio, !(priv->mode & SPI_CS_HIGH));
+       dm_gpio_set_value(&plat->cs, 0);
 
        return 0;
 }
@@ -109,7 +106,6 @@ static int soft_spi_xfer(struct udevice *dev, unsigned int bitlen,
        uchar           tmpdout = 0;
        const u8        *txd = dout;
        u8              *rxd = din;
-       int             cpol = priv->mode & SPI_CPOL;
        int             cpha = priv->mode & SPI_CPHA;
        unsigned int    j;
 
@@ -137,19 +133,19 @@ static int soft_spi_xfer(struct udevice *dev, unsigned int bitlen,
                }
 
                if (!cpha)
-                       soft_spi_scl(dev, !cpol);
+                       soft_spi_scl(dev, 0);
                soft_spi_sda(dev, tmpdout & 0x80);
                udelay(plat->spi_delay_us);
                if (cpha)
-                       soft_spi_scl(dev, !cpol);
+                       soft_spi_scl(dev, 0);
                else
-                       soft_spi_scl(dev, cpol);
+                       soft_spi_scl(dev, 1);
                tmpdin  <<= 1;
-               tmpdin  |= gpio_get_value(plat->miso.gpio);
+               tmpdin  |= dm_gpio_get_value(&plat->miso);
                tmpdout <<= 1;
                udelay(plat->spi_delay_us);
                if (cpha)
-                       soft_spi_scl(dev, cpol);
+                       soft_spi_scl(dev, 1);
        }
        /*
         * If the number of bits isn't a multiple of 8, shift the last
@@ -183,14 +179,6 @@ static int soft_spi_set_mode(struct udevice *dev, unsigned int mode)
        return 0;
 }
 
-static int soft_spi_child_pre_probe(struct udevice *dev)
-{
-       struct spi_slave *slave = dev_get_parentdata(dev);
-
-       slave->dev = dev;
-       return spi_ofdata_to_platdata(gd->fdt_blob, dev->of_offset, slave);
-}
-
 static const struct dm_spi_ops soft_spi_ops = {
        .claim_bus      = soft_spi_claim_bus,
        .release_bus    = soft_spi_release_bus,
@@ -205,11 +193,6 @@ static int soft_spi_ofdata_to_platdata(struct udevice *dev)
        const void *blob = gd->fdt_blob;
        int node = dev->of_offset;
 
-       if (fdtdec_decode_gpio(blob, node, "cs-gpio", &plat->cs) ||
-           fdtdec_decode_gpio(blob, node, "sclk-gpio", &plat->sclk) ||
-           fdtdec_decode_gpio(blob, node, "mosi-gpio", &plat->mosi) ||
-           fdtdec_decode_gpio(blob, node, "miso-gpio", &plat->miso))
-               return -EINVAL;
        plat->spi_delay_us = fdtdec_get_int(blob, node, "spi-delay-us", 0);
 
        return 0;
@@ -219,16 +202,19 @@ static int soft_spi_probe(struct udevice *dev)
 {
        struct spi_slave *slave = dev_get_parentdata(dev);
        struct soft_spi_platdata *plat = dev->platdata;
-
-       gpio_request(plat->cs.gpio, "soft_spi_cs");
-       gpio_request(plat->sclk.gpio, "soft_spi_sclk");
-       gpio_request(plat->mosi.gpio, "soft_spi_mosi");
-       gpio_request(plat->miso.gpio, "soft_spi_miso");
-
-       gpio_direction_output(plat->sclk.gpio, slave->mode & SPI_CPOL);
-       gpio_direction_output(plat->mosi.gpio, 1);
-       gpio_direction_input(plat->miso.gpio);
-       gpio_direction_output(plat->cs.gpio, !(slave->mode & SPI_CS_HIGH));
+       int cs_flags, clk_flags;
+
+       cs_flags = (slave->mode & SPI_CS_HIGH) ? 0 : GPIOD_ACTIVE_LOW;
+       clk_flags = (slave->mode & SPI_CPOL) ? GPIOD_ACTIVE_LOW : 0;
+       if (gpio_request_by_name(dev, "cs-gpio", 0, &plat->cs,
+                                GPIOD_IS_OUT | cs_flags) ||
+           gpio_request_by_name(dev, "sclk-gpio", 0, &plat->sclk,
+                                GPIOD_IS_OUT | clk_flags) ||
+           gpio_request_by_name(dev, "mosi-gpio", 0, &plat->mosi,
+                                GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE) ||
+           gpio_request_by_name(dev, "miso-gpio", 0, &plat->miso,
+                                GPIOD_IS_IN))
+               return -EINVAL;
 
        return 0;
 }
@@ -246,7 +232,5 @@ U_BOOT_DRIVER(soft_spi) = {
        .ofdata_to_platdata = soft_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct soft_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct soft_spi_priv),
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .probe  = soft_spi_probe,
-       .child_pre_probe        = soft_spi_child_pre_probe,
 };
index 7a57bceb260f1c3e79fc9ed4d735f1b27c45160b..63a6217cc62d0085b6c4ba259415fae514651ba9 100644 (file)
@@ -98,21 +98,51 @@ int spi_post_bind(struct udevice *dev)
        return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
 }
 
-int spi_post_probe(struct udevice *dev)
+int spi_child_post_bind(struct udevice *dev)
 {
-       struct dm_spi_bus *spi = dev->uclass_priv;
+       struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
 
-       spi->max_hz = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+       if (dev->of_offset == -1)
+               return 0;
+
+       return spi_slave_ofdata_to_platdata(gd->fdt_blob, dev->of_offset, plat);
+}
+
+int spi_post_probe(struct udevice *bus)
+{
+       struct dm_spi_bus *spi = bus->uclass_priv;
+
+       spi->max_hz = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
                                     "spi-max-frequency", 0);
 
        return 0;
 }
 
-int spi_chip_select(struct udevice *dev)
+int spi_child_pre_probe(struct udevice *dev)
 {
+       struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
        struct spi_slave *slave = dev_get_parentdata(dev);
 
-       return slave ? slave->cs : -ENOENT;
+       /*
+        * This is needed because we pass struct spi_slave around the place
+        * instead slave->dev (a struct udevice). So we have to have some
+        * way to access the slave udevice given struct spi_slave. Once we
+        * change the SPI API to use udevice instead of spi_slave, we can
+        * drop this.
+        */
+       slave->dev = dev;
+
+       slave->max_hz = plat->max_hz;
+       slave->mode = plat->mode;
+
+       return 0;
+}
+
+int spi_chip_select(struct udevice *dev)
+{
+       struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
+
+       return plat ? plat->cs : -ENOENT;
 }
 
 int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp)
@@ -121,17 +151,11 @@ int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp)
 
        for (device_find_first_child(bus, &dev); dev;
             device_find_next_child(&dev)) {
-               struct spi_slave store;
-               struct spi_slave *slave = dev_get_parentdata(dev);
+               struct dm_spi_slave_platdata *plat;
 
-               if (!slave)  {
-                       slave = &store;
-                       spi_ofdata_to_platdata(gd->fdt_blob, dev->of_offset,
-                                              slave);
-               }
-               debug("%s: slave=%p, cs=%d\n", __func__, slave,
-                     slave ? slave->cs : -1);
-               if (slave && slave->cs == cs) {
+               plat = dev_get_parent_platdata(dev);
+               debug("%s: plat=%p, cs=%d\n", __func__, plat, plat->cs);
+               if (plat->cs == cs) {
                        *devp = dev;
                        return 0;
                }
@@ -215,7 +239,6 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
                       struct udevice **busp, struct spi_slave **devp)
 {
        struct udevice *bus, *dev;
-       struct spi_slave *slave;
        bool created = false;
        int ret;
 
@@ -232,11 +255,17 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
         * SPI flash chip - we will bind to the correct driver.
         */
        if (ret == -ENODEV && drv_name) {
+               struct dm_spi_slave_platdata *plat;
+
                debug("%s: Binding new device '%s', busnum=%d, cs=%d, driver=%s\n",
                      __func__, dev_name, busnum, cs, drv_name);
                ret = device_bind_driver(bus, drv_name, dev_name, &dev);
                if (ret)
                        return ret;
+               plat = dev_get_parent_platdata(dev);
+               plat->cs = cs;
+               plat->max_hz = speed;
+               plat->mode = mode;
                created = true;
        } else if (ret) {
                printf("Invalid chip select %d:%d (err=%d)\n", busnum, cs,
@@ -245,23 +274,13 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
        }
 
        if (!device_active(dev)) {
-               slave = (struct spi_slave *)calloc(1,
-                                                  sizeof(struct spi_slave));
-               if (!slave) {
-                       ret = -ENOMEM;
-                       goto err;
-               }
+               struct spi_slave *slave;
 
-               ret = spi_ofdata_to_platdata(gd->fdt_blob, dev->of_offset,
-                                            slave);
+               ret = device_probe(dev);
                if (ret)
                        goto err;
-               slave->cs = cs;
+               slave = dev_get_parentdata(dev);
                slave->dev = dev;
-               ret = device_probe_child(dev, slave);
-               free(slave);
-               if (ret)
-                       goto err;
        }
 
        ret = spi_set_speed_mode(bus, speed, mode);
@@ -275,6 +294,8 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
        return 0;
 
 err:
+       debug("%s: Error path, credted=%d, device '%s'\n", __func__,
+             created, dev->name);
        if (created) {
                device_remove(dev);
                device_unbind(dev);
@@ -321,13 +342,13 @@ void spi_free_slave(struct spi_slave *slave)
        slave->dev = NULL;
 }
 
-int spi_ofdata_to_platdata(const void *blob, int node,
-                          struct spi_slave *spi)
+int spi_slave_ofdata_to_platdata(const void *blob, int node,
+                                struct dm_spi_slave_platdata *plat)
 {
        int mode = 0;
 
-       spi->cs = fdtdec_get_int(blob, node, "reg", -1);
-       spi->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", 0);
+       plat->cs = fdtdec_get_int(blob, node, "reg", -1);
+       plat->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", 0);
        if (fdtdec_get_bool(blob, node, "spi-cpol"))
                mode |= SPI_CPOL;
        if (fdtdec_get_bool(blob, node, "spi-cpha"))
@@ -336,7 +357,7 @@ int spi_ofdata_to_platdata(const void *blob, int node,
                mode |= SPI_CS_HIGH;
        if (fdtdec_get_bool(blob, node, "spi-half-duplex"))
                mode |= SPI_PREAMBLE;
-       spi->mode = mode;
+       plat->mode = mode;
 
        return 0;
 }
@@ -344,9 +365,15 @@ int spi_ofdata_to_platdata(const void *blob, int node,
 UCLASS_DRIVER(spi) = {
        .id             = UCLASS_SPI,
        .name           = "spi",
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
        .post_bind      = spi_post_bind,
        .post_probe     = spi_post_probe,
+       .child_pre_probe = spi_child_pre_probe,
        .per_device_auto_alloc_size = sizeof(struct dm_spi_bus),
+       .per_child_auto_alloc_size = sizeof(struct spi_slave),
+       .per_child_platdata_auto_alloc_size =
+                       sizeof(struct dm_spi_slave_platdata),
+       .child_post_bind = spi_child_post_bind,
 };
 
 UCLASS_DRIVER(spi_generic) = {
index 2d97625fba73b81dcb8a2ba2d55d5e1d5eef0bcb..53ff9ea22105353180159203def640905b5fecf8 100644 (file)
@@ -407,6 +407,5 @@ U_BOOT_DRIVER(tegra114_spi) = {
        .ofdata_to_platdata = tegra114_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct tegra_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct tegra114_spi_priv),
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .probe  = tegra114_spi_probe,
 };
index 7d0d0f37fc70a7f5f5da821b2af8589bf59ac7a1..78c74cdf37fe095d8efa34c26ab5df0093e305bd 100644 (file)
@@ -348,6 +348,5 @@ U_BOOT_DRIVER(tegra20_sflash) = {
        .ofdata_to_platdata = tegra20_sflash_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct tegra_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct tegra20_sflash_priv),
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .probe  = tegra20_sflash_probe,
 };
index 213fa5f7939a848889e0168d1991040dd9830a61..597d6ad5ccecb8e36818bb6d2d555c2f3b14294f 100644 (file)
@@ -361,6 +361,5 @@ U_BOOT_DRIVER(tegra30_spi) = {
        .ofdata_to_platdata = tegra30_spi_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct tegra_spi_platdata),
        .priv_auto_alloc_size = sizeof(struct tegra30_spi_priv),
-       .per_child_auto_alloc_size      = sizeof(struct spi_slave),
        .probe  = tegra30_spi_probe,
 };
index b8ca720e25bf7ae342814b6015ba41ba789c0d22..0ef85db7b51d51e3db2ce300a158699b87e30744 100644 (file)
@@ -271,6 +271,19 @@ static int asix_read_mac(struct eth_device *eth)
        return 0;
 }
 
+static int asix_write_mac(struct eth_device *eth)
+{
+       struct ueth_data *dev = (struct ueth_data *)eth->priv;
+       int ret;
+
+       ret = asix_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
+                                ETH_ALEN, eth->enetaddr);
+       if (ret < 0)
+               debug("Failed to set MAC address: %02x\n", ret);
+
+       return ret;
+}
+
 static int asix_basic_reset(struct ueth_data *dev)
 {
        struct asix_private *dev_priv = (struct asix_private *)dev->dev_priv;
@@ -686,6 +699,7 @@ int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
        eth->send = asix_send;
        eth->recv = asix_recv;
        eth->halt = asix_halt;
+       eth->write_hwaddr = asix_write_mac;
        eth->priv = ss;
 
        if (asix_basic_reset(ss))
index a4c5606527a824bca5f53a5c7514d38e2d530f8b..98c2da6f14bbf3522125221cde25e8946ad18281 100644 (file)
@@ -761,6 +761,14 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                        if (value >= 0)
                                value = min(w_length, (u16) value);
                        break;
+               case USB_DT_BOS:
+                       /*
+                        * The USB compliance test (USB 2.0 Command Verifier)
+                        * issues this request. We should not run into the
+                        * default path here. But return for now until
+                        * the superspeed support is added.
+                        */
+                       break;
                default:
                        goto unknown;
                }
index ead71eba6b136db95c9cd4b017ef2da6827872a4..77a1567a944c71b95fc5c11d077138e7cc6df563 100644 (file)
@@ -780,6 +780,13 @@ static int dfu_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
        return 0;
 }
 
+static int __dfu_get_alt(struct usb_function *f, unsigned intf)
+{
+       struct f_dfu *f_dfu = func_to_dfu(f);
+
+       return f_dfu->altsetting;
+}
+
 /* TODO: is this really what we need here? */
 static void dfu_disable(struct usb_function *f)
 {
@@ -806,6 +813,7 @@ static int dfu_bind_config(struct usb_configuration *c)
        f_dfu->usb_function.bind = dfu_bind;
        f_dfu->usb_function.unbind = dfu_unbind;
        f_dfu->usb_function.set_alt = dfu_set_alt;
+       f_dfu->usb_function.get_alt = __dfu_get_alt;
        f_dfu->usb_function.disable = dfu_disable;
        f_dfu->usb_function.strings = dfu_generic_strings;
        f_dfu->usb_function.setup = dfu_handle;
index 8945c5b665511b16dc44dd04c240dcbedc0af3b1..d4460b2dc715fe2ca197533aed285ee63fe35f0f 100644 (file)
@@ -1950,11 +1950,11 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
        dev->watchdog.period = 5000 * CONFIG_SYS_HZ / 1000000; /* 5 ms */
        dev->watchdog.function = udc_watchdog;
 
+       dev->mach = &mach_info;
+
        udc_disable(dev);
        udc_reinit(dev);
 
-       dev->mach = &mach_info;
-
        dev->gadget.name = "pxa2xx_udc";
        retval = driver->bind(&dev->gadget);
        if (retval) {
index 6fdbf5724f4a6527757d8cec692c9a59c7529b6a..f3c077d82e4d4c726ef99c32189f759571feb46e 100644 (file)
@@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 struct exynos_ehci {
        struct exynos_usb_phy *usb;
        struct ehci_hccr *hcd;
-       struct fdt_gpio_state vbus_gpio;
+       struct gpio_desc vbus_gpio;
 };
 
 static struct exynos_ehci exynos;
@@ -61,7 +61,8 @@ static int exynos_usb_parse_dt(const void *blob, struct exynos_ehci *exynos)
        exynos->hcd = (struct ehci_hccr *)addr;
 
        /* Vbus gpio */
-       fdtdec_decode_gpio(blob, node, "samsung,vbus-gpio", &exynos->vbus_gpio);
+       gpio_request_by_name_nodev(blob, node, "samsung,vbus-gpio", 0,
+                                  &exynos->vbus_gpio, GPIOD_IS_OUT);
 
        depth = 0;
        node = fdtdec_next_compatible_subnode(blob, node,
@@ -236,9 +237,8 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 #ifdef CONFIG_OF_CONTROL
        /* setup the Vbus gpio here */
-       if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
-           !fdtdec_setup_gpio(&ctx->vbus_gpio))
-               gpio_direction_output(ctx->vbus_gpio.gpio, 1);
+       if (dm_gpio_is_valid(&ctx->vbus_gpio))
+               dm_gpio_set_value(&ctx->vbus_gpio, 1);
 #endif
 
        setup_usb_phy(ctx->usb);
index bc7606646bbcf9ac76ab679a8f85405ceaa6d45a..f1fb19013281c6483c052ce77b64689faf09fe93 100644 (file)
@@ -1148,7 +1148,7 @@ disable_periodic(struct ehci_ctrl *ctrl)
 
 struct int_queue *
 create_int_queue(struct usb_device *dev, unsigned long pipe, int queuesize,
-                int elementsize, void *buffer)
+                int elementsize, void *buffer, int interval)
 {
        struct ehci_ctrl *ctrl = dev->controller;
        struct int_queue *result = NULL;
@@ -1398,7 +1398,7 @@ submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
              dev, pipe, buffer, length, interval);
 
-       queue = create_int_queue(dev, pipe, 1, length, buffer);
+       queue = create_int_queue(dev, pipe, 1, length, buffer, interval);
        if (!queue)
                return -1;
 
index 5f0a98e8b80b59f79372e2185e31e16585c6dd7f..b5ad1e35e54c668fa0e5d3c9207d74d39904527a 100644 (file)
@@ -72,8 +72,8 @@ struct fdt_usb {
        enum usb_init_type init_type;
        enum dr_mode dr_mode;   /* dual role mode */
        enum periph_id periph_id;/* peripheral id */
-       struct fdt_gpio_state vbus_gpio;        /* GPIO for vbus enable */
-       struct fdt_gpio_state phy_reset_gpio; /* GPIO to reset ULPI phy */
+       struct gpio_desc vbus_gpio;     /* GPIO for vbus enable */
+       struct gpio_desc phy_reset_gpio; /* GPIO to reset ULPI phy */
 };
 
 static struct fdt_usb port[USB_PORTS_MAX];     /* List of valid USB ports */
@@ -252,17 +252,14 @@ static void set_up_vbus(struct fdt_usb *config, enum usb_init_type init)
                return;
        }
 
-       if (fdt_gpio_isvalid(&config->vbus_gpio)) {
+       if (dm_gpio_is_valid(&config->vbus_gpio)) {
                int vbus_value;
 
-               fdtdec_setup_gpio(&config->vbus_gpio);
+               vbus_value = (init == USB_INIT_HOST);
+               dm_gpio_set_value(&config->vbus_gpio, vbus_value);
 
-               vbus_value = (init == USB_INIT_HOST) ^
-                            !!(config->vbus_gpio.flags & FDT_GPIO_ACTIVE_LOW);
-               gpio_direction_output(config->vbus_gpio.gpio, vbus_value);
-
-               debug("set_up_vbus: GPIO %d %d\n", config->vbus_gpio.gpio,
-                     vbus_value);
+               debug("set_up_vbus: GPIO %d %d\n",
+                     gpio_get_number(&config->vbus_gpio), vbus_value);
        }
 }
 
@@ -360,7 +357,7 @@ static int init_utmi_usb_controller(struct fdt_usb *config,
         * mux must be switched to actually use a_sess_vld threshold.
         */
        if (config->dr_mode == DR_MODE_OTG &&
-           fdt_gpio_isvalid(&config->vbus_gpio))
+           dm_gpio_is_valid(&config->vbus_gpio))
                clrsetbits_le32(&usbctlr->usb1_legacy_ctrl,
                        VBUS_SENSE_CTL_MASK,
                        VBUS_SENSE_CTL_A_SESS_VLD << VBUS_SENSE_CTL_SHIFT);
@@ -569,11 +566,10 @@ static int init_ulpi_usb_controller(struct fdt_usb *config,
        clock_set_pllout(CLOCK_ID_PERIPH, PLL_OUT4, CONFIG_ULPI_REF_CLK);
 
        /* reset ULPI phy */
-       if (fdt_gpio_isvalid(&config->phy_reset_gpio)) {
-               fdtdec_setup_gpio(&config->phy_reset_gpio);
-               gpio_direction_output(config->phy_reset_gpio.gpio, 0);
+       if (dm_gpio_is_valid(&config->phy_reset_gpio)) {
+               dm_gpio_set_value(&config->phy_reset_gpio, 0);
                mdelay(5);
-               gpio_set_value(config->phy_reset_gpio.gpio, 1);
+               dm_gpio_set_value(&config->phy_reset_gpio, 1);
        }
 
        /* Reset the usb controller */
@@ -685,14 +681,16 @@ static int fdt_decode_usb(const void *blob, int node, struct fdt_usb *config)
                debug("%s: Missing/invalid peripheral ID\n", __func__);
                return -FDT_ERR_NOTFOUND;
        }
-       fdtdec_decode_gpio(blob, node, "nvidia,vbus-gpio", &config->vbus_gpio);
-       fdtdec_decode_gpio(blob, node, "nvidia,phy-reset-gpio",
-                       &config->phy_reset_gpio);
+       gpio_request_by_name_nodev(blob, node, "nvidia,vbus-gpio", 0,
+                                  &config->vbus_gpio, GPIOD_IS_OUT);
+       gpio_request_by_name_nodev(blob, node, "nvidia,phy-reset-gpio", 0,
+                                  &config->phy_reset_gpio, GPIOD_IS_OUT);
        debug("enabled=%d, legacy_mode=%d, utmi=%d, ulpi=%d, periph_id=%d, "
                "vbus=%d, phy_reset=%d, dr_mode=%d\n",
                config->enabled, config->has_legacy_mode, config->utmi,
-               config->ulpi, config->periph_id, config->vbus_gpio.gpio,
-               config->phy_reset_gpio.gpio, config->dr_mode);
+               config->ulpi, config->periph_id,
+               gpio_get_number(&config->vbus_gpio),
+               gpio_get_number(&config->phy_reset_gpio), config->dr_mode);
 
        return 0;
 }
index b4946a3f1cf5900614e7238f8033979876eac942..a77c8bc91930524e75de4749accb927ab9d2d586 100644 (file)
@@ -40,7 +40,7 @@ struct exynos_xhci {
        struct exynos_usb3_phy *usb3_phy;
        struct xhci_hccr *hcd;
        struct dwc3 *dwc3_reg;
-       struct fdt_gpio_state vbus_gpio;
+       struct gpio_desc vbus_gpio;
 };
 
 static struct exynos_xhci exynos;
@@ -69,7 +69,8 @@ static int exynos_usb3_parse_dt(const void *blob, struct exynos_xhci *exynos)
        exynos->hcd = (struct xhci_hccr *)addr;
 
        /* Vbus gpio */
-       fdtdec_decode_gpio(blob, node, "samsung,vbus-gpio", &exynos->vbus_gpio);
+       gpio_request_by_name_nodev(blob, node, "samsung,vbus-gpio", 0,
+                                  &exynos->vbus_gpio, GPIOD_IS_OUT);
 
        depth = 0;
        node = fdtdec_next_compatible_subnode(blob, node,
@@ -298,9 +299,8 @@ int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor)
 
 #ifdef CONFIG_OF_CONTROL
        /* setup the Vbus gpio here */
-       if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
-           !fdtdec_setup_gpio(&ctx->vbus_gpio))
-               gpio_direction_output(ctx->vbus_gpio.gpio, 1);
+       if (dm_gpio_is_valid(&ctx->vbus_gpio))
+               dm_gpio_set_value(&ctx->vbus_gpio, 1);
 #endif
 
        ret = exynos_xhci_core_init(ctx);
index 3facf0fc105dbf430d0eeb6b884fcb7e0ee9081e..9edeece381de106b1ae613085fbded6240bda0c5 100644 (file)
@@ -8,6 +8,7 @@ obj-$(CONFIG_MUSB_HOST) += musb_host.o musb_core.o musb_uboot.o
 obj-$(CONFIG_USB_MUSB_DSPS) += musb_dsps.o
 obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
 obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
+obj-$(CONFIG_USB_MUSB_SUNXI) += sunxi.o
 
 ccflags-y := $(call cc-option,-Wno-unused-variable) \
                $(call cc-option,-Wno-unused-but-set-variable) \
index bbcee88241ba33f05cafad51d3162bc63bc12021..437309ceb44a380bfed9b05d73d6f9828db08210 100644 (file)
@@ -2130,8 +2130,6 @@ done:
        return ret;
 }
 
-
-#ifndef __UBOOT__
 /*
  * abort a transfer that's at the head of a hardware queue.
  * called with controller locked, irqs blocked
@@ -2195,7 +2193,14 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh)
        return status;
 }
 
-static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+#ifndef __UBOOT__
+static int musb_urb_dequeue(
+#else
+int musb_urb_dequeue(
+#endif
+       struct usb_hcd *hcd,
+       struct urb *urb,
+       int status)
 {
        struct musb             *musb = hcd_to_musb(hcd);
        struct musb_qh          *qh;
@@ -2253,6 +2258,7 @@ done:
        return ret;
 }
 
+#ifndef __UBOOT__
 /* disable an endpoint */
 static void
 musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
index ebebe0c02a57c61b6cd9cb881990714feb0d5c6b..546b4a2715f4549c96e0b426f2dad78e86a1772f 100644 (file)
@@ -110,5 +110,6 @@ static inline struct urb *next_urb(struct musb_qh *qh)
 
 #ifdef __UBOOT__
 int musb_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
+int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
 #endif
 #endif                         /* _MUSB_HOST_H */
index 03f2655af290758cb708a67f832abd6257df2894..27e4ed4ec6a3257b9e49f8b416fa90c758e32d74 100644 (file)
 
 #ifndef CONFIG_BLACKFIN
 
+/* SUNXI has different reg addresses, but identical r/w functions */
+#ifndef CONFIG_ARCH_SUNXI 
+
 /*
  * Common USB registers
  */
 #define MUSB_BUSCTL_OFFSET(_epnum, _offset) \
        (0x80 + (8*(_epnum)) + (_offset))
 
+#else /* CONFIG_ARCH_SUNXI */
+
+/*
+ * Common USB registers
+ */
+
+#define MUSB_FADDR             0x0098
+#define MUSB_POWER             0x0040
+
+#define MUSB_INTRTX            0x0044
+#define MUSB_INTRRX            0x0046
+#define MUSB_INTRTXE           0x0048
+#define MUSB_INTRRXE           0x004A
+#define MUSB_INTRUSB           0x004C
+#define MUSB_INTRUSBE          0x0050
+#define MUSB_FRAME             0x0054
+#define MUSB_INDEX             0x0042
+#define MUSB_TESTMODE          0x007C
+
+/* Get offset for a given FIFO from musb->mregs */
+#define MUSB_FIFO_OFFSET(epnum)        (0x00 + ((epnum) * 4))
+
+/*
+ * Additional Control Registers
+ */
+
+#define MUSB_DEVCTL            0x0041
+
+/* These are always controlled through the INDEX register */
+#define MUSB_TXFIFOSZ          0x0090
+#define MUSB_RXFIFOSZ          0x0094
+#define MUSB_TXFIFOADD         0x0092
+#define MUSB_RXFIFOADD         0x0096
+
+#define MUSB_EPINFO            0x0078
+#define MUSB_RAMINFO           0x0079
+#define MUSB_LINKINFO          0x007A
+#define MUSB_VPLEN             0x007B
+#define MUSB_HS_EOF1           0x007C
+#define MUSB_FS_EOF1           0x007D
+#define MUSB_LS_EOF1           0x007E
+
+/* Offsets to endpoint registers */
+#define MUSB_TXMAXP            0x0080
+#define MUSB_TXCSR             0x0082
+#define MUSB_CSR0              0x0082
+#define MUSB_RXMAXP            0x0084
+#define MUSB_RXCSR             0x0086
+#define MUSB_RXCOUNT           0x0088
+#define MUSB_COUNT0            0x0088
+#define MUSB_TXTYPE            0x008C
+#define MUSB_TYPE0             0x008C
+#define MUSB_TXINTERVAL                0x008D
+#define MUSB_NAKLIMIT0         0x008D
+#define MUSB_RXTYPE            0x008E
+#define MUSB_RXINTERVAL                0x008F
+
+#define MUSB_CONFIGDATA                0x00b0 /* musb_read_configdata adds 0x10 ! */
+#define MUSB_FIFOSIZE          0x0090
+
+/* Offsets to endpoint registers in indexed model (using INDEX register) */
+#define MUSB_INDEXED_OFFSET(_epnum, _offset) (_offset)
+
+#define MUSB_TXCSR_MODE                0x2000
+
+/* "bus control"/target registers, for host side multipoint (external hubs) */
+#define MUSB_TXFUNCADDR                0x0098
+#define MUSB_TXHUBADDR         0x009A
+#define MUSB_TXHUBPORT         0x009B
+
+#define MUSB_RXFUNCADDR                0x009C
+#define MUSB_RXHUBADDR         0x009E
+#define MUSB_RXHUBPORT         0x009F
+
+/* Endpoint is selected with MUSB_INDEX. */
+#define MUSB_BUSCTL_OFFSET(_epnum, _offset) (_offset)
+
+#endif /* CONFIG_ARCH_SUNXI */
+
 static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size)
 {
        musb_writeb(mbase, MUSB_TXFIFOSZ, c_size);
@@ -340,7 +422,9 @@ static inline void  musb_write_rxfifoadd(void __iomem *mbase, u16 c_off)
 
 static inline void musb_write_ulpi_buscontrol(void __iomem *mbase, u8 val)
 {
+#ifndef CONFIG_ARCH_SUNXI /* No ulpi on sunxi */
        musb_writeb(mbase, MUSB_ULPI_BUSCONTROL, val);
+#endif
 }
 
 static inline u8 musb_read_txfifosz(void __iomem *mbase)
@@ -365,7 +449,11 @@ static inline u16  musb_read_rxfifoadd(void __iomem *mbase)
 
 static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase)
 {
+#ifdef CONFIG_ARCH_SUNXI /* No ulpi on sunxi */
+       return 0;
+#else
        return musb_readb(mbase, MUSB_ULPI_BUSCONTROL);
+#endif
 }
 
 static inline u8 musb_read_configdata(void __iomem *mbase)
@@ -376,7 +464,11 @@ static inline u8 musb_read_configdata(void __iomem *mbase)
 
 static inline u16 musb_read_hwvers(void __iomem *mbase)
 {
+#ifdef CONFIG_ARCH_SUNXI
+       return 0; /* Unknown version */
+#else
        return musb_readw(mbase, MUSB_HWVERS);
+#endif
 }
 
 static inline void __iomem *musb_read_target_reg_base(u8 i, void __iomem *mbase)
index 2676f09c3844d159c5f15130ccdff6c287339aed..6e58ddf02cc34b67b4550b9f752d5a00c2d0615c 100644 (file)
 #include "musb_gadget.h"
 
 #ifdef CONFIG_MUSB_HOST
+struct int_queue {
+       struct usb_host_endpoint hep;
+       struct urb urb;
+};
+
 static struct musb *host;
 static struct usb_hcd hcd;
 static enum usb_device_speed host_speed;
@@ -25,45 +30,42 @@ static void musb_host_complete_urb(struct urb *urb)
 static struct usb_host_endpoint hep;
 static struct urb urb;
 
-static struct urb *construct_urb(struct usb_device *dev, int endpoint_type,
-                               unsigned long pipe, void *buffer, int len,
-                               struct devrequest *setup, int interval)
+static void construct_urb(struct urb *urb, struct usb_host_endpoint *hep,
+                         struct usb_device *dev, int endpoint_type,
+                         unsigned long pipe, void *buffer, int len,
+                         struct devrequest *setup, int interval)
 {
        int epnum = usb_pipeendpoint(pipe);
        int is_in = usb_pipein(pipe);
 
-       memset(&urb, 0, sizeof(struct urb));
-       memset(&hep, 0, sizeof(struct usb_host_endpoint));
-       INIT_LIST_HEAD(&hep.urb_list);
-       INIT_LIST_HEAD(&urb.urb_list);
-       urb.ep = &hep;
-       urb.complete = musb_host_complete_urb;
-       urb.status = -EINPROGRESS;
-       urb.dev = dev;
-       urb.pipe = pipe;
-       urb.transfer_buffer = buffer;
-       urb.transfer_dma = (unsigned long)buffer;
-       urb.transfer_buffer_length = len;
-       urb.setup_packet = (unsigned char *)setup;
-
-       urb.ep->desc.wMaxPacketSize =
+       memset(urb, 0, sizeof(struct urb));
+       memset(hep, 0, sizeof(struct usb_host_endpoint));
+       INIT_LIST_HEAD(&hep->urb_list);
+       INIT_LIST_HEAD(&urb->urb_list);
+       urb->ep = hep;
+       urb->complete = musb_host_complete_urb;
+       urb->status = -EINPROGRESS;
+       urb->dev = dev;
+       urb->pipe = pipe;
+       urb->transfer_buffer = buffer;
+       urb->transfer_dma = (unsigned long)buffer;
+       urb->transfer_buffer_length = len;
+       urb->setup_packet = (unsigned char *)setup;
+
+       urb->ep->desc.wMaxPacketSize =
                __cpu_to_le16(is_in ? dev->epmaxpacketin[epnum] :
                                dev->epmaxpacketout[epnum]);
-       urb.ep->desc.bmAttributes = endpoint_type;
-       urb.ep->desc.bEndpointAddress =
+       urb->ep->desc.bmAttributes = endpoint_type;
+       urb->ep->desc.bEndpointAddress =
                (is_in ? USB_DIR_IN : USB_DIR_OUT) | epnum;
-       urb.ep->desc.bInterval = interval;
-
-       return &urb;
+       urb->ep->desc.bInterval = interval;
 }
 
-#define MUSB_HOST_TIMEOUT      0x3ffffff
-
 static int submit_urb(struct usb_hcd *hcd, struct urb *urb)
 {
        struct musb *host = hcd->hcd_priv;
        int ret;
-       int timeout;
+       unsigned long timeout;
 
        ret = musb_urb_enqueue(hcd, urb, 0);
        if (ret < 0) {
@@ -71,12 +73,16 @@ static int submit_urb(struct usb_hcd *hcd, struct urb *urb)
                return ret;
        }
 
-       timeout = MUSB_HOST_TIMEOUT;
+       timeout = get_timer(0) + USB_TIMEOUT_MS(urb->pipe);
        do {
                if (ctrlc())
                        return -EIO;
                host->isr(0, host);
-       } while ((urb->dev->status & USB_ST_NOT_PROC) && --timeout);
+       } while (urb->status == -EINPROGRESS &&
+                get_timer(0) < timeout);
+
+       if (urb->status == -EINPROGRESS)
+               musb_urb_dequeue(hcd, urb, -ETIME);
 
        return urb->status;
 }
@@ -84,38 +90,117 @@ static int submit_urb(struct usb_hcd *hcd, struct urb *urb)
 int submit_control_msg(struct usb_device *dev, unsigned long pipe,
                        void *buffer, int len, struct devrequest *setup)
 {
-       struct urb *urb = construct_urb(dev, USB_ENDPOINT_XFER_CONTROL, pipe,
-                                       buffer, len, setup, 0);
+       construct_urb(&urb, &hep, dev, USB_ENDPOINT_XFER_CONTROL, pipe,
+                     buffer, len, setup, 0);
 
        /* Fix speed for non hub-attached devices */
        if (!dev->parent)
                dev->speed = host_speed;
 
-       return submit_urb(&hcd, urb);
+       return submit_urb(&hcd, &urb);
 }
 
 
 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
                                        void *buffer, int len)
 {
-       struct urb *urb = construct_urb(dev, USB_ENDPOINT_XFER_BULK, pipe,
-                                       buffer, len, NULL, 0);
-       return submit_urb(&hcd, urb);
+       construct_urb(&urb, &hep, dev, USB_ENDPOINT_XFER_BULK, pipe,
+                     buffer, len, NULL, 0);
+       return submit_urb(&hcd, &urb);
 }
 
 int submit_int_msg(struct usb_device *dev, unsigned long pipe,
                                void *buffer, int len, int interval)
 {
-       struct urb *urb = construct_urb(dev, USB_ENDPOINT_XFER_INT, pipe,
-                                       buffer, len, NULL, interval);
-       return submit_urb(&hcd, urb);
+       construct_urb(&urb, &hep, dev, USB_ENDPOINT_XFER_INT, pipe,
+                     buffer, len, NULL, interval);
+       return submit_urb(&hcd, &urb);
 }
 
-int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
+struct int_queue *create_int_queue(struct usb_device *dev, unsigned long pipe,
+       int queuesize, int elementsize, void *buffer, int interval)
+{
+       struct int_queue *queue;
+       int ret, index = usb_pipein(pipe) * 16 + usb_pipeendpoint(pipe);
+
+       if (queuesize != 1) {
+               printf("ERROR musb int-queues only support queuesize 1\n");
+               return NULL;
+       }
+
+       if (dev->int_pending & (1 << index)) {
+               printf("ERROR int-urb is already pending on pipe %lx\n", pipe);
+               return NULL;
+       }
+
+       queue = malloc(sizeof(*queue));
+       if (!queue)
+               return NULL;
+
+       construct_urb(&queue->urb, &queue->hep, dev, USB_ENDPOINT_XFER_INT,
+                     pipe, buffer, elementsize, NULL, interval);
+
+       ret = musb_urb_enqueue(&hcd, &queue->urb, 0);
+       if (ret < 0) {
+               printf("Failed to enqueue URB to controller\n");
+               free(queue);
+               return NULL;
+       }
+
+       dev->int_pending |= 1 << index;
+       return queue;
+}
+
+int destroy_int_queue(struct usb_device *dev, struct int_queue *queue)
+{
+       int index = usb_pipein(queue->urb.pipe) * 16 + 
+                   usb_pipeendpoint(queue->urb.pipe);
+
+       if (queue->urb.status == -EINPROGRESS)
+               musb_urb_dequeue(&hcd, &queue->urb, -ETIME);
+
+       dev->int_pending &= ~(1 << index);
+       free(queue);
+       return 0;
+}
+
+void *poll_int_queue(struct usb_device *dev, struct int_queue *queue)
 {
+       if (queue->urb.status != -EINPROGRESS)
+               return NULL; /* URB has already completed in a prev. poll */
+
+       host->isr(0, host);
+
+       if (queue->urb.status != -EINPROGRESS)
+               return queue->urb.transfer_buffer; /* Done */
+
+       return NULL; /* URB still pending */
+}
+
+void usb_reset_root_port(void)
+{
+       void *mbase = host->mregs;
        u8 power;
+
+       power = musb_readb(mbase, MUSB_POWER);
+       power &= 0xf0;
+       musb_writeb(mbase, MUSB_POWER, MUSB_POWER_RESET | power);
+       mdelay(50);
+       power = musb_readb(mbase, MUSB_POWER);
+       musb_writeb(mbase, MUSB_POWER, ~MUSB_POWER_RESET & power);
+       host->isr(0, host);
+       host_speed = (musb_readb(mbase, MUSB_POWER) & MUSB_POWER_HSMODE) ?
+                       USB_SPEED_HIGH :
+                       (musb_readb(mbase, MUSB_DEVCTL) & MUSB_DEVCTL_FSDEV) ?
+                       USB_SPEED_FULL : USB_SPEED_LOW;
+       mdelay((host_speed == USB_SPEED_LOW) ? 200 : 50);
+}
+
+int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
+{
        void *mbase;
-       int timeout = MUSB_HOST_TIMEOUT;
+       /* USB spec says it may take up to 1 second for a device to connect */
+       unsigned long timeout = get_timer(0) + 1000;
 
        if (!host) {
                printf("MUSB host is not registered\n");
@@ -127,20 +212,11 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
        do {
                if (musb_readb(mbase, MUSB_DEVCTL) & MUSB_DEVCTL_HM)
                        break;
-       } while (--timeout);
-       if (!timeout)
+       } while (get_timer(0) < timeout);
+       if (get_timer(0) >= timeout)
                return -ENODEV;
 
-       power = musb_readb(mbase, MUSB_POWER);
-       musb_writeb(mbase, MUSB_POWER, MUSB_POWER_RESET | power);
-       udelay(30000);
-       power = musb_readb(mbase, MUSB_POWER);
-       musb_writeb(mbase, MUSB_POWER, ~MUSB_POWER_RESET & power);
-       host->isr(0, host);
-       host_speed = (musb_readb(mbase, MUSB_POWER) & MUSB_POWER_HSMODE) ?
-                       USB_SPEED_HIGH :
-                       (musb_readb(mbase, MUSB_DEVCTL) & MUSB_DEVCTL_FSDEV) ?
-                       USB_SPEED_FULL : USB_SPEED_LOW;
+       usb_reset_root_port();
        host->is_active = 1;
        hcd.hcd_priv = host;
 
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
new file mode 100644 (file)
index 0000000..778916d
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * Allwinner SUNXI "glue layer"
+ *
+ * Copyright Â© 2015 Hans de Goede <hdegoede@redhat.com>
+ * Copyright Â© 2013 Jussi Kivilinna <jussi.kivilinna@iki.fi>
+ *
+ * Based on the sw_usb "Allwinner OTG Dual Role Controller" code.
+ *  Copyright 2007-2012 (C) Allwinner Technology Co., Ltd.
+ *  javen <javen@allwinnertech.com>
+ *
+ * Based on the DA8xx "glue layer" code.
+ *  Copyright (c) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
+ *  Copyright (C) 2005-2006 by Texas Instruments
+ *
+ * This file is part of the Inventra Controller Driver for Linux.
+ *
+ * The Inventra Controller Driver for Linux is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU
+ * General Public License version 2 as published by the Free Software
+ * Foundation.
+ *
+ */
+#include <common.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/usbc.h>
+#include "linux-compat.h"
+#include "musb_core.h"
+
+/******************************************************************************
+ ******************************************************************************
+ * From the Allwinner driver
+ ******************************************************************************
+ ******************************************************************************/
+
+/******************************************************************************
+ * From include/sunxi_usb_bsp.h
+ ******************************************************************************/
+
+/* reg offsets */
+#define  USBC_REG_o_ISCR       0x0400
+#define  USBC_REG_o_PHYCTL     0x0404
+#define  USBC_REG_o_PHYBIST    0x0408
+#define  USBC_REG_o_PHYTUNE    0x040c
+
+#define  USBC_REG_o_VEND0      0x0043
+
+/* Interface Status and Control */
+#define  USBC_BP_ISCR_VBUS_VALID_FROM_DATA     30
+#define  USBC_BP_ISCR_VBUS_VALID_FROM_VBUS     29
+#define  USBC_BP_ISCR_EXT_ID_STATUS            28
+#define  USBC_BP_ISCR_EXT_DM_STATUS            27
+#define  USBC_BP_ISCR_EXT_DP_STATUS            26
+#define  USBC_BP_ISCR_MERGED_VBUS_STATUS       25
+#define  USBC_BP_ISCR_MERGED_ID_STATUS         24
+
+#define  USBC_BP_ISCR_ID_PULLUP_EN             17
+#define  USBC_BP_ISCR_DPDM_PULLUP_EN           16
+#define  USBC_BP_ISCR_FORCE_ID                 14
+#define  USBC_BP_ISCR_FORCE_VBUS_VALID         12
+#define  USBC_BP_ISCR_VBUS_VALID_SRC           10
+
+#define  USBC_BP_ISCR_HOSC_EN                  7
+#define  USBC_BP_ISCR_VBUS_CHANGE_DETECT       6
+#define  USBC_BP_ISCR_ID_CHANGE_DETECT         5
+#define  USBC_BP_ISCR_DPDM_CHANGE_DETECT       4
+#define  USBC_BP_ISCR_IRQ_ENABLE               3
+#define  USBC_BP_ISCR_VBUS_CHANGE_DETECT_EN    2
+#define  USBC_BP_ISCR_ID_CHANGE_DETECT_EN      1
+#define  USBC_BP_ISCR_DPDM_CHANGE_DETECT_EN    0
+
+/******************************************************************************
+ * From usbc/usbc.c
+ ******************************************************************************/
+
+static u32 USBC_WakeUp_ClearChangeDetect(u32 reg_val)
+{
+       u32 temp = reg_val;
+
+       temp &= ~(1 << USBC_BP_ISCR_VBUS_CHANGE_DETECT);
+       temp &= ~(1 << USBC_BP_ISCR_ID_CHANGE_DETECT);
+       temp &= ~(1 << USBC_BP_ISCR_DPDM_CHANGE_DETECT);
+
+       return temp;
+}
+
+static void USBC_EnableIdPullUp(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val |= (1 << USBC_BP_ISCR_ID_PULLUP_EN);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_DisableIdPullUp(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(1 << USBC_BP_ISCR_ID_PULLUP_EN);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_EnableDpDmPullUp(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val |= (1 << USBC_BP_ISCR_DPDM_PULLUP_EN);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_DisableDpDmPullUp(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(1 << USBC_BP_ISCR_DPDM_PULLUP_EN);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_ForceIdToLow(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(0x03 << USBC_BP_ISCR_FORCE_ID);
+       reg_val |= (0x02 << USBC_BP_ISCR_FORCE_ID);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_ForceIdToHigh(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(0x03 << USBC_BP_ISCR_FORCE_ID);
+       reg_val |= (0x03 << USBC_BP_ISCR_FORCE_ID);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_ForceVbusValidDisable(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(0x03 << USBC_BP_ISCR_FORCE_VBUS_VALID);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_ForceVbusValidToHigh(__iomem void *base)
+{
+       u32 reg_val;
+
+       reg_val = musb_readl(base, USBC_REG_o_ISCR);
+       reg_val &= ~(0x03 << USBC_BP_ISCR_FORCE_VBUS_VALID);
+       reg_val |= (0x03 << USBC_BP_ISCR_FORCE_VBUS_VALID);
+       reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
+       musb_writel(base, USBC_REG_o_ISCR, reg_val);
+}
+
+static void USBC_ConfigFIFO_Base(void)
+{
+       u32 reg_value;
+
+       /* config usb fifo, 8kb mode */
+       reg_value = readl(SUNXI_SRAMC_BASE + 0x04);
+       reg_value &= ~(0x03 << 0);
+       reg_value |= (1 << 0);
+       writel(reg_value, SUNXI_SRAMC_BASE + 0x04);
+}
+
+/******************************************************************************
+ * MUSB Glue code
+ ******************************************************************************/
+
+static irqreturn_t sunxi_musb_interrupt(int irq, void *__hci)
+{
+       struct musb             *musb = __hci;
+       irqreturn_t             retval = IRQ_NONE;
+
+       /* read and flush interrupts */
+       musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
+       if (musb->int_usb)
+               musb_writeb(musb->mregs, MUSB_INTRUSB, musb->int_usb);
+       musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
+       if (musb->int_tx)
+               musb_writew(musb->mregs, MUSB_INTRTX, musb->int_tx);
+       musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
+       if (musb->int_rx)
+               musb_writew(musb->mregs, MUSB_INTRRX, musb->int_rx);
+
+       if (musb->int_usb || musb->int_tx || musb->int_rx)
+               retval |= musb_interrupt(musb);
+
+       return retval;
+}
+
+static void sunxi_musb_enable(struct musb *musb)
+{
+       pr_debug("%s():\n", __func__);
+
+       /* select PIO mode */
+       musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0);
+
+       if (is_host_enabled(musb)) {
+               /* port power on */
+               sunxi_usbc_vbus_enable(0);
+       }
+}
+
+static void sunxi_musb_disable(struct musb *musb)
+{
+       pr_debug("%s():\n", __func__);
+
+       /* Put the controller back in a pristane state for "usb reset" */
+       if (musb->is_active) {
+               sunxi_usbc_disable(0);
+               sunxi_usbc_enable(0);
+               musb->is_active = 0;
+       }
+}
+
+static int sunxi_musb_init(struct musb *musb)
+{
+       int err;
+
+       pr_debug("%s():\n", __func__);
+
+       err = sunxi_usbc_request_resources(0);
+       if (err)
+               return err;
+
+       musb->isr = sunxi_musb_interrupt;
+       sunxi_usbc_enable(0);
+
+       USBC_ConfigFIFO_Base();
+       USBC_EnableDpDmPullUp(musb->mregs);
+       USBC_EnableIdPullUp(musb->mregs);
+
+       if (is_host_enabled(musb)) {
+               /* Host mode */
+               USBC_ForceIdToLow(musb->mregs);
+               USBC_ForceVbusValidToHigh(musb->mregs);
+       } else {
+               /* Peripheral mode */
+               USBC_ForceIdToHigh(musb->mregs);
+               USBC_ForceVbusValidDisable(musb->mregs);
+       }
+
+       return 0;
+}
+
+static int sunxi_musb_exit(struct musb *musb)
+{
+       pr_debug("%s():\n", __func__);
+
+       USBC_DisableDpDmPullUp(musb->mregs);
+       USBC_DisableIdPullUp(musb->mregs);
+       sunxi_usbc_vbus_disable(0);
+       sunxi_usbc_disable(0);
+
+       return sunxi_usbc_free_resources(0);
+}
+
+const struct musb_platform_ops sunxi_musb_ops = {
+       .init           = sunxi_musb_init,
+       .exit           = sunxi_musb_exit,
+
+       .enable         = sunxi_musb_enable,
+       .disable        = sunxi_musb_disable,
+};
index 27f656f0ce518149dddcaae86d63ddc0e9d2f0f4..50bad378c5de95c6527cc1016021a790d4daa087 100644 (file)
@@ -48,6 +48,7 @@ struct urb {
        list_add_tail(&urb->urb_list, &urb->ep->urb_list);      \
        ret; })
 #define usb_hcd_unlink_urb_from_ep(hcd, urb)   list_del_init(&urb->urb_list)
+#define usb_hcd_check_unlink_urb(hdc, urb, status)     0
 
 static inline void usb_hcd_giveback_urb(struct usb_hcd *hcd,
                                        struct urb *urb,
index fdbf3f64f28fee2479ab7dca441508858b430f1e..51728b366f007529c2335dd929becaa30b3fcfd4 100644 (file)
@@ -1,8 +1,90 @@
-config VIDEO_X86
-       bool "Enable x86 video driver support"
+config VIDEO_VESA
+       bool "Enable VESA video driver support"
        depends on X86
        default n
        help
          Turn on this option to enable a very simple driver which uses vesa
          to discover the video mode and then provides a frame buffer for use
-         by U-Boot.
+         by U-Boot. This can in principle be used with any platform that
+         supports PCI and video cards that support VESA BIOS Extension (VBE).
+
+config VIDEO_LCD_SSD2828
+       bool "SSD2828 bridge chip"
+       default n
+       ---help---
+       Support for the SSD2828 bridge chip, which can take pixel data coming
+       from a parallel LCD interface and translate it on the fly into MIPI DSI
+       interface for driving a MIPI compatible LCD panel. It uses SPI for
+       configuration.
+
+config VIDEO_LCD_SSD2828_TX_CLK
+       int "SSD2828 TX_CLK frequency (in MHz)"
+       depends on VIDEO_LCD_SSD2828
+       default 0
+       ---help---
+       The frequency of the crystal, which is clocking SSD2828. It may be
+       anything in the 8MHz-30MHz range and the exact value should be
+       retrieved from the board schematics. Or in the case of Allwinner
+       hardware, it can be usually found as 'lcd_xtal_freq' variable in
+       FEX files. It can be also set to 0 for selecting PCLK from the
+       parallel LCD interface instead of TX_CLK as the PLL clock source.
+
+config VIDEO_LCD_SSD2828_RESET
+       string "RESET pin of SSD2828"
+       depends on VIDEO_LCD_SSD2828
+       default ""
+       ---help---
+       The reset pin of SSD2828 chip. This takes a string in the format
+       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_HITACHI_TX18D42VM
+       bool "Hitachi tx18d42vm LVDS LCD panel support"
+       depends on VIDEO
+       default n
+       ---help---
+       Support for Hitachi tx18d42vm LVDS LCD panels, these panels have a
+       lcd controller which needs to be initialized over SPI, once that is
+       done they work like a regular LVDS panel.
+
+config VIDEO_LCD_SPI_CS
+       string "SPI CS pin for LCD related config job"
+       depends on VIDEO_LCD_SSD2828 || VIDEO_LCD_HITACHI_TX18D42VM
+       default ""
+       ---help---
+       This is one of the SPI communication pins, involved in setting up a
+       working LCD configuration. The exact role of SPI may differ for
+       different hardware setups. The option takes a string in the format
+       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_SCLK
+       string "SPI SCLK pin for LCD related config job"
+       depends on VIDEO_LCD_SSD2828 || VIDEO_LCD_HITACHI_TX18D42VM
+       default ""
+       ---help---
+       This is one of the SPI communication pins, involved in setting up a
+       working LCD configuration. The exact role of SPI may differ for
+       different hardware setups. The option takes a string in the format
+       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_MOSI
+       string "SPI MOSI pin for LCD related config job"
+       depends on VIDEO_LCD_SSD2828 || VIDEO_LCD_HITACHI_TX18D42VM
+       default ""
+       ---help---
+       This is one of the SPI communication pins, involved in setting up a
+       working LCD configuration. The exact role of SPI may differ for
+       different hardware setups. The option takes a string in the format
+       understood by 'name_to_gpio' function, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_MISO
+       string "SPI MISO pin for LCD related config job (optional)"
+       depends on VIDEO_LCD_SSD2828
+       default ""
+       ---help---
+       This is one of the SPI communication pins, involved in setting up a
+       working LCD configuration. The exact role of SPI may differ for
+       different hardware setups. If wired up, this pin may provide additional
+       useful functionality. Such as bi-directional communication with the
+       hardware and LCD panel id retrieval (if the panel can report it). The
+       option takes a string in the format understood by 'name_to_gpio'
+       function, e.g. PH1 for pin 1 of port H.
index 42b1eaaf760c9323210dfabf2a0ca939d3c04e28..af2d47bd75f63bde957bb4667916c1fbc64021fa 100644 (file)
@@ -29,6 +29,8 @@ obj-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
 obj-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_IMX25LCDC) += imx25lcdc.o videomodes.o
+obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
+obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
 obj-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o
 obj-$(CONFIG_VIDEO_MB86R0xGDC) += mb86r0xgdc.o videomodes.o
 obj-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o
@@ -42,7 +44,7 @@ obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
-obj-$(CONFIG_VIDEO_X86) += x86_fb.o
+obj-$(CONFIG_VIDEO_VESA) += vesa_fb.o
 obj-$(CONFIG_FORMIKE) += formike.o
 obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
 obj-$(CONFIG_VIDEO_PARADE) += parade.o
index a653bb4168551b78272f8f4f6ee087d63c7fec4b..a81affa3333f743ed6e56e8758a6fab98addf003 100644 (file)
  * Defines for the SED13806 driver
  */
 #ifdef CONFIG_VIDEO_SED13806
-
-#ifndef CONFIG_TOTAL5200
 #define VIDEO_FB_LITTLE_ENDIAN
-#endif
 #define VIDEO_HW_RECTFILL
 #define VIDEO_HW_BITBLT
 #endif
 
-/*
- * Defines for the SED13806 driver
- */
-#ifdef CONFIG_VIDEO_SM501
-
-#ifdef CONFIG_HH405
-#define VIDEO_FB_LITTLE_ENDIAN
-#endif
-#endif
-
 #ifdef CONFIG_VIDEO_MXS
 #define VIDEO_FB_16BPP_WORD_SWAP
 #endif
@@ -312,7 +299,11 @@ void console_cursor(int state);
 #define CONSOLE_ROW_SECOND     (video_console_address + CONSOLE_ROW_SIZE)
 #define CONSOLE_ROW_LAST       (video_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 #define CONSOLE_SIZE           (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
-#define CONSOLE_SCROLL_SIZE    (CONSOLE_SIZE - CONSOLE_ROW_SIZE)
+
+/* By default we scroll by a single line */
+#ifndef CONFIG_CONSOLE_SCROLL_LINES
+#define CONFIG_CONSOLE_SCROLL_LINES 1
+#endif
 
 /* Macros */
 #ifdef VIDEO_FB_LITTLE_ENDIAN
@@ -753,26 +744,33 @@ static void console_clear_line(int line, int begin, int end)
 
 static void console_scrollup(void)
 {
+       const int rows = CONFIG_CONSOLE_SCROLL_LINES;
+       int i;
+
        /* copy up rows ignoring the first one */
 
 #ifdef VIDEO_HW_BITBLT
        video_hw_bitblt(VIDEO_PIXEL_SIZE,       /* bytes per pixel */
                        0,                      /* source pos x */
                        video_logo_height +
-                               VIDEO_FONT_HEIGHT, /* source pos y */
+                               VIDEO_FONT_HEIGHT * rows, /* source pos y */
                        0,                      /* dest pos x */
                        video_logo_height,      /* dest pos y */
                        VIDEO_VISIBLE_COLS,     /* frame width */
                        VIDEO_VISIBLE_ROWS
                        - video_logo_height
-                       - VIDEO_FONT_HEIGHT     /* frame height */
+                       - VIDEO_FONT_HEIGHT * rows      /* frame height */
                );
 #else
-       memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND,
-               CONSOLE_SCROLL_SIZE >> 2);
+       memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_FIRST + rows * CONSOLE_ROW_SIZE,
+               (CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows) >> 2);
 #endif
        /* clear the last one */
-       console_clear_line(CONSOLE_ROWS - 1, 0, CONSOLE_COLS - 1);
+       for (i = 1; i <= rows; i++)
+               console_clear_line(CONSOLE_ROWS - i, 0, CONSOLE_COLS - 1);
+
+       /* Decrement row number */
+       console_row -= rows;
 }
 
 static void console_back(void)
@@ -884,9 +882,6 @@ static void console_newline(int n)
        if (console_row >= CONSOLE_ROWS) {
                /* Scroll everything up */
                console_scrollup();
-
-               /* Decrement row number */
-               console_row = CONSOLE_ROWS - 1;
        }
 }
 
diff --git a/drivers/video/hitachi_tx18d42vm_lcd.c b/drivers/video/hitachi_tx18d42vm_lcd.c
new file mode 100644 (file)
index 0000000..1ce4a8c
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Hitachi tx18d42vm LVDS LCD panel driver
+ *
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+#include <asm/gpio.h>
+#include <errno.h>
+
+/*
+ * Very simple write only SPI support, this does not use the generic SPI infra
+ * because that assumes R/W SPI, requiring a MISO pin. Also the necessary glue
+ * code alone would be larger then this minimal version.
+ */
+static void lcd_panel_spi_write(int cs, int clk, int mosi,
+                               unsigned int data, int bits)
+{
+       int i, offset;
+
+       gpio_direction_output(cs, 0);
+       for (i = 0; i < bits; i++) {
+               gpio_direction_output(clk, 0);
+               offset = (bits - 1) - i;
+               gpio_direction_output(mosi, (data >> offset) & 1);
+               udelay(2);
+               gpio_direction_output(clk, 1);
+               udelay(2);
+       }
+       gpio_direction_output(cs, 1);
+       udelay(2);
+}
+
+int hitachi_tx18d42vm_init(void)
+{
+       const u16 init_data[] = {
+               0x0029,         /* reset */
+               0x0025,         /* standby */
+               0x0840,         /* enable normally black */
+               0x0430,         /* enable FRC/dither */
+               0x385f,         /* enter test mode(1) */
+               0x3ca4,         /* enter test mode(2) */
+               0x3409,         /* enable SDRRS, enlarge OE width */
+               0x4041,         /* adopt 2 line / 1 dot */
+       };
+       int i, cs, clk, mosi, ret = 0;
+
+       cs = name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS);
+       clk = name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK);
+       mosi = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI);
+
+       if (cs == -1 || clk == -1 || mosi == 1) {
+               printf("Error tx18d42vm spi gpio config is invalid\n");
+               return -EINVAL;
+       }
+
+       if (gpio_request(cs, "tx18d42vm-spi-cs") != 0 ||
+           gpio_request(clk, "tx18d42vm-spi-clk") != 0 ||
+           gpio_request(mosi, "tx18d42vm-spi-mosi") != 0) {
+               printf("Error cannot request tx18d42vm spi gpios\n");
+               ret = -EBUSY;
+               goto out;
+       }
+
+       for (i = 0; i < ARRAY_SIZE(init_data); i++)
+               lcd_panel_spi_write(cs, clk, mosi, init_data[i], 16);
+
+       mdelay(50); /* All the tx18d42vm drivers have a delay here ? */
+
+       lcd_panel_spi_write(cs, clk, mosi, 0x00ad, 16); /* display on */
+
+out:
+       gpio_free(mosi);
+       gpio_free(clk);
+       gpio_free(cs);
+
+       return ret;
+}
diff --git a/drivers/video/hitachi_tx18d42vm_lcd.h b/drivers/video/hitachi_tx18d42vm_lcd.h
new file mode 100644 (file)
index 0000000..1b72800
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * Hitachi tx18d42vm LVDS LCD panel driver
+ *
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+void hitachi_tx18d42vm_init(void);
index da653c0f51673a162e287e9c2b3d23244949aeda..cd7fac6f970603f8f111e47d4d06b9a61759fd50 100644 (file)
 #define writeByte(ptrReg,value) \
     *(volatile unsigned char *)(sed13806.isaBase + ptrReg) = value
 
-#ifdef CONFIG_TOTAL5200
-#define writeWord(ptrReg,value) \
-    (*(volatile unsigned short *)(sed13806.isaBase + ptrReg) = value)
-#else
 #define writeWord(ptrReg,value) \
     (*(volatile unsigned short *)(sed13806.isaBase + ptrReg) = ((value >> 8 ) & 0xff) | ((value << 8) & 0xff00))
-#endif
 
 GraphicDevice sed13806;
 
diff --git a/drivers/video/ssd2828.c b/drivers/video/ssd2828.c
new file mode 100644 (file)
index 0000000..8b09082
--- /dev/null
@@ -0,0 +1,436 @@
+/*
+ * (C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Support for the SSD2828 bridge chip, which can take pixel data coming
+ * from a parallel LCD interface and translate it on the flight into MIPI DSI
+ * interface for driving a MIPI compatible TFT display.
+ */
+
+#include <common.h>
+#include <mipi_display.h>
+#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
+
+#include "videomodes.h"
+#include "ssd2828.h"
+
+#define                SSD2828_DIR     0xB0
+#define                SSD2828_VICR1   0xB1
+#define                SSD2828_VICR2   0xB2
+#define                SSD2828_VICR3   0xB3
+#define                SSD2828_VICR4   0xB4
+#define                SSD2828_VICR5   0xB5
+#define                SSD2828_VICR6   0xB6
+#define                SSD2828_CFGR    0xB7
+#define                SSD2828_VCR     0xB8
+#define                SSD2828_PCR     0xB9
+#define                SSD2828_PLCR    0xBA
+#define                SSD2828_CCR     0xBB
+#define                SSD2828_PSCR1   0xBC
+#define                SSD2828_PSCR2   0xBD
+#define                SSD2828_PSCR3   0xBE
+#define                SSD2828_PDR     0xBF
+#define                SSD2828_OCR     0xC0
+#define                SSD2828_MRSR    0xC1
+#define                SSD2828_RDCR    0xC2
+#define                SSD2828_ARSR    0xC3
+#define                SSD2828_LCR     0xC4
+#define                SSD2828_ICR     0xC5
+#define                SSD2828_ISR     0xC6
+#define                SSD2828_ESR     0xC7
+#define                SSD2828_DAR1    0xC9
+#define                SSD2828_DAR2    0xCA
+#define                SSD2828_DAR3    0xCB
+#define                SSD2828_DAR4    0xCC
+#define                SSD2828_DAR5    0xCD
+#define                SSD2828_DAR6    0xCE
+#define                SSD2828_HTTR1   0xCF
+#define                SSD2828_HTTR2   0xD0
+#define                SSD2828_LRTR1   0xD1
+#define                SSD2828_LRTR2   0xD2
+#define                SSD2828_TSR     0xD3
+#define                SSD2828_LRR     0xD4
+#define                SSD2828_PLLR    0xD5
+#define                SSD2828_TR      0xD6
+#define                SSD2828_TECR    0xD7
+#define                SSD2828_ACR1    0xD8
+#define                SSD2828_ACR2    0xD9
+#define                SSD2828_ACR3    0xDA
+#define                SSD2828_ACR4    0xDB
+#define                SSD2828_IOCR    0xDC
+#define                SSD2828_VICR7   0xDD
+#define                SSD2828_LCFR    0xDE
+#define                SSD2828_DAR7    0xDF
+#define                SSD2828_PUCR1   0xE0
+#define                SSD2828_PUCR2   0xE1
+#define                SSD2828_PUCR3   0xE2
+#define                SSD2828_CBCR1   0xE9
+#define                SSD2828_CBCR2   0xEA
+#define                SSD2828_CBSR    0xEB
+#define                SSD2828_ECR     0xEC
+#define                SSD2828_VSDR    0xED
+#define                SSD2828_TMR     0xEE
+#define                SSD2828_GPIO1   0xEF
+#define                SSD2828_GPIO2   0xF0
+#define                SSD2828_DLYA01  0xF1
+#define                SSD2828_DLYA23  0xF2
+#define                SSD2828_DLYB01  0xF3
+#define                SSD2828_DLYB23  0xF4
+#define                SSD2828_DLYC01  0xF5
+#define                SSD2828_DLYC23  0xF6
+#define                SSD2828_ACR5    0xF7
+#define                SSD2828_RR      0xFF
+
+#define        SSD2828_CFGR_HS                                 (1 << 0)
+#define        SSD2828_CFGR_CKE                                (1 << 1)
+#define        SSD2828_CFGR_SLP                                (1 << 2)
+#define        SSD2828_CFGR_VEN                                (1 << 3)
+#define        SSD2828_CFGR_HCLK                               (1 << 4)
+#define        SSD2828_CFGR_CSS                                (1 << 5)
+#define        SSD2828_CFGR_DCS                                (1 << 6)
+#define        SSD2828_CFGR_REN                                (1 << 7)
+#define        SSD2828_CFGR_ECD                                (1 << 8)
+#define        SSD2828_CFGR_EOT                                (1 << 9)
+#define        SSD2828_CFGR_LPE                                (1 << 10)
+#define        SSD2828_CFGR_TXD                                (1 << 11)
+
+#define        SSD2828_VIDEO_MODE_NON_BURST_WITH_SYNC_PULSES   (0 << 2)
+#define        SSD2828_VIDEO_MODE_NON_BURST_WITH_SYNC_EVENTS   (1 << 2)
+#define        SSD2828_VIDEO_MODE_BURST                        (2 << 2)
+
+#define        SSD2828_VIDEO_PIXEL_FORMAT_16BPP                0
+#define        SSD2828_VIDEO_PIXEL_FORMAT_18BPP_PACKED         1
+#define        SSD2828_VIDEO_PIXEL_FORMAT_18BPP_LOOSELY_PACKED 2
+#define        SSD2828_VIDEO_PIXEL_FORMAT_24BPP                3
+
+#define        SSD2828_LP_CLOCK_DIVIDER(n)                     (((n) - 1) & 0x3F)
+
+/*
+ * SPI transfer, using the "24-bit 3 wire" mode (that's how it is called in
+ * the SSD2828 documentation). The 'dout' input parameter specifies 24-bits
+ * of data to be written to SSD2828. Returns the lowest 16-bits of data,
+ * that is received back.
+ */
+static u32 soft_spi_xfer_24bit_3wire(const struct ssd2828_config *drv, u32 dout)
+{
+       int j, bitlen = 24;
+       u32 tmpdin = 0;
+       /*
+        * According to the "24 Bit 3 Wire SPI Interface Timing Characteristics"
+        * and "TX_CLK Timing Characteristics" tables in the SSD2828 datasheet,
+        * the lowest possible 'tx_clk' clock frequency is 8MHz, and SPI runs
+        * at 1/8 of that after reset. So using 1 microsecond delays is safe in
+        * the main loop. But the delays around chip select pin manipulations
+        * need to be longer (up to 16 'tx_clk' cycles, or 2 microseconds in
+        * the worst case).
+        */
+       const int spi_delay_us = 1;
+       const int spi_cs_delay_us = 2;
+
+       gpio_set_value(drv->csx_pin, 0);
+       udelay(spi_cs_delay_us);
+       for (j = bitlen - 1; j >= 0; j--) {
+               gpio_set_value(drv->sck_pin, 0);
+               gpio_set_value(drv->sdi_pin, (dout & (1 << j)) != 0);
+               udelay(spi_delay_us);
+               if (drv->sdo_pin != -1)
+                       tmpdin = (tmpdin << 1) | gpio_get_value(drv->sdo_pin);
+               gpio_set_value(drv->sck_pin, 1);
+               udelay(spi_delay_us);
+       }
+       udelay(spi_cs_delay_us);
+       gpio_set_value(drv->csx_pin, 1);
+       udelay(spi_cs_delay_us);
+       return tmpdin & 0xFFFF;
+}
+
+/*
+ * Read from a SSD2828 hardware register (regnum >= 0xB0)
+ */
+static u32 read_hw_register(const struct ssd2828_config *cfg, u8 regnum)
+{
+       soft_spi_xfer_24bit_3wire(cfg, 0x700000 | regnum);
+       return soft_spi_xfer_24bit_3wire(cfg, 0x730000);
+}
+
+/*
+ * Write to a SSD2828 hardware register (regnum >= 0xB0)
+ */
+static void write_hw_register(const struct ssd2828_config *cfg, u8 regnum,
+                             u16 val)
+{
+       soft_spi_xfer_24bit_3wire(cfg, 0x700000 | regnum);
+       soft_spi_xfer_24bit_3wire(cfg, 0x720000 | val);
+}
+
+/*
+ * Send MIPI command to the LCD panel (cmdnum < 0xB0)
+ */
+static void send_mipi_dcs_command(const struct ssd2828_config *cfg, u8 cmdnum)
+{
+       /* Set packet size to 1 (a single command with no parameters) */
+       write_hw_register(cfg, SSD2828_PSCR1, 1);
+       /* Send the command */
+       write_hw_register(cfg, SSD2828_PDR, cmdnum);
+}
+
+/*
+ * Reset SSD2828
+ */
+static void ssd2828_reset(const struct ssd2828_config *cfg)
+{
+       /* RESET needs 10 milliseconds according to the datasheet */
+       gpio_set_value(cfg->reset_pin, 0);
+       mdelay(10);
+       gpio_set_value(cfg->reset_pin, 1);
+       mdelay(10);
+}
+
+static int ssd2828_enable_gpio(const struct ssd2828_config *cfg)
+{
+       if (gpio_request(cfg->csx_pin, "ssd2828_csx")) {
+               printf("SSD2828: request for 'ssd2828_csx' pin failed\n");
+               return 1;
+       }
+       if (gpio_request(cfg->sck_pin, "ssd2828_sck")) {
+               gpio_free(cfg->csx_pin);
+               printf("SSD2828: request for 'ssd2828_sck' pin failed\n");
+               return 1;
+       }
+       if (gpio_request(cfg->sdi_pin, "ssd2828_sdi")) {
+               gpio_free(cfg->csx_pin);
+               gpio_free(cfg->sck_pin);
+               printf("SSD2828: request for 'ssd2828_sdi' pin failed\n");
+               return 1;
+       }
+       if (gpio_request(cfg->reset_pin, "ssd2828_reset")) {
+               gpio_free(cfg->csx_pin);
+               gpio_free(cfg->sck_pin);
+               gpio_free(cfg->sdi_pin);
+               printf("SSD2828: request for 'ssd2828_reset' pin failed\n");
+               return 1;
+       }
+       if (cfg->sdo_pin != -1 && gpio_request(cfg->sdo_pin, "ssd2828_sdo")) {
+               gpio_free(cfg->csx_pin);
+               gpio_free(cfg->sck_pin);
+               gpio_free(cfg->sdi_pin);
+               gpio_free(cfg->reset_pin);
+               printf("SSD2828: request for 'ssd2828_sdo' pin failed\n");
+               return 1;
+       }
+       gpio_direction_output(cfg->reset_pin, 0);
+       gpio_direction_output(cfg->csx_pin, 1);
+       gpio_direction_output(cfg->sck_pin, 1);
+       gpio_direction_output(cfg->sdi_pin, 1);
+       if (cfg->sdo_pin != -1)
+               gpio_direction_input(cfg->sdo_pin);
+
+       return 0;
+}
+
+static int ssd2828_free_gpio(const struct ssd2828_config *cfg)
+{
+       gpio_free(cfg->csx_pin);
+       gpio_free(cfg->sck_pin);
+       gpio_free(cfg->sdi_pin);
+       gpio_free(cfg->reset_pin);
+       if (cfg->sdo_pin != -1)
+               gpio_free(cfg->sdo_pin);
+       return 1;
+}
+
+/*
+ * PLL configuration register settings.
+ *
+ * See the "PLL Configuration Register Description" in the SSD2828 datasheet.
+ */
+static u32 construct_pll_config(u32 desired_pll_freq_kbps,
+                               u32 reference_freq_khz)
+{
+       u32 div_factor = 1, mul_factor, fr = 0;
+       u32 output_freq_kbps;
+
+       /* The intermediate clock after division can't be less than 5MHz */
+       while (reference_freq_khz / (div_factor + 1) >= 5000)
+               div_factor++;
+       if (div_factor > 31)
+               div_factor = 31;
+
+       mul_factor = DIV_ROUND_UP(desired_pll_freq_kbps * div_factor,
+                                 reference_freq_khz);
+
+       output_freq_kbps = reference_freq_khz * mul_factor / div_factor;
+
+       if (output_freq_kbps >= 501000)
+               fr = 3;
+       else if (output_freq_kbps >= 251000)
+               fr = 2;
+       else if (output_freq_kbps >= 126000)
+               fr = 1;
+
+       return (fr << 14) | (div_factor << 8) | mul_factor;
+}
+
+static u32 decode_pll_config(u32 pll_config, u32 reference_freq_khz)
+{
+       u32 mul_factor = pll_config & 0xFF;
+       u32 div_factor = (pll_config >> 8) & 0x1F;
+       if (mul_factor == 0)
+               mul_factor = 1;
+       if (div_factor == 0)
+               div_factor = 1;
+       return reference_freq_khz * mul_factor / div_factor;
+}
+
+static int ssd2828_configure_video_interface(const struct ssd2828_config *cfg,
+                                            const struct ctfb_res_modes *mode)
+{
+       u32 val;
+
+       /* RGB Interface Control Register 1 */
+       write_hw_register(cfg, SSD2828_VICR1, (mode->vsync_len << 8) |
+                                             (mode->hsync_len));
+
+       /* RGB Interface Control Register 2 */
+       u32 vbp = mode->vsync_len + mode->upper_margin;
+       u32 hbp = mode->hsync_len + mode->left_margin;
+       write_hw_register(cfg, SSD2828_VICR2, (vbp << 8) | hbp);
+
+       /* RGB Interface Control Register 3 */
+       write_hw_register(cfg, SSD2828_VICR3, (mode->lower_margin << 8) |
+                                             (mode->right_margin));
+
+       /* RGB Interface Control Register 4 */
+       write_hw_register(cfg, SSD2828_VICR4, mode->xres);
+
+       /* RGB Interface Control Register 5 */
+       write_hw_register(cfg, SSD2828_VICR5, mode->yres);
+
+       /* RGB Interface Control Register 6 */
+       val = SSD2828_VIDEO_MODE_BURST;
+       switch (cfg->ssd2828_color_depth) {
+       case 16:
+               val |= SSD2828_VIDEO_PIXEL_FORMAT_16BPP;
+               break;
+       case 18:
+               val |= cfg->mipi_dsi_loosely_packed_pixel_format ?
+                       SSD2828_VIDEO_PIXEL_FORMAT_18BPP_LOOSELY_PACKED :
+                       SSD2828_VIDEO_PIXEL_FORMAT_18BPP_PACKED;
+               break;
+       case 24:
+               val |= SSD2828_VIDEO_PIXEL_FORMAT_24BPP;
+               break;
+       default:
+               printf("SSD2828: unsupported color depth\n");
+               return 1;
+       }
+       write_hw_register(cfg, SSD2828_VICR6, val);
+
+       /* Lane Configuration Register */
+       write_hw_register(cfg, SSD2828_LCFR,
+                         cfg->mipi_dsi_number_of_data_lanes - 1);
+
+       return 0;
+}
+
+int ssd2828_init(const struct ssd2828_config *cfg,
+                const struct ctfb_res_modes *mode)
+{
+       u32 lp_div, pll_freq_kbps, reference_freq_khz, pll_config;
+       /* The LP clock speed is limited by 10MHz */
+       const u32 mipi_dsi_low_power_clk_khz = 10000;
+       /*
+        * This is just the reset default value of CFGR register (0x301).
+        * Because we are not always able to read back from SPI, have
+        * it initialized here.
+        */
+       u32 cfgr_reg = SSD2828_CFGR_EOT | /* EOT Packet Enable */
+                      SSD2828_CFGR_ECD | /* Disable ECC and CRC */
+                      SSD2828_CFGR_HS;   /* Data lanes are in HS mode */
+
+       /* Initialize the pins */
+       if (ssd2828_enable_gpio(cfg) != 0)
+               return 1;
+
+       /* Reset the chip */
+       ssd2828_reset(cfg);
+
+       /*
+        * If there is a pin to read data back from SPI, then we are lucky. Try
+        * to check if SPI is configured correctly and SSD2828 is actually able
+        * to talk back.
+        */
+       if (cfg->sdo_pin != -1) {
+               if (read_hw_register(cfg, SSD2828_DIR) != 0x2828 ||
+                   read_hw_register(cfg, SSD2828_CFGR) != cfgr_reg) {
+                       printf("SSD2828: SPI communication failed.\n");
+                       ssd2828_free_gpio(cfg);
+                       return 1;
+               }
+       }
+
+       /*
+        * Pick the reference clock for PLL. If we know the exact 'tx_clk'
+        * clock speed, then everything is good. If not, then we can fallback
+        * to 'pclk' (pixel clock from the parallel LCD interface). In the
+        * case of using this fallback, it is necessary to have parallel LCD
+        * already initialized and running at this point.
+        */
+       reference_freq_khz = cfg->ssd2828_tx_clk_khz;
+       if (reference_freq_khz  == 0) {
+               reference_freq_khz = mode->pixclock_khz;
+               /* Use 'pclk' as the reference clock for PLL */
+               cfgr_reg |= SSD2828_CFGR_CSS;
+       }
+
+       /*
+        * Setup the parallel LCD timings in the appropriate registers.
+        */
+       if (ssd2828_configure_video_interface(cfg, mode) != 0) {
+               ssd2828_free_gpio(cfg);
+               return 1;
+       }
+
+       /* Configuration Register */
+       cfgr_reg &= ~SSD2828_CFGR_HS;  /* Data lanes are in LP mode */
+       cfgr_reg |= SSD2828_CFGR_CKE;  /* Clock lane is in HS mode */
+       cfgr_reg |= SSD2828_CFGR_DCS;  /* Only use DCS packets */
+       write_hw_register(cfg, SSD2828_CFGR, cfgr_reg);
+
+       /* PLL Configuration Register */
+       pll_config = construct_pll_config(
+                               cfg->mipi_dsi_bitrate_per_data_lane_mbps * 1000,
+                               reference_freq_khz);
+       write_hw_register(cfg, SSD2828_PLCR, pll_config);
+
+       pll_freq_kbps = decode_pll_config(pll_config, reference_freq_khz);
+       lp_div = DIV_ROUND_UP(pll_freq_kbps, mipi_dsi_low_power_clk_khz * 8);
+
+       /* VC Control Register */
+       write_hw_register(cfg, SSD2828_VCR, 0);
+
+       /* Clock Control Register */
+       write_hw_register(cfg, SSD2828_CCR, SSD2828_LP_CLOCK_DIVIDER(lp_div));
+
+       /* PLL Control Register */
+       write_hw_register(cfg, SSD2828_PCR, 1); /* Enable PLL */
+
+       /* Wait for PLL lock */
+       udelay(500);
+
+       send_mipi_dcs_command(cfg, MIPI_DCS_EXIT_SLEEP_MODE);
+       mdelay(cfg->mipi_dsi_delay_after_exit_sleep_mode_ms);
+
+       send_mipi_dcs_command(cfg, MIPI_DCS_SET_DISPLAY_ON);
+       mdelay(cfg->mipi_dsi_delay_after_set_display_on_ms);
+
+       cfgr_reg |= SSD2828_CFGR_HS;    /* Enable HS mode for data lanes */
+       cfgr_reg |= SSD2828_CFGR_VEN;   /* Enable video pipeline */
+       write_hw_register(cfg, SSD2828_CFGR, cfgr_reg);
+
+       return 0;
+}
diff --git a/drivers/video/ssd2828.h b/drivers/video/ssd2828.h
new file mode 100644 (file)
index 0000000..1af6fa4
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * (C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Support for the SSD2828 bridge chip, which can take pixel data coming
+ * from a parallel LCD interface and translate it on the flight into MIPI DSI
+ * interface for driving a MIPI compatible TFT display.
+ *
+ * Implemented as a utility function. To be used from display drivers, which are
+ * responsible for driving parallel LCD hardware in front of the video pipeline.
+ */
+
+#ifndef _SSD2828_H
+#define _SSD2828_H
+
+struct ctfb_res_modes;
+
+struct ssd2828_config {
+       /*********************************************************************/
+       /* SSD2828 configuration                                             */
+       /*********************************************************************/
+
+       /*
+        * The pins, which are used for SPI communication. This is only used
+        * for configuring SSD2828, so the performance is irrelevant (only
+        * around a hundred of bytes is moved). Also these can be any arbitrary
+        * GPIO pins (not necessarily the pins having hardware SPI function).
+        * Moreover, the 'sdo' pin may be even not wired up in some devices.
+        *
+        * These configuration variables need to be set as pin numbers for
+        * the standard u-boot GPIO interface (gpio_get_value/gpio_set_value
+        * functions). Note that -1 value can be used for the pins, which are
+        * not really wired up.
+        */
+       int csx_pin;
+       int sck_pin;
+       int sdi_pin;
+       int sdo_pin;
+       /* SSD2828 reset pin (shared with LCD panel reset) */
+       int reset_pin;
+
+       /*
+        * The SSD2828 has its own dedicated clock source 'tx_clk' (connected
+        * to TX_CLK_XIO/TX_CLK_XIN pins), which is necessary at least for
+        * clocking SPI after reset. The exact clock speed is not strictly,
+        * defined, but the datasheet says that it must be somewhere in the
+        * 8MHz - 30MHz range (see "TX_CLK Timing" section). It can be also
+        * used as a reference clock for PLL. If the exact clock frequency
+        * is known, then it can be specified here. If it is unknown, or the
+        * information is not trustworthy, then it can be set to 0.
+        *
+        * If unsure, set to 0.
+        */
+       int ssd2828_tx_clk_khz;
+
+       /*
+        * This is not a property of the used LCD panel, but more like a
+        * property of the SSD2828 wiring. See the "SSD2828QN4 RGB data
+        * arrangement" table in the datasheet. The SSD2828 pins are arranged
+        * in such a way that 18bpp and 24bpp configurations are completely
+        * incompatible with each other.
+        *
+        * Depending on the color depth, this must be set to 16, 18 or 24.
+        */
+       int ssd2828_color_depth;
+
+       /*********************************************************************/
+       /* LCD panel configuration                                           */
+       /*********************************************************************/
+
+       /*
+        * The number of lanes in the MIPI DSI interface. May vary from 1 to 4.
+        *
+        * This information can be found in the LCD panel datasheet.
+        */
+       int mipi_dsi_number_of_data_lanes;
+
+       /*
+        * Data transfer bit rate per lane. Please note that it is expected
+        * to be higher than the pixel clock rate of the used video mode when
+        * multiplied by the number of lanes. This is perfectly normal because
+        * MIPI DSI handles data transfers in periodic bursts, and uses the
+        * idle time between bursts for sending configuration information and
+        * commands. Or just for saving power.
+        *
+        * The necessary Mbps/lane information can be found in the LCD panel
+        * datasheet. Note that the transfer rate can't be always set precisely
+        * and it may be rounded *up* (introducing no more than 10Mbps error).
+        */
+       int mipi_dsi_bitrate_per_data_lane_mbps;
+
+       /*
+        * Setting this to 1 enforces packing of 18bpp pixel data in 24bpp
+        * envelope when sending it over the MIPI DSI link.
+        *
+        * If unsure, set to 0.
+        */
+       int mipi_dsi_loosely_packed_pixel_format;
+
+       /*
+        * According to the "Example for system sleep in and out" section in
+        * the SSD2828 datasheet, some LCD panel specific delays are necessary
+        * after MIPI DCS commands EXIT_SLEEP_MODE and SET_DISPLAY_ON.
+        *
+        * For example, Allwinner uses 100 milliseconds delay after
+        * EXIT_SLEEP_MODE and 200 milliseconds delay after SET_DISPLAY_ON.
+        */
+       int mipi_dsi_delay_after_exit_sleep_mode_ms;
+       int mipi_dsi_delay_after_set_display_on_ms;
+};
+
+/*
+ * Initialize the SSD2828 chip. It needs the 'ssd2828_config' structure
+ * and also the video mode timings.
+ *
+ * The right place to insert this function call is after the parallel LCD
+ * interface is initialized and before turning on the backlight. This is
+ * advised in the "Example for system sleep in and out" section of the
+ * SSD2828 datasheet. And also SS2828 may use 'pclk' as the clock source
+ * for PLL, which means that the input signal must be already there.
+ */
+int ssd2828_init(const struct ssd2828_config *cfg,
+                const struct ctfb_res_modes *mode);
+
+#endif
index d92dfa88635260560c871c92536209f18e27c194..f5f24fc020bd793d2e1de7914f99d032e55a5743 100644 (file)
 #include <fdt_support.h>
 #include <video_fb.h>
 #include "videomodes.h"
+#include "hitachi_tx18d42vm_lcd.h"
+#include "ssd2828.h"
+
+#ifdef CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW
+#define PWM_ON 0
+#define PWM_OFF 1
+#else
+#define PWM_ON 1
+#define PWM_OFF 0
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -270,6 +280,114 @@ static int sunxi_hdmi_edid_get_mode(struct ctfb_res_modes *mode)
 
 #endif /* CONFIG_VIDEO_HDMI */
 
+#ifdef CONFIG_MACH_SUN4I
+/*
+ * Testing has shown that on sun4i the display backend engine does not have
+ * deep enough fifo-s causing flickering / tearing in full-hd mode due to
+ * fifo underruns. So on sun4i we use the display frontend engine to do the
+ * dma from memory, as the frontend does have deep enough fifo-s.
+ */
+
+static const u32 sun4i_vert_coef[32] = {
+       0x00004000, 0x000140ff, 0x00033ffe, 0x00043ffd,
+       0x00063efc, 0xff083dfc, 0x000a3bfb, 0xff0d39fb,
+       0xff0f37fb, 0xff1136fa, 0xfe1433fb, 0xfe1631fb,
+       0xfd192ffb, 0xfd1c2cfb, 0xfd1f29fb, 0xfc2127fc,
+       0xfc2424fc, 0xfc2721fc, 0xfb291ffd, 0xfb2c1cfd,
+       0xfb2f19fd, 0xfb3116fe, 0xfb3314fe, 0xfa3611ff,
+       0xfb370fff, 0xfb390dff, 0xfb3b0a00, 0xfc3d08ff,
+       0xfc3e0600, 0xfd3f0400, 0xfe3f0300, 0xff400100,
+};
+
+static const u32 sun4i_horz_coef[64] = {
+       0x40000000, 0x00000000, 0x40fe0000, 0x0000ff03,
+       0x3ffd0000, 0x0000ff05, 0x3ffc0000, 0x0000ff06,
+       0x3efb0000, 0x0000ff08, 0x3dfb0000, 0x0000ff09,
+       0x3bfa0000, 0x0000fe0d, 0x39fa0000, 0x0000fe0f,
+       0x38fa0000, 0x0000fe10, 0x36fa0000, 0x0000fe12,
+       0x33fa0000, 0x0000fd16, 0x31fa0000, 0x0000fd18,
+       0x2ffa0000, 0x0000fd1a, 0x2cfa0000, 0x0000fc1e,
+       0x29fa0000, 0x0000fc21, 0x27fb0000, 0x0000fb23,
+       0x24fb0000, 0x0000fb26, 0x21fb0000, 0x0000fb29,
+       0x1ffc0000, 0x0000fa2b, 0x1cfc0000, 0x0000fa2e,
+       0x19fd0000, 0x0000fa30, 0x16fd0000, 0x0000fa33,
+       0x14fd0000, 0x0000fa35, 0x11fe0000, 0x0000fa37,
+       0x0ffe0000, 0x0000fa39, 0x0dfe0000, 0x0000fa3b,
+       0x0afe0000, 0x0000fa3e, 0x08ff0000, 0x0000fb3e,
+       0x06ff0000, 0x0000fb40, 0x05ff0000, 0x0000fc40,
+       0x03ff0000, 0x0000fd41, 0x01ff0000, 0x0000fe42,
+};
+
+static void sunxi_frontend_init(void)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       struct sunxi_de_fe_reg * const de_fe =
+               (struct sunxi_de_fe_reg *)SUNXI_DE_FE0_BASE;
+       int i;
+
+       /* Clocks on */
+       setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_DE_FE0);
+       setbits_le32(&ccm->dram_clk_gate, 1 << CCM_DRAM_GATE_OFFSET_DE_FE0);
+       clock_set_de_mod_clock(&ccm->fe0_clk_cfg, 300000000);
+
+       setbits_le32(&de_fe->enable, SUNXI_DE_FE_ENABLE_EN);
+
+       for (i = 0; i < 32; i++) {
+               writel(sun4i_horz_coef[2 * i], &de_fe->ch0_horzcoef0[i]);
+               writel(sun4i_horz_coef[2 * i + 1], &de_fe->ch0_horzcoef1[i]);
+               writel(sun4i_vert_coef[i], &de_fe->ch0_vertcoef[i]);
+               writel(sun4i_horz_coef[2 * i], &de_fe->ch1_horzcoef0[i]);
+               writel(sun4i_horz_coef[2 * i + 1], &de_fe->ch1_horzcoef1[i]);
+               writel(sun4i_vert_coef[i], &de_fe->ch1_vertcoef[i]);
+       }
+
+       setbits_le32(&de_fe->frame_ctrl, SUNXI_DE_FE_FRAME_CTRL_COEF_RDY);
+}
+
+static void sunxi_frontend_mode_set(const struct ctfb_res_modes *mode,
+                                   unsigned int address)
+{
+       struct sunxi_de_fe_reg * const de_fe =
+               (struct sunxi_de_fe_reg *)SUNXI_DE_FE0_BASE;
+
+       setbits_le32(&de_fe->bypass, SUNXI_DE_FE_BYPASS_CSC_BYPASS);
+       writel(CONFIG_SYS_SDRAM_BASE + address, &de_fe->ch0_addr);
+       writel(mode->xres * 4, &de_fe->ch0_stride);
+       writel(SUNXI_DE_FE_INPUT_FMT_ARGB8888, &de_fe->input_fmt);
+       writel(SUNXI_DE_FE_OUTPUT_FMT_ARGB8888, &de_fe->output_fmt);
+
+       writel(SUNXI_DE_FE_HEIGHT(mode->yres) | SUNXI_DE_FE_WIDTH(mode->xres),
+              &de_fe->ch0_insize);
+       writel(SUNXI_DE_FE_HEIGHT(mode->yres) | SUNXI_DE_FE_WIDTH(mode->xres),
+              &de_fe->ch0_outsize);
+       writel(SUNXI_DE_FE_FACTOR_INT(1), &de_fe->ch0_horzfact);
+       writel(SUNXI_DE_FE_FACTOR_INT(1), &de_fe->ch0_vertfact);
+
+       writel(SUNXI_DE_FE_HEIGHT(mode->yres) | SUNXI_DE_FE_WIDTH(mode->xres),
+              &de_fe->ch1_insize);
+       writel(SUNXI_DE_FE_HEIGHT(mode->yres) | SUNXI_DE_FE_WIDTH(mode->xres),
+              &de_fe->ch1_outsize);
+       writel(SUNXI_DE_FE_FACTOR_INT(1), &de_fe->ch1_horzfact);
+       writel(SUNXI_DE_FE_FACTOR_INT(1), &de_fe->ch1_vertfact);
+
+       setbits_le32(&de_fe->frame_ctrl, SUNXI_DE_FE_FRAME_CTRL_REG_RDY);
+}
+
+static void sunxi_frontend_enable(void)
+{
+       struct sunxi_de_fe_reg * const de_fe =
+               (struct sunxi_de_fe_reg *)SUNXI_DE_FE0_BASE;
+
+       setbits_le32(&de_fe->frame_ctrl, SUNXI_DE_FE_FRAME_CTRL_FRM_START);
+}
+#else
+static void sunxi_frontend_init(void) {}
+static void sunxi_frontend_mode_set(const struct ctfb_res_modes *mode,
+                                   unsigned int address) {}
+static void sunxi_frontend_enable(void) {}
+#endif
+
 /*
  * This is the entity that mixes and matches the different layers and inputs.
  * Allwinner calls it the back-end, but i like composer better.
@@ -282,6 +400,8 @@ static void sunxi_composer_init(void)
                (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
        int i;
 
+       sunxi_frontend_init();
+
 #if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
        /* Reset off */
        setbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_DE_BE0);
@@ -289,7 +409,9 @@ static void sunxi_composer_init(void)
 
        /* Clocks on */
        setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_DE_BE0);
+#ifndef CONFIG_MACH_SUN4I /* On sun4i the frontend does the dma */
        setbits_le32(&ccm->dram_clk_gate, 1 << CCM_DRAM_GATE_OFFSET_DE_BE0);
+#endif
        clock_set_de_mod_clock(&ccm->be0_clk_cfg, 300000000);
 
        /* Engine bug, clear registers after reset */
@@ -305,13 +427,19 @@ static void sunxi_composer_mode_set(const struct ctfb_res_modes *mode,
        struct sunxi_de_be_reg * const de_be =
                (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
 
+       sunxi_frontend_mode_set(mode, address);
+
        writel(SUNXI_DE_BE_HEIGHT(mode->yres) | SUNXI_DE_BE_WIDTH(mode->xres),
               &de_be->disp_size);
        writel(SUNXI_DE_BE_HEIGHT(mode->yres) | SUNXI_DE_BE_WIDTH(mode->xres),
               &de_be->layer0_size);
+#ifndef CONFIG_MACH_SUN4I /* On sun4i the frontend does the dma */
        writel(SUNXI_DE_BE_LAYER_STRIDE(mode->xres), &de_be->layer0_stride);
        writel(address << 3, &de_be->layer0_addr_low32b);
        writel(address >> 29, &de_be->layer0_addr_high4b);
+#else
+       writel(SUNXI_DE_BE_LAYER_ATTR0_SRC_FE0, &de_be->layer0_attr0_ctrl);
+#endif
        writel(SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888, &de_be->layer0_attr1_ctrl);
 
        setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_LAYER0_ENABLE);
@@ -322,6 +450,8 @@ static void sunxi_composer_enable(void)
        struct sunxi_de_be_reg * const de_be =
                (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
 
+       sunxi_frontend_enable();
+
        setbits_le32(&de_be->reg_ctrl, SUNXI_DE_BE_REG_CTRL_LOAD_REGS);
        setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_START);
 }
@@ -476,8 +606,7 @@ static void sunxi_lcdc_panel_enable(void)
        pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_BL_PWM);
        if (pin != -1) {
                gpio_request(pin, "lcd_backlight_pwm");
-               /* backlight pwm is inverted, set to 1 to disable backlight */
-               gpio_direction_output(pin, 1);
+               gpio_direction_output(pin, PWM_OFF);
        }
 
        /* Give the backlight some time to turn off and power up the panel. */
@@ -504,10 +633,8 @@ static void sunxi_lcdc_backlight_enable(void)
                gpio_direction_output(pin, 1);
 
        pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_BL_PWM);
-       if (pin != -1) {
-               /* backlight pwm is inverted, set to 0 to enable backlight */
-               gpio_direction_output(pin, 0);
-       }
+       if (pin != -1)
+               gpio_direction_output(pin, PWM_ON);
 }
 
 static int sunxi_lcdc_get_clk_delay(const struct ctfb_res_modes *mode)
@@ -518,7 +645,8 @@ static int sunxi_lcdc_get_clk_delay(const struct ctfb_res_modes *mode)
        return (delay > 30) ? 30 : delay;
 }
 
-static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode)
+static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
+                                     bool for_ext_vga_dac)
 {
        struct sunxi_lcdc_reg * const lcdc =
                (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
@@ -587,16 +715,16 @@ static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode)
                       &lcdc->tcon0_frm_ctrl);
        }
 
-#ifdef CONFIG_VIDEO_LCD_IF_PARALLEL
-       val = SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE0;
-#endif
-#ifdef CONFIG_VIDEO_LCD_IF_LVDS
-       val = SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE60;
-#endif
+       val = SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE(CONFIG_VIDEO_LCD_DCLK_PHASE);
        if (!(mode->sync & FB_SYNC_HOR_HIGH_ACT))
                val |= SUNXI_LCDC_TCON_HSYNC_MASK;
        if (!(mode->sync & FB_SYNC_VERT_HIGH_ACT))
                val |= SUNXI_LCDC_TCON_VSYNC_MASK;
+
+#ifdef CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
+       if (for_ext_vga_dac)
+               val = 0;
+#endif
        writel(val, &lcdc->tcon0_io_polarity);
 
        writel(0, &lcdc->tcon0_io_tristate);
@@ -826,6 +954,40 @@ static void sunxi_vga_external_dac_enable(void)
 }
 #endif /* CONFIG_VIDEO_VGA_VIA_LCD */
 
+#ifdef CONFIG_VIDEO_LCD_SSD2828
+static int sunxi_ssd2828_init(const struct ctfb_res_modes *mode)
+{
+       struct ssd2828_config cfg = {
+               .csx_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS),
+               .sck_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_SCLK),
+               .sdi_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MOSI),
+               .sdo_pin = name_to_gpio(CONFIG_VIDEO_LCD_SPI_MISO),
+               .reset_pin = name_to_gpio(CONFIG_VIDEO_LCD_SSD2828_RESET),
+               .ssd2828_tx_clk_khz  = CONFIG_VIDEO_LCD_SSD2828_TX_CLK * 1000,
+               .ssd2828_color_depth = 24,
+#ifdef CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828
+               .mipi_dsi_number_of_data_lanes           = 4,
+               .mipi_dsi_bitrate_per_data_lane_mbps     = 513,
+               .mipi_dsi_delay_after_exit_sleep_mode_ms = 100,
+               .mipi_dsi_delay_after_set_display_on_ms  = 200
+#else
+#error MIPI LCD panel needs configuration parameters
+#endif
+       };
+
+       if (cfg.csx_pin == -1 || cfg.sck_pin == -1 || cfg.sdi_pin == -1) {
+               printf("SSD2828: SPI pins are not properly configured\n");
+               return 1;
+       }
+       if (cfg.reset_pin == -1) {
+               printf("SSD2828: Reset pin is not properly configured\n");
+               return 1;
+       }
+
+       return ssd2828_init(&cfg, mode);
+}
+#endif /* CONFIG_VIDEO_LCD_SSD2828 */
+
 static void sunxi_engines_init(void)
 {
        sunxi_composer_init();
@@ -854,10 +1016,17 @@ static void sunxi_mode_set(const struct ctfb_res_modes *mode,
                break;
        case sunxi_monitor_lcd:
                sunxi_lcdc_panel_enable();
+               if (IS_ENABLED(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM)) {
+                       mdelay(50); /* Wait for lcd controller power on */
+                       hitachi_tx18d42vm_init();
+               }
                sunxi_composer_mode_set(mode, address);
-               sunxi_lcdc_tcon0_mode_set(mode);
+               sunxi_lcdc_tcon0_mode_set(mode, false);
                sunxi_composer_enable();
                sunxi_lcdc_enable();
+#ifdef CONFIG_VIDEO_LCD_SSD2828
+               sunxi_ssd2828_init(mode);
+#endif
                sunxi_lcdc_backlight_enable();
                break;
        case sunxi_monitor_vga:
@@ -870,7 +1039,7 @@ static void sunxi_mode_set(const struct ctfb_res_modes *mode,
                sunxi_vga_enable();
 #elif defined CONFIG_VIDEO_VGA_VIA_LCD
                sunxi_composer_mode_set(mode, address);
-               sunxi_lcdc_tcon0_mode_set(mode);
+               sunxi_lcdc_tcon0_mode_set(mode, true);
                sunxi_composer_enable();
                sunxi_lcdc_enable();
                sunxi_vga_external_dac_enable();
@@ -1027,21 +1196,27 @@ int sunxi_simplefb_setup(void *blob)
        int offset, ret;
        const char *pipeline = NULL;
 
+#ifdef CONFIG_MACH_SUN4I
+#define PIPELINE_PREFIX "de_fe0-"
+#else
+#define PIPELINE_PREFIX
+#endif
+
        switch (sunxi_display.monitor) {
        case sunxi_monitor_none:
                return 0;
        case sunxi_monitor_dvi:
        case sunxi_monitor_hdmi:
-               pipeline = "de_be0-lcd0-hdmi";
+               pipeline = PIPELINE_PREFIX "de_be0-lcd0-hdmi";
                break;
        case sunxi_monitor_lcd:
-               pipeline = "de_be0-lcd0";
+               pipeline = PIPELINE_PREFIX "de_be0-lcd0";
                break;
        case sunxi_monitor_vga:
 #ifdef CONFIG_VIDEO_VGA
-               pipeline = "de_be0-lcd0-tve0";
+               pipeline = PIPELINE_PREFIX "de_be0-lcd0-tve0";
 #elif defined CONFIG_VIDEO_VGA_VIA_LCD
-               pipeline = "de_be0-lcd0";
+               pipeline = PIPELINE_PREFIX "de_be0-lcd0";
 #endif
                break;
        }
index 57cb0074e277f97e35e40d78e889c31437cd156b..b8f3431f242339c96cd0a9e28fffa435b4aef0fa 100644 (file)
@@ -149,14 +149,18 @@ static int fdt_decode_lcd(const void *blob, struct fdt_panel_config *config)
                                            FDT_LCD_CACHE_WRITE_BACK_FLUSH);
 
        /* These GPIOs are all optional */
-       fdtdec_decode_gpio(blob, display_node, "nvidia,backlight-enable-gpios",
-                           &config->backlight_en);
-       fdtdec_decode_gpio(blob, display_node, "nvidia,lvds-shutdown-gpios",
-                          &config->lvds_shutdown);
-       fdtdec_decode_gpio(blob, display_node, "nvidia,backlight-vdd-gpios",
-                          &config->backlight_vdd);
-       fdtdec_decode_gpio(blob, display_node, "nvidia,panel-vdd-gpios",
-                          &config->panel_vdd);
+       gpio_request_by_name_nodev(blob, display_node,
+                                  "nvidia,backlight-enable-gpios", 0,
+                                  &config->backlight_en, GPIOD_IS_OUT);
+       gpio_request_by_name_nodev(blob, display_node,
+                                  "nvidia,lvds-shutdown-gpios", 0,
+                                  &config->lvds_shutdown, GPIOD_IS_OUT);
+       gpio_request_by_name_nodev(blob, display_node,
+                                  "nvidia,backlight-vdd-gpios", 0,
+                                  &config->backlight_vdd, GPIOD_IS_OUT);
+       gpio_request_by_name_nodev(blob, display_node,
+                                  "nvidia,panel-vdd-gpios", 0,
+                                  &config->panel_vdd, GPIOD_IS_OUT);
 
        return fdtdec_get_int_array(blob, display_node, "nvidia,panel-timings",
                        config->panel_timings, FDT_LCD_TIMINGS);
@@ -196,36 +200,18 @@ static int handle_stage(const void *blob)
                 */
 
                funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT);
-
-               fdtdec_setup_gpio(&config.panel_vdd);
-               fdtdec_setup_gpio(&config.lvds_shutdown);
-               fdtdec_setup_gpio(&config.backlight_vdd);
-               fdtdec_setup_gpio(&config.backlight_en);
-
-               /*
-                * TODO: If fdt includes output flag we can omit this code
-                * since fdtdec_setup_gpio will do it for us.
-                */
-               if (fdt_gpio_isvalid(&config.panel_vdd))
-                       gpio_direction_output(config.panel_vdd.gpio, 0);
-               if (fdt_gpio_isvalid(&config.lvds_shutdown))
-                       gpio_direction_output(config.lvds_shutdown.gpio, 0);
-               if (fdt_gpio_isvalid(&config.backlight_vdd))
-                       gpio_direction_output(config.backlight_vdd.gpio, 0);
-               if (fdt_gpio_isvalid(&config.backlight_en))
-                       gpio_direction_output(config.backlight_en.gpio, 0);
                break;
        case STAGE_PANEL_VDD:
-               if (fdt_gpio_isvalid(&config.panel_vdd))
-                       gpio_direction_output(config.panel_vdd.gpio, 1);
+               if (dm_gpio_is_valid(&config.panel_vdd))
+                       dm_gpio_set_value(&config.panel_vdd, 1);
                break;
        case STAGE_LVDS:
-               if (fdt_gpio_isvalid(&config.lvds_shutdown))
-                       gpio_set_value(config.lvds_shutdown.gpio, 1);
+               if (dm_gpio_is_valid(&config.lvds_shutdown))
+                       dm_gpio_set_value(&config.lvds_shutdown, 1);
                break;
        case STAGE_BACKLIGHT_VDD:
-               if (fdt_gpio_isvalid(&config.backlight_vdd))
-                       gpio_set_value(config.backlight_vdd.gpio, 1);
+               if (dm_gpio_is_valid(&config.backlight_vdd))
+                       dm_gpio_set_value(&config.backlight_vdd, 1);
                break;
        case STAGE_PWM:
                /* Enable PWM at 15/16 high, 32768 Hz with divider 1 */
@@ -235,8 +221,8 @@ static int handle_stage(const void *blob)
                pwm_enable(config.pwm_channel, 32768, 0xdf, 1);
                break;
        case STAGE_BACKLIGHT_EN:
-               if (fdt_gpio_isvalid(&config.backlight_en))
-                       gpio_set_value(config.backlight_en.gpio, 1);
+               if (dm_gpio_is_valid(&config.backlight_en))
+                       dm_gpio_set_value(&config.backlight_en, 1);
                break;
        case STAGE_DONE:
                break;
diff --git a/drivers/video/vesa_fb.c b/drivers/video/vesa_fb.c
new file mode 100644 (file)
index 0000000..3dacafd
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ *
+ * Vesa frame buffer driver for x86
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <pci_rom.h>
+#include <video_fb.h>
+#include <vbe.h>
+
+/*
+ * The Graphic Device
+ */
+GraphicDevice ctfb;
+
+/* Devices to allow - only the last one works fully */
+struct pci_device_id vesa_video_ids[] = {
+       { .vendor = 0x102b, .device = 0x0525 },
+       { .vendor = 0x1002, .device = 0x5159 },
+       { .vendor = 0x1002, .device = 0x4752 },
+       { .vendor = 0x1002, .device = 0x5452 },
+       {},
+};
+
+void *video_hw_init(void)
+{
+       GraphicDevice *gdev = &ctfb;
+       int bits_per_pixel;
+       pci_dev_t dev;
+       int ret;
+
+       printf("Video: ");
+       if (vbe_get_video_info(gdev)) {
+               /* TODO: Should we look these up by class? */
+               dev = pci_find_devices(vesa_video_ids, 0);
+               if (dev == -1) {
+                       printf("no card detected\n");
+                       return NULL;
+               }
+               printf("bdf %x\n", dev);
+               ret = pci_run_vga_bios(dev, NULL, true);
+               if (ret) {
+                       printf("failed to run video BIOS: %d\n", ret);
+                       return NULL;
+               }
+       }
+
+       if (vbe_get_video_info(gdev)) {
+               printf("No video mode configured\n");
+               return NULL;
+       }
+
+       bits_per_pixel = gdev->gdfBytesPP * 8;
+       sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
+               bits_per_pixel);
+       printf("%s\n", gdev->modeIdent);
+       debug("Framex buffer at %x\n", gdev->pciBase);
+
+       return (void *)gdev;
+}
diff --git a/drivers/video/x86_fb.c b/drivers/video/x86_fb.c
deleted file mode 100644 (file)
index 6641033..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Vesa frame buffer driver for x86
- *
- * Copyright (C) 2014 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <video_fb.h>
-#include <vbe.h>
-#include "videomodes.h"
-
-/*
- * The Graphic Device
- */
-GraphicDevice ctfb;
-
-void *video_hw_init(void)
-{
-       GraphicDevice *gdev = &ctfb;
-       int bits_per_pixel;
-
-       printf("Video: ");
-       if (vbe_get_video_info(gdev)) {
-               printf("No video mode configured\n");
-               return NULL;
-       }
-
-       bits_per_pixel = gdev->gdfBytesPP * 8;
-       sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
-               bits_per_pixel);
-       printf("%s\n", gdev->modeIdent);
-       debug("Frame buffer at %x\n", gdev->frameAdrs);
-
-       return (void *)gdev;
-}
index 0bf690e73d157fffa65d423060227aced9865fe3..920a0a9cf3b4ae96c2ba3aa21394dde4fd50318b 100644 (file)
@@ -2,6 +2,8 @@
 #include <exports.h>
 #include <linux/compiler.h>
 
+#define FO(x) offsetof(struct jt_funcs, x)
+
 #if defined(CONFIG_X86)
 /*
  * x86 does not have a dedicated register to store the pointer to
  * from flash memory. The global_data address is passed as argv[-1]
  * to the application program.
  */
-static void **jt;
+static struct jt_funcs *jt;
 gd_t *global_data;
 
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
 "      movl    %0, %%eax\n"            \
 "      movl    jt, %%ecx\n"            \
 "      jmp     *(%%ecx, %%eax)\n"      \
-       : : "i"(XF_ ## x * sizeof(void *)) : "eax", "ecx");
+       : : "i"(FO(x)) : "eax", "ecx");
 #elif defined(CONFIG_PPC)
 /*
  * r2 holds the pointer to the global_data, r11 is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
@@ -34,33 +36,33 @@ gd_t *global_data;
 "      lwz     %%r11, %1(%%r11)\n"     \
 "      mtctr   %%r11\n"                \
 "      bctr\n"                         \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r11");
 #elif defined(CONFIG_ARM)
 #ifdef CONFIG_ARM64
 /*
  * x18 holds the pointer to the global_data, x9 is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
 "      ldr     x9, [x18, %0]\n"                \
 "      ldr     x9, [x9, %1]\n"         \
 "      br      x9\n"           \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "x9");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "x9");
 #else
 /*
  * r9 holds the pointer to the global_data, ip is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
 "      ldr     ip, [r9, %0]\n"         \
 "      ldr     pc, [ip, %1]\n"         \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "ip");
 #endif
 #elif defined(CONFIG_MIPS)
 /*
@@ -70,19 +72,19 @@ gd_t *global_data;
  * it; however, GCC/mips generates an additional `nop' after each asm
  * statement
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
 "      lw      $25, %0($26)\n"         \
 "      lw      $25, %1($25)\n"         \
 "      jr      $25\n"                  \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "t9");
 #elif defined(CONFIG_NIOS2)
 /*
  * gp holds the pointer to the global_data, r8 is call-clobbered
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
@@ -92,13 +94,13 @@ gd_t *global_data;
 "      ldw     r8, 0(r8)\n"            \
 "      ldw     r8, %1(r8)\n"           \
 "      jmp     r8\n"                   \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "gp");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "gp");
 #elif defined(CONFIG_M68K)
 /*
  * d7 holds the pointer to the global_data, a0 is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
@@ -108,50 +110,50 @@ gd_t *global_data;
 "      adda.l  %1, %%a0\n"             \
 "      move.l  (%%a0), %%a0\n"         \
 "      jmp     (%%a0)\n"                       \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "a0");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "a0");
 #elif defined(CONFIG_MICROBLAZE)
 /*
  * r31 holds the pointer to the global_data. r5 is a call-clobbered.
  */
-#define EXPORT_FUNC(x)                         \
+#define EXPORT_FUNC(f, a, x, ...)                              \
        asm volatile (                          \
 "      .globl " #x "\n"                        \
 #x ":\n"                                       \
 "      lwi     r5, r31, %0\n"                  \
 "      lwi     r5, r5, %1\n"                   \
 "      bra     r5\n"                           \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r5");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r5");
 #elif defined(CONFIG_BLACKFIN)
 /*
  * P3 holds the pointer to the global_data, P0 is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x)                 \
+#define EXPORT_FUNC(f, a, x, ...)                      \
        asm volatile (                  \
 "      .globl _" #x "\n_"              \
 #x ":\n"                               \
 "      P0 = [P3 + %0]\n"               \
 "      P0 = [P0 + %1]\n"               \
 "      JUMP (P0)\n"                    \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "P0");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "P0");
 #elif defined(CONFIG_AVR32)
 /*
  * r6 holds the pointer to the global_data. r8 is call clobbered.
  */
-#define EXPORT_FUNC(x)                                 \
+#define EXPORT_FUNC(f, a, x, ...)                                      \
        asm volatile(                                   \
                "       .globl\t" #x "\n"               \
                #x ":\n"                                \
                "       ld.w    r8, r6[%0]\n"           \
                "       ld.w    pc, r8[%1]\n"           \
                :                                       \
-               : "i"(offsetof(gd_t, jt)), "i"(XF_ ##x) \
+               : "i"(offsetof(gd_t, jt)), "i"(FO(x))   \
                : "r8");
 #elif defined(CONFIG_SH)
 /*
  * r13 holds the pointer to the global_data. r1 is a call clobbered.
  */
-#define EXPORT_FUNC(x)                                 \
+#define EXPORT_FUNC(f, a, x, ...)                                      \
        asm volatile (                                  \
                "       .align  2\n"                    \
                "       .globl " #x "\n"                \
@@ -164,12 +166,12 @@ gd_t *global_data;
                "       jmp     @r1\n"                  \
                "       nop\n"                          \
                "       nop\n"                          \
-               : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r1", "r2");
+               : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r1", "r2");
 #elif defined(CONFIG_SPARC)
 /*
  * g7 holds the pointer to the global_data. g1 is call clobbered.
  */
-#define EXPORT_FUNC(x)                                 \
+#define EXPORT_FUNC(f, a, x, ...)                                      \
        asm volatile(                                   \
 "      .globl\t" #x "\n"                               \
 #x ":\n"                                               \
@@ -179,26 +181,26 @@ gd_t *global_data;
 "      ld [%%g1 + %1], %%g1\n"                         \
 "      jmp %%g1\n"                                     \
 "      nop\n"                                          \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "g1");
 #elif defined(CONFIG_NDS32)
 /*
  * r16 holds the pointer to the global_data. gp is call clobbered.
  * not support reduced register (16 GPR).
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
 "      lwi     $r16, [$gp + (%0)]\n"   \
 "      lwi     $r16, [$r16 + (%1)]\n"  \
 "      jr      $r16\n"                 \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "$r16");
 #elif defined(CONFIG_OPENRISC)
 /*
  * r10 holds the pointer to the global_data, r13 is a call-clobbered
  * register
  */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
@@ -206,12 +208,12 @@ gd_t *global_data;
 "      l.lwz   r13, %1(r13)\n" \
 "      l.jr    r13\n"          \
 "      l.nop\n"                                \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r13");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r13");
 #elif defined(CONFIG_ARC)
 /*
  * r25 holds the pointer to the global_data. r10 is call clobbered.
   */
-#define EXPORT_FUNC(x) \
+#define EXPORT_FUNC(f, a, x, ...) \
        asm volatile( \
 "      .align 4\n" \
 "      .globl " #x "\n" \
@@ -219,7 +221,7 @@ gd_t *global_data;
 "      ld      r10, [r25, %0]\n" \
 "      ld      r10, [r10, %1]\n" \
 "      j       [r10]\n" \
-       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r10");
+       : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r10");
 #else
 /*"    addi    $sp, $sp, -24\n"        \
 "      br      $r16\n"                 \*/
diff --git a/fs/fs.c b/fs/fs.c
index ddd751c9cccc1d4c30ed6d29bf1d55581e208ab7..483273fe20b8212075f74526cb86aa2ae3e36988 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -79,6 +79,7 @@ static inline int fs_uuid_unsupported(char *uuid_str)
 
 struct fstype_info {
        int fstype;
+       char *name;
        /*
         * Is it legal to pass NULL as .probe()'s  fs_dev_desc parameter? This
         * should be false in most cases. For "virtual" filesystems which
@@ -105,6 +106,7 @@ static struct fstype_info fstypes[] = {
 #ifdef CONFIG_FS_FAT
        {
                .fstype = FS_TYPE_FAT,
+               .name = "fat",
                .null_dev_desc_ok = false,
                .probe = fat_set_blk_dev,
                .close = fat_close,
@@ -123,6 +125,7 @@ static struct fstype_info fstypes[] = {
 #ifdef CONFIG_FS_EXT4
        {
                .fstype = FS_TYPE_EXT,
+               .name = "ext4",
                .null_dev_desc_ok = false,
                .probe = ext4fs_probe,
                .close = ext4fs_close,
@@ -141,6 +144,7 @@ static struct fstype_info fstypes[] = {
 #ifdef CONFIG_SANDBOX
        {
                .fstype = FS_TYPE_SANDBOX,
+               .name = "sandbox",
                .null_dev_desc_ok = true,
                .probe = sandbox_fs_set_blk_dev,
                .close = sandbox_fs_close,
@@ -154,6 +158,7 @@ static struct fstype_info fstypes[] = {
 #endif
        {
                .fstype = FS_TYPE_ANY,
+               .name = "unsupported",
                .null_dev_desc_ok = true,
                .probe = fs_probe_unsupported,
                .close = fs_close_unsupported,
@@ -190,6 +195,7 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
        if (!relocated) {
                for (i = 0, info = fstypes; i < ARRAY_SIZE(fstypes);
                                i++, info++) {
+                       info->name += gd->reloc_off;
                        info->probe += gd->reloc_off;
                        info->close += gd->reloc_off;
                        info->ls += gd->reloc_off;
@@ -503,3 +509,24 @@ int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 
        return CMD_RET_SUCCESS;
 }
+
+int do_fs_type(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       struct fstype_info *info;
+
+       if (argc < 3 || argc > 4)
+               return CMD_RET_USAGE;
+
+       if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_ANY))
+               return 1;
+
+       info = fs_get_info(fs_type);
+
+       if (argc == 4)
+               setenv(argv[3], info->name);
+       else
+               printf("%s\n", info->name);
+
+       return CMD_RET_SUCCESS;
+}
+
diff --git a/include/74xx_7xx.h b/include/74xx_7xx.h
deleted file mode 100644 (file)
index 3deeeea..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber, Mission Critical Linux, Inc. <huber@mclx.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * 74xx_7xx.h
- *
- * 74xx/7xx specific definitions
- */
-
-#ifndef __MPC74XX_H__
-#define __MPC74XX_H__
-
-/*----------------------------------------------------------------
- * Exception offsets (PowerPC standard)
- */
-#define EXC_OFF_SYS_RESET        0x0100      /* default system reset offset */
-#define _START_OFFSET          EXC_OFF_SYS_RESET
-
-/*----------------------------------------------------------------
- * l2cr values
- */
-#define l2cr            1017
-
-#define L2CR_L2E         0x80000000 /* bit 0 - enable */
-#define L2CR_L2PE        0x40000000 /* bit 1 - data parity */
-#define L2CR_L2SIZ_2M    0x00000000 /* bits 2-3 - 2MB, MPC7400 only! */
-#define L2CR_L2SIZ_1M    0x30000000 /* ... 1MB */
-#define L2CR_L2SIZ_HM    0x20000000 /* ... 512K */
-#define L2CR_L2SIZ_QM    0x10000000 /* ... 256k */
-#define L2CR_L2CLK_1     0x02000000 /* bits 4-6 clock ratio div 1 */
-#define L2CR_L2CLK_1_5   0x04000000 /* bits 4-6 clock ratio div 1.5 */
-#define L2CR_L2CLK_2     0x08000000 /* bits 4-6 clock ratio div 2 */
-#define L2CR_L2CLK_2_5   0x0a000000 /* bits 4-6 clock ratio div 2.5 */
-#define L2CR_L2CLK_3     0x0c000000 /* bits 4-6 clock ratio div 3 */
-#define L2CR_L2CLK_3_5   0x06000000 /* bits 4-6 clock ratio div 3.5 */
-#define L2CR_L2CLK_4     0x0e000000 /* bits 4-6 clock ratio div 4 */
-#define L2CR_L2RAM_BURST 0x01000000 /* bits 7-8 - burst SRAM */
-#define L2CR_DO          0x00400000 /* bit 9 - enable caching of instr. in L2 */
-#define L2CR_L2I         0x00200000 /* bit 10 - global invalidate bit */
-#define L2CR_L2CTL       0x00100000 /* bit 11 - l2 ram control */
-#define L2CR_L2WT        0x00080000 /* bit 12 - l2 write-through */
-#define L2CR_TS          0x00040000 /* bit 13 - test support on */
-#define L2CR_TS_OFF      -L2CR_TS   /* bit 13 - test support off */
-#define L2CR_L2OH_5      0x00000000 /* bits 14-15 - output hold time = short */
-#define L2CR_L2OH_1      0x00010000 /* bits 14-15 - output hold time = medium */
-#define L2CR_L2OH_INV    0x00020000 /* bits 14-15 - output hold time = long */
-#define L2CR_L2IP        0x00000001 /* global invalidate in progress */
-
-#ifndef __ASSEMBLY__
-/* cpu ids we detect */
-typedef enum __cpu_t {
-       CPU_740, CPU_750,
-       CPU_740P, CPU_750P,
-       CPU_745, CPU_755,
-       CPU_750CX, CPU_750FX, CPU_750GX,
-       CPU_7400,
-       CPU_7410,
-       CPU_7447A, CPU_7448,
-       CPU_7450, CPU_7455, CPU_7457,
-       CPU_UNKNOWN} cpu_t;
-
-extern cpu_t get_cpu_type(void);
-
-#define l1icache_enable        icache_enable
-
-void l2cache_enable(void);
-void l1dcache_enable(void);
-
-static __inline__ unsigned long get_msr (void)
-{
-       unsigned long msr;
-       asm volatile("mfmsr %0" : "=r" (msr) :);
-       return msr;
-}
-
-static __inline__ void set_msr (unsigned long msr)
-{
-       asm volatile("mtmsr %0" : : "r" (msr));
-}
-
-static __inline__ unsigned long get_hid0 (void)
-{
-       unsigned long hid0;
-       asm volatile("mfspr %0, 1008" : "=r" (hid0) :);
-       return hid0;
-}
-
-static __inline__ unsigned long get_hid1 (void)
-{
-       unsigned long hid1;
-       asm volatile("mfspr %0, 1009" : "=r" (hid1) :);
-       return hid1;
-}
-
-static __inline__ void set_hid0 (unsigned long hid0)
-{
-       asm volatile("mtspr 1008, %0" : : "r" (hid0));
-}
-
-static __inline__ void set_hid1 (unsigned long hid1)
-{
-       asm volatile("mtspr 1009, %0" : : "r" (hid1));
-}
-
-#endif /* __ASSEMBLY__ */
-#endif  /* __MPC74XX_H__ */
index 349a3c5522ff876f5fba77731a53a56a15371e84..594470328ea8a7aca5b83e359457410806eaf2c3 100644 (file)
@@ -1,32 +1,73 @@
 /*
- * You do not need to use #ifdef around functions that may not exist
+ * You need to use #ifdef around functions that may not exist
  * in the final configuration (such as i2c).
+ * use a dummyfunction as first parameter to EXPORT_FUNC.
+ * As an example see the CONFIG_CMD_I2C section below
  */
-EXPORT_FUNC(get_version)
-EXPORT_FUNC(getc)
-EXPORT_FUNC(tstc)
-EXPORT_FUNC(putc)
-EXPORT_FUNC(puts)
-EXPORT_FUNC(printf)
-EXPORT_FUNC(install_hdlr)
-EXPORT_FUNC(free_hdlr)
-EXPORT_FUNC(malloc)
-EXPORT_FUNC(free)
-EXPORT_FUNC(udelay)
-EXPORT_FUNC(get_timer)
-EXPORT_FUNC(vprintf)
-EXPORT_FUNC(do_reset)
-EXPORT_FUNC(getenv)
-EXPORT_FUNC(setenv)
-EXPORT_FUNC(simple_strtoul)
-EXPORT_FUNC(strict_strtoul)
-EXPORT_FUNC(simple_strtol)
-EXPORT_FUNC(strcmp)
-EXPORT_FUNC(i2c_write)
-EXPORT_FUNC(i2c_read)
-EXPORT_FUNC(spi_init)
-EXPORT_FUNC(spi_setup_slave)
-EXPORT_FUNC(spi_free_slave)
-EXPORT_FUNC(spi_claim_bus)
-EXPORT_FUNC(spi_release_bus)
-EXPORT_FUNC(spi_xfer)
+#ifndef EXPORT_FUNC
+#define EXPORT_FUNC(a, b, c, ...)
+#endif
+       EXPORT_FUNC(get_version, unsigned long, get_version, void)
+       EXPORT_FUNC(getc, int, getc, void)
+       EXPORT_FUNC(tstc, int, tstc, void)
+       EXPORT_FUNC(putc, void, putc, const char)
+       EXPORT_FUNC(puts, void, puts, const char *)
+       EXPORT_FUNC(printf, int, printf, const char*, ...)
+#if defined(CONFIG_X86) || defined(CONFIG_PPC)
+       EXPORT_FUNC(irq_install_handler, void, install_hdlr,
+                   int, interrupt_handler_t, void*)
+
+       EXPORT_FUNC(irq_free_handler, void, free_hdlr, int)
+#else
+       EXPORT_FUNC(dummy, void, install_hdlr, void)
+       EXPORT_FUNC(dummy, void, free_hdlr, void)
+#endif
+       EXPORT_FUNC(malloc, void *, malloc, size_t)
+       EXPORT_FUNC(free, void, free, void *)
+       EXPORT_FUNC(udelay, void, udelay, unsigned long)
+       EXPORT_FUNC(get_timer, unsigned long, get_timer, unsigned long)
+       EXPORT_FUNC(vprintf, int, vprintf, const char *, va_list)
+       EXPORT_FUNC(do_reset, int, do_reset, cmd_tbl_t *,
+                   int , int , char * const [])
+       EXPORT_FUNC(getenv, char  *, getenv, const char*)
+       EXPORT_FUNC(setenv, int, setenv, const char *, const char *)
+       EXPORT_FUNC(simple_strtoul, unsigned long, simple_strtoul,
+                   const char *, char **, unsigned int)
+       EXPORT_FUNC(strict_strtoul, int, strict_strtoul,
+                   const char *, unsigned int , unsigned long *)
+       EXPORT_FUNC(simple_strtol, long, simple_strtol,
+                   const char *, char **, unsigned int)
+       EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct)
+#if defined(CONFIG_CMD_I2C) && \
+               (!defined(CONFIG_DM_I2C) || defined(CONFIG_DM_I2C_COMPAT))
+       EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int)
+       EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int)
+#else
+       EXPORT_FUNC(dummy, void, i2c_write, void)
+       EXPORT_FUNC(dummy, void, i2c_read, void)
+#endif
+
+#if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI)
+       EXPORT_FUNC(dummy, void, spi_init, void)
+       EXPORT_FUNC(dummy, void, spi_setup_slave, void)
+       EXPORT_FUNC(dummy, void, spi_free_slave, void)
+#else
+       EXPORT_FUNC(spi_init, void, spi_init, void)
+       EXPORT_FUNC(spi_setup_slave, struct spi_slave *, spi_setup_slave,
+                   unsigned int, unsigned int, unsigned int, unsigned int)
+       EXPORT_FUNC(spi_free_slave, void, spi_free_slave, struct spi_slave *)
+#endif
+#ifndef CONFIG_CMD_SPI
+       EXPORT_FUNC(dummy, void, spi_claim_bus, void)
+       EXPORT_FUNC(dummy, void, spi_release_bus, void)
+       EXPORT_FUNC(dummy, void, spi_xfer, void)
+#else
+       EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *)
+       EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *)
+       EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *,
+                   unsigned int, const void *, void *, unsigned long)
+#endif
+       EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul,
+                   const char *, char **, unsigned int)
+       EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull,
+                   const char *, char **, unsigned int)
index 3d14d5f11746680256ffbfb053da8d4c2bbcb3d6..6747619b1c7868ce946660619e4bbe694bcae577 100644 (file)
@@ -73,7 +73,7 @@ typedef struct global_data {
        const void *fdt_blob;   /* Our device tree, NULL if none */
        void *new_fdt;          /* Relocated FDT */
        unsigned long fdt_size; /* Space reserved for relocated FDT */
-       void **jt;              /* jump table */
+       struct jt_funcs *jt;            /* jump table */
        char env_buf[32];       /* buffer for getenv() before reloc. */
 #ifdef CONFIG_TRACE
        void            *trace_buff;    /* The trace buffer */
index 36a36c64b8a6a19879e5236eb85af2fd5960a43d..3b96b8209a10b09d2cdcdf1f559c5fa2787831d7 100644 (file)
 /*
  * Generic GPIO API for U-Boot
  *
+ * --
+ * NB: This is deprecated. Please use the driver model functions instead:
+ *
+ *    - gpio_request_by_name()
+ *    - dm_gpio_get_value() etc.
+ *
+ * For now we need a dm_ prefix on some functions to avoid name collision.
+ * --
+ *
  * GPIOs are numbered from 0 to GPIO_COUNT-1 which value is defined
  * by the SOC/architecture.
  *
@@ -26,6 +35,7 @@
  */
 
 /**
+ * @deprecated Please use driver model instead
  * Request a GPIO. This should be called before any of the other functions
  * are used on this GPIO.
  *
@@ -39,6 +49,7 @@
 int gpio_request(unsigned gpio, const char *label);
 
 /**
+ * @deprecated Please use driver model instead
  * Stop using the GPIO.  This function should not alter pin configuration.
  *
  * @param gpio GPIO number
@@ -47,6 +58,7 @@ int gpio_request(unsigned gpio, const char *label);
 int gpio_free(unsigned gpio);
 
 /**
+ * @deprecated Please use driver model instead
  * Make a GPIO an input.
  *
  * @param gpio GPIO number
@@ -55,6 +67,7 @@ int gpio_free(unsigned gpio);
 int gpio_direction_input(unsigned gpio);
 
 /**
+ * @deprecated Please use driver model instead
  * Make a GPIO an output, and set its value.
  *
  * @param gpio GPIO number
@@ -64,6 +77,7 @@ int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 
 /**
+ * @deprecated Please use driver model instead
  * Get a GPIO's value. This will work whether the GPIO is an input
  * or an output.
  *
@@ -73,6 +87,7 @@ int gpio_direction_output(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
 
 /**
+ * @deprecated Please use driver model instead
  * Set an output GPIO's value. The GPIO must already be an output or
  * this function may have no effect.
  *
@@ -95,6 +110,34 @@ enum gpio_func_t {
 
 struct udevice;
 
+struct gpio_desc {
+       struct udevice *dev;    /* Device, NULL for invalid GPIO */
+       unsigned long flags;
+#define GPIOD_REQUESTED                (1 << 0)        /* Requested/claimed */
+#define GPIOD_IS_OUT           (1 << 1)        /* GPIO is an output */
+#define GPIOD_IS_IN            (1 << 2)        /* GPIO is an output */
+#define GPIOD_ACTIVE_LOW       (1 << 3)        /* value has active low */
+#define GPIOD_IS_OUT_ACTIVE    (1 << 4)        /* set output active */
+
+       uint offset;            /* GPIO offset within the device */
+       /*
+        * We could consider adding the GPIO label in here. Possibly we could
+        * use this structure for internal GPIO information.
+        */
+};
+
+/**
+ * dm_gpio_is_valid() - Check if a GPIO is gpio_is_valie
+ *
+ * @desc:      GPIO description containing device, offset and flags,
+ *             previously returned by gpio_request_by_name()
+ * @return true if valid, false if not
+ */
+static inline bool dm_gpio_is_valid(struct gpio_desc *desc)
+{
+       return desc->dev != NULL;
+}
+
 /**
  * gpio_get_status() - get the current GPIO status as a string
  *
@@ -106,6 +149,8 @@ struct udevice;
  * which means this is GPIO bank b, offset 4, currently set to input, current
  * value 1, [x] means that it is requested and the owner is 'sdmmc_cd'
  *
+ * TODO(sjg@chromium.org): This should use struct gpio_desc
+ *
  * @dev:       Device to check
  * @offset:    Offset of device GPIO to check
  * @buf:       Place to put string
@@ -118,6 +163,8 @@ int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize);
  *
  * Note this returns GPIOF_UNUSED if the GPIO is not requested.
  *
+ * TODO(sjg@chromium.org): This should use struct gpio_desc
+ *
  * @dev:       Device to check
  * @offset:    Offset of device GPIO to check
  * @namep:     If non-NULL, this is set to the nane given when the GPIO
@@ -135,6 +182,8 @@ int gpio_get_function(struct udevice *dev, int offset, const char **namep);
  * Note this does not return GPIOF_UNUSED - it will always return the GPIO
  * driver's view of a pin function, even if it is not correctly set up.
  *
+ * TODO(sjg@chromium.org): This should use struct gpio_desc
+ *
  * @dev:       Device to check
  * @offset:    Offset of device GPIO to check
  * @namep:     If non-NULL, this is set to the nane given when the GPIO
@@ -155,6 +204,8 @@ int gpio_get_raw_function(struct udevice *dev, int offset, const char **namep);
 int gpio_requestf(unsigned gpio, const char *fmt, ...)
                __attribute__ ((format (__printf__, 2, 3)));
 
+struct fdtdec_phandle_args;
+
 /**
  * struct struct dm_gpio_ops - Driver model GPIO operations
  *
@@ -198,6 +249,33 @@ struct dm_gpio_ops {
         * @return current function - GPIOF_...
         */
        int (*get_function)(struct udevice *dev, unsigned offset);
+
+       /**
+        * xlate() - Translate phandle arguments into a GPIO description
+        *
+        * This function should set up the fields in desc according to the
+        * information in the arguments. The uclass will have set up:
+        *
+        *   @desc->dev to @dev
+        *   @desc->flags to 0
+        *   @desc->offset to the value of the first argument in args, if any,
+        *              otherwise -1 (which is invalid)
+        *
+        * This method is optional so if the above defaults suit it can be
+        * omitted. Typical behaviour is to set up the GPIOD_ACTIVE_LOW flag
+        * in desc->flags.
+        *
+        * Note that @dev is passed in as a parameter to follow driver model
+        * uclass conventions, even though it is already available as
+        * desc->dev.
+        *
+        * @dev:        GPIO device
+        * @desc:       Place to put GPIO description
+        * @args:       Arguments provided in descripion
+        * @return 0 if OK, -ve on error
+        */
+       int (*xlate)(struct udevice *dev, struct gpio_desc *desc,
+                    struct fdtdec_phandle_args *args);
 };
 
 /**
@@ -268,4 +346,191 @@ int gpio_lookup_name(const char *name, struct udevice **devp,
  */
 unsigned gpio_get_values_as_int(const int *gpio_list);
 
+/**
+ * gpio_request_by_name() - Locate and request a GPIO by name
+ *
+ * This operates by looking up the given list name in the device (device
+ * tree property) and requesting the GPIO for use. The property must exist
+ * in @dev's node.
+ *
+ * Use @flags to specify whether the GPIO should be an input or output. In
+ * principle this can also come from the device tree binding but most
+ * bindings don't provide this information. Specifically, when the GPIO uclass
+ * calls the xlate() method, it can return default flags, which are then
+ * ORed with this @flags.
+ *
+ * If we find that requesting the GPIO is not always needed we could add a
+ * new function or a new GPIOD_NO_REQUEST flag.
+ *
+ * At present driver model has no reference counting so if one device
+ * requests a GPIO which subsequently is unbound, the @desc->dev pointer
+ * will be invalid. However this will only happen if the GPIO device is
+ * unbound, not if it is removed, so this seems like a reasonable limitation
+ * for now. There is no real use case for unbinding drivers in normal
+ * operation.
+ *
+ * The device tree binding is doc/device-tree-bindings/gpio/gpio.txt in
+ * generate terms and each specific device may add additional details in
+ * a binding file in the same directory.
+ *
+ * @dev:       Device requesting the GPIO
+ * @list_name: Name of GPIO list (e.g. "board-id-gpios")
+ * @index:     Index number of the GPIO in that list use request (0=first)
+ * @desc:      Returns GPIO description information. If there is no such
+ *             GPIO, dev->dev will be NULL.
+ * @flags:     Indicates the GPIO input/output settings (GPIOD_...)
+ * @return 0 if OK, -ENOENT if the GPIO does not exist, -EINVAL if there is
+ * something wrong with the list, or other -ve for another error (e.g.
+ * -EBUSY if a GPIO was already requested)
+ */
+int gpio_request_by_name(struct udevice *dev, const char *list_name,
+                        int index, struct gpio_desc *desc, int flags);
+
+/**
+ * gpio_request_list_by_name() - Request a list of GPIOs
+ *
+ * Reads all the GPIOs from a list and requetss them. See
+ * gpio_request_by_name() for additional details. Lists should not be
+ * misused to hold unrelated or optional GPIOs. They should only be used
+ * for things like parallel data lines. A zero phandle terminates the list
+ * the list.
+ *
+ * This function will either succeed, and request all GPIOs in the list, or
+ * fail and request none (it will free already-requested GPIOs in case of
+ * an error part-way through).
+ *
+ * @dev:       Device requesting the GPIO
+ * @list_name: Name of GPIO list (e.g. "board-id-gpios")
+ * @desc_list: Returns a list of GPIO description information
+ * @max_count: Maximum number of GPIOs to return (@desc_list must be at least
+ *             this big)
+ * @flags:     Indicates the GPIO input/output settings (GPIOD_...)
+ * @return number of GPIOs requested, or -ve on error
+ */
+int gpio_request_list_by_name(struct udevice *dev, const char *list_name,
+                             struct gpio_desc *desc_list, int max_count,
+                             int flags);
+
+/**
+ * gpio_get_list_count() - Returns the number of GPIOs in a list
+ *
+ * Counts the GPIOs in a list. See gpio_request_by_name() for additional
+ * details.
+ *
+ * @dev:       Device requesting the GPIO
+ * @list_name: Name of GPIO list (e.g. "board-id-gpios")
+ * @return number of GPIOs (0 for an empty property) or -ENOENT if the list
+ * does not exist
+ */
+int gpio_get_list_count(struct udevice *dev, const char *list_name);
+
+/**
+ * gpio_request_by_name_nodev() - request GPIOs without a device
+ *
+ * This is a version of gpio_request_list_by_name() that does not use a
+ * device. Avoid it unless the caller is not yet using driver model
+ */
+int gpio_request_by_name_nodev(const void *blob, int node,
+                              const char *list_name,
+                              int index, struct gpio_desc *desc, int flags);
+
+/**
+ * gpio_request_list_by_name_nodev() - request GPIOs without a device
+ *
+ * This is a version of gpio_request_list_by_name() that does not use a
+ * device. Avoid it unless the caller is not yet using driver model
+ */
+int gpio_request_list_by_name_nodev(const void *blob, int node,
+                                   const char *list_name,
+                                   struct gpio_desc *desc_list, int max_count,
+                                   int flags);
+
+/**
+ * dm_gpio_free() - Free a single GPIO
+ *
+ * This frees a single GPIOs previously returned from gpio_request_by_name().
+ *
+ * @dev:       Device which requested the GPIO
+ * @desc:      GPIO to free
+ * @return 0 if OK, -ve on error
+ */
+int dm_gpio_free(struct udevice *dev, struct gpio_desc *desc);
+
+/**
+ * gpio_free_list() - Free a list of GPIOs
+ *
+ * This frees a list of GPIOs previously returned from
+ * gpio_request_list_by_name().
+ *
+ * @dev:       Device which requested the GPIOs
+ * @desc:      List of GPIOs to free
+ * @count:     Number of GPIOs in the list
+ * @return 0 if OK, -ve on error
+ */
+int gpio_free_list(struct udevice *dev, struct gpio_desc *desc, int count);
+
+/**
+ * gpio_free_list_nodev() - free GPIOs without a device
+ *
+ * This is a version of gpio_free_list() that does not use a
+ * device. Avoid it unless the caller is not yet using driver model
+ */
+int gpio_free_list_nodev(struct gpio_desc *desc, int count);
+
+/**
+ * dm_gpio_get_value() - Get the value of a GPIO
+ *
+ * This is the driver model version of the existing gpio_get_value() function
+ * and should be used instead of that.
+ *
+ * For now, these functions have a dm_ prefix since they conflict with
+ * existing names.
+ *
+ * @desc:      GPIO description containing device, offset and flags,
+ *             previously returned by gpio_request_by_name()
+ * @return GPIO value (0 for inactive, 1 for active) or -ve on error
+ */
+int dm_gpio_get_value(struct gpio_desc *desc);
+
+int dm_gpio_set_value(struct gpio_desc *desc, int value);
+
+/**
+ * dm_gpio_set_dir() - Set the direction for a GPIO
+ *
+ * This sets up the direction according tot the provided flags. It will do
+ * nothing unless the direction is actually specified.
+ *
+ * @desc:      GPIO description containing device, offset and flags,
+ *             previously returned by gpio_request_by_name()
+ * @return 0 if OK, -ve on error
+ */
+int dm_gpio_set_dir(struct gpio_desc *desc);
+
+/**
+ * dm_gpio_set_dir_flags() - Set direction using specific flags
+ *
+ * This is like dm_gpio_set_dir() except that the flags value is provided
+ * instead of being used from desc->flags. This is needed because in many
+ * cases the GPIO description does not include direction information.
+ * Note that desc->flags is updated by this function.
+ *
+ * @desc:      GPIO description containing device, offset and flags,
+ *             previously returned by gpio_request_by_name()
+ * @flags:     New flags to use
+ * @return 0 if OK, -ve on error, in which case desc->flags is not updated
+ */
+int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags);
+
+/**
+ * gpio_get_number() - Get the global GPIO number of a GPIO
+ *
+ * This should only be used for debugging or interest. It returns the nummber
+ * that should be used for gpio_get_value() etc. to access this GPIO.
+ *
+ * @desc:      GPIO description containing device, offset and flags,
+ *             previously returned by gpio_request_by_name()
+ * @return GPIO number, or -ve if not found
+ */
+int gpio_get_number(struct gpio_desc *desc);
+
 #endif /* _ASM_GENERIC_GPIO_H_ */
index e6639f1ffe694b12b9dbf79f0a7f9b57102c2185..a20e25c2f82740249c9333a7d49657d55ea2550c 100644 (file)
@@ -12,7 +12,6 @@
 
 #define AXP223_DEVICE_ADDR 0x3a3
 #define AXP223_RUNTIME_ADDR 0x2d
-#define AXP223_DEVICE_MODE_DATA 0x7c3e00
 
 /* Page 0 addresses */
 #define AXP221_CHIP_ID         0x03
@@ -26,6 +25,9 @@
 #define AXP221_OUTPUT_CTRL1_ALDO1_EN   (1 << 6)
 #define AXP221_OUTPUT_CTRL1_ALDO2_EN   (1 << 7)
 #define AXP221_OUTPUT_CTRL2    0x12
+#define AXP221_OUTPUT_CTRL2_ELDO1_EN   (1 << 0)
+#define AXP221_OUTPUT_CTRL2_ELDO2_EN   (1 << 1)
+#define AXP221_OUTPUT_CTRL2_ELDO3_EN   (1 << 2)
 #define AXP221_OUTPUT_CTRL2_DLDO1_EN   (1 << 3)
 #define AXP221_OUTPUT_CTRL2_DLDO2_EN   (1 << 4)
 #define AXP221_OUTPUT_CTRL2_DLDO3_EN   (1 << 5)
@@ -37,6 +39,9 @@
 #define AXP221_DLDO2_CTRL      0x16
 #define AXP221_DLDO3_CTRL      0x17
 #define AXP221_DLDO4_CTRL      0x18
+#define AXP221_ELDO1_CTRL      0x19
+#define AXP221_ELDO2_CTRL      0x1a
+#define AXP221_ELDO3_CTRL      0x1b
 #define AXP221_DCDC1_CTRL      0x21
 #define AXP221_DCDC2_CTRL      0x22
 #define AXP221_DCDC3_CTRL      0x23
@@ -69,6 +74,7 @@ int axp221_set_dldo4(unsigned int mvolt);
 int axp221_set_aldo1(unsigned int mvolt);
 int axp221_set_aldo2(unsigned int mvolt);
 int axp221_set_aldo3(unsigned int mvolt);
+int axp221_set_eldo(int eldo_num, unsigned int mvolt);
 int axp221_init(void);
 int axp221_get_sid(unsigned int *sid);
 int axp_drivebus_enable(void);
index 29350e45568a01ded9961062ab3319ac18a11fef..97c8f79fc7375706c07af06c752c424e196a083d 100644 (file)
@@ -228,12 +228,13 @@ int run_command_list(const char *cmd, int len, int flag);
 extern char console_buffer[];
 
 /* arch/$(ARCH)/lib/board.c */
-void   board_init_f(ulong);
-void   board_init_r  (gd_t *, ulong) __attribute__ ((noreturn));
-int    checkboard    (void);
-int    checkflash    (void);
-int    checkdram     (void);
-int    last_stage_init(void);
+void board_init_f(ulong);
+void board_init_r(gd_t *, ulong) __attribute__ ((noreturn));
+int checkboard(void);
+int show_board_info(void);
+int checkflash(void);
+int checkdram(void);
+int last_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
 extern u8 __dtb_dt_begin[];    /* embedded device tree blob */
@@ -435,13 +436,6 @@ extern ssize_t spi_read     (uchar *, int, uchar *, int);
 extern ssize_t spi_write (uchar *, int, uchar *, int);
 #endif
 
-#ifdef CONFIG_EVB64260
-void  evb64260_init(void);
-void  debug_led(int, int);
-void  display_mem_map(void);
-void  perform_soft_reset(void);
-#endif
-
 /* $(BOARD)/$(BOARD).c */
 int board_early_init_f (void);
 int board_late_init (void);
@@ -486,10 +480,6 @@ ulong      get_endaddr   (void);
 void   trap_init     (ulong);
 #if defined (CONFIG_4xx)       || \
     defined (CONFIG_MPC5xxx)   || \
-    defined (CONFIG_74xx_7xx)  || \
-    defined (CONFIG_74x)       || \
-    defined (CONFIG_75x)       || \
-    defined (CONFIG_74xx)      || \
     defined (CONFIG_MPC85xx)   || \
     defined (CONFIG_MPC86xx)   || \
     defined (CONFIG_MPC83xx)
index be616e8bfd0e0578d54c0414e29599885ada17e8..49674f4537541c6014cb2259976c21ee36dab2d3 100644 (file)
@@ -13,7 +13,7 @@
 #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \
                "if " #devtypel " dev ${devnum}; then " \
                        "setenv devtype " #devtypel "; " \
-                       "run scan_dev_for_boot; " \
+                       "run scan_dev_for_boot_part; " \
                "fi\0"
 
 #define BOOTENV_SHARED_BLKDEV(devtypel) \
 #endif
 
 #ifdef CONFIG_CMD_USB
-#define BOOTENV_RUN_USB_INIT "run usb_init; "
-#define BOOTENV_SET_USB_NEED_INIT "setenv usb_need_init; "
+#define BOOTENV_RUN_USB_INIT "usb start; "
 #define BOOTENV_SHARED_USB \
-       "usb_init=" \
-               "if ${usb_need_init}; then " \
-                       "setenv usb_need_init false; " \
-                       "usb start 0; " \
-               "fi\0" \
-       \
        "usb_boot=" \
                BOOTENV_RUN_USB_INIT \
                BOOTENV_SHARED_BLKDEV_BODY(usb)
 #define BOOTENV_DEV_NAME_USB   BOOTENV_DEV_NAME_BLKDEV
 #else
 #define BOOTENV_RUN_USB_INIT
-#define BOOTENV_SET_USB_NEED_INIT
 #define BOOTENV_SHARED_USB
 #define BOOTENV_DEV_USB \
        BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
 #define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \
        "bootcmd_dhcp=" \
                BOOTENV_RUN_USB_INIT \
-               "if dhcp ${scriptaddr} boot.scr.uimg; then " \
+               "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \
                        "source ${scriptaddr}; " \
                "fi\0"
 #define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \
        BOOTENV_SHARED_IDE \
        "boot_prefixes=/ /boot/\0" \
        "boot_scripts=boot.scr.uimg boot.scr\0" \
+       "boot_script_dhcp=boot.scr.uimg\0" \
        BOOTENV_BOOT_TARGETS \
-       "bootpart=1\0" \
        \
        "boot_extlinux="                                                  \
                "sysboot ${devtype} ${devnum}:${bootpart} any "           \
                "done\0"                                                  \
        \
        "scan_dev_for_boot="                                              \
-               "echo Scanning ${devtype} ${devnum}...; "                 \
+               "echo Scanning ${devtype} ${devnum}:${bootpart}...; "     \
                "for prefix in ${boot_prefixes}; do "                     \
                        "run scan_dev_for_extlinux; "                     \
                        "run scan_dev_for_scripts; "                      \
                "done\0"                                                  \
        \
+       "scan_dev_for_boot_part="                                         \
+               "part list ${devtype} ${devnum} devplist; "               \
+               "for bootpart in ${devplist}; do "                        \
+                       "if fstype ${devtype} ${devnum}:${bootpart} "     \
+                                       "bootfstype; then "               \
+                               "run scan_dev_for_boot; "                 \
+                       "fi; "                                            \
+               "done\0"                                                  \
+       \
        BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
        \
-       "bootcmd=" BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT   \
+       "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT                      \
                "for target in ${boot_targets}; do "                      \
                        "run bootcmd_${target}; "                         \
                "done\0"
 
+#ifndef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd"
+#endif
+
 #endif  /* _CONFIG_CMD_DISTRO_BOOTCMD_H */
index eeb0671ddb310df1c24414579200b51af395cee1..6aaaaa43f0f69d413058d5693f0186e319b10b48 100644 (file)
@@ -433,6 +433,7 @@ extern unsigned long get_sdram_size(void);
 #define CONFIG_UBOOTPATH       "u-boot.bin" /* U-Boot image on TFTP server */
 
 #define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTDELAY       10 /* -1 disable auto-boot */
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                               \
        "netdev=eth0\0"                                         \
index e8a8d299cd9d4c8d0c9e17e79ba6ff17e315406e..59a8d1b5d17dc406ba6db3dc30e621655f214a19 100644 (file)
@@ -675,6 +675,7 @@ combinations. this should be removed later
 #define CONFIG_UBOOTPATH       "u-boot.bin"
 
 #define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTDELAY       10 /* -1 disable auto-boot */
 
 #ifdef CONFIG_SDCARD
 #define CONFIG_DEF_HWCONFIG    "hwconfig=usb1:dr_mode=host,phy_type=ulpi\0"
index ecb3d7b25fd710f6ac8d4abfeb24af901987a11c..e24b9233687eef4dcccd8c3c8a842e95b25d22b2 100644 (file)
 
 #define CONFIG_BOOTCOMMAND CONFIG_RAMBOOTCOMMAND
 
+#include <asm/fsl_secure_boot.h>
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/CATcenter.h b/include/configs/CATcenter.h
deleted file mode 100644 (file)
index 27539d2..0000000
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- * ueberarbeitet durch Christoph Seyfert
- *
- * (C) Copyright 2004-2005 DENX Software Engineering,
- *     Wolfgang Grandegger <wg@denx.de>
- * (C) Copyright 2003
- *     DAVE Srl
- *
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:info@wawnet.biz
- *
- * Credits: Stefan Roese, Wolfgang Denk
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_PPCHAMELEON_MODULE_BA   0       /* Basic    Model */
-#define CONFIG_PPCHAMELEON_MODULE_ME   1       /* Medium   Model */
-#define CONFIG_PPCHAMELEON_MODULE_HI   2       /* High-End Model */
-#ifndef CONFIG_PPCHAMELEON_MODULE_MODEL
-#define CONFIG_PPCHAMELEON_MODULE_MODEL CONFIG_PPCHAMELEON_MODULE_BA
-#endif
-
-/* Only one of the following two symbols must be defined (default is 25 MHz)
- * CONFIG_PPCHAMELEON_CLK_25
- * CONFIG_PPCHAMELEON_CLK_33
- */
-#if (!defined(CONFIG_PPCHAMELEON_CLK_25) && !defined(CONFIG_PPCHAMELEON_CLK_33))
-#define CONFIG_PPCHAMELEON_CLK_25
-#endif
-
-#if (defined(CONFIG_PPCHAMELEON_CLK_25) && defined(CONFIG_PPCHAMELEON_CLK_33))
-#error "* Two external frequencies (SysClk) are defined! *"
-#endif
-
-#undef CONFIG_PPCHAMELEON_SMI712
-
-/*
- * Debug stuff
- */
-#undef __DEBUG_START_FROM_SRAM__
-#define __DISABLE_MACHINE_EXCEPTION__
-
-#ifdef __DEBUG_START_FROM_SRAM__
-#define CONFIG_SYS_DUMMY_FLASH_SIZE            1024*1024*4
-#endif
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_405EP           1       /* This is a PPC405 CPU         */
-#define CONFIG_PPCHAMELEONEVB  1       /* ...on a PPChameleonEVB board */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFFFB0000      /* Reserve 320 kB for Monitor */
-#define CONFIG_SYS_LDSCRIPT    "board/dave/PPChameleonEVB/u-boot.lds"
-
-#define CONFIG_BOARD_EARLY_INIT_F 1    /* call board_early_init_f()    */
-#define CONFIG_MISC_INIT_R     1       /* call misc_init_r()           */
-
-#ifdef CONFIG_PPCHAMELEON_CLK_25
-# define CONFIG_SYS_CLK_FREQ   25000000 /* external frequency to pll   */
-#elif (defined (CONFIG_PPCHAMELEON_CLK_33))
-#define CONFIG_SYS_CLK_FREQ    33333333 /* external frequency to pll   */
-#else
-# error "* External frequency (SysClk) not defined! *"
-#endif
-
-#define CONFIG_CONS_INDEX      2       /* Use UART1                    */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_serial_clock()
-#define CONFIG_BAUDRATE                115200
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-
-#define CONFIG_VERSION_VARIABLE        1       /* add version variable         */
-#define CONFIG_IDENT_STRING    "1"
-
-#undef CONFIG_BOOTARGS
-
-/* Ethernet stuff */
-#define CONFIG_ENV_OVERWRITE /* Let the user to change the Ethernet MAC addresses */
-#define CONFIG_ETHADDR 00:50:C2:1E:AF:FE
-#define CONFIG_HAS_ETH1
-#define CONFIG_ETH1ADDR 00:50:C2:1E:AF:FD
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change        */
-
-
-#define CONFIG_PPC4xx_EMAC
-#undef CONFIG_EXT_PHY
-
-#define CONFIG_MII             1       /* MII PHY management           */
-#ifndef         CONFIG_EXT_PHY
-#define CONFIG_PHY_ADDR                1       /* EMAC0 PHY address            */
-#define CONFIG_PHY1_ADDR       16      /* EMAC1 PHY address            */
-#else
-#define CONFIG_PHY_ADDR                2       /* PHY address                  */
-#endif
-#define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ
-
-#define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_JFFS2
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_SNTP
-
-
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
-
-#define CONFIG_RTC_MC146818            /* DS1685 is MC146818 compatible*/
-#define CONFIG_SYS_RTC_REG_BASE_ADDR    0xF0000500 /* RTC Base Address         */
-
-#define CONFIG_SDRAM_BANK0     1       /* init onboard SDRAM bank 0    */
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory         */
-
-#define        CONFIG_SYS_HUSH_PARSER                  /* use "hush" command parser    */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size      */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size      */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS     16              /* max number of command args   */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size    */
-
-#define CONFIG_SYS_DEVICE_NULLDEV      1       /* include nulldev device       */
-
-#define CONFIG_SYS_CONSOLE_INFO_QUIET  1       /* don't print console @ startup*/
-
-#define CONFIG_SYS_MEMTEST_START       0x0400000       /* memtest works on     */
-#define CONFIG_SYS_MEMTEST_END         0x0C00000       /* 4 ... 12 MB in DRAM  */
-
-#undef CONFIG_SYS_EXT_SERIAL_CLOCK             /* no external serial clock used */
-#define CONFIG_SYS_BASE_BAUD           691200
-
-/* The following table includes the supported baudrates */
-#define CONFIG_SYS_BAUDRATE_TABLE      \
-       { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400,     \
-        57600, 115200, 230400, 460800, 921600 }
-
-#define CONFIG_SYS_LOAD_ADDR   0x100000        /* default load address */
-#define CONFIG_SYS_EXTBDINFO   1               /* To use extended board_into (bd_t) */
-
-#define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
-
-/*-----------------------------------------------------------------------
- * NAND-FLASH stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_SYS_NAND0_BASE 0xFF400000
-#define CONFIG_SYS_NAND1_BASE 0xFF000000
-#define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND0_BASE }
-#define NAND_BIG_DELAY_US      25
-
-/* For CATcenter there is only NAND on the module */
-#define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices           */
-#define NAND_NO_RB
-
-#define CONFIG_SYS_NAND0_CE  (0x80000000 >> 1)  /* our CE is GPIO1 */
-#define CONFIG_SYS_NAND0_CLE (0x80000000 >> 2)  /* our CLE is GPIO2 */
-#define CONFIG_SYS_NAND0_ALE (0x80000000 >> 3)  /* our ALE is GPIO3 */
-#define CONFIG_SYS_NAND0_RDY (0x80000000 >> 4)  /* our RDY is GPIO4 */
-
-#define CONFIG_SYS_NAND1_CE  (0x80000000 >> 14)  /* our CE is GPIO14 */
-#define CONFIG_SYS_NAND1_CLE (0x80000000 >> 15)  /* our CLE is GPIO15 */
-#define CONFIG_SYS_NAND1_ALE (0x80000000 >> 16)  /* our ALE is GPIO16 */
-#define CONFIG_SYS_NAND1_RDY (0x80000000 >> 31)  /* our RDY is GPIO31 */
-
-
-#define MACRO_NAND_DISABLE_CE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_CE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_CE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_ENABLE_CE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_CE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_CE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_CLRALE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_ALE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_ALE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_SETALE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_ALE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_ALE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_CLRCLE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_CLE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_CLE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_SETCLE(nandptr) do { \
-       switch((unsigned long)nandptr) { \
-       case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_CLE); \
-               break; \
-       case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_CLE); \
-               break; \
-       } \
-} while(0)
-
-#ifdef NAND_NO_RB
-/* constant delay (see also tR in the datasheet) */
-#define NAND_WAIT_READY(nand) do { \
-       udelay(12); \
-} while (0)
-#else
-/* use the R/B pin */
-/* TBD */
-#endif
-
-#define WRITE_NAND_COMMAND(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)(d); } while(0)
-#define WRITE_NAND_ADDRESS(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)(d); } while(0)
-#define WRITE_NAND(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)d; } while(0)
-#define READ_NAND(adr) ((volatile unsigned char)(*(volatile __u8 *)(unsigned long)adr))
-
-/*-----------------------------------------------------------------------
- * PCI stuff
- *-----------------------------------------------------------------------
- */
-#if 0  /* No PCI on CATcenter */
-#define PCI_HOST_ADAPTER 0             /* configure as pci adapter     */
-#define PCI_HOST_FORCE 1               /* configure as pci host        */
-#define PCI_HOST_AUTO  2               /* detected via arbiter enable  */
-
-#define CONFIG_PCI                     /* include pci support          */
-#define CONFIG_PCI_INDIRECT_BRIDGE     /* indirect PCI bridge support */
-#define CONFIG_PCI_HOST PCI_HOST_FORCE  /* select pci host function     */
-#undef CONFIG_PCI_PNP                  /* do pci plug-and-play         */
-                                       /* resource configuration       */
-
-#define CONFIG_PCI_SCAN_SHOW           /* print pci devices @ startup  */
-
-#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1014  /* PCI Vendor ID: IBM   */
-#define CONFIG_SYS_PCI_SUBSYS_DEVICEID 0x0000  /* PCI Device ID: ---   */
-#define CONFIG_SYS_PCI_CLASSCODE       0x0b20  /* PCI Class Code: Processor/PPC*/
-
-#define CONFIG_SYS_PCI_PTM1LA  0x00000000      /* point to sdram               */
-#define CONFIG_SYS_PCI_PTM1MS  0xfc000001      /* 64MB, enable hard-wired to 1 */
-#define CONFIG_SYS_PCI_PTM1PCI 0x00000000      /* Host: use this pci address   */
-#define CONFIG_SYS_PCI_PTM2LA  0xffc00000      /* point to flash               */
-#define CONFIG_SYS_PCI_PTM2MS  0xffc00001      /* 4MB, enable                  */
-#define CONFIG_SYS_PCI_PTM2PCI 0x04000000      /* Host: use this pci address   */
-#endif /* No PCI */
-
-/*-----------------------------------------------------------------------
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_FLASH_BASE          0xFFFC0000
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)    /* Reserve 256 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (256 * 1024)    /* Reserve 256 kB for malloc()  */
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-/*-----------------------------------------------------------------------
- * FLASH organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max number of memory banks           */
-#define CONFIG_SYS_MAX_FLASH_SECT      256     /* max number of sectors on one chip    */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    120000  /* Timeout for Flash Erase (in ms)      */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    1000    /* Timeout for Flash Write (in ms)      */
-
-#define CONFIG_SYS_FLASH_WORD_SIZE     unsigned short  /* flash word size (width)      */
-#define CONFIG_SYS_FLASH_ADDR0         0x5555  /* 1st address for flash config cycles  */
-#define CONFIG_SYS_FLASH_ADDR1         0x2AAA  /* 2nd address for flash config cycles  */
-/*
- * The following defines are added for buggy IOP480 byte interface.
- * All other boards should use the standard values (CPCI405 etc.)
- */
-#define CONFIG_SYS_FLASH_READ0         0x0000  /* 0 is standard                        */
-#define CONFIG_SYS_FLASH_READ1         0x0001  /* 1 is standard                        */
-#define CONFIG_SYS_FLASH_READ2         0x0002  /* 2 is standard                        */
-
-#define CONFIG_SYS_FLASH_EMPTY_INFO            /* print 'E' for empty sector on flinfo */
-
-/*-----------------------------------------------------------------------
- * Environment Variable setup
- */
-#define CONFIG_ENV_IS_IN_FLASH 1       /* use FLASH for environment vars */
-#define CONFIG_ENV_ADDR                0xFFFF8000      /* environment starts at the first small sector */
-#define CONFIG_ENV_SECT_SIZE   0x2000  /* 8196 bytes may be used for env vars*/
-#define CONFIG_ENV_ADDR_REDUND 0xFFFFA000
-#define CONFIG_ENV_SIZE_REDUND 0x2000
-
-#define        CONFIG_SYS_USE_PPCENV                   /* Environment embedded in sect .ppcenv */
-
-#define CONFIG_SYS_NVRAM_BASE_ADDR     0xF0000500              /* NVRAM base address   */
-#define CONFIG_SYS_NVRAM_SIZE          242                     /* NVRAM size           */
-
-/*-----------------------------------------------------------------------
- * I2C EEPROM (CAT24WC16) for environment
- */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_PPC4XX
-#define CONFIG_SYS_I2C_PPC4XX_CH0
-#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
-#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
-/* mask of address bits that overflow into the "EEPROM chip address"   */
-/*#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW  0x07*/
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4    /* The Catalyst CAT24WC08 has   */
-                                       /* 16 byte page write mode using*/
-                                       /* last 4 bits of the address   */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10   /* and takes up to 10 msec */
-
-/*
- * Init Memory Controller:
- *
- * BR0/1 and OR0/1 (FLASH)
- */
-
-#define FLASH_BASE0_PRELIM     0xFFC00000      /* FLASH bank #0        */
-
-/*-----------------------------------------------------------------------
- * External Bus Controller (EBC) Setup
- */
-
-/* Memory Bank 0 (Flash Bank 0, NOR-FLASH) initialization                      */
-#define CONFIG_SYS_EBC_PB0AP           0x92015480
-#define CONFIG_SYS_EBC_PB0CR           0xFFC5A000  /* BAS=0xFFC,BS=4MB,BU=R/W,BW=16bit */
-
-/* Memory Bank 1 (External SRAM) initialization                                        */
-/* Since this must replace NOR Flash, we use the same settings for CS0         */
-#define CONFIG_SYS_EBC_PB1AP           0x92015480
-#define CONFIG_SYS_EBC_PB1CR           0xFF85A000  /* BAS=0xFF8,BS=4MB,BU=R/W,BW=8bit  */
-
-/* Memory Bank 2 (Flash Bank 1, NAND-FLASH) initialization                     */
-#define CONFIG_SYS_EBC_PB2AP           0x92015480
-#define CONFIG_SYS_EBC_PB2CR           0xFF458000  /* BAS=0xFF4,BS=4MB,BU=R/W,BW=8bit  */
-
-/* Memory Bank 3 (Flash Bank 2, NAND-FLASH) initialization                     */
-#define CONFIG_SYS_EBC_PB3AP           0x92015480
-#define CONFIG_SYS_EBC_PB3CR           0xFF058000  /* BAS=0xFF0,BS=4MB,BU=R/W,BW=8bit  */
-
-#ifdef CONFIG_PPCHAMELEON_SMI712
-/*
- * Video console (graphic: SMI LynxEM)
- */
-#define CONFIG_VIDEO
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SMI_LYNXEM
-#define CONFIG_VIDEO_LOGO
-/*#define CONFIG_VIDEO_BMP_LOGO*/
-#define CONFIG_CONSOLE_EXTRA_INFO
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-/* This is the base address (on 405EP-side) used to generate I/O accesses on PCI bus */
-#define CONFIG_SYS_ISA_IO 0xE8000000
-/* see also drivers/video/videomodes.c */
-#define CONFIG_SYS_DEFAULT_VIDEO_MODE 0x303
-#endif
-
-/*-----------------------------------------------------------------------
- * FPGA stuff
- */
-/* FPGA internal regs */
-#define CONFIG_SYS_FPGA_MODE           0x00
-#define CONFIG_SYS_FPGA_STATUS         0x02
-#define CONFIG_SYS_FPGA_TS             0x04
-#define CONFIG_SYS_FPGA_TS_LOW         0x06
-#define CONFIG_SYS_FPGA_TS_CAP0        0x10
-#define CONFIG_SYS_FPGA_TS_CAP0_LOW    0x12
-#define CONFIG_SYS_FPGA_TS_CAP1        0x14
-#define CONFIG_SYS_FPGA_TS_CAP1_LOW    0x16
-#define CONFIG_SYS_FPGA_TS_CAP2        0x18
-#define CONFIG_SYS_FPGA_TS_CAP2_LOW    0x1a
-#define CONFIG_SYS_FPGA_TS_CAP3        0x1c
-#define CONFIG_SYS_FPGA_TS_CAP3_LOW    0x1e
-
-/* FPGA Mode Reg */
-#define CONFIG_SYS_FPGA_MODE_CF_RESET  0x0001
-#define CONFIG_SYS_FPGA_MODE_TS_IRQ_ENABLE 0x0100
-#define CONFIG_SYS_FPGA_MODE_TS_IRQ_CLEAR  0x1000
-#define CONFIG_SYS_FPGA_MODE_TS_CLEAR  0x2000
-
-/* FPGA Status Reg */
-#define CONFIG_SYS_FPGA_STATUS_DIP0    0x0001
-#define CONFIG_SYS_FPGA_STATUS_DIP1    0x0002
-#define CONFIG_SYS_FPGA_STATUS_DIP2    0x0004
-#define CONFIG_SYS_FPGA_STATUS_FLASH   0x0008
-#define CONFIG_SYS_FPGA_STATUS_TS_IRQ  0x1000
-
-#define CONFIG_SYS_FPGA_SPARTAN2       1               /* using Xilinx Spartan 2 now   */
-#define CONFIG_SYS_FPGA_MAX_SIZE       128*1024        /* 128kByte is enough for XC2S50E*/
-
-/* FPGA program pin configuration */
-#define CONFIG_SYS_FPGA_PRG            0x04000000      /* FPGA program pin (ppc output) */
-#define CONFIG_SYS_FPGA_CLK            0x02000000      /* FPGA clk pin (ppc output)    */
-#define CONFIG_SYS_FPGA_DATA           0x01000000      /* FPGA data pin (ppc output)   */
-#define CONFIG_SYS_FPGA_INIT           0x00010000      /* FPGA init pin (ppc input)    */
-#define CONFIG_SYS_FPGA_DONE           0x00008000      /* FPGA done pin (ppc input)    */
-
-/*-----------------------------------------------------------------------
- * Definitions for initial stack pointer and data area (in data cache)
- */
-/* use on chip memory ( OCM ) for temperary stack until sdram is tested */
-#define CONFIG_SYS_TEMP_STACK_OCM      1
-
-/* On Chip Memory location */
-#define CONFIG_SYS_OCM_DATA_ADDR       0xF8000000
-#define CONFIG_SYS_OCM_DATA_SIZE       0x1000
-#define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_SYS_OCM_DATA_ADDR /* inside of SDRAM             */
-#define CONFIG_SYS_INIT_RAM_SIZE       CONFIG_SYS_OCM_DATA_SIZE /* Size of used area in RAM    */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET    (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-/*-----------------------------------------------------------------------
- * Definitions for GPIO setup (PPC405EP specific)
- *
- * GPIO0[0]    - External Bus Controller BLAST output
- * GPIO0[1-9]  - Instruction trace outputs -> GPIO
- * GPIO0[10-13] - External Bus Controller CS_1 - CS_4 outputs
- * GPIO0[14-16] - External Bus Controller ABUS3-ABUS5 outputs -> GPIO
- * GPIO0[17-23] - External Interrupts IRQ0 - IRQ6 inputs
- * GPIO0[24-27] - UART0 control signal inputs/outputs
- * GPIO0[28-29] - UART1 data signal input/output
- * GPIO0[30]   - EMAC0 input
- * GPIO0[31]   - EMAC1 reject packet as output
- */
-#define CONFIG_SYS_GPIO0_OSRL          0x40000550
-#define CONFIG_SYS_GPIO0_OSRH          0x00000110
-#define CONFIG_SYS_GPIO0_ISR1L         0x00000000
-/*#define CONFIG_SYS_GPIO0_ISR1H       0x15555445*/
-#define CONFIG_SYS_GPIO0_ISR1H         0x15555444
-#define CONFIG_SYS_GPIO0_TSRL          0x00000000
-#define CONFIG_SYS_GPIO0_TSRH          0x00000000
-#define CONFIG_SYS_GPIO0_TCR           0xF7FF8014
-
-#define CONFIG_NO_SERIAL_EEPROM
-
-/*--------------------------------------------------------------------*/
-
-#ifdef CONFIG_NO_SERIAL_EEPROM
-
-/*
-!-----------------------------------------------------------------------
-! Defines for entry options.
-! Note: Because the 405EP SDRAM controller does not support ECC, ECC DIMMs that
-!      are plugged in the board will be utilized as non-ECC DIMMs.
-!-----------------------------------------------------------------------
-*/
-#undef         AUTO_MEMORY_CONFIG
-#define                DIMM_READ_ADDR 0xAB
-#define                DIMM_WRITE_ADDR 0xAA
-
-/* Defines for CPC0_PLLMR1 Register fields */
-#define PLL_ACTIVE             0x80000000
-#define CPC0_PLLMR1_SSCS       0x80000000
-#define PLL_RESET              0x40000000
-#define CPC0_PLLMR1_PLLR       0x40000000
-    /* Feedback multiplier */
-#define PLL_FBKDIV             0x00F00000
-#define CPC0_PLLMR1_FBDV       0x00F00000
-#define PLL_FBKDIV_16          0x00000000
-#define PLL_FBKDIV_1           0x00100000
-#define PLL_FBKDIV_2           0x00200000
-#define PLL_FBKDIV_3           0x00300000
-#define PLL_FBKDIV_4           0x00400000
-#define PLL_FBKDIV_5           0x00500000
-#define PLL_FBKDIV_6           0x00600000
-#define PLL_FBKDIV_7           0x00700000
-#define PLL_FBKDIV_8           0x00800000
-#define PLL_FBKDIV_9           0x00900000
-#define PLL_FBKDIV_10          0x00A00000
-#define PLL_FBKDIV_11          0x00B00000
-#define PLL_FBKDIV_12          0x00C00000
-#define PLL_FBKDIV_13          0x00D00000
-#define PLL_FBKDIV_14          0x00E00000
-#define PLL_FBKDIV_15          0x00F00000
-    /* Forward A divisor */
-#define PLL_FWDDIVA            0x00070000
-#define CPC0_PLLMR1_FWDVA      0x00070000
-#define PLL_FWDDIVA_8          0x00000000
-#define PLL_FWDDIVA_7          0x00010000
-#define PLL_FWDDIVA_6          0x00020000
-#define PLL_FWDDIVA_5          0x00030000
-#define PLL_FWDDIVA_4          0x00040000
-#define PLL_FWDDIVA_3          0x00050000
-#define PLL_FWDDIVA_2          0x00060000
-#define PLL_FWDDIVA_1          0x00070000
-    /* Forward B divisor */
-#define PLL_FWDDIVB            0x00007000
-#define CPC0_PLLMR1_FWDVB      0x00007000
-#define PLL_FWDDIVB_8          0x00000000
-#define PLL_FWDDIVB_7          0x00001000
-#define PLL_FWDDIVB_6          0x00002000
-#define PLL_FWDDIVB_5          0x00003000
-#define PLL_FWDDIVB_4          0x00004000
-#define PLL_FWDDIVB_3          0x00005000
-#define PLL_FWDDIVB_2          0x00006000
-#define PLL_FWDDIVB_1          0x00007000
-    /* PLL tune bits */
-#define PLL_TUNE_MASK          0x000003FF
-#define PLL_TUNE_2_M_3         0x00000133      /*  2 <= M <= 3                 */
-#define PLL_TUNE_4_M_6         0x00000134      /*  3 <  M <= 6                 */
-#define PLL_TUNE_7_M_10                0x00000138      /*  6 <  M <= 10                */
-#define PLL_TUNE_11_M_14       0x0000013C      /* 10 <  M <= 14                */
-#define PLL_TUNE_15_M_40       0x0000023E      /* 14 <  M <= 40                */
-#define PLL_TUNE_VCO_LOW       0x00000000      /* 500MHz <= VCO <=  800MHz     */
-#define PLL_TUNE_VCO_HI                0x00000080      /* 800MHz <  VCO <= 1000MHz     */
-
-/* Defines for CPC0_PLLMR0 Register fields */
-    /* CPU divisor */
-#define PLL_CPUDIV             0x00300000
-#define CPC0_PLLMR0_CCDV       0x00300000
-#define PLL_CPUDIV_1           0x00000000
-#define PLL_CPUDIV_2           0x00100000
-#define PLL_CPUDIV_3           0x00200000
-#define PLL_CPUDIV_4           0x00300000
-    /* PLB divisor */
-#define PLL_PLBDIV             0x00030000
-#define CPC0_PLLMR0_CBDV       0x00030000
-#define PLL_PLBDIV_1           0x00000000
-#define PLL_PLBDIV_2           0x00010000
-#define PLL_PLBDIV_3           0x00020000
-#define PLL_PLBDIV_4           0x00030000
-    /* OPB divisor */
-#define PLL_OPBDIV             0x00003000
-#define CPC0_PLLMR0_OPDV       0x00003000
-#define PLL_OPBDIV_1           0x00000000
-#define PLL_OPBDIV_2           0x00001000
-#define PLL_OPBDIV_3           0x00002000
-#define PLL_OPBDIV_4           0x00003000
-    /* EBC divisor */
-#define PLL_EXTBUSDIV          0x00000300
-#define CPC0_PLLMR0_EPDV       0x00000300
-#define PLL_EXTBUSDIV_2                0x00000000
-#define PLL_EXTBUSDIV_3                0x00000100
-#define PLL_EXTBUSDIV_4                0x00000200
-#define PLL_EXTBUSDIV_5                0x00000300
-    /* MAL divisor */
-#define PLL_MALDIV             0x00000030
-#define CPC0_PLLMR0_MPDV       0x00000030
-#define PLL_MALDIV_1           0x00000000
-#define PLL_MALDIV_2           0x00000010
-#define PLL_MALDIV_3           0x00000020
-#define PLL_MALDIV_4           0x00000030
-    /* PCI divisor */
-#define PLL_PCIDIV             0x00000003
-#define CPC0_PLLMR0_PPFD       0x00000003
-#define PLL_PCIDIV_1           0x00000000
-#define PLL_PCIDIV_2           0x00000001
-#define PLL_PCIDIV_3           0x00000002
-#define PLL_PCIDIV_4           0x00000003
-
-#ifdef CONFIG_PPCHAMELEON_CLK_25
-/* CPU - PLB/SDRAM - EBC - OPB - PCI (assuming a 25.0 MHz input clock to the 405EP) */
-#define PPCHAMELEON_PLLMR0_133_133_33_66_33     (PLL_CPUDIV_1 | PLL_PLBDIV_1 |  \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_133_133_33_66_33     (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_6 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |  \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_200_100_50_33 (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_4 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_266_133_33_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |     \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_266_133_33_66_33 (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_3 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_333_111_37_55_55 (PLL_CPUDIV_1 | PLL_PLBDIV_3 |     \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_2)
-#define PPCHAMELEON_PLLMR1_333_111_37_55_55 (PLL_FBKDIV_10     |  \
-                             PLL_FWDDIVA_3 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
-
-#elif (defined (CONFIG_PPCHAMELEON_CLK_33))
-
-/* CPU - PLB/SDRAM - EBC - OPB - PCI (assuming a 33.3MHz input clock to the 405EP) */
-#define PPCHAMELEON_PLLMR0_133_133_33_66_33     (PLL_CPUDIV_1 | PLL_PLBDIV_1 |  \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_133_133_33_66_33     (PLL_FBKDIV_4  |  \
-                                 PLL_FWDDIVA_6 | PLL_FWDDIVB_6 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |  \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_200_100_50_33 (PLL_FBKDIV_6  |  \
-                                 PLL_FWDDIVA_4 | PLL_FWDDIVB_4 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_266_133_33_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |     \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_266_133_33_66_33 (PLL_FBKDIV_8  |  \
-                                 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_333_111_37_55_55 (PLL_CPUDIV_1 | PLL_PLBDIV_3 |     \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_2)
-#define PPCHAMELEON_PLLMR1_333_111_37_55_55 (PLL_FBKDIV_10     |  \
-                                 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
-
-#else
-#error "* External frequency (SysClk) not defined! *"
-#endif
-
-#if   (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_HI)
-/* Model HI */
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_333_111_37_55_55
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_333_111_37_55_55
-#define CONFIG_SYS_OPB_FREQ    55555555
-/* Model ME */
-#elif (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME)
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_266_133_33_66_33
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_266_133_33_66_33
-#define CONFIG_SYS_OPB_FREQ    66666666
-#else
-/* Model BA (default) */
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_133_133_33_66_33
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_133_133_33_66_33
-#define CONFIG_SYS_OPB_FREQ    66666666
-#endif
-
-#endif /* CONFIG_NO_SERIAL_EEPROM */
-
-#define CONFIG_JFFS2_NAND 1                    /* jffs2 on nand support */
-#define NAND_CACHE_PAGES 16                    /* size of nand cache in 512 bytes pages */
-
-/*
- * JFFS2 partitions
- *
- */
-/* No command line, one static partition */
-#undef CONFIG_CMD_MTDPARTS
-#define CONFIG_JFFS2_DEV               "nand"
-#define CONFIG_JFFS2_PART_SIZE         0x00200000
-#define CONFIG_JFFS2_PART_OFFSET       0x00000000
-
-/* mtdparts command line support
- *
- * Note: fake mtd_id used, no linux mtd map file
- */
-/*
-#define CONFIG_CMD_MTDPARTS
-#define MTDIDS_DEFAULT         "nand0=catcenter"
-#define MTDPARTS_DEFAULT       "mtdparts=catcenter:2m(nand)"
-*/
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/ELPPC.h b/include/configs/ELPPC.h
deleted file mode 100644 (file)
index debfc36..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * (C) Copyright 2002 ELTEC Elektronik AG
- * Frank Gottschling <fgottschling@eltec.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define GTREGREAD(x) 0xffffffff         /* needed for debug */
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFFF00000
-
-/* these hardware addresses are pretty bogus, please change them to
-   suit your needs */
-
-/* first ethernet */
-#define CONFIG_ETHADDR          00:00:5b:ee:de:ad
-
-#define CONFIG_IPADDR           192.168.0.105
-#define CONFIG_SERVERIP         192.168.0.100
-
-#define CONFIG_ELPPC            1       /* this is an BAB740/BAB750 board */
-
-#define CONFIG_BAUDRATE         9600    /* console baudrate */
-
-#undef  CONFIG_WATCHDOG
-
-#define CONFIG_BOOTDELAY        5       /* autoboot after 5 seconds */
-
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-
-#undef  CONFIG_BOOTARGS
-#define CONFIG_BOOTCOMMAND                                  \
-    "bootp 1000000; "                                       \
-    "setenv bootargs root=ramfs console=ttyS00,9600 "       \
-    "ip=${ipaddr}:${serverip}:${rootpath}:${gatewayip}:"    \
-    "${netmask}:${hostname}:eth0:none; "                    \
-    "bootm"
-
-#define CONFIG_LOADS_ECHO       0       /* echo off for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE           /* allow baudrate changes */
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_BOOTPATH
-
-#define CONFIG_BOOTP_BOOTFILESIZE
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_PCI
-#define CONFIG_CMD_JFFS2
-
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory */
-
-/*
- * choose between COM1 and COM2 as serial console
- */
-#define CONFIG_CONS_INDEX       1
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024        /* Console I/O Buffer Size */
-#else
-#define CONFIG_SYS_CBSIZE              256         /* Console I/O Buffer Size */
-#endif
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#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       0x00000000  /* memtest works on    */
-#define CONFIG_SYS_MEMTEST_END         0x04000000  /* 0 ... 64 MB in DRAM    */
-
-#define CONFIG_SYS_LOAD_ADDR           0x1000000   /* default load address    */
-
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-/*
- * Low Level Configuration Settings
- * (address mappings, register initial values, etc.)
- * You should know what you are doing if you make changes here.
- */
-#define CONFIG_SYS_BOARD_ASM_INIT
-#define CONFIG_MISC_INIT_R
-
-/*
- * Address mapping scheme for the MPC107 mem controller is mapping B (CHRP)
- */
-#undef  CONFIG_SYS_ADDRESS_MAP_A
-
-#define CONFIG_SYS_PCI_MEMORY_BUS      0x00000000
-#define CONFIG_SYS_PCI_MEMORY_PHYS     0x00000000
-#define CONFIG_SYS_PCI_MEMORY_SIZE     0x40000000
-
-#define CONFIG_SYS_PCI_MEM_BUS         0x80000000
-#define CONFIG_SYS_PCI_MEM_PHYS        0x80000000
-#define CONFIG_SYS_PCI_MEM_SIZE        0x7d000000
-
-#define CONFIG_SYS_ISA_MEM_BUS         0x00000000
-#define CONFIG_SYS_ISA_MEM_PHYS        0xfd000000
-#define CONFIG_SYS_ISA_MEM_SIZE        0x01000000
-
-#define CONFIG_SYS_PCI_IO_BUS          0x00800000
-#define CONFIG_SYS_PCI_IO_PHYS         0xfe800000
-#define CONFIG_SYS_PCI_IO_SIZE         0x00400000
-
-#define CONFIG_SYS_ISA_IO_BUS          0x00000000
-#define CONFIG_SYS_ISA_IO_PHYS         0xfe000000
-#define CONFIG_SYS_ISA_IO_SIZE         0x00800000
-
-/* driver defines FDC,IDE,... */
-#define CONFIG_SYS_ISA_IO_BASE_ADDRESS CONFIG_SYS_ISA_IO_PHYS
-#define CONFIG_SYS_ISA_IO              CONFIG_SYS_ISA_IO_PHYS
-#define CONFIG_SYS_60X_PCI_IO_OFFSET   CONFIG_SYS_ISA_IO_PHYS
-
-/*
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-
-#define CONFIG_SYS_USR_LED_BASE        0x78000000
-#define CONFIG_SYS_NVRAM_BASE          0xff000000
-#define CONFIG_SYS_UART_BASE           0xff400000
-#define CONFIG_SYS_FLASH_BASE          0xfff00000
-
-#define MPC107_EUMB_ADDR        0xfce00000
-#define MPC107_EUMB_PI          0xfce41090
-#define MPC107_EUMB_GCR         0xfce41020
-#define MPC107_EUMB_IACKR       0xfce600a0
-#define MPC107_I2C_ADDR         0xfce03000
-
-/*
- * Definitions for initial stack pointer and data area
- */
-#define CONFIG_SYS_INIT_RAM_ADDR       0x00fd0000  /* above the memtest region */
-#define CONFIG_SYS_INIT_RAM_SIZE        0x4000
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-/*
- * Flash mapping/organization on the MPC10x.
- */
-#define FLASH_BASE0_PRELIM      0xff800000
-#define FLASH_BASE1_PRELIM      0xffc00000
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     2           /* max number of memory banks    */
-#define CONFIG_SYS_MAX_FLASH_SECT      67          /* max number of sectors on one chip */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    120000      /* Timeout for Flash Erase (in ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500         /* Timeout for Flash Write (in ms) */
-
-/*
- * JFFS2 partitions
- *
- */
-/* No command line, one static partition, whole device */
-#undef CONFIG_CMD_MTDPARTS
-#define CONFIG_JFFS2_DEV               "nor0"
-#define CONFIG_JFFS2_PART_SIZE         0xFFFFFFFF
-#define CONFIG_JFFS2_PART_OFFSET       0x00000000
-
-/* mtdparts command line support */
-/* Note: fake mtd_id used, no linux mtd map file */
-/*
-#define CONFIG_CMD_MTDPARTS
-#define MTDIDS_DEFAULT         "nor0=elppc-0,nor1=elppc-1"
-#define MTDPARTS_DEFAULT       "mtdparts=elppc-0:-(jffs2),elppc-1:-(user)"
-*/
-
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MONITOR_LEN         0x40000     /* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MALLOC_LEN          0x20000     /* Reserve 128 kB for malloc() */
-#undef  CONFIG_SYS_MEMTEST
-
-/*
- * Environment settings
- */
-#define CONFIG_ENV_OVERWRITE
-#define CONFIG_ENV_IS_IN_NVRAM     1           /* use NVRAM for environment vars */
-#define CONFIG_SYS_NVRAM_SIZE          0x800       /* NVRAM size (2kB) */
-#define CONFIG_ENV_SIZE            0x400       /* Size of Environment vars (1kB) */
-#define CONFIG_ENV_ADDR            0x0
-#define CONFIG_ENV_MAP_ADRS        0xff000000
-#define CONFIG_SYS_NV_SROM_COPY_ADDR   (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
-#define CONFIG_SYS_NVRAM_ACCESS_ROUTINE            /* only byte accsess alowed */
-#define CONFIG_SYS_SROM_SIZE           0x100       /* shadow of revision info is in nvram */
-
-/*
- * Serial devices
- */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         24000000
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_UART_BASE + 0)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_UART_BASE + 8)
-
-/*
- * PCI stuff
- */
-#define CONFIG_PCI                                /* include pci support */
-#define CONFIG_PCI_INDIRECT_BRIDGE     /* indirect PCI bridge support */
-#define CONFIG_PCI_PNP                            /* pci plug-and-play */
-#define CONFIG_PCI_HOST         PCI_HOST_AUTO
-#undef  CONFIG_PCI_SCAN_SHOW
-
-/*
- * Optional Video console (graphic: SMI LynxEM)
- */
-#define CONFIG_VIDEO
-#define CONFIG_CFB_CONSOLE
-#define VIDEO_KBD_INIT_FCT    (simple_strtol (getenv("console"), NULL, 10))
-#define VIDEO_TSTC_FCT         serial_stub_tstc
-#define VIDEO_GETC_FCT         serial_stub_getc
-
-#define CONFIG_VIDEO_SMI_LYNXEM
-#define CONFIG_VIDEO_LOGO
-#define CONFIG_CONSOLE_EXTRA_INFO
-
-/*
- * Initial BATs
- */
-#if 1
-
-#define CONFIG_SYS_IBAT0L 0
-#define CONFIG_SYS_IBAT0U 0
-#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT1U
-
-#define CONFIG_SYS_IBAT1L 0
-#define CONFIG_SYS_IBAT1U 0
-#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
-
-#define CONFIG_SYS_IBAT2L 0
-#define CONFIG_SYS_IBAT2U 0
-#define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
-#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
-
-#define CONFIG_SYS_IBAT3L 0
-#define CONFIG_SYS_IBAT3U 0
-#define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
-#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
-
-#else
-
-/* SDRAM */
-#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_RW)
-#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT1U
-
-/* address range for flashes */
-#define CONFIG_SYS_IBAT1L (CONFIG_SYS_FLASH_BASE | BATL_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT1U (CONFIG_SYS_FLASH_BASE | BATU_BL_16M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
-
-/* ISA IO space */
-#define CONFIG_SYS_IBAT2L (CONFIG_SYS_ISA_IO | BATL_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT2U (CONFIG_SYS_ISA_IO | BATU_BL_16M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
-#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
-
-/* ISA memory space */
-#define CONFIG_SYS_IBAT3L (CONFIG_SYS_ISA_MEM | BATL_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT3U (CONFIG_SYS_ISA_MEM | BATU_BL_16M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
-#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
-
-#endif
-
-/*
- * Speed settings are board specific
- */
-#define CONFIG_SYS_BUS_CLK     100000000
-#define CONFIG_SYS_CPU_CLK     400000000
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)           /* Initial Memory map for Linux */
-
-/*
- * Cache Configuration
- */
-#define CONFIG_SYS_CACHELINE_SIZE        32    /* For all MPC74xx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CACHELINE_SHIFT        5    /* log base 2 of the above value */
-#endif
-
-/*
- * L2CR setup -- make sure this is right for your board!
- * look in include/74xx_7xx.h for the defines used here
- */
-
-#define CONFIG_SYS_L2
-
-#if 1
-#define L2_INIT     0       /* cpu 750 CXe*/
-#else
-#define L2_INIT     (L2CR_L2SIZ_2M | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \
-                    L2CR_L2OH_5   | L2CR_L2CTL | L2CR_L2WT)
-#endif
-#define L2_ENABLE   (L2_INIT | L2CR_L2E)
-
-#define CONFIG_EEPRO100
-#define CONFIG_SYS_RX_ETH_BUFFER       8               /* use 8 rx buffer on eepro100  */
-#define CONFIG_EEPRO100_SROM_WRITE
-
-#endif    /* __CONFIG_H */
diff --git a/include/configs/IceCube.h b/include/configs/IceCube.h
deleted file mode 100644 (file)
index 1861aa8..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200         1       /* This is a MPC5200 CPU */
-#define CONFIG_ICECUBE         1       /* ... on IceCube board */
-
-/*
- * Valid values for CONFIG_SYS_TEXT_BASE are:
- * 0xFFF00000  boot high (standard configuration)
- * 0xFF000000  boot low for 16 MiB boards
- * 0xFF800000  boot low for  8 MiB boards
- * 0x00100000  boot from RAM (for testing only)
- */
-#ifndef CONFIG_SYS_TEXT_BASE
-#define        CONFIG_SYS_TEXT_BASE    0xFFF00000
-#endif
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000 /* ... running at 33.000000MHz */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-
-/*
- * PCI Mapping:
- * 0x40000000 - 0x4fffffff - PCI Memory
- * 0x50000000 - 0x50ffffff - PCI IO Space
- */
-#define CONFIG_PCI
-
-#if defined(CONFIG_PCI)
-#define CONFIG_PCI_PNP         1
-#define CONFIG_PCI_SCAN_SHOW   1
-#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
-
-#define CONFIG_PCI_MEM_BUS     0x40000000
-#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE    0x10000000
-
-#define CONFIG_PCI_IO_BUS      0x50000000
-#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE     0x01000000
-#endif
-
-#define CONFIG_SYS_XLB_PIPELINING      1
-
-#define CONFIG_MII             1
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8  /* use 8 rx buffer on eepro100  */
-#define CONFIG_NS8382X         1
-
-/* Partitions */
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-#define CONFIG_ISO_PARTITION
-
-/* USB */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_USB_STORAGE
-#define CONFIG_SYS_OHCI_BE_CONTROLLER
-#undef CONFIG_SYS_USB_OHCI_BOARD_INIT
-#define CONFIG_SYS_USB_OHCI_CPU_INIT   1
-#define CONFIG_SYS_USB_OHCI_REGS_BASE  MPC5XXX_USB
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME  "mpc5200"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
-
-#define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_SNTP
-#define CONFIG_CMD_USB
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_PCI
-#endif
-
-
-#if (CONFIG_SYS_TEXT_BASE == 0xFF000000)               /* Boot low with 16 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT16        1
-#endif
-#if (CONFIG_SYS_TEXT_BASE == 0xFF800000)               /* Boot low with  8 MB Flash */
-#if defined(CONFIG_LITE5200B)
-#   error CONFIG_SYS_LOWBOOT08 is incompatible with the Lite5200B
-#else
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT08        1
-#endif
-#endif
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "netdev=eth0\0"                                                 \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off panic=1\0"                  \
-       "flash_nfs=run nfsargs addip;"                                  \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip;"                                 \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0"     \
-       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
-       "bootfile=/tftpboot/MPC5200/uImage\0"                           \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-
-/*
- * IPB Bus clocking configuration.
- */
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_SYS_IPBCLK_EQUALS_XLBCLK        /* define for 133MHz speed */
-#else
-#undef CONFIG_SYS_IPBCLK_EQUALS_XLBCLK         /* define for 133MHz speed */
-#endif
-
-/* pass open firmware flat tree */
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
-
-#define OF_CPU                 "PowerPC,5200@0"
-#define OF_SOC                 "soc5200@f0000000"
-#define OF_TBCLK               (bd->bi_busfreq / 4)
-#define OF_STDOUT_PATH         "/soc5200@f0000000/serial@2000"
-
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          2       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           100000 /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  70
-
-/*
- * Flash configuration
- */
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_SYS_FLASH_BASE          0xFE000000
-#define CONFIG_SYS_FLASH_SIZE          0x01000000
-#if !defined(CONFIG_SYS_LOWBOOT)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x01760000 + 0x00800000)
-#else  /* CONFIG_SYS_LOWBOOT */
-#if defined(CONFIG_SYS_LOWBOOT08)
-# error CONFIG_SYS_LOWBOOT08 is incompatible with the Lite5200B
-#endif
-#if defined(CONFIG_SYS_LOWBOOT16)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x01060000)
-#endif
-#endif /* CONFIG_SYS_LOWBOOT */
-#else /* !CONFIG_LITE5200B (IceCube)*/
-#define CONFIG_SYS_FLASH_BASE          0xFF000000
-#define CONFIG_SYS_FLASH_SIZE          0x01000000
-#if !defined(CONFIG_SYS_LOWBOOT)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x00740000 + 0x00800000)
-#else  /* CONFIG_SYS_LOWBOOT */
-#if defined(CONFIG_SYS_LOWBOOT08)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x00040000 + 0x00800000)
-#endif
-#if defined(CONFIG_SYS_LOWBOOT16)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x00040000)
-#endif
-#endif /* CONFIG_SYS_LOWBOOT */
-#endif /* CONFIG_LITE5200B */
-#define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max num of memory banks      */
-
-#define CONFIG_SYS_MAX_FLASH_SECT      128     /* max num of sects on one chip */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    240000  /* Flash Erase Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (in ms)  */
-
-#undef CONFIG_FLASH_16BIT      /* Flash is 8-bit */
-
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_FLASH_CFI_DRIVER
-#define CONFIG_SYS_FLASH_CFI
-#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_CS1_START,CONFIG_SYS_CS0_START}
-#endif
-
-
-/*
- * Environment settings
- */
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x10000
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_ENV_SECT_SIZE   0x20000
-#else
-#define CONFIG_ENV_SECT_SIZE   0x10000
-#endif
-#define CONFIG_ENV_OVERWRITE   1
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_MBAR                0xF0000000
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (512 << 10)     /* Reserve 512 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_MII100
-/*
- * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
- */
-/* #define CONFIG_MPC5xxx_FEC_MII10 */
-#define CONFIG_PHY_ADDR                0x00
-
-/*
- * GPIO configuration
- */
-#ifdef CONFIG_MPC5200_DDR
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x90000004
-#else
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x10000004
-#endif
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS             16              /* max number of command args   */
-#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size    */
-
-#define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
-#define CONFIG_SYS_HUSH_PARSER         1       /* use "hush" command parser    */
-
-#define CONFIG_SYS_MEMTEST_START       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#if defined(CONFIG_LITE5200B)
-#define CONFIG_SYS_CS1_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS1_SIZE            CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_CS1_CFG             0x00047800
-#define CONFIG_SYS_CS0_START           (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE)
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_CS0_START
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x00047800
-#else /* IceCube aka Lite5200 */
-#ifdef CONFIG_MPC5200_DDR
-
-#define CONFIG_SYS_BOOTCS_START        (CONFIG_SYS_CS1_START + CONFIG_SYS_CS1_SIZE)
-#define CONFIG_SYS_BOOTCS_SIZE         0x00800000
-#define CONFIG_SYS_BOOTCS_CFG          0x00047801
-#define CONFIG_SYS_CS1_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS1_SIZE            0x00800000
-#define CONFIG_SYS_CS1_CFG             0x00047800
-
-#else /* !CONFIG_MPC5200_DDR */
-
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x00047801
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-
-#endif /* CONFIG_MPC5200_DDR */
-#endif /*CONFIG_LITE5200B */
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-#define CONFIG_SYS_RESET_ADDRESS       0xff000000
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef  CONFIG_IDE_8xx_PCCARD          /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
-
-#define        CONFIG_IDE_RESET                /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       2       /* max. 1 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers                                                */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-#define CONFIG_ATAPI            1
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h
deleted file mode 100644 (file)
index aefde74..0000000
+++ /dev/null
@@ -1,735 +0,0 @@
-/*
- * Copyright (C) 2006,2011 Freescale Semiconductor, Inc.
- *
- * Dave Liu <daveliu@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_E300            1 /* E300 family */
-#define CONFIG_QE              1 /* Has QE */
-#define CONFIG_MPC8360         1 /* MPC8360 CPU specific */
-#define CONFIG_MPC8360EMDS     1 /* MPC8360EMDS board specific */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFE000000
-
-#undef CONFIG_PQ_MDS_PIB /* POWERQUICC MDS Platform IO Board */
-#undef CONFIG_PQ_MDS_PIB_ATM /* QOC3 ATM card */
-
-/*
- * System Clock Setup
- */
-#ifdef CONFIG_CLKIN_33MHZ
-#ifdef CONFIG_PCISLAVE
-#define CONFIG_83XX_PCICLK     33330000 /* in HZ */
-#else
-#define CONFIG_83XX_CLKIN      33330000 /* in Hz */
-#endif
-
-#ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ    33330000
-#endif
-
-#elif defined(CONFIG_CLKIN_66MHZ)
-#ifdef CONFIG_PCISLAVE
-#define CONFIG_83XX_PCICLK     66000000 /* in HZ */
-#else
-#define CONFIG_83XX_CLKIN      66000000 /* in Hz */
-#endif
-
-#ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ    66000000
-#endif
-#else
-#error Unknown oscillator frequency.
-#endif
-
-/*
- * Hardware Reset Configuration Word
- */
-#ifdef CONFIG_CLKIN_33MHZ
-#define CONFIG_SYS_HRCW_LOW (\
-       HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
-       HRCWL_DDR_TO_SCB_CLK_1X1 |\
-       HRCWL_CSB_TO_CLKIN_8X1 |\
-       HRCWL_VCO_1X2 |\
-       HRCWL_CE_PLL_VCO_DIV_4 |\
-       HRCWL_CE_PLL_DIV_1X1 |\
-       HRCWL_CE_TO_PLL_1X15 |\
-       HRCWL_CORE_TO_CSB_2X1)
-#elif defined(CONFIG_CLKIN_66MHZ)
-#define CONFIG_SYS_HRCW_LOW (\
-       HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
-       HRCWL_DDR_TO_SCB_CLK_1X1 |\
-       HRCWL_CSB_TO_CLKIN_4X1 |\
-       HRCWL_VCO_1X2 |\
-       HRCWL_CE_PLL_VCO_DIV_4 |\
-       HRCWL_CE_PLL_DIV_1X1 |\
-       HRCWL_CE_TO_PLL_1X6 |\
-       HRCWL_CORE_TO_CSB_2X1)
-#endif
-
-#ifdef CONFIG_PCISLAVE
-#define CONFIG_SYS_HRCW_HIGH (\
-       HRCWH_PCI_AGENT |\
-       HRCWH_PCI1_ARBITER_DISABLE |\
-       HRCWH_PCICKDRV_DISABLE |\
-       HRCWH_CORE_ENABLE |\
-       HRCWH_FROM_0XFFF00100 |\
-       HRCWH_BOOTSEQ_DISABLE |\
-       HRCWH_SW_WATCHDOG_DISABLE |\
-       HRCWH_ROM_LOC_LOCAL_16BIT)
-#else
-#define CONFIG_SYS_HRCW_HIGH (\
-       HRCWH_PCI_HOST |\
-       HRCWH_PCI1_ARBITER_ENABLE |\
-       HRCWH_PCICKDRV_ENABLE |\
-       HRCWH_CORE_ENABLE |\
-       HRCWH_FROM_0X00000100 |\
-       HRCWH_BOOTSEQ_DISABLE |\
-       HRCWH_SW_WATCHDOG_DISABLE |\
-       HRCWH_ROM_LOC_LOCAL_16BIT)
-#endif
-
-/*
- * System IO Config
- */
-#define CONFIG_SYS_SICRH               0x00000000
-#define CONFIG_SYS_SICRL               0x40000000
-
-#define CONFIG_BOARD_EARLY_INIT_F /* call board_pre_init */
-#define CONFIG_BOARD_EARLY_INIT_R
-
-/*
- * IMMR new address
- */
-#define CONFIG_SYS_IMMR                0xE0000000
-
-/*
- * DDR Setup
- */
-#define CONFIG_SYS_DDR_BASE    0x00000000 /* DDR is system memory */
-#define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_BASE
-                               /* + 256M */
-#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000)
-#define CONFIG_SYS_DDR_SDRAM_BASE      CONFIG_SYS_DDR_BASE
-#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN \
-                                       | DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-
-#define CONFIG_SYS_83XX_DDR_USES_CS0
-
-#define CONFIG_DDR_ECC         /* support DDR ECC function */
-#define CONFIG_DDR_ECC_CMD     /* Use DDR ECC user commands */
-
-/*
- * DDRCDR - DDR Control Driver Register
- */
-#define CONFIG_SYS_DDRCDR_VALUE        0x80080001
-
-#define CONFIG_SPD_EEPROM      /* Use SPD EEPROM for DDR setup */
-#if defined(CONFIG_SPD_EEPROM)
-/*
- * Determine DDR configuration from I2C interface.
- */
-#define SPD_EEPROM_ADDRESS     0x52 /* DDR SODIMM */
-#else
-/*
- * Manually set up DDR parameters
- */
-#define CONFIG_SYS_DDR_SIZE            256 /* MB */
-#if defined(CONFIG_DDR_II)
-#define CONFIG_SYS_DDRCDR              0x80080001
-#define CONFIG_SYS_DDR_CS0_BNDS                0x0000000f
-#define CONFIG_SYS_DDR_CS0_CONFIG      0x80330102
-#define CONFIG_SYS_DDR_TIMING_0                0x00220802
-#define CONFIG_SYS_DDR_TIMING_1                0x38357322
-#define CONFIG_SYS_DDR_TIMING_2                0x2f9048c8
-#define CONFIG_SYS_DDR_TIMING_3                0x00000000
-#define CONFIG_SYS_DDR_CLK_CNTL                0x02000000
-#define CONFIG_SYS_DDR_MODE            0x47d00432
-#define CONFIG_SYS_DDR_MODE2           0x8000c000
-#define CONFIG_SYS_DDR_INTERVAL                0x03cf0080
-#define CONFIG_SYS_DDR_SDRAM_CFG       0x43000000
-#define CONFIG_SYS_DDR_SDRAM_CFG2      0x00401000
-#else
-#define CONFIG_SYS_DDR_CS0_CONFIG      (CSCONFIG_EN \
-                                       | CSCONFIG_ROW_BIT_13 \
-                                       | CSCONFIG_COL_BIT_9)
-#define CONFIG_SYS_DDR_CS1_CONFIG      CONFIG_SYS_DDR_CS0_CONFIG
-#define CONFIG_SYS_DDR_TIMING_1        0x37344321 /* tCL-tRCD-tRP-tRAS=2.5-3-3-7 */
-#define CONFIG_SYS_DDR_TIMING_2        0x00000800 /* may need tuning */
-#define CONFIG_SYS_DDR_CONTROL 0x42008000 /* Self refresh,2T timing */
-#define CONFIG_SYS_DDR_MODE    0x20000162 /* DLL,normal,seq,4/2.5 */
-#define CONFIG_SYS_DDR_INTERVAL        0x045b0100 /* page mode */
-#endif
-#endif
-
-/*
- * Memory test
- */
-#undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
-
-/*
- * The reserved memory
- */
-
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE /* start of monitor */
-
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#define CONFIG_SYS_RAMBOOT
-#else
-#undef CONFIG_SYS_RAMBOOT
-#endif
-
-/* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */
-#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */
-#define CONFIG_SYS_MALLOC_LEN  (256 * 1024) /* Reserved for malloc */
-
-/*
- * Initial RAM Base Address Setup
- */
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR       0xE6000000 /* Initial RAM address */
-#define CONFIG_SYS_INIT_RAM_SIZE       0x1000 /* Size of used area in RAM */
-#define CONFIG_SYS_GBL_DATA_OFFSET     \
-                       (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-
-/*
- * Local Bus Configuration & Clock Setup
- */
-#define CONFIG_SYS_LCRR_DBYP   LCRR_DBYP
-#define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
-#define CONFIG_SYS_LBC_LBCR    0x00000000
-
-/*
- * FLASH on the Local Bus
- */
-#define CONFIG_SYS_FLASH_CFI           /* use the Common Flash Interface */
-#define CONFIG_FLASH_CFI_DRIVER                /* use the CFI driver */
-#define CONFIG_SYS_FLASH_BASE          0xFE000000 /* FLASH base address */
-#define CONFIG_SYS_FLASH_SIZE          32 /* max FLASH size is 32M */
-#define CONFIG_SYS_FLASH_PROTECTION    1 /* Use h/w Flash protection. */
-#define CONFIG_FLASH_SHOW_PROGRESS     45 /* count down from 45/5: 9..1 */
-
-                                       /* Window base at flash base */
-#define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
-
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | BR_PS_16      /* 16 bit port */ \
-                               | BR_MS_GPCM    /* MSEL = GPCM */ \
-                               | BR_V)         /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-                               | OR_GPCM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_ACS_DIV2 \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX_SET \
-                               | OR_GPCM_EHTR_SET \
-                               | OR_GPCM_EAD)
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
-#define CONFIG_SYS_MAX_FLASH_SECT      256 /* max sectors per device */
-
-#undef CONFIG_SYS_FLASH_CHECKSUM
-
-/*
- * BCSR on the Local Bus
- */
-#define CONFIG_SYS_BCSR                        0xF8000000
-                                       /* Access window base at BCSR base */
-#define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_BCSR
-#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_64KB)
-
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_BCSR \
-                               | BR_PS_8 \
-                               | BR_MS_GPCM \
-                               | BR_V)
-#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
-                               | OR_GPCM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX_SET \
-                               | OR_GPCM_EHTR_SET \
-                               | OR_GPCM_EAD)
-                               /* 0xFFFFE9F7 */
-
-/*
- * SDRAM on the Local Bus
- */
-#define CONFIG_SYS_LBC_SDRAM_BASE      0xF0000000      /* SDRAM base address */
-#define CONFIG_SYS_LBC_SDRAM_SIZE      64              /* LBC SDRAM is 64MB */
-
-#define CONFIG_SYS_LB_SDRAM            /* if board has SRDAM on local bus */
-
-#ifdef CONFIG_SYS_LB_SDRAM
-#define CONFIG_SYS_LBLAWBAR2           0
-#define CONFIG_SYS_LBLAWAR2            (LBLAWAR_EN | LBLAWAR_64MB)
-
-/*local bus BR2, OR2 definition for SDRAM if soldered on the EPB board */
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- *
- * For BR2, need:
- *    Base address = BR[0:16] = dynamic
- *    port size = 32-bits = BR2[19:20] = 11
- *    no parity checking = BR2[21:22] = 00
- *    SDRAM for MSEL = BR2[24:26] = 011
- *    Valid = BR[31] = 1
- *
- * 0   4    8    12   16   20   24   28
- * xxxx xxxx xxxx xxxx x001 1000 0110 0001 = 00001861
- */
-
-/* Port size=32bit, MSEL=DRAM */
-#define CONFIG_SYS_BR2 (BR_PS_32 | BR_MS_SDRAM | BR_V) /* 0xF0001861 */
-
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *    64MB mask for AM, OR2[0:7] = 1111 1100
- *                XAM, OR2[17:18] = 11
- *    9 columns OR2[19-21] = 010
- *    13 rows  OR2[23-25] = 100
- *    EAD set for extra time OR[31] = 1
- *
- * 0   4    8    12   16   20   24   28
- * 1111 1100 0000 0000 0110 1001 0000 0001 = fc006901
- */
-
-#define CONFIG_SYS_OR2 (MEG_TO_AM(CONFIG_SYS_LBC_SDRAM_SIZE) \
-                       | OR_SDRAM_XAM \
-                       | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
-                       | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
-                       | OR_SDRAM_EAD)
-                       /* 0xFC006901 */
-
-                               /* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT    0x32000000
-                               /* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR   0x20000000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON    0x0063b723
-
-/*
- * SDRAM Controller configuration sequence.
- */
-#define CONFIG_SYS_LBC_LSDMR_1 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_PCHALL)
-#define CONFIG_SYS_LBC_LSDMR_2 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_3 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_4 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW)
-#define CONFIG_SYS_LBC_LSDMR_5 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL)
-
-#endif
-
-/*
- * Windows to access Platform I/O Boards (PIB) via local bus
- */
-#define CONFIG_SYS_PIB_BASE            0xF8008000
-#define CONFIG_SYS_PIB_WINDOW_SIZE     (32 * 1024)
-
-/* [RFC] This LBLAW only covers the 2nd window (CS5) */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    \
-                       CONFIG_SYS_PIB_BASE + CONFIG_SYS_PIB_WINDOW_SIZE
-#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
-
-/*
- * CS4 on Local Bus, to PIB
- */
-                               /* CS4 base address at 0xf8008000 */
-#define CONFIG_SYS_BR4_PRELIM  (CONFIG_SYS_PIB_BASE \
-                               | BR_PS_8 \
-                               | BR_MS_GPCM \
-                               | BR_V)
-                               /* 0xF8008801 */
-#define CONFIG_SYS_OR4_PRELIM  (OR_AM_32KB \
-                               | OR_GPCM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX_SET \
-                               | OR_GPCM_EHTR_SET \
-                               | OR_GPCM_EAD)
-                               /* 0xffffe9f7 */
-
-/*
- * CS5 on Local Bus, to PIB
- */
-                               /* CS5 base address at 0xf8010000 */
-#define CONFIG_SYS_BR5_PRELIM  ((CONFIG_SYS_PIB_BASE + \
-                                               CONFIG_SYS_PIB_WINDOW_SIZE) \
-                               | BR_PS_8 \
-                               | BR_MS_GPCM \
-                               | BR_V)
-                               /* 0xF8010801 */
-#define CONFIG_SYS_OR5_PRELIM  (CONFIG_SYS_PIB_BASE \
-                               | OR_GPCM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX_SET \
-                               | OR_GPCM_EHTR_SET \
-                               | OR_GPCM_EAD)
-                               /* 0xffffe9f7 */
-
-/*
- * Serial Port
- */
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_BAUDRATE_TABLE  \
-               {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
-
-#define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
-#define CONFIG_AUTO_COMPLETE           /* add autocompletion support   */
-/* Use the HUSH parser */
-#define CONFIG_SYS_HUSH_PARSER
-
-/* pass open firmware flat tree */
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
-#define CONFIG_OF_STDOUT_VIA_ALIAS     1
-
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_SPEED       400000
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x52} }
-
-/*
- * Config on-board RTC
- */
-#define CONFIG_RTC_DS1374              /* use ds1374 rtc via i2c */
-#define CONFIG_SYS_I2C_RTC_ADDR        0x68    /* at address 0x68 */
-
-/*
- * General PCI
- * Addresses are mapped 1-1.
- */
-#define CONFIG_SYS_PCI1_MEM_BASE       0x80000000
-#define CONFIG_SYS_PCI1_MEM_PHYS       CONFIG_SYS_PCI1_MEM_BASE
-#define CONFIG_SYS_PCI1_MEM_SIZE       0x10000000 /* 256M */
-#define CONFIG_SYS_PCI1_MMIO_BASE      0x90000000
-#define CONFIG_SYS_PCI1_MMIO_PHYS      CONFIG_SYS_PCI1_MMIO_BASE
-#define CONFIG_SYS_PCI1_MMIO_SIZE      0x10000000 /* 256M */
-#define CONFIG_SYS_PCI1_IO_BASE                0x00000000
-#define CONFIG_SYS_PCI1_IO_PHYS                0xE0300000
-#define CONFIG_SYS_PCI1_IO_SIZE                0x100000 /* 1M */
-
-#define CONFIG_SYS_PCI_SLV_MEM_LOCAL   CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_PCI_SLV_MEM_BUS     0x00000000
-#define CONFIG_SYS_PCI_SLV_MEM_SIZE    0x80000000
-
-
-#ifdef CONFIG_PCI
-#define CONFIG_PCI_INDIRECT_BRIDGE
-
-#define CONFIG_PCI_PNP         /* do pci plug-and-play */
-#define CONFIG_83XX_PCI_STREAMING
-
-#undef CONFIG_EEPRO100
-#undef CONFIG_PCI_SCAN_SHOW    /* show pci devices on startup */
-#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1957  /* Freescale */
-
-#endif /* CONFIG_PCI */
-
-
-#define CONFIG_HWCONFIG                1
-
-/*
- * QE UEC ethernet configuration
- */
-#define CONFIG_UEC_ETH
-#define CONFIG_ETHPRIME                "UEC0"
-#define CONFIG_PHY_MODE_NEED_CHANGE
-
-#define CONFIG_UEC_ETH1                /* GETH1 */
-
-#ifdef CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM        0       /* UCC1 */
-#define CONFIG_SYS_UEC1_RX_CLK         QE_CLK_NONE
-#define CONFIG_SYS_UEC1_TX_CLK         QE_CLK9
-#define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR       0
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000
-#endif
-
-#define CONFIG_UEC_ETH2                /* GETH2 */
-
-#ifdef CONFIG_UEC_ETH2
-#define CONFIG_SYS_UEC2_UCC_NUM        1       /* UCC2 */
-#define CONFIG_SYS_UEC2_RX_CLK         QE_CLK_NONE
-#define CONFIG_SYS_UEC2_TX_CLK         QE_CLK4
-#define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
-#define CONFIG_SYS_UEC2_PHY_ADDR       1
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_ID
-#define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000
-#endif
-
-/*
- * Environment
- */
-
-#ifndef CONFIG_SYS_RAMBOOT
-       #define CONFIG_ENV_IS_IN_FLASH  1
-       #define CONFIG_ENV_ADDR         \
-                       (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
-       #define CONFIG_ENV_SECT_SIZE    0x20000
-       #define CONFIG_ENV_SIZE         0x2000
-#else
-       #define CONFIG_SYS_NO_FLASH     1       /* Flash is not usable now */
-       #define CONFIG_ENV_IS_NOWHERE   1       /* Store ENV in memory only */
-       #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE - 0x1000)
-       #define CONFIG_ENV_SIZE         0x2000
-#endif
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
-
-/*
- * 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>
-
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_SDRAM
-
-#if defined(CONFIG_PCI)
-    #define CONFIG_CMD_PCI
-#endif
-
-#if defined(CONFIG_SYS_RAMBOOT)
-    #undef CONFIG_CMD_SAVEENV
-    #undef CONFIG_CMD_LOADS
-#endif
-
-
-#undef CONFIG_WATCHDOG         /* watchdog disabled */
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-#define CONFIG_SYS_LOAD_ADDR           0x2000000 /* default load address */
-
-#if defined(CONFIG_CMD_KGDB)
-       #define CONFIG_SYS_CBSIZE       1024 /* Console I/O Buffer Size */
-#else
-       #define CONFIG_SYS_CBSIZE       256 /* Console I/O Buffer Size */
-#endif
-
-                               /* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-#define CONFIG_SYS_MAXARGS     16      /* max number of command args */
-                               /* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 256 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (256 << 20) /* Initial Memory map for Linux */
-
-/*
- * Core HID Setup
- */
-#define CONFIG_SYS_HID0_INIT   0x000000000
-#define CONFIG_SYS_HID0_FINAL  (HID0_ENABLE_MACHINE_CHECK | \
-                                HID0_ENABLE_INSTRUCTION_CACHE)
-#define CONFIG_SYS_HID2                HID2_HBE
-
-/*
- * MMU Setup
- */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-#define CONFIG_BAT_RW
-
-/* DDR/LBC SDRAM: cacheable */
-#define CONFIG_SYS_IBAT0L      (CONFIG_SYS_SDRAM_BASE \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT0U      (CONFIG_SYS_SDRAM_BASE \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT0L      CONFIG_SYS_IBAT0L
-#define CONFIG_SYS_DBAT0U      CONFIG_SYS_IBAT0U
-
-/* IMMRBAR & PCI IO: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT1L      (CONFIG_SYS_IMMR \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT1U      (CONFIG_SYS_IMMR \
-                               | BATU_BL_4M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT1L      CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U      CONFIG_SYS_IBAT1U
-
-/* BCSR: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT2L      (CONFIG_SYS_BCSR \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT2U      (CONFIG_SYS_BCSR \
-                               | BATU_BL_128K \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT2L      CONFIG_SYS_IBAT2L
-#define CONFIG_SYS_DBAT2U      CONFIG_SYS_IBAT2U
-
-/* FLASH: icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_FLASH_BASE \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT3U      (CONFIG_SYS_FLASH_BASE \
-                               | BATU_BL_32M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_FLASH_BASE \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U      CONFIG_SYS_IBAT3U
-
-/* DDR/LBC SDRAM next 256M: cacheable */
-#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_SDRAM_BASE2 \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT4U      (CONFIG_SYS_SDRAM_BASE2 \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT4L      CONFIG_SYS_IBAT4L
-#define CONFIG_SYS_DBAT4U      CONFIG_SYS_IBAT4U
-
-/* Stack in dcache: cacheable, no memory coherence */
-#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
-#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_INIT_RAM_ADDR \
-                               | BATU_BL_128K \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT5L      CONFIG_SYS_IBAT5L
-#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
-
-#ifdef CONFIG_PCI
-/* PCI MEM space: cacheable */
-#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_PCI1_MEM_PHYS \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_PCI1_MEM_PHYS \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT6L      CONFIG_SYS_IBAT6L
-#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
-/* PCI MMIO space: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT7L      (CONFIG_SYS_PCI1_MMIO_PHYS \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT7U      (CONFIG_SYS_PCI1_MMIO_PHYS \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
-#else
-#define CONFIG_SYS_IBAT6L      (0)
-#define CONFIG_SYS_IBAT6U      (0)
-#define CONFIG_SYS_IBAT7L      (0)
-#define CONFIG_SYS_IBAT7U      (0)
-#define CONFIG_SYS_DBAT6L      CONFIG_SYS_IBAT6L
-#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
-#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
-#endif
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#endif
-
-/*
- * Environment Configuration
- */
-
-#define CONFIG_ENV_OVERWRITE
-
-#if defined(CONFIG_UEC_ETH)
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-#endif
-
-#define CONFIG_BAUDRATE 115200
-
-#define CONFIG_LOADADDR 800000 /* default location for tftp and bootm */
-
-#define CONFIG_BOOTDELAY 6     /* -1 disables auto-boot */
-#undef CONFIG_BOOTARGS         /* the boot command will set bootargs */
-
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       "netdev=eth0\0"                                                 \
-       "consoledev=ttyS0\0"                                            \
-       "ramdiskaddr=1000000\0"                                         \
-       "ramdiskfile=ramfs.83xx\0"                                      \
-       "fdtaddr=780000\0"                                              \
-       "fdtfile=mpc836x_mds.dtb\0"                                     \
-       ""
-
-#define CONFIG_NFSBOOTCOMMAND                                          \
-       "setenv bootargs root=/dev/nfs rw "                             \
-               "nfsroot=$serverip:$rootpath "                          \
-               "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:"   \
-                                                       "$netdev:off "  \
-               "console=$consoledev,$baudrate $othbootargs;"           \
-       "tftp $loadaddr $bootfile;"                                     \
-       "tftp $fdtaddr $fdtfile;"                                       \
-       "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_RAMBOOTCOMMAND                                          \
-       "setenv bootargs root=/dev/ram rw "                             \
-               "console=$consoledev,$baudrate $othbootargs;"           \
-       "tftp $ramdiskaddr $ramdiskfile;"                               \
-       "tftp $loadaddr $bootfile;"                                     \
-       "tftp $fdtaddr $fdtfile;"                                       \
-       "bootm $loadaddr $ramdiskaddr $fdtaddr"
-
-
-#define CONFIG_BOOTCOMMAND CONFIG_NFSBOOTCOMMAND
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/MPC8360ERDK.h b/include/configs/MPC8360ERDK.h
deleted file mode 100644 (file)
index 1b8bad1..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <daveliu@freescale.com>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <peterb@logicpd.com>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_E300            1 /* E300 family */
-#define CONFIG_QE              1 /* Has QE */
-#define CONFIG_MPC8360         1 /* MPC8360 CPU specific */
-#define CONFIG_MPC8360ERDK     1 /* MPC8360ERDK board specific */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFF800000
-
-/*
- * System Clock Setup
- */
-#ifdef CONFIG_CLKIN_33MHZ
-#define CONFIG_83XX_CLKIN              33333333
-#define CONFIG_SYS_CLK_FREQ            33333333
-#define CONFIG_PCI_33M                         1
-#define HRCWL_CSB_TO_CLKIN_MPC8360ERDK HRCWL_CSB_TO_CLKIN_10X1
-#else
-#define CONFIG_83XX_CLKIN              66000000
-#define CONFIG_SYS_CLK_FREQ            66000000
-#define CONFIG_PCI_66M                         1
-#define HRCWL_CSB_TO_CLKIN_MPC8360ERDK HRCWL_CSB_TO_CLKIN_5X1
-#endif /* CONFIG_CLKIN_33MHZ */
-
-/*
- * Hardware Reset Configuration Word
- */
-#define CONFIG_SYS_HRCW_LOW (\
-       HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
-       HRCWL_DDR_TO_SCB_CLK_1X1 |\
-       HRCWL_CSB_TO_CLKIN_MPC8360ERDK |\
-       HRCWL_CORE_TO_CSB_2X1 |\
-       HRCWL_CE_TO_PLL_1X15)
-
-#define CONFIG_SYS_HRCW_HIGH (\
-       HRCWH_PCI_HOST |\
-       HRCWH_PCI1_ARBITER_ENABLE |\
-       HRCWH_PCICKDRV_ENABLE |\
-       HRCWH_CORE_ENABLE |\
-       HRCWH_FROM_0X00000100 |\
-       HRCWH_BOOTSEQ_DISABLE |\
-       HRCWH_SW_WATCHDOG_DISABLE |\
-       HRCWH_ROM_LOC_LOCAL_16BIT |\
-       HRCWH_SECONDARY_DDR_DISABLE |\
-       HRCWH_BIG_ENDIAN |\
-       HRCWH_LALE_EARLY)
-
-/*
- * System IO Config
- */
-#define CONFIG_SYS_SICRH               0x00000000
-#define CONFIG_SYS_SICRL               0x40000000
-
-#define CONFIG_BOARD_EARLY_INIT_R
-
-/*
- * IMMR new address
- */
-#define CONFIG_SYS_IMMR                0xE0000000
-
-/*
- * DDR Setup
- */
-#define CONFIG_SYS_DDR_BASE            0x00000000 /* DDR is system memory */
-#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_BASE
-#define CONFIG_SYS_DDR_SDRAM_BASE      CONFIG_SYS_DDR_BASE
-#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN \
-                                       | DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-
-#define CONFIG_SYS_83XX_DDR_USES_CS0
-
-#define CONFIG_DDR_ECC         /* support DDR ECC function */
-#define CONFIG_DDR_ECC_CMD     /* Use DDR ECC user commands */
-
-/*
- * DDRCDR - DDR Control Driver Register
- */
-#define CONFIG_SYS_DDRCDR_VALUE        (DDRCDR_DHC_EN \
-                               | DDRCDR_ODT \
-                               | DDRCDR_Q_DRN)
-                               /* 0x80080001 */
-
-#undef CONFIG_SPD_EEPROM       /* Do not use SPD EEPROM for DDR setup */
-
-/*
- * Manually set up DDR parameters
- */
-#define CONFIG_DDR_II
-#define CONFIG_SYS_DDR_SIZE            256 /* MB */
-#define CONFIG_SYS_DDR_CS0_BNDS                0x0000000f
-#define CONFIG_SYS_DDR_CS0_CONFIG      (CSCONFIG_EN \
-                                       | CSCONFIG_ROW_BIT_13 \
-                                       | CSCONFIG_COL_BIT_10 \
-                                       | CSCONFIG_ODT_WR_ONLY_CURRENT)
-#define CONFIG_SYS_DDR_SDRAM_CFG       (SDRAM_CFG_SDRAM_TYPE_DDR2 \
-                                       | SDRAM_CFG_ECC_EN)
-#define CONFIG_SYS_DDR_SDRAM_CFG2      0x00001000
-#define CONFIG_SYS_DDR_CLK_CNTL                (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-#define CONFIG_SYS_DDR_INTERVAL                ((256 << SDRAM_INTERVAL_BSTOPRE_SHIFT) \
-                                       | (1115 << SDRAM_INTERVAL_REFINT_SHIFT))
-#define CONFIG_SYS_DDR_MODE            0x47800432
-#define CONFIG_SYS_DDR_MODE2           0x8000c000
-
-#define CONFIG_SYS_DDR_TIMING_0        ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
-                                (9 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
-                                (3 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
-                                (3 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
-                                (0 << TIMING_CFG0_WWT_SHIFT) | \
-                                (0 << TIMING_CFG0_RRT_SHIFT) | \
-                                (0 << TIMING_CFG0_WRT_SHIFT) | \
-                                (0 << TIMING_CFG0_RWT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_1        ((TIMING_CFG1_CASLAT_30) | \
-                                (2 << TIMING_CFG1_WRTORD_SHIFT) | \
-                                (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
-                                (3 << TIMING_CFG1_WRREC_SHIFT) | \
-                                (10 << TIMING_CFG1_REFREC_SHIFT) | \
-                                (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
-                                (8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
-                                (3 << TIMING_CFG1_PRETOACT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_2        ((9 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
-                                (4 << TIMING_CFG2_CKE_PLS_SHIFT) | \
-                                (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
-                                (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
-                                (2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
-                                (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
-                                (0 << TIMING_CFG2_CPO_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_3        0x00000000
-
-/*
- * Memory test
- */
-#undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
-
-/*
- * The reserved memory
- */
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE /* start of monitor */
-#define CONFIG_SYS_FLASH_BASE          0xFF800000 /* FLASH base address */
-
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#define CONFIG_SYS_RAMBOOT
-#else
-#undef CONFIG_SYS_RAMBOOT
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */
-#define CONFIG_SYS_MALLOC_LEN  (256 * 1024) /* Reserved for malloc */
-
-/*
- * Initial RAM Base Address Setup
- */
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR       0xE6000000 /* Initial RAM address */
-#define CONFIG_SYS_INIT_RAM_SIZE       0x1000 /* Size of used area in RAM */
-#define CONFIG_SYS_GBL_DATA_OFFSET     \
-                       (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-
-/*
- * Local Bus Configuration & Clock Setup
- */
-#define CONFIG_SYS_LCRR_DBYP   LCRR_DBYP
-#define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
-#define CONFIG_SYS_LBC_LBCR    0x00000000
-
-/*
- * FLASH on the Local Bus
- */
-#define CONFIG_SYS_FLASH_CFI           /* use the Common Flash Interface */
-#define CONFIG_FLASH_CFI_DRIVER                /* use the CFI driver */
-#define CONFIG_SYS_FLASH_SIZE          8 /* max FLASH size is 32M */
-#define CONFIG_SYS_FLASH_PROTECTION    1 /* Use intel Flash protection. */
-
-                                       /* Window base at flash base */
-#define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
-
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | BR_PS_16      /* 16 bit port */ \
-                               | BR_MS_GPCM    /* MSEL = GPCM */ \
-                               | BR_V)         /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-                               | OR_UPM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_ACS_DIV2 \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX_SET \
-                               | OR_GPCM_EHTR_SET \
-                               | OR_GPCM_EAD)
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
-#define CONFIG_SYS_MAX_FLASH_SECT      256 /* max sectors per device */
-
-#undef CONFIG_SYS_FLASH_CHECKSUM
-
-/*
- * NAND flash on the local bus
- */
-#define CONFIG_SYS_NAND_BASE           0x60000000
-#define CONFIG_CMD_NAND                1
-#define CONFIG_NAND_FSL_UPM    1
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
-
-#define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-/*
- * [RFC] Comment said 4KB window; code said 256MB window; OR1 says 64MB
- * ... What's correct?
- */
-#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-
-/* Port size 8 bit, UPMA */
-#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_NAND_BASE \
-                                       | BR_PS_8 \
-                                       | BR_MS_UPMA \
-                                       | BR_V)
-                                       /* 0x60000881 */
-#define CONFIG_SYS_OR1_PRELIM          (OR_AM_64MB | OR_UPM_EAD)
-                                       /* 0xFC000001 */
-
-/*
- * Fujitsu MB86277 (MINT) graphics controller
- */
-#define CONFIG_SYS_VIDEO_BASE          0x70000000
-
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_VIDEO_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
-
-/* Port size 32 bit, UPMB */
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_VIDEO_BASE \
-                               | BR_PS_32 \
-                               | BR_MS_UPMB \
-                               | BR_V)
-                               /* 0x000018a1 */
-#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB | OR_UPM_EAD)
-                               /* 0xFC000001 */
-
-/*
- * Serial Port
- */
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_BAUDRATE_TABLE  \
-               {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
-
-#define CONFIG_CMDLINE_EDITING 1       /* add command line history */
-#define CONFIG_AUTO_COMPLETE           /* add autocompletion support */
-/* Use the HUSH parser */
-#define CONFIG_SYS_HUSH_PARSER
-
-/* Pass open firmware flat tree */
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
-#define CONFIG_OF_STDOUT_VIA_ALIAS
-
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_SPEED       400000
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_FSL_I2C2_SPEED      400000
-#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
-#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
-#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x52} }
-
-/*
- * General PCI
- * Addresses are mapped 1-1.
- */
-#define CONFIG_PCI
-
-#define CONFIG_SYS_PCI1_MEM_BASE       0x80000000
-#define CONFIG_SYS_PCI1_MEM_PHYS       CONFIG_SYS_PCI1_MEM_BASE
-#define CONFIG_SYS_PCI1_MEM_SIZE       0x10000000 /* 256M */
-#define CONFIG_SYS_PCI1_MMIO_BASE      0x90000000
-#define CONFIG_SYS_PCI1_MMIO_PHYS      CONFIG_SYS_PCI1_MMIO_BASE
-#define CONFIG_SYS_PCI1_MMIO_SIZE      0x10000000 /* 256M */
-#define CONFIG_SYS_PCI1_IO_BASE                0xE0300000
-#define CONFIG_SYS_PCI1_IO_PHYS                0xE0300000
-#define CONFIG_SYS_PCI1_IO_SIZE                0x100000 /* 1M */
-
-#ifdef CONFIG_PCI
-#define CONFIG_PCI_INDIRECT_BRIDGE
-
-#define CONFIG_PCI_PNP         /* do pci plug-and-play */
-
-#undef CONFIG_EEPRO100
-#undef CONFIG_PCI_SCAN_SHOW    /* show pci devices on startup */
-#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1957  /* Freescale */
-
-#endif /* CONFIG_PCI */
-
-/*
- * QE UEC ethernet configuration
- */
-#define CONFIG_UEC_ETH
-#define CONFIG_ETHPRIME                "UEC0"
-
-#define CONFIG_UEC_ETH1                /* GETH1 */
-
-#ifdef CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM        0       /* UCC1 */
-#define CONFIG_SYS_UEC1_RX_CLK         QE_CLK_NONE
-#define CONFIG_SYS_UEC1_TX_CLK         QE_CLK9
-#define CONFIG_SYS_UEC1_ETH_TYPE       GIGA_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR       2
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_RXID
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED        1000
-#endif
-
-#define CONFIG_UEC_ETH2                /* GETH2 */
-
-#ifdef CONFIG_UEC_ETH2
-#define CONFIG_SYS_UEC2_UCC_NUM        1       /* UCC2 */
-#define CONFIG_SYS_UEC2_RX_CLK         QE_CLK_NONE
-#define CONFIG_SYS_UEC2_TX_CLK         QE_CLK4
-#define CONFIG_SYS_UEC2_ETH_TYPE       GIGA_ETH
-#define CONFIG_SYS_UEC2_PHY_ADDR       4
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RGMII_RXID
-#define CONFIG_SYS_UEC2_INTERFACE_SPEED        1000
-#endif
-
-/*
- * Environment
- */
-
-#ifndef CONFIG_SYS_RAMBOOT
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR        (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env */
-#define CONFIG_ENV_SIZE                0x20000
-#else /* CONFIG_SYS_RAMBOOT */
-#define CONFIG_SYS_NO_FLASH    1       /* Flash is not usable now */
-#define CONFIG_ENV_IS_NOWHERE  1       /* Store ENV in memory only */
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - 0x1000)
-#define CONFIG_ENV_SIZE                0x2000
-#endif /* CONFIG_SYS_RAMBOOT */
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
-
-/*
- * 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>
-
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_DHCP
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_PCI
-#endif
-
-#if defined(CONFIG_SYS_RAMBOOT)
-#undef CONFIG_CMD_SAVEENV
-#undef CONFIG_CMD_LOADS
-#endif
-
-#undef CONFIG_WATCHDOG         /* watchdog disabled */
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-#define CONFIG_SYS_LOAD_ADDR           0x2000000 /* default load address */
-
-#if defined(CONFIG_CMD_KGDB)
-       #define CONFIG_SYS_CBSIZE       1024 /* Console I/O Buffer Size */
-#else
-       #define CONFIG_SYS_CBSIZE       256 /* Console I/O Buffer Size */
-#endif
-
-                               /* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-#define CONFIG_SYS_MAXARGS     16      /* max number of command args */
-                               /* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 256 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (256 << 20) /* Initial Memory map for Linux */
-
-/*
- * Core HID Setup
- */
-#define CONFIG_SYS_HID0_INIT   0x000000000
-#define CONFIG_SYS_HID0_FINAL  (HID0_ENABLE_MACHINE_CHECK | \
-                                HID0_ENABLE_INSTRUCTION_CACHE)
-#define CONFIG_SYS_HID2                HID2_HBE
-
-/*
- * MMU Setup
- */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/* DDR: cache cacheable */
-#define CONFIG_SYS_IBAT0L      (CONFIG_SYS_SDRAM_BASE \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT0U      (CONFIG_SYS_SDRAM_BASE \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT0L      CONFIG_SYS_IBAT0L
-#define CONFIG_SYS_DBAT0U      CONFIG_SYS_IBAT0U
-
-/* IMMRBAR & PCI IO: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT1L      (CONFIG_SYS_IMMR \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT1U      (CONFIG_SYS_IMMR \
-                               | BATU_BL_4M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT1L      CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U      CONFIG_SYS_IBAT1U
-
-/* NAND: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT2L      (CONFIG_SYS_NAND_BASE \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT2U      (CONFIG_SYS_NAND_BASE \
-                               | BATU_BL_64M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT2L      CONFIG_SYS_IBAT2L
-#define CONFIG_SYS_DBAT2U      CONFIG_SYS_IBAT2U
-
-/* FLASH: icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_FLASH_BASE \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT3U      (CONFIG_SYS_FLASH_BASE \
-                               | BATU_BL_32M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_FLASH_BASE \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U      CONFIG_SYS_IBAT3U
-
-/* Stack in dcache: cacheable, no memory coherence */
-#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_INIT_RAM_ADDR \
-                               | BATL_PP_RW)
-#define CONFIG_SYS_IBAT4U      (CONFIG_SYS_INIT_RAM_ADDR \
-                               | BATU_BL_128K \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT4L      CONFIG_SYS_IBAT4L
-#define CONFIG_SYS_DBAT4U      CONFIG_SYS_IBAT4U
-
-#define CONFIG_SYS_IBAT5L      (CONFIG_SYS_VIDEO_BASE \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT5U      (CONFIG_SYS_VIDEO_BASE \
-                               | BATU_BL_64M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT5L      CONFIG_SYS_IBAT5L
-#define CONFIG_SYS_DBAT5U      CONFIG_SYS_IBAT5U
-
-#ifdef CONFIG_PCI
-/* PCI MEM space: cacheable */
-#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_PCI1_MEM_PHYS \
-                               | BATL_PP_RW \
-                               | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_PCI1_MEM_PHYS \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT6L      CONFIG_SYS_IBAT6L
-#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
-/* PCI MMIO space: cache-inhibit and guarded */
-#define CONFIG_SYS_IBAT7L      (CONFIG_SYS_PCI1_MMIO_PHYS \
-                               | BATL_PP_RW \
-                               | BATL_CACHEINHIBIT \
-                               | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT7U      (CONFIG_SYS_PCI1_MMIO_PHYS \
-                               | BATU_BL_256M \
-                               | BATU_VS \
-                               | BATU_VP)
-#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
-#else /* CONFIG_PCI */
-#define CONFIG_SYS_IBAT6L      (0)
-#define CONFIG_SYS_IBAT6U      (0)
-#define CONFIG_SYS_IBAT7L      (0)
-#define CONFIG_SYS_IBAT7U      (0)
-#define CONFIG_SYS_DBAT6L      CONFIG_SYS_IBAT6L
-#define CONFIG_SYS_DBAT6U      CONFIG_SYS_IBAT6U
-#define CONFIG_SYS_DBAT7L      CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U      CONFIG_SYS_IBAT7U
-#endif /* CONFIG_PCI */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
-#endif
-
-/*
- * Environment Configuration
- */
-#define CONFIG_ENV_OVERWRITE
-
-#if defined(CONFIG_UEC_ETH)
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-#define CONFIG_HAS_ETH2
-#define CONFIG_HAS_ETH3
-#endif
-
-#define CONFIG_BAUDRATE 115200
-
-#define CONFIG_LOADADDR        a00000
-#define CONFIG_HOSTNAME        mpc8360erdk
-#define CONFIG_BOOTFILE        "uImage"
-
-#define CONFIG_ROOTPATH                "/nfsroot/"
-
-#define        CONFIG_BOOTDELAY 2      /* -1 disables auto-boot */
-#undef CONFIG_BOOTARGS         /* the boot command will set bootargs */
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "netdev=eth0\0"                                                 \
-       "consoledev=ttyS0\0"                                            \
-       "loadaddr=a00000\0"                                             \
-       "fdtaddr=900000\0"                                              \
-       "fdtfile=mpc836x_rdk.dtb\0"                                     \
-       "fsfile=fs\0"                                                   \
-       "ubootfile=u-boot.bin\0"                                        \
-       "mtdparts=mtdparts=60000000.nand-flash:4096k(kernel),128k(dtb),"\
-                                                       "-(rootfs)\0"   \
-       "setbootargs=setenv bootargs console=$consoledev,$baudrate "    \
-               "$mtdparts panic=1\0"                                   \
-       "adddhcpargs=setenv bootargs $bootargs ip=on\0"                 \
-       "addnfsargs=setenv bootargs $bootargs ip=$ipaddr:$serverip:"    \
-               "$gatewayip:$netmask:$hostname:$netdev:off "            \
-               "root=/dev/nfs rw nfsroot=$serverip:$rootpath\0"        \
-       "addnandargs=setenv bootargs $bootargs root=/dev/mtdblock3 "    \
-               "rootfstype=jffs2 rw\0"                                 \
-       "tftp_get_uboot=tftp 100000 $ubootfile\0"                       \
-       "tftp_get_kernel=tftp $loadaddr $bootfile\0"                    \
-       "tftp_get_dtb=tftp $fdtaddr $fdtfile\0"                         \
-       "tftp_get_fs=tftp c00000 $fsfile\0"                             \
-       "nand_erase_kernel=nand erase 0 400000\0"                       \
-       "nand_erase_dtb=nand erase 400000 20000\0"                      \
-       "nand_erase_fs=nand erase 420000 3be0000\0"                     \
-       "nand_write_kernel=nand write.jffs2 $loadaddr 0 400000\0"       \
-       "nand_write_dtb=nand write.jffs2 $fdtaddr 400000 20000\0"       \
-       "nand_write_fs=nand write.jffs2 c00000 420000 $filesize\0"      \
-       "nand_read_kernel=nand read.jffs2 $loadaddr 0 400000\0"         \
-       "nand_read_dtb=nand read.jffs2 $fdtaddr 400000 20000\0"         \
-       "nor_reflash=protect off ff800000 ff87ffff ; "                  \
-               "erase ff800000 ff87ffff ; "                            \
-               "cp.b 100000 ff800000 $filesize\0"                      \
-       "nand_reflash_kernel=run tftp_get_kernel nand_erase_kernel "    \
-               "nand_write_kernel\0"                                   \
-       "nand_reflash_dtb=run tftp_get_dtb nand_erase_dtb nand_write_dtb\0"\
-       "nand_reflash_fs=run tftp_get_fs nand_erase_fs nand_write_fs\0" \
-       "nand_reflash=run nand_reflash_kernel nand_reflash_dtb "        \
-               "nand_reflash_fs\0"                                     \
-       "boot_m=bootm $loadaddr - $fdtaddr\0"                           \
-       "dhcpboot=dhcp ; run setbootargs adddhcpargs tftp_get_dtb boot_m\0"\
-       "nfsboot=run setbootargs addnfsargs tftp_get_kernel tftp_get_dtb "\
-               "boot_m\0"                                              \
-       "nandboot=run setbootargs addnandargs nand_read_kernel nand_read_dtb "\
-               "boot_m\0"                                              \
-       ""
-
-#define CONFIG_BOOTCOMMAND "run dhcpboot"
-
-#endif /* __CONFIG_H */
index 8ed0f7c21afee03ee22fb1ab50c4e93860a8cf6e..19e0e30eef1cea5241a9d4c182a44c5ac6d8c4b8 100644 (file)
@@ -15,6 +15,8 @@
 #define CONFIG_E300            1 /* E300 family */
 #define CONFIG_MPC837x         1 /* MPC837x CPU specific */
 #define CONFIG_MPC837XERDB     1
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_SYS_GENERIC_BOARD
 
 #define        CONFIG_SYS_TEXT_BASE    0xFE000000
 
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
deleted file mode 100644 (file)
index c75638a..0000000
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * P1 P2 RDB board configuration file
- * This file is intended to address a set of Low End and Ultra Low End
- * Freescale SOCs of QorIQ series(RDB platforms).
- * Currently only P2020RDB
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#ifdef CONFIG_36BIT
-#define CONFIG_PHYS_64BIT
-#endif
-
-#ifdef CONFIG_P1011RDB
-#define CONFIG_P1011
-#define CONFIG_SYS_L2_SIZE     (256 << 10)
-#endif
-#ifdef CONFIG_P1020RDB
-#define CONFIG_P1020
-#define CONFIG_SYS_L2_SIZE     (256 << 10)
-#endif
-#ifdef CONFIG_P2010RDB
-#define CONFIG_P2010
-#define CONFIG_SYS_L2_SIZE     (512 << 10)
-#endif
-#ifdef CONFIG_P2020RDB
-#define CONFIG_P2020
-#define CONFIG_SYS_L2_SIZE     (512 << 10)
-#endif
-
-#ifdef CONFIG_SDCARD
-#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
-#define CONFIG_SPL_ENV_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_MMC_SUPPORT
-#define CONFIG_SPL_MMC_MINIMAL
-#define CONFIG_SPL_FLUSH_IMAGE
-#define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SYS_TEXT_BASE           0x11001000
-#define CONFIG_SPL_TEXT_BASE           0xf8f81000
-#define CONFIG_SPL_PAD_TO              0x20000
-#define CONFIG_SPL_MAX_SIZE            (128 * 1024)
-#define CONFIG_SYS_MMC_U_BOOT_SIZE     (768 << 10)
-#define CONFIG_SYS_MMC_U_BOOT_DST      (0x11000000)
-#define CONFIG_SYS_MMC_U_BOOT_START    (0x11000000)
-#define CONFIG_SYS_MMC_U_BOOT_OFFS     (129 << 10)
-#define CONFIG_SYS_MPC85XX_NO_RESETVEC
-#define CONFIG_SYS_LDSCRIPT    "arch/powerpc/cpu/mpc85xx/u-boot.lds"
-#define CONFIG_SPL_MMC_BOOT
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SPL_COMMON_INIT_DDR
-#endif
-#endif
-
-#ifdef CONFIG_SPIFLASH
-#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
-#define CONFIG_SPL_ENV_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_SPI_SUPPORT
-#define CONFIG_SPL_SPI_FLASH_SUPPORT
-#define CONFIG_SPL_SPI_FLASH_MINIMAL
-#define CONFIG_SPL_FLUSH_IMAGE
-#define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SYS_TEXT_BASE           0x11001000
-#define CONFIG_SPL_TEXT_BASE           0xf8f81000
-#define CONFIG_SPL_PAD_TO              0x20000
-#define CONFIG_SPL_MAX_SIZE            (128 * 1024)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE       (768 << 10)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST                (0x11000000)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_START      (0x11000000)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS       (128 << 10)
-#define CONFIG_SYS_MPC85XX_NO_RESETVEC
-#define CONFIG_SYS_LDSCRIPT    "arch/powerpc/cpu/mpc85xx/u-boot.lds"
-#define CONFIG_SPL_SPI_BOOT
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SPL_COMMON_INIT_DDR
-#endif
-#endif
-
-#ifdef CONFIG_NAND
-#ifdef CONFIG_TPL_BUILD
-#define CONFIG_SPL_NAND_BOOT
-#define CONFIG_SPL_FLUSH_IMAGE
-#define CONFIG_SPL_ENV_SUPPORT
-#define CONFIG_SPL_NAND_INIT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
-#define CONFIG_SPL_COMMON_INIT_DDR
-#define CONFIG_SPL_MAX_SIZE            (128 << 10)
-#define CONFIG_SPL_TEXT_BASE           0xf8f81000
-#define CONFIG_SYS_MPC85XX_NO_RESETVEC
-#define CONFIG_SYS_NAND_U_BOOT_SIZE    (832 << 10)
-#define CONFIG_SYS_NAND_U_BOOT_DST     (0x11000000)
-#define CONFIG_SYS_NAND_U_BOOT_START   (0x11000000)
-#define CONFIG_SYS_NAND_U_BOOT_OFFS    ((128 + 128) << 10)
-#elif defined(CONFIG_SPL_BUILD)
-#define CONFIG_SPL_INIT_MINIMAL
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_FLUSH_IMAGE
-#define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
-#define CONFIG_SPL_TEXT_BASE           0xff800000
-#define CONFIG_SPL_MAX_SIZE            4096
-#define CONFIG_SYS_NAND_U_BOOT_SIZE    (128 << 10)
-#define CONFIG_SYS_NAND_U_BOOT_DST     0xf8f80000
-#define CONFIG_SYS_NAND_U_BOOT_START   0xf8f80000
-#define CONFIG_SYS_NAND_U_BOOT_OFFS    (128 << 10)
-#endif /* not CONFIG_TPL_BUILD */
-
-#define CONFIG_SPL_PAD_TO              0x20000
-#define CONFIG_TPL_PAD_TO              0x20000
-#define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
-#define CONFIG_SYS_TEXT_BASE           0x11001000
-#define CONFIG_SYS_LDSCRIPT    "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds"
-#endif
-
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE           0xeff40000
-#endif
-
-#ifndef CONFIG_RESET_VECTOR_ADDRESS
-#define CONFIG_RESET_VECTOR_ADDRESS    0xeffffffc
-#endif
-
-#ifndef CONFIG_SYS_MONITOR_BASE
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SPL_TEXT_BASE
-#else
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE    /* start of monitor */
-#endif
-#endif
-
-/* High Level Configuration Options */
-#define CONFIG_BOOKE           1       /* BOOKE */
-#define CONFIG_E500            1       /* BOOKE e500 family */
-#define CONFIG_FSL_ELBC                1       /* Enable eLBC Support */
-
-#define CONFIG_PCI             1       /* Enable PCI/PCIE */
-#if defined(CONFIG_PCI)
-#define CONFIG_PCIE1           1       /* PCIE controler 1 (slot 1) */
-#define CONFIG_PCIE2           1       /* PCIE controler 2 (slot 2) */
-#define CONFIG_FSL_PCI_INIT    1       /* Use common FSL init code */
-#define CONFIG_PCI_INDIRECT_BRIDGE 1   /* indirect PCI bridge support */
-#define CONFIG_FSL_PCIE_RESET  1       /* need PCIe reset errata */
-#define CONFIG_SYS_PCI_64BIT   1       /* enable 64-bit PCI resources */
-#endif /* #if defined(CONFIG_PCI) */
-#define CONFIG_FSL_LAW         1       /* Use common FSL init code */
-#define CONFIG_TSEC_ENET               /* tsec ethernet support */
-#define CONFIG_ENV_OVERWRITE
-
-#if defined(CONFIG_PCI)
-#define CONFIG_E1000           1       /*  E1000 pci Ethernet card*/
-#endif
-
-#ifndef __ASSEMBLY__
-extern unsigned long get_board_sys_clk(unsigned long dummy);
-#endif
-#define CONFIG_DDR_CLK_FREQ    66666666 /* DDRCLK on P1_P2 RDB */
-#define CONFIG_SYS_CLK_FREQ    get_board_sys_clk(0) /*sysclk for P1_P2 RDB */
-
-#if defined(CONFIG_P2020) || defined(CONFIG_P1020)
-#define CONFIG_MP
-#endif
-
-#define CONFIG_HWCONFIG
-
-/*
- * These can be toggled for performance analysis, otherwise use default.
- */
-#define CONFIG_L2_CACHE                        /* toggle L2 cache */
-#define CONFIG_BTB                     /* toggle branch predition */
-
-#define CONFIG_ADDR_STREAMING          /* toggle addr streaming */
-
-#define CONFIG_ENABLE_36BIT_PHYS       1
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_ADDR_MAP                        1
-#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_END         0x1fffffff
-#define CONFIG_PANIC_HANG      /* do not reset board on panic */
-
-/*
- * Config the L2 Cache as L2 SRAM
-*/
-#if defined(CONFIG_SPL_BUILD)
-#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
-#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
-#define CONFIG_SYS_INIT_L2_END (CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
-#define CONFIG_SPL_RELOC_TEXT_BASE     0xf8f81000
-#define CONFIG_SPL_GD_ADDR             (CONFIG_SYS_INIT_L2_ADDR + 112 * 1024)
-#define CONFIG_SPL_RELOC_STACK         (CONFIG_SYS_INIT_L2_ADDR + 116 * 1024)
-#define CONFIG_SPL_RELOC_STACK_SIZE    (32 << 10)
-#define CONFIG_SPL_RELOC_MALLOC_ADDR   (CONFIG_SYS_INIT_L2_ADDR + 148 * 1024)
-#if defined(CONFIG_P2020RDB)
-#define CONFIG_SPL_RELOC_MALLOC_SIZE   (364 << 10)
-#else
-#define CONFIG_SPL_RELOC_MALLOC_SIZE   (108 << 10)
-#endif
-#elif defined(CONFIG_NAND)
-#ifdef CONFIG_TPL_BUILD
-#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
-#define CONFIG_SYS_INIT_L2_END (CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
-#define CONFIG_SPL_RELOC_TEXT_BASE     0xf8f81000
-#define CONFIG_SPL_RELOC_STACK         (CONFIG_SYS_INIT_L2_ADDR + 192 * 1024)
-#define CONFIG_SPL_RELOC_MALLOC_ADDR   (CONFIG_SYS_INIT_L2_ADDR + 208 * 1024)
-#define CONFIG_SPL_RELOC_MALLOC_SIZE   (48 << 10)
-#define CONFIG_SPL_GD_ADDR             (CONFIG_SYS_INIT_L2_ADDR + 176 * 1024)
-#else
-#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
-#define CONFIG_SYS_INIT_L2_END (CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
-#define CONFIG_SPL_RELOC_TEXT_BASE     (CONFIG_SYS_INIT_L2_END - 0x2000)
-#define CONFIG_SPL_RELOC_STACK         ((CONFIG_SYS_INIT_L2_END - 1) & ~0xF)
-#endif /* CONFIG_TPL_BUILD */
-#endif
-#endif
-
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_CCSR_DO_NOT_RELOCATE
-#endif
-
-/* DDR Setup */
-#define CONFIG_SYS_FSL_DDR2
-#undef CONFIG_FSL_DDR_INTERACTIVE
-#undef CONFIG_SPD_EEPROM               /* Use SPD EEPROM for DDR setup */
-
-#define CONFIG_MEM_INIT_VALUE  0xDeadBeef
-
-#if defined(CONFIG_P1011RDB) || defined(CONFIG_P1020RDB)
-/*
- * P1020 and it's derivatives support max 32bit DDR width
- * So Reduce available DDR size
-*/
-#define CONFIG_SYS_SDRAM_SIZE  512
-#else
-#define CONFIG_SYS_SDRAM_SIZE  1024
-#endif
-#define CONFIG_SYS_DDR_SDRAM_BASE      0x00000000
-#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
-
-#define CONFIG_NUM_DDR_CONTROLLERS     1
-#define CONFIG_DIMM_SLOTS_PER_CTLR     1
-#define CONFIG_CHIP_SELECTS_PER_CTRL   1
-
-#define CONFIG_SYS_DDR_ERR_INT_EN      0x0000000d
-#define CONFIG_SYS_DDR_ERR_DIS         0x00000000
-#define CONFIG_SYS_DDR_SBE             0x00FF0000
-
-/*
- * Memory map
- *
- * 0x0000_0000 0x3fff_ffff     DDR                     1G cacheablen
- * 0x8000_0000  0xbfff_ffff    PCI Express Mem         1G non-cacheable
- * 0xffc0_0000  0xffc3_ffff    PCI IO range            256k non-cacheable
- *
- * Localbus cacheable (TBD)
- * 0xXXXX_XXXX 0xXXXX_XXXX     SRAM                    YZ M Cacheable
- *
- * Localbus non-cacheable
- * 0xef00_0000 0xefff_ffff     FLASH                   16M non-cacheable
- * 0xffa0_0000 0xffaf_ffff     NAND                    1M non-cacheable
- * 0xffb0_0000 0xffbf_ffff     VSC7385 switch          1M non-cacheable
- * 0xffd0_0000 0xffd0_3fff     L1 for stack            16K Cacheable TLB0
- * 0xffe0_0000 0xffef_ffff     CCSR                    1M non-cacheable
- */
-
-/*
- * Local Bus Definitions
- */
-#define CONFIG_SYS_FLASH_BASE          0xef000000      /* start of FLASH 16M */
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_FLASH_BASE_PHYS     0xfef000000ull
-#else
-#define CONFIG_SYS_FLASH_BASE_PHYS     CONFIG_SYS_FLASH_BASE
-#endif
-
-#define CONFIG_FLASH_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
-                                       BR_PS_16 | BR_V)
-#define CONFIG_FLASH_OR_PRELIM         0xff000ff7
-
-#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE_PHYS}
-#define CONFIG_SYS_FLASH_QUIET_TEST
-#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
-#define CONFIG_SYS_MAX_FLASH_SECT      128     /* sectors per device */
-#undef CONFIG_SYS_FLASH_CHECKSUM
-#define CONFIG_SYS_FLASH_ERASE_TOUT    60000   /* Flash Erase Timeout (ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (ms) */
-
-#define CONFIG_FLASH_CFI_DRIVER
-#define CONFIG_SYS_FLASH_CFI
-#define CONFIG_SYS_FLASH_EMPTY_INFO
-#define CONFIG_SYS_FLASH_AMD_CHECK_DQ7
-
-#define CONFIG_BOARD_EARLY_INIT_R      /* call board_early_init_r function */
-#define CONFIG_MISC_INIT_R
-#define CONFIG_HWCONFIG
-
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR      0xffd00000       /* stack in RAM */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR
-/* The assembler doesn't like typecast */
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
-       ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
-         CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
-#else
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS  CONFIG_SYS_INIT_RAM_ADDR /* Initial L1 address */
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
-#endif
-#define CONFIG_SYS_INIT_RAM_SIZE       0x00004000      /* Size of used area in RAM */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE \
-                                               - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_LEN         (768 * 1024)
-#define CONFIG_SYS_MALLOC_LEN          (1024 * 1024)   /* Reserved for malloc*/
-
-#define CONFIG_SYS_NAND_BASE           0xff800000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_NAND_BASE_PHYS      0xfff800000ull
-#else
-#define CONFIG_SYS_NAND_BASE_PHYS      CONFIG_SYS_NAND_BASE
-#endif
-
-#define CONFIG_CMD_NAND
-#define CONFIG_SYS_NAND_BASE_LIST      {CONFIG_SYS_NAND_BASE}
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
-#define CONFIG_NAND_FSL_ELBC           1
-#define CONFIG_SYS_NAND_BLOCK_SIZE     (16 * 1024)
-
-/* NAND flash config */
-#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8       /* Port Size = 8 bit */ \
-                               | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)                 /* valid */
-
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFF80000     /* length 32K */ \
-                               | OR_FCM_CSCT \
-                               | OR_FCM_CST \
-                               | OR_FCM_CHT \
-                               | OR_FCM_SCY_1 \
-                               | OR_FCM_TRLX \
-                               | OR_FCM_EHTR)
-
-#ifdef CONFIG_NAND
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
-#define CONFIG_SYS_BR1_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
-#define CONFIG_SYS_OR1_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#else
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR1_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
-#define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
-#endif
-
-#define CONFIG_SYS_VSC7385_BASE        0xffb00000
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_VSC7385_BASE_PHYS   0xfffb00000ull
-#else
-#define CONFIG_SYS_VSC7385_BASE_PHYS   CONFIG_SYS_VSC7385_BASE
-#endif
-
-#define CONFIG_SYS_BR2_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_VSC7385_BASE) \
-                                                       | BR_PS_8 | BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB | OR_GPCM_CSNT | OR_GPCM_XACS | \
-                               OR_GPCM_SCY_15 | OR_GPCM_SETA | OR_GPCM_TRLX | \
-                               OR_GPCM_EHTR | OR_GPCM_EAD)
-
-/* Serial Port - controlled on board with jumper J8
- * open - index 2
- * shorted - index 1
- */
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL)
-#define CONFIG_NS16550_MIN_FUNCTIONS
-#endif
-
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV   /* determine from environment */
-
-#define CONFIG_SYS_BAUDRATE_TABLE      \
-       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400,115200}
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_CCSRBAR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
-
-/* Use the HUSH parser */
-#define CONFIG_SYS_HUSH_PARSER
-
-/*
- * Pass open firmware flat tree
- */
-#define CONFIG_OF_LIBFDT               1
-#define CONFIG_OF_BOARD_SETUP          1
-#define CONFIG_OF_STDOUT_VIA_ALIAS     1
-
-/* new uImage format support */
-#define CONFIG_FIT             1
-#define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
-
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_FSL_I2C_SPEED       400000
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
-#define CONFIG_SYS_FSL_I2C2_SPEED      400000
-#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
-#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
-
-/*
- * I2C2 EEPROM
- */
-#define CONFIG_ID_EEPROM
-#ifdef CONFIG_ID_EEPROM
-#define CONFIG_SYS_I2C_EEPROM_NXID
-#endif
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x52
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_EEPROM_BUS_NUM      1
-
-#define CONFIG_SYS_I2C_PCA9557_ADDR    0x18
-
-#define CONFIG_RTC_DS1337
-#define CONFIG_SYS_RTC_DS1337_NOOSC
-#define CONFIG_SYS_I2C_RTC_ADDR                0x68
-
-/* eSPI - Enhanced SPI */
-#define CONFIG_FSL_ESPI
-#define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_SPANSION
-#define CONFIG_CMD_SF
-#define CONFIG_SF_DEFAULT_SPEED                10000000
-#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
-
-/*
- * General PCI
- * Memory space is mapped 1-1, but I/O space must start from 0.
- */
-
-#if defined(CONFIG_PCI)
-/* controller 2, Slot 2, tgtid 2, Base address 9000 */
-#define CONFIG_SYS_PCIE2_NAME          "Slot 1"
-#define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE2_MEM_BUS       0xc0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
-#else
-#define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
-#endif
-#define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
-#define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
-#else
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
-#endif
-#define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
-
-/* controller 1, Slot 1, tgtid 1, Base address a000 */
-#define CONFIG_SYS_PCIE1_NAME          "Slot 2"
-#define CONFIG_SYS_PCIE1_MEM_VIRT      0x80000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
-#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc00000000ull
-#else
-#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
-#define CONFIG_SYS_PCIE1_MEM_PHYS      0x80000000
-#endif
-#define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE1_IO_VIRT       0xffc00000
-#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE1_IO_PHYS       0xfffc00000ull
-#else
-#define CONFIG_SYS_PCIE1_IO_PHYS       0xffc00000
-#endif
-#define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
-
-#define CONFIG_PCI_PNP                 /* do pci plug-and-play */
-
-#undef CONFIG_EEPRO100
-#undef CONFIG_TULIP
-#undef CONFIG_RTL8139
-
-#ifdef CONFIG_RTL8139
-/* This macro is used by RTL8139 but not defined in PPC architecture */
-#define KSEG1ADDR(x)           (x)
-#define _IO_BASE       0x00000000
-#endif
-
-
-#define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup */
-#define CONFIG_DOS_PARTITION
-
-#endif /* CONFIG_PCI */
-
-
-#if defined(CONFIG_TSEC_ENET)
-#define CONFIG_MII             1       /* MII PHY management */
-#define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
-#define CONFIG_TSEC1   1
-#define CONFIG_TSEC1_NAME      "eTSEC1"
-#define CONFIG_TSEC2   1
-#define CONFIG_TSEC2_NAME      "eTSEC2"
-#define CONFIG_TSEC3   1
-#define CONFIG_TSEC3_NAME      "eTSEC3"
-
-#define TSEC1_PHY_ADDR         2
-#define TSEC2_PHY_ADDR         0
-#define TSEC3_PHY_ADDR         1
-
-#define CONFIG_VSC7385_ENET
-
-#define TSEC1_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC2_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC3_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-
-#define TSEC1_PHYIDX           0
-#define TSEC2_PHYIDX           0
-#define TSEC3_PHYIDX           0
-
-/* Vitesse 7385 */
-
-#ifdef CONFIG_VSC7385_ENET
-/* The size of the VSC7385 firmware image */
-#define CONFIG_VSC7385_IMAGE_SIZE      8192
-#endif
-
-#define CONFIG_ETHPRIME                "eTSEC1"
-
-#define CONFIG_PHY_GIGE                1       /* Include GbE speed/duplex detection */
-
-#endif /* CONFIG_TSEC_ENET */
-
-/*
- * Environment
- */
-#ifdef CONFIG_SPIFLASH
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_SPI_BUS     0
-#define CONFIG_ENV_SPI_CS      0
-#define CONFIG_ENV_SPI_MAX_HZ  10000000
-#define CONFIG_ENV_SPI_MODE    0
-#define CONFIG_ENV_SIZE                0x2000  /* 8KB */
-#define CONFIG_ENV_OFFSET      0x100000        /* 1MB */
-#define CONFIG_ENV_SECT_SIZE   0x10000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_INIT_L2_ADDR + (160 << 10))
-#elif defined(CONFIG_SDCARD)
-#define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_FSL_FIXED_MMC_LOCATION
-#define CONFIG_ENV_SIZE                0x2000
-#define CONFIG_SYS_MMC_ENV_DEV 0
-#define CONFIG_ENV_OFFSET      (512 * 0x800)
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_INIT_L2_ADDR + (160 << 10))
-#elif defined(CONFIG_NAND)
-#ifdef CONFIG_TPL_BUILD
-#define CONFIG_ENV_SIZE                0x2000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_INIT_L2_ADDR + (160 << 10))
-#else
-#define CONFIG_ENV_SIZE                CONFIG_SYS_NAND_BLOCK_SIZE
-#endif
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET      (1024 * 1024)
-#define CONFIG_ENV_RANGE       (3 * CONFIG_ENV_SIZE)
-#elif defined(CONFIG_SYS_RAMBOOT)
-#define CONFIG_ENV_IS_NOWHERE  /* Store ENV in memory only */
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - 0x1000)
-#define CONFIG_ENV_SIZE                0x2000
-#else
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR        (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE                0x2000
-#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K (one sector) */
-#endif
-
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_SETEXPR
-#define CONFIG_CMD_REGINFO
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_PCI
-#endif
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled */
-
-#define CONFIG_MMC     1
-
-#ifdef CONFIG_MMC
-#define CONFIG_BOARD_EARLY_INIT_F      1       /* Call board_pre_init */
-#define CONFIG_CMD_MMC
-#define CONFIG_DOS_PARTITION
-#define CONFIG_FSL_ESDHC
-#define CONFIG_GENERIC_MMC
-#define CONFIG_SYS_FSL_ESDHC_ADDR      CONFIG_SYS_MPC85xx_ESDHC_ADDR
-#ifdef CONFIG_P2020
-#define CONFIG_SYS_FSL_ESDHC_USE_PIO /* P2020 eSDHC DMA is not functional*/
-#endif
-#endif
-
-#define CONFIG_HAS_FSL_DR_USB
-
-#if defined(CONFIG_HAS_FSL_DR_USB)
-#define CONFIG_USB_EHCI
-
-#ifdef CONFIG_USB_EHCI
-#define CONFIG_CMD_USB
-#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
-#define CONFIG_USB_EHCI_FSL
-#define CONFIG_USB_STORAGE
-#endif
-#endif
-
-#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI)
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_DOS_PARTITION
-#endif
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory */
-#define CONFIG_CMDLINE_EDITING                 /* Command-line editing */
-#define CONFIG_AUTO_COMPLETE                   /* add autocompletion support */
-#define CONFIG_SYS_LOAD_ADDR   0x2000000       /* default load address */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-                                               /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS     16              /* max number of command args */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE/* Boot Argument Buffer Size */
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 64 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)/* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#endif
-
-/*
- * Environment Configuration
- */
-
-#if defined(CONFIG_TSEC_ENET)
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-#define CONFIG_HAS_ETH2
-#endif
-
-#define CONFIG_HOSTNAME                P2020RDB
-#define CONFIG_ROOTPATH                "/opt/nfsroot"
-#define CONFIG_BOOTFILE                "uImage"
-#define CONFIG_UBOOTPATH       u-boot.bin/* U-Boot image on TFTP server */
-
-/* default location for tftp and bootm */
-#define CONFIG_LOADADDR                1000000
-
-#define CONFIG_BOOTDELAY 10    /* -1 disables auto-boot */
-#undef  CONFIG_BOOTARGS                /* the boot command will set bootargs */
-
-#define CONFIG_BAUDRATE        115200
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                               \
-       "netdev=eth0\0"                                         \
-       "uboot=" __stringify(CONFIG_UBOOTPATH) "\0"             \
-       "loadaddr=1000000\0"                                    \
-       "tftpflash=tftpboot $loadaddr $uboot; "                 \
-               "protect off " __stringify(CONFIG_SYS_TEXT_BASE)        \
-                       " +$filesize; " \
-               "erase " __stringify(CONFIG_SYS_TEXT_BASE)              \
-                       " +$filesize; " \
-               "cp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE)     \
-                       " $filesize; "  \
-               "protect on " __stringify(CONFIG_SYS_TEXT_BASE)         \
-                       " +$filesize; " \
-               "cmp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE)    \
-                       " $filesize\0"  \
-       "consoledev=ttyS0\0"                            \
-       "ramdiskaddr=2000000\0"                 \
-       "ramdiskfile=rootfs.ext2.gz.uboot\0"            \
-       "fdtaddr=c00000\0"                              \
-       "fdtfile=p2020rdb.dtb\0"                \
-       "bdev=sda1\0"   \
-       "jffs2nor=mtdblock3\0"  \
-       "norbootaddr=ef080000\0"        \
-       "norfdtaddr=ef040000\0" \
-       "jffs2nand=mtdblock9\0" \
-       "nandbootaddr=100000\0" \
-       "nandfdtaddr=80000\0"           \
-       "nandimgsize=400000\0"          \
-       "nandfdtsize=80000\0"           \
-       "hwconfig=usb1:dr_mode=host,phy_type=ulpi\0"    \
-       "vscfw_addr=ef000000\0" \
-       "othbootargs=ramdisk_size=600000\0" \
-       "usbfatboot=setenv bootargs root=/dev/ram rw "  \
-       "console=$consoledev,$baudrate $othbootargs; "  \
-       "usb start;"                    \
-       "fatload usb 0:2 $loadaddr $bootfile;"          \
-       "fatload usb 0:2 $fdtaddr $fdtfile;"    \
-       "fatload usb 0:2 $ramdiskaddr $ramdiskfile;"    \
-       "bootm $loadaddr $ramdiskaddr $fdtaddr\0"               \
-       "usbext2boot=setenv bootargs root=/dev/ram rw " \
-       "console=$consoledev,$baudrate $othbootargs; "  \
-       "usb start;"                    \
-       "ext2load usb 0:4 $loadaddr $bootfile;"         \
-       "ext2load usb 0:4 $fdtaddr $fdtfile;"   \
-       "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;"   \
-       "bootm $loadaddr $ramdiskaddr $fdtaddr\0"               \
-       "norboot=setenv bootargs root=/dev/$jffs2nor rw "       \
-       "console=$consoledev,$baudrate rootfstype=jffs2 $othbootargs;"  \
-       "bootm $norbootaddr - $norfdtaddr\0"            \
-       "nandboot=setenv bootargs root=/dev/$jffs2nand rw rootfstype=jffs2 " \
-       "console=$consoledev,$baudrate $othbootargs;"   \
-       "nand read 2000000 $nandbootaddr $nandimgsize;" \
-       "nand read 3000000 $nandfdtaddr $nandfdtsize;"  \
-       "bootm 2000000 - 3000000;\0"
-
-#define CONFIG_NFSBOOTCOMMAND          \
-       "setenv bootargs root=/dev/nfs rw "     \
-       "nfsroot=$serverip:$rootpath "          \
-       "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
-       "console=$consoledev,$baudrate $othbootargs;"   \
-       "tftp $loadaddr $bootfile;"             \
-       "tftp $fdtaddr $fdtfile;"               \
-       "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_HDBOOT                  \
-       "setenv bootargs root=/dev/$bdev rw rootdelay=30 "      \
-       "console=$consoledev,$baudrate $othbootargs;"   \
-       "usb start;"                    \
-       "ext2load usb 0:1 $loadaddr /boot/$bootfile;"           \
-       "ext2load usb 0:1 $fdtaddr /boot/$fdtfile;"     \
-       "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_RAMBOOTCOMMAND          \
-       "setenv bootargs root=/dev/ram rw "     \
-       "console=$consoledev,$baudrate $othbootargs; "  \
-       "tftp $ramdiskaddr $ramdiskfile;"       \
-       "tftp $loadaddr $bootfile;"             \
-       "tftp $fdtaddr $fdtfile;"               \
-       "bootm $loadaddr $ramdiskaddr $fdtaddr"
-
-#define CONFIG_BOOTCOMMAND             CONFIG_HDBOOT
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/P2020COME.h b/include/configs/P2020COME.h
deleted file mode 100644 (file)
index d414b84..0000000
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright 2009-2010,2012 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/* The P2020COME board is only booted via the Freescale On-Chip ROM */
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-
-#define CONFIG_SYS_TEXT_BASE           0xf8f80000
-#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
-
-#ifdef CONFIG_SDCARD
-#define CONFIG_RAMBOOT_SDCARD          1
-#endif
-
-#ifdef CONFIG_SPIFLASH
-#define CONFIG_RAMBOOT_SPIFLASH                1
-#endif
-
-#ifndef CONFIG_SYS_MONITOR_BASE
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE    /* start of monitor */
-#endif
-
-/* High Level Configuration Options */
-#define CONFIG_BOOKE           1       /* BOOKE */
-#define CONFIG_E500            1       /* BOOKE e500 family */
-#define CONFIG_P2020           1
-#define CONFIG_P2020COME       1
-#define CONFIG_FSL_ELBC                1       /* Enable eLBC Support */
-#define CONFIG_MP
-
-#define CONFIG_PCI             1       /* Enable PCI/PCIE */
-#if defined(CONFIG_PCI)
-#define CONFIG_PCIE1           1       /* PCIE controller 1 (slot 1) */
-#define CONFIG_PCIE2           1       /* PCIE controller 2 (slot 2) */
-#define CONFIG_PCIE3           1       /* PCIE controller 3 (slot 3) */
-
-#define CONFIG_FSL_PCI_INIT    1       /* Use common FSL init code */
-#define CONFIG_PCI_INDIRECT_BRIDGE 1   /* indirect PCI bridge support */
-#define CONFIG_FSL_PCIE_RESET  1       /* need PCIe reset errata */
-#define CONFIG_SYS_PCI_64BIT   1       /* enable 64-bit PCI resources */
-#endif /* #if defined(CONFIG_PCI) */
-#define CONFIG_FSL_LAW         1       /* Use common FSL init code */
-#define CONFIG_TSEC_ENET               /* tsec ethernet support */
-#define CONFIG_ENV_OVERWRITE
-
-#if defined(CONFIG_PCI)
-#define CONFIG_E1000           1       /* E1000 pci Ethernet card */
-#endif
-
-#ifndef __ASSEMBLY__
-extern unsigned long get_board_ddr_clk(unsigned long dummy);
-extern unsigned long get_board_sys_clk(unsigned long dummy);
-#endif
-
-/*
- * For P2020COME DDRCLK and SYSCLK are from the same oscillator
- * For DA phase the SYSCLK is 66MHz
- * For EA phase the SYSCLK is 100MHz
- */
-#define CONFIG_DDR_CLK_FREQ    get_board_ddr_clk(0)
-#define CONFIG_SYS_CLK_FREQ    get_board_sys_clk(0)
-
-#define CONFIG_HWCONFIG
-
-/*
- * These can be toggled for performance analysis, otherwise use default.
- */
-#define CONFIG_L2_CACHE                        /* toggle L2 cache */
-#define CONFIG_BTB                     /* toggle branch prediction */
-
-#define CONFIG_ADDR_STREAMING          /* toggle addr streaming */
-
-#define CONFIG_ENABLE_36BIT_PHYS       1
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_ADDR_MAP                        1
-#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_END         0x1fffffff
-#define CONFIG_PANIC_HANG      /* do not reset board on panic */
-
- /*
-  * Config the L2 Cache as L2 SRAM
-  */
-#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   0xff8f80000ull
-#else
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
-#endif
-#define CONFIG_SYS_L2_SIZE             (512 << 10)
-#define CONFIG_SYS_INIT_L2_END         (CONFIG_SYS_INIT_L2_ADDR \
-                                       + CONFIG_SYS_L2_SIZE)
-
-#define CONFIG_SYS_CCSRBAR             0xffe00000
-#define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
-
-/* DDR Setup */
-#define CONFIG_SYS_FSL_DDR3
-#define CONFIG_SPD_EEPROM              /* Use SPD EEPROM for DDR setup */
-#define CONFIG_DDR_SPD
-
-#define CONFIG_DDR_ECC
-#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
-#define CONFIG_MEM_INIT_VALUE          0xdeadbeef
-
-#define CONFIG_SYS_SDRAM_SIZE          2048ULL /* DDR size on P2020COME */
-#define CONFIG_SYS_DDR_SDRAM_BASE      0x00000000
-#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
-
-#define CONFIG_NUM_DDR_CONTROLLERS     1
-#define CONFIG_DIMM_SLOTS_PER_CTLR     1
-#define CONFIG_CHIP_SELECTS_PER_CTRL   2
-
-#define CONFIG_SYS_DDR_ERR_INT_EN      0x0000000d
-#define CONFIG_SYS_DDR_ERR_DIS         0x00000000
-#define CONFIG_SYS_DDR_SBE             0x00ff0000
-
-#define CONFIG_SYS_SPD_BUS_NUM         1
-#define SPD_EEPROM_ADDRESS             0x53
-
-/*
- * Memory map
- *
- * 0x0000_0000 0x7fff_ffff     DDR3                    2G Cacheable
- * 0x8000_0000 0x9fff_ffff     PCI Express 3 Mem       1G non-cacheable
- * 0xa000_0000 0xbfff_ffff     PCI Express 2 Mem       1G non-cacheable
- * 0xc000_0000 0xdfff_ffff     PCI Express 1 Mem       1G non-cacheable
- * 0xffc1_0000 0xffc1_ffff     PCI Express 3 IO        64K non-cacheable
- * 0xffc2_0000 0xffc2_ffff     PCI Express 2 IO        64K non-cacheable
- * 0xffc3_0000 0xffc3_ffff     PCI Express 1 IO        64K non-cacheable
- *
- * 0xffd0_0000 0xffd0_3fff     L1 for stack            16K Cacheable TLB0
- * 0xffe0_0000 0xffef_ffff     CCSR                    1M non-cacheable
- */
-
-/*
- * Local Bus Definitions
- */
-
-/* There is no NOR Flash on P2020COME */
-#define CONFIG_SYS_NO_FLASH
-
-#define CONFIG_BOARD_EARLY_INIT_R      /* call board_early_init_r function */
-#define CONFIG_HWCONFIG
-
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR       0xffd00000      /* stack in RAM */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH     0xf
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW      CONFIG_SYS_INIT_RAM_ADDR
-/* the assembler doesn't like typecast */
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
-       ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
-         CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
-#else
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS  CONFIG_SYS_INIT_RAM_ADDR
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
-#endif
-#define CONFIG_SYS_INIT_RAM_SIZE       0x00004000
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE \
-                                               - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
-#define CONFIG_SYS_MALLOC_LEN          (1024 * 1024)
-
-/* Serial Port - controlled on board with jumper J8
- * open - index 2
- * shorted - index 1
- */
-#define CONFIG_CONS_INDEX              1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV   /* determine from environment */
-
-#define CONFIG_SYS_BAUDRATE_TABLE   \
-       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_CCSRBAR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
-
-/* Use the HUSH parser */
-#define CONFIG_SYS_HUSH_PARSER
-
-/*
- * Pass open firmware flat tree
- */
-#define CONFIG_OF_LIBFDT               1
-#define CONFIG_OF_BOARD_SETUP          1
-#define CONFIG_OF_STDOUT_VIA_ALIAS     1
-
-/* new uImage format support */
-#define CONFIG_FIT                     1
-#define CONFIG_FIT_VERBOSE             1
-
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_SPEED       400000
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_FSL_I2C2_SPEED      400000
-#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
-#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
-#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
-
-/*
- * I2C2 EEPROM
- */
-#define CONFIG_ID_EEPROM
-#ifdef CONFIG_ID_EEPROM
-#define CONFIG_SYS_I2C_EEPROM_NXID
-#endif
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
-#define CONFIG_SYS_I2C_EEPROM_ADDR2    0x18
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_EEPROM_BUS_NUM      0
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10 /* and takes up to 10 msec */
-
-/*
- * eSPI - Enhanced SPI
- */
-#define CONFIG_FSL_ESPI
-#define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_STMICRO
-#define CONFIG_CMD_SF
-#define CONFIG_SF_DEFAULT_SPEED                10000000
-#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
-
-/*
- * General PCI
- * Memory space is mapped 1-1, but I/O space must start from 0.
- */
-#if defined(CONFIG_PCI)
-
-/* controller 3, Slot 3, tgtid 3, Base address 8000 */
-#define CONFIG_SYS_PCIE3_MEM_VIRT      0x80000000
-#define CONFIG_SYS_PCIE3_MEM_BUS       0x80000000
-#define CONFIG_SYS_PCIE3_MEM_PHYS      0x80000000
-#define CONFIG_SYS_PCIE3_MEM_SIZE      0x20000000  /* 512M */
-#define CONFIG_SYS_PCIE3_IO_VIRT       0xffc10000
-#define CONFIG_SYS_PCIE3_IO_BUS                0x00000000
-#define CONFIG_SYS_PCIE3_IO_PHYS       0xffc10000
-#define CONFIG_SYS_PCIE3_IO_SIZE       0x00010000  /* 64k */
-
-/* controller 2, Slot 2, tgtid 2, Base address 9000 */
-#define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000  /* 512M */
-#define CONFIG_SYS_PCIE2_IO_VIRT       0xffc20000
-#define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc20000
-#define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000  /* 64k */
-
-/* controller 1, Slot 1, tgtid 1, Base address a000 */
-#define CONFIG_SYS_PCIE1_MEM_VIRT      0xc0000000
-#define CONFIG_SYS_PCIE1_MEM_BUS       0xc0000000
-#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc0000000
-#define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000  /* 512M */
-#define CONFIG_SYS_PCIE1_IO_VIRT       0xffc30000
-#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
-#define CONFIG_SYS_PCIE1_IO_PHYS       0xffc30000
-#define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000  /* 64k */
-
-#define CONFIG_PCI_PNP                 /* do pci plug-and-play */
-
-#undef CONFIG_EEPRO100
-#undef CONFIG_TULIP
-#undef CONFIG_RTL8139
-
-#ifdef CONFIG_RTL8139
-/* This macro is used by RTL8139 but not defined in PPC architecture */
-#define KSEG1ADDR(x)           (x)
-#define _IO_BASE               0x00000000
-#endif
-
-#define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup */
-#define CONFIG_DOS_PARTITION
-
-#endif /* CONFIG_PCI */
-
-#if defined(CONFIG_TSEC_ENET)
-#define CONFIG_MII             1       /* MII PHY management */
-#define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
-#define CONFIG_TSEC1           1
-#define CONFIG_TSEC1_NAME      "eTSEC1"
-#define CONFIG_TSEC2           1
-#define CONFIG_TSEC2_NAME      "eTSEC2"
-#define CONFIG_TSEC3           1
-#define CONFIG_TSEC3_NAME      "eTSEC3"
-
-#define TSEC1_PHY_ADDR         0
-#define TSEC2_PHY_ADDR         2
-#define TSEC3_PHY_ADDR         1
-
-#undef CONFIG_VSC7385_ENET
-
-#define TSEC1_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC2_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC3_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-
-#define TSEC1_PHYIDX           0
-#define TSEC2_PHYIDX           0
-#define TSEC3_PHYIDX           0
-
-#define CONFIG_ETHPRIME                "eTSEC1"
-
-#define CONFIG_PHY_GIGE                1       /* Include GbE speed/duplex detection */
-
-#endif /* CONFIG_TSEC_ENET */
-
-/*
- * Environment
- */
-#if defined(CONFIG_RAMBOOT_SDCARD)
-       #define CONFIG_ENV_IS_IN_MMC    1
-       #define CONFIG_FSL_FIXED_MMC_LOCATION
-       #define CONFIG_ENV_SIZE         0x2000
-       #define CONFIG_SYS_MMC_ENV_DEV  0
-#elif defined(CONFIG_RAMBOOT_SPIFLASH)
-       #define CONFIG_ENV_IS_IN_SPI_FLASH
-       #define CONFIG_ENV_SPI_BUS      0
-       #define CONFIG_ENV_SPI_CS       0
-       #define CONFIG_ENV_SPI_MAX_HZ   10000000
-       #define CONFIG_ENV_SPI_MODE     0
-       #define CONFIG_ENV_OFFSET       0x100000        /* 1MB */
-       #define CONFIG_ENV_SECT_SIZE    0x10000
-       #define CONFIG_ENV_SIZE         0x2000
-#endif
-
-#define CONFIG_LOADS_ECHO              1
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_SETEXPR
-#define CONFIG_CMD_REGINFO
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_PCI
-#endif
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled */
-
-#define CONFIG_MMC     1
-
-#ifdef CONFIG_MMC
-#define CONFIG_BOARD_EARLY_INIT_F      1       /* Call board_pre_init */
-#define CONFIG_CMD_MMC
-#define CONFIG_DOS_PARTITION
-#define CONFIG_FSL_ESDHC
-#define CONFIG_GENERIC_MMC
-#define CONFIG_SYS_FSL_ESDHC_ADDR      CONFIG_SYS_MPC85xx_ESDHC_ADDR
-#define CONFIG_SYS_FSL_ESDHC_BROKEN_TIMEOUT
-#endif /* CONFIG_MMC */
-
-#define CONFIG_HAS_FSL_DR_USB
-#ifdef CONFIG_HAS_FSL_DR_USB
-#define CONFIG_USB_EHCI
-
-#ifdef CONFIG_USB_EHCI
-#define CONFIG_CMD_USB
-#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
-#define CONFIG_USB_EHCI_FSL
-#define CONFIG_USB_STORAGE
-#endif
-#endif
-
-#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI)
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_DOS_PARTITION
-#endif
-
-/* Misc Extra Settings */
-#define CONFIG_CMD_DHCP                        1
-
-#define CONFIG_CMD_DATE                        1
-#define CONFIG_RTC_M41T62              1
-#define CONFIG_SYS_RTC_BUS_NUM         1
-#define CONFIG_SYS_I2C_RTC_ADDR                0x68
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory */
-#define CONFIG_CMDLINE_EDITING                 /* Command-line editing */
-#define CONFIG_AUTO_COMPLETE   1               /* add autocompletion support */
-#define CONFIG_SYS_LOAD_ADDR   0x2000000       /* default load address */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size */
-#endif
-#define CONFIG_SYS_PBSIZE      (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
-                                               /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS     16              /* max number of command args */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE/* Boot Argument Buffer Size */
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 64 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)
-#define CONFIG_SYS_BOOTM_LEN   (64 << 20)
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#endif
-
-/*
- * Environment Configuration
- */
-
-/* The mac addresses for all ethernet interface */
-#if defined(CONFIG_TSEC_ENET)
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-#define CONFIG_HAS_ETH2
-#define CONFIG_HAS_ETH3
-#endif
-
-#define CONFIG_HOSTNAME                unknown
-#define CONFIG_ROOTPATH                "/opt/nfsroot"
-#define CONFIG_BOOTFILE                "uImage"
-#define CONFIG_UBOOTPATH       u-boot.bin
-
-/* default location for tftp and bootm */
-#define CONFIG_LOADADDR                1000000
-
-#define CONFIG_BOOTDELAY       10      /* -1 disables auto-boot */
-#undef  CONFIG_BOOTARGS                        /* the boot command will set bootargs */
-
-#define CONFIG_BAUDRATE                115200
-
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       "hwconfig=fsl_ddr:ecc=on\0"                                     \
-       "bootcmd=run sdboot\0"                                          \
-       "sdboot=setenv bootargs root=/dev/mmcblk0p2 rw "                \
-               "rootdelay=$rootdelaysecond console=$consoledev,$baudrate "\
-               "$othbootargs; mmcinfo; "                               \
-               "ext2load mmc 0:2 $loadaddr /boot/$bootfile; "          \
-               "ext2load mmc 0:2 $fdtaddr /boot/$fdtfile; "            \
-               "bootm $loadaddr - $fdtaddr\0"                          \
-       "sdfatboot=setenv bootargs root=/dev/ram rw "                   \
-               "rootdelay=$rootdelaysecond console=$consoledev,$baudrate "\
-               "$othbootargs; mmcinfo; "                               \
-               "fatload mmc 0:1 $loadaddr $bootfile; "                 \
-               "fatload mmc 0:1 $fdtaddr $fdtfile; "                   \
-               "fatload mmc 0:1 $ramdiskaddr $ramdiskfile; "           \
-               "bootm $loadaddr $ramdiskaddr $fdtaddr\0"               \
-       "usbboot=setenv bootargs root=/dev/sda1 rw "                    \
-               "rootdelay=$rootdelaysecond console=$consoledev,$baudrate "\
-               "$othbootargs; "                                        \
-               "usb start; "                                           \
-               "ext2load usb 0:1 $loadaddr /boot/$bootfile; "          \
-               "ext2load usb 0:1 $fdtaddr /boot/$fdtfile; "            \
-               "bootm $loadaddr - $fdtaddr\0"                          \
-       "usbfatboot=setenv bootargs root=/dev/ram rw "                  \
-               "console=$consoledev,$baudrate $othbootargs; "          \
-               "usb start; "                                           \
-               "fatload usb 0:2 $loadaddr $bootfile; "                 \
-               "fatload usb 0:2 $fdtaddr $fdtfile; "                   \
-               "fatload usb 0:2 $ramdiskaddr $ramdiskfile; "           \
-               "bootm $loadaddr $ramdiskaddr $fdtaddr\0"               \
-       "usbext2boot=setenv bootargs root=/dev/ram rw "                 \
-               "console=$consoledev,$baudrate $othbootargs; "          \
-               "usb start; "                                           \
-               "ext2load usb 0:4 $loadaddr $bootfile; "                \
-               "ext2load usb 0:4 $fdtaddr $fdtfile; "                  \
-               "ext2load usb 0:4 $ramdiskaddr $ramdiskfile; "          \
-               "bootm $loadaddr $ramdiskaddr $fdtaddr\0"               \
-       "upgradespi=sf probe 0; "                                       \
-               "setenv startaddr 0; "                                  \
-               "setenv erasesize a0000; "                              \
-               "tftp 1000000 $tftppath/$uboot_spi; "                   \
-               "sf erase $startaddr $erasesize; "                      \
-               "sf write 1000000 $startaddr $filesize; "               \
-               "sf erase 100000 120000\0"                              \
-       "clearspienv=sf probe 0;sf erase 100000 20000\0"                \
-       "othbootargs=ramdisk_size=700000 cache-sram-size=0x10000\0"     \
-       "netdev=eth0\0"                                                 \
-       "rootdelaysecond=15\0"                                          \
-       "uboot_nor=u-boot-nor.bin\0"                                    \
-       "uboot_spi=u-boot-p2020.spi\0"                                  \
-       "uboot_sd=u-boot-p2020.bin\0"                                   \
-       "consoledev=ttyS0\0"                                            \
-       "ramdiskaddr=2000000\0"                                         \
-       "ramdiskfile=rootfs-dev.ext2.img\0"                             \
-       "fdtaddr=c00000\0"                                              \
-       "fdtfile=uImage-2.6.32-p2020.dtb\0"                             \
-       "tftppath=p2020\0"
-
-#define CONFIG_HDBOOT                                                  \
-       "setenv bootargs root=/dev/$bdev rw rootdelay=30 "              \
-       "console=$consoledev,$baudrate $othbootargs;"                   \
-       "usb start;"                                                    \
-       "ext2load usb 0:1 $loadaddr /boot/$bootfile;"                   \
-       "ext2load usb 0:1 $fdtaddr /boot/$fdtfile;"                     \
-       "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_NFSBOOTCOMMAND                                          \
-       "setenv bootargs root=/dev/nfs rw "                             \
-       "nfsroot=$serverip:$rootpath "                                  \
-       "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off "\
-       "console=$consoledev,$baudrate $othbootargs;"                   \
-       "tftp $loadaddr $tftppath/$bootfile;"                           \
-       "tftp $fdtaddr $tftppath/$fdtfile;"                             \
-       "bootm $loadaddr - $fdtaddr"
-
-
-#define CONFIG_RAMBOOTCOMMAND                                          \
-       "setenv bootargs root=/dev/ram rw "                             \
-       "console=$consoledev,$baudrate $othbootargs;"                   \
-       "tftp $ramdiskaddr $tftppath/$ramdiskfile;"                     \
-       "tftp $loadaddr $tftppath/$bootfile;"                           \
-       "tftp $fdtaddr $tftppath/$fdtfile;"                             \
-       "bootm $loadaddr $ramdiskaddr $fdtaddr"
-
-#define CONFIG_BOOTCOMMAND             CONFIG_HDBOOT
-
-#endif  /* __CONFIG_H */
diff --git a/include/configs/P2020DS.h b/include/configs/P2020DS.h
deleted file mode 100644 (file)
index 820b633..0000000
+++ /dev/null
@@ -1,751 +0,0 @@
-/*
- * Copyright 2007-2012 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * p2020ds board configuration file
- *
- */
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include "../board/freescale/common/ics307_clk.h"
-
-#ifdef CONFIG_36BIT
-#define CONFIG_PHYS_64BIT
-#endif
-
-#ifdef CONFIG_SDCARD
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-#define CONFIG_SYS_TEXT_BASE           0xf8f40000
-#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
-#endif
-
-#ifdef CONFIG_SPIFLASH
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-#define CONFIG_SYS_TEXT_BASE           0xf8f40000
-#define CONFIG_RESET_VECTOR_ADDRESS    0xf8fffffc
-#endif
-
-/* High Level Configuration Options */
-#define CONFIG_BOOKE           1       /* BOOKE */
-#define CONFIG_E500            1       /* BOOKE e500 family */
-#define CONFIG_P2020           1
-#define CONFIG_P2020DS         1
-#define CONFIG_MP              1       /* support multiple processors */
-
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE   0xeff40000
-#endif
-
-#ifndef CONFIG_RESET_VECTOR_ADDRESS
-#define CONFIG_RESET_VECTOR_ADDRESS    0xeffffffc
-#endif
-
-#define CONFIG_SYS_SRIO
-#define CONFIG_SRIO1                   /* SRIO port 1 */
-#define CONFIG_SRIO2                   /* SRIO port 2 */
-
-#define CONFIG_FSL_ELBC                1       /* Has Enhanced localbus controller */
-#define CONFIG_PCI             1       /* Enable PCI/PCIE */
-#define CONFIG_PCIE1           1       /* PCIE controler 1 (slot 1) */
-#define CONFIG_PCIE2           1       /* PCIE controler 2 (slot 2) */
-#define CONFIG_PCIE3           1       /* PCIE controler 3 (ULI bridge) */
-#define CONFIG_FSL_PCI_INIT    1       /* Use common FSL init code */
-#define CONFIG_PCI_INDIRECT_BRIDGE 1   /* indirect PCI bridge support */
-#define CONFIG_FSL_PCIE_RESET  1       /* need PCIe reset errata */
-#define CONFIG_SYS_PCI_64BIT   1       /* enable 64-bit PCI resources */
-
-#define CONFIG_FSL_LAW         1       /* Use common FSL init code */
-#define CONFIG_E1000           1       /* Defind e1000 pci Ethernet card*/
-
-#define CONFIG_TSEC_ENET               /* tsec ethernet support */
-#define CONFIG_ENV_OVERWRITE
-
-#define CONFIG_SYS_CLK_FREQ    get_board_sys_clk() /* sysclk for MPC85xx */
-#define CONFIG_DDR_CLK_FREQ    get_board_ddr_clk() /* ddrclk for MPC85xx */
-#define CONFIG_ICS307_REFCLK_HZ        33333000  /* ICS307 clock chip ref freq */
-
-/*
- * These can be toggled for performance analysis, otherwise use default.
- */
-#define CONFIG_L2_CACHE                        /* toggle L2 cache */
-#define CONFIG_BTB                     /* toggle branch predition */
-
-#define CONFIG_BOARD_EARLY_INIT_F      /* Call board_pre_init */
-
-#define CONFIG_ENABLE_36BIT_PHYS       1
-
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_ADDR_MAP                        1
-#define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
-#endif
-
-#define CONFIG_POST CONFIG_SYS_POST_MEMORY     /* test POST memory test */
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-#define CONFIG_PANIC_HANG      /* do not reset board on panic */
-
-/*
- * Config the L2 Cache
- */
-#define CONFIG_SYS_INIT_L2_ADDR                0xf8f80000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   0xff8f80000ull
-#else
-#define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
-#endif
-#define CONFIG_SYS_L2_SIZE             (512 << 10)
-#define CONFIG_SYS_INIT_L2_END (CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
-
-#define CONFIG_SYS_CCSRBAR             0xffe00000
-#define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
-
-/* DDR Setup */
-#define CONFIG_VERY_BIG_RAM
-#ifdef CONFIG_DDR2
-#define CONFIG_SYS_FSL_DDR2
-#else
-#define CONFIG_SYS_FSL_DDR3            1
-#endif
-
-/* ECC will be enabled based on perf_mode environment variable */
-/* #define     CONFIG_DDR_ECC */
-
-#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
-#define CONFIG_MEM_INIT_VALUE  0xDeadBeef
-
-#define CONFIG_SYS_DDR_SDRAM_BASE      0x00000000
-#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
-
-#define CONFIG_NUM_DDR_CONTROLLERS     1
-#define CONFIG_DIMM_SLOTS_PER_CTLR     1
-#define CONFIG_CHIP_SELECTS_PER_CTRL   2
-
-/* I2C addresses of SPD EEPROMs */
-#define CONFIG_DDR_SPD
-#define CONFIG_SYS_SPD_BUS_NUM         0       /* SPD EEPROM located on I2C bus 0 */
-#define SPD_EEPROM_ADDRESS     0x51    /* CTLR 0 DIMM 0 */
-
-/* These are used when DDR doesn't use SPD.  */
-#define CONFIG_SYS_SDRAM_SIZE          1024            /* DDR is 1GB */
-
-/* Default settings for "stable" mode */
-#define CONFIG_SYS_DDR_CS0_BNDS                0x0000003F
-#define CONFIG_SYS_DDR_CS1_BNDS                0x00000000
-#define CONFIG_SYS_DDR_CS0_CONFIG      0x80014202
-#define CONFIG_SYS_DDR_CS1_CONFIG      0x00000000
-#define CONFIG_SYS_DDR_TIMING_3                0x00020000
-#define CONFIG_SYS_DDR_TIMING_0                0x00330804
-#define CONFIG_SYS_DDR_TIMING_1                0x6f6b4846
-#define CONFIG_SYS_DDR_TIMING_2                0x0fa890d4
-#define CONFIG_SYS_DDR_MODE_1          0x00421422
-#define CONFIG_SYS_DDR_MODE_2          0x00000000
-#define CONFIG_SYS_DDR_MODE_CTRL       0x00000000
-#define CONFIG_SYS_DDR_INTERVAL                0x61800100
-#define CONFIG_SYS_DDR_DATA_INIT       0xdeadbeef
-#define CONFIG_SYS_DDR_CLK_CTRL                0x02000000
-#define CONFIG_SYS_DDR_TIMING_4                0x00220001
-#define CONFIG_SYS_DDR_TIMING_5                0x03402400
-#define CONFIG_SYS_DDR_ZQ_CNTL         0x89080600
-#define CONFIG_SYS_DDR_WRLVL_CNTL      0x8655A608
-#define CONFIG_SYS_DDR_CONTROL         0xE7000000 /* Type = DDR3: ECC enabled, No Interleaving */
-#define CONFIG_SYS_DDR_CONTROL2                0x24400011
-#define CONFIG_SYS_DDR_CDR1            0x00040000
-#define CONFIG_SYS_DDR_CDR2            0x00000000
-
-#define CONFIG_SYS_DDR_ERR_INT_EN      0x0000000d
-#define CONFIG_SYS_DDR_ERR_DIS         0x00000000
-#define CONFIG_SYS_DDR_SBE             0x00010000
-
-/* Settings that differ for "performance" mode */
-#define CONFIG_SYS_DDR_CS0_BNDS_PERF           0x0000007F /* Interleaving Enabled */
-#define CONFIG_SYS_DDR_CS1_BNDS_PERF           0x00000000 /* Interleaving Enabled */
-#define CONFIG_SYS_DDR_CS1_CONFIG_PERF 0x80014202
-#define CONFIG_SYS_DDR_TIMING_1_PERF           0x5d5b4543
-#define CONFIG_SYS_DDR_TIMING_2_PERF           0x0fa890ce
-#define CONFIG_SYS_DDR_CONTROL_PERF            0xC7004000 /* Type = DDR3: ECC disabled, cs0-cs1 interleaving */
-
-/*
- * The following set of values were tested for DDR2
- * with a DDR3 to DDR2 interposer
- *
-#define CONFIG_SYS_DDR_TIMING_3                0x00000000
-#define CONFIG_SYS_DDR_TIMING_0                0x00260802
-#define CONFIG_SYS_DDR_TIMING_1                0x3935d322
-#define CONFIG_SYS_DDR_TIMING_2                0x14904cc8
-#define CONFIG_SYS_DDR_MODE_1          0x00480432
-#define CONFIG_SYS_DDR_MODE_2          0x00000000
-#define CONFIG_SYS_DDR_INTERVAL                0x06180100
-#define CONFIG_SYS_DDR_DATA_INIT       0xdeadbeef
-#define CONFIG_SYS_DDR_CLK_CTRL                0x03800000
-#define CONFIG_SYS_DDR_OCD_CTRL                0x00000000
-#define CONFIG_SYS_DDR_OCD_STATUS      0x00000000
-#define CONFIG_SYS_DDR_CONTROL         0xC3008000
-#define CONFIG_SYS_DDR_CONTROL2                0x04400010
- *
- */
-
-/*
- * Memory map
- *
- * 0x0000_0000 0x7fff_ffff     DDR                     2G Cacheable
- * 0x8000_0000 0xbfff_ffff     PCI Express Mem         1G non-cacheable
- * 0xc000_0000 0xdfff_ffff     PCI                     512M non-cacheable
- * 0xe100_0000 0xe3ff_ffff     PCI IO range            4M non-cacheable
- *
- * Localbus cacheable (TBD)
- * 0xXXXX_XXXX 0xXXXX_XXXX     SRAM                    YZ M Cacheable
- *
- * Localbus non-cacheable
- * 0xe000_0000 0xe80f_ffff     Promjet/free            128M non-cacheable
- * 0xe800_0000 0xefff_ffff     FLASH                   128M non-cacheable
- * 0xffa0_0000 0xffaf_ffff     NAND                    1M non-cacheable
- * 0xffdf_0000 0xffdf_7fff     PIXIS                   32K non-cacheable TLB0
- * 0xffd0_0000 0xffd0_3fff     L1 for stack            16K Cacheable TLB0
- * 0xffe0_0000 0xffef_ffff     CCSR                    1M non-cacheable
- */
-
-/*
- * Local Bus Definitions
- */
-#define CONFIG_SYS_FLASH_BASE          0xe0000000      /* start of FLASH 128M */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_FLASH_BASE_PHYS     0xfe0000000ull
-#else
-#define CONFIG_SYS_FLASH_BASE_PHYS     CONFIG_SYS_FLASH_BASE
-#endif
-
-#define CONFIG_FLASH_BR_PRELIM  \
-       (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000) | BR_PS_16 | BR_V)
-#define CONFIG_FLASH_OR_PRELIM 0xf8000ff7
-
-#define CONFIG_SYS_BR1_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | BR_PS_16 | BR_V)
-#define CONFIG_SYS_OR1_PRELIM  0xf8000ff7
-
-#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000, CONFIG_SYS_FLASH_BASE_PHYS}
-#define CONFIG_SYS_FLASH_QUIET_TEST
-#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
-
-#define CONFIG_SYS_MAX_FLASH_BANKS     2               /* number of banks */
-#define CONFIG_SYS_MAX_FLASH_SECT      1024            /* sectors per device */
-#define CONFIG_SYS_FLASH_ERASE_TOUT    60000           /* Flash Erase Timeout (ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500             /* Flash Write Timeout (ms) */
-
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE    /* start of monitor */
-
-#define CONFIG_FLASH_CFI_DRIVER
-#define CONFIG_SYS_FLASH_CFI
-#define CONFIG_SYS_FLASH_EMPTY_INFO
-#define CONFIG_SYS_FLASH_AMD_CHECK_DQ7
-
-#define CONFIG_BOARD_EARLY_INIT_R      /* call board_early_init_r function */
-
-#define CONFIG_HWCONFIG                        /* enable hwconfig */
-#define CONFIG_FSL_NGPIXIS             /* use common ngPIXIS code */
-
-#ifdef CONFIG_FSL_NGPIXIS
-#define PIXIS_BASE     0xffdf0000      /* PIXIS registers */
-#ifdef CONFIG_PHYS_64BIT
-#define PIXIS_BASE_PHYS        0xfffdf0000ull
-#else
-#define PIXIS_BASE_PHYS        PIXIS_BASE
-#endif
-
-#define CONFIG_SYS_BR3_PRELIM  (BR_PHYS_ADDR(PIXIS_BASE_PHYS) | BR_PS_8 | BR_V)
-#define CONFIG_SYS_OR3_PRELIM          0xffffeff7      /* 32KB but only 4k mapped */
-
-#define PIXIS_LBMAP_SWITCH     7
-#define PIXIS_LBMAP_MASK       0xf0
-#define PIXIS_LBMAP_SHIFT      4
-#define PIXIS_LBMAP_ALTBANK    0x20
-#endif
-
-#define CONFIG_SYS_INIT_RAM_LOCK       1
-#define CONFIG_SYS_INIT_RAM_ADDR       0xffd00000      /* Initial L1 address */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR
-/* The assembler doesn't like typecast */
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
-       ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
-         CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
-#else
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS  CONFIG_SYS_INIT_RAM_ADDR /* Initial L1 address */
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
-#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
-#endif
-#define CONFIG_SYS_INIT_RAM_SIZE       0x00004000      /* Size of used area in RAM */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_LEN         (768 * 1024)
-#define CONFIG_SYS_MALLOC_LEN          (1024 * 1024)   /* Reserved for malloc */
-
-#define CONFIG_SYS_NAND_BASE           0xffa00000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_NAND_BASE_PHYS      0xfffa00000ull
-#else
-#define CONFIG_SYS_NAND_BASE_PHYS      CONFIG_SYS_NAND_BASE
-#endif
-#define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE,\
-                               CONFIG_SYS_NAND_BASE + 0x40000, \
-                               CONFIG_SYS_NAND_BASE + 0x80000,\
-                               CONFIG_SYS_NAND_BASE + 0xC0000}
-#define CONFIG_SYS_MAX_NAND_DEVICE     4
-#define CONFIG_MTD_NAND_VERIFY_WRITE
-#define CONFIG_CMD_NAND                        1
-#define CONFIG_NAND_FSL_ELBC           1
-#define CONFIG_SYS_NAND_BLOCK_SIZE     (128 * 1024)
-
-/* NAND flash config */
-#define CONFIG_SYS_NAND_BR_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* Port Size = 8bit */ \
-                               | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM  (0xFFFC0000         /* length 256K */ \
-                               | OR_FCM_PGS            /* Large Page*/ \
-                               | OR_FCM_CSCT \
-                               | OR_FCM_CST \
-                               | OR_FCM_CHT \
-                               | OR_FCM_SCY_1 \
-                               | OR_FCM_TRLX \
-                               | OR_FCM_EHTR)
-
-#define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
-#define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
-#define CONFIG_SYS_BR2_PRELIM  CONFIG_SYS_NAND_BR_PRELIM  /* NAND Base Address */
-#define CONFIG_SYS_OR2_PRELIM  CONFIG_SYS_NAND_OR_PRELIM  /* NAND Options */
-
-#define CONFIG_SYS_BR4_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS + 0x40000) \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* Port Size = 8bit */ \
-                               | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR4_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
-#define CONFIG_SYS_BR5_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS + 0x80000) \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* Port Size = 8bit */ \
-                               | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR5_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
-
-#define CONFIG_SYS_BR6_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS + 0xc0000) \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* Port Size = 8bit */ \
-                               | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR6_PRELIM  CONFIG_SYS_NAND_OR_PRELIM       /* NAND Options */
-
-/* Serial Port - controlled on board with jumper J8
- * open - index 2
- * shorted - index 1
- */
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_BAUDRATE_TABLE      \
-       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_CCSRBAR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
-
-/* Use the HUSH parser */
-#define CONFIG_SYS_HUSH_PARSER
-
-/*
- * Pass open firmware flat tree
- */
-#define CONFIG_OF_LIBFDT               1
-#define CONFIG_OF_BOARD_SETUP          1
-#define CONFIG_OF_STDOUT_VIA_ALIAS     1
-
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
-#define CONFIG_SYS_FSL_I2C_SPEED       400000
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C2_SPEED      400000
-#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
-
-/*
- * I2C2 EEPROM
- */
-#define CONFIG_ID_EEPROM
-#ifdef CONFIG_ID_EEPROM
-#define CONFIG_SYS_I2C_EEPROM_NXID
-#endif
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x57
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_SYS_EEPROM_BUS_NUM      0
-
-/*
- * eSPI - Enhanced SPI
- */
-#define CONFIG_FSL_ESPI
-
-#define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_SPANSION
-
-#define CONFIG_CMD_SF
-#define CONFIG_SF_DEFAULT_SPEED                10000000
-#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
-
-/*
- * General PCI
- * Memory space is mapped 1-1, but I/O space must start from 0.
- */
-
-/* controller 3, Slot 1, tgtid 3, Base address b000 */
-#define CONFIG_SYS_PCIE3_NAME          "Slot 1"
-#define CONFIG_SYS_PCIE3_MEM_VIRT      0x80000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE3_MEM_BUS       0xe0000000
-#define CONFIG_SYS_PCIE3_MEM_PHYS      0xc00000000ull
-#else
-#define CONFIG_SYS_PCIE3_MEM_BUS       0x80000000
-#define CONFIG_SYS_PCIE3_MEM_PHYS      0x80000000
-#endif
-#define CONFIG_SYS_PCIE3_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE3_IO_VIRT       0xffc00000
-#define CONFIG_SYS_PCIE3_IO_BUS                0x00000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE3_IO_PHYS       0xfffc00000ull
-#else
-#define CONFIG_SYS_PCIE3_IO_PHYS       0xffc00000
-#endif
-#define CONFIG_SYS_PCIE3_IO_SIZE       0x00010000      /* 64k */
-
-/* controller 2, direct to uli, tgtid 2, Base address 9000 */
-#define CONFIG_SYS_PCIE2_NAME          "ULI"
-#define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE2_MEM_BUS       0xe0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
-#else
-#define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
-#endif
-#define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
-#define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
-#else
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
-#endif
-#define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
-
-/* controller 1, Slot 2, tgtid 1, Base address a000 */
-#define CONFIG_SYS_PCIE1_NAME          "Slot 2"
-#define CONFIG_SYS_PCIE1_MEM_VIRT      0xc0000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE1_MEM_BUS       0xe0000000
-#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc40000000ull
-#else
-#define CONFIG_SYS_PCIE1_MEM_BUS       0xc0000000
-#define CONFIG_SYS_PCIE1_MEM_PHYS      0xc0000000
-#endif
-#define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE1_IO_VIRT       0xffc20000
-#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE1_IO_PHYS       0xfffc20000ull
-#else
-#define CONFIG_SYS_PCIE1_IO_PHYS       0xffc20000
-#endif
-#define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
-
-#if defined(CONFIG_PCI)
-
-/*PCIE video card used*/
-#define VIDEO_IO_OFFSET                CONFIG_SYS_PCIE1_IO_VIRT
-
-/* video */
-#undef CONFIG_VIDEO
-
-#if defined(CONFIG_VIDEO)
-#define CONFIG_BIOSEMU
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SW_CURSOR
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_ATI_RADEON_FB
-#define CONFIG_VIDEO_LOGO
-/*#define CONFIG_CONSOLE_CURSOR*/
-#define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
-#endif
-
-/* SRIO1 uses the same window as PCIE2 mem window */
-#define CONFIG_SYS_SRIO1_MEM_VIRT      0xa0000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_SRIO1_MEM_PHYS      0xc20000000ull
-#else
-#define CONFIG_SYS_SRIO1_MEM_PHYS      0xa0000000
-#endif
-#define CONFIG_SYS_SRIO1_MEM_SIZE      0x20000000      /* 512M */
-
-/* SRIO2 uses the same window as PCIE1 mem window */
-#define CONFIG_SYS_SRIO2_MEM_VIRT      0xc0000000
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_SRIO2_MEM_PHYS      0xc40000000ull
-#else
-#define CONFIG_SYS_SRIO2_MEM_PHYS      0xc0000000
-#endif
-#define CONFIG_SYS_SRIO2_MEM_SIZE      0x20000000      /* 512M */
-
-#define CONFIG_PCI_PNP                 /* do pci plug-and-play */
-#define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup */
-#define CONFIG_DOS_PARTITION
-#define CONFIG_SCSI_AHCI
-
-#ifdef CONFIG_SCSI_AHCI
-#define CONFIG_LIBATA
-#define CONFIG_SATA_ULI5288
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID    4
-#define CONFIG_SYS_SCSI_MAX_LUN        1
-#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * CONFIG_SYS_SCSI_MAX_LUN)
-#define CONFIG_SYS_SCSI_MAXDEVICE      CONFIG_SYS_SCSI_MAX_DEVICE
-#endif /* SCSI */
-
-#endif /* CONFIG_PCI */
-
-
-#if defined(CONFIG_TSEC_ENET)
-
-#define CONFIG_MII             1       /* MII PHY management */
-#define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
-#define CONFIG_TSEC1   1
-#define CONFIG_TSEC1_NAME      "eTSEC1"
-#define CONFIG_TSEC2   1
-#define CONFIG_TSEC2_NAME      "eTSEC2"
-#define CONFIG_TSEC3   1
-#define CONFIG_TSEC3_NAME      "eTSEC3"
-
-#define CONFIG_FSL_SGMII_RISER 1
-#define SGMII_RISER_PHY_OFFSET 0x1b
-
-#ifdef CONFIG_FSL_SGMII_RISER
-#define CONFIG_SYS_TBIPA_VALUE         0x10 /* avoid conflict with eTSEC4 paddr */
-#endif
-
-#define TSEC1_PHY_ADDR         0
-#define TSEC2_PHY_ADDR         1
-#define TSEC3_PHY_ADDR         2
-
-#define TSEC1_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC2_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC3_FLAGS            (TSEC_GIGABIT | TSEC_REDUCED)
-
-#define TSEC1_PHYIDX           0
-#define TSEC2_PHYIDX           0
-#define TSEC3_PHYIDX           0
-
-#define CONFIG_ETHPRIME                "eTSEC1"
-
-#define CONFIG_PHY_GIGE                1       /* Include GbE speed/duplex detection */
-#endif /* CONFIG_TSEC_ENET */
-
-/*
- * Environment
- */
-#if defined(CONFIG_SDCARD)
-#define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_FSL_FIXED_MMC_LOCATION
-#define CONFIG_ENV_SIZE                        0x2000
-#define CONFIG_SYS_MMC_ENV_DEV         0
-#elif defined(CONFIG_SPIFLASH)
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_SPI_BUS             0
-#define CONFIG_ENV_SPI_CS              0
-#define CONFIG_ENV_SPI_MAX_HZ          10000000
-#define CONFIG_ENV_SPI_MODE            0
-#define CONFIG_ENV_SIZE                        0x2000          /* 8KB */
-#define CONFIG_ENV_OFFSET              0x100000        /* 1MB */
-#define CONFIG_ENV_SECT_SIZE           0x10000
-#else
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE                0x2000
-#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K (one sector) */
-#endif
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_SETEXPR
-#define CONFIG_CMD_REGINFO
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_PCI
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_SCSI
-#define CONFIG_CMD_EXT2
-#endif
-
-/*
- * USB
- */
-#define CONFIG_HAS_FSL_DR_USB
-#ifdef CONFIG_HAS_FSL_DR_USB
-#define CONFIG_USB_EHCI
-
-#ifdef CONFIG_USB_EHCI
-#define CONFIG_CMD_USB
-#define CONFIG_USB_STORAGE
-#define CONFIG_USB_EHCI_FSL
-#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
-#endif
-#endif
-
-/*
- * SDHC/MMC
- */
-#define CONFIG_MMC
-
-#ifdef CONFIG_MMC
-#define CONFIG_FSL_ESDHC
-#define CONFIG_SYS_FSL_ESDHC_ADDR      CONFIG_SYS_MPC85xx_ESDHC_ADDR
-#define CONFIG_CMD_MMC
-#define CONFIG_GENERIC_MMC
-#endif
-
-#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI)
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_DOS_PARTITION
-#endif
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory */
-#define CONFIG_CMDLINE_EDITING                 /* Command-line editing */
-#define CONFIG_AUTO_COMPLETE                   /* add autocompletion support */
-#define CONFIG_SYS_LOAD_ADDR   0x2000000       /* default load address */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS     16              /* max number of command args */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size */
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 64 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (64 << 20)      /* Initial Memory map for Linux*/
-#define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#endif
-
-/*
- * Environment Configuration
- */
-
-/* The mac addresses for all ethernet interface */
-#if defined(CONFIG_TSEC_ENET)
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-#define CONFIG_HAS_ETH2
-#endif
-
-#define CONFIG_IPADDR          192.168.1.254
-
-#define CONFIG_HOSTNAME                unknown
-#define CONFIG_ROOTPATH                "/opt/nfsroot"
-#define CONFIG_BOOTFILE                "uImage"
-#define CONFIG_UBOOTPATH       u-boot.bin      /* U-Boot image on TFTP server */
-
-#define CONFIG_SERVERIP                192.168.1.1
-#define CONFIG_GATEWAYIP       192.168.1.1
-#define CONFIG_NETMASK         255.255.255.0
-
-/* default location for tftp and bootm */
-#define CONFIG_LOADADDR                1000000
-
-#define CONFIG_BOOTDELAY 10    /* -1 disables auto-boot */
-
-#define CONFIG_BAUDRATE        115200
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                               \
-"perf_mode=performance\0"                      \
-       "hwconfig=fsl_ddr:ctlr_intlv=bank,bank_intlv=cs0_cs1;"  \
-       "usb1:dr_mode=host,phy_type=ulpi\0"                     \
-"netdev=eth0\0"                                                \
-"uboot=" __stringify(CONFIG_UBOOTPATH) "\0"                    \
-"tftpflash=tftpboot $loadaddr $uboot; "                        \
-       "protect off " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
-       "erase " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; "      \
-       "cp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) " $filesize; " \
-       "protect on " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
-       "cmp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) " $filesize\0" \
-"satabootcmd=setenv bootargs root=/dev/$bdev rw "      \
-       "console=$consoledev,$baudrate $othbootargs;"   \
-       "tftp $loadaddr $bootfile;"                     \
-       "tftp $fdtaddr $fdtfile;"                       \
-       "bootm $loadaddr - $fdtaddr"                    \
-"consoledev=ttyS0\0"                           \
-"ramdiskaddr=2000000\0"                        \
-"ramdiskfile=p2020ds/ramdisk.uboot\0"          \
-"fdtaddr=c00000\0"                             \
-"othbootargs=cache-sram-size=0x10000\0"        \
-"fdtfile=p2020ds/p2020ds.dtb\0"                \
-"bdev=sda3\0"                                  \
-"partition=scsi 0:0\0"
-
-#define CONFIG_HDBOOT                          \
- "setenv bootargs root=/dev/$bdev rw "         \
- "console=$consoledev,$baudrate $othbootargs;" \
- "ext2load $partition $loadaddr $bootfile;"    \
- "ext2load $partition $fdtaddr $fdtfile;"      \
- "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_NFSBOOTCOMMAND          \
- "setenv bootargs root=/dev/nfs rw "   \
- "nfsroot=$serverip:$rootpath "                \
- "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
- "console=$consoledev,$baudrate $othbootargs;" \
- "tftp $loadaddr $bootfile;"           \
- "tftp $fdtaddr $fdtfile;"             \
- "bootm $loadaddr - $fdtaddr"
-
-#define CONFIG_RAMBOOTCOMMAND          \
- "setenv bootargs root=/dev/ram rw "   \
- "console=$consoledev,$baudrate $othbootargs;" \
- "tftp $ramdiskaddr $ramdiskfile;"     \
- "tftp $loadaddr $bootfile;"           \
- "tftp $fdtaddr $fdtfile;"             \
- "bootm $loadaddr $ramdiskaddr $fdtaddr"
-
-#define CONFIG_BOOTCOMMAND             CONFIG_HDBOOT
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/P3G4.h b/include/configs/P3G4.h
deleted file mode 100644 (file)
index ac75d3e..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#ifndef __ASSEMBLY__
-#include <galileo/core.h>
-#endif
-
-#include "../board/evb64260/local.h"
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_P3G4            1       /* this is a P3G4  board        */
-#define CONFIG_SYS_GT_6426x        GT_64260 /* with a 64260 system controller */
-
-#define        CONFIG_SYS_TEXT_BASE    0xfff00000
-
-#define CONFIG_BAUDRATE                115200  /* console baudrate = 115200    */
-
-#undef CONFIG_ECC                      /* enable ECC support */
-/* #define CONFIG_EVB64260_750CX  1 */      /* Support the EVB-64260-750CX Board */
-
-/* which initialization functions to call for this board */
-#define CONFIG_MISC_INIT_R     1
-#define CONFIG_BOARD_EARLY_INIT_F 1
-
-#define CONFIG_SYS_BOARD_NAME          "P3G4"
-
-#undef CONFIG_SYS_HUSH_PARSER
-
-/*
- * The following defines let you select what serial you want to use
- * for your console driver.
- *
- * to use the MPSC, #define CONFIG_MPSC.  If you have wired up another
- * mpsc channel, change CONFIG_MPSC_PORT to the desired value.
- */
-#define        CONFIG_MPSC
-#define CONFIG_MPSC_PORT       0
-
-
-/* define this if you want to enable GT MAC filtering */
-#define CONFIG_GT_USE_MAC_HASH_TABLE
-
-#undef CONFIG_ETHER_PORT_MII   /* use RMII */
-
-#if 0
-#define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
-#else
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-#endif
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "netdev=eth0\0"                                                 \
-       "hostname=p3g4\0"                                               \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off panic=1\0"                  \
-       "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
-       "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip addtty;"                          \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
-               "bootm\0"                                               \
-       "rootpath=/opt/eldk/ppc_74xx\0"                                 \
-       "bootfile=/tftpboot/p3g4/uImage\0"                              \
-       "kernel_addr=ff000000\0"                                        \
-       "ramdisk_addr=ff010000\0"                                       \
-       "load=tftp 100000 /tftpboot/p3g4/u-boot.bin\0"                  \
-       "update=protect off fff00000 fff3ffff;era fff00000 fff3ffff;"   \
-               "cp.b 100000 fff00000 ${filesize};"                     \
-               "setenv filesize;saveenv\0"                             \
-       "upd=run load update\0"                                         \
-       ""
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-
-#define CONFIG_LOADS_ECHO      0       /* echo off for serial download */
-#define        CONFIG_SYS_LOADS_BAUD_CHANGE            /* allow baudrate changes       */
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
-#undef CONFIG_ALTIVEC                  /* undef to disable             */
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_BOOTFILESIZE
-
-
-#define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_PCI
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_UNIVERSE
-#define CONFIG_CMD_BSP
-
-
-/*
- * Miscellaneous configurable options
- */
-#define        CONFIG_SYS_LONGHELP                     /* undef to save memory         */
-#if defined(CONFIG_CMD_KGDB)
-#define        CONFIG_SYS_CBSIZE       1024            /* Console I/O Buffer Size      */
-#else
-#define        CONFIG_SYS_CBSIZE       256             /* Console I/O Buffer Size      */
-#endif
-#define        CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#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       0x00400000      /* memtest works on     */
-#define CONFIG_SYS_MEMTEST_END         0x00C00000      /* 4 ... 12 MB in DRAM  */
-
-#define        CONFIG_SYS_LOAD_ADDR            0x00300000      /* default load address */
-#define CONFIG_SYS_BUS_CLK             133000000       /* 133 MHz              */
-
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-
-/*
- * Low Level Configuration Settings
- * (address mappings, register initial values, etc.)
- * You should know what you are doing if you make changes here.
- */
-
-/*-----------------------------------------------------------------------
- * Definitions for initial stack pointer and data area
- */
-#define CONFIG_SYS_INIT_RAM_ADDR       0x40000000
-#define        CONFIG_SYS_INIT_RAM_SIZE        0x1000
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_RAM_LOCK
-
-
-/*-----------------------------------------------------------------------
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-#define        CONFIG_SYS_SDRAM_BASE           0x00000000
-#define CONFIG_SYS_FLASH_BASE          0xff000000
-#define CONFIG_SYS_RESET_ADDRESS       0xfff00100
-#define        CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE
-#define        CONFIG_SYS_MALLOC_LEN           (256 << 10)     /* Reserve 256 kB for malloc */
-
-/* areas to map different things with the GT in physical space */
-#define CONFIG_SYS_DRAM_BANKS          1
-#define CONFIG_SYS_DFL_GT_REGS         0x14000000      /* boot time GT_REGS */
-
-/* What to put in the bats. */
-#define CONFIG_SYS_MISC_REGION_BASE    0xf0000000
-
-/* Peripheral Device section */
-#define CONFIG_SYS_GT_REGS             0xf8000000
-#define CONFIG_SYS_DEV_BASE            0xff000000
-
-#define CONFIG_SYS_DEV0_SPACE          CONFIG_SYS_DEV_BASE
-#define CONFIG_SYS_DEV1_SPACE          (CONFIG_SYS_DEV0_SPACE + CONFIG_SYS_DEV0_SIZE)
-#define CONFIG_SYS_DEV2_SPACE          (CONFIG_SYS_DEV1_SPACE + CONFIG_SYS_DEV1_SIZE)
-#define CONFIG_SYS_DEV3_SPACE          (CONFIG_SYS_DEV2_SPACE + CONFIG_SYS_DEV2_SIZE)
-
-#define CONFIG_SYS_DEV0_SIZE            _8M /* Flash bank */
-#define CONFIG_SYS_DEV1_SIZE            0   /* unused */
-#define CONFIG_SYS_DEV2_SIZE            0   /* unused */
-#define CONFIG_SYS_DEV3_SIZE            0   /* unused */
-
-#define CONFIG_SYS_16BIT_BOOT_PAR      0xc01b5e7c
-#define CONFIG_SYS_DEV0_PAR            CONFIG_SYS_16BIT_BOOT_PAR
-
-#if 0 /* Wrong?? NTL */
-#define CONFIG_SYS_MPP_CONTROL_0       0x53541717      /* InitAct EOT[4] DBurst TCEn[1] */
-                                               /* DMAAck[1:0] GNT0[1:0] */
-#else
-#define CONFIG_SYS_MPP_CONTROL_0       0x53547777      /* InitAct EOT[4] DBurst TCEn[1] */
-                                               /* REQ0[1:0] GNT0[1:0] */
-#endif
-#define CONFIG_SYS_MPP_CONTROL_1       0x44009911      /* TCEn[4] TCTcnt[4] GPP[13:12] */
-                                               /* DMAReq[4] DMAAck[4] WDNMI WDE */
-#if 0 /* Wrong?? NTL */
-#define CONFIG_SYS_MPP_CONTROL_2       0x40091818      /* TCTcnt[0] GPP[22:21] BClkIn */
-                                               /* DMAAck[1:0] GNT1[1:0] */
-#else
-#define CONFIG_SYS_MPP_CONTROL_2       0x40098888      /* TCTcnt[0] */
-                                               /* GPP[22] (RS232IntB or PCI1Int) */
-                                               /* GPP[21] (RS323IntA) */
-                                               /* BClkIn */
-                                               /* REQ1[1:0] GNT1[1:0] */
-#endif
-
-#if 0 /* Wrong?? NTL */
-# define CONFIG_SYS_MPP_CONTROL_3      0x00090066      /* GPP[31:29] BClkOut0 */
-                                               /* GPP[27:26] Int[1:0] */
-#else
-# define CONFIG_SYS_MPP_CONTROL_3      0x22090066      /* MREQ MGNT */
-                                               /* GPP[29]    (PCI1Int) */
-                                               /* BClkOut0 */
-                                               /* GPP[27]    (PCI0Int) */
-                                               /* GPP[26]    (RtcInt or PCI1Int) */
-                                               /* CPUInt[25:24] */
-#endif
-
-#define CONFIG_SYS_SERIAL_PORT_MUX     0x00001102      /* 11=MPSC1/MPSC0 02=ETH 0 and 2 RMII */
-
-#if 0 /* Wrong?? - NTL */
-# define CONFIG_SYS_GPP_LEVEL_CONTROL  0x000002c6
-#else
-# define CONFIG_SYS_GPP_LEVEL_CONTROL  0x2c600000      /* 0010 1100 0110 0000 */
-                                               /* gpp[29] */
-                                               /* gpp[27:26] */
-                                               /* gpp[22:21] */
-
-# define CONFIG_SYS_SDRAM_CONFIG       0xd8e18200      /* 0x448 */
-                               /* idmas use buffer 1,1
-                                  comm use buffer 0
-                                  pci use buffer 1,1
-                                  cpu use buffer 0
-                                  normal load (see also ifdef HVL)
-                                  standard SDRAM (see also ifdef REG)
-                                  non staggered refresh */
-                               /* 31:26  25 23  20 19 18 16 */
-                               /* 110110 00 111 0  0  00 1 */
-                               /* refresh_count=0x200
-                                  phisical interleaving disable
-                                  virtual interleaving enable */
-                               /* 15 14 13:0 */
-                               /* 1  0  0x200 */
-#endif
-
-#if 0
-#define CONFIG_SYS_DUART_IO            CONFIG_SYS_DEV2_SPACE
-#define CONFIG_SYS_DUART_CHAN          1               /* channel to use for console */
-#endif
-#undef CONFIG_SYS_INIT_CHAN1
-#undef CONFIG_SYS_INIT_CHAN2
-#if 0
-#define SRAM_BASE              CONFIG_SYS_DEV0_SPACE
-#define SRAM_SIZE              0x00100000              /* 1 MB of sram */
-#endif
-
-
-/*-----------------------------------------------------------------------
- * PCI stuff
- *-----------------------------------------------------------------------
- */
-
-#define PCI_HOST_ADAPTER 0              /* configure ar pci adapter     */
-#define PCI_HOST_FORCE  1               /* configure as pci host        */
-#define PCI_HOST_AUTO   2               /* detected via arbiter enable  */
-
-#define CONFIG_PCI                      /* include pci support          */
-#define CONFIG_PCI_HOST PCI_HOST_FORCE  /* select pci host function     */
-#define CONFIG_PCI_PNP                  /* do pci plug-and-play         */
-
-/* PCI MEMORY MAP section */
-#define CONFIG_SYS_PCI0_MEM_BASE       0x80000000
-#define CONFIG_SYS_PCI0_MEM_SIZE       _128M
-#define CONFIG_SYS_PCI0_0_MEM_SPACE    (CONFIG_SYS_PCI0_MEM_BASE)
-
-#define CONFIG_SYS_PCI1_MEM_BASE       0x88000000
-#define CONFIG_SYS_PCI1_MEM_SIZE       _128M
-#define CONFIG_SYS_PCI1_0_MEM_SPACE    (CONFIG_SYS_PCI1_MEM_BASE)
-
-/* PCI I/O MAP section */
-#define CONFIG_SYS_PCI0_IO_BASE        0xfa000000
-#define CONFIG_SYS_PCI0_IO_SIZE        _16M
-#define CONFIG_SYS_PCI0_IO_SPACE       (CONFIG_SYS_PCI0_IO_BASE)
-#define CONFIG_SYS_PCI0_IO_SPACE_PCI   0x00000000
-
-#define CONFIG_SYS_PCI1_IO_BASE        0xfb000000
-#define CONFIG_SYS_PCI1_IO_SIZE        _16M
-#define CONFIG_SYS_PCI1_IO_SPACE       (CONFIG_SYS_PCI1_IO_BASE)
-#define CONFIG_SYS_PCI1_IO_SPACE_PCI   0x00000000
-
-/*----------------------------------------------------------------------
- * Initial BAT mappings
- */
-
-/* NOTES:
- * 1) GUARDED and WRITE_THRU not allowed in IBATS
- * 2) CACHEINHIBIT and WRITETHROUGH not allowed together in same BAT
- */
-
-/* SDRAM */
-#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
-
-/* init ram */
-#define CONFIG_SYS_IBAT1L  (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT1U  (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT1L  CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U  CONFIG_SYS_IBAT1U
-
-/* PCI0, PCI1 in one BAT */
-#define CONFIG_SYS_IBAT2L BATL_NO_ACCESS
-#define CONFIG_SYS_IBAT2U CONFIG_SYS_DBAT2U
-#define CONFIG_SYS_DBAT2L (CONFIG_SYS_PCI0_MEM_BASE | BATL_CACHEINHIBIT | BATL_PP_RW | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT2U (CONFIG_SYS_PCI0_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-
-/* GT regs, bootrom, all the devices, PCI I/O */
-#define CONFIG_SYS_IBAT3L (CONFIG_SYS_MISC_REGION_BASE | BATL_CACHEINHIBIT | BATL_PP_RW)
-#define CONFIG_SYS_IBAT3U (CONFIG_SYS_MISC_REGION_BASE | BATU_VS | BATU_VP | BATU_BL_256M)
-#define CONFIG_SYS_DBAT3L (CONFIG_SYS_MISC_REGION_BASE | BATL_CACHEINHIBIT | BATL_PP_RW | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
-
-/* I2C speed and slave address (for compatability) defaults */
-#define CONFIG_SYS_I2C_SPEED   400000
-#define CONFIG_SYS_I2C_SLAVE   0x7F
-
-/* I2C addresses for the two DIMM SPD chips */
-#ifndef CONFIG_EVB64260_750CX
-#define DIMM0_I2C_ADDR 0x56
-#define DIMM1_I2C_ADDR 0x54
-#else /* CONFIG_EVB64260_750CX - only has 1 DIMM */
-#define DIMM0_I2C_ADDR  0x54
-#define DIMM1_I2C_ADDR 0x54
-#endif
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define        CONFIG_SYS_BOOTMAPSZ            (8<<20) /* Initial Memory map for Linux */
-
-/*-----------------------------------------------------------------------
- * FLASH organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max number of memory banks   */
-#define CONFIG_SYS_MAX_FLASH_SECT      67      /* max number of sectors on one chip */
-
-#define CONFIG_SYS_EXTRA_FLASH_DEVICE  BOOT_DEVICE
-#define CONFIG_SYS_EXTRA_FLASH_WIDTH   2       /* 16 bit */
-#define CONFIG_SYS_BOOT_FLASH_WIDTH    2       /* 16 bit */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    120000  /* Timeout for Flash Erase (in ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Timeout for Flash Write (in ms) */
-#define CONFIG_SYS_FLASH_CFI           1
-
-#define        CONFIG_ENV_IS_IN_FLASH  1
-#define        CONFIG_ENV_SIZE         0x1000  /* Total Size of Environment Sector */
-#define CONFIG_ENV_SECT_SIZE   0x20000
-#define CONFIG_ENV_ADDR                0xFFFE0000
-
-/*-----------------------------------------------------------------------
- * Cache Configuration
- */
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For all MPC74xx CPUs          */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CACHELINE_SHIFT     5       /* log base 2 of the above value */
-#endif
-
-/*-----------------------------------------------------------------------
- * L2CR setup -- make sure this is right for your board!
- * look in include/74xx_7xx.h for the defines used here
- */
-
-#define CONFIG_SYS_L2
-
-#define L2_INIT                (L2CR_L2SIZ_2M | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \
-                        L2CR_L2OH_5 | L2CR_L2CTL | L2CR_L2WT)
-
-#define L2_ENABLE      (L2_INIT | L2CR_L2E)
-
-#define CONFIG_SYS_BOARD_ASM_INIT      1
-
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/PM520.h b/include/configs/PM520.h
deleted file mode 100644 (file)
index de46216..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200
-#define CONFIG_PM520           1       /* PM520 board */
-
-#define        CONFIG_SYS_TEXT_BASE    0xfff00000
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000 /* ... running at 33MHz */
-
-#define CONFIG_MISC_INIT_R
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#define CONFIG_BAUDRATE                9600    /* ... at 9600 bps */
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-
-/*
- * PCI Mapping:
- * 0x40000000 - 0x4fffffff - PCI Memory
- * 0x50000000 - 0x50ffffff - PCI IO Space
- */
-#define CONFIG_PCI             1
-#define CONFIG_PCI_PNP         1
-#define CONFIG_PCI_SCAN_SHOW   1
-#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
-
-#define CONFIG_PCI_MEM_BUS     0x40000000
-#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE    0x10000000
-
-#define CONFIG_PCI_IO_BUS      0x50000000
-#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE     0x01000000
-
-#define CONFIG_MII             1
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8  /* use 8 rx buffer on eepro100  */
-#undef  CONFIG_NS8382X
-
-
-/* Partitions */
-#define CONFIG_DOS_PARTITION
-
-/* USB */
-#if 1
-#define CONFIG_USB_OHCI
-#define CONFIG_USB_STORAGE
-#endif
-
-/*
- * 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>
-
-#define CONFIG_CMD_BEDBUG
-#define CONFIG_CMD_DATE
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_SNTP
-#define CONFIG_CMD_USB
-
-#define CONFIG_CMD_PCI
-
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "netdev=eth0\0"                                                 \
-       "hostname=pm520\0"                                                      \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off panic=1\0"                  \
-       "flash_nfs=run nfsargs addip;"                                  \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip;"                                 \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0"     \
-       "rootpath=/opt/eldk30/ppc_82xx\0"                                       \
-       "bootfile=/tftpboot/PM520/uImage\0"                             \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-
-/*
- * IPB Bus clocking configuration.
- */
-#undef CONFIG_SYS_IPBCLK_EQUALS_XLBCLK         /* define for 133MHz speed */
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          2       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           100000 /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x58
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      4
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
-
-/*
- * RTC configuration
- */
-#define CONFIG_RTC_PCF8563
-#define CONFIG_SYS_I2C_RTC_ADDR                0x51
-
-#define CONFIG_SYS_DOC_BASE            0xE0000000
-#define CONFIG_SYS_DOC_SIZE            0x00100000
-
-#if defined(CONFIG_BOOT_ROM)
-/*
- * Flash configuration (8,16 or 32 MB)
- * TEXT base always at 0xFFF00000
- * ENV_ADDR always at  0xFFF40000
- * FLASH_BASE at 0xFA000000 for 64 MB
- *               0xFC000000 for 32 MB
- *               0xFD000000 for 16 MB
- *               0xFD800000 for  8 MB
- */
-#define CONFIG_SYS_FLASH_BASE          0xFA000000
-#define CONFIG_SYS_FLASH_SIZE          0x04000000
-#define CONFIG_SYS_BOOTROM_BASE        0xFFF00000
-#define CONFIG_SYS_BOOTROM_SIZE        0x00080000
-#define CONFIG_ENV_ADDR                (0xFDF00000 + 0x40000)
-#else
-/*
- * Flash configuration (8,16 or 32 MB)
- * TEXT base always at 0xFFF00000
- * ENV_ADDR always at  0xFFF40000
- * FLASH_BASE at 0xFC000000 for 64 MB
- *               0xFE000000 for 32 MB
- *               0xFF000000 for 16 MB
- *               0xFF800000 for  8 MB
- */
-#define CONFIG_SYS_FLASH_BASE          0xFC000000
-#define CONFIG_SYS_FLASH_SIZE          0x04000000
-#define CONFIG_ENV_ADDR                (0xFFF00000 + 0x40000)
-#endif
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max num of memory banks      */
-
-#define CONFIG_SYS_MAX_FLASH_SECT      256     /* max num of sects on one chip */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    240000  /* Flash Erase Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_LOCK_TOUT     5       /* Timeout for Flash Set Lock Bit (in ms) */
-#define CONFIG_SYS_FLASH_UNLOCK_TOUT   10000   /* Timeout for Flash Clear Lock Bits (in ms) */
-#define CONFIG_SYS_FLASH_PROTECTION            /* "Real" (hardware) sectors protection */
-
-#define PHYS_FLASH_SECT_SIZE   0x00040000 /* 256 KB sectors (x2) */
-
-#undef CONFIG_FLASH_16BIT      /* Flash is 32-bit */
-
-
-/*
- * Environment settings
- */
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x10000
-#define CONFIG_ENV_SECT_SIZE   0x40000
-#define CONFIG_ENV_OVERWRITE   1
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_MBAR                0xf0000000
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_MII100
-/*
- * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
- */
-/* #define CONFIG_MPC5xxx_FEC_MII10 */
-#define CONFIG_PHY_ADDR                0x00
-
-/*
- * GPIO configuration
- */
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x10000004
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#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       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#if defined(CONFIG_BOOT_ROM)
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_BOOTROM_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_BOOTROM_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x00047800
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_BOOTROM_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_BOOTROM_SIZE
-#define CONFIG_SYS_CS1_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS1_SIZE            CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_CS1_CFG             0x0004FF00
-#else
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x0004FF00
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_CS1_START           CONFIG_SYS_DOC_BASE
-#define CONFIG_SYS_CS1_SIZE            CONFIG_SYS_DOC_SIZE
-#define CONFIG_SYS_CS1_CFG             0x00047800
-#endif
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-#define CONFIG_SYS_RESET_ADDRESS       0xff000000
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00005000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef  CONFIG_IDE_8xx_PCCARD          /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
-
-#undef CONFIG_IDE_RESET                /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       2       /* max. 2 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers                                                */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/PPChameleonEVB.h b/include/configs/PPChameleonEVB.h
deleted file mode 100644 (file)
index e277d0d..0000000
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
- * (C) Copyright 2003-2005
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * (C) Copyright 2003
- * DAVE Srl
- *
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:info@wawnet.biz
- *
- * Credits: Stefan Roese, Wolfgang Denk
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_PPCHAMELEON_MODULE_BA   0       /* Basic    Model */
-#define CONFIG_PPCHAMELEON_MODULE_ME   1       /* Medium   Model */
-#define CONFIG_PPCHAMELEON_MODULE_HI   2       /* High-End Model */
-#ifndef CONFIG_PPCHAMELEON_MODULE_MODEL
-#define CONFIG_PPCHAMELEON_MODULE_MODEL CONFIG_PPCHAMELEON_MODULE_BA
-#endif
-
-
-/* Only one of the following two symbols must be defined (default is 25 MHz)
- * CONFIG_PPCHAMELEON_CLK_25
- * CONFIG_PPCHAMELEON_CLK_33
- */
-#if (!defined(CONFIG_PPCHAMELEON_CLK_25) && !defined(CONFIG_PPCHAMELEON_CLK_33))
-#define CONFIG_PPCHAMELEON_CLK_25
-#endif
-
-#if (defined(CONFIG_PPCHAMELEON_CLK_25) && defined(CONFIG_PPCHAMELEON_CLK_33))
-#error "* Two external frequencies (SysClk) are defined! *"
-#endif
-
-#undef CONFIG_PPCHAMELEON_SMI712
-
-/*
- * Debug stuff
- */
-#undef __DEBUG_START_FROM_SRAM__
-#define __DISABLE_MACHINE_EXCEPTION__
-
-#ifdef __DEBUG_START_FROM_SRAM__
-#define CONFIG_SYS_DUMMY_FLASH_SIZE            1024*1024*4
-#endif
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_405EP           1       /* This is a PPC405 CPU         */
-#define CONFIG_PPCHAMELEONEVB  1       /* ...on a PPChameleonEVB board */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFFFB0000      /* Reserve 320 kB for Monitor */
-#define CONFIG_SYS_LDSCRIPT    "board/dave/PPChameleonEVB/u-boot.lds"
-
-#define CONFIG_BOARD_EARLY_INIT_F 1    /* call board_early_init_f()    */
-#define CONFIG_MISC_INIT_R     1       /* call misc_init_r()           */
-
-
-#ifdef CONFIG_PPCHAMELEON_CLK_25
-# define CONFIG_SYS_CLK_FREQ   25000000 /* external frequency to pll   */
-#elif (defined (CONFIG_PPCHAMELEON_CLK_33))
-# define CONFIG_SYS_CLK_FREQ   33333333 /* external frequency to pll   */
-#else
-# error "* External frequency (SysClk) not defined! *"
-#endif
-
-#define CONFIG_BAUDRATE                115200
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-
-#undef CONFIG_BOOTARGS
-
-/* Ethernet stuff */
-#define CONFIG_ENV_OVERWRITE /* Let the user to change the Ethernet MAC addresses */
-#define CONFIG_ETHADDR 00:50:c2:1e:af:fe
-#define CONFIG_HAS_ETH1
-#define CONFIG_ETH1ADDR 00:50:c2:1e:af:fd
-
-#define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change        */
-
-#undef CONFIG_EXT_PHY
-
-#define CONFIG_PPC4xx_EMAC
-#define CONFIG_MII             1       /* MII PHY management           */
-#ifndef         CONFIG_EXT_PHY
-#define CONFIG_PHY_ADDR                1       /* EMAC0 PHY address            */
-#define CONFIG_PHY1_ADDR       2       /* EMAC1 PHY address            */
-#else
-#define CONFIG_PHY_ADDR                2       /* PHY address                  */
-#endif
-#define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_DATE
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IRQ
-#define CONFIG_CMD_JFFS2
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_PCI
-#define CONFIG_CMD_SNTP
-
-
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
-
-#define CONFIG_RTC_M41T11      1       /* uses a M41T00 RTC            */
-#define CONFIG_SYS_I2C_RTC_ADDR        0x68
-#define CONFIG_SYS_M41T11_BASE_YEAR    1900
-
-/*
- * SDRAM configuration (please see cpu/ppc/sdram.[ch])
- */
-#define CONFIG_SDRAM_BANK0     1       /* init onboard SDRAM bank 0    */
-
-/* SDRAM timings used in datasheet */
-#define CONFIG_SYS_SDRAM_CL            2
-#define CONFIG_SYS_SDRAM_tRP           20
-#define CONFIG_SYS_SDRAM_tRC           65
-#define CONFIG_SYS_SDRAM_tRCD          20
-#undef  CONFIG_SYS_SDRAM_tRFC
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory         */
-
-#undef CONFIG_SYS_HUSH_PARSER                  /* use "hush" command parser    */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size      */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size      */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS     16              /* max number of command args   */
-#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size    */
-
-#define CONFIG_SYS_DEVICE_NULLDEV      1       /* include nulldev device       */
-
-#define CONFIG_SYS_CONSOLE_INFO_QUIET  1       /* don't print console @ startup*/
-
-#define CONFIG_SYS_MEMTEST_START       0x0400000       /* memtest works on     */
-#define CONFIG_SYS_MEMTEST_END         0x0C00000       /* 4 ... 12 MB in DRAM  */
-
-#define CONFIG_CONS_INDEX      1       /* Use UART0                    */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_serial_clock()
-
-#undef CONFIG_SYS_EXT_SERIAL_CLOCK             /* no external serial clock used */
-#define CONFIG_SYS_BASE_BAUD           691200
-
-/* The following table includes the supported baudrates */
-#define CONFIG_SYS_BAUDRATE_TABLE      \
-       { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400,     \
-        57600, 115200, 230400, 460800, 921600 }
-
-#define CONFIG_SYS_LOAD_ADDR   0x100000        /* default load address */
-#define CONFIG_SYS_EXTBDINFO   1               /* To use extended board_into (bd_t) */
-
-#define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
-
-/*-----------------------------------------------------------------------
- * NAND-FLASH stuff
- *-----------------------------------------------------------------------
- */
-
-/*
- * nand device 1 on dave (PPChameleonEVB) needs more time,
- * so we just introduce additional wait in nand_wait(),
- * effectively for both devices.
- */
-#define PPCHAMELON_NAND_TIMER_HACK
-
-#define CONFIG_SYS_NAND0_BASE 0xFF400000
-#define CONFIG_SYS_NAND1_BASE 0xFF000000
-#define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND0_BASE, CONFIG_SYS_NAND1_BASE }
-#define NAND_BIG_DELAY_US      25
-#define CONFIG_SYS_MAX_NAND_DEVICE     2       /* Max number of NAND devices */
-
-#define CONFIG_SYS_NAND0_CE  (0x80000000 >> 1)  /* our CE is GPIO1 */
-#define CONFIG_SYS_NAND0_RDY (0x80000000 >> 4)  /* our RDY is GPIO4 */
-#define CONFIG_SYS_NAND0_CLE (0x80000000 >> 2)  /* our CLE is GPIO2 */
-#define CONFIG_SYS_NAND0_ALE (0x80000000 >> 3)  /* our ALE is GPIO3 */
-
-#define CONFIG_SYS_NAND1_CE  (0x80000000 >> 14)  /* our CE is GPIO14 */
-#define CONFIG_SYS_NAND1_RDY (0x80000000 >> 31)  /* our RDY is GPIO31 */
-#define CONFIG_SYS_NAND1_CLE (0x80000000 >> 15)  /* our CLE is GPIO15 */
-#define CONFIG_SYS_NAND1_ALE (0x80000000 >> 16)  /* our ALE is GPIO16 */
-
-#define MACRO_NAND_DISABLE_CE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_CE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_CE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_ENABLE_CE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_CE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_CE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_CLRALE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_ALE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_ALE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_SETALE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_ALE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_ALE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_CLRCLE(nandptr) do \
-{ \
-       switch((unsigned long)nandptr) \
-       { \
-           case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND0_CLE); \
-               break; \
-           case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) & ~CONFIG_SYS_NAND1_CLE); \
-               break; \
-       } \
-} while(0)
-
-#define MACRO_NAND_CTL_SETCLE(nandptr) do { \
-       switch((unsigned long)nandptr) { \
-       case CONFIG_SYS_NAND0_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND0_CLE); \
-               break; \
-       case CONFIG_SYS_NAND1_BASE: \
-               out32(GPIO0_OR, in32(GPIO0_OR) | CONFIG_SYS_NAND1_CLE); \
-               break; \
-       } \
-} while(0)
-
-/*-----------------------------------------------------------------------
- * PCI stuff
- *-----------------------------------------------------------------------
- */
-#define PCI_HOST_ADAPTER 0             /* configure as pci adapter     */
-#define PCI_HOST_FORCE 1               /* configure as pci host        */
-#define PCI_HOST_AUTO  2               /* detected via arbiter enable  */
-
-#define CONFIG_PCI                     /* include pci support          */
-#define CONFIG_PCI_INDIRECT_BRIDGE     /* indirect PCI bridge support */
-#define CONFIG_PCI_HOST PCI_HOST_FORCE  /* select pci host function     */
-#undef CONFIG_PCI_PNP                  /* do pci plug-and-play         */
-                                       /* resource configuration       */
-
-#define CONFIG_PCI_SCAN_SHOW           /* print pci devices @ startup  */
-
-#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1014  /* PCI Vendor ID: IBM   */
-#define CONFIG_SYS_PCI_SUBSYS_DEVICEID 0x0000  /* PCI Device ID: ---   */
-#define CONFIG_SYS_PCI_CLASSCODE       0x0b20  /* PCI Class Code: Processor/PPC*/
-
-#define CONFIG_SYS_PCI_PTM1LA  0x00000000      /* point to sdram               */
-#define CONFIG_SYS_PCI_PTM1MS  0xfc000001      /* 64MB, enable hard-wired to 1 */
-#define CONFIG_SYS_PCI_PTM1PCI 0x00000000      /* Host: use this pci address   */
-#define CONFIG_SYS_PCI_PTM2LA  0xffc00000      /* point to flash               */
-#define CONFIG_SYS_PCI_PTM2MS  0xffc00001      /* 4MB, enable                  */
-#define CONFIG_SYS_PCI_PTM2PCI 0x04000000      /* Host: use this pci address   */
-
-/*-----------------------------------------------------------------------
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-
-/* Reserve 256 kB for Monitor  */
-/*
-#define CONFIG_SYS_FLASH_BASE          0xFFFC0000
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
-*/
-
-/* Reserve 320 kB for Monitor  */
-#define CONFIG_SYS_FLASH_BASE          0xFFFB0000
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MONITOR_LEN         (320 * 1024)
-
-#define CONFIG_SYS_MALLOC_LEN          (256 * 1024)    /* Reserve 256 kB for malloc()  */
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-/*-----------------------------------------------------------------------
- * FLASH organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max number of memory banks           */
-#define CONFIG_SYS_MAX_FLASH_SECT      256     /* max number of sectors on one chip    */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    120000  /* Timeout for Flash Erase (in ms)      */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    1000    /* Timeout for Flash Write (in ms)      */
-
-#define CONFIG_SYS_FLASH_WORD_SIZE     unsigned short  /* flash word size (width)      */
-#define CONFIG_SYS_FLASH_ADDR0         0x5555  /* 1st address for flash config cycles  */
-#define CONFIG_SYS_FLASH_ADDR1         0x2AAA  /* 2nd address for flash config cycles  */
-/*
- * The following defines are added for buggy IOP480 byte interface.
- * All other boards should use the standard values (CPCI405 etc.)
- */
-#define CONFIG_SYS_FLASH_READ0         0x0000  /* 0 is standard                        */
-#define CONFIG_SYS_FLASH_READ1         0x0001  /* 1 is standard                        */
-#define CONFIG_SYS_FLASH_READ2         0x0002  /* 2 is standard                        */
-
-#define CONFIG_SYS_FLASH_EMPTY_INFO            /* print 'E' for empty sector on flinfo */
-
-/*-----------------------------------------------------------------------
- * Environment Variable setup
- */
-#ifdef ENVIRONMENT_IN_EEPROM
-
-#define CONFIG_ENV_IS_IN_EEPROM        1       /* use EEPROM for environment vars */
-#define CONFIG_ENV_OFFSET              0x100   /* environment starts at the beginning of the EEPROM */
-#define CONFIG_ENV_SIZE                0x700   /* 2048-256 bytes may be used for env vars (total size of a CAT24WC16 is 2048 bytes)*/
-
-#else  /* DEFAULT: environment in flash, using redundand flash sectors */
-
-#define CONFIG_ENV_IS_IN_FLASH 1       /* use FLASH for environment vars */
-#define CONFIG_ENV_ADDR                0xFFFF8000      /* environment starts at the first small sector */
-#define CONFIG_ENV_SECT_SIZE   0x2000  /* 8196 bytes may be used for env vars*/
-#define CONFIG_ENV_ADDR_REDUND 0xFFFFA000
-#define CONFIG_ENV_SIZE_REDUND 0x2000
-
-#define        CONFIG_SYS_USE_PPCENV                   /* Environment embedded in sect .ppcenv */
-
-#endif /* ENVIRONMENT_IN_EEPROM */
-
-
-#define CONFIG_SYS_NVRAM_BASE_ADDR     0xF0000500              /* NVRAM base address   */
-#define CONFIG_SYS_NVRAM_SIZE          242                     /* NVRAM size           */
-
-/*-----------------------------------------------------------------------
- * I2C EEPROM (CAT24WC16) for environment
- */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_PPC4XX
-#define CONFIG_SYS_I2C_PPC4XX_CH0
-#define CONFIG_SYS_I2C_PPC4XX_SPEED_0          400000
-#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0          0x7F
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* EEPROM CAT28WC08             */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1       /* Bytes of address             */
-/* mask of address bits that overflow into the "EEPROM chip address"   */
-/*#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW  0x07*/
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4    /* The Catalyst CAT24WC08 has   */
-                                       /* 16 byte page write mode using*/
-                                       /* last 4 bits of the address   */
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10   /* and takes up to 10 msec */
-
-/*
- * Init Memory Controller:
- *
- * BR0/1 and OR0/1 (FLASH)
- */
-
-#define FLASH_BASE0_PRELIM     0xFFC00000      /* FLASH bank #0        */
-
-/*-----------------------------------------------------------------------
- * External Bus Controller (EBC) Setup
- */
-
-/* Memory Bank 0 (Flash Bank 0, NOR-FLASH) initialization                      */
-#define CONFIG_SYS_EBC_PB0AP           0x92015480
-#define CONFIG_SYS_EBC_PB0CR           0xFFC5A000  /* BAS=0xFFC,BS=4MB,BU=R/W,BW=16bit */
-
-/* Memory Bank 1 (External SRAM) initialization                                        */
-/* Since this must replace NOR Flash, we use the same settings for CS0         */
-#define CONFIG_SYS_EBC_PB1AP           0x92015480
-#define CONFIG_SYS_EBC_PB1CR           0xFF85A000  /* BAS=0xFF8,BS=4MB,BU=R/W,BW=8bit  */
-
-/* Memory Bank 2 (Flash Bank 1, NAND-FLASH) initialization                     */
-#define CONFIG_SYS_EBC_PB2AP           0x92015480
-#define CONFIG_SYS_EBC_PB2CR           0xFF458000  /* BAS=0xFF4,BS=4MB,BU=R/W,BW=8bit  */
-
-/* Memory Bank 3 (Flash Bank 2, NAND-FLASH) initialization                     */
-#define CONFIG_SYS_EBC_PB3AP           0x92015480
-#define CONFIG_SYS_EBC_PB3CR           0xFF058000  /* BAS=0xFF0,BS=4MB,BU=R/W,BW=8bit  */
-
-#ifdef CONFIG_PPCHAMELEON_SMI712
-/*
- * Video console (graphic: SMI LynxEM)
- */
-#define CONFIG_VIDEO
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SMI_LYNXEM
-#define CONFIG_VIDEO_LOGO
-/*#define CONFIG_VIDEO_BMP_LOGO*/
-#define CONFIG_CONSOLE_EXTRA_INFO
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-/* This is the base address (on 405EP-side) used to generate I/O accesses on PCI bus */
-#define CONFIG_SYS_ISA_IO 0xE8000000
-/* see also drivers/video/videomodes.c */
-#define CONFIG_SYS_DEFAULT_VIDEO_MODE 0x303
-#endif
-
-/*-----------------------------------------------------------------------
- * FPGA stuff
- */
-/* FPGA internal regs */
-#define CONFIG_SYS_FPGA_MODE           0x00
-#define CONFIG_SYS_FPGA_STATUS         0x02
-#define CONFIG_SYS_FPGA_TS             0x04
-#define CONFIG_SYS_FPGA_TS_LOW         0x06
-#define CONFIG_SYS_FPGA_TS_CAP0        0x10
-#define CONFIG_SYS_FPGA_TS_CAP0_LOW    0x12
-#define CONFIG_SYS_FPGA_TS_CAP1        0x14
-#define CONFIG_SYS_FPGA_TS_CAP1_LOW    0x16
-#define CONFIG_SYS_FPGA_TS_CAP2        0x18
-#define CONFIG_SYS_FPGA_TS_CAP2_LOW    0x1a
-#define CONFIG_SYS_FPGA_TS_CAP3        0x1c
-#define CONFIG_SYS_FPGA_TS_CAP3_LOW    0x1e
-
-/* FPGA Mode Reg */
-#define CONFIG_SYS_FPGA_MODE_CF_RESET  0x0001
-#define CONFIG_SYS_FPGA_MODE_TS_IRQ_ENABLE 0x0100
-#define CONFIG_SYS_FPGA_MODE_TS_IRQ_CLEAR  0x1000
-#define CONFIG_SYS_FPGA_MODE_TS_CLEAR  0x2000
-
-/* FPGA Status Reg */
-#define CONFIG_SYS_FPGA_STATUS_DIP0    0x0001
-#define CONFIG_SYS_FPGA_STATUS_DIP1    0x0002
-#define CONFIG_SYS_FPGA_STATUS_DIP2    0x0004
-#define CONFIG_SYS_FPGA_STATUS_FLASH   0x0008
-#define CONFIG_SYS_FPGA_STATUS_TS_IRQ  0x1000
-
-#define CONFIG_SYS_FPGA_SPARTAN2       1               /* using Xilinx Spartan 2 now    */
-#define CONFIG_SYS_FPGA_MAX_SIZE       128*1024        /* 128kByte is enough for XC2S50E*/
-
-/* FPGA program pin configuration */
-#define CONFIG_SYS_FPGA_PRG            0x04000000      /* FPGA program pin (ppc output) */
-#define CONFIG_SYS_FPGA_CLK            0x02000000      /* FPGA clk pin (ppc output)     */
-#define CONFIG_SYS_FPGA_DATA           0x01000000      /* FPGA data pin (ppc output)    */
-#define CONFIG_SYS_FPGA_INIT           0x00010000      /* FPGA init pin (ppc input)     */
-#define CONFIG_SYS_FPGA_DONE           0x00008000      /* FPGA done pin (ppc input)     */
-
-/*-----------------------------------------------------------------------
- * Definitions for initial stack pointer and data area (in data cache)
- */
-/* use on chip memory ( OCM ) for temperary stack until sdram is tested */
-#define CONFIG_SYS_TEMP_STACK_OCM      1
-
-/* On Chip Memory location */
-#define CONFIG_SYS_OCM_DATA_ADDR       0xF8000000
-#define CONFIG_SYS_OCM_DATA_SIZE       0x1000
-#define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_SYS_OCM_DATA_ADDR /* inside of SDRAM             */
-#define CONFIG_SYS_INIT_RAM_SIZE       CONFIG_SYS_OCM_DATA_SIZE /* Size of used area in RAM    */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET    (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-/*-----------------------------------------------------------------------
- * Definitions for GPIO setup (PPC405EP specific)
- *
- * GPIO0[0]    - External Bus Controller BLAST output
- * GPIO0[1-9]  - Instruction trace outputs -> GPIO
- * GPIO0[10-13] - External Bus Controller CS_1 - CS_4 outputs
- * GPIO0[14-16] - External Bus Controller ABUS3-ABUS5 outputs -> GPIO
- * GPIO0[17-23] - External Interrupts IRQ0 - IRQ6 inputs
- * GPIO0[24-27] - UART0 control signal inputs/outputs
- * GPIO0[28-29] - UART1 data signal input/output
- * GPIO0[30]   - EMAC0 input
- * GPIO0[31]   - EMAC1 reject packet as output
- */
-#define CONFIG_SYS_GPIO0_OSRL          0x40000550
-#define CONFIG_SYS_GPIO0_OSRH          0x00000110
-#define CONFIG_SYS_GPIO0_ISR1L         0x00000000
-/*#define CONFIG_SYS_GPIO0_ISR1H       0x15555445*/
-#define CONFIG_SYS_GPIO0_ISR1H         0x15555444
-#define CONFIG_SYS_GPIO0_TSRL          0x00000000
-#define CONFIG_SYS_GPIO0_TSRH          0x00000000
-#define CONFIG_SYS_GPIO0_TCR           0xF7FF8014
-
-#define CONFIG_NO_SERIAL_EEPROM
-
-/*--------------------------------------------------------------------*/
-
-#ifdef CONFIG_NO_SERIAL_EEPROM
-
-/*
-!-----------------------------------------------------------------------
-! Defines for entry options.
-! Note: Because the 405EP SDRAM controller does not support ECC, ECC DIMMs that
-!      are plugged in the board will be utilized as non-ECC DIMMs.
-!-----------------------------------------------------------------------
-*/
-#undef         AUTO_MEMORY_CONFIG
-#define                DIMM_READ_ADDR 0xAB
-#define                DIMM_WRITE_ADDR 0xAA
-
-/* Defines for CPC0_PLLMR1 Register fields */
-#define PLL_ACTIVE             0x80000000
-#define CPC0_PLLMR1_SSCS       0x80000000
-#define PLL_RESET              0x40000000
-#define CPC0_PLLMR1_PLLR       0x40000000
-    /* Feedback multiplier */
-#define PLL_FBKDIV             0x00F00000
-#define CPC0_PLLMR1_FBDV       0x00F00000
-#define PLL_FBKDIV_16          0x00000000
-#define PLL_FBKDIV_1           0x00100000
-#define PLL_FBKDIV_2           0x00200000
-#define PLL_FBKDIV_3           0x00300000
-#define PLL_FBKDIV_4           0x00400000
-#define PLL_FBKDIV_5           0x00500000
-#define PLL_FBKDIV_6           0x00600000
-#define PLL_FBKDIV_7           0x00700000
-#define PLL_FBKDIV_8           0x00800000
-#define PLL_FBKDIV_9           0x00900000
-#define PLL_FBKDIV_10          0x00A00000
-#define PLL_FBKDIV_11          0x00B00000
-#define PLL_FBKDIV_12          0x00C00000
-#define PLL_FBKDIV_13          0x00D00000
-#define PLL_FBKDIV_14          0x00E00000
-#define PLL_FBKDIV_15          0x00F00000
-    /* Forward A divisor */
-#define PLL_FWDDIVA            0x00070000
-#define CPC0_PLLMR1_FWDVA      0x00070000
-#define PLL_FWDDIVA_8          0x00000000
-#define PLL_FWDDIVA_7          0x00010000
-#define PLL_FWDDIVA_6          0x00020000
-#define PLL_FWDDIVA_5          0x00030000
-#define PLL_FWDDIVA_4          0x00040000
-#define PLL_FWDDIVA_3          0x00050000
-#define PLL_FWDDIVA_2          0x00060000
-#define PLL_FWDDIVA_1          0x00070000
-    /* Forward B divisor */
-#define PLL_FWDDIVB            0x00007000
-#define CPC0_PLLMR1_FWDVB      0x00007000
-#define PLL_FWDDIVB_8          0x00000000
-#define PLL_FWDDIVB_7          0x00001000
-#define PLL_FWDDIVB_6          0x00002000
-#define PLL_FWDDIVB_5          0x00003000
-#define PLL_FWDDIVB_4          0x00004000
-#define PLL_FWDDIVB_3          0x00005000
-#define PLL_FWDDIVB_2          0x00006000
-#define PLL_FWDDIVB_1          0x00007000
-    /* PLL tune bits */
-#define PLL_TUNE_MASK          0x000003FF
-#define PLL_TUNE_2_M_3         0x00000133      /*  2 <= M <= 3                 */
-#define PLL_TUNE_4_M_6         0x00000134      /*  3 <  M <= 6                 */
-#define PLL_TUNE_7_M_10                0x00000138      /*  6 <  M <= 10                */
-#define PLL_TUNE_11_M_14       0x0000013C      /* 10 <  M <= 14                */
-#define PLL_TUNE_15_M_40       0x0000023E      /* 14 <  M <= 40                */
-#define PLL_TUNE_VCO_LOW       0x00000000      /* 500MHz <= VCO <=  800MHz     */
-#define PLL_TUNE_VCO_HI                0x00000080      /* 800MHz <  VCO <= 1000MHz     */
-
-/* Defines for CPC0_PLLMR0 Register fields */
-    /* CPU divisor */
-#define PLL_CPUDIV             0x00300000
-#define CPC0_PLLMR0_CCDV       0x00300000
-#define PLL_CPUDIV_1           0x00000000
-#define PLL_CPUDIV_2           0x00100000
-#define PLL_CPUDIV_3           0x00200000
-#define PLL_CPUDIV_4           0x00300000
-    /* PLB divisor */
-#define PLL_PLBDIV             0x00030000
-#define CPC0_PLLMR0_CBDV       0x00030000
-#define PLL_PLBDIV_1           0x00000000
-#define PLL_PLBDIV_2           0x00010000
-#define PLL_PLBDIV_3           0x00020000
-#define PLL_PLBDIV_4           0x00030000
-    /* OPB divisor */
-#define PLL_OPBDIV             0x00003000
-#define CPC0_PLLMR0_OPDV       0x00003000
-#define PLL_OPBDIV_1           0x00000000
-#define PLL_OPBDIV_2           0x00001000
-#define PLL_OPBDIV_3           0x00002000
-#define PLL_OPBDIV_4           0x00003000
-    /* EBC divisor */
-#define PLL_EXTBUSDIV          0x00000300
-#define CPC0_PLLMR0_EPDV       0x00000300
-#define PLL_EXTBUSDIV_2                0x00000000
-#define PLL_EXTBUSDIV_3                0x00000100
-#define PLL_EXTBUSDIV_4                0x00000200
-#define PLL_EXTBUSDIV_5                0x00000300
-    /* MAL divisor */
-#define PLL_MALDIV             0x00000030
-#define CPC0_PLLMR0_MPDV       0x00000030
-#define PLL_MALDIV_1           0x00000000
-#define PLL_MALDIV_2           0x00000010
-#define PLL_MALDIV_3           0x00000020
-#define PLL_MALDIV_4           0x00000030
-    /* PCI divisor */
-#define PLL_PCIDIV             0x00000003
-#define CPC0_PLLMR0_PPFD       0x00000003
-#define PLL_PCIDIV_1           0x00000000
-#define PLL_PCIDIV_2           0x00000001
-#define PLL_PCIDIV_3           0x00000002
-#define PLL_PCIDIV_4           0x00000003
-
-#ifdef CONFIG_PPCHAMELEON_CLK_25
-/* CPU - PLB/SDRAM - EBC - OPB - PCI (assuming a 25.0 MHz input clock to the 405EP) */
-#define PPCHAMELEON_PLLMR0_133_133_33_66_33     (PLL_CPUDIV_1 | PLL_PLBDIV_1 |  \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_133_133_33_66_33     (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_6 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |  \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_200_100_50_33 (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_4 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_266_133_33_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |     \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_266_133_33_66_33 (PLL_FBKDIV_8  |  \
-                             PLL_FWDDIVA_3 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_333_111_37_55_55 (PLL_CPUDIV_1 | PLL_PLBDIV_3 |     \
-                             PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |  \
-                             PLL_MALDIV_1 | PLL_PCIDIV_2)
-#define PPCHAMELEON_PLLMR1_333_111_37_55_55 (PLL_FBKDIV_10     |  \
-                             PLL_FWDDIVA_3 | PLL_FWDDIVB_4 |  \
-                             PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
-
-#elif (defined (CONFIG_PPCHAMELEON_CLK_33))
-
-/* CPU - PLB/SDRAM - EBC - OPB - PCI (assuming a 33.3MHz input clock to the 405EP) */
-#define PPCHAMELEON_PLLMR0_133_133_33_66_33     (PLL_CPUDIV_1 | PLL_PLBDIV_1 |  \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_133_133_33_66_33     (PLL_FBKDIV_4  |  \
-                                 PLL_FWDDIVA_6 | PLL_FWDDIVB_6 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |  \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_200_100_50_33 (PLL_FBKDIV_6  |  \
-                                 PLL_FWDDIVA_4 | PLL_FWDDIVB_4 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_266_133_33_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 |     \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_4)
-#define PPCHAMELEON_PLLMR1_266_133_33_66_33 (PLL_FBKDIV_8  |  \
-                                 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
-
-#define PPCHAMELEON_PLLMR0_333_111_37_55_55 (PLL_CPUDIV_1 | PLL_PLBDIV_3 |     \
-                                 PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 |      \
-                                 PLL_MALDIV_1 | PLL_PCIDIV_2)
-#define PPCHAMELEON_PLLMR1_333_111_37_55_55 (PLL_FBKDIV_10     |  \
-                                 PLL_FWDDIVA_3 | PLL_FWDDIVB_3 |  \
-                                 PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
-
-#else
-#error "* External frequency (SysClk) not defined! *"
-#endif
-
-#if   (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_HI)
-/* Model HI */
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_333_111_37_55_55
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_333_111_37_55_55
-#define CONFIG_SYS_OPB_FREQ    55555555
-/* Model ME */
-#elif (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME)
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_266_133_33_66_33
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_266_133_33_66_33
-#define CONFIG_SYS_OPB_FREQ    66666666
-#else
-/* Model BA (default) */
-#define PLLMR0_DEFAULT PPCHAMELEON_PLLMR0_133_133_33_66_33
-#define PLLMR1_DEFAULT PPCHAMELEON_PLLMR1_133_133_33_66_33
-#define CONFIG_SYS_OPB_FREQ    66666666
-#endif
-
-#endif /* CONFIG_NO_SERIAL_EEPROM */
-
-#define CONFIG_JFFS2_NAND 1                    /* jffs2 on nand support */
-#define NAND_CACHE_PAGES 16                    /* size of nand cache in 512 bytes pages */
-
-/*
- * JFFS2 partitions
- */
-
-/* No command line, one static partition */
-#undef CONFIG_CMD_MTDPARTS
-#define CONFIG_JFFS2_DEV               "nand0"
-#define CONFIG_JFFS2_PART_SIZE         0x00400000
-#define CONFIG_JFFS2_PART_OFFSET       0x00000000
-
-/* mtdparts command line support */
-/*
-#define CONFIG_CMD_MTDPARTS
-#define MTDIDS_DEFAULT         "nor0=PPChameleon-0,nand0=ppchameleonevb-nand"
-*/
-
-/* 256 kB U-boot image */
-/*
-#define MTDPARTS_DEFAULT       "mtdparts=PPChameleon-0:1m(kernel1),1m(kernel2)," \
-                                       "1792k(user),256k(u-boot);" \
-                               "ppchameleonevb-nand:-(nand)"
-*/
-
-/* 320 kB U-boot image */
-/*
-#define MTDPARTS_DEFAULT       "mtdparts=PPChameleon-0:1m(kernel1),1m(kernel2)," \
-                                       "1728k(user),320k(u-boot);" \
-                               "ppchameleonevb-nand:-(nand)"
-*/
-
-#endif /* __CONFIG_H */
index c2bdbb99eda9d28b46422672707179f627a33265..3f02cede3201f0d021aab3d35caf8fa632400fa2 100644 (file)
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
 
 #ifdef CONFIG_RAMBOOT_PBL
 #define CONFIG_SYS_FSL_PBL_PBI board/freescale/t102xqds/t1024_pbi.cfg
index 82b669ba6ed94ddca249e2b3f43f2dcb1916eeae..bd40d6ac93c82186e5b50cbb3120a02415c75be9 100644 (file)
 
 /* support deep sleep */
 #define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
 
 #ifdef CONFIG_RAMBOOT_PBL
 #define CONFIG_SYS_FSL_PBL_PBI board/freescale/t102xrdb/t1024_pbi.cfg
@@ -51,7 +54,7 @@
 #define CONFIG_SPL_I2C_SUPPORT
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #define CONFIG_FSL_LAW                 /* Use common FSL init code */
-#define CONFIG_SYS_TEXT_BASE           0x00201000
+#define CONFIG_SYS_TEXT_BASE           0x30001000
 #define CONFIG_SPL_TEXT_BASE           0xFFFD8000
 #define CONFIG_SPL_PAD_TO              0x40000
 #define CONFIG_SPL_MAX_SIZE            0x28000
 #ifdef CONFIG_NAND
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SYS_NAND_U_BOOT_SIZE    (768 << 10)
-#define CONFIG_SYS_NAND_U_BOOT_DST     0x00200000
-#define CONFIG_SYS_NAND_U_BOOT_START   0x00200000
+#define CONFIG_SYS_NAND_U_BOOT_DST     0x30000000
+#define CONFIG_SYS_NAND_U_BOOT_START   0x30000000
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    (256 << 10)
 #define CONFIG_SYS_LDSCRIPT    "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds"
 #define CONFIG_SPL_NAND_BOOT
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#define CONFIG_RESET_VECTOR_ADDRESS            0x200FFC
+#define CONFIG_RESET_VECTOR_ADDRESS            0x30000FFC
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_MINIMAL
 #define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE       (768 << 10)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST                (0x00200000)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_START      (0x00200000)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST                (0x30000000)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_START      (0x30000000)
 #define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS       (256 << 10)
 #define CONFIG_SYS_LDSCRIPT            "arch/powerpc/cpu/mpc85xx/u-boot.lds"
 #ifndef CONFIG_SPL_BUILD
 #endif
 
 #ifdef CONFIG_SDCARD
-#define CONFIG_RESET_VECTOR_ADDRESS    0x200FFC
+#define CONFIG_RESET_VECTOR_ADDRESS    0x30000FFC
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SPL_MMC_MINIMAL
 #define CONFIG_SYS_MMC_U_BOOT_SIZE     (768 << 10)
-#define CONFIG_SYS_MMC_U_BOOT_DST      (0x00200000)
-#define CONFIG_SYS_MMC_U_BOOT_START    (0x00200000)
+#define CONFIG_SYS_MMC_U_BOOT_DST      (0x30000000)
+#define CONFIG_SYS_MMC_U_BOOT_START    (0x30000000)
 #define CONFIG_SYS_MMC_U_BOOT_OFFS     (260 << 10)
 #define CONFIG_SYS_LDSCRIPT            "arch/powerpc/cpu/mpc85xx/u-boot.lds"
 #ifndef CONFIG_SPL_BUILD
@@ -759,8 +762,10 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_FMAN_ENET
 #define CONFIG_PHYLIB_10G
 #define CONFIG_PHY_REALTEK
+#define CONFIG_PHY_AQUANTIA
 #define RGMII_PHY1_ADDR                0x2
 #define RGMII_PHY2_ADDR                0x6
+#define SGMII_PHY1_ADDR                0x2
 #define FM1_10GEC1_PHY_ADDR    0x1
 #endif
 
index b70bdfe5e79f63dcd371a1b7fe314c9498c3188a..92f5f56718cb310da2ddd949aa25cb0e72a5fd2a 100644 (file)
 
 /* support deep sleep */
 #define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
 
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE   0xeff40000
@@ -689,6 +692,12 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_PHY_GIGE                /* Include GbE speed/duplex detection */
 #endif
 
+/* Enable VSC9953 L2 Switch driver */
+#define CONFIG_VSC9953
+#define CONFIG_VSC9953_CMD
+#define CONFIG_SYS_FM1_QSGMII11_PHY_ADDR       0x14
+#define CONFIG_SYS_FM1_QSGMII21_PHY_ADDR       0x18
+
 /*
  * Dynamic MTD Partition support with mtdparts
  */
index 57cdf7213c4c6b3fa4233f36e02eb9ac50ebef23..d47f1be6851188650e1d315e586905ed1fcdf5f3 100644 (file)
 #define CONFIG_SYS_RGMII1_PHY_ADDR             0x01
 #define CONFIG_SYS_RGMII2_PHY_ADDR             0x02
 
+/* Enable VSC9953 L2 Switch driver on T1040 SoC */
+#ifdef CONFIG_T1040RDB
+#define CONFIG_VSC9953
+#define CONFIG_VSC9953_CMD
+#define CONFIG_SYS_FM1_QSGMII11_PHY_ADDR       0x04
+#define CONFIG_SYS_FM1_QSGMII21_PHY_ADDR       0x08
+#endif
+
 #define CONFIG_MII             /* MII PHY management */
 #define CONFIG_ETHPRIME                "FM1@DTSEC4"
 #define CONFIG_PHY_GIGE                /* Include GbE speed/duplex detection */
diff --git a/include/configs/Total5200.h b/include/configs/Total5200.h
deleted file mode 100644 (file)
index a58eeca..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * Check valid setting of revision define.
- * Total5100 and Total5200 Rev.1 are identical except for the processor.
- */
-#if (CONFIG_TOTAL5200_REV!=1 && CONFIG_TOTAL5200_REV!=2)
-#error CONFIG_TOTAL5200_REV must be 1 or 2
-#endif
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200         1       /* This is a MPC5200 CPU */
-#define CONFIG_TOTAL5200       1       /* ... on Total5200 board */
-
-/*
- * Valid values for CONFIG_SYS_TEXT_BASE are:
- * 0xFFF00000  boot high (standard configuration)
- * 0xFE000000  boot low
- * 0x00100000  boot from RAM (for testing only)
- */
-#ifndef CONFIG_SYS_TEXT_BASE
-#define        CONFIG_SYS_TEXT_BASE    0xFFF00000
-#endif
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000 /* ... running at 33.000000MHz */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     3       /* console is on PSC3 */
-#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-/*
- * Video console
- */
-#define CONFIG_VIDEO
-#define CONFIG_VIDEO_SED13806
-#define CONFIG_VIDEO_SED13806_16BPP
-
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_LOGO
-/* #define CONFIG_VIDEO_BMP_LOGO */
-#define CONFIG_CONSOLE_EXTRA_INFO
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_VIDEO_SW_CURSOR
-#define CONFIG_SPLASH_SCREEN
-
-
-/*
- * PCI Mapping:
- * 0x40000000 - 0x4fffffff - PCI Memory
- * 0x50000000 - 0x50ffffff - PCI IO Space
- */
-#define CONFIG_PCI             1
-#define CONFIG_PCI_PNP         1
-#define CONFIG_PCI_SCAN_SHOW   1
-#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
-
-#define CONFIG_PCI_MEM_BUS     0x40000000
-#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE    0x10000000
-
-#define CONFIG_PCI_IO_BUS      0x50000000
-#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE     0x01000000
-
-#define CONFIG_MII             1
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8  /* use 8 rx buffer on eepro100  */
-#define CONFIG_NS8382X         1
-
-/* Partitions */
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-/* USB */
-#define CONFIG_USB_OHCI
-#define CONFIG_USB_STORAGE
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_PCI
-
-#define CONFIG_CMD_BMP
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_USB
-
-
-#if (CONFIG_SYS_TEXT_BASE == 0xFE000000)               /* Boot low */
-#   define CONFIG_SYS_LOWBOOT          1
-#endif
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT \
-       "setenv stdout serial;setenv stderr serial;" \
-       "echo;" \
-       "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "netdev=eth0\0"                                                 \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
-               ":${hostname}:${netdev}:off panic=1\0"                  \
-       "flash_nfs=run nfsargs addip;"                                  \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip;"                                 \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0"     \
-       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
-       "bootfile=/tftpboot/MPC5200/uImage\0"                           \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-
-/*
- * IPB Bus clocking configuration.
- */
-#undef CONFIG_SYS_IPBCLK_EQUALS_XLBCLK         /* define for 133MHz speed */
-
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          1       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           100000 /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  70
-
-/*
- * Flash configuration
- */
-#define CONFIG_SYS_FLASH_CFI           1       /* Flash is CFI conformant */
-#define CONFIG_FLASH_CFI_DRIVER        1       /* Use the common driver */
-#if CONFIG_TOTAL5200_REV==2
-#   define CONFIG_SYS_MAX_FLASH_BANKS  3       /* max num of flash banks */
-#   define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_CS5_START, CONFIG_SYS_CS4_START, CONFIG_SYS_BOOTCS_START }
-#else
-#   define CONFIG_SYS_MAX_FLASH_BANKS  1       /* max num of flash banks  */
-#   define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_BOOTCS_START }
-#endif
-#define CONFIG_SYS_FLASH_EMPTY_INFO
-#define CONFIG_SYS_MAX_FLASH_SECT      128     /* max num of sects on one chip */
-
-#if CONFIG_TOTAL5200_REV==1
-#   define CONFIG_SYS_FLASH_BASE       0xFE000000
-#   define CONFIG_SYS_FLASH_SIZE       0x02000000
-#elif CONFIG_TOTAL5200_REV==2
-#   define CONFIG_SYS_FLASH_BASE       0xFA000000
-#   define CONFIG_SYS_FLASH_SIZE       0x06000000
-#endif /* CONFIG_TOTAL5200_REV */
-
-#if defined(CONFIG_SYS_LOWBOOT)
-#   define CONFIG_ENV_ADDR             0xFE040000
-#else  /* CONFIG_SYS_LOWBOOT */
-#   define CONFIG_ENV_ADDR             0xFFF40000
-#endif /* CONFIG_SYS_LOWBOOT */
-
-/*
- * Environment settings
- */
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x40000
-#define CONFIG_ENV_SECT_SIZE   0x40000
-#define CONFIG_ENV_OVERWRITE   1
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-#define CONFIG_SYS_MBAR                0xF0000000      /*   64 kB */
-#define CONFIG_SYS_FPGA_BASE           0xF0010000      /*   64 kB */
-#define CONFIG_SYS_CPLD_BASE           0xF0020000      /*   64 kB */
-#define CONFIG_SYS_LCD_BASE            0xF1000000      /* 4096 kB */
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_SEVENWIRE
-/* dummy, 7-wire FEC does not have phy address */
-#define CONFIG_PHY_ADDR                0x00
-
-/*
- * GPIO configuration
- *
- * CS1:   SDRAM CS1 disabled, gpio_wkup_6 enabled                0
- * Reserved                                                      0
- * ALTs:  CAN1/2 on PSC2, SPI on PSC3                            00
- * CS7:   Interrupt GPIO on PSC3_5                               0
- * CS8:   Interrupt GPIO on PSC3_4                               0
- * ATA:   reset default, changed in ATA driver                   00
- * IR_USB_CLK: IrDA/USB 48MHz clock gen. int., pin is GPIO       0
- * IRDA:  reset default, changed in IrDA driver                  000
- * ETHER: reset default, changed in Ethernet driver              0000
- * PCI_DIS: reset default, changed in PCI driver                 0
- * USB_SE: reset default, changed in USB driver                  0
- * USB:   reset default, changed in USB driver                   00
- * PSC3:  SPI and UART functionality without CD                  1100
- * Reserved                                                      0
- * PSC2:  CAN1/2                                                 001
- * Reserved                                                      0
- * PSC1:  reset default, changed in AC'97 driver                 000
- *
- */
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x00000C10
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#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       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#if CONFIG_TOTAL5200_REV==1
-#   define CONFIG_SYS_BOOTCS_START     CONFIG_SYS_FLASH_BASE
-#   define CONFIG_SYS_BOOTCS_SIZE      0x02000000      /* 32 MB */
-#   define CONFIG_SYS_BOOTCS_CFG       0x0004DF00      /* 4WS, MX, AL, CE, AS_25, DS_32 */
-#   define CONFIG_SYS_CS0_START        CONFIG_SYS_FLASH_BASE
-#   define CONFIG_SYS_CS0_SIZE         0x02000000      /* 32 MB */
-#else
-#   define CONFIG_SYS_BOOTCS_START     (CONFIG_SYS_CS4_START + CONFIG_SYS_CS4_SIZE)
-#   define CONFIG_SYS_BOOTCS_SIZE      0x02000000      /* 32 MB */
-#   define CONFIG_SYS_BOOTCS_CFG       0x0004DF00      /* 4WS, MX, AL, CE, AS_25, DS_32 */
-#   define CONFIG_SYS_CS4_START        (CONFIG_SYS_CS5_START + CONFIG_SYS_CS5_SIZE)
-#   define CONFIG_SYS_CS4_SIZE         0x02000000      /* 32 MB */
-#   define CONFIG_SYS_CS4_CFG          0x0004DF00      /* 4WS, MX, AL, CE, AS_25, DS_32 */
-#   define CONFIG_SYS_CS5_START        CONFIG_SYS_FLASH_BASE
-#   define CONFIG_SYS_CS5_SIZE         0x02000000      /* 32 MB */
-#   define CONFIG_SYS_CS5_CFG          0x0004DF00      /* 4WS, MX, AL, CE, AS_25, DS_32 */
-#endif
-
-#define CONFIG_SYS_CS1_START           CONFIG_SYS_FPGA_BASE
-#define CONFIG_SYS_CS1_SIZE            0x00010000      /* 64 kB */
-#define CONFIG_SYS_CS1_CFG             0x0019FF00      /* 25WS, MX, AL, AA, CE, AS_25, DS_32 */
-
-#define CONFIG_SYS_CS2_START           CONFIG_SYS_LCD_BASE
-#define CONFIG_SYS_CS2_SIZE            0x00400000      /* 4096 kB */
-#define CONFIG_SYS_CS2_CFG             0x0032FD0C      /* 50WS, MX, AL, AA, CE, AS_25, DS_16, endian swapping */
-
-#if CONFIG_TOTAL5200_REV==1
-#   define CONFIG_SYS_CS3_START        CONFIG_SYS_CPLD_BASE
-#   define CONFIG_SYS_CS3_SIZE         0x00010000      /* 64 kB */
-#   define CONFIG_SYS_CS3_CFG          0x000ADF00      /* 10WS, MX, AL, CE, AS_25, DS_32 */
-#else
-#   define CONFIG_SYS_CS3_START        CONFIG_SYS_CPLD_BASE
-#   define CONFIG_SYS_CS3_SIZE         0x00010000      /* 64 kB */
-#   define CONFIG_SYS_CS3_CFG          0x000AD800      /* 10WS, MX, AL, CE, AS_24, DS_8 */
-#endif
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef  CONFIG_IDE_8xx_PCCARD          /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
-
-#define        CONFIG_IDE_RESET                /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_ATA_CS_ON_I2C2
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       1       /* max. 1 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers                                                */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/ZUMA.h b/include/configs/ZUMA.h
deleted file mode 100644 (file)
index cac6a67..0000000
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * (C) Copyright 2001
- * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board/config.h - configuration options, board specific
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_SYS_GT_6426x        GT_64260 /* with a 64260 system controller */
-#define CONFIG_ETHER_PORT_MII  /* use two MII ports */
-#define CONFIG_INTEL_LXT97X    /* Intel LXT97X phy */
-
-#ifndef __ASSEMBLY__
-#include <galileo/core.h>
-#endif
-
-#include "../board/evb64260/local.h"
-
-#define CONFIG_EVB64260                1       /* this is an EVB64260 board    */
-#define CONFIG_ZUMA_V2         1       /* always define this for ZUMA v2 */
-
-#define        CONFIG_SYS_TEXT_BASE    0xfff00000
-
-/* #define CONFIG_ZUMA_V2_OLD  1 */    /* backwards compat for old V2 board */
-
-#define CONFIG_BAUDRATE                38400   /* console baudrate = 38400     */
-
-#define CONFIG_ECC                     /* enable ECC support */
-
-#define CONFIG_750CX                   /* we have a 750CX/CXe (override local.h) */
-
-/* which initialization functions to call for this board */
-#define CONFIG_MISC_INIT_R
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_SYS_BOARD_ASM_INIT
-
-#define CONFIG_SYS_BOARD_NAME          "Zuma APv2"
-
-#define CONFIG_SYS_HUSH_PARSER
-
-/*
- * The following defines let you select what serial you want to use
- * for your console driver.
- *
- * what to do:
- * to use the DUART, undef CONFIG_MPSC.         If you have hacked a serial
- * cable onto the second DUART channel, change the CONFIG_SYS_DUART port from 1
- * to 0 below.
- *
- * to use the MPSC, #define CONFIG_MPSC.  If you have wired up another
- * mpsc channel, change CONFIG_MPSC_PORT to the desired value.
- */
-#define CONFIG_MPSC
-
-#define CONFIG_MPSC_PORT       0
-
-
-/* define this if you want to enable GT MAC filtering */
-#define CONFIG_GT_USE_MAC_HASH_TABLE
-
-#if 1
-#define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
-#else
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-#endif
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-
-#undef CONFIG_BOOTARGS
-
-#define CONFIG_BOOTCOMMAND                                                     \
-       "tftpboot && "                                                          \
-       "setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath " \
-       "ip=$ipaddr:$serverip:$gatewayip:"                              \
-       "$netmask:$hostname:eth0:none panic=5 && bootm"
-
-#define CONFIG_LOADS_ECHO      0       /* echo off for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE           /* allow baudrate changes       */
-
-#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
-#undef CONFIG_ALTIVEC                  /* undef to disable             */
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_BOOTFILESIZE
-
-#define CONFIG_MII             /* enable MII commands */
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_BSP
-#define CONFIG_CMD_JFFS2
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_DATE
-
-
-/*
- * JFFS2 partitions
- *
- */
-/* No command line, one static partition, whole device */
-#undef CONFIG_CMD_MTDPARTS
-#define CONFIG_JFFS2_DEV               "nor0"
-#define CONFIG_JFFS2_PART_SIZE         0xFFFFFFFF
-#define CONFIG_JFFS2_PART_OFFSET       0x00000000
-
-/* mtdparts command line support */
-/* Note: fake mtd_id used, no linux mtd map file */
-/*
-#define CONFIG_CMD_MTDPARTS
-#define MTDIDS_DEFAULT         "nor1=zuma-1,nor2=zuma-2"
-#define MTDPARTS_DEFAULT       "mtdparts=zuma-1:-(jffs2),zuma-2:-(user)"
-*/
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory         */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE      1024            /* Console I/O Buffer Size      */
-#else
-#define CONFIG_SYS_CBSIZE      256             /* Console I/O Buffer Size      */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#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       0x00400000      /* memtest works on     */
-#define CONFIG_SYS_MEMTEST_END         0x00C00000      /* 4 ... 12 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x00300000      /* default load address */
-
-#define CONFIG_SYS_BUS_CLK             133000000       /* 133 MHz              */
-
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-/*
- * Low Level Configuration Settings
- * (address mappings, register initial values, etc.)
- * You should know what you are doing if you make changes here.
- */
-
-/*-----------------------------------------------------------------------
- * Definitions for initial stack pointer and data area
- */
-#define CONFIG_SYS_INIT_RAM_ADDR       0x40000000
-#define CONFIG_SYS_INIT_RAM_SIZE       0x1000
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_RAM_LOCK
-
-
-/*-----------------------------------------------------------------------
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_FLASH_BASE          0xfff00000
-#define CONFIG_SYS_RESET_ADDRESS       0xfff00100
-#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_MALLOC_LEN          (256 << 10)     /* Reserve 256 kB for malloc */
-
-/* areas to map different things with the GT in physical space */
-#define CONFIG_SYS_DRAM_BANKS          4
-#define CONFIG_SYS_DFL_GT_REGS         0x14000000      /* boot time GT_REGS */
-
-/* What to put in the bats. */
-#define CONFIG_SYS_MISC_REGION_BASE    0xf0000000
-
-/* Peripheral Device section */
-#define CONFIG_SYS_GT_REGS             0xf8000000      /* later mapped GT_REGS */
-#define CONFIG_SYS_DEV_BASE            0xf0000000
-#define CONFIG_SYS_DEV0_SIZE           _64M /* zuma flash @ 0xf000.0000*/
-#define CONFIG_SYS_DEV1_SIZE            _8M /* zuma IDE   @ 0xf400.0000 */
-#define CONFIG_SYS_DEV2_SIZE            _8M /* unused */
-#define CONFIG_SYS_DEV3_SIZE            _8M /* unused */
-
-#define CONFIG_SYS_DEV0_PAR            0xc498243c
-       /*     c    4     9     8     2     4     3     c */
-       /* 33 22|2222|22 22|111 1|11 11|1 1  |     |      */
-       /* 10 98|7654|32 10|987 6|54 32|1 098|7 654|3 210 */
-       /* 11|00|0100|10 01|100|0 00|10 0|100 0|011 1|100 */
-       /*  3| 0|.... ..| 1| 4 |  0 |  4 |   8 |   7 | 4  */
-
-#define CONFIG_SYS_DEV1_PAR            0xc01b6ac5
-       /*     c    0     1     b     6     a     c     5 */
-       /* 33 22|2222|22 22|111 1|11 11|1 1  |     |      */
-       /* 10 98|7654|32 10|987 6|54 32|1 098|7 654|3 210 */
-       /* 11|00|0000|00 01|101|1 01|10 1|010 1|100 0|101 */
-       /*  3| 0|.... ..| 1| 5 |  5 |  5 |   5 |   8 | 5  */
-
-
-#define CONFIG_SYS_8BIT_BOOT_PAR       0xc00b5e7c
-
-#define CONFIG_SYS_MPP_CONTROL_0       0x00007777 /* GPP[7:4] : REQ0[1:0] GNT0[1:0] */
-#define CONFIG_SYS_MPP_CONTROL_1       0x00000000 /* GPP[15:12] : GPP[11:8] */
-#define CONFIG_SYS_MPP_CONTROL_2       0x00008888 /* GPP[23:20] : REQ1[1:0] GNT1[1:0] */
-#define CONFIG_SYS_MPP_CONTROL_3       0x00000000 /* GPP[31:28] (int[3:0]) */
-                                          /* GPP[27:24] (27 is int4, rest are GPP) */
-
-#define CONFIG_SYS_SERIAL_PORT_MUX     0x00001101 /* 11=MPSC1/MPSC0 01=ETH,  0=only MII */
-#define CONFIG_SYS_GPP_LEVEL_CONTROL   0xf8000000 /* interrupt inputs: GPP[31:27] */
-
-#define CONFIG_SYS_SDRAM_CONFIG        0xe4e18200      /* 0x448 */
-                               /* idmas use buffer 1,1
-                                  comm use buffer 1
-                                  pci use buffer 0,0 (pci1->0 pci0->0)
-                                  cpu use buffer 1 (R*18)
-                                  normal load (see also ifdef HVL)
-                                  standard SDRAM (see also ifdef REG)
-                                  non staggered refresh */
-                               /* 31:26  25 23  20 19 18 16 */
-                               /* 111001 00 111 0  0  00 1 */
-
-                               /* refresh count=0x200
-                                  phy interleave disable (by default,
-                                  set later by dram config..)
-                                  virt interleave enable */
-                               /* 15 14 13:0 */
-                               /* 1  0  0x200 */
-
-#define CONFIG_SYS_DEV0_SPACE          CONFIG_SYS_DEV_BASE
-#define CONFIG_SYS_DEV1_SPACE          (CONFIG_SYS_DEV0_SPACE + CONFIG_SYS_DEV0_SIZE)
-#define CONFIG_SYS_DEV2_SPACE          (CONFIG_SYS_DEV1_SPACE + CONFIG_SYS_DEV1_SIZE)
-#define CONFIG_SYS_DEV3_SPACE          (CONFIG_SYS_DEV2_SPACE + CONFIG_SYS_DEV2_SIZE)
-
-/*-----------------------------------------------------------------------
- * PCI stuff
- */
-
-#define PCI_HOST_ADAPTER       0       /* configure ar pci adapter     */
-#define PCI_HOST_FORCE         1       /* configure as pci host        */
-#define PCI_HOST_AUTO          2       /* detected via arbiter enable  */
-
-#define CONFIG_PCI                     /* include pci support          */
-#define CONFIG_PCI_HOST PCI_HOST_FORCE /* select pci host function     */
-#define CONFIG_PCI_PNP                 /* do pci plug-and-play         */
-
-/* PCI MEMORY MAP section */
-#define CONFIG_SYS_PCI0_MEM_BASE       0x80000000
-#define CONFIG_SYS_PCI0_MEM_SIZE       _128M
-#define CONFIG_SYS_PCI1_MEM_BASE       0x88000000
-#define CONFIG_SYS_PCI1_MEM_SIZE       _128M
-
-#define CONFIG_SYS_PCI0_0_MEM_SPACE    (CONFIG_SYS_PCI0_MEM_BASE)
-#define CONFIG_SYS_PCI1_0_MEM_SPACE    (CONFIG_SYS_PCI1_MEM_BASE)
-
-/* PCI I/O MAP section */
-#define CONFIG_SYS_PCI0_IO_BASE        0xfa000000
-#define CONFIG_SYS_PCI0_IO_SIZE        _16M
-#define CONFIG_SYS_PCI1_IO_BASE        0xfb000000
-#define CONFIG_SYS_PCI1_IO_SIZE        _16M
-
-#define CONFIG_SYS_PCI0_IO_SPACE       (CONFIG_SYS_PCI0_IO_BASE)
-#define CONFIG_SYS_PCI0_IO_SPACE_PCI   0x00000000
-#define CONFIG_SYS_PCI1_IO_SPACE       (CONFIG_SYS_PCI1_IO_BASE)
-#define CONFIG_SYS_PCI1_IO_SPACE_PCI   0x00000000
-
-
-/*----------------------------------------------------------------------
- * Initial BAT mappings
- */
-
-/* NOTES:
- * 1) GUARDED and WRITE_THRU not allowed in IBATS
- * 2) CACHEINHIBIT and WRITETHROUGH not allowed together in same BAT
- */
-
-/* SDRAM */
-#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
-
-/* init ram */
-#define CONFIG_SYS_IBAT1L  (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT1U  (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT1L  CONFIG_SYS_IBAT1L
-#define CONFIG_SYS_DBAT1U  CONFIG_SYS_IBAT1U
-
-/* PCI0, PCI1 memory space (starting at PCI0 base, mapped in one BAT) */
-#define CONFIG_SYS_IBAT2L BATL_NO_ACCESS
-#define CONFIG_SYS_IBAT2U CONFIG_SYS_DBAT2U
-#define CONFIG_SYS_DBAT2L (CONFIG_SYS_PCI0_MEM_BASE | BATL_CACHEINHIBIT | BATL_PP_RW | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT2U (CONFIG_SYS_PCI0_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-
-/* GT regs, bootrom, all the devices, PCI I/O */
-#define CONFIG_SYS_IBAT3L (CONFIG_SYS_MISC_REGION_BASE | BATL_CACHEINHIBIT | BATL_PP_RW)
-#define CONFIG_SYS_IBAT3U (CONFIG_SYS_MISC_REGION_BASE | BATU_VS | BATU_VP | BATU_BL_256M)
-#define CONFIG_SYS_DBAT3L (CONFIG_SYS_MISC_REGION_BASE | BATL_CACHEINHIBIT | BATL_PP_RW | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ           (8<<20) /* Initial Memory map for Linux */
-
-
-/*-----------------------------------------------------------------------
- * FLASH organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     3       /* max number of memory banks   */
-#define CONFIG_SYS_MAX_FLASH_SECT      130     /* max number of sectors on one chip */
-
-#define CONFIG_SYS_EXTRA_FLASH_DEVICE  DEVICE0 /* extra flash at device 0 */
-#define CONFIG_SYS_EXTRA_FLASH_WIDTH   2       /* 16 bit */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    120000  /* Timeout for Flash Erase (in ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Timeout for Flash Write (in ms) */
-#define CONFIG_SYS_FLASH_CFI           1
-
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x1000  /* Total Size of Environment Sector */
-#define CONFIG_ENV_SECT_SIZE   0x10000 /* see README - env sect real size */
-#define CONFIG_ENV_ADDR                (0xfff80000 - CONFIG_ENV_SECT_SIZE)
-
-/*-----------------------------------------------------------------------
- * Cache Configuration
- */
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For all MPC74xx CPUs          */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CACHELINE_SHIFT     5       /* log base 2 of the above value */
-#endif
-
-/*-----------------------------------------------------------------------
- * L2CR setup -- make sure this is right for your board!
- * look in include/74xx_7xx.h for the defines used here
- */
-
-#define CONFIG_SYS_L2
-
-#ifdef CONFIG_750CX
-#define L2_INIT                0
-#else
-#define L2_INIT                (L2CR_L2SIZ_2M | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \
-                       L2CR_L2OH_5 | L2CR_L2CTL | L2CR_L2WT)
-#endif
-
-#define L2_ENABLE      (L2_INIT | L2CR_L2E)
-
-/*------------------------------------------------------------------------
- * Real time clock
- */
-#define CONFIG_RTC_DS1302
-
-
-/*------------------------------------------------------------------------
- * Galileo I2C driver
- */
-#define CONFIG_GT_I2C
-
-#endif /* __CONFIG_H */
index 000475051812a2846bfd8b0625945cabfd315168..76ce7deb9508716871e6c65e5a38634e8afc86ab 100644 (file)
 #include <configs/ti_am335x_common.h>
 
 #ifndef CONFIG_SPL_BUILD
+#ifndef CONFIG_FIT
 # define CONFIG_FIT
+#endif
 # define CONFIG_TIMESTAMP
 # define CONFIG_LZO
-# ifdef CONFIG_ENABLE_VBOOT
-#  define CONFIG_FIT_SIGNATURE
-#  define CONFIG_RSA
-# endif
 #endif
 
 #define CONFIG_SYS_BOOTM_LEN           (16 << 20)
index b00585c47b041ad4f8710e84011c3512edd0aeae..7ccbf36b0b3b3bae2b2da96e43dc6016fb8399d3 100644 (file)
@@ -39,6 +39,7 @@
 #define CONFIG_POWER
 #define CONFIG_POWER_I2C
 #define CONFIG_POWER_TPS65218
+#define CONFIG_POWER_TPS62362
 
 /* SPL defines. */
 #define CONFIG_SPL_TEXT_BASE           0x40300350
                        "setenv fdtfile am437x-gp-evm.dtb; fi; " \
                "if test $board_name = AM43__SK; then " \
                        "setenv fdtfile am437x-sk-evm.dtb; fi; " \
+               "if test $board_name = AM43_IDK; then " \
+                       "setenv fdtfile am437x-idk-evm.dtb; fi; " \
                "if test $fdtfile = undefined; then " \
                        "echo WARNING: Could not determine device tree; fi; \0"
 
index d68993bb1f7301c1384caaed9185524f7a2e3ea6..3ad4a9ba91f6eaa7da5d465b9584308561cbd9f3 100644 (file)
@@ -51,8 +51,6 @@
 /* PMIC */
 #define CONFIG_PMIC
 #define CONFIG_POWER_I2C
-#define CONFIG_POWER_MAX77686
-
 
 #define CONFIG_PREBOOT
 
index 7e6d239d13d207c334da837485fc906ecf4ac792..7b460e83c45726004a605b9ef3a5775e6cc000c5 100644 (file)
@@ -20,6 +20,7 @@
 
 #define CONFIG_DCACHE_RAM_MRC_VAR_SIZE         0x4000
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_MISC_INIT_R
 
 #define CONFIG_NR_DRAM_BANKS                   8
 #define CONFIG_X86_MRC_ADDR                    0xfffa0000
 #define CONFIG_CMD_CROS_EC
 #define CONFIG_ARCH_EARLY_INIT_R
 
+#undef CONFIG_ENV_IS_NOWHERE
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZE                        0x1000
+#define CONFIG_ENV_SECT_SIZE           0x1000
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET              0x003f8000
+
 #define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,vga,serial\0" \
                                        "stdout=vga,serial\0" \
                                        "stderr=vga,serial\0"
index 5b50c1d6dd5c459b0328da23eec806fd09342461..ace511f76534bc9188a2222eee32a0f15cb2bc0f 100644 (file)
@@ -18,6 +18,7 @@
 
 #define MACH_TYPE_CORVUS               2066
 
+#define CONFIG_MACH_TYPE               MACH_TYPE_CORVUS
 #define CONFIG_SYS_GENERIC_BOARD
 /*
  * Warning: changing CONFIG_SYS_TEXT_BASE requires
 /* 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_SPL_BOARD_INIT
 #define CONFIG_SPL_GPIO_SUPPORT
-#define CONFIG_SYS_NAND_ENABLE_PIN_SPL (2*32 + 14)
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SYS_NAND_U_BOOT_DST     CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 
-#define CONFIG_SYS_NAND_SIZE           (256*1024*1024)
 #define CONFIG_SYS_NAND_PAGE_SIZE      2048
 #define CONFIG_SYS_NAND_BLOCK_SIZE     (128*1024)
 #define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
diff --git a/include/configs/cpci5200.h b/include/configs/cpci5200.h
deleted file mode 100644 (file)
index ec926fd..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
-
- */
-
-/*************************************************************************
- * (c) 2005 esd gmbh Hannover
- *
- *
- * from IceCube.h file
- * by Reinhard Arlt reinhard.arlt@esd-electronics.com
- *
- *************************************************************************/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200         1       /* This is an MPC5200 CPU */
-#define CONFIG_ICECUBE         1       /* ... on IceCube board   */
-#define CONFIG_CPCI5200                1       /* ... on CPCI5200  board */
-#define CONFIG_MPC5200_DDR     1       /* ... use DDR RAM        */
-
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE   0xFFF00000      /* Standard: boot high */
-#endif
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000        /* ... running at 33.000000MHz */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported    */
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#define CONFIG_BAUDRATE                9600    /* ... at 115200 bps */
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-/*
- * PCI Mapping:
- * 0x40000000 - 0x4fffffff - PCI Memory
- * 0x50000000 - 0x50ffffff - PCI IO Space
- */
-#if 1
-#define CONFIG_PCI             1
-#if 1
-#define CONFIG_PCI_PNP         1
-#endif
-#define CONFIG_PCI_SCAN_SHOW   1
-#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
-
-#define CONFIG_PCI_MEM_BUS     0x40000000
-#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE    0x10000000
-
-#define CONFIG_PCI_IO_BUS      0x50000000
-#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE     0x01000000
-#endif
-
-#define CONFIG_MII
-#if 0                          /* test-only !!! */
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8       /* use 8 rx buffer on eepro100  */
-#define CONFIG_NS8382X         1
-#endif
-
-/* Partitions */
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-/* USB */
-#if 0
-#define CONFIG_USB_OHCI
-#define CONFIG_USB_STORAGE
-#endif
-
-/*
- * 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>
-
-#if defined(CONFIG_PCI)
-#define CONFIG_CMD_PCI
-#endif
-
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_BSP
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_DATE
-
-#if (CONFIG_SYS_TEXT_BASE == 0xFF000000)       /* Boot low with 16 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT16        1
-#endif
-#if (CONFIG_SYS_TEXT_BASE == 0xFF800000)       /* Boot low with  8 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT08        1
-#endif
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       3       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Welcome to esd CPU CPCI/5200;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS \
-       "netdev=eth0\0" \
-       "flash_vxworks0=run ata_vxworks_args;setenv loadaddr ff000000;bootvx\0" \
-       "flash_vxworks1=run ata_vxworks_args;setenv loadaddr ff200000:bootvx\0" \
-       "net_vxworks=phypower 1;sleep 2;tftp ${loadaddr} ${image};run vxworks_args;bootvx\0" \
-       "vxworks_args=setenv bootargs fec(0,0)${host}:${image} h=${serverip} e=${ipaddr} g=${gatewayip} u=${user} ${pass} tn=${target} s=${script}\0" \
-       "ata_vxworks_args=setenv bootargs /ata0/vxWorks h=${serverip} e=${ipaddr} g=${gatewayip} u=${user} ${pass} tn=${target} s=${script} o=fec0 \0" \
-       "loadaddr=01000000\0" \
-       "serverip=192.168.2.99\0" \
-       "gatewayip=10.0.0.79\0" \
-       "user=mu\0" \
-       "target=cpci5200.esd\0" \
-       "script=cpci5200.bat\0" \
-       "image=/tftpboot/vxWorks_cpci5200\0" \
-       "ipaddr=10.0.13.196\0" \
-       "netmask=255.255.0.0\0" \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_vxworks0"
-
-#define CONFIG_RTC_M48T35A     1       /* ST Electronics M48 timekeeper */
-#define CONFIG_SYS_NVRAM_BASE_ADDR     0xfd010000
-#define CONFIG_SYS_NVRAM_SIZE          32*1024
-
-/*
- * IPB Bus clocking configuration.
- */
-#undef CONFIG_SYS_IPBCLK_EQUALS_XLBCLK         /* define for 133MHz speed */
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          1       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           86000   /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      5
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS           1
-/*
- * Flash configuration
- */
-
-#define CONFIG_SYS_FLASH_CFI           1       /* Flash is CFI conformant           */
-#define CONFIG_SYS_FLASH_BASE          0xFE000000
-#define CONFIG_SYS_FLASH_SIZE          0x02000000
-#define CONFIG_SYS_FLASH_INCREMENT     0x01000000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x00000000)
-#define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max num of memory banks      */
-#define CONFIG_SYS_MAX_FLASH_SECT      128
-
-#define CONFIG_SYS_FLASH_PROTECTION    1       /* use hardware protection           */
-#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1    /* use buffered writes (20x faster)  */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    240000  /* Flash Erase Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (in ms)  */
-
-/*
- * Environment settings
- */
-#if 1                          /* test-only */
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x20000
-#define CONFIG_ENV_SECT_SIZE   0x20000
-#define CONFIG_ENV_OVERWRITE   1
-#else
-#define CONFIG_ENV_IS_IN_EEPROM        1       /* use EEPROM for environment vars */
-#define CONFIG_ENV_OFFSET              0x0000  /* environment starts at the beginning of the EEPROM */
-#define CONFIG_ENV_SIZE                0x0400  /* 8192 bytes may be used for env vars */
-                                  /* total size of a CAT24WC32 is 8192 bytes */
-#define CONFIG_ENV_OVERWRITE   1
-#endif
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_MBAR                0xF0000000
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_MII100
-/*
- * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
- */
-/* #define CONFIG_FEC_10MBIT 1 */
-#define CONFIG_PHY_ADDR                0x00
-#define CONFIG_UDP_CHECKSUM    1
-
-/*
- * GPIO configuration
- */
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x01052444
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#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       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_VXWORKS_MAC_PTR     0x00000000      /* Pass Ethernet MAC to VxWorks */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x0004DD00
-
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-
-#define CONFIG_SYS_CS1_START           0xfd000000
-#define CONFIG_SYS_CS1_SIZE            0x00010000
-#define CONFIG_SYS_CS1_CFG             0x10101410
-
-#define CONFIG_SYS_CS3_START           0xfd010000
-#define CONFIG_SYS_CS3_SIZE            0x00010000
-#define CONFIG_SYS_CS3_CFG             0x10109410
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-#define CONFIG_SYS_RESET_ADDRESS       0xff000000
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef CONFIG_IDE_8xx_PCCARD   /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT   /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED          /* LED   for ide not supported  */
-
-#define        CONFIG_IDE_RESET        /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       1       /* max. 1 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers                                               */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-/*-----------------------------------------------------------------------
- * CPLD stuff
- */
-#define CONFIG_SYS_FPGA_XC95XL         1       /* using Xilinx XC95XL CPLD      */
-#define CONFIG_SYS_FPGA_MAX_SIZE       32*1024 /* 32kByte is enough for CPLD    */
-
-/* CPLD program pin configuration */
-#define CONFIG_SYS_FPGA_PRG            0x20000000      /* JTAG TMS pin (ppc output)           */
-#define CONFIG_SYS_FPGA_CLK            0x10000000      /* JTAG TCK pin (ppc output)           */
-#define CONFIG_SYS_FPGA_DATA           0x20000000      /* JTAG TDO->TDI data pin (ppc output) */
-#define CONFIG_SYS_FPGA_DONE           0x10000000      /* JTAG TDI->TDO pin (ppc input)       */
-
-#define JTAG_GPIO_ADDR_TMS     (CONFIG_SYS_MBAR + 0xB10)       /* JTAG TMS pin (GPS data out value reg.)      */
-#define JTAG_GPIO_ADDR_TCK     (CONFIG_SYS_MBAR + 0xC0C)       /* JTAG TCK pin (GPW data out value reg.)      */
-#define JTAG_GPIO_ADDR_TDI     (CONFIG_SYS_MBAR + 0xC0C)       /* JTAG TDO->TDI pin (GPW data out value reg.) */
-#define JTAG_GPIO_ADDR_TDO     (CONFIG_SYS_MBAR + 0xB14)       /* JTAG TDI->TDO pin (GPS data in value reg.)  */
-
-#define JTAG_GPIO_ADDR_CFG     (CONFIG_SYS_MBAR + 0xB00)
-#define JTAG_GPIO_CFG_SET      0x00000000
-#define JTAG_GPIO_CFG_RESET    0x00F00000
-
-#define JTAG_GPIO_ADDR_EN_TMS  (CONFIG_SYS_MBAR + 0xB04)
-#define JTAG_GPIO_TMS_EN_SET   0x20000000      /* Enable for GPIO */
-#define JTAG_GPIO_TMS_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TMS (CONFIG_SYS_MBAR + 0xB0C)
-#define JTAG_GPIO_TMS_DDR_SET  0x20000000      /* Set as output   */
-#define JTAG_GPIO_TMS_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TCK  (CONFIG_SYS_MBAR + 0xC00)
-#define JTAG_GPIO_TCK_EN_SET   0x20000000      /* Enable for GPIO */
-#define JTAG_GPIO_TCK_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TCK (CONFIG_SYS_MBAR + 0xC08)
-#define JTAG_GPIO_TCK_DDR_SET  0x20000000      /* Set as output   */
-#define JTAG_GPIO_TCK_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TDI  (CONFIG_SYS_MBAR + 0xC00)
-#define JTAG_GPIO_TDI_EN_SET   0x10000000      /* Enable as GPIO  */
-#define JTAG_GPIO_TDI_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TDI (CONFIG_SYS_MBAR + 0xC08)
-#define JTAG_GPIO_TDI_DDR_SET  0x10000000      /* Set as output   */
-#define JTAG_GPIO_TDI_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TDO  (CONFIG_SYS_MBAR + 0xB04)
-#define JTAG_GPIO_TDO_EN_SET   0x10000000      /* Enable as GPIO  */
-#define JTAG_GPIO_TDO_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TDO (CONFIG_SYS_MBAR + 0xB0C)
-#define JTAG_GPIO_TDO_DDR_SET  0x00000000
-#define JTAG_GPIO_TDO_DDR_RESET 0x10000000     /* Set as input    */
-
-#endif                         /* __CONFIG_H */
index 77e2f587bde69c02014415a01eacad4ba01bec08..1c69551d16ae31cb3dda2924edf88d261f972c78 100644 (file)
 #define __CONFIG_H
 
 /* High Level Configuration Options */
-#define CONFIG_OMAP            1       /* in a TI OMAP core */
 #define CONFIG_OMAP3_DEVKIT8000        1       /* working with DevKit8000 */
 #define CONFIG_MACH_TYPE       MACH_TYPE_DEVKIT8000
-#define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
-#define CONFIG_SYS_GENERIC_BOARD
 
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  */
 #define CONFIG_SYS_TEXT_BASE   0x80100000
 
-#define CONFIG_SDRC    /* The chip has SDRC controller */
+#define CONFIG_SPL_BSS_START_ADDR       0x80000500 /* leave space for bootargs*/
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+
+#define CONFIG_SYS_SPL_MALLOC_START    0x80208000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000        /* 1 MB */
+
+#define CONFIG_NAND
+
+/*  Physical Memory Map  */
+#define CONFIG_NR_DRAM_BANKS           2 /* CS1 may or may not be populated */
 
-#include <asm/arch/cpu.h>              /* get chip and board defs */
-#include <asm/arch/omap3.h>
+#include <configs/ti_omap3_common.h>
 
 /* Display CPU and Board information */
 #define CONFIG_DISPLAY_CPUINFO         1
 #define CONFIG_DISPLAY_BOARDINFO       1
 
-/* Clock Defines */
-#define V_OSCK                         26000000        /* Clock output from T2 */
-#define V_SCLK                         (V_OSCK >> 1)
-
 #define CONFIG_MISC_INIT_R
 
-#define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS       1
-#define CONFIG_INITRD_TAG              1
 #define CONFIG_REVISION_TAG            1
 
-#define CONFIG_OF_LIBFDT               1
-
 /* Size of malloc() pool */
 #define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
                                                /* Sector */
+#undef CONFIG_SYS_MALLOC_LEN
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (128 << 10))
 
 /* Hardware drivers */
 #define CONFIG_DM9000_NO_SROM          1
 #undef CONFIG_DM9000_DEBUG
 
-/* NS16550 Configuration */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
-#define CONFIG_SYS_NS16550_CLK         48000000 /* 48MHz (APLL96/2) */
-
-/* select serial console configuration */
-#define CONFIG_CONS_INDEX              3
-#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
-#define CONFIG_SERIAL3                 3
-#define CONFIG_BAUDRATE                        115200
-#define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
-                                       115200}
-
-/* MMC */
-#define CONFIG_GENERIC_MMC             1
-#define CONFIG_MMC                     1
-#define CONFIG_OMAP_HSMMC              1
-#define CONFIG_DOS_PARTITION           1
+/* SPI */
+#undef CONFIG_SPI
+#undef CONFIG_OMAP3_SPI
 
 /* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_OMAP24_I2C_SPEED    100000
-#define CONFIG_SYS_OMAP24_I2C_SLAVE    1
+#undef CONFIG_SYS_I2C_OMAP24XX
 #define CONFIG_SYS_I2C_OMAP34XX
 
 /* TWL4030 */
-#define CONFIG_TWL4030_POWER           1
 #define CONFIG_TWL4030_LED             1
 
 /* Board NAND Info */
-#define CONFIG_SYS_NO_FLASH            /* no NOR flash */
-#define CONFIG_MTD_DEVICE              /* needed for mtdparts commands */
 #define MTDIDS_DEFAULT                 "nand0=nand"
 #define MTDPARTS_DEFAULT               "mtdparts=nand:" \
                                                "512k(x-loader)," \
                                                "4m(kernel)," \
                                                "-(fs)"
 
-#define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_SYS_NAND_ADDR           NAND_BASE       /* physical address */
                                                        /* to access nand */
-#define CONFIG_SYS_NAND_BASE           NAND_BASE       /* physical address */
-                                                       /* to access nand at */
-                                                       /* CS0 */
-#define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of NAND */
-                                                       /* devices */
 #define CONFIG_JFFS2_NAND
 /* nand device jffs2 lives on */
 #define CONFIG_JFFS2_DEV               "nand0"
                                                        /* partition */
 
 /* commands to include */
-#include <config_cmd_default.h>
-
 #define CONFIG_CMD_DHCP                        /* DHCP support                 */
-#define CONFIG_CMD_EXT2                        /* EXT2 Support                 */
-#define CONFIG_CMD_FAT                 /* FAT support                  */
-#define CONFIG_CMD_I2C                 /* I2C serial bus support       */
 #define CONFIG_CMD_JFFS2               /* JFFS2 Support                */
-#define CONFIG_CMD_MMC                 /* MMC support                  */
-#define CONFIG_CMD_MTDPARTS            /* Enable MTD parts commands    */
-#define CONFIG_CMD_NAND                        /* NAND support                 */
 #define CONFIG_CMD_NAND_LOCK_UNLOCK    /* nand (un)lock commands       */
 
 #undef CONFIG_CMD_FPGA                 /* FPGA configuration Support   */
 #undef CONFIG_CMD_IMI                  /* iminfo                       */
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_GPIO
+#undef CONFIG_CMD_ASKENV
+#undef CONFIG_CMD_BOOTZ
+#undef CONFIG_SUPPORT_RAW_INITRD
+#undef CONFIG_FAT_WRITE
+#undef CONFIG_CMD_EXT4
+#undef CONFIG_CMD_FS_GENERIC
 
 /* BOOTP/DHCP options */
 #define CONFIG_BOOTP_SUBNETMASK
 #undef CONFIG_BOOTP_VENDOREX
 
 /* Environment information */
-#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
-
-#define CONFIG_BOOTDELAY               3
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x82000000\0" \
        "console=ttyO2,115200n8\0" \
 
 #define CONFIG_BOOTCOMMAND "run autoboot"
 
-/* Miscellaneous configurable options */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
-#define CONFIG_AUTO_COMPLETE           1
-#define CONFIG_SYS_PROMPT              "OMAP3 DevKit8000 # "
-#define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
-                                       sizeof(CONFIG_SYS_PROMPT) + 16)
-#define CONFIG_SYS_MAXARGS             128     /* max number of command args */
-
 /* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
-
 #define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0 + 0x07000000)
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
                                        0x01000000) /* 16MB */
 
-#define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0 + 0x02000000)
-
-/*
- * OMAP3 has 12 GP timers, they can be driven by the system clock
- * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
- * This rate is divided by a local divisor.
- */
-#define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
-#define CONFIG_SYS_PTV                 2 /* Divisor: 2^(PTV+1) => 8 */
-
-/*  Physical Memory Map  */
-#define CONFIG_NR_DRAM_BANKS           2 /* CS1 may or may not be populated */
-#define PHYS_SDRAM_1                   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_2                   OMAP34XX_SDRC_CS1
-
 /* NAND and environment organization  */
-#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 2 sectors */
-
 #define CONFIG_ENV_IS_IN_NAND          1
 #define SMNAND_ENV_OFFSET              0x260000 /* environment starts here */
 
 #define CONFIG_ENV_OFFSET              SMNAND_ENV_OFFSET
 
-#define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define CONFIG_SYS_INIT_RAM_ADDR        0x4020f800
-#define CONFIG_SYS_INIT_RAM_SIZE        0x800
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_INIT_RAM_ADDR + \
-                                                        CONFIG_SYS_INIT_RAM_SIZE - \
-                                                        GENERATED_GBL_DATA_SIZE)
-
 /* SRAM config */
 #define CONFIG_SYS_SRAM_START              0x40200000
 #define CONFIG_SYS_SRAM_SIZE               0x10000
 
 /* Defines for SPL */
-#define CONFIG_SPL_FRAMEWORK
-#define CONFIG_SPL_NAND_SIMPLE
-
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_LIBDISK_SUPPORT
-#define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_I2C_SUPPORT
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_GPIO_SUPPORT
-#define CONFIG_SPL_POWER_SUPPORT
-#define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_BASE
-#define CONFIG_SPL_NAND_DRIVERS
-#define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_MMC_SUPPORT
-#define CONFIG_SPL_FAT_SUPPORT
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
-#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
+#undef CONFIG_SPL_MTD_SUPPORT
 
+#undef CONFIG_SPL_TEXT_BASE
 #define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
-#define CONFIG_SPL_MAX_SIZE            (54 * 1024)     /* 8 KB for stack */
+#undef CONFIG_SPL_STACK
 #define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR       0x80000500 /* leave space for bootargs*/
-#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
-
 /* NAND boot config */
 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT 16
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_ECCBYTES       3
 #define CONFIG_NAND_OMAP_ECCSCHEME     OMAP_ECC_HAM1_CODE_HW
 
-#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_TEXT_BASE
-
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
 #define CONFIG_SYS_NAND_U_BOOT_SIZE    0x200000
 
-#define CONFIG_SYS_SPL_MALLOC_START    0x80208000
-#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000        /* 1 MB */
-
 /* SPL OS boot options */
-#define CONFIG_SPL_OS_BOOT
-
-#define CONFIG_CMD_SPL
 #define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
 #define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
                                        0x400000)
 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
 
-#define CONFIG_SPL_FS_LOAD_KERNEL_NAME         "uImage"
-#define CONFIG_SPL_FS_LOAD_ARGS_NAME           "args"
-
+#undef CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR
+#undef CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR
+#undef CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS
 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x500 /* address 0xa0000 */
 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x8   /* address 0x1000 */
 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8     /* 4KB */
 
+#undef CONFIG_SYS_SPL_ARGS_ADDR
 #define CONFIG_SYS_SPL_ARGS_ADDR        (PHYS_SDRAM_1 + 0x100)
 
 #endif /* __CONFIG_H */
index 46a42b30874492f970aabf6b0420ea11d57d7dbc..ec7f721ff3736e3f571b3a567d3b09bf9cbba487 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _CONFIG_DOCKSTAR_H
 #define _CONFIG_DOCKSTAR_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
index ad63f3c5496d39e0be23c35d2a1d29c92edf8c11..0ba39a23dd03d4fcf71d3bed7815e8149cc7019d 100644 (file)
 #define SPI_FLASH_UBOOT_POS    (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE)
 
 /* I2C */
-#define CONFIG_SYS_I2C_INIT_BOARD
-#define CONFIG_SYS_I2C
+#define CONFIG_DM_I2C
+#define CONFIG_DM_I2C_COMPAT
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000          /* 100 Kbps */
 #define CONFIG_SYS_I2C_S3C24X0
-#define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C_S3C24X0_SPEED   100000          /* 100 Kbps */
 #define CONFIG_SYS_I2C_S3C24X0_SLAVE    0x0
 #define CONFIG_I2C_EDID
 
index 671431397fc02598316a9da65e170cd9196c5df8..ae0e5ff47b096a48f2a1a798070a80a06ad52f52 100644 (file)
@@ -28,9 +28,6 @@
 
 #define CONFIG_SYS_INIT_SP_ADDR        CONFIG_IRAM_STACK
 
-/* PMIC */
-#define CONFIG_POWER_MAX77686
-
 /* Sound */
 #define CONFIG_CMD_SOUND
 #ifdef CONFIG_CMD_SOUND
index 5ed949791f642a5e0a901d7838c0f2595e7fecd1..836515d17820f581fcc2b708c7cf7961d1f3efca 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef _CONFIG_GOFLEXHOME_H
 #define _CONFIG_GOFLEXHOME_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
index a56a4cb98271c558bcd4a3654b686c448ebdd06c..8e53af8c04bb47d3c3ced3d807ddd9fb1537f735 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * (C) Copyright 2009
+ * (C) Copyright 2009-2014
+ * Gerald Kerma <dreagle@doukki.net>
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Siddarth Gore <gores@marvell.com>
  *
@@ -9,6 +10,8 @@
 #ifndef _CONFIG_GURUPLUG_H
 #define _CONFIG_GURUPLUG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
 #define CONFIG_MACH_GURUPLUG   /* Machine type */
 #define CONFIG_SKIP_LOWLEVEL_INIT      /* disable board lowlevel_init */
 
+/*
+ * Compression configuration
+ */
+#define CONFIG_BZIP2
+#define CONFIG_LZMA
+#define CONFIG_LZO
+
+/*
+ * Enable device tree support
+ */
+#define CONFIG_OF_LIBFDT
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
+
 /*
  * Commands configuration
  */
 #define CONFIG_SYS_NO_FLASH            /* Declare no flash (NOR/SPI) */
 #include <config_cmd_default.h>
+#define CONFIG_CMD_BOOTZ
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
-#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_MII
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_USB
-#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
 
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * it has to be rounded to sector size
  */
 #define CONFIG_ENV_SIZE                        0x20000 /* 128k */
-#define CONFIG_ENV_ADDR                        0x60000
-#define CONFIG_ENV_OFFSET              0x60000 /* env starts here */
+#define CONFIG_ENV_OFFSET              0xE0000 /* env starts here */
 
 /*
  * Default environment variables
  */
-#define CONFIG_BOOTCOMMAND             "setenv ethact egiga0; " \
-       "${x_bootcmd_ethernet}; setenv ethact egiga1; " \
-       "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\
-       "setenv bootargs ${x_bootargs} ${x_bootargs_root}; "    \
-       "bootm 0x6400000;"
-
-#define CONFIG_EXTRA_ENV_SETTINGS      \
-       "x_bootcmd_ethernet=ping 192.168.2.1\0" \
-       "x_bootcmd_usb=usb start\0"     \
-       "x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000\0" \
-       "x_bootargs=console=ttyS0,115200\0"     \
-       "x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
+#define CONFIG_BOOTCOMMAND \
+       "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
+       "ubi part root; "                                               \
+       "ubifsmount ubi:rootfs; "                                       \
+       "ubifsload 0x800000 ${kernel}; "                                \
+       "ubifsload 0x700000 ${fdt}; "                                   \
+       "ubifsumount; "                                                 \
+       "fdt addr 0x700000; fdt resize; fdt chosen; "                   \
+       "bootz 0x800000 - 0x700000"
+
+#define CONFIG_MTDPARTS        \
+       "mtdparts=orion_nand:"                                          \
+       "896K(uboot),128K(uboot_env),"                                  \
+       "-@1M(root)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "console=console=ttyS0,115200\0"                                \
+       "mtdids=nand0=orion_nand\0"                                     \
+       "mtdparts="CONFIG_MTDPARTS                                      \
+       "kernel=/boot/zImage\0"                                         \
+       "fdt=/boot/guruplug-server-plus.dtb\0"                          \
+       "bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
+
+#define MTDIDS_DEFAULT "nand0=orion_nand"
+
+#define MTDPARTS_DEFAULT       \
+       "mtdparts="CONFIG_MTDPARTS
 
 /*
  * Ethernet Driver configuration
 #define CONFIG_SYS_ATA_IDE0_OFFSET     MV_SATA_PORT0_OFFSET
 #endif /*CONFIG_MVSATA_IDE*/
 
+/*
+ * File system
+ */
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+
 #define CONFIG_SYS_ALT_MEMTEST
 
 #endif /* _CONFIG_GURUPLUG_H */
index f4c748a91d1f0d94190046545fcf73fd5b9946d5..f1ddf21580da19fd0e12f4d3ffa4b49cb47834c3 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _CONFIG_IB62x0_H
 #define _CONFIG_IB62x0_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
index 9f4a4b83a32a7927f6a4f6b2ac168b30a614cb97..2baf50cc4e1df6ec7229becfb8322ed25f4a0b8c 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _CONFIG_ICONNECT_H
 #define _CONFIG_ICONNECT_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
index f08483487d9fc7dc7533076cfa6527127d7d8570..2384864eb025fc979288bec16e3a2e2aca709f01 100644 (file)
 
 #define CONFIG_VERSION_VARIABLE
 
-#define CONFIG_FIT
-#define CONFIG_FIT_SIGNATURE
 #define CONFIG_IMAGE_FORMAT_LEGACY
 #define CONFIG_CMD_FDT
 #define CONFIG_CMD_HASH
-#define CONFIG_RSA
 #define CONFIG_SHA1
 #define CONFIG_SHA256
 
index 8dc04f2e574bd40eee24a31605a245b0373a4a16..2874ccc6fadd2847b98fe5018fb3c6f16479fae7 100644 (file)
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
+#define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
+#define CONFIG_SILENT_CONSOLE
+#endif
+
 /*
  * Size of malloc() pool
  */
@@ -72,7 +77,8 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SPL_PAD_TO              0x1c000
 #define CONFIG_SYS_TEXT_BASE           0x82000000
 
-#define CONFIG_SYS_SPL_MALLOC_START    0x80200000
+#define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SYS_TEXT_BASE + \
+               CONFIG_SYS_MONITOR_LEN)
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
 #define CONFIG_SPL_BSS_START_ADDR      0x80100000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000
@@ -365,11 +371,16 @@ unsigned long get_board_ddr_clk(void);
 /*
  * Serial Port
  */
+#ifdef CONFIG_LPUART
+#define CONFIG_FSL_LPUART
+#define CONFIG_LPUART_32B_REG
+#else
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE    1
 #define CONFIG_SYS_NS16550_CLK         get_serial_clock()
+#endif
 
 #define CONFIG_BAUDRATE                        115200
 
@@ -385,6 +396,7 @@ unsigned long get_board_ddr_clk(void);
  */
 #define I2C_MUX_PCA_ADDR_PRI           0x77
 #define I2C_MUX_CH_DEFAULT             0x8
+#define I2C_MUX_CH_CH7301              0xC
 
 /*
  * MMC
@@ -426,6 +438,25 @@ unsigned long get_board_ddr_clk(void);
 #endif
 #endif
 
+/*
+ * Video
+ */
+#define CONFIG_FSL_DCU_FB
+
+#ifdef CONFIG_FSL_DCU_FB
+#define CONFIG_VIDEO
+#define CONFIG_CMD_BMP
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_VIDEO_BMP_LOGO
+
+#define CONFIG_FSL_DIU_CH7301
+#define CONFIG_SYS_I2C_DVI_BUS_NUM     0
+#define CONFIG_SYS_I2C_QIXIS_ADDR      0x66
+#define CONFIG_SYS_I2C_DVI_ADDR                0x75
+#endif
+
 /*
  * eTSEC
  */
@@ -508,11 +539,19 @@ unsigned long get_board_ddr_clk(void);
 
 #define CONFIG_SYS_QE_FW_ADDR     0x67f40000
 
+#ifdef CONFIG_LPUART
+#define CONFIG_EXTRA_ENV_SETTINGS       \
+       "bootargs=root=/dev/ram0 rw console=ttyLP0,115200\0" \
+       "fdt_high=0xcfffffff\0"         \
+       "initrd_high=0xcfffffff\0"      \
+       "hwconfig=fsl_ddr:ctlr_intlv=null,bank_intlv=null\0"
+#else
 #define CONFIG_EXTRA_ENV_SETTINGS      \
        "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
        "fdt_high=0xcfffffff\0"         \
        "initrd_high=0xcfffffff\0"      \
        "hwconfig=fsl_ddr:ctlr_intlv=null,bank_intlv=null\0"
+#endif
 
 /*
  * Miscellaneous configurable options
index 66954d0a401aee4e97be648cd5566c4c6b9d6194..0a0bb5f1099ea789b8da6dabe00778745527ecf0 100644 (file)
 /*
  * Serial Port
  */
+#ifdef CONFIG_LPUART
+#define CONFIG_FSL_LPUART
+#define CONFIG_LPUART_32B_REG
+#else
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE    1
 #define CONFIG_SYS_NS16550_CLK         get_serial_clock()
+#endif
 
 #define CONFIG_BAUDRATE                        115200
 
 
 #define CONFIG_BOOTDELAY               3
 
+#ifdef CONFIG_LPUART
+#define CONFIG_EXTRA_ENV_SETTINGS       \
+       "bootargs=root=/dev/ram0 rw console=ttyLP0,115200\0" \
+       "initrd_high=0xcfffffff\0"      \
+       "fdt_high=0xcfffffff\0"
+#else
 #define CONFIG_EXTRA_ENV_SETTINGS      \
        "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
        "initrd_high=0xcfffffff\0"      \
        "fdt_high=0xcfffffff\0"
+#endif
 
 /*
  * Miscellaneous configurable options
index a29b86b4f63c95fe5110f901ca52891c315fa4a2..354672ecf8735e9240b119a801df2ffba0b91ab1 100644 (file)
@@ -38,8 +38,6 @@
 #define CONFIG_SYS_MHZ                 250     /* arbitrary value */
 #define CONFIG_SYS_MIPS_TIMER_FREQ     (CONFIG_SYS_MHZ * 1000000)
 
-#define CONFIG_SWAP_IO_SPACE
-
 /*
  * Memory map
  */
@@ -73,6 +71,7 @@
                                         sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS             16
 
+#define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
 
 #define CONFIG_ENV_ADDR \
        (CONFIG_SYS_FLASH_BASE + (4 << 20) - CONFIG_ENV_SIZE)
 
+/*
+ * IDE/ATA
+ */
+#define CONFIG_SYS_IDE_MAXBUS          1
+#define CONFIG_SYS_IDE_MAXDEVICE       2
+#define CONFIG_SYS_ATA_BASE_ADDR       CONFIG_SYS_ISA_IO_BASE_ADDRESS
+#define CONFIG_SYS_ATA_IDE0_OFFSET     0x01f0
+#define CONFIG_SYS_ATA_DATA_OFFSET     0
+#define CONFIG_SYS_ATA_REG_OFFSET      0
+
 /*
  * Commands
  */
 
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IDE
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
 
diff --git a/include/configs/mecp5200.h b/include/configs/mecp5200.h
deleted file mode 100644 (file)
index b270429..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-
-/*************************************************************************
- * (c) 2005 esd gmbh Hannover
- *
- *
- * from IceCube.h file
- * by Reinhard Arlt reinhard.arlt@esd-electronics.com
- *
- *************************************************************************/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200         1       /* This is an MPC5200 CPU */
-#define CONFIG_ICECUBE         1       /* ... on IceCube board */
-#define CONFIG_MECP5200                1       /* ... on MECP5200  board */
-#define CONFIG_MPC5200_DDR      1       /* ... use DDR RAM      */
-
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE   0xFFF00000
-#endif
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000 /* ... running at 33.000000MHz */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#if 0 /* test-only */
-#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
-#else
-#define CONFIG_BAUDRATE                9600    /* ... at 115200 bps */
-#endif
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-#define CONFIG_MII
-#if 0 /* test-only !!! */
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8  /* use 8 rx buffer on eepro100  */
-#define CONFIG_NS8382X         1
-#endif
-
-/* Partitions */
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-/* USB */
-#if 0
-#define CONFIG_USB_OHCI
-#define CONFIG_USB_STORAGE
-#endif
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
-#define CONFIG_CMD_BSP
-#define CONFIG_CMD_ELF
-
-
-#if (CONFIG_SYS_TEXT_BASE == 0xFF000000)               /* Boot low with 16 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT16        1
-#endif
-#if (CONFIG_SYS_TEXT_BASE == 0xFF800000)               /* Boot low with  8 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT08        1
-#endif
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       3       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Welcome to CBX-CPU5200 (mecp5200);" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS \
-       "netdev=eth0\0" \
-       "flash_vxworks0=run ata_vxworks_args;setenv loadaddr ff000000;bootvx\0" \
-       "flash_vxworks1=run ata_vxworks_args;setenv loadaddr ff200000:bootvx\0" \
-       "net_vxworks=tftp $(loadaddr) $(image);run vxworks_args;bootvx\0" \
-       "vxworks_args=setenv bootargs fec(0,0)$(host):$(image) h=$(serverip) e=$(ipaddr) g=$(gatewayip) u=$(user) $(pass) tn=$(target) s=$(script)\0" \
-       "ata_vxworks_args=setenv bootargs /ata0/vxWorks h=$(serverip) e=$(ipaddr) g=$(gatewayip) u=$(user) $(pass) tn=$(target) s=$(script) o=fec0 \0" \
-       "loadaddr=01000000\0" \
-       "serverip=192.168.2.99\0" \
-       "gatewayip=10.0.0.79\0" \
-       "user=mu\0" \
-       "target=mecp5200.esd\0" \
-       "script=mecp5200.bat\0" \
-       "image=/tftpboot/vxWorks_mecp5200\0" \
-       "ipaddr=10.0.13.196\0" \
-       "netmask=255.255.0.0\0" \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_vxworks0"
-
-/*
- * IPB Bus clocking configuration.
- */
-#undef CONFIG_SYS_IPBSPEED_133                 /* define for 133MHz speed */
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          2       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           86000 /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      5
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS           1
-/*
- * Flash configuration
- */
-#define CONFIG_SYS_FLASH_BASE          0xFFC00000
-#define CONFIG_SYS_FLASH_SIZE          0x00400000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x003E0000)
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max num of memory banks      */
-#define CONFIG_SYS_MAX_FLASH_SECT      512
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    240000  /* Flash Erase Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (in ms)  */
-
-/*
- * Environment settings
- */
-#if 1 /* test-only */
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_SIZE                0x10000
-#define CONFIG_ENV_SECT_SIZE   0x10000
-#define CONFIG_ENV_OVERWRITE   1
-#else
-#define CONFIG_ENV_IS_IN_EEPROM        1       /* use EEPROM for environment vars */
-#define CONFIG_ENV_OFFSET              0x0000  /* environment starts at the beginning of the EEPROM */
-#define CONFIG_ENV_SIZE                0x0400  /* 8192 bytes may be used for env vars*/
-                                  /* total size of a CAT24WC32 is 8192 bytes */
-#define CONFIG_ENV_OVERWRITE   1
-#endif
-
-#define CONFIG_FLASH_CFI_DRIVER        1          /* Flash is CFI conformant           */
-#define CONFIG_SYS_FLASH_CFI           1          /* Flash is CFI conformant           */
-#define CONFIG_SYS_FLASH_PROTECTION    1          /* use hardware protection           */
-#if 0
-#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1       /* use buffered writes (20x faster)  */
-#endif
-#define CONFIG_SYS_FLASH_INCREMENT     0x00400000 /* size of  flash bank               */
-#define CONFIG_SYS_FLASH_BANKS_LIST  { CONFIG_SYS_FLASH_BASE }
-#define CONFIG_SYS_FLASH_EMPTY_INFO    1          /* show if bank is empty             */
-
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_MBAR                0xF0000000
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_MII100
-/*
- * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
- */
-/* #define CONFIG_MPC5xxx_FEC_MII10 */
-#define CONFIG_PHY_ADDR                0x00
-#define CONFIG_UDP_CHECKSUM     1
-
-
-/*
- * GPIO configuration
- */
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x01052444
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP                    /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#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       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_VXWORKS_MAC_PTR     0x00000000      /* Pass Ethernet MAC to VxWorks */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x00085d00
-
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-
-#define CONFIG_SYS_CS1_START           0xfd000000
-#define CONFIG_SYS_CS1_SIZE            0x00010000
-#define CONFIG_SYS_CS1_CFG             0x10101410
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-#define CONFIG_SYS_RESET_ADDRESS       0xff000000
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef  CONFIG_IDE_8xx_PCCARD          /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
-
-#define        CONFIG_IDE_RESET                /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       1       /* max. 1 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers          */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h
deleted file mode 100644 (file)
index 0308c52..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (c) 2005 Freescale Semiconductor, Inc.
- *
- * (C) Copyright 2006
- * Alex Bounine , Tundra Semiconductor Corp.
- * Roy Zang    , <tie-fei.zang@freescale.com> Freescale Corp.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*
- * board specific configuration options for Freescale
- * MPC7448HPC2 (High-Performance Computing II) (Taiga) board
- *
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/* Board Configuration Definitions */
-/* MPC7448HPC2 (High-Performance Computing II) (Taiga) board */
-
-#define CONFIG_MPC7448HPC2
-
-#define CONFIG_74xx
-#define CONFIG_HIGH_BATS       /* High BATs supported */
-#define CONFIG_ALTIVEC         /* undef to disable */
-
-#define        CONFIG_SYS_TEXT_BASE    0xFF000000
-
-#define CONFIG_SYS_BOARD_NAME          "MPC7448 HPC II"
-#define CONFIG_IDENT_STRING    " Freescale MPC7448 HPC II"
-
-#define CONFIG_SYS_OCN_CLK             133000000       /* 133 MHz */
-#define CONFIG_SYS_BUS_CLK             133000000
-
-#define CONFIG_SYS_CLK_SPREAD          /* Enable Spread-Spectrum Clock generation */
-
-#undef  CONFIG_ECC             /* disable ECC support */
-
-#ifndef __ASSEMBLY__
-#include <galileo/core.h>
-#endif
-
-/* Board-specific Initialization Functions to be called */
-#define CONFIG_SYS_BOARD_ASM_INIT
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_BOARD_EARLY_INIT_R
-#define CONFIG_MISC_INIT_R
-
-#define CONFIG_HAS_ETH0
-#define CONFIG_HAS_ETH1
-
-#define CONFIG_ENV_OVERWRITE
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_BAUDRATE                115200  /* console baudrate = 115000 */
-
-/*#define CONFIG_SYS_HUSH_PARSER */
-#undef CONFIG_SYS_HUSH_PARSER
-
-
-/* Pass open firmware flat tree */
-#define CONFIG_OF_LIBFDT       1
-#define CONFIG_OF_BOARD_SETUP  1
-
-#define OF_TSI                 "tsi108@c0000000"
-#define OF_TBCLK               (bd->bi_busfreq / 8)
-#define OF_STDOUT_PATH         "/tsi108@c0000000/serial@7808"
-
-/*
- * The following defines let you select what serial you want to use
- * for your console driver.
- *
- * what to do:
- * If you have hacked a serial cable onto the second DUART channel,
- * change the CONFIG_SYS_DUART port from 1 to 0 below.
- *
- */
-
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         CONFIG_SYS_OCN_CLK * 8
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_TSI108_CSR_RST_BASE+0x7808)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_TSI108_CSR_RST_BASE+0x7C08)
-
-#define CONFIG_BOOTDELAY       3       /* autoboot after 3 seconds */
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-
-#undef CONFIG_BOOTARGS
-/* #define CONFIG_PREBOOT  "echo;echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;echo" */
-
-#if (CONFIG_BOOTDELAY >= 0)
-#define CONFIG_BOOTCOMMAND     "tftpboot 0x400000 zImage.initrd.elf;\
- setenv bootargs $(bootargs) $(bootargs_root) nfsroot=$(serverip):$(rootpath) \
- ip=$(ipaddr):$(serverip)$(bootargs_end);  bootm 0x400000; "
-
-#define CONFIG_BOOTARGS "console=ttyS0,115200"
-#endif
-
-#undef CONFIG_EXTRA_ENV_SETTINGS
-
-#define CONFIG_SERIAL  "No. 1"
-
-/* Networking Configuration */
-
-#define CONFIG_TSI108_ETH
-#define CONFIG_TSI108_ETH_NUM_PORTS    2
-
-
-#define CONFIG_BOOTFILE                "zImage.initrd.elf"
-#define CONFIG_LOADADDR                0x400000
-
-/*-------------------------------------------------------------------------- */
-
-#define CONFIG_LOADS_ECHO      0       /* echo off for serial download */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   /* allow baudrate changes */
-
-#undef CONFIG_WATCHDOG         /* watchdog disabled */
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_BOOTFILESIZE
-
-
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_CACHE
-#define CONFIG_CMD_PCI
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_FLASH
-#define CONFIG_CMD_SAVEENV
-#define CONFIG_CMD_BSP
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_DATE
-
-
-/*set date in u-boot*/
-#define CONFIG_RTC_M48T35A
-#define CONFIG_SYS_NVRAM_BASE_ADDR     0xfc000000
-#define CONFIG_SYS_NVRAM_SIZE          0x8000
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_VERSION_VARIABLE                1
-#define CONFIG_TSI108_I2C
-#define CONFIG_SYS_I2C_SPEED           100000  /* I2C speed */
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* I2C EEPROM page 1 */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1       /* Bytes of address */
-
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
-#define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port at */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
-#endif
-
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)/* Print Buffer Size */
-#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       0x00400000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x07c00000      /* 4 ... 124 MB in DRAM */
-
-#define CONFIG_SYS_LOAD_ADDR   0x00400000      /* default load address */
-
-/*
- * Low Level Configuration Settings
- * (address mappings, register initial values, etc.)
- * You should know what you are doing if you make changes here.
- */
-
-/*-----------------------------------------------------------------------
- * Definitions for initial stack pointer and data area
- */
-
-/*
- * When locking data in cache you should point the CONFIG_SYS_INIT_RAM_ADDRESS
- * To an unused memory region. The stack will remain in cache until RAM
- * is initialized
- */
-#undef  CONFIG_SYS_INIT_RAM_LOCK
-#define CONFIG_SYS_INIT_RAM_ADDR       0x07d00000      /* unused memory region */
-#define CONFIG_SYS_INIT_RAM_SIZE       0x4000/* larger space - we have SDRAM initialized */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-
-/*-----------------------------------------------------------------------
- * Start addresses for the final memory configuration
- * (Set up by the startup code)
- * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
- */
-
-#define CONFIG_SYS_SDRAM_BASE          0x00000000      /* first 256 MB of SDRAM */
-#define CONFIG_SYS_SDRAM1_BASE         0x10000000      /* next 256MB of SDRAM */
-
-#define CONFIG_SYS_SDRAM2_BASE 0x40000000      /* beginning of non-cacheable alias for SDRAM - first 256MB */
-#define CONFIG_SYS_SDRAM3_BASE 0x50000000      /* next Non-Cacheable 256MB of SDRAM */
-
-#define CONFIG_SYS_PCI_PFM_BASE        0x80000000      /* Prefetchable (cacheable) PCI/X PFM and SDRAM OCN (128MB+128MB) */
-
-#define CONFIG_SYS_PCI_MEM32_BASE      0xE0000000      /* Non-Cacheable PCI/X MEM and SDRAM OCN (128MB+128MB) */
-
-#define CONFIG_SYS_MISC_REGION_BASE    0xf0000000      /* Base Address for (PCI/X + Flash) region */
-
-#define CONFIG_SYS_FLASH_BASE  0xff000000      /* Base Address of Flash device */
-#define CONFIG_SYS_FLASH_BASE2 0xfe000000      /* Alternate Flash Base Address */
-
-#define CONFIG_VERY_BIG_RAM    /* we will use up to 256M memory for cause we are short of BATS */
-
-#define PCI0_IO_BASE_BOOTM     0xfd000000
-
-#define CONFIG_SYS_RESET_ADDRESS       0x3fffff00
-#define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE    /* u-boot code base */
-#define CONFIG_SYS_MALLOC_LEN          (256 << 10)     /* Reserve 256 kB for malloc */
-
-/* Peripheral Device section */
-
-/*
- * Resources on the Tsi108
- */
-
-#define CONFIG_SYS_TSI108_CSR_RST_BASE 0xC0000000      /* Tsi108 CSR base after reset */
-#define CONFIG_SYS_TSI108_CSR_BASE     CONFIG_SYS_TSI108_CSR_RST_BASE  /* Runtime Tsi108 CSR base */
-
-#define ENABLE_PCI_CSR_BAR     /* enables access to Tsi108 CSRs from the PCI/X bus */
-
-#undef  DISABLE_PBM
-
-/*
- * PCI stuff
- *
- */
-
-#define CONFIG_PCI             /* include pci support */
-#define CONFIG_TSI108_PCI      /* include tsi108 pci support */
-
-#define PCI_HOST_ADAPTER       0       /* configure as pci adapter */
-#define PCI_HOST_FORCE         1       /* configure as pci host */
-#define PCI_HOST_AUTO          2       /* detected via arbiter enable */
-
-#define CONFIG_PCI_HOST PCI_HOST_FORCE /* select pci host function */
-#define CONFIG_PCI_PNP         /* do pci plug-and-play */
-
-/* PCI MEMORY MAP section */
-
-/* PCI view of System Memory */
-#define CONFIG_SYS_PCI_MEMORY_BUS      0x00000000
-#define CONFIG_SYS_PCI_MEMORY_PHYS     0x00000000
-#define CONFIG_SYS_PCI_MEMORY_SIZE     0x80000000
-
-/* PCI Memory Space */
-#define CONFIG_SYS_PCI_MEM_BUS         (CONFIG_SYS_PCI_MEM_PHYS)
-#define CONFIG_SYS_PCI_MEM_PHYS        (CONFIG_SYS_PCI_MEM32_BASE)     /* 0xE0000000 */
-#define CONFIG_SYS_PCI_MEM_SIZE        0x10000000      /* 256 MB space for PCI/X Mem + SDRAM OCN */
-
-/* PCI I/O Space */
-#define CONFIG_SYS_PCI_IO_BUS          0x00000000
-#define CONFIG_SYS_PCI_IO_PHYS         0xfa000000      /* Changed from fd000000 */
-
-#define CONFIG_SYS_PCI_IO_SIZE         0x01000000      /* 16MB */
-
-/* PCI Config Space mapping */
-#define CONFIG_SYS_PCI_CFG_BASE        0xfb000000      /* Changed from FE000000 */
-#define CONFIG_SYS_PCI_CFG_SIZE        0x01000000      /* 16MB */
-
-#define CONFIG_SYS_IBAT0U      0xFE0003FF
-#define CONFIG_SYS_IBAT0L      0xFE000002
-
-#define CONFIG_SYS_IBAT1U      0x00007FFF
-#define CONFIG_SYS_IBAT1L      0x00000012
-
-#define CONFIG_SYS_IBAT2U      0x80007FFF
-#define CONFIG_SYS_IBAT2L      0x80000022
-
-#define CONFIG_SYS_IBAT3U      0x00000000
-#define CONFIG_SYS_IBAT3L      0x00000000
-
-#define CONFIG_SYS_IBAT4U      0x00000000
-#define CONFIG_SYS_IBAT4L      0x00000000
-
-#define CONFIG_SYS_IBAT5U      0x00000000
-#define CONFIG_SYS_IBAT5L      0x00000000
-
-#define CONFIG_SYS_IBAT6U      0x00000000
-#define CONFIG_SYS_IBAT6L      0x00000000
-
-#define CONFIG_SYS_IBAT7U      0x00000000
-#define CONFIG_SYS_IBAT7L      0x00000000
-
-#define CONFIG_SYS_DBAT0U      0xE0003FFF
-#define CONFIG_SYS_DBAT0L      0xE000002A
-
-#define CONFIG_SYS_DBAT1U      0x00007FFF
-#define CONFIG_SYS_DBAT1L      0x00000012
-
-#define CONFIG_SYS_DBAT2U      0x00000000
-#define CONFIG_SYS_DBAT2L      0x00000000
-
-#define CONFIG_SYS_DBAT3U      0xC0000003
-#define CONFIG_SYS_DBAT3L      0xC000002A
-
-#define CONFIG_SYS_DBAT4U      0x00000000
-#define CONFIG_SYS_DBAT4L      0x00000000
-
-#define CONFIG_SYS_DBAT5U      0x00000000
-#define CONFIG_SYS_DBAT5L      0x00000000
-
-#define CONFIG_SYS_DBAT6U      0x00000000
-#define CONFIG_SYS_DBAT6L      0x00000000
-
-#define CONFIG_SYS_DBAT7U      0x00000000
-#define CONFIG_SYS_DBAT7L      0x00000000
-
-/* I2C addresses for the two DIMM SPD chips */
-#define DIMM0_I2C_ADDR 0x51
-#define DIMM1_I2C_ADDR 0x52
-
-/*
- * For booting Linux, the board info and command line data
- * have to be in the first 8 MB of memory, since this is
- * the maximum mapped by the Linux kernel during initialization.
- */
-#define CONFIG_SYS_BOOTMAPSZ   (8<<20) /* Initial Memory map for Linux */
-
-/*-----------------------------------------------------------------------
- * FLASH organization
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     1               /* Flash can be at one of two addresses */
-#define FLASH_BANK_SIZE                0x01000000      /* 16 MB Total */
-#define CONFIG_SYS_FLASH_BANKS_LIST    { CONFIG_SYS_FLASH_BASE, /* CONFIG_SYS_FLASH_BASE2 */ }
-
-#define CONFIG_FLASH_CFI_DRIVER
-#define CONFIG_SYS_FLASH_CFI
-#define CONFIG_SYS_WRITE_SWAPPED_DATA
-
-#define PHYS_FLASH_SIZE                0x01000000
-#define CONFIG_SYS_MAX_FLASH_SECT      (128)
-
-#define CONFIG_ENV_IS_IN_NVRAM
-#define CONFIG_ENV_ADDR                0xFC000000
-
-#define CONFIG_ENV_OFFSET      0x00000000      /* Offset of Environment Sector */
-#define CONFIG_ENV_SIZE        0x00000400      /* Total Size of Environment Space */
-
-/*-----------------------------------------------------------------------
- * Cache Configuration
- */
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For all MPC74xx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CACHELINE_SHIFT     5       /* log base 2 of the above value */
-#endif
-
-/*-----------------------------------------------------------------------
- * L2CR setup -- make sure this is right for your board!
- * look in include/mpc74xx.h for the defines used here
- */
-#undef CONFIG_SYS_L2
-
-#define L2_INIT                0
-#define L2_ENABLE      (L2_INIT | L2CR_L2E)
-#define CONFIG_SYS_SERIAL_HANG_IN_EXCEPTION
-#endif /* __CONFIG_H */
index 807e96bbaab9f676bb13f4cacb38ddb5a1af05b0..9d5dbdce369381588f67a13e2e5cb44673d2dab4 100644 (file)
 
 /* I2C */
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C
+#define CONFIG_DM_I2C
+#define CONFIG_DM_I2C_COMPAT
 #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_INIT_BOARD
 
 /* POWER */
 #define CONFIG_POWER
index 7d102a46996098308dcb09b15ec3d64a8fd791ba..c0bb227a3311e0e96bf15a458375753af0afd34f 100644 (file)
@@ -45,6 +45,9 @@
                "root=${mmcroot} " \
                "rootfstype=${mmcrootfstype}\0" \
        "bootenv=uEnv.txt\0" \
+       "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
+               "source ${loadaddr}\0" \
        "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
        "importbootenv=echo Importing environment from mmc ...; " \
                "env import -t $loadaddr $filesize\0" \
 #define CONFIG_BOOTCOMMAND \
        "mmc dev ${mmcdev}; if mmc rescan; then " \
                "echo SD/MMC found on device ${mmcdev};" \
-               "if run loadbootenv; then " \
-                       "echo Loaded environment from ${bootenv};" \
-                       "run importbootenv;" \
-               "fi;" \
-               "if test -n $uenvcmd; then " \
-                       "echo Running uenvcmd ...;" \
-                       "run uenvcmd;" \
-               "fi;" \
-               "if run loaduimage; then " \
-                       "run mmcboot;" \
-               "fi;" \
+               "if run loadbootscript; then " \
+                       "run bootscript;" \
+               "else " \
+                       "if run loadbootenv; then " \
+                               "echo Loaded environment from ${bootenv};" \
+                               "run importbootenv;" \
+                       "fi;" \
+                       "if test -n $uenvcmd; then " \
+                               "echo Running uenvcmd ...;" \
+                               "run uenvcmd;" \
+                       "fi;" \
+                       "if run loaduimage; then " \
+                               "run mmcboot;" \
+                       "fi;" \
+               "fi ;" \
        "fi;" \
 
 /* Clock Defines */
diff --git a/include/configs/pf5200.h b/include/configs/pf5200.h
deleted file mode 100644 (file)
index be76478..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/*************************************************************************
- * (c) 2005 esd gmbh Hannover
- *
- *
- * from IceCube.h file
- * by Reinhard Arlt reinhard.arlt@esd-electronics.com
- *
- *************************************************************************/
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-
-#define CONFIG_MPC5200         1       /* This is an MPC5200 CPU */
-#define CONFIG_ICECUBE         1       /* ... on IceCube board */
-#define CONFIG_PF5200          1       /* ... on PF5200  board */
-#define CONFIG_MPC5200_DDR     1       /* ... use DDR RAM      */
-
-#ifndef CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_TEXT_BASE   0xFFF00000
-#endif
-
-#define CONFIG_SYS_MPC5XXX_CLKIN       33000000        /* ... running at 33.000000MHz */
-
-#define CONFIG_HIGH_BATS       1       /* High BATs supported */
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#if 0                          /* test-only */
-#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
-#else
-#define CONFIG_BAUDRATE                9600    /* ... at 115200 bps */
-#endif
-#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-/*
- * PCI Mapping:
- * 0x40000000 - 0x4fffffff - PCI Memory
- * 0x50000000 - 0x50ffffff - PCI IO Space
- */
-#define CONFIG_PCI             1
-#define CONFIG_PCI_PNP         1
-#define CONFIG_PCI_SCAN_SHOW   1
-#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
-
-#define CONFIG_PCI_MEM_BUS     0x40000000
-#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE    0x10000000
-
-#define CONFIG_PCI_IO_BUS      0x50000000
-#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE     0x01000000
-
-#define CONFIG_MII             1
-#if 0                          /* test-only !!! */
-#define CONFIG_EEPRO100                1
-#define CONFIG_SYS_RX_ETH_BUFFER       8       /* use 8 rx buffer on eepro100  */
-#define CONFIG_NS8382X         1
-#endif
-
-/* Partitions */
-#define CONFIG_MAC_PARTITION
-#define CONFIG_DOS_PARTITION
-
-/* USB */
-#if 0
-#define CONFIG_USB_OHCI
-#define CONFIG_USB_STORAGE
-#endif
-
-
-/*
- * 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>
-
-#define CONFIG_CMD_BSP
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
-
-#define CONFIG_CMD_PCI
-
-
-#if (CONFIG_SYS_TEXT_BASE == 0xFF000000)       /* Boot low with 16 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT16        1
-#endif
-#if (CONFIG_SYS_TEXT_BASE == 0xFF800000)       /* Boot low with  8 MB Flash */
-#   define CONFIG_SYS_LOWBOOT          1
-#   define CONFIG_SYS_LOWBOOT08        1
-#endif
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       3       /* autoboot after 5 seconds */
-
-#define CONFIG_PREBOOT "echo;" \
-       "echo Welcome to ParaFinder pf5200;" \
-       "echo"
-
-#undef CONFIG_BOOTARGS
-
-#define        CONFIG_EXTRA_ENV_SETTINGS \
-       "netdev=eth0\0" \
-       "flash_vxworks0=run ata_vxworks_args;setenv loadaddr ff000000;bootvx\0" \
-       "flash_vxworks1=run ata_vxworks_args;setenv loadaddr ff200000:bootvx\0" \
-       "net_vxworks=phypower 1;sleep 2;tftp ${loadaddr} ${image};run vxworks_args;bootvx\0" \
-       "vxworks_args=setenv bootargs fec(0,0)${host}:${image} h=${serverip} e=${ipaddr} g=${gatewayip} u=${user} ${pass} tn=${target} s=${script}\0" \
-       "ata_vxworks_args=setenv bootargs /ata0/vxWorks h=${serverip} e=${ipaddr} g=${gatewayip} u=${user} ${pass} tn=${target} s=${script} o=fec0 \0" \
-       "loadaddr=01000000\0" \
-       "serverip=192.168.2.99\0" \
-       "gatewayip=10.0.0.79\0" \
-       "user=mu\0" \
-       "target=pf5200.esd\0" \
-       "script=pf5200.bat\0" \
-       "image=/tftpboot/vxWorks_pf5200\0" \
-       "ipaddr=10.0.13.196\0" \
-       "netmask=255.255.0.0\0" \
-       ""
-
-#define CONFIG_BOOTCOMMAND     "run flash_vxworks0"
-
-/*
- * IPB Bus clocking configuration.
- */
-#undef CONFIG_SYS_IPBCLK_EQUALS_XLBCLK         /* define for 133MHz speed */
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CONFIG_SYS_I2C_MODULE          2       /* Select I2C module #1 or #2 */
-
-#define CONFIG_SYS_I2C_SPEED           86000   /* 100 kHz */
-#define CONFIG_SYS_I2C_SLAVE           0x7F
-
-/*
- * EEPROM configuration
- */
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50    /* 1010000x */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      5
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
-#define CONFIG_SYS_I2C_MULTI_EEPROMS           1
-/*
- * Flash configuration
- */
-#define CONFIG_SYS_FLASH_BASE          0xFE000000
-#define CONFIG_SYS_FLASH_SIZE          0x02000000
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_FLASH_BASE + 0x00000000)
-#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max num of memory banks      */
-#define CONFIG_SYS_MAX_FLASH_SECT      512
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT    240000  /* Flash Erase Timeout (in ms)  */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    500     /* Flash Write Timeout (in ms)  */
-
-/*
- * Environment settings
- */
-#if 1                          /* test-only */
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_SIZE                0x10000
-#define CONFIG_ENV_SECT_SIZE   0x10000
-#define CONFIG_ENV_OVERWRITE   1
-#else
-#define CONFIG_ENV_IS_IN_EEPROM        1       /* use EEPROM for environment vars */
-#define CONFIG_ENV_OFFSET              0x0000  /* environment starts at the beginning of the EEPROM */
-#define CONFIG_ENV_SIZE                0x0400  /* 8192 bytes may be used for env vars */
-                                  /* total size of a CAT24WC32 is 8192 bytes */
-#define CONFIG_ENV_OVERWRITE   1
-#endif
-
-/*
- * Memory map
- */
-#define CONFIG_SYS_MBAR                0xF0000000
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_DEFAULT_MBAR        0x80000000
-
-/* Use SRAM until RAM will be available */
-#define CONFIG_SYS_INIT_RAM_ADDR       MPC5XXX_SRAM
-#define CONFIG_SYS_INIT_RAM_SIZE       MPC5XXX_SRAM_SIZE       /* Size of used area in DPRAM */
-
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
-
-#define CONFIG_SYS_MONITOR_BASE    CONFIG_SYS_TEXT_BASE
-#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
-#   define CONFIG_SYS_RAMBOOT          1
-#endif
-
-#define CONFIG_SYS_MONITOR_LEN         (192 << 10)     /* Reserve 192 kB for Monitor   */
-#define CONFIG_SYS_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
-#define CONFIG_SYS_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_MPC5xxx_FEC_MII100
-/*
- * Define CONFIG_MPC5xxx_FEC_MII10 to force FEC at 10Mb
- */
-/* #define CONFIG_MPC5xxx_FEC_MII10 */
-#define CONFIG_PHY_ADDR                0x00
-#define CONFIG_UDP_CHECKSUM    1
-
-/*
- * GPIO configuration
- */
-#define CONFIG_SYS_GPS_PORT_CONFIG     0x01052444
-
-/*
- * Miscellaneous configurable options
- */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory     */
-#if defined(CONFIG_CMD_KGDB)
-#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size  */
-#else
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size  */
-#endif
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)     /* Print Buffer Size */
-#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       0x00100000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00f00000      /* 1 ... 15 MB in DRAM  */
-
-#define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
-
-#define CONFIG_SYS_VXWORKS_MAC_PTR     0x00000000      /* Pass Ethernet MAC to VxWorks */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32      /* For MPC5xxx CPUs */
-#if defined(CONFIG_CMD_KGDB)
-#  define CONFIG_SYS_CACHELINE_SHIFT   5       /* log base 2 of the above value */
-#endif
-
-/*
- * Various low-level settings
- */
-#define CONFIG_SYS_HID0_INIT           HID0_ICE | HID0_ICFI
-#define CONFIG_SYS_HID0_FINAL          HID0_ICE
-
-#define CONFIG_SYS_BOOTCS_START        CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_BOOTCS_SIZE         CONFIG_SYS_FLASH_SIZE
-#define CONFIG_SYS_BOOTCS_CFG          0x0004DD00
-
-#define CONFIG_SYS_CS0_START           CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_CS0_SIZE            CONFIG_SYS_FLASH_SIZE
-
-#define CONFIG_SYS_CS1_START           0xfd000000
-#define CONFIG_SYS_CS1_SIZE            0x00010000
-#define CONFIG_SYS_CS1_CFG             0x10101410
-
-#define CONFIG_SYS_CS_BURST            0x00000000
-#define CONFIG_SYS_CS_DEADCYCLE        0x33333333
-
-#define CONFIG_SYS_RESET_ADDRESS       0xff000000
-
-/*-----------------------------------------------------------------------
- * USB stuff
- *-----------------------------------------------------------------------
- */
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-
-/*-----------------------------------------------------------------------
- * IDE/ATA stuff Supports IDE harddisk
- *-----------------------------------------------------------------------
- */
-
-#undef CONFIG_IDE_8xx_PCCARD   /* Use IDE with PC Card Adapter */
-
-#undef CONFIG_IDE_8xx_DIRECT   /* Direct IDE    not supported  */
-#undef CONFIG_IDE_LED          /* LED   for ide not supported  */
-
-#define        CONFIG_IDE_RESET        /* reset for ide supported      */
-#define CONFIG_IDE_PREINIT
-
-#define CONFIG_SYS_IDE_MAXBUS          1       /* max. 1 IDE bus               */
-#define CONFIG_SYS_IDE_MAXDEVICE       1       /* max. 1 drive per IDE bus     */
-
-#define CONFIG_SYS_ATA_IDE0_OFFSET     0x0000
-
-#define CONFIG_SYS_ATA_BASE_ADDR       MPC5XXX_ATA
-
-/* Offset for data I/O                 */
-#define CONFIG_SYS_ATA_DATA_OFFSET     (0x0060)
-
-/* Offset for normal register accesses */
-#define CONFIG_SYS_ATA_REG_OFFSET      (CONFIG_SYS_ATA_DATA_OFFSET)
-
-/* Offset for alternate registers      */
-#define CONFIG_SYS_ATA_ALT_OFFSET      (0x005C)
-
-/* Interval between registers                                               */
-#define CONFIG_SYS_ATA_STRIDE          4
-
-/*-----------------------------------------------------------------------
- * CPLD stuff
- */
-#define CONFIG_SYS_FPGA_XC95XL         1       /* using Xilinx XC95XL CPLD      */
-#define CONFIG_SYS_FPGA_MAX_SIZE       32*1024 /* 32kByte is enough for CPLD    */
-
-/* CPLD program pin configuration */
-#define CONFIG_SYS_FPGA_PRG            0x20000000      /* JTAG TMS pin (ppc output)           */
-#define CONFIG_SYS_FPGA_CLK            0x10000000      /* JTAG TCK pin (ppc output)           */
-#define CONFIG_SYS_FPGA_DATA           0x20000000      /* JTAG TDO->TDI data pin (ppc output) */
-#define CONFIG_SYS_FPGA_DONE           0x10000000      /* JTAG TDI->TDO pin (ppc input)       */
-
-#define JTAG_GPIO_ADDR_TMS     (CONFIG_SYS_MBAR + 0xB10)       /* JTAG TMS pin (GPS data out value reg.)      */
-#define JTAG_GPIO_ADDR_TCK     (CONFIG_SYS_MBAR + 0xC0C)       /* JTAG TCK pin (GPW data out value reg.)      */
-#define JTAG_GPIO_ADDR_TDI     (CONFIG_SYS_MBAR + 0xC0C)       /* JTAG TDO->TDI pin (GPW data out value reg.) */
-#define JTAG_GPIO_ADDR_TDO     (CONFIG_SYS_MBAR + 0xB14)       /* JTAG TDI->TDO pin (GPS data in value reg.)  */
-
-#define JTAG_GPIO_ADDR_CFG     (CONFIG_SYS_MBAR + 0xB00)
-#define JTAG_GPIO_CFG_SET      0x00000000
-#define JTAG_GPIO_CFG_RESET    0x00F00000
-
-#define JTAG_GPIO_ADDR_EN_TMS  (CONFIG_SYS_MBAR + 0xB04)
-#define JTAG_GPIO_TMS_EN_SET   0x20000000      /* Enable for GPIO */
-#define JTAG_GPIO_TMS_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TMS (CONFIG_SYS_MBAR + 0xB0C)
-#define JTAG_GPIO_TMS_DDR_SET  0x20000000      /* Set as output   */
-#define JTAG_GPIO_TMS_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TCK  (CONFIG_SYS_MBAR + 0xC00)
-#define JTAG_GPIO_TCK_EN_SET   0x20000000      /* Enable for GPIO */
-#define JTAG_GPIO_TCK_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TCK (CONFIG_SYS_MBAR + 0xC08)
-#define JTAG_GPIO_TCK_DDR_SET  0x20000000      /* Set as output   */
-#define JTAG_GPIO_TCK_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TDI  (CONFIG_SYS_MBAR + 0xC00)
-#define JTAG_GPIO_TDI_EN_SET   0x10000000      /* Enable as GPIO  */
-#define JTAG_GPIO_TDI_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TDI (CONFIG_SYS_MBAR + 0xC08)
-#define JTAG_GPIO_TDI_DDR_SET  0x10000000      /* Set as output   */
-#define JTAG_GPIO_TDI_DDR_RESET 0x00000000
-
-#define JTAG_GPIO_ADDR_EN_TDO  (CONFIG_SYS_MBAR + 0xB04)
-#define JTAG_GPIO_TDO_EN_SET   0x10000000      /* Enable as GPIO  */
-#define JTAG_GPIO_TDO_EN_RESET 0x00000000
-#define JTAG_GPIO_ADDR_DDR_TDO (CONFIG_SYS_MBAR + 0xB0C)
-#define JTAG_GPIO_TDO_DDR_SET  0x00000000
-#define JTAG_GPIO_TDO_DDR_RESET 0x10000000     /* Set as input    */
-
-#endif                         /* __CONFIG_H */
index 7594bdb4123a514c8704e829c2ec21090ec17456..89560ad1c5b5f38fd067ff6e6f64e69a10c1edb6 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef _CONFIG_POGO_E02_H
 #define _CONFIG_POGO_E02_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Machine type definition and ID
  */
diff --git a/include/configs/ppmc7xx.h b/include/configs/ppmc7xx.h
deleted file mode 100644 (file)
index 18f9a6c..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * ppmc7xx.h
- * ---------
- *
- * Wind River PPMC 7xx/74xx board configuration file.
- *
- * By Richard Danter (richard.danter@windriver.com)
- * Copyright (C) 2005 Wind River Systems
- */
-
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define CONFIG_PPMC7XX
-
-
-/*===================================================================
- *
- * User configurable settings - Modify to your preference
- *
- *===================================================================
- */
-
-/*
- * Debug
- *
- * DEBUG               - Define this is you want extra debug info
- * GTREGREAD           - Required to build with debug
- * do_bdinfo           - Required to build with debug
- */
-
-#ifdef DEBUG
-#define        GTREGREAD(x)    0xFFFFFFFF
-#define        do_bdinfo(a,b,c,d)
-#endif
-
-/*
- * CPU type
- *
- * CONFIG_7xx          - We have a 750 or 755 CPU
- * CONFIG_74xx         - We have a 7400 CPU
- * CONFIG_ALTIVEC      - We have altivec enabled CPU (only 7400)
- * CONFIG_BUS_CLK      - System bus clock in Hz
- */
-
-#define        CONFIG_7xx
-#undef CONFIG_74xx
-#undef CONFIG_ALTIVEC
-#define CONFIG_BUS_CLK 66000000
-
-#define        CONFIG_SYS_TEXT_BASE    0xFFF00000
-
-#ifndef __ASSEMBLY__
-#include <galileo/core.h>
-#endif
-
-/*
- * Monitor configuration
- *
- * List of command sets to include in shell
- *
- * The following command sets have been tested and known to work:
- *
- * CMD_CACHE           - Cache control commands
- * CMD_MEMORY          - Memory display, change and test commands
- * CMD_FLASH           - Erase and program flash
- * CMD_ENV             - Environment commands
- * CMD_RUN             - Run commands stored in env vars
- * CMD_ELF             - Load ELF files
- * CMD_NET             - Networking/file download commands
- * CMD_PIN             - ICMP Echo Request command
- * CMD_PCI             - PCI Bus scanning command
- */
-
-/*
- * 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>
-
-#define CONFIG_CMD_FLASH
-#define CONFIG_CMD_SAVEENV
-#define CONFIG_CMD_RUN
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_PCI
-
-#undef CONFIG_CMD_KGDB
-
-
-/*
- * Serial configuration
- *
- * CONFIG_CONS_INDEX           - Serial console port number (COM1)
- * CONFIG_BAUDRATE             - Serial speed
- */
-
-#define CONFIG_CONS_INDEX      1
-#define CONFIG_BAUDRATE                9600
-
-
-/*
- * PCI config
- *
- * CONFIG_PCI                  - Enable PCI bus
- * CONFIG_PCI_PNP              - Enable Plug & Play support
- * CONFIG_PCI_SCAN_SHOW                - Enable display of devices at startup
- */
-
-#define        CONFIG_PCI
-#define        CONFIG_PCI_INDIRECT_BRIDGE
-#define        CONFIG_PCI_PNP
-#undef CONFIG_PCI_SCAN_SHOW
-
-
-/*
- * Network config
- *
- * CONFIG_EEPRO100             - Intel 8255x Ethernet Controller
- * CONFIG_EEPRO100_SROM_WRITE  - Enable writing to network card ROM
- */
-
-#define        CONFIG_EEPRO100
-#define        CONFIG_EEPRO100_SROM_WRITE
-
-
-/*
- * Enable extra init functions
- *
- * CONFIG_MISC_INIT_F          - Call pre-relocation init functions
- * CONFIG_MISC_INIT_R          - Call post relocation init functions
- */
-
-#undef CONFIG_MISC_INIT_F
-#define CONFIG_MISC_INIT_R
-
-
-/*
- * Boot config
- *
- * CONFIG_BOOTCOMMAND          - Command(s) to execute to auto-boot
- * CONFIG_BOOTDELAY            - How long to wait before auto-boot (in sec)
- */
-
-#define CONFIG_BOOTCOMMAND             \
-       "bootp;" \
-       "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
-       "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
-       "bootm"
-#define CONFIG_BOOTDELAY               5
-
-
-/*===================================================================
- *
- * Board configuration settings - You should not need to modify these
- *
- *===================================================================
- */
-
-
-/*
- * Memory map
- *
- * This board runs in a standard CHRP (Map-B) configuration.
- *
- *     Type        Start       End         Size    Width   Chip Sel
- *     ----------- ----------- ----------- ------- ------- --------
- *     SDRAM       0x00000000  0x04000000  64MB    64b     SDRAMCS0
- *     User LED's  0x78000000                              RCS3
- *     UART        0x7C000000                              RCS2
- *     Mailbox     0xFF000000                              RCS1
- *     Flash       0xFFC00000  0xFFFFFFFF   4MB    64b     RCS0
- *
- * Flash sectors are laid out as follows.
- *
- *     Sector  Start           End     Size    Comments
- *     ------- ----------- ----------- ------- -----------
- *      0      0xFFC00000  0xFFC3FFFF  256KB
- *      1      0xFFC40000  0xFFC7FFFF  256KB
- *      2      0xFFC80000  0xFFCBFFFF  256KB
- *      3      0xFFCC0000  0xFFCFFFFF  256KB
- *      4      0xFFD00000  0xFFD3FFFF  256KB
- *      5      0xFFD40000  0xFFD7FFFF  256KB
- *      6      0xFFD80000  0xFFDBFFFF  256KB
- *      7      0xFFDC0000  0xFFDFFFFF  256KB
- *      8      0xFFE00000  0xFFE3FFFF  256KB
- *      9      0xFFE40000  0xFFE7FFFF  256KB
- *     10      0xFFE80000  0xFFEBFFFF  256KB
- *     11      0xFFEC0000  0xFFEFFFFF  256KB
- *     12      0xFFF00000  0xFFF3FFFF  256KB   U-Boot code here
- *     13      0xFFF40000  0xFFF7FFFF  256KB
- *     14      0xFFF80000  0xFFFBFFFF  256KB
- *     15      0xFFFC0000  0xFFFDFFFF  128KB
- *     16      0xFFFE0000  0xFFFE7FFF   32KB   U-Boot env vars here
- *     17      0xFFFE8000  0xFFFEFFFF   32KB   U-Boot backup copy of env vars here
- *     18      0xFFFF0000  0xFFFFFFFF   64KB
- */
-
-
-/*
- * SDRAM config - see memory map details above.
- *
- * CONFIG_SYS_SDRAM_BASE               - Start address of SDRAM, this _must_ be zero!
- * CONFIG_SYS_SDRAM_SIZE               - Total size of contiguous SDRAM bank(s)
- */
-
-#define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_SDRAM_SIZE          0x04000000
-
-
-/*
- * Flash config - see memory map details above.
- *
- * CONFIG_SYS_FLASH_BASE               - Start address of flash memory
- * CONFIG_SYS_FLASH_SIZE               - Total size of contiguous flash mem
- * CONFIG_SYS_FLASH_ERASE_TOUT         - Erase timeout in ms
- * CONFIG_SYS_FLASH_WRITE_TOUT         - Write timeout in ms
- * CONFIG_SYS_MAX_FLASH_BANKS          - Number of banks of flash on board
- * CONFIG_SYS_MAX_FLASH_SECT           - Number of sectors in a bank
- */
-
-#define CONFIG_SYS_FLASH_BASE          0xFFC00000
-#define CONFIG_SYS_FLASH_SIZE          0x00400000
-#define CONFIG_SYS_FLASH_ERASE_TOUT    250000
-#define CONFIG_SYS_FLASH_WRITE_TOUT    5000
-#define CONFIG_SYS_MAX_FLASH_BANKS     1
-#define CONFIG_SYS_MAX_FLASH_SECT      128
-
-
-/*
- * Monitor config - see memory map details above
- *
- * CONFIG_SYS_MONITOR_BASE             - Base address of monitor code
- * CONFIG_SYS_MALLOC_LEN               - Size of malloc pool (128KB)
- */
-
-#define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_MALLOC_LEN          0x20000
-
-
-/*
- * Command shell settings
- *
- * CONFIG_SYS_BARGSIZE                 - Boot Argument buffer size
- * CONFIG_SYS_BOOTMAPSZ                - Size of app's mapped RAM at boot (Linux=8MB)
- * CONFIG_SYS_CBSIZE                   - Console Buffer (input) size
- * CONFIG_SYS_LOAD_ADDR                - Default load address
- * CONFIG_SYS_LONGHELP                 - Provide more detailed help
- * CONFIG_SYS_MAXARGS                  - Number of args accepted by monitor commands
- * CONFIG_SYS_MEMTEST_START            - Start address of test to run on RAM
- * CONFIG_SYS_MEMTEST_END              - End address of RAM test
- * CONFIG_SYS_PBSIZE                   - Print Buffer (output) size
- * CONFIG_SYS_PROMPT                   - Prompt string
- */
-
-#define CONFIG_SYS_BARGSIZE            1024
-#define CONFIG_SYS_BOOTMAPSZ           0x800000
-#define CONFIG_SYS_CBSIZE              1024
-#define CONFIG_SYS_LOAD_ADDR           0x100000
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_MAXARGS             16
-#define CONFIG_SYS_MEMTEST_START       0x00040000
-#define CONFIG_SYS_MEMTEST_END         0x00040100
-#define CONFIG_SYS_PBSIZE              1024
-
-
-/*
- * Environment config - see memory map details above
- *
- * CONFIG_ENV_IS_IN_FLASH              - The env variables are stored in flash
- * CONFIG_ENV_ADDR                     - Address of the sector containing env vars
- * CONFIG_ENV_SIZE                     - Ammount of RAM for env vars (used to save RAM, 4KB)
- * CONFIG_ENV_SECT_SIZE                - Size of sector containing env vars (32KB)
- */
-
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                0xFFFE0000
-#define CONFIG_ENV_SIZE                0x1000
-#define CONFIG_ENV_ADDR_REDUND 0xFFFE8000
-#define CONFIG_ENV_SIZE_REDUND 0x1000
-#define CONFIG_ENV_SECT_SIZE   0x8000
-
-
-/*
- * Initial RAM config
- *
- * Since the main system RAM is initialised very early, we place the INIT_RAM
- * in the main system RAM just above the exception vectors. The contents are
- * copied to top of RAM by the init code.
- *
- * CONFIG_SYS_INIT_RAM_ADDR            - Address of Init RAM, above exception vect
- * CONFIG_SYS_INIT_RAM_SIZE            - Size of Init RAM
- * GENERATED_GBL_DATA_SIZE             - Ammount of RAM to reserve for global data
- * CONFIG_SYS_GBL_DATA_OFFSET          - Start of global data, top of stack
- */
-
-#define CONFIG_SYS_INIT_RAM_ADDR       (CONFIG_SYS_SDRAM_BASE + 0x4000)
-#define CONFIG_SYS_INIT_RAM_SIZE       0x4000
-#define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-
-
-/*
- * Initial BAT config
- *
- * BAT0        - System SDRAM
- * BAT1 - LED's and Serial Port
- * BAT2 - PCI Memory
- * BAT3 - PCI I/O including Flash Memory
- */
-
-#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_64M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
-#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
-
-#define CONFIG_SYS_IBAT1L (0x70000000 | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT1U (0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT1L (0x70000000 | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT1U (0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-
-#define CONFIG_SYS_IBAT2L (0x80000000 | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT2U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT2L (0x80000000 | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT2U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-
-#define CONFIG_SYS_IBAT3L (0xF0000000 | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT3U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT3L (0xF0000000 | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
-
-
-/*
- * Cache config
- *
- * CONFIG_SYS_CACHELINE_SIZE           - Size of a cache line (CPU specific)
- * CONFIG_SYS_L2                       - L2 cache enabled if defined
- * L2_INIT                     - L2 cache init flags
- * L2_ENABLE                   - L2 cache enable flags
- */
-
-#define CONFIG_SYS_CACHELINE_SIZE      32
-#undef CONFIG_SYS_L2
-#define L2_INIT                        0
-#define L2_ENABLE              0
-
-
-/*
- * Clocks config
- *
- * CONFIG_SYS_BUS_CLK                  - Bus clock frequency in Hz
- * CONFIG_SYS_HZ                       - Decrementer freq in Hz
- */
-
-#define CONFIG_SYS_BUS_CLK             CONFIG_BUS_CLK
-
-
-/*
- * Serial port config
- *
- * CONFIG_SYS_NS16550                  - Include the NS16550 driver
- * CONFIG_SYS_NS16550_SERIAL           - Include the serial (wrapper) driver
- * CONFIG_SYS_NS16550_CLK              - Frequency of reference clock
- * CONFIG_SYS_NS16550_REG_SIZE         - 64-bit accesses to 8-bit port
- * CONFIG_SYS_NS16550_COM1             - Base address of 1st serial port
- */
-
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_CLK         3686400
-#define CONFIG_SYS_NS16550_REG_SIZE    -8
-#define CONFIG_SYS_NS16550_COM1        0x7C000000
-
-
-/*
- * PCI Config - Address Map B (CHRP)
- */
-
-#define CONFIG_SYS_PCI_MEMORY_BUS      0x00000000
-#define CONFIG_SYS_PCI_MEMORY_PHYS     0x00000000
-#define CONFIG_SYS_PCI_MEMORY_SIZE     0x40000000
-#define CONFIG_SYS_PCI_MEM_BUS         0x80000000
-#define CONFIG_SYS_PCI_MEM_PHYS        0x80000000
-#define CONFIG_SYS_PCI_MEM_SIZE        0x7D000000
-#define CONFIG_SYS_ISA_MEM_BUS         0x00000000
-#define CONFIG_SYS_ISA_MEM_PHYS        0xFD000000
-#define CONFIG_SYS_ISA_MEM_SIZE        0x01000000
-#define CONFIG_SYS_PCI_IO_BUS          0x00800000
-#define CONFIG_SYS_PCI_IO_PHYS         0xFE800000
-#define CONFIG_SYS_PCI_IO_SIZE         0x00400000
-#define CONFIG_SYS_ISA_IO_BUS          0x00000000
-#define CONFIG_SYS_ISA_IO_PHYS         0xFE000000
-#define CONFIG_SYS_ISA_IO_SIZE         0x00800000
-#define CONFIG_SYS_ISA_IO_BASE_ADDRESS CONFIG_SYS_ISA_IO_PHYS
-#define CONFIG_SYS_ISA_IO              CONFIG_SYS_ISA_IO_PHYS
-#define CONFIG_SYS_60X_PCI_IO_OFFSET   CONFIG_SYS_ISA_IO_PHYS
-
-
-/*
- * Extra init functions
- *
- * CONFIG_SYS_BOARD_ASM_INIT           - Call assembly init code
- */
-
-#define CONFIG_SYS_BOARD_ASM_INIT
-
-#endif /* __CONFIG_H */
index d5588b12414c54c3dadba4d86ecc450223169695..9458047c06e0077851947ba4e37488a0e20cc051 100644 (file)
 #define CONFIG_SYS_NAND_OOBSIZE                64
 #define CONFIG_SYS_NAND_BLOCK_SIZE     0x20000
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS  0x0
+#define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
 
 #endif
 
index 104edef1026e5b8568dbf970878ca0a094b12366..996973d99b6cb236f848c7d12ad63f61069878f5 100644 (file)
 #define CONFIG_USB_STORAGE
 #endif
 
+/* USB device */
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_ATMEL_USBA
+#define CONFIG_USB_ETHER
+#define CONFIG_USB_ETH_RNDIS
+#define CONFIG_USBNET_MANUFACTURER      "Atmel SAMA5D4EK"
+
 #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
index cbdb3a2943f93bd44209a7b54174713c9d02daa8..09ab4d7f256b514ad33ee8c6b6d433a0a52a3423 100644 (file)
 #define CONFIG_USB_STORAGE
 #endif
 
+/* USB device */
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_ATMEL_USBA
+#define CONFIG_USB_ETHER
+#define CONFIG_USB_ETH_RNDIS
+#define CONFIG_USBNET_MANUFACTURER      "Atmel SAMA5D4EK"
+
 #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
index 657f751f3c21bb9c4de81c996695a7371fd3427d..e9d3f3226b373f078faaa2c6c5e34932a3729ee1 100644 (file)
@@ -23,7 +23,6 @@
 
 #define CONFIG_BOOTSTAGE
 #define CONFIG_BOOTSTAGE_REPORT
-#define CONFIG_DM
 #define CONFIG_CMD_DEMO
 #define CONFIG_CMD_DM
 #define CONFIG_DM_DEMO
@@ -41,9 +40,6 @@
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_LMB
-#define CONFIG_FIT
-#define CONFIG_FIT_SIGNATURE
-#define CONFIG_RSA
 #define CONFIG_CMD_FDT
 #define CONFIG_ANDROID_BOOT_IMAGE
 
index 71be8238998b7a077bfa32d42e4f6922d8c230ef..21c8bda9f30452b0c8f3de97673563a3001ce2b6 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef _CONFIG_SHEEVAPLUG_H
 #define _CONFIG_SHEEVAPLUG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
index 83953728dd29b818ad9aae658b209f1e46a92fbf..3b06d305db50221f8ec445d27673cd970c12719b 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <configs/exynos5250-common.h>
 
+/* PMIC */
+#define CONFIG_POWER_MAX77686
 
 #define CONFIG_BOARD_COMMON
 #define CONFIG_ARCH_EARLY_INIT_R
index 942af2e7f6244a59c2f3463b8d24dd539ea5baa7..9fa644f7c288201c1eced5e9d17f84b6b2b7464d 100644 (file)
@@ -34,7 +34,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 #define CONFIG_SKIP_LOWLEVEL_INIT
-#define CONFIG_SKIP_RELOCATE_UBOOT
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_FIT
 
index 7eaa58697e44f6cfeab3d2480eada7afb67aa636..ce6676eae7f71c95a32a98d0681584ba6ca15902 100644 (file)
@@ -22,6 +22,7 @@
 
 #define CONFIG_CROS_EC_I2C             /* Support CROS_EC over I2C */
 #define CONFIG_POWER_TPS65090_I2C
+#define CONFIG_DM_CROS_EC
 
 #define CONFIG_BOARD_COMMON
 #define CONFIG_ARCH_EARLY_INIT_R
index 7b857405e9e7839a27a7905b136a5677ec535b08..87d269b041c00f60d3085d842598c38a89e778b7 100644 (file)
@@ -13,7 +13,6 @@
  */
 #define CONFIG_CLK_FULL_SPEED          1008000000
 
-#define CONFIG_SYS_PROMPT              "sun4i# "
 #define CONFIG_MACH_TYPE               4104
 
 #ifdef CONFIG_USB_EHCI
index 09f7533575c83518c43c040ecf944a787aab4fba..52e3a6ff01b3d6ef94400e05ca63e0a9c2ab40d8 100644 (file)
@@ -13,7 +13,6 @@
  */
 #define CONFIG_CLK_FULL_SPEED          1008000000
 
-#define CONFIG_SYS_PROMPT              "sun5i# "
 #define CONFIG_MACH_TYPE               4138
 
 #ifdef CONFIG_USB_EHCI
index 1b738527990972e112a487e9e02ab3031625a6ae..f5e11ddb691f113c32943033592133e01653a72a 100644 (file)
@@ -16,8 +16,6 @@
  */
 #define CONFIG_CLK_FULL_SPEED          1008000000
 
-#define CONFIG_SYS_PROMPT              "sun6i# "
-
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT        2
index ccec50c328171d9fe4f11a1a1c3f67a287f52267..7cd78903412626622713cad62b4a663ec78250bf 100644 (file)
@@ -14,7 +14,6 @@
  */
 #define CONFIG_CLK_FULL_SPEED          912000000
 
-#define CONFIG_SYS_PROMPT              "sun7i# "
 #define CONFIG_MACH_TYPE               4283
 
 #ifdef CONFIG_USB_EHCI
index f16e60b576427574eff1e2f7f26595a0912a9e18..3bdedb390c119f6cc515e6342990fbfb258c77a9 100644 (file)
@@ -14,8 +14,6 @@
  */
 #define CONFIG_CLK_FULL_SPEED  1008000000
 
-#define CONFIG_SYS_PROMPT      "sun8i# "
-
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT        1
index e839053e2ba995ca3388f251fdb6e0f8bf886a9f..6cfd7e1489001f248af66001420d88e11400ea71 100644 (file)
@@ -40,6 +40,8 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 
+#define CONFIG_SYS_PROMPT      "sunxi# "
+
 /* Serial & console */
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00080000      /* 512 KiB */
 
 /* I2C */
+#if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER
 #define CONFIG_SPL_I2C_SUPPORT
+#endif
+
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MVTWSI
 #define CONFIG_SYS_I2C_SPEED           400000
 #endif
 
 #ifdef CONFIG_USB_EHCI
-#define CONFIG_CMD_USB
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1
+#endif
+
+#ifdef CONFIG_USB_MUSB_SUNXI
+#define CONFIG_MUSB_HOST
+#define CONFIG_MUSB_PIO_ONLY
+#endif
+
+#if defined CONFIG_USB_EHCI || defined CONFIG_USB_MUSB_SUNXI
+#define CONFIG_CMD_USB
 #define CONFIG_USB_STORAGE
 #endif
 
index 20194aebb504d215b6aad4d336eb83c9a7406eae..65468ad1656dad3bbd66fea5fcc8b9b7d6590201 100644 (file)
 
 #define CONFIG_SYS_GENERIC_BOARD
 
+#if defined(CONFIG_SPL_BUILD)
+#define CONFIG_SYS_THUMB_BUILD
+#define CONFIG_SYS_ICACHE_OFF
+#define CONFIG_SYS_DCACHE_OFF
+#endif
 /*
  * Warning: changing CONFIG_SYS_TEXT_BASE requires
  * adapting the initial boot program.
 #define TAURUS_SPI_MASK (1 << 4)
 #define TAURUS_SPI_CS_PIN      AT91_PIN_PA3
 
+#if defined(CONFIG_SPL_BUILD)
+/* SPL related */
+#undef CONFIG_SPL_OS_BOOT              /* Not supported by existing map */
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
+
+#define CONFIG_SF_DEFAULT_BUS 0
+#define CONFIG_SF_DEFAULT_SPEED 10000000
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#endif
+
 /* load address */
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000
 
 /* Defines for SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x0
-#define CONFIG_SPL_MAX_SIZE            (11 * 1024)
+#define CONFIG_SPL_MAX_SIZE            (14 * 1024)
 #define CONFIG_SPL_STACK               (16 * 1024)
+#define CONFIG_SYS_SPL_MALLOC_START     (CONFIG_SYS_TEXT_BASE - \
+                                       CONFIG_SYS_MALLOC_LEN)
+#define CONFIG_SYS_SPL_MALLOC_SIZE      CONFIG_SYS_MALLOC_LEN
 
 #define CONFIG_SPL_BSS_START_ADDR      CONFIG_SPL_MAX_SIZE
 #define CONFIG_SPL_BSS_MAX_SIZE                (3 * 1024)
index 5ed86d9365cd08aee392bbe77e7c7bf84e5c9ad6..598526bf95feb0709fdef7ad179838b0aabdf2a7 100644 (file)
@@ -20,7 +20,9 @@
 #define CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
 
 #ifndef CONFIG_SPL_BUILD
+#ifndef CONFIG_DM
 # define CONFIG_DM
+#endif
 # define CONFIG_CMD_DM
 # define CONFIG_DM_GPIO
 # define CONFIG_DM_SERIAL
index c47651d79620c3c1431437d444f3c285b714cf00..925cb42dd38d9a66ecb1bbb94cae5bcb31b2bad6 100644 (file)
                "vram=${vram} " \
                "root=${mmcroot} " \
                "rootfstype=${mmcrootfstype}\0" \
+       "netargs=setenv bootargs console=${console} " \
+               "${optargs} " \
+               "root=/dev/nfs " \
+               "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
+               "ip=dhcp\0" \
        "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
        "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
                "source ${loadaddr}\0" \
-       "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+       "bootenv=uEnv.txt\0" \
+       "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
        "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
                "env import -t ${loadaddr} ${filesize}\0" \
        "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
                                "bootz ${loadaddr} - ${fdtaddr}; " \
                        "fi;" \
                "fi;\0" \
+       "netboot=echo Booting from network ...; " \
+               "set env autoload no; " \
+               "dhcp; " \
+               "tftp ${loadaddr} ${bootfile}; " \
+               "tftp ${fdtaddr} ${fdtfile}; " \
+               "run netargs; " \
+               "bootz ${loadaddr} - ${fdtaddr}\0" \
        "findfdt="\
                "if test $board_name = omap5_uevm; then " \
                        "setenv fdtfile omap5-uevm.dtb; fi; " \
index 5a53c506c35f50be969b4e5188d002206910ccfc..9ad47f6933eaac0f8a4ffa1817e0be6773ef146d 100644 (file)
@@ -43,6 +43,9 @@
 #define CONFIG_SDRAM1_SIZE     0x10000000
 #endif
 
+#define CONFIG_I2C_EEPROM
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
+
 /*
  * Support card address map
  */
index 027d78b59171901274da4e46c0da576c128c6415..7fb28a54ba175f5bba12a4c7e6a20ea304202577 100644 (file)
@@ -11,9 +11,9 @@
 /* We use generic board for v8 Versatile Express */
 #define CONFIG_SYS_GENERIC_BOARD
 
-#ifdef CONFIG_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #ifndef CONFIG_SEMIHOSTING
-#error CONFIG_BASE_FVP requires CONFIG_SEMIHOSTING
+#error CONFIG_TARGET_VEXPRESS64_BASE_FVP requires CONFIG_SEMIHOSTING
 #endif
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_ARMV8_SWITCH_TO_EL1
@@ -21,8 +21,9 @@
 
 #define CONFIG_REMAKE_ELF
 
-#ifndef CONFIG_BASE_FVP
-/* Base FVP not using GICv3 yet */
+#if !defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP) && \
+    !defined(CONFIG_TARGET_VEXPRESS64_JUNO)
+/* Base FVP and Juno not using GICv3 yet */
 #define CONFIG_GICV3
 #endif
 
 #define CONFIG_BOOTP_VCI_STRING                "U-boot.armv8.vexpress_aemv8a"
 
 /* Link Definitions */
-#ifdef CONFIG_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
 /* ATF loads u-boot here for BASE_FVP model */
 #define CONFIG_SYS_TEXT_BASE           0x88000000
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
+#elif CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_SYS_TEXT_BASE           0xe0000000
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 #else
 #define CONFIG_SYS_TEXT_BASE           0x80000000
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
@@ -54,7 +58,7 @@
 
 
 /* SMP Spin Table Definitions */
-#ifdef CONFIG_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #define CPU_RELEASE_ADDR               (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
 #else
 #define CPU_RELEASE_ADDR               (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 #define V2M_KMI0                       (V2M_PA_CS3 + V2M_PERIPH_OFFSET(6))
 #define V2M_KMI1                       (V2M_PA_CS3 + V2M_PERIPH_OFFSET(7))
 
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define V2M_UART0                      0x7ff80000
+#define V2M_UART1                      0x7ff70000
+#else /* Not Juno */
 #define V2M_UART0                      (V2M_PA_CS3 + V2M_PERIPH_OFFSET(9))
 #define V2M_UART1                      (V2M_PA_CS3 + V2M_PERIPH_OFFSET(10))
 #define V2M_UART2                      (V2M_PA_CS3 + V2M_PERIPH_OFFSET(11))
 #define V2M_UART3                      (V2M_PA_CS3 + V2M_PERIPH_OFFSET(12))
+#endif
 
 #define V2M_WDT                                (V2M_PA_CS3 + V2M_PERIPH_OFFSET(15))
 
 #define GICR_BASE                      (0x2f100000)
 #else
 
-#ifdef CONFIG_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #define GICD_BASE                      (0x2f000000)
 #define GICC_BASE                      (0x2c000000)
+#elif CONFIG_TARGET_VEXPRESS64_JUNO
+#define GICD_BASE                      (0x2C010000)
+#define GICC_BASE                      (0x2C02f000)
 #else
 #define GICD_BASE                      (0x2C001000)
 #define GICC_BASE                      (0x2C002000)
 
 /* PL011 Serial Configuration */
 #define CONFIG_PL011_SERIAL
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_PL011_CLOCK             7273800
+#else
 #define CONFIG_PL011_CLOCK             24000000
+#endif
 #define CONFIG_PL01x_PORTS             {(void *)CONFIG_SYS_SERIAL0, \
                                         (void *)CONFIG_SYS_SERIAL1}
 #define CONFIG_CONS_INDEX              0
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_FLASH
 #define CONFIG_CMD_IMI
+#define CONFIG_CMD_LOADB
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_NET
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 
 /* Initial environment variables */
-#ifdef CONFIG_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #define CONFIG_EXTRA_ENV_SETTINGS      \
                                "kernel_name=uImage\0"  \
                                "kernel_addr_r=0x80000000\0"    \
index 7e78f8ac8fcc60acf2b728626904d5b70aa29fe4..2dea9210454a7b6dd7cf824aea89295d84864e22 100644 (file)
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_SYS_L2CACHE_OFF         1
 #define CONFIG_INITRD_TAG              1
-
+#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_OF_LIBFDT               1
 
 /* Size of malloc() pool */
index f16ae3291323887671945745dd7cf954c9073ee1..ecedfc3ab16ecc00d3f12af3118120ef255ee9c5 100644 (file)
 #define VIDEO_FB_16BPP_WORD_SWAP
 #define CONFIG_I8042_KBD
 #define CONFIG_CFB_CONSOLE
+#define CONFIG_CONSOLE_SCROLL_LINES 5
 
 /*-----------------------------------------------------------------------
  * CPU Features
 #define CONFIG_CMD_SF_TEST
 #define CONFIG_CMD_SPI
 #define CONFIG_SPI
+#define CONFIG_OF_SPI_FLASH
 
 /*-----------------------------------------------------------------------
  * Environment configuration
index 87b4fffeb9fb262143edaae2599220c04255a959..864528a5ea1b39e8b39e089b45837812bc731a82 100644 (file)
 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
 # define CONFIG_PHYLIB
 # define CONFIG_PHY_MARVELL
+# define CONFIG_BOOTP_SERVERIP
+# define CONFIG_BOOTP_BOOTPATH
+# define CONFIG_BOOTP_GATEWAY
+# define CONFIG_BOOTP_HOSTNAME
+# define CONFIG_BOOTP_MAY_FAIL
+# if !defined(CONFIG_ZYNQ_GEM_EMIO0)
+#  define CONFIG_ZYNQ_GEM_EMIO0        0
+# endif
+# if !defined(CONFIG_ZYNQ_GEM_EMIO1)
+#  define CONFIG_ZYNQ_GEM_EMIO1        0
+# endif
 #endif
 
 /* SPI */
 # define CONFIG_USB_ULPI
 # define CONFIG_EHCI_IS_TDI
 # define CONFIG_USB_MAX_CONTROLLER_COUNT       2
+
+# define CONFIG_CI_UDC           /* ChipIdea CI13xxx UDC */
+# define CONFIG_USB_GADGET
+# define CONFIG_USB_GADGET_DUALSPEED
+# define CONFIG_USBDOWNLOAD_GADGET
+# define CONFIG_SYS_DFU_DATA_BUF_SIZE  0x600000
+# define DFU_DEFAULT_POLL_TIMEOUT      300
+# define CONFIG_DFU_FUNCTION
+# define CONFIG_DFU_RAM
+# define CONFIG_USB_GADGET_VBUS_DRAW   2
+# define CONFIG_G_DNL_VENDOR_NUM       0x03FD
+# define CONFIG_G_DNL_PRODUCT_NUM      0x0300
+# define CONFIG_G_DNL_MANUFACTURER     "Xilinx"
+# define CONFIG_USB_GADGET
+# define CONFIG_USB_CABLE_CHECK
+# define CONFIG_CMD_DFU
+# define CONFIG_CMD_THOR_DOWNLOAD
+# define CONFIG_THOR_FUNCTION
+# define DFU_ALT_INFO_RAM \
+       "dfu_ram_info=" \
+       "set dfu_alt_info " \
+       "${kernel_image} ram 0x3000000 0x500000\\\\;" \
+       "${devicetree_image} ram 0x2A00000 0x20000\\\\;" \
+       "${ramdisk_image} ram 0x2000000 0x600000\0" \
+       "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
+       "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
+
+# if defined(CONFIG_ZYNQ_SDHCI0) || defined(CONFIG_ZYNQ_SDHCI1)
+#  define CONFIG_DFU_MMC
+#  define DFU_ALT_INFO_MMC \
+       "dfu_mmc_info=" \
+       "set dfu_alt_info " \
+       "${kernel_image} fat 0 1\\\\;" \
+       "${devicetree_image} fat 0 1\\\\;" \
+       "${ramdisk_image} fat 0 1\0" \
+       "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \
+       "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0"
+
+#  define DFU_ALT_INFO \
+       DFU_ALT_INFO_RAM \
+       DFU_ALT_INFO_MMC
+# else
+#  define DFU_ALT_INFO \
+       DFU_ALT_INFO_RAM
+# endif
+#endif
+
+#if !defined(DFU_ALT_INFO)
+# define DFU_ALT_INFO
 #endif
 
 #if defined(CONFIG_ZYNQ_SDHCI) || defined(CONFIG_ZYNQ_USB)
 # define CONFIG_DOS_PARTITION
 # define CONFIG_CMD_EXT4
 # define CONFIG_CMD_EXT4_WRITE
+# define CONFIG_CMD_FS_GENERIC
 #endif
 
 #define CONFIG_SYS_I2C_ZYNQ
 # define CONFIG_SYS_EEPROM_SIZE                        1024 /* Bytes */
 #endif
 
-#define CONFIG_BOOTP_SERVERIP
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-#define CONFIG_BOOTP_MAY_FAIL
-
 /* Total Size of Environment Sector */
 #define CONFIG_ENV_SIZE                        (128 << 10)
 
                "cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
                "bootm ${load_addr}\0" \
        "sdboot=echo Copying FIT from SD to RAM... && " \
-               "fatload mmc 0 ${load_addr} ${fit_image} && " \
+               "load mmc 0 ${load_addr} ${fit_image} && " \
                "bootm ${load_addr}\0" \
        "jtagboot=echo TFTPing FIT to RAM... && " \
                "tftpboot ${load_addr} ${fit_image} && " \
                "bootm ${load_addr}\0" \
        "usbboot=if usb start; then " \
                        "echo Copying FIT from USB to RAM... && " \
-                       "fatload usb 0 ${load_addr} ${fit_image} && " \
+                       "load usb 0 ${load_addr} ${fit_image} && " \
                        "bootm ${load_addr}\0" \
-               "fi\0"
+               "fi\0" \
+               DFU_ALT_INFO
 
 #define CONFIG_BOOTCOMMAND             "run $modeboot"
 #define CONFIG_BOOTDELAY               3 /* -1 to Disable autoboot */
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_BOARD_LATE_INIT
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CLOCKS
 #define CONFIG_CMD_CLK
 #define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x1000)
 
-#define CONFIG_SYS_MALLOC_LEN          0x400000
+#define CONFIG_SYS_MALLOC_LEN          0xC00000
 #define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_INIT_RAM_SIZE       CONFIG_SYS_MALLOC_LEN
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR + \
 #define CONFIG_OF_LIBFDT
 
 /* FIT support */
-#define CONFIG_FIT
-#define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
 #define CONFIG_IMAGE_FORMAT_LEGACY /* enable also legacy image format */
 
 /* FDT support */
 #define CONFIG_DISPLAY_BOARDINFO_LATE
 
-/* RSA support */
-#define CONFIG_FIT_SIGNATURE
-#define CONFIG_RSA
-
 /* Extend size of kernel image for uncompression */
 #define CONFIG_SYS_BOOTM_LEN   (60 * 1024 * 1024)
 
index 9e13146ecbb266a5b73dbb9b93b1e90317c79a06..8457c80c5efd4264e5943255dc35b83fd520581b 100644 (file)
@@ -13,6 +13,7 @@
 #include <ec_commands.h>
 #include <fdtdec.h>
 #include <cros_ec_message.h>
+#include <asm/gpio.h>
 
 #ifndef CONFIG_DM_CROS_EC
 /* Which interface is the device on? */
@@ -39,7 +40,7 @@ struct cros_ec_dev {
        unsigned int bus_num;           /* Bus number (for I2C) */
        unsigned int max_frequency;     /* Maximum interface frequency */
 #endif
-       struct fdt_gpio_state ec_int;   /* GPIO used as EC interrupt line */
+       struct gpio_desc ec_int;        /* GPIO used as EC interrupt line */
        int protocol_version;           /* Protocol version to use */
        int optimise_flash_write;       /* Don't write erased flash blocks */
 
index a24fec6658e8e9bb1df82235222befc404411b32..03722d0c14dc14de253bc203185da4c59503cd99 100644 (file)
@@ -25,10 +25,14 @@ struct dm_demo_pdata {
 struct demo_ops {
        int (*hello)(struct udevice *dev, int ch);
        int (*status)(struct udevice *dev, int *status);
+       int (*set_light)(struct udevice *dev, int light);
+       int (*get_light)(struct udevice *dev);
 };
 
 int demo_hello(struct udevice *dev, int ch);
 int demo_status(struct udevice *dev, int *status);
+int demo_set_light(struct udevice *dev, int light);
+int demo_get_light(struct udevice *dev);
 int demo_list(void);
 
 int demo_parse_dt(struct udevice *dev);
index 13598a15b68684ee81b023c30d8ec42e21941c2b..81afa8c6281f8f9c55dbd968bfd4b344f8cf872a 100644 (file)
@@ -26,6 +26,9 @@ struct driver_info;
 /* DM should init this device prior to relocation */
 #define DM_FLAG_PRE_RELOC      (1 << 2)
 
+/* DM is responsible for allocating and freeing parent_platdata */
+#define DM_FLAG_ALLOC_PARENT_PDATA     (1 << 3)
+
 /**
  * struct udevice - An instance of a driver
  *
@@ -46,6 +49,7 @@ struct driver_info;
  * @driver: The driver used by this device
  * @name: Name of device, typically the FDT node name
  * @platdata: Configuration data for this device
+ * @parent_platdata: The parent bus's configuration data for this device
  * @of_offset: Device tree node offset for this device (- for none)
  * @of_id: Pointer to the udevice_id structure which created the device
  * @parent: Parent of this device, or NULL for the top level device
@@ -65,6 +69,7 @@ struct udevice {
        struct driver *driver;
        const char *name;
        void *platdata;
+       void *parent_platdata;
        int of_offset;
        const struct udevice_id *of_id;
        struct udevice *parent;
@@ -127,6 +132,7 @@ struct udevice_id {
  * @remove: Called to remove a device, i.e. de-activate it
  * @unbind: Called to unbind a device from its driver
  * @ofdata_to_platdata: Called before probe to decode device tree data
+ * @child_post_bind: Called after a new child has been bound
  * @child_pre_probe: Called before a child device is probed. The device has
  * memory allocated but it has not yet been probed.
  * @child_post_remove: Called after a child device is removed. The device
@@ -146,6 +152,9 @@ struct udevice_id {
  * device_probe_child() pass it in. So far the use case for allocating it
  * is SPI, but I found that unsatisfactory. Since it is here I will leave it
  * until things are clearer.
+ * @per_child_platdata_auto_alloc_size: A bus likes to store information about
+ * its children. If non-zero this is the size of this data, to be allocated
+ * in the child's parent_platdata pointer.
  * @ops: Driver-specific operations. This is typically a list of function
  * pointers defined by the driver, to implement driver functions required by
  * the uclass.
@@ -160,11 +169,13 @@ struct driver {
        int (*remove)(struct udevice *dev);
        int (*unbind)(struct udevice *dev);
        int (*ofdata_to_platdata)(struct udevice *dev);
+       int (*child_post_bind)(struct udevice *dev);
        int (*child_pre_probe)(struct udevice *dev);
        int (*child_post_remove)(struct udevice *dev);
        int priv_auto_alloc_size;
        int platdata_auto_alloc_size;
        int per_child_auto_alloc_size;
+       int per_child_platdata_auto_alloc_size;
        const void *ops;        /* driver-specific operations */
        uint32_t flags;
 };
@@ -183,6 +194,16 @@ struct driver {
  */
 void *dev_get_platdata(struct udevice *dev);
 
+/**
+ * dev_get_parent_platdata() - Get the parent platform data for a device
+ *
+ * This checks that dev is not NULL, but no other checks for now
+ *
+ * @dev                Device to check
+ * @return parent's platform data, or NULL if none
+ */
+void *dev_get_parent_platdata(struct udevice *dev);
+
 /**
  * dev_get_parentdata() - Get the parent data for a device
  *
@@ -224,6 +245,14 @@ struct udevice *dev_get_parent(struct udevice *child);
  */
 ulong dev_get_of_data(struct udevice *dev);
 
+/*
+ * device_get_uclass_id() - return the uclass ID of a device
+ *
+ * @dev:       Device to check
+ * @return uclass ID for the device
+ */
+enum uclass_id device_get_uclass_id(struct udevice *dev);
+
 /**
  * device_get_child() - Get the child of a device by index
  *
index f08c05da8147725f87900da81bf8944ff1c46ebc..707c69e07f02c488f10de559185769829534e689 100644 (file)
@@ -67,6 +67,8 @@ enum {
 struct dm_test_priv {
        int ping_total;
        int op_count[DM_TEST_OP_COUNT];
+       int uclass_flag;
+       int uclass_total;
 };
 
 /**
@@ -88,6 +90,7 @@ struct dm_test_uclass_priv {
  *
  * @sum: Test value used to check parent data works correctly
  * @flag: Used to track calling of parent operations
+ * @uclass_flag: Used to track calling of parent operations by uclass
  */
 struct dm_test_parent_data {
        int sum;
index f17c3c2b384dfc8aa782583fa0734cb31a77d222..91bb90dcfb3044196907da15b3b83efb2c2dd07c 100644 (file)
@@ -33,6 +33,7 @@ enum uclass_id {
        UCLASS_I2C,             /* I2C bus */
        UCLASS_I2C_GENERIC,     /* Generic I2C device */
        UCLASS_I2C_EEPROM,      /* I2C EEPROM device */
+       UCLASS_MOD_EXP,         /* RSA Mod Exp device */
 
        UCLASS_COUNT,
        UCLASS_INVALID = -1,
index f718f37affba344713f7599692f9fa79b2286652..f2f254a8259736f9d24ba18ad95ba9e126eb53c2 100644 (file)
@@ -43,6 +43,17 @@ int uclass_bind_device(struct udevice *dev);
  */
 int uclass_unbind_device(struct udevice *dev);
 
+/**
+ * uclass_pre_probe_child() - Deal with a child that is about to be probed
+ *
+ * Perform any pre-processing that is needed by the uclass before it can be
+ * probed.
+ *
+ * @dev:       Pointer to the device
+ * #return 0 on success, -ve on error
+ */
+int uclass_pre_probe_child(struct udevice *dev);
+
 /**
  * uclass_post_probe_device() - Deal with a device that has just been probed
  *
index f6ec6d7e9f62f7551b869f1eb7b188e8587b44ee..d6c40c60dda0913c27c46ffb8538176a7d595210 100644 (file)
@@ -40,6 +40,9 @@ struct uclass {
 
 struct udevice;
 
+/* Members of this uclass sequence themselves with aliases */
+#define DM_UC_FLAG_SEQ_ALIAS                   (1 << 0)
+
 /**
  * struct uclass_driver - Driver for the uclass
  *
@@ -52,6 +55,7 @@ struct udevice;
  * @pre_unbind: Called before a device is unbound from this uclass
  * @post_probe: Called after a new device is probed
  * @pre_remove: Called before a device is removed
+ * @child_post_bind: Called after a child is bound to a device in this uclass
  * @init: Called to set up the uclass
  * @destroy: Called to destroy the uclass
  * @priv_auto_alloc_size: If non-zero this is the size of the private data
@@ -60,8 +64,16 @@ struct udevice;
  * @per_device_auto_alloc_size: Each device can hold private data owned
  * by the uclass. If required this will be automatically allocated if this
  * value is non-zero.
+ * @per_child_auto_alloc_size: Each child device (of a parent in this
+ * uclass) can hold parent data for the device/uclass. This value is only
+ * used as a falback if this member is 0 in the driver.
+ * @per_child_platdata_auto_alloc_size: A bus likes to store information about
+ * its children. If non-zero this is the size of this data, to be allocated
+ * in the child device's parent_platdata pointer. This value is only used as
+ * a falback if this member is 0 in the driver.
  * @ops: Uclass operations, providing the consistent interface to devices
  * within the uclass.
+ * @flags: Flags for this uclass (DM_UC_...)
  */
 struct uclass_driver {
        const char *name;
@@ -70,11 +82,16 @@ struct uclass_driver {
        int (*pre_unbind)(struct udevice *dev);
        int (*post_probe)(struct udevice *dev);
        int (*pre_remove)(struct udevice *dev);
+       int (*child_post_bind)(struct udevice *dev);
+       int (*child_pre_probe)(struct udevice *dev);
        int (*init)(struct uclass *class);
        int (*destroy)(struct uclass *class);
        int priv_auto_alloc_size;
        int per_device_auto_alloc_size;
+       int per_child_auto_alloc_size;
+       int per_child_platdata_auto_alloc_size;
        const void *ops;
+       uint32_t flags;
 };
 
 /* Declare a new uclass_driver */
@@ -141,6 +158,8 @@ int uclass_get_device_by_of_offset(enum uclass_id id, int node,
 /**
  * uclass_first_device() - Get the first device in a uclass
  *
+ * The device returned is probed if necessary, and ready for use
+ *
  * @id: Uclass ID to look up
  * @devp: Returns pointer to the first device in that uclass, or NULL if none
  * @return 0 if OK (found or not found), -1 on error
@@ -150,6 +169,8 @@ int uclass_first_device(enum uclass_id id, struct udevice **devp);
 /**
  * uclass_next_device() - Get the next device in a uclass
  *
+ * The device returned is probed if necessary, and ready for use
+ *
  * @devp: On entry, pointer to device to lookup. On exit, returns pointer
  * to the next device in the same uclass, or NULL if none
  * @return 0 if OK (found or not found), -1 on error
index 41d5085e16c27017d7e02540c3aacfa2090e994a..205affe72d701d087107b21a818daf974422d8f8 100644 (file)
@@ -3,6 +3,8 @@
 
 #ifndef __ASSEMBLY__
 
+struct spi_slave;
+
 /* These are declarations of exported functions available in C code */
 unsigned long get_version(void);
 int  getc(void);
@@ -10,22 +12,23 @@ int  tstc(void);
 void putc(const char);
 void puts(const char*);
 int printf(const char* fmt, ...);
-void install_hdlr(int, void (*interrupt_handler_t)(void *), void*);
+void install_hdlr(int, interrupt_handler_t, void*);
 void free_hdlr(int);
 void *malloc(size_t);
 void free(void*);
 void __udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
-unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (const char *name);
 int setenv (const char *varname, const char *varvalue);
-long simple_strtol(const char *cp,char **endp,unsigned int base);
-int strcmp(const char * cs,const char * ct);
+long simple_strtol(const char *cp, char **endp, unsigned int base);
+int strcmp(const char *cs, const char *ct);
 unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
 unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
-#if defined(CONFIG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C) && \
+               (!defined(CONFIG_DM_I2C) || defined(CONFIG_DM_I2C_COMPAT))
 int i2c_write (uchar, uint, int , uchar* , int);
 int i2c_read (uchar, uint, int , uchar* , int);
 #endif
@@ -34,15 +37,14 @@ void app_startup(char * const *);
 
 #endif    /* ifndef __ASSEMBLY__ */
 
-enum {
-#define EXPORT_FUNC(x) XF_ ## x ,
+struct jt_funcs {
+#define EXPORT_FUNC(impl, res, func, ...) res(*func)(__VA_ARGS__);
 #include <_exports.h>
 #undef EXPORT_FUNC
-
-       XF_MAX
 };
 
-#define XF_VERSION     6
+
+#define XF_VERSION     7
 
 #if defined(CONFIG_X86)
 extern gd_t *global_data;
index 75af750ee576174a1e135952cae09e6ed4f3e1ca..231eed789273800fb3daf14913ae84b07d65a6c9 100644 (file)
@@ -115,9 +115,6 @@ enum fdt_compat_id {
        COMPAT_NVIDIA_TEGRA20_USB,      /* Tegra20 USB port */
        COMPAT_NVIDIA_TEGRA30_USB,      /* Tegra30 USB port */
        COMPAT_NVIDIA_TEGRA114_USB,     /* Tegra114 USB port */
-       COMPAT_NVIDIA_TEGRA114_I2C,     /* Tegra114 I2C w/single clock source */
-       COMPAT_NVIDIA_TEGRA20_I2C,      /* Tegra20 i2c */
-       COMPAT_NVIDIA_TEGRA20_DVC,      /* Tegra20 dvc (really just i2c) */
        COMPAT_NVIDIA_TEGRA20_EMC,      /* Tegra20 memory controller */
        COMPAT_NVIDIA_TEGRA20_EMC_TABLE, /* Tegra20 memory timing table */
        COMPAT_NVIDIA_TEGRA20_KBC,      /* Tegra20 Keyboard */
@@ -127,9 +124,6 @@ enum fdt_compat_id {
        COMPAT_NVIDIA_TEGRA124_SDMMC,   /* Tegra124 SDMMC controller */
        COMPAT_NVIDIA_TEGRA30_SDMMC,    /* Tegra30 SDMMC controller */
        COMPAT_NVIDIA_TEGRA20_SDMMC,    /* Tegra20 SDMMC controller */
-       COMPAT_NVIDIA_TEGRA20_SFLASH,   /* Tegra 2 SPI flash controller */
-       COMPAT_NVIDIA_TEGRA20_SLINK,    /* Tegra 2 SPI SLINK controller */
-       COMPAT_NVIDIA_TEGRA114_SPI,     /* Tegra 114 SPI controller */
        COMPAT_NVIDIA_TEGRA124_PCIE,    /* Tegra 124 PCIe controller */
        COMPAT_NVIDIA_TEGRA30_PCIE,     /* Tegra 30 PCIe controller */
        COMPAT_NVIDIA_TEGRA20_PCIE,     /* Tegra 20 PCIe controller */
@@ -140,7 +134,6 @@ enum fdt_compat_id {
        COMPAT_SAMSUNG_S3C2440_I2C,     /* Exynos I2C Controller */
        COMPAT_SAMSUNG_EXYNOS5_SOUND,   /* Exynos Sound */
        COMPAT_WOLFSON_WM8994_CODEC,    /* Wolfson WM8994 Sound Codec */
-       COMPAT_SAMSUNG_EXYNOS_SPI,      /* Exynos SPI */
        COMPAT_GOOGLE_CROS_EC,          /* Google CROS_EC Protocol */
        COMPAT_GOOGLE_CROS_EC_KEYB,     /* Google CROS_EC Keyboard */
        COMPAT_SAMSUNG_EXYNOS_EHCI,     /* Exynos EHCI controller */
@@ -173,42 +166,63 @@ enum fdt_compat_id {
        COMPAT_INTEL_MODEL_206AX,       /* Intel Model 206AX CPU */
        COMPAT_INTEL_GMA,               /* Intel Graphics Media Accelerator */
        COMPAT_AMS_AS3722,              /* AMS AS3722 PMIC */
+       COMPAT_INTEL_ICH_SPI,           /* Intel ICH7/9 SPI controller */
 
        COMPAT_COUNT,
 };
 
-/* GPIOs are numbered from 0 */
-enum {
-       FDT_GPIO_NONE = -1U,    /* an invalid GPIO used to end our list */
-
-       FDT_GPIO_ACTIVE_LOW = 1 << 0,   /* input is active low (else high) */
-};
-
-/* This is the state of a GPIO pin as defined by the fdt */
-struct fdt_gpio_state {
-       const char *name;       /* name of the fdt property defining this */
-       uint gpio;              /* GPIO number, or FDT_GPIO_NONE if none */
-       u8 flags;               /* FDT_GPIO_... flags */
+#define MAX_PHANDLE_ARGS 16
+struct fdtdec_phandle_args {
+       int node;
+       int args_count;
+       uint32_t args[MAX_PHANDLE_ARGS];
 };
 
-/* This tells us whether a fdt_gpio_state record is valid or not */
-#define fdt_gpio_isvalid(x) ((x)->gpio != FDT_GPIO_NONE)
-
 /**
- * Read the GPIO taking into account the polarity of the pin.
+ * fdtdec_parse_phandle_with_args() - Find a node pointed by phandle in a list
  *
- * @param gpio         pointer to the decoded gpio
- * @return value of the gpio if successful, < 0 if unsuccessful
- */
-int fdtdec_get_gpio(struct fdt_gpio_state *gpio);
-
-/**
- * Write the GPIO taking into account the polarity of the pin.
+ * This function is useful to parse lists of phandles and their arguments.
+ *
+ * Example:
+ *
+ * phandle1: node1 {
+ *     #list-cells = <2>;
+ * }
+ *
+ * phandle2: node2 {
+ *     #list-cells = <1>;
+ * }
+ *
+ * node3 {
+ *     list = <&phandle1 1 2 &phandle2 3>;
+ * }
+ *
+ * To get a device_node of the `node2' node you may call this:
+ * fdtdec_parse_phandle_with_args(blob, node3, "list", "#list-cells", 0, 1,
+ *                               &args);
+ *
+ * (This function is a modified version of __of_parse_phandle_with_args() from
+ * Linux 3.18)
+ *
+ * @blob:      Pointer to device tree
+ * @src_node:  Offset of device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name:        property name that specifies the phandles' arguments count,
+ *             or NULL to use @cells_count
+ * @cells_count: Cell count to use if @cells_name is NULL
+ * @index:     index of a phandle to parse out
+ * @out_args:  optional pointer to output arguments structure (will be filled)
+ * @return 0 on success (with @out_args filled out if not NULL), -ENOENT if
+ *     @list_name does not exist, a phandle was not found, @cells_name
+ *     could not be found, the arguments were truncated or there were too
+ *     many arguments.
  *
- * @param gpio         pointer to the decoded gpio
- * @return 0 if successful
  */
-int fdtdec_set_gpio(struct fdt_gpio_state *gpio, int val);
+int fdtdec_parse_phandle_with_args(const void *blob, int src_node,
+                                  const char *list_name,
+                                  const char *cells_name,
+                                  int cell_count, int index,
+                                  struct fdtdec_phandle_args *out_args);
 
 /**
  * Find the next numbered alias for a peripheral. This is used to enumerate
@@ -590,50 +604,6 @@ const u32 *fdtdec_locate_array(const void *blob, int node,
  */
 int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
 
-/**
- * Decode a single GPIOs from an FDT.
- *
- * If the property is not found, then the GPIO structure will still be
- * initialised, with gpio set to FDT_GPIO_NONE. This makes it easy to
- * provide optional GPIOs.
- *
- * @param blob         FDT blob to use
- * @param node         Node to look at
- * @param prop_name    Node property name
- * @param gpio         gpio elements to fill from FDT
- * @return 0 if ok, -FDT_ERR_NOTFOUND if the property is missing.
- */
-int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
-               struct fdt_gpio_state *gpio);
-
-/**
- * Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
- * terminating item.
- *
- * @param blob         FDT blob to use
- * @param node         Node to look at
- * @param prop_name    Node property name
- * @param gpio         Array of gpio elements to fill from FDT. This will be
- *                     untouched if either 0 or an error is returned
- * @param max_count    Maximum number of elements allowed
- * @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
- * be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
- */
-int fdtdec_decode_gpios(const void *blob, int node, const char *prop_name,
-               struct fdt_gpio_state *gpio, int max_count);
-
-/**
- * Set up a GPIO pin according to the provided gpio information. At present this
- * just requests the GPIO.
- *
- * If the gpio is FDT_GPIO_NONE, no action is taken. This makes it easy to
- * deal with optional GPIOs.
- *
- * @param gpio         GPIO info to use for set up
- * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
- */
-int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
-
 /**
  * Look in the FDT for a config item with the given name and return its value
  * as a 32-bit integer. The property must have at least 4 bytes of data. The
index 914024c17cb8841578ea622e112bb7aaf7fccb68..e0d12981b283ea93f9e4ef9fcf66076e4cc5bbda 100644 (file)
@@ -49,18 +49,19 @@ typedef enum {
 } bitstream_type;
 
 /* root function definitions */
-extern void fpga_init(void);
-extern int fpga_add(fpga_type devtype, void *desc);
-extern int fpga_count(void);
-extern int fpga_load(int devnum, const void *buf, size_t bsize,
-                    bitstream_type bstype);
-extern int fpga_fsload(int devnum, const void *buf, size_t size,
-                      fpga_fs_info *fpga_fsinfo);
-extern int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
-                             bitstream_type bstype);
-extern int fpga_dump(int devnum, const void *buf, size_t bsize);
-extern int fpga_info(int devnum);
-extern const fpga_desc *const fpga_validate(int devnum, const void *buf,
-                                           size_t bsize, char *fn);
+void fpga_init(void);
+int fpga_add(fpga_type devtype, void *desc);
+int fpga_count(void);
+const fpga_desc *const fpga_get_desc(int devnum);
+int fpga_load(int devnum, const void *buf, size_t bsize,
+             bitstream_type bstype);
+int fpga_fsload(int devnum, const void *buf, size_t size,
+               fpga_fs_info *fpga_fsinfo);
+int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
+                      bitstream_type bstype);
+int fpga_dump(int devnum, const void *buf, size_t bsize);
+int fpga_info(int devnum);
+const fpga_desc *const fpga_validate(int devnum, const void *buf,
+                                    size_t bsize, char *fn);
 
 #endif /* _FPGA_H_ */
index ffb6ce7ada64f0498b46eac89d6a335bea83c488..fd1e4ab1c0f3880e0a4a9fdfd8e2be5df42fd4ca 100644 (file)
@@ -109,4 +109,10 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype);
 
+/*
+ * Determine the type of the specified filesystem and print it. Optionally it is
+ * possible to store the type directly in env.
+ */
+int do_fs_type(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+
 #endif /* _FS_H */
index 675557ad1fd3605f07fab75477f8c61f6cd58fae..3286c95907c2419e3ccdc6cdc05a8245357459a5 100644 (file)
 #ifdef CONFIG_SYS_FSL_DDR_LE
 #define ddr_in32(a)    in_le32(a)
 #define ddr_out32(a, v)        out_le32(a, v)
+#define ddr_setbits32(a, v)    setbits_le32(a, v)
+#define ddr_clrbits32(a, v)    clrbits_le32(a, v)
+#define ddr_clrsetbits32(a, clear, set)        clrsetbits_le32(a, clear, set)
 #else
 #define ddr_in32(a)    in_be32(a)
 #define ddr_out32(a, v)        out_be32(a, v)
+#define ddr_setbits32(a, v)    setbits_be32(a, v)
+#define ddr_clrbits32(a, v)    clrbits_be32(a, v)
+#define ddr_clrsetbits32(a, clear, set)        clrsetbits_be32(a, clear, set)
 #endif
 
 #define _DDR_ADDR CONFIG_SYS_FSL_DDR_ADDR
diff --git a/include/galileo/core.h b/include/galileo/core.h
deleted file mode 100644 (file)
index 95013fa..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Core.h - Basic core logic functions and definitions */
-
-/* Copyright Galileo Technology. */
-
-/*
-DESCRIPTION
-This header file contains simple read/write macros for addressing
-the SDRAM, devices, GT`s internal registers and PCI (using the PCI`s address
-space). The macros take care of Big/Little endian conversions.
-*/
-
-#ifndef __INCcoreh
-#define __INCcoreh
-
-/* includes */
-#include "gt64260R.h"
-#include <stdbool.h>
-
-extern unsigned int INTERNAL_REG_BASE_ADDR;
-
-/*
- * GT-6426x variants
- */
-#define GT_64260       0  /* includes both 64260A and 64260B */
-#define GT_64261       1
-
-#if (CONFIG_SYS_GT_6426x == GT_64260)
-#ifdef CONFIG_ETHER_PORT_MII
-#define GAL_ETH_DEVS 2
-#else
-#define GAL_ETH_DEVS 3
-#endif
-#elif (CONFIG_SYS_GT_6426x == GT_64261)
-#define GAL_ETH_DEVS 2
-#else
-#define GAL_ETH_DEVS 3 /* default to a 64260 */
-#endif
-
-/****************************************/
-/*          GENERAL Definitions                        */
-/****************************************/
-
-#define NO_BIT          0x00000000
-#define BIT0            0x00000001
-#define BIT1            0x00000002
-#define BIT2            0x00000004
-#define BIT3            0x00000008
-#define BIT4            0x00000010
-#define BIT5            0x00000020
-#define BIT6            0x00000040
-#define BIT7            0x00000080
-#define BIT8            0x00000100
-#define BIT9            0x00000200
-#define BIT10           0x00000400
-#define BIT11           0x00000800
-#define BIT12           0x00001000
-#define BIT13           0x00002000
-#define BIT14           0x00004000
-#define BIT15           0x00008000
-#define BIT16           0x00010000
-#define BIT17           0x00020000
-#define BIT18           0x00040000
-#define BIT19           0x00080000
-#define BIT20           0x00100000
-#define BIT21           0x00200000
-#define BIT22           0x00400000
-#define BIT23           0x00800000
-#define BIT24           0x01000000
-#define BIT25           0x02000000
-#define BIT26           0x04000000
-#define BIT27           0x08000000
-#define BIT28           0x10000000
-#define BIT29           0x20000000
-#define BIT30           0x40000000
-#define BIT31           0x80000000
-
-#define _1K             0x00000400
-#define _2K             0x00000800
-#define _4K             0x00001000
-#define _8K             0x00002000
-#define _16K            0x00004000
-#define _32K            0x00008000
-#define _64K            0x00010000
-#define _128K           0x00020000
-#define _256K           0x00040000
-#define _512K           0x00080000
-
-#define _1M             0x00100000
-#define _2M             0x00200000
-#define _3M             0x00300000
-#define _4M             0x00400000
-#define _5M             0x00500000
-#define _6M             0x00600000
-#define _7M             0x00700000
-#define _8M             0x00800000
-#define _9M             0x00900000
-#define _10M            0x00a00000
-#define _11M            0x00b00000
-#define _12M            0x00c00000
-#define _13M            0x00d00000
-#define _14M            0x00e00000
-#define _15M            0x00f00000
-#define _16M            0x01000000
-
-#define _32M            0x02000000
-#define _64M            0x04000000
-#define _128M           0x08000000
-#define _256M           0x10000000
-#define _512M           0x20000000
-
-#define _1G             0x40000000
-#define _2G             0x80000000
-
-/* Little to Big endian conversion macros */
-
-#ifdef LE /* Little Endian */
-#define SHORT_SWAP(X) (X)
-#define WORD_SWAP(X) (X)
-#define LONG_SWAP(X) ((l64)(X))
-
-#else    /* Big Endian */
-#define SHORT_SWAP(X) ((X <<8 ) | (X >> 8))
-
-#define WORD_SWAP(X) (((X)&0xff)<<24)+      \
-                   (((X)&0xff00)<<8)+      \
-                   (((X)&0xff0000)>>8)+    \
-                   (((X)&0xff000000)>>24)
-
-#define LONG_SWAP(X) ( (l64) (((X)&0xffULL)<<56)+               \
-                           (((X)&0xff00ULL)<<40)+              \
-                           (((X)&0xff0000ULL)<<24)+            \
-                           (((X)&0xff000000ULL)<<8)+           \
-                           (((X)&0xff00000000ULL)>>8)+         \
-                           (((X)&0xff0000000000ULL)>>24)+      \
-                           (((X)&0xff000000000000ULL)>>40)+    \
-                           (((X)&0xff00000000000000ULL)>>56))
-
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* Those two definitions were defined to be compatible with MIPS */
-#define NONE_CACHEABLE         0x00000000
-#define CACHEABLE                      0x00000000
-
-/* 750 cache line */
-#define CACHE_LINE_SIZE 32
-#define CACHELINE_MASK_BITS (CACHE_LINE_SIZE - 1)
-#define CACHELINE_ROUNDUP(A) (((A)+CACHELINE_MASK_BITS) & ~CACHELINE_MASK_BITS)
-
-/* Read/Write to/from GT`s internal registers */
-#define GT_REG_READ(offset, pData)                                          \
-*pData = ( *((volatile unsigned int *)(NONE_CACHEABLE |                     \
-               INTERNAL_REG_BASE_ADDR | (offset))) ) ;                                              \
-*pData = WORD_SWAP(*pData)
-
-#define GTREGREAD(offset)                                                   \
-        (WORD_SWAP( *((volatile unsigned int *)(NONE_CACHEABLE |            \
-                  INTERNAL_REG_BASE_ADDR | (offset))) ))
-
-#define GT_REG_WRITE(offset, data)                                          \
-*((unsigned int *)( INTERNAL_REG_BASE_ADDR | (offset))) =                   \
-                   WORD_SWAP(data)
-
-/* Write 32/16/8 bit */
-#define WRITE_CHAR(address, data)                                           \
-       *((unsigned char *)(address)) = data
-#define WRITE_SHORT(address, data)                                          \
-       *((unsigned short *)(address)) = data
-#define WRITE_WORD(address, data)                                           \
-       *((unsigned int *)(address)) = data
-
-/* Read 32/16/8 bits - returns data in variable. */
-#define READ_CHAR(address, pData)                                           \
-       *pData = *((volatile unsigned char *)(address))
-
-#define READ_SHORT(address, pData)                                          \
-       *pData = *((volatile unsigned short *)(address))
-
-#define READ_WORD(address, pData)                                           \
-       *pData = *((volatile unsigned int *)(address))
-
-/* Read 32/16/8 bit - returns data direct. */
-#define READCHAR(address)                                                   \
-       *((volatile unsigned char *)((address) | NONE_CACHEABLE))
-
-#define READSHORT(address)                                                  \
-       *((volatile unsigned short *)((address) | NONE_CACHEABLE))
-
-#define READWORD(address)                                                   \
-       *((volatile unsigned int *)((address) | NONE_CACHEABLE))
-
-/* Those two Macros were defined to be compatible with MIPS */
-#define VIRTUAL_TO_PHY(x)    (((unsigned int)x) & 0xffffffff)
-#define PHY_TO_VIRTUAL(x)    (((unsigned int)x) | NONE_CACHEABLE)
-
-/*  SET_REG_BITS(regOffset,bits) -
-   gets register offset and bits: a 32bit value. It set to logic '1' in the
-   internal register the bits which given as an input example:
-   SET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
-   '1' in register 0x840 while the other bits stays as is. */
-#define SET_REG_BITS(regOffset,bits) \
-       *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR |  \
-       regOffset) |= (unsigned int)WORD_SWAP(bits)
-
-/*  RESET_REG_BITS(regOffset,bits) -
-   gets register offset and bits: a 32bit value. It set to logic '0' in the
-   internal register the bits which given as an input example:
-   RESET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
-   '0' in register 0x840 while the other bits stays as is. */
-#define RESET_REG_BITS(regOffset,bits) \
-       *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR   \
-       | regOffset) &= ~( (unsigned int)WORD_SWAP(bits) )
-
-#endif /* __INCcoreh */
diff --git a/include/galileo/gt64260R.h b/include/galileo/gt64260R.h
deleted file mode 100644 (file)
index b55da9d..0000000
+++ /dev/null
@@ -1,1194 +0,0 @@
-/* gt64260R.h - GT64260 Internal registers definition file */
-
-/* Copyright - Galileo technology. */
-
-#ifndef __INCgt64260rh
-#define __INCgt64260rh
-
-#ifndef GT64260
-#define GT64260
-#endif
-
-/* CPU MASTER CONTROL REGISTER */
-#define        CPU_CONFIGURATION       0x0
-#define        CPU_MASTER_CONTROL      0x160
-
-/****************************************/
-/* Processor Address Space             */
-/****************************************/
-
-/* Sdram's BAR'S */
-#define SCS_0_LOW_DECODE_ADDRESS                       0x008
-#define SCS_0_HIGH_DECODE_ADDRESS                      0x010
-#define SCS_1_LOW_DECODE_ADDRESS                       0x208
-#define SCS_1_HIGH_DECODE_ADDRESS                      0x210
-#define SCS_2_LOW_DECODE_ADDRESS                       0x018
-#define SCS_2_HIGH_DECODE_ADDRESS                      0x020
-#define SCS_3_LOW_DECODE_ADDRESS                       0x218
-#define SCS_3_HIGH_DECODE_ADDRESS                      0x220
-/* Devices BAR'S */
-#define CS_0_LOW_DECODE_ADDRESS                                0x028
-#define CS_0_HIGH_DECODE_ADDRESS                       0x030
-#define CS_1_LOW_DECODE_ADDRESS                                0x228
-#define CS_1_HIGH_DECODE_ADDRESS                       0x230
-#define CS_2_LOW_DECODE_ADDRESS                                0x248
-#define CS_2_HIGH_DECODE_ADDRESS                       0x250
-#define CS_3_LOW_DECODE_ADDRESS                                0x038
-#define CS_3_HIGH_DECODE_ADDRESS                       0x040
-#define BOOTCS_LOW_DECODE_ADDRESS                      0x238
-#define BOOTCS_HIGH_DECODE_ADDRESS                     0x240
-
-#define PCI_0I_O_LOW_DECODE_ADDRESS                    0x048
-#define PCI_0I_O_HIGH_DECODE_ADDRESS                   0x050
-#define PCI_0MEMORY0_LOW_DECODE_ADDRESS                        0x058
-#define PCI_0MEMORY0_HIGH_DECODE_ADDRESS               0x060
-#define PCI_0MEMORY1_LOW_DECODE_ADDRESS                        0x080
-#define PCI_0MEMORY1_HIGH_DECODE_ADDRESS               0x088
-#define PCI_0MEMORY2_LOW_DECODE_ADDRESS                        0x258
-#define PCI_0MEMORY2_HIGH_DECODE_ADDRESS               0x260
-#define PCI_0MEMORY3_LOW_DECODE_ADDRESS                        0x280
-#define PCI_0MEMORY3_HIGH_DECODE_ADDRESS               0x288
-
-#define PCI_1I_O_LOW_DECODE_ADDRESS                    0x090
-#define PCI_1I_O_HIGH_DECODE_ADDRESS                   0x098
-#define PCI_1MEMORY0_LOW_DECODE_ADDRESS                        0x0a0
-#define PCI_1MEMORY0_HIGH_DECODE_ADDRESS               0x0a8
-#define PCI_1MEMORY1_LOW_DECODE_ADDRESS                        0x0b0
-#define PCI_1MEMORY1_HIGH_DECODE_ADDRESS               0x0b8
-#define PCI_1MEMORY2_LOW_DECODE_ADDRESS                        0x2a0
-#define PCI_1MEMORY2_HIGH_DECODE_ADDRESS               0x2a8
-#define PCI_1MEMORY3_LOW_DECODE_ADDRESS                        0x2b0
-#define PCI_1MEMORY3_HIGH_DECODE_ADDRESS               0x2b8
-
-
-#define INTERNAL_SPACE_DECODE                          0x068
-
-#define CPU_0_LOW_DECODE_ADDRESS                       0x290
-#define CPU_0_HIGH_DECODE_ADDRESS                      0x298
-#define CPU_1_LOW_DECODE_ADDRESS                       0x2c0
-#define CPU_1_HIGH_DECODE_ADDRESS                      0x2c8
-
-#define PCI_0I_O_ADDRESS_REMAP                         0x0f0
-#define PCI_0MEMORY0_ADDRESS_REMAP                     0x0f8
-#define PCI_0MEMORY0_HIGH_ADDRESS_REMAP                        0x320
-#define PCI_0MEMORY1_ADDRESS_REMAP                     0x100
-#define PCI_0MEMORY1_HIGH_ADDRESS_REMAP                        0x328
-#define PCI_0MEMORY2_ADDRESS_REMAP                     0x2f8
-#define PCI_0MEMORY2_HIGH_ADDRESS_REMAP                        0x330
-#define PCI_0MEMORY3_ADDRESS_REMAP                     0x300
-#define PCI_0MEMORY3_HIGH_ADDRESS_REMAP                        0x338
-
-#define PCI_1I_O_ADDRESS_REMAP                         0x108
-#define PCI_1MEMORY0_ADDRESS_REMAP                     0x110
-#define PCI_1MEMORY0_HIGH_ADDRESS_REMAP                        0x340
-#define PCI_1MEMORY1_ADDRESS_REMAP                     0x118
-#define PCI_1MEMORY1_HIGH_ADDRESS_REMAP                        0x348
-#define PCI_1MEMORY2_ADDRESS_REMAP                     0x310
-#define PCI_1MEMORY2_HIGH_ADDRESS_REMAP                        0x350
-#define PCI_1MEMORY3_ADDRESS_REMAP                     0x318
-#define PCI_1MEMORY3_HIGH_ADDRESS_REMAP                        0x358
-
-
-/****************************************/
-/* CPU Sync Barrier                    */
-/****************************************/
-
-#define PCI_0SYNC_BARIER_VIRTUAL_REGISTER              0x0c0
-#define PCI_1SYNC_BARIER_VIRTUAL_REGISTER              0x0c8
-
-
-/****************************************/
-/* CPU Access Protect                  */
-/****************************************/
-
-#define CPU_LOW_PROTECT_ADDRESS_0                      0x180
-#define CPU_HIGH_PROTECT_ADDRESS_0                     0x188
-#define CPU_LOW_PROTECT_ADDRESS_1                      0x190
-#define CPU_HIGH_PROTECT_ADDRESS_1                     0x198
-#define CPU_LOW_PROTECT_ADDRESS_2                      0x1a0
-#define CPU_HIGH_PROTECT_ADDRESS_2                     0x1a8
-#define CPU_LOW_PROTECT_ADDRESS_3                      0x1b0
-#define CPU_HIGH_PROTECT_ADDRESS_3                     0x1b8
-#define CPU_LOW_PROTECT_ADDRESS_4                      0x1c0
-#define CPU_HIGH_PROTECT_ADDRESS_4                     0x1c8
-#define CPU_LOW_PROTECT_ADDRESS_5                      0x1d0
-#define CPU_HIGH_PROTECT_ADDRESS_5                     0x1d8
-#define CPU_LOW_PROTECT_ADDRESS_6                      0x1e0
-#define CPU_HIGH_PROTECT_ADDRESS_6                     0x1e8
-#define CPU_LOW_PROTECT_ADDRESS_7                      0x1f0
-#define CPU_HIGH_PROTECT_ADDRESS_7                     0x1f8
-
-
-/****************************************/
-/*         Snoop Control               */
-/****************************************/
-
-#define SNOOP_BASE_ADDRESS_0                           0x380
-#define SNOOP_TOP_ADDRESS_0                            0x388
-#define SNOOP_BASE_ADDRESS_1                           0x390
-#define SNOOP_TOP_ADDRESS_1                            0x398
-#define SNOOP_BASE_ADDRESS_2                           0x3a0
-#define SNOOP_TOP_ADDRESS_2                            0x3a8
-#define SNOOP_BASE_ADDRESS_3                           0x3b0
-#define SNOOP_TOP_ADDRESS_3                            0x3b8
-
-/****************************************/
-/*         CPU Error Report            */
-/****************************************/
-
-#define CPU_ERROR_ADDRESS_LOW                          0x070
-#define CPU_ERROR_ADDRESS_HIGH                         0x078
-#define CPU_ERROR_DATA_LOW                             0x128
-#define CPU_ERROR_DATA_HIGH                            0x130
-#define CPU_ERROR_PARITY                               0x138
-#define CPU_ERROR_CAUSE                                        0x140
-#define CPU_ERROR_MASK                                 0x148
-
-/****************************************/
-/*         Pslave Debug                */
-/****************************************/
-
-#define X_0_ADDRESS                                    0x360
-#define X_0_COMMAND_ID                                 0x368
-#define X_1_ADDRESS                                    0x370
-#define X_1_COMMAND_ID                                 0x378
-#define WRITE_DATA_LOW                                 0x3c0
-#define WRITE_DATA_HIGH                                        0x3c8
-#define WRITE_BYTE_ENABLE                              0x3e0
-#define READ_DATA_LOW                                  0x3d0
-#define READ_DATA_HIGH                                 0x3d8
-#define READ_ID                                                0x3e8
-
-
-/****************************************/
-/* SDRAM and Device Address Space      */
-/****************************************/
-
-
-/****************************************/
-/* SDRAM Configuration                 */
-/****************************************/
-
-
-#define SDRAM_CONFIGURATION                            0x448
-#define SDRAM_OPERATION_MODE                           0x474
-#define SDRAM_ADDRESS_DECODE                           0x47c
-#define SDRAM_UMA_CONTROL                              0x4a4
-#define SDRAM_CROSS_BAR_CONTROL_LOW                    0x4a8
-#define SDRAM_CROSS_BAR_CONTROL_HIGH                   0x4ac
-#define SDRAM_CROSS_BAR_TIMEOUT                                0x4b0
-#define SDRAM_TIMING                                   0x4b4
-
-
-/****************************************/
-/* SDRAM Parameters                    */
-/****************************************/
-
-#define SDRAM_BANK0PARAMETERS                          0x44C
-#define SDRAM_BANK1PARAMETERS                          0x450
-#define SDRAM_BANK2PARAMETERS                          0x454
-#define SDRAM_BANK3PARAMETERS                          0x458
-
-
-/****************************************/
-/* SDRAM Error Report                  */
-/****************************************/
-
-#define SDRAM_ERROR_DATA_LOW                           0x484
-#define SDRAM_ERROR_DATA_HIGH                          0x480
-#define SDRAM_AND_DEVICE_ERROR_ADDRESS                 0x490
-#define SDRAM_RECEIVED_ECC                             0x488
-#define SDRAM_CALCULATED_ECC                           0x48c
-#define SDRAM_ECC_CONTROL                              0x494
-#define SDRAM_ECC_ERROR_COUNTER                                0x498
-
-
-/****************************************/
-/* SDunit Debug (for internal use)     */
-/****************************************/
-
-#define X0_ADDRESS                                     0x500
-#define X0_COMMAND_AND_ID                              0x504
-#define X0_WRITE_DATA_LOW                              0x508
-#define X0_WRITE_DATA_HIGH                             0x50c
-#define X0_WRITE_BYTE_ENABLE                           0x518
-#define X0_READ_DATA_LOW                               0x510
-#define X0_READ_DATA_HIGH                              0x514
-#define X0_READ_ID                                     0x51c
-#define X1_ADDRESS                                     0x520
-#define X1_COMMAND_AND_ID                              0x524
-#define X1_WRITE_DATA_LOW                              0x528
-#define X1_WRITE_DATA_HIGH                             0x52c
-#define X1_WRITE_BYTE_ENABLE                           0x538
-#define X1_READ_DATA_LOW                               0x530
-#define X1_READ_DATA_HIGH                              0x534
-#define X1_READ_ID                                     0x53c
-#define X0_SNOOP_ADDRESS                               0x540
-#define X0_SNOOP_COMMAND                               0x544
-#define X1_SNOOP_ADDRESS                               0x548
-#define X1_SNOOP_COMMAND                               0x54c
-
-
-/****************************************/
-/* Device Parameters                   */
-/****************************************/
-
-#define DEVICE_BANK0PARAMETERS                         0x45c
-#define DEVICE_BANK1PARAMETERS                         0x460
-#define DEVICE_BANK2PARAMETERS                         0x464
-#define DEVICE_BANK3PARAMETERS                         0x468
-#define DEVICE_BOOT_BANK_PARAMETERS                    0x46c
-#define DEVICE_CONTROL                                 0x4c0
-#define DEVICE_CROSS_BAR_CONTROL_LOW                   0x4c8
-#define DEVICE_CROSS_BAR_CONTROL_HIGH                  0x4cc
-#define DEVICE_CROSS_BAR_TIMEOUT                       0x4c4
-
-
-/****************************************/
-/* Device Interrupt                    */
-/****************************************/
-
-#define DEVICE_INTERRUPT_CAUSE                         0x4d0
-#define DEVICE_INTERRUPT_MASK                          0x4d4
-#define DEVICE_ERROR_ADDRESS                           0x4d8
-
-/****************************************/
-/* DMA Record                          */
-/****************************************/
-
-#define CHANNEL0_DMA_BYTE_COUNT                                0x800
-#define CHANNEL1_DMA_BYTE_COUNT                                0x804
-#define CHANNEL2_DMA_BYTE_COUNT                                0x808
-#define CHANNEL3_DMA_BYTE_COUNT                                0x80C
-#define CHANNEL4_DMA_BYTE_COUNT                                0x900
-#define CHANNEL5_DMA_BYTE_COUNT                                0x904
-#define CHANNEL6_DMA_BYTE_COUNT                                0x908
-#define CHANNEL7_DMA_BYTE_COUNT                                0x90C
-#define CHANNEL0_DMA_SOURCE_ADDRESS                    0x810
-#define CHANNEL1_DMA_SOURCE_ADDRESS                    0x814
-#define CHANNEL2_DMA_SOURCE_ADDRESS                    0x818
-#define CHANNEL3_DMA_SOURCE_ADDRESS                    0x81C
-#define CHANNEL4_DMA_SOURCE_ADDRESS                    0x910
-#define CHANNEL5_DMA_SOURCE_ADDRESS                    0x914
-#define CHANNEL6_DMA_SOURCE_ADDRESS                    0x918
-#define CHANNEL7_DMA_SOURCE_ADDRESS                    0x91C
-#define CHANNEL0_DMA_DESTINATION_ADDRESS               0x820
-#define CHANNEL1_DMA_DESTINATION_ADDRESS               0x824
-#define CHANNEL2_DMA_DESTINATION_ADDRESS               0x828
-#define CHANNEL3_DMA_DESTINATION_ADDRESS               0x82C
-#define CHANNEL4_DMA_DESTINATION_ADDRESS               0x920
-#define CHANNEL5_DMA_DESTINATION_ADDRESS               0x924
-#define CHANNEL6_DMA_DESTINATION_ADDRESS               0x928
-#define CHANNEL7_DMA_DESTINATION_ADDRESS               0x92C
-#define CHANNEL0NEXT_RECORD_POINTER                    0x830
-#define CHANNEL1NEXT_RECORD_POINTER                    0x834
-#define CHANNEL2NEXT_RECORD_POINTER                    0x838
-#define CHANNEL3NEXT_RECORD_POINTER                    0x83C
-#define CHANNEL4NEXT_RECORD_POINTER                    0x930
-#define CHANNEL5NEXT_RECORD_POINTER                    0x934
-#define CHANNEL6NEXT_RECORD_POINTER                    0x938
-#define CHANNEL7NEXT_RECORD_POINTER                    0x93C
-#define CHANNEL0CURRENT_DESCRIPTOR_POINTER             0x870
-#define CHANNEL1CURRENT_DESCRIPTOR_POINTER             0x874
-#define CHANNEL2CURRENT_DESCRIPTOR_POINTER             0x878
-#define CHANNEL3CURRENT_DESCRIPTOR_POINTER             0x87C
-#define CHANNEL4CURRENT_DESCRIPTOR_POINTER             0x970
-#define CHANNEL5CURRENT_DESCRIPTOR_POINTER             0x974
-#define CHANNEL6CURRENT_DESCRIPTOR_POINTER             0x978
-#define CHANNEL7CURRENT_DESCRIPTOR_POINTER             0x97C
-#define CHANNEL0_DMA_SOURCE_HIGH_PCI_ADDRESS           0x890
-#define CHANNEL1_DMA_SOURCE_HIGH_PCI_ADDRESS           0x894
-#define CHANNEL2_DMA_SOURCE_HIGH_PCI_ADDRESS           0x898
-#define CHANNEL3_DMA_SOURCE_HIGH_PCI_ADDRESS           0x89c
-#define CHANNEL4_DMA_SOURCE_HIGH_PCI_ADDRESS           0x990
-#define CHANNEL5_DMA_SOURCE_HIGH_PCI_ADDRESS           0x994
-#define CHANNEL6_DMA_SOURCE_HIGH_PCI_ADDRESS           0x998
-#define CHANNEL7_DMA_SOURCE_HIGH_PCI_ADDRESS           0x99c
-#define CHANNEL0_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x8a0
-#define CHANNEL1_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x8a4
-#define CHANNEL2_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x8a8
-#define CHANNEL3_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x8ac
-#define CHANNEL4_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x9a0
-#define CHANNEL5_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x9a4
-#define CHANNEL6_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x9a8
-#define CHANNEL7_DMA_DESTINATION_HIGH_PCI_ADDRESS      0x9ac
-#define CHANNEL0_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x8b0
-#define CHANNEL1_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x8b4
-#define CHANNEL2_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x8b8
-#define CHANNEL3_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x8bc
-#define CHANNEL4_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x9b0
-#define CHANNEL5_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x9b4
-#define CHANNEL6_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x9b8
-#define CHANNEL7_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS  0x9bc
-
-/****************************************/
-/* DMA Channel Control                 */
-/****************************************/
-
-#define CHANNEL0CONTROL                                        0x840
-#define CHANNEL0CONTROL_HIGH                           0x880
-#define CHANNEL1CONTROL                                        0x844
-#define CHANNEL1CONTROL_HIGH                           0x884
-#define CHANNEL2CONTROL                                        0x848
-#define CHANNEL2CONTROL_HIGH                           0x888
-#define CHANNEL3CONTROL                                        0x84C
-#define CHANNEL3CONTROL_HIGH                           0x88C
-
-#define CHANNEL4CONTROL                                        0x940
-#define CHANNEL4CONTROL_HIGH                           0x980
-#define CHANNEL5CONTROL                                        0x944
-#define CHANNEL5CONTROL_HIGH                           0x984
-#define CHANNEL6CONTROL                                        0x948
-#define CHANNEL6CONTROL_HIGH                           0x988
-#define CHANNEL7CONTROL                                        0x94C
-#define CHANNEL7CONTROL_HIGH                           0x98C
-
-
-/****************************************/
-/* DMA Arbiter                         */
-/****************************************/
-
-#define ARBITER_CONTROL_0_3                                                                            0x860
-#define ARBITER_CONTROL_4_7                                                                            0x960
-
-
-/****************************************/
-/* DMA Interrupt                       */
-/****************************************/
-
-#define CHANELS0_3_INTERRUPT_CAUSE                     0x8c0
-#define CHANELS0_3_INTERRUPT_MASK                      0x8c4
-#define CHANELS0_3_ERROR_ADDRESS                       0x8c8
-#define CHANELS0_3_ERROR_SELECT                                0x8cc
-#define CHANELS4_7_INTERRUPT_CAUSE                     0x9c0
-#define CHANELS4_7_INTERRUPT_MASK                      0x9c4
-#define CHANELS4_7_ERROR_ADDRESS                       0x9c8
-#define CHANELS4_7_ERROR_SELECT                                0x9cc
-
-
-/****************************************/
-/* DMA Debug (for internal use)                */
-/****************************************/
-
-#define DMA_X0_ADDRESS                                 0x8e0
-#define DMA_X0_COMMAND_AND_ID                          0x8e4
-#define DMA_X0_WRITE_DATA_LOW                          0x8e8
-#define DMA_X0_WRITE_DATA_HIGH                         0x8ec
-#define DMA_X0_WRITE_BYTE_ENABLE                       0x8f8
-#define DMA_X0_READ_DATA_LOW                           0x8f0
-#define DMA_X0_READ_DATA_HIGH                          0x8f4
-#define DMA_X0_READ_ID                                 0x8fc
-#define DMA_X1_ADDRESS                                 0x9e0
-#define DMA_X1_COMMAND_AND_ID                          0x9e4
-#define DMA_X1_WRITE_DATA_LOW                          0x9e8
-#define DMA_X1_WRITE_DATA_HIGH                         0x9ec
-#define DMA_X1_WRITE_BYTE_ENABLE                       0x9f8
-#define DMA_X1_READ_DATA_LOW                           0x9f0
-#define DMA_X1_READ_DATA_HIGH                          0x9f4
-#define DMA_X1_READ_ID                                 0x9fc
-
-/****************************************/
-/* Timer_Counter                       */
-/****************************************/
-
-#define TIMER_COUNTER0                                 0x850
-#define TIMER_COUNTER1                                 0x854
-#define TIMER_COUNTER2                                 0x858
-#define TIMER_COUNTER3                                 0x85C
-#define TIMER_COUNTER_0_3_CONTROL                      0x864
-#define TIMER_COUNTER_0_3_INTERRUPT_CAUSE              0x868
-#define TIMER_COUNTER_0_3_INTERRUPT_MASK               0x86c
-#define TIMER_COUNTER4                                 0x950
-#define TIMER_COUNTER5                                 0x954
-#define TIMER_COUNTER6                                 0x958
-#define TIMER_COUNTER7                                 0x95C
-#define TIMER_COUNTER_4_7_CONTROL                      0x964
-#define TIMER_COUNTER_4_7_INTERRUPT_CAUSE              0x968
-#define TIMER_COUNTER_4_7_INTERRUPT_MASK               0x96c
-
-/****************************************/
-/* PCI Slave Address Decoding          */
-/****************************************/
-
-#define PCI_0SCS_0_BANK_SIZE                           0xc08
-#define PCI_1SCS_0_BANK_SIZE                           0xc88
-#define PCI_0SCS_1_BANK_SIZE                           0xd08
-#define PCI_1SCS_1_BANK_SIZE                           0xd88
-#define PCI_0SCS_2_BANK_SIZE                           0xc0c
-#define PCI_1SCS_2_BANK_SIZE                           0xc8c
-#define PCI_0SCS_3_BANK_SIZE                           0xd0c
-#define PCI_1SCS_3_BANK_SIZE                           0xd8c
-#define PCI_0CS_0_BANK_SIZE                            0xc10
-#define PCI_1CS_0_BANK_SIZE                            0xc90
-#define PCI_0CS_1_BANK_SIZE                            0xd10
-#define PCI_1CS_1_BANK_SIZE                            0xd90
-#define PCI_0CS_2_BANK_SIZE                            0xd18
-#define PCI_1CS_2_BANK_SIZE                            0xd98
-#define PCI_0CS_3_BANK_SIZE                            0xc14
-#define PCI_1CS_3_BANK_SIZE                            0xc94
-#define PCI_0CS_BOOT_BANK_SIZE                         0xd14
-#define PCI_1CS_BOOT_BANK_SIZE                         0xd94
-#define PCI_0P2P_MEM0_BAR_SIZE                         0xd1c
-#define PCI_1P2P_MEM0_BAR_SIZE                         0xd9c
-#define PCI_0P2P_MEM1_BAR_SIZE                         0xd20
-#define PCI_1P2P_MEM1_BAR_SIZE                         0xda0
-#define PCI_0P2P_I_O_BAR_SIZE                          0xd24
-#define PCI_1P2P_I_O_BAR_SIZE                          0xda4
-#define PCI_0CPU_BAR_SIZE                              0xd28
-#define PCI_1CPU_BAR_SIZE                              0xda8
-#define PCI_0DAC_SCS_0_BANK_SIZE                       0xe00
-#define PCI_1DAC_SCS_0_BANK_SIZE                       0xe80
-#define PCI_0DAC_SCS_1_BANK_SIZE                       0xe04
-#define PCI_1DAC_SCS_1_BANK_SIZE                       0xe84
-#define PCI_0DAC_SCS_2_BANK_SIZE                       0xe08
-#define PCI_1DAC_SCS_2_BANK_SIZE                       0xe88
-#define PCI_0DAC_SCS_3_BANK_SIZE                       0xe0c
-#define PCI_1DAC_SCS_3_BANK_SIZE                       0xe8c
-#define PCI_0DAC_CS_0_BANK_SIZE                                0xe10
-#define PCI_1DAC_CS_0_BANK_SIZE                                0xe90
-#define PCI_0DAC_CS_1_BANK_SIZE                                0xe14
-#define PCI_1DAC_CS_1_BANK_SIZE                                0xe94
-#define PCI_0DAC_CS_2_BANK_SIZE                                0xe18
-#define PCI_1DAC_CS_2_BANK_SIZE                                0xe98
-#define PCI_0DAC_CS_3_BANK_SIZE                                0xe1c
-#define PCI_1DAC_CS_3_BANK_SIZE                                0xe9c
-#define PCI_0DAC_BOOTCS_BANK_SIZE                      0xe20
-#define PCI_1DAC_BOOTCS_BANK_SIZE                      0xea0
-#define PCI_0DAC_P2P_MEM0_BAR_SIZE                     0xe24
-#define PCI_1DAC_P2P_MEM0_BAR_SIZE                     0xea4
-#define PCI_0DAC_P2P_MEM1_BAR_SIZE                     0xe28
-#define PCI_1DAC_P2P_MEM1_BAR_SIZE                     0xea8
-#define PCI_0DAC_CPU_BAR_SIZE                          0xe2c
-#define PCI_1DAC_CPU_BAR_SIZE                          0xeac
-#define PCI_0EXPANSION_ROM_BAR_SIZE                    0xd2c
-#define PCI_1EXPANSION_ROM_BAR_SIZE                    0xdac
-#define PCI_0BASE_ADDRESS_REGISTERS_ENABLE             0xc3c
-#define PCI_1BASE_ADDRESS_REGISTERS_ENABLE             0xcbc
-#define PCI_0SCS_0_BASE_ADDRESS_REMAP                  0xc48
-#define PCI_1SCS_0_BASE_ADDRESS_REMAP                  0xcc8
-#define PCI_0SCS_1_BASE_ADDRESS_REMAP                  0xd48
-#define PCI_1SCS_1_BASE_ADDRESS_REMAP                  0xdc8
-#define PCI_0SCS_2_BASE_ADDRESS_REMAP                  0xc4c
-#define PCI_1SCS_2_BASE_ADDRESS_REMAP                  0xccc
-#define PCI_0SCS_3_BASE_ADDRESS_REMAP                  0xd4c
-#define PCI_1SCS_3_BASE_ADDRESS_REMAP                  0xdcc
-#define PCI_0CS_0_BASE_ADDRESS_REMAP                   0xc50
-#define PCI_1CS_0_BASE_ADDRESS_REMAP                   0xcd0
-#define PCI_0CS_1_BASE_ADDRESS_REMAP                   0xd50
-#define PCI_1CS_1_BASE_ADDRESS_REMAP                   0xdd0
-#define PCI_0CS_2_BASE_ADDRESS_REMAP                   0xd58
-#define PCI_1CS_2_BASE_ADDRESS_REMAP                   0xdd8
-#define PCI_0CS_3_BASE_ADDRESS_REMAP                   0xc54
-#define PCI_1CS_3_BASE_ADDRESS_REMAP                   0xcd4
-#define PCI_0CS_BOOTCS_BASE_ADDRESS_REMAP              0xd54
-#define PCI_1CS_BOOTCS_BASE_ADDRESS_REMAP              0xdd4
-#define PCI_0P2P_MEM0_BASE_ADDRESS_REMAP_LOW           0xd5c
-#define PCI_1P2P_MEM0_BASE_ADDRESS_REMAP_LOW           0xddc
-#define PCI_0P2P_MEM0_BASE_ADDRESS_REMAP_HIGH          0xd60
-#define PCI_1P2P_MEM0_BASE_ADDRESS_REMAP_HIGH          0xde0
-#define PCI_0P2P_MEM1_BASE_ADDRESS_REMAP_LOW           0xd64
-#define PCI_1P2P_MEM1_BASE_ADDRESS_REMAP_LOW           0xde4
-#define PCI_0P2P_MEM1_BASE_ADDRESS_REMAP_HIGH          0xd68
-#define PCI_1P2P_MEM1_BASE_ADDRESS_REMAP_HIGH          0xde8
-#define PCI_0P2P_I_O_BASE_ADDRESS_REMAP                        0xd6c
-#define PCI_1P2P_I_O_BASE_ADDRESS_REMAP                        0xdec
-#define PCI_0CPU_BASE_ADDRESS_REMAP                    0xd70
-#define PCI_1CPU_BASE_ADDRESS_REMAP                    0xdf0
-#define PCI_0DAC_SCS_0_BASE_ADDRESS_REMAP              0xf00
-#define PCI_1DAC_SCS_0_BASE_ADDRESS_REMAP              0xff0
-#define PCI_0DAC_SCS_1_BASE_ADDRESS_REMAP              0xf04
-#define PCI_1DAC_SCS_1_BASE_ADDRESS_REMAP              0xf84
-#define PCI_0DAC_SCS_2_BASE_ADDRESS_REMAP              0xf08
-#define PCI_1DAC_SCS_2_BASE_ADDRESS_REMAP              0xf88
-#define PCI_0DAC_SCS_3_BASE_ADDRESS_REMAP              0xf0c
-#define PCI_1DAC_SCS_3_BASE_ADDRESS_REMAP              0xf8c
-#define PCI_0DAC_CS_0_BASE_ADDRESS_REMAP               0xf10
-#define PCI_1DAC_CS_0_BASE_ADDRESS_REMAP               0xf90
-#define PCI_0DAC_CS_1_BASE_ADDRESS_REMAP               0xf14
-#define PCI_1DAC_CS_1_BASE_ADDRESS_REMAP               0xf94
-#define PCI_0DAC_CS_2_BASE_ADDRESS_REMAP               0xf18
-#define PCI_1DAC_CS_2_BASE_ADDRESS_REMAP               0xf98
-#define PCI_0DAC_CS_3_BASE_ADDRESS_REMAP               0xf1c
-#define PCI_1DAC_CS_3_BASE_ADDRESS_REMAP               0xf9c
-#define PCI_0DAC_BOOTCS_BASE_ADDRESS_REMAP             0xf20
-#define PCI_1DAC_BOOTCS_BASE_ADDRESS_REMAP             0xfa0
-#define PCI_0DAC_P2P_MEM0_BASE_ADDRESS_REMAP_LOW       0xf24
-#define PCI_1DAC_P2P_MEM0_BASE_ADDRESS_REMAP_LOW       0xfa4
-#define PCI_0DAC_P2P_MEM0_BASE_ADDRESS_REMAP_HIGH      0xf28
-#define PCI_1DAC_P2P_MEM0_BASE_ADDRESS_REMAP_HIGH      0xfa8
-#define PCI_0DAC_P2P_MEM1_BASE_ADDRESS_REMAP_LOW       0xf2c
-#define PCI_1DAC_P2P_MEM1_BASE_ADDRESS_REMAP_LOW       0xfac
-#define PCI_0DAC_P2P_MEM1_BASE_ADDRESS_REMAP_HIGH      0xf30
-#define PCI_1DAC_P2P_MEM1_BASE_ADDRESS_REMAP_HIGH      0xfb0
-#define PCI_0DAC_CPU_BASE_ADDRESS_REMAP                        0xf34
-#define PCI_1DAC_CPU_BASE_ADDRESS_REMAP                        0xfb4
-#define PCI_0EXPANSION_ROM_BASE_ADDRESS_REMAP          0xf38
-#define PCI_1EXPANSION_ROM_BASE_ADDRESS_REMAP          0xfb8
-#define PCI_0ADDRESS_DECODE_CONTROL                    0xd3c
-#define PCI_1ADDRESS_DECODE_CONTROL                    0xdbc
-
-/****************************************/
-/* PCI Control                         */
-/****************************************/
-
-#define PCI_0COMMAND                                   0xc00
-#define PCI_1COMMAND                                   0xc80
-#define PCI_0MODE                                      0xd00
-#define PCI_1MODE                                      0xd80
-#define PCI_0TIMEOUT_RETRY                             0xc04
-#define PCI_1TIMEOUT_RETRY                             0xc84
-#define PCI_0READ_BUFFER_DISCARD_TIMER                 0xd04
-#define PCI_1READ_BUFFER_DISCARD_TIMER                 0xd84
-#define MSI_0TRIGGER_TIMER                             0xc38
-#define MSI_1TRIGGER_TIMER                             0xcb8
-#define PCI_0ARBITER_CONTROL                           0x1d00
-#define PCI_1ARBITER_CONTROL                           0x1d80
-/* changing untill here */
-#define PCI_0CROSS_BAR_CONTROL_LOW                     0x1d08
-#define PCI_0CROSS_BAR_CONTROL_HIGH                    0x1d0c
-#define PCI_0CROSS_BAR_TIMEOUT                         0x1d04
-#define PCI_0READ_RESPONSE_CROSS_BAR_CONTROL_LOW       0x1d18
-#define PCI_0READ_RESPONSE_CROSS_BAR_CONTROL_HIGH      0x1d1c
-#define PCI_0SYNC_BARRIER_VIRTUAL_REGISTER             0x1d10
-#define PCI_0P2P_CONFIGURATION                         0x1d14
-#define PCI_0ACCESS_CONTROL_BASE_0_LOW                 0x1e00
-#define PCI_0ACCESS_CONTROL_BASE_0_HIGH                        0x1e04
-#define PCI_0ACCESS_CONTROL_TOP_0                      0x1e08
-#define PCI_0ACCESS_CONTROL_BASE_1_LOW                 0x1e10
-#define PCI_0ACCESS_CONTROL_BASE_1_HIGH                        0x1e14
-#define PCI_0ACCESS_CONTROL_TOP_1                      0x1e18
-#define PCI_0ACCESS_CONTROL_BASE_2_LOW                 0x1e20
-#define PCI_0ACCESS_CONTROL_BASE_2_HIGH                        0x1e24
-#define PCI_0ACCESS_CONTROL_TOP_2                      0x1e28
-#define PCI_0ACCESS_CONTROL_BASE_3_LOW                 0x1e30
-#define PCI_0ACCESS_CONTROL_BASE_3_HIGH                        0x1e34
-#define PCI_0ACCESS_CONTROL_TOP_3                      0x1e38
-#define PCI_0ACCESS_CONTROL_BASE_4_LOW                 0x1e40
-#define PCI_0ACCESS_CONTROL_BASE_4_HIGH                        0x1e44
-#define PCI_0ACCESS_CONTROL_TOP_4                      0x1e48
-#define PCI_0ACCESS_CONTROL_BASE_5_LOW                 0x1e50
-#define PCI_0ACCESS_CONTROL_BASE_5_HIGH                        0x1e54
-#define PCI_0ACCESS_CONTROL_TOP_5                      0x1e58
-#define PCI_0ACCESS_CONTROL_BASE_6_LOW                 0x1e60
-#define PCI_0ACCESS_CONTROL_BASE_6_HIGH                        0x1e64
-#define PCI_0ACCESS_CONTROL_TOP_6                      0x1e68
-#define PCI_0ACCESS_CONTROL_BASE_7_LOW                 0x1e70
-#define PCI_0ACCESS_CONTROL_BASE_7_HIGH                        0x1e74
-#define PCI_0ACCESS_CONTROL_TOP_7                      0x1e78
-#define PCI_1CROSS_BAR_CONTROL_LOW                     0x1d88
-#define PCI_1CROSS_BAR_CONTROL_HIGH                    0x1d8c
-#define PCI_1CROSS_BAR_TIMEOUT                         0x1d84
-#define PCI_1READ_RESPONSE_CROSS_BAR_CONTROL_LOW       0x1d98
-#define PCI_1READ_RESPONSE_CROSS_BAR_CONTROL_HIGH      0x1d9c
-#define PCI_1SYNC_BARRIER_VIRTUAL_REGISTER             0x1d90
-#define PCI_1P2P_CONFIGURATION                         0x1d94
-#define PCI_1ACCESS_CONTROL_BASE_0_LOW                 0x1e80
-#define PCI_1ACCESS_CONTROL_BASE_0_HIGH                        0x1e84
-#define PCI_1ACCESS_CONTROL_TOP_0                      0x1e88
-#define PCI_1ACCESS_CONTROL_BASE_1_LOW                 0x1e90
-#define PCI_1ACCESS_CONTROL_BASE_1_HIGH                        0x1e94
-#define PCI_1ACCESS_CONTROL_TOP_1                      0x1e98
-#define PCI_1ACCESS_CONTROL_BASE_2_LOW                 0x1ea0
-#define PCI_1ACCESS_CONTROL_BASE_2_HIGH                        0x1ea4
-#define PCI_1ACCESS_CONTROL_TOP_2                      0x1ea8
-#define PCI_1ACCESS_CONTROL_BASE_3_LOW                 0x1eb0
-#define PCI_1ACCESS_CONTROL_BASE_3_HIGH                        0x1eb4
-#define PCI_1ACCESS_CONTROL_TOP_3                      0x1eb8
-#define PCI_1ACCESS_CONTROL_BASE_4_LOW                 0x1ec0
-#define PCI_1ACCESS_CONTROL_BASE_4_HIGH                        0x1ec4
-#define PCI_1ACCESS_CONTROL_TOP_4                      0x1ec8
-#define PCI_1ACCESS_CONTROL_BASE_5_LOW                 0x1ed0
-#define PCI_1ACCESS_CONTROL_BASE_5_HIGH                        0x1ed4
-#define PCI_1ACCESS_CONTROL_TOP_5                      0x1ed8
-#define PCI_1ACCESS_CONTROL_BASE_6_LOW                 0x1ee0
-#define PCI_1ACCESS_CONTROL_BASE_6_HIGH                        0x1ee4
-#define PCI_1ACCESS_CONTROL_TOP_6                      0x1ee8
-#define PCI_1ACCESS_CONTROL_BASE_7_LOW                 0x1ef0
-#define PCI_1ACCESS_CONTROL_BASE_7_HIGH                        0x1ef4
-#define PCI_1ACCESS_CONTROL_TOP_7                      0x1ef8
-
-/****************************************/
-/* PCI Snoop Control                   */
-/****************************************/
-
-#define PCI_0SNOOP_CONTROL_BASE_0_LOW                  0x1f00
-#define PCI_0SNOOP_CONTROL_BASE_0_HIGH                 0x1f04
-#define PCI_0SNOOP_CONTROL_TOP_0                       0x1f08
-#define PCI_0SNOOP_CONTROL_BASE_1_0_LOW                        0x1f10
-#define PCI_0SNOOP_CONTROL_BASE_1_0_HIGH               0x1f14
-#define PCI_0SNOOP_CONTROL_TOP_1                       0x1f18
-#define PCI_0SNOOP_CONTROL_BASE_2_0_LOW                        0x1f20
-#define PCI_0SNOOP_CONTROL_BASE_2_0_HIGH               0x1f24
-#define PCI_0SNOOP_CONTROL_TOP_2                       0x1f28
-#define PCI_0SNOOP_CONTROL_BASE_3_0_LOW                        0x1f30
-#define PCI_0SNOOP_CONTROL_BASE_3_0_HIGH               0x1f34
-#define PCI_0SNOOP_CONTROL_TOP_3                       0x1f38
-#define PCI_1SNOOP_CONTROL_BASE_0_LOW                  0x1f80
-#define PCI_1SNOOP_CONTROL_BASE_0_HIGH                 0x1f84
-#define PCI_1SNOOP_CONTROL_TOP_0                       0x1f88
-#define PCI_1SNOOP_CONTROL_BASE_1_0_LOW                        0x1f90
-#define PCI_1SNOOP_CONTROL_BASE_1_0_HIGH               0x1f94
-#define PCI_1SNOOP_CONTROL_TOP_1                       0x1f98
-#define PCI_1SNOOP_CONTROL_BASE_2_0_LOW                        0x1fa0
-#define PCI_1SNOOP_CONTROL_BASE_2_0_HIGH               0x1fa4
-#define PCI_1SNOOP_CONTROL_TOP_2                       0x1fa8
-#define PCI_1SNOOP_CONTROL_BASE_3_0_LOW                        0x1fb0
-#define PCI_1SNOOP_CONTROL_BASE_3_0_HIGH               0x1fb4
-#define PCI_1SNOOP_CONTROL_TOP_3                       0x1fb8
-
-/****************************************/
-/* PCI Configuration Address           */
-/****************************************/
-
-#define PCI_0CONFIGURATION_ADDRESS                     0xcf8
-#define PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER       0xcfc
-#define PCI_1CONFIGURATION_ADDRESS                     0xc78
-#define PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER       0xc7c
-#define PCI_0INTERRUPT_ACKNOWLEDGE_VIRTUAL_REGISTER    0xc34
-#define PCI_1INTERRUPT_ACKNOWLEDGE_VIRTUAL_REGISTER    0xcb4
-
-/****************************************/
-/* PCI Error Report                    */
-/****************************************/
-
-#define PCI_0SERR_MASK                                                                          0xc28
-#define PCI_0ERROR_ADDRESS_LOW                         0x1d40
-#define PCI_0ERROR_ADDRESS_HIGH                                0x1d44
-#define PCI_0ERROR_DATA_LOW                            0x1d48
-#define PCI_0ERROR_DATA_HIGH                           0x1d4c
-#define PCI_0ERROR_COMMAND                             0x1d50
-#define PCI_0ERROR_CAUSE                               0x1d58
-#define PCI_0ERROR_MASK                                        0x1d5c
-#define PCI_1SERR_MASK                                                                          0xca8
-#define PCI_1ERROR_ADDRESS_LOW                         0x1dc0
-#define PCI_1ERROR_ADDRESS_HIGH                                0x1dc4
-#define PCI_1ERROR_DATA_LOW                            0x1dc8
-#define PCI_1ERROR_DATA_HIGH                           0x1dcc
-#define PCI_1ERROR_COMMAND                             0x1dd0
-#define PCI_1ERROR_CAUSE                               0x1dd8
-#define PCI_1ERROR_MASK                                        0x1ddc
-
-
-/****************************************/
-/* Lslave Debug  (for internal use)    */
-/****************************************/
-
-#define L_SLAVE_X0_ADDRESS                             0x1d20
-#define L_SLAVE_X0_COMMAND_AND_ID                      0x1d24
-#define L_SLAVE_X1_ADDRESS                             0x1d28
-#define L_SLAVE_X1_COMMAND_AND_ID                      0x1d2c
-#define L_SLAVE_WRITE_DATA_LOW                         0x1d30
-#define L_SLAVE_WRITE_DATA_HIGH                                0x1d34
-#define L_SLAVE_WRITE_BYTE_ENABLE                      0x1d60
-#define L_SLAVE_READ_DATA_LOW                          0x1d38
-#define L_SLAVE_READ_DATA_HIGH                         0x1d3c
-#define L_SLAVE_READ_ID                                        0x1d64
-
-/****************************************/
-/* PCI Configuration Function 0                */
-/****************************************/
-
-#define PCI_DEVICE_AND_VENDOR_ID                       0x000
-#define PCI_STATUS_AND_COMMAND                         0x004
-#define PCI_CLASS_CODE_AND_REVISION_ID                 0x008
-#define PCI_BIST_HEADER_TYPE_LATENCY_TIMER_CACHE_LINE  0x00C
-#define PCI_SCS_0_BASE_ADDRESS                         0x010
-#define PCI_SCS_1_BASE_ADDRESS                         0x014
-#define PCI_SCS_2_BASE_ADDRESS                         0x018
-#define PCI_SCS_3_BASE_ADDRESS                         0x01C
-#define PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS  0x020
-#define PCI_INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS  0x024
-#define PCI_SUBSYSTEM_ID_AND_SUBSYSTEM_VENDOR_ID       0x02C
-#define PCI_EXPANSION_ROM_BASE_ADDRESS_REGISTER                0x030
-#define PCI_CAPABILTY_LIST_POINTER                     0x034
-#define PCI_INTERRUPT_PIN_AND_LINE                     0x03C
-#define PCI_POWER_MANAGEMENT_CAPABILITY                        0x040
-#define PCI_POWER_MANAGEMENT_STATUS_AND_CONTROL                0x044
-#define PCI_VPD_ADDRESS                                        0x048
-#define PCI_VPD_DATA                                   0x04c
-#define PCI_MSI_MESSAGE_CONTROL                                0x050
-#define PCI_MSI_MESSAGE_ADDRESS                                0x054
-#define PCI_MSI_MESSAGE_UPPER_ADDRESS                  0x058
-#define PCI_MSI_MESSAGE_DATA                           0x05c
-#define PCI_COMPACT_PCI_HOT_SWAP_CAPABILITY            0x058
-
-/****************************************/
-/* PCI Configuration Function 1                */
-/****************************************/
-
-#define PCI_CS_0_BASE_ADDRESS                          0x110
-#define PCI_CS_1_BASE_ADDRESS                          0x114
-#define PCI_CS_2_BASE_ADDRESS                          0x118
-#define PCI_CS_3_BASE_ADDRESS                          0x11c
-#define PCI_BOOTCS_BASE_ADDRESS                                0x120
-
-/****************************************/
-/* PCI Configuration Function 2                */
-/****************************************/
-
-#define PCI_P2P_MEM0_BASE_ADDRESS                      0x210
-#define PCI_P2P_MEM1_BASE_ADDRESS                      0x214
-#define PCI_P2P_I_O_BASE_ADDRESS                       0x218
-#define PCI_CPU_BASE_ADDRESS                           0x21c
-
-/****************************************/
-/* PCI Configuration Function 4                */
-/****************************************/
-
-#define PCI_DAC_SCS_0_BASE_ADDRESS_LOW                 0x410
-#define PCI_DAC_SCS_0_BASE_ADDRESS_HIGH                        0x414
-#define PCI_DAC_SCS_1_BASE_ADDRESS_LOW                 0x418
-#define PCI_DAC_SCS_1_BASE_ADDRESS_HIGH                        0x41c
-#define PCI_DAC_P2P_MEM0_BASE_ADDRESS_LOW              0x420
-#define PCI_DAC_P2P_MEM0_BASE_ADDRESS_HIGH             0x424
-
-
-/****************************************/
-/* PCI Configuration Function 5                */
-/****************************************/
-
-#define PCI_DAC_SCS_2_BASE_ADDRESS_LOW                 0x510
-#define PCI_DAC_SCS_2_BASE_ADDRESS_HIGH                        0x514
-#define PCI_DAC_SCS_3_BASE_ADDRESS_LOW                 0x518
-#define PCI_DAC_SCS_3_BASE_ADDRESS_HIGH                        0x51c
-#define PCI_DAC_P2P_MEM1_BASE_ADDRESS_LOW              0x520
-#define PCI_DAC_P2P_MEM1_BASE_ADDRESS_HIGH             0x524
-
-
-/****************************************/
-/* PCI Configuration Function 6                */
-/****************************************/
-
-#define PCI_DAC_CS_0_BASE_ADDRESS_LOW                  0x610
-#define PCI_DAC_CS_0_BASE_ADDRESS_HIGH                 0x614
-#define PCI_DAC_CS_1_BASE_ADDRESS_LOW                  0x618
-#define PCI_DAC_CS_1_BASE_ADDRESS_HIGH                 0x61c
-#define PCI_DAC_CS_2_BASE_ADDRESS_LOW                  0x620
-#define PCI_DAC_CS_2_BASE_ADDRESS_HIGH                 0x624
-
-/****************************************/
-/* PCI Configuration Function 7                */
-/****************************************/
-
-#define PCI_DAC_CS_3_BASE_ADDRESS_LOW                  0x710
-#define PCI_DAC_CS_3_BASE_ADDRESS_HIGH                 0x714
-#define PCI_DAC_BOOTCS_BASE_ADDRESS_LOW                        0x718
-#define PCI_DAC_BOOTCS_BASE_ADDRESS_HIGH               0x71c
-#define PCI_DAC_CPU_BASE_ADDRESS_LOW                   0x720
-#define PCI_DAC_CPU_BASE_ADDRESS_HIGH                  0x724
-
-/****************************************/
-/* Interrupts                          */
-/****************************************/
-
-#define LOW_INTERRUPT_CAUSE_REGISTER                   0xc18
-#define HIGH_INTERRUPT_CAUSE_REGISTER                  0xc68
-#define CPU_INTERRUPT_MASK_REGISTER_LOW                        0xc1c
-#define CPU_INTERRUPT_MASK_REGISTER_HIGH               0xc6c
-#define CPU_SELECT_CAUSE_REGISTER                      0xc70
-#define PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW         0xc24
-#define PCI_0INTERRUPT_CAUSE_MASK_REGISTER_HIGH                0xc64
-#define PCI_0SELECT_CAUSE                              0xc74
-#define PCI_1INTERRUPT_CAUSE_MASK_REGISTER_LOW         0xca4
-#define PCI_1INTERRUPT_CAUSE_MASK_REGISTER_HIGH                0xce4
-#define PCI_1SELECT_CAUSE                              0xcf4
-#define CPU_INT_0_MASK                                 0xe60
-#define CPU_INT_1_MASK                                 0xe64
-#define CPU_INT_2_MASK                                 0xe68
-#define CPU_INT_3_MASK                                 0xe6c
-
-/****************************************/
-/* I20 Support registers               */
-/****************************************/
-
-#define INBOUND_MESSAGE_REGISTER0_PCI_SIDE             0x010
-#define INBOUND_MESSAGE_REGISTER1_PCI_SIDE             0x014
-#define OUTBOUND_MESSAGE_REGISTER0_PCI_SIDE            0x018
-#define OUTBOUND_MESSAGE_REGISTER1_PCI_SIDE            0x01C
-#define INBOUND_DOORBELL_REGISTER_PCI_SIDE             0x020
-#define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE      0x024
-#define INBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE       0x028
-#define OUTBOUND_DOORBELL_REGISTER_PCI_SIDE            0x02C
-#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE     0x030
-#define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE      0x034
-#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE   0x040
-#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE  0x044
-#define QUEUE_CONTROL_REGISTER_PCI_SIDE                        0x050
-#define QUEUE_BASE_ADDRESS_REGISTER_PCI_SIDE           0x054
-#define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE    0x060
-#define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE    0x064
-#define INBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE    0x068
-#define INBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE    0x06C
-#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE   0x070
-#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE   0x074
-#define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE   0x078
-#define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE   0x07C
-
-#define INBOUND_MESSAGE_REGISTER0_CPU_SIDE             0x1C10
-#define INBOUND_MESSAGE_REGISTER1_CPU_SIDE             0x1C14
-#define OUTBOUND_MESSAGE_REGISTER0_CPU_SIDE            0x1C18
-#define OUTBOUND_MESSAGE_REGISTER1_CPU_SIDE            0x1C1C
-#define INBOUND_DOORBELL_REGISTER_CPU_SIDE             0x1C20
-#define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE      0x1C24
-#define INBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE       0x1C28
-#define OUTBOUND_DOORBELL_REGISTER_CPU_SIDE            0x1C2C
-#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE     0x1C30
-#define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE      0x1C34
-#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE   0x1C40
-#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE  0x1C44
-#define QUEUE_CONTROL_REGISTER_CPU_SIDE                        0x1C50
-#define QUEUE_BASE_ADDRESS_REGISTER_CPU_SIDE           0x1C54
-#define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE    0x1C60
-#define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE    0x1C64
-#define INBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE    0x1C68
-#define INBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE    0x1C6C
-#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE   0x1C70
-#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE   0x1C74
-#define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE   0x1C78
-#define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE   0x1C7C
-
-/****************************************/
-/* Communication Unit Registers                */
-/****************************************/
-
-#define ETHERNET_0_ADDRESS_CONTROL_LOW                 0xf200
-#define ETHERNET_0_ADDRESS_CONTROL_HIGH                        0xf204
-#define ETHERNET_0_RECEIVE_BUFFER_PCI_HIGH_ADDRESS     0xf208
-#define ETHERNET_0_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS    0xf20c
-#define ETHERNET_0_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf210
-#define ETHERNET_0_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf214
-#define ETHERNET_0_HASH_TABLE_PCI_HIGH_ADDRESS         0xf218
-#define ETHERNET_1_ADDRESS_CONTROL_LOW                 0xf220
-#define ETHERNET_1_ADDRESS_CONTROL_HIGH                        0xf224
-#define ETHERNET_1_RECEIVE_BUFFER_PCI_HIGH_ADDRESS     0xf228
-#define ETHERNET_1_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS    0xf22c
-#define ETHERNET_1_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf230
-#define ETHERNET_1_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf234
-#define ETHERNET_1_HASH_TABLE_PCI_HIGH_ADDRESS         0xf238
-#define ETHERNET_2_ADDRESS_CONTROL_LOW                 0xf240
-#define ETHERNET_2_ADDRESS_CONTROL_HIGH                        0xf244
-#define ETHERNET_2_RECEIVE_BUFFER_PCI_HIGH_ADDRESS     0xf248
-#define ETHERNET_2_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS    0xf24c
-#define ETHERNET_2_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf250
-#define ETHERNET_2_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf254
-#define ETHERNET_2_HASH_TABLE_PCI_HIGH_ADDRESS         0xf258
-#define MPSC_0_ADDRESS_CONTROL_LOW                     0xf280
-#define MPSC_0_ADDRESS_CONTROL_HIGH                    0xf284
-#define MPSC_0_RECEIVE_BUFFER_PCI_HIGH_ADDRESS         0xf288
-#define MPSC_0_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS                0xf28c
-#define MPSC_0_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS     0xf290
-#define MPSC_0_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS    0xf294
-#define MPSC_1_ADDRESS_CONTROL_LOW                     0xf2c0
-#define MPSC_1_ADDRESS_CONTROL_HIGH                    0xf2c4
-#define MPSC_1_RECEIVE_BUFFER_PCI_HIGH_ADDRESS         0xf2c8
-#define MPSC_1_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS                0xf2cc
-#define MPSC_1_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS     0xf2d0
-#define MPSC_1_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS    0xf2d4
-#define SERIAL_INIT_PCI_HIGH_ADDRESS                   0xf320
-#define SERIAL_INIT_LAST_DATA                          0xf324
-#define SERIAL_INIT_STATUS_AND_CONTROL                 0xf328
-#define COMM_UNIT_ARBITER_CONTROL                      0xf300
-#define COMM_UNIT_CROSS_BAR_TIMEOUT                    0xf304
-#define COMM_UNIT_INTERRUPT_CAUSE                      0xf310
-#define COMM_UNIT_INTERRUPT_MASK                       0xf314
-#define COMM_UNIT_ERROR_ADDRESS                                0xf314
-
-/****************************************/
-/* Cunit Debug (for internal use)     */
-/****************************************/
-
-#define CUNIT_ADDRESS                                  0xf340
-#define CUNIT_COMMAND_AND_ID                           0xf344
-#define CUNIT_WRITE_DATA_LOW                           0xf348
-#define CUNIT_WRITE_DATA_HIGH                          0xf34c
-#define CUNIT_WRITE_BYTE_ENABLE                                0xf358
-#define CUNIT_READ_DATA_LOW                            0xf350
-#define CUNIT_READ_DATA_HIGH                           0xf354
-#define CUNIT_READ_ID                                  0xf35c
-
-/****************************************/
-/* Fast Ethernet Unit Registers                */
-/****************************************/
-
-/* Ethernet */
-
-#define ETHERNET_PHY_ADDRESS_REGISTER                  0x2000
-#define ETHERNET_SMI_REGISTER                          0x2010
-
-/* Ethernet 0 */
-
-#define ETHERNET0_PORT_CONFIGURATION_REGISTER          0x2400
-#define ETHERNET0_PORT_CONFIGURATION_EXTEND_REGISTER   0x2408
-#define ETHERNET0_PORT_COMMAND_REGISTER                        0x2410
-#define ETHERNET0_PORT_STATUS_REGISTER                 0x2418
-#define ETHERNET0_SERIAL_PARAMETRS_REGISTER            0x2420
-#define ETHERNET0_HASH_TABLE_POINTER_REGISTER          0x2428
-#define ETHERNET0_FLOW_CONTROL_SOURCE_ADDRESS_LOW      0x2430
-#define ETHERNET0_FLOW_CONTROL_SOURCE_ADDRESS_HIGH     0x2438
-#define ETHERNET0_SDMA_CONFIGURATION_REGISTER          0x2440
-#define ETHERNET0_SDMA_COMMAND_REGISTER                        0x2448
-#define ETHERNET0_INTERRUPT_CAUSE_REGISTER             0x2450
-#define ETHERNET0_INTERRUPT_MASK_REGISTER              0x2458
-#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER0         0x2480
-#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER1         0x2484
-#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER2         0x2488
-#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER3         0x248c
-#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER0       0x24a0
-#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER1       0x24a4
-#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER2       0x24a8
-#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER3       0x24ac
-#define ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER0       0x24e0
-#define ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER1       0x24e4
-#define ETHERNET0_MIB_COUNTER_BASE                     0x2500
-
-/* Ethernet 1 */
-
-#define ETHERNET1_PORT_CONFIGURATION_REGISTER          0x2800
-#define ETHERNET1_PORT_CONFIGURATION_EXTEND_REGISTER   0x2808
-#define ETHERNET1_PORT_COMMAND_REGISTER                        0x2810
-#define ETHERNET1_PORT_STATUS_REGISTER                 0x2818
-#define ETHERNET1_SERIAL_PARAMETRS_REGISTER            0x2820
-#define ETHERNET1_HASH_TABLE_POINTER_REGISTER          0x2828
-#define ETHERNET1_FLOW_CONTROL_SOURCE_ADDRESS_LOW      0x2830
-#define ETHERNET1_FLOW_CONTROL_SOURCE_ADDRESS_HIGH     0x2838
-#define ETHERNET1_SDMA_CONFIGURATION_REGISTER          0x2840
-#define ETHERNET1_SDMA_COMMAND_REGISTER                        0x2848
-#define ETHERNET1_INTERRUPT_CAUSE_REGISTER             0x2850
-#define ETHERNET1_INTERRUPT_MASK_REGISTER              0x2858
-#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER0         0x2880
-#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER1         0x2884
-#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER2         0x2888
-#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER3         0x288c
-#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER0       0x28a0
-#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER1       0x28a4
-#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER2       0x28a8
-#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER3       0x28ac
-#define ETHERNET1_CURRENT_TX_DESCRIPTOR_POINTER0       0x28e0
-#define ETHERNET1_CURRENT_TX_DESCRIPTOR_POINTER1       0x28e4
-#define ETHERNET1_MIB_COUNTER_BASE                     0x2900
-
-/* Ethernet 2 */
-
-#define ETHERNET2_PORT_CONFIGURATION_REGISTER          0x2c00
-#define ETHERNET2_PORT_CONFIGURATION_EXTEND_REGISTER   0x2c08
-#define ETHERNET2_PORT_COMMAND_REGISTER                        0x2c10
-#define ETHERNET2_PORT_STATUS_REGISTER                 0x2c18
-#define ETHERNET2_SERIAL_PARAMETRS_REGISTER            0x2c20
-#define ETHERNET2_HASH_TABLE_POINTER_REGISTER          0x2c28
-#define ETHERNET2_FLOW_CONTROL_SOURCE_ADDRESS_LOW      0x2c30
-#define ETHERNET2_FLOW_CONTROL_SOURCE_ADDRESS_HIGH     0x2c38
-#define ETHERNET2_SDMA_CONFIGURATION_REGISTER          0x2c40
-#define ETHERNET2_SDMA_COMMAND_REGISTER                        0x2c48
-#define ETHERNET2_INTERRUPT_CAUSE_REGISTER             0x2c50
-#define ETHERNET2_INTERRUPT_MASK_REGISTER              0x2c58
-#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER0         0x2c80
-#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER1         0x2c84
-#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER2         0x2c88
-#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER3         0x2c8c
-#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER0       0x2ca0
-#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER1       0x2ca4
-#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER2       0x2ca8
-#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER3       0x2cac
-#define ETHERNET2_CURRENT_TX_DESCRIPTOR_POINTER0       0x2ce0
-#define ETHERNET2_CURRENT_TX_DESCRIPTOR_POINTER1       0x2ce4
-#define ETHERNET2_MIB_COUNTER_BASE                     0x2d00
-
-/****************************************/
-/* SDMA Registers                      */
-/****************************************/
-
-#define SDMA_GROUP_CONFIGURATION_REGISTER              0xb1f0
-#define CHANNEL0_CONFIGURATION_REGISTER                        0x4000
-#define CHANNEL0_COMMAND_REGISTER                      0x4008
-#define CHANNEL0_RX_CMD_STATUS                         0x4800
-#define CHANNEL0_RX_PACKET_AND_BUFFER_SIZES            0x4804
-#define CHANNEL0_RX_BUFFER_POINTER                     0x4808
-#define CHANNEL0_RX_NEXT_POINTER                       0x480c
-#define CHANNEL0_CURRENT_RX_DESCRIPTOR_POINTER         0x4810
-#define CHANNEL0_TX_CMD_STATUS                         0x4C00
-#define CHANNEL0_TX_PACKET_SIZE                                0x4C04
-#define CHANNEL0_TX_BUFFER_POINTER                     0x4C08
-#define CHANNEL0_TX_NEXT_POINTER                       0x4C0c
-#define CHANNEL0_CURRENT_TX_DESCRIPTOR_POINTER         0x4c10
-#define CHANNEL0_FIRST_TX_DESCRIPTOR_POINTER           0x4c14
-#define CHANNEL1_CONFIGURATION_REGISTER                        0x5000
-#define CHANNEL1_COMMAND_REGISTER                      0x5008
-#define CHANNEL1_RX_CMD_STATUS                         0x5800
-#define CHANNEL1_RX_PACKET_AND_BUFFER_SIZES            0x5804
-#define CHANNEL1_RX_BUFFER_POINTER                     0x5808
-#define CHANNEL1_RX_NEXT_POINTER                       0x580c
-#define CHANNEL1_TX_CMD_STATUS                         0x5C00
-#define CHANNEL1_TX_PACKET_SIZE                                0x5C04
-#define CHANNEL1_TX_BUFFER_POINTER                     0x5C08
-#define CHANNEL1_TX_NEXT_POINTER                       0x5C0c
-#define CHANNEL1_CURRENT_RX_DESCRIPTOR_POINTER         0x5810
-#define CHANNEL1_CURRENT_TX_DESCRIPTOR_POINTER         0x5c10
-#define CHANNEL1_FIRST_TX_DESCRIPTOR_POINTER           0x5c14
-#define CHANNEL2_CONFIGURATION_REGISTER                        0x6000
-#define CHANNEL2_COMMAND_REGISTER                      0x6008
-#define CHANNEL2_RX_CMD_STATUS                         0x6800
-#define CHANNEL2_RX_PACKET_AND_BUFFER_SIZES            0x6804
-#define CHANNEL2_RX_BUFFER_POINTER                     0x6808
-#define CHANNEL2_RX_NEXT_POINTER                       0x680c
-#define CHANNEL2_CURRENT_RX_DESCRIPTOR_POINTER         0x6810
-#define CHANNEL2_TX_CMD_STATUS                         0x6C00
-#define CHANNEL2_TX_PACKET_SIZE                                0x6C04
-#define CHANNEL2_TX_BUFFER_POINTER                     0x6C08
-#define CHANNEL2_TX_NEXT_POINTER                       0x6C0c
-#define CHANNEL2_CURRENT_RX_DESCRIPTOR_POINTER         0x6810
-#define CHANNEL2_CURRENT_TX_DESCRIPTOR_POINTER         0x6c10
-#define CHANNEL2_FIRST_TX_DESCRIPTOR_POINTER           0x6c14
-
-/* SDMA Interrupt */
-
-#define SDMA_CAUSE                                     0xb820
-#define SDMA_MASK                                      0xb8a0
-
-
-/****************************************/
-/* Baude Rate Generators Registers     */
-/****************************************/
-
-/* BRG 0 */
-
-#define BRG0_CONFIGURATION_REGISTER                    0xb200
-#define BRG0_BAUDE_TUNING_REGISTER                     0xb204
-
-/* BRG 1 */
-
-#define BRG1_CONFIGURATION_REGISTER                    0xb208
-#define BRG1_BAUDE_TUNING_REGISTER                     0xb20c
-
-/* BRG 2 */
-
-#define BRG2_CONFIGURATION_REGISTER                    0xb210
-#define BRG2_BAUDE_TUNING_REGISTER                     0xb214
-
-/* BRG Interrupts */
-
-#define BRG_CAUSE_REGISTER                             0xb834
-#define BRG_MASK_REGISTER                              0xb8b4
-
-/* MISC */
-
-#define MAIN_ROUTING_REGISTER                          0xb400
-#define RECEIVE_CLOCK_ROUTING_REGISTER                 0xb404
-#define TRANSMIT_CLOCK_ROUTING_REGISTER                        0xb408
-#define COMM_UNIT_ARBITER_CONFIGURATION_REGISTER       0xb40c
-#define WATCHDOG_CONFIGURATION_REGISTER                        0xb410
-#define WATCHDOG_VALUE_REGISTER                                0xb414
-
-
-/****************************************/
-/* Flex TDM Registers                  */
-/****************************************/
-
-/* FTDM Port */
-
-#define FLEXTDM_TRANSMIT_READ_POINTER                  0xa800
-#define FLEXTDM_RECEIVE_READ_POINTER                   0xa804
-#define FLEXTDM_CONFIGURATION_REGISTER                 0xa808
-#define FLEXTDM_AUX_CHANNELA_TX_REGISTER               0xa80c
-#define FLEXTDM_AUX_CHANNELA_RX_REGISTER               0xa810
-#define FLEXTDM_AUX_CHANNELB_TX_REGISTER               0xa814
-#define FLEXTDM_AUX_CHANNELB_RX_REGISTER               0xa818
-
-/* FTDM Interrupts */
-
-#define FTDM_CAUSE_REGISTER                            0xb830
-#define FTDM_MASK_REGISTER                             0xb8b0
-
-
-/****************************************/
-/* GPP Interface Registers             */
-/****************************************/
-
-#define GPP_IO_CONTROL                                 0xf100
-#define GPP_LEVEL_CONTROL                              0xf110
-#define GPP_VALUE                                      0xf104
-#define GPP_INTERRUPT_CAUSE                            0xf108
-#define GPP_INTERRUPT_MASK                             0xf10c
-
-#define MPP_CONTROL0                                   0xf000
-#define MPP_CONTROL1                                   0xf004
-#define MPP_CONTROL2                                   0xf008
-#define MPP_CONTROL3                                   0xf00c
-#define DEBUG_PORT_MULTIPLEX                           0xf014
-#define SERIAL_PORT_MULTIPLEX                          0xf010
-
-/****************************************/
-/* I2C Registers                       */
-/****************************************/
-
-#define I2C_SLAVE_ADDRESS                              0xc000
-#define I2C_EXTENDED_SLAVE_ADDRESS                     0xc040
-#define I2C_DATA                                       0xc004
-#define I2C_CONTROL                                    0xc008
-#define I2C_STATUS_BAUDE_RATE                          0xc00C
-#define I2C_SOFT_RESET                                 0xc01c
-
-/****************************************/
-/* MPSC Registers                      */
-/****************************************/
-
-/* MPSC0  */
-
-#define MPSC0_MAIN_CONFIGURATION_LOW                   0x8000
-#define MPSC0_MAIN_CONFIGURATION_HIGH                  0x8004
-#define MPSC0_PROTOCOL_CONFIGURATION                   0x8008
-#define CHANNEL0_REGISTER1                             0x800c
-#define CHANNEL0_REGISTER2                             0x8010
-#define CHANNEL0_REGISTER3                             0x8014
-#define CHANNEL0_REGISTER4                             0x8018
-#define CHANNEL0_REGISTER5                             0x801c
-#define CHANNEL0_REGISTER6                             0x8020
-#define CHANNEL0_REGISTER7                             0x8024
-#define CHANNEL0_REGISTER8                             0x8028
-#define CHANNEL0_REGISTER9                             0x802c
-#define CHANNEL0_REGISTER10                            0x8030
-#define CHANNEL0_REGISTER11                            0x8034
-
-/* MPSC1  */
-
-#define MPSC1_MAIN_CONFIGURATION_LOW                   0x8840
-#define MPSC1_MAIN_CONFIGURATION_HIGH                  0x8844
-#define MPSC1_PROTOCOL_CONFIGURATION                   0x8848
-#define CHANNEL1_REGISTER1                             0x884c
-#define CHANNEL1_REGISTER2                             0x8850
-#define CHANNEL1_REGISTER3                             0x8854
-#define CHANNEL1_REGISTER4                             0x8858
-#define CHANNEL1_REGISTER5                             0x885c
-#define CHANNEL1_REGISTER6                             0x8860
-#define CHANNEL1_REGISTER7                             0x8864
-#define CHANNEL1_REGISTER8                             0x8868
-#define CHANNEL1_REGISTER9                             0x886c
-#define CHANNEL1_REGISTER10                            0x8870
-#define CHANNEL1_REGISTER11                            0x8874
-
-/* MPSC2  */
-
-#define MPSC2_MAIN_CONFIGURATION_LOW                   0x9040
-#define MPSC2_MAIN_CONFIGURATION_HIGH                  0x9044
-#define MPSC2_PROTOCOL_CONFIGURATION                   0x9048
-#define CHANNEL2_REGISTER1                             0x904c
-#define CHANNEL2_REGISTER2                             0x9050
-#define CHANNEL2_REGISTER3                             0x9054
-#define CHANNEL2_REGISTER4                             0x9058
-#define CHANNEL2_REGISTER5                             0x905c
-#define CHANNEL2_REGISTER6                             0x9060
-#define CHANNEL2_REGISTER7                             0x9064
-#define CHANNEL2_REGISTER8                             0x9068
-#define CHANNEL2_REGISTER9                             0x906c
-#define CHANNEL2_REGISTER10                            0x9070
-#define CHANNEL2_REGISTER11                            0x9074
-
-/* MPSCs Interrupts  */
-
-#define MPSC0_CAUSE                                    0xb824
-#define MPSC0_MASK                                     0xb8a4
-#define MPSC1_CAUSE                                    0xb828
-#define MPSC1_MASK                                     0xb8a8
-#define MPSC2_CAUSE                                    0xb82c
-#define MPSC2_MASK                                     0xb8ac
-
-#endif /* __INCgt64260rh */
diff --git a/include/galileo/memory.h b/include/galileo/memory.h
deleted file mode 100644 (file)
index 0c46c24..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Memory.h - Memory mappings and remapping functions declarations */
-
-/* Copyright - Galileo technology. */
-
-#ifndef __INCmemoryh
-#define __INCmemoryh
-
-/* includes */
-
-#include "core.h"
-
-/* defines */
-
-#define DONT_MODIFY     0xffffffff
-#define PARITY_SUPPORT  0x40000000
-
-#define _8BIT           0x00000000
-#define _16BIT          0x00100000
-#define _32BIT          0x00200000
-#define _64BIT          0x00300000
-
-/* typedefs */
-
- typedef struct deviceParam
-{                               /* boundary values  */
-    unsigned int    turnOff;    /* 0x0 - 0xf        */
-    unsigned int    acc2First;  /* 0x0 - 0x1f       */
-    unsigned int    acc2Next;   /* 0x0 - 0x1f       */
-    unsigned int    ale2Wr;     /* 0x0 - 0xf        */
-    unsigned int    wrLow;      /* 0x0 - 0xf        */
-    unsigned int    wrHigh;     /* 0x0 - 0xf        */
-    unsigned int    deviceWidth;    /* in Bytes  */
-} DEVICE_PARAM;
-
-typedef enum __memBank{BANK0,BANK1,BANK2,BANK3} MEMORY_BANK;
-typedef enum __memDevice{DEVICE0,DEVICE1,DEVICE2,DEVICE3,BOOT_DEVICE} DEVICE;
-
-typedef enum __memoryProtectRegion{MEM_REGION0,MEM_REGION1,MEM_REGION2,       \
-                                  MEM_REGION3,MEM_REGION4,MEM_REGION5,       \
-                                  MEM_REGION6,MEM_REGION7}                   \
-                                  MEMORY_PROTECT_REGION;
-typedef enum __memoryAccess{MEM_ACCESS_ALLOWED,MEM_ACCESS_FORBIDEN}           \
-                           MEMORY_ACCESS;
-typedef enum __memoryWrite{MEM_WRITE_ALLOWED,MEM_WRITE_FORBIDEN}              \
-                          MEMORY_ACCESS_WRITE;
-typedef enum __memoryCacheProtect{MEM_CACHE_ALLOWED,MEM_CACHE_FORBIDEN}       \
-                                 MEMORY_CACHE_PROTECT;
-typedef enum __memorySnoopType{MEM_NO_SNOOP,MEM_SNOOP_WT,MEM_SNOOP_WB}        \
-                              MEMORY_SNOOP_TYPE;
-typedef enum __memorySnoopRegion{MEM_SNOOP_REGION0,MEM_SNOOP_REGION1,         \
-                                MEM_SNOOP_REGION2,MEM_SNOOP_REGION3}         \
-                                MEMORY_SNOOP_REGION;
-
-/* functions */
-unsigned int memoryGetBankBaseAddress(MEMORY_BANK bank);
-unsigned int memoryGetDeviceBaseAddress(DEVICE device);
-unsigned int memoryGetBankSize(MEMORY_BANK bank);
-unsigned int memoryGetDeviceSize(DEVICE device);
-unsigned int memoryGetDeviceWidth(DEVICE device);
-
-/* when given base Address and size Set new WINDOW for SCS_X. (X = 0,1,2 or 3*/
-bool memoryMapBank(MEMORY_BANK bank, unsigned int bankBase,unsigned int bankLength);
-bool memoryMapDeviceSpace(DEVICE device, unsigned int deviceBase,unsigned int deviceLength);
-
-/* Change the Internal Register Base Address to a new given Address. */
-bool memoryMapInternalRegistersSpace(unsigned int internalRegBase);
-/* returns internal Register Space Base Address. */
-unsigned int memoryGetInternalRegistersSpace(void);
-/* Configurate the protection feature to a given space. */
-bool memorySetProtectRegion(MEMORY_PROTECT_REGION region,
-                           MEMORY_ACCESS memoryAccess,
-                           MEMORY_ACCESS_WRITE memoryWrite,
-                           MEMORY_CACHE_PROTECT cacheProtection,
-                           unsigned int baseAddress,
-                           unsigned int regionLength);
-/* Configurate the snoop feature to a given space. */
-bool memorySetRegionSnoopMode(MEMORY_SNOOP_REGION region,
-                             MEMORY_SNOOP_TYPE snoopType,
-                             unsigned int baseAddress,
-                             unsigned int regionLength);
-
-bool memoryRemapAddress(unsigned int remapReg, unsigned int remapValue);
-bool memoryGetDeviceParam(DEVICE_PARAM *deviceParam, DEVICE deviceNum);
-bool memorySetDeviceParam(DEVICE_PARAM *deviceParam, DEVICE deviceNum);
-#endif  /* __INCmemoryh */
diff --git a/include/galileo/pci.h b/include/galileo/pci.h
deleted file mode 100644 (file)
index 6ed8b95..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* PCI.h - PCI functions header file */
-
-/* Copyright - Galileo technology. */
-
-#ifndef __INCpcih
-#define __INCpcih
-
-/* includes */
-
-#include "core.h"
-#include "memory.h"
-
-/* According to PCI REV 2.1 MAX agents allowed on the bus are -21- */
-#define PCI_MAX_DEVICES 22
-
-
-/* Macros */
-#define     SELF                    32
-
-/* Defines for the access regions. */
-#define     PREFETCH_ENABLE                 BIT12
-#define     PREFETCH_DISABLE                NO_BIT
-#define     DELAYED_READ_ENABLE             BIT13
-/* #define     CACHING_ENABLE                  BIT14 */
-/* aggressive prefetch: PCI slave prefetch two burst in advance*/
-#define     AGGRESSIVE_PREFETCH              BIT16
-/* read line aggresive prefetch: PCI slave prefetch two burst in advance*/
-#define     READ_LINE_AGGRESSIVE_PREFETCH   BIT17
-/* read multiple aggresive prefetch: PCI slave prefetch two burst in advance*/
-#define     READ_MULTI_AGGRESSIVE_PREFETCH  BIT18
-#define     MAX_BURST_4                     NO_BIT
-#define     MAX_BURST_8                     BIT20  /* Bits[21:20] = 01 */
-#define     MAX_BURST_16                    BIT21  /* Bits[21:20] = 10 */
-#define     PCI_BYTE_SWAP                   NO_BIT /* Bits[25:24] = 00 */
-#define     PCI_NO_SWAP                     BIT24  /* Bits[25:24] = 01 */
-#define     PCI_BYTE_AND_WORD_SWAP          BIT25  /* Bits[25:24] = 10 */
-#define     PCI_WORD_SWAP                  (BIT24 | BIT25) /* Bits[25:24] = 11 */
-#define     PCI_ACCESS_PROTECT              BIT28
-#define     PCI_WRITE_PROTECT               BIT29
-
-/* typedefs */
-
-typedef enum __pciAccessRegions{REGION0,REGION1,REGION2,REGION3,REGION4,REGION5,
-                               REGION6,REGION7} PCI_ACCESS_REGIONS;
-
-typedef enum __pciAgentPrio{LOW_AGENT_PRIO,HI_AGENT_PRIO} PCI_AGENT_PRIO;
-typedef enum __pciAgentPark{PARK_ON_AGENT,DONT_PARK_ON_AGENT} PCI_AGENT_PARK;
-
-typedef enum __pciSnoopType{PCI_NO_SNOOP,PCI_SNOOP_WT,PCI_SNOOP_WB}
-                           PCI_SNOOP_TYPE;
-typedef enum __pciSnoopRegion{PCI_SNOOP_REGION0,PCI_SNOOP_REGION1,
-                             PCI_SNOOP_REGION2,PCI_SNOOP_REGION3}
-                             PCI_SNOOP_REGION;
-
-typedef enum __memPciHost{PCI_HOST0,PCI_HOST1} PCI_HOST;
-typedef enum __memPciRegion{PCI_REGION0,PCI_REGION1,
-                        PCI_REGION2,PCI_REGION3,
-                        PCI_IO}
-                        PCI_REGION;
-
-/* read/write configuration registers on local PCI bus. */
-void pciWriteConfigReg(PCI_HOST host, unsigned int regOffset,
-                      unsigned int pciDevNum, unsigned int data);
-unsigned int pciReadConfigReg (PCI_HOST host, unsigned int regOffset,
-                              unsigned int pciDevNum);
-
-/* read/write configuration registers on another PCI bus. */
-void pciOverBridgeWriteConfigReg(PCI_HOST host,
-                                unsigned int regOffset,
-                                unsigned int pciDevNum,
-                                unsigned int busNum,unsigned int data);
-unsigned int pciOverBridgeReadConfigReg(PCI_HOST host,
-                                       unsigned int regOffset,
-                                       unsigned int pciDevNum,
-                                       unsigned int busNum);
-
-/*      Master`s memory space   */
-bool pciMapSpace(PCI_HOST host, PCI_REGION region,
-               unsigned int remapBase,
-               unsigned int deviceBase,
-               unsigned int deviceLength);
-unsigned int pciGetSpaceBase(PCI_HOST host, PCI_REGION region);
-unsigned int pciGetSpaceSize(PCI_HOST host, PCI_REGION region);
-
-/*      Slave`s memory space   */
-void pciMapMemoryBank(PCI_HOST host, MEMORY_BANK bank,
-                     unsigned int pci0Dram0Base, unsigned int pci0Dram0Size);
-
-/* PCI region options */
-
-bool  pciSetRegionFeatures(PCI_HOST host, PCI_ACCESS_REGIONS region,
-       unsigned int features, unsigned int baseAddress,
-       unsigned int regionLength);
-
-void  pciDisableAccessRegion(PCI_HOST host, PCI_ACCESS_REGIONS region);
-
-/* PCI arbiter */
-
-bool pciArbiterEnable(PCI_HOST host);
-bool pciArbiterDisable(PCI_HOST host);
-bool pciParkingDisable(PCI_HOST host, PCI_AGENT_PARK internalAgent,
-                       PCI_AGENT_PARK externalAgent0,
-                       PCI_AGENT_PARK externalAgent1,
-                       PCI_AGENT_PARK externalAgent2,
-                       PCI_AGENT_PARK externalAgent3,
-                       PCI_AGENT_PARK externalAgent4,
-                       PCI_AGENT_PARK externalAgent5);
-bool pciSetRegionSnoopMode(PCI_HOST host, PCI_SNOOP_REGION region,
-                           PCI_SNOOP_TYPE snoopType,
-                           unsigned int baseAddress,
-                           unsigned int regionLength);
-
-#endif /* __INCpcih */
index d8ec4f08e166702d6a33b145f82eee3c78f6a6a3..f4eb100de05f1279e82930f30e3586d319a453ca 100644 (file)
@@ -17,7 +17,6 @@ enum {
        HASH_FLAG_ENV           = 1 << 1,       /* Allow env vars */
 };
 
-#ifndef USE_HOSTCC
 #if defined(CONFIG_SHA1SUM_VERIFY) || defined(CONFIG_CRC32_VERIFY)
 #define CONFIG_HASH_VERIFY
 #endif
@@ -77,6 +76,7 @@ struct hash_algo {
                           int size);
 };
 
+#ifndef USE_HOSTCC
 /**
  * hash_command: Process a hash command for a particular algorithm
  *
@@ -114,6 +114,23 @@ int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
 int hash_block(const char *algo_name, const void *data, unsigned int len,
               uint8_t *output, int *output_size);
 
+/**
+ * hash_show() - Print out a hash algorithm and value
+ *
+ * You will get a message like this (without a newline at the end):
+ *
+ * "sha1 for 9eb3337c ... 9eb3338f ==> 7942ef1df479fd3130f716eb9613d107dab7e257"
+ *
+ * @algo:              Algorithm used for hash
+ * @addr:              Address of data that was hashed
+ * @len:               Length of data that was hashed
+ * @output:            Hash value to display
+ */
+void hash_show(struct hash_algo *algo, ulong addr, ulong len,
+              uint8_t *output);
+
+#endif /* !USE_HOSTCC */
+
 /**
  * hash_lookup_algo() - Look up the hash_algo struct for an algorithm
  *
@@ -128,18 +145,17 @@ int hash_block(const char *algo_name, const void *data, unsigned int len,
 int hash_lookup_algo(const char *algo_name, struct hash_algo **algop);
 
 /**
- * hash_show() - Print out a hash algorithm and value
+ * hash_progressive_lookup_algo() - Look up hash_algo for prog. hash support
  *
- * You will get a message like this (without a newline at the end):
+ * The function returns the pointer to the struct or -EPROTONOSUPPORT if the
+ * algorithm is not available with progressive hash support.
  *
- * "sha1 for 9eb3337c ... 9eb3338f ==> 7942ef1df479fd3130f716eb9613d107dab7e257"
+ * @algo_name: Hash algorithm to look up
+ * @algop: Pointer to the hash_algo struct if found
  *
- * @algo:              Algorithm used for hash
- * @addr:              Address of data that was hashed
- * @len:               Length of data that was hashed
- * @output:            Hash value to display
+ * @return 0 if ok, -EPROTONOSUPPORT for an unknown algorithm.
  */
-void hash_show(struct hash_algo *algo, ulong addr, ulong len,
-              uint8_t *output);
-#endif /* !USE_HOSTCC */
+int hash_progressive_lookup_algo(const char *algo_name,
+                                struct hash_algo **algop);
+
 #endif
index 9c6a60cf9ae89e50e2a4d2dfaa94874a56774e1f..27fe00f17361763a42bc13f59e378d464c484dc6 100644 (file)
@@ -39,8 +39,8 @@ enum dm_i2c_chip_flags {
  * An I2C chip is a device on the I2C bus. It sits at a particular address
  * and normally supports 7-bit or 10-bit addressing.
  *
- * To obtain this structure, use dev_get_parentdata(dev) where dev is the
- * chip to examine.
+ * To obtain this structure, use dev_get_parent_platdata(dev) where dev is
+ * the chip to examine.
  *
  * @chip_addr: Chip address on bus
  * @offset_len: Length of offset in bytes. A single byte offset can
@@ -75,7 +75,7 @@ struct dm_i2c_bus {
 };
 
 /**
- * i2c_read() - read bytes from an I2C chip
+ * dm_i2c_read() - read bytes from an I2C chip
  *
  * To obtain an I2C device (called a 'chip') given the I2C bus address you
  * can use i2c_get_chip(). To obtain a bus by bus number use
@@ -91,13 +91,12 @@ struct dm_i2c_bus {
  *
  * @return 0 on success, -ve on failure
  */
-int i2c_read(struct udevice *dev, uint offset, uint8_t *buffer,
-            int len);
+int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len);
 
 /**
- * i2c_write() - write bytes to an I2C chip
+ * dm_i2c_write() - write bytes to an I2C chip
  *
- * See notes for i2c_read() above.
+ * See notes for dm_i2c_read() above.
  *
  * @dev:       Chip to write to
  * @offset:    Offset within chip to start writing
@@ -106,11 +105,11 @@ int i2c_read(struct udevice *dev, uint offset, uint8_t *buffer,
  *
  * @return 0 on success, -ve on failure
  */
-int i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
-             int len);
+int dm_i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
+                int len);
 
 /**
- * i2c_probe() - probe a particular chip address
+ * dm_i2c_probe() - probe a particular chip address
  *
  * This can be useful to check for the existence of a chip on the bus.
  * It is typically implemented by writing the chip address to the bus
@@ -122,8 +121,8 @@ int i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
  * @devp:      Returns the device found, or NULL if none
  * @return 0 if a chip was found at that address, -ve if not
  */
-int i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
-             struct udevice **devp);
+int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
+                struct udevice **devp);
 
 /**
  * i2c_set_bus_speed() - set the speed of a bus
@@ -185,6 +184,80 @@ int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len);
  */
 int i2c_deblock(struct udevice *bus);
 
+#ifdef CONFIG_DM_I2C_COMPAT
+/**
+ * i2c_probe() - Compatibility function for driver model
+ *
+ * Calls dm_i2c_probe() on the current bus
+ */
+int i2c_probe(uint8_t chip_addr);
+
+/**
+ * i2c_read() - Compatibility function for driver model
+ *
+ * Calls dm_i2c_read() with the device corresponding to @chip_addr, and offset
+ * set to @addr. @alen must match the current setting for the device.
+ */
+int i2c_read(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer,
+            int len);
+
+/**
+ * i2c_write() - Compatibility function for driver model
+ *
+ * Calls dm_i2c_write() with the device corresponding to @chip_addr, and offset
+ * set to @addr. @alen must match the current setting for the device.
+ */
+int i2c_write(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer,
+             int len);
+
+/**
+ * i2c_get_bus_num_fdt() - Compatibility function for driver model
+ *
+ * @return the bus number associated with the given device tree node
+ */
+int i2c_get_bus_num_fdt(int node);
+
+/**
+ * i2c_get_bus_num() - Compatibility function for driver model
+ *
+ * @return the 'current' bus number
+ */
+unsigned int i2c_get_bus_num(void);
+
+/**
+ * i2c_set_bus_num() - Compatibility function for driver model
+ *
+ * Sets the 'current' bus
+ */
+int i2c_set_bus_num(unsigned int bus);
+
+static inline void I2C_SET_BUS(unsigned int bus)
+{
+       i2c_set_bus_num(bus);
+}
+
+static inline unsigned int I2C_GET_BUS(void)
+{
+       return i2c_get_bus_num();
+}
+
+/**
+ * i2c_init() - Compatibility function for driver model
+ *
+ * This function does nothing.
+ */
+void i2c_init(int speed, int slaveaddr);
+
+/**
+ * board_i2c_init() - Compatibility function for driver model
+ *
+ * @param blob  Device tree blbo
+ * @return the number of I2C bus
+ */
+void board_i2c_init(const void *blob);
+
+#endif
+
 /*
  * Not all of these flags are implemented in the U-Boot API
  */
@@ -330,10 +403,12 @@ struct dm_i2c_ops {
  *
  * @bus:       Bus to examine
  * @chip_addr: Chip address for the new device
+ * @offset_len:        Length of a register offset in bytes (normally 1)
  * @devp:      Returns pointer to new device if found or -ENODEV if not
  *             found
  */
-int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp);
+int i2c_get_chip(struct udevice *bus, uint chip_addr, uint offset_len,
+                struct udevice **devp);
 
 /**
  * i2c_get_chip() - get a device to use to access a chip on a bus number
@@ -343,10 +418,12 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp);
  *
  * @busnum:    Bus number to examine
  * @chip_addr: Chip address for the new device
+ * @offset_len:        Length of a register offset in bytes (normally 1)
  * @devp:      Returns pointer to new device if found or -ENODEV if not
  *             found
  */
-int i2c_get_chip_for_busnum(int busnum, int chip_addr, struct udevice **devp);
+int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
+                           struct udevice **devp);
 
 /**
  * i2c_chip_ofdata_to_platdata() - Decode standard I2C platform data
index ee3afe35670a9b460921ba0b2f5218df5a76b0c0..0e6af00c16bbab07a7c1284bca9963b0a4f2155c 100644 (file)
@@ -751,6 +751,7 @@ int fit_parse_conf(const char *spec, ulong addr_curr,
 int fit_parse_subimage(const char *spec, ulong addr_curr,
                ulong *addr, const char **image_name);
 
+int fit_get_subimage_count(const void *fit, int images_noffset);
 void fit_print_contents(const void *fit);
 void fit_image_print(const void *fit, int noffset, const char *p);
 
@@ -927,8 +928,9 @@ struct checksum_algo {
 #if IMAGE_ENABLE_SIGN
        const EVP_MD *(*calculate_sign)(void);
 #endif
-       void (*calculate)(const struct image_region region[],
-                         int region_count, uint8_t *checksum);
+       int (*calculate)(const char *name,
+                        const struct image_region region[],
+                        int region_count, uint8_t *checksum);
        const uint8_t *rsa_padding;
 };
 
index d37fba44dcafc6b1ce6813cca4e8f3d6999e95d5..940c87128194b654c364c477fc3ba864a523ffc0 100644 (file)
@@ -23,7 +23,7 @@
 
 /**
  * A linker list is constructed by grouping together linker input
- * sections, each containning one entry of the list. Each input section
+ * sections, each containing one entry of the list. Each input section
  * contains a constant initialized variable which holds the entry's
  * content. Linker list input sections are constructed from the list
  * and entry names, plus a prefix which allows grouping all lists
@@ -39,7 +39,7 @@
  * This ensures uniqueness for both input section and C variable name.
  *
  * Note that the names differ only in the first character, "." for the
- * setion and "_" for the variable, so that the linker cannot confuse
+ * section and "_" for the variable, so that the linker cannot confuse
  * section and symbol names. From now on, both names will be referred
  * to as
  *
index 9a8658257ff9953b5c410713a36d1315e6e29059..6cbae450221ffc9bec9d63b190bf3cfd77963010 100644 (file)
@@ -66,7 +66,11 @@ struct gpmc {
        u32 status;             /* 0x54 */
        u8 res5[0x8];           /* 0x58 */
        struct gpmc_cs cs[8];   /* 0x60, 0x90, .. */
-       u8 res6[0x14];          /* 0x1E0 */
+       u32 prefetch_config1;   /* 0x1E0 */
+       u32 prefetch_config2;   /* 0x1E4 */
+       u32 res6;               /* 0x1E8 */
+       u32 prefetch_control;   /* 0x1EC */
+       u32 prefetch_status;    /* 0x1F0 */
        u32 ecc_config;         /* 0x1F4 */
        u32 ecc_control;        /* 0x1F8 */
        u32 ecc_size_config;    /* 0x1FC */
diff --git a/include/mipi_display.h b/include/mipi_display.h
new file mode 100644 (file)
index 0000000..ddcc8ca
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Defines for Mobile Industry Processor Interface (MIPI(R))
+ * Display Working Group standards: DSI, DCS, DBI, DPI
+ *
+ * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ * Copyright (C) 2006 Nokia Corporation
+ * Author: Imre Deak <imre.deak@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef MIPI_DISPLAY_H
+#define MIPI_DISPLAY_H
+
+/* MIPI DSI Processor-to-Peripheral transaction types */
+enum {
+       MIPI_DSI_V_SYNC_START                           = 0x01,
+       MIPI_DSI_V_SYNC_END                             = 0x11,
+       MIPI_DSI_H_SYNC_START                           = 0x21,
+       MIPI_DSI_H_SYNC_END                             = 0x31,
+
+       MIPI_DSI_COLOR_MODE_OFF                         = 0x02,
+       MIPI_DSI_COLOR_MODE_ON                          = 0x12,
+       MIPI_DSI_SHUTDOWN_PERIPHERAL                    = 0x22,
+       MIPI_DSI_TURN_ON_PERIPHERAL                     = 0x32,
+
+       MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM            = 0x03,
+       MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM            = 0x13,
+       MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM            = 0x23,
+
+       MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM           = 0x04,
+       MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM           = 0x14,
+       MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM           = 0x24,
+
+       MIPI_DSI_DCS_SHORT_WRITE                        = 0x05,
+       MIPI_DSI_DCS_SHORT_WRITE_PARAM                  = 0x15,
+
+       MIPI_DSI_DCS_READ                               = 0x06,
+
+       MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE         = 0x37,
+
+       MIPI_DSI_END_OF_TRANSMISSION                    = 0x08,
+
+       MIPI_DSI_NULL_PACKET                            = 0x09,
+       MIPI_DSI_BLANKING_PACKET                        = 0x19,
+       MIPI_DSI_GENERIC_LONG_WRITE                     = 0x29,
+       MIPI_DSI_DCS_LONG_WRITE                         = 0x39,
+
+       MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20    = 0x0c,
+       MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24            = 0x1c,
+       MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16            = 0x2c,
+
+       MIPI_DSI_PACKED_PIXEL_STREAM_30                 = 0x0d,
+       MIPI_DSI_PACKED_PIXEL_STREAM_36                 = 0x1d,
+       MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12            = 0x3d,
+
+       MIPI_DSI_PACKED_PIXEL_STREAM_16                 = 0x0e,
+       MIPI_DSI_PACKED_PIXEL_STREAM_18                 = 0x1e,
+       MIPI_DSI_PIXEL_STREAM_3BYTE_18                  = 0x2e,
+       MIPI_DSI_PACKED_PIXEL_STREAM_24                 = 0x3e,
+};
+
+/* MIPI DSI Peripheral-to-Processor transaction types */
+enum {
+       MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT        = 0x02,
+       MIPI_DSI_RX_END_OF_TRANSMISSION                 = 0x08,
+       MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE   = 0x11,
+       MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE   = 0x12,
+       MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE          = 0x1a,
+       MIPI_DSI_RX_DCS_LONG_READ_RESPONSE              = 0x1c,
+       MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE       = 0x21,
+       MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE       = 0x22,
+};
+
+/* MIPI DCS commands */
+enum {
+       MIPI_DCS_NOP                    = 0x00,
+       MIPI_DCS_SOFT_RESET             = 0x01,
+       MIPI_DCS_GET_DISPLAY_ID         = 0x04,
+       MIPI_DCS_GET_RED_CHANNEL        = 0x06,
+       MIPI_DCS_GET_GREEN_CHANNEL      = 0x07,
+       MIPI_DCS_GET_BLUE_CHANNEL       = 0x08,
+       MIPI_DCS_GET_DISPLAY_STATUS     = 0x09,
+       MIPI_DCS_GET_POWER_MODE         = 0x0A,
+       MIPI_DCS_GET_ADDRESS_MODE       = 0x0B,
+       MIPI_DCS_GET_PIXEL_FORMAT       = 0x0C,
+       MIPI_DCS_GET_DISPLAY_MODE       = 0x0D,
+       MIPI_DCS_GET_SIGNAL_MODE        = 0x0E,
+       MIPI_DCS_GET_DIAGNOSTIC_RESULT  = 0x0F,
+       MIPI_DCS_ENTER_SLEEP_MODE       = 0x10,
+       MIPI_DCS_EXIT_SLEEP_MODE        = 0x11,
+       MIPI_DCS_ENTER_PARTIAL_MODE     = 0x12,
+       MIPI_DCS_ENTER_NORMAL_MODE      = 0x13,
+       MIPI_DCS_EXIT_INVERT_MODE       = 0x20,
+       MIPI_DCS_ENTER_INVERT_MODE      = 0x21,
+       MIPI_DCS_SET_GAMMA_CURVE        = 0x26,
+       MIPI_DCS_SET_DISPLAY_OFF        = 0x28,
+       MIPI_DCS_SET_DISPLAY_ON         = 0x29,
+       MIPI_DCS_SET_COLUMN_ADDRESS     = 0x2A,
+       MIPI_DCS_SET_PAGE_ADDRESS       = 0x2B,
+       MIPI_DCS_WRITE_MEMORY_START     = 0x2C,
+       MIPI_DCS_WRITE_LUT              = 0x2D,
+       MIPI_DCS_READ_MEMORY_START      = 0x2E,
+       MIPI_DCS_SET_PARTIAL_AREA       = 0x30,
+       MIPI_DCS_SET_SCROLL_AREA        = 0x33,
+       MIPI_DCS_SET_TEAR_OFF           = 0x34,
+       MIPI_DCS_SET_TEAR_ON            = 0x35,
+       MIPI_DCS_SET_ADDRESS_MODE       = 0x36,
+       MIPI_DCS_SET_SCROLL_START       = 0x37,
+       MIPI_DCS_EXIT_IDLE_MODE         = 0x38,
+       MIPI_DCS_ENTER_IDLE_MODE        = 0x39,
+       MIPI_DCS_SET_PIXEL_FORMAT       = 0x3A,
+       MIPI_DCS_WRITE_MEMORY_CONTINUE  = 0x3C,
+       MIPI_DCS_READ_MEMORY_CONTINUE   = 0x3E,
+       MIPI_DCS_SET_TEAR_SCANLINE      = 0x44,
+       MIPI_DCS_GET_SCANLINE           = 0x45,
+       MIPI_DCS_READ_DDB_START         = 0xA1,
+       MIPI_DCS_READ_DDB_CONTINUE      = 0xA8,
+};
+
+/* MIPI DCS pixel formats */
+#define MIPI_DCS_PIXEL_FMT_24BIT       7
+#define MIPI_DCS_PIXEL_FMT_18BIT       6
+#define MIPI_DCS_PIXEL_FMT_16BIT       5
+#define MIPI_DCS_PIXEL_FMT_12BIT       3
+#define MIPI_DCS_PIXEL_FMT_8BIT                2
+#define MIPI_DCS_PIXEL_FMT_3BIT                1
+
+#endif
index 7ec255d882199c88dc7bf79f52857c87a796a46c..09101e2c87a11cfa76c0412c92dd5e9b6eb5ab00 100644 (file)
 /*
  * EXT_CSD fields
  */
+#define EXT_CSD_ENH_START_ADDR         136     /* R/W */
+#define EXT_CSD_ENH_SIZE_MULT          140     /* R/W */
 #define EXT_CSD_GP_SIZE_MULT           143     /* R/W */
 #define EXT_CSD_PARTITION_SETTING      155     /* R/W */
 #define EXT_CSD_PARTITIONS_ATTRIBUTE   156     /* R/W */
+#define EXT_CSD_MAX_ENH_SIZE_MULT      157     /* R */
 #define EXT_CSD_PARTITIONING_SUPPORT   160     /* RO */
 #define EXT_CSD_RST_N_FUNCTION         162     /* R/W */
+#define EXT_CSD_WR_REL_PARAM           166     /* R */
+#define EXT_CSD_WR_REL_SET             167     /* R/W */
 #define EXT_CSD_RPMB_MULT              168     /* RO */
 #define EXT_CSD_ERASE_GROUP_DEF                175     /* R/W */
 #define EXT_CSD_BOOT_BUS_WIDTH         177
 
 #define EXT_CSD_PARTITION_SETTING_COMPLETED    (1 << 0)
 
+#define EXT_CSD_ENH_USR                (1 << 0)        /* user data area is enhanced */
+#define EXT_CSD_ENH_GP(x)      (1 << ((x)+1))  /* GP part (x+1) is enhanced */
+
+#define EXT_CSD_HS_CTRL_REL    (1 << 0)        /* host controlled WR_REL_SET */
+
+#define EXT_CSD_WR_DATA_REL_USR                (1 << 0)        /* user data area WR_REL */
+#define EXT_CSD_WR_DATA_REL_GP(x)      (1 << ((x)+1))  /* GP part (x+1) WR_REL */
+
 #define R1_ILLEGAL_COMMAND             (1 << 22)
 #define R1_APP_CMD                     (1 << 5)
 
 #define MMCPART_NOAVAILABLE    (0xff)
 #define PART_ACCESS_MASK       (0x7)
 #define PART_SUPPORT           (0x1)
+#define ENHNCD_SUPPORT         (0x2)
 #define PART_ENH_ATTRIB                (0x1f)
 
 /* Maximum block size for MMC */
@@ -302,17 +316,23 @@ struct mmc {
        uint csd[4];
        uint cid[4];
        ushort rca;
+       u8 part_support;
+       u8 part_attr;
+       u8 wr_rel_set;
        char part_config;
        char part_num;
        uint tran_speed;
        uint read_bl_len;
        uint write_bl_len;
-       uint erase_grp_size;
+       uint erase_grp_size;    /* in 512-byte sectors */
+       uint hc_wp_grp_size;    /* in 512-byte sectors */
        u64 capacity;
        u64 capacity_user;
        u64 capacity_boot;
        u64 capacity_rpmb;
        u64 capacity_gp[4];
+       u64 enh_user_start;
+       u64 enh_user_size;
        block_dev_desc_t block_dev;
        char op_cond_pending;   /* 1 if we are waiting on an op_cond command */
        char init_in_progress;  /* 1 if we have done mmc_start_init() */
@@ -321,6 +341,27 @@ struct mmc {
        int ddr_mode;
 };
 
+struct mmc_hwpart_conf {
+       struct {
+               uint enh_start; /* in 512-byte sectors */
+               uint enh_size;  /* in 512-byte sectors, if 0 no enh area */
+               unsigned wr_rel_change : 1;
+               unsigned wr_rel_set : 1;
+       } user;
+       struct {
+               uint size;      /* in 512-byte sectors */
+               unsigned enhanced : 1;
+               unsigned wr_rel_change : 1;
+               unsigned wr_rel_set : 1;
+       } gp_part[4];
+};
+
+enum mmc_hwpart_conf_mode {
+       MMC_HWPART_CONF_CHECK,
+       MMC_HWPART_CONF_SET,
+       MMC_HWPART_CONF_COMPLETE,
+};
+
 int mmc_register(struct mmc *mmc);
 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv);
 void mmc_destroy(struct mmc *mmc);
@@ -333,6 +374,8 @@ int mmc_set_dev(int dev_num);
 void print_mmc_devices(char separator);
 int get_mmc_num(void);
 int mmc_switch_part(int dev_num, unsigned int part_num);
+int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
+                     enum mmc_hwpart_conf_mode mode);
 int mmc_getcd(struct mmc *mmc);
 int board_mmc_getcd(struct mmc *mmc);
 int mmc_getwp(struct mmc *mmc);
index 3da35fe981880500b9025ca813164c27a2aa8bdb..73ea88b42d7defb35ddea2da2d0ff30684c26b30 100644 (file)
@@ -482,6 +482,36 @@ extern void net_set_ip_header(uchar *pkt, IPaddr_t dest, IPaddr_t source);
 extern void net_set_udp_header(uchar *pkt, IPaddr_t dest, int dport,
                                int sport, int len);
 
+/**
+ * compute_ip_checksum() - Compute IP checksum
+ *
+ * @addr:      Address to check (must be 16-bit aligned)
+ * @nbytes:    Number of bytes to check (normally a multiple of 2)
+ * @return 16-bit IP checksum
+ */
+unsigned compute_ip_checksum(const void *addr, unsigned nbytes);
+
+/**
+ * add_ip_checksums() - add two IP checksums
+ *
+ * @offset:    Offset of first sum (if odd we do a byte-swap)
+ * @sum:       First checksum
+ * @new_sum:   New checksum to add
+ * @return updated 16-bit IP checksum
+ */
+unsigned add_ip_checksums(unsigned offset, unsigned sum, unsigned new_sum);
+
+/**
+ * ip_checksum_ok() - check if a checksum is correct
+ *
+ * This works by making sure the checksum sums to 0
+ *
+ * @addr:      Address to check (must be 16-bit aligned)
+ * @nbytes:    Number of bytes to check (normally a multiple of 2)
+ * @return true if the checksum matches, false if not
+ */
+int ip_checksum_ok(const void *addr, unsigned nbytes);
+
 /* Checksum */
 extern int     NetCksumOk(uchar *, int);       /* Return true if cksum OK */
 extern uint    NetCksum(uchar *, int);         /* Calculate the checksum */
index 34651ab3779014ce6ec96a83b41acc0a96e60c00..daffc1222d60afba54d8ad9dc5dba7d84d284fe0 100644 (file)
@@ -93,7 +93,8 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
 int xilinx_ll_temac_eth_init(bd_t *bis, unsigned long base_addr, int flags,
                                                unsigned long ctrl_addr);
 int zynq_gem_of_init(const void *blob);
-int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr, u32 emio);
+int zynq_gem_initialize(bd_t *bis, phys_addr_t base_addr,
+                       int phy_addr, u32 emio);
 /*
  * As long as the Xilinx xps_ll_temac ethernet driver has not its own interface
  * exported by a public hader file, we need a global definition at this point.
index 7f67ca6542652cfdab8beff36494b404d6a211f6..4fbb8f6729f2e33d7f313427af31100b618d5a00 100644 (file)
@@ -697,5 +697,14 @@ void pci_write_bar32(struct pci_controller *hose, pci_dev_t dev, int barnum,
  * */
 u32 pci_read_bar32(struct pci_controller *hose, pci_dev_t dev, int barnum);
 
+/**
+ * pciauto_setup_rom() - Set up access to a device ROM
+ *
+ * @hose:      PCI hose to use
+ * @dev:       PCI device to adjust
+ * @return 0 if done, -ve on error
+ */
+int pciauto_setup_rom(struct pci_controller *hose, pci_dev_t dev);
+
 #endif /* __ASSEMBLY__ */
 #endif /* _PCI_H */
index 8b2674cf87940fbcdd79b456695718a1f822b178..4ba36eb1b7bd079311d59523d14ad41f4d0962fc 100644 (file)
@@ -8,7 +8,6 @@
 #define _PCI_ROM_H
 
 #define PCI_ROM_HDR                    0xaa55
-#define PCI_VGA_RAM_IMAGE_START                0xc0000
 
 struct pci_rom_header {
        uint16_t signature;
index 1e282e2964ec44e5b24fd22b0febd5200dc0df88..d117fc1634b071a6da4bd90206619840618c0dcf 100644 (file)
@@ -225,6 +225,7 @@ int gen10g_startup(struct phy_device *phydev);
 int gen10g_shutdown(struct phy_device *phydev);
 int gen10g_discover_mmds(struct phy_device *phydev);
 
+int phy_aquantia_init(void);
 int phy_atheros_init(void);
 int phy_broadcom_init(void);
 int phy_cortina_init(void);
diff --git a/include/power/tps62362.h b/include/power/tps62362.h
new file mode 100644 (file)
index 0000000..720c338
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
+ * Author: Felipe Balbi <balbi@ti.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __POWER_TPS62362_H__
+#define __POWER_TPS62362_H__
+
+/* I2C chip address */
+#define TPS62362_I2C_ADDR                      0x60
+
+/* Registers */
+#define TPS62362_SET0                          0x00
+#define TPS62362_SET1                          0x01
+#define TPS62362_SET2                          0x02
+#define TPS62362_SET3                          0x03
+#define TPS62362_NUM_REGS                      4
+
+#define TPS62362_DCDC_VOLT_SEL_0950MV          0x12
+#define TPS62362_DCDC_VOLT_SEL_1100MV          0x21
+#define TPS62362_DCDC_VOLT_SEL_1200MV          0x2b
+#define TPS62362_DCDC_VOLT_SEL_1260MV          0x31
+#define TPS62362_DCDC_VOLT_SEL_1330MV          0x38
+
+int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel);
+int power_tps62362_init(unsigned char bus);
+#endif /* __POWER_TPS62362_H__ */
index f8f33b8b16bae0003034e4e64aadf12988370113..63fc7b343f8ccec3ef910f9b103ae95f34eac9f8 100644 (file)
@@ -54,7 +54,10 @@ enum {
 
 #define TPS65218_MASK_ALL_BITS                 0xFF
 
+#define TPS65218_DCDC_VOLT_SEL_0950MV          0x0a
 #define TPS65218_DCDC_VOLT_SEL_1100MV          0x19
+#define TPS65218_DCDC_VOLT_SEL_1200MV          0x23
+#define TPS65218_DCDC_VOLT_SEL_1260MV          0x29
 #define TPS65218_DCDC_VOLT_SEL_1330MV          0x30
 
 int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
index d11aa8baf91b7370bf40a18f5785522448933386..54e361ea5e83ee28593dddd8178a361b5e1b53f2 100644 (file)
@@ -50,6 +50,38 @@ void to_tm (int, struct rtc_time *);
 unsigned long mktime (unsigned int, unsigned int, unsigned int,
                      unsigned int, unsigned int, unsigned int);
 
+/**
+ * rtc_read8() - Read an 8-bit register
+ *
+ * @reg:       Register to read
+ * @return value read
+ */
+int rtc_read8(int reg);
+
+/**
+ * rtc_write8() - Write an 8-bit register
+ *
+ * @reg:       Register to write
+ * @value:     Value to write
+ */
+void rtc_write8(int reg, uchar val);
+
+/**
+ * rtc_read32() - Read a 32-bit value from the RTC
+ *
+ * @reg:       Offset to start reading from
+ * @return value read
+ */
+u32 rtc_read32(int reg);
+
+/**
+ * rtc_write32() - Write a 32-bit value to the RTC
+ *
+ * @reg:       Register to start writing to
+ * @value:     Value to write
+ */
+void rtc_write32(int reg, u32 value);
+
 /**
  * rtc_init() - Set up the real time clock ready for use
  */
index aa4a0e9654dd6262839aec65df1d8fab08e16076..23893b57408056ea3cd077af2923a300e53c36fb 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <asm/io.h>
 #include <mmc.h>
-#include <fdtdec.h>
+#include <asm/gpio.h>
 
 /*
  * Controller registers
@@ -246,8 +246,8 @@ struct sdhci_host {
        int index;
 
        int bus_width;
-       struct fdt_gpio_state pwr_gpio; /* Power GPIO */
-       struct fdt_gpio_state cd_gpio;          /* Card Detect GPIO */
+       struct gpio_desc pwr_gpio;      /* Power GPIO */
+       struct gpio_desc cd_gpio;               /* Card Detect GPIO */
 
        void (*set_control_reg)(struct sdhci_host *host);
        void (*set_clock)(int dev_index, unsigned int div);
index 2aca954e73ab108dbd0f20fa84648d64e44fe1bb..14606c303180a43a551977caf2d13a41ca187c87 100644 (file)
@@ -38,7 +38,12 @@ typedef struct {
        xilinx_post_fn  post;
 } xilinx_spartan2_slave_serial_fns;
 
+#if defined(CONFIG_FPGA_SPARTAN2)
 extern struct xilinx_fpga_op spartan2_op;
+# define FPGA_SPARTAN2_OPS     &spartan2_op
+#else
+# define FPGA_SPARTAN2_OPS     NULL
+#endif
 
 /* Device Image Sizes
  *********************************************************************/
@@ -61,36 +66,47 @@ extern struct xilinx_fpga_op spartan2_op;
  *********************************************************************/
 /* Spartan-II devices */
 #define XILINX_XC2S15_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S30_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S50_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S100_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S150_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S200_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S50E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S100E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S150E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S200E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #define XILINX_XC2S300E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie, &spartan2_op }
+{ xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN2_OPS }
 
 #endif /* _SPARTAN2_H_ */
index d6d67a6e560cf4ad45d043a44b4be5fa277118e8..fcb27b01e4a7ea261b2126abe4a5d2c56371c556 100644 (file)
@@ -40,7 +40,12 @@ typedef struct {
        xilinx_abort_fn abort;
 } xilinx_spartan3_slave_serial_fns;
 
+#if defined(CONFIG_FPGA_SPARTAN3)
 extern struct xilinx_fpga_op spartan3_op;
+# define FPGA_SPARTAN3_OPS     &spartan3_op
+#else
+# define FPGA_SPARTAN3_OPS     NULL
+#endif
 
 /* Device Image Sizes
  *********************************************************************/
@@ -71,48 +76,60 @@ extern struct xilinx_fpga_op spartan3_op;
  *********************************************************************/
 /* Spartan-III devices */
 #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 /* Spartan-3E devices */
 #define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
 { xilinx_spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie, \
-       &spartan3_op }
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
 { xilinx_spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie, \
-       &spartan3_op }
+       FPGA_SPARTAN3_OPS }
 
 #define XILINX_XC6SLX4_DESC(iface, fn_table, cookie) \
-{ xilinx_spartan3, iface, XILINK_XC6SLX4_SIZE, fn_table, cookie, &spartan3_op }
+{ xilinx_spartan3, iface, XILINK_XC6SLX4_SIZE, fn_table, cookie, \
+       FPGA_SPARTAN3_OPS }
 
 #endif /* _SPARTAN3_H_ */
index ec17bd0bcc8963e4c4e402e57c0003d3b839b568..c58e453559616eb1cbbca36ee20704afcd4ebecc 100644 (file)
 #define SPI_DEFAULT_WORDLEN 8
 
 #ifdef CONFIG_DM_SPI
+/* TODO(sjg@chromium.org): Remove this and use max_hz from struct spi_slave */
 struct dm_spi_bus {
        uint max_hz;
 };
 
+/**
+ * struct dm_spi_platdata - platform data for all SPI slaves
+ *
+ * This describes a SPI slave, a child device of the SPI bus. To obtain this
+ * struct from a spi_slave, use dev_get_parent_platdata(dev) or
+ * dev_get_parent_platdata(slave->dev).
+ *
+ * This data is immuatable. Each time the device is probed, @max_hz and @mode
+ * will be copied to struct spi_slave.
+ *
+ * @cs:                Chip select number (0..n-1)
+ * @max_hz:    Maximum bus speed that this slave can tolerate
+ * @mode:      SPI mode to use for this device (see SPI mode flags)
+ */
+struct dm_spi_slave_platdata {
+       unsigned int cs;
+       uint max_hz;
+       uint mode;
+};
+
 #endif /* CONFIG_DM_SPI */
 
 /**
  * struct spi_slave - Representation of a SPI slave
  *
  * For driver model this is the per-child data used by the SPI bus. It can
- * be accessed using dev_get_parentdata() on the slave device. Each SPI
- * driver should define this child data in its U_BOOT_DRIVER() definition:
- *
- *     .per_child_auto_alloc_size      = sizeof(struct spi_slave),
+ * be accessed using dev_get_parentdata() on the slave device. The SPI uclass
+ * sets uip per_child_auto_alloc_size to sizeof(struct spi_slave), and the
+ * driver should not override it. Two platform data fields (max_hz and mode)
+ * are copied into this structure to provide an initial value. This allows
+ * them to be changed, since we should never change platform data in drivers.
  *
  * If not using driver model, drivers are expected to extend this with
  * controller-specific data.
@@ -97,8 +119,8 @@ struct spi_slave {
        uint mode;
 #else
        unsigned int bus;
-#endif
        unsigned int cs;
+#endif
        u8 op_mode_rx;
        u8 op_mode_tx;
        unsigned int wordlen;
@@ -545,16 +567,16 @@ int spi_chip_select(struct udevice *slave);
 int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp);
 
 /**
- * spi_ofdata_to_platdata() - decode standard SPI platform data
+ * spi_slave_ofdata_to_platdata() - decode standard SPI platform data
  *
- * This decodes the speed and mode from a device tree node and puts it into
- * the spi_slave structure.
+ * This decodes the speed and mode for a slave from a device tree node
  *
  * @blob:      Device tree blob
  * @node:      Node offset to read from
- * @spi:       Place to put the decoded information
+ * @plat:      Place to put the decoded information
  */
-int spi_ofdata_to_platdata(const void *blob, int node, struct spi_slave *spi);
+int spi_slave_ofdata_to_platdata(const void *blob, int node,
+                                struct dm_spi_slave_platdata *plat);
 
 /**
  * spi_cs_info() - Check information on a chip select
index c996fb3e4c10eaf7c73451bbc8e7cf420b96d3d3..3c69d85ecbac7956a525b2e188943b46193259a3 100644 (file)
@@ -16,9 +16,18 @@ extern const uint8_t padding_sha256_rsa4096[];
 extern const uint8_t padding_sha256_rsa2048[];
 extern const uint8_t padding_sha1_rsa2048[];
 
-void sha256_calculate(const struct image_region region[], int region_count,
-                     uint8_t *checksum);
-void sha1_calculate(const struct image_region region[], int region_count,
-                   uint8_t *checksum);
+/**
+ * hash_calculate() - Calculate hash over the data
+ *
+ * @name:  Name of algorithm to be used for hash calculation
+ * @region: Array having info of regions over which hash needs to be calculated
+ * @region_count: Number of regions in the region array
+ * @checksum: Buffer contanining the output hash
+ *
+ * @return 0 if OK, < 0 if error
+ */
+int hash_calculate(const char *name,
+                  const struct image_region region[], int region_count,
+                  uint8_t *checksum);
 
 #endif
diff --git a/include/u-boot/rsa-mod-exp.h b/include/u-boot/rsa-mod-exp.h
new file mode 100644 (file)
index 0000000..fce445a
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, Ruchika Gupta.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+*/
+
+#ifndef _RSA_MOD_EXP_H
+#define _RSA_MOD_EXP_H
+
+#include <errno.h>
+#include <image.h>
+
+/**
+ * struct key_prop - holder for a public key properties
+ *
+ * The struct has pointers to modulus (Typically called N),
+ * The inverse, R^2, exponent. These can be typecasted and
+ * used as byte arrays or converted to the required format
+ * as per requirement of RSA implementation.
+ */
+struct key_prop {
+       const void *rr;         /* R^2 can be treated as byte array */
+       const void *modulus;    /* modulus as byte array */
+       const void *public_exponent; /* public exponent as byte array */
+       uint32_t n0inv;         /* -1 / modulus[0] mod 2^32 */
+       int num_bits;           /* Key length in bits */
+       uint32_t exp_len;       /* Exponent length in number of uint8_t */
+};
+
+/**
+ * rsa_mod_exp_sw() - Perform RSA Modular Exponentiation in sw
+ *
+ * Operation: out[] = sig ^ exponent % modulus
+ *
+ * @sig:       RSA PKCS1.5 signature
+ * @sig_len:   Length of signature in number of bytes
+ * @node:      Node with RSA key elements like modulus, exponent, R^2, n0inv
+ * @out:       Result in form of byte array of len equal to sig_len
+ */
+int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *node, uint8_t *out);
+
+int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *node, uint8_t *out);
+
+/**
+ * struct struct mod_exp_ops - Driver model for RSA Modular Exponentiation
+ *                             operations
+ *
+ * The uclass interface is implemented by all crypto devices which use
+ * driver model.
+ */
+struct mod_exp_ops {
+       /**
+        * Perform Modular Exponentiation
+        *
+        * Operation: out[] = sig ^ exponent % modulus
+        *
+        * @dev:        RSA Device
+        * @sig:        RSA PKCS1.5 signature
+        * @sig_len:    Length of signature in number of bytes
+        * @node:       Node with RSA key elements like modulus, exponent,
+        *              R^2, n0inv
+        * @out:        Result in form of byte array of len equal to sig_len
+        *
+        * This function computes exponentiation over the signature.
+        * Returns: 0 if exponentiation is successful, or a negative value
+        * if it wasn't.
+        */
+       int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
+                          uint32_t sig_len, struct key_prop *node,
+                          uint8_t *outp);
+};
+
+#endif
index d3c741597c64f64c06281f3d3ce807769d91f4e9..a8fee0bdb76f59a30e478286d06abb1d8201ce8a 100644 (file)
@@ -120,6 +120,7 @@ struct usb_device {
         * Each instance needs its own set of data structures.
         */
        unsigned long status;
+       unsigned long int_pending;      /* 1 bit per ep, used by int_queue */
        int act_len;                    /* transfered bytes */
        int maxchild;                   /* Number of ports if hub */
        int portnr;
@@ -154,11 +155,16 @@ enum usb_init_type {
        defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
        defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) || \
        defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
-       defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_XHCI) || \
-       defined(CONFIG_USB_DWC2)
+       defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) || \
+       defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2)
 
 int usb_lowlevel_init(int index, enum usb_init_type init, void **controller);
 int usb_lowlevel_stop(int index);
+#ifdef CONFIG_MUSB_HOST
+void usb_reset_root_port(void);
+#else
+#define usb_reset_root_port()
+#endif
 
 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
                        void *buffer, int transfer_len);
@@ -167,9 +173,9 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        int transfer_len, int interval);
 
-#ifdef CONFIG_USB_EHCI /* Only the ehci code has pollable int support */
+#if defined CONFIG_USB_EHCI || defined CONFIG_MUSB_HOST
 struct int_queue *create_int_queue(struct usb_device *dev, unsigned long pipe,
-       int queuesize, int elementsize, void *buffer);
+       int queuesize, int elementsize, void *buffer, int interval);
 int destroy_int_queue(struct usb_device *dev, struct int_queue *queue);
 void *poll_int_queue(struct usb_device *dev, struct int_queue *queue);
 #endif
index d4056914c4eb106b431be60828b311846c4aded6..c5deee9eca9d6e4c6997e6422c6d8cff802a3033 100644 (file)
@@ -35,10 +35,14 @@ struct __packed screen_info_input {
 struct __packed vbe_info {
        char signature[4];
        u16 version;
-       u8 *oem_string_ptr;
+       u32 oem_string_ptr;
        u32 capabilities;
-       u16 video_mode_list[256];
+       u32 modes_ptr;
        u16 total_memory;
+       u16 oem_version;
+       u32 vendor_name_ptr;
+       u32 product_name_ptr;
+       u32 product_rev_ptr;
 };
 
 struct __packed vesa_mode_info {
@@ -96,6 +100,7 @@ struct vbe_ddc_info {
 #define VESA_GET_INFO          0x4f00
 #define VESA_GET_MODE_INFO     0x4f01
 #define VESA_SET_MODE          0x4f02
+#define VESA_GET_CUR_MODE      0x4f03
 
 struct graphic_device;
 int vbe_get_video_info(struct graphic_device *gdev);
index 7b7825f513e358be83dbbbb753bd75569892d007..503df9abaeaa2cc9e2769ecb6c776393d356d9fc 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <xilinx.h>
 
-extern struct xilinx_fpga_op virtex2_op;
-
 /*
  * Slave SelectMap Implementation function table.
  */
@@ -40,12 +38,19 @@ typedef struct {
        xilinx_wdata_fn wdata;
 } xilinx_virtex2_slave_serial_fns;
 
+#if defined(CONFIG_FPGA_VIRTEX2)
+extern struct xilinx_fpga_op virtex2_op;
+# define FPGA_VIRTEX2_OPS      &virtex2_op
+#else
+# define FPGA_VIRTEX2_OPS      NULL
+#endif
+
 /* Device Image Sizes (in bytes)
  *********************************************************************/
-#define XILINX_XC2V40_SIZE             (338208 / 8)
-#define XILINX_XC2V80_SIZE             (597408 / 8)
-#define XILINX_XC2V250_SIZE            (1591584 / 8)
-#define XILINX_XC2V500_SIZE            (2557857 / 8)
+#define XILINX_XC2V40_SIZE     (338208 / 8)
+#define XILINX_XC2V80_SIZE     (597408 / 8)
+#define XILINX_XC2V250_SIZE    (1591584 / 8)
+#define XILINX_XC2V500_SIZE    (2557857 / 8)
 #define XILINX_XC2V1000_SIZE   (3749408 / 8)
 #define XILINX_XC2V1500_SIZE   (5166240 / 8)
 #define XILINX_XC2V2000_SIZE   (6808352 / 8)
@@ -58,39 +63,51 @@ typedef struct {
 /* Descriptor Macros
  *********************************************************************/
 #define XILINX_XC2V40_DESC(iface, fn_table, cookie)    \
-{ xilinx_virtex2, iface, XILINX_XC2V40_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V40_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V80_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V80_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V80_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V250_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V250_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V250_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V500_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V500_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V500_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V1000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V1000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V1000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V1500_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V1500_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V1500_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V2000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V2000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V2000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V3000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V3000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V3000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V4000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V4000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V4000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V6000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V6000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V6000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V8000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V8000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V8000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #define XILINX_XC2V10000_DESC(iface, fn_table, cookie) \
-{ xilinx_virtex2, iface, XILINX_XC2V10000_SIZE, fn_table, cookie, &virtex2_op }
+{ xilinx_virtex2, iface, XILINX_XC2V10000_SIZE, fn_table, cookie, \
+       FPGA_VIRTEX2_OPS }
 
 #endif /* _VIRTEX2_H_ */
diff --git a/include/vsc9953.h b/include/vsc9953.h
new file mode 100644 (file)
index 0000000..3d11b87
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ *  vsc9953.h
+ *
+ *  Driver for the Vitesse VSC9953 L2 Switch
+ *
+ *  This software may be used and distributed according to the
+ *  terms of the GNU Public License, Version 2, incorporated
+ *  herein by reference.
+ *
+ * Copyright 2013  Freescale Semiconductor, Inc.
+ *
+ */
+
+#ifndef _VSC9953_H_
+#define _VSC9953_H_
+
+#include <config.h>
+#include <miiphy.h>
+#include <asm/types.h>
+#include <malloc.h>
+
+#define VSC9953_OFFSET                 (CONFIG_SYS_CCSRBAR_DEFAULT + 0x800000)
+
+#define VSC9953_SYS_OFFSET             0x010000
+#define VSC9953_DEV_GMII_OFFSET                0x100000
+#define VSC9953_QSYS_OFFSET            0x200000
+#define VSC9953_ANA_OFFSET             0x280000
+#define VSC9953_DEVCPU_GCB             0x070000
+#define VSC9953_ES0                    0x040000
+#define VSC9953_IS1                    0x050000
+#define VSC9953_IS2                    0x060000
+
+#define T1040_SWITCH_GMII_DEV_OFFSET   0x010000
+#define VSC9953_PHY_REGS_OFFST         0x0000AC
+
+#define CONFIG_VSC9953_SOFT_SWC_RST_ENA        0x00000001
+#define CONFIG_VSC9953_CORE_ENABLE     0x80
+#define CONFIG_VSC9953_MEM_ENABLE      0x40
+#define CONFIG_VSC9953_MEM_INIT                0x20
+
+#define CONFIG_VSC9953_PORT_ENA                0x00003a00
+#define CONFIG_VSC9953_MAC_ENA_CFG     0x00000011
+#define CONFIG_VSC9953_MAC_MODE_CFG    0x00000011
+#define CONFIG_VSC9953_MAC_IFG_CFG     0x00000515
+#define CONFIG_VSC9953_MAC_HDX_CFG     0x00001043
+#define CONFIG_VSC9953_CLOCK_CFG       0x00000001
+#define CONFIG_VSC9953_CLOCK_CFG_1000M 0x00000001
+#define CONFIG_VSC9953_PFC_FC          0x00000001
+#define CONFIG_VSC9953_PFC_FC_QSGMII   0x00000000
+#define CONFIG_VSC9953_MAC_FC_CFG      0x04700000
+#define CONFIG_VSC9953_MAC_FC_CFG_QSGMII       0x00700000
+#define CONFIG_VSC9953_PAUSE_CFG       0x001ffffe
+#define CONFIG_VSC9953_TOT_TAIL_DROP_LVL       0x000003ff
+#define CONFIG_VSC9953_FRONT_PORT_MODE 0x00000000
+#define CONFIG_VSC9953_MAC_MAX_LEN     0x000005ee
+
+#define        CONFIG_VSC9953_VCAP_MV_CFG      0x0000ffff
+#define        CONFIG_VSC9953_VCAP_UPDATE_CTRL 0x01000004
+#define VSC9953_MAX_PORTS              10
+#define VSC9953_PORT_CHECK(port)       \
+       (((port) < 0 || (port) >= VSC9953_MAX_PORTS) ? 0 : 1)
+#define VSC9953_INTERNAL_PORT_CHECK(port) ( \
+       ( \
+               (port) < VSC9953_MAX_PORTS - 2 || (port) >= VSC9953_MAX_PORTS \
+       ) ? 0 : 1 \
+)
+
+#define DEFAULT_VSC9953_MDIO_NAME      "VSC9953_MDIO0"
+
+#define MIIMIND_OPR_PEND               0x00000004
+
+struct vsc9953_mdio_info {
+       struct vsc9953_mii_mng  *regs;
+       char    *name;
+};
+
+/* VSC9953 ANA structure for T1040 U-boot*/
+
+struct vsc9953_ana_port {
+       u32     vlan_cfg;
+       u32     drop_cfg;
+       u32     qos_cfg;
+       u32     vcap_cfg;
+       u32     vcap_s1_key_cfg[3];
+       u32     vcap_s2_cfg;
+       u32     qos_pcp_dei_map_cfg[16];
+       u32     cpu_fwd_cfg;
+       u32     cpu_fwd_bpdu_cfg;
+       u32     cpu_fwd_garp_cfg;
+       u32     cpu_fwd_ccm_cfg;
+       u32     port_cfg;
+       u32     pol_cfg;
+       u32     reserved[34];
+};
+
+struct vsc9953_ana_pol {
+       u32     pol_pir_cfg;
+       u32     pol_cir_cfg;
+       u32     pol_mode_cfg;
+       u32     pol_pir_state;
+       u32     pol_cir_state;
+       u32     reserved1[3];
+};
+
+struct vsc9953_ana_ana_tables {
+       u32     entry_lim[11];
+       u32     an_moved;
+       u32     mach_data;
+       u32     macl_data;
+       u32     mac_access;
+       u32     mact_indx;
+       u32     vlan_access;
+       u32     vlan_tidx;
+};
+
+struct vsc9953_ana_ana {
+       u32     adv_learn;
+       u32     vlan_mask;
+       u32     anag_efil;
+       u32     an_events;
+       u32     storm_limit_burst;
+       u32     storm_limit_cfg[4];
+       u32     isolated_prts;
+       u32     community_ports;
+       u32     auto_age;
+       u32     mac_options;
+       u32     learn_disc;
+       u32     agen_ctrl;
+       u32     mirror_ports;
+       u32     emirror_ports;
+       u32     flooding;
+       u32     flooding_ipmc;
+       u32     sflow_cfg[11];
+       u32     port_mode[12];
+};
+
+struct vsc9953_ana_pgid {
+       u32     port_grp_id[91];
+};
+
+struct vsc9953_ana_pfc {
+       u32     pfc_cfg;
+       u32     reserved1[15];
+};
+
+struct vsc9953_ana_pol_misc {
+       u32     pol_flowc[10];
+       u32     reserved1[17];
+       u32     pol_hyst;
+};
+
+struct vsc9953_ana_common {
+       u32     aggr_cfg;
+       u32     cpuq_cfg;
+       u32     cpuq_8021_cfg;
+       u32     dscp_cfg;
+       u32     dscp_rewr_cfg;
+       u32     vcap_rng_type_cfg;
+       u32     vcap_rng_val_cfg;
+       u32     discard_cfg;
+       u32     fid_cfg;
+};
+
+struct vsc9953_analyzer {
+       struct vsc9953_ana_port port[11];
+       u32     reserved1[9536];
+       struct vsc9953_ana_pol  pol[164];
+       struct vsc9953_ana_ana_tables   ana_tables;
+       u32     reserved2[14];
+       struct vsc9953_ana_ana  ana;
+       u32     reserved3[22];
+       struct vsc9953_ana_pgid port_id_tbl;
+       u32     reserved4[549];
+       struct vsc9953_ana_pfc  pfc[10];
+       struct vsc9953_ana_pol_misc     pol_misc;
+       u32     reserved5[196];
+       struct vsc9953_ana_common       common;
+};
+/* END VSC9953 ANA structure for T1040 U-boot*/
+
+/* VSC9953 DEV_GMII structure for T1040 U-boot*/
+
+struct vsc9953_dev_gmii_port_mode {
+       u32     clock_cfg;
+       u32     port_misc;
+       u32     reserved1;
+       u32     eee_cfg;
+};
+
+struct vsc9953_dev_gmii_mac_cfg_status {
+       u32     mac_ena_cfg;
+       u32     mac_mode_cfg;
+       u32     mac_maxlen_cfg;
+       u32     mac_tags_cfg;
+       u32     mac_adv_chk_cfg;
+       u32     mac_ifg_cfg;
+       u32     mac_hdx_cfg;
+       u32     mac_fc_mac_low_cfg;
+       u32     mac_fc_mac_high_cfg;
+       u32     mac_sticky;
+};
+
+struct vsc9953_dev_gmii {
+       struct vsc9953_dev_gmii_port_mode       port_mode;
+       struct vsc9953_dev_gmii_mac_cfg_status  mac_cfg_status;
+};
+
+/* END VSC9953 DEV_GMII structure for T1040 U-boot*/
+
+/* VSC9953 QSYS structure for T1040 U-boot*/
+
+struct vsc9953_qsys_hsch {
+       u32     cir_cfg;
+       u32     reserved1;
+       u32     se_cfg;
+       u32     se_dwrr_cfg[8];
+       u32     cir_state;
+       u32     reserved2[20];
+};
+
+struct vsc9953_qsys_sys {
+       u32     port_mode[12];
+       u32     switch_port_mode[11];
+       u32     stat_cnt_cfg;
+       u32     eee_cfg[10];
+       u32     eee_thrs;
+       u32     igr_no_sharing;
+       u32     egr_no_sharing;
+       u32     sw_status[11];
+       u32     ext_cpu_cfg;
+       u32     cpu_group_map;
+       u32     reserved1[23];
+};
+
+struct vsc9953_qsys_qos_cfg {
+       u32     red_profile[16];
+       u32     res_qos_mode;
+};
+
+struct vsc9953_qsys_drop_cfg {
+       u32     egr_drop_mode;
+};
+
+struct vsc9953_qsys_mmgt {
+       u32     eq_cntrl;
+       u32     reserved1;
+};
+
+struct vsc9953_qsys_hsch_misc {
+       u32     hsch_misc_cfg;
+       u32     reserved1[546];
+};
+
+struct vsc9953_qsys_res_ctrl {
+       u32     res_cfg;
+       u32     res_stat;
+
+};
+
+struct vsc9953_qsys_reg {
+       struct vsc9953_qsys_hsch        hsch[108];
+       struct vsc9953_qsys_sys sys;
+       struct vsc9953_qsys_qos_cfg     qos_cfg;
+       struct vsc9953_qsys_drop_cfg    drop_cfg;
+       struct vsc9953_qsys_mmgt        mmgt;
+       struct vsc9953_qsys_hsch_misc   hsch_misc;
+       struct vsc9953_qsys_res_ctrl    res_ctrl[1024];
+};
+
+/* END VSC9953 QSYS structure for T1040 U-boot*/
+
+/* VSC9953 SYS structure for T1040 U-boot*/
+
+struct vsc9953_sys_stat {
+       u32     rx_cntrs[64];
+       u32     tx_cntrs[64];
+       u32     drop_cntrs[64];
+       u32     reserved1[6];
+};
+
+struct vsc9953_sys_sys {
+       u32     reset_cfg;
+       u32     reserved1;
+       u32     vlan_etype_cfg;
+       u32     port_mode[12];
+       u32     front_port_mode[10];
+       u32     frame_aging;
+       u32     stat_cfg;
+       u32     reserved2[50];
+};
+
+struct vsc9953_sys_pause_cfg {
+       u32     pause_cfg[11];
+       u32     pause_tot_cfg;
+       u32     tail_drop_level[11];
+       u32     tot_tail_drop_lvl;
+       u32     mac_fc_cfg[10];
+};
+
+struct vsc9953_sys_mmgt {
+       u16     free_cnt;
+};
+
+struct vsc9953_system_reg {
+       struct vsc9953_sys_stat stat;
+       struct vsc9953_sys_sys  sys;
+       struct vsc9953_sys_pause_cfg    pause_cfg;
+       struct vsc9953_sys_mmgt mmgt;
+};
+
+/* END VSC9953 SYS structure for T1040 U-boot*/
+
+
+/* VSC9953 DEVCPU_GCB structure for T1040 U-boot*/
+
+struct vsc9953_chip_regs {
+       u32     chipd_id;
+       u32     gpr;
+       u32     soft_rst;
+};
+
+struct vsc9953_gpio {
+       u32     gpio_out_set[10];
+       u32     gpio_out_clr[10];
+       u32     gpio_out[10];
+       u32     gpio_in[10];
+};
+
+struct vsc9953_mii_mng {
+       u32     miimstatus;
+       u32     reserved1;
+       u32     miimcmd;
+       u32     miimdata;
+       u32     miimcfg;
+       u32     miimscan_0;
+       u32     miimscan_1;
+       u32     miiscan_lst_rslts;
+       u32     miiscan_lst_rslts_valid;
+};
+
+struct vsc9953_mii_read_scan {
+       u32     mii_scan_results_sticky[2];
+};
+
+struct vsc9953_devcpu_gcb {
+       struct vsc9953_chip_regs        chip_regs;
+       struct vsc9953_gpio             gpio;
+       struct vsc9953_mii_mng  mii_mng[2];
+       struct vsc9953_mii_read_scan    mii_read_scan;
+};
+
+/* END VSC9953 DEVCPU_GCB structure for T1040 U-boot*/
+
+/* VSC9953 IS* structure for T1040 U-boot*/
+
+struct vsc9953_vcap_core_cfg   {
+       u32     vcap_update_ctrl;
+       u32     vcap_mv_cfg;
+};
+
+struct vsc9953_vcap {
+struct vsc9953_vcap_core_cfg   vcap_core_cfg;
+};
+
+/* END VSC9953 IS* structure for T1040 U-boot*/
+
+#define VSC9953_PORT_INFO_INITIALIZER(idx) \
+{                                                                      \
+       .enabled        = 0,                                            \
+       .phyaddr        = 0,                                            \
+       .index          = idx,                                          \
+       .phy_regs       = NULL,                                         \
+       .enet_if        = PHY_INTERFACE_MODE_NONE,                      \
+       .bus            = NULL,                                         \
+       .phydev         = NULL,                                         \
+}
+
+/* Structure to describe a VSC9953 port */
+struct vsc9953_port_info {
+       u8      enabled;
+       u8      phyaddr;
+       int     index;
+       void    *phy_regs;
+       phy_interface_t enet_if;
+       struct mii_dev  *bus;
+       struct phy_device       *phydev;
+};
+
+/* Structure to describe a VSC9953 switch */
+struct vsc9953_info {
+       struct  vsc9953_port_info       port[VSC9953_MAX_PORTS];
+};
+
+void vsc9953_init(bd_t *bis);
+
+void vsc9953_port_info_set_mdio(int port, struct mii_dev *bus);
+void vsc9953_port_info_set_phy_address(int port, int address);
+void vsc9953_port_enable(int port);
+void vsc9953_port_disable(int port);
+void vsc9953_port_info_set_phy_int(int port, phy_interface_t phy_int);
+
+#endif /* _VSC9953_H_ */
index 8a9ec3297fbe5b576f434cf4812d736cf88baf49..1d37a51a04ef8e3f65f6cbddd166f7b27e227d55 100644 (file)
 
 #include <xilinx.h>
 
+#if defined(CONFIG_FPGA_ZYNQPL)
 extern struct xilinx_fpga_op zynq_op;
+# define FPGA_ZYNQPL_OPS       &zynq_op
+#else
+# define FPGA_ZYNQPL_OPS       NULL
+#endif
 
 #define XILINX_ZYNQ_7010       0x2
 #define XILINX_ZYNQ_7015       0x1b
 #define XILINX_ZYNQ_7020       0x7
 #define XILINX_ZYNQ_7030       0xc
+#define XILINX_ZYNQ_7035       0x12
 #define XILINX_ZYNQ_7045       0x11
 #define XILINX_ZYNQ_7100       0x16
 
@@ -26,26 +32,37 @@ extern struct xilinx_fpga_op zynq_op;
 #define XILINX_XC7Z015_SIZE    28085344/8
 #define XILINX_XC7Z020_SIZE    32364512/8
 #define XILINX_XC7Z030_SIZE    47839328/8
+#define XILINX_XC7Z035_SIZE    106571232/8
 #define XILINX_XC7Z045_SIZE    106571232/8
 #define XILINX_XC7Z100_SIZE    139330784/8
 
 /* Descriptor Macros */
 #define XILINX_XC7Z010_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z010_SIZE, NULL, cookie, &zynq_op, "7z010" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z010_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z010" }
 
 #define XILINX_XC7Z015_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z015_SIZE, NULL, cookie, &zynq_op, "7z015" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z015_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z015" }
 
 #define XILINX_XC7Z020_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z020_SIZE, NULL, cookie, &zynq_op, "7z020" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z020_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z020" }
 
 #define XILINX_XC7Z030_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z030_SIZE, NULL, cookie, &zynq_op, "7z030" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z030_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z030" }
+
+#define XILINX_XC7Z035_DESC(cookie) \
+{ xilinx_zynq, devcfg, XILINX_XC7Z035_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z035" }
 
 #define XILINX_XC7Z045_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z045_SIZE, NULL, cookie, &zynq_op, "7z045" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z045_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z045" }
 
 #define XILINX_XC7Z100_DESC(cookie) \
-{ xilinx_zynq, devcfg, XILINX_XC7Z100_SIZE, NULL, cookie, &zynq_op, "7z100" }
+{ xilinx_zynq, devcfg, XILINX_XC7Z100_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z100" }
 
 #endif /* _ZYNQPL_H_ */
index 8460439d8e772d4126b78ad616059dd38a7dabff..a1f30a2c4ef0931483cf80010ef0674ea5dbbb58 100644 (file)
@@ -27,4 +27,6 @@ config SYS_HZ
          get_timer() must operate in milliseconds and this option must be
          set to 1000.
 
+source lib/rsa/Kconfig
+
 endmenu
index 487122eebcf64c9129abb60c91e91d328f207f29..5bf8f29b13e92fbfcb9f0d83132e0e6ac987d0e2 100644 (file)
@@ -11,8 +11,6 @@
 #include <fdtdec.h>
 #include <linux/ctype.h>
 
-#include <asm/gpio.h>
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -26,9 +24,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
        COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
        COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
-       COMPAT(NVIDIA_TEGRA114_I2C, "nvidia,tegra114-i2c"),
-       COMPAT(NVIDIA_TEGRA20_I2C, "nvidia,tegra20-i2c"),
-       COMPAT(NVIDIA_TEGRA20_DVC, "nvidia,tegra20-i2c-dvc"),
        COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
        COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
        COMPAT(NVIDIA_TEGRA20_KBC, "nvidia,tegra20-kbc"),
@@ -38,9 +33,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(NVIDIA_TEGRA124_SDMMC, "nvidia,tegra124-sdhci"),
        COMPAT(NVIDIA_TEGRA30_SDMMC, "nvidia,tegra30-sdhci"),
        COMPAT(NVIDIA_TEGRA20_SDMMC, "nvidia,tegra20-sdhci"),
-       COMPAT(NVIDIA_TEGRA20_SFLASH, "nvidia,tegra20-sflash"),
-       COMPAT(NVIDIA_TEGRA20_SLINK, "nvidia,tegra20-slink"),
-       COMPAT(NVIDIA_TEGRA114_SPI, "nvidia,tegra114-spi"),
        COMPAT(NVIDIA_TEGRA124_PCIE, "nvidia,tegra124-pcie"),
        COMPAT(NVIDIA_TEGRA30_PCIE, "nvidia,tegra30-pcie"),
        COMPAT(NVIDIA_TEGRA20_PCIE, "nvidia,tegra20-pcie"),
@@ -50,7 +42,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(SAMSUNG_S3C2440_I2C, "samsung,s3c2440-i2c"),
        COMPAT(SAMSUNG_EXYNOS5_SOUND, "samsung,exynos-sound"),
        COMPAT(WOLFSON_WM8994_CODEC, "wolfson,wm8994-codec"),
-       COMPAT(SAMSUNG_EXYNOS_SPI, "samsung,exynos-spi"),
        COMPAT(GOOGLE_CROS_EC, "google,cros-ec"),
        COMPAT(GOOGLE_CROS_EC_KEYB, "google,cros-ec-keyb"),
        COMPAT(SAMSUNG_EXYNOS_EHCI, "samsung,exynos-ehci"),
@@ -83,6 +74,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(INTEL_MODEL_206AX, "intel,model-206ax"),
        COMPAT(INTEL_GMA, "intel,gma"),
        COMPAT(AMS_AS3722, "ams,as3722"),
+       COMPAT(INTEL_ICH_SPI, "intel,ich-spi"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -678,99 +670,128 @@ int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
        return cell != NULL;
 }
 
-/**
- * Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
- * terminating item.
- *
- * @param blob         FDT blob to use
- * @param node         Node to look at
- * @param prop_name    Node property name
- * @param gpio         Array of gpio elements to fill from FDT. This will be
- *                     untouched if either 0 or an error is returned
- * @param max_count    Maximum number of elements allowed
- * @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
- * be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
- */
-int fdtdec_decode_gpios(const void *blob, int node, const char *prop_name,
-               struct fdt_gpio_state *gpio, int max_count)
+int fdtdec_parse_phandle_with_args(const void *blob, int src_node,
+                                  const char *list_name,
+                                  const char *cells_name,
+                                  int cell_count, int index,
+                                  struct fdtdec_phandle_args *out_args)
 {
-       const struct fdt_property *prop;
-       const u32 *cell;
-       const char *name;
-       int len, i;
-
-       debug("%s: %s\n", __func__, prop_name);
-       assert(max_count > 0);
-       prop = fdt_get_property(blob, node, prop_name, &len);
-       if (!prop) {
-               debug("%s: property '%s' missing\n", __func__, prop_name);
-               return -FDT_ERR_NOTFOUND;
-       }
-
-       /* We will use the name to tag the GPIO */
-       name = fdt_string(blob, fdt32_to_cpu(prop->nameoff));
-       cell = (u32 *)prop->data;
-       len /= sizeof(u32) * 3;         /* 3 cells per GPIO record */
-       if (len > max_count) {
-               debug(" %s: too many GPIOs / cells for "
-                       "property '%s'\n", __func__, prop_name);
-               return -FDT_ERR_BADLAYOUT;
-       }
-
-       /* Read out the GPIO data from the cells */
-       for (i = 0; i < len; i++, cell += 3) {
-               gpio[i].gpio = fdt32_to_cpu(cell[1]);
-               gpio[i].flags = fdt32_to_cpu(cell[2]);
-               gpio[i].name = name;
-       }
-
-       return len;
-}
+       const __be32 *list, *list_end;
+       int rc = 0, size, cur_index = 0;
+       uint32_t count = 0;
+       int node = -1;
+       int phandle;
+
+       /* Retrieve the phandle list property */
+       list = fdt_getprop(blob, src_node, list_name, &size);
+       if (!list)
+               return -ENOENT;
+       list_end = list + size / sizeof(*list);
 
-int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
-               struct fdt_gpio_state *gpio)
-{
-       int err;
+       /* Loop over the phandles until all the requested entry is found */
+       while (list < list_end) {
+               rc = -EINVAL;
+               count = 0;
 
-       debug("%s: %s\n", __func__, prop_name);
-       gpio->gpio = FDT_GPIO_NONE;
-       gpio->name = NULL;
-       err = fdtdec_decode_gpios(blob, node, prop_name, gpio, 1);
-       return err == 1 ? 0 : err;
-}
+               /*
+                * If phandle is 0, then it is an empty entry with no
+                * arguments.  Skip forward to the next entry.
+                */
+               phandle = be32_to_cpup(list++);
+               if (phandle) {
+                       /*
+                        * Find the provider node and parse the #*-cells
+                        * property to determine the argument length.
+                        *
+                        * This is not needed if the cell count is hard-coded
+                        * (i.e. cells_name not set, but cell_count is set),
+                        * except when we're going to return the found node
+                        * below.
+                        */
+                       if (cells_name || cur_index == index) {
+                               node = fdt_node_offset_by_phandle(blob,
+                                                                 phandle);
+                               if (!node) {
+                                       debug("%s: could not find phandle\n",
+                                             fdt_get_name(blob, src_node,
+                                                          NULL));
+                                       goto err;
+                               }
+                       }
 
-int fdtdec_get_gpio(struct fdt_gpio_state *gpio)
-{
-       int val;
+                       if (cells_name) {
+                               count = fdtdec_get_int(blob, node, cells_name,
+                                                      -1);
+                               if (count == -1) {
+                                       debug("%s: could not get %s for %s\n",
+                                             fdt_get_name(blob, src_node,
+                                                          NULL),
+                                             cells_name,
+                                             fdt_get_name(blob, node,
+                                                          NULL));
+                                       goto err;
+                               }
+                       } else {
+                               count = cell_count;
+                       }
 
-       if (!fdt_gpio_isvalid(gpio))
-               return -1;
+                       /*
+                        * Make sure that the arguments actually fit in the
+                        * remaining property data length
+                        */
+                       if (list + count > list_end) {
+                               debug("%s: arguments longer than property\n",
+                                     fdt_get_name(blob, src_node, NULL));
+                               goto err;
+                       }
+               }
 
-       val = gpio_get_value(gpio->gpio);
-       return gpio->flags & FDT_GPIO_ACTIVE_LOW ? val ^ 1 : val;
-}
+               /*
+                * All of the error cases above bail out of the loop, so at
+                * this point, the parsing is successful. If the requested
+                * index matches, then fill the out_args structure and return,
+                * or return -ENOENT for an empty entry.
+                */
+               rc = -ENOENT;
+               if (cur_index == index) {
+                       if (!phandle)
+                               goto err;
+
+                       if (out_args) {
+                               int i;
+
+                               if (count > MAX_PHANDLE_ARGS) {
+                                       debug("%s: too many arguments %d\n",
+                                             fdt_get_name(blob, src_node,
+                                                          NULL), count);
+                                       count = MAX_PHANDLE_ARGS;
+                               }
+                               out_args->node = node;
+                               out_args->args_count = count;
+                               for (i = 0; i < count; i++) {
+                                       out_args->args[i] =
+                                                       be32_to_cpup(list++);
+                               }
+                       }
 
-int fdtdec_set_gpio(struct fdt_gpio_state *gpio, int val)
-{
-       if (!fdt_gpio_isvalid(gpio))
-               return -1;
+                       /* Found it! return success */
+                       return 0;
+               }
 
-       val = gpio->flags & FDT_GPIO_ACTIVE_LOW ? val ^ 1 : val;
-       return gpio_set_value(gpio->gpio, val);
-}
+               node = -1;
+               list += count;
+               cur_index++;
+       }
 
-int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
-{
        /*
-        * Return success if there is no GPIO defined. This is used for
-        * optional GPIOs)
+        * Result will be one of:
+        * -ENOENT : index is for empty phandle
+        * -EINVAL : parsing error on data
+        * [1..n]  : Number of phandle (count mode; when index = -1)
         */
-       if (!fdt_gpio_isvalid(gpio))
-               return 0;
-
-       if (gpio_request(gpio->gpio, gpio->name))
-               return -1;
-       return 0;
+       rc = index < 0 ? cur_index : -ENOENT;
+ err:
+       return rc;
 }
 
 int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
diff --git a/lib/rsa/Kconfig b/lib/rsa/Kconfig
new file mode 100644 (file)
index 0000000..1268a1b
--- /dev/null
@@ -0,0 +1,27 @@
+config RSA
+       bool "Use RSA Library"
+       select RSA_FREESCALE_EXP if FSL_CAAM
+       select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+       help
+         RSA support. This enables the RSA algorithm used for FIT image
+         verification in U-Boot.
+         See doc/uImage.FIT/signature.txt for more details.
+
+if RSA
+config RSA_SOFTWARE_EXP
+       bool "Enable driver for RSA Modular Exponentiation in software"
+       depends on DM && RSA
+       help
+         Enables driver for modular exponentiation in software. This is a RSA
+         algorithm used in FIT image verification. It required RSA Key as
+         input.
+         See doc/uImage.FIT/signature.txt for more details.
+
+config RSA_FREESCALE_EXP
+       bool "Enable RSA Modular Exponentiation with FSL crypto accelerator"
+       depends on DM && RSA && FSL_CAAM
+       help
+       Enables driver for RSA modular exponentiation using Freescale cryptographic
+       accelerator - CAAM.
+
+endif
index a5a96cb680d16d1cea1f88375f2ca1ec7bfc1776..cc25b3ce6d9232c60ff0b848632265b8a2788626 100644 (file)
@@ -7,4 +7,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_FIT_SIGNATURE) += rsa-verify.o rsa-checksum.o
+obj-$(CONFIG_FIT_SIGNATURE) += rsa-verify.o rsa-checksum.o rsa-mod-exp.o
index 8d8b59f779a2bd7d5d9eeb413706c86b5307d9ff..68d9d651b02860ab6cf422be4be62565834370c6 100644 (file)
 #include <asm/byteorder.h>
 #include <asm/errno.h>
 #include <asm/unaligned.h>
+#include <hash.h>
 #else
 #include "fdt_host.h"
-#endif
-#include <u-boot/rsa.h>
 #include <u-boot/sha1.h>
 #include <u-boot/sha256.h>
+#endif
+#include <u-boot/rsa.h>
 
 /* PKCS 1.5 paddings as described in the RSA PKCS#1 v2.1 standard. */
 
@@ -136,28 +137,37 @@ const uint8_t padding_sha256_rsa4096[RSA4096_BYTES - SHA256_SUM_LEN] = {
        0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
 };
 
-void sha1_calculate(const struct image_region region[], int region_count,
-                   uint8_t *checksum)
+int hash_calculate(const char *name,
+                   const struct image_region region[],
+                   int region_count, uint8_t *checksum)
 {
-       sha1_context ctx;
+       struct hash_algo *algo;
+       int ret = 0;
+       void *ctx;
        uint32_t i;
        i = 0;
 
-       sha1_starts(&ctx);
-       for (i = 0; i < region_count; i++)
-               sha1_update(&ctx, region[i].data, region[i].size);
-       sha1_finish(&ctx, checksum);
-}
+       ret = hash_progressive_lookup_algo(name, &algo);
+       if (ret)
+               return ret;
 
-void sha256_calculate(const struct image_region region[], int region_count,
-                     uint8_t *checksum)
-{
-       sha256_context ctx;
-       uint32_t i;
-       i = 0;
+       ret = algo->hash_init(algo, &ctx);
+       if (ret)
+               return ret;
+
+       for (i = 0; i < region_count - 1; i++) {
+               ret = algo->hash_update(algo, ctx, region[i].data,
+                                       region[i].size, 0);
+               if (ret)
+                       return ret;
+       }
+
+       ret = algo->hash_update(algo, ctx, region[i].data, region[i].size, 1);
+       if (ret)
+               return ret;
+       ret = algo->hash_finish(algo, ctx, checksum, algo->digest_size);
+       if (ret)
+               return ret;
 
-       sha256_starts(&ctx);
-       for (i = 0; i < region_count; i++)
-               sha256_update(&ctx, region[i].data, region[i].size);
-       sha256_finish(&ctx, checksum);
+       return 0;
 }
diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c
new file mode 100644 (file)
index 0000000..4a6de2b
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2013, Google Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef USE_HOSTCC
+#include <common.h>
+#include <fdtdec.h>
+#include <asm/types.h>
+#include <asm/byteorder.h>
+#include <asm/errno.h>
+#include <asm/types.h>
+#include <asm/unaligned.h>
+#else
+#include "fdt_host.h"
+#include "mkimage.h"
+#include <fdt_support.h>
+#endif
+#include <u-boot/rsa.h>
+#include <u-boot/rsa-mod-exp.h>
+
+#define UINT64_MULT32(v, multby)  (((uint64_t)(v)) * ((uint32_t)(multby)))
+
+#define get_unaligned_be32(a) fdt32_to_cpu(*(uint32_t *)a)
+#define put_unaligned_be32(a, b) (*(uint32_t *)(b) = cpu_to_fdt32(a))
+
+/* Default public exponent for backward compatibility */
+#define RSA_DEFAULT_PUBEXP     65537
+
+/**
+ * subtract_modulus() - subtract modulus from the given value
+ *
+ * @key:       Key containing modulus to subtract
+ * @num:       Number to subtract modulus from, as little endian word array
+ */
+static void subtract_modulus(const struct rsa_public_key *key, uint32_t num[])
+{
+       int64_t acc = 0;
+       uint i;
+
+       for (i = 0; i < key->len; i++) {
+               acc += (uint64_t)num[i] - key->modulus[i];
+               num[i] = (uint32_t)acc;
+               acc >>= 32;
+       }
+}
+
+/**
+ * greater_equal_modulus() - check if a value is >= modulus
+ *
+ * @key:       Key containing modulus to check
+ * @num:       Number to check against modulus, as little endian word array
+ * @return 0 if num < modulus, 1 if num >= modulus
+ */
+static int greater_equal_modulus(const struct rsa_public_key *key,
+                                uint32_t num[])
+{
+       int i;
+
+       for (i = (int)key->len - 1; i >= 0; i--) {
+               if (num[i] < key->modulus[i])
+                       return 0;
+               if (num[i] > key->modulus[i])
+                       return 1;
+       }
+
+       return 1;  /* equal */
+}
+
+/**
+ * montgomery_mul_add_step() - Perform montgomery multiply-add step
+ *
+ * Operation: montgomery result[] += a * b[] / n0inv % modulus
+ *
+ * @key:       RSA key
+ * @result:    Place to put result, as little endian word array
+ * @a:         Multiplier
+ * @b:         Multiplicand, as little endian word array
+ */
+static void montgomery_mul_add_step(const struct rsa_public_key *key,
+               uint32_t result[], const uint32_t a, const uint32_t b[])
+{
+       uint64_t acc_a, acc_b;
+       uint32_t d0;
+       uint i;
+
+       acc_a = (uint64_t)a * b[0] + result[0];
+       d0 = (uint32_t)acc_a * key->n0inv;
+       acc_b = (uint64_t)d0 * key->modulus[0] + (uint32_t)acc_a;
+       for (i = 1; i < key->len; i++) {
+               acc_a = (acc_a >> 32) + (uint64_t)a * b[i] + result[i];
+               acc_b = (acc_b >> 32) + (uint64_t)d0 * key->modulus[i] +
+                               (uint32_t)acc_a;
+               result[i - 1] = (uint32_t)acc_b;
+       }
+
+       acc_a = (acc_a >> 32) + (acc_b >> 32);
+
+       result[i - 1] = (uint32_t)acc_a;
+
+       if (acc_a >> 32)
+               subtract_modulus(key, result);
+}
+
+/**
+ * montgomery_mul() - Perform montgomery mutitply
+ *
+ * Operation: montgomery result[] = a[] * b[] / n0inv % modulus
+ *
+ * @key:       RSA key
+ * @result:    Place to put result, as little endian word array
+ * @a:         Multiplier, as little endian word array
+ * @b:         Multiplicand, as little endian word array
+ */
+static void montgomery_mul(const struct rsa_public_key *key,
+               uint32_t result[], uint32_t a[], const uint32_t b[])
+{
+       uint i;
+
+       for (i = 0; i < key->len; ++i)
+               result[i] = 0;
+       for (i = 0; i < key->len; ++i)
+               montgomery_mul_add_step(key, result, a[i], b);
+}
+
+/**
+ * num_pub_exponent_bits() - Number of bits in the public exponent
+ *
+ * @key:       RSA key
+ * @num_bits:  Storage for the number of public exponent bits
+ */
+static int num_public_exponent_bits(const struct rsa_public_key *key,
+               int *num_bits)
+{
+       uint64_t exponent;
+       int exponent_bits;
+       const uint max_bits = (sizeof(exponent) * 8);
+
+       exponent = key->exponent;
+       exponent_bits = 0;
+
+       if (!exponent) {
+               *num_bits = exponent_bits;
+               return 0;
+       }
+
+       for (exponent_bits = 1; exponent_bits < max_bits + 1; ++exponent_bits)
+               if (!(exponent >>= 1)) {
+                       *num_bits = exponent_bits;
+                       return 0;
+               }
+
+       return -EINVAL;
+}
+
+/**
+ * is_public_exponent_bit_set() - Check if a bit in the public exponent is set
+ *
+ * @key:       RSA key
+ * @pos:       The bit position to check
+ */
+static int is_public_exponent_bit_set(const struct rsa_public_key *key,
+               int pos)
+{
+       return key->exponent & (1ULL << pos);
+}
+
+/**
+ * pow_mod() - in-place public exponentiation
+ *
+ * @key:       RSA key
+ * @inout:     Big-endian word array containing value and result
+ */
+static int pow_mod(const struct rsa_public_key *key, uint32_t *inout)
+{
+       uint32_t *result, *ptr;
+       uint i;
+       int j, k;
+
+       /* Sanity check for stack size - key->len is in 32-bit words */
+       if (key->len > RSA_MAX_KEY_BITS / 32) {
+               debug("RSA key words %u exceeds maximum %d\n", key->len,
+                     RSA_MAX_KEY_BITS / 32);
+               return -EINVAL;
+       }
+
+       uint32_t val[key->len], acc[key->len], tmp[key->len];
+       uint32_t a_scaled[key->len];
+       result = tmp;  /* Re-use location. */
+
+       /* Convert from big endian byte array to little endian word array. */
+       for (i = 0, ptr = inout + key->len - 1; i < key->len; i++, ptr--)
+               val[i] = get_unaligned_be32(ptr);
+
+       if (0 != num_public_exponent_bits(key, &k))
+               return -EINVAL;
+
+       if (k < 2) {
+               debug("Public exponent is too short (%d bits, minimum 2)\n",
+                     k);
+               return -EINVAL;
+       }
+
+       if (!is_public_exponent_bit_set(key, 0)) {
+               debug("LSB of RSA public exponent must be set.\n");
+               return -EINVAL;
+       }
+
+       /* the bit at e[k-1] is 1 by definition, so start with: C := M */
+       montgomery_mul(key, acc, val, key->rr); /* acc = a * RR / R mod n */
+       /* retain scaled version for intermediate use */
+       memcpy(a_scaled, acc, key->len * sizeof(a_scaled[0]));
+
+       for (j = k - 2; j > 0; --j) {
+               montgomery_mul(key, tmp, acc, acc); /* tmp = acc^2 / R mod n */
+
+               if (is_public_exponent_bit_set(key, j)) {
+                       /* acc = tmp * val / R mod n */
+                       montgomery_mul(key, acc, tmp, a_scaled);
+               } else {
+                       /* e[j] == 0, copy tmp back to acc for next operation */
+                       memcpy(acc, tmp, key->len * sizeof(acc[0]));
+               }
+       }
+
+       /* the bit at e[0] is always 1 */
+       montgomery_mul(key, tmp, acc, acc); /* tmp = acc^2 / R mod n */
+       montgomery_mul(key, acc, tmp, val); /* acc = tmp * a / R mod M */
+       memcpy(result, acc, key->len * sizeof(result[0]));
+
+       /* Make sure result < mod; result is at most 1x mod too large. */
+       if (greater_equal_modulus(key, result))
+               subtract_modulus(key, result);
+
+       /* Convert to bigendian byte array */
+       for (i = key->len - 1, ptr = inout; (int)i >= 0; i--, ptr++)
+               put_unaligned_be32(result[i], ptr);
+       return 0;
+}
+
+static void rsa_convert_big_endian(uint32_t *dst, const uint32_t *src, int len)
+{
+       int i;
+
+       for (i = 0; i < len; i++)
+               dst[i] = fdt32_to_cpu(src[len - 1 - i]);
+}
+
+int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
+               struct key_prop *prop, uint8_t *out)
+{
+       struct rsa_public_key key;
+       int ret;
+
+       if (!prop) {
+               debug("%s: Skipping invalid prop", __func__);
+               return -EBADF;
+       }
+       key.n0inv = prop->n0inv;
+       key.len = prop->num_bits;
+
+       if (!prop->public_exponent)
+               key.exponent = RSA_DEFAULT_PUBEXP;
+       else
+               key.exponent =
+                       fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
+
+       if (!key.len || !prop->modulus || !prop->rr) {
+               debug("%s: Missing RSA key info", __func__);
+               return -EFAULT;
+       }
+
+       /* Sanity check for stack size */
+       if (key.len > RSA_MAX_KEY_BITS || key.len < RSA_MIN_KEY_BITS) {
+               debug("RSA key bits %u outside allowed range %d..%d\n",
+                     key.len, RSA_MIN_KEY_BITS, RSA_MAX_KEY_BITS);
+               return -EFAULT;
+       }
+       key.len /= sizeof(uint32_t) * 8;
+       uint32_t key1[key.len], key2[key.len];
+
+       key.modulus = key1;
+       key.rr = key2;
+       rsa_convert_big_endian(key.modulus, (uint32_t *)prop->modulus, key.len);
+       rsa_convert_big_endian(key.rr, (uint32_t *)prop->rr, key.len);
+       if (!key.modulus || !key.rr) {
+               debug("%s: Out of memory", __func__);
+               return -ENOMEM;
+       }
+
+       uint32_t buf[sig_len / sizeof(uint32_t)];
+
+       memcpy(buf, sig, sig_len);
+
+       ret = pow_mod(&key, buf);
+       if (ret)
+               return ret;
+
+       memcpy(out, buf, sig_len);
+
+       return 0;
+}
index 4ef19b66f4b12588f2bbe0a978500a0718177336..60126d22884b6e29dd18887ee7fbad90869ed049 100644 (file)
 #include <asm/errno.h>
 #include <asm/types.h>
 #include <asm/unaligned.h>
+#include <dm.h>
 #else
 #include "fdt_host.h"
 #include "mkimage.h"
 #include <fdt_support.h>
 #endif
+#include <u-boot/rsa-mod-exp.h>
 #include <u-boot/rsa.h>
-#include <u-boot/sha1.h>
-#include <u-boot/sha256.h>
-
-#define UINT64_MULT32(v, multby)  (((uint64_t)(v)) * ((uint32_t)(multby)))
-
-#define get_unaligned_be32(a) fdt32_to_cpu(*(uint32_t *)a)
-#define put_unaligned_be32(a, b) (*(uint32_t *)(b) = cpu_to_fdt32(a))
 
 /* Default public exponent for backward compatibility */
 #define RSA_DEFAULT_PUBEXP     65537
 
 /**
- * subtract_modulus() - subtract modulus from the given value
- *
- * @key:       Key containing modulus to subtract
- * @num:       Number to subtract modulus from, as little endian word array
- */
-static void subtract_modulus(const struct rsa_public_key *key, uint32_t num[])
-{
-       int64_t acc = 0;
-       uint i;
-
-       for (i = 0; i < key->len; i++) {
-               acc += (uint64_t)num[i] - key->modulus[i];
-               num[i] = (uint32_t)acc;
-               acc >>= 32;
-       }
-}
-
-/**
- * greater_equal_modulus() - check if a value is >= modulus
- *
- * @key:       Key containing modulus to check
- * @num:       Number to check against modulus, as little endian word array
- * @return 0 if num < modulus, 1 if num >= modulus
- */
-static int greater_equal_modulus(const struct rsa_public_key *key,
-                                uint32_t num[])
-{
-       int i;
-
-       for (i = (int)key->len - 1; i >= 0; i--) {
-               if (num[i] < key->modulus[i])
-                       return 0;
-               if (num[i] > key->modulus[i])
-                       return 1;
-       }
-
-       return 1;  /* equal */
-}
-
-/**
- * montgomery_mul_add_step() - Perform montgomery multiply-add step
- *
- * Operation: montgomery result[] += a * b[] / n0inv % modulus
- *
- * @key:       RSA key
- * @result:    Place to put result, as little endian word array
- * @a:         Multiplier
- * @b:         Multiplicand, as little endian word array
- */
-static void montgomery_mul_add_step(const struct rsa_public_key *key,
-               uint32_t result[], const uint32_t a, const uint32_t b[])
-{
-       uint64_t acc_a, acc_b;
-       uint32_t d0;
-       uint i;
-
-       acc_a = (uint64_t)a * b[0] + result[0];
-       d0 = (uint32_t)acc_a * key->n0inv;
-       acc_b = (uint64_t)d0 * key->modulus[0] + (uint32_t)acc_a;
-       for (i = 1; i < key->len; i++) {
-               acc_a = (acc_a >> 32) + (uint64_t)a * b[i] + result[i];
-               acc_b = (acc_b >> 32) + (uint64_t)d0 * key->modulus[i] +
-                               (uint32_t)acc_a;
-               result[i - 1] = (uint32_t)acc_b;
-       }
-
-       acc_a = (acc_a >> 32) + (acc_b >> 32);
-
-       result[i - 1] = (uint32_t)acc_a;
-
-       if (acc_a >> 32)
-               subtract_modulus(key, result);
-}
-
-/**
- * montgomery_mul() - Perform montgomery mutitply
+ * rsa_verify_key() - Verify a signature against some data using RSA Key
  *
- * Operation: montgomery result[] = a[] * b[] / n0inv % modulus
+ * Verify a RSA PKCS1.5 signature against an expected hash using
+ * the RSA Key properties in prop structure.
  *
- * @key:       RSA key
- * @result:    Place to put result, as little endian word array
- * @a:         Multiplier, as little endian word array
- * @b:         Multiplicand, as little endian word array
+ * @prop:      Specifies key
+ * @sig:       Signature
+ * @sig_len:   Number of bytes in signature
+ * @hash:      Pointer to the expected hash
+ * @algo:      Checksum algo structure having information on RSA padding etc.
+ * @return 0 if verified, -ve on error
  */
-static void montgomery_mul(const struct rsa_public_key *key,
-               uint32_t result[], uint32_t a[], const uint32_t b[])
-{
-       uint i;
-
-       for (i = 0; i < key->len; ++i)
-               result[i] = 0;
-       for (i = 0; i < key->len; ++i)
-               montgomery_mul_add_step(key, result, a[i], b);
-}
-
-/**
- * num_pub_exponent_bits() - Number of bits in the public exponent
- *
- * @key:       RSA key
- * @num_bits:  Storage for the number of public exponent bits
- */
-static int num_public_exponent_bits(const struct rsa_public_key *key,
-               int *num_bits)
-{
-       uint64_t exponent;
-       int exponent_bits;
-       const uint max_bits = (sizeof(exponent) * 8);
-
-       exponent = key->exponent;
-       exponent_bits = 0;
-
-       if (!exponent) {
-               *num_bits = exponent_bits;
-               return 0;
-       }
-
-       for (exponent_bits = 1; exponent_bits < max_bits + 1; ++exponent_bits)
-               if (!(exponent >>= 1)) {
-                       *num_bits = exponent_bits;
-                       return 0;
-               }
-
-       return -EINVAL;
-}
-
-/**
- * is_public_exponent_bit_set() - Check if a bit in the public exponent is set
- *
- * @key:       RSA key
- * @pos:       The bit position to check
- */
-static int is_public_exponent_bit_set(const struct rsa_public_key *key,
-               int pos)
-{
-       return key->exponent & (1ULL << pos);
-}
-
-/**
- * pow_mod() - in-place public exponentiation
- *
- * @key:       RSA key
- * @inout:     Big-endian word array containing value and result
- */
-static int pow_mod(const struct rsa_public_key *key, uint32_t *inout)
-{
-       uint32_t *result, *ptr;
-       uint i;
-       int j, k;
-
-       /* Sanity check for stack size - key->len is in 32-bit words */
-       if (key->len > RSA_MAX_KEY_BITS / 32) {
-               debug("RSA key words %u exceeds maximum %d\n", key->len,
-                     RSA_MAX_KEY_BITS / 32);
-               return -EINVAL;
-       }
-
-       uint32_t val[key->len], acc[key->len], tmp[key->len];
-       uint32_t a_scaled[key->len];
-       result = tmp;  /* Re-use location. */
-
-       /* Convert from big endian byte array to little endian word array. */
-       for (i = 0, ptr = inout + key->len - 1; i < key->len; i++, ptr--)
-               val[i] = get_unaligned_be32(ptr);
-
-       if (0 != num_public_exponent_bits(key, &k))
-               return -EINVAL;
-
-       if (k < 2) {
-               debug("Public exponent is too short (%d bits, minimum 2)\n",
-                     k);
-               return -EINVAL;
-       }
-
-       if (!is_public_exponent_bit_set(key, 0)) {
-               debug("LSB of RSA public exponent must be set.\n");
-               return -EINVAL;
-       }
-
-       /* the bit at e[k-1] is 1 by definition, so start with: C := M */
-       montgomery_mul(key, acc, val, key->rr); /* acc = a * RR / R mod n */
-       /* retain scaled version for intermediate use */
-       memcpy(a_scaled, acc, key->len * sizeof(a_scaled[0]));
-
-       for (j = k - 2; j > 0; --j) {
-               montgomery_mul(key, tmp, acc, acc); /* tmp = acc^2 / R mod n */
-
-               if (is_public_exponent_bit_set(key, j)) {
-                       /* acc = tmp * val / R mod n */
-                       montgomery_mul(key, acc, tmp, a_scaled);
-               } else {
-                       /* e[j] == 0, copy tmp back to acc for next operation */
-                       memcpy(acc, tmp, key->len * sizeof(acc[0]));
-               }
-       }
-
-       /* the bit at e[0] is always 1 */
-       montgomery_mul(key, tmp, acc, acc); /* tmp = acc^2 / R mod n */
-       montgomery_mul(key, acc, tmp, val); /* acc = tmp * a / R mod M */
-       memcpy(result, acc, key->len * sizeof(result[0]));
-
-       /* Make sure result < mod; result is at most 1x mod too large. */
-       if (greater_equal_modulus(key, result))
-               subtract_modulus(key, result);
-
-       /* Convert to bigendian byte array */
-       for (i = key->len - 1, ptr = inout; (int)i >= 0; i--, ptr++)
-               put_unaligned_be32(result[i], ptr);
-       return 0;
-}
-
-static int rsa_verify_key(const struct rsa_public_key *key, const uint8_t *sig,
+static int rsa_verify_key(struct key_prop *prop, const uint8_t *sig,
                          const uint32_t sig_len, const uint8_t *hash,
                          struct checksum_algo *algo)
 {
        const uint8_t *padding;
        int pad_len;
        int ret;
+#if !defined(USE_HOSTCC)
+       struct udevice *mod_exp_dev;
+#endif
 
-       if (!key || !sig || !hash || !algo)
+       if (!prop || !sig || !hash || !algo)
                return -EIO;
 
-       if (sig_len != (key->len * sizeof(uint32_t))) {
+       if (sig_len != (prop->num_bits / 8)) {
                debug("Signature is of incorrect length %d\n", sig_len);
                return -EINVAL;
        }
@@ -265,13 +65,23 @@ static int rsa_verify_key(const struct rsa_public_key *key, const uint8_t *sig,
                return -EINVAL;
        }
 
-       uint32_t buf[sig_len / sizeof(uint32_t)];
+       uint8_t buf[sig_len];
 
-       memcpy(buf, sig, sig_len);
+#if !defined(USE_HOSTCC)
+       ret = uclass_get_device(UCLASS_MOD_EXP, 0, &mod_exp_dev);
+       if (ret) {
+               printf("RSA: Can't find Modular Exp implementation\n");
+               return -EINVAL;
+       }
 
-       ret = pow_mod(key, buf);
-       if (ret)
+       ret = rsa_mod_exp(mod_exp_dev, sig, sig_len, prop, buf);
+#else
+       ret = rsa_mod_exp_sw(sig, sig_len, prop, buf);
+#endif
+       if (ret) {
+               debug("Error in Modular exponentation\n");
                return ret;
+       }
 
        padding = algo->rsa_padding;
        pad_len = algo->pad_len - algo->checksum_len;
@@ -291,72 +101,57 @@ static int rsa_verify_key(const struct rsa_public_key *key, const uint8_t *sig,
        return 0;
 }
 
-static void rsa_convert_big_endian(uint32_t *dst, const uint32_t *src, int len)
-{
-       int i;
-
-       for (i = 0; i < len; i++)
-               dst[i] = fdt32_to_cpu(src[len - 1 - i]);
-}
-
+/**
+ * rsa_verify_with_keynode() - Verify a signature against some data using
+ * information in node with prperties of RSA Key like modulus, exponent etc.
+ *
+ * Parse sign-node and fill a key_prop structure with properties of the
+ * key.  Verify a RSA PKCS1.5 signature against an expected hash using
+ * the properties parsed
+ *
+ * @info:      Specifies key and FIT information
+ * @hash:      Pointer to the expected hash
+ * @sig:       Signature
+ * @sig_len:   Number of bytes in signature
+ * @node:      Node having the RSA Key properties
+ * @return 0 if verified, -ve on error
+ */
 static int rsa_verify_with_keynode(struct image_sign_info *info,
-               const void *hash, uint8_t *sig, uint sig_len, int node)
+                                  const void *hash, uint8_t *sig,
+                                  uint sig_len, int node)
 {
        const void *blob = info->fdt_blob;
-       struct rsa_public_key key;
-       const void *modulus, *rr;
-       const uint64_t *public_exponent;
+       struct key_prop prop;
        int length;
-       int ret;
+       int ret = 0;
 
        if (node < 0) {
                debug("%s: Skipping invalid node", __func__);
                return -EBADF;
        }
-       if (!fdt_getprop(blob, node, "rsa,n0-inverse", NULL)) {
-               debug("%s: Missing rsa,n0-inverse", __func__);
-               return -EFAULT;
-       }
-       key.len = fdtdec_get_int(blob, node, "rsa,num-bits", 0);
-       key.n0inv = fdtdec_get_int(blob, node, "rsa,n0-inverse", 0);
-       public_exponent = fdt_getprop(blob, node, "rsa,exponent", &length);
-       if (!public_exponent || length < sizeof(*public_exponent))
-               key.exponent = RSA_DEFAULT_PUBEXP;
-       else
-               key.exponent = fdt64_to_cpu(*public_exponent);
-       modulus = fdt_getprop(blob, node, "rsa,modulus", NULL);
-       rr = fdt_getprop(blob, node, "rsa,r-squared", NULL);
-       if (!key.len || !modulus || !rr) {
-               debug("%s: Missing RSA key info", __func__);
-               return -EFAULT;
-       }
 
-       /* Sanity check for stack size */
-       if (key.len > RSA_MAX_KEY_BITS || key.len < RSA_MIN_KEY_BITS) {
-               debug("RSA key bits %u outside allowed range %d..%d\n",
-                     key.len, RSA_MIN_KEY_BITS, RSA_MAX_KEY_BITS);
+       prop.num_bits = fdtdec_get_int(blob, node, "rsa,num-bits", 0);
+
+       prop.n0inv = fdtdec_get_int(blob, node, "rsa,n0-inverse", 0);
+
+       prop.public_exponent = fdt_getprop(blob, node, "rsa,exponent", &length);
+       if (!prop.public_exponent || length < sizeof(uint64_t))
+               prop.public_exponent = NULL;
+
+       prop.exp_len = sizeof(uint64_t);
+
+       prop.modulus = fdt_getprop(blob, node, "rsa,modulus", NULL);
+
+       prop.rr = fdt_getprop(blob, node, "rsa,r-squared", NULL);
+
+       if (!prop.num_bits || !prop.modulus) {
+               debug("%s: Missing RSA key info", __func__);
                return -EFAULT;
        }
-       key.len /= sizeof(uint32_t) * 8;
-       uint32_t key1[key.len], key2[key.len];
-
-       key.modulus = key1;
-       key.rr = key2;
-       rsa_convert_big_endian(key.modulus, modulus, key.len);
-       rsa_convert_big_endian(key.rr, rr, key.len);
-       if (!key.modulus || !key.rr) {
-               debug("%s: Out of memory", __func__);
-               return -ENOMEM;
-       }
 
-       debug("key length %d\n", key.len);
-       ret = rsa_verify_key(&key, sig, sig_len, hash, info->algo->checksum);
-       if (ret) {
-               printf("%s: RSA failed to verify: %d\n", __func__, ret);
-               return ret;
-       }
+       ret = rsa_verify_key(&prop, sig, sig_len, hash, info->algo->checksum);
 
-       return 0;
+       return ret;
 }
 
 int rsa_verify(struct image_sign_info *info,
@@ -389,7 +184,12 @@ int rsa_verify(struct image_sign_info *info,
        }
 
        /* Calculate checksum with checksum-algorithm */
-       info->algo->checksum->calculate(region, region_count, hash);
+       ret = info->algo->checksum->calculate(info->algo->checksum->name,
+                                       region, region_count, hash);
+       if (ret < 0) {
+               debug("%s: Error in checksum calculation\n", __func__);
+               return -EINVAL;
+       }
 
        /* See if we must use a particular key */
        if (info->required_keynode != -1) {
index 942595021dad1cf3fccb27531bde72e20e0acd88..e9cc8ada96a783ae18444c9f68a107bede6e0054 100644 (file)
@@ -7,6 +7,7 @@
 
 #ccflags-y += -DDEBUG
 
+obj-y += checksum.o
 obj-$(CONFIG_CMD_NET)  += arp.o
 obj-$(CONFIG_CMD_NET)  += bootp.o
 obj-$(CONFIG_CMD_CDP)  += cdp.o
diff --git a/net/checksum.c b/net/checksum.c
new file mode 100644 (file)
index 0000000..a8c9ff5
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file was originally taken from the FreeBSD project.
+ *
+ * Copyright (c) 2001 Charles Mott <cm@linktel.net>
+ * Copyright (c) 2008 coresystems GmbH
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:    BSD-2-Clause
+ */
+
+#include <common.h>
+#include <net.h>
+
+unsigned compute_ip_checksum(const void *vptr, unsigned nbytes)
+{
+       int sum, oddbyte;
+       const unsigned short *ptr = vptr;
+
+       sum = 0;
+       while (nbytes > 1) {
+               sum += *ptr++;
+               nbytes -= 2;
+       }
+       if (nbytes == 1) {
+               oddbyte = 0;
+               ((u8 *)&oddbyte)[0] = *(u8 *)ptr;
+               ((u8 *)&oddbyte)[1] = 0;
+               sum += oddbyte;
+       }
+       sum = (sum >> 16) + (sum & 0xffff);
+       sum += (sum >> 16);
+       sum = ~sum & 0xffff;
+
+       return sum;
+}
+
+unsigned add_ip_checksums(unsigned offset, unsigned sum, unsigned new)
+{
+       unsigned long checksum;
+
+       sum = ~sum & 0xffff;
+       new = ~new & 0xffff;
+       if (offset & 1) {
+               /*
+                * byte-swap the sum if it came from an odd offset; since the
+                * computation is endian independant this works.
+                */
+               new = ((new >> 8) & 0xff) | ((new << 8) & 0xff00);
+       }
+       checksum = sum + new;
+       if (checksum > 0xffff)
+               checksum -= 0xffff;
+
+       return (~checksum) & 0xffff;
+}
+
+int ip_checksum_ok(const void *addr, unsigned nbytes)
+{
+       return !(compute_ip_checksum(addr, nbytes) & 0xfffe);
+}
index abbaccff509ce09374f30e88983252672d3c4e62..faffe6a385b6f8ef9ee066ac705d959993232226 100644 (file)
@@ -9,11 +9,18 @@
 #include <dm/device-internal.h>
 #include <dm/root.h>
 #include <dm/test.h>
+#include <dm/uclass-internal.h>
 #include <dm/ut.h>
 #include <dm/util.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+struct dm_test_parent_platdata {
+       int count;
+       int bind_flag;
+       int uclass_bind_flag;
+};
+
 enum {
        FLAG_CHILD_PROBED       = 10,
        FLAG_CHILD_REMOVED      = -7,
@@ -26,6 +33,17 @@ static int testbus_drv_probe(struct udevice *dev)
        return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
 }
 
+static int testbus_child_post_bind(struct udevice *dev)
+{
+       struct dm_test_parent_platdata *plat;
+
+       plat = dev_get_parent_platdata(dev);
+       plat->bind_flag = 1;
+       plat->uclass_bind_flag = 2;
+
+       return 0;
+}
+
 static int testbus_child_pre_probe(struct udevice *dev)
 {
        struct dm_test_parent_data *parent_data = dev_get_parentdata(dev);
@@ -35,6 +53,15 @@ static int testbus_child_pre_probe(struct udevice *dev)
        return 0;
 }
 
+static int testbus_child_pre_probe_uclass(struct udevice *dev)
+{
+       struct dm_test_priv *priv = dev_get_priv(dev);
+
+       priv->uclass_flag++;
+
+       return 0;
+}
+
 static int testbus_child_post_remove(struct udevice *dev)
 {
        struct dm_test_parent_data *parent_data = dev_get_parentdata(dev);
@@ -59,9 +86,12 @@ U_BOOT_DRIVER(testbus_drv) = {
        .of_match       = testbus_ids,
        .id     = UCLASS_TEST_BUS,
        .probe  = testbus_drv_probe,
+       .child_post_bind = testbus_child_post_bind,
        .priv_auto_alloc_size = sizeof(struct dm_test_priv),
        .platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
        .per_child_auto_alloc_size = sizeof(struct dm_test_parent_data),
+       .per_child_platdata_auto_alloc_size =
+                       sizeof(struct dm_test_parent_platdata),
        .child_pre_probe = testbus_child_pre_probe,
        .child_post_remove = testbus_child_post_remove,
 };
@@ -69,12 +99,14 @@ U_BOOT_DRIVER(testbus_drv) = {
 UCLASS_DRIVER(testbus) = {
        .name           = "testbus",
        .id             = UCLASS_TEST_BUS,
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
+       .child_pre_probe = testbus_child_pre_probe_uclass,
 };
 
 /* Test that we can probe for children */
 static int dm_test_bus_children(struct dm_test_state *dms)
 {
-       int num_devices = 4;
+       int num_devices = 6;
        struct udevice *bus;
        struct uclass *uc;
 
@@ -172,7 +204,7 @@ DM_TEST(dm_test_bus_children_iterators,
        DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
 /* Test that the bus can store data about each child */
-static int dm_test_bus_parent_data(struct dm_test_state *dms)
+static int test_bus_parent_data(struct dm_test_state *dms)
 {
        struct dm_test_parent_data *parent_data;
        struct udevice *bus, *dev;
@@ -231,9 +263,36 @@ static int dm_test_bus_parent_data(struct dm_test_state *dms)
 
        return 0;
 }
-
+/* Test that the bus can store data about each child */
+static int dm_test_bus_parent_data(struct dm_test_state *dms)
+{
+       return test_bus_parent_data(dms);
+}
 DM_TEST(dm_test_bus_parent_data, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
+/* As above but the size is controlled by the uclass */
+static int dm_test_bus_parent_data_uclass(struct dm_test_state *dms)
+{
+       struct udevice *bus;
+       int size;
+       int ret;
+
+       /* Set the driver size to 0 so that the uclass size is used */
+       ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
+       size = bus->driver->per_child_auto_alloc_size;
+       bus->uclass->uc_drv->per_child_auto_alloc_size = size;
+       bus->driver->per_child_auto_alloc_size = 0;
+       ret = test_bus_parent_data(dms);
+       if (ret)
+               return ret;
+       bus->uclass->uc_drv->per_child_auto_alloc_size = 0;
+       bus->driver->per_child_auto_alloc_size = size;
+
+       return 0;
+}
+DM_TEST(dm_test_bus_parent_data_uclass,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
 /* Test that the bus ops are called when a child is probed/removed */
 static int dm_test_bus_parent_ops(struct dm_test_state *dms)
 {
@@ -271,3 +330,188 @@ static int dm_test_bus_parent_ops(struct dm_test_state *dms)
        return 0;
 }
 DM_TEST(dm_test_bus_parent_ops, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+static int test_bus_parent_platdata(struct dm_test_state *dms)
+{
+       struct dm_test_parent_platdata *plat;
+       struct udevice *bus, *dev;
+       int child_count;
+
+       /* Check that the bus has no children */
+       ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
+       device_find_first_child(bus, &dev);
+       ut_asserteq_ptr(NULL, dev);
+
+       ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
+
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               /* Check that platform data is allocated */
+               plat = dev_get_parent_platdata(dev);
+               ut_assert(plat != NULL);
+
+               /*
+                * Check that it is not affected by the device being
+                * probed/removed
+                */
+               plat->count++;
+               ut_asserteq(1, plat->count);
+               device_probe(dev);
+               device_remove(dev);
+
+               ut_asserteq_ptr(plat, dev_get_parent_platdata(dev));
+               ut_asserteq(1, plat->count);
+               ut_assertok(device_probe(dev));
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       /* Removing the bus should also have no effect (it is still bound) */
+       device_remove(bus);
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               /* Check that platform data is allocated */
+               plat = dev_get_parent_platdata(dev);
+               ut_assert(plat != NULL);
+               ut_asserteq(1, plat->count);
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       /* Unbind all the children */
+       do {
+               device_find_first_child(bus, &dev);
+               if (dev)
+                       device_unbind(dev);
+       } while (dev);
+
+       /* Now the child platdata should be removed and re-added */
+       device_probe(bus);
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               /* Check that platform data is allocated */
+               plat = dev_get_parent_platdata(dev);
+               ut_assert(plat != NULL);
+               ut_asserteq(0, plat->count);
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       return 0;
+}
+
+/* Test that the bus can store platform data about each child */
+static int dm_test_bus_parent_platdata(struct dm_test_state *dms)
+{
+       return test_bus_parent_platdata(dms);
+}
+DM_TEST(dm_test_bus_parent_platdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* As above but the size is controlled by the uclass */
+static int dm_test_bus_parent_platdata_uclass(struct dm_test_state *dms)
+{
+       struct udevice *bus;
+       int size;
+       int ret;
+
+       /* Set the driver size to 0 so that the uclass size is used */
+       ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
+       size = bus->driver->per_child_platdata_auto_alloc_size;
+       bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = size;
+       bus->driver->per_child_platdata_auto_alloc_size = 0;
+       ret = test_bus_parent_platdata(dms);
+       if (ret)
+               return ret;
+       bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = 0;
+       bus->driver->per_child_platdata_auto_alloc_size = size;
+
+       return 0;
+}
+DM_TEST(dm_test_bus_parent_platdata_uclass,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test that the child post_bind method is called */
+static int dm_test_bus_child_post_bind(struct dm_test_state *dms)
+{
+       struct dm_test_parent_platdata *plat;
+       struct udevice *bus, *dev;
+       int child_count;
+
+       ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               /* Check that platform data is allocated */
+               plat = dev_get_parent_platdata(dev);
+               ut_assert(plat != NULL);
+               ut_asserteq(1, plat->bind_flag);
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       return 0;
+}
+DM_TEST(dm_test_bus_child_post_bind, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test that the child post_bind method is called */
+static int dm_test_bus_child_post_bind_uclass(struct dm_test_state *dms)
+{
+       struct dm_test_parent_platdata *plat;
+       struct udevice *bus, *dev;
+       int child_count;
+
+       ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               /* Check that platform data is allocated */
+               plat = dev_get_parent_platdata(dev);
+               ut_assert(plat != NULL);
+               ut_asserteq(2, plat->uclass_bind_flag);
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       return 0;
+}
+DM_TEST(dm_test_bus_child_post_bind_uclass,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/*
+ * Test that the bus' uclass' child_pre_probe() is called before the
+ * device's probe() method
+ */
+static int dm_test_bus_child_pre_probe_uclass(struct dm_test_state *dms)
+{
+       struct udevice *bus, *dev;
+       int child_count;
+
+       /*
+        * See testfdt_drv_probe() which effectively checks that the uclass
+        * flag is set before that method is called
+        */
+       ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
+       for (device_find_first_child(bus, &dev), child_count = 0;
+            dev;
+            device_find_next_child(&dev)) {
+               struct dm_test_priv *priv = dev_get_priv(dev);
+
+               /* Check that things happened in the right order */
+               ut_asserteq_ptr(NULL, priv);
+               ut_assertok(device_probe(dev));
+
+               priv = dev_get_priv(dev);
+               ut_assert(priv != NULL);
+               ut_asserteq(1, priv->uclass_flag);
+               ut_asserteq(1, priv->uclass_total);
+               child_count++;
+       }
+       ut_asserteq(3, child_count);
+
+       return 0;
+}
+DM_TEST(dm_test_bus_child_pre_probe_uclass,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
index ff5c2a749c5e37dbbcca5340dabdf18374a8e5c2..eccda0974da6d6effbdd931c75dff71f36bdaaf6 100644 (file)
@@ -598,3 +598,14 @@ static int dm_test_uclass_before_ready(struct dm_test_state *dms)
 }
 
 DM_TEST(dm_test_uclass_before_ready, 0);
+
+static int dm_test_device_get_uclass_id(struct dm_test_state *dms)
+{
+       struct udevice *dev;
+
+       ut_assertok(uclass_get_device(UCLASS_TEST, 0, &dev));
+       ut_asserteq(UCLASS_TEST, device_get_uclass_id(dev));
+
+       return 0;
+}
+DM_TEST(dm_test_device_get_uclass_id, DM_TESTF_SCAN_PDATA);
index 94bd0d99dc0bc1fa9b5c7033690ab6de7cc29b41..b29daf1af4e238e6d3952f3058191bce3c5a1bb8 100644 (file)
@@ -174,5 +174,72 @@ static int dm_test_gpio_leak(struct dm_test_state *dms)
 
        return 0;
 }
-
 DM_TEST(dm_test_gpio_leak, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test that we can find GPIOs using phandles */
+static int dm_test_gpio_phandles(struct dm_test_state *dms)
+{
+       struct gpio_desc desc, desc_list[8], desc_list2[8];
+       struct udevice *dev, *gpio_a, *gpio_b;
+
+       ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
+       ut_asserteq_str("a-test", dev->name);
+
+       ut_assertok(gpio_request_by_name(dev, "test-gpios", 1, &desc, 0));
+       ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio_a));
+       ut_assertok(uclass_get_device(UCLASS_GPIO, 2, &gpio_b));
+       ut_asserteq_str("base-gpios", gpio_a->name);
+       ut_asserteq(true, !!device_active(gpio_a));
+       ut_asserteq_ptr(gpio_a, desc.dev);
+       ut_asserteq(4, desc.offset);
+       /* GPIOF_INPUT is the sandbox GPIO driver default */
+       ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 4, NULL));
+       ut_assertok(dm_gpio_free(dev, &desc));
+
+       ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 3, &desc,
+                                                 0));
+       ut_asserteq_ptr(NULL, desc.dev);
+       ut_asserteq(desc.offset, 0);
+       ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 5, &desc,
+                                                 0));
+
+       /* Last GPIO is ignord as it comes after <0> */
+       ut_asserteq(3, gpio_request_list_by_name(dev, "test-gpios", desc_list,
+                                                ARRAY_SIZE(desc_list), 0));
+       ut_asserteq(-EBUSY, gpio_request_list_by_name(dev, "test-gpios",
+                                                     desc_list2,
+                                                     ARRAY_SIZE(desc_list2),
+                                                     0));
+       ut_assertok(gpio_free_list(dev, desc_list, 3));
+       ut_asserteq(3, gpio_request_list_by_name(dev,  "test-gpios", desc_list,
+                                                ARRAY_SIZE(desc_list),
+                                                GPIOD_IS_OUT |
+                                                GPIOD_IS_OUT_ACTIVE));
+       ut_asserteq_ptr(gpio_a, desc_list[0].dev);
+       ut_asserteq(1, desc_list[0].offset);
+       ut_asserteq_ptr(gpio_a, desc_list[1].dev);
+       ut_asserteq(4, desc_list[1].offset);
+       ut_asserteq_ptr(gpio_b, desc_list[2].dev);
+       ut_asserteq(5, desc_list[2].offset);
+       ut_asserteq(1, dm_gpio_get_value(desc_list));
+       ut_assertok(gpio_free_list(dev, desc_list, 3));
+
+       ut_asserteq(6, gpio_request_list_by_name(dev, "test2-gpios", desc_list,
+                                                ARRAY_SIZE(desc_list), 0));
+       /* This was set to output previously, so still will be */
+       ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_a, 1, NULL));
+
+       /* Active low should invert the input value */
+       ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 6, NULL));
+       ut_asserteq(1, dm_gpio_get_value(&desc_list[2]));
+
+       ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 7, NULL));
+       ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 8, NULL));
+       ut_asserteq(0, dm_gpio_get_value(&desc_list[4]));
+       ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 9, NULL));
+       ut_asserteq(1, dm_gpio_get_value(&desc_list[5]));
+
+
+       return 0;
+}
+DM_TEST(dm_test_gpio_phandles, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
index a53e28dbe5dc528172811f24bb9dce3909365860..ef88372d56361ab40186a34787cc6c7a8e0c40d4 100644 (file)
@@ -35,8 +35,8 @@ static int dm_test_i2c_find(struct dm_test_state *dms)
         * remove the emulation and the slave device.
         */
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_probe(bus, chip, 0, &dev));
-       ut_asserteq(-ENODEV, i2c_probe(bus, no_chip, 0, &dev));
+       ut_assertok(dm_i2c_probe(bus, chip, 0, &dev));
+       ut_asserteq(-ENODEV, dm_i2c_probe(bus, no_chip, 0, &dev));
        ut_asserteq(-ENODEV, uclass_get_device_by_seq(UCLASS_I2C, 1, &bus));
 
        return 0;
@@ -49,11 +49,11 @@ static int dm_test_i2c_read_write(struct dm_test_state *dms)
        uint8_t buf[5];
 
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_get_chip(bus, chip, &dev));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf)));
-       ut_assertok(i2c_write(dev, 2, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0AB\0", sizeof(buf)));
 
        return 0;
@@ -66,13 +66,13 @@ static int dm_test_i2c_speed(struct dm_test_state *dms)
        uint8_t buf[5];
 
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_get_chip(bus, chip, &dev));
+       ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
        ut_assertok(i2c_set_bus_speed(bus, 100000));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(i2c_set_bus_speed(bus, 400000));
        ut_asserteq(400000, i2c_get_bus_speed(bus));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
-       ut_asserteq(-EINVAL, i2c_write(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
+       ut_asserteq(-EINVAL, dm_i2c_write(dev, 0, buf, 5));
 
        return 0;
 }
@@ -84,9 +84,9 @@ static int dm_test_i2c_offset_len(struct dm_test_state *dms)
        uint8_t buf[5];
 
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_get_chip(bus, chip, &dev));
+       ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
        ut_assertok(i2c_set_chip_offset_len(dev, 1));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
 
        /* This is not supported by the uclass */
        ut_asserteq(-EINVAL, i2c_set_chip_offset_len(dev, 5));
@@ -100,7 +100,7 @@ static int dm_test_i2c_probe_empty(struct dm_test_state *dms)
        struct udevice *bus, *dev;
 
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_probe(bus, SANDBOX_I2C_TEST_ADDR, 0, &dev));
+       ut_assertok(dm_i2c_probe(bus, SANDBOX_I2C_TEST_ADDR, 0, &dev));
 
        return 0;
 }
@@ -113,8 +113,8 @@ static int dm_test_i2c_bytewise(struct dm_test_state *dms)
        uint8_t buf[5];
 
        ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
-       ut_assertok(i2c_get_chip(bus, chip, &dev));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf)));
 
        /* Tell the EEPROM to only read/write one register at a time */
@@ -123,34 +123,34 @@ static int dm_test_i2c_bytewise(struct dm_test_state *dms)
        sandbox_i2c_eeprom_set_test_mode(eeprom, SIE_TEST_MODE_SINGLE_BYTE);
 
        /* Now we only get the first byte - the rest will be 0xff */
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf)));
 
        /* If we do a separate transaction for each byte, it works */
        ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_RD_ADDRESS));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf)));
 
        /* This will only write A */
        ut_assertok(i2c_set_chip_flags(dev, 0));
-       ut_assertok(i2c_write(dev, 2, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf)));
 
        /* Check that the B was ignored */
        ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_RD_ADDRESS));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0A\0\0\0", sizeof(buf)));
 
        /* Now write it again with the new flags, it should work */
        ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_WR_ADDRESS));
-       ut_assertok(i2c_write(dev, 2, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf)));
 
        ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_WR_ADDRESS |
                                                DM_I2C_CHIP_RD_ADDRESS));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "\0\0AB\0\0", sizeof(buf)));
 
        /* Restore defaults */
@@ -167,45 +167,45 @@ static int dm_test_i2c_offset(struct dm_test_state *dms)
        struct udevice *dev;
        uint8_t buf[5];
 
-       ut_assertok(i2c_get_chip_for_busnum(busnum, chip, &dev));
+       ut_assertok(i2c_get_chip_for_busnum(busnum, chip, 1, &dev));
 
        /* Do a transfer so we can find the emulator */
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(uclass_first_device(UCLASS_I2C_EMUL, &eeprom));
 
        /* Offset length 0 */
        sandbox_i2c_eeprom_set_offset_len(eeprom, 0);
        ut_assertok(i2c_set_chip_offset_len(dev, 0));
-       ut_assertok(i2c_write(dev, 10 /* ignored */, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 10 /* ignored */, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "AB\0\0\0\0", sizeof(buf)));
 
        /* Offset length 1 */
        sandbox_i2c_eeprom_set_offset_len(eeprom, 1);
        ut_assertok(i2c_set_chip_offset_len(dev, 1));
-       ut_assertok(i2c_write(dev, 2, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0, buf, 5));
        ut_assertok(memcmp(buf, "ABAB\0", sizeof(buf)));
 
        /* Offset length 2 */
        sandbox_i2c_eeprom_set_offset_len(eeprom, 2);
        ut_assertok(i2c_set_chip_offset_len(dev, 2));
-       ut_assertok(i2c_write(dev, 0x210, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0x210, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 0x210, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0x210, buf, 5));
        ut_assertok(memcmp(buf, "AB\0\0\0", sizeof(buf)));
 
        /* Offset length 3 */
        sandbox_i2c_eeprom_set_offset_len(eeprom, 2);
        ut_assertok(i2c_set_chip_offset_len(dev, 2));
-       ut_assertok(i2c_write(dev, 0x410, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0x410, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 0x410, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0x410, buf, 5));
        ut_assertok(memcmp(buf, "AB\0\0\0", sizeof(buf)));
 
        /* Offset length 4 */
        sandbox_i2c_eeprom_set_offset_len(eeprom, 2);
        ut_assertok(i2c_set_chip_offset_len(dev, 2));
-       ut_assertok(i2c_write(dev, 0x420, (uint8_t *)"AB", 2));
-       ut_assertok(i2c_read(dev, 0x420, buf, 5));
+       ut_assertok(dm_i2c_write(dev, 0x420, (uint8_t *)"AB", 2));
+       ut_assertok(dm_i2c_read(dev, 0x420, buf, 5));
        ut_assertok(memcmp(buf, "AB\0\0\0", sizeof(buf)));
 
        /* Restore defaults */
index 61b5b2548c42e4e9895ef95345b5e9e99bc9c52a..c7ee65207b0472d3d360e26a7a87629849544c29 100644 (file)
@@ -36,7 +36,6 @@ static int dm_test_spi_find(struct dm_test_state *dms)
        ut_asserteq(0, uclass_get_device_by_seq(UCLASS_SPI, busnum, &bus));
        ut_assertok(spi_cs_info(bus, cs, &info));
        of_offset = info.dev->of_offset;
-       sandbox_sf_unbind_emul(state_get_current(), busnum, cs);
        device_remove(info.dev);
        device_unbind(info.dev);
 
@@ -45,7 +44,7 @@ static int dm_test_spi_find(struct dm_test_state *dms)
         * reports that CS 0 is present
         */
        ut_assertok(spi_cs_info(bus, cs, &info));
-       ut_asserteq_ptr(info.dev, NULL);
+       ut_asserteq_ptr(NULL, info.dev);
 
        /* This finds nothing because we removed the device */
        ut_asserteq(-ENODEV, spi_find_bus_and_cs(busnum, cs, &bus, &dev));
@@ -62,8 +61,9 @@ static int dm_test_spi_find(struct dm_test_state *dms)
        ut_asserteq(-ENOENT, spi_get_bus_and_cs(busnum, cs, speed, mode,
                                                "spi_flash_std", "name", &bus,
                                                &slave));
+       sandbox_sf_unbind_emul(state_get_current(), busnum, cs);
        ut_assertok(spi_cs_info(bus, cs, &info));
-       ut_asserteq_ptr(info.dev, NULL);
+       ut_asserteq_ptr(NULL, info.dev);
 
        /* Add the emulation and try again */
        ut_assertok(sandbox_sf_bind_emul(state, busnum, cs, bus, of_offset,
index bb99677ece9462604e4362fc514030291e30862d..8ebc39297cb53ec315c828a4d0429e8c7ae46dc7 100755 (executable)
@@ -1,9 +1,14 @@
 #!/bin/sh
 
+die() {
+       echo $1
+       exit 1
+}
+
 NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor)
 dtc -I dts -O dtb test/dm/test.dts -o test/dm/test.dtb
-make O=sandbox sandbox_config
-make O=sandbox -s -j${NUM_CPUS}
+make O=sandbox sandbox_config || die "Cannot configure U-Boot"
+make O=sandbox -s -j${NUM_CPUS} || die "Cannot build U-Boot"
 dd if=/dev/zero of=spi.bin bs=1M count=2
 ./sandbox/u-boot -d test/dm/test.dtb -c "dm test"
 rm spi.bin
index cd2c38995e936246a5b8643f04c91b218d454ff0..b8ee9599a22a67c999bb8cd066226cf63237f324 100644 (file)
@@ -51,6 +51,13 @@ static int testfdt_drv_probe(struct udevice *dev)
 
        priv->ping_total += DM_TEST_START_TOTAL;
 
+       /*
+        * If this device is on a bus, the uclass_flag will be set before
+        * calling this function. This is used by
+        * dm_test_bus_child_pre_probe_uclass().
+        */
+       priv->uclass_total += priv->uclass_flag;
+
        return 0;
 }
 
@@ -89,6 +96,7 @@ int testfdt_ping(struct udevice *dev, int pingval, int *pingret)
 UCLASS_DRIVER(testfdt) = {
        .name           = "testfdt",
        .id             = UCLASS_TEST_FDT,
+       .flags          = DM_UC_FLAG_SEQ_ALIAS,
 };
 
 int dm_check_devices(struct dm_test_state *dms, int num_devices)
@@ -128,7 +136,7 @@ int dm_check_devices(struct dm_test_state *dms, int num_devices)
 /* Test that FDT-based binding works correctly */
 static int dm_test_fdt(struct dm_test_state *dms)
 {
-       const int num_devices = 4;
+       const int num_devices = 6;
        struct udevice *dev;
        struct uclass *uc;
        int ret;
@@ -143,12 +151,12 @@ static int dm_test_fdt(struct dm_test_state *dms)
        /* These are num_devices compatible root-level device tree nodes */
        ut_asserteq(num_devices, list_count_items(&uc->dev_head));
 
-       /* Each should have no platdata / priv */
+       /* Each should have platform data but no private data */
        for (i = 0; i < num_devices; i++) {
                ret = uclass_find_device(UCLASS_TEST_FDT, i, &dev);
                ut_assert(!ret);
                ut_assert(!dev_get_priv(dev));
-               ut_assert(!dev->platdata);
+               ut_assert(dev->platdata);
        }
 
        ut_assertok(dm_check_devices(dms, num_devices));
@@ -184,7 +192,7 @@ static int dm_test_fdt_uclass_seq(struct dm_test_state *dms)
        ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_FDT, 3, true, &dev));
        ut_asserteq_str("b-test", dev->name);
 
-       ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_FDT, 0, true, &dev));
+       ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_FDT, 8, true, &dev));
        ut_asserteq_str("a-test", dev->name);
 
        ut_asserteq(-ENODEV, uclass_find_device_by_seq(UCLASS_TEST_FDT, 5,
@@ -220,11 +228,11 @@ static int dm_test_fdt_uclass_seq(struct dm_test_state *dms)
        ut_asserteq(-ENODEV, uclass_get_device_by_seq(UCLASS_TEST_FDT, 1,
                                                      &dev));
        ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
-       ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 1, &dev));
+       ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 4, &dev));
 
        /* But now that it is probed, we can find it */
        ut_assertok(uclass_get_device_by_seq(UCLASS_TEST_FDT, 1, &dev));
-       ut_asserteq_str("a-test", dev->name);
+       ut_asserteq_str("f-test", dev->name);
 
        return 0;
 }
index fb0272a59cd25472b4e733afbe832a35c607d1d8..84024a44a3f0368c5cea2e983a02d25465969482 100644 (file)
@@ -8,7 +8,15 @@
 
        aliases {
                console = &uart0;
+               i2c0 = "/i2c@0";
+               spi0 = "/spi@0";
                testfdt6 = "/e-test";
+               testbus3 = "/some-bus";
+               testfdt0 = "/some-bus/c-test@0";
+               testfdt1 = "/some-bus/c-test@1";
+               testfdt3 = "/b-test";
+               testfdt5 = "/some-bus/c-test@5";
+               testfdt8 = "/a-test";
        };
 
        uart0: serial {
                ping-expect = <0>;
                ping-add = <0>;
                u-boot,dm-pre-reloc;
+               test-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 5 0 3 2 1>,
+                       <0>, <&gpio_a 12>;
+               test2-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 6 1 3 2 1>,
+                       <&gpio_b 7 2 3 2 1>, <&gpio_b 8 4 3 2 1>,
+                       <&gpio_b 9 0xc 3 2 1>;
        };
 
        junk {
                compatible = "google,another-fdt-test";
        };
 
+       f-test {
+               compatible = "denx,u-boot-fdt-test";
+       };
+
+       g-test {
+               compatible = "denx,u-boot-fdt-test";
+       };
+
        gpio_a: base-gpios {
                compatible = "sandbox,gpio";
+               gpio-controller;
+               #gpio-cells = <1>;
                gpio-bank-name = "a";
                num-gpios = <20>;
        };
 
-       extra-gpios {
+       gpio_b: extra-gpios {
                compatible = "sandbox,gpio";
+               gpio-controller;
+               #gpio-cells = <5>;
                gpio-bank-name = "b";
                num-gpios = <10>;
        };
index 9e299e1e57aa40f88f373008293900b7ca4281ef..952f975af11ec9eeb5ff30c63381b80fc8fc7d77 100755 (executable)
 # ./test/image/test-imagetools.sh
 
 BASEDIR=sandbox
-SRCDIR=sandbox/boot
+SRCDIR=${BASEDIR}/boot
 IMAGE_NAME="v1.0-test"
-IMAGE=linux.img
+IMAGE_MULTI=linux.img
+IMAGE_FIT_ITS=linux.its
+IMAGE_FIT_ITB=linux.itb
 DATAFILE0=vmlinuz
 DATAFILE1=initrd.img
 DATAFILE2=System.map
@@ -34,14 +36,17 @@ cleanup()
        for file in ${DATAFILES}; do
                rm -f ${file} ${SRCDIR}/${file}
        done
-       rm -f ${IMAGE} ${DUMPIMAGE_LIST} ${MKIMAGE_LIST} ${TEST_OUT}
+       rm -f ${IMAGE_MULTI}
+       rm -f ${DUMPIMAGE_LIST}
+       rm -f ${MKIMAGE_LIST}
+       rm -f ${TEST_OUT}
        rmdir ${SRCDIR}
 }
 
 # Check that two files are the same
 assert_equal()
 {
-       if ! diff $1 $2; then
+       if ! diff -u $1 $2; then
                echo "Failed."
                cleanup
                exit 1
@@ -82,35 +87,103 @@ do_cmd_redir()
        ${cmd} >${redir}
 }
 
-# Write files into an image
-create_image()
+# Write files into an multi-file image
+create_multi_image()
 {
        local files="${SRCDIR}/${DATAFILE0}:${SRCDIR}/${DATAFILE1}"
        files+=":${SRCDIR}/${DATAFILE2}"
 
-       echo -e "\nBuilding image..."
+       echo -e "\nBuilding multi-file image..."
        do_cmd ${MKIMAGE} -A x86 -O linux -T multi -n \"${IMAGE_NAME}\" \
-               -d ${files} ${IMAGE}
+               -d ${files} ${IMAGE_MULTI}
        echo "done."
 }
 
-# Extract files from an image
-extract_image()
+# Extract files from an multi-file image
+extract_multi_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 -e "\nExtracting multi-file image contents..."
+       do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 0 ${DATAFILE0}
+       do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 1 ${DATAFILE1}
+       do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2}
+       do_cmd ${DUMPIMAGE} -T multi -i ${IMAGE_MULTI} -p 2 ${DATAFILE2} -o ${TEST_OUT}
+       echo "done."
+}
+
+# Write files into a FIT image
+create_fit_image()
+{
+       echo " \
+       /dts-v1/; \
+       / { \
+           description = \"FIT image\"; \
+           #address-cells = <1>; \
+       \
+           images { \
+               kernel@1 { \
+                   description = \"kernel\"; \
+                   data = /incbin/(\"${DATAFILE0}\"); \
+                   type = \"kernel\"; \
+                   arch = \"sandbox\"; \
+                   os = \"linux\"; \
+                   compression = \"gzip\"; \
+                   load = <0x40000>; \
+                   entry = <0x8>; \
+               }; \
+               ramdisk@1 { \
+                   description = \"filesystem\"; \
+                   data = /incbin/(\"${DATAFILE1}\"); \
+                   type = \"ramdisk\"; \
+                   arch = \"sandbox\"; \
+                   os = \"linux\"; \
+                   compression = \"none\"; \
+                   load = <0x80000>; \
+                   entry = <0x16>; \
+               }; \
+               fdt@1 { \
+                   description = \"device tree\"; \
+                   data = /incbin/(\"${DATAFILE2}\"); \
+                   type = \"flat_dt\"; \
+                   arch = \"sandbox\"; \
+                   compression = \"none\"; \
+               }; \
+           }; \
+           configurations { \
+               default = \"conf@1\"; \
+               conf@1 { \
+                   kernel = \"kernel@1\"; \
+                   fdt = \"fdt@1\"; \
+               }; \
+           }; \
+       }; \
+       " > ${IMAGE_FIT_ITS}
+
+       echo -e "\nBuilding FIT image..."
+       do_cmd ${MKIMAGE} -f ${IMAGE_FIT_ITS} ${IMAGE_FIT_ITB}
+       echo "done."
+}
+
+# Extract files from a FIT image
+extract_fit_image()
+{
+       echo -e "\nExtracting FIT image contents..."
+       do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 0 ${DATAFILE0}
+       do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 1 ${DATAFILE1}
+       do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2}
+       do_cmd ${DUMPIMAGE} -T flat_dt -i ${IMAGE_FIT_ITB} -p 2 ${DATAFILE2} -o ${TEST_OUT}
        echo "done."
 }
 
 # List the contents of a file
+# Args:
+#    image filename
 list_image()
 {
+       local image="$1"
+
        echo -e "\nListing image contents..."
-       do_cmd_redir ${MKIMAGE_LIST} ${MKIMAGE} -l ${IMAGE}
-       do_cmd_redir ${DUMPIMAGE_LIST} ${DUMPIMAGE} -l ${IMAGE}
+       do_cmd_redir ${MKIMAGE_LIST} ${MKIMAGE} -l ${image}
+       do_cmd_redir ${DUMPIMAGE_LIST} ${DUMPIMAGE} -l ${image}
        echo "done."
 }
 
@@ -120,16 +193,28 @@ main()
 
        create_files
 
-       # Compress and extract multifile images, compare the result
-       create_image
-       extract_image
+       # Compress and extract multi-file images, compare the result
+       create_multi_image
+       extract_multi_image
+       for file in ${DATAFILES}; do
+               assert_equal ${file} ${SRCDIR}/${file}
+       done
+       assert_equal ${TEST_OUT} ${DATAFILE2}
+
+       # List contents of multi-file image and compares output from tools
+       list_image ${IMAGE_MULTI}
+       assert_equal ${DUMPIMAGE_LIST} ${MKIMAGE_LIST}
+
+       # Compress and extract FIT images, compare the result
+       create_fit_image
+       extract_fit_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
+       # List contents of FIT image and compares output from tools
+       list_image ${IMAGE_FIT_ITB}
        assert_equal ${DUMPIMAGE_LIST} ${MKIMAGE_LIST}
 
        # Remove files created
index e549f8e63c9cbe0b1066a659efb16bd641601601..6e1ce79f2f45cd33cc3e99ca278a330adb0f75bd 100644 (file)
@@ -60,7 +60,8 @@ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
 LIBFDT_OBJS := $(addprefix lib/libfdt/, \
                        fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o)
 RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
-                                       rsa-sign.o rsa-verify.o rsa-checksum.o)
+                                       rsa-sign.o rsa-verify.o rsa-checksum.o \
+                                       rsa-mod-exp.o)
 
 # common objs for dumpimage and mkimage
 dumpimage-mkimage-objs := aisimage.o \
@@ -90,6 +91,7 @@ dumpimage-mkimage-objs := aisimage.o \
                        socfpgaimage.o \
                        lib/sha1.o \
                        lib/sha256.o \
+                       common/hash.o \
                        ublimage.o \
                        $(LIBFDT_OBJS) \
                        $(RSA_OBJS-y)
@@ -122,6 +124,8 @@ HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
 HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
 HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage)
 
+HOSTLDFLAGS += -T $(srctree)/tools/imagetool.lds
+
 hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl
 hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
 HOSTCFLAGS_mkexynosspl.o := -pedantic
index 8de370a2e08d4cb7deff61f333c5986c722b77f9..9338342cb36c28022c780eb60b2494baf0f08914 100644 (file)
@@ -413,19 +413,17 @@ int aisimage_check_params(struct image_tool_params *params)
 /*
  * aisimage parameters
  */
-static struct image_type_params aisimage_params = {
-       .name           = "TI Davinci AIS Boot Image support",
-       .header_size    = 0,
-       .hdr            = NULL,
-       .check_image_type = aisimage_check_image_types,
-       .verify_header  = aisimage_verify_header,
-       .print_header   = aisimage_print_header,
-       .set_header     = aisimage_set_header,
-       .check_params   = aisimage_check_params,
-       .vrec_header    = aisimage_generate,
-};
-
-void init_ais_image_type(void)
-{
-       register_image_type(&aisimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       aisimage,
+       "TI Davinci AIS Boot Image support",
+       0,
+       NULL,
+       aisimage_check_params,
+       aisimage_verify_header,
+       aisimage_print_header,
+       aisimage_set_header,
+       NULL,
+       aisimage_check_image_types,
+       NULL,
+       aisimage_generate
+);
index c8101d2ddc221803c2e07f1991be35abcc69d055..5b72ac54a6d35442232a49780287d83134bdf12b 100644 (file)
@@ -324,19 +324,17 @@ static int atmel_vrec_header(struct image_tool_params *params,
        return EXIT_SUCCESS;
 }
 
-static struct image_type_params atmelimage_params = {
-       .name           = "ATMEL ROM-Boot Image support",
-       .header_size    = 0,
-       .hdr            = NULL,
-       .check_image_type = atmel_check_image_type,
-       .verify_header  = atmel_verify_header,
-       .print_header   = atmel_print_header,
-       .set_header     = atmel_set_header,
-       .check_params   = atmel_check_params,
-       .vrec_header    = atmel_vrec_header,
-};
-
-void init_atmel_image_type(void)
-{
-       register_image_type(&atmelimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       atmelimage,
+       "ATMEL ROM-Boot Image support",
+       0,
+       NULL,
+       atmel_check_params,
+       atmel_verify_header,
+       atmel_print_header,
+       atmel_set_header,
+       NULL,
+       atmel_check_image_type,
+       NULL,
+       atmel_vrec_header
+);
index 0f8ea200f54980b9f840b3df5b4206a6cd8193ca..cf7bf5c17e15025a767a991946ebd98822203e4b 100644 (file)
@@ -141,8 +141,8 @@ $ git clone git://git.denx.de/u-boot.git .
 $ git checkout -b my-branch origin/master
 $ # Add some commits to the branch, reading for testing
 
-2. Create ~/.buildman to tell buildman where to find tool chains. As an
-example:
+2. Create ~/.buildman to tell buildman where to find tool chains (see 'The
+.buildman file' later for details). As an example:
 
 # Buildman settings file
 
@@ -171,7 +171,16 @@ The toolchain-alias section indicates that the i386 toolchain should be used
 to build x86 commits.
 
 
-2. Check the available toolchains
+3. Make sure you have the require Python pre-requisites
+
+Buildman uses multiprocessing, Queue, shutil, StringIO, ConfigParser and
+urllib2. These should normally be available, but if you get an error like
+this then you will need to obtain those modules:
+
+    ImportError: No module named multiprocessing
+
+
+4. Check the available toolchains
 
 Run this check to make sure that you have a toolchain for every architecture.
 
@@ -301,6 +310,47 @@ You can see that everything is covered, even some strange ones that won't
 be used (c88 and c99). This is a feature.
 
 
+5. Install new toolchains if needed
+
+You can download toolchains and update the [toolchain] section of the
+settings file to find them.
+
+To make this easier, buildman can automatically download and install
+toolchains from kernel.org. First list the available architectures:
+
+$ ./tools/buildman/buildman sandbox --fetch-arch list
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.2/
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.1/
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.2.4/
+Available architectures: alpha am33_2.0 arm avr32 bfin cris crisv32 frv h8300
+hppa hppa64 i386 ia64 m32r m68k mips mips64 or32 powerpc powerpc64 s390x sh4
+sparc sparc64 tilegx x86_64 xtensa
+
+Then pick one and download it:
+
+$ ./tools/buildman/buildman sandbox --fetch-arch or32
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.2/
+Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.1/
+Downloading: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.1//x86_64-gcc-4.5.1-nolibc_or32-linux.tar.xz
+Unpacking to: /home/sjg/.buildman-toolchains
+Testing
+      - looking in '/home/sjg/.buildman-toolchains/gcc-4.5.1-nolibc/or32-linux/.'
+      - looking in '/home/sjg/.buildman-toolchains/gcc-4.5.1-nolibc/or32-linux/bin'
+         - found '/home/sjg/.buildman-toolchains/gcc-4.5.1-nolibc/or32-linux/bin/or32-linux-gcc'
+Tool chain test:  OK
+
+Buildman should now be set up to use your new toolchain.
+
+At the time of writing, U-Boot has these architectures:
+
+   arc, arm, avr32, blackfin, m68k, microblaze, mips, nds32, nios2, openrisc
+   powerpc, sandbox, sh, sparc, x86
+
+Of these, only arc, microblaze and nds32 are not available at kernel.org..
+
+
 How to run it
 =============
 
@@ -310,8 +360,9 @@ branch with a valid upstream)
 $ ./tools/buildman/buildman -b <branch> -n
 
 If it can't detect the upstream branch, try checking out the branch, and
-doing something like 'git branch --set-upstream <branch> upstream/master'
-or something similar.
+doing something like 'git branch --set-upstream-to upstream/master'
+or something similar. Buildman will try to guess a suitable upstream branch
+if it can't find one (you will see a message like" Guessing upstream as ...).
 
 As an example:
 
@@ -665,28 +716,62 @@ It is common when refactoring code for the rodata to decrease as the text size
 increases, and vice versa.
 
 
-Providing 'make' flags
-======================
+The .buildman file
+==================
+
+The .buildman file provides information about the available toolchains and
+also allows build flags to be passed to 'make'. It consists of several
+sections, with the section name in square brackets. Within each section are
+a set of (tag, value) pairs.
+
+'[toolchain]' section
+
+    This lists the available toolchains. The tag here doesn't matter, but
+    make sure it is unique. The value is the path to the toolchain. Buildman
+    will look in that path for a file ending in 'gcc'. It will then execute
+    it to check that it is a C compiler, passing only the --version flag to
+    it. If the return code is 0, buildman assumes that it is a valid C
+    compiler. It uses the first part of the name as the architecture and
+    strips off the last part when setting the CROSS_COMPILE environment
+    variable (parts are delimited with a hyphen).
+
+    For example powerpc-linux-gcc will be noted as a toolchain for 'powerpc'
+    and CROSS_COMPILE will be set to powerpc-linux- when using it.
+
+'[toolchain-alias]' section
+
+    This converts toolchain architecture names to U-Boot names. For example,
+    if an x86 toolchains is called i386-linux-gcc it will not normally be
+    used for architecture 'x86'. Adding 'x86: i386 x86_64' to this section
+    will tell buildman that the i386 and x86_64 toolchains can be used for
+    the x86 architecture.
+
+'[make-flags]' section
 
-U-Boot's build system supports a few flags (such as BUILD_TAG) which affect
-the build product. These flags can be specified in the buildman settings
-file. They can also be useful when building U-Boot against other open source
-software.
+    U-Boot's build system supports a few flags (such as BUILD_TAG) which
+    affect the build product. These flags can be specified in the buildman
+    settings file. They can also be useful when building U-Boot against other
+    open source software.
 
-[make-flags]
-at91-boards=ENABLE_AT91_TEST=1
-snapper9260=${at91-boards} BUILD_TAG=442
-snapper9g45=${at91-boards} BUILD_TAG=443
+    [make-flags]
+    at91-boards=ENABLE_AT91_TEST=1
+    snapper9260=${at91-boards} BUILD_TAG=442
+    snapper9g45=${at91-boards} BUILD_TAG=443
 
-This will use 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9260
-and 'make ENABLE_AT91_TEST=1 BUILD_TAG=443' for snapper9g45. A special
-variable ${target} is available to access the target name (snapper9260 and
-snapper9g20 in this case). Variables are resolved recursively. Note that
-variables can only contain the characters A-Z, a-z, 0-9, hyphen (-) and
-underscore (_).
+    This will use 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9260
+    and 'make ENABLE_AT91_TEST=1 BUILD_TAG=443' for snapper9g45. A special
+    variable ${target} is available to access the target name (snapper9260
+    and snapper9g20 in this case). Variables are resolved recursively. Note
+    that variables can only contain the characters A-Z, a-z, 0-9, hyphen (-)
+    and underscore (_).
 
-It is expected that any variables added are dealt with in U-Boot's
-config.mk file and documented in the README.
+    It is expected that any variables added are dealt with in U-Boot's
+    config.mk file and documented in the README.
+
+    Note that you can pass ad-hoc options to the build using environment
+    variables, for example:
+
+       SOME_OPTION=1234 ./tools/buildman/buildman my_board
 
 
 Quick Sanity Check
@@ -698,6 +783,17 @@ build the selected boards and display build status as it runs (i.e. -v is
 enabled automatically). Use -e to see errors/warnings as well.
 
 
+Building Ranges
+===============
+
+You can build a range of commits by specifying a range instead of a branch
+when using the -b flag. For example:
+
+    upstream/master..us-buildman
+
+will build commits in us-buildman that are not in upstream/master.
+
+
 Other options
 =============
 
index fdd875b0736f9ec918c443b50778c84aef33cdfa..b36146918005b92ce6eafd5af88ba664b0200bfa 100644 (file)
@@ -40,7 +40,16 @@ def GetItems(section):
     try:
         return settings.items(section)
     except ConfigParser.NoSectionError as e:
-        print e
         return []
     except:
         raise
+
+def SetItem(section, tag, value):
+    """Set an item and write it back to the settings file"""
+    global settings
+    global config_fname
+
+    settings.set(section, tag, value)
+    if config_fname is not None:
+        with open(config_fname, 'w') as fd:
+            settings.write(fd)
index 7002034221d12789473d33e7f62cb21cbe296be7..1b0ad9927592d9b22ca63893de0bd2255db8fb7d 100644 (file)
@@ -174,7 +174,8 @@ class Builder:
             self.func_sizes = func_sizes
 
     def __init__(self, toolchains, base_dir, git_dir, num_threads, num_jobs,
-                 gnu_make='make', checkout=True, show_unknown=True, step=1):
+                 gnu_make='make', checkout=True, show_unknown=True, step=1,
+                 no_subdirs=False, full_path=False, verbose_build=False):
         """Create a new Builder object
 
         Args:
@@ -188,6 +189,11 @@ class Builder:
                 This is used for testing.
             show_unknown: Show unknown boards (those not built) in summary
             step: 1 to process every commit, n to process every nth commit
+            no_subdirs: Don't create subdirectories when building current
+                source for a single board
+            full_path: Return the full path in CROSS_COMPILE and don't set
+                PATH
+            verbose_build: Run build with V=1 and don't use 'make -s'
         """
         self.toolchains = toolchains
         self.base_dir = base_dir
@@ -213,6 +219,9 @@ class Builder:
         self._step = step
         self.in_tree = False
         self._error_lines = 0
+        self.no_subdirs = no_subdirs
+        self.full_path = full_path
+        self.verbose_build = verbose_build
 
         self.col = terminal.Color()
 
@@ -392,15 +401,17 @@ class Builder:
         Args:
             commit_upto: Commit number to use (0..self.count-1)
         """
+        commit_dir = None
         if self.commits:
             commit = self.commits[commit_upto]
             subject = commit.subject.translate(trans_valid_chars)
             commit_dir = ('%02d_of_%02d_g%s_%s' % (commit_upto + 1,
                     self.commit_count, commit.hash, subject[:20]))
-        else:
+        elif not self.no_subdirs:
             commit_dir = 'current'
-        output_dir = os.path.join(self.base_dir, commit_dir)
-        return output_dir
+        if not commit_dir:
+            return self.base_dir
+        return os.path.join(self.base_dir, commit_dir)
 
     def GetBuildDir(self, commit_upto, target):
         """Get the name of the build directory for a commit number
@@ -1115,6 +1126,8 @@ class Builder:
         create. Having left over directories is confusing when the user wants
         to check the output manually.
         """
+        if not self.commits:
+            return
         dir_list = []
         for commit_upto in range(self.commit_count):
             dir_list.append(self._GetOutputDir(commit_upto))
index bc4541cb3eb90b357e4608aca5ceae583eee1c05..efb62f16d7020793d6f24439fd34c46df05134db 100644 (file)
@@ -177,7 +177,7 @@ class BuilderThread(threading.Thread):
                     commit = 'current'
 
                 # Set up the environment and command line
-                env = self.toolchain.MakeEnvironment()
+                env = self.toolchain.MakeEnvironment(self.builder.full_path)
                 Mkdir(out_dir)
                 args = []
                 cwd = work_dir
@@ -197,7 +197,8 @@ class BuilderThread(threading.Thread):
                         src_dir = os.getcwd()
                     else:
                         args.append('O=build')
-                args.append('-s')
+                if not self.builder.verbose_build:
+                    args.append('-s')
                 if self.builder.num_jobs is not None:
                     args.extend(['-j', str(self.builder.num_jobs)])
                 config_args = ['%s_defconfig' % brd.target]
@@ -284,7 +285,7 @@ class BuilderThread(threading.Thread):
                 print >>fd, 'path', result.toolchain.path
 
             # Write out the image and function size information and an objdump
-            env = result.toolchain.MakeEnvironment()
+            env = result.toolchain.MakeEnvironment(self.builder.full_path)
             lines = []
             for fname in ['u-boot', 'spl/u-boot-spl']:
                 cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]
index 27d3c708e6f311d473ed8f6cb9200d82ba148779..e8a6dadd1c7dfd8cca279b7c5cde03de337315f9 100644 (file)
@@ -36,6 +36,10 @@ def ParseArgs():
     parser.add_option('-F', '--force-build-failures', dest='force_build_failures',
           action='store_true', default=False,
           help='Force build of previously-failed build')
+    parser.add_option('--fetch-arch', type='string',
+          help="Fetch a toolchain for architecture FETCH_ARCH ('list' to list)."
+              ' You can also fetch several toolchains separate by comma, or'
+              " 'all' to download all")
     parser.add_option('-g', '--git', type='string',
           help='Git repo containing branch to build', default='.')
     parser.add_option('-G', '--config-file', type='string',
@@ -55,11 +59,15 @@ def ParseArgs():
           help='List available tool chains')
     parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
           default=False, help="Do a dry run (describe actions, but do nothing)")
+    parser.add_option('-N', '--no-subdirs', action='store_true', dest='no_subdirs',
+          default=False, help="Don't create subdirectories when building current source for a single board")
     parser.add_option('-o', '--output-dir', type='string',
           dest='output_dir', default='..',
           help='Directory where all builds happen and buildman has its workspace (default is ../)')
     parser.add_option('-Q', '--quick', action='store_true',
           default=False, help='Do a rough build, with limited warning resolution')
+    parser.add_option('-p', '--full-path', action='store_true',
+          default=False, help="Use full toolchain path in CROSS_COMPILE")
     parser.add_option('-s', '--summary', action='store_true',
           default=False, help='Show a build summary')
     parser.add_option('-S', '--show-sizes', action='store_true',
@@ -74,6 +82,8 @@ def ParseArgs():
           default=False, help='Show boards with unknown build result')
     parser.add_option('-v', '--verbose', action='store_true',
           default=False, help='Show build results while the build progresses')
+    parser.add_option('-V', '--verbose-build', action='store_true',
+          default=False, help='Run make with V=1, showing all output')
     parser.add_option('-x', '--exclude', dest='exclude',
           type='string', action='append',
           help='Specify a list of boards to exclude, separated by comma')
index fb79a1ecfef19c8087998eb5b95d1a196a4d50e2..720b978b238ffb8d664f03278b6a7f29cb7f3d73 100644 (file)
@@ -118,21 +118,45 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         print
         return 0
 
+    if options.fetch_arch:
+        if options.fetch_arch == 'list':
+            sorted_list = toolchains.ListArchs()
+            print 'Available architectures: %s\n' % ' '.join(sorted_list)
+            return 0
+        else:
+            fetch_arch = options.fetch_arch
+            if fetch_arch == 'all':
+                fetch_arch = ','.join(toolchains.ListArchs())
+                print 'Downloading toolchains: %s\n' % fetch_arch
+            for arch in fetch_arch.split(','):
+                ret = toolchains.FetchAndInstall(arch)
+                if ret:
+                    return ret
+            return 0
+
     # Work out how many commits to build. We want to build everything on the
     # branch. We also build the upstream commit as a control so we can see
     # problems introduced by the first commit on the branch.
     col = terminal.Color()
     count = options.count
+    has_range = options.branch and '..' in options.branch
     if count == -1:
         if not options.branch:
             count = 1
         else:
-            count = gitutil.CountCommitsInBranch(options.git_dir,
-                                                 options.branch)
+            if has_range:
+                count, msg = gitutil.CountCommitsInRange(options.git_dir,
+                                                         options.branch)
+            else:
+                count, msg = gitutil.CountCommitsInBranch(options.git_dir,
+                                                          options.branch)
             if count is None:
-                str = ("Branch '%s' not found or has no upstream" %
-                       options.branch)
-                sys.exit(col.Color(col.RED, str))
+                sys.exit(col.Color(col.RED, msg))
+            elif count == 0:
+                sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+                                   options.branch))
+            if msg:
+                print col.Color(col.YELLOW, msg)
             count += 1   # Build upstream commit also
 
     if not count:
@@ -172,8 +196,11 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
     # to overwrite earlier ones by setting allow_overwrite=True
     if options.branch:
         if count == -1:
-            range_expr = gitutil.GetRangeInBranch(options.git_dir,
-                                                  options.branch)
+            if has_range:
+                range_expr = options.branch
+            else:
+                range_expr = gitutil.GetRangeInBranch(options.git_dir,
+                                                      options.branch)
             upstream_commit = gitutil.GetUpstream(options.git_dir,
                                                   options.branch)
             series = patchstream.GetMetaDataForList(upstream_commit,
@@ -207,17 +234,22 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
     if not gnu_make:
         sys.exit('GNU Make not found')
 
-    # Create a new builder with the selected options
+    # Create a new builder with the selected options.
+    output_dir = options.output_dir
     if options.branch:
         dirname = options.branch.replace('/', '_')
-    else:
-        dirname = 'current'
-    output_dir = os.path.join(options.output_dir, dirname)
-    if clean_dir and os.path.exists(output_dir):
+        # As a special case allow the board directory to be placed in the
+        # output directory itself rather than any subdirectory.
+        if not options.no_subdirs:
+            output_dir = os.path.join(options.output_dir, dirname)
+    if (clean_dir and output_dir != options.output_dir and
+            os.path.exists(output_dir)):
         shutil.rmtree(output_dir)
     builder = Builder(toolchains, output_dir, options.git_dir,
             options.threads, options.jobs, gnu_make=gnu_make, checkout=True,
-            show_unknown=options.show_unknown, step=options.step)
+            show_unknown=options.show_unknown, step=options.step,
+            no_subdirs=options.no_subdirs, full_path=options.full_path,
+            verbose_build=options.verbose_build)
     builder.force_config_on_failure = not options.quick
     if make_func:
         builder.do_make = make_func
index a2a85ac9ce42873b420db6fda98dadc4a707c534..c0ad5d027dce1c3f3e5c56df4e7e242fc007a3da 100644 (file)
@@ -24,6 +24,16 @@ import commit
 import terminal
 import toolchain
 
+settings_data = '''
+# Buildman settings file
+
+[toolchain]
+main: /usr/sbin
+
+[toolchain-alias]
+x86: i386 x86_64
+'''
+
 errors = [
     '''main.c: In function 'main_loop':
 main.c:260:6: warning: unused variable 'joe' [-Wunused-variable]
@@ -83,6 +93,8 @@ boards = [
     ['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''],
 ]
 
+BASE_DIR = 'base'
+
 class Options:
     """Class that holds build options"""
     pass
@@ -111,8 +123,11 @@ class TestBuild(unittest.TestCase):
             self.boards.AddBoard(board.Board(*brd))
         self.boards.SelectBoards([])
 
+        # Add some test settings
+        bsettings.Setup(None)
+        bsettings.AddFile(settings_data)
+
         # Set up the toolchains
-        bsettings.Setup()
         self.toolchains = toolchain.Toolchains()
         self.toolchains.Add('arm-linux-gcc', test=False)
         self.toolchains.Add('sparc-linux-gcc', test=False)
@@ -341,6 +356,64 @@ class TestBuild(unittest.TestCase):
         self.assertEqual(self.boards.SelectBoards(['sandbox sandbox',
                                                    'sandbox']),
                          {'all': 1, 'sandbox': 1})
+    def CheckDirs(self, build, dirname):
+        self.assertEqual('base%s' % dirname, build._GetOutputDir(1))
+        self.assertEqual('base%s/fred' % dirname,
+                         build.GetBuildDir(1, 'fred'))
+        self.assertEqual('base%s/fred/done' % dirname,
+                         build.GetDoneFile(1, 'fred'))
+        self.assertEqual('base%s/fred/u-boot.sizes' % dirname,
+                         build.GetFuncSizesFile(1, 'fred', 'u-boot'))
+        self.assertEqual('base%s/fred/u-boot.objdump' % dirname,
+                         build.GetObjdumpFile(1, 'fred', 'u-boot'))
+        self.assertEqual('base%s/fred/err' % dirname,
+                         build.GetErrFile(1, 'fred'))
+
+    def testOutputDir(self):
+        build = builder.Builder(self.toolchains, BASE_DIR, None, 1, 2,
+                                checkout=False, show_unknown=False)
+        build.commits = self.commits
+        build.commit_count = len(self.commits)
+        subject = self.commits[1].subject.translate(builder.trans_valid_chars)
+        dirname ='/%02d_of_%02d_g%s_%s' % (2, build.commit_count, commits[1][0],
+                                           subject[:20])
+        self.CheckDirs(build, dirname)
+
+    def testOutputDirCurrent(self):
+        build = builder.Builder(self.toolchains, BASE_DIR, None, 1, 2,
+                                checkout=False, show_unknown=False)
+        build.commits = None
+        build.commit_count = 0
+        self.CheckDirs(build, '/current')
+
+    def testOutputDirNoSubdirs(self):
+        build = builder.Builder(self.toolchains, BASE_DIR, None, 1, 2,
+                                checkout=False, show_unknown=False,
+                                no_subdirs=True)
+        build.commits = None
+        build.commit_count = 0
+        self.CheckDirs(build, '')
+
+    def testToolchainAliases(self):
+        self.assertTrue(self.toolchains.Select('arm') != None)
+        with self.assertRaises(ValueError):
+            self.toolchains.Select('no-arch')
+        with self.assertRaises(ValueError):
+            self.toolchains.Select('x86')
+
+        self.toolchains = toolchain.Toolchains()
+        self.toolchains.Add('x86_64-linux-gcc', test=False)
+        self.assertTrue(self.toolchains.Select('x86') != None)
+
+        self.toolchains = toolchain.Toolchains()
+        self.toolchains.Add('i386-linux-gcc', test=False)
+        self.assertTrue(self.toolchains.Select('x86') != None)
+
+    def testToolchainDownload(self):
+        """Test that we can download toolchains"""
+        self.assertEqual('https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/x86_64-gcc-4.6.3-nolibc_arm-unknown-linux-gnueabi.tar.xz',
+            self.toolchains.LocateArchUrl('arm'))
+
 
 if __name__ == "__main__":
     unittest.main()
index 27dc31889b8021c64d0af0d9bdf2898253e0b993..d4c5d4a11eb96bbea64da6d4e1fb56eea985c4e8 100644 (file)
@@ -5,11 +5,42 @@
 
 import re
 import glob
+from HTMLParser import HTMLParser
 import os
+import sys
+import tempfile
+import urllib2
 
 import bsettings
 import command
 
+# Simple class to collect links from a page
+class MyHTMLParser(HTMLParser):
+    def __init__(self, arch):
+        """Create a new parser
+
+        After the parser runs, self.links will be set to a list of the links
+        to .xz archives found in the page, and self.arch_link will be set to
+        the one for the given architecture (or None if not found).
+
+        Args:
+            arch: Architecture to search for
+        """
+        HTMLParser.__init__(self)
+        self.arch_link = None
+        self.links = []
+        self._match = '_%s-' % arch
+
+    def handle_starttag(self, tag, attrs):
+        if tag == 'a':
+            for tag, value in attrs:
+                if tag == 'href':
+                    if value and value.endswith('.xz'):
+                        self.links.append(value)
+                        if self._match in value:
+                            self.arch_link = value
+
+
 class Toolchain:
     """A single toolchain
 
@@ -20,7 +51,6 @@ class Toolchain:
         arch: Architecture of toolchain as determined from the first
                 component of the filename. E.g. arm-linux-gcc becomes arm
     """
-
     def __init__(self, fname, test, verbose=False):
         """Create a new toolchain object.
 
@@ -30,11 +60,18 @@ class Toolchain:
         """
         self.gcc = fname
         self.path = os.path.dirname(fname)
-        self.cross = os.path.basename(fname)[:-3]
+
+        # Find the CROSS_COMPILE prefix to use for U-Boot. For example,
+        # 'arm-linux-gnueabihf-gcc' turns into 'arm-linux-gnueabihf-'.
+        basename = os.path.basename(fname)
+        pos = basename.rfind('-')
+        self.cross = basename[:pos + 1] if pos != -1 else ''
+
+        # The architecture is the first part of the name
         pos = self.cross.find('-')
         self.arch = self.cross[:pos] if pos != -1 else 'sandbox'
 
-        env = self.MakeEnvironment()
+        env = self.MakeEnvironment(False)
 
         # As a basic sanity check, run the C compiler with --version
         cmd = [fname, '--version']
@@ -74,15 +111,23 @@ class Toolchain:
                 return prio
         return prio
 
-    def MakeEnvironment(self):
+    def MakeEnvironment(self, full_path):
         """Returns an environment for using the toolchain.
 
-        Thie takes the current environment, adds CROSS_COMPILE and
-        augments PATH so that the toolchain will operate correctly.
+        Thie takes the current environment and adds CROSS_COMPILE so that
+        the tool chain will operate correctly.
+
+        Args:
+            full_path: Return the full path in CROSS_COMPILE and don't set
+                PATH
         """
         env = dict(os.environ)
-        env['CROSS_COMPILE'] = self.cross
-        env['PATH'] += (':' + self.path)
+        if full_path:
+            env['CROSS_COMPILE'] = os.path.join(self.path, self.cross)
+        else:
+            env['CROSS_COMPILE'] = self.cross
+            env['PATH'] = self.path + ':' + env['PATH']
+
         return env
 
 
@@ -101,18 +146,29 @@ class Toolchains:
         self.paths = []
         self._make_flags = dict(bsettings.GetItems('make-flags'))
 
-    def GetSettings(self):
+    def GetPathList(self):
+        """Get a list of available toolchain paths
+
+        Returns:
+            List of strings, each a path to a toolchain mentioned in the
+            [toolchain] section of the settings file.
+        """
         toolchains = bsettings.GetItems('toolchain')
         if not toolchains:
             print ("Warning: No tool chains - please add a [toolchain] section"
                  " to your buildman config file %s. See README for details" %
                  bsettings.config_fname)
 
+        paths = []
         for name, value in toolchains:
             if '*' in value:
-                self.paths += glob.glob(value)
+                paths += glob.glob(value)
             else:
-                self.paths.append(value)
+                paths.append(value)
+        return paths
+
+    def GetSettings(self):
+      self.paths += self.GetPathList()
 
     def Add(self, fname, test=True, verbose=False):
         """Add a toolchain to our list
@@ -132,6 +188,24 @@ class Toolchains:
         if add_it:
             self.toolchains[toolchain.arch] = toolchain
 
+    def ScanPath(self, path, verbose):
+        """Scan a path for a valid toolchain
+
+        Args:
+            path: Path to scan
+            verbose: True to print out progress information
+        Returns:
+            Filename of C compiler if found, else None
+        """
+        for subdir in ['.', 'bin', 'usr/bin']:
+            dirname = os.path.join(path, subdir)
+            if verbose: print "      - looking in '%s'" % dirname
+            for fname in glob.glob(dirname + '/*gcc'):
+                if verbose: print "         - found '%s'" % fname
+                return fname
+        return None
+
+
     def Scan(self, verbose):
         """Scan for available toolchains and select the best for each arch.
 
@@ -145,12 +219,9 @@ class Toolchains:
         if verbose: print 'Scanning for tool chains'
         for path in self.paths:
             if verbose: print "   - scanning path '%s'" % path
-            for subdir in ['.', 'bin', 'usr/bin']:
-                dirname = os.path.join(path, subdir)
-                if verbose: print "      - looking in '%s'" % dirname
-                for fname in glob.glob(dirname + '/*gcc'):
-                    if verbose: print "         - found '%s'" % fname
-                    self.Add(fname, True, verbose)
+            fname = self.ScanPath(path, verbose)
+            if fname:
+                self.Add(fname, True, verbose)
 
     def List(self):
         """List out the selected toolchains for each architecture"""
@@ -170,9 +241,11 @@ class Toolchains:
         returns:
             toolchain object, or None if none found
         """
-        for name, value in bsettings.GetItems('toolchain-alias'):
-            if arch == name:
-                arch = value
+        for tag, value in bsettings.GetItems('toolchain-alias'):
+            if arch == tag:
+                for alias in value.split():
+                    if alias in self.toolchains:
+                        return self.toolchains[alias]
 
         if not arch in self.toolchains:
             raise ValueError, ("No tool chain found for arch '%s'" % arch)
@@ -247,3 +320,160 @@ class Toolchains:
             else:
                 i += 1
         return args
+
+    def LocateArchUrl(self, fetch_arch):
+        """Find a toolchain available online
+
+        Look in standard places for available toolchains. At present the
+        only standard place is at kernel.org.
+
+        Args:
+            arch: Architecture to look for, or 'list' for all
+        Returns:
+            If fetch_arch is 'list', a tuple:
+                Machine architecture (e.g. x86_64)
+                List of toolchains
+            else
+                URL containing this toolchain, if avaialble, else None
+        """
+        arch = command.OutputOneLine('uname', '-m')
+        base = 'https://www.kernel.org/pub/tools/crosstool/files/bin'
+        versions = ['4.6.3', '4.6.2', '4.5.1', '4.2.4']
+        links = []
+        for version in versions:
+            url = '%s/%s/%s/' % (base, arch, version)
+            print 'Checking: %s' % url
+            response = urllib2.urlopen(url)
+            html = response.read()
+            parser = MyHTMLParser(fetch_arch)
+            parser.feed(html)
+            if fetch_arch == 'list':
+                links += parser.links
+            elif parser.arch_link:
+                return url + parser.arch_link
+        if fetch_arch == 'list':
+            return arch, links
+        return None
+
+    def Download(self, url):
+        """Download a file to a temporary directory
+
+        Args:
+            url: URL to download
+        Returns:
+            Tuple:
+                Temporary directory name
+                Full path to the downloaded archive file in that directory,
+                    or None if there was an error while downloading
+        """
+        print "Downloading: %s" % url
+        leaf = url.split('/')[-1]
+        tmpdir = tempfile.mkdtemp('.buildman')
+        response = urllib2.urlopen(url)
+        fname = os.path.join(tmpdir, leaf)
+        fd = open(fname, 'wb')
+        meta = response.info()
+        size = int(meta.getheaders("Content-Length")[0])
+        done = 0
+        block_size = 1 << 16
+        status = ''
+
+        # Read the file in chunks and show progress as we go
+        while True:
+            buffer = response.read(block_size)
+            if not buffer:
+                print chr(8) * (len(status) + 1), '\r',
+                break
+
+            done += len(buffer)
+            fd.write(buffer)
+            status = r"%10d MiB  [%3d%%]" % (done / 1024 / 1024,
+                                             done * 100 / size)
+            status = status + chr(8) * (len(status) + 1)
+            print status,
+            sys.stdout.flush()
+        fd.close()
+        if done != size:
+            print 'Error, failed to download'
+            os.remove(fname)
+            fname = None
+        return tmpdir, fname
+
+    def Unpack(self, fname, dest):
+        """Unpack a tar file
+
+        Args:
+            fname: Filename to unpack
+            dest: Destination directory
+        Returns:
+            Directory name of the first entry in the archive, without the
+            trailing /
+        """
+        stdout = command.Output('tar', 'xvfJ', fname, '-C', dest)
+        return stdout.splitlines()[0][:-1]
+
+    def TestSettingsHasPath(self, path):
+        """Check if builmand will find this toolchain
+
+        Returns:
+            True if the path is in settings, False if not
+        """
+        paths = self.GetPathList()
+        return path in paths
+
+    def ListArchs(self):
+        """List architectures with available toolchains to download"""
+        host_arch, archives = self.LocateArchUrl('list')
+        re_arch = re.compile('[-a-z0-9.]*_([^-]*)-.*')
+        arch_set = set()
+        for archive in archives:
+            # Remove the host architecture from the start
+            arch = re_arch.match(archive[len(host_arch):])
+            if arch:
+                arch_set.add(arch.group(1))
+        return sorted(arch_set)
+
+    def FetchAndInstall(self, arch):
+        """Fetch and install a new toolchain
+
+        arch:
+            Architecture to fetch, or 'list' to list
+        """
+        # Fist get the URL for this architecture
+        url = self.LocateArchUrl(arch)
+        if not url:
+            print ("Cannot find toolchain for arch '%s' - use 'list' to list" %
+                   arch)
+            return 2
+        home = os.environ['HOME']
+        dest = os.path.join(home, '.buildman-toolchains')
+        if not os.path.exists(dest):
+            os.mkdir(dest)
+
+        # Download the tar file for this toolchain and unpack it
+        tmpdir, tarfile = self.Download(url)
+        if not tarfile:
+            return 1
+        print 'Unpacking to: %s' % dest,
+        sys.stdout.flush()
+        path = self.Unpack(tarfile, dest)
+        os.remove(tarfile)
+        os.rmdir(tmpdir)
+        print
+
+        # Check that the toolchain works
+        print 'Testing'
+        dirpath = os.path.join(dest, path)
+        compiler_fname = self.ScanPath(dirpath, True)
+        if not compiler_fname:
+            print 'Could not locate C compiler - fetch failed.'
+            return 1
+        toolchain = Toolchain(compiler_fname, True, True)
+
+        # Make sure that it will be found by buildman
+        if not self.TestSettingsHasPath(dirpath):
+            print ("Adding 'download' to config file '%s'" %
+                   bsettings.config_fname)
+            tools_dir = os.path.dirname(dirpath)
+            bsettings.SetItem('toolchain', 'download', '%s/*' % tools_dir)
+        return 0
index 0a0792e503eadefe058f51db90c5fe98fcc2e1e2..cf5c0d4393b0937b55bb684023a43a2c0d62f9cd 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 #include "imagetool.h"
+#include "mkimage.h"
+
 #include <image.h>
 #include <u-boot/crc.h>
 
@@ -53,9 +55,8 @@ static int image_verify_header(unsigned char *ptr, int image_size,
        memcpy(hdr, ptr, sizeof(image_header_t));
 
        if (be32_to_cpu(hdr->ih_magic) != IH_MAGIC) {
-               fprintf(stderr,
-                       "%s: Bad Magic Number: \"%s\" is no valid image\n",
-                       params->cmdname, params->imagefile);
+               debug("%s: Bad Magic Number: \"%s\" is no valid image\n",
+                     params->cmdname, params->imagefile);
                return -FDT_ERR_BADMAGIC;
        }
 
@@ -66,9 +67,8 @@ static int image_verify_header(unsigned char *ptr, int image_size,
        hdr->ih_hcrc = cpu_to_be32(0);  /* clear for re-calculation */
 
        if (crc32(0, data, len) != checksum) {
-               fprintf(stderr,
-                       "%s: ERROR: \"%s\" has bad header checksum!\n",
-                       params->cmdname, params->imagefile);
+               debug("%s: ERROR: \"%s\" has bad header checksum!\n",
+                     params->cmdname, params->imagefile);
                return -FDT_ERR_BADSTATE;
        }
 
@@ -77,9 +77,8 @@ static int image_verify_header(unsigned char *ptr, int image_size,
 
        checksum = be32_to_cpu(hdr->ih_dcrc);
        if (crc32(0, data, len) != checksum) {
-               fprintf(stderr,
-                       "%s: ERROR: \"%s\" has corrupted data!\n",
-                       params->cmdname, params->imagefile);
+               debug("%s: ERROR: \"%s\" has corrupted data!\n",
+                     params->cmdname, params->imagefile);
                return -FDT_ERR_BADSTRUCTURE;
        }
        return 0;
@@ -117,33 +116,7 @@ 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)
+static int image_extract_subimage(void *ptr, struct image_tool_params *params)
 {
        const image_header_t *hdr = (const image_header_t *)ptr;
        ulong file_data;
@@ -170,25 +143,23 @@ static int image_extract_datafile(void *ptr, struct image_tool_params *params)
        }
 
        /* save the "data file" into the file system */
-       return image_save_datafile(params, file_data, file_len);
+       return imagetool_save_subimage(params->outfile, file_data, file_len);
 }
 
 /*
  * Default image type parameters definition
  */
-static struct image_type_params defimage_params = {
-       .name = "Default Image support",
-       .header_size = sizeof(image_header_t),
-       .hdr = (void*)&header,
-       .check_image_type = image_check_image_types,
-       .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)
-{
-       register_image_type(&defimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       defimage,
+       "Default Image support",
+       sizeof(image_header_t),
+       (void *)&header,
+       image_check_params,
+       image_verify_header,
+       image_print_contents,
+       image_set_header,
+       image_extract_subimage,
+       image_check_image_types,
+       NULL,
+       NULL
+);
index 542ee2821096fd41614dc05de3f5ab789840e374..75a5d4762cda6b1e31432a1e419b3d8400e7751e 100644 (file)
 
 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 -
+ * dumpimage_extract_subimage -
  *
  * It scans all registered image types,
  * verifies image_header for each supported image type
@@ -127,29 +28,27 @@ static int dumpimage_verify_print_header(void *ptr, struct stat *sbuf)
  * 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)
+static int dumpimage_extract_subimage(struct image_type_params *tparams,
+               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;
-                       }
+       if (tparams->verify_header) {
+               retval = tparams->verify_header((unsigned char *)ptr,
+                               sbuf->st_size, &params);
+               if (retval != 0)
+                       return -1;
+               /*
+                * Extract the file from the image
+                * if verify is successful
+                */
+               if (tparams->extract_subimage) {
+                       retval = tparams->extract_subimage(ptr, &params);
+               } else {
+                       fprintf(stderr,
+                               "%s: extract_subimage undefined for %s\n",
+                               params.cmdname, tparams->name);
+                       return -2;
                }
        }
 
@@ -165,12 +64,9 @@ int main(int argc, char **argv)
        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) {
+       while ((opt = getopt(argc, argv, "li:o:T:p:V")) != -1) {
                switch (opt) {
                case 'l':
                        params.lflag = 1;
@@ -182,6 +78,12 @@ int main(int argc, char **argv)
                case 'o':
                        params.outfile = optarg;
                        break;
+               case 'T':
+                       params.type = genimg_get_type_id(optarg);
+                       if (params.type < 0) {
+                               usage();
+                       }
+                       break;
                case 'p':
                        params.pflag = strtoul(optarg, &ptr, 10);
                        if (*ptr) {
@@ -196,6 +98,7 @@ int main(int argc, char **argv)
                        exit(EXIT_SUCCESS);
                default:
                        usage();
+                       break;
                }
        }
 
@@ -203,9 +106,9 @@ int main(int argc, char **argv)
                usage();
 
        /* set tparams as per input type_id */
-       tparams = dumpimage_get_type(params.type);
+       tparams = imagetool_get_type(params.type);
        if (tparams == NULL) {
-               fprintf(stderr, "%s: unsupported type %s\n",
+               fprintf(stderr, "%s: unsupported type: %s\n",
                        params.cmdname, genimg_get_type_name(params.type));
                exit(EXIT_FAILURE);
        }
@@ -242,7 +145,7 @@ int main(int argc, char **argv)
                        exit(EXIT_FAILURE);
                }
 
-               if ((unsigned)sbuf.st_size < tparams->header_size) {
+               if ((uint32_t)sbuf.st_size < tparams->header_size) {
                        fprintf(stderr,
                                "%s: Bad size: \"%s\" is not valid image\n",
                                params.cmdname, params.imagefile);
@@ -267,13 +170,15 @@ int main(int argc, char **argv)
                         * Extract the data files from within the matched
                         * image type. Returns the error code if not matched
                         */
-                       retval = dumpimage_extract_datafile(ptr, &sbuf);
+                       retval = dumpimage_extract_subimage(tparams, 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);
+                       retval = imagetool_verify_print_header(ptr, &sbuf,
+                                       tparams, &params);
                }
 
                (void)munmap((void *)ptr, sbuf.st_size);
@@ -293,9 +198,10 @@ static void usage(void)
                "          -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",
+               "       %s -i image -T type [-p position] [-o outfile] data_file\n"
+               "          -i ==> extract from the 'image' a specific 'data_file'\n"
+               "          -T ==> set image type to 'type'\n"
+               "          -p ==> 'position' (starting at 0) of the 'data_file' inside the 'image'\n",
                params.cmdname);
        fprintf(stderr,
                "       %s -V ==> print version information and exit\n",
index 3ececf913ff4c4fe2c1c2457f3f5b5ccbfa195fb..eb2a25eeac6aebcd7ae764ff8a593d18cc482528 100644 (file)
@@ -155,6 +155,97 @@ err_system:
        return -1;
 }
 
+/**
+ * fit_image_extract - extract a FIT component image
+ * @fit: pointer to the FIT format image header
+ * @image_noffset: offset of the component image node
+ * @file_name: name of the file to store the FIT sub-image
+ *
+ * returns:
+ *     zero in case of success or a negative value if fail.
+ */
+static int fit_image_extract(
+       const void *fit,
+       int image_noffset,
+       const char *file_name)
+{
+       const void *file_data;
+       size_t file_size = 0;
+
+       /* get the "data" property of component at offset "image_noffset" */
+       fit_image_get_data(fit, image_noffset, &file_data, &file_size);
+
+       /* save the "file_data" into the file specified by "file_name" */
+       return imagetool_save_subimage(file_name, (ulong) file_data, file_size);
+}
+
+/**
+ * fit_extract_contents - retrieve a sub-image component from the FIT image
+ * @ptr: pointer to the FIT format image header
+ * @params: command line parameters
+ *
+ * returns:
+ *     zero in case of success or a negative value if fail.
+ */
+static int fit_extract_contents(void *ptr, struct image_tool_params *params)
+{
+       int images_noffset;
+       int noffset;
+       int ndepth;
+       const void *fit = ptr;
+       int count = 0;
+       const char *p;
+
+       /* Indent string is defined in header image.h */
+       p = IMAGE_INDENT_STRING;
+
+       if (!fit_check_format(fit)) {
+               printf("Bad FIT image format\n");
+               return -1;
+       }
+
+       /* Find images parent node offset */
+       images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               printf("Can't find images parent node '%s' (%s)\n",
+                      FIT_IMAGES_PATH, fdt_strerror(images_noffset));
+               return -1;
+       }
+
+       /* Avoid any overrun */
+       count = fit_get_subimage_count(fit, images_noffset);
+       if ((params->pflag < 0) || (count <= params->pflag)) {
+               printf("No such component at '%d'\n", params->pflag);
+               return -1;
+       }
+
+       /* Process its subnodes, extract the desired component from image */
+       for (ndepth = 0, count = 0,
+               noffset = fdt_next_node(fit, images_noffset, &ndepth);
+               (noffset >= 0) && (ndepth > 0);
+               noffset = fdt_next_node(fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /*
+                        * Direct child node of the images parent node,
+                        * i.e. component image node.
+                        */
+                       if (params->pflag == count) {
+                               printf("Extracted:\n%s Image %u (%s)\n", p,
+                                      count, fit_get_name(fit, noffset, NULL));
+
+                               fit_image_print(fit, noffset, p);
+
+                               return fit_image_extract(fit, noffset,
+                                               params->outfile);
+                       }
+
+                       count++;
+               }
+       }
+
+       return 0;
+}
+
 static int fit_check_params(struct image_tool_params *params)
 {
        return  ((params->dflag && (params->fflag || params->lflag)) ||
@@ -162,19 +253,17 @@ static int fit_check_params(struct image_tool_params *params)
                (params->lflag && (params->dflag || params->fflag)));
 }
 
-static struct image_type_params fitimage_params = {
-       .name = "FIT Image support",
-       .header_size = sizeof(image_header_t),
-       .hdr = (void*)&header,
-       .verify_header = fit_verify_header,
-       .print_header = fit_print_contents,
-       .check_image_type = fit_check_image_types,
-       .fflag_handle = fit_handle_file,
-       .set_header = NULL,     /* FIT images use DTB header */
-       .check_params = fit_check_params,
-};
-
-void init_fit_image_type (void)
-{
-       register_image_type(&fitimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       fitimage,
+       "FIT Image support",
+       sizeof(image_header_t),
+       (void *)&header,
+       fit_check_params,
+       fit_verify_header,
+       fit_print_contents,
+       NULL,
+       fit_extract_contents,
+       fit_check_image_types,
+       fit_handle_file,
+       NULL /* FIT images use DTB header */
+);
index b343a3aa8b7c2964eb58d5098149504f947344af..5ad52be4377467614c36a2de18d94c9c0c6f5351 100644 (file)
@@ -32,7 +32,8 @@ void to_be32(uint32_t *gph_size, uint32_t *gph_load_addr)
 
 int gph_verify_header(struct gp_header *gph, int be)
 {
-       uint32_t gph_size = gph->size, gph_load_addr = gph->load_addr;
+       uint32_t gph_size = gph->size;
+       uint32_t gph_load_addr = gph->load_addr;
 
        if (be)
                to_be32(&gph_size, &gph_load_addr);
index 1cabb5b612e2a485662e6d5c411e5851c12efd06..1adc55c5fca9effb91eeb8f8541282abd8ba7839 100644 (file)
@@ -60,18 +60,17 @@ static void gpimage_set_header(void *ptr, struct stat *sbuf, int ifd,
 /*
  * gpimage parameters
  */
-static struct image_type_params gpimage_params = {
-       .name           = "TI KeyStone GP Image support",
-       .header_size    = GPIMAGE_HDR_SIZE,
-       .hdr            = (void *)&gpimage_header,
-       .check_image_type = gpimage_check_image_types,
-       .verify_header  = gpimage_verify_header,
-       .print_header   = gpimage_print_header,
-       .set_header     = gpimage_set_header,
-       .check_params   = gpimage_check_params,
-};
-
-void init_gpimage_type(void)
-{
-       register_image_type(&gpimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       gpimage,
+       "TI KeyStone GP Image support",
+       GPIMAGE_HDR_SIZE,
+       (void *)&gpimage_header,
+       gpimage_check_params,
+       gpimage_verify_header,
+       gpimage_print_header,
+       gpimage_set_header,
+       NULL,
+       gpimage_check_image_types,
+       NULL,
+       NULL
+);
index 98717bdeddcf39fe9988e6f14ab6b35d8ed6f2b0..148e4662b7b366e2b2400639aa733b59e747865f 100644 (file)
@@ -8,57 +8,87 @@
 
 #include "imagetool.h"
 
-/*
- * Callback function to register a image type within a tool
- */
-static imagetool_register_t register_func;
+#include <image.h>
 
-/*
- * 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)
+struct image_type_params *imagetool_get_type(int type)
 {
-       /*
-        * Save the image tool callback function. It will be used to register
-        * image types within that tool
-        */
-       register_func = image_register;
+       struct image_type_params *curr;
+       struct image_type_params *start = ll_entry_start(
+                       struct image_type_params, image_type);
+       struct image_type_params *end = ll_entry_end(
+                       struct image_type_params, image_type);
 
-       /* Init ATMEL ROM Boot Image generation/list support */
-       init_atmel_image_type();
-       /* 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 Altera SOCFPGA support */
-       init_socfpga_image_type();
-       /* Init TI Keystone boot image generation/list support */
-       init_gpimage_type();
+       for (curr = start; curr != end; curr++) {
+               if (curr->check_image_type) {
+                       if (!curr->check_image_type(type))
+                               return curr;
+               }
+       }
+       return NULL;
 }
 
-/*
- * register_image_type -
- *
- * Register a image type within a tool
- */
-void register_image_type(struct image_type_params *tparams)
+int imagetool_verify_print_header(
+       void *ptr,
+       struct stat *sbuf,
+       struct image_type_params *tparams,
+       struct image_tool_params *params)
 {
-       register_func(tparams);
+       int retval = -1;
+       struct image_type_params *curr;
+
+       struct image_type_params *start = ll_entry_start(
+                       struct image_type_params, image_type);
+       struct image_type_params *end = ll_entry_end(
+                       struct image_type_params, image_type);
+
+       for (curr = start; curr != end; curr++) {
+               if (curr->verify_header) {
+                       retval = curr->verify_header((unsigned char *)ptr,
+                                                    sbuf->st_size, params);
+
+                       if (retval == 0) {
+                               /*
+                                * 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;
+}
+
+int imagetool_save_subimage(
+       const char *file_name,
+       ulong file_data,
+       ulong file_len)
+{
+       int dfd;
+
+       dfd = open(file_name, O_RDWR | O_CREAT | O_TRUNC | O_BINARY,
+                  S_IRUSR | S_IWUSR);
+       if (dfd < 0) {
+               fprintf(stderr, "Can't open \"%s\": %s\n",
+                       file_name, strerror(errno));
+               return -1;
+       }
+
+       if (write(dfd, (void *)file_data, file_len) != (ssize_t)file_len) {
+               fprintf(stderr, "Write error on \"%s\": %s\n",
+                       file_name, strerror(errno));
+               close(dfd);
+               return -1;
+       }
+
+       close(dfd);
+
+       return 0;
 }
index 8bce059482737bb5030ed36d68cafc28838a4084..f35dec71c7190a4b82e817315e998c561f5e064a 100644 (file)
 #include <time.h>
 #include <unistd.h>
 #include <u-boot/sha1.h>
+
+/* define __KERNEL__ in order to get the definitions
+ * required by the linker list. This is probably not
+ * the best way to do this */
+#ifndef __KERNEL__
+#define __KERNEL__
+#include <linker_lists.h>
+#undef __KERNEL__
+#endif /* __KERNEL__ */
+
 #include "fdt_host.h"
 
 #define ARRAY_SIZE(x)          (sizeof(x) / sizeof((x)[0]))
@@ -100,14 +110,15 @@ struct image_type_params {
        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>).
+        * This function is used by the command to retrieve a component
+        * (sub-image) from the image (i.e. dumpimage -i <image> -p <position>
+        * <sub-image-name>).
         * 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 *);
+       int (*extract_subimage)(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
@@ -127,50 +138,88 @@ struct image_type_params {
         */
        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.
+/**
+ * imagetool_get_type() - find the image type params for a given image type
+ *
+ * It scans all registers image type supports
+ * checks the input type for each supported image type
+ *
+ * if successful,
+ *     returns respective image_type_params pointer if success
+ * if input type_id is not supported by any of image_type_support
+ *     returns NULL
  */
-typedef void (*imagetool_register_t)(struct image_type_params *);
+struct image_type_params *imagetool_get_type(int type);
 
 /*
- * Initializes all image types with the given registration callback
- * function.
- * An image tool uses this function to initialize all image types.
+ * imagetool_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
  */
-void register_image_tool(imagetool_register_t image_register);
+int imagetool_verify_print_header(
+       void *ptr,
+       struct stat *sbuf,
+       struct image_type_params *tparams,
+       struct image_tool_params *params);
 
-/*
- * Register a image type within a tool.
- * An image type uses this function to register itself within
- * all tools.
+/**
+ * imagetool_save_subimage - store data into a file
+ * @file_name: name of the destination file
+ * @file_data: data to be written
+ * @file_len: the amount of data to store
+ *
+ * imagetool_save_subimage() store file_len bytes of data pointed by file_data
+ * into the file name by file_name.
+ *
+ * returns:
+ *     zero in case of success or a negative value if fail.
  */
-void register_image_type(struct image_type_params *tparams);
+int imagetool_save_subimage(
+       const char *file_name,
+       ulong file_data,
+       ulong file_len);
 
 /*
  * 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_atmel_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 init_socfpga_image_type(void);
-void init_gpimage_type(void);
+
 
 void pbl_load_uboot(int fd, struct image_tool_params *mparams);
 
+#define U_BOOT_IMAGE_TYPE( \
+               _id, \
+               _name, \
+               _header_size, \
+               _header, \
+               _check_params, \
+               _verify_header, \
+               _print_header, \
+               _set_header, \
+               _extract_subimage, \
+               _check_image_type, \
+               _fflag_handle, \
+               _vrec_header \
+       ) \
+       ll_entry_declare(struct image_type_params, _id, image_type) = { \
+               .name = _name, \
+               .header_size = _header_size, \
+               .hdr = _header, \
+               .check_params = _check_params, \
+               .verify_header = _verify_header, \
+               .print_header = _print_header, \
+               .set_header = _set_header, \
+               .extract_subimage = _extract_subimage, \
+               .check_image_type = _check_image_type, \
+               .fflag_handle = _fflag_handle, \
+               .vrec_header = _vrec_header \
+       }
+
 #endif /* _IMAGETOOL_H_ */
diff --git a/tools/imagetool.lds b/tools/imagetool.lds
new file mode 100644 (file)
index 0000000..7e92b4a
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2011-2012 The Chromium OS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+SECTIONS
+{
+
+       . = ALIGN(4);
+       .u_boot_list : {
+               KEEP(*(SORT(.u_boot_list*)));
+       }
+
+       __u_boot_sandbox_option_start = .;
+       _u_boot_sandbox_getopt : { *(.u_boot_sandbox_getopt) }
+       __u_boot_sandbox_option_end = .;
+
+       __bss_start = .;
+}
+
+INSERT BEFORE .data;
index 526b7d490d5c38cca59c6abfd12ac3f15f3931ab..3d3759188692b91323e88603d5a2503714f3b39b 100644 (file)
@@ -694,19 +694,17 @@ static int imximage_generate(struct image_tool_params *params,
 /*
  * imximage parameters
  */
-static struct image_type_params imximage_params = {
-       .name           = "Freescale i.MX Boot Image support",
-       .header_size    = 0,
-       .hdr            = NULL,
-       .check_image_type = imximage_check_image_types,
-       .verify_header  = imximage_verify_header,
-       .print_header   = imximage_print_header,
-       .set_header     = imximage_set_header,
-       .check_params   = imximage_check_params,
-       .vrec_header    = imximage_generate,
-};
-
-void init_imx_image_type(void)
-{
-       register_image_type(&imximage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       imximage,
+       "Freescale i.MX Boot Image support",
+       0,
+       NULL,
+       imximage_check_params,
+       imximage_verify_header,
+       imximage_print_header,
+       imximage_set_header,
+       NULL,
+       imximage_check_image_types,
+       NULL,
+       imximage_generate
+);
index 807d46668be78ee90b1103b2e5b56460dbc6afe0..66f459ad6b1c7f2b65eb612349e6a2e647c8238e 100644 (file)
@@ -905,19 +905,17 @@ static int kwbimage_check_params(struct image_tool_params *params)
 /*
  * kwbimage type parameters definition
  */
-static struct image_type_params kwbimage_params = {
-       .name           = "Marvell MVEBU Boot Image support",
-       .header_size    = 0,            /* no fixed header size */
-       .hdr            = NULL,
-       .vrec_header    = kwbimage_generate,
-       .check_image_type = kwbimage_check_image_types,
-       .verify_header  = kwbimage_verify_header,
-       .print_header   = kwbimage_print_header,
-       .set_header     = kwbimage_set_header,
-       .check_params   = kwbimage_check_params,
-};
-
-void init_kwb_image_type (void)
-{
-       register_image_type(&kwbimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       kwbimage,
+       "Marvell MVEBU Boot Image support",
+       0,
+       NULL,
+       kwbimage_check_params,
+       kwbimage_verify_header,
+       kwbimage_print_header,
+       kwbimage_set_header,
+       NULL,
+       kwbimage_check_image_types,
+       NULL,
+       kwbimage_generate
+);
index c70408c9ba02375ae959e20d438e4e65acfd75b0..5ccd951048cef587686d264575aae6ea7623e90f 100644 (file)
@@ -15,9 +15,6 @@
 static void copy_file(int, const char *, int);
 static void usage(void);
 
-/* image_type_params link list to maintain registered image type supports */
-struct image_type_params *mkimage_tparams = NULL;
-
 /* parameters initialized by core will be used by the image type code */
 struct image_tool_params params = {
        .os = IH_OS_LINUX,
@@ -29,106 +26,6 @@ struct image_tool_params params = {
        .imagename2 = "",
 };
 
-/*
- * mkimage_register -
- *
- * It is used to register respective image generation/list support to the
- * mkimage core
- *
- * the input struct image_type_params is checked and appended to the link
- * list, if the input structure is already registered, error
- */
-void mkimage_register (struct image_type_params *tparams)
-{
-       struct image_type_params **tp;
-
-       if (!tparams) {
-               fprintf (stderr, "%s: %s: Null input\n",
-                       params.cmdname, __FUNCTION__);
-               exit (EXIT_FAILURE);
-       }
-
-       /* scan the linked list, check for registry and point the last one */
-       for (tp = &mkimage_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);
-}
-
-/*
- * mkimage_get_type -
- *
- * It scans all registers image type supports
- * checks the input type_id for each supported image type
- *
- * if successful,
- *     returns respective image_type_params pointer if success
- * if input type_id is not supported by any of image_type_support
- *     returns NULL
- */
-struct image_type_params *mkimage_get_type(int type)
-{
-       struct image_type_params *curr;
-
-       for (curr = mkimage_tparams; curr != NULL; curr = curr->next) {
-               if (curr->check_image_type) {
-                       if (!curr->check_image_type (type))
-                               return curr;
-               }
-       }
-       return NULL;
-}
-
-/*
- * mkimage_verify_print_header -
- *
- * It scans mkimage_tparams link list,
- * verifies image_header for each supported image type
- * if verification is successful, prints respective header
- *
- * returns negative if input image format does not match with any of
- * supported image types
- */
-int mkimage_verify_print_header (void *ptr, struct stat *sbuf)
-{
-       int retval = -1;
-       struct image_type_params *curr;
-
-       for (curr = mkimage_tparams; curr != NULL; curr = curr->next ) {
-               if (curr->verify_header) {
-                       retval = curr->verify_header (
-                               (unsigned char *)ptr, sbuf->st_size,
-                               &params);
-
-                       if (retval == 0) {
-                               /*
-                                * 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;
-}
-
 int
 main (int argc, char **argv)
 {
@@ -139,9 +36,6 @@ main (int argc, char **argv)
        struct image_type_params *tparams = NULL;
        int pad_len = 0;
 
-       /* Init all image generation/list support */
-       register_image_tool(mkimage_register);
-
        params.cmdname = *argv;
        params.addr = params.ep = 0;
 
@@ -279,7 +173,7 @@ NXTARG:             ;
                usage ();
 
        /* set tparams as per input type_id */
-       tparams = mkimage_get_type(params.type);
+       tparams = imagetool_get_type(params.type);
        if (tparams == NULL) {
                fprintf (stderr, "%s: unsupported type %s\n",
                        params.cmdname, genimg_get_type_name(params.type));
@@ -363,7 +257,8 @@ NXTARG:             ;
                 * Print the image information for matched image type
                 * Returns the error code if not matched
                 */
-               retval = mkimage_verify_print_header (ptr, &sbuf);
+               retval = imagetool_verify_print_header(ptr, &sbuf,
+                               tparams, &params);
 
                (void) munmap((void *)ptr, sbuf.st_size);
                (void) close (ifd);
@@ -529,7 +424,7 @@ copy_file (int ifd, const char *datafile, int pad)
        uint8_t zeros[4096];
        int offset = 0;
        int size;
-       struct image_type_params *tparams = mkimage_get_type (params.type);
+       struct image_type_params *tparams = imagetool_get_type(params.type);
 
        if (pad >= sizeof(zeros)) {
                fprintf(stderr, "%s: Can't pad to %d\n",
index 04beefe05cbfd87575b9e23816a69034742b505c..98fc64491c7d9f56591858f075020eed7d911ca2 100644 (file)
@@ -2312,25 +2312,18 @@ fail:
 /*
  * mxsimage parameters
  */
-static struct image_type_params mxsimage_params = {
-       .name           = "Freescale MXS Boot Image support",
-       .header_size    = 0,
-       .hdr            = NULL,
-       .check_image_type = mxsimage_check_image_types,
-       .verify_header  = mxsimage_verify_header,
-       .print_header   = mxsimage_print_header,
-       .set_header     = mxsimage_set_header,
-       .check_params   = mxsimage_check_params,
-       .vrec_header    = mxsimage_generate,
-};
-
-void init_mxs_image_type(void)
-{
-       register_image_type(&mxsimage_params);
-}
-
-#else
-void init_mxs_image_type(void)
-{
-}
+U_BOOT_IMAGE_TYPE(
+       mxsimage,
+       "Freescale MXS Boot Image support",
+       0,
+       NULL,
+       mxsimage_check_params,
+       mxsimage_verify_header,
+       mxsimage_print_header,
+       mxsimage_set_header,
+       NULL,
+       mxsimage_check_image_types,
+       NULL,
+       mxsimage_generate
+);
 #endif
index 1e0c16479681aec2d8621eabd953ff9a8cdb203c..7198b3330d6d6a62a8d3064643bfe1fe191cec33 100644 (file)
@@ -162,18 +162,17 @@ static void omapimage_set_header(void *ptr, struct stat *sbuf, int ifd,
 /*
  * omapimage parameters
  */
-static struct image_type_params omapimage_params = {
-       .name           = "TI OMAP CH/GP Boot Image support",
-       .header_size    = OMAP_FILE_HDR_SIZE,
-       .hdr            = (void *)&omapimage_header,
-       .check_image_type = omapimage_check_image_types,
-       .verify_header  = omapimage_verify_header,
-       .print_header   = omapimage_print_header,
-       .set_header     = omapimage_set_header,
-       .check_params   = gpimage_check_params,
-};
-
-void init_omap_image_type(void)
-{
-       register_image_type(&omapimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       omapimage,
+       "TI OMAP CH/GP Boot Image support",
+       OMAP_FILE_HDR_SIZE,
+       (void *)&omapimage_header,
+       gpimage_check_params,
+       omapimage_verify_header,
+       omapimage_print_header,
+       omapimage_set_header,
+       NULL,
+       omapimage_check_image_types,
+       NULL,
+       NULL
+);
index e466886ed2428416824e40f8d0faa529248ff4e4..7d039e82bc2781bc6624bb423f5d8f4ef302232d 100644 (file)
@@ -52,12 +52,15 @@ will get a consistent result each time.
 How to configure it
 ===================
 
-For most cases of using patman for U-Boot development, patman will
-locate and use the file 'doc/git-mailrc' in your U-Boot directory.
-This contains most of the aliases you will need.
+For most cases of using patman for U-Boot development, patman can use the
+file 'doc/git-mailrc' in your U-Boot directory to supply the email aliases
+you need. To make this work, tell git where to find the file by typing
+this once:
 
-For Linux the 'scripts/get_maintainer.pl' handles figuring out where
-to send patches pretty well.
+    git config sendemail.aliasesfile doc/git-mailrc
+
+For both Linux and U-Boot the 'scripts/get_maintainer.pl' handles figuring
+out where to send patches pretty well.
 
 During the first run patman creates a config file for you by taking the default
 user name and email address from the global .gitconfig file.
index b68df5d72e7ffa525b84b622840eedce13358a4e..c593070d67ef24800462543c0a1774a33515c6bf 100644 (file)
@@ -61,6 +61,52 @@ def CountCommitsToBranch():
     patch_count = int(stdout)
     return patch_count
 
+def NameRevision(commit_hash):
+    """Gets the revision name for a commit
+
+    Args:
+        commit_hash: Commit hash to look up
+
+    Return:
+        Name of revision, if any, else None
+    """
+    pipe = ['git', 'name-rev', commit_hash]
+    stdout = command.RunPipe([pipe], capture=True, oneline=True).stdout
+
+    # We expect a commit, a space, then a revision name
+    name = stdout.split(' ')[1].strip()
+    return name
+
+def GuessUpstream(git_dir, branch):
+    """Tries to guess the upstream for a branch
+
+    This lists out top commits on a branch and tries to find a suitable
+    upstream. It does this by looking for the first commit where
+    'git name-rev' returns a plain branch name, with no ! or ^ modifiers.
+
+    Args:
+        git_dir: Git directory containing repo
+        branch: Name of branch
+
+    Returns:
+        Tuple:
+            Name of upstream branch (e.g. 'upstream/master') or None if none
+            Warning/error message, or None if none
+    """
+    pipe = [LogCmd(branch, git_dir=git_dir, oneline=True, count=100)]
+    result = command.RunPipe(pipe, capture=True, capture_stderr=True,
+                             raise_on_error=False)
+    if result.return_code:
+        return None, "Branch '%s' not found" % branch
+    for line in result.stdout.splitlines()[1:]:
+        commit_hash = line.split(' ')[0]
+        name = NameRevision(commit_hash)
+        if '~' not in name and '^' not in name:
+            if name.startswith('remotes/'):
+                name = name[8:]
+            return name, "Guessing upstream as '%s'" % name
+    return None, "Cannot find a suitable upstream for branch '%s'" % branch
+
 def GetUpstream(git_dir, branch):
     """Returns the name of the upstream for a branch
 
@@ -69,7 +115,9 @@ def GetUpstream(git_dir, branch):
         branch: Name of branch
 
     Returns:
-        Name of upstream branch (e.g. 'upstream/master') or None if none
+        Tuple:
+            Name of upstream branch (e.g. 'upstream/master') or None if none
+            Warning/error message, or None if none
     """
     try:
         remote = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
@@ -77,13 +125,14 @@ def GetUpstream(git_dir, branch):
         merge = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
                                       'branch.%s.merge' % branch)
     except:
-        return None
+        upstream, msg = GuessUpstream(git_dir, branch)
+        return upstream, msg
 
     if remote == '.':
         return merge
     elif remote and merge:
         leaf = merge.split('/')[-1]
-        return '%s/%s' % (remote, leaf)
+        return '%s/%s' % (remote, leaf), None
     else:
         raise ValueError, ("Cannot determine upstream branch for branch "
                 "'%s' remote='%s', merge='%s'" % (branch, remote, merge))
@@ -99,10 +148,29 @@ def GetRangeInBranch(git_dir, branch, include_upstream=False):
         Expression in the form 'upstream..branch' which can be used to
         access the commits. If the branch does not exist, returns None.
     """
-    upstream = GetUpstream(git_dir, branch)
+    upstream, msg = GetUpstream(git_dir, branch)
     if not upstream:
-        return None
-    return '%s%s..%s' % (upstream, '~' if include_upstream else '', branch)
+        return None, msg
+    rstr = '%s%s..%s' % (upstream, '~' if include_upstream else '', branch)
+    return rstr, msg
+
+def CountCommitsInRange(git_dir, range_expr):
+    """Returns the number of commits in the given range.
+
+    Args:
+        git_dir: Directory containing git repo
+        range_expr: Range to check
+    Return:
+        Number of patches that exist in the supplied rangem or None if none
+        were found
+    """
+    pipe = [LogCmd(range_expr, git_dir=git_dir, oneline=True)]
+    result = command.RunPipe(pipe, capture=True, capture_stderr=True,
+                             raise_on_error=False)
+    if result.return_code:
+        return None, "Range '%s' not found or is invalid" % range_expr
+    patch_count = len(result.stdout.splitlines())
+    return patch_count, None
 
 def CountCommitsInBranch(git_dir, branch, include_upstream=False):
     """Returns the number of commits in the given branch.
@@ -114,14 +182,10 @@ def CountCommitsInBranch(git_dir, branch, include_upstream=False):
         Number of patches that exist on top of the branch, or None if the
         branch does not exist.
     """
-    range_expr = GetRangeInBranch(git_dir, branch, include_upstream)
+    range_expr, msg = GetRangeInBranch(git_dir, branch, include_upstream)
     if not range_expr:
-        return None
-    pipe = [LogCmd(range_expr, git_dir=git_dir, oneline=True),
-            ['wc', '-l']]
-    result = command.RunPipe(pipe, capture=True, oneline=True)
-    patch_count = int(result.stdout)
-    return patch_count
+        return None, msg
+    return CountCommitsInRange(git_dir, range_expr)
 
 def CountCommits(commit_range):
     """Returns the number of commits in the given range.
@@ -328,7 +392,8 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
                    "Or do something like this\n"
                    "git config sendemail.to u-boot@lists.denx.de")
             return
-    cc = BuildEmailList(series.get('cc'), '--cc', alias, raise_on_error)
+    cc = BuildEmailList(list(set(series.get('cc')) - set(series.get('to'))),
+                        '--cc', alias, raise_on_error)
     if self_only:
         to = BuildEmailList([os.getenv('USER')], '--to', alias, raise_on_error)
         cc = []
index da0488337b29a5fd4db542b58892a14c4e637ee9..8c3a0ec9eee5e7af6bc0ef0820a069e0f74c78aa 100644 (file)
@@ -139,6 +139,9 @@ class PatchStream:
         # Initially we have no output. Prepare the input line string
         out = []
         line = line.rstrip('\n')
+
+        commit_match = re_commit.match(line) if self.is_log else None
+
         if self.is_log:
             if line[:4] == '    ':
                 line = line[4:]
@@ -146,7 +149,6 @@ class PatchStream:
         # Handle state transition and skipping blank lines
         series_tag_match = re_series_tag.match(line)
         commit_tag_match = re_commit_tag.match(line)
-        commit_match = re_commit.match(line) if self.is_log else None
         cover_cc_match = re_cover_cc.match(line)
         signoff_match = re_signoff.match(line)
         tag_match = None
index b67f870b7e21518fa51e97040470658979094b5b..60ebc766f7e956f959e6577c833ec9c68dc5d848 100644 (file)
@@ -94,6 +94,9 @@ class Series(dict):
             cmd: The git command we would have run
             process_tags: Process tags as if they were aliases
         """
+        to_set = set(gitutil.BuildEmailList(self.to));
+        cc_set = set(gitutil.BuildEmailList(self.cc));
+
         col = terminal.Color()
         print 'Dry run, so not doing much. But I would do this:'
         print
@@ -106,24 +109,16 @@ class Series(dict):
             commit = self.commits[upto]
             print col.Color(col.GREEN, '   %s' % args[upto])
             cc_list = list(self._generated_cc[commit.patch])
-
-            # Skip items in To list
-            if 'to' in self:
-                try:
-                    map(cc_list.remove, gitutil.BuildEmailList(self.to))
-                except ValueError:
-                    pass
-
-            for email in cc_list:
+            for email in set(cc_list) - to_set - cc_set:
                 if email == None:
                     email = col.Color(col.YELLOW, "<alias '%s' not found>"
                             % tag)
                 if email:
                     print '      Cc: ',email
         print
-        for item in gitutil.BuildEmailList(self.get('to', '<none>')):
+        for item in to_set:
             print 'To:\t ', item
-        for item in gitutil.BuildEmailList(self.cc):
+        for item in cc_set - to_set:
             print 'Cc:\t ', item
         print 'Version: ', self.get('version')
         print 'Prefix:\t ', self.get('prefix')
@@ -131,7 +126,7 @@ class Series(dict):
             print 'Cover: %d lines' % len(self.cover)
             cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
             all_ccs = itertools.chain(cover_cc, *self._generated_cc.values())
-            for email in set(all_ccs):
+            for email in set(all_ccs) - to_set - cc_set:
                     print '      Cc: ',email
         if cmd:
             print 'Git command: %s' % cmd
@@ -230,7 +225,7 @@ class Series(dict):
            if add_maintainers:
                 list += get_maintainer.GetMaintainer(commit.patch)
             all_ccs += list
-            print >>fd, commit.patch, ', '.join(list)
+            print >>fd, commit.patch, ', '.join(set(list))
             self._generated_cc[commit.patch] = list
 
         if cover_fname:
index 2a799ab4b64eb9214c1a38b317d782cd5fe1e0ea..d74fde9a4415df6e12548a72f1b4b7a9e2ea1d6a 100644 (file)
@@ -308,19 +308,17 @@ int pblimage_check_params(struct image_tool_params *params)
 };
 
 /* pblimage parameters */
-static struct image_type_params pblimage_params = {
-       .name           = "Freescale PBL Boot Image support",
-       .header_size    = sizeof(struct pbl_header),
-       .hdr            = (void *)&pblimage_header,
-       .check_image_type = pblimage_check_image_types,
-       .check_params   = pblimage_check_params,
-       .verify_header  = pblimage_verify_header,
-       .print_header   = pblimage_print_header,
-       .set_header     = pblimage_set_header,
-};
-
-void init_pbl_image_type(void)
-{
-       pbl_size = 0;
-       register_image_type(&pblimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       pblimage,
+       "Freescale PBL Boot Image support",
+       sizeof(struct pbl_header),
+       (void *)&pblimage_header,
+       pblimage_check_params,
+       pblimage_verify_header,
+       pblimage_print_header,
+       pblimage_set_header,
+       NULL,
+       pblimage_check_image_types,
+       NULL,
+       NULL
+);
index 917873e7b3ce83487cb16a9a9d577f495192f5f6..8fe91fe80ee9ac9ab5c2c0f7af25705f212bd486 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "pbl_crc32.h"
 #include "imagetool.h"
+#include "mkimage.h"
+
 #include <image.h>
 
 #define HEADER_OFFSET  0x40
@@ -133,12 +135,12 @@ static int verify_buffer(const uint8_t *buf)
 
        len = verify_header(buf + HEADER_OFFSET);
        if (len < 0) {
-               fprintf(stderr, "Invalid header\n");
+               debug("Invalid header\n");
                return -1;
        }
 
        if (len < HEADER_OFFSET || len > PADDED_SIZE) {
-               fprintf(stderr, "Invalid header length (%i)\n", len);
+               debug("Invalid header length (%i)\n", len);
                return -1;
        }
 
@@ -241,19 +243,17 @@ static void socfpgaimage_set_header(void *ptr, struct stat *sbuf, int ifd,
        sign_buffer(buf, 0, 0, data_size, 0);
 }
 
-static struct image_type_params socfpgaimage_params = {
-       .name           = "Altera SOCFPGA preloader support",
-       .vrec_header    = socfpgaimage_vrec_header,
-       .header_size    = 0, /* This will be modified by vrec_header() */
-       .hdr            = (void *)buffer,
-       .check_image_type = socfpgaimage_check_image_types,
-       .verify_header  = socfpgaimage_verify_header,
-       .print_header   = socfpgaimage_print_header,
-       .set_header     = socfpgaimage_set_header,
-       .check_params   = socfpgaimage_check_params,
-};
-
-void init_socfpga_image_type(void)
-{
-       register_image_type(&socfpgaimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       socfpgaimage,
+       "Altera SOCFPGA preloader support",
+       0, /* This will be modified by vrec_header() */
+       (void *)buffer,
+       socfpgaimage_check_params,
+       socfpgaimage_verify_header,
+       socfpgaimage_print_header,
+       socfpgaimage_set_header,
+       NULL,
+       socfpgaimage_check_image_types,
+       NULL,
+       socfpgaimage_vrec_header
+);
index cbbbe205dadf4d168ca5c71b2d6b2aedcf3ffb75..6ed1eef29c95e38bf78658131a9548217059f197 100644 (file)
@@ -244,18 +244,17 @@ int ublimage_check_params(struct image_tool_params *params)
 /*
  * ublimage parameters
  */
-static struct image_type_params ublimage_params = {
-       .name           = "Davinci UBL boot support",
-       .header_size    = sizeof(struct ubl_header),
-       .hdr            = (void *)&ublimage_header,
-       .check_image_type = ublimage_check_image_types,
-       .verify_header  = ublimage_verify_header,
-       .print_header   = ublimage_print_header,
-       .set_header     = ublimage_set_header,
-       .check_params   = ublimage_check_params,
-};
-
-void init_ubl_image_type(void)
-{
-       register_image_type(&ublimage_params);
-}
+U_BOOT_IMAGE_TYPE(
+       ublimage,
+       "Davinci UBL boot support",
+       sizeof(struct ubl_header),
+       (void *)&ublimage_header,
+       ublimage_check_params,
+       ublimage_verify_header,
+       ublimage_print_header,
+       ublimage_set_header,
+       NULL,
+       ublimage_check_image_types,
+       NULL,
+       NULL
+);