]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
Merge git://git.denx.de/u-boot-x86
authorTom Rini <trini@ti.com>
Mon, 1 Dec 2014 20:24:07 +0000 (15:24 -0500)
committerTom Rini <trini@ti.com>
Mon, 1 Dec 2014 20:24:07 +0000 (15:24 -0500)
244 files changed:
README
arch/arm/Kconfig
arch/arm/cpu/armv7/exynos/Kconfig
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
arch/arm/cpu/armv7/exynos/dmc_init_ddr3.c
arch/arm/cpu/armv7/exynos/pinmux.c
arch/arm/cpu/armv7/exynos/power.c
arch/arm/cpu/armv7/exynos/spl_boot.c
arch/arm/cpu/armv7/sunxi/clock_sun4i.c
arch/arm/cpu/armv7/sunxi/clock_sun6i.c
arch/arm/cpu/armv7/sunxi/dram_sun4i.c
arch/arm/cpu/armv7/sunxi/dram_sun6i.c
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c
arch/arm/dts/Makefile
arch/arm/dts/exynos4412-odroid.dts
arch/arm/dts/exynos5250-snow.dts
arch/arm/dts/exynos5800-peach-pi.dts [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-ld4-ref.dts [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-ld4.dtsi [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-pro4-ref.dts [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-pro4.dtsi [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-sld8-ref.dts [new file with mode: 0644]
arch/arm/dts/uniphier-ph1-sld8.dtsi [new file with mode: 0644]
arch/arm/include/asm/arch-exynos/cpu.h
arch/arm/include/asm/arch-exynos/dmc.h
arch/arm/include/asm/arch-exynos/ehci.h
arch/arm/include/asm/arch-exynos/gpio.h
arch/arm/include/asm/arch-exynos/power.h
arch/arm/include/asm/arch-ls102xa/config.h
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
arch/arm/include/asm/arch-s3c24x0/s3c2410.h
arch/arm/include/asm/arch-s3c24x0/s3c2440.h
arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
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/cpu.h
arch/arm/include/asm/arch-sunxi/display.h [new file with mode: 0644]
arch/arm/include/asm/arch-sunxi/gpio.h
arch/arm/include/asm/arch-uniphier/gpio.h [new file with mode: 0644]
arch/arm/include/asm/global_data.h
arch/mips/cpu/mips32/start.S
arch/mips/cpu/mips64/start.S
arch/mips/lib/Makefile
arch/mips/lib/board.c [deleted file]
arch/mips/lib/bootm.c
arch/nios2/cpu/fdt.c
arch/powerpc/cpu/mpc85xx/cmd_errata.c
arch/powerpc/cpu/ppc4xx/fdt.c
arch/powerpc/include/asm/config_mpc85xx.h
arch/powerpc/include/asm/fsl_errata.h
arch/powerpc/include/asm/fsl_serdes.h
board/a3m071/a3m071.c
board/a4m072/a4m072.c
board/amcc/canyonlands/canyonlands.c
board/amcc/sequoia/sequoia.c
board/cm5200/cm5200.c
board/compulab/cm_fx6/cm_fx6.c
board/compulab/cm_t54/cm_t54.c
board/davedenx/aria/aria.c
board/esd/cpci405/cpci405.c
board/esd/mecp5123/mecp5123.c
board/esd/pmc405de/pmc405de.c
board/esd/pmc440/pmc440.c
board/esd/vme8349/vme8349.c
board/freescale/b4860qds/b4860qds.c
board/freescale/bsc9131rdb/bsc9131rdb.c
board/freescale/bsc9132qds/bsc9132qds.c
board/freescale/c29xpcie/c29xpcie.c
board/freescale/common/cds_pci_ft.c
board/freescale/common/sys_eeprom.c
board/freescale/corenet_ds/corenet_ds.c
board/freescale/ls1021aqds/ls1021aqds.c
board/freescale/ls1021atwr/ls1021atwr.c
board/freescale/ls2085a/ls2085a.c
board/freescale/mpc5121ads/mpc5121ads.c
board/freescale/mpc7448hpc2/mpc7448hpc2.c
board/freescale/mpc8308rdb/mpc8308rdb.c
board/freescale/mpc8313erdb/mpc8313erdb.c
board/freescale/mpc8315erdb/mpc8315erdb.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/freescale/mpc832xemds/mpc832xemds.c
board/freescale/mpc8349emds/mpc8349emds.c
board/freescale/mpc8349itx/mpc8349itx.c
board/freescale/mpc8360emds/mpc8360emds.c
board/freescale/mpc8360erdk/mpc8360erdk.c
board/freescale/mpc837xemds/mpc837xemds.c
board/freescale/mpc837xerdb/mpc837xerdb.c
board/freescale/mpc8536ds/mpc8536ds.c
board/freescale/mpc8540ads/mpc8540ads.c
board/freescale/mpc8544ds/mpc8544ds.c
board/freescale/mpc8560ads/mpc8560ads.c
board/freescale/mpc8568mds/mpc8568mds.c
board/freescale/mpc8569mds/mpc8569mds.c
board/freescale/mpc8572ds/mpc8572ds.c
board/freescale/mpc8610hpcd/mpc8610hpcd.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
board/freescale/p1010rdb/p1010rdb.c
board/freescale/p1022ds/p1022ds.c
board/freescale/p1023rdb/p1023rdb.c
board/freescale/p1_p2_rdb/p1_p2_rdb.c
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/freescale/p1_twr/p1_twr.c
board/freescale/p2020come/p2020come.c
board/freescale/p2020ds/p2020ds.c
board/freescale/p2041rdb/p2041rdb.c
board/freescale/qemu-ppce500/qemu-ppce500.c
board/freescale/t1040qds/t1040qds.c
board/freescale/t104xrdb/t104xrdb.c
board/freescale/t208xqds/README [new file with mode: 0755]
board/freescale/t208xqds/eth_t208xqds.c
board/freescale/t208xqds/t208xqds.c
board/freescale/t208xrdb/t208xrdb.c
board/freescale/t4qds/t4240emu.c
board/freescale/t4qds/t4240qds.c
board/freescale/t4rdb/t4240rdb.c
board/galaxy5200/galaxy5200.c
board/gateworks/gw_ventana/gw_ventana.c
board/gdsys/intip/intip.c
board/gdsys/mpc8308/hrcon.c
board/gdsys/p1022/controlcenterd.c
board/highbank/highbank.c
board/icecube/icecube.c
board/ids/ids8313/ids8313.c
board/ifm/ac14xx/ac14xx.c
board/ifm/o2dnt2/o2dnt2.c
board/intercontrol/digsy_mtc/digsy_mtc.c
board/ipek01/ipek01.c
board/jupiter/jupiter.c
board/keymile/km82xx/km82xx.c
board/keymile/km83xx/km83xx.c
board/keymile/kmp204x/kmp204x.c
board/korat/korat.c
board/kup/kup4k/kup4k.c
board/manroland/mucmc52/mucmc52.c
board/manroland/uc101/uc101.c
board/motionpro/motionpro.c
board/mpc8308_p1m/mpc8308_p1m.c
board/muas3001/muas3001.c
board/munices/munices.c
board/pdm360ng/pdm360ng.c
board/phytec/pcm030/pcm030.c
board/raspberrypi/rpi_b/rpi_b.c
board/samsung/odroid/odroid.c
board/samsung/smdk5420/Kconfig
board/samsung/smdk5420/MAINTAINERS
board/sbc8349/sbc8349.c
board/sbc8548/sbc8548.c
board/sbc8641d/sbc8641d.c
board/socrates/socrates.c
board/stx/stxssa/stxssa.c
board/sunxi/Kconfig
board/sunxi/ahci.c
board/sunxi/board.c
board/sunxi/gmac.c
board/ti/ks2_evm/board.c
board/tqc/tqm5200/tqm5200.c
board/tqc/tqm834x/tqm834x.c
board/tqc/tqm8xx/tqm8xx.c
board/tqc/tqma6/tqma6.c
board/ve8313/ve8313.c
board/xes/xpedite517x/xpedite517x.c
board/xes/xpedite520x/xpedite520x.c
board/xes/xpedite537x/xpedite537x.c
board/xes/xpedite550x/xpedite550x.c
common/board_f.c
common/cmd_fdt.c
common/fdt_support.c
common/image-fdt.c
common/lcd.c
common/spl/spl_ext.c
configs/A13-OLinuXinoM_defconfig
configs/A13-OLinuXino_defconfig
configs/Colombus_defconfig
configs/Ippo_q8h_v5_defconfig
configs/Mele_M9_defconfig
configs/peach-pi_defconfig [new file with mode: 0644]
configs/ph1_ld4_defconfig
configs/ph1_pro4_defconfig
configs/ph1_sld8_defconfig
doc/README.odroid
drivers/Makefile
drivers/mmc/fsl_esdhc.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/denali.c
drivers/mtd/nand/denali.h
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/s3c2410_nand.c
drivers/mtd/nand/vf610_nfc.c
drivers/net/fm/eth.c
drivers/power/pmic/pmic_max77686.c
drivers/qe/Makefile
drivers/qe/fdt.c
drivers/qe/qe.c
drivers/qe/qe.h
drivers/serial/serial_uniphier.c
drivers/usb/host/ehci-exynos.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-uniphier.c
drivers/video/Makefile
drivers/video/sunxi_display.c [new file with mode: 0644]
fs/ext4/ext4fs.c
fs/fat/fat_write.c
fs/fs.c
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/P1023RDB.h
include/configs/T4240RDB.h
include/configs/arndale.h
include/configs/dbau1x00.h
include/configs/exynos-common.h
include/configs/exynos5-common.h
include/configs/exynos5-dt-common.h
include/configs/exynos5250-common.h
include/configs/exynos5420-common.h
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h
include/configs/odroid.h
include/configs/origen.h
include/configs/pb1x00.h
include/configs/peach-pi.h [new file with mode: 0644]
include/configs/peach-pit.h
include/configs/qemu-mips.h
include/configs/qemu-mips64.h
include/configs/smdk2410.h
include/configs/smdk5420.h
include/configs/sun7i.h
include/configs/sunxi-common.h
include/configs/uniphier-common.h
include/configs/vct.h
include/fdt_support.h
include/fdtdec.h
include/fsl_usb.h
include/image.h
include/phy.h
include/power/max77686_pmic.h
include/usb/ehci-fsl.h
lib/fdtdec.c

diff --git a/README b/README
index e7cd1bcb436dff45feb2be387eaee30323cc15ae..66770b648539701fe0fdd8b36b1076359557ddd3 100644 (file)
--- a/README
+++ b/README
@@ -783,6 +783,13 @@ The following options need to be configured:
                Board code has addition modification that it wants to make
                to the flat device tree before handing it off to the kernel
 
+               CONFIG_OF_SYSTEM_SETUP
+
+               Other code has addition modification that it wants to make
+               to the flat device tree before handing it off to the kernel.
+               This causes ft_system_setup() to be called before booting
+               the kernel.
+
                CONFIG_OF_BOOT_CPU
 
                This define fills in the correct boot CPU in the boot
@@ -3510,7 +3517,7 @@ FIT uImage format:
                to 128 or 256, although it does not have to be power of 2).
 
                default: 4096
-               
+
                CONFIG_MTD_UBI_BEB_LIMIT
                This option specifies the maximum bad physical eraseblocks UBI
                expects on the MTD device (per 1024 eraseblocks). If the
index b9ac59e1a4a9a9925804f5bf654cb4a977e8523d..0982117fadac7ad8e57d32df37beb6f0ca352587 100644 (file)
@@ -793,6 +793,7 @@ config ARCH_UNIPHIER
        bool "Panasonic UniPhier platform"
        select CPU_V7
        select SUPPORT_SPL
+       select OF_CONTROL if !SPL_BUILD
 
 endchoice
 
index e9a102ce3c05681394c2043f0235f6e97baee653..f3eadb4db30b762670521ac8a8ad2e733a80346a 100644 (file)
@@ -46,11 +46,16 @@ config TARGET_SMDK5420
        select SUPPORT_SPL
        select OF_CONTROL if !SPL_BUILD
 
-config TARGET_PEACH_PIT
+config TARGET_PEACH_PI
        bool "Peach Pi board"
        select SUPPORT_SPL
        select OF_CONTROL if !SPL_BUILD
 
+config TARGET_PEACH_PIT
+       bool "Peach Pit board"
+       select SUPPORT_SPL
+       select OF_CONTROL if !SPL_BUILD
+
 endchoice
 
 config SYS_SOC
index c0c95fbc83dc805953717b48d8701b15c52f7211..8fab135bebf4ef6900677847b60a8e1a1520254c 100644 (file)
@@ -118,7 +118,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
                        div = PLL_DIV_1024;
                else if (proid_is_exynos4412())
                        div = PLL_DIV_65535;
-               else if (proid_is_exynos5250() || proid_is_exynos5420())
+               else if (proid_is_exynos5250() || proid_is_exynos5420()
+                        || proid_is_exynos5800())
                        div = PLL_DIV_65536;
                else
                        return 0;
@@ -1581,7 +1582,7 @@ static unsigned long exynos4_get_i2c_clk(void)
 unsigned long get_pll_clk(int pllreg)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_get_pll_clk(pllreg);
                return exynos5_get_pll_clk(pllreg);
        } else {
@@ -1617,7 +1618,7 @@ unsigned long get_i2c_clk(void)
 unsigned long get_pwm_clk(void)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_get_pwm_clk();
                return clock_get_periph_rate(PERIPH_ID_PWM0);
        } else {
@@ -1630,7 +1631,7 @@ unsigned long get_pwm_clk(void)
 unsigned long get_uart_clk(int dev_index)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_get_uart_clk(dev_index);
                return exynos5_get_uart_clk(dev_index);
        } else {
@@ -1643,7 +1644,7 @@ unsigned long get_uart_clk(int dev_index)
 unsigned long get_mmc_clk(int dev_index)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_get_mmc_clk(dev_index);
                return exynos5_get_mmc_clk(dev_index);
        } else {
@@ -1654,7 +1655,7 @@ unsigned long get_mmc_clk(int dev_index)
 void set_mmc_clk(int dev_index, unsigned int div)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        exynos5420_set_mmc_clk(dev_index, div);
                else
                        exynos5_set_mmc_clk(dev_index, div);
@@ -1668,7 +1669,7 @@ unsigned long get_lcd_clk(void)
        if (cpu_is_exynos4())
                return exynos4_get_lcd_clk();
        else {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
@@ -1682,7 +1683,7 @@ void set_lcd_clk(void)
        else {
                if (proid_is_exynos5250())
                        exynos5_set_lcd_clk();
-               else if (proid_is_exynos5420())
+               else if (proid_is_exynos5420() || proid_is_exynos5800())
                        exynos5420_set_lcd_clk();
        }
 }
@@ -1696,7 +1697,7 @@ void set_mipi_clk(void)
 int set_spi_clk(int periph_id, unsigned int rate)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_set_spi_clk(periph_id, rate);
                return exynos5_set_spi_clk(periph_id, rate);
        } else {
index b6a9bc1831e0d5b5fa862dee66d79030a14763b8..0aff3d0d0cf454c25f8e90d8d6f1080dbf3da4c7 100644 (file)
@@ -971,7 +971,7 @@ static void exynos5420_system_clock_init(void)
 
 void system_clock_init(void)
 {
-       if (proid_is_exynos5420())
+       if (proid_is_exynos5420() || proid_is_exynos5800())
                exynos5420_system_clock_init();
        else
                exynos5250_system_clock_init();
index b86dd2d6503b71687cc671caa1018a3c0986ead3..7c0b12ae51addbffee5af54128ddd2f57a539adf 100644 (file)
@@ -464,6 +464,16 @@ int ddr3_mem_ctrl_init(struct mem_timings *mem, int reset)
                                                        + DMC_OFFSET);
        pmu = (struct exynos5_power *)EXYNOS5420_POWER_BASE;
 
+       if (CONFIG_NR_DRAM_BANKS > 4) {
+               /* Need both controllers. */
+               mem->memcontrol |= DMC_MEMCONTROL_NUM_CHIP_2;
+               mem->chips_per_channel = 2;
+               mem->chips_to_configure = 2;
+       } else {
+               /* 2GB requires a single controller */
+               mem->memcontrol |= DMC_MEMCONTROL_NUM_CHIP_1;
+       }
+
        /* Enable PAUSE for DREX */
        setbits_le32(&clk->pause, ENABLE_BIT);
 
@@ -832,6 +842,25 @@ int ddr3_mem_ctrl_init(struct mem_timings *mem, int reset)
        setbits_le32(&drex0->cgcontrol, DMC_INTERNAL_CG);
        setbits_le32(&drex1->cgcontrol, DMC_INTERNAL_CG);
 
+       /*
+        * As per Exynos5800 UM ver 0.00 section 17.13.2.1
+        * CONCONTROL register bit 3 [update_mode], Exynos5800 does not
+        * support the PHY initiated update. And it is recommended to set
+        * this field to 1'b1 during initialization
+        *
+        * When we apply PHY-initiated mode, DLL lock value is determined
+        * once at DMC init time and not updated later when we change the MIF
+        * voltage based on ASV group in kernel. Applying MC-initiated mode
+        * makes sure that DLL tracing is ON so that silicon is able to
+        * compensate the voltage variation.
+        */
+       val = readl(&drex0->concontrol);
+       val |= CONCONTROL_UPDATE_MODE;
+       writel(val , &drex0->concontrol);
+       val = readl(&drex1->concontrol);
+       val |= CONCONTROL_UPDATE_MODE;
+       writel(val , &drex1->concontrol);
+
        return 0;
 }
 #endif
index 3d95dc3339e6ee87859748d529510a7036b6cece..94d02970516e9efce5065852bf73182647dfd9de 100644 (file)
@@ -837,7 +837,7 @@ static int exynos4x12_pinmux_config(int peripheral, int flags)
 int exynos_pinmux_config(int peripheral, int flags)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_pinmux_config(peripheral, flags);
                else if (proid_is_exynos5250())
                        return exynos5_pinmux_config(peripheral, flags);
index e1ab3d6997c813461f8932e4370481f3512213ee..1520d642c5d0d944fac86dbfdf531d97081ce095 100644 (file)
@@ -53,10 +53,37 @@ void exynos5_set_usbhost_phy_ctrl(unsigned int enable)
        }
 }
 
+void exynos4412_set_usbhost_phy_ctrl(unsigned int enable)
+{
+       struct exynos4412_power *power =
+               (struct exynos4412_power *)samsung_get_base_power();
+
+       if (enable) {
+               /* Enabling USBHOST_PHY */
+               setbits_le32(&power->usbhost_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+               setbits_le32(&power->hsic1_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+               setbits_le32(&power->hsic2_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+       } else {
+               /* Disabling USBHOST_PHY */
+               clrbits_le32(&power->usbhost_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+               clrbits_le32(&power->hsic1_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+               clrbits_le32(&power->hsic2_phy_control,
+                            POWER_USB_HOST_PHY_CTRL_EN);
+       }
+}
+
 void set_usbhost_phy_ctrl(unsigned int enable)
 {
        if (cpu_is_exynos5())
                exynos5_set_usbhost_phy_ctrl(enable);
+       else if (cpu_is_exynos4())
+               if (proid_is_exynos4412())
+                       exynos4412_set_usbhost_phy_ctrl(enable);
 }
 
 static void exynos5_set_usbdrd_phy_ctrl(unsigned int enable)
index ae3ad0167d19d5197e95c477ace390e58ead0147..bc237c969fc9eba89e50fe36eb4164bf283c9a07 100644 (file)
@@ -195,10 +195,16 @@ void copy_uboot_to_ram(void)
        void (*end_bootop_from_emmc)(void);
 #endif
 #ifdef CONFIG_USB_BOOTING
-       u32 (*usb_copy)(void);
        int is_cr_z_set;
        unsigned int sec_boot_check;
 
+       /*
+        * Note that older hardware (before Exynos5800) does not expect any
+        * arguments, but it does not hurt to pass them, so a common function
+        * prototype is used.
+        */
+       u32 (*usb_copy)(u32 num_of_block, u32 *dst);
+
        /* Read iRAM location to check for secondary USB boot mode */
        sec_boot_check = readl(EXYNOS_IRAM_SECONDARY_BASE);
        if (sec_boot_check == EXYNOS_USB_SECONDARY_BOOT)
@@ -240,7 +246,7 @@ void copy_uboot_to_ram(void)
                 */
                is_cr_z_set = config_branch_prediction(0);
                usb_copy = get_irom_func(USB_INDEX);
-               usb_copy();
+               usb_copy(0, (u32 *)CONFIG_SYS_TEXT_BASE);
                config_branch_prediction(is_cr_z_set);
                break;
 #endif
index a0e49d179feff469f212f479925bc6ab881b3585..49f4032e9cfda56acab108adf57278c63e5e63a0 100644 (file)
@@ -180,6 +180,21 @@ void clock_set_pll1(unsigned int hz)
 }
 #endif
 
+void clock_set_pll3(unsigned int clk)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+       if (clk == 0) {
+               clrbits_le32(&ccm->pll3_cfg, CCM_PLL3_CTRL_EN);
+               return;
+       }
+
+       /* PLL3 rate = 3000000 * m */
+       writel(CCM_PLL3_CTRL_EN | CCM_PLL3_CTRL_INTEGER_MODE |
+              CCM_PLL3_CTRL_M(clk / 3000000), &ccm->pll3_cfg);
+}
+
 unsigned int clock_get_pll5p(void)
 {
        struct sunxi_ccm_reg *const ccm =
@@ -200,3 +215,15 @@ unsigned int clock_get_pll6(void)
        int k = ((rval & CCM_PLL6_CTRL_K_MASK) >> CCM_PLL6_CTRL_K_SHIFT) + 1;
        return 24000000 * n * k / 2;
 }
+
+void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz)
+{
+       int pll = clock_get_pll5p();
+       int div = 1;
+
+       while ((pll / div) > hz)
+               div++;
+
+       writel(CCM_DE_CTRL_GATE | CCM_DE_CTRL_RST | CCM_DE_CTRL_PLL5P |
+              CCM_DE_CTRL_M(div), clk_cfg);
+}
index 16ab6f372976923f8903266a566bde7c907e2a1c..8e949c6901d2e1e6299825b1c6b4f9c17e2fc01e 100644 (file)
@@ -127,6 +127,23 @@ void clock_set_pll1(unsigned int clk)
 }
 #endif
 
+void clock_set_pll3(unsigned int clk)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       const int m = 8; /* 3 MHz steps just like sun4i, sun5i and sun7i */
+
+       if (clk == 0) {
+               clrbits_le32(&ccm->pll3_cfg, CCM_PLL3_CTRL_EN);
+               return;
+       }
+
+       /* PLL3 rate = 24000000 * n / m */
+       writel(CCM_PLL3_CTRL_EN | CCM_PLL3_CTRL_INTEGER_MODE |
+              CCM_PLL3_CTRL_N(clk / (24000000 / m)) | CCM_PLL3_CTRL_M(m),
+              &ccm->pll3_cfg);
+}
+
 void clock_set_pll5(unsigned int clk)
 {
        struct sunxi_ccm_reg * const ccm =
@@ -151,3 +168,15 @@ unsigned int clock_get_pll6(void)
        int k = ((rval & CCM_PLL6_CTRL_K_MASK) >> CCM_PLL6_CTRL_K_SHIFT) + 1;
        return 24000000 * n * k / 2;
 }
+
+void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz)
+{
+       int pll = clock_get_pll6() * 2;
+       int div = 1;
+
+       while ((pll / div) > hz)
+               div++;
+
+       writel(CCM_DE_CTRL_GATE | CCM_DE_CTRL_PLL6_2X | CCM_DE_CTRL_M(div),
+              clk_cfg);
+}
index dc9fdb930b6e5c51c2d7252f7b4511439c3f33a2..ec8aaa7d48e6a92ca3c94825b034d495dd00a87c 100644 (file)
@@ -428,9 +428,9 @@ static void dramc_clock_output_en(u32 on)
 #ifdef CONFIG_MACH_SUN4I
        struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
        if (on)
-               setbits_le32(&ccm->dram_clk_cfg, CCM_DRAM_CTRL_DCLK_OUT);
+               setbits_le32(&ccm->dram_clk_gate, CCM_DRAM_CTRL_DCLK_OUT);
        else
-               clrbits_le32(&ccm->dram_clk_cfg, CCM_DRAM_CTRL_DCLK_OUT);
+               clrbits_le32(&ccm->dram_clk_gate, CCM_DRAM_CTRL_DCLK_OUT);
 #endif
 }
 
index 10a62416d2686194642542e7aab2ee3548ff7044..699173cf699b252e68793190513daa65ee6f755c 100644 (file)
@@ -142,9 +142,6 @@ static void mctl_channel_init(int ch_index, struct dram_sun6i_para *para)
 
        writel((MCTL_TITMSRST << 18) | (MCTL_TDLLLOCK << 6) | MCTL_TDLLSRST,
               &mctl_phy->ptr0);
-       /* Unknown magic performed by boot0 */
-       if ((readl(SUNXI_RTC_BASE + 0x20c) & 3) == 2)
-               setbits_le32(&mctl_phy->ptr0, 1 << 18);
 
        writel((MCTL_TDINIT1 << 19) | MCTL_TDINIT0, &mctl_phy->ptr1);
        writel((MCTL_TDINIT3 << 17) | MCTL_TDINIT2, &mctl_phy->ptr2);
index fba1cc7498c2ecaefef564f389798ad0e4ddf9e9..5d682d3ca30d69a8b9c06b4f5306910a9c112685 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
-obj-y += platdevice.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
                                                                clkrst_init.o
index 62f5b0148dc0b61cc637208a7d8f30473a8f0395..9d51299308764fb02d94c3d7e668d31a122e02ae 100644 (file)
@@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */
 struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = {
        {
                .base = 0x5a800100,
index 74129bc86ad2d8452426579deb15f565dd760174..fd1c432f4f45db7e18cb0519adea6c972ec4c378 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
-obj-y += platdevice.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_SOC_INIT) += sbc_init.o sg_init.o pll_init.o clkrst_init.o
 obj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o
index 1843d0469f6e775c0da6f3bf2f7a6ec9f59543ef..31ee2a210002d2c67759191b515e105d90ed8cd8 100644 (file)
@@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */
 struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = {
        {
                .base = 0x5a800100,
index fba1cc7498c2ecaefef564f389798ad0e4ddf9e9..5d682d3ca30d69a8b9c06b4f5306910a9c112685 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
-obj-y += platdevice.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
                                                                clkrst_init.o
index 72ec599f69b905dd029c73519ccd2abf2679a8a7..ea0691dd67b9f06ca21d8dbb0ac85fa1df549aad 100644 (file)
@@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */
 struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = {
        {
                .base = 0x5a800100,
index ba6dec930b39c224ea6592b66d557db3bf509a4d..01df9a9f0e1f6a567b1410453abe85d3bb022d7b 100644 (file)
@@ -12,7 +12,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
        exynos5250-snow.dtb \
        exynos5250-smdk5250.dtb \
        exynos5420-smdk5420.dtb \
-       exynos5420-peach-pit.dtb
+       exynos5420-peach-pit.dtb \
+       exynos5800-peach-pi.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
@@ -31,6 +32,10 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra114-dalmore.dtb \
        tegra124-jetson-tk1.dtb \
        tegra124-venice2.dtb
+dtb-$(CONFIG_ARCH_UNIPHIER) += \
+       uniphier-ph1-pro4-ref.dtb \
+       uniphier-ph1-ld4-ref.dtb \
+       uniphier-ph1-sld8-ref.dtb
 dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \
        zynq-zc706.dtb \
        zynq-zed.dtb \
index 2a1f1dda4e23079a0e8108c9e29418b9eab7272b..c78efec64957ea53e801df849da005f06e56d36c 100644 (file)
                div = <0x3>;
                index = <4>;
        };
+
+       ehci@12580000 {
+               compatible = "samsung,exynos-ehci";
+               reg = <0x12580000 0x100>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               phy {
+                       compatible = "samsung,exynos-usb-phy";
+                       reg = <0x125B0000 0x100>;
+               };
+       };
 };
index 6fd9275c4ef789134344bd4a774de154e18c4c5a..95af02534caa6ea9058a22b23fdb5dfc87617ac1 100644 (file)
        };
 
        ehci@12110000 {
-               samsung,vbus-gpio = <&gpio 0x309 0>; /* X11 */
+               samsung,vbus-gpio = <&gpio 0xb1 0>; /* X11 */
        };
 
        xhci@12000000 {
-               samsung,vbus-gpio = <&gpio 0x317 0>; /* X27 */
+               samsung,vbus-gpio = <&gpio 0xbf 0>; /* X27 */
        };
 
        tmu@10060000 {
diff --git a/arch/arm/dts/exynos5800-peach-pi.dts b/arch/arm/dts/exynos5800-peach-pi.dts
new file mode 100644 (file)
index 0000000..8aedf8e
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * SAMSUNG/GOOGLE Peach-Pit board device tree source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+#include "exynos54xx.dtsi"
+
+/ {
+       model = "Samsung/Google Peach Pi board based on Exynos5800";
+
+       compatible = "google,pit-rev#", "google,pit",
+               "google,peach", "samsung,exynos5800", "samsung,exynos5";
+
+       config {
+               google,bad-wake-gpios = <&gpio 0x56 0>; /* gpx0-6 */
+               hwid = "PIT TEST A-A 7848";
+               lazy-init = <1>;
+       };
+
+       aliases {
+               serial0 = "/serial@12C30000";
+               console = "/serial@12C30000";
+               pmic = "/i2c@12ca0000";
+       };
+
+       dmc {
+               mem-manuf = "samsung";
+               mem-type = "ddr3";
+               clock-frequency = <800000000>;
+               arm-frequency = <1700000000>;
+       };
+
+       tmu@10060000 {
+               samsung,min-temp        = <25>;
+               samsung,max-temp        = <125>;
+               samsung,start-warning   = <95>;
+               samsung,start-tripping  = <105>;
+               samsung,hw-tripping     = <110>;
+               samsung,efuse-min-value = <40>;
+               samsung,efuse-value     = <55>;
+               samsung,efuse-max-value = <100>;
+               samsung,slope           = <274761730>;
+               samsung,dc-value        = <25>;
+       };
+
+       /* MAX77802 is on i2c bus 4 */
+       i2c@12ca0000 {
+               clock-frequency = <400000>;
+               power-regulator@9 {
+                       compatible = "maxim,max77802-pmic";
+                       reg = <0x9>;
+               };
+       };
+
+       i2c@12cd0000 { /* i2c7 */
+               clock-frequency = <100000>;
+              soundcodec@20 {
+                     reg = <0x20>;
+                     compatible = "maxim,max98090-codec";
+              };
+
+               edp-lvds-bridge@48 {
+                       compatible = "parade,ps8625";
+                       reg = <0x48>;
+               };
+       };
+
+        sound@3830000 {
+                samsung,codec-type = "max98090";
+        };
+
+       i2c@12e10000 { /* i2c9 */
+               clock-frequency = <400000>;
+                tpm@20 {
+                        compatible = "infineon,slb9645-tpm";
+                        reg = <0x20>;
+               };
+       };
+
+       spi@12d30000 { /* spi1 */
+               spi-max-frequency = <50000000>;
+               firmware_storage_spi: flash@0 {
+                       reg = <0>;
+
+                       /*
+                        * A region for the kernel to store a panic event
+                        * which the firmware will add to the log.
+                       */
+                       elog-panic-event-offset = <0x01e00000 0x100000>;
+
+                       elog-shrink-size = <0x400>;
+                       elog-full-threshold = <0xc00>;
+               };
+       };
+
+       spi@12d40000 { /* spi2 */
+               spi-max-frequency = <4000000>;
+               spi-deactivate-delay = <200>;
+               cros-ec@0 {
+                       reg = <0>;
+                       compatible = "google,cros-ec";
+                       spi-half-duplex;
+                       spi-max-timeout-ms = <1100>;
+                       spi-frame-header = <0xec>;
+                       ec-interrupt = <&gpio 93 1>; /* GPX1_5 */
+
+                       /*
+                        * This describes the flash memory within the EC. Note
+                        * that the STM32L flash erases to 0, not 0xff.
+                        */
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       flash@8000000 {
+                               reg = <0x08000000 0x20000>;
+                               erase-value = <0>;
+                       };
+               };
+       };
+
+       xhci@12000000 {
+               samsung,vbus-gpio = <&gpio 0x40 0>; /* H00 */
+       };
+
+       xhci@12400000 {
+               samsung,vbus-gpio = <&gpio 0x41 0>; /* H01 */
+       };
+
+       fimd@14400000 {
+               samsung,vl-freq = <60>;
+               samsung,vl-col = <1920>;
+               samsung,vl-row = <1080>;
+               samsung,vl-width = <1920>;
+               samsung,vl-height = <1080>;
+
+               samsung,vl-clkp;
+               samsung,vl-dp;
+               samsung,vl-bpix = <4>;
+
+               samsung,vl-hspw = <80>;
+               samsung,vl-hbpd = <172>;
+               samsung,vl-hfpd = <60>;
+               samsung,vl-vspw = <10>;
+               samsung,vl-vbpd = <25>;
+               samsung,vl-vfpd = <10>;
+               samsung,vl-cmd-allow-len = <0xf>;
+
+               samsung,winid = <3>;
+               samsung,interface-mode = <1>;
+               samsung,dp-enabled = <1>;
+               samsung,dual-lcd-enabled = <0>;
+       };
+};
diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts
new file mode 100644 (file)
index 0000000..f01189c
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Device Tree Source for UniPhier PH1-LD4 Reference Board
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ "uniphier-ph1-ld4.dtsi"
+
+/ {
+       model = "Panasonic UniPhier PH1-LD4 Reference Board";
+       compatible = "panasonic,ph1-ld4-ref", "panasonic,ph1-ld4";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyPS0,115200 earlyprintk";
+               stdout-path = &uart0;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+      status = "okay";
+};
+
+&usb1 {
+      status = "okay";
+};
diff --git a/arch/arm/dts/uniphier-ph1-ld4.dtsi b/arch/arm/dts/uniphier-ph1-ld4.dtsi
new file mode 100644 (file)
index 0000000..80074c5
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Device Tree Source for UniPhier PH1-LD4 SoC
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "panasonic,ph1-ld4";
+
+       cpus {
+               #size-cells = <0>;
+               #address-cells = <1>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               uart0: serial@54006800 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006800 0x20>;
+                       clock-frequency = <36864000>;
+               };
+
+               uart1: serial@54006900 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006900 0x20>;
+                       clock-frequency = <36864000>;
+               };
+
+               uart2: serial@54006a00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006a00 0x20>;
+                       clock-frequency = <36864000>;
+               };
+
+               uart3: serial@54006b00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006b00 0x20>;
+                       clock-frequency = <36864000>;
+               };
+
+               usb0: usb@5a800100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a800100 0x100>;
+               };
+
+               usb1: usb@5a810100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a810100 0x100>;
+               };
+
+               usb2: usb@5a820100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a820100 0x100>;
+               };
+       };
+};
diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts
new file mode 100644 (file)
index 0000000..52fa81f
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Device Tree Source for UniPhier PH1-Pro4 Reference Board
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ "uniphier-ph1-pro4.dtsi"
+
+/ {
+       model = "Panasonic UniPhier PH1-Pro4 Reference Board";
+       compatible = "panasonic,ph1-pro4-ref", "panasonic,ph1-pro4";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyPS0,115200 earlyprintk";
+               stdout-path = &uart0;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+      status = "okay";
+};
+
+&usb1 {
+      status = "okay";
+};
diff --git a/arch/arm/dts/uniphier-ph1-pro4.dtsi b/arch/arm/dts/uniphier-ph1-pro4.dtsi
new file mode 100644 (file)
index 0000000..dd84269
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Device Tree Source for UniPhier PH1-Pro4 SoC
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "panasonic,ph1-pro4";
+
+       cpus {
+               #size-cells = <0>;
+               #address-cells = <1>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               uart0: serial@54006800 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006800 0x20>;
+                       clock-frequency = <73728000>;
+               };
+
+               uart1: serial@54006900 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006900 0x20>;
+                       clock-frequency = <73728000>;
+               };
+
+               uart2: serial@54006a00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006a00 0x20>;
+                       clock-frequency = <73728000>;
+               };
+
+               uart3: serial@54006b00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006b00 0x20>;
+                       clock-frequency = <73728000>;
+               };
+
+               usb0: usb@5a800100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a800100 0x100>;
+               };
+
+               usb1: usb@5a810100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a810100 0x100>;
+               };
+       };
+};
diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts
new file mode 100644 (file)
index 0000000..ac73aad
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD8 Reference Board
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ "uniphier-ph1-sld8.dtsi"
+
+/ {
+       model = "Panasonic UniPhier PH1-sLD8 Reference Board";
+       compatible = "panasonic,ph1-sld8-ref", "panasonic,ph1-sld8";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyPS0,115200 earlyprintk";
+               stdout-path = &uart0;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+      status = "okay";
+};
+
+&usb1 {
+      status = "okay";
+};
diff --git a/arch/arm/dts/uniphier-ph1-sld8.dtsi b/arch/arm/dts/uniphier-ph1-sld8.dtsi
new file mode 100644 (file)
index 0000000..43a39f5
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD8 SoC
+ *
+ * Copyright (C) 2014 Panasonic Corporation
+ *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "panasonic,ph1-sld8";
+
+       cpus {
+               #size-cells = <0>;
+               #address-cells = <1>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               uart0: serial@54006800 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006800 0x20>;
+                       clock-frequency = <80000000>;
+               };
+
+               uart1: serial@54006900 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006900 0x20>;
+                       clock-frequency = <80000000>;
+               };
+
+               uart2: serial@54006a00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006a00 0x20>;
+                       clock-frequency = <80000000>;
+               };
+
+               uart3: serial@54006b00 {
+                       compatible = "panasonic,uniphier-uart";
+                       status = "disabled";
+                       reg = <0x54006b00 0x20>;
+                       clock-frequency = <80000000>;
+               };
+
+               usb0: usb@5a800100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a800100 0x100>;
+               };
+
+               usb1: usb@5a810100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a810100 0x100>;
+               };
+
+               usb2: usb@5a820100 {
+                       compatible = "panasonic,uniphier-ehci", "usb-ehci";
+                       status = "disabled";
+                       reg = <0x5a820100 0x100>;
+               };
+       };
+};
index 78aceef17b18b90a278aa48e25533f3ca86ad2c6..29674ad4dadda7942531df19b2495b535b8ec37d 100644 (file)
@@ -227,6 +227,13 @@ static inline void s5p_set_cpu_id(void)
                /* Exynos5420 */
                s5p_cpu_id = 0x5420;
                break;
+       case 0x422:
+               /*
+                * Exynos5800 is a variant of Exynos5420
+                * and has product id 0x5422
+                */
+               s5p_cpu_id = 0x5800;
+               break;
        }
 }
 
@@ -255,6 +262,7 @@ IS_EXYNOS_TYPE(exynos4210, 0x4210)
 IS_EXYNOS_TYPE(exynos4412, 0x4412)
 IS_EXYNOS_TYPE(exynos5250, 0x5250)
 IS_EXYNOS_TYPE(exynos5420, 0x5420)
+IS_EXYNOS_TYPE(exynos5800, 0x5800)
 
 #define SAMSUNG_BASE(device, base)                             \
 static inline unsigned int __attribute__((no_instrument_function)) \
@@ -265,7 +273,7 @@ static inline unsigned int __attribute__((no_instrument_function)) \
                        return EXYNOS4X12_##base;               \
                return EXYNOS4_##base;                          \
        } else if (cpu_is_exynos5()) {                          \
-               if (proid_is_exynos5420())                      \
+               if (proid_is_exynos5420() || proid_is_exynos5800())     \
                        return EXYNOS5420_##base;               \
                return EXYNOS5_##base;                          \
        }                                                       \
index ec3f9b6ee102aaa46f869ace99b92f0027142f6c..4990a1af39c908cff63ddf4166864de5da78d934 100644 (file)
@@ -450,6 +450,7 @@ enum mem_manuf {
 #define CONCONTROL_RD_FETCH_SHIFT      12
 #define CONCONTROL_RD_FETCH_MASK       (0x7 << CONCONTROL_RD_FETCH_SHIFT)
 #define CONCONTROL_AREF_EN_SHIFT       5
+#define CONCONTROL_UPDATE_MODE         (1 << 3)
 
 /* PRECHCONFIG register field */
 #define PRECHCONFIG_TP_CNT_SHIFT       24
index d2d70bd82be801db6a95dc2319451a2498d32937..3800fa904438dde4e047e264f45561378e8778c5 100644 (file)
 
 #define CLK_24MHZ              5
 
+#define PHYPWR_NORMAL_MASK_PHY0                 (0x39 << 0)
+#define PHYPWR_NORMAL_MASK_PHY1                 (0x7 << 6)
+#define PHYPWR_NORMAL_MASK_HSIC0                (0x7 << 9)
+#define PHYPWR_NORMAL_MASK_HSIC1                (0x7 << 12)
+#define RSTCON_HOSTPHY_SWRST                    (0xf << 3)
+#define RSTCON_SWRST                            (0x1 << 0)
+
 #define HOST_CTRL0_PHYSWRSTALL                 (1 << 31)
 #define HOST_CTRL0_COMMONON_N                  (1 << 9)
 #define HOST_CTRL0_SIDDQ                       (1 << 6)
@@ -61,6 +68,12 @@ struct exynos_usb_phy {
        unsigned int usbotgtune;
 };
 
+struct exynos4412_usb_phy {
+       unsigned int usbphyctrl;
+       unsigned int usbphyclk;
+       unsigned int usbphyrstcon;
+};
+
 /* Switch on the VBUS power. */
 int board_usb_vbus_init(void);
 
index 02287decc2f008fc19de7426c078740afe3bb208..9699954a7d452c1d0979e8675a9094d658747066 100644 (file)
@@ -1398,7 +1398,7 @@ static struct gpio_info exynos5420_gpio_data[EXYNOS5420_GPIO_NUM_PARTS] = {
 static inline struct gpio_info *get_gpio_data(void)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return exynos5420_gpio_data;
                else
                        return exynos5_gpio_data;
@@ -1415,7 +1415,7 @@ static inline struct gpio_info *get_gpio_data(void)
 static inline unsigned int get_bank_num(void)
 {
        if (cpu_is_exynos5()) {
-               if (proid_is_exynos5420())
+               if (proid_is_exynos5420() || proid_is_exynos5800())
                        return EXYNOS5420_GPIO_NUM_PARTS;
                else
                        return EXYNOS5_GPIO_NUM_PARTS;
index e8a98a54714a2411c49b49e2546d124537d549ff..3f97b31aeada2dcf20554894d338e7be47d77c4a 100644 (file)
@@ -210,6 +210,13 @@ struct exynos4_power {
        unsigned int    gps_alive_option;
 };
 
+struct exynos4412_power {
+       unsigned char   res1[0x0704];
+       unsigned int    usbhost_phy_control;
+       unsigned int    hsic1_phy_control;
+       unsigned int    hsic2_phy_control;
+};
+
 struct exynos5_power {
        unsigned int    om_stat;
        unsigned char   res1[0x18];
index f2c9687df42cb9da9cc480cc0d35b5255a400c9e..ba86eea040295e1ad0240569c601951137e8059d 100644 (file)
 #define CONFIG_SYS_NS16550_COM1                        (CONFIG_SYS_IMMR + 0x011c0500)
 #define CONFIG_SYS_NS16550_COM2                        (CONFIG_SYS_IMMR + 0x011d0500)
 #define CONFIG_SYS_DCU_ADDR                    (CONFIG_SYS_IMMR + 0x01ce0000)
+#define CONFIG_SYS_LS102XA_USB1_ADDR \
+       (CONFIG_SYS_IMMR + CONFIG_SYS_LS102XA_USB1_OFFSET)
 
+#define CONFIG_SYS_LS102XA_USB1_OFFSET         0x07600000
 #define CONFIG_SYS_TSEC1_OFFSET                        0x01d10000
 #define CONFIG_SYS_TSEC2_OFFSET                        0x01d50000
 #define CONFIG_SYS_TSEC3_OFFSET                        0x01d90000
 
 #define DCU_LAYER_MAX_NUM                      16
 
+#define QE_MURAM_SIZE          0x6000UL
+#define MAX_QE_RISC            1
+#define QE_NUM_OF_SNUM         28
+
 #define CONFIG_SYS_FSL_SRDS_1
 
 #ifdef CONFIG_LS102XA
@@ -80,6 +87,7 @@
 #define CONFIG_NUM_DDR_CONTROLLERS             1
 #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
 #else
 #error SoC not defined
 #endif
index 7995fe262b17c653569a247e617608be83039ce8..b0c267cfc2b2680e7bbe6c30e05297fa3dcd2e87 100644 (file)
@@ -95,8 +95,6 @@ struct ccsr_gur {
        u32     sdhcpcr;
 };
 
-#define SCFG_SCFGREVCR_REV             0xffffffff
-#define SCFG_SCFGREVCR_NOREV           0
 #define SCFG_ETSECDMAMCR_LE_BD_FR      0xf8001a0f
 #define SCFG_ETSECCMCR_GE2_CLK125      0x04000000
 #define SCFG_PIXCLKCR_PXCKEN           0x80000000
@@ -182,7 +180,7 @@ struct ccsr_scfg {
        u32 etsecmcr;
        u32 sdhciovserlcr;
        u32 resv14[61];
-       u32 sparecr;
+       u32 sparecr[8];
 };
 
 /* Clocking */
@@ -448,6 +446,7 @@ struct ccsr_ddr {
 
 #define CCI400_CTRLORD_TERM_BARRIER    0x00000008
 #define CCI400_CTRLORD_EN_BARRIER      0
+#define CCI400_SHAORD_NON_SHAREABLE    0x00000002
 
 /* CCI-400 registers */
 struct ccsr_cci400 {
index ce4186fed043d448c411b10d531e87ad2a1e7e97..8773ce30d17241ccb241f0a396af50be901fa577 100644 (file)
@@ -83,9 +83,9 @@ static inline struct s3c24x0_lcd *s3c24x0_get_base_lcd(void)
        return (struct s3c24x0_lcd *)S3C24X0_LCD_BASE;
 }
 
-static inline struct s3c2410_nand *s3c2410_get_base_nand(void)
+static inline struct s3c24x0_nand *s3c24x0_get_base_nand(void)
 {
-       return (struct s3c2410_nand *)S3C2410_NAND_BASE;
+       return (struct s3c24x0_nand *)S3C2410_NAND_BASE;
 }
 
 static inline struct s3c24x0_uart
index 3f44bdc306b5eb29690e88a441fc80496e6d69ff..7a525f281877c2ce808e1bca91dcf8fd642ac6ab 100644 (file)
@@ -81,9 +81,9 @@ static inline struct s3c24x0_lcd *s3c24x0_get_base_lcd(void)
        return (struct s3c24x0_lcd *)S3C24X0_LCD_BASE;
 }
 
-static inline struct s3c2440_nand *s3c2440_get_base_nand(void)
+static inline struct s3c24x0_nand *s3c24x0_get_base_nand(void)
 {
-       return (struct s3c2440_nand *)S3C2440_NAND_BASE;
+       return (struct s3c24x0_nand *)S3C2440_NAND_BASE;
 }
 
 static inline struct s3c24x0_uart
index ed9df34c69082113abaf13ddef8b5027322ac2fe..2dae9fc3d74b0b7bee471a51365ae4bb32230afc 100644 (file)
@@ -135,34 +135,33 @@ struct s3c24x0_lcd {
 };
 
 
-#ifdef CONFIG_S3C2410
-/* NAND FLASH (see S3C2410 manual chapter 6) */
-struct s3c2410_nand {
-       u32     nfconf;
-       u32     nfcmd;
-       u32     nfaddr;
-       u32     nfdata;
-       u32     nfstat;
-       u32     nfecc;
-};
-#endif
-#ifdef CONFIG_S3C2440
-/* NAND FLASH (see S3C2440 manual chapter 6) */
-struct s3c2440_nand {
+/* NAND FLASH (see manual chapter 6) */
+struct s3c24x0_nand {
        u32     nfconf;
+#ifndef CONFIG_S3C2410
        u32     nfcont;
+#endif
        u32     nfcmd;
        u32     nfaddr;
        u32     nfdata;
+#ifndef CONFIG_S3C2410
        u32     nfeccd0;
        u32     nfeccd1;
        u32     nfeccd;
+#endif
        u32     nfstat;
+#ifdef CONFIG_S3C2410
+       u32     nfecc;
+#else
        u32     nfstat0;
        u32     nfstat1;
-};
+       u32     nfmecc0;
+       u32     nfmecc1;
+       u32     nfsecc;
+       u32     nfsblk;
+       u32     nfeblk;
 #endif
-
+};
 
 /* UART (see manual chapter 11) */
 struct s3c24x0_uart {
index b40c16b6e7bc262fee8b2faebf9b1921a9e62ab6..64acff3504154a75253a430819e25fe2c3ba1e13 100644 (file)
 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);
 void clock_set_pll5(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);
 #endif
index 9dca800d7851a762de594e46ac92bc6354560de4..eb889695d9143e5cc9756a2c2a0661068336fc57 100644 (file)
@@ -62,7 +62,7 @@ struct sunxi_ccm_reg {
        u32 gps_clk_cfg;        /* 0xd0 */
        u32 spi3_clk_cfg;       /* 0xd4 */
        u8 res5[0x28];
-       u32 dram_clk_cfg;       /* 0x100 */
+       u32 dram_clk_gate;      /* 0x100 */
        u32 be0_clk_cfg;        /* 0x104 */
        u32 be1_clk_cfg;        /* 0x108 */
        u32 fe0_clk_cfg;        /* 0x10c */
@@ -186,12 +186,20 @@ struct sunxi_ccm_reg {
 
 /* ahb clock gate bit offset (second register) */
 #define AHB_GATE_OFFSET_GMAC           17
+#define AHB_GATE_OFFSET_DE_BE0         12
+#define AHB_GATE_OFFSET_HDMI           11
+#define AHB_GATE_OFFSET_LCD1           5
+#define AHB_GATE_OFFSET_LCD0           4
 
 #define CCM_AHB_GATE_GPS (0x1 << 26)
 #define CCM_AHB_GATE_SDRAM (0x1 << 14)
 #define CCM_AHB_GATE_DLL (0x1 << 15)
 #define CCM_AHB_GATE_ACE (0x1 << 16)
 
+#define CCM_PLL3_CTRL_M(n)             (((n) & 0x7f) << 0)
+#define CCM_PLL3_CTRL_INTEGER_MODE     (0x1 << 15)
+#define CCM_PLL3_CTRL_EN               (0x1 << 31)
+
 #define CCM_PLL5_CTRL_M(n) (((n) & 0x3) << 0)
 #define CCM_PLL5_CTRL_M_MASK CCM_PLL5_CTRL_M(0x3)
 #define CCM_PLL5_CTRL_M_X(n) ((n) - 1)
@@ -253,6 +261,34 @@ struct sunxi_ccm_reg {
 
 #define CCM_MMC_CTRL_ENABLE (0x1 << 31)
 
+#define CCM_DRAM_GATE_OFFSET_DE_BE0    26
+
+#define CCM_LCD_CH0_CTRL_PLL3          (0 << 24)
+#define CCM_LCD_CH0_CTRL_PLL7          (1 << 24)
+#define CCM_LCD_CH0_CTRL_PLL3_2X       (2 << 24)
+#define CCM_LCD_CH0_CTRL_PLL7_2X       (3 << 24)
+#define CCM_LCD_CH0_CTRL_RST           (0x1 << 30)
+#define CCM_LCD_CH0_CTRL_GATE          (0x1 << 31)
+
+#define CCM_LCD_CH1_CTRL_M(n)          ((((n) - 1) & 0xf) << 0)
+/* We leave bit 11 set to 0, so sclk1 == sclk2 */
+#define CCM_LCD_CH1_CTRL_PLL3          (0 << 24)
+#define CCM_LCD_CH1_CTRL_PLL7          (1 << 24)
+#define CCM_LCD_CH1_CTRL_PLL3_2X       (2 << 24)
+#define CCM_LCD_CH1_CTRL_PLL7_2X       (3 << 24)
+/* Enable / disable both ch1 sclk1 and sclk2 at the same time */
+#define CCM_LCD_CH1_CTRL_GATE          (0x1 << 31 | 0x1 << 15)
+
+#define CCM_HDMI_CTRL_M(n)             ((((n) - 1) & 0xf) << 0)
+#define CCM_HDMI_CTRL_PLL_MASK         (3 << 24)
+#define CCM_HDMI_CTRL_PLL3             (0 << 24)
+#define CCM_HDMI_CTRL_PLL7             (1 << 24)
+#define CCM_HDMI_CTRL_PLL3_2X          (2 << 24)
+#define CCM_HDMI_CTRL_PLL7_2X          (3 << 24)
+/* No separate ddc gate on sun4i, sun5i and sun7i */
+#define CCM_HDMI_CTRL_DDC_GATE         0
+#define CCM_HDMI_CTRL_GATE             (0x1 << 31)
+
 #define CCM_GMAC_CTRL_TX_CLK_SRC_MII 0x0
 #define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1
 #define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
@@ -266,4 +302,13 @@ struct sunxi_ccm_reg {
 #define CCM_USB_CTRL_PHY1_CLK 0
 #define CCM_USB_CTRL_PHY2_CLK 0
 
+/* CCM bits common to all Display Engine (and IEP) clock ctrl regs */
+#define CCM_DE_CTRL_M(n)               ((((n) - 1) & 0xf) << 0)
+#define CCM_DE_CTRL_PLL_MASK           (3 << 24)
+#define CCM_DE_CTRL_PLL3               (0 << 24)
+#define CCM_DE_CTRL_PLL7               (1 << 24)
+#define CCM_DE_CTRL_PLL5P              (2 << 24)
+#define CCM_DE_CTRL_RST                        (1 << 30)
+#define CCM_DE_CTRL_GATE               (1 << 31)
+
 #endif /* _SUNXI_CLOCK_SUN4I_H */
index e16a7647ed9f711800e17ae06b98e54b838da429..359905452c3e27979ee1a2325351a2444cb7160a 100644 (file)
@@ -176,13 +176,18 @@ struct sunxi_ccm_reg {
 #define CCM_PLL1_CTRL_MAGIC            (0x1 << 16)
 #define CCM_PLL1_CTRL_EN               (0x1 << 31)
 
+#define CCM_PLL3_CTRL_M(n)             ((((n) - 1) & 0xf) << 0)
+#define CCM_PLL3_CTRL_N(n)             ((((n) - 1) & 0x7f) << 8)
+#define CCM_PLL3_CTRL_INTEGER_MODE     (0x1 << 24)
+#define CCM_PLL3_CTRL_EN               (0x1 << 31)
+
 #define CCM_PLL5_CTRL_M(n)             ((((n) - 1) & 0x3) << 0)
 #define CCM_PLL5_CTRL_K(n)             ((((n) - 1) & 0x3) << 4)
 #define CCM_PLL5_CTRL_N(n)             ((((n) - 1) & 0x1f) << 8)
 #define CCM_PLL5_CTRL_UPD              (0x1 << 20)
 #define CCM_PLL5_CTRL_EN               (0x1 << 31)
 
-#define PLL6_CFG_DEFAULT               0x90041811
+#define PLL6_CFG_DEFAULT               0x90041811 /* 600 MHz */
 
 #define CCM_PLL6_CTRL_N_SHIFT          8
 #define CCM_PLL6_CTRL_N_MASK           (0x1f << CCM_PLL6_CTRL_N_SHIFT)
@@ -193,17 +198,26 @@ struct sunxi_ccm_reg {
 
 #define AXI_GATE_OFFSET_DRAM           0
 
+/* ahb_gate0 offsets */
 #define AHB_GATE_OFFSET_USB_OHCI1      30
 #define AHB_GATE_OFFSET_USB_OHCI0      29
 #define AHB_GATE_OFFSET_USB_EHCI1      27
 #define AHB_GATE_OFFSET_USB_EHCI0      26
 #define AHB_GATE_OFFSET_MCTL           14
+#define AHB_GATE_OFFSET_GMAC           17
 #define AHB_GATE_OFFSET_MMC3           11
 #define AHB_GATE_OFFSET_MMC2           10
 #define AHB_GATE_OFFSET_MMC1           9
 #define AHB_GATE_OFFSET_MMC0           8
 #define AHB_GATE_OFFSET_MMC(n)         (AHB_GATE_OFFSET_MMC0 + (n))
 
+/* ahb_gate1 offsets */
+#define AHB_GATE_OFFSET_DRC0           25
+#define AHB_GATE_OFFSET_DE_BE0         12
+#define AHB_GATE_OFFSET_HDMI           11
+#define AHB_GATE_OFFSET_LCD1           5
+#define AHB_GATE_OFFSET_LCD0           4
+
 #define CCM_MMC_CTRL_OSCM24 (0x0 << 24)
 #define CCM_MMC_CTRL_PLL6   (0x1 << 24)
 
@@ -216,6 +230,12 @@ struct sunxi_ccm_reg {
 #define CCM_USB_CTRL_PHY1_CLK (0x1 << 9)
 #define CCM_USB_CTRL_PHY2_CLK (0x1 << 10)
 
+#define CCM_GMAC_CTRL_TX_CLK_SRC_MII   0x0
+#define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1
+#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 MDFS_CLK_DEFAULT               0x81000002 /* PLL6 / 3 */
 
 #define CCM_DRAMCLK_CFG_DIV0(x)                ((x - 1) << 8)
@@ -223,8 +243,35 @@ struct sunxi_ccm_reg {
 #define CCM_DRAMCLK_CFG_UPD            (0x1 << 16)
 #define CCM_DRAMCLK_CFG_RST            (0x1 << 31)
 
+#define CCM_DRAM_GATE_OFFSET_DE_BE0    26
+
+#define CCM_LCD_CH0_CTRL_PLL3          (0 << 24)
+#define CCM_LCD_CH0_CTRL_PLL7          (1 << 24)
+#define CCM_LCD_CH0_CTRL_PLL3_2X       (2 << 24)
+#define CCM_LCD_CH0_CTRL_PLL7_2X       (3 << 24)
+#define CCM_LCD_CH0_CTRL_MIPI_PLL      (4 << 24)
+#define CCM_LCD_CH0_CTRL_GATE          (0x1 << 31)
+
+#define CCM_LCD_CH1_CTRL_M(n)          ((((n) - 1) & 0xf) << 0)
+#define CCM_LCD_CH1_CTRL_PLL3          (0 << 24)
+#define CCM_LCD_CH1_CTRL_PLL7          (1 << 24)
+#define CCM_LCD_CH1_CTRL_PLL3_2X       (2 << 24)
+#define CCM_LCD_CH1_CTRL_PLL7_2X       (3 << 24)
+#define CCM_LCD_CH1_CTRL_GATE          (0x1 << 31)
+
+#define CCM_HDMI_CTRL_M(n)             ((((n) - 1) & 0xf) << 0)
+#define CCM_HDMI_CTRL_PLL_MASK         (3 << 24)
+#define CCM_HDMI_CTRL_PLL3             (0 << 24)
+#define CCM_HDMI_CTRL_PLL7             (1 << 24)
+#define CCM_HDMI_CTRL_PLL3_2X          (2 << 24)
+#define CCM_HDMI_CTRL_PLL7_2X          (3 << 24)
+#define CCM_HDMI_CTRL_DDC_GATE         (0x1 << 30)
+#define CCM_HDMI_CTRL_GATE             (0x1 << 31)
+
 #define MBUS_CLK_DEFAULT               0x81000001 /* PLL6 / 2 */
 
+/* ahb_reset0 offsets */
+#define AHB_RESET_OFFSET_GMAC          17
 #define AHB_RESET_OFFSET_MCTL          14
 #define AHB_RESET_OFFSET_MMC3          11
 #define AHB_RESET_OFFSET_MMC2          10
@@ -232,10 +279,28 @@ struct sunxi_ccm_reg {
 #define AHB_RESET_OFFSET_MMC0          8
 #define AHB_RESET_OFFSET_MMC(n)                (AHB_RESET_OFFSET_MMC0 + (n))
 
+/* ahb_reset0 offsets */
+#define AHB_RESET_OFFSET_DRC0          25
+#define AHB_RESET_OFFSET_DE_BE0                12
+#define AHB_RESET_OFFSET_HDMI          11
+#define AHB_RESET_OFFSET_LCD1          5
+#define AHB_RESET_OFFSET_LCD0          4
+
 /* apb2 reset */
 #define APB2_RESET_UART_SHIFT          (16)
 #define APB2_RESET_UART_MASK           (0xff << APB2_RESET_UART_SHIFT)
 #define APB2_RESET_TWI_SHIFT           (0)
 #define APB2_RESET_TWI_MASK            (0xf << APB2_RESET_TWI_SHIFT)
 
+/* CCM bits common to all Display Engine (and IEP) clock ctrl regs */
+#define CCM_DE_CTRL_M(n)               ((((n) - 1) & 0xf) << 0)
+#define CCM_DE_CTRL_PLL_MASK           (0xf << 24)
+#define CCM_DE_CTRL_PLL3               (0 << 24)
+#define CCM_DE_CTRL_PLL7               (1 << 24)
+#define CCM_DE_CTRL_PLL6_2X            (2 << 24)
+#define CCM_DE_CTRL_PLL8               (3 << 24)
+#define CCM_DE_CTRL_PLL9               (4 << 24)
+#define CCM_DE_CTRL_PLL10              (5 << 24)
+#define CCM_DE_CTRL_GATE               (1 << 31)
+
 #endif /* _SUNXI_CLOCK_SUN6I_H */
index bdee89e87da7c95c01e00b6a67c5d18f0a09d0cd..2c92b5ca568363b26125c166caa6f2fe1b3f15d4 100644 (file)
 
 #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
diff --git a/arch/arm/include/asm/arch-sunxi/display.h b/arch/arm/include/asm/arch-sunxi/display.h
new file mode 100644 (file)
index 0000000..ddb71c1
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Sunxi platform display controller register and constant defines
+ *
+ * (C) Copyright 2014 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _SUNXI_DISPLAY_H
+#define _SUNXI_DISPLAY_H
+
+struct sunxi_de_be_reg {
+       u8 res0[0x800];                 /* 0x000 */
+       u32 mode;                       /* 0x800 */
+       u32 backcolor;                  /* 0x804 */
+       u32 disp_size;                  /* 0x808 */
+       u8 res1[0x4];                   /* 0x80c */
+       u32 layer0_size;                /* 0x810 */
+       u32 layer1_size;                /* 0x814 */
+       u32 layer2_size;                /* 0x818 */
+       u32 layer3_size;                /* 0x81c */
+       u32 layer0_pos;                 /* 0x820 */
+       u32 layer1_pos;                 /* 0x824 */
+       u32 layer2_pos;                 /* 0x828 */
+       u32 layer3_pos;                 /* 0x82c */
+       u8 res2[0x10];                  /* 0x830 */
+       u32 layer0_stride;              /* 0x840 */
+       u32 layer1_stride;              /* 0x844 */
+       u32 layer2_stride;              /* 0x848 */
+       u32 layer3_stride;              /* 0x84c */
+       u32 layer0_addr_low32b;         /* 0x850 */
+       u32 layer1_addr_low32b;         /* 0x854 */
+       u32 layer2_addr_low32b;         /* 0x858 */
+       u32 layer3_addr_low32b;         /* 0x85c */
+       u32 layer0_addr_high4b;         /* 0x860 */
+       u32 layer1_addr_high4b;         /* 0x864 */
+       u32 layer2_addr_high4b;         /* 0x868 */
+       u32 layer3_addr_high4b;         /* 0x86c */
+       u32 reg_ctrl;                   /* 0x870 */
+       u8 res3[0xc];                   /* 0x874 */
+       u32 color_key_max;              /* 0x880 */
+       u32 color_key_min;              /* 0x884 */
+       u32 color_key_config;           /* 0x888 */
+       u8 res4[0x4];                   /* 0x88c */
+       u32 layer0_attr0_ctrl;          /* 0x890 */
+       u32 layer1_attr0_ctrl;          /* 0x894 */
+       u32 layer2_attr0_ctrl;          /* 0x898 */
+       u32 layer3_attr0_ctrl;          /* 0x89c */
+       u32 layer0_attr1_ctrl;          /* 0x8a0 */
+       u32 layer1_attr1_ctrl;          /* 0x8a4 */
+       u32 layer2_attr1_ctrl;          /* 0x8a8 */
+       u32 layer3_attr1_ctrl;          /* 0x8ac */
+};
+
+struct sunxi_lcdc_reg {
+       u32 ctrl;                       /* 0x00 */
+       u32 int0;                       /* 0x04 */
+       u32 int1;                       /* 0x08 */
+       u8 res0[0x04];                  /* 0x0c */
+       u32 frame_ctrl;                 /* 0x10 */
+       u8 res1[0x2c];                  /* 0x14 */
+       u32 tcon0_ctrl;                 /* 0x40 */
+       u32 tcon0_dclk;                 /* 0x44 */
+       u32 tcon0_basic_timing0;        /* 0x48 */
+       u32 tcon0_basic_timing1;        /* 0x4c */
+       u32 tcon0_basic_timing2;        /* 0x50 */
+       u32 tcon0_basic_timing3;        /* 0x54 */
+       u32 tcon0_hv_intf;              /* 0x58 */
+       u8 res2[0x04];                  /* 0x5c */
+       u32 tcon0_cpu_intf;             /* 0x60 */
+       u32 tcon0_cpu_wr_dat;           /* 0x64 */
+       u32 tcon0_cpu_rd_dat0;          /* 0x68 */
+       u32 tcon0_cpu_rd_dat1;          /* 0x6c */
+       u32 tcon0_ttl_timing0;          /* 0x70 */
+       u32 tcon0_ttl_timing1;          /* 0x74 */
+       u32 tcon0_ttl_timing2;          /* 0x78 */
+       u32 tcon0_ttl_timing3;          /* 0x7c */
+       u32 tcon0_ttl_timing4;          /* 0x80 */
+       u32 tcon0_lvds_intf;            /* 0x84 */
+       u32 tcon0_io_polarity;          /* 0x88 */
+       u32 tcon0_io_tristate;          /* 0x8c */
+       u32 tcon1_ctrl;                 /* 0x90 */
+       u32 tcon1_timing_source;        /* 0x94 */
+       u32 tcon1_timing_scale;         /* 0x98 */
+       u32 tcon1_timing_out;           /* 0x9c */
+       u32 tcon1_timing_h;             /* 0xa0 */
+       u32 tcon1_timing_v;             /* 0xa4 */
+       u32 tcon1_timing_sync;          /* 0xa8 */
+       u8 res3[0x44];                  /* 0xac */
+       u32 tcon1_io_polarity;          /* 0xf0 */
+       u32 tcon1_io_tristate;          /* 0xf4 */
+};
+
+struct sunxi_hdmi_reg {
+       u32 version_id;                 /* 0x000 */
+       u32 ctrl;                       /* 0x004 */
+       u32 irq;                        /* 0x008 */
+       u32 hpd;                        /* 0x00c */
+       u32 video_ctrl;                 /* 0x010 */
+       u32 video_size;                 /* 0x014 */
+       u32 video_bp;                   /* 0x018 */
+       u32 video_fp;                   /* 0x01c */
+       u32 video_spw;                  /* 0x020 */
+       u32 video_polarity;             /* 0x024 */
+       u8 res0[0x1d8];                 /* 0x028 */
+       u32 pad_ctrl0;                  /* 0x200 */
+       u32 pad_ctrl1;                  /* 0x204 */
+       u32 pll_ctrl;                   /* 0x208 */
+       u32 pll_dbg0;                   /* 0x20c */
+};
+
+/*
+ * DE-BE register constants.
+ */
+#define SUNXI_DE_BE_WIDTH(x)                   (((x) - 1) << 0)
+#define SUNXI_DE_BE_HEIGHT(y)                  (((y) - 1) << 16)
+#define SUNXI_DE_BE_MODE_ENABLE                        (1 << 0)
+#define SUNXI_DE_BE_MODE_START                 (1 << 1)
+#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_ATTR1_FMT_XRGB8888   (0x09 << 8)
+
+/*
+ * LCDC register constants.
+ */
+#define SUNXI_LCDC_X(x)                                (((x) - 1) << 16)
+#define SUNXI_LCDC_Y(y)                                (((y) - 1) << 0)
+#define SUNXI_LCDC_CTRL_IO_MAP_MASK            (1 << 0)
+#define SUNXI_LCDC_CTRL_IO_MAP_TCON0           (0 << 0)
+#define SUNXI_LCDC_CTRL_IO_MAP_TCON1           (1 << 0)
+#define SUNXI_LCDC_CTRL_TCON_ENABLE            (1 << 31)
+#define SUNXI_LCDC_TCON0_DCLK_ENABLE           (0xf << 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)
+#define SUNXI_LCDC_TCON1_TIMING_H_TOTAL(n)     (((n) - 1) << 16)
+#define SUNXI_LCDC_TCON1_TIMING_V_BP(n)                (((n) - 1) << 0)
+#define SUNXI_LCDC_TCON1_TIMING_V_TOTAL(n)     (((n) * 2) << 16)
+
+/*
+ * HDMI register constants.
+ */
+#define SUNXI_HDMI_X(x)                                (((x) - 1) << 0)
+#define SUNXI_HDMI_Y(y)                                (((y) - 1) << 16)
+#define SUNXI_HDMI_CTRL_ENABLE                 (1 << 31)
+#define SUNXI_HDMI_IRQ_STATUS_FIFO_UF          (1 << 0)
+#define SUNXI_HDMI_IRQ_STATUS_FIFO_OF          (1 << 1)
+#define SUNXI_HDMI_IRQ_STATUS_BITS             0x73
+#define SUNXI_HDMI_HPD_DETECT                  (1 << 0)
+#define SUNXI_HDMI_VIDEO_CTRL_ENABLE           (1 << 31)
+#define SUNXI_HDMI_VIDEO_POL_HOR               (1 << 0)
+#define SUNXI_HDMI_VIDEO_POL_VER               (1 << 1)
+#define SUNXI_HDMI_VIDEO_POL_TX_CLK            (0x3e0 << 16)
+
+#ifdef CONFIG_MACH_SUN6I
+#define SUNXI_HDMI_PAD_CTRL0_HDP               0x7e80000f
+#define SUNXI_HDMI_PAD_CTRL0_RUN               0x7e8000ff
+#else
+#define SUNXI_HDMI_PAD_CTRL0_HDP               0xfe800000
+#define SUNXI_HDMI_PAD_CTRL0_RUN               0xfe800000
+#endif
+
+#ifdef CONFIG_MACH_SUN4I
+#define SUNXI_HDMI_PAD_CTRL1                   0x00d8c820
+#elif defined CONFIG_MACH_SUN6I
+#define SUNXI_HDMI_PAD_CTRL1                   0x01ded030
+#else
+#define SUNXI_HDMI_PAD_CTRL1                   0x00d8c830
+#endif
+#define SUNXI_HDMI_PAD_CTRL1_HALVE             (1 << 6)
+
+#ifdef CONFIG_MACH_SUN6I
+#define SUNXI_HDMI_PLL_CTRL                    0xba48a308
+#define SUNXI_HDMI_PLL_CTRL_DIV(n)             (((n) - 1) << 4)
+#else
+#define SUNXI_HDMI_PLL_CTRL                    0xfa4ef708
+#define SUNXI_HDMI_PLL_CTRL_DIV(n)             ((n) << 4)
+#endif
+#define SUNXI_HDMI_PLL_CTRL_DIV_MASK           (0xf << 4)
+
+#define SUNXI_HDMI_PLL_DBG0_PLL3               (0 << 21)
+#define SUNXI_HDMI_PLL_DBG0_PLL7               (1 << 21)
+
+int sunxi_simplefb_setup(void *blob);
+
+#endif /* _SUNXI_DISPLAY_H */
index c734cf015e631f8304ba489f7e91324c3a6ae08c..366c0dc45ac119ea428a795b89edacf90b5a47b6 100644 (file)
@@ -134,6 +134,7 @@ enum sunxi_gpio_number {
 #define SUNXI_GPIO_OUTPUT      1
 
 #define SUNXI_GPA0_EMAC                2
+#define SUN6I_GPA0_GMAC                2
 #define SUN7I_GPA0_GMAC                5
 
 #define SUNXI_GPB0_TWI0                2
diff --git a/arch/arm/include/asm/arch-uniphier/gpio.h b/arch/arm/include/asm/arch-uniphier/gpio.h
new file mode 100644 (file)
index 0000000..1fc4e19
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ * 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 even if GPIO is not supported.
+ */
index c69d0646f58099caf2e9f664bcaf0ce4cc30fe7e..438f128326a67a6c5237df32a0f392efdabee1c7 100644 (file)
@@ -17,6 +17,14 @@ struct arch_global_data {
 #if defined(CONFIG_FSL_ESDHC)
        u32 sdhc_clk;
 #endif
+
+#if defined(CONFIG_U_QE)
+       u32 qe_clk;
+       u32 brg_clk;
+       uint mp_alloc_base;
+       uint mp_alloc_top;
+#endif /* CONFIG_U_QE */
+
 #ifdef CONFIG_AT91FAMILY
        /* "static data" needed by at91's clock.c */
        unsigned long   cpu_clk_rate_hz;
index 68e59b596f1146f605a91383c7dd950945fddc2f..384ea26022bcf5b907a8eaf541466bbb56a3612a 100644 (file)
@@ -136,10 +136,11 @@ reset:
 
        /* 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
-        nop
+        move   ra, zero
 
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
@@ -155,6 +156,7 @@ reset:
        .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
@@ -260,8 +262,9 @@ in_ram:
         addi   t1, 4
 
        move    a0, s0                  # a0 <-- gd
+       move    a1, s2
        la      t9, board_init_r
        jr      t9
-        move   a1, s2
+        move   ra, zero
 
        .end    relocate_code
index 92954e1c907bf9dddb64aa433aa6374cd324205a..6ff714e8ed4fa2f177ecdc02d9fa8989dd1fe783 100644 (file)
@@ -130,10 +130,11 @@ reset:
 
        /* 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
-        nop
+        move   ra, zero
 
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
@@ -149,6 +150,7 @@ reset:
        .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
@@ -254,8 +256,9 @@ in_ram:
         daddi  t1, 8
 
        move    a0, s0                  # a0 <-- gd
+       move    a1, s2
        dla     t9, board_init_r
        jr      t9
-        move   a1, s2
+        move   ra, zero
 
        .end    relocate_code
index e483e86f6b471e69e4b38b190c0c14278294a621..7f9b6536afa84ab8e7ff2947bec24518caae95b5 100644 (file)
@@ -5,9 +5,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-ifndef CONFIG_SYS_GENERIC_BOARD
-obj-y  += board.o
-endif
 obj-y  += io.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
deleted file mode 100644 (file)
index 3feb020..0000000
+++ /dev/null
@@ -1,320 +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 <malloc.h>
-#include <serial.h>
-#include <stdio_dev.h>
-#include <version.h>
-#include <net.h>
-#include <environment.h>
-#include <nand.h>
-#include <onenand_uboot.h>
-#include <spi.h>
-
-#ifdef CONFIG_BITBANGMII
-#include <miiphy.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-ulong monitor_flash_len;
-
-static char *failed = "*** failed ***\n";
-
-int __board_early_init_f(void)
-{
-       /*
-        * Nothing to do in this dummy implementation
-        */
-       return 0;
-}
-int board_early_init_f(void)
-       __attribute__((weak, alias("__board_early_init_f")));
-
-static int init_func_ram(void)
-{
-#ifdef CONFIG_BOARD_TYPES
-       int board_type = gd->board_type;
-#else
-       int board_type = 0;     /* use dummy arg */
-#endif
-       puts("DRAM:  ");
-
-       gd->ram_size = initdram(board_type);
-       if (gd->ram_size > 0) {
-               print_size(gd->ram_size, "\n");
-               return 0;
-       }
-       puts(failed);
-       return 1;
-}
-
-static int display_banner(void)
-{
-
-       printf("\n\n%s\n\n", version_string);
-       return 0;
-}
-
-#ifndef CONFIG_SYS_NO_FLASH
-static void display_flash_config(ulong size)
-{
-       puts("Flash: ");
-       print_size(size, "\n");
-}
-#endif
-
-static int init_baudrate(void)
-{
-       gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
-       return 0;
-}
-
-
-/*
- * Breath some life into the board...
- *
- * The first part of initialization is running from Flash memory;
- * its main purpose is to initialize the RAM so that we
- * can relocate the monitor code to RAM.
- */
-
-/*
- * All attempts to come up with a "common" initialization sequence
- * that works for all boards and architectures failed: some of the
- * requirements are just _too_ different. To get rid of the resulting
- * mess of board dependend #ifdef'ed code we now make the whole
- * initialization sequence configurable to the user.
- *
- * The requirements for any new initalization function is simple: it
- * receives a pointer to the "global data" structure as it's only
- * argument, and returns an integer return code, where 0 means
- * "continue" and != 0 means "fatal error, hang the system".
- */
-typedef int (init_fnc_t)(void);
-
-init_fnc_t *init_sequence[] = {
-       board_early_init_f,
-       timer_init,
-       env_init,               /* initialize environment */
-       init_baudrate,          /* initialize baudrate settings */
-       serial_init,            /* serial communications setup */
-       console_init_f,
-       display_banner,         /* say that we are here */
-       checkboard,
-       init_func_ram,
-       NULL,
-};
-
-
-void board_init_f(ulong bootflag)
-{
-       gd_t gd_data, *id;
-       bd_t *bd;
-       init_fnc_t **init_fnc_ptr;
-       ulong addr, addr_sp, len;
-       ulong *s;
-
-       /* Pointer is writable since we allocated a register for it.
-        */
-       gd = &gd_data;
-       /* compiler optimization barrier needed for GCC >= 3.4 */
-       __asm__ __volatile__("" : : : "memory");
-
-       memset((void *)gd, 0, sizeof(gd_t));
-
-       for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
-               if ((*init_fnc_ptr)() != 0)
-                       hang();
-       }
-
-       /*
-        * Now that we have DRAM mapped and working, we can
-        * relocate the code and continue running from DRAM.
-        */
-       addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
-
-       /* We can reserve some RAM "on top" here.
-        */
-
-       /* round down to next 4 kB limit.
-        */
-       addr &= ~(4096 - 1);
-       debug("Top of RAM usable for U-Boot at: %08lx\n", addr);
-
-       /* Reserve memory for U-Boot code, data & bss
-        * round down to next 16 kB limit
-        */
-       len = bss_end() - CONFIG_SYS_MONITOR_BASE;
-       addr -= len;
-       addr &= ~(16 * 1024 - 1);
-
-       debug("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
-
-        /* Reserve memory for malloc() arena.
-        */
-       addr_sp = addr - TOTAL_MALLOC_LEN;
-       debug("Reserving %dk for malloc() at: %08lx\n",
-                       TOTAL_MALLOC_LEN >> 10, addr_sp);
-
-       /*
-        * (permanently) allocate a Board Info struct
-        * and a permanent copy of the "global" data
-        */
-       addr_sp -= sizeof(bd_t);
-       bd = (bd_t *)addr_sp;
-       gd->bd = bd;
-       debug("Reserving %zu Bytes for Board Info at: %08lx\n",
-                       sizeof(bd_t), addr_sp);
-
-       addr_sp -= sizeof(gd_t);
-       id = (gd_t *)addr_sp;
-       debug("Reserving %zu Bytes for Global Data at: %08lx\n",
-                       sizeof(gd_t), addr_sp);
-
-       /* Reserve memory for boot params.
-        */
-       addr_sp -= CONFIG_SYS_BOOTPARAMS_LEN;
-       bd->bi_boot_params = addr_sp;
-       debug("Reserving %dk for boot params() at: %08lx\n",
-                       CONFIG_SYS_BOOTPARAMS_LEN >> 10, addr_sp);
-
-       /*
-        * Finally, we set up a new (bigger) stack.
-        *
-        * Leave some safety gap for SP, force alignment on 16 byte boundary
-        * Clear initial stack frame
-        */
-       addr_sp -= 16;
-       addr_sp &= ~0xF;
-       s = (ulong *)addr_sp;
-       *s-- = 0;
-       *s-- = 0;
-       addr_sp = (ulong)s;
-       debug("Stack Pointer at: %08lx\n", addr_sp);
-
-       /*
-        * Save local variables to board info struct
-        */
-       bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;        /* start of DRAM */
-       bd->bi_memsize  = gd->ram_size;         /* size of DRAM in bytes */
-
-       memcpy(id, (void *)gd, sizeof(gd_t));
-
-       relocate_code(addr_sp, id, addr);
-
-       /* NOTREACHED - relocate_code() does not return */
-}
-
-/*
- * This is the next part if the initialization sequence: we are now
- * running from RAM and have a "normal" C environment, i. e. global
- * data can be written, BSS has been cleared, the stack size in not
- * that critical any more, etc.
- */
-
-void board_init_r(gd_t *id, ulong dest_addr)
-{
-#ifndef CONFIG_SYS_NO_FLASH
-       ulong size;
-#endif
-       bd_t *bd;
-
-       gd = id;
-       gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
-
-       debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
-
-       gd->reloc_off = dest_addr - CONFIG_SYS_MONITOR_BASE;
-
-       monitor_flash_len = image_copy_end() - dest_addr;
-
-       serial_initialize();
-
-       bd = gd->bd;
-
-       /* The Malloc area is immediately below the monitor copy in DRAM */
-       mem_malloc_init(CONFIG_SYS_MONITOR_BASE + gd->reloc_off -
-                       TOTAL_MALLOC_LEN, TOTAL_MALLOC_LEN);
-
-#ifndef CONFIG_SYS_NO_FLASH
-       /* configure available FLASH banks */
-       size = flash_init();
-       display_flash_config(size);
-       bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
-       bd->bi_flashsize = size;
-
-#if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
-       bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
-#else
-       bd->bi_flashoffset = 0;
-#endif
-#else
-       bd->bi_flashstart = 0;
-       bd->bi_flashsize = 0;
-       bd->bi_flashoffset = 0;
-#endif
-
-#ifdef CONFIG_CMD_NAND
-       puts("NAND:  ");
-       nand_init();            /* go init the NAND */
-#endif
-
-#if defined(CONFIG_CMD_ONENAND)
-       onenand_init();
-#endif
-
-       /* relocate environment function pointers etc. */
-       env_relocate();
-
-#if defined(CONFIG_PCI)
-       /*
-        * Do pci configuration
-        */
-       pci_init();
-#endif
-
-/** leave this here (after malloc(), environment and PCI are working) **/
-       /* Initialize stdio devices */
-       stdio_init();
-
-       jumptable_init();
-
-       /* Initialize the console (after the relocation and devices init) */
-       console_init_r();
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-       /* Initialize from environment */
-       load_addr = getenv_ulong("loadaddr", 16, load_addr);
-
-#ifdef CONFIG_CMD_SPI
-       puts("SPI:   ");
-       spi_init();             /* go init the SPI */
-       puts("ready\n");
-#endif
-
-#if defined(CONFIG_MISC_INIT_R)
-       /* miscellaneous platform dependent initialisations */
-       misc_init_r();
-#endif
-
-#ifdef CONFIG_BITBANGMII
-       bb_miiphy_init();
-#endif
-#if defined(CONFIG_CMD_NET)
-       puts("Net:   ");
-       eth_initialize(gd->bd);
-#endif
-
-       /* main_loop() can return to retry autoboot, if so just run it again. */
-       for (;;)
-               main_loop();
-
-       /* NOTREACHED - no way out of command loop except booting */
-}
index 71bb0d2a199b28512828640352ec547b67cf6ff9..e0722d20d1e876122939117163071e4ecd525b26 100644 (file)
@@ -6,10 +6,7 @@
  */
 
 #include <common.h>
-#include <command.h>
 #include <image.h>
-#include <u-boot/zlib.h>
-#include <asm/byteorder.h>
 #include <asm/addrspace.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -52,6 +49,20 @@ void arch_lmb_reserve(struct lmb *lmb)
        lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp);
 }
 
+static int boot_setup_linux(bootm_headers_t *images)
+{
+       int ret;
+       ulong rd_len;
+
+       rd_len = images->rd_end - images->rd_start;
+       ret = boot_ramdisk_high(&images->lmb, images->rd_start,
+               rd_len, &images->initrd_start, &images->initrd_end);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
 static void linux_cmdline_init(void)
 {
        linux_argc = 1;
@@ -224,6 +235,8 @@ static void boot_jump_linux(bootm_headers_t *images)
 int do_bootm_linux(int flag, int argc, char * const argv[],
                        bootm_headers_t *images)
 {
+       int ret;
+
        /* No need for those on MIPS */
        if (flag & BOOTM_STATE_OS_BD_T)
                return -1;
@@ -243,6 +256,10 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
                return 0;
        }
 
+       ret = boot_setup_linux(images);
+       if (ret)
+               return ret;
+
        boot_cmdline_linux(images);
        boot_prep_linux(images);
        boot_jump_linux(images);
index 4d88f169df7c12c797c4e39b40ac769d0b56e0eb..502468208820a25b9f72905a10a8e49bdf418b9a 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void __ft_board_setup(void *blob, bd_t *bd)
+int __ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
-void ft_board_setup(void *blob, bd_t *bd) \
+int ft_board_setup(void *blob, bd_t *bd)
        __attribute__((weak, alias("__ft_board_setup")));
 
 void ft_cpu_setup(void *blob, bd_t *bd)
@@ -32,5 +34,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
         * Note: aliases in the dts are required for this
         */
        fdt_fixup_ethernet(blob);
+
+       return 0;
 }
 #endif /* CONFIG_OF_LIBFDT && CONFIG_OF_BOARD_SETUP */
index 3a04a893012d2d46ad8160eddea6320d93302402..fe3eb06324d5ae3c175c503d60ff056e8bb0a865 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/compiler.h>
 #include <asm/fsl_errata.h>
 #include <asm/processor.h>
+#include <fsl_usb.h>
 #include "fsl_corenet_serdes.h"
 
 #ifdef CONFIG_SYS_FSL_ERRATUM_A004849
@@ -293,6 +294,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (has_erratum_a007075())
                puts("Work-around for Erratum A007075 enabled\n");
 #endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007798
+       if (has_erratum_a007798())
+               puts("Work-around for Erratum A007798 enabled\n");
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
        if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
            (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV))
index bd905d15863b99ca6c0e81f75bf2d5c69dee514b..eef9c5a17fa78cabf27de3d4d834cd9f335b592c 100644 (file)
@@ -18,7 +18,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void __ft_board_setup(void *blob, bd_t *bd)
+int __ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
        int i;
@@ -60,8 +60,11 @@ void __ft_board_setup(void *blob, bd_t *bd)
                printf("Unable to update property EBC mappings, err=%s\n",
                       fdt_strerror(rc));
        }
+
+       return 0;
 }
-void ft_board_setup(void *blob, bd_t *bd) __attribute__((weak, alias("__ft_board_setup")));
+int ft_board_setup(void *blob, bd_t *bd)
+               __attribute__((weak, alias("__ft_board_setup")));
 
 /*
  * Fixup all PCIe nodes by setting the device_type property
index 4c1774f503c834ee26877d58cddbd92a026865e6..7860b40884dc587104c523e5898566378bb72b28 100644 (file)
 #define CONFIG_SYS_FSL_ERRATUM_A006379
 #define CONFIG_SYS_FSL_ERRATUM_A007186
 #define CONFIG_SYS_FSL_ERRATUM_A006593
+#define CONFIG_SYS_FSL_ERRATUM_A007798
 #define CONFIG_SYS_CCSRBAR_DEFAULT     0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
 #define CONFIG_SYS_FSL_PCI_VER_3_X
index 64da4bb3bae185ae180908332f5033b2b2b701ea..b9e2fb00fa158c17c0dded28416bf0323e8cf5bc 100644 (file)
@@ -26,59 +26,4 @@ static inline bool has_erratum_a006379(void)
        return false;
 }
 #endif
-
-#ifdef CONFIG_SYS_FSL_ERRATUM_A006261
-static inline bool has_erratum_a006261(void)
-{
-       u32 svr = get_svr();
-       u32 soc = SVR_SOC_VER(svr);
-
-       switch (soc) {
-       case SVR_P1010:
-               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
-       case SVR_P2041:
-       case SVR_P2040:
-               return IS_SVR_REV(svr, 1, 0) ||
-                       IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 1);
-       case SVR_P3041:
-               return IS_SVR_REV(svr, 1, 0) ||
-                       IS_SVR_REV(svr, 1, 1) ||
-                       IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
-       case SVR_P5010:
-       case SVR_P5020:
-       case SVR_P5021:
-               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
-       case SVR_T4240:
-       case SVR_T4160:
-       case SVR_T4080:
-               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
-       case SVR_T1040:
-               return IS_SVR_REV(svr, 1, 0);
-       case SVR_T2080:
-       case SVR_T2081:
-               return IS_SVR_REV(svr, 1, 0);
-       case SVR_P5040:
-               return IS_SVR_REV(svr, 1, 0);
-       }
-
-       return false;
-}
-#endif
-
-static inline bool has_erratum_a007075(void)
-{
-       u32 svr = get_svr();
-       u32 soc = SVR_SOC_VER(svr);
-
-       switch (soc) {
-       case SVR_B4860:
-       case SVR_B4420:
-               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
-       case SVR_P1010:
-               return IS_SVR_REV(svr, 1, 0);
-       case SVR_P4080:
-               return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
-       }
-       return false;
-}
 #endif
index f60cb0a6de22522cd7265c4d95134a30aacbfbea..8e0e190003872928bc3814e028388a9b6e025029 100644 (file)
@@ -71,6 +71,22 @@ enum srds_prtcl {
        INTERLAKEN,
        QSGMII_SW1_A,           /* Indicates ports on L2 Switch */
        QSGMII_SW1_B,
+       SGMII_2500_FM1_DTSEC1,
+       SGMII_2500_FM1_DTSEC2,
+       SGMII_2500_FM1_DTSEC3,
+       SGMII_2500_FM1_DTSEC4,
+       SGMII_2500_FM1_DTSEC5,
+       SGMII_2500_FM1_DTSEC6,
+       SGMII_2500_FM1_DTSEC9,
+       SGMII_2500_FM1_DTSEC10,
+       SGMII_2500_FM2_DTSEC1,
+       SGMII_2500_FM2_DTSEC2,
+       SGMII_2500_FM2_DTSEC3,
+       SGMII_2500_FM2_DTSEC4,
+       SGMII_2500_FM2_DTSEC5,
+       SGMII_2500_FM2_DTSEC6,
+       SGMII_2500_FM2_DTSEC9,
+       SGMII_2500_FM2_DTSEC10,
 };
 
 enum srds {
index b96ba811fa2823f7ac6e021597cb3ccf06995c94..ee1681b5db18ca08d6126bb6c042f5d7e71b79e1 100644 (file)
@@ -392,9 +392,11 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
 
index d3d4c181afad83d3b3dd8d43b449ce90b7d6ff58..c5d161bca3bcc6df2fb228d380e0e2482c2e5d90 100644 (file)
@@ -171,10 +171,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 79d4babe067146fac76fa18a6ed11c8400389000..c5cc4ffa690d9c69f595525b6d9ccc9988f6eb92 100644 (file)
@@ -490,9 +490,9 @@ int misc_init_r(void)
 #endif /* !defined(CONFIG_ARCHES) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-extern void __ft_board_setup(void *blob, bd_t *bd);
+extern int __ft_board_setup(void *blob, bd_t *bd);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        __ft_board_setup(blob, bd);
 
@@ -515,5 +515,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",
                                     "disabled", sizeof("disabled"), 1);
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 53f9b3419faa4961d3eb10a60471ae69edd4cdc4..91c6cbf7aa80d95e2d351940774e9df9f03b7187 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <errno.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/ppc4xx.h>
@@ -363,7 +364,7 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
  * On NAND-booting sequoia, we need to patch the chips select numbers
  * in the dtb (CS0 - NAND, CS3 - NOR)
  */
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
        int len;
@@ -381,15 +382,14 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NOR chip select for NAND booting\n");
-               return;
+               return -FDT_ERR_NOTFOUND;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 3;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NOR mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NOR mappings\n");
+               return rc;
        }
 
        /* And now configure NAND chip select to 0 instead of 3 */
@@ -398,15 +398,16 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NDFC chip select for NAND booting\n");
-               return;
+               return len;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 0;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NDFC mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NDFC mapping\n");
+               return rc;
        }
+
+       return 0;
 }
 #endif /* CONFIG_SYS_RAMBOOT */
index 048aa6c2e914aa806d52d03e7c8b53d0922ab54b..5276907b45ca249ad46f71c13aea47ae5dd4c316 100644 (file)
@@ -359,9 +359,11 @@ int last_stage_init(void)
 
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_blob_update(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 09e285b74db81b34e4e32790cd06887f786fb7dd..84e36439fa18ddf10040043f63abd2fba478562f 100644 (file)
@@ -458,7 +458,7 @@ int cm_fx6_setup_ecspi(void) { return 0; }
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        uint8_t enetaddr[6];
 
@@ -467,6 +467,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/fec", "local-mac-address",
                                     enetaddr, 6, 1);
        }
+
+       return 0;
 }
 #endif
 
index b1a067d8816fddeec015d3652595141040de7077..2c2530ab3fd1e6ce5c3e200276bebaac51daea43 100644 (file)
@@ -121,7 +121,7 @@ int board_mmc_init(bd_t *bis)
 
 #ifdef CONFIG_USB_HOST_ETHER
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        uint8_t enetaddr[6];
 
@@ -130,6 +130,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_find_and_setprop(blob, "/smsc95xx@0", "mac-address",
                                     enetaddr, 6, 1);
        }
+
+       return 0;
 }
 
 static void generate_mac_addr(uint8_t *enetaddr)
index c740669f33ea2ca2c488674454c1bfa13eaa7557..a15a9edac4569a633e002fa00fb2fde26f5be903 100644 (file)
@@ -107,8 +107,10 @@ int checkboard (void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 63cd862d2d2ff6b31dc94042eee924b430cc0c49..e23ec55f2bbeb6018ec6905148ed191229667b3b 100644 (file)
@@ -508,7 +508,7 @@ int pci_pre_init(struct pci_controller *hose)
 #endif /* defined(CONFIG_PCI) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                               fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 97006116f4ed6ee2479a28b2a0b4da3a5f519be0..cda1d7bccc5911b5a471e43c249f150ce08fe16c 100644 (file)
@@ -199,8 +199,10 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 4409ea6524feb0d708af89d540bdd0cec0644069..3e1713247d34c13cb052be830ae5706b529070b9 100644 (file)
@@ -300,7 +300,7 @@ int pci_pre_init(struct pci_controller *hose)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -318,6 +318,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                               fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 062ae67276157e3287a0fdec2bde0fd235281e34..15c3151b8421587947d447504323be366e72efce 100644 (file)
@@ -882,7 +882,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
 
@@ -899,5 +899,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        printf("err=%s\n", fdt_strerror(rc));
                }
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 01365dcbd3aeddd59013340364aed70fa4b79027..f8f1834b59c119a1669fd453ef1eb2360a798a25 100644 (file)
@@ -74,13 +74,15 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 
index 34d66d5fd2dd59891d77288cbaeb39988dc2b12e..bed8f56be43a0adb187e7bd87cdede01b89d6b1f 100644 (file)
@@ -1110,7 +1110,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -1136,6 +1136,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 9146f492626e5a3e378e83d11cb7d5bececca404..75e114217b6a6d94ccd0a7ed7dc4483bb0e8aeca 100644 (file)
@@ -58,7 +58,7 @@ struct node_info nodes[] = {
        { "fsl,ifc-nand",               MTD_DEV_TYPE_NAND, },
 };
 #endif
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -74,5 +74,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
index c88838b3dfac59a7d83e002c222e14128e167b82..36a68dbc4dba95ae0990c9f3a900a4b487f5ee85 100644 (file)
@@ -363,7 +363,7 @@ struct node_info nodes[] = {
        { "fsl,ifc-nand",               MTD_DEV_TYPE_NAND, },
 };
 #endif
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -423,5 +423,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        printf("\nRemove sim from hwconfig and reset\n");
                }
        }
+
+       return 0;
 }
 #endif
index 534c6d11b056034b72e409d6f809aae11aee1468..d75770969b1891f56dea3b077a5e77377999b037 100644 (file)
@@ -128,7 +128,7 @@ void fdt_del_sec(void *blob, int offset)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -150,5 +150,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_del_sec(blob, 1);
        else if (cpu->soc_ver == SVR_C292)
                fdt_del_sec(blob, 2);
+
+       return 0;
 }
 #endif
index 2e5dcdf0e285a00f771e1e8fdec6146a18540915..571dfbbaada6e6607ebd1f416259a2dd43d16470 100644 (file)
@@ -63,13 +63,14 @@ static void cds_pci_fixup(void *blob)
        }
 }
 
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
        cds_pci_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index c9c8eaade233d590c702236b06b70585d98b116b..5cb7570c8b8a82c6bf6233fd753c8b991cdcb689 100644 (file)
@@ -90,7 +90,7 @@ static void show_eeprom(void)
        /* EEPROM tag ID, either CCID or NXID */
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
        printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
-               be32_to_cpu(e.version));
+              e.version);
 #else
        printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
 #endif
@@ -485,7 +485,7 @@ int mac_read_from_eeprom(void)
 
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
        printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
-               be32_to_cpu(e.version));
+              e.version);
 #else
        printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
 #endif
index 65b386741e166c9e0d0c56d69ef7a2a6ba853111..6f0fea1a3566a57c4efb4fec5078149bc767168e 100644 (file)
@@ -190,7 +190,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -213,4 +213,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index 5fafc8567207d3d777f40567dfb90aec92670196..0a7720a001c61c5e8b4a38d422acc767fbc6500a 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "../common/qixis.h"
 #include "ls1021aqds_qixis.h"
+#ifdef CONFIG_U_QE
+#include "../../../drivers/qe/qe.h"
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -137,9 +140,8 @@ int board_early_init_f(void)
        struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
 
 #ifdef CONFIG_TSEC_ENET
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV);
        out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV);
+       out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125);
 #endif
 
 #ifdef CONFIG_FSL_IFC
@@ -230,6 +232,13 @@ 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);
 
@@ -237,12 +246,19 @@ int board_init(void)
        fsl_serdes_init();
        config_serdes_mux();
 #endif
+
+#ifdef CONFIG_U_QE
+       u_qe_init();
+#endif
+
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 
 u8 flash_read8(void *addr)
index 50d564055b173ddd2ee46db63b2797168e7e2544..3e8c37b05d4aeb03fd23b1ab33943004b7ec8070 100644 (file)
 #include <fsl_mdio.h>
 #include <tsec.h>
 #include <fsl_sec.h>
+#ifdef CONFIG_U_QE
+#include "../../../drivers/qe/qe.h"
+#endif
+
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -251,11 +255,8 @@ int board_early_init_f(void)
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
 
 #ifdef CONFIG_TSEC_ENET
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV);
        out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
        out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125);
-       udelay(10);
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV);
 #endif
 
 #ifdef CONFIG_FSL_IFC
@@ -263,9 +264,7 @@ int board_early_init_f(void)
 #endif
 
 #ifdef CONFIG_FSL_DCU_FB
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV);
        out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN);
-       out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV);
 #endif
 
        return 0;
@@ -273,11 +272,25 @@ int board_early_init_f(void)
 
 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();
        config_serdes_mux();
 #endif
 
+#ifdef CONFIG_U_QE
+       u_qe_init();
+#endif
+
        return 0;
 }
 
@@ -290,9 +303,11 @@ int misc_init_r(void)
 }
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 
 u8 flash_read8(void *addr)
index 2c79a7181ecc53db55eb50591470f44e3ea1efc2..163a4c486a6acb03c43b377902af8e2112a8c54d 100644 (file)
@@ -100,7 +100,7 @@ void fdt_fixup_board_enet(void *fdt)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -115,5 +115,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 #endif
index 940978e649e6b6dbe1d44eee5f40c9b70f6d4bc0..40bd55dfba6c6fa8ea27d6959a987f099790a0b9 100644 (file)
@@ -275,8 +275,10 @@ int checkboard (void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 71b760c4a98ee715dea8fe0c2e729167b4236ee3..11747ca4a4ebc037e3be876d3894d84bb5f4b335 100644 (file)
@@ -70,11 +70,12 @@ phys_size_t initdram (int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+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
 
index fba41fe504a7ca616655792ba6860410eb45c4a4..93e1c50f393a0cccbd5a429607eb3b8859382ee5 100644 (file)
@@ -161,11 +161,13 @@ int misc_init_r(void)
        return 0;
 }
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif
 
index 69e98a50074b581761893eae0c1a0ffcb5de77ba..eac193e8177620aa57efe29c249dfb1f921a2410 100644 (file)
@@ -116,12 +116,14 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 #else /* CONFIG_SPL_BUILD */
index e6f091fd2f4c6060d1c1aa9dc0e465c267ecc30b..ed611c56c3f11dc700351c14b38c52746ece3b19 100644 (file)
@@ -188,7 +188,7 @@ void fdt_tsec1_fixup(void *fdt, bd_t *bd)
        do_fixup_by_path(fdt, path, "status", disabled, sizeof(disabled), 1);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
@@ -196,6 +196,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        fdt_fixup_dr_usb(blob, bd);
        fdt_tsec1_fixup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 3dce3623a411acb147d19518a664a141cc246eeb..0a0152ad9ea30969d8c4de54c5fcbe2a495a1c8a 100644 (file)
@@ -172,12 +172,14 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 
index b7ea0e44c39034d991c39da68b6b77f280297b30..adf425486e1edb92e9ccc89a84d245c413fffa51 100644 (file)
@@ -154,11 +154,13 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index d9092201aa549552bd2792a56b070d459f428131..02b5040ef4af177b18f3421bd709e14b3fb48c3f 100644 (file)
@@ -273,11 +273,13 @@ void spi_cs_deactivate(struct spi_slave *slave)
 #endif /* CONFIG_HARD_SPI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index 803d722806046ab3fc296631b6094d0641e9895a..22a1d99c8846ae6bb2115b994f1c90711cd2ed2b 100644 (file)
@@ -378,11 +378,13 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index 5ff9dff5870791aa085426f3f1ebc18c88d22bf0..f0a55f8a8d8c3ef27f61161c1e2741dffe864432 100644 (file)
@@ -402,7 +402,7 @@ static void ft_board_fixup_qe_usb(void *blob, bd_t *bd)
                           "peripheral", sizeof("peripheral"), 1);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
@@ -447,5 +447,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
                }
        }
+
+       return 0;
 }
 #endif
index fef230bfbd5683bead9042b7cd13ceec08f302c9..478f8205a9c780bcdfa40334a3b3f90584d0d2a9 100644 (file)
@@ -340,9 +340,11 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_pci_setup(blob, bd);
+
+       return 0;
 }
 #endif
index c749e5553a785c115a4571752048ca645bb22057..572913c7ac521ce1f55758079bf49ea6a2ec031f 100644 (file)
@@ -328,7 +328,7 @@ static void ft_pci_fixup(void *blob, bd_t *bd)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_tsec_fixup(blob, bd);
@@ -340,5 +340,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                ft_pci_fixup(blob, bd);
        ft_pcie_fixup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 9afdcaf7aefbbd18f361d3f4e39016eb2a5f881e..e0a10313808d519206eb5b0df1f827973cff4152 100644 (file)
@@ -199,7 +199,7 @@ int misc_init_r(void)
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
@@ -207,5 +207,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 93eed59b1a95b23dda37ec20c2b06798bf9604ae..7b0f46197147b36db16cd790aad7a253663da687 100644 (file)
@@ -271,7 +271,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
@@ -285,5 +285,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_dr_usb(blob, bd);
 #endif
 
+       return 0;
 }
 #endif
index 93288c7e9ce0252f8a7ee1ecdaa3b2e9f9153919..1069e2c8c86b803d29cd997bfc638b3314ddf160 100644 (file)
@@ -218,8 +218,7 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int node, tmp[2];
        const char *path;
@@ -237,5 +236,7 @@ ft_board_setup(void *blob, bd_t *bd)
                }
 #endif
        }
+
+       return 0;
 }
 #endif
index 1b33db6f31448b58651ebb5d8971f2f1f4caccf4..66fb228a908943fced11e9d2178e4d112658ca8b 100644 (file)
@@ -305,7 +305,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
@@ -314,5 +314,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index 7104e33156efc2f7918b301bec24d23deebe8352..f99d639b2fbfda636c3dfa5b42c5642d15958b12 100644 (file)
@@ -438,8 +438,7 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int node, tmp[2];
        const char *path;
@@ -457,5 +456,7 @@ ft_board_setup(void *blob, bd_t *bd)
                }
 #endif
        }
+
+       return 0;
 }
 #endif
index a8fdcb5f917704ab824b9cde76a74bc578c7d012..a5c5d9dd1acae394921b1fe9fedd455fc5fd5385 100644 (file)
@@ -345,10 +345,12 @@ void pci_init_board(void)
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
index cb55e1c98c0dba1059bbd8afad4157d5456aec06..836578f3cb827935fefd7b0acff3aafb1e6f1ce0 100644 (file)
@@ -514,7 +514,7 @@ void pci_init_board(void)
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #if defined(CONFIG_SYS_UCC_RMII_MODE)
        int nodeoff, off, err;
@@ -579,5 +579,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_board_fixup_esdhc(blob, bd);
        fdt_board_fixup_qe_uart(blob, bd);
        fdt_board_fixup_qe_usb(blob, bd);
+
+       return 0;
 }
 #endif
index 1bbf83214873d35a41974dddca61f6c9d8de3181..3f68cf496a45487e3c0888cb5d8f78adf1876c20 100644 (file)
@@ -232,7 +232,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -249,5 +249,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index d8740ddaccf4e22e0ee783f63d40e53e96dc4c5f..95e398c9f4958d540026648638c2de16029e7c44 100644 (file)
@@ -258,12 +258,13 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index a58b5f9cd4bc8e178a17451765dc3636ece2345a..94633b5c99dcc38334c939e24524d14ea1b4ed14 100644 (file)
@@ -119,12 +119,11 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int off;
        u64 *tmp;
-       u32 *addrcells;
+       int addrcells;
 
        ft_cpu_setup(blob, bd);
 
@@ -136,12 +135,13 @@ ft_board_setup(void *blob, bd_t *bd)
         * which is defined by the "reg" property in the soc node.
         */
        off = fdt_path_offset(blob, "/soc8641");
-       addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL);
+       addrcells = fdt_address_cells(blob, 0);
        tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);
 
        if (tmp) {
                u64 addr;
-               if (addrcells && (*addrcells == 1))
+
+               if (addrcells == 1)
                        addr = *(u32 *)tmp;
                else
                        addr = *tmp;
@@ -152,6 +152,8 @@ ft_board_setup(void *blob, bd_t *bd)
                               "in u-boot.  This means your .dts might "
                               "be old.\n");
        }
+
+       return 0;
 }
 #endif
 
index 491b576258cd7f972bb81df4ef22e677bfa04497..1cf0ab78b71fe992ab454b65d3531f0a3a92a43f 100644 (file)
@@ -444,7 +444,7 @@ void fdt_disable_uart1(void *blob)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -496,6 +496,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                fdt_del_flexcan(blob);
                fdt_disable_uart1(blob);
        }
+
+       return 0;
 }
 #endif
 
index f5e18515a0f867b511bf66a0ce24582c8e453ed1..d7dd478dff903f6d0495ae1939b2f1a6aed78b84 100644 (file)
@@ -332,7 +332,7 @@ static void ft_codec_setup(void *blob, const char *compatible)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -356,5 +356,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        /* Update the WM8776 node's clock frequency property */
        ft_codec_setup(blob, "wlf,wm8776");
+
+       return 0;
 }
 #endif
index d4d277ba6d3c1ba866a1a1a8dfdd0f551167625f..56f561a50582f6d76b0e61ee2db540d0709bc970 100644 (file)
@@ -130,7 +130,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -147,5 +147,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_fman_ethernet(blob);
+
+       return 0;
 }
 #endif
index aba4f534b8655b5d532dd36e2086328013cbcc84..61ed466fa7f7e421550ed1b60116792cb0686434 100644 (file)
@@ -234,7 +234,7 @@ int board_eth_init(bd_t *bis)
 #if defined(CONFIG_OF_BOARD_SETUP)
 extern void ft_pci_board_setup(void *blob);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        const char *soc_usb_compat = "fsl-usb2-dr";
        int err, usb1_off, usb2_off;
@@ -263,39 +263,41 @@ void ft_board_setup(void *blob, bd_t *bd)
                int off = fdt_node_offset_by_compatible(blob, -1,
                        soc_elbc_compat);
                if (off < 0) {
-                       printf("WARNING: could not find compatible node"
-                               " %s: %s.\n", soc_elbc_compat,
-                               fdt_strerror(off));
-                               return;
+                       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: %s.\n",
-                               soc_elbc_compat, fdt_strerror(err));
+                       printf("WARNING: could not remove %s\n",
+                              soc_elbc_compat);
+                       return err;
                }
-               return;
+               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: %s.\n", soc_usb_compat,
-                       fdt_strerror(usb1_off));
-               return;
+               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: %s.\n", soc_usb_compat,
-                       fdt_strerror(usb2_off));
-               return;
+               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: %s.\n",
-                       soc_usb_compat, fdt_strerror(err));
+       if (err < 0) {
+               printf("WARNING: could not remove %s\n", soc_usb_compat);
+               return err;
+       }
+
+       return 0;
 }
+
 #endif
index a6756c68f40f3698a330249299a13b3bb9317a95..3f47cfbb82aa3e9b2b547a31feaa0ea39d18f44b 100644 (file)
@@ -424,7 +424,7 @@ static void fdt_board_fixup_qe_pins(void *blob)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -459,17 +459,17 @@ void ft_board_setup(void *blob, bd_t *bd)
                int off = fdt_node_offset_by_compatible(blob, -1,
                                soc_elbc_compat);
                if (off < 0) {
-                       printf("WARNING: could not find compatible node %s: %s.\n",
-                              soc_elbc_compat,
-                              fdt_strerror(off));
-                               return;
+                       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: %s.\n",
-                              soc_elbc_compat, fdt_strerror(err));
+                       printf("WARNING: could not remove %s\n",
+                              soc_elbc_compat);
+                       return err;
                }
-               return;
+               return 0;
        }
 #endif
 
@@ -477,24 +477,23 @@ void ft_board_setup(void *blob, bd_t *bd)
        usb1_off = fdt_node_offset_by_compatible(blob, -1,
                soc_usb_compat);
        if (usb1_off < 0) {
-               printf("WARNING: could not find compatible node %s: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb1_off));
-               return;
+               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: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb2_off));
-               return;
+               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: %s.\n",
-                      soc_usb_compat, fdt_strerror(err));
+               printf("WARNING: could not remove %s\n", soc_usb_compat);
+               return err;
        }
 
+       return 0;
 }
 #endif
index a0a416ba17667784044ab961376ce1532830dd11..a40bea328b02154a0ffa925c32c86f72cc538d80 100644 (file)
@@ -261,7 +261,7 @@ static void fdt_board_fixup_qe_pins(void *blob)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -283,5 +283,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_board_fixup_qe_pins(blob);
 #endif
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
index f777bb9d679d45237a5481346ee74b5a14d5e369..1db37e3be8e4d0ad856c5ac142939741f3e0c361 100644 (file)
@@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -269,5 +269,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_HAS_FSL_DR_USB
        fdt_fixup_dr_usb(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index b72fcffdd08dd9e579ae901a50902ff9e328692a..5d18e8de75a3de7384847c36ed02d5426b4aa6d2 100644 (file)
@@ -236,7 +236,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -257,5 +257,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_SGMII_RISER
        fsl_sgmii_riser_fdt_fixup(blob);
 #endif
+
+       return 0;
 }
 #endif
index a14b43b5a503e4a272e7e6baab96e37ce858467c..e600bdbc2a87a38ab014d268aac95cbcfd733ed3 100644 (file)
@@ -215,7 +215,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -239,4 +239,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
        fdt_fixup_fman_ethernet(blob);
 #endif
+
+       return 0;
 }
index 230870d90e442d2d1ac7c6730218bfe725467116..a0fca0d88083105e07a71cb4cccd23ed0751f325 100644 (file)
@@ -235,9 +235,11 @@ int board_eth_init(bd_t *bis)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index 19af46e48fdb1ba15a7d828cf40fdd49eb577f28..13285be42cf394a3b711e24a79cf8df969319286 100644 (file)
@@ -233,7 +233,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -259,6 +259,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 void qixis_dump_switch(void)
index ddb669fb06c9b8b5e982863477395f9eb971571a..4734f9dd93b17faf924661fc1a16efcd82214461 100644 (file)
@@ -85,7 +85,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -110,6 +110,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
        fdt_fixup_fman_ethernet(blob);
 #endif
+
+       return 0;
 }
 
 #ifdef CONFIG_DEEP_SLEEP
diff --git a/board/freescale/t208xqds/README b/board/freescale/t208xqds/README
new file mode 100755 (executable)
index 0000000..83060c1
--- /dev/null
@@ -0,0 +1,274 @@
+The T2080QDS is a high-performance computing evaluation, development and
+test platform supporting the T2080 QorIQ Power Architecture processor.
+
+T2080 SoC Overview
+------------------
+The T2080 QorIQ multicore processor combines four dual-threaded e6500 Power
+Architecture processor cores with high-performance datapath acceleration
+logic and network and peripheral bus interfaces required for networking,
+telecom/datacom, wireless infrastructure, and mil/aerospace applications.
+
+T2080 includes the following functions and features:
+ - Four dual-threads 64-bit Power architecture e6500 cores, up to 1.8GHz
+ - 2MB L2 cache and 512KB CoreNet platform cache (CPC)
+ - Hierarchical interconnect fabric
+ - One 32-/64-bit DDR3/3L SDRAM memory controllers with ECC and interleaving
+ - Data Path Acceleration Architecture (DPAA) incorporating acceleration
+ - 16 SerDes lanes up to 10.3125 GHz
+ - 8 Ethernet interfaces, supporting combinations of the following:
+   - Up to four 10 Gbps Ethernet MACs
+   - Up to eight 1 Gbps Ethernet MACs
+   - Up to four 2.5 Gbps Ethernet MACs
+ - High-speed peripheral interfaces
+   - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0 with SR-IOV)
+   - Two Serial RapidIO 2.0 controllers/ports running at up to 5 GHz
+ - Additional peripheral interfaces
+   - Two serial ATA (SATA 2.0) controllers
+   - Two high-speed USB 2.0 controllers with integrated PHY
+   - Enhanced secure digital host controller (SD/SDHC/SDXC/eMMC)
+   - Enhanced serial peripheral interface (eSPI)
+   - Four I2C controllers
+   - Four 2-pin UARTs or two 4-pin UARTs
+   - Integrated Flash Controller supporting NAND and NOR flash
+ - Three eight-channel DMA engines
+ - Support for hardware virtualization and partitioning enforcement
+ - QorIQ Platform's Trust Architecture 2.0
+
+Differences between T2080 and T2081
+-----------------------------------
+  Feature              T2080    T2081
+  1G Ethernet numbers:  8       6
+  10G Ethernet numbers: 4       2
+  SerDes lanes:                16       8
+  Serial RapidIO,RMan:  2       no
+  SATA Controller:     2        no
+  Aurora:              yes      no
+  SoC Package:         896-pins 780-pins
+
+
+T2080QDS feature overview
+-------------------------
+Processor:
+ - T2080 SoC integrating four 64-bit dual-threads e6500 cores up to 1.8GHz
+Memory:
+ - Single memory controller capable of supporting DDR3 and DDR3-LV devices
+ - Two DDR3 DIMMs up to 4GB, Dual rank @ 2133MT/s and ECC support
+Ethernet interfaces:
+ - Two 1Gbps RGMII on-board ports
+ - Four 10Gbps XFI on-board cages
+ - 1Gbps/2.5Gbps SGMII Riser card
+ - 10Gbps XAUI Riser card
+Accelerator:
+ - DPAA components consist of FMan, BMan, QMan, PME, DCE and SEC
+SerDes:
+ - 16 lanes up to 10.3125GHz
+ - Supports Aurora debug, PEX, SATA, SGMII, sRIO, HiGig, XFI and XAUI
+IFC:
+ - 128MB NOR Flash, 512MB NAND Flash, PromJet debug port and FPGA
+eSPI:
+ - Three SPI flash (16MB N25Q128A + 16MB EN25S64 + 512KB SST25WF040)
+USB:
+ - Two USB2.0 ports with internal PHY (one Type-A + one micro Type-AB)
+PCIE:
+ - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0 with SR-IOV)
+SATA:
+ - Two SATA 2.0 ports on-board
+SRIO:
+ - Two Serial RapidIO 2.0 ports up to 5 GHz
+eSDHC:
+ - Supports SD/SDHC/SDXC/eMMC Card
+I2C:
+ - Four I2C controllers.
+UART:
+ - Dual 4-pins UART serial ports
+System Logic:
+ - QIXIS-II FPGA system controll
+Debug Features:
+ - Support Legacy, COP/JTAG, Aurora, Event and EVT
+XFI:
+ - XFI is supported on T2080QDS through Lane A/B/C/D on Serdes 1 routed to
+ a on-board SFP+ cages, which to house optical module (fiber cable) or
+ direct attach cable(copper), the copper cable is used to emulate
+ 10GBASE-KR scenario.
+ So, for XFI usage, there are two scenarios, one will use fiber cable,
+ another will use copper cable. An hwconfig env "fsl_10gkr_copper" is
+ introduced to indicate a XFI port will use copper cable, and U-boot
+ will fixup the dtb accordingly.
+ It's used as: fsl_10gkr_copper:<10g_mac_name>
+ The <10g_mac_name> can be fm1_10g1, fm1_10g2, fm1_10g3, fm1_10g4, they
+ do not have to be coexist in hwconfig. If a MAC is listed in the env
+ "fsl_10gkr_copper", it will use copper cable, otherwise, fiber cable
+ will be used by default.
+ for ex. set "fsl_10gkr_copper:fm1_10g1,fm1_10g2,fm1_10g3,fm1_10g4" in
+ hwconfig, then both four XFI ports will use copper cable.
+ set "fsl_10gkr_copper:fm1_10g1,fm1_10g2" in hwconfig, then first two
+ XFI ports will use copper cable, the other two XFI ports will use fiber
+ cable.
+1000BASE-KX(1G-KX):
+ - T2080QDS can support 1G-KX by using SGMII protocol, but serdes lane
+ runs in 1G-KX mode. By default, the lane runs in SGMII mode, to set a lane
+ in 1G-KX mode, need to set corresponding bit in SerDes Protocol Configuration
+ Register 1 (PCCR1), and U-boot fixup the dtb for kernel to do proper
+ initialization.
+ Hwconfig "fsl_1gkx" is used to indicate a lane runs in 1G-KX mode, MAC
+ 1/2/5/6/9/10 are available for 1G-KX, MAC 3/4 run in RGMII mode. To set a
+ MAC to use 1G-KX mode, set its' corresponding env in "fsl_1gkx", 'fm1_1g1'
+ stands for MAC 1, 'fm1_1g2' stands for MAC 2, etc.
+ For ex. set "fsl_1gkx:fm1_1g1,fm1_1g2,fm1_1g5,fm1_1g6,fm1_1g9,fm1_1g10" in
+ hwconfig, MAC 1/2/5/6/9/10 will use 1G-KX mode.
+
+System Memory map
+----------------
+
+Start Address  End Address      Description                    Size
+0xF_FFDF_0000  0xF_FFDF_0FFF    IFC - CPLD                     4KB
+0xF_FF80_0000  0xF_FF80_FFFF    IFC - NAND Flash               64KB
+0xF_FE00_0000  0xF_FEFF_FFFF    CCSRBAR                                16MB
+0xF_F803_0000  0xF_F803_FFFF    PCI Express 4 I/O Space                64KB
+0xF_F802_0000  0xF_F802_FFFF    PCI Express 3 I/O Space                64KB
+0xF_F801_0000  0xF_F801_FFFF    PCI Express 2 I/O Space                64KB
+0xF_F800_0000  0xF_F800_FFFF    PCI Express 1 I/O Space                64KB
+0xF_F600_0000  0xF_F7FF_FFFF    Queue manager software portal  32MB
+0xF_F400_0000  0xF_F5FF_FFFF    Buffer manager software portal 32MB
+0xF_E800_0000  0xF_EFFF_FFFF    IFC - NOR Flash                        128MB
+0xF_0000_0000  0xF_003F_FFFF    DCSR                           4MB
+0xC_4000_0000  0xC_4FFF_FFFF    PCI Express 4 Mem Space                256MB
+0xC_3000_0000  0xC_3FFF_FFFF    PCI Express 3 Mem Space                256MB
+0xC_2000_0000  0xC_2FFF_FFFF    PCI Express 2 Mem Space                256MB
+0xC_0000_0000  0xC_1FFF_FFFF    PCI Express 1 Mem Space                512MB
+0x0_0000_0000  0x0_ffff_ffff    DDR                            4GB
+
+
+128M NOR Flash memory Map
+-------------------------
+Start Address   End Address    Definition                      Max size
+0xEFF40000     0xEFFFFFFF      u-boot (current bank)           768KB
+0xEFF20000     0xEFF3FFFF      u-boot env (current bank)       128KB
+0xEFF00000     0xEFF1FFFF      FMAN Ucode (current bank)       128KB
+0xED300000     0xEFEFFFFF      rootfs (alt bank)               44MB
+0xEC800000     0xEC8FFFFF      Hardware device tree (alt bank) 1MB
+0xEC020000     0xEC7FFFFF      Linux.uImage (alt bank)         7MB + 875KB
+0xEC000000     0xEC01FFFF      RCW (alt bank)                  128KB
+0xEBF40000     0xEBFFFFFF      u-boot (alt bank)               768KB
+0xEBF20000     0xEBF3FFFF      u-boot env (alt bank)           128KB
+0xEBF00000     0xEBF1FFFF      FMAN ucode (alt bank)           128KB
+0xE9300000     0xEBEFFFFF      rootfs (current bank)           44MB
+0xE8800000     0xE88FFFFF      Hardware device tree (cur bank) 1MB
+0xE8020000     0xE86FFFFF      Linux.uImage (current bank)     7MB + 875KB
+0xE8000000     0xE801FFFF      RCW (current bank)              128KB
+
+
+
+Software configurations and board settings
+------------------------------------------
+1. NOR boot:
+   a. build NOR boot image
+       $  make T2080QDS_config
+       $  make
+   b. program u-boot.bin image to NOR flash
+       => tftp 1000000 u-boot.bin
+       => pro off all;era eff40000 efffffff;cp.b 1000000 eff40000 $filesize
+       set SW1[1:8] = '00010011', SW2[1] = '1', SW6[1:4] = '0000' for NOR boot
+
+   Switching between default bank0 and alternate bank4 on NOR flash
+   To change boot source to vbank4:
+       by software:   run command 'qixis_reset altbank' in u-boot.
+       by DIP-switch: set SW6[1:4] = '0100'
+
+   To change boot source to vbank0:
+       by software:   run command 'qixis_reset' in u-boot.
+       by DIP-Switch: set SW6[1:4] = '0000'
+
+2. NAND Boot:
+   a. build PBL image for NAND boot
+       $ make T2080QDS_NAND_config
+       $ make
+   b. program u-boot-with-spl-pbl.bin to NAND flash
+       => tftp 1000000 u-boot-with-spl-pbl.bin
+       => nand erase 0 $filesize
+       => nand write 1000000 0 $filesize
+       set SW1[1:8] = '10000010', SW2[1] = '0' and SW6[1:4] = '1001' for NAND boot
+
+3. SPI Boot:
+   a. build PBL image for SPI boot
+       $ make T2080QDS_SPIFLASH_config
+       $ make
+   b. program u-boot-with-spl-pbl.bin to SPI flash
+       => tftp 1000000 u-boot-with-spl-pbl.bin
+       => sf probe 0
+       => sf erase 0 f0000
+       => sf write 1000000 0 $filesize
+       set SW1[1:8] = '00100010', SW2[1] ='1' for SPI boot
+
+4. SD Boot:
+   a. build PBL image for SD boot
+       $ make T2080QDS_SDCARD_config
+       $ make
+   b. program u-boot-with-spl-pbl.bin to SD/MMC card
+       => tftp 1000000 u-boot-with-spl-pbl.bin
+       => mmc write 1000000 8 0x800
+       => tftp 1000000 fsl_fman_ucode_T2080_xx.bin
+       => mmc write 1000000 0x820 80
+       set SW1[1:8] = '00100000', SW2[1] = '0' for SD boot
+
+
+2-stage NAND/SPI/SD boot loader
+-------------------------------
+PBL initializes the internal CPC-SRAM and copy SPL(160K) to SRAM.
+SPL further initializes DDR using SPD and environment variables
+and copy u-boot(768 KB) from NAND/SPI/SD device to DDR.
+Finally SPL transers control to u-boot for futher booting.
+
+SPL has following features:
+ - Executes within 256K
+ - No relocation required
+
+Run time view of SPL framework
+-------------------------------------------------
+|Area             | Address                    |
+-------------------------------------------------
+|SecureBoot header | 0xFFFC0000 (32KB)         |
+-------------------------------------------------
+|GD, BD                   | 0xFFFC8000 (4KB)           |
+-------------------------------------------------
+|ENV              | 0xFFFC9000 (8KB)           |
+-------------------------------------------------
+|HEAP             | 0xFFFCB000 (50KB)          |
+-------------------------------------------------
+|STACK            | 0xFFFD8000 (22KB)          |
+-------------------------------------------------
+|U-boot SPL       | 0xFFFD8000 (160KB)         |
+-------------------------------------------------
+
+NAND Flash memory Map on T2080QDS
+--------------------------------------------------------------
+Start          End             Definition      Size
+0x000000       0x0FFFFF        u-boot img      1MB  (2 blocks)
+0x100000       0x17FFFF        u-boot env      512KB (1 block)
+0x180000       0x1FFFFF        FMAN ucode      512KB (1 block)
+
+
+Micro SD Card memory Map on T2080QDS
+----------------------------------------------------
+Block          #blocks         Definition      Size
+0x008          2048            u-boot img      1MB
+0x800          0016            u-boot env      8KB
+0x820          0128            FMAN ucode      64KB
+
+
+SPI Flash memory Map on T2080QDS
+----------------------------------------------------
+Start          End             Definition      Size
+0x000000       0x0FFFFF        u-boot img      1MB
+0x100000       0x101FFF        u-boot env      8KB
+0x110000       0x11FFFF        FMAN ucode      64KB
+
+
+How to update the ucode of Freescale FMAN
+-----------------------------------------
+=> tftp 1000000 fsl_fman_ucode_t2080_xx.bin
+=> pro off all;erase 0xeff00000 0xeff1ffff;cp 1000000 0xeff00000 $filesize
+
+
+For more details, please refer to T2080QDS User Guide and access
+website www.freescale.com and Freescale QorIQ SDK Infocenter document.
index 5879198e4d34181e43ab3f2ca1838ac839c21b3f..b82e9e7540208e49da8311805b563850d5b0e44d 100644 (file)
@@ -23,6 +23,7 @@
 #include <phy.h>
 #include <asm/fsl_dtsec.h>
 #include <asm/fsl_serdes.h>
+#include <hwconfig.h>
 #include "../common/qixis.h"
 #include "../common/fman.h"
 #include "t208xqds_qixis.h"
 #define EMI2           8
 #endif
 
+#define PCCR1_SGMIIA_KX_MASK           0x00008000
+#define PCCR1_SGMIIB_KX_MASK           0x00004000
+#define PCCR1_SGMIIC_KX_MASK           0x00002000
+#define PCCR1_SGMIID_KX_MASK           0x00001000
+#define PCCR1_SGMIIE_KX_MASK           0x00000800
+#define PCCR1_SGMIIF_KX_MASK           0x00000400
+#define PCCR1_SGMIIG_KX_MASK           0x00000200
+#define PCCR1_SGMIIH_KX_MASK           0x00000100
+
 static int mdio_mux[NUM_FM_PORTS];
 
 static const char * const mdio_names[] = {
@@ -187,8 +197,18 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
 {
        int phy;
        char alias[20];
+       char lane_mode[2][20] = {"1000BASE-KX", "10GBASE-KR"};
+       char buf[32] = "serdes-1,";
        struct fixed_link f_link;
+       int media_type = 0;
+       int off;
+
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#ifdef CONFIG_T2080QDS
+       serdes_corenet_t *srds_regs =
+               (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+       u32 srds1_pccr1 = in_be32(&srds_regs->srdspccr1);
+#endif
        u32 srds_s1 = in_be32(&gur->rcwsr[4]) &
                                FSL_CORENET2_RCWSR4_SRDS1_PRTCL;
 
@@ -199,9 +219,54 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                switch (port) {
 #if defined(CONFIG_T2080QDS)
                case FM1_DTSEC1:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g1")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx1");
+                               fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio1");
+                               sprintf(buf, "%s%s%s", buf, "lane-c,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIIH_KX_MASK);
+                               break;
+                       }
                case FM1_DTSEC2:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g2")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx2");
+                               fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio2");
+                               sprintf(buf, "%s%s%s", buf, "lane-d,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIIG_KX_MASK);
+                               break;
+                       }
                case FM1_DTSEC9:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g9")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx9");
+                               fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio9");
+                               sprintf(buf, "%s%s%s", buf, "lane-a,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIIE_KX_MASK);
+                               break;
+                       }
                case FM1_DTSEC10:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g10")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx10");
+                               fdt_status_okay_by_alias(fdt,
+                                                        "1gkx_pcs_mdio10");
+                               sprintf(buf, "%s%s%s", buf, "lane-b,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIIF_KX_MASK);
+                               break;
+                       }
                        if (mdio_mux[port] == EMI1_SLOT2) {
                                sprintf(alias, "phy_sgmii_s2_%x", phy);
                                fdt_set_phy_handle(fdt, compat, addr, alias);
@@ -213,7 +278,29 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                        }
                        break;
                case FM1_DTSEC5:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g5")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx5");
+                               fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio5");
+                               sprintf(buf, "%s%s%s", buf, "lane-g,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIIC_KX_MASK);
+                               break;
+                       }
                case FM1_DTSEC6:
+                       if (hwconfig_sub("fsl_1gkx", "fm1_1g6")) {
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                                  "phy_1gkx6");
+                               fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio6");
+                               sprintf(buf, "%s%s%s", buf, "lane-h,",
+                                               (char *)lane_mode[0]);
+                               out_be32(&srds_regs->srdspccr1, srds1_pccr1 |
+                                        PCCR1_SGMIID_KX_MASK);
+                               break;
+                       }
                        if (mdio_mux[port] == EMI1_SLOT1) {
                                sprintf(alias, "phy_sgmii_s1_%x", phy);
                                fdt_set_phy_handle(fdt, compat, addr, alias);
@@ -257,6 +344,12 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                default:
                        break;
                }
+               if (media_type) {
+                       /* set property for 1000BASE-KX in dtb */
+                       off = fdt_node_offset_by_compat_reg(fdt,
+                                       "fsl,fman-memac-mdio", addr + 0x1000);
+                       fdt_setprop_string(fdt, off, "lane-instance", buf);
+               }
 
        } else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_XGMII) {
                switch (srds_s1) {
@@ -265,15 +358,77 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                case 0x6c:
                case 0x6d:
                case 0x71:
-                       f_link.phy_id = port;
-                       f_link.duplex = 1;
-                       f_link.link_speed = 10000;
-                       f_link.pause = 0;
-                       f_link.asym_pause = 0;
-                       /* no PHY for XFI */
-                       fdt_delprop(fdt, offset, "phy-handle");
-                       fdt_setprop(fdt, offset, "fixed-link", &f_link,
-                                   sizeof(f_link));
+                       /*
+                       * if the 10G is XFI, check hwconfig to see what is the
+                       * media type, there are two types, fiber or copper,
+                       * fix the dtb accordingly.
+                       */
+                       switch (port) {
+                       case FM1_10GEC1:
+                       if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g1")) {
+                               /* it's MAC9 */
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                               "phy_xfi9");
+                               fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio9");
+                               sprintf(buf, "%s%s%s", buf, "lane-a,",
+                                               (char *)lane_mode[1]);
+                       }
+                               break;
+                       case FM1_10GEC2:
+                       if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g2")) {
+                               /* it's MAC10 */
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                               "phy_xfi10");
+                               fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio10");
+                               sprintf(buf, "%s%s%s", buf, "lane-b,",
+                                               (char *)lane_mode[1]);
+                       }
+                               break;
+                       case FM1_10GEC3:
+                       if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g3")) {
+                               /* it's MAC1 */
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                               "phy_xfi1");
+                               fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio1");
+                               sprintf(buf, "%s%s%s", buf, "lane-c,",
+                                               (char *)lane_mode[1]);
+                       }
+                               break;
+                       case FM1_10GEC4:
+                       if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g4")) {
+                               /* it's MAC2 */
+                               media_type = 1;
+                               fdt_set_phy_handle(fdt, compat, addr,
+                                               "phy_xfi2");
+                               fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio2");
+                               sprintf(buf, "%s%s%s", buf, "lane-d,",
+                                               (char *)lane_mode[1]);
+                       }
+                               break;
+                       default:
+                               return;
+                       }
+
+                       if (!media_type) {
+                               /* fixed-link is used for XFI fiber cable */
+                               f_link.phy_id = port;
+                               f_link.duplex = 1;
+                               f_link.link_speed = 10000;
+                               f_link.pause = 0;
+                               f_link.asym_pause = 0;
+                               fdt_delprop(fdt, offset, "phy-handle");
+                               fdt_setprop(fdt, offset, "fixed-link", &f_link,
+                                       sizeof(f_link));
+                       } else {
+                               /* set property for copper cable */
+                               off = fdt_node_offset_by_compat_reg(fdt,
+                                       "fsl,fman-memac-mdio", addr + 0x1000);
+                               fdt_setprop_string(fdt, off,
+                                       "lane-instance", buf);
+                       }
                        break;
                default:
                        break;
index fc6d25611171603fb1963c58392270b3dbffd5da..5c470c3a497123abc79c8bb92664908dc73ca5e0 100644 (file)
@@ -437,7 +437,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -460,4 +460,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index be99fb806dd73648918bd8eaf829912f4b85fb4e..341453bc74e8c6b9d434fd264edccd4b9e1e5ab6 100644 (file)
@@ -103,7 +103,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -126,4 +126,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
index 479e124a3969d13f9b2bc6b5c95dc44827267529..54410943f28123b693480bd32ff6873181de6942 100644 (file)
@@ -69,7 +69,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -83,4 +83,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        fdt_fixup_liodn(blob);
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
index 6205fea35e72dc9fbaad6ec18e567997212c7d7d..4f2cccd709d6554dbda9fd30e432265fb9b3e0b2 100644 (file)
@@ -683,7 +683,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -706,6 +706,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 2ff77b8487313d0862adbd5df93d85edd0a0fec0..fac442bfc8c8e9ab68eda0a9be8ad5fb74914a28 100644 (file)
@@ -88,7 +88,7 @@ int misc_init_r(void)
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -111,6 +111,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 /*
index 29e40eb58aafb78379913168cbe461216f7a04d3..5d957b7e70f032eedfe3fd7aef88cb8b98e184c9 100644 (file)
@@ -146,9 +146,11 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index df491a8fc8869afc5a531302a315f5fc713c51d2..bb08cd272ef28b439326c3c63499f87a58788e8e 100644 (file)
@@ -1483,7 +1483,7 @@ int misc_init_r(void)
  *  - board (full model from EEPROM)
  *  - peripherals removed from DTB if not loaded on board (per EEPROM config)
  */
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        struct ventana_board_info *info = &ventana_info;
        struct ventana_eeprom_config *cfg;
@@ -1495,7 +1495,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        if (getenv("fdt_noauto")) {
                puts("   Skiping ft_board_setup (fdt_noauto defined)\n");
-               return;
+               return 0;
        }
 
        /* Update partition nodes using info from mtdparts env var */
@@ -1504,7 +1504,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        if (!model) {
                puts("invalid board info: Leaving FDT fully enabled\n");
-               return;
+               return 0;
        }
        printf("   Adjusting FDT per EEPROM for %s...\n", model);
 
@@ -1523,7 +1523,7 @@ void ft_board_setup(void *blob, bd_t *bd)
         */
        if (getenv("fdt_noconfig")) {
                puts("   Skiping periperhal config (fdt_noconfig defined)\n");
-               return;
+               return 0;
        }
        cfg = econfig;
        while (cfg->name) {
@@ -1533,6 +1533,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                }
                cfg++;
        }
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
 
index ee6f9e06c354d526534fd542e287a2e281b376cc..8d01d8b116f510a3181c614277302f95f080f4c8 100644 (file)
@@ -206,7 +206,7 @@ int misc_init_r(void)
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 extern void __ft_board_setup(void *blob, bd_t *bd);
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        __ft_board_setup(blob, bd);
 
@@ -215,5 +215,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 
        fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",
                             "disabled", sizeof("disabled"), 1);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a0516824bc61f482287f6b8c82dd059c972ed025..e4434b3b6b71c483588010783b0f2261ec997d76 100644 (file)
@@ -531,11 +531,13 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
        fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif
 
index f76d968962711a5612633b13a24b54d8ca826390..64d90dd3fde076ae2d88c82c57fcb5c484db1d50 100644 (file)
@@ -326,7 +326,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -343,6 +343,8 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index a1b67494f6c526d6659a75f460c050d58f196978..fc2385cf31a527a7225abe142928edbc6aa4939e 100644 (file)
@@ -94,7 +94,7 @@ void dram_init_banksize(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *fdt, bd_t *bd)
+int ft_board_setup(void *fdt, bd_t *bd)
 {
        static const char disabled[] = "disabled";
        u32 reg = readl(HB_SREG_A9_PWRDOM_STAT);
@@ -106,6 +106,8 @@ void ft_board_setup(void *fdt, bd_t *bd)
        if (!(reg & PWRDOM_STAT_EMMC))
                do_fixup_by_compat(fdt, "calxeda,hb-sdhci", "status",
                        disabled, sizeof(disabled), 1);
+
+       return 0;
 }
 #endif
 
index a99416b3aaf211e79ff784be6ce00e08bdcb1824..f0af24ad9bd7d36ab054cdf38ed8fa5907823f94 100644 (file)
@@ -311,10 +311,11 @@ void ide_set_reset (int idereset)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index f742143bb9de1d6b94accd6f1f6758a230ab23fd..e7838dcd2a6e73e3c1af7318e78d72129f6c8c34 100644 (file)
@@ -138,9 +138,11 @@ phys_size_t initdram(int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 0fbdfdbf71a3af6a69e1822ec8e70f7929cd71e7..5d2ab2fad3ca0218261c3987d9d09f795accf5bc 100644 (file)
@@ -608,8 +608,10 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 6716ffc9d0e09c9c53d3d0c8d12e44c72f90964b..ca09767d287b6b366033c39d5d3d13862ea4405f 100644 (file)
@@ -364,7 +364,7 @@ int update_flash_size(int flash_size)
 }
 #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int phy_addr = CONFIG_PHY_ADDR;
        char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0";
@@ -380,5 +380,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        /* fix up the phy address */
        do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 584372521b43b58436fdbb13a80185f25ea97657..4ab71609c0363c760a30a2828505ee902683ad2f 100644 (file)
@@ -454,7 +454,7 @@ int update_flash_size (int flash_size)
 }
 #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int phy_addr = CONFIG_PHY_ADDR;
        char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0";
@@ -478,5 +478,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
        /* fix up the phy address */
        do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index d44c4bf6695bc9a8b9edd94279d6baff477b1565..2078f537690000eb41833fb885ed7c42fce12844 100644 (file)
@@ -196,10 +196,12 @@ void pci_init_board (void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup (void *blob, bd_t * bd)
+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 /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 78e4b5d1e9164dd76e793a518a01b5083456a9be..8856393686955c0bbdbee994b8e13d8bdc1f080b 100644 (file)
@@ -283,9 +283,10 @@ void ide_set_reset (int idereset)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index dfbfab81369b4acce51bca58ae09d850976a4837..e2009357de8c648587086abca8370afb8b960145 100644 (file)
@@ -460,8 +460,10 @@ static void setports(int gpio)
 }
 #endif
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 0543483d5a91d06e81d04299dcc55f7baa154f7e..1da0dcb9d8a03354db82fc72385b7ba52407cc7a 100644 (file)
@@ -359,9 +359,11 @@ int checkboard(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
 
index 4a736137e3fcffd72e3846f4a218542733d1270d..a74f75bad41dc09af5d9caf680f6f1bf08bb2a3e 100644 (file)
@@ -261,7 +261,7 @@ void fdt_fixup_fman_mac_addresses(void *blob)
 }
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -286,6 +286,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_fman_mac_addresses(blob);
 #endif
+
+       return 0;
 }
 
 #if defined(CONFIG_POST)
index 8b8300050909c6092109dd7edfac7ba765cb8cab..d9ab2fd421651df92c7784424cb7dc0441835056 100644 (file)
@@ -610,7 +610,7 @@ void pci_target_init(struct pci_controller *hose)
 #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[4];
        int rc;
@@ -627,5 +627,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update property NOR mapping, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a4c199859c3d66b29fd2acf1f3d3a4792d17a097..71c6a79ae14a6bfe95d4150e3c79873f0d587114 100644 (file)
@@ -280,8 +280,10 @@ static unsigned char swapbyte(unsigned char c)
  * Device Tree Support
  */
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index c3ce66d8d0649c66df79d64a085089a1cb7c4bd1..c8ed5b73f423c723473d4eec82c7d93302a4403f 100644 (file)
@@ -385,8 +385,10 @@ void pci_init_board (void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 5c5afa21ef57ea14bfd476bbcce246d3a5670ceb..e794c4645ee702196d102f294334a950b2160101 100644 (file)
@@ -358,8 +358,10 @@ void hw_watchdog_reset(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index a6235e53945fa56ecee3541d29ea95df5097c16e..4d0ebaab74567008c5718cd082fcfe1e751c5a3d 100644 (file)
@@ -185,9 +185,11 @@ int checkboard(void)
 
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 2009e62a1a7bfcbb575cc0f2308841e37e34e8fc..688cc12a6c9a7f816f0f75a863d7835b64f775ea 100644 (file)
@@ -62,10 +62,12 @@ void pci_init_board(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
+
+       return 0;
 }
 #endif
 
index 08eb5e829039d86f5395fdfdb140a23bf262327e..529a58c222114a6ca8a889c1400533073e20ad41 100644 (file)
@@ -329,9 +329,11 @@ void ft_blob_update (void *blob, bd_t *bd)
        }
 }
 
-void ft_board_setup (void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
        ft_blob_update (blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 319fa8cba41c1c779d0d528f2d9d93163afa67e6..23d0f56bd625a20ed1a1daa47904d6c14dee7527 100644 (file)
@@ -146,9 +146,10 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index 15f8f3163d7fac3ed0a0577bd1d2273bda7245be..81f3024ed995be04a950cc53542f75ea630818ce 100644 (file)
@@ -477,7 +477,7 @@ static unsigned char edid_buf[128] = {
 };
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[8];
        int rc, i = 0;
@@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update flash reg property, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index ce515d834c6dfc2c324f373c12af8bd024591fe2..ed41de13d474b4a84add031bf068959d70b39cb3 100644 (file)
@@ -164,9 +164,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t * bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 7445f5318ad2ed44525ea8bf8a11cc5ae95cbc42..db904a4107f6bb477fcf95604711354798ddd1c0 100644 (file)
@@ -154,7 +154,7 @@ int board_mmc_init(bd_t *bis)
                                  msg_clk->get_clock_rate.body.resp.rate_hz);
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        /*
         * For now, we simply always add the simplefb DT node. Later, we
@@ -162,4 +162,6 @@ void ft_board_setup(void *blob, bd_t *bd)
         * node exists for the "real" graphics driver.
         */
        lcd_dt_simplefb_add_node(blob);
+
+       return 0;
 }
index 33003ee9b563fb7a7385ea053b265b3b3aaa35ed..b7d23817e143016688d332fbf1da1acd925fe6c2 100644 (file)
@@ -382,6 +382,22 @@ static void board_gpio_init(void)
        gpio_set_pull(EXYNOS4X12_GPIO_X31, S5P_GPIO_PULL_UP);
        gpio_set_drv(EXYNOS4X12_GPIO_X31, S5P_GPIO_DRV_4X);
        gpio_direction_input(EXYNOS4X12_GPIO_X31);
+
+       /* Blue LED (Odroid X2/U2/U3) */
+       gpio_request(EXYNOS4X12_GPIO_C10, "Blue LED");
+
+       gpio_direction_output(EXYNOS4X12_GPIO_C10, 0);
+
+#ifdef CONFIG_CMD_USB
+       /* USB3503A Reference frequency */
+       gpio_request(EXYNOS4X12_GPIO_X30, "USB3503A RefFreq");
+
+       /* USB3503A Connect */
+       gpio_request(EXYNOS4X12_GPIO_X34, "USB3503A Connect");
+
+       /* USB3503A Reset */
+       gpio_request(EXYNOS4X12_GPIO_X35, "USB3503A Reset");
+#endif
 }
 
 static int pmic_init_max77686(void)
@@ -462,9 +478,39 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
        .usb_phy_ctrl   = EXYNOS4X12_USBPHY_CONTROL,
        .usb_flags      = PHY0_SLEEP,
 };
+#endif
+
+#if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB)
 
 int board_usb_init(int index, enum usb_init_type init)
 {
+#ifdef CONFIG_CMD_USB
+       struct pmic *p_pmic;
+
+       /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/
+       /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
+       if (gd->board_type == ODROID_TYPE_U3)
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
+       else
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+
+       /* Disconnect, Reset, Connect */
+       gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);
+       gpio_direction_output(EXYNOS4X12_GPIO_X35, 0);
+       gpio_direction_output(EXYNOS4X12_GPIO_X35, 1);
+       gpio_direction_output(EXYNOS4X12_GPIO_X34, 1);
+
+       /* Power off and on BUCK8 for LAN9730 */
+       debug("LAN9730 - Turning power buck 8 OFF and ON.\n");
+
+       p_pmic = pmic_get("MAX77686_PMIC");
+       if (p_pmic && !pmic_probe(p_pmic)) {
+               max77686_set_buck_voltage(p_pmic, 8, 750000);
+               max77686_set_buck_voltage(p_pmic, 8, 3300000);
+       }
+
+#endif
+
        debug("USB_udc_probe\n");
        return s3c_udc_probe(&s5pc210_otg_data);
 }
index d3a5b7f7d7f2fb8286429f9b7663157fb969ef9f..e7aafe5bebd3600c1bd4313d783e9b5313eb670d 100644 (file)
@@ -1,3 +1,19 @@
+if TARGET_PEACH_PI
+
+config SYS_BOARD
+       string
+       default "smdk5420"
+
+config SYS_VENDOR
+       string
+       default "samsung"
+
+config SYS_CONFIG_NAME
+       string
+       default "peach-pi"
+
+endif
+
 if TARGET_PEACH_PIT
 
 config SYS_BOARD
index e0f5c7a530e88d1bf0819d31876628e1ad60ab5c..1423f839955a3c8db4755a25641c5305bc1f3feb 100644 (file)
@@ -6,3 +6,5 @@ F:      include/configs/peach-pit.h
 F:     configs/peach-pit_defconfig
 F:     include/configs/smdk5420.h
 F:     configs/smdk5420_defconfig
+F:     include/configs/peach-pi.h
+F:     configs/peach-pi_defconfig
index 89da47ed12d0d301f790d02787d05462f78d1798..72786d2ace6516f9ebe251f3bf1371c9107ad00b 100644 (file)
@@ -214,11 +214,13 @@ void sdram_init(void)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index d584276253a5e33414a085d2e5414844cfd11a94..25329e44736eba2b47f18c8505b9ca0351866152 100644 (file)
@@ -301,12 +301,14 @@ int last_stage_init(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_FSL_PCI_INIT
        FT_FSL_PCI_SETUP;
 #endif
+
+       return 0;
 }
 #endif
index 4906be488934d22d67eef6e9d4b6307dd5e7445d..6bdf1a28e97bbea16eff991718df3bad378b0c98 100644 (file)
@@ -173,11 +173,13 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup (void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
        FT_FSL_PCI_SETUP;
+
+       return 0;
 }
 #endif
 
index 2caefbbe5844a217b4380160b00044c60b609826..953a43ff3163526b58c993bea7ba46bb9772520a 100644 (file)
@@ -218,8 +218,7 @@ int board_early_init_r (void)
 #endif /* CONFIG_BOARD_EARLY_INIT_R */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[12];
        int rc, i = 0;
@@ -251,6 +250,8 @@ ft_board_setup(void *blob, bd_t *bd)
        if (rc)
                printf("Unable to update localbus ranges, err=%s\n",
                       fdt_strerror(rc));
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index f5c3d750cee634d9dae12b316ace5260d5a1b87a..6e4eed86a5f3419a54dd5f754df7d7a5591435b4 100644 (file)
@@ -233,9 +233,11 @@ reset_phy(void)
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
 
index 7555896f740885343dd9f1f49f314635d3b34198..246cd9a1a708df0d42892586d4db6188c3c75b36 100644 (file)
@@ -24,6 +24,7 @@ config MACH_SUN7I
        select CPU_V7_HAS_NONSEC
        select CPU_V7_HAS_VIRT
        select SUPPORT_SPL
+       select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
 
 config MACH_SUN8I
        bool "sun8i (Allwinner A23)"
@@ -215,4 +216,18 @@ config USB2_VBUS_PIN
        ---help---
        See USB1_VBUS_PIN help text.
 
+config VIDEO
+       boolean "Enable graphical uboot console on HDMI"
+       default y
+       ---help---
+       Say Y here to add support for using a cfb console on the HDMI output
+       found on most sunxi devices.
+
+config USB_KEYBOARD
+       boolean "Enable USB keyboard support"
+       default y
+       ---help---
+       Say Y here to add support for using a USB keyboard (typically used
+       in combination with a graphical console on HDMI).
+
 endif
index 5e123285b03d2d8a8fb29b6c2712d11bf4fa1df5..b7f0dda2058eecf97547270a2feac54565b5d7b1 100644 (file)
@@ -76,6 +76,8 @@ void scsi_init(void)
 #ifdef CONFIG_SATAPWR
        gpio_request(CONFIG_SATAPWR, "satapwr");
        gpio_direction_output(CONFIG_SATAPWR, 1);
+       /* Give attached sata device time to power-up to avoid link timeouts */
+       mdelay(500);
 #endif
 
        if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0)
index e6ec5b8fc10b89447f6088ec1320eb0701a10108..4c1c69a6ae1381fafc9b0c2b6f1117377ee5c3aa 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>
+#include <asm/arch/display.h>
 #include <asm/arch/dram.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
@@ -237,3 +238,12 @@ int misc_init_r(void)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_OF_BOARD_SETUP
+int ft_board_setup(void *blob, bd_t *bd)
+{
+#ifdef CONFIG_VIDEO_DT_SIMPLEFB
+       return sunxi_simplefb_setup(blob);
+#endif
+}
+#endif /* CONFIG_OF_BOARD_SETUP */
index 051aca01a83202fdb026458bdaf40711601d207f..571bc9e0ab0d49ba3ab6c1ef621adff2f038441e 100644 (file)
@@ -13,7 +13,12 @@ int sunxi_gmac_initialize(bd_t *bis)
                (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
        /* Set up clock gating */
+#ifndef CONFIG_MACH_SUN6I
        setbits_le32(&ccm->ahb_gate1, 0x1 << AHB_GATE_OFFSET_GMAC);
+#else
+       setbits_le32(&ccm->ahb_reset0_cfg, 0x1 << AHB_RESET_OFFSET_GMAC);
+       setbits_le32(&ccm->ahb_gate0, 0x1 << AHB_GATE_OFFSET_GMAC);
+#endif
 
        /* Set MII clock */
 #ifdef CONFIG_RGMII
@@ -33,6 +38,7 @@ int sunxi_gmac_initialize(bd_t *bis)
        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++) {
 #ifdef CONFIG_RGMII
@@ -43,9 +49,48 @@ int sunxi_gmac_initialize(bd_t *bis)
                sunxi_gpio_set_cfgpin(pin, SUN7I_GPA0_GMAC);
                sunxi_gpio_set_drv(pin, 3);
        }
+#elif defined CONFIG_RGMII
+       /* Configure sun6i RGMII mode pin mux settings */
+       for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(3); pin++) {
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+               sunxi_gpio_set_drv(pin, 3);
+       }
+       for (pin = SUNXI_GPA(9); pin <= SUNXI_GPA(14); pin++) {
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+               sunxi_gpio_set_drv(pin, 3);
+       }
+       for (pin = SUNXI_GPA(19); pin <= SUNXI_GPA(20); pin++) {
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+               sunxi_gpio_set_drv(pin, 3);
+       }
+       for (pin = SUNXI_GPA(25); pin <= SUNXI_GPA(27); pin++) {
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+               sunxi_gpio_set_drv(pin, 3);
+       }
+#elif defined CONFIG_GMII
+       /* Configure sun6i GMII mode pin mux settings */
+       for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(27); pin++) {
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+               sunxi_gpio_set_drv(pin, 2);
+       }
+#else
+       /* Configure sun6i MII mode pin mux settings */
+       for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(3); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+       for (pin = SUNXI_GPA(8); pin <= SUNXI_GPA(9); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+       for (pin = SUNXI_GPA(11); pin <= SUNXI_GPA(14); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+       for (pin = SUNXI_GPA(19); pin <= SUNXI_GPA(24); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+       for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
+#endif
 
 #ifdef CONFIG_RGMII
        return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
+#elif defined CONFIG_GMII
+       return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII);
 #else
        return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);
 #endif
index ff7bc4bb18d695feac087803a04ad37a881a1430..04ec675103630c35af3dd7eaaeaee9f7800b6ab0 100644 (file)
@@ -114,7 +114,7 @@ u32 spl_boot_device(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int lpae;
        char *env;
@@ -217,6 +217,8 @@ void ft_board_setup(void *blob, bd_t *bd)
                        }
                }
        }
+
+       return 0;
 }
 
 void ft_board_setup_ex(void *blob, bd_t *bd)
index a1f56cde2962a96053a289068c412a37096e0325..e9363ea394823a24b6d4cf9f8007d160f73b7e7d 100644 (file)
@@ -863,12 +863,14 @@ int board_get_height (void)
 #endif /* CONFIG_VIDEO_SM501 */
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #if defined(CONFIG_VIDEO)
        fdt_add_edid(blob, "smi,sm501", edid_buf);
 #endif
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
index 814fcb26573f61ce4dba176e3c16b3a38afdda5d..d891a3844ca3836284a907faa7e5514840bcdd84 100644 (file)
@@ -414,12 +414,14 @@ static void set_ddr_config(void) {
 }
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif /* CONFIG_PCI */
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 9ce2a5739f321b936c884d29f6f7621661fbf4d2..3b5230abc0d43f95cf787292a84475ffd90a5f3c 100644 (file)
@@ -674,10 +674,12 @@ void ft_blob_update (void *blob, bd_t *bd)
        }
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
        ft_blob_update(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
 
index e480d57e7dbe9c7f54929743f14e7d89003ef1f7..c9e163e7d5e8e492a5a4e3e04d948031f6808e3e 100644 (file)
@@ -266,12 +266,14 @@ int checkboard(void)
  * Device Tree Support
  */
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        /* bring in eMMC dsr settings */
        do_fixup_by_path_u32(blob,
                             "/soc/aips-bus@02100000/usdhc@02198000",
                             "dsr", tqma6_emmc_dsr, 2);
        tqma6_bb_ft_board_setup(blob, bd);
+
+       return 0;
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index c4feef8196ec3c979cbd62a4449a1ccf68b5e811..7f24a30688ac2468b1048deae5854502ec736b3d 100644 (file)
@@ -192,11 +192,13 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
index b7ad3495025f85a8966c19b219ae65ce01572c0c..0028870db07784a6e417cd4f39b305cbecf33dc2 100644 (file)
@@ -69,11 +69,13 @@ phys_size_t initdram(int board_type)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index aa9e99d108ea5dac3d0be1ebff694ea7169715a8..6a3df52391e782007602c093ae5372ed038fff9b 100644 (file)
@@ -70,11 +70,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index efd563b266b655885448d95e1943b939ca5f3712..41419feb178a955d2e4b4049f31fb82895e7f0b7 100644 (file)
@@ -72,11 +72,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index e64d682afe7e7f92ef56df857ec8bb52781123f3..1f05150d0ff245b1fc897aac709e4260645d068c 100644 (file)
@@ -72,11 +72,13 @@ int board_early_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_board_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+
+       return 0;
 }
 #endif
index f8fd324d0d79741c0741f24d38645895c22a2fbb..98c9c728ce7358b5efd42c5fb50d51d6da94296b 100644 (file)
@@ -581,7 +581,7 @@ static int reserve_stacks(void)
        gd->irq_sp = gd->start_addr_sp;
 # endif
 #else
-# if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
+# ifdef CONFIG_PPC
        ulong *s;
 # endif
 
@@ -611,12 +611,6 @@ static int reserve_stacks(void)
        s = (ulong *) gd->start_addr_sp;
        *s = 0; /* Terminate back chain */
        *++s = 0; /* NULL return address */
-# elif defined(CONFIG_MIPS)
-       /* Clear initial stack frame */
-       s = (ulong *) gd->start_addr_sp;
-       *s-- = 0;
-       *s-- = 0;
-       gd->start_addr_sp = (ulong) s;
 # endif /* Architecture specific code */
 
        return 0;
index 5640ded296895d8bf2dbd6b1e99ba565d52e1377..25b4675744f57f8e58f7390159a88f5ea9b772d1 100644 (file)
@@ -566,8 +566,27 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 #ifdef CONFIG_OF_BOARD_SETUP
        /* Call the board-specific fixup routine */
-       else if (strncmp(argv[1], "boa", 3) == 0)
-               ft_board_setup(working_fdt, gd->bd);
+       else if (strncmp(argv[1], "boa", 3) == 0) {
+               int err = ft_board_setup(working_fdt, gd->bd);
+
+               if (err) {
+                       printf("Failed to update board information in FDT: %s\n",
+                              fdt_strerror(err));
+                       return CMD_RET_FAILURE;
+               }
+       }
+#endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+       /* Call the board-specific fixup routine */
+       else if (strncmp(argv[1], "sys", 3) == 0) {
+               int err = ft_system_setup(working_fdt, gd->bd);
+
+               if (err) {
+                       printf("Failed to add system information to FDT: %s\n",
+                              fdt_strerror(err));
+                       return CMD_RET_FAILURE;
+               }
+       }
 #endif
        /* Create a chosen node */
        else if (strncmp(argv[1], "cho", 3) == 0) {
@@ -1007,6 +1026,9 @@ static char fdt_help_text[] =
        "addr [-c]  <addr> [<length>]   - Set the [control] fdt location to <addr>\n"
 #ifdef CONFIG_OF_BOARD_SETUP
        "fdt boardsetup                      - Do board-specific set up\n"
+#endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+       "fdt systemsetup                     - Do system-specific set up\n"
 #endif
        "fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active\n"
        "fdt resize                          - Resize fdt to size + padding to 4k addr\n"
index 2d3c3870b19a3d42f0edb0e4f1f9c88272072b1e..ea42c63eaafd74300374dd5734726f6a64aaf8e3 100644 (file)
 #include <fdt_support.h>
 #include <exports.h>
 
-/*
- * Get cells len in bytes
- *     if #NNNN-cells property is 2 then len is 8
- *     otherwise len is 4
- */
-static int get_cells_len(const void *fdt, const char *nr_cells_name)
-{
-       const fdt32_t *cell;
-
-       cell = fdt_getprop(fdt, 0, nr_cells_name, NULL);
-       if (cell && fdt32_to_cpu(*cell) == 2)
-               return 8;
-
-       return 4;
-}
-
 /**
  * fdt_getprop_u32_default_node - Return a node's property or a default
  *
@@ -113,7 +97,8 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
 }
 
 /**
- * fdt_find_or_add_subnode - find or possibly add a subnode of a given node
+ * fdt_find_or_add_subnode() - find or possibly add a subnode of a given node
+ *
  * @fdt: pointer to the device tree blob
  * @parentoffset: structure block offset of a node
  * @name: name of the subnode to locate
@@ -121,8 +106,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
  * fdt_subnode_offset() finds a subnode of the node with a given name.
  * If the subnode does not exist, it will be created.
  */
-static int fdt_find_or_add_subnode(void *fdt, int parentoffset,
-                                  const char *name)
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name)
 {
        int offset;
 
@@ -246,7 +230,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
                return err;
        }
 
-       is_u64 = (get_cells_len(fdt, "#address-cells") == 8);
+       is_u64 = (fdt_address_cells(fdt, 0) == 2);
 
        err = fdt_setprop_uxx(fdt, nodeoffset, "linux,initrd-start",
                              (uint64_t)initrd_start, is_u64);
@@ -382,22 +366,22 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat,
 /*
  * fdt_pack_reg - pack address and size array into the "reg"-suitable stream
  */
-static int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address,
-                       uint64_t *size, int n)
+static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
+                       int n)
 {
        int i;
-       int address_len = get_cells_len(fdt, "#address-cells");
-       int size_len = get_cells_len(fdt, "#size-cells");
+       int address_len = fdt_address_cells(fdt, 0);
+       int size_len = fdt_size_cells(fdt, 0);
        char *p = buf;
 
        for (i = 0; i < n; i++) {
-               if (address_len == 8)
+               if (address_len == 2)
                        *(fdt64_t *)p = cpu_to_fdt64(address[i]);
                else
                        *(fdt32_t *)p = cpu_to_fdt32(address[i]);
                p += address_len;
 
-               if (size_len == 8)
+               if (size_len == 2)
                        *(fdt64_t *)p = cpu_to_fdt64(size[i]);
                else
                        *(fdt32_t *)p = cpu_to_fdt32(size[i]);
@@ -968,13 +952,8 @@ void of_bus_default_count_cells(void *blob, int parentoffset,
 {
        const fdt32_t *prop;
 
-       if (addrc) {
-               prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL);
-               if (prop)
-                       *addrc = be32_to_cpup(prop);
-               else
-                       *addrc = 2;
-       }
+       if (addrc)
+               *addrc = fdt_address_cells(blob, parentoffset);
 
        if (sizec) {
                prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL);
@@ -1420,11 +1399,7 @@ u64 fdt_get_base_address(void *fdt, int node)
        u32 naddr;
        const fdt32_t *prop;
 
-       prop = fdt_getprop(fdt, node, "#address-cells", &size);
-       if (prop && size == 4)
-               naddr = be32_to_cpup(prop);
-       else
-               naddr = 2;
+       naddr = fdt_address_cells(fdt, node);
 
        prop = fdt_getprop(fdt, node, "ranges", &size);
 
@@ -1524,3 +1499,65 @@ int fdt_read_range(void *fdt, int node, int n, uint64_t *child_addr,
 
        return 0;
 }
+
+/**
+ * fdt_setup_simplefb_node - Fill and enable a simplefb node
+ *
+ * @fdt: ptr to device tree
+ * @node: offset of the simplefb node
+ * @base_address: framebuffer base address
+ * @width: width in pixels
+ * @height: height in pixels
+ * @stride: bytes per line
+ * @format: pixel format string
+ *
+ * Convenience function to fill and enable a simplefb node.
+ */
+int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
+                           u32 height, u32 stride, const char *format)
+{
+       char name[32];
+       fdt32_t cells[4];
+       int i, addrc, sizec, ret;
+
+       of_bus_default_count_cells(fdt, fdt_parent_offset(fdt, node),
+                                  &addrc, &sizec);
+       i = 0;
+       if (addrc == 2)
+               cells[i++] = cpu_to_fdt32(base_address >> 32);
+       cells[i++] = cpu_to_fdt32(base_address);
+       if (sizec == 2)
+               cells[i++] = 0;
+       cells[i++] = cpu_to_fdt32(height * stride);
+
+       ret = fdt_setprop(fdt, node, "reg", cells, sizeof(cells[0]) * i);
+       if (ret < 0)
+               return ret;
+
+       snprintf(name, sizeof(name), "framebuffer@%llx", base_address);
+       ret = fdt_set_name(fdt, node, name);
+       if (ret < 0)
+               return ret;
+
+       ret = fdt_setprop_u32(fdt, node, "width", width);
+       if (ret < 0)
+               return ret;
+
+       ret = fdt_setprop_u32(fdt, node, "height", height);
+       if (ret < 0)
+               return ret;
+
+       ret = fdt_setprop_u32(fdt, node, "stride", stride);
+       if (ret < 0)
+               return ret;
+
+       ret = fdt_setprop_string(fdt, node, "format", format);
+       if (ret < 0)
+               return ret;
+
+       ret = fdt_setprop_string(fdt, node, "status", "okay");
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
index a39ae1b4cce9f172dea99f9459f2320f6b98e8a7..1d76bd60da843404d9dda64e4c5a93630e7ecb5e 100644 (file)
@@ -460,19 +460,32 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 {
        ulong *initrd_start = &images->initrd_start;
        ulong *initrd_end = &images->initrd_end;
-       int ret;
+       int ret = -EPERM;
+       int fdt_ret;
 
        if (fdt_chosen(blob) < 0) {
-               puts("ERROR: /chosen node create failed");
-               puts(" - must RESET the board to recover.\n");
-               return -1;
+               printf("ERROR: /chosen node create failed\n");
+               goto err;
        }
        if (arch_fixup_fdt(blob) < 0) {
-               puts("ERROR: arch specific fdt fixup failed");
-               return -1;
+               printf("ERROR: arch-specific fdt fixup failed\n");
+               goto err;
+       }
+       if (IMAGE_OF_BOARD_SETUP) {
+               fdt_ret = ft_board_setup(blob, gd->bd);
+               if (fdt_ret) {
+                       printf("ERROR: board-specific fdt fixup failed: %s\n",
+                              fdt_strerror(fdt_ret));
+                       goto err;
+               }
+       }
+       if (IMAGE_OF_SYSTEM_SETUP) {
+               if (ft_system_setup(blob, gd->bd)) {
+                       printf("ERROR: system-specific fdt fixup failed: %s\n",
+                              fdt_strerror(fdt_ret));
+                       goto err;
+               }
        }
-       if (IMAGE_OF_BOARD_SETUP)
-               ft_board_setup(blob, gd->bd);
        fdt_fixup_ethernet(blob);
 
        /* Delete the old LMB reservation */
@@ -481,7 +494,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
        ret = fdt_shrink_to_minimum(blob);
        if (ret < 0)
-               return ret;
+               goto err;
        of_size = ret;
 
        if (*initrd_start && *initrd_end) {
@@ -493,7 +506,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
        fdt_initrd(blob, *initrd_start, *initrd_end);
        if (!ft_verify_fdt(blob))
-               return -1;
+               goto err;
 
 #if defined(CONFIG_SOC_KEYSTONE)
        if (IMAGE_OF_BOARD_SETUP)
@@ -501,4 +514,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 #endif
 
        return 0;
+err:
+       printf(" - must RESET the board to recover.\n\n");
+
+       return ret;
 }
index d8e13715c18f82c269cfd3b670a9567bbf895fd3..28b3fe79184d627eebbe941e46330955d5092fab 100644 (file)
@@ -30,6 +30,7 @@
 #include <splash.h>
 #include <asm/io.h>
 #include <asm/unaligned.h>
+#include <fdt_support.h>
 
 #if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
        defined(CONFIG_CPU_MONAHANS)
@@ -1172,51 +1173,13 @@ int lcd_get_screen_columns(void)
 #if defined(CONFIG_LCD_DT_SIMPLEFB)
 static int lcd_dt_simplefb_configure_node(void *blob, int off)
 {
-       u32 stride;
-       fdt32_t cells[2];
-       int ret;
-       static const char format[] =
 #if LCD_BPP == LCD_COLOR16
-               "r5g6b5";
+       return fdt_setup_simplefb_node(blob, off, gd->fb_base,
+                                      panel_info.vl_col, panel_info.vl_row,
+                                      panel_info.vl_col * 2, "r5g6b5");
 #else
-               "";
+       return -1;
 #endif
-
-       if (!format[0])
-               return -1;
-
-       stride = panel_info.vl_col * 2;
-
-       cells[0] = cpu_to_fdt32(gd->fb_base);
-       cells[1] = cpu_to_fdt32(stride * panel_info.vl_row);
-       ret = fdt_setprop(blob, off, "reg", cells, sizeof(cells[0]) * 2);
-       if (ret < 0)
-               return -1;
-
-       cells[0] = cpu_to_fdt32(panel_info.vl_col);
-       ret = fdt_setprop(blob, off, "width", cells, sizeof(cells[0]));
-       if (ret < 0)
-               return -1;
-
-       cells[0] = cpu_to_fdt32(panel_info.vl_row);
-       ret = fdt_setprop(blob, off, "height", cells, sizeof(cells[0]));
-       if (ret < 0)
-               return -1;
-
-       cells[0] = cpu_to_fdt32(stride);
-       ret = fdt_setprop(blob, off, "stride", cells, sizeof(cells[0]));
-       if (ret < 0)
-               return -1;
-
-       ret = fdt_setprop(blob, off, "format", format, strlen(format) + 1);
-       if (ret < 0)
-               return -1;
-
-       ret = fdt_delprop(blob, off, "status");
-       if (ret < 0)
-               return -1;
-
-       return 0;
 }
 
 int lcd_dt_simplefb_add_node(void *blob)
index 5ff9bc5626c4f8ce669f60112735ab60a6da412e..9d37fd352113dab7459a66fa9a90066bfe08f328 100644 (file)
@@ -43,7 +43,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
                goto end;
        }
        err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen);
-       if (err <= 0) {
+       if (err < 0) {
                puts("spl: ext4fs_read failed\n");
                goto end;
        }
@@ -54,12 +54,12 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 
 end:
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-       if (err <= 0)
+       if (err < 0)
                printf("%s: error reading image %s, err - %d\n",
                       __func__, filename, err);
 #endif
 
-       return err <= 0;
+       return err < 0;
 }
 
 #ifdef CONFIG_SPL_OS_BOOT
@@ -95,7 +95,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
                        goto defaults;
                }
                err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
-               if (err <= 0) {
+               if (err < 0) {
                        printf("spl: error reading image %s, err - %d, falling back to default\n",
                               file, err);
                        goto defaults;
@@ -124,7 +124,7 @@ defaults:
                puts("spl: ext4fs_open failed\n");
 
        err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
-       if (err <= 0) {
+       if (err < 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("%s: error reading image %s, err - %d\n",
                       __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
index 8517203613327389ecc9b75557dc19def929889e..be8652b459a29c768ac59d00f0ed29f4c92343b7 100644 (file)
@@ -2,6 +2,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,USB_EHCI"
 CONFIG_FDTFILE="sun5i-a13-olinuxino-micro.dtb"
 CONFIG_USB1_VBUS_PIN="PG11"
+CONFIG_VIDEO=n
+CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
index 61f54666c24eb6608172380f329cf23ff9a0850b..654e12aaa3fb0dbb18ebd3472795b7b37fe996a4 100644 (file)
@@ -2,6 +2,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER,USB_EHCI"
 CONFIG_FDTFILE="sun5i-a13-olinuxino.dtb"
 CONFIG_USB1_VBUS_PIN="PG11"
+CONFIG_VIDEO=n
+CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN5I=y
index bef568df7132bd885e7f1241ea006fab1bb48c8d..de78a01801ed939aebaee7e0ba30f75616d3e947 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_SPL=y
 CONFIG_FDTFILE="sun6i-a31-colombus.dtb"
+CONFIG_USB_KEYBOARD=n
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
 +S:CONFIG_MACH_SUN6I=y
index fc67bd9d56cec113477818eccb1c2af3943c8436..50c2f9366ed9e87197e2d2099adadc52c01795a4 100644 (file)
@@ -4,3 +4,5 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN8I=y
 CONFIG_TARGET_IPPO_Q8H_V5=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5.dtb"
+CONFIG_VIDEO=n
+CONFIG_USB_KEYBOARD=n
index f46439fa4e8bb91d4d0b90827d82869a6c9b640d..ac3cd36be800e4bee266706d8ea10435b1d482e3 100644 (file)
@@ -1,5 +1,5 @@
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI"
+CONFIG_SYS_EXTRA_OPTIONS="USB_EHCI,SUNXI_GMAC"
 CONFIG_FDTFILE="sun6i-a31-m9.dtb"
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_SUNXI=y
@@ -14,5 +14,7 @@ CONFIG_FDTFILE="sun6i-a31-m9.dtb"
 # HDMI power ?
 +S:CONFIG_AXP221_ALDO2_VOLT=1800
 +S:CONFIG_AXP221_ALDO3_VOLT=3000
-# No Vbus gpio for usb1
-+S:CONFIG_USB1_VBUS_PIN=""
+# Vbus gpio for usb1
++S:CONFIG_USB1_VBUS_PIN="PC27"
+# No Vbus gpio for usb2
++S:CONFIG_USB2_VBUS_PIN=""
diff --git a/configs/peach-pi_defconfig b/configs/peach-pi_defconfig
new file mode 100644 (file)
index 0000000..8ada0db
--- /dev/null
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_EXYNOS=y
++S:CONFIG_TARGET_PEACH_PI=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5800-peach-pi"
index f54b15fa309fb60cb49bbf832382bec7df2e3b0a..de068e9c59ceeefcd7bcf1e80ab3fb32bd50bb7c 100644 (file)
@@ -1,7 +1,33 @@
 CONFIG_SPL=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_UNIPHIER=y
 +S:CONFIG_MACH_PH1_LD4=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BDI=y
+CONFIG_CMD_CONSOLE=y
+CONFIG_CMD_BOOTD=y
+CONFIG_CMD_RUN=y
+CONFIG_CMD_IMI=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_EDITENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_MEMORY=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_LOADS=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ECHO=y
+CONFIG_CMD_ITEST=y
+CONFIG_CMD_SOURCE=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_NFS=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TIME=y
+CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld4-ref"
 CONFIG_DM=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
index e7957520fbebe7ff340eae161741f89563622afd..f4ddf5f27811f49b298bbd33b6d48c4aeb58ddf2 100644 (file)
@@ -1,7 +1,33 @@
 CONFIG_SPL=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_UNIPHIER=y
 +S:CONFIG_MACH_PH1_PRO4=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BDI=y
+CONFIG_CMD_CONSOLE=y
+CONFIG_CMD_BOOTD=y
+CONFIG_CMD_RUN=y
+CONFIG_CMD_IMI=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_EDITENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_MEMORY=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_LOADS=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ECHO=y
+CONFIG_CMD_ITEST=y
+CONFIG_CMD_SOURCE=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_NFS=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TIME=y
+CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref"
 CONFIG_DM=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
index 65109374b7e05255bd6d26b2f465caf2aa40f3b4..ee14382804027d656ddf91c38c2908272c1f3e2f 100644 (file)
@@ -1,7 +1,33 @@
 CONFIG_SPL=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
 +S:CONFIG_ARM=y
 +S:CONFIG_ARCH_UNIPHIER=y
 +S:CONFIG_MACH_PH1_SLD8=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BDI=y
+CONFIG_CMD_CONSOLE=y
+CONFIG_CMD_BOOTD=y
+CONFIG_CMD_RUN=y
+CONFIG_CMD_IMI=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_EDITENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_MEMORY=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_LOADS=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ECHO=y
+CONFIG_CMD_ITEST=y
+CONFIG_CMD_SOURCE=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_NFS=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TIME=y
+CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-sld8-ref"
 CONFIG_DM=y
 CONFIG_NAND_DENALI=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
index 528bb952795b5ea55a68338bdf9100d8e14e4dd2..25b962b9f1373bf6947116c6b9a3566cf496702b 100644 (file)
@@ -141,3 +141,172 @@ And the boot sequence is:
 - boot_fit - if "Image.itb" exists
 - boot_zimg - if "zImage" exists
 - boot_uimg - if "uImage" exists
+
+11. USB host support
+====================
+
+The ethernet can be accessed after starting the USB subsystem in U-Boot.
+The adapter does not come with a preconfigured MAC address, and hence it needs
+to be set before starting USB.
+setenv usbethaddr 02:DE:AD:BE:EF:FF
+
+Note that in this example a locally managed MAC address is chosen. Care should
+be taken to make these MAC addresses unique within the same subnet.
+
+Start the USB subsystem:
+Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
+Odroid # usb start
+(Re)start USB...
+USB0:   USB EHCI 1.00
+scanning bus 0 for devices... 4 USB Device(s) found
+       scanning usb for storage devices... 1 Storage Device(s) found
+       scanning usb for ethernet devices... 1 Ethernet Device(s) found
+Odroid #
+
+Automatic IP assignment:
+------------------------
+If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
+then the below will automatically assign an ip address through DHCP.
+setenv autoload no
+dhcp
+
+Odroid # setenv autoload no
+Odroid # dhcp
+Waiting for Ethernet connection... done.
+BOOTP broadcast 1
+DHCP client bound to address 192.168.1.10 (524 ms)
+Odroid #
+
+Note that this automatically sets the many IP address related variables in
+U-Boot that is obtained from the DHCP server.
+
+Odroid # printenv ipaddr netmask gatewayip dnsip
+ipaddr=192.168.1.10
+netmask=255.255.255.0
+gatewayip=192.168.1.1
+dnsip=192.168.1.1
+
+Ping example:
+The ping command can be used a test to check connectivity. In this example,
+192.168.1.27 is a pingable server in the network.
+Odroid # ping 192.168.1.27
+Waiting for Ethernet connection... done.
+Using sms0 device
+host 192.168.1.27 is alive
+Odroid #
+
+Static IP assignment:
+---------------------
+In the case where there are no DHCP servers in the network, or you want to
+set the IP address statically, it can be done by:
+Odroid # setenv ipaddr 192.168.1.10
+Odroid # ping 192.168.1.27
+Waiting for Ethernet connection... done.
+Using sms0 device
+host 192.168.1.27 is alive
+
+TFTP booting:
+-------------
+Say there exists a tftp server in the network with address 192.168.1.27 and
+it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
+that needs to be loaded and booted. It can be accomplished as below:
+(Assumes that you have setenv usbethaddr, and have not set autoload to no)
+
+Odroid # setenv serverip 192.168.1.27
+Odroid # tftpboot 0x40080000 zImage.3.17
+Waiting for Ethernet connection... done.
+Using sms0 device
+TFTP from server 192.168.1.27; our IP address is 192.168.1.10
+Filename 'zImage.3.17'.
+Load address: 0x40080000
+Loading: #################################################################
+        #################################################################
+        #################################################################
+        #######################
+        52.7 KiB/s
+done
+Bytes transferred = 3194200 (30bd58 hex)
+Odroid # tftpboot 0x42000000 exynos4412-odroidu3.dtb
+Waiting for Ethernet connection... done.
+Using sms0 device
+TFTP from server 192.168.1.27; our IP address is 192.168.1.10
+Filename 'exynos4412-odroidu3.dtb'.
+Load address: 0x42000000
+Loading: ####
+        40 KiB/s
+done
+Bytes transferred = 46935 (b757 hex)
+Odroid # printenv bootargs
+bootargs=Please use defined boot
+Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
+Odroid # bootz 40080000 - 42000000
+Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
+## Flattened Device Tree blob at 42000000
+   Booting using the fdt blob at 0x42000000
+   Loading Device Tree to 4fff1000, end 4ffff756 ... OK
+
+Starting kernel ...
+
+[    0.000000] Booting Linux on physical CPU 0xa00
+... etc ...
+
+In the above example you can substitute 'dhcp' for 'tftpboot' as well.
+
+USB Storage booting:
+--------------------
+Similarly we can use the USB storage to load the kernel image/initrd/fdt etc
+and boot. For this example, there is a USB drive plugged in. It has a FAT
+1st partition and an EXT 2nd partition. Using the generic FS (ls/load) makes
+it even easier to work with FAT/EXT file systems.
+For this example the second EXT partition is used for booting and as rootfs.
+The boot files - kernel and the dtb are present in the /boot directory of the
+second partition.
+
+Odroid # usb start
+(Re)start USB...
+USB0:   USB EHCI 1.00
+scanning bus 0 for devices... 4 USB Device(s) found
+       scanning usb for storage devices... 1 Storage Device(s) found
+       scanning usb for ethernet devices...
+Error: sms0 address not set.           <----- Note the error as usbethaddr
+Warning: failed to set MAC address     <----- is not set.
+1 Ethernet Device(s) found
+Odroid # usb part 0
+
+Partition Map for USB device 0  --   Partition Type: DOS
+
+Part   Start Sector    Num Sectors     UUID            Type
+  1    3072            263168          000c4046-01     06
+  2    266240          13457408        000c4046-02     83
+
+Odroid # ls usb 0:2 /boot
+<DIR>       4096 .
+<DIR>       4096 ..
+             353 boot.scr
+             281 boot.txt
+          101420 config-3.8.13.23
+         2127254 initrd.img-3.8.13.23
+         2194825 uInitrd
+         2194825 uInitrd-3.8.13.23
+         2453112 zImage
+          101448 config-3.8.13.26
+         2127670 uInitrd-3.8.13.26
+         2127606 initrd.img-3.8.13.26
+         3194200 zImage.3.17                    <--- Kernel
+           46935 exynos4412-odroidu3.dtb        <--- DTB
+Odroid # load usb 0:2 40080000 /boot/zImage.3.17
+3194200 bytes read in 471 ms (6.5 MiB/s)
+Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
+46935 bytes read in 233 ms (196.3 KiB/s)
+Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
+Odroid # bootz 40080000 - 42000000
+Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
+## Flattened Device Tree blob at 42000000
+   Booting using the fdt blob at 0x42000000
+   Loading Device Tree to 4fff1000, end 4ffff756 ... OK
+
+Starting kernel ...
+
+[    0.000000] Booting Linux on physical CPU 0xa00
+
+Please refer to README.usb for additional information.
index 7683c6139ffbf1eefe652a28764c0f168a271c95..5ef58c051e7f969c0f1c25a247a933975fa129e3 100644 (file)
@@ -16,6 +16,7 @@ obj-y += twserial/
 obj-y += video/
 obj-y += watchdog/
 obj-$(CONFIG_QE) += qe/
+obj-$(CONFIG_U_QE) += qe/
 obj-y += memory/
 obj-y += pwm/
 obj-y += input/
index cb46b13cbd37de6fbf905d34ffee2672dc90d364..c55eb28217bc5920c3137016dc71b8a6cd58b4b4 100644 (file)
@@ -618,7 +618,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
 #endif
 
        cfg->cfg.f_min = 400000;
-       cfg->cfg.f_max = min(gd->arch.sdhc_clk, (u32)52000000);
+       cfg->cfg.f_max = min(cfg->sdhc_clk, (u32)52000000);
 
        cfg->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
index 75c2c065c891e42028d0ce6fea80785f6e28b6d4..c24221499bfb6cd47f272cd5e71839d7296cf4ea 100644 (file)
@@ -1,9 +1,16 @@
 menu "NAND Device Support"
 
+config SYS_NAND_SELF_INIT
+       bool
+       help
+         This option, if enabled, provides more flexible and linux-like
+         NAND initialization process.
+
 if !SPL_BUILD
 
 config NAND_DENALI
        bool "Support Denali NAND controller"
+       select SYS_NAND_SELF_INIT
        help
          Enable support for the Denali NAND controller.
 
index 308b7845f122e49b47ba46bc178824a746a9abfd..9e0429aa198949903a6ddc0dbb32fa4e2125a247 100644 (file)
@@ -44,7 +44,7 @@ static int onfi_timing_mode = NAND_DEFAULT_TIMINGS;
  * this macro allows us to convert from an MTD structure to our own
  * device context (denali) structure.
  */
-#define mtd_to_denali(m) (((struct nand_chip *)mtd->priv)->priv)
+#define mtd_to_denali(m) container_of(m->priv, struct denali_nand_info, nand)
 
 /* These constants are defined by the driver to enable common driver
  * configuration options. */
@@ -1144,70 +1144,128 @@ static void denali_hw_init(struct denali_nand_info *denali)
 
 static struct nand_ecclayout nand_oob;
 
-static int denali_nand_init(struct nand_chip *nand)
+static int denali_init(struct denali_nand_info *denali)
 {
-       struct denali_nand_info *denali;
+       int ret;
 
-       denali = malloc(sizeof(*denali));
-       if (!denali)
-               return -ENOMEM;
+       denali_hw_init(denali);
 
-       nand->priv = denali;
+       denali->mtd->name = "denali-nand";
+       denali->mtd->owner = THIS_MODULE;
+       denali->mtd->priv = &denali->nand;
 
-       denali->flash_reg = (void  __iomem *)CONFIG_SYS_NAND_REGS_BASE;
-       denali->flash_mem = (void  __iomem *)CONFIG_SYS_NAND_DATA_BASE;
+       /* register the driver with the NAND core subsystem */
+       denali->nand.select_chip = denali_select_chip;
+       denali->nand.cmdfunc = denali_cmdfunc;
+       denali->nand.read_byte = denali_read_byte;
+       denali->nand.read_buf = denali_read_buf;
+       denali->nand.waitfunc = denali_waitfunc;
+
+       /*
+        * scan for NAND devices attached to the controller
+        * this is the first stage in a two step process to register
+        * with the nand subsystem
+        */
+       if (nand_scan_ident(denali->mtd, denali->max_banks, NULL)) {
+               ret = -ENXIO;
+               goto fail;
+       }
 
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
        /* check whether flash got BBT table (located at end of flash). As we
         * use NAND_BBT_NO_OOB, the BBT page will start with
         * bbt_pattern. We will have mirror pattern too */
-       nand->bbt_options |= NAND_BBT_USE_FLASH;
+       denali->nand.bbt_options |= NAND_BBT_USE_FLASH;
        /*
         * We are using main + spare with ECC support. As BBT need ECC support,
         * we need to ensure BBT code don't write to OOB for the BBT pattern.
         * All BBT info will be stored into data area with ECC support.
         */
-       nand->bbt_options |= NAND_BBT_NO_OOB;
+       denali->nand.bbt_options |= NAND_BBT_NO_OOB;
 #endif
 
-       nand->ecc.mode = NAND_ECC_HW;
-       nand->ecc.size = CONFIG_NAND_DENALI_ECC_SIZE;
-       nand->ecc.read_oob = denali_read_oob;
-       nand->ecc.write_oob = denali_write_oob;
-       nand->ecc.read_page = denali_read_page;
-       nand->ecc.read_page_raw = denali_read_page_raw;
-       nand->ecc.write_page = denali_write_page;
-       nand->ecc.write_page_raw = denali_write_page_raw;
+       denali->nand.ecc.mode = NAND_ECC_HW;
+       denali->nand.ecc.size = CONFIG_NAND_DENALI_ECC_SIZE;
+
        /*
         * Tell driver the ecc strength. This register may be already set
         * correctly. So we read this value out.
         */
-       nand->ecc.strength = readl(denali->flash_reg + ECC_CORRECTION);
-       switch (nand->ecc.size) {
+       denali->nand.ecc.strength = readl(denali->flash_reg + ECC_CORRECTION);
+       switch (denali->nand.ecc.size) {
        case 512:
-               nand->ecc.bytes = (nand->ecc.strength * 13 + 15) / 16 * 2;
+               denali->nand.ecc.bytes =
+                       (denali->nand.ecc.strength * 13 + 15) / 16 * 2;
                break;
        case 1024:
-               nand->ecc.bytes = (nand->ecc.strength * 14 + 15) / 16 * 2;
+               denali->nand.ecc.bytes =
+                       (denali->nand.ecc.strength * 14 + 15) / 16 * 2;
                break;
        default:
                pr_err("Unsupported ECC size\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto fail;
        }
-       nand_oob.eccbytes = nand->ecc.bytes;
-       nand->ecc.layout = &nand_oob;
-
-       /* Set address of hardware control function */
-       nand->cmdfunc = denali_cmdfunc;
-       nand->read_byte = denali_read_byte;
-       nand->read_buf = denali_read_buf;
-       nand->select_chip = denali_select_chip;
-       nand->waitfunc = denali_waitfunc;
-       denali_hw_init(denali);
-       return 0;
+       nand_oob.eccbytes = denali->nand.ecc.bytes;
+       denali->nand.ecc.layout = &nand_oob;
+
+       writel(denali->mtd->erasesize / denali->mtd->writesize,
+              denali->flash_reg + PAGES_PER_BLOCK);
+       writel(denali->nand.options & NAND_BUSWIDTH_16 ? 1 : 0,
+              denali->flash_reg + DEVICE_WIDTH);
+       writel(denali->mtd->writesize,
+              denali->flash_reg + DEVICE_MAIN_AREA_SIZE);
+       writel(denali->mtd->oobsize,
+              denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
+       if (readl(denali->flash_reg + DEVICES_CONNECTED) == 0)
+               writel(1, denali->flash_reg + DEVICES_CONNECTED);
+
+       /* override the default operations */
+       denali->nand.ecc.read_page = denali_read_page;
+       denali->nand.ecc.read_page_raw = denali_read_page_raw;
+       denali->nand.ecc.write_page = denali_write_page;
+       denali->nand.ecc.write_page_raw = denali_write_page_raw;
+       denali->nand.ecc.read_oob = denali_read_oob;
+       denali->nand.ecc.write_oob = denali_write_oob;
+
+       if (nand_scan_tail(denali->mtd)) {
+               ret = -ENXIO;
+               goto fail;
+       }
+
+       ret = nand_register(0);
+
+fail:
+       return ret;
+}
+
+static int __board_nand_init(void)
+{
+       struct denali_nand_info *denali;
+
+       denali = kzalloc(sizeof(*denali), GFP_KERNEL);
+       if (!denali)
+               return -ENOMEM;
+
+       /*
+        * If CONFIG_SYS_NAND_SELF_INIT is defined, each driver is responsible
+        * for instantiating struct nand_chip, while drivers/mtd/nand/nand.c
+        * still provides a "struct mtd_info nand_info" instance.
+        */
+       denali->mtd = &nand_info[0];
+
+       /*
+        * In the future, these base addresses should be taken from
+        * Device Tree or platform data.
+        */
+       denali->flash_reg = (void  __iomem *)CONFIG_SYS_NAND_REGS_BASE;
+       denali->flash_mem = (void  __iomem *)CONFIG_SYS_NAND_DATA_BASE;
+
+       return denali_init(denali);
 }
 
-int board_nand_init(struct nand_chip *chip)
+void board_nand_init(void)
 {
-       return denali_nand_init(chip);
+       if (__board_nand_init() < 0)
+               pr_warn("Failed to initialize Denali NAND controller.\n");
 }
index 3277da71e1bb0645fde46c9488a07ec9b8bdaec2..a258df00fda2d0f4a5126adbfbcadc9987a4048a 100644 (file)
@@ -434,9 +434,8 @@ struct nand_buf {
 #define DT             3
 
 struct denali_nand_info {
-       struct mtd_info mtd;
-       struct nand_chip *nand;
-
+       struct mtd_info *mtd;
+       struct nand_chip nand;
        int flash_bank; /* currently selected chip */
        int status;
        int platform;
index 0b6e7ee385c8da9bc5e5ad1f08c5e274e73edd15..70e780c3113a6049cfd5fac686bbfdd140b4050a 100644 (file)
@@ -634,6 +634,11 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
 {
        struct nand_chip *chip = mtd->priv;
 
+       if (!(chip->options & NAND_BBT_SCANNED)) {
+               chip->scan_bbt(mtd);
+               chip->options |= NAND_BBT_SCANNED;
+       }
+
        if (!chip->bbt)
                return chip->block_bad(mtd, ofs, getchip);
 
@@ -4322,10 +4327,9 @@ int nand_scan_tail(struct mtd_info *mtd)
 
        /* Check, if we should skip the bad block table scan */
        if (chip->options & NAND_SKIP_BBTSCAN)
-               return 0;
+               chip->options |= NAND_BBT_SCANNED;
 
-       /* Build bad block table */
-       return chip->scan_bbt(mtd);
+       return 0;
 }
 EXPORT_SYMBOL(nand_scan_tail);
 
index db87d07269b0bbe46911144f03edb101e95aded1..b3a2a60bb268f26740b60fc968af6870405e2ceb 100644 (file)
@@ -38,10 +38,10 @@ static void nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 }
 #endif
 
-static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+static void s3c24x0_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 {
        struct nand_chip *chip = mtd->priv;
-       struct s3c2410_nand *nand = s3c2410_get_base_nand();
+       struct s3c24x0_nand *nand = s3c24x0_get_base_nand();
 
        debug("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
 
@@ -67,35 +67,35 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
                writeb(cmd, chip->IO_ADDR_W);
 }
 
-static int s3c2410_dev_ready(struct mtd_info *mtd)
+static int s3c24x0_dev_ready(struct mtd_info *mtd)
 {
-       struct s3c2410_nand *nand = s3c2410_get_base_nand();
+       struct s3c24x0_nand *nand = s3c24x0_get_base_nand();
        debug("dev_ready\n");
        return readl(&nand->nfstat) & 0x01;
 }
 
 #ifdef CONFIG_S3C2410_NAND_HWECC
-void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode)
+void s3c24x0_nand_enable_hwecc(struct mtd_info *mtd, int mode)
 {
-       struct s3c2410_nand *nand = s3c2410_get_base_nand();
-       debug("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode);
+       struct s3c24x0_nand *nand = s3c24x0_get_base_nand();
+       debug("s3c24x0_nand_enable_hwecc(%p, %d)\n", mtd, mode);
        writel(readl(&nand->nfconf) | S3C2410_NFCONF_INITECC, &nand->nfconf);
 }
 
-static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
+static int s3c24x0_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
                                      u_char *ecc_code)
 {
-       struct s3c2410_nand *nand = s3c2410_get_base_nand();
+       struct s3c24x0_nand *nand = s3c24x0_get_base_nand();
        ecc_code[0] = readb(&nand->nfecc);
        ecc_code[1] = readb(&nand->nfecc + 1);
        ecc_code[2] = readb(&nand->nfecc + 2);
-       debug("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
-              mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
+       debug("s3c24x0_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
+             mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
 
        return 0;
 }
 
-static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
+static int s3c24x0_nand_correct_data(struct mtd_info *mtd, u_char *dat,
                                     u_char *read_ecc, u_char *calc_ecc)
 {
        if (read_ecc[0] == calc_ecc[0] &&
@@ -103,7 +103,7 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
            read_ecc[2] == calc_ecc[2])
                return 0;
 
-       printf("s3c2410_nand_correct_data: not implemented\n");
+       printf("s3c24x0_nand_correct_data: not implemented\n");
        return -1;
 }
 #endif
@@ -113,7 +113,7 @@ int board_nand_init(struct nand_chip *nand)
        u_int32_t cfg;
        u_int8_t tacls, twrph0, twrph1;
        struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power();
-       struct s3c2410_nand *nand_reg = s3c2410_get_base_nand();
+       struct s3c24x0_nand *nand_reg = s3c24x0_get_base_nand();
 
        debug("board_nand_init()\n");
 
@@ -149,14 +149,14 @@ int board_nand_init(struct nand_chip *nand)
 #endif
 
        /* hwcontrol always must be implemented */
-       nand->cmd_ctrl = s3c2410_hwcontrol;
+       nand->cmd_ctrl = s3c24x0_hwcontrol;
 
-       nand->dev_ready = s3c2410_dev_ready;
+       nand->dev_ready = s3c24x0_dev_ready;
 
 #ifdef CONFIG_S3C2410_NAND_HWECC
-       nand->ecc.hwctl = s3c2410_nand_enable_hwecc;
-       nand->ecc.calculate = s3c2410_nand_calculate_ecc;
-       nand->ecc.correct = s3c2410_nand_correct_data;
+       nand->ecc.hwctl = s3c24x0_nand_enable_hwecc;
+       nand->ecc.calculate = s3c24x0_nand_calculate_ecc;
+       nand->ecc.correct = s3c24x0_nand_correct_data;
        nand->ecc.mode = NAND_ECC_HW;
        nand->ecc.size = CONFIG_SYS_NAND_ECCSIZE;
        nand->ecc.bytes = CONFIG_SYS_NAND_ECCBYTES;
index 7feb3a7b1e78c30251c3df480fbaf164ba9732e8..928d58b3a732894bcf7fe143da3ef821d6caf0bb 100644 (file)
@@ -611,6 +611,9 @@ static int vf610_nfc_nand_init(int devnum, void __iomem *addr)
                vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_16BIT);
        }
 
+       /* Disable subpage writes as we do not provide ecc->hwctl */
+       chip->options |= NAND_NO_SUBPAGE_WRITE;
+
        chip->dev_ready = vf610_nfc_dev_ready;
        chip->cmdfunc = vf610_nfc_command;
        chip->read_byte = vf610_nfc_read_byte;
index 218a5ed17509a6d2d50eb83cbebabd55fe110a53..137886c2f3cd5f0d2a74537d51ad1cba0562c103 100644 (file)
@@ -39,9 +39,14 @@ static void dtsec_configure_serdes(struct fm_eth *priv)
        u32 value;
        struct mii_dev bus;
        bus.priv = priv->mac->phyregs;
+       bool sgmii_2500 = (priv->enet_if ==
+                       PHY_INTERFACE_MODE_SGMII_2500) ? true : false;
+
+       /* SGMII IF mode + AN enable only for 1G SGMII, not for 2.5G */
+       value = PHY_SGMII_IF_MODE_SGMII;
+       if (!sgmii_2500)
+               value |= PHY_SGMII_IF_MODE_AN;
 
-       /* SGMII IF mode + AN enable */
-       value = PHY_SGMII_IF_MODE_AN | PHY_SGMII_IF_MODE_SGMII;
        memac_mdio_write(&bus, 0, MDIO_DEVAD_NONE, 0x14, value);
 
        /* Dev ability according to SGMII specification */
@@ -54,7 +59,9 @@ static void dtsec_configure_serdes(struct fm_eth *priv)
        memac_mdio_write(&bus, 0, MDIO_DEVAD_NONE, 0x12, 0xd40);
 
        /* Restart AN */
-       value = PHY_SGMII_CR_DEF_VAL | PHY_SGMII_CR_RESET_AN;
+       value = PHY_SGMII_CR_DEF_VAL;
+       if (!sgmii_2500)
+               value |= PHY_SGMII_CR_RESET_AN;
        memac_mdio_write(&bus, 0, MDIO_DEVAD_NONE, 0, value);
 #else
        struct dtsec *regs = priv->mac->base;
@@ -83,7 +90,8 @@ static void dtsec_init_phy(struct eth_device *dev)
        out_be32(&regs->tbipa, CONFIG_SYS_TBIPA_VALUE);
 #endif
 
-       if (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII)
+       if (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII ||
+           fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII_2500)
                dtsec_configure_serdes(fm_eth);
 }
 
index df1fd91de385ebbdd8c4f066f4ec960275ad4f94..95b1a57ca2bf10829befad0022948d608bfe39b3 100644 (file)
@@ -42,11 +42,30 @@ static unsigned int max77686_ldo_volt2hex(int ldo, ulong uV)
        return 0;
 }
 
+static int max77686_buck_volt2hex(int buck, ulong uV)
+{
+       int hex = 0;
+
+       if (buck < 5 || buck > 9) {
+               debug("%s: buck %d is not supported\n", __func__, buck);
+               return -EINVAL;
+       }
+
+       hex = (uV - 750000) / 50000;
+
+       if (hex >= 0 && hex <= MAX77686_BUCK_VOLT_MAX_HEX)
+               return hex;
+
+       debug("%s: %ld is wrong voltage value for BUCK%d\n",
+             __func__, uV, buck);
+       return -EINVAL;
+}
+
 int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV)
 {
        unsigned int val, ret, hex, adr;
 
-       if (ldo < 1 && ldo > 26) {
+       if (ldo < 1 || ldo > 26) {
                printf("%s: %d is wrong ldo number\n", __func__, ldo);
                return -1;
        }
@@ -68,11 +87,38 @@ int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV)
        return ret;
 }
 
+int max77686_set_buck_voltage(struct pmic *p, int buck, ulong uV)
+{
+       unsigned int val, adr;
+       int hex, ret;
+
+       if (buck < 5 || buck > 9) {
+               printf("%s: %d is an unsupported bucket number\n",
+                      __func__, buck);
+               return -EINVAL;
+       }
+
+       adr = max77686_buck_addr[buck] + 1;
+       hex = max77686_buck_volt2hex(buck, uV);
+
+       if (hex < 0)
+               return hex;
+
+       ret = pmic_reg_read(p, adr, &val);
+       if (ret)
+               return ret;
+
+       val &= ~MAX77686_BUCK_VOLT_MASK;
+       ret |= pmic_reg_write(p, adr, val | hex);
+
+       return ret;
+}
+
 int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode)
 {
        unsigned int val, ret, adr, mode;
 
-       if (ldo < 1 && 26 < ldo) {
+       if (ldo < 1 || 26 < ldo) {
                printf("%s: %d is wrong ldo number\n", __func__, ldo);
                return -1;
        }
@@ -157,7 +203,7 @@ int max77686_set_buck_mode(struct pmic *p, int buck, char opmode)
        /* mode */
        switch (opmode) {
        case OPMODE_OFF:
-               mode = MAX77686_BUCK_MODE_OFF;
+               mode = MAX77686_BUCK_MODE_OFF << mode_shift;
                break;
        case OPMODE_STANDBY:
                switch (buck) {
index 7f1bd06922f4995b446581713c589d5b30ba670f..8fa48667ec7153d67a409f568f81c77e485c6b62 100644 (file)
@@ -4,5 +4,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y := qe.o uccf.o uec.o uec_phy.o
+obj-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
+obj-$(CONFIG_U_QE) += qe.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
index d9a7d8206ffa8e2a9304b028f0d9c19093d3337d..dfae4bf64defd63349833462d878027294e06afe 100644 (file)
@@ -12,6 +12,7 @@
 #include <fdt_support.h>
 #include "qe.h"
 
+#ifdef CONFIG_QE
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -72,3 +73,4 @@ void ft_qe_setup(void *blob)
                "clock-frequency", gd->arch.qe_clk / 2, 1);
        fdt_fixup_qe_firmware(blob);
 }
+#endif
index 4358a91adb5300911753416852654b63a1cc6faf..bc946731a1eb20aa670722a9bdde67efb1d20eee 100644 (file)
@@ -40,6 +40,7 @@ void qe_issue_cmd(uint cmd, uint sbc, u8 mcn, u32 cmd_data)
        return;
 }
 
+#ifdef CONFIG_QE
 uint qe_muram_alloc(uint size, uint align)
 {
        uint    retloc;
@@ -70,6 +71,7 @@ uint qe_muram_alloc(uint size, uint align)
 
        return retloc;
 }
+#endif
 
 void *qe_muram_addr(uint offset)
 {
@@ -180,6 +182,17 @@ void qe_init(uint qe_base)
        qe_snums_init();
 }
 
+#ifdef CONFIG_U_QE
+void u_qe_init(void)
+{
+       uint qe_base = CONFIG_SYS_IMMR + 0x01400000; /* QE immr base */
+       qe_immr = (qe_map_t *)qe_base;
+
+       u_qe_upload_firmware((const void *)CONFIG_SYS_QE_FW_ADDR);
+       out_be32(&qe_immr->iram.iready, QE_IRAM_READY);
+}
+#endif
+
 void qe_reset(void)
 {
        qe_issue_cmd(QE_RESET, QE_CR_SUBBLOCK_INVALID,
@@ -212,6 +225,7 @@ void qe_assign_page(uint snum, uint para_ram_base)
 
 #define BRG_CLK                (gd->arch.brg_clk)
 
+#ifdef CONFIG_QE
 int qe_set_brg(uint brg, uint rate)
 {
        volatile uint   *bp;
@@ -239,6 +253,7 @@ int qe_set_brg(uint brg, uint rate)
 
        return 0;
 }
+#endif
 
 /* Set ethernet MII clock master
 */
@@ -429,6 +444,131 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
        return 0;
 }
 
+#ifdef CONFIG_U_QE
+/*
+ * Upload a microcode to the I-RAM at a specific address.
+ *
+ * See docs/README.qe_firmware for information on QE microcode uploading.
+ *
+ * Currently, only version 1 is supported, so the 'version' field must be
+ * set to 1.
+ *
+ * The SOC model and revision are not validated, they are only displayed for
+ * informational purposes.
+ *
+ * 'calc_size' is the calculated size, in bytes, of the firmware structure and
+ * all of the microcode structures, minus the CRC.
+ *
+ * 'length' is the size that the structure says it is, including the CRC.
+ */
+int u_qe_upload_firmware(const struct qe_firmware *firmware)
+{
+       unsigned int i;
+       unsigned int j;
+       u32 crc;
+       size_t calc_size = sizeof(struct qe_firmware);
+       size_t length;
+       const struct qe_header *hdr;
+#ifdef CONFIG_DEEP_SLEEP
+       ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#endif
+       if (!firmware) {
+               printf("Invalid address\n");
+               return -EINVAL;
+       }
+
+       hdr = &firmware->header;
+       length = be32_to_cpu(hdr->length);
+
+       /* Check the magic */
+       if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
+           (hdr->magic[2] != 'F')) {
+               printf("Not a microcode\n");
+#ifdef CONFIG_DEEP_SLEEP
+               setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE);
+#endif
+               return -EPERM;
+       }
+
+       /* Check the version */
+       if (hdr->version != 1) {
+               printf("Unsupported version\n");
+               return -EPERM;
+       }
+
+       /* Validate some of the fields */
+       if ((firmware->count < 1) || (firmware->count > MAX_QE_RISC)) {
+               printf("Invalid data\n");
+               return -EINVAL;
+       }
+
+       /* Validate the length and check if there's a CRC */
+       calc_size += (firmware->count - 1) * sizeof(struct qe_microcode);
+
+       for (i = 0; i < firmware->count; i++)
+               /*
+                * For situations where the second RISC uses the same microcode
+                * as the first, the 'code_offset' and 'count' fields will be
+                * zero, so it's okay to add those.
+                */
+               calc_size += sizeof(u32) *
+                       be32_to_cpu(firmware->microcode[i].count);
+
+       /* Validate the length */
+       if (length != calc_size + sizeof(u32)) {
+               printf("Invalid length\n");
+               return -EPERM;
+       }
+
+       /*
+        * Validate the CRC.  We would normally call crc32_no_comp(), but that
+        * function isn't available unless you turn on JFFS support.
+        */
+       crc = be32_to_cpu(*(u32 *)((void *)firmware + calc_size));
+       if (crc != (crc32(-1, (const void *)firmware, calc_size) ^ -1)) {
+               printf("Firmware CRC is invalid\n");
+               return -EIO;
+       }
+
+       /*
+        * If the microcode calls for it, split the I-RAM.
+        */
+       if (!firmware->split) {
+               out_be16(&qe_immr->cp.cercr,
+                        in_be16(&qe_immr->cp.cercr) | QE_CP_CERCR_CIR);
+       }
+
+       if (firmware->soc.model)
+               printf("Firmware '%s' for %u V%u.%u\n",
+                      firmware->id, be16_to_cpu(firmware->soc.model),
+                      firmware->soc.major, firmware->soc.minor);
+       else
+               printf("Firmware '%s'\n", firmware->id);
+
+       /* Loop through each microcode. */
+       for (i = 0; i < firmware->count; i++) {
+               const struct qe_microcode *ucode = &firmware->microcode[i];
+
+               /* Upload a microcode if it's present */
+               if (ucode->code_offset)
+                       qe_upload_microcode(firmware, ucode);
+
+               /* Program the traps for this processor */
+               for (j = 0; j < 16; j++) {
+                       u32 trap = be32_to_cpu(ucode->traps[j]);
+
+                       if (trap)
+                               out_be32(&qe_immr->rsp[i].tibcr[j], trap);
+               }
+
+               /* Enable traps */
+               out_be32(&qe_immr->rsp[i].eccr, be32_to_cpu(ucode->eccr));
+       }
+
+       return 0;
+}
+#endif
+
 struct qe_firmware_info *qe_get_firmware_info(void)
 {
        return qe_firmware_uploaded ? &qe_firmware_info : NULL;
index ebb7c5f12463239476167299e47756b88cbf2387..33878f897b0177d87578092af1edceb08883e674 100644 (file)
@@ -285,4 +285,9 @@ void ft_qe_setup(void *blob);
 void qe_init(uint qe_base);
 void qe_reset(void);
 
+#ifdef CONFIG_U_QE
+void u_qe_init(void);
+int u_qe_upload_firmware(const struct qe_firmware *firmware);
+#endif
+
 #endif /* __QE_H__ */
index 6046efb51fe87b8711bf7e4c13e007ead20e3647..e8a1608b9988c193c1c860795730ecced5b4c107 100644 (file)
@@ -11,6 +11,7 @@
 #include <dm/device.h>
 #include <dm/platform_data/serial-uniphier.h>
 #include <serial.h>
+#include <fdtdec.h>
 
 #define UART_REG(x)                                    \
        u8 x;                                           \
@@ -113,19 +114,21 @@ static int uniphier_serial_remove(struct udevice *dev)
 }
 
 #ifdef CONFIG_OF_CONTROL
-static const struct udevice_id uniphier_uart_of_match = {
-       { .compatible = "panasonic,uniphier-uart"},
+static const struct udevice_id uniphier_uart_of_match[] = {
+       { .compatible = "panasonic,uniphier-uart" },
        {},
 };
 
 static int uniphier_serial_ofdata_to_platdata(struct udevice *dev)
 {
-       /*
-        * TODO: Masahiro Yamada (yamada.m@jp.panasonic.com)
-        *
-        * Implement conversion code from DTB to platform data
-        * when supporting CONFIG_OF_CONTROL on UniPhir platform.
-        */
+       struct uniphier_serial_platform_data *plat = dev_get_platdata(dev);
+       DECLARE_GLOBAL_DATA_PTR;
+
+       plat->base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
+       plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+                                      "clock-frequency", 0);
+
+       return 0;
 }
 #endif
 
index edd91a84a7e78ec97f37a5a27e82826a06eadb2c..6fdbf5724f4a6527757d8cec692c9a59c7529b6a 100644 (file)
@@ -85,15 +85,10 @@ static int exynos_usb_parse_dt(const void *blob, struct exynos_ehci *exynos)
 }
 #endif
 
-/* Setup the EHCI host controller. */
-static void setup_usb_phy(struct exynos_usb_phy *usb)
+static void exynos5_setup_usb_phy(struct exynos_usb_phy *usb)
 {
        u32 hsic_ctrl;
 
-       set_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN);
-
-       set_usbhost_phy_ctrl(POWER_USB_HOST_PHY_CTRL_EN);
-
        clrbits_le32(&usb->usbphyctrl0,
                        HOST_CTRL0_FSEL_MASK |
                        HOST_CTRL0_COMMONON_N |
@@ -150,8 +145,34 @@ static void setup_usb_phy(struct exynos_usb_phy *usb)
                        EHCICTRL_ENAINCR16);
 }
 
-/* Reset the EHCI host controller. */
-static void reset_usb_phy(struct exynos_usb_phy *usb)
+static void exynos4412_setup_usb_phy(struct exynos4412_usb_phy *usb)
+{
+       writel(CLK_24MHZ, &usb->usbphyclk);
+
+       clrbits_le32(&usb->usbphyctrl, (PHYPWR_NORMAL_MASK_HSIC0 |
+               PHYPWR_NORMAL_MASK_HSIC1 | PHYPWR_NORMAL_MASK_PHY1 |
+               PHYPWR_NORMAL_MASK_PHY0));
+
+       setbits_le32(&usb->usbphyrstcon, (RSTCON_HOSTPHY_SWRST | RSTCON_SWRST));
+       udelay(10);
+       clrbits_le32(&usb->usbphyrstcon, (RSTCON_HOSTPHY_SWRST | RSTCON_SWRST));
+}
+
+static void setup_usb_phy(struct exynos_usb_phy *usb)
+{
+       set_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN);
+
+       set_usbhost_phy_ctrl(POWER_USB_HOST_PHY_CTRL_EN);
+
+       if (cpu_is_exynos5())
+               exynos5_setup_usb_phy(usb);
+       else if (cpu_is_exynos4())
+               if (proid_is_exynos4412())
+                       exynos4412_setup_usb_phy((struct exynos4412_usb_phy *)
+                                                usb);
+}
+
+static void exynos5_reset_usb_phy(struct exynos_usb_phy *usb)
 {
        u32 hsic_ctrl;
 
@@ -171,6 +192,24 @@ static void reset_usb_phy(struct exynos_usb_phy *usb)
 
        setbits_le32(&usb->hsicphyctrl1, hsic_ctrl);
        setbits_le32(&usb->hsicphyctrl2, hsic_ctrl);
+}
+
+static void exynos4412_reset_usb_phy(struct exynos4412_usb_phy *usb)
+{
+       setbits_le32(&usb->usbphyctrl, (PHYPWR_NORMAL_MASK_HSIC0 |
+               PHYPWR_NORMAL_MASK_HSIC1 | PHYPWR_NORMAL_MASK_PHY1 |
+               PHYPWR_NORMAL_MASK_PHY0));
+}
+
+/* Reset the EHCI host controller. */
+static void reset_usb_phy(struct exynos_usb_phy *usb)
+{
+       if (cpu_is_exynos5())
+               exynos5_reset_usb_phy(usb);
+       else if (cpu_is_exynos4())
+               if (proid_is_exynos4412())
+                       exynos4412_reset_usb_phy((struct exynos4412_usb_phy *)
+                                                usb);
 
        set_usbhost_phy_ctrl(POWER_USB_HOST_PHY_CTRL_DISABLE);
 }
index 45062e699bd7c38793e9bd6a5a3142e263c16f84..8f554649e15625406da818fbd97701ec4c2dd6d4 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/io.h>
 #include <usb/ehci-fsl.h>
 #include <hwconfig.h>
-#include <asm/fsl_errata.h>
+#include <fsl_usb.h>
 
 #include "ehci.h"
 
@@ -130,8 +130,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
        in_le32(&ehci->usbmode);
 
-       if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
-           IS_SVR_REV(get_svr(), 2, 0))
+       if (has_erratum_a007798())
                set_txfifothresh(ehci, TXFIFOTHRESH);
 
        return 0;
index 77f6c9d9d141b99f80cd1da6bd6368042f1e1d61..32a43752790d72ee1c7d0d18730c255d7a191dd7 100644 (file)
@@ -6,10 +6,43 @@
  */
 
 #include <common.h>
+#include <linux/err.h>
 #include <usb.h>
 #include <asm/arch/ehci-uniphier.h>
 #include "ehci.h"
 
+#ifdef CONFIG_OF_CONTROL
+#include <fdtdec.h>
+DECLARE_GLOBAL_DATA_PTR;
+
+#define FDT            gd->fdt_blob
+#define COMPAT         "panasonic,uniphier-ehci"
+
+static int get_uniphier_ehci_base(int index, struct ehci_hccr **base)
+{
+       int offset;
+
+       for (offset = fdt_node_offset_by_compatible(FDT, 0, COMPAT);
+            offset >= 0;
+            offset = fdt_node_offset_by_compatible(FDT, offset, COMPAT)) {
+               if (index == 0) {
+                       *base = (struct ehci_hccr *)
+                                       fdtdec_get_addr(FDT, offset, "reg");
+                       return 0;
+               }
+               index--;
+       }
+
+       return -ENODEV; /* not found */
+}
+#else
+static int get_uniphier_ehci_base(int index, struct ehci_hccr **base)
+{
+       *base = (struct ehci_hccr *)uniphier_ehci_platdata[index].base;
+       return 0;
+}
+#endif
+
 /*
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
 int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr,
                  struct ehci_hcor **hcor)
 {
+       int ret;
        struct ehci_hccr *cr;
        struct ehci_hcor *or;
 
        uniphier_ehci_reset(index, 0);
 
-       cr = (struct ehci_hccr *)(uniphier_ehci_platdata[index].base);
+       ret = get_uniphier_ehci_base(index, &cr);
+       if (ret < 0)
+               return ret;
        or = (void *)cr + HC_LENGTH(ehci_readl(&cr->cr_capbase));
 
        *hccr = cr;
index 000f389b9397e242b33b3489807e74388a9348b6..00b563f26aea6e94cf02856d8afc254de209a3fb 100644 (file)
@@ -39,6 +39,7 @@ obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
 obj-$(CONFIG_VIDEO_SED13806) += sed13806.o
 obj-$(CONFIG_VIDEO_SM501) += sm501.o
 obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
+obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o
 obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 obj-$(CONFIG_VIDEO_X86) += x86_fb.o
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
new file mode 100644 (file)
index 0000000..d241397
--- /dev/null
@@ -0,0 +1,451 @@
+/*
+ * Display driver for Allwinner SoCs.
+ *
+ * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
+ * (C) Copyright 2014 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+#include <asm/arch/clock.h>
+#include <asm/arch/display.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <fdtdec.h>
+#include <fdt_support.h>
+#include <linux/fb.h>
+#include <video_fb.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct sunxi_display {
+       GraphicDevice graphic_device;
+       bool enabled;
+} sunxi_display;
+
+static int sunxi_hdmi_hpd_detect(void)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       struct sunxi_hdmi_reg * const hdmi =
+               (struct sunxi_hdmi_reg *)SUNXI_HDMI_BASE;
+
+       /* Set pll3 to 300MHz */
+       clock_set_pll3(300000000);
+
+       /* Set hdmi parent to pll3 */
+       clrsetbits_le32(&ccm->hdmi_clk_cfg, CCM_HDMI_CTRL_PLL_MASK,
+                       CCM_HDMI_CTRL_PLL3);
+
+       /* Set ahb gating to pass */
+#ifdef CONFIG_MACH_SUN6I
+       setbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_HDMI);
+#endif
+       setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_HDMI);
+
+       /* Clock on */
+       setbits_le32(&ccm->hdmi_clk_cfg, CCM_HDMI_CTRL_GATE);
+
+       writel(SUNXI_HDMI_CTRL_ENABLE, &hdmi->ctrl);
+       writel(SUNXI_HDMI_PAD_CTRL0_HDP, &hdmi->pad_ctrl0);
+
+       udelay(1000);
+
+       if (readl(&hdmi->hpd) & SUNXI_HDMI_HPD_DETECT)
+               return 1;
+
+       /* No need to keep these running */
+       clrbits_le32(&hdmi->ctrl, SUNXI_HDMI_CTRL_ENABLE);
+       clrbits_le32(&ccm->hdmi_clk_cfg, CCM_HDMI_CTRL_GATE);
+       clrbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_HDMI);
+#ifdef CONFIG_MACH_SUN6I
+       clrbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_HDMI);
+#endif
+       clock_set_pll3(0);
+
+       return 0;
+}
+
+/*
+ * This is the entity that mixes and matches the different layers and inputs.
+ * Allwinner calls it the back-end, but i like composer better.
+ */
+static void sunxi_composer_init(void)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       struct sunxi_de_be_reg * const de_be =
+               (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
+       int i;
+
+#ifdef CONFIG_MACH_SUN6I
+       /* Reset off */
+       setbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_DE_BE0);
+#endif
+
+       /* Clocks on */
+       setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_DE_BE0);
+       setbits_le32(&ccm->dram_clk_gate, 1 << CCM_DRAM_GATE_OFFSET_DE_BE0);
+       clock_set_de_mod_clock(&ccm->be0_clk_cfg, 300000000);
+
+       /* Engine bug, clear registers after reset */
+       for (i = 0x0800; i < 0x1000; i += 4)
+               writel(0, SUNXI_DE_BE0_BASE + i);
+
+       setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_ENABLE);
+}
+
+static void sunxi_composer_mode_set(struct fb_videomode *mode,
+                                   unsigned int address)
+{
+       struct sunxi_de_be_reg * const de_be =
+               (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
+
+       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);
+       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);
+       writel(SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888, &de_be->layer0_attr1_ctrl);
+
+       setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_LAYER0_ENABLE);
+}
+
+/*
+ * LCDC, what allwinner calls a CRTC, so timing controller and serializer.
+ */
+static void sunxi_lcdc_pll_set(int dotclock, int *clk_div, int *clk_double)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       int value, n, m, diff;
+       int best_n = 0, best_m = 0, best_diff = 0x0FFFFFFF;
+       int best_double = 0;
+
+       /*
+        * Find the lowest divider resulting in a matching clock, if there
+        * is no match, pick the closest lower clock, as monitors tend to
+        * not sync to higher frequencies.
+        */
+       for (m = 15; m > 0; m--) {
+               n = (m * dotclock) / 3000;
+
+               if ((n >= 9) && (n <= 127)) {
+                       value = (3000 * n) / m;
+                       diff = dotclock - value;
+                       if (diff < best_diff) {
+                               best_diff = diff;
+                               best_m = m;
+                               best_n = n;
+                               best_double = 0;
+                       }
+               }
+
+               /* These are just duplicates */
+               if (!(m & 1))
+                       continue;
+
+               n = (m * dotclock) / 6000;
+               if ((n >= 9) && (n <= 127)) {
+                       value = (6000 * n) / m;
+                       diff = dotclock - value;
+                       if (diff < best_diff) {
+                               best_diff = diff;
+                               best_m = m;
+                               best_n = n;
+                               best_double = 1;
+                       }
+               }
+       }
+
+       debug("dotclock: %dkHz = %dkHz: (%d * 3MHz * %d) / %d\n",
+             dotclock, (best_double + 1) * 3000 * best_n / best_m,
+             best_double + 1, best_n, best_m);
+
+       clock_set_pll3(best_n * 3000000);
+
+       writel(CCM_LCD_CH1_CTRL_GATE |
+           (best_double ? CCM_LCD_CH1_CTRL_PLL3_2X : CCM_LCD_CH1_CTRL_PLL3) |
+           CCM_LCD_CH1_CTRL_M(best_m), &ccm->lcd0_ch1_clk_cfg);
+
+       *clk_div = best_m;
+       *clk_double = best_double;
+}
+
+static void sunxi_lcdc_init(void)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       struct sunxi_lcdc_reg * const lcdc =
+               (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
+
+       /* Reset off */
+#ifdef CONFIG_MACH_SUN6I
+       setbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_LCD0);
+#else
+       setbits_le32(&ccm->lcd0_ch0_clk_cfg, CCM_LCD_CH0_CTRL_RST);
+#endif
+
+       /* Clock on */
+       setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_LCD0);
+
+       /* Init lcdc */
+       writel(0, &lcdc->ctrl); /* Disable tcon */
+       writel(0, &lcdc->int0); /* Disable all interrupts */
+
+       /* Disable tcon0 dot clock */
+       clrbits_le32(&lcdc->tcon0_dclk, SUNXI_LCDC_TCON0_DCLK_ENABLE);
+
+       /* Set all io lines to tristate */
+       writel(0xffffffff, &lcdc->tcon0_io_tristate);
+       writel(0xffffffff, &lcdc->tcon1_io_tristate);
+}
+
+static void sunxi_lcdc_mode_set(struct fb_videomode *mode,
+                               int *clk_div, int *clk_double)
+{
+       struct sunxi_lcdc_reg * const lcdc =
+               (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
+       int bp, total;
+
+       /* Use tcon1 */
+       clrsetbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_IO_MAP_MASK,
+                       SUNXI_LCDC_CTRL_IO_MAP_TCON1);
+
+       /* Enabled, 0x1e start delay */
+       writel(SUNXI_LCDC_TCON1_CTRL_ENABLE |
+              SUNXI_LCDC_TCON1_CTRL_CLK_DELAY(0x1e), &lcdc->tcon1_ctrl);
+
+       writel(SUNXI_LCDC_X(mode->xres) | SUNXI_LCDC_Y(mode->yres),
+              &lcdc->tcon1_timing_source);
+       writel(SUNXI_LCDC_X(mode->xres) | SUNXI_LCDC_Y(mode->yres),
+              &lcdc->tcon1_timing_scale);
+       writel(SUNXI_LCDC_X(mode->xres) | SUNXI_LCDC_Y(mode->yres),
+              &lcdc->tcon1_timing_out);
+
+       bp = mode->hsync_len + mode->left_margin;
+       total = mode->xres + mode->right_margin + bp;
+       writel(SUNXI_LCDC_TCON1_TIMING_H_TOTAL(total) |
+              SUNXI_LCDC_TCON1_TIMING_H_BP(bp), &lcdc->tcon1_timing_h);
+
+       bp = mode->vsync_len + mode->upper_margin;
+       total = mode->yres + mode->lower_margin + bp;
+       writel(SUNXI_LCDC_TCON1_TIMING_V_TOTAL(total) |
+              SUNXI_LCDC_TCON1_TIMING_V_BP(bp), &lcdc->tcon1_timing_v);
+
+       writel(SUNXI_LCDC_X(mode->hsync_len) | SUNXI_LCDC_Y(mode->vsync_len),
+              &lcdc->tcon1_timing_sync);
+
+       sunxi_lcdc_pll_set(mode->pixclock, clk_div, clk_double);
+}
+
+#ifdef CONFIG_MACH_SUN6I
+static void sunxi_drc_init(void)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+       /* On sun6i the drc must be clocked even when in pass-through mode */
+       setbits_le32(&ccm->ahb_reset1_cfg, 1 << AHB_RESET_OFFSET_DRC0);
+       clock_set_de_mod_clock(&ccm->iep_drc0_clk_cfg, 300000000);
+}
+#endif
+
+static void sunxi_hdmi_mode_set(struct fb_videomode *mode,
+                               int clk_div, int clk_double)
+{
+       struct sunxi_hdmi_reg * const hdmi =
+               (struct sunxi_hdmi_reg *)SUNXI_HDMI_BASE;
+       int x, y;
+
+       /* Write clear interrupt status bits */
+       writel(SUNXI_HDMI_IRQ_STATUS_BITS, &hdmi->irq);
+
+       /* Init various registers, select pll3 as clock source */
+       writel(SUNXI_HDMI_VIDEO_POL_TX_CLK, &hdmi->video_polarity);
+       writel(SUNXI_HDMI_PAD_CTRL0_RUN, &hdmi->pad_ctrl0);
+       writel(SUNXI_HDMI_PAD_CTRL1, &hdmi->pad_ctrl1);
+       writel(SUNXI_HDMI_PLL_CTRL, &hdmi->pll_ctrl);
+       writel(SUNXI_HDMI_PLL_DBG0_PLL3, &hdmi->pll_dbg0);
+
+       /* Setup clk div and doubler */
+       clrsetbits_le32(&hdmi->pll_ctrl, SUNXI_HDMI_PLL_CTRL_DIV_MASK,
+                       SUNXI_HDMI_PLL_CTRL_DIV(clk_div));
+       if (!clk_double)
+               setbits_le32(&hdmi->pad_ctrl1, SUNXI_HDMI_PAD_CTRL1_HALVE);
+
+       /* Setup timing registers */
+       writel(SUNXI_HDMI_Y(mode->yres) | SUNXI_HDMI_X(mode->xres),
+              &hdmi->video_size);
+
+       x = mode->hsync_len + mode->left_margin;
+       y = mode->vsync_len + mode->upper_margin;
+       writel(SUNXI_HDMI_Y(y) | SUNXI_HDMI_X(x), &hdmi->video_bp);
+
+       x = mode->right_margin;
+       y = mode->lower_margin;
+       writel(SUNXI_HDMI_Y(y) | SUNXI_HDMI_X(x), &hdmi->video_fp);
+
+       x = mode->hsync_len;
+       y = mode->vsync_len;
+       writel(SUNXI_HDMI_Y(y) | SUNXI_HDMI_X(x), &hdmi->video_spw);
+
+       if (mode->sync & FB_SYNC_HOR_HIGH_ACT)
+               setbits_le32(&hdmi->video_polarity, SUNXI_HDMI_VIDEO_POL_HOR);
+
+       if (mode->sync & FB_SYNC_VERT_HIGH_ACT)
+               setbits_le32(&hdmi->video_polarity, SUNXI_HDMI_VIDEO_POL_VER);
+}
+
+static void sunxi_engines_init(void)
+{
+       sunxi_composer_init();
+       sunxi_lcdc_init();
+#ifdef CONFIG_MACH_SUN6I
+       sunxi_drc_init();
+#endif
+}
+
+static void sunxi_mode_set(struct fb_videomode *mode, unsigned int address)
+{
+       struct sunxi_de_be_reg * const de_be =
+               (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
+       struct sunxi_lcdc_reg * const lcdc =
+               (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
+       struct sunxi_hdmi_reg * const hdmi =
+               (struct sunxi_hdmi_reg *)SUNXI_HDMI_BASE;
+       int clk_div, clk_double;
+       int retries = 3;
+
+retry:
+       clrbits_le32(&hdmi->video_ctrl, SUNXI_HDMI_VIDEO_CTRL_ENABLE);
+       clrbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_TCON_ENABLE);
+       clrbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_START);
+
+       sunxi_composer_mode_set(mode, address);
+       sunxi_lcdc_mode_set(mode, &clk_div, &clk_double);
+       sunxi_hdmi_mode_set(mode, clk_div, clk_double);
+
+       setbits_le32(&de_be->reg_ctrl, SUNXI_DE_BE_REG_CTRL_LOAD_REGS);
+       setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_START);
+
+       udelay(1000000 / mode->refresh + 500);
+
+       setbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_TCON_ENABLE);
+
+       udelay(1000000 / mode->refresh + 500);
+
+       setbits_le32(&hdmi->video_ctrl, SUNXI_HDMI_VIDEO_CTRL_ENABLE);
+
+       udelay(1000000 / mode->refresh + 500);
+
+       /*
+        * Sometimes the display pipeline does not sync up properly, if
+        * this happens the hdmi fifo underrun or overrun bits are set.
+        */
+       if (readl(&hdmi->irq) &
+           (SUNXI_HDMI_IRQ_STATUS_FIFO_UF | SUNXI_HDMI_IRQ_STATUS_FIFO_OF)) {
+               if (retries--)
+                       goto retry;
+               printf("HDMI fifo under or overrun\n");
+       }
+}
+
+void *video_hw_init(void)
+{
+       static GraphicDevice *graphic_device = &sunxi_display.graphic_device;
+       /*
+        * Vesa standard 1024x768@60
+        * 65.0  1024 1048 1184 1344  768 771 777 806  -hsync -vsync
+        */
+       struct fb_videomode mode = {
+               .name = "1024x768",
+               .refresh = 60,
+               .xres = 1024,
+               .yres = 768,
+               .pixclock = 65000,
+               .left_margin = 160,
+               .right_margin = 24,
+               .upper_margin = 29,
+               .lower_margin = 3,
+               .hsync_len = 136,
+               .vsync_len = 6,
+               .sync = 0,
+               .vmode = 0,
+               .flag = 0,
+       };
+       int ret;
+
+       memset(&sunxi_display, 0, sizeof(struct sunxi_display));
+
+       printf("Reserved %dkB of RAM for Framebuffer.\n",
+              CONFIG_SUNXI_FB_SIZE >> 10);
+       gd->fb_base = gd->ram_top;
+
+       ret = sunxi_hdmi_hpd_detect();
+       if (!ret)
+               return NULL;
+
+       printf("HDMI connected.\n");
+       sunxi_display.enabled = true;
+
+       printf("Setting up a %s console.\n", mode.name);
+       sunxi_engines_init();
+       sunxi_mode_set(&mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);
+
+       /*
+        * These are the only members of this structure that are used. All the
+        * others are driver specific. There is nothing to decribe pitch or
+        * stride, but we are lucky with our hw.
+        */
+       graphic_device->frameAdrs = gd->fb_base;
+       graphic_device->gdfIndex = GDF_32BIT_X888RGB;
+       graphic_device->gdfBytesPP = 4;
+       graphic_device->winSizeX = mode.xres;
+       graphic_device->winSizeY = mode.yres;
+
+       return graphic_device;
+}
+
+/*
+ * Simplefb support.
+ */
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_VIDEO_DT_SIMPLEFB)
+int sunxi_simplefb_setup(void *blob)
+{
+       static GraphicDevice *graphic_device = &sunxi_display.graphic_device;
+       int offset, ret;
+
+       if (!sunxi_display.enabled)
+               return 0;
+
+       /* Find a framebuffer node, with pipeline == "de_be0-lcd0-hdmi" */
+       offset = fdt_node_offset_by_compatible(blob, -1,
+                                              "allwinner,simple-framebuffer");
+       while (offset >= 0) {
+               ret = fdt_find_string(blob, offset, "allwinner,pipeline",
+                                     "de_be0-lcd0-hdmi");
+               if (ret == 0)
+                       break;
+               offset = fdt_node_offset_by_compatible(blob, offset,
+                                              "allwinner,simple-framebuffer");
+       }
+       if (offset < 0) {
+               eprintf("Cannot setup simplefb: node not found\n");
+               return 0; /* Keep older kernels working */
+       }
+
+       ret = fdt_setup_simplefb_node(blob, offset, gd->fb_base,
+                       graphic_device->winSizeX, graphic_device->winSizeY,
+                       graphic_device->winSizeX * graphic_device->gdfBytesPP,
+                       "x8r8g8b8");
+       if (ret)
+               eprintf("Cannot setup simplefb: Error setting properties\n");
+
+       return ret;
+}
+#endif /* CONFIG_OF_BOARD_SETUP && CONFIG_VIDEO_DT_SIMPLEFB */
index 943b5bcf35e903382dbc7f928d6577b6874c51c4..258b93791b642e66a791467898e83f12b7a8c832 100644 (file)
@@ -25,6 +25,7 @@
 #include <ext_common.h>
 #include <ext4fs.h>
 #include "ext4_common.h"
+#include <div64.h>
 
 int ext4fs_symlinknest;
 struct ext_filesystem ext_fs;
@@ -67,11 +68,11 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
        if (len > filesize)
                len = filesize;
 
-       blockcnt = ((len + pos) + blocksize - 1) / blocksize;
+       blockcnt = lldiv(((len + pos) + blocksize - 1), blocksize);
 
-       for (i = pos / blocksize; i < blockcnt; i++) {
+       for (i = lldiv(pos, blocksize); i < blockcnt; i++) {
                lbaint_t blknr;
-               int blockoff = pos % blocksize;
+               int blockoff = pos - (blocksize * i);
                int blockend = blocksize;
                int skipfirst = 0;
                blknr = read_allocated_block(&(node->inode), i);
@@ -82,7 +83,7 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
 
                /* Last block.  */
                if (i == blockcnt - 1) {
-                       blockend = (len + pos) % blocksize;
+                       blockend = (len + pos) - (blocksize * i);
 
                        /* The last portion is exactly blocksize. */
                        if (!blockend)
@@ -90,7 +91,7 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
                }
 
                /* First block. */
-               if (i == pos / blocksize) {
+               if (i == lldiv(pos, blocksize)) {
                        skipfirst = blockoff;
                        blockend -= skipfirst;
                }
index 88dd4959ccde28f0e541dfc31f5fb924988685c1..98b88add83c507116bfa05a7927983c785a13a2c 100644 (file)
@@ -13,6 +13,8 @@
 #include <asm/byteorder.h>
 #include <part.h>
 #include <linux/ctype.h>
+#include <div64.h>
+#include <linux/math64.h>
 #include "fat.c"
 
 static void uppercase(char *str, int len)
@@ -770,7 +772,7 @@ static void fill_dentry(fsdata *mydata, dir_entry *dentptr,
  */
 static int check_overflow(fsdata *mydata, __u32 clustnum, loff_t size)
 {
-       __u32 startsect, sect_num;
+       __u32 startsect, sect_num, offset;
 
        if (clustnum > 0) {
                startsect = mydata->data_begin +
@@ -779,13 +781,13 @@ static int check_overflow(fsdata *mydata, __u32 clustnum, loff_t size)
                startsect = mydata->rootdir_sect;
        }
 
-       sect_num = size / mydata->sect_size;
-       if (size % mydata->sect_size)
+       sect_num = div_u64_rem(size, mydata->sect_size, &offset);
+
+       if (offset != 0)
                sect_num++;
 
        if (startsect + sect_num > cur_part_info.start + total_sector)
                return -1;
-
        return 0;
 }
 
diff --git a/fs/fs.c b/fs/fs.c
index 3da78606d1281f93ebe3108b9a7bd8f6e5f31edc..ddd751c9cccc1d4c30ed6d29bf1d55581e208ab7 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -23,6 +23,8 @@
 #include <fs.h>
 #include <sandboxfs.h>
 #include <asm/io.h>
+#include <div64.h>
+#include <linux/math64.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -399,7 +401,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        printf("%llu bytes read in %lu ms", len_read, time);
        if (time > 0) {
                puts(" (");
-               print_size(len_read / time * 1000, "/s");
+               print_size(div_u64(len_read, time) * 1000, "/s");
                puts(")");
        }
        puts("\n");
@@ -469,7 +471,7 @@ int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        printf("%llu bytes written in %lu ms", len, time);
        if (time > 0) {
                puts(" (");
-               print_size(len / time * 1000, "/s");
+               print_size(div_u64(len, time) * 1000, "/s");
                puts(")");
        }
        puts("\n");
index 695e47bf07f46589befccee6028c8ab4ce1e6b27..832c10f5c016c7b4d0f1b0eeecdfd318ae0b8d52 100644 (file)
@@ -387,6 +387,11 @@ extern int board_pci_host_broken(void);
 #define CONFIG_PQ_MDS_PIB      1 /* PQ MDS Platform IO Board */
 
 #define CONFIG_HAS_FSL_DR_USB  1 /* fixup device tree for the DR USB */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_FSL
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 
 #define CONFIG_PCI_PNP         /* do pci plug-and-play */
 
index 1d1f4c0e2224b29769ee462d1bca7af325809a76..8ed0f7c21afee03ee22fb1ab50c4e93860a8cf6e 100644 (file)
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_HAS_FSL_DR_USB
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_FSL
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 
 #define CONFIG_NETDEV          "eth1"
 
index ba3da06dfb062f1bd24697132131efc8890e6c6e..6b29add78e683e45f67aeda7585d1a9548324d6a 100644 (file)
@@ -374,6 +374,49 @@ extern unsigned long get_clock_freq(void);
 #endif
 
 #define CONFIG_EXTRA_ENV_SETTINGS      \
+       "netdev=eth0\0"                                         \
+       "uboot=" __stringify(CONFIG_UBOOTPATH) "\0"             \
+       "loadaddr=1000000\0"                                    \
+       "ubootaddr=" __stringify(CONFIG_SYS_TEXT_BASE) "\0"     \
+       "tftpflash=tftpboot $loadaddr $uboot; "                 \
+               "protect off $ubootaddr +$filesize; "           \
+               "erase $ubootaddr +$filesize; "                 \
+               "cp.b $loadaddr $ubootaddr $filesize; "         \
+               "protect on $ubootaddr +$filesize; "            \
+               "cmp.b $loadaddr $ubootaddr $filesize\0"        \
+       "consoledev=ttyS0\0"                                    \
+       "ramdiskaddr=2000000\0"                                 \
+       "ramdiskfile=rootfs.ext2.gz.uboot\0"                    \
+       "fdtaddr=c00000\0"                                      \
+       "fdtfile=p1023rdb.dtb\0"                                \
+       "othbootargs=ramdisk_size=600000\0"                     \
+       "bdev=sda1\0"                                           \
        "hwconfig=usb1:dr_mode=host,phy_type=ulpi\0"
 
+#define CONFIG_HDBOOT                                  \
+       "setenv bootargs root=/dev/$bdev rw "           \
+       "console=$consoledev,$baudrate $othbootargs;"   \
+       "tftp $loadaddr $bootfile;"                     \
+       "tftp $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_RAMBOOTCOMMAND
+
 #endif /* __CONFIG_H */
index e639e1d57af0f5c88e15b948785593ecb33f1747..48b8dc7fd71f1362dbf1fe19e094d730323ece3c 100644 (file)
@@ -533,7 +533,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_CS3_FTIM1           (FTIM1_GPCM_TACO(0x0e) | \
                                        FTIM1_GPCM_TRAD(0x1f))
 #define CONFIG_SYS_CS3_FTIM2           (FTIM2_GPCM_TCS(0x0e) | \
-                                       FTIM2_GPCM_TCH(0x0) | \
+                                       FTIM2_GPCM_TCH(0x8) | \
                                        FTIM2_GPCM_TWP(0x1f))
 #define CONFIG_SYS_CS3_FTIM3           0x0
 
index aa6b631c5d469cbe575ad2b800c1bff67f496be9..81e8a7c3a362ebedf3d573df6156123bd47ee53a 100644 (file)
@@ -9,6 +9,9 @@
 #ifndef __CONFIG_ARNDALE_H
 #define __CONFIG_ARNDALE_H
 
+#define EXYNOS_FDTFILE_SETTING \
+       "fdtfile=exynos5250-arndale.dtb\0"
+
 #include "exynos5250-common.h"
 
 /* SD/MMC configuration */
@@ -17,8 +20,6 @@
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
-#define CONFIG_CMD_EXT2
-
 /* USB */
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_EXYNOS
index e0bf3dc61e6c0260e61a9cf01132f9e92decee05..8a7447dcd3d73d773b86921b691a76a18b540c32 100644 (file)
@@ -15,6 +15,9 @@
 #define CONFIG_DBAU1X00                1
 #define CONFIG_SOC_AU1X00      1  /* alchemy series cpu */
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #ifdef CONFIG_DBAU1000
 /* Also known as Merlot */
 #define CONFIG_SOC_AU1000      1
index b258cb93c454c7f44f85f535067a6f042776a5f7..1f3ee55098fc8f8289cd882eceecbfa66b8147d6 100644 (file)
@@ -30,9 +30,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-/* Enable fdt support */
-#define CONFIG_OF_LIBFDT
-
 /* Keep L2 Cache Disabled */
 #define CONFIG_CMD_CACHE
 
@@ -42,7 +39,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
-#define CONFIG_CMDLINE_EDITING
 #define CONFIG_ENV_OVERWRITE
 
 /* Size of malloc() pool before and after relocation */
@@ -61,7 +57,6 @@
 #define CONFIG_EXYNOS_DWMMC
 #define CONFIG_BOUNCE_BUFFER
 
-#define CONFIG_BOOTDELAY               3
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 
 /* PWM */
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_MMC
-#define CONFIG_CMD_EXT4
 #define CONFIG_CMD_EXT4_WRITE
-#define CONFIG_CMD_FAT
 #define CONFIG_FAT_WRITE
 #define CONFIG_CMD_FS_GENERIC
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_PART
 #define CONFIG_PARTITION_UUIDS
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser    */
-#define CONFIG_SYS_CBSIZE              256     /* Console I/O Buffer Size */
-#define CONFIG_SYS_PBSIZE              384     /* Print Buffer Size */
+#define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE              1024    /* Print Buffer Size */
 #define CONFIG_SYS_MAXARGS             16      /* max number of command args */
 
 /* Boot Argument Buffer Size */
@@ -96,4 +85,6 @@
 #define CONFIG_SYS_NO_FLASH
 #undef CONFIG_CMD_IMLS
 
+#include <config_distro_defaults.h>
+
 #endif /* __CONFIG_H */
index ba591e7c1ec9435b0b03b6c888735805b5a15173..8f9b780003065960c02b99e4606de6f456a5583c 100644 (file)
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 #define CONFIG_CONSOLE_MUX
 
-#define EXYNOS_DEVICE_SETTINGS \
-               "stdin=serial\0" \
-               "stdout=serial\0" \
-               "stderr=serial\0"
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       EXYNOS_DEVICE_SETTINGS
-
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_NET
 #define CONFIG_CMD_HASH
 
 /* Thermal Management Unit */
 #define CONFIG_ENV_SROM_BANK           1
 #endif /*CONFIG_CMD_NET*/
 
-/* Enable PXE Support */
-#ifdef CONFIG_CMD_NET
-#define CONFIG_CMD_PXE
-#define CONFIG_MENU
-#endif
-
 /* SHA hashing */
 #define CONFIG_CMD_HASH
 #define CONFIG_HASH_VERIFY
 /* Enable Time Command */
 #define CONFIG_CMD_TIME
 
-#define CONFIG_CMD_BOOTZ
-
 #define CONFIG_CMD_GPIO
 
 /* USB boot mode */
 #define CONFIG_FIT
 #define CONFIG_FIT_BEST_MATCH
 
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 1) \
+       func(MMC, mmc, 0) \
+       func(PXE, pxe, na) \
+       func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+#ifndef MEM_LAYOUT_ENV_SETTINGS
+/* 2GB RAM, bootm size of 256M, load scripts after that */
+#define MEM_LAYOUT_ENV_SETTINGS \
+       "bootm_size=0x10000000\0" \
+       "kernel_addr_r=0x42000000\0" \
+       "fdt_addr_r=0x43000000\0" \
+       "ramdisk_addr_r=0x43300000\0" \
+       "scriptaddr=0x50000000\0" \
+       "pxefile_addr_r=0x51000000\0"
+#endif
+
+#ifndef EXYNOS_DEVICE_SETTINGS
+#define EXYNOS_DEVICE_SETTINGS \
+       "stdin=serial\0" \
+       "stdout=serial\0" \
+       "stderr=serial\0"
+#endif
+
+#ifndef EXYNOS_FDTFILE_SETTING
+#define EXYNOS_FDTFILE_SETTING
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       EXYNOS_DEVICE_SETTINGS \
+       EXYNOS_FDTFILE_SETTING \
+       MEM_LAYOUT_ENV_SETTINGS \
+       BOOTENV
+
 #endif /* __CONFIG_EXYNOS5_COMMON_H */
index 66547fa34efe44ba756b67613b857cc039107333..9cef0b0a38f799527ef14693e371417b07bb0a74 100644 (file)
@@ -9,6 +9,13 @@
 #ifndef __CONFIG_EXYNOS5_DT_COMMON_H
 #define __CONFIG_EXYNOS5_DT_COMMON_H
 
+/* Console configuration */
+#undef EXYNOS_DEVICE_SETTINGS
+#define EXYNOS_DEVICE_SETTINGS \
+               "stdin=serial,cros-ec-keyb\0" \
+               "stdout=serial,lcd\0" \
+               "stderr=serial,lcd\0"
+
 #include "exynos5-common.h"
 
 /* PMIC */
 #define CONFIG_CMD_CROS_EC
 #define CONFIG_KEYBOARD
 
-/* Console configuration */
-#undef EXYNOS_DEVICE_SETTINGS
-#define EXYNOS_DEVICE_SETTINGS \
-               "stdin=serial,cros-ec-keyb\0" \
-               "stdout=serial,lcd\0" \
-               "stderr=serial,lcd\0"
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       EXYNOS_DEVICE_SETTINGS
-
 #endif
index 713614f3adcf3f7a1b67078ce4ab6fa1d09e0223..a0107e8b4d4b551a4688c06bf66f73aaee58b73f 100644 (file)
@@ -29,8 +29,6 @@
 
 #define CONFIG_SPL_TEXT_BASE   0x02023400
 
-#define CONFIG_BOOTCOMMAND     "mmc read 40007000 451 2000; bootm 40007000"
-
 #define CONFIG_IRAM_STACK      0x02050000
 
 #define CONFIG_SYS_INIT_SP_ADDR        CONFIG_IRAM_STACK
index b0f940cd164a81dd2031e4d04e40b08847fa2645..ef6e1551ab0086a139e4dc2e03cc95c94d95bdc9 100644 (file)
@@ -10,6 +10,8 @@
 #define __CONFIG_EXYNOS5420_H
 
 #define CONFIG_EXYNOS5420
+/* A variant of Exynos5420 (Exynos5 Family) */
+#define CONFIG_EXYNOS5800
 
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_SPI_FLASH
 
 #define CONFIG_SPL_MAX_FOOTPRINT       (30 * 1024)
 
-#define CONFIG_DEVICE_TREE_LIST "exynos5420-peach-pit exynos5420-smdk5420"
+#define CONFIG_DEVICE_TREE_LIST "exynos5800-peach-pi"  \
+                               "exynos5420-peach-pit exynos5420-smdk5420"
 
 #define CONFIG_MAX_I2C_NUM     11
 
 #define CONFIG_BOARD_REV_GPIO_COUNT    2
 
-#define CONFIG_BOOTCOMMAND     "mmc read 20007000 451 2000; bootm 20007000"
-
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS     2
 
 /*
  */
 #define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_IRAM_TOP - 0x800)
 
-/* DRAM Memory Banks */
-#define CONFIG_NR_DRAM_BANKS   7
-#define SDRAM_BANK_SIZE                (512UL << 20UL) /* 512 MB */
-
 /* Miscellaneous configurable options */
 #define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
 
index b19a60f2bd0213ab09595183352ac3e12dcb06b5..48e10ec8c423120a9235a2c947dceb30b3605f41 100644 (file)
@@ -70,6 +70,11 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_HAS_SERDES
 
 #define CONFIG_FSL_CAAM                        /* Enable CAAM */
+
+#if !defined(CONFIG_SDCARD) && !defined(CONFIG_NAND) && !defined(CONFIG_SPI)
+#define CONFIG_U_QE
+#endif
+
 /*
  * IFC Definitions
  */
@@ -110,6 +115,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_FLASH_QUIET_TEST
 #define CONFIG_FLASH_SHOW_PROGRESS     45
 #define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
+#define CONFIG_SYS_WRITE_SWAPPED_DATA
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     2       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      1024    /* sectors per device */
@@ -273,6 +279,23 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_FSL_ESDHC
 #define CONFIG_GENERIC_MMC
 
+/*
+ * 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
+#define CONFIG_CMD_EXT2
+#endif
+#endif
+
 /*
  * eTSEC
  */
@@ -332,6 +355,8 @@ unsigned long get_board_ddr_clk(void);
 
 #define CONFIG_BOOTDELAY               3
 
+#define CONFIG_SYS_QE_FW_ADDR     0x67f40000
+
 #define CONFIG_EXTRA_ENV_SETTINGS      \
        "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
        "fdt_high=0xcfffffff\0"         \
index e98e102e424727a739dbf68ead6df3983cf420c5..3eac7eea01afec5660d68002de8a10c4a8a308f8 100644 (file)
 
 #define CONFIG_FSL_CAAM                        /* Enable CAAM */
 
+#if !defined(CONFIG_SDCARD) && !defined(CONFIG_NAND) && !defined(CONFIG_SPI)
+#define CONFIG_U_QE
+#endif
+
 /*
  * IFC Definitions
  */
@@ -95,6 +99,7 @@
 #define CONFIG_SYS_FLASH_BANKS_LIST    { CONFIG_SYS_FLASH_BASE_PHYS }
 
 #define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
+#define CONFIG_SYS_WRITE_SWAPPED_DATA
 
 /* CPLD */
 
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
 
+/* EEPROM */
+#ifndef CONFIG_SD_BOOT
+#define CONFIG_ID_EEPROM
+#define CONFIG_SYS_I2C_EEPROM_NXID
+#define CONFIG_SYS_EEPROM_BUS_NUM              1
+#define CONFIG_SYS_I2C_EEPROM_ADDR             0x53
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  5
+#endif
+
 /*
  * MMC
  */
 
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE    /* start of monitor */
 
+#define CONFIG_SYS_QE_FW_ADDR     0x67f40000
+
 /*
  * Environment
  */
index b928af839e839c3070b3d2f391e80fd18a5170a0..807e96bbaab9f676bb13f4cacb38ddb5a1af05b0 100644 (file)
 
 #define CONFIG_CMD_GPIO
 
+/* USB */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_EXYNOS
+#define CONFIG_USB_STORAGE
+
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS     3
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+
 /*
  * Supported Odroid boards: X3, U3
  * TODO: Add Odroid X support
index da9d6a1ee1e5cae2613eb1eade2f9864b741305b..8f1e25696e8b419ad93b31d0109f85c09952ece2 100644 (file)
 #undef CONFIG_CMD_PING
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FS_GENERIC
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 #undef CONFIG_CMD_NET
 #undef CONFIG_CMD_NFS
 
 #define COPY_BL2_FNPTR_ADDR    0x02020030
 #define CONFIG_SPL_TEXT_BASE   0x02021410
 
-#define CONFIG_BOOTCOMMAND     "fatload mmc 0 40007000 uImage; bootm 40007000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "loadaddr=0x40007000\0" \
+       "rdaddr=0x48000000\0" \
+       "kerneladdr=0x40007000\0" \
+       "ramdiskaddr=0x48000000\0" \
+       "console=ttySAC2,115200n8\0" \
+       "mmcdev=0\0" \
+       "bootenv=uEnv.txt\0" \
+       "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+       "importbootenv=echo Importing environment from mmc ...; " \
+               "env import -t $loadaddr $filesize\0" \
+        "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+        "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
+                "source ${loadaddr}\0"
+#define CONFIG_BOOTCOMMAND \
+       "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 loadbootscript; then " \
+                       "run bootscript; " \
+               "fi; " \
+       "fi;" \
+       "load mmc ${mmcdev} ${loadaddr} uImage; bootm ${loadaddr} "
 
 #define CONFIG_IDENT_STRING            " for ORIGEN"
 
index 1c04a58e9fed7428afaa517c89dc5d68c4c39c08..61e6af384d4b21d5a957aa668d0bceed05566eef 100644 (file)
@@ -15,6 +15,9 @@
 #define CONFIG_PB1X00          1
 #define CONFIG_SOC_AU1X00      1  /* alchemy series cpu */
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #ifdef CONFIG_PB1000
 #define CONFIG_SOC_AU1000      1
 #else
diff --git a/include/configs/peach-pi.h b/include/configs/peach-pi.h
new file mode 100644 (file)
index 0000000..8a82402
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * Configuration settings for the SAMSUNG/GOOGLE PEACH-PI board.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_PEACH_PI_H
+#define __CONFIG_PEACH_PI_H
+
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SPI_FLASH
+#define CONFIG_ENV_SPI_BASE    0x12D30000
+#define FLASH_SIZE             (0x4 << 20)
+#define CONFIG_ENV_OFFSET      (FLASH_SIZE - CONFIG_BL2_SIZE)
+
+#include <configs/exynos5420-common.h>
+#include <configs/exynos5-dt-common.h>
+
+#define CONFIG_BOARD_COMMON
+
+/* select serial console configuration */
+#define CONFIG_SERIAL3         /* use SERIAL 3 */
+
+#define CONFIG_SYS_PROMPT      "Peach-Pi # "
+#define CONFIG_IDENT_STRING    " for Peach-Pi"
+
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPP                        LCD_COLOR16
+#endif
+
+#define CONFIG_POWER_TPS65090_EC
+#define CONFIG_CROS_EC_SPI             /* Support CROS_EC over SPI */
+#define CONFIG_DM_CROS_EC
+
+#define CONFIG_USB_XHCI
+#define CONFIG_USB_XHCI_EXYNOS
+
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE                (512UL << 20UL) /* 512 MB */
+
+#endif /* __CONFIG_PEACH_PI_H */
index 91bd37d6bca60fb9dfa9bc88ff61da2fad4bf8df..ad5db57f5f94678591d2c6f2398cd3ca83ed2bd9 100644 (file)
@@ -23,8 +23,8 @@
 /* select serial console configuration */
 #define CONFIG_SERIAL3         /* use SERIAL 3 */
 
-#define CONFIG_SYS_PROMPT      "Peach # "
-#define CONFIG_IDENT_STRING    " for Peach"
+#define CONFIG_SYS_PROMPT      "Peach-Pit # "
+#define CONFIG_IDENT_STRING    " for Peach-Pit"
 
 #define CONFIG_VIDEO_PARADE
 
@@ -43,4 +43,8 @@
 #define CONFIG_USB_XHCI
 #define CONFIG_USB_XHCI_EXYNOS
 
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   4
+#define SDRAM_BANK_SIZE                (512UL << 20UL) /* 512 MB */
+
 #endif /* __CONFIG_PEACH_PIT_H */
index 98ed8bc97f12c30ef146ee2895ff3503e7e0a324..1548d3e682d99bdb64a59d3b2475468e7ef69a0e 100644 (file)
@@ -13,6 +13,9 @@
 #define __CONFIG_H
 
 #define CONFIG_QEMU_MIPS
+
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_MISC_INIT_R
 
 #define CONFIG_BOOTDELAY       10      /* autoboot after 10 seconds */
index e8f5a4c9e8bdb21c48df7e7c0828b881ef81e87e..61cafadd7cf47872cbdc026c861109ff43a6d558 100644 (file)
@@ -13,6 +13,9 @@
 #define __CONFIG_H
 
 #define CONFIG_QEMU_MIPS
+
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_MISC_INIT_R
 
 #define CONFIG_BOOTDELAY       10      /* autoboot after 10 seconds */
index b83c15f01fcdb415c05eb6cd57c57b4c1e13cee0..71eb81c2f726792ae4a61513d57ee144462c430d 100644 (file)
@@ -23,6 +23,8 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x0
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
 
 /* input clock of PLL (the SMDK2410 has 12MHz input clock) */
index fd2d482e4ae912c1a8f58cfd26ba798cd14938fa..5c9a3c0b21b676e5d09d13796abdac1fbbd71b6d 100644 (file)
@@ -23,4 +23,8 @@
 #define CONFIG_IDENT_STRING    " for SMDK5420"
 #define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
 
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE                (512UL << 20UL) /* 512 MB */
+
 #endif /* __CONFIG_SMDK5420_H */
index 36295876fd87fe6367afe20b1cb38befdb99da8d..f6b1b3edc12f0cf2c5f2ffb676a3e121517571ef 100644 (file)
@@ -23,7 +23,6 @@
 #endif
 
 #define CONFIG_ARMV7_PSCI              1
-#define CONFIG_ARMV7_PSCI_NR_CPUS      2
 #define CONFIG_ARMV7_SECURE_BASE       SUNXI_SRAM_B_BASE
 #define CONFIG_SYS_CLK_FREQ            24000000
 
index ce038eddf04b1858cc87bf22fc87709301559599..3f890b2fb0338f63fbf46655189f9d27b55699d8 100644 (file)
 #define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_CMD_GPIO
 
+#ifdef CONFIG_VIDEO
+/*
+ * The amount of RAM that is reserved for the FB. This will not show up as
+ * RAM to the kernel, but will be reclaimed by a KMS driver in future.
+ */
+#define CONFIG_SUNXI_FB_SIZE (8 << 20)
+
+/* Do we want to initialize a simple FB? */
+#define CONFIG_VIDEO_DT_SIMPLEFB
+
+#define CONFIG_VIDEO_SUNXI
+
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VIDEO_LOGO
+
+/* allow both serial and cfb console. */
+#define CONFIG_CONSOLE_MUX
+/* stop x86 thinking in cfbconsole from trying to init a pc keyboard */
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+
+#define CONFIG_SYS_MEM_TOP_HIDE ((CONFIG_SUNXI_FB_SIZE + 0xFFF) & ~0xFFF)
+
+/* To be able to hook simplefb into dt */
+#ifdef CONFIG_VIDEO_DT_SIMPLEFB
+#define CONFIG_OF_BOARD_SETUP
+#endif
+
+#endif /* CONFIG_VIDEO */
+
 /* Ethernet support */
 #ifdef CONFIG_SUNXI_EMAC
 #define CONFIG_MII                     /* MII PHY management           */
 #define CONFIG_USB_STORAGE
 #endif
 
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_PREBOOT
+#define CONFIG_SYS_STDIO_DEREGISTER
+#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
+#endif
+
 #if !defined CONFIG_ENV_IS_IN_MMC && \
     !defined CONFIG_ENV_IS_IN_NAND && \
     !defined CONFIG_ENV_IS_IN_FAT && \
 #endif
 
 #define CONFIG_MISC_INIT_R
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
 #ifndef CONFIG_SPL_BUILD
 #include <config_distro_defaults.h>
 
 #include <config_distro_bootcmd.h>
 
+#ifdef CONFIG_USB_KEYBOARD
+#define CONSOLE_STDIN_SETTINGS \
+       "preboot=usb start\0" \
+       "stdin=serial,usbkbd\0"
+#else
+#define CONSOLE_STDIN_SETTINGS \
+       "stdin=serial\0"
+#endif
+
+#ifdef CONFIG_VIDEO
+#define CONSOLE_STDOUT_SETTINGS \
+       "stdout=serial,vga\0" \
+       "stderr=serial,vga\0"
+#else
+#define CONSOLE_STDOUT_SETTINGS \
+       "stdout=serial\0" \
+       "stderr=serial\0"
+#endif
+
+#define CONSOLE_ENV_SETTINGS \
+       CONSOLE_STDIN_SETTINGS \
+       CONSOLE_STDOUT_SETTINGS
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
+       CONSOLE_ENV_SETTINGS \
        MEM_LAYOUT_ENV_SETTINGS \
        "fdtfile=" CONFIG_FDTFILE "\0" \
        "console=ttyS0,115200\0" \
index 7c4dba0387e126f72f7de1d49ebb4829fe2560ad..2140fccc5a4ec27e38e5f472d17e80bae17be8eb 100644 (file)
@@ -112,7 +112,6 @@ are defined. Select only one of them."
 #define CONFIG_SYS_LONGHELP            /* undef to save memory */
 
 #define CONFIG_CMDLINE_EDITING         /* add command line history     */
-#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
 #define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
 /* Print Buffer Size */
 #define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
@@ -143,15 +142,6 @@ are defined. Select only one of them."
  */
 #define CONFIG_ARP_TIMEOUT     500UL  /* 0.5 msec */
 
-/*
- * Command line configuration.
- */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_TIME
-#define CONFIG_CMD_NAND                /* NAND flash suppport */
-
 #define CONFIG_SYS_MAX_NAND_DEVICE                     1
 #define CONFIG_SYS_NAND_MAX_CHIPS                      2
 #define CONFIG_SYS_NAND_ONFI_DETECTION
@@ -167,7 +157,6 @@ are defined. Select only one of them."
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS                  0
 
 /* USB */
-#define CONFIG_CMD_USB
 #define CONFIG_USB_MAX_CONTROLLER_COUNT                2
 #define CONFIG_CMD_FAT
 #define CONFIG_FAT_WRITE
@@ -225,10 +214,6 @@ are defined. Select only one of them."
        "add_default_bootargs=setenv bootargs $bootargs"                \
                " console=ttyS0,$baudrate\0"                            \
 
-/* FIT support */
-#define CONFIG_FIT
-#define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
-
 /* Open Firmware flat tree */
 #define CONFIG_OF_LIBFDT
 
index 217ba2fbd9b22bfb68433fce18578b959ad7d246..83e4163e3f897e802443416ed8e9b155dd101178 100644 (file)
@@ -25,6 +25,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #define CPU_CLOCK_RATE                 324000000 /* Clock for the MIPS core */
 #define CONFIG_SYS_MIPS_TIMER_FREQ     (CPU_CLOCK_RATE / 2)
 
index 55cef94358bcd9ed1db349493941addc901d1ff4..1f19fe4c9622a84c365f500ff80b2b72bb61baf1 100644 (file)
@@ -64,7 +64,20 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {}
 int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose);
 #endif
 
-void ft_board_setup(void *blob, bd_t *bd);
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
+ * Add board-specific data to the FDT before booting the OS.
+ *
+ * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_BOARD_SETUP is defined
+ *
+ * @param blob         FDT blob to update
+ * @param bd_t         Pointer to board data
+ * @return 0 if ok, or -FDT_ERR_... on error
+ */
+int ft_board_setup(void *blob, bd_t *bd);
+
 /*
  * The keystone2 SOC requires all 32 bit aliased addresses to be converted
  * to their 36 physical format. This has to happen after all fdt nodes
@@ -75,6 +88,18 @@ void ft_board_setup_ex(void *blob, bd_t *bd);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
+/**
+ * Add system-specific data to the FDT before booting the OS.
+ *
+ * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_SYSTEM_SETUP is defined
+ *
+ * @param blob         FDT blob to update
+ * @param bd_t         Pointer to board data
+ * @return 0 if ok, or -FDT_ERR_... on error
+ */
+int ft_system_setup(void *blob, bd_t *bd);
+
 void set_working_fdt_addr(void *addr);
 int fdt_shrink_to_minimum(void *blob);
 int fdt_increase_size(void *fdt, int add_len);
@@ -147,6 +172,9 @@ void of_bus_default_count_cells(void *blob, int parentoffset,
 int ft_verify_fdt(void *fdt);
 int arch_fixup_memory_node(void *blob);
 
+int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
+                           u32 height, u32 stride, const char *format);
+
 #endif /* ifdef CONFIG_OF_LIBFDT */
 
 #ifdef USE_HOSTCC
index ea9289454591c4ae898de36b97804fefff76ba7e..c010bd87f788280a768bae1db29e539c8dce11fd 100644 (file)
@@ -616,17 +616,33 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node,
  * @param blob         FDT blob
  * @param node         node to examine
  * @param prop_name    name of property to find
- * @param ptrp         returns pointer to region, or NULL if no address
- * @param size         returns size of region
- * @return 0 if ok, -1 on error (propery not found)
+ * @param basep                Returns base address of region
+ * @param size         Returns size of region
+ * @return 0 if ok, -1 on error (property not found)
  */
-int fdtdec_decode_region(const void *blob, int node,
-               const char *prop_name, void **ptrp, size_t *size);
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+                        fdt_addr_t *basep, fdt_size_t *sizep);
+
+enum fmap_compress_t {
+       FMAP_COMPRESS_NONE,
+       FMAP_COMPRESS_LZO,
+};
+
+enum fmap_hash_t {
+       FMAP_HASH_NONE,
+       FMAP_HASH_SHA1,
+       FMAP_HASH_SHA256,
+};
 
 /* A flash map entry, containing an offset and length */
 struct fmap_entry {
        uint32_t offset;
        uint32_t length;
+       uint32_t used;                  /* Number of bytes used in region */
+       enum fmap_compress_t compress_algo;     /* Compression type */
+       enum fmap_hash_t hash_algo;             /* Hash algorithm */
+       const uint8_t *hash;                    /* Hash value */
+       int hash_size;                          /* Hash size */
 };
 
 /**
@@ -682,4 +698,31 @@ int fdt_get_named_resource(const void *fdt, int node, const char *property,
  */
 int fdtdec_pci_get_bdf(const void *fdt, int node, int *bdf);
 
+/**
+ * Decode a named region within a memory bank of a given type.
+ *
+ * This function handles selection of a memory region. The region is
+ * specified as an offset/size within a particular type of memory.
+ *
+ * The properties used are:
+ *
+ *     <mem_type>-memory<suffix> for the name of the memory bank
+ *     <mem_type>-offset<suffix> for the offset in that bank
+ *
+ * The property value must have an offset and a size. The function checks
+ * that the region is entirely within the memory bank.5
+ *
+ * @param blob         FDT blob
+ * @param node         Node containing the properties (-1 for /config)
+ * @param mem_type     Type of memory to use, which is a name, such as
+ *                     "u-boot" or "kernel".
+ * @param suffix       String to append to the memory/offset
+ *                     property names
+ * @param basep                Returns base of region
+ * @param sizep                Returns size of region
+ * @return 0 if OK, -ive on error
+ */
+int fdtdec_decode_memory_region(const void *blob, int node,
+                               const char *mem_type, const char *suffix,
+                               fdt_addr_t *basep, fdt_size_t *sizep);
 #endif
index 1a6c9c1636638f3977db5f3dfbc77bc01392f03a..e4902aac96d2bd102e73d0cb3581a2ed03e35953 100644 (file)
@@ -85,4 +85,81 @@ struct ccsr_usb_phy {
 #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK 0x07
 #endif
 
+/* USB Erratum Checking code */
+#ifdef CONFIG_PPC
+static inline bool has_erratum_a006261(void)
+{
+       u32 svr = get_svr();
+       u32 soc = SVR_SOC_VER(svr);
+
+       switch (soc) {
+       case SVR_P1010:
+               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+       case SVR_P2041:
+       case SVR_P2040:
+               return IS_SVR_REV(svr, 1, 0) ||
+                       IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 1);
+       case SVR_P3041:
+               return IS_SVR_REV(svr, 1, 0) ||
+                       IS_SVR_REV(svr, 1, 1) ||
+                       IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
+       case SVR_P5010:
+       case SVR_P5020:
+       case SVR_P5021:
+               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+       case SVR_T4240:
+       case SVR_T4160:
+       case SVR_T4080:
+               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+       case SVR_T1040:
+               return IS_SVR_REV(svr, 1, 0);
+       case SVR_T2080:
+       case SVR_T2081:
+               return IS_SVR_REV(svr, 1, 0);
+       case SVR_P5040:
+               return IS_SVR_REV(svr, 1, 0);
+       }
+
+       return false;
+}
+
+static inline bool has_erratum_a007075(void)
+{
+       u32 svr = get_svr();
+       u32 soc = SVR_SOC_VER(svr);
+
+       switch (soc) {
+       case SVR_B4860:
+       case SVR_B4420:
+               return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+       case SVR_P1010:
+               return IS_SVR_REV(svr, 1, 0);
+       case SVR_P4080:
+               return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
+       }
+       return false;
+}
+
+static inline bool has_erratum_a007798(void)
+{
+       return SVR_SOC_VER(get_svr()) == SVR_T4240 &&
+               IS_SVR_REV(get_svr(), 2, 0);
+}
+#else
+static inline bool has_erratum_a006261(void)
+{
+       return false;
+}
+
+static inline bool has_erratum_a007075(void)
+{
+       return false;
+}
+
+static inline bool has_erratum_a007798(void)
+{
+       return false;
+}
+
+#endif
 #endif /*_ASM_FSL_USB_H_ */
index 07e9aed16d95190b3cebe2f19dcb29ef15ab63b2..af30d601585e3bf0124b590a41a3cf863e494a31 100644 (file)
@@ -119,6 +119,12 @@ struct lmb;
 # define IMAGE_OF_BOARD_SETUP          0
 #endif
 
+#ifdef CONFIG_OF_SYSTEM_SETUP
+# define IMAGE_OF_SYSTEM_SETUP 1
+#else
+# define IMAGE_OF_SYSTEM_SETUP 0
+#endif
+
 /*
  * Operating System Codes
  */
index b4950776977e5440a75873065b753c472798a73e..d430ed0e32b2fc4476961e7db99b3476e31c2d38 100644 (file)
@@ -41,6 +41,7 @@ typedef enum {
        PHY_INTERFACE_MODE_MII,
        PHY_INTERFACE_MODE_GMII,
        PHY_INTERFACE_MODE_SGMII,
+       PHY_INTERFACE_MODE_SGMII_2500,
        PHY_INTERFACE_MODE_QSGMII,
        PHY_INTERFACE_MODE_TBI,
        PHY_INTERFACE_MODE_RMII,
@@ -57,6 +58,7 @@ static const char *phy_interface_strings[] = {
        [PHY_INTERFACE_MODE_MII]                = "mii",
        [PHY_INTERFACE_MODE_GMII]               = "gmii",
        [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
+       [PHY_INTERFACE_MODE_SGMII_2500]         = "sgmii-2500",
        [PHY_INTERFACE_MODE_QSGMII]             = "qsgmii",
        [PHY_INTERFACE_MODE_TBI]                = "tbi",
        [PHY_INTERFACE_MODE_RMII]               = "rmii",
index c2a772a8951eea4a2373eef22e849bb745d83e90..b0e42550a2a4eb3bfd591aca3de0a67c1c1f4e34 100644 (file)
@@ -150,6 +150,7 @@ enum {
 
 int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV);
 int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode);
+int max77686_set_buck_voltage(struct pmic *p, int buck, ulong uV);
 int max77686_set_buck_mode(struct pmic *p, int buck, char opmode);
 
 #define MAX77686_LDO_VOLT_MAX_HEX      0x3f
@@ -159,6 +160,8 @@ int max77686_set_buck_mode(struct pmic *p, int buck, char opmode);
 #define MAX77686_LDO_MODE_STANDBY      (0x01 << 0x06)
 #define MAX77686_LDO_MODE_LPM          (0x02 << 0x06)
 #define MAX77686_LDO_MODE_ON           (0x03 << 0x06)
+#define MAX77686_BUCK_VOLT_MAX_HEX     0x3f
+#define MAX77686_BUCK_VOLT_MASK                0x3f
 #define MAX77686_BUCK_MODE_MASK                0x03
 #define MAX77686_BUCK_MODE_SHIFT_1     0x00
 #define MAX77686_BUCK_MODE_SHIFT_2     0x04
index dd77ad63254f94d03355501c9ed3a21da97826bd..897018bf84c942ec7a6dad04324c26cdf381e06a 100644 (file)
 #elif defined(CONFIG_MPC512X)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_MPC512x_USB1_ADDR
 #define CONFIG_SYS_FSL_USB2_ADDR       0
+#elif defined(CONFIG_LS102XA)
+#define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_LS102XA_USB1_ADDR
+#define CONFIG_SYS_FSL_USB2_ADDR        0
 #endif
 
 /*
index 0d1d5d55a92a67334e9d33ebd339360b504d2898..a8872b058961a4419338e965f474272ef90d52a9 100644 (file)
@@ -694,20 +694,25 @@ char *fdtdec_get_config_string(const void *blob, const char *prop_name)
        return (char *)nodep;
 }
 
-int fdtdec_decode_region(const void *blob, int node,
-               const char *prop_name, void **ptrp, size_t *size)
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+                        fdt_addr_t *basep, fdt_size_t *sizep)
 {
        const fdt_addr_t *cell;
        int len;
 
-       debug("%s: %s\n", __func__, prop_name);
+       debug("%s: %s: %s\n", __func__, fdt_get_name(blob, node, NULL),
+             prop_name);
        cell = fdt_getprop(blob, node, prop_name, &len);
-       if (!cell || (len != sizeof(fdt_addr_t) * 2))
+       if (!cell || (len < sizeof(fdt_addr_t) * 2)) {
+               debug("cell=%p, len=%d\n", cell, len);
                return -1;
+       }
+
+       *basep = fdt_addr_to_cpu(*cell);
+       *sizep = fdt_size_to_cpu(cell[1]);
+       debug("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep,
+             (ulong)*sizep);
 
-       *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size);
-       *size = fdt_size_to_cpu(cell[1]);
-       debug("%s: size=%zx\n", __func__, *size);
        return 0;
 }
 
@@ -723,6 +728,7 @@ int fdtdec_decode_region(const void *blob, int node,
 int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
                           struct fmap_entry *entry)
 {
+       const char *prop;
        u32 reg[2];
 
        if (fdtdec_get_int_array(blob, node, "reg", reg, 2)) {
@@ -731,6 +737,13 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
        }
        entry->offset = reg[0];
        entry->length = reg[1];
+       entry->used = fdtdec_get_int(blob, node, "used", entry->length);
+       prop = fdt_getprop(blob, node, "compress", NULL);
+       entry->compress_algo = prop && !strcmp(prop, "lzo") ?
+               FMAP_COMPRESS_LZO : FMAP_COMPRESS_NONE;
+       prop = fdt_getprop(blob, node, "hash", &entry->hash_size);
+       entry->hash_algo = prop ? FMAP_HASH_SHA256 : FMAP_HASH_NONE;
+       entry->hash = (uint8_t *)prop;
 
        return 0;
 }
@@ -805,4 +818,65 @@ int fdtdec_pci_get_bdf(const void *fdt, int node, int *bdf)
 
        return 0;
 }
+
+int fdtdec_decode_memory_region(const void *blob, int config_node,
+                               const char *mem_type, const char *suffix,
+                               fdt_addr_t *basep, fdt_size_t *sizep)
+{
+       char prop_name[50];
+       const char *mem;
+       fdt_size_t size, offset_size;
+       fdt_addr_t base, offset;
+       int node;
+
+       if (config_node == -1) {
+               config_node = fdt_path_offset(blob, "/config");
+               if (config_node < 0) {
+                       debug("%s: Cannot find /config node\n", __func__);
+                       return -ENOENT;
+               }
+       }
+       if (!suffix)
+               suffix = "";
+
+       snprintf(prop_name, sizeof(prop_name), "%s-memory%s", mem_type,
+                suffix);
+       mem = fdt_getprop(blob, config_node, prop_name, NULL);
+       if (!mem) {
+               debug("%s: No memory type for '%s', using /memory\n", __func__,
+                     prop_name);
+               mem = "/memory";
+       }
+
+       node = fdt_path_offset(blob, mem);
+       if (node < 0) {
+               debug("%s: Failed to find node '%s': %s\n", __func__, mem,
+                     fdt_strerror(node));
+               return -ENOENT;
+       }
+
+       /*
+        * Not strictly correct - the memory may have multiple banks. We just
+        * use the first
+        */
+       if (fdtdec_decode_region(blob, node, "reg", &base, &size)) {
+               debug("%s: Failed to decode memory region %s\n", __func__,
+                     mem);
+               return -EINVAL;
+       }
+
+       snprintf(prop_name, sizeof(prop_name), "%s-offset%s", mem_type,
+                suffix);
+       if (fdtdec_decode_region(blob, config_node, prop_name, &offset,
+                                &offset_size)) {
+               debug("%s: Failed to decode memory region '%s'\n", __func__,
+                     prop_name);
+               return -EINVAL;
+       }
+
+       *basep = base + offset;
+       *sizep = offset_size;
+
+       return 0;
+}
 #endif