]> git.sur5r.net Git - u-boot/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-tegra
authorTom Rini <trini@konsulko.com>
Wed, 29 Jul 2015 22:58:39 +0000 (18:58 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 29 Jul 2015 22:58:39 +0000 (18:58 -0400)
173 files changed:
Kbuild
Kconfig
Makefile
README
arch/Kconfig
arch/arm/Kconfig
arch/arm/cpu/armv7/am33xx/sys_info.c
arch/arm/cpu/armv7/omap-common/Makefile
arch/arm/cpu/armv7/omap-common/boot-common.c
arch/arm/cpu/armv7/omap-common/hwinit-common.c
arch/arm/cpu/armv7/omap-common/lowlevel_init.S
arch/arm/cpu/armv7/omap3/Makefile
arch/arm/cpu/armv7/omap3/board.c
arch/arm/cpu/armv7/omap3/boot.c [new file with mode: 0644]
arch/arm/cpu/armv7/omap3/lowlevel_init.S
arch/arm/cpu/armv7/omap3/sys_info.c
arch/arm/cpu/armv7/omap4/Makefile
arch/arm/cpu/armv7/omap4/boot.c [new file with mode: 0644]
arch/arm/cpu/armv7/omap4/prcm-regs.c
arch/arm/cpu/armv7/omap5/Makefile
arch/arm/cpu/armv7/omap5/boot.c [new file with mode: 0644]
arch/arm/cpu/armv7/sunxi/dram_sun8i_a23.c
arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c
arch/arm/cpu/armv7m/stm32f4/clock.c
arch/arm/cpu/armv8/Makefile
arch/arm/cpu/armv8/zynqmp/Kconfig [new file with mode: 0644]
arch/arm/cpu/armv8/zynqmp/Makefile
arch/arm/cpu/armv8/zynqmp/mp.c
arch/arm/cpu/armv8/zynqmp/slcr.c [new file with mode: 0644]
arch/arm/dts/Makefile
arch/arm/dts/zynq-7000.dtsi
arch/arm/dts/zynq-zc702.dts
arch/arm/dts/zynq-zc706.dts
arch/arm/dts/zynq-zc770-xm010.dts
arch/arm/dts/zynq-zc770-xm011.dts [new file with mode: 0644]
arch/arm/dts/zynq-zc770-xm012.dts
arch/arm/dts/zynq-zc770-xm013.dts
arch/arm/dts/zynq-zed.dts
arch/arm/dts/zynq-zybo.dts
arch/arm/include/asm/arch-am33xx/omap.h
arch/arm/include/asm/arch-am33xx/spl.h
arch/arm/include/asm/arch-am33xx/sys_proto.h
arch/arm/include/asm/arch-omap3/omap.h
arch/arm/include/asm/arch-omap3/spl.h
arch/arm/include/asm/arch-omap3/sys_proto.h
arch/arm/include/asm/arch-omap4/omap.h
arch/arm/include/asm/arch-omap4/spl.h
arch/arm/include/asm/arch-omap5/omap.h
arch/arm/include/asm/arch-omap5/spl.h
arch/arm/include/asm/arch-stm32f4/stm32.h
arch/arm/include/asm/arch-zynqmp/hardware.h
arch/arm/include/asm/arch-zynqmp/sys_proto.h
arch/arm/include/asm/global_data.h
arch/arm/include/asm/omap_boot.h [deleted file]
arch/arm/include/asm/omap_common.h
arch/arm/include/asm/ti-common/sys_proto.h
arch/arm/mach-keystone/cmd_mon.c
arch/powerpc/Kconfig
arch/x86/Kconfig
arch/x86/cpu/cpu.c
arch/x86/cpu/interrupts.c
arch/x86/cpu/ivybridge/gma.c
arch/x86/cpu/ivybridge/lpc.c
arch/x86/cpu/ivybridge/sdram.c
arch/x86/cpu/pci.c
arch/x86/cpu/qemu/pci.c
arch/x86/cpu/queensbay/Makefile
arch/x86/cpu/queensbay/tnc.c
arch/x86/cpu/queensbay/tnc_pci.c [deleted file]
arch/x86/dts/chromebook_link.dts
arch/x86/dts/chromebox_panther.dts
arch/x86/dts/crownbay.dts
arch/x86/dts/galileo.dts
arch/x86/dts/minnowmax.dts
arch/x86/dts/qemu-x86_i440fx.dts
arch/x86/dts/qemu-x86_q35.dts
arch/x86/dts/rtc.dtsi
arch/x86/include/asm/arch-qemu/qemu.h
arch/x86/include/asm/interrupt.h
arch/x86/include/asm/mpspec.h
arch/x86/include/asm/mtrr.h
arch/x86/include/asm/pci.h
arch/x86/include/asm/ptrace.h
arch/x86/lib/fsp/fsp_dram.c
arch/x86/lib/mpspec.c
arch/x86/lib/pirq_routing.c
arch/x86/lib/zimage.c
board/compulab/cm_t54/cm_t54.c
board/st/stm32f429-discovery/stm32f429-discovery.c
board/sunxi/dram_sun4i_auto.c
board/sunxi/dram_sun5i_auto.c
board/ti/ks2_evm/README
board/ti/ks2_evm/board.c
board/xilinx/zynq/Makefile
board/xilinx/zynqmp/Kconfig [deleted file]
board/xilinx/zynqmp/MAINTAINERS
board/xilinx/zynqmp/zynqmp.c
common/board_info.c
common/cmd_mp.c
configs/am3517_evm_defconfig
configs/chromebook_link_defconfig
configs/chromebox_panther_defconfig
configs/crownbay_defconfig
configs/galileo_defconfig
configs/minnowmax_defconfig
configs/qemu-x86_defconfig
configs/xilinx_zynqmp_defconfig [deleted file]
configs/xilinx_zynqmp_ep_defconfig [new file with mode: 0644]
configs/zynq_zc770_xm011_defconfig [new file with mode: 0644]
doc/device-tree-bindings/spi/spi-zynq.txt
drivers/misc/pca9551_led.c
drivers/net/keystone_net.c
drivers/net/zynq_gem.c
drivers/pci/pci-uclass.c
drivers/pci/pci_auto.c
drivers/pci/pci_common.c
drivers/spi/zynq_spi.c
include/configs/adp-ag101.h
include/configs/adp-ag101p.h
include/configs/adp-ag102.h
include/configs/am3517_evm.h
include/configs/am43xx_evm.h
include/configs/k2e_evm.h
include/configs/k2hk_evm.h
include/configs/k2l_evm.h
include/configs/ks2_evm.h [deleted file]
include/configs/nokia_rx51.h
include/configs/omap3_overo.h
include/configs/pepper.h
include/configs/siemens-am33x-common.h
include/configs/stm32f429-discovery.h
include/configs/ti_am335x_common.h
include/configs/ti_armv7_common.h
include/configs/ti_armv7_keystone2.h [new file with mode: 0644]
include/configs/ti_armv7_omap.h [new file with mode: 0644]
include/configs/ti_omap3_common.h
include/configs/ti_omap4_common.h
include/configs/ti_omap5_common.h
include/configs/xilinx_zynqmp.h
include/configs/xilinx_zynqmp_ep.h [new file with mode: 0644]
include/configs/zynq_zc770.h
include/linker_lists.h
scripts/Kbuild.include
scripts/Makefile.autoconf
scripts/Makefile.build
scripts/Makefile.clean
scripts/Makefile.lib
scripts/kconfig/Makefile
scripts/kconfig/conf.c
scripts/kconfig/confdata.c
scripts/kconfig/expr.c
scripts/kconfig/expr.h
scripts/kconfig/gconf.c
scripts/kconfig/list.h
scripts/kconfig/lkc.h
scripts/kconfig/lkc_proto.h
scripts/kconfig/lxdialog/check-lxdialog.sh
scripts/kconfig/mconf.c
scripts/kconfig/menu.c
scripts/kconfig/merge_config.sh
scripts/kconfig/nconf.c
scripts/kconfig/qconf.cc
scripts/kconfig/symbol.c
scripts/kconfig/util.c
tools/.gitignore
tools/Makefile
tools/buildman/README
tools/default_image.c
tools/mpc86x_clk.c [deleted file]
tools/patman/README
tools/patman/__init__.py [new file with mode: 0644]
tools/patman/patman.py
tools/patman/setup.py [new file with mode: 0644]

diff --git a/Kbuild b/Kbuild
index 465b930f625a73e7b939cb93c3a31f97f01e28bb..e2e3b2995f16ef68abaef1d15acd8d4aa1ef6eb4 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -36,7 +36,7 @@ endef
 generic-offsets-file := include/generated/generic-asm-offsets.h
 
 always  := $(generic-offsets-file)
-targets := $(generic-offsets-file) lib/asm-offsets.s
+targets := lib/asm-offsets.s
 
 # We use internal kbuild rules to avoid the "is up to date" message from make
 lib/asm-offsets.s: lib/asm-offsets.c FORCE
@@ -55,7 +55,6 @@ offsets-file := include/generated/asm-offsets.h
 endif
 
 always  += $(offsets-file)
-targets += $(offsets-file)
 targets += arch/$(ARCH)/lib/asm-offsets.s
 
 CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
diff --git a/Kconfig b/Kconfig
index 15e15af5b3c59510614b9e6cef03bdd1968a49ed..fc69189217a15d63b701f74cff93e3cd97964aa6 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -178,7 +178,7 @@ config SYS_EXTRA_OPTIONS
          new boards should not use this option.
 
 config SYS_TEXT_BASE
-       depends on SPARC || ARC || X86 || ARCH_UNIPHIER
+       depends on SPARC || ARC || X86 || ARCH_UNIPHIER || ARCH_ZYNQMP
        hex "Text Base"
        help
          TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
index 54ef2cd1a04c6f15f423cdb50ea7dc173cde68f6..394ed096f053740e398e4c86aa6f3107170aafdf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,10 @@ NAME =
 # Comments in this file are targeted only to the developer, do not
 # expect to learn how to build the kernel reading this file.
 
-# Do not use make's built-in rules and variables
-# (this increases performance and avoids hard-to-debug behaviour);
-MAKEFLAGS += -rR
+# o Do not use make's built-in rules and variables
+#   (this increases performance and avoids hard-to-debug behaviour);
+# o Look for make include files relative to root of kernel src
+MAKEFLAGS += -rR --include-dir=$(CURDIR)
 
 # Avoid funny character set dependencies
 unexport LC_ALL
@@ -319,12 +320,9 @@ endif
 export KBUILD_MODULES KBUILD_BUILTIN
 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
 
-# Look for make include files relative to root of kernel src
-MAKEFLAGS += --include-dir=$(srctree)
-
 # We need some generic definitions (do not try to remake the file).
-$(srctree)/scripts/Kbuild.include: ;
-include $(srctree)/scripts/Kbuild.include
+scripts/Kbuild.include: ;
+include scripts/Kbuild.include
 
 # Make variables (CC, etc...)
 
@@ -437,7 +435,7 @@ endif
 ifeq ($(KBUILD_EXTMOD),)
         ifneq ($(filter config %config,$(MAKECMDGOALS)),)
                 config-targets := 1
-                ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+                ifneq ($(words $(MAKECMDGOALS)),1)
                         mixed-targets := 1
                 endif
         endif
@@ -518,8 +516,8 @@ ifneq ($(wildcard include/config/auto.conf),)
 autoconf_is_old := $(shell find . -path ./$(KCONFIG_CONFIG) -newer \
                                                include/config/auto.conf)
 ifeq ($(autoconf_is_old),)
-include $(srctree)/config.mk
-include $(srctree)/arch/$(ARCH)/Makefile
+include config.mk
+include arch/$(ARCH)/Makefile
 endif
 endif
 endif
@@ -595,7 +593,7 @@ endif
 
 export CONFIG_SYS_TEXT_BASE
 
-include $(srctree)/scripts/Makefile.extrawarn
+include scripts/Makefile.extrawarn
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 KBUILD_CPPFLAGS += $(KCPPFLAGS)
@@ -1232,9 +1230,10 @@ define filechk_version.h
 endef
 
 define filechk_timestamp.h
-       (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
-       LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
-       LC_ALL=C date +'#define U_BOOT_TZ "%z"')
+       (SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
+       LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+       LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; \
+       LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' )
 endef
 
 $(version_h): include/config/uboot.release FORCE
@@ -1243,12 +1242,6 @@ $(version_h): include/config/uboot.release FORCE
 $(timestamp_h): $(srctree)/Makefile FORCE
        $(call filechk,timestamp.h)
 
-# ---------------------------------------------------------------------------
-
-PHONY += depend dep
-depend dep:
-       @echo '*** Warning: make $@ is unnecessary now.'
-
 # ---------------------------------------------------------------------------
 quiet_cmd_cpp_lds = LDS     $@
 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
@@ -1549,11 +1542,6 @@ ifneq ($(cmd_files),)
   include $(cmd_files)
 endif
 
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
-# Usage:
-# $(Q)$(MAKE) $(clean)=dir
-clean := -f $(srctree)/scripts/Makefile.clean obj
-
 endif  # skip-makefile
 
 PHONY += FORCE
diff --git a/README b/README
index 4e0ff9f74e5991843acc2983904d675bb79f735d..1bcb63c7e39b8316ca8642dce640f543a5f6b012 100644 (file)
--- a/README
+++ b/README
@@ -5081,6 +5081,18 @@ This firmware often needs to be loaded during U-Boot booting.
 - CONFIG_SYS_MEM_TOP_HIDE_MIN
        Define minimum DDR size to be hided from top of the DDR memory
 
+Reproducible builds
+-------------------
+
+In order to achieve reproducible builds, timestamps used in the U-Boot build
+process have to be set to a fixed value.
+
+This is done using the SOURCE_DATE_EPOCH environment variable.
+SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a configuration
+option for U-Boot or an environment variable in U-Boot.
+
+SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in UTC.
+
 Building the Software:
 ======================
 
index afa1d6c2d782e00282d14e7838f578ef1b8cd4f7..e952bb1e729846558dc79cc0fce4282f9fbecdae 100644 (file)
@@ -1,3 +1,6 @@
+config CREATE_ARCH_SYMLINK
+       bool
+
 config HAVE_GENERIC_BOARD
        bool
 
@@ -18,12 +21,14 @@ config ARC
 
 config ARM
        bool "ARM architecture"
+       select CREATE_ARCH_SYMLINK
        select HAVE_PRIVATE_LIBGCC if !ARM64
        select HAVE_GENERIC_BOARD
        select SUPPORT_OF_CONTROL
 
 config AVR32
        bool "AVR32 architecture"
+       select CREATE_ARCH_SYMLINK
        select HAVE_GENERIC_BOARD
        select SYS_GENERIC_BOARD
 
@@ -84,9 +89,11 @@ config SH
 
 config SPARC
        bool "SPARC architecture"
+       select CREATE_ARCH_SYMLINK
 
 config X86
        bool "x86 architecture"
+       select CREATE_ARCH_SYMLINK
        select HAVE_PRIVATE_LIBGCC
        select HAVE_GENERIC_BOARD
        select SYS_GENERIC_BOARD
index 65e710ab4b71128fbecf301d2e73f3a0fa3e8344..9127ace52a7a6463bae032efbc40bd8881348971 100644 (file)
@@ -681,7 +681,7 @@ config ARCH_ZYNQ
        select DM_SPI
        select DM_SPI_FLASH
 
-config TARGET_XILINX_ZYNQMP
+config ARCH_ZYNQMP
        bool "Support Xilinx ZynqMP Platform"
        select ARM64
 
@@ -863,6 +863,8 @@ source "arch/arm/mach-zynq/Kconfig"
 
 source "arch/arm/cpu/armv7/Kconfig"
 
+source "arch/arm/cpu/armv8/zynqmp/Kconfig"
+
 source "arch/arm/cpu/armv8/Kconfig"
 
 source "arch/arm/imx-common/Kconfig"
@@ -980,7 +982,6 @@ source "board/warp/Kconfig"
 source "board/woodburn/Kconfig"
 source "board/work-microwave/work_92105/Kconfig"
 source "board/xaeniax/Kconfig"
-source "board/xilinx/zynqmp/Kconfig"
 source "board/zipitz2/Kconfig"
 
 source "arch/arm/Kconfig.debug"
index 781d83fc72a400f416d7c23b8f3f32b4b924af3a..52a6824cf592187dbb74d66bd8c41c17798f61b2 100644 (file)
@@ -50,15 +50,6 @@ u32 get_cpu_type(void)
        return partnum;
 }
 
-/**
- * get_board_rev() - setup to pass kernel board revision information
- * returns: 0 for the ATAG REVISION tag value.
- */
-u32 __weak get_board_rev(void)
-{
-       return 0;
-}
-
 /**
  * get_device_type(): tell if GP/HS/EMU/TST
  */
index f3725b267c99c3df38f2b4a97faebdc89624a059..464a5d1d732a7540f1cbea19ab285397c5cc781b 100644 (file)
@@ -26,9 +26,7 @@ ifeq ($(CONFIG_SYS_DCACHE_OFF),)
 obj-y  += omap-cache.o
 endif
 
-ifeq ($(CONFIG_OMAP34XX),)
 obj-y  += boot-common.o
-endif
 obj-y  += lowlevel_init.o
 
 obj-y  += mem-common.o
index 7fc0a561b750dc0f3534dfe3439ab48ca4cda76b..5ec46fa14d5aad668f9ae3d0cddb5148a6f54e56 100644 (file)
 #include <asm/arch/sys_proto.h>
 #include <watchdog.h>
 #include <scsi.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+__weak u32 omap_sys_boot_device(void)
+{
+       return BOOT_DEVICE_NONE;
+}
+
 void save_omap_boot_params(void)
 {
-       u32 rom_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
-       u8 boot_device;
-       u32 dev_desc, dev_data;
+       u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
+       struct omap_boot_parameters *omap_boot_params;
+       u32 boot_device;
+       u32 boot_mode;
 
-       if ((rom_params <  NON_SECURE_SRAM_START) ||
-           (rom_params > NON_SECURE_SRAM_END))
+       if ((boot_params < NON_SECURE_SRAM_START) ||
+           (boot_params > NON_SECURE_SRAM_END))
                return;
 
-       /*
-        * rom_params can be type casted to omap_boot_parameters and
-        * used. But it not correct to assume that romcode structure
-        * encoding would be same as u-boot. So use the defined offsets.
-        */
-       boot_device = *((u8 *)(rom_params + BOOT_DEVICE_OFFSET));
+       omap_boot_params = (struct omap_boot_parameters *)boot_params;
+
+       boot_device = omap_boot_params->boot_device;
+       boot_mode = MMCSD_MODE_UNDEFINED;
+
+       /* Boot device */
 
-#if defined(BOOT_DEVICE_NAND_I2C)
+#ifdef BOOT_DEVICE_NAND_I2C
        /*
         * Re-map NAND&I2C boot-device to the "normal" NAND boot-device.
         * Otherwise the SPL boot IF can't handle this device correctly.
@@ -47,61 +54,109 @@ void save_omap_boot_params(void)
        if (boot_device == BOOT_DEVICE_NAND_I2C)
                boot_device = BOOT_DEVICE_NAND;
 #endif
-       gd->arch.omap_boot_params.omap_bootdevice = boot_device;
+#ifdef BOOT_DEVICE_QSPI_4
+       /*
+        * We get different values for QSPI_1 and QSPI_4 being used, but
+        * don't actually care about this difference.  Rather than
+        * mangle the later code, if we're coming in as QSPI_4 just
+        * change to the QSPI_1 value.
+        */
+       if (boot_device == BOOT_DEVICE_QSPI_4)
+               boot_device = BOOT_DEVICE_SPI;
+#endif
+#if (defined(BOOT_DEVICE_UART) && !defined(CONFIG_SPL_YMODEM_SUPPORT)) || \
+    (defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_SUPPORT)) || \
+    (defined(BOOT_DEVICE_USBETH) && !defined(CONFIG_SPL_USBETH_SUPPORT))
+       /*
+        * When booting from peripheral booting, the boot device is not usable
+        * as-is (unless there is support for it), so the boot device is instead
+        * figured out using the SYS_BOOT pins.
+        */
+       switch (boot_device) {
+#ifdef BOOT_DEVICE_UART
+       case BOOT_DEVICE_UART:
+#endif
+#ifdef BOOT_DEVICE_USB
+       case BOOT_DEVICE_USB:
+#endif
+               boot_device = omap_sys_boot_device();
+
+               /* MMC raw mode will fallback to FS mode. */
+               if ((boot_device >= MMC_BOOT_DEVICES_START) &&
+                   (boot_device <= MMC_BOOT_DEVICES_END))
+                       boot_mode = MMCSD_MODE_RAW;
 
-       gd->arch.omap_boot_params.ch_flags =
-                               *((u8 *)(rom_params + CH_FLAGS_OFFSET));
+               break;
+       }
+#endif
 
+       gd->arch.omap_boot_device = boot_device;
+
+       /* Boot mode */
+
+#ifdef CONFIG_OMAP34XX
        if ((boot_device >= MMC_BOOT_DEVICES_START) &&
            (boot_device <= MMC_BOOT_DEVICES_END)) {
-#if !defined(CONFIG_AM33XX) && !defined(CONFIG_TI81XX) && \
-       !defined(CONFIG_AM43XX)
-               if ((omap_hw_init_context() ==
-                                     OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)) {
-                       gd->arch.omap_boot_params.omap_bootmode =
-                       *((u8 *)(rom_params + BOOT_MODE_OFFSET));
-               } else
-#endif
-               {
-                       dev_desc = *((u32 *)(rom_params + DEV_DESC_PTR_OFFSET));
-                       dev_data = *((u32 *)(dev_desc + DEV_DATA_PTR_OFFSET));
-                       gd->arch.omap_boot_params.omap_bootmode =
-                                       *((u32 *)(dev_data + BOOT_MODE_OFFSET));
+               switch (boot_device) {
+               case BOOT_DEVICE_MMC1:
+                       boot_mode = MMCSD_MODE_FS;
+                       break;
+               case BOOT_DEVICE_MMC2:
+                       boot_mode = MMCSD_MODE_RAW;
+                       break;
                }
        }
-
-#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
+#else
        /*
-        * We get different values for QSPI_1 and QSPI_4 being used, but
-        * don't actually care about this difference.  Rather than
-        * mangle the later code, if we're coming in as QSPI_4 just
-        * change to the QSPI_1 value.
+        * If the boot device was dynamically changed and doesn't match what
+        * the bootrom initially booted, we cannot use the boot device
+        * descriptor to figure out the boot mode.
         */
-       if (gd->arch.omap_boot_params.omap_bootdevice == 11)
-               gd->arch.omap_boot_params.omap_bootdevice = BOOT_DEVICE_SPI;
+       if ((boot_device == omap_boot_params->boot_device) &&
+           (boot_device >= MMC_BOOT_DEVICES_START) &&
+           (boot_device <= MMC_BOOT_DEVICES_END)) {
+               boot_params = omap_boot_params->boot_device_descriptor;
+               if ((boot_params < NON_SECURE_SRAM_START) ||
+                   (boot_params > NON_SECURE_SRAM_END))
+                       return;
+
+               boot_params = *((u32 *)(boot_params + DEVICE_DATA_OFFSET));
+               if ((boot_params < NON_SECURE_SRAM_START) ||
+                   (boot_params > NON_SECURE_SRAM_END))
+                       return;
+
+               boot_mode = *((u32 *)(boot_params + BOOT_MODE_OFFSET));
+
+               if (boot_mode != MMCSD_MODE_FS &&
+                   boot_mode != MMCSD_MODE_RAW)
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+                       boot_mode = MMCSD_MODE_EMMCBOOT;
+#else
+                       boot_mode = MMCSD_MODE_UNDEFINED;
+#endif
+       }
+#endif
+
+       gd->arch.omap_boot_mode = boot_mode;
+
+#if !defined(CONFIG_TI814X) && !defined(CONFIG_TI816X) && \
+    !defined(CONFIG_AM33XX) && !defined(CONFIG_AM43XX)
+
+       /* CH flags */
+
+       gd->arch.omap_ch_flags = omap_boot_params->ch_flags;
 #endif
 }
 
 #ifdef CONFIG_SPL_BUILD
 u32 spl_boot_device(void)
 {
-       return (u32) (gd->arch.omap_boot_params.omap_bootdevice);
+       return gd->arch.omap_boot_device;
 }
 
 u32 spl_boot_mode(void)
 {
-       u32 val = gd->arch.omap_boot_params.omap_bootmode;
-
-       if (val == MMCSD_MODE_RAW)
-               return MMCSD_MODE_RAW;
-       else if (val == MMCSD_MODE_FS)
-               return MMCSD_MODE_FS;
-       else
-#ifdef CONFIG_SUPPORT_EMMC_BOOT
-               return MMCSD_MODE_EMMCBOOT;
-#else
-               return MMCSD_MODE_UNDEFINED;
-#endif
+       return gd->arch.omap_boot_mode;
 }
 
 void spl_board_init(void)
@@ -116,9 +171,12 @@ void spl_board_init(void)
        /* Prepare console output */
        preloader_console_init();
 
-#ifdef CONFIG_SPL_NAND_SUPPORT
+#if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
        gpmc_init();
 #endif
+#ifdef CONFIG_SPL_I2C_SUPPORT
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+#endif
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT)
        arch_misc_init();
 #endif
@@ -150,9 +208,11 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
        image_entry_noargs_t image_entry =
                        (image_entry_noargs_t) spl_image->entry_point;
 
+       u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
+
        debug("image entry point: 0x%X\n", spl_image->entry_point);
        /* Pass the saved boot_params from rom code */
-       image_entry((u32 *)&gd->arch.omap_boot_params);
+       image_entry((u32 *)boot_params);
 }
 #endif
 
index 6c8f3bcea4f3f83e0ea7a3fa6468db741d234ddd..80794f9c611ad2990972b61d69ac4cdaf6ea390d 100644 (file)
@@ -90,7 +90,9 @@ void __weak srcomp_enable(void)
  */
 int arch_cpu_init(void)
 {
+#ifdef CONFIG_SPL
        save_omap_boot_params();
+#endif
        return 0;
 }
 #endif /* CONFIG_ARCH_CPU_INIT */
index 746df922c27d686a6376cf03b238158ba0daeff4..528313584f3dd07e28dda860a2dc6d7404c7f074 100644 (file)
@@ -16,8 +16,9 @@
 #include <asm/arch/spl.h>
 #include <linux/linkage.h>
 
-#ifndef CONFIG_OMAP34XX
+#ifdef CONFIG_SPL
 ENTRY(save_boot_params)
+
        ldr     r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
        str     r0, [r1]
        b       save_boot_params_ret
index cf860463532f077d28ffeb2f7759af4c3fff0745..b2fce966d9a428eea917b3769f575c114d2d110b 100644 (file)
@@ -8,6 +8,7 @@
 obj-y  := lowlevel_init.o
 
 obj-y  += board.o
+obj-y  += boot.o
 obj-y  += clock.o
 obj-y  += sys_info.o
 ifdef CONFIG_SPL_BUILD
index b064c0cc834356b33e14e0f36774108fa6a6c580..17cb5b759b9a4d598ab828a6fda6af2a50f6b3bc 100644 (file)
@@ -18,7 +18,6 @@
  */
 #include <common.h>
 #include <dm.h>
-#include <mmc.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
@@ -27,8 +26,6 @@
 #include <asm/armv7.h>
 #include <asm/gpio.h>
 #include <asm/omap_common.h>
-#include <asm/arch/mmc_host_def.h>
-#include <i2c.h>
 #include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -73,62 +70,6 @@ const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
 
 #endif
 
-#ifdef CONFIG_SPL_BUILD
-/*
-* We use static variables because global data is not ready yet.
-* Initialized data is available in SPL right from the beginning.
-* We would not typically need to save these parameters in regular
-* U-Boot. This is needed only in SPL at the moment.
-*/
-u32 omap3_boot_device = BOOT_DEVICE_NAND;
-
-/* auto boot mode detection is not possible for OMAP3 - hard code */
-u32 spl_boot_mode(void)
-{
-       switch (spl_boot_device()) {
-       case BOOT_DEVICE_MMC2:
-               return MMCSD_MODE_RAW;
-       case BOOT_DEVICE_MMC1:
-               return MMCSD_MODE_FS;
-               break;
-       default:
-               puts("spl: ERROR:  unknown device - can't select boot mode\n");
-               hang();
-       }
-}
-
-u32 spl_boot_device(void)
-{
-       return omap3_boot_device;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-       switch (spl_boot_device()) {
-       case BOOT_DEVICE_MMC1:
-               omap_mmc_init(0, 0, 0, -1, -1);
-               break;
-       case BOOT_DEVICE_MMC2:
-       case BOOT_DEVICE_MMC2_2:
-               omap_mmc_init(1, 0, 0, -1, -1);
-               break;
-       }
-       return 0;
-}
-
-void spl_board_init(void)
-{
-       preloader_console_init();
-#if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
-       gpmc_init();
-#endif
-#ifdef CONFIG_SPL_I2C_SUPPORT
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-#endif
-}
-#endif /* CONFIG_SPL_BUILD */
-
-
 /******************************************************************************
  * Routine: secure_unlock
  * Description: Setup security registers for access
diff --git a/arch/arm/cpu/armv7/omap3/boot.c b/arch/arm/cpu/armv7/omap3/boot.c
new file mode 100644 (file)
index 0000000..66576b2
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * OMAP3 boot
+ *
+ * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sys_proto.h>
+#include <spl.h>
+
+static u32 boot_devices[] = {
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC2_2,
+};
+
+u32 omap_sys_boot_device(void)
+{
+       struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+       u32 sys_boot;
+
+       /* Grab the first 5 bits of the status register for SYS_BOOT. */
+       sys_boot = readl(&ctrl_base->status) & ((1 << 5) - 1);
+
+       if (sys_boot >= (sizeof(boot_devices) / sizeof(u32)))
+               return BOOT_DEVICE_NONE;
+
+       return boot_devices[sys_boot];
+}
index 249761308e686c5de2a4d89668bc855da79711f0..1e587723cec128b4e393a4cba1cf93deb2f756e6 100644 (file)
 #include <asm/arch/clocks_omap3.h>
 #include <linux/linkage.h>
 
-#ifdef CONFIG_SPL_BUILD
-ENTRY(save_boot_params)
-       ldr     r4, =omap3_boot_device
-       ldr     r5, [r0, #0x4]
-       and     r5, r5, #0xff
-       str     r5, [r4]
-       b       save_boot_params_ret
-ENDPROC(save_boot_params)
-#endif
-
 /*
  * Funtion for making PPA HAL API calls in secure devices
  * Input:
index bbb65bbe7263674c2b47b97ee05a9f588ed1c58f..ab60a0341525a9ed2d0a1f9c8d7886ae5e45d02e 100644 (file)
@@ -196,10 +196,12 @@ u32 get_gpmc0_width(void)
  * get_board_rev() - setup to pass kernel board revision information
  * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
  *************************************************************************/
+#ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
        return 0x20;
 }
+#endif
 
 /********************************************************
  *  get_base(); get upper addr of current execution
index 76a032a2d96684048170533a7b3f4327ec42f520..564f1f632f328e8a6e429fb4940065877bc2910c 100644 (file)
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
+obj-y  += boot.o
 obj-y  += sdram_elpida.o
 obj-y  += hwinit.o
 obj-y  += emif.o
diff --git a/arch/arm/cpu/armv7/omap4/boot.c b/arch/arm/cpu/armv7/omap4/boot.c
new file mode 100644 (file)
index 0000000..4b5aa77
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * OMAP4 boot
+ *
+ * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/omap_common.h>
+#include <spl.h>
+
+static u32 boot_devices[] = {
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIPWAIT,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_ONENAND,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_MMC2_2,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC2_2,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_MMC2_2,
+       BOOT_DEVICE_MMC2_2,
+       BOOT_DEVICE_NONE,
+       BOOT_DEVICE_XIPWAIT,
+};
+
+u32 omap_sys_boot_device(void)
+{
+       u32 sys_boot;
+
+       /* Grab the first 5 bits of the status register for SYS_BOOT. */
+       sys_boot = readl((u32 *) (*ctrl)->control_status) & ((1 << 5) - 1);
+
+       if (sys_boot >= (sizeof(boot_devices) / sizeof(u32)))
+               return BOOT_DEVICE_NONE;
+
+       return boot_devices[sys_boot];
+}
index 1ed146b44538c57ab57d569cc0215853a4761bf1..8698ec7a486d07d98d15456184b17c6c93225467 100644 (file)
@@ -279,6 +279,7 @@ struct prcm_regs const omap4_prcm = {
 };
 
 struct omap_sys_ctrl_regs const omap4_ctrl = {
+       .control_status                         = 0x4A0022C4,
        .control_id_code                        = 0x4A002204,
        .control_std_fuse_opp_bgap              = 0x4a002260,
        .control_status                         = 0x4a0022c4,
index e709f14a921bb24c22a56ab5f600cca50fb6f99d..f2930d521c69db01ab6aa23c66196c445fdb220a 100644 (file)
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
+obj-y  += boot.o
 obj-y  += hwinit.o
 obj-y  += emif.o
 obj-y  += sdram.o
diff --git a/arch/arm/cpu/armv7/omap5/boot.c b/arch/arm/cpu/armv7/omap5/boot.c
new file mode 100644 (file)
index 0000000..583becc
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * OMAP5 boot
+ *
+ * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/omap_common.h>
+#include <spl.h>
+
+static u32 boot_devices[] = {
+#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_SATA,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_SPI,
+       BOOT_DEVICE_SPI,
+#else
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_NAND,
+       BOOT_DEVICE_MMC1,
+       BOOT_DEVICE_SATA,
+       BOOT_DEVICE_XIP,
+       BOOT_DEVICE_MMC2,
+       BOOT_DEVICE_XIPWAIT,
+#endif
+};
+
+u32 omap_sys_boot_device(void)
+{
+       u32 sys_boot;
+
+       /* Grab the first 4 bits of the status register for SYS_BOOT. */
+       sys_boot = readl((u32 *) (*ctrl)->control_status) & ((1 << 4) - 1);
+
+       if (sys_boot >= (sizeof(boot_devices) / sizeof(u32)))
+               return BOOT_DEVICE_NONE;
+
+       return boot_devices[sys_boot];
+}
index 165c052122ec4a9e0acfda51a9e992d575bc0b81..c53671a0e9b835b9a528d50fe82c19a2b6afd655 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/dram.h>
 #include <asm/arch/prcm.h>
-#include <linux/kconfig.h>
 
 static const struct dram_para dram_para = {
        .clock = CONFIG_DRAM_CLK,
index ebba43831969063bdd41aabb33ef591b947c7c44..fa1620cb3931eed3d5d28c25243ed609791b6197 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/dram.h>
 #include <asm/arch/prcm.h>
-#include <linux/kconfig.h>
 
 /* PLL runs at 2x dram-clk, controller runs at PLL / 4 (dram-clk / 2) */
 #define DRAM_CLK_MUL 2
index 2eded1f52e7ad4195c2221c6fb03a1e313b0a084..d520a13efdd6e83d144bf31deb750b4a2ae492f9 100644 (file)
@@ -92,7 +92,20 @@ struct pll_psc {
 #error "CONFIG_STM32_HSE_HZ not defined!"
 #else
 #if (CONFIG_STM32_HSE_HZ == 8000000)
-struct pll_psc pll_psc_168 = {
+#if (CONFIG_SYS_CLK_FREQ == 180000000)
+/* 180 MHz */
+struct pll_psc sys_pll_psc = {
+       .pll_m = 8,
+       .pll_n = 360,
+       .pll_p = 2,
+       .pll_q = 8,
+       .ahb_psc = AHB_PSC_1,
+       .apb1_psc = APB_PSC_4,
+       .apb2_psc = APB_PSC_2
+};
+#else
+/* default 168 MHz */
+struct pll_psc sys_pll_psc = {
        .pll_m = 8,
        .pll_n = 336,
        .pll_p = 2,
@@ -101,6 +114,7 @@ struct pll_psc pll_psc_168 = {
        .apb1_psc = APB_PSC_4,
        .apb2_psc = APB_PSC_2
 };
+#endif
 #else
 #error "No PLL/Prescaler configuration for given CONFIG_STM32_HSE_HZ exists"
 #endif
@@ -122,19 +136,19 @@ int configure_clocks(void)
        while (!(readl(&STM32_RCC->cr) & RCC_CR_HSERDY))
                ;
 
-       /* Enable high performance mode, System frequency up to 168 MHz */
+       /* Enable high performance mode, System frequency up to 180 MHz */
        setbits_le32(&STM32_RCC->apb1enr, RCC_APB1ENR_PWREN);
        writel(PWR_CR_VOS_SCALE_MODE_1, &STM32_PWR->cr);
 
        setbits_le32(&STM32_RCC->cfgr, ((
-               pll_psc_168.ahb_psc << RCC_CFGR_HPRE_SHIFT)
-               | (pll_psc_168.apb1_psc << RCC_CFGR_PPRE1_SHIFT)
-               | (pll_psc_168.apb2_psc << RCC_CFGR_PPRE2_SHIFT)));
-
-       writel(pll_psc_168.pll_m
-               | (pll_psc_168.pll_n << RCC_PLLCFGR_PLLN_SHIFT)
-               | (((pll_psc_168.pll_p >> 1) - 1) << RCC_PLLCFGR_PLLP_SHIFT)
-               | (pll_psc_168.pll_q << RCC_PLLCFGR_PLLQ_SHIFT),
+               sys_pll_psc.ahb_psc << RCC_CFGR_HPRE_SHIFT)
+               | (sys_pll_psc.apb1_psc << RCC_CFGR_PPRE1_SHIFT)
+               | (sys_pll_psc.apb2_psc << RCC_CFGR_PPRE2_SHIFT)));
+
+       writel(sys_pll_psc.pll_m
+               | (sys_pll_psc.pll_n << RCC_PLLCFGR_PLLN_SHIFT)
+               | (((sys_pll_psc.pll_p >> 1) - 1) << RCC_PLLCFGR_PLLP_SHIFT)
+               | (sys_pll_psc.pll_q << RCC_PLLCFGR_PLLQ_SHIFT),
                &STM32_RCC->pllcfgr);
        setbits_le32(&STM32_RCC->pllcfgr, RCC_PLLCFGR_PLLSRC);
 
index dee5e258b6c33580e8ee118130b3c3a3d9b086ec..6466ebb4606b2b6d65c7a5e2173ee78d4c0a5a95 100644 (file)
@@ -16,4 +16,4 @@ obj-y += tlb.o
 obj-y  += transition.o
 
 obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/
-obj-$(CONFIG_TARGET_XILINX_ZYNQMP) += zynqmp/
+obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/
diff --git a/arch/arm/cpu/armv8/zynqmp/Kconfig b/arch/arm/cpu/armv8/zynqmp/Kconfig
new file mode 100644 (file)
index 0000000..c8fcfb6
--- /dev/null
@@ -0,0 +1,23 @@
+if ARCH_ZYNQMP
+
+choice
+       prompt "Xilinx ZynqMP board select"
+
+config TARGET_ZYNQMP_EP
+       bool "ZynqMP EP Board"
+
+endchoice
+
+config SYS_BOARD
+       default "zynqmp"
+
+config SYS_VENDOR
+       default "xilinx"
+
+config SYS_SOC
+       default "zynqmp"
+
+config SYS_CONFIG_NAME
+       default "xilinx_zynqmp_ep" if TARGET_ZYNQMP_EP
+
+endif
index efab5eabc97b07bd81c899a4dce88d66126219aa..d0ed2223ff7973b27e24cb936546bcf81bb58b85 100644 (file)
@@ -8,3 +8,4 @@
 obj-y  += clk.o
 obj-y  += cpu.o
 obj-$(CONFIG_MP)       += mp.o
+obj-y  += slcr.o
index 17e32a7b7ce8426e9895938b6772de5388e55c72..dcb80b522ead5d0e711190eb6cfd582ffe6411ab 100644 (file)
@@ -216,12 +216,7 @@ int cpu_release(int nr, int argc, char * const argv[])
                        printf("R5 lockstep mode\n");
                        set_r5_tcm_mode(LOCK);
                        set_r5_halt_mode(HALT, LOCK);
-
-                       if (boot_addr == 0)
-                               set_r5_start(0);
-                       else
-                               set_r5_start(1);
-
+                       set_r5_start(boot_addr);
                        enable_clock_r5();
                        release_r5_reset(LOCK);
                        set_r5_halt_mode(RELEASE, LOCK);
diff --git a/arch/arm/cpu/armv8/zynqmp/slcr.c b/arch/arm/cpu/armv8/zynqmp/slcr.c
new file mode 100644 (file)
index 0000000..713e9a6
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * (C) Copyright 2014 - 2015 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/clk.h>
+
+/*
+ * zynq_slcr_mio_get_status - Get the status of MIO peripheral.
+ *
+ * @peri_name: Name of the peripheral for checking MIO status
+ * @get_pins: Pointer to array of get pin for this peripheral
+ * @num_pins: Number of pins for this peripheral
+ * @mask: Mask value
+ * @check_val: Required check value to get the status of  periph
+ */
+struct zynq_slcr_mio_get_status {
+       const char *peri_name;
+       const int *get_pins;
+       int num_pins;
+       u32 mask;
+       u32 check_val;
+};
+
+static const struct zynq_slcr_mio_get_status mio_periphs[] = {
+};
+
+/*
+ * zynq_slcr_get_mio_pin_status - Get the MIO pin status of peripheral.
+ *
+ * @periph: Name of the peripheral
+ *
+ * Returns count to indicate the number of pins configured for the
+ * given @periph.
+ */
+int zynq_slcr_get_mio_pin_status(const char *periph)
+{
+       const struct zynq_slcr_mio_get_status *mio_ptr;
+       int val, i, j;
+       int mio = 0;
+
+       for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
+               if (strcmp(periph, mio_periphs[i].peri_name) == 0) {
+                       mio_ptr = &mio_periphs[i];
+                       for (j = 0; j < mio_ptr->num_pins; j++) {
+                               val = readl(&slcr_base->mio_pin
+                                               [mio_ptr->get_pins[j]]);
+                               if ((val & mio_ptr->mask) == mio_ptr->check_val)
+                                       mio++;
+                       }
+                       break;
+               }
+       }
+
+       return mio;
+}
index 83e2770f31e7df3d4914cfe7c784355c0a95ef68..ba6355379cba8421a5de090ece9b13ea03b88a0d 100644 (file)
@@ -46,6 +46,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
        zynq-microzed.dtb \
        zynq-picozed.dtb \
        zynq-zc770-xm010.dtb \
+       zynq-zc770-xm011.dtb \
        zynq-zc770-xm012.dtb \
        zynq-zc770-xm013.dtb
 dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb
index 920715989e9502d73ed3dbe4635ecce3b932580a..0b62cb093658a79de876e015985a7b92e9135103 100644 (file)
@@ -2,7 +2,7 @@
  * Xilinx Zynq 7000 DTSI
  * Describes the hardware common to all Zynq 7000-based boards.
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ *  Copyright (C) 2011 - 2015 Xilinx
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
                        reg = <0>;
                        clocks = <&clkc 3>;
                        clock-latency = <1000>;
+                       cpu0-supply = <&regulator_vccpint>;
                        operating-points = <
                                /* kHz    uV */
                                666667  1000000
                                333334  1000000
-                               222223  1000000
                        >;
                };
 
                reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >;
        };
 
-       amba {
+       regulator_vccpint: fixedregulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCCPINT";
+               regulator-min-microvolt = <1000000>;
+               regulator-max-microvolt = <1000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       amba: amba {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                interrupt-parent = <&intc>;
                ranges;
 
-               i2c0: zynq-i2c@e0004000 {
+               adc: adc@f8007100 {
+                       compatible = "xlnx,zynq-xadc-1.00.a";
+                       reg = <0xf8007100 0x20>;
+                       interrupts = <0 7 4>;
+                       interrupt-parent = <&intc>;
+                       clocks = <&clkc 12>;
+               };
+
+               can0: can@e0008000 {
+                       compatible = "xlnx,zynq-can-1.0";
+                       status = "disabled";
+                       clocks = <&clkc 19>, <&clkc 36>;
+                       clock-names = "can_clk", "pclk";
+                       reg = <0xe0008000 0x1000>;
+                       interrupts = <0 28 4>;
+                       interrupt-parent = <&intc>;
+                       tx-fifo-depth = <0x40>;
+                       rx-fifo-depth = <0x40>;
+               };
+
+               can1: can@e0009000 {
+                       compatible = "xlnx,zynq-can-1.0";
+                       status = "disabled";
+                       clocks = <&clkc 20>, <&clkc 37>;
+                       clock-names = "can_clk", "pclk";
+                       reg = <0xe0009000 0x1000>;
+                       interrupts = <0 51 4>;
+                       interrupt-parent = <&intc>;
+                       tx-fifo-depth = <0x40>;
+                       rx-fifo-depth = <0x40>;
+               };
+
+               gpio0: gpio@e000a000 {
+                       compatible = "xlnx,zynq-gpio-1.0";
+                       #gpio-cells = <2>;
+                       clocks = <&clkc 42>;
+                       gpio-controller;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 20 4>;
+                       reg = <0xe000a000 0x1000>;
+               };
+
+               i2c0: i2c@e0004000 {
                        compatible = "cdns,i2c-r1p10";
                        status = "disabled";
                        clocks = <&clkc 38>;
                        #size-cells = <0>;
                };
 
-               i2c1: zynq-i2c@e0005000 {
+               i2c1: i2c@e0005000 {
                        compatible = "cdns,i2c-r1p10";
                        status = "disabled";
                        clocks = <&clkc 39>;
                intc: interrupt-controller@f8f01000 {
                        compatible = "arm,cortex-a9-gic";
                        #interrupt-cells = <3>;
-                       #address-cells = <1>;
                        interrupt-controller;
                        reg = <0xF8F01000 0x1000>,
                              <0xF8F00100 0x100>;
                };
 
-               L2: cache-controller {
+               L2: cache-controller@f8f02000 {
                        compatible = "arm,pl310-cache";
                        reg = <0xF8F02000 0x1000>;
+                       interrupts = <0 2 4>;
                        arm,data-latency = <3 2 2>;
                        arm,tag-latency = <2 2 2>;
                        cache-unified;
                        cache-level = <2>;
                };
 
-               uart0: uart@e0000000 {
-                       compatible = "xlnx,xuartps";
+               mc: memory-controller@f8006000 {
+                       compatible = "xlnx,zynq-ddrc-a05";
+                       reg = <0xf8006000 0x1000>;
+               };
+
+               uart0: serial@e0000000 {
+                       compatible = "xlnx,xuartps", "cdns,uart-r1p8";
                        status = "disabled";
                        clocks = <&clkc 23>, <&clkc 40>;
-                       clock-names = "ref_clk", "aper_clk";
+                       clock-names = "uart_clk", "pclk";
                        reg = <0xE0000000 0x1000>;
                        interrupts = <0 27 4>;
                };
 
-               uart1: uart@e0001000 {
-                       compatible = "xlnx,xuartps";
+               uart1: serial@e0001000 {
+                       compatible = "xlnx,xuartps", "cdns,uart-r1p8";
                        status = "disabled";
                        clocks = <&clkc 24>, <&clkc 41>;
-                       clock-names = "ref_clk", "aper_clk";
+                       clock-names = "uart_clk", "pclk";
                        reg = <0xE0001000 0x1000>;
                        interrupts = <0 50 4>;
                };
 
                spi0: spi@e0006000 {
-                       compatible = "xlnx,zynq-spi";
+                       compatible = "xlnx,zynq-spi-r1p6";
                        reg = <0xe0006000 0x1000>;
                        status = "disabled";
                        interrupt-parent = <&intc>;
                };
 
                spi1: spi@e0007000 {
-                       compatible = "xlnx,zynq-spi";
+                       compatible = "xlnx,zynq-spi-r1p6";
                        reg = <0xe0007000 0x1000>;
                        status = "disabled";
                        interrupt-parent = <&intc>;
                };
 
                gem0: ethernet@e000b000 {
-                       compatible = "cdns,gem";
-                       reg = <0xe000b000 0x4000>;
+                       compatible = "cdns,zynq-gem", "cdns,gem";
+                       reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
                        clock-names = "pclk", "hclk", "tx_clk";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                gem1: ethernet@e000c000 {
-                       compatible = "cdns,gem";
-                       reg = <0xe000c000 0x4000>;
+                       compatible = "cdns,zynq-gem", "cdns,gem";
+                       reg = <0xe000c000 0x1000>;
                        status = "disabled";
                        interrupts = <0 45 4>;
                        clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>;
                        clock-names = "pclk", "hclk", "tx_clk";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
-               sdhci0: ps7-sdhci@e0100000 {
+               sdhci0: sdhci@e0100000 {
                        compatible = "arasan,sdhci-8.9a";
                        status = "disabled";
                        clock-names = "clk_xin", "clk_ahb";
                        reg = <0xe0100000 0x1000>;
                } ;
 
-               sdhci1: ps7-sdhci@e0101000 {
+               sdhci1: sdhci@e0101000 {
                        compatible = "arasan,sdhci-8.9a";
                        status = "disabled";
                        clock-names = "clk_xin", "clk_ahb";
                slcr: slcr@f8000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       compatible = "xlnx,zynq-slcr", "syscon";
+                       compatible = "xlnx,zynq-slcr", "syscon", "simple-bus";
                        reg = <0xF8000000 0x1000>;
                        ranges;
                        clkc: clkc@100 {
                                #clock-cells = <1>;
                                compatible = "xlnx,ps7-clkc";
-                               ps-clk-frequency = <33333333>;
                                fclk-enable = <0>;
                                clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
                                                "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
                                                "dbg_trc", "dbg_apb";
                                reg = <0x100 0x100>;
                        };
+
+                       pinctrl0: pinctrl@700 {
+                               compatible = "xlnx,pinctrl-zynq";
+                               reg = <0x700 0x200>;
+                               syscon = <&slcr>;
+                       };
+               };
+
+               dmac_s: dmac@f8003000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xf8003000 0x1000>;
+                       interrupt-parent = <&intc>;
+                       interrupt-names = "abort", "dma0", "dma1", "dma2", "dma3",
+                               "dma4", "dma5", "dma6", "dma7";
+                       interrupts = <0 13 4>,
+                                    <0 14 4>, <0 15 4>,
+                                    <0 16 4>, <0 17 4>,
+                                    <0 40 4>, <0 41 4>,
+                                    <0 42 4>, <0 43 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <4>;
+                       clocks = <&clkc 27>;
+                       clock-names = "apb_pclk";
+               };
+
+               devcfg: devcfg@f8007000 {
+                       compatible = "xlnx,zynq-devcfg-1.0";
+                       reg = <0xf8007000 0x100>;
                };
 
                global_timer: timer@f8f00200 {
                        clocks = <&clkc 4>;
                };
 
-               ttc0: ttc0@f8001000 {
+               ttc0: timer@f8001000 {
                        interrupt-parent = <&intc>;
-                       interrupts = < 0 10 4 0 11 4 0 12 4 >;
+                       interrupts = <0 10 4>, <0 11 4>, <0 12 4>;
                        compatible = "cdns,ttc";
                        clocks = <&clkc 6>;
                        reg = <0xF8001000 0x1000>;
                };
 
-               ttc1: ttc1@f8002000 {
+               ttc1: timer@f8002000 {
                        interrupt-parent = <&intc>;
-                       interrupts = < 0 37 4 0 38 4 0 39 4 >;
+                       interrupts = <0 37 4>, <0 38 4>, <0 39 4>;
                        compatible = "cdns,ttc";
                        clocks = <&clkc 6>;
                        reg = <0xF8002000 0x1000>;
                };
-               scutimer: scutimer@f8f00600 {
+
+               scutimer: timer@f8f00600 {
                        interrupt-parent = <&intc>;
                        interrupts = < 1 13 0x301 >;
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = < 0xf8f00600 0x20 >;
                        clocks = <&clkc 4>;
                } ;
+
+               usb0: usb@e0002000 {
+                       compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
+                       status = "disabled";
+                       clocks = <&clkc 28>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 21 4>;
+                       reg = <0xe0002000 0x1000>;
+                       phy_type = "ulpi";
+               };
+
+               usb1: usb@e0003000 {
+                       compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
+                       status = "disabled";
+                       clocks = <&clkc 29>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 44 4>;
+                       reg = <0xe0003000 0x1000>;
+                       phy_type = "ulpi";
+               };
+
+               watchdog0: watchdog@f8005000 {
+                       clocks = <&clkc 45>;
+                       compatible = "cdns,wdt-r1p2";
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 9 1>;
+                       reg = <0xf8005000 0x1000>;
+                       timeout-sec = <10>;
+               };
        };
 };
index 4fa0b00b318bb45d07b2f7fd079e8f6a3442e48e..6691a8de247d282118cf9bc16c37d2bf024f9b0f 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Xilinx ZC702 board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ *  Copyright (C) 2011 - 2015 Xilinx
+ *  Copyright (C) 2012 National Instruments Corp.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZC702 Board";
+       model = "Zynq ZC702 Development Board";
        compatible = "xlnx,zynq-zc702", "xlnx,zynq-7000";
 
        aliases {
+               ethernet0 = &gem0;
+               i2c0 = &i2c0;
                serial0 = &uart1;
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0x40000000>;
+               reg = <0x0 0x40000000>;
        };
+
+       chosen {
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               autorepeat;
+               sw14 {
+                       label = "sw14";
+                       gpios = <&gpio0 12 0>;
+                       linux,code = <108>; /* down */
+                       gpio-key,wakeup;
+                       autorepeat;
+               };
+               sw13 {
+                       label = "sw13";
+                       gpios = <&gpio0 14 0>;
+                       linux,code = <103>; /* up */
+                       gpio-key,wakeup;
+                       autorepeat;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               ds23 {
+                       label = "ds23";
+                       gpios = <&gpio0 10 0>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       usb_phy0: phy0 {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
+       };
+};
+
+&amba {
+       ocm: sram@fffc0000 {
+               compatible = "mmio-sram";
+               reg = <0xfffc0000 0x10000>;
+       };
+};
+
+&can0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can0_default>;
+};
+
+&clkc {
+       ps-clk-frequency = <33333333>;
+};
+
+&gem0 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gem0_default>;
+
+       ethernet_phy: ethernet-phy@7 {
+               reg = <7>;
+       };
+};
+
+&gpio0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio0_default>;
+};
+
+&i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c0_default>;
+
+       i2cswitch@74 {
+               compatible = "nxp,pca9548";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x74>;
+
+               i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+                       si570: clock-generator@5d {
+                               #clock-cells = <0>;
+                               compatible = "silabs,si570";
+                               temperature-stability = <50>;
+                               reg = <0x5d>;
+                               factory-fout = <156250000>;
+                               clock-frequency = <148500000>;
+                       };
+               };
+
+               i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+                       eeprom@54 {
+                               compatible = "at,24c08";
+                               reg = <0x54>;
+                       };
+               };
+
+               i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+                       gpio@21 {
+                               compatible = "ti,tca6416";
+                               reg = <0x21>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+               };
+
+               i2c@4 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <4>;
+                       rtc@51 {
+                               compatible = "nxp,pcf8563";
+                               reg = <0x51>;
+                       };
+               };
+
+               i2c@7 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <7>;
+                       hwmon@52 {
+                               compatible = "ti,ucd9248";
+                               reg = <52>;
+                       };
+                       hwmon@53 {
+                               compatible = "ti,ucd9248";
+                               reg = <53>;
+                       };
+                       hwmon@54 {
+                               compatible = "ti,ucd9248";
+                               reg = <54>;
+                       };
+               };
+       };
+};
+
+&pinctrl0 {
+       pinctrl_can0_default: can0-default {
+               mux {
+                       function = "can0";
+                       groups = "can0_9_grp";
+               };
+
+               conf {
+                       groups = "can0_9_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-rx {
+                       pins = "MIO46";
+                       bias-high-impedance;
+               };
+
+               conf-tx {
+                       pins = "MIO47";
+                       bias-disable;
+               };
+       };
+
+       pinctrl_gem0_default: gem0-default {
+               mux {
+                       function = "ethernet0";
+                       groups = "ethernet0_0_grp";
+               };
+
+               conf {
+                       groups = "ethernet0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <4>;
+               };
+
+               conf-rx {
+                       pins = "MIO22", "MIO23", "MIO24", "MIO25", "MIO26", "MIO27";
+                       bias-high-impedance;
+                       low-power-disable;
+               };
+
+               conf-tx {
+                       pins = "MIO16", "MIO17", "MIO18", "MIO19", "MIO20", "MIO21";
+                       bias-disable;
+                       low-power-enable;
+               };
+
+               mux-mdio {
+                       function = "mdio0";
+                       groups = "mdio0_0_grp";
+               };
+
+               conf-mdio {
+                       groups = "mdio0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+                       bias-disable;
+               };
+       };
+
+       pinctrl_gpio0_default: gpio0-default {
+               mux {
+                       function = "gpio0";
+                       groups = "gpio0_7_grp", "gpio0_8_grp", "gpio0_9_grp",
+                                "gpio0_10_grp", "gpio0_11_grp", "gpio0_12_grp",
+                                "gpio0_13_grp", "gpio0_14_grp";
+               };
+
+               conf {
+                       groups = "gpio0_7_grp", "gpio0_8_grp", "gpio0_9_grp",
+                                "gpio0_10_grp", "gpio0_11_grp", "gpio0_12_grp",
+                                "gpio0_13_grp", "gpio0_14_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-pull-up {
+                       pins = "MIO9", "MIO10", "MIO11", "MIO12", "MIO13", "MIO14";
+                       bias-pull-up;
+               };
+
+               conf-pull-none {
+                       pins = "MIO7", "MIO8";
+                       bias-disable;
+               };
+       };
+
+       pinctrl_i2c0_default: i2c0-default {
+               mux {
+                       groups = "i2c0_10_grp";
+                       function = "i2c0";
+               };
+
+               conf {
+                       groups = "i2c0_10_grp";
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+       };
+
+       pinctrl_sdhci0_default: sdhci0-default {
+               mux {
+                       groups = "sdio0_2_grp";
+                       function = "sdio0";
+               };
+
+               conf {
+                       groups = "sdio0_2_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+                       bias-disable;
+               };
+
+               mux-cd {
+                       groups = "gpio0_0_grp";
+                       function = "sdio0_cd";
+               };
+
+               conf-cd {
+                       groups = "gpio0_0_grp";
+                       bias-high-impedance;
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               mux-wp {
+                       groups = "gpio0_15_grp";
+                       function = "sdio0_wp";
+               };
+
+               conf-wp {
+                       groups = "gpio0_15_grp";
+                       bias-high-impedance;
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+       };
+
+       pinctrl_uart1_default: uart1-default {
+               mux {
+                       groups = "uart1_10_grp";
+                       function = "uart1";
+               };
+
+               conf {
+                       groups = "uart1_10_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-rx {
+                       pins = "MIO49";
+                       bias-high-impedance;
+               };
+
+               conf-tx {
+                       pins = "MIO48";
+                       bias-disable;
+               };
+       };
+
+       pinctrl_usb0_default: usb0-default {
+               mux {
+                       groups = "usb0_0_grp";
+                       function = "usb0";
+               };
+
+               conf {
+                       groups = "usb0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-rx {
+                       pins = "MIO29", "MIO31", "MIO36";
+                       bias-high-impedance;
+               };
+
+               conf-tx {
+                       pins = "MIO28", "MIO30", "MIO32", "MIO33", "MIO34",
+                              "MIO35", "MIO37", "MIO38", "MIO39";
+                       bias-disable;
+               };
+       };
+};
+
+&sdhci0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sdhci0_default>;
+};
+
+&uart1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1_default>;
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+       usb-phy = <&usb_phy0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usb0_default>;
 };
index 2a80195757db11e78812bda1944e01a096220821..cf7bce4468de227f251cf7705d8b1329d0bc9c8f 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Xilinx ZC706 board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ *  Copyright (C) 2011 - 2015 Xilinx
+ *  Copyright (C) 2012 National Instruments Corp.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZC706 Board";
+       model = "Zynq ZC706 Development Board";
        compatible = "xlnx,zynq-zc706", "xlnx,zynq-7000";
 
        aliases {
+               ethernet0 = &gem0;
+               i2c0 = &i2c0;
                serial0 = &uart1;
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0x40000000>;
+               reg = <0x0 0x40000000>;
        };
+
+       chosen {
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
+       };
+
+       usb_phy0: phy0 {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
+       };
+};
+
+&clkc {
+       ps-clk-frequency = <33333333>;
+};
+
+&gem0 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gem0_default>;
+
+       ethernet_phy: ethernet-phy@7 {
+               reg = <7>;
+       };
+};
+
+&gpio0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio0_default>;
+};
+
+&i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c0_default>;
+
+       i2cswitch@74 {
+               compatible = "nxp,pca9548";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x74>;
+
+               i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+                       si570: clock-generator@5d {
+                               #clock-cells = <0>;
+                               compatible = "silabs,si570";
+                               temperature-stability = <50>;
+                               reg = <0x5d>;
+                               factory-fout = <156250000>;
+                               clock-frequency = <148500000>;
+                       };
+               };
+
+               i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+                       eeprom@54 {
+                               compatible = "at,24c08";
+                               reg = <0x54>;
+                       };
+               };
+
+               i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+                       gpio@21 {
+                               compatible = "ti,tca6416";
+                               reg = <0x21>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+               };
+
+               i2c@4 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <4>;
+                       rtc@51 {
+                               compatible = "nxp,pcf8563";
+                               reg = <0x51>;
+                       };
+               };
+
+               i2c@7 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <7>;
+                       ucd90120@65 {
+                               compatible = "ti,ucd90120";
+                               reg = <0x65>;
+                       };
+               };
+       };
+};
+
+&pinctrl0 {
+       pinctrl_gem0_default: gem0-default {
+               mux {
+                       function = "ethernet0";
+                       groups = "ethernet0_0_grp";
+               };
+
+               conf {
+                       groups = "ethernet0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <4>;
+               };
+
+               conf-rx {
+                       pins = "MIO22", "MIO23", "MIO24", "MIO25", "MIO26", "MIO27";
+                       bias-high-impedance;
+                       low-power-disable;
+               };
+
+               conf-tx {
+                       pins = "MIO16", "MIO17", "MIO18", "MIO19", "MIO20", "MIO21";
+                       low-power-enable;
+                       bias-disable;
+               };
+
+               mux-mdio {
+                       function = "mdio0";
+                       groups = "mdio0_0_grp";
+               };
+
+               conf-mdio {
+                       groups = "mdio0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+                       bias-disable;
+               };
+       };
+
+       pinctrl_gpio0_default: gpio0-default {
+               mux {
+                       function = "gpio0";
+                       groups = "gpio0_7_grp", "gpio0_46_grp", "gpio0_47_grp";
+               };
+
+               conf {
+                       groups = "gpio0_7_grp", "gpio0_46_grp", "gpio0_47_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-pull-up {
+                       pins = "MIO46", "MIO47";
+                       bias-pull-up;
+               };
+
+               conf-pull-none {
+                       pins = "MIO7";
+                       bias-disable;
+               };
+       };
+
+       pinctrl_i2c0_default: i2c0-default {
+               mux {
+                       groups = "i2c0_10_grp";
+                       function = "i2c0";
+               };
+
+               conf {
+                       groups = "i2c0_10_grp";
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+       };
+
+       pinctrl_sdhci0_default: sdhci0-default {
+               mux {
+                       groups = "sdio0_2_grp";
+                       function = "sdio0";
+               };
+
+               conf {
+                       groups = "sdio0_2_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+                       bias-disable;
+               };
+
+               mux-cd {
+                       groups = "gpio0_14_grp";
+                       function = "sdio0_cd";
+               };
+
+               conf-cd {
+                       groups = "gpio0_14_grp";
+                       bias-high-impedance;
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               mux-wp {
+                       groups = "gpio0_15_grp";
+                       function = "sdio0_wp";
+               };
+
+               conf-wp {
+                       groups = "gpio0_15_grp";
+                       bias-high-impedance;
+                       bias-pull-up;
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+       };
+
+       pinctrl_uart1_default: uart1-default {
+               mux {
+                       groups = "uart1_10_grp";
+                       function = "uart1";
+               };
+
+               conf {
+                       groups = "uart1_10_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-rx {
+                       pins = "MIO49";
+                       bias-high-impedance;
+               };
+
+               conf-tx {
+                       pins = "MIO48";
+                       bias-disable;
+               };
+       };
+
+       pinctrl_usb0_default: usb0-default {
+               mux {
+                       groups = "usb0_0_grp";
+                       function = "usb0";
+               };
+
+               conf {
+                       groups = "usb0_0_grp";
+                       slew-rate = <0>;
+                       io-standard = <1>;
+               };
+
+               conf-rx {
+                       pins = "MIO29", "MIO31", "MIO36";
+                       bias-high-impedance;
+               };
+
+               conf-tx {
+                       pins = "MIO28", "MIO30", "MIO32", "MIO33", "MIO34",
+                              "MIO35", "MIO37", "MIO38", "MIO39";
+                       bias-disable;
+               };
+       };
+};
+
+&sdhci0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sdhci0_default>;
+};
+
+&uart1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1_default>;
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+       usb-phy = <&usb_phy0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usb0_default>;
 };
index bf107e308a6a77a53f60f17a107fad4e598760ae..da3a182ea1e1706a513048949686d5f01051e5b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Xilinx ZC770 XM010 board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ * Copyright (C) 2013 - 2015 Xilinx, Inc.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -9,20 +9,85 @@
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZC770 XM010 Board";
        compatible = "xlnx,zynq-zc770-xm010", "xlnx,zynq-7000";
+       model = "Xilinx Zynq";
 
        aliases {
+               ethernet0 = &gem0;
+               i2c0 = &i2c0;
                serial0 = &uart1;
-               spi1 = &spi1;
+               spi0 = &spi1;
        };
 
-       memory {
+       chosen {
+               bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";
+               linux,stdout-path = &uart1;
+               stdout-path = &uart1;
+       };
+
+       memory@0 {
                device_type = "memory";
-               reg = <0 0x40000000>;
+               reg = <0x0 0x40000000>;
+       };
+
+       usb_phy0: phy0 {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
        };
 };
 
 &spi1 {
        status = "okay";
+       num-cs = <4>;
+       is-decoded-cs = <0>;
+       flash@0 {
+               compatible = "sst25wf080";
+               reg = <1>;
+               spi-max-frequency = <1000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               partition@test {
+                       label = "spi-flash";
+                       reg = <0x0 0x100000>;
+               };
+       };
+};
+
+&can0 {
+       status = "okay";
+};
+
+&gem0 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+
+       ethernet_phy: ethernet-phy@7 {
+               reg = <7>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       m24c02_eeprom@52 {
+               compatible = "at,24c02";
+               reg = <0x52>;
+       };
+
+};
+
+&sdhci0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+       usb-phy = <&usb_phy0>;
 };
diff --git a/arch/arm/dts/zynq-zc770-xm011.dts b/arch/arm/dts/zynq-zc770-xm011.dts
new file mode 100644 (file)
index 0000000..d38c820
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Xilinx ZC770 XM013 board DTS
+ *
+ * Copyright (C) 2013 Xilinx, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+/dts-v1/;
+#include "zynq-7000.dtsi"
+/ {
+       compatible = "xlnx,zynq-zc770-xm011", "xlnx,zynq-7000";
+       model = "Xilinx Zynq";
+
+       aliases {
+               i2c0 = &i2c1;
+               serial0 = &uart1;
+               spi0 = &spi0;
+       };
+
+       chosen {
+               bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";
+               linux,stdout-path = &uart1;
+               stdout-path = &uart1;
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x40000000>;
+       };
+
+       usb_phy1: phy1 {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
+       };
+};
+
+&spi0 {
+       status = "okay";
+       num-cs = <4>;
+       is-decoded-cs = <0>;
+};
+
+&can0 {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       m24c02_eeprom@52 {
+               compatible = "at,24c02";
+               reg = <0x52>;
+       };
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+       dr_mode = "host";
+       usb-phy = <&usb_phy1>;
+};
index 127a6619c6314d6b9c4ef3cac97e69713bd1a8be..f8cc5039d6b776aa62644248198d4f130fea63bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Xilinx ZC770 XM012 board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ * Copyright (C) 2013 - 2015 Xilinx, Inc.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -9,15 +9,58 @@
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZC770 XM012 Board";
        compatible = "xlnx,zynq-zc770-xm012", "xlnx,zynq-7000";
+       model = "Xilinx Zynq";
 
        aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
                serial0 = &uart1;
+               spi0 = &spi1;
        };
 
-       memory {
+       chosen {
+               bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";
+               linux,stdout-path = &uart1;
+               stdout-path = &uart1;
+       };
+
+       memory@0 {
                device_type = "memory";
-               reg = <0 0x40000000>;
+               reg = <0x0 0x40000000>;
+       };
+};
+
+&spi1 {
+       status = "okay";
+       num-cs = <4>;
+       is-decoded-cs = <0>;
+};
+
+&can1 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       m24c02_eeprom@52 {
+               compatible = "at,24c02";
+               reg = <0x52>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       m24c02_eeprom@52 {
+               compatible = "at,24c02";
+               reg = <0x52>;
        };
 };
+
+&uart1 {
+       status = "okay";
+};
index c61c7e7592f89d882551e2eaeaacb8295c72e9a1..436a8cd1b9a9d4112752a6555d754a4103fd750a 100644 (file)
@@ -9,15 +9,71 @@
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZC770 XM013 Board";
        compatible = "xlnx,zynq-zc770-xm013", "xlnx,zynq-7000";
+       model = "Xilinx Zynq";
 
        aliases {
+               ethernet0 = &gem1;
+               i2c0 = &i2c1;
                serial0 = &uart0;
+               spi0 = &spi0;
        };
 
-       memory {
+       chosen {
+               bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";
+               linux,stdout-path = &uart0;
+               stdout-path = &uart0;
+       };
+
+       memory@0 {
                device_type = "memory";
-               reg = <0 0x40000000>;
+               reg = <0x0 0x40000000>;
+       };
+};
+
+&spi0 {
+       status = "okay";
+       num-cs = <4>;
+       is-decoded-cs = <0>;
+       eeprom: at25@0 {
+               at25,byte-len = <8192>;
+               at25,addr-mode = <2>;
+               at25,page-size = <32>;
+
+               compatible = "atmel,at25";
+               reg = <2>;
+               spi-max-frequency = <1000000>;
+       };
+};
+
+&can1 {
+       status = "okay";
+};
+
+&gem1 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+
+       ethernet_phy: ethernet-phy@7 {
+               reg = <7>;
        };
 };
+
+&i2c1 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       si570: clock-generator@55 {
+               #clock-cells = <0>;
+               compatible = "silabs,si570";
+               temperature-stability = <50>;
+               reg = <0x55>;
+               factory-fout = <156250000>;
+               clock-frequency = <148500000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index 70cc8a6c0d75134c1fda1c701b0cea9c4eea85a8..5762576fea2de490aeb046f9dec16ad48c20f252 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Xilinx ZED board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ *  Copyright (C) 2011 - 2015 Xilinx
+ *  Copyright (C) 2012 National Instruments Corp.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZED Board";
+       model = "Zynq Zed Development Board";
        compatible = "xlnx,zynq-zed", "xlnx,zynq-7000";
 
        aliases {
+               ethernet0 = &gem0;
                serial0 = &uart1;
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0x20000000>;
+               reg = <0x0 0x20000000>;
        };
+
+       chosen {
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
+       };
+
+       usb_phy0: phy0 {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
+       };
+};
+
+&clkc {
+       ps-clk-frequency = <33333333>;
+};
+
+&gem0 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+
+       ethernet_phy: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&sdhci0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+       usb-phy = <&usb_phy0>;
 };
index 20e03867773a0d86b66877a056a861ecc2924569..10f78155244d7ec6a00b1e2ad77274cc2d2be485 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Digilent ZYBO board DTS
  *
- * Copyright (C) 2013 Xilinx, Inc.
+ *  Copyright (C) 2011 - 2015 Xilinx
+ *  Copyright (C) 2012 National Instruments Corp.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include "zynq-7000.dtsi"
 
 / {
-       model = "Zynq ZYBO Board";
-       compatible = "xlnx,zynq-zybo", "xlnx,zynq-7000";
+       model = "Zynq ZYBO Development Board";
+       compatible = "digilent,zynq-zybo", "xlnx,zynq-7000";
 
        aliases {
+               ethernet0 = &gem0;
                serial0 = &uart1;
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0x20000000>;
+               reg = <0x0 0x20000000>;
        };
+
+       chosen {
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
+       };
+
+};
+
+&clkc {
+       ps-clk-frequency = <50000000>;
+};
+
+&gem0 {
+       status = "okay";
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethernet_phy>;
+
+       ethernet_phy: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&sdhci0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
 };
index e5c0b0d08ff9ecd1ec1689234de428be26c1fc79..47962dadf59c9b11da0c7975b2f2b92830876e2d 100644 (file)
 #define AM4372_BOARD_VERSION_END       SRAM_SCRATCH_SPACE_ADDR + 0x14
 #define QSPI_BASE              0x47900000
 #endif
+
+/* Boot parameters */
+#ifndef __ASSEMBLY__
+struct omap_boot_parameters {
+       unsigned int reserved;
+       unsigned int boot_device_descriptor;
+       unsigned char boot_device;
+       unsigned char reset_reason;
+};
+#endif
+
 #endif
index e756418a59d957a3aafdbbe11f3d9ad6e566ad55..4ed85972e3ec7758547c6f5809ba84449236d86b 100644 (file)
@@ -7,51 +7,65 @@
 #ifndef        _ASM_ARCH_SPL_H_
 #define        _ASM_ARCH_SPL_H_
 
-#if defined(CONFIG_TI816X)
-#define BOOT_DEVICE_XIP                2
-#define BOOT_DEVICE_NAND       3
-#define BOOT_DEVICE_MMC1       6
-#define BOOT_DEVICE_MMC2       5
+#define BOOT_DEVICE_NONE       0x00
+#define BOOT_DEVICE_MMC2_2     0xFF
+
+#if defined(CONFIG_TI814X)
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_XIPWAIT    0x02
+#define BOOT_DEVICE_NAND       0x05
+#define BOOT_DEVICE_NAND_I2C   0x06
+#define BOOT_DEVICE_MMC2       0x08 /* ROM only supports 2nd instance. */
+#define BOOT_DEVICE_MMC1       0x09
+#define BOOT_DEVICE_SPI                0x15
+#define BOOT_DEVICE_UART       0x41
+#define BOOT_DEVICE_USBETH     0x44
+#define BOOT_DEVICE_CPGMAC     0x46
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
+#elif defined(CONFIG_TI816X)
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_XIPWAIT    0x02
+#define BOOT_DEVICE_NAND       0x03
+#define BOOT_DEVICE_ONENAD     0x04
+#define BOOT_DEVICE_MMC2       0x05 /* ROM only supports 2nd instance. */
+#define BOOT_DEVICE_MMC1       0x06
 #define BOOT_DEVICE_UART       0x43
-#elif defined(CONFIG_AM43XX)
-#define BOOT_DEVICE_NOR                1
-#define BOOT_DEVICE_NAND       5
-#define BOOT_DEVICE_MMC1       7
-#define BOOT_DEVICE_MMC2       8
-#define BOOT_DEVICE_SPI                10
-#define BOOT_DEVICE_USB     13
-#define BOOT_DEVICE_UART       65
-#define BOOT_DEVICE_CPGMAC     71
-#else
-#define BOOT_DEVICE_XIP        2
-#define BOOT_DEVICE_NAND       5
-#define BOOT_DEVICE_NAND_I2C   6
-#if defined(CONFIG_AM33XX)
-#define BOOT_DEVICE_MMC1       8
-#define BOOT_DEVICE_MMC2       9       /* eMMC or daughter card */
-#elif defined(CONFIG_TI814X)
-#define BOOT_DEVICE_MMC1       9
-#define BOOT_DEVICE_MMC2       8       /* ROM only supports 2nd instance */
-#endif
-#define BOOT_DEVICE_SPI                11
-#define BOOT_DEVICE_UART       65
-#define BOOT_DEVICE_USBETH     68
-#define BOOT_DEVICE_CPGMAC     70
-#endif
-#define BOOT_DEVICE_MMC2_2      0xFF
+#define BOOT_DEVICE_USB                0x45
 
-#if defined(CONFIG_AM33XX)
-#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
-#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
+#elif defined(CONFIG_AM33XX)
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_XIPWAIT    0x02
+#define BOOT_DEVICE_NAND       0x05
+#define BOOT_DEVICE_NAND_I2C   0x06
+#define BOOT_DEVICE_MMC1       0x08
+#define BOOT_DEVICE_MMC2       0x09
+#define BOOT_DEVICE_SPI                0x15
+#define BOOT_DEVICE_UART       0x41
+#define BOOT_DEVICE_USBETH     0x44
+#define BOOT_DEVICE_CPGMAC     0x46
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
 #elif defined(CONFIG_AM43XX)
-#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define BOOT_DEVICE_NOR                0x01
+#define BOOT_DEVICE_NAND       0x05
+#define BOOT_DEVICE_MMC1       0x07
+#define BOOT_DEVICE_MMC2       0x08
+#define BOOT_DEVICE_SPI                0x0A
+#define BOOT_DEVICE_UART       0x41
+#define BOOT_DEVICE_USB                0x45
+#define BOOT_DEVICE_CPGMAC     0x47
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
 #ifdef CONFIG_SPL_USB_SUPPORT
-#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_USB
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_USB
 #else
-#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
 #endif
-#elif defined(CONFIG_TI81XX)
-#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
-#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
 #endif
+
 #endif
index 7eacf27a935b640d7b337626bac8796a2ba371ca..91b614ad20751f2feb1e308be3d668c719ed919e 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 #include <linux/mtd/omap_gpmc.h>
-#include <asm/ti-common/sys_proto.h>
 #include <asm/arch/cpu.h>
 
 u32 get_cpu_rev(void);
index 194b93bf56dcedd2e71ae63d5a4986b80b769afd..537d13b2637a625cbe3e79fdf49d12eaeb229731 100644 (file)
@@ -142,6 +142,7 @@ struct gpio {
 
 #define NON_SECURE_SRAM_START          0x40208000 /* Works for GP & EMU */
 #define NON_SECURE_SRAM_END            0x40210000
+#define SRAM_SCRATCH_SPACE_ADDR                0x4020E000
 
 #define LOW_LEVEL_SRAM_STACK           0x4020FFFC
 
@@ -245,4 +246,16 @@ struct gpio {
 /* ABB tranxdone mask */
 #define OMAP_ABB_MPU_TXDONE_MASK       (0x1 << 26)
 
+/* Boot parameters */
+#ifndef __ASSEMBLY__
+struct omap_boot_parameters {
+       unsigned int boot_message;
+       unsigned char boot_device;
+       unsigned char reserved;
+       unsigned char reset_reason;
+       unsigned char ch_flags;
+       unsigned int boot_device_descriptor;
+};
+#endif
+
 #endif
index 835053278647a85d030f7205db0aba9604e7a998..a31b4ea24b543e532fcee47221a813b4b6fae05c 100644 (file)
@@ -7,14 +7,16 @@
 #ifndef        _ASM_ARCH_SPL_H_
 #define        _ASM_ARCH_SPL_H_
 
-#define BOOT_DEVICE_NONE       0
-#define BOOT_DEVICE_XIP                1
-#define BOOT_DEVICE_NAND       2
-#define BOOT_DEVICE_ONENAND    3
-#define BOOT_DEVICE_MMC2       5 /*emmc*/
-#define BOOT_DEVICE_MMC1       6
-#define BOOT_DEVICE_XIPWAIT    7
-#define BOOT_DEVICE_MMC2_2      0xFF
+#define BOOT_DEVICE_NONE       0x00
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_NAND       0x02
+#define BOOT_DEVICE_ONENAND    0x03
+#define BOOT_DEVICE_MMC2       0x05
+#define BOOT_DEVICE_MMC1       0x06
+#define BOOT_DEVICE_XIPWAIT    0x07
+#define BOOT_DEVICE_MMC2_2      0x08
+#define BOOT_DEVICE_UART       0x10
+#define BOOT_DEVICE_USB                0x11
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
index 3e45ce184ba4381907f99d50502bbeb035332c70..94f29fdd41e49b01be72a58a0323bc94bf277820 100644 (file)
@@ -52,7 +52,6 @@ void set_muxconf_regs(void);
 u32 get_cpu_family(void);
 u32 get_cpu_rev(void);
 u32 get_sku_id(void);
-u32 get_sysboot_value(void);
 u32 is_gpmc_muxed(void);
 u32 get_gpmc0_type(void);
 u32 get_gpmc0_width(void);
@@ -75,4 +74,6 @@ void get_dieid(u32 *id);
 void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
 void omap3_set_aux_cr_secure(u32 acr);
 u32 warm_reset(void);
+
+void save_omap_boot_params(void);
 #endif
index d43dc265cd68f952897d07b39fbf691fbe281fdf..12b1a094461ed49ffd2057d16ce8e9374e52f24a 100644 (file)
@@ -124,4 +124,15 @@ struct s32ktimer {
 /* ABB tranxdone mask */
 #define OMAP_ABB_MPU_TXDONE_MASK       (0x1 << 7)
 
+/* Boot parameters */
+#ifndef __ASSEMBLY__
+struct omap_boot_parameters {
+       unsigned int boot_message;
+       unsigned int boot_device_descriptor;
+       unsigned char boot_device;
+       unsigned char reset_reason;
+       unsigned char ch_flags;
+};
+#endif
+
 #endif
index fb842a22640ce68decb8e4500f6aa1df6d5faa60..bace92dae8f18432fe377e174f3ec962b5d43eb9 100644 (file)
@@ -7,15 +7,17 @@
 #ifndef        _ASM_ARCH_SPL_H_
 #define        _ASM_ARCH_SPL_H_
 
-#define BOOT_DEVICE_NONE       0
-#define BOOT_DEVICE_XIP                1
-#define BOOT_DEVICE_XIPWAIT    2
-#define BOOT_DEVICE_NAND       3
-#define BOOT_DEVICE_ONENAND    4
-#define BOOT_DEVICE_MMC1       5
-#define BOOT_DEVICE_MMC2       6
-#define BOOT_DEVICE_MMC2_2     0xFF
+#define BOOT_DEVICE_NONE       0x00
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_XIPWAIT    0x02
+#define BOOT_DEVICE_NAND       0x03
+#define BOOT_DEVICE_ONENAND    0x04
+#define BOOT_DEVICE_MMC1       0x05
+#define BOOT_DEVICE_MMC2       0x06
+#define BOOT_DEVICE_MMC2_2     0x07
+#define BOOT_DEVICE_UART       0x43
+#define BOOT_DEVICE_USB                0x45
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
-#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2_2
 #endif
index 68c6d6dc0acc7e3f919e0a03ecc5227bd3643aea..524fae4bb9c642307212c0b56b7936e1b73c5952 100644 (file)
@@ -235,4 +235,16 @@ struct ctrl_ioregs {
 };
 
 #endif /* __ASSEMBLY__ */
+
+/* Boot parameters */
+#ifndef __ASSEMBLY__
+struct omap_boot_parameters {
+       unsigned int boot_message;
+       unsigned int boot_device_descriptor;
+       unsigned char boot_device;
+       unsigned char reset_reason;
+       unsigned char ch_flags;
+};
+#endif
+
 #endif
index f70799860f4d387396317cacb04bf7c9a9a122f2..468ff5afd54738f7cd89466bfe0e8e916d598e15 100644 (file)
@@ -7,17 +7,20 @@
 #ifndef        _ASM_ARCH_SPL_H_
 #define        _ASM_ARCH_SPL_H_
 
-#define BOOT_DEVICE_NONE        0
-#define BOOT_DEVICE_XIP         1
-#define BOOT_DEVICE_XIPWAIT     2
-#define BOOT_DEVICE_NAND        3
-#define BOOT_DEVICE_ONENAND    4
-#define BOOT_DEVICE_MMC1        5
-#define BOOT_DEVICE_MMC2        6
-#define BOOT_DEVICE_MMC2_2     7
-#define BOOT_DEVICE_SATA       9
-#define BOOT_DEVICE_SPI                10
+#define BOOT_DEVICE_NONE       0x00
+#define BOOT_DEVICE_XIP                0x01
+#define BOOT_DEVICE_XIPWAIT    0x02
+#define BOOT_DEVICE_NAND       0x03
+#define BOOT_DEVICE_ONENAND    0x04
+#define BOOT_DEVICE_MMC1       0x05
+#define BOOT_DEVICE_MMC2       0x06
+#define BOOT_DEVICE_MMC2_2     0x07
+#define BOOT_DEVICE_SATA       0x09
+#define BOOT_DEVICE_SPI                0x0A
+#define BOOT_DEVICE_QSPI_1     0x0A
+#define BOOT_DEVICE_QSPI_4     0x0B
 #define BOOT_DEVICE_UART       0x43
+#define BOOT_DEVICE_USB                0x45
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2_2
index a9f88db560fe4f2b3aa9931b26096647580bf5b2..3ed3801dfe7d9d045d19110c70d4000029461002 100644 (file)
@@ -14,6 +14,7 @@
 /*
  * Peripheral memory map
  */
+#define STM32_SYSMEM_BASE      0x1FFF0000
 #define STM32_PERIPH_BASE      0x40000000
 #define STM32_APB1PERIPH_BASE  (STM32_PERIPH_BASE + 0x00000000)
 #define STM32_APB2PERIPH_BASE  (STM32_PERIPH_BASE + 0x00010000)
 /*
  * Register maps
  */
+struct stm32_u_id_regs {
+       u32 u_id_low;
+       u32 u_id_mid;
+       u32 u_id_high;
+};
+
 struct stm32_rcc_regs {
        u32 cr;         /* RCC clock control */
        u32 pllcfgr;    /* RCC PLL configuration */
@@ -78,6 +85,9 @@ struct stm32_flash_regs {
 /*
  * Registers access macros
  */
+#define STM32_U_ID_BASE                (STM32_SYSMEM_BASE + 0x7A10)
+#define STM32_U_ID             ((struct stm32_u_id_regs *)STM32_U_ID_BASE)
+
 #define STM32_RCC_BASE         (STM32_AHB1PERIPH_BASE + 0x3800)
 #define STM32_RCC              ((struct stm32_rcc_regs *)STM32_RCC_BASE)
 
index c9dc49d783173db819352c218153e4a472a93ee4..7640eabad13e2ad6138aa490520d749bc48f96b5 100644 (file)
 #define ZYNQ_SERIAL_BASEADDR0  0xFF000000
 #define ZYNQ_SERIAL_BASEADDR1  0xFF001000
 
+#define ZYNQ_GEM_BASEADDR0     0xFF0B0000
+#define ZYNQ_GEM_BASEADDR1     0xFF0C0000
+#define ZYNQ_GEM_BASEADDR2     0xFF0D0000
+#define ZYNQ_GEM_BASEADDR3     0xFF0E0000
+
 #define ZYNQ_SPI_BASEADDR0     0xFF040000
 #define ZYNQ_SPI_BASEADDR1     0xFF050000
 
@@ -20,6 +25,8 @@
 #define ZYNQ_SDHCI_BASEADDR0   0xFF160000
 #define ZYNQ_SDHCI_BASEADDR1   0xFF170000
 
+#define ZYNQMP_SATA_BASEADDR   0xFD0C0000
+
 #define ZYNQMP_CRL_APB_BASEADDR        0xFF5E0000
 #define ZYNQMP_CRL_APB_TIMESTAMP_REF_CTRL_CLKACT       0x1000000
 
@@ -55,6 +62,15 @@ struct iou_scntr {
 #define EMMC_MODE      0x00000006
 #define JTAG_MODE      0x00000000
 
+#define ZYNQMP_IOU_SLCR_BASEADDR       0xFF180000
+
+struct iou_slcr_regs {
+       u32 mio_pin[78];
+       u32 reserved[442];
+};
+
+#define slcr_base ((struct iou_slcr_regs *)ZYNQMP_IOU_SLCR_BASEADDR)
+
 #define ZYNQMP_RPU_BASEADDR    0xFF9A0000
 
 struct rpu_regs {
index d8e0ba1588a0a9f5ab912db5d5f17115717dc5cf..f5c90d11dc40abb2a834c25d538710110c1dbd39 100644 (file)
@@ -8,7 +8,13 @@
 #ifndef _ASM_ARCH_SYS_PROTO_H
 #define _ASM_ARCH_SYS_PROTO_H
 
+/* Setup clk for network */
+static inline void zynq_slcr_gem_clk_setup(u32 gem_id, unsigned long clk_rate)
+{
+}
+
 int zynq_sdhci_init(unsigned long regbase);
+int zynq_slcr_get_mio_pin_status(const char *periph);
 
 unsigned int zynqmp_get_silicon_version(void);
 
index bb24f33d0d8816c089ba344d332ae40ed8c7002b..4e3ea55e290a19c766017b59241615f7723531d5 100644 (file)
@@ -8,10 +8,6 @@
 #ifndef        __ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
-#ifdef CONFIG_OMAP
-#include <asm/omap_boot.h>
-#endif
-
 /* Architecture-specific global data */
 struct arch_global_data {
 #if defined(CONFIG_FSL_ESDHC)
@@ -45,8 +41,10 @@ struct arch_global_data {
        unsigned long tlb_size;
 #endif
 
-#ifdef CONFIG_OMAP
-       struct omap_boot_parameters omap_boot_params;
+#ifdef CONFIG_OMAP_COMMON
+       u32 omap_boot_device;
+       u32 omap_boot_mode;
+       u8 omap_ch_flags;
 #endif
 #ifdef CONFIG_FSL_LSCH3
        unsigned long mem2_clk;
diff --git a/arch/arm/include/asm/omap_boot.h b/arch/arm/include/asm/omap_boot.h
deleted file mode 100644 (file)
index f77f9d6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (C) Copyright 2013
- * Texas Instruments, <www.ti.com>
- *
- * Sricharan R <r.sricharan@ti.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-/* ROM code defines */
-/* Boot device */
-#define BOOT_DEVICE_MASK       0xFF
-#define BOOT_DEVICE_OFFSET     0x8
-#define DEV_DESC_PTR_OFFSET    0x4
-#define DEV_DATA_PTR_OFFSET    0x18
-#define BOOT_MODE_OFFSET       0x8
-#define RESET_REASON_OFFSET    0x9
-#define CH_FLAGS_OFFSET                0xA
-
-#define CH_FLAGS_CHSETTINGS    (0x1 << 0)
-#define CH_FLAGS_CHRAM         (0x1 << 1)
-#define CH_FLAGS_CHFLASH       (0x1 << 2)
-#define CH_FLAGS_CHMMCSD       (0x1 << 3)
-
-#ifndef __ASSEMBLY__
-struct omap_boot_parameters {
-       char *boot_message;
-       unsigned int mem_boot_descriptor;
-       unsigned char omap_bootdevice;
-       unsigned char reset_reason;
-       unsigned char ch_flags;
-       unsigned long omap_bootmode;
-};
-#endif
index 5469435cc756e82af8839529bd20a9501a910b37..056affc3fabdccdf6be6a4ec2dd8ea32118fd1dc 100644 (file)
@@ -688,4 +688,17 @@ static inline u8 is_dra72x(void)
 #define OMAP_SRAM_SCRATCH_BOOT_PARAMS  (SRAM_SCRATCH_SPACE_ADDR + 0x24)
 #define OMAP5_SRAM_SCRATCH_SPACE_END   (SRAM_SCRATCH_SPACE_ADDR + 0x28)
 
+/* Boot parameters */
+#define DEVICE_DATA_OFFSET     0x18
+#define BOOT_MODE_OFFSET       0x8
+
+#define CH_FLAGS_CHSETTINGS    (1 << 0)
+#define CH_FLAGS_CHRAM         (1 << 1)
+#define CH_FLAGS_CHFLASH       (1 << 2)
+#define CH_FLAGS_CHMMCSD       (1 << 3)
+
+#ifndef __ASSEMBLY__
+u32 omap_sys_boot_device(void);
+#endif
+
 #endif /* _OMAP_COMMON_H_ */
index d3ab75fa3209024d0dd16ff00638aaeaa3f3db3c..2bdb71cfe8e593eded89661b87cecb4cedbb50e6 100644 (file)
@@ -36,7 +36,7 @@ static inline u8 uboot_loaded_by_spl(void)
         * variable by both SPL and u-boot.Check out for CHSETTINGS, which is a
         * mandatory section if CH is present.
         */
-       if ((gd->arch.omap_boot_params.ch_flags) & (CH_FLAGS_CHSETTINGS))
+       if (gd->arch.omap_ch_flags & CH_FLAGS_CHSETTINGS)
                return 0;
        else
                return running_from_sdram();
index f9f58a37dfcd054a124c88dda265530e2ecf46c8..73ceb8307225e03ccd44222950dd46c252718796 100644 (file)
@@ -55,8 +55,13 @@ U_BOOT_CMD(mon_install, 2, 0, do_mon_install,
 
 static void core_spin(void)
 {
-       while (1)
-               ; /* forever */;
+       while (1) {
+               asm volatile (
+                       "dsb\n"
+                       "isb\n"
+                       "wfi\n"
+               );
+       }
 }
 
 int mon_power_on(int core_id, void *ep)
index 3b3f4463ba4ab34c2c5b60ecdbcb6244ce8afc37..18451d3e45183dd2f4faaab21ce89f8825d436df 100644 (file)
@@ -22,9 +22,11 @@ config MPC8260
 
 config MPC83xx
        bool "MPC83xx"
+       select CREATE_ARCH_SYMLINK
 
 config MPC85xx
        bool "MPC85xx"
+       select CREATE_ARCH_SYMLINK
 
 config MPC86xx
        bool "MPC86xx"
@@ -34,6 +36,7 @@ config 8xx
 
 config 4xx
        bool "PPC4xx"
+       select CREATE_ARCH_SYMLINK
 
 endchoice
 
index cbbaa4f2ce6db901a2ccf8941710332a0c696f4e..e8968a7182bbcbc0b64722b4667b97fcc7c00ac4 100644 (file)
@@ -369,4 +369,14 @@ config PCIE_ECAM_BASE
          assigned to PCI devices - i.e. the memory and prefetch regions, as
          passed to pci_set_region().
 
+config PCIE_ECAM_SIZE
+       hex
+       default 0x10000000
+       help
+         This is the size of memory-mapped address of PCI configuration space,
+         which is only available through the Enhanced Configuration Access
+         Mechanism (ECAM) with PCI Express. Each bus consumes 1 MiB memory,
+         so a default 0x10000000 size covers all of the 256 buses which is the
+         maximum number of PCI buses as defined by the PCI specification.
+
 endmenu
index af927b94e0839b9211393cbd536046a7214d3c61..b9134cfef3747602ea8cee9cc4964afae8511abd 100644 (file)
@@ -363,13 +363,26 @@ int x86_cpu_init_f(void)
                mtrr_cap = native_read_msr(MTRR_CAP_MSR);
                if (mtrr_cap & MTRR_CAP_FIX) {
                        /* Mark the VGA RAM area as uncacheable */
-                       native_write_msr(MTRR_FIX_16K_A0000_MSR, 0, 0);
-
-                       /* Mark the PCI ROM area as uncacheable */
-                       native_write_msr(MTRR_FIX_4K_C0000_MSR, 0, 0);
-                       native_write_msr(MTRR_FIX_4K_C8000_MSR, 0, 0);
-                       native_write_msr(MTRR_FIX_4K_D0000_MSR, 0, 0);
-                       native_write_msr(MTRR_FIX_4K_D8000_MSR, 0, 0);
+                       native_write_msr(MTRR_FIX_16K_A0000_MSR,
+                                        MTRR_FIX_TYPE(MTRR_TYPE_UNCACHEABLE),
+                                        MTRR_FIX_TYPE(MTRR_TYPE_UNCACHEABLE));
+
+                       /*
+                        * Mark the PCI ROM area as cacheable to improve ROM
+                        * execution performance.
+                        */
+                       native_write_msr(MTRR_FIX_4K_C0000_MSR,
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK),
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
+                       native_write_msr(MTRR_FIX_4K_C8000_MSR,
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK),
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
+                       native_write_msr(MTRR_FIX_4K_D0000_MSR,
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK),
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
+                       native_write_msr(MTRR_FIX_4K_D8000_MSR,
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK),
+                                        MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
 
                        /* Enable the fixed range MTRRs */
                        msr_setbits_64(MTRR_DEF_TYPE_MSR, MTRR_DEF_TYPE_FIX_EN);
@@ -683,6 +696,15 @@ __weak int x86_init_cpus(void)
 #ifdef CONFIG_SMP
        debug("Init additional CPUs\n");
        x86_mp_init();
+#else
+       struct udevice *dev;
+
+       /*
+        * This causes the cpu-x86 driver to be probed.
+        * We don't check return value here as we want to allow boards
+        * which have not been converted to use cpu uclass driver to boot.
+        */
+       uclass_first_device(UCLASS_CPU, &dev);
 #endif
 
        return 0;
index c777d3646fca7e1db142216b3449e737aba0752a..853c82f5a7709105b822309abc2edcd44f6e7635 100644 (file)
@@ -32,14 +32,76 @@ DECLARE_GLOBAL_DATA_PTR;
        "pushl $"#x"\n" \
        "jmp irq_common_entry\n"
 
+static char *exceptions[] = {
+       "Divide Error",
+       "Debug",
+       "NMI Interrupt",
+       "Breakpoint",
+       "Overflow",
+       "BOUND Range Exceeded",
+       "Invalid Opcode (Undefined Opcode)",
+       "Device Not Avaiable (No Math Coprocessor)",
+       "Double Fault",
+       "Coprocessor Segment Overrun",
+       "Invalid TSS",
+       "Segment Not Present",
+       "Stack Segment Fault",
+       "Gerneral Protection",
+       "Page Fault",
+       "Reserved",
+       "x87 FPU Floating-Point Error",
+       "Alignment Check",
+       "Machine Check",
+       "SIMD Floating-Point Exception",
+       "Virtualization Exception",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved",
+       "Reserved"
+};
+
 static void dump_regs(struct irq_regs *regs)
 {
+       unsigned long cs, eip, eflags;
        unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
        unsigned long d0, d1, d2, d3, d6, d7;
        unsigned long sp;
 
+       /*
+        * Some exceptions cause an error code to be saved on the current stack
+        * after the EIP value. We should extract CS/EIP/EFLAGS from different
+        * position on the stack based on the exception number.
+        */
+       switch (regs->irq_id) {
+       case EXC_DF:
+       case EXC_TS:
+       case EXC_NP:
+       case EXC_SS:
+       case EXC_GP:
+       case EXC_PF:
+       case EXC_AC:
+               cs = regs->context.ctx2.xcs;
+               eip = regs->context.ctx2.eip;
+               eflags = regs->context.ctx2.eflags;
+               /* We should fix up the ESP due to error code */
+               regs->esp += 4;
+               break;
+       default:
+               cs = regs->context.ctx1.xcs;
+               eip = regs->context.ctx1.eip;
+               eflags = regs->context.ctx1.eflags;
+               break;
+       }
+
        printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n",
-                       (u16)regs->xcs, regs->eip, regs->eflags);
+                       (u16)cs, eip, eflags);
 
        printf("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
                regs->eax, regs->ebx, regs->ecx, regs->edx);
@@ -85,6 +147,13 @@ static void dump_regs(struct irq_regs *regs)
        }
 }
 
+static void do_exception(struct irq_regs *regs)
+{
+       printf("%s\n", exceptions[regs->irq_id]);
+       dump_regs(regs);
+       hang();
+}
+
 struct idt_entry {
        u16     base_low;
        u16     selector;
@@ -201,111 +270,10 @@ void irq_llsr(struct irq_regs *regs)
         * Order Number: 253665-029US, November 2008
         * Table 6-1. Exceptions and Interrupts
         */
-       switch (regs->irq_id) {
-       case 0x00:
-               printf("Divide Error (Division by zero)\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x01:
-               printf("Debug Interrupt (Single step)\n");
-               dump_regs(regs);
-               break;
-       case 0x02:
-               printf("NMI Interrupt\n");
-               dump_regs(regs);
-               break;
-       case 0x03:
-               printf("Breakpoint\n");
-               dump_regs(regs);
-               break;
-       case 0x04:
-               printf("Overflow\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x05:
-               printf("BOUND Range Exceeded\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x06:
-               printf("Invalid Opcode (UnDefined Opcode)\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x07:
-               printf("Device Not Available (No Math Coprocessor)\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x08:
-               printf("Double fault\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x09:
-               printf("Co-processor segment overrun\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x0a:
-               printf("Invalid TSS\n");
-               dump_regs(regs);
-               break;
-       case 0x0b:
-               printf("Segment Not Present\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x0c:
-               printf("Stack Segment Fault\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x0d:
-               printf("General Protection\n");
-               dump_regs(regs);
-               break;
-       case 0x0e:
-               printf("Page fault\n");
-               dump_regs(regs);
-               hang();
-               break;
-       case 0x0f:
-               printf("Floating-Point Error (Math Fault)\n");
-               dump_regs(regs);
-               break;
-       case 0x10:
-               printf("Alignment check\n");
-               dump_regs(regs);
-               break;
-       case 0x11:
-               printf("Machine Check\n");
-               dump_regs(regs);
-               break;
-       case 0x12:
-               printf("SIMD Floating-Point Exception\n");
-               dump_regs(regs);
-               break;
-       case 0x13:
-       case 0x14:
-       case 0x15:
-       case 0x16:
-       case 0x17:
-       case 0x18:
-       case 0x19:
-       case 0x1a:
-       case 0x1b:
-       case 0x1c:
-       case 0x1d:
-       case 0x1e:
-       case 0x1f:
-               printf("Reserved Exception\n");
-               dump_regs(regs);
-               break;
-
-       default:
+       if (regs->irq_id < 32) {
+               /* Architecture defined exception */
+               do_exception(regs);
+       } else {
                /* Hardware or User IRQ */
                do_irq(regs->irq_id);
        }
index ea169b05e944429fe4b4bd7cbdab1df5b478a23a..89d4a5e9ccacf5d49d7ca9f26d07983f3f01f211 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/pci.h>
 #include <asm/arch/pch.h>
 #include <asm/arch/sandybridge.h>
-#include <linux/kconfig.h>
 
 struct gt_powermeter {
        u16 reg;
index bc1a0f06fbe31d6829a7a1c75c38c50c0c768a11..3efd3e841f4e8f1c7696664ac7efc33dad54a839 100644 (file)
@@ -252,7 +252,6 @@ static void pch_rtc_init(pci_dev_t dev)
        /* TODO: Handle power failure */
        if (rtc_failed)
                printf("RTC power failed\n");
-       rtc_init();
 }
 
 /* CougarPoint PCH Power Management init */
index af907c5b9b3c9a36e8c37a29821500a7580e5ccc..7f3b13d3571f420aee76006c4277445d878d1df3 100644 (file)
@@ -128,6 +128,14 @@ static int get_mrc_entry(struct udevice **devp, struct fmap_entry *entry)
 static int read_seed_from_cmos(struct pei_data *pei_data)
 {
        u16 c1, c2, checksum, seed_checksum;
+       struct udevice *dev;
+       int rcode = 0;
+
+       rcode = uclass_get_device(UCLASS_RTC, 0, &dev);
+       if (rcode) {
+               debug("Cannot find RTC: err=%d\n", rcode);
+               return -ENODEV;
+       }
 
        /*
         * Read scrambler seeds from CMOS RAM. We don't want to store them in
@@ -135,11 +143,11 @@ static int read_seed_from_cmos(struct pei_data *pei_data)
         * the flash too much. So we store these in CMOS and the large MRC
         * data in SPI flash.
         */
-       pei_data->scrambler_seed = rtc_read32(CMOS_OFFSET_MRC_SEED);
+       rtc_read32(dev, CMOS_OFFSET_MRC_SEED, &pei_data->scrambler_seed);
        debug("Read scrambler seed    0x%08x from CMOS 0x%02x\n",
              pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED);
 
-       pei_data->scrambler_seed_s3 = rtc_read32(CMOS_OFFSET_MRC_SEED_S3);
+       rtc_read32(dev, CMOS_OFFSET_MRC_SEED_S3, &pei_data->scrambler_seed_s3);
        debug("Read S3 scrambler seed 0x%08x from CMOS 0x%02x\n",
              pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3);
 
@@ -150,8 +158,8 @@ static int read_seed_from_cmos(struct pei_data *pei_data)
                                 sizeof(u32));
        checksum = add_ip_checksums(sizeof(u32), c1, c2);
 
-       seed_checksum = rtc_read8(CMOS_OFFSET_MRC_SEED_CHK);
-       seed_checksum |= rtc_read8(CMOS_OFFSET_MRC_SEED_CHK + 1) << 8;
+       seed_checksum = rtc_read8(dev, CMOS_OFFSET_MRC_SEED_CHK);
+       seed_checksum |= rtc_read8(dev, CMOS_OFFSET_MRC_SEED_CHK + 1) << 8;
 
        if (checksum != seed_checksum) {
                debug("%s: invalid seed checksum\n", __func__);
@@ -223,13 +231,21 @@ static int build_mrc_data(struct mrc_data_container **datap)
 static int write_seeds_to_cmos(struct pei_data *pei_data)
 {
        u16 c1, c2, checksum;
+       struct udevice *dev;
+       int rcode = 0;
+
+       rcode = uclass_get_device(UCLASS_RTC, 0, &dev);
+       if (rcode) {
+               debug("Cannot find RTC: err=%d\n", rcode);
+               return -ENODEV;
+       }
 
        /* Save the MRC seed values to CMOS */
-       rtc_write32(CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed);
+       rtc_write32(dev, CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed);
        debug("Save scrambler seed    0x%08x to CMOS 0x%02x\n",
              pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED);
 
-       rtc_write32(CMOS_OFFSET_MRC_SEED_S3, pei_data->scrambler_seed_s3);
+       rtc_write32(dev, CMOS_OFFSET_MRC_SEED_S3, pei_data->scrambler_seed_s3);
        debug("Save s3 scrambler seed 0x%08x to CMOS 0x%02x\n",
              pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3);
 
@@ -240,8 +256,8 @@ static int write_seeds_to_cmos(struct pei_data *pei_data)
                                 sizeof(u32));
        checksum = add_ip_checksums(sizeof(u32), c1, c2);
 
-       rtc_write8(CMOS_OFFSET_MRC_SEED_CHK, checksum & 0xff);
-       rtc_write8(CMOS_OFFSET_MRC_SEED_CHK + 1, (checksum >> 8) & 0xff);
+       rtc_write8(dev, CMOS_OFFSET_MRC_SEED_CHK, checksum & 0xff);
+       rtc_write8(dev, CMOS_OFFSET_MRC_SEED_CHK + 1, (checksum >> 8) & 0xff);
 
        return 0;
 }
index c209f15ec4a8787364080467fffed562eda65cc1..f8da08035e62bbcfd5454682bfa5b03fbeca19a9 100644 (file)
@@ -152,23 +152,32 @@ int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
        return 0;
 }
 
-void pci_assign_irqs(int bus, int device, int func, u8 irq[4])
+void pci_assign_irqs(int bus, int device, u8 irq[4])
 {
        pci_dev_t bdf;
+       int func;
+       u16 vendor;
        u8 pin, line;
 
-       bdf = PCI_BDF(bus, device, func);
+       for (func = 0; func < 8; func++) {
+               bdf = PCI_BDF(bus, device, func);
+               vendor = x86_pci_read_config16(bdf, PCI_VENDOR_ID);
+               if (vendor == 0xffff || vendor == 0x0000)
+                       continue;
 
-       pin = x86_pci_read_config8(bdf, PCI_INTERRUPT_PIN);
+               pin = x86_pci_read_config8(bdf, PCI_INTERRUPT_PIN);
 
-       /* PCI spec says all values except 1..4 are reserved */
-       if ((pin < 1) || (pin > 4))
-               return;
+               /* PCI spec says all values except 1..4 are reserved */
+               if ((pin < 1) || (pin > 4))
+                       continue;
 
-       line = irq[pin - 1];
+               line = irq[pin - 1];
+               if (!line)
+                       continue;
 
-       debug("Assigning IRQ %d to PCI device %d.%x.%d (INT%c)\n",
-             line, bus, device, func, 'A' + pin - 1);
+               debug("Assigning IRQ %d to PCI device %d.%x.%d (INT%c)\n",
+                     line, bus, device, func, 'A' + pin - 1);
 
-       x86_pci_write_config8(bdf, PCI_INTERRUPT_LINE, line);
+               x86_pci_write_config8(bdf, PCI_INTERRUPT_LINE, line);
+       }
 }
index 1a9140b46e04f64d9241eb27f4eb3ad48a8a3583..2e944569b5be3da8d02e5182ee21c0b4cd9a8573 100644 (file)
@@ -13,6 +13,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static bool i440fx;
+
 void board_pci_setup_hose(struct pci_controller *hose)
 {
        hose->first_busno = 0;
@@ -50,7 +52,7 @@ void board_pci_setup_hose(struct pci_controller *hose)
 int board_pci_post_scan(struct pci_controller *hose)
 {
        int ret = 0;
-       u16 device;
+       u16 device, xbcs;
        int pam, i;
        pci_dev_t vga;
        ulong start;
@@ -61,7 +63,8 @@ int board_pci_post_scan(struct pci_controller *hose)
         * PCI device ID.
         */
        device = x86_pci_read_config16(PCI_BDF(0, 0, 0), PCI_DEVICE_ID);
-       pam = (device == PCI_DEVICE_ID_INTEL_82441) ? I440FX_PAM : Q35_PAM;
+       i440fx = (device == PCI_DEVICE_ID_INTEL_82441);
+       pam = i440fx ? I440FX_PAM : Q35_PAM;
 
        /*
         * Initialize Programmable Attribute Map (PAM) Registers
@@ -71,7 +74,7 @@ int board_pci_post_scan(struct pci_controller *hose)
        for (i = 0; i < PAM_NUM; i++)
                x86_pci_write_config8(PCI_BDF(0, 0, 0), pam + i, PAM_RW);
 
-       if (device == PCI_DEVICE_ID_INTEL_82441) {
+       if (i440fx) {
                /*
                 * Enable legacy IDE I/O ports decode
                 *
@@ -82,6 +85,15 @@ int board_pci_post_scan(struct pci_controller *hose)
                 */
                x86_pci_write_config16(PIIX_IDE, IDE0_TIM, IDE_DECODE_EN);
                x86_pci_write_config16(PIIX_IDE, IDE1_TIM, IDE_DECODE_EN);
+
+               /* Enable I/O APIC */
+               xbcs = x86_pci_read_config16(PIIX_ISA, XBCS);
+               xbcs |= APIC_EN;
+               x86_pci_write_config16(PIIX_ISA, XBCS, xbcs);
+       } else {
+               /* Configure PCIe ECAM base address */
+               x86_pci_write_config32(PCI_BDF(0, 0, 0), PCIEX_BAR,
+                                      CONFIG_PCIE_ECAM_BASE | BAR_EN);
        }
 
        /*
@@ -92,10 +104,35 @@ int board_pci_post_scan(struct pci_controller *hose)
         * board, it shows as device 2, while for Q35 and ICH9 chipset board,
         * it shows as device 1.
         */
-       vga = (device == PCI_DEVICE_ID_INTEL_82441) ? I440FX_VGA : Q35_VGA;
+       vga = i440fx ? I440FX_VGA : Q35_VGA;
        start = get_timer(0);
        ret = pci_run_vga_bios(vga, NULL, PCI_ROM_USE_NATIVE);
        debug("BIOS ran in %lums\n", get_timer(start));
 
        return ret;
 }
+
+#ifdef CONFIG_GENERATE_MP_TABLE
+int mp_determine_pci_dstirq(int bus, int dev, int func, int pirq)
+{
+       u8 irq;
+
+       if (i440fx) {
+               /*
+                * Not like most x86 platforms, the PIRQ[A-D] on PIIX3 are not
+                * connected to I/O APIC INTPIN#16-19. Instead they are routed
+                * to an irq number controled by the PIRQ routing register.
+                */
+               irq = x86_pci_read_config8(PCI_BDF(bus, dev, func),
+                                          PCI_INTERRUPT_LINE);
+       } else {
+               /*
+                * ICH9's PIRQ[A-H] are not consecutive numbers from 0 to 7.
+                * PIRQ[A-D] still maps to [0-3] but PIRQ[E-H] maps to [8-11].
+                */
+               irq = pirq < 8 ? pirq + 16 : pirq + 12;
+       }
+
+       return irq;
+}
+#endif
index d8761fdfbd28523e45b7f1e0b5ef8d068234b6e8..660f9678bd303573ef506986f913382c4377e002 100644 (file)
@@ -6,4 +6,3 @@
 
 obj-y += fsp_configs.o
 obj-y += tnc.o topcliff.o
-obj-$(CONFIG_PCI) += tnc_pci.o
index d27b2d9ec635f1ec6f705fae429cc5b47f816578..de50893e6fb178e8ca906cb46e7a4eff229f1854 100644 (file)
@@ -25,7 +25,6 @@ static void unprotect_spi_flash(void)
 
 int arch_cpu_init(void)
 {
-       struct pci_controller *hose;
        int ret;
 
        post_code(POST_CPU_INIT);
@@ -37,10 +36,6 @@ int arch_cpu_init(void)
        if (ret)
                return ret;
 
-       ret = pci_early_init_hose(&hose);
-       if (ret)
-               return ret;
-
        unprotect_spi_flash();
 
        return 0;
diff --git a/arch/x86/cpu/queensbay/tnc_pci.c b/arch/x86/cpu/queensbay/tnc_pci.c
deleted file mode 100644 (file)
index 6c291f9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <pci.h>
-#include <asm/pci.h>
-#include <asm/fsp/fsp_support.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void board_pci_setup_hose(struct pci_controller *hose)
-{
-       hose->first_busno = 0;
-       hose->last_busno = 0;
-
-       /* PCI memory space */
-       pci_set_region(hose->regions + 0,
-                      CONFIG_PCI_MEM_BUS,
-                      CONFIG_PCI_MEM_PHYS,
-                      CONFIG_PCI_MEM_SIZE,
-                      PCI_REGION_MEM);
-
-       /* PCI IO space */
-       pci_set_region(hose->regions + 1,
-                      CONFIG_PCI_IO_BUS,
-                      CONFIG_PCI_IO_PHYS,
-                      CONFIG_PCI_IO_SIZE,
-                      PCI_REGION_IO);
-
-       pci_set_region(hose->regions + 2,
-                      CONFIG_PCI_PREF_BUS,
-                      CONFIG_PCI_PREF_PHYS,
-                      CONFIG_PCI_PREF_SIZE,
-                      PCI_REGION_PREFETCH);
-
-       pci_set_region(hose->regions + 3,
-                      0,
-                      0,
-                      gd->ram_size,
-                      PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
-
-       hose->region_count = 4;
-}
index 7c7034c7ebe25a8dce184ff8ad1de32a55091cb4..ad390bf11721a3b161c3b55a1c517ddf1e55eb5b 100644 (file)
@@ -2,6 +2,7 @@
 
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "Google Link";
index 4eccefdb8c8413c8d6bf8a5a18c8ff344d637599..84eae3ab6513ac0990ebab28255936d24ff684c0 100644 (file)
@@ -2,6 +2,7 @@
 
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "Google Panther";
index 60da1f544bcd8fb41e34db214d6b1094b31d7d53..3af9cc3d2606ec2a8adfbf39fa134727b17e742d 100644 (file)
        pci {
                #address-cells = <3>;
                #size-cells = <2>;
-               compatible = "intel,pci";
+               compatible = "pci-x86";
                device_type = "pci";
+               u-boot,dm-pre-reloc;
+               ranges = <0x02000000 0x0 0x40000000 0x40000000 0 0x80000000
+                         0x42000000 0x0 0xc0000000 0xc0000000 0 0x20000000
+                         0x01000000 0x0 0x2000 0x2000 0 0xe000>;
 
                pcie@17,0 {
                        #address-cells = <3>;
index 2ba081e9dc22bf60ed4d72c4958e67a596326ca2..d77ff8ad5558c30e06de3fb69866ee68859567b0 100644 (file)
@@ -10,6 +10,7 @@
 #include <dt-bindings/interrupt-router/intel-irq.h>
 
 /include/ "skeleton.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "Intel Galileo";
index 0e59b18d3404eb3a75ae163c7f5bda3a6807fbc2..9527233d7fc084d6c8c38832dc65890077c46315 100644 (file)
@@ -10,6 +10,7 @@
 
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "Intel Minnowboard Max";
index 557428a459c6d55765c14d75a351a4b8f354ef7c..c26c71bcf7368d250e67c90055ddff41c19b65c7 100644 (file)
@@ -10,6 +10,7 @@
 
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "QEMU x86 (I440FX)";
                stdout-path = "/serial";
        };
 
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "cpu-x86";
+                       reg = <0>;
+                       intel,apic-id = <0>;
+               };
+       };
+
        pci {
                compatible = "pci-x86";
                #address-cells = <3>;
index c259f2a3d296d2f8a40ee8db3801262cc16424d6..2e785fa4bf507ed38f6d92d472c0f2f7b81195e4 100644 (file)
@@ -20,6 +20,7 @@
 
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
+/include/ "rtc.dtsi"
 
 / {
        model = "QEMU x86 (Q35)";
                stdout-path = "/serial";
        };
 
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "cpu-x86";
+                       reg = <0>;
+                       intel,apic-id = <0>;
+               };
+       };
+
        pci {
                compatible = "pci-x86";
                #address-cells = <3>;
index 93dacd7307c5c2a5c72246196efc9313cef8fdd8..1797e042daf052940233e568991bb82ea8039def 100644 (file)
@@ -1,6 +1,7 @@
 / {
        rtc {
                compatible = "motorola,mc146818";
+               u-boot,dm-pre-reloc;
                reg = <0x70 2>;
        };
 };
index 5cbfffffee55c168f4ab0f8d29414821a7fd488b..b67d3428ee69711f5e469aa70ebd13146e073fa7 100644 (file)
 #define PAM_NUM                        7
 #define PAM_RW                 0x33
 
+/* X-Bus Chip Select Register */
+#define XBCS                   0x4e
+#define APIC_EN                        (1 << 8)
+
 /* IDE Timing Register */
 #define IDE0_TIM               0x40
 #define IDE1_TIM               0x42
-#define IDE_DECODE_EN          0x8000
+#define IDE_DECODE_EN          (1 << 15)
+
+/* PCIe ECAM Base Address Register */
+#define PCIEX_BAR              0x60
+#define BAR_EN                 (1 << 0)
 
 /* I/O Ports */
 #define CMOS_ADDR_PORT         0x70
index 00cbe07ed186381c2d63f9e1d73f6b6a0743d022..fcd766ba9b6a255f916a17639541554385a9acf1 100644 (file)
 
 #include <asm/types.h>
 
+/* Architecture defined exceptions */
+enum x86_exception {
+       EXC_DE = 0,
+       EXC_DB,
+       EXC_NMI,
+       EXC_BP,
+       EXC_OF,
+       EXC_BR,
+       EXC_UD,
+       EXC_NM,
+       EXC_DF,
+       EXC_CSO,
+       EXC_TS,
+       EXC_NP,
+       EXC_SS,
+       EXC_GP,
+       EXC_PF,
+       EXC_MF = 16,
+       EXC_AC,
+       EXC_MC,
+       EXC_XM,
+       EXC_VE
+};
+
 /* arch/x86/cpu/interrupts.c */
 void set_vector(u8 intnum, void *routine);
 
index efa9231f922f96041928060b7d90087871ff19e7..ad8eba947b9a42aca24499cfad3693030d5d2223 100644 (file)
@@ -431,6 +431,23 @@ void mp_write_compat_address_space(struct mp_config_table *mc, int busid,
  */
 u32 mptable_finalize(struct mp_config_table *mc);
 
+/**
+ * mp_determine_pci_dstirq() - Determine PCI device's int pin on the I/O APIC
+ *
+ * This determines a PCI device's interrupt pin number on the I/O APIC.
+ *
+ * This can be implemented by platform codes to handle specifal cases, which
+ * do not conform to the normal chipset/board design where PIRQ[A-H] are mapped
+ * directly to I/O APIC INTPIN#16-23.
+ *
+ * @bus:       bus number of the pci device
+ * @dev:       device number of the pci device
+ * @func:      function number of the pci device
+ * @pirq:      PIRQ number the PCI device's interrupt pin is routed to
+ * @return:    interrupt pin number on the I/O APIC
+ */
+int mp_determine_pci_dstirq(int bus, int dev, int func, int pirq);
+
 /**
  * write_mp_table() - Write MP table
  *
index 70762eed108955a7acd3c30dc3a7cdcfd1ee4fe8..f9b30f68bdfca86b518bda50898cded40cc83b9b 100644 (file)
@@ -55,6 +55,8 @@
 #define MTRR_FIX_4K_F0000_MSR  0x26e
 #define MTRR_FIX_4K_F8000_MSR  0x26f
 
+#define MTRR_FIX_TYPE(t)       ((t << 24) | (t << 16) | (t << 8) | t)
+
 #if !defined(__ASSEMBLER__)
 
 /**
index 56eaa25b0c30080d238b202664d2acecc0119c81..f7e968e0b0d34192d2cf12f9adeedfa78046f468 100644 (file)
@@ -72,11 +72,10 @@ int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  *
  * @bus:       PCI bus number
  * @device:    PCI device number
- * @func:      PCI function number
  * @irq:       An array of IRQ numbers that are assigned to INTA through
  *             INTD of this PCI device.
  */
-void pci_assign_irqs(int bus, int device, int func, u8 irq[4]);
+void pci_assign_irqs(int bus, int device, u8 irq[4]);
 
 #endif /* __ASSEMBLY__ */
 
index a727dbfb0577d50d905c5ef6e6e3b4c19948fa58..3849bc075663c9d568a431eccc9eca7285d69fd0 100644 (file)
@@ -63,9 +63,19 @@ struct irq_regs {
        /* Pushed by vector handler (irq_<num>) */
        long irq_id;
        /* Pushed by cpu in response to interrupt */
-       long eip;
-       long xcs;
-       long eflags;
+       union {
+               struct {
+                       long eip;
+                       long xcs;
+                       long eflags;
+               } ctx1;
+               struct {
+                       long err;
+                       long eip;
+                       long xcs;
+                       long eflags;
+               } ctx2;
+       } context;
 }  __attribute__ ((packed));
 
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
index 4c0a7c82ca22923a0874f1bc8ee4c7cecdee6a8c..28552fa15a0e32b8601cb177a7ff26b58d727304 100644 (file)
@@ -77,5 +77,11 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
                num_entries++;
        }
 
+       /* Mark PCIe ECAM address range as reserved */
+       entries[num_entries].addr = CONFIG_PCIE_ECAM_BASE;
+       entries[num_entries].size = CONFIG_PCIE_ECAM_SIZE;
+       entries[num_entries].type = E820_RESERVED;
+       num_entries++;
+
        return num_entries;
 }
index f16fbcbb0d4ca72621675050b1c7fdc537dfd35c..f3ad116316a9541953c39c0f13709d96a3e44777 100644 (file)
@@ -21,6 +21,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static bool isa_irq_occupied[16];
+
 struct mp_config_table *mp_write_floating_table(struct mp_floating_table *mf)
 {
        u32 mc;
@@ -243,10 +245,18 @@ static void mptable_add_isa_interrupts(struct mp_config_table *mc, int bus_isa,
                        MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH,
                        bus_isa, 0, apicid, 2);
 
-       for (i = 3; i < 16; i++)
+       for (i = 3; i < 16; i++) {
+               /*
+                * Do not write ISA interrupt entry if it is already occupied
+                * by the platform devices.
+                */
+               if (isa_irq_occupied[i])
+                       continue;
+
                mp_write_intsrc(mc, MP_INT,
                                MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH,
                                bus_isa, i, apicid, i);
+       }
 }
 
 /*
@@ -269,6 +279,13 @@ static bool check_dup_entry(struct mpc_config_intsrc *intsrc_base,
        return (i == entry_num) ? false : true;
 }
 
+/* TODO: move this to driver model */
+__weak int mp_determine_pci_dstirq(int bus, int dev, int func, int pirq)
+{
+       /* PIRQ[A-H] are connected to I/O APIC INTPIN#16-23 */
+       return pirq + 16;
+}
+
 static int mptable_add_intsrc(struct mp_config_table *mc,
                              int bus_isa, int apicid)
 {
@@ -280,10 +297,6 @@ static int mptable_add_intsrc(struct mp_config_table *mc,
        const u32 *cell;
        int i;
 
-       /* Legacy Interrupts */
-       debug("Writing ISA IRQs\n");
-       mptable_add_isa_interrupts(mc, bus_isa, apicid, 0);
-
        /* Get I/O interrupt information from device tree */
        node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IRQ_ROUTER);
        if (node < 0) {
@@ -304,28 +317,41 @@ static int mptable_add_intsrc(struct mp_config_table *mc,
 
        for (i = 0; i < count; i++) {
                struct pirq_routing pr;
+               int bus, dev, func;
+               int dstirq;
 
                pr.bdf = fdt_addr_to_cpu(cell[0]);
                pr.pin = fdt_addr_to_cpu(cell[1]);
                pr.pirq = fdt_addr_to_cpu(cell[2]);
+               bus = PCI_BUS(pr.bdf);
+               dev = PCI_DEV(pr.bdf);
+               func = PCI_FUNC(pr.bdf);
 
                if (check_dup_entry(intsrc_base, intsrc_entries,
-                                   PCI_BUS(pr.bdf), PCI_DEV(pr.bdf), pr.pin)) {
+                                   bus, dev, pr.pin)) {
                        debug("found entry for bus %d device %d INT%c, skipping\n",
-                             PCI_BUS(pr.bdf), PCI_DEV(pr.bdf),
-                             'A' + pr.pin - 1);
+                             bus, dev, 'A' + pr.pin - 1);
                        cell += sizeof(struct pirq_routing) / sizeof(u32);
                        continue;
                }
 
-               /* PIRQ[A-H] are always connected to I/O APIC INTPIN#16-23 */
-               mp_write_pci_intsrc(mc, MP_INT, PCI_BUS(pr.bdf),
-                                   PCI_DEV(pr.bdf), pr.pin, apicid,
-                                   pr.pirq + 16);
+               dstirq = mp_determine_pci_dstirq(bus, dev, func, pr.pirq);
+               /*
+                * For PIRQ which is connected to I/O APIC interrupt pin#0-15,
+                * mark it as occupied so that we can skip it later.
+                */
+               if (dstirq < 16)
+                       isa_irq_occupied[dstirq] = true;
+               mp_write_pci_intsrc(mc, MP_INT, bus, dev, pr.pin,
+                                   apicid, dstirq);
                intsrc_entries++;
                cell += sizeof(struct pirq_routing) / sizeof(u32);
        }
 
+       /* Legacy Interrupts */
+       debug("Writing ISA IRQs\n");
+       mptable_add_isa_interrupts(mc, bus_isa, apicid, 0);
+
        return 0;
 }
 
index 7a34dcf366cb764ccf014c2513753e9ee24b7ed4..ba4116908c92017b9267215bf090e1ea30dce220 100644 (file)
@@ -98,8 +98,7 @@ void pirq_route_irqs(struct irq_info *irq, int num)
                }
 
                /* Bus, device, slots IRQs for {A,B,C,D} */
-               pci_assign_irqs(irq->bus, irq->devfn >> 3, irq->devfn & 7,
-                               irq_slot);
+               pci_assign_irqs(irq->bus, irq->devfn >> 3, irq_slot);
 
                irq++;
        }
index 144471c5bb7c49458382803c260c31f0938358f8..a1ec57e8d3ea478e1d75babac788f71eafd89e18 100644 (file)
@@ -61,8 +61,11 @@ __weak unsigned install_e820_map(unsigned max_entries,
        entries[2].addr = ISA_END_ADDRESS;
        entries[2].size = gd->ram_size - ISA_END_ADDRESS;
        entries[2].type = E820_RAM;
+       entries[3].addr = CONFIG_PCIE_ECAM_BASE;
+       entries[3].size = CONFIG_PCIE_ECAM_SIZE;
+       entries[3].type = E820_RESERVED;
 
-       return 3;
+       return 4;
 }
 
 static void build_command_line(char *command_line, int auto_boot)
index fad05514989d344ad55789540f932f2dc6e4b7bf..6d3b18ac189666767df87dd1797f5950f1b90288 100644 (file)
@@ -82,7 +82,7 @@ static int cm_t54_palmas_regulator_set(u8 vreg, u8 vval, u8 creg, u8 cval)
 #ifdef CONFIG_SYS_MMC_ENV_PART
 uint mmc_get_env_part(struct mmc *mmc)
 {
-       u32 bootmode = gd->arch.omap_boot_params.omap_bootmode;
+       u32 bootmode = gd->arch.omap_boot_mode;
        uint bootpart = CONFIG_SYS_MMC_ENV_PART;
 
        /*
index 2dd5d935d9ec9af0c661794d1daea9a9944fd6ae..f418186c1eab88d5942e412e5f84eb32be17a671 100644 (file)
@@ -285,3 +285,22 @@ int board_init(void)
 
        return 0;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+       char serialno[25];
+       uint32_t u_id_low, u_id_mid, u_id_high;
+
+       if (!getenv("serial#")) {
+               u_id_low  = readl(&STM32_U_ID->u_id_low);
+               u_id_mid  = readl(&STM32_U_ID->u_id_mid);
+               u_id_high = readl(&STM32_U_ID->u_id_high);
+               sprintf(serialno, "%08x%08x%08x",
+                       u_id_high, u_id_mid, u_id_low);
+               setenv("serial#", serialno);
+       }
+
+       return 0;
+}
+#endif
index 149bb51dcbd097f39530d3e8597f6985589d6202..7d4409b51e9882ca3707154f4c8f4939f43880af 100644 (file)
@@ -1,6 +1,5 @@
 #include <common.h>
 #include <asm/arch/dram.h>
-#include <linux/kconfig.h>
 
 static struct dram_para dram_para = {
        .clock = CONFIG_DRAM_CLK,
index 596a2060725d313ee7e176a4e09a8202f6ebded6..e3fa243267b09fd0e2b5e4d636451c33bd1da520 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <common.h>
 #include <asm/arch/dram.h>
-#include <linux/kconfig.h>
 
 static struct dram_para dram_para = {
        .clock = CONFIG_DRAM_CLK,
index 9ee90a4f9d03165d0f481ac768ccb15b08b4bffe..6586faba32eba46554628f9c770f0fb5e5be2a8e 100644 (file)
@@ -47,7 +47,6 @@ Board configuration files:
 include/configs/k2hk_evm.h
 include/configs/k2e_evm.h
 include/configs/k2l_evm.h
-include/configs/k2l_evm.h
 
 As u-boot is migrating to Kconfig there is also board defconfig files
 configs/k2e_evm_defconfig
@@ -71,7 +70,7 @@ Don't forget to add ARCH=arm and CROSS_COMPILE.
 
 To build u-boot.bin
   >make k2hk_evm_defconfig
-  >make u-boot-spi.gph
+  >make u-boot.bin
 
 To build u-boot-spi.gph
   >make k2hk_evm_defconfig
index 8892a2843df4db3fad47235f55353f92ab84e981..0cefb340440337951d8a01138a7177d3bc349139 100644 (file)
@@ -48,7 +48,7 @@ int dram_init(void)
 
 int board_init(void)
 {
-       gd->bd->bi_boot_params = CONFIG_LINUX_BOOT_PARAM_ADDR;
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
        return 0;
 }
index 20522fba50977d6185ccfdae45c476fcf5ce6b53..fd5d6fe950c7c9aaa420aa85520df27fbd8de167 100644 (file)
@@ -25,7 +25,7 @@ ifeq ($(init-objs),)
 ifneq ($(wildcard $(srctree)/$(src)/ps7_init_gpl.c),)
 init-objs := ps7_init_gpl.o
 $(if $(CONFIG_SPL_BUILD),\
-$(warning Put custom ps7_init_gpl.c/h to board/xilinx/zynq/custome_hw_platform/))
+$(warning Put custom ps7_init_gpl.c/h to board/xilinx/zynq/custom_hw_platform/))
 endif
 endif
 
diff --git a/board/xilinx/zynqmp/Kconfig b/board/xilinx/zynqmp/Kconfig
deleted file mode 100644 (file)
index b07932e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if TARGET_XILINX_ZYNQMP
-
-config SYS_BOARD
-       default "zynqmp"
-
-config SYS_VENDOR
-       default "xilinx"
-
-config SYS_SOC
-       default "zynqmp"
-
-config SYS_CONFIG_NAME
-       default "xilinx_zynqmp"
-
-endif
index da33340459443d8041bedd03484168472ead4f4e..20ca6522e5700fb47b67a8a80843ca4dcb18734a 100644 (file)
@@ -1,6 +1,7 @@
-XILINX_ZYNQMP BOARD
+XILINX_ZYNQMP_EP BOARD
 M:     Michal Simek <michal.simek@xilinx.com>
 S:     Maintained
 F:     board/xilinx/zynqmp/
 F:     include/configs/xilinx_zynqmp.h
-F:     configs/xilinx_zynqmp_defconfig
+F:     include/configs/xilinx_zynqmp_ep.h
+F:     configs/xilinx_zynqmp_ep_defconfig
index f5ff64d988e5b902d6a02ffb99f93276da865555..0c9a8141445814a110236d810f20d4c4ecce35ae 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <ahci.h>
+#include <scsi.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
@@ -15,6 +17,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
+       printf("EL Level:\tEL%d\n", current_el());
+
        return 0;
 }
 
@@ -51,6 +55,39 @@ void reset_cpu(ulong addr)
 {
 }
 
+#ifdef CONFIG_SCSI_AHCI_PLAT
+void scsi_init(void)
+{
+       ahci_init((void __iomem *)ZYNQMP_SATA_BASEADDR);
+       scsi_scan(1);
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+       u32 ret = 0;
+
+#if defined(CONFIG_ZYNQ_GEM)
+# if defined(CONFIG_ZYNQ_GEM0)
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR0, 0);
+# endif
+# if defined(CONFIG_ZYNQ_GEM1)
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR1, 0);
+# endif
+# if defined(CONFIG_ZYNQ_GEM2)
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR2,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR2, 0);
+# endif
+# if defined(CONFIG_ZYNQ_GEM3)
+       ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR3,
+                                               CONFIG_ZYNQ_GEM_PHY_ADDR3, 0);
+# endif
+#endif
+       return ret;
+}
+
 #ifdef CONFIG_CMD_MMC
 int board_mmc_init(bd_t *bd)
 {
index 42d0641294a86c0c632213dd8a1ed52e96bbd7be..4e5a1f7808119d329e71815a6c89b7ea3708da27 100644 (file)
@@ -14,8 +14,7 @@ int __weak checkboard(void)
 
 /*
  * If the root node of the DTB has a "model" property, show it.
- * If CONFIG_OF_CONTROL is disabled or the "model" property is missing,
- * fall back to checkboard().
+ * Then call checkboard().
  */
 int show_board_info(void)
 {
@@ -25,10 +24,8 @@ int show_board_info(void)
 
        model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
 
-       if (model) {
+       if (model)
                printf("Model: %s\n", model);
-               return 0;
-       }
 #endif
 
        return checkboard();
index 328b338068b812f613bbe3c8998ef221e8e90897..a80c6421575ea3ade21165b2102f2af9af526a39 100644 (file)
@@ -7,11 +7,32 @@
 #include <common.h>
 #include <command.h>
 
+static int cpu_status_all(void)
+{
+       unsigned long cpuid;
+
+       for (cpuid = 0; ; cpuid++) {
+               if (!is_core_valid(cpuid)) {
+                       if (cpuid == 0) {
+                               printf("Core num: %lu is not valid\n", cpuid);
+                               return 1;
+                       }
+                       break;
+               }
+               cpu_status(cpuid);
+       }
+
+       return 0;
+}
+
 static int
 cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned long cpuid;
 
+       if (argc == 2 && strncmp(argv[1], "status", 6) == 0)
+                 return cpu_status_all();
+
        if (argc < 3)
                return CMD_RET_USAGE;
 
@@ -48,6 +69,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_SYS_LONGHELP
 static char cpu_help_text[] =
            "<num> reset                 - Reset cpu <num>\n"
+       "cpu status                      - Status of all cpus\n"
        "cpu <num> status                - Status of cpu <num>\n"
        "cpu <num> disable               - Disable cpu <num>\n"
        "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
index 4589b30a11373e3f0eff2ee2aa3b984dd61e463b..c72d29e5d347a252f38cc44f9b3429dd531057f6 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_AM3517_EVM=y
 CONFIG_SPL=y
+CONFIG_FIT=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 9931d65dc2e92f34c5bfb6a2a9d853b9bce735f7..e394dab719b9c3106b177e9023c386b3ee14abf8 100644 (file)
@@ -17,5 +17,6 @@ CONFIG_SPI_FLASH=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
+CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
index b3a5f28be91753ce00a84cdf1d33d04aa32af906..340510f71a6af0f72a6f67cc157f8fe1a97f109c 100644 (file)
@@ -17,5 +17,6 @@ CONFIG_SPI_FLASH=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
+CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
index 17e6a72c9d9bad77c62c8441a58a1b323878e27d..aa1232d15169ac9efba324b187343f636267125d 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_OF_CONTROL=y
 CONFIG_CPU=y
+CONFIG_DM_PCI=y
 CONFIG_SPI_FLASH=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
index 1ced47e7b8f41fddcdbaa6b99adc7a32b11926dc..3f80483aef96704b8aad7dad01e76966e421688d 100644 (file)
@@ -15,5 +15,6 @@ CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_SPI_FLASH=y
 CONFIG_NETDEVICES=y
 CONFIG_ETH_DESIGNWARE=y
+CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
index 29dd44b4009009c0f506912e172e2be339b60633..e98f5eb5cee3b9f4bd325ddfb3b52d781d83df8a 100644 (file)
@@ -21,5 +21,6 @@ CONFIG_SPI_FLASH=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
+CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
index 5639cc5b151f7f03bc4644b138796180a6af9fbe..4b18d5173864e42b55d6ae1a77e85bccb78d6166 100644 (file)
@@ -1,6 +1,8 @@
 CONFIG_X86=y
 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx"
 CONFIG_GENERATE_PIRQ_TABLE=y
+CONFIG_GENERATE_MP_TABLE=y
+CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -9,9 +11,11 @@ CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_OF_CONTROL=y
+CONFIG_CPU=y
 CONFIG_SPI_FLASH=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
+CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
diff --git a/configs/xilinx_zynqmp_defconfig b/configs/xilinx_zynqmp_defconfig
deleted file mode 100644 (file)
index 1c64eea..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CONFIG_ARM=y
-CONFIG_TARGET_XILINX_ZYNQMP=y
-CONFIG_DEFAULT_DEVICE_TREE="zynqmp"
-# CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
-# CONFIG_CMD_XIMG is not set
-# CONFIG_CMD_EDITENV is not set
-# CONFIG_CMD_ENV_EXISTS is not set
-# CONFIG_CMD_LOADB is not set
-# CONFIG_CMD_LOADS is not set
-# CONFIG_CMD_FPGA is not set
-# CONFIG_CMD_ITEST is not set
-# CONFIG_CMD_SETEXPR is not set
-# CONFIG_CMD_NET is not set
-# CONFIG_CMD_NFS is not set
-CONFIG_CMD_TIME=y
-CONFIG_CMD_TIMER=y
diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig
new file mode 100644 (file)
index 0000000..fda44ea
--- /dev/null
@@ -0,0 +1,18 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ZYNQMP=y
+CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep"
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EDITENV is not set
+# CONFIG_CMD_ENV_EXISTS is not set
+# CONFIG_CMD_LOADB is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NET is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_TIME=y
+CONFIG_CMD_TIMER=y
+CONFIG_SYS_TEXT_BASE=0x8000000
diff --git a/configs/zynq_zc770_xm011_defconfig b/configs/zynq_zc770_xm011_defconfig
new file mode 100644 (file)
index 0000000..8f9221d
--- /dev/null
@@ -0,0 +1,13 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ZYNQ=y
+CONFIG_TARGET_ZYNQ_ZC770=y
+CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm011"
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_SPL=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM011"
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_SETEXPR is not set
index f397a36d68016ea6120962de49ff7d9aece99bb6..cb2945789d05398694bfd2befacdd78bf5be6aaf 100644 (file)
@@ -1,29 +1,32 @@
-Zynq SPI controller Device Tree Bindings
-----------------------------------------
+Cadence SPI controller Device Tree Bindings
+-------------------------------------------
 
 Required properties:
-- compatible           : Should be "xlnx,spi-zynq".
+- compatible           : Should be "cdns,spi-r1p6" or "xlnx,zynq-spi-r1p6".
 - reg                  : Physical base address and size of SPI registers map.
-- status               : Status will be disabled in dtsi and enabled in required dts.
-- interrupt-parent     : Must be core interrupt controller.
 - interrupts           : Property with a value describing the interrupt
                          number.
-- clocks               : Clock phandles (see clock bindings for details).
+- interrupt-parent     : Must be core interrupt controller
 - clock-names          : List of input clock names - "ref_clk", "pclk"
                          (See clock bindings for details).
+- clocks               : Clock phandles (see clock bindings for details).
 - spi-max-frequency    : Maximum SPI clocking speed of device in Hz
 
+Optional properties:
+- num-cs               : Number of chip selects used.
+                         If a decoder is used, this will be the number of
+                         chip selects after the decoder.
+- is-decoded-cs                : Flag to indicate whether decoder is used or not.
+
 Example:
 
-       spi@e0006000 {
-               compatible = "xlnx,zynq-spi";
-               reg = <0xe0006000 0x1000>;
-               status = "disabled";
-               interrupt-parent = <&intc>;
-               interrupts = <0 26 4>;
-               clocks = <&clkc 25>, <&clkc 34>;
+       spi@e0007000 {
+               compatible = "xlnx,zynq-spi-r1p6";
                clock-names = "ref_clk", "pclk";
-               spi-max-frequency = <166666700>;
-               #address-cells = <1>;
-               #size-cells = <0>;
+               clocks = <&clkc 26>, <&clkc 35>;
+               interrupt-parent = <&intc>;
+               interrupts = <0 49 4>;
+               num-cs = <4>;
+               is-decoded-cs = <0>;
+               reg = <0xe0007000 0x1000>;
        } ;
index 79b1e20ccf1e12371d207ce6d42586d1307183d9..d4034f6735b93d1c098e0b4765158d17cad282ac 100644 (file)
@@ -32,7 +32,10 @@ struct pca9551_blink_rate {
        u8 pwm; /* Pulse width modulation, see PCA9551_7.pdf p. 6 */
 };
 
-static int freq0, freq1;
+static int freq_last = -1;
+static int mask_last = -1;
+static int idx_last = -1;
+static int mode_last;
 
 static int pca9551_led_get_state(int led, int *state)
 {
@@ -135,21 +138,30 @@ void __led_blink(led_id_t mask, int freq)
 {
        struct pca9551_blink_rate rate;
        int mode;
-       int blink;
+       int idx;
 
-       if ((freq0 == 0) || (freq == freq0)) {
-               blink = 0;
-               mode = PCA9551_LED_STATE_BLINK0;
-               freq0 = freq;
+       if ((freq == freq_last) || (mask == mask_last)) {
+               idx = idx_last;
+               mode = mode_last;
        } else {
-               blink = 1;
-               mode = PCA9551_LED_STATE_BLINK1;
-               freq1 = freq;
+               /* Toggle blink index */
+               if (idx_last == 0) {
+                       idx = 1;
+                       mode = PCA9551_LED_STATE_BLINK1;
+               } else {
+                       idx = 0;
+                       mode = PCA9551_LED_STATE_BLINK0;
+               }
+
+               idx_last = idx;
+               mode_last = mode;
        }
+       freq_last = freq;
+       mask_last = mask;
 
        rate.psc = ((freq * 38) / 1000) - 1;
        rate.pwm = 128;         /* 50% duty cycle */
 
-       pca9551_led_set_blink_rate(blink, rate);
+       pca9551_led_set_blink_rate(idx, rate);
        pca9551_led_set_state(mask, mode);
 }
index 0c5fdeefd758424bc64e97fd51ed97762e793094..67b570279ec3280b77851a356c4b83f46bbe9242 100644 (file)
@@ -512,6 +512,13 @@ static int keystone2_eth_rcv_packet(struct eth_device *dev)
        return pkt_size;
 }
 
+#ifdef CONFIG_MCAST_TFTP
+static int keystone2_eth_bcast_addr(struct eth_device *dev, u32 ip, u8 set)
+{
+       return 0;
+}
+#endif
+
 /*
  * This function initializes the EMAC hardware.
  */
@@ -537,6 +544,9 @@ int keystone2_emac_initialize(struct eth_priv_t *eth_priv)
        dev->halt               = keystone2_eth_close;
        dev->send               = keystone2_eth_send_packet;
        dev->recv               = keystone2_eth_rcv_packet;
+#ifdef CONFIG_MCAST_TFTP
+       dev->mcast              = keystone2_eth_bcast_addr;
+#endif
 
        eth_register(dev);
 
index c723dbb0a6947221790eadfc14b0776645f40902..b2006dfa0775152e2dbbb2eafce4263e766d0981 100644 (file)
@@ -20,6 +20,7 @@
 #include <phy.h>
 #include <miiphy.h>
 #include <watchdog.h>
+#include <asm/system.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 
 #define ZYNQ_GEM_NWCFG_MDCCLKDIV       0x000080000 /* Div pclk by 32, 80MHz */
 #define ZYNQ_GEM_NWCFG_MDCCLKDIV2      0x0000c0000 /* Div pclk by 48, 120MHz */
 
-#define ZYNQ_GEM_NWCFG_INIT            (ZYNQ_GEM_NWCFG_FDEN | \
+#ifdef CONFIG_ARM64
+# define ZYNQ_GEM_DBUS_WIDTH   (1 << 21) /* 64 bit bus */
+#else
+# define ZYNQ_GEM_DBUS_WIDTH   (0 << 21) /* 32 bit bus */
+#endif
+
+#define ZYNQ_GEM_NWCFG_INIT            (ZYNQ_GEM_DBUS_WIDTH | \
+                                       ZYNQ_GEM_NWCFG_FDEN | \
                                        ZYNQ_GEM_NWCFG_FSREM | \
                                        ZYNQ_GEM_NWCFG_MDCCLKDIV)
 
@@ -130,7 +138,7 @@ struct emac_bd {
        u32 status;
 };
 
-#define RX_BUF 3
+#define RX_BUF 32
 /* Page table entries are set to 1MB, or multiples of 1MB
  * (not < 1MB). driver uses less bd's so use 1MB bdspace.
  */
@@ -155,7 +163,7 @@ struct zynq_gem_priv {
 static inline int mdio_wait(struct eth_device *dev)
 {
        struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
-       u32 timeout = 200;
+       u32 timeout = 20000;
 
        /* Wait till MDIO interface is ready to accept a new transaction. */
        while (--timeout) {
@@ -395,12 +403,18 @@ static int zynq_gem_send(struct eth_device *dev, void *ptr, int len)
 
        priv->tx_bd->addr = (u32)ptr;
        priv->tx_bd->status = (len & ZYNQ_GEM_TXBUF_FRMLEN_MASK) |
-                               ZYNQ_GEM_TXBUF_LAST_MASK;
+                              ZYNQ_GEM_TXBUF_LAST_MASK |
+                              ZYNQ_GEM_TXBUF_WRAP_MASK;
 
        addr = (u32) ptr;
        addr &= ~(ARCH_DMA_MINALIGN - 1);
        size = roundup(len, ARCH_DMA_MINALIGN);
        flush_dcache_range(addr, addr + size);
+
+       addr = (u32)priv->rxbuffers;
+       addr &= ~(ARCH_DMA_MINALIGN - 1);
+       size = roundup((RX_BUF * PKTSIZE_ALIGN), ARCH_DMA_MINALIGN);
+       flush_dcache_range(addr, addr + size);
        barrier();
 
        /* Start transmit */
@@ -436,8 +450,6 @@ static int zynq_gem_recv(struct eth_device *dev)
        if (frame_len) {
                u32 addr = current_bd->addr & ZYNQ_GEM_RXBUF_ADD_MASK;
                addr &= ~(ARCH_DMA_MINALIGN - 1);
-               u32 size = roundup(frame_len, ARCH_DMA_MINALIGN);
-               invalidate_dcache_range(addr, addr + size);
 
                net_process_received_packet((u8 *)addr, frame_len);
 
@@ -511,7 +523,7 @@ int zynq_gem_initialize(bd_t *bis, phys_addr_t base_addr,
        priv->rxbuffers = memalign(ARCH_DMA_MINALIGN, RX_BUF * PKTSIZE_ALIGN);
        memset(priv->rxbuffers, 0, RX_BUF * PKTSIZE_ALIGN);
 
-       /* Align bd_space to 1MB */
+       /* Align bd_space to MMU_SECTION_SHIFT */
        bd_space = memalign(1 << MMU_SECTION_SHIFT, BD_SPACE);
        mmu_set_region_dcache_behaviour((phys_addr_t)bd_space,
                                        BD_SPACE, DCACHE_OFF);
index 3be76c99ee471646dc5307164c6817d69563f793..c7d93f92d6f7259682591ebb8cb05d9622f01a40 100644 (file)
@@ -207,8 +207,7 @@ int pci_write_config(pci_dev_t bdf, int offset, unsigned long value,
        if (ret)
                return ret;
 
-       return pci_bus_write_config(bus, PCI_MASK_BUS(bdf), offset, value,
-                                   size);
+       return pci_bus_write_config(bus, bdf, offset, value, size);
 }
 
 int pci_write_config32(pci_dev_t bdf, int offset, u32 value)
@@ -247,8 +246,7 @@ int pci_read_config(pci_dev_t bdf, int offset, unsigned long *valuep,
        if (ret)
                return ret;
 
-       return pci_bus_read_config(bus, PCI_MASK_BUS(bdf), offset, valuep,
-                                  size);
+       return pci_bus_read_config(bus, bdf, offset, valuep, size);
 }
 
 int pci_read_config32(pci_dev_t bdf, int offset, u32 *valuep)
@@ -303,14 +301,10 @@ int pci_auto_config_devices(struct udevice *bus)
        for (ret = device_find_first_child(bus, &dev);
             !ret && dev;
             ret = device_find_next_child(&dev)) {
-               struct pci_controller *ctlr_hose;
                unsigned int max_bus;
 
                debug("%s: device %s\n", __func__, dev->name);
-
-               /* The root controller has the region information */
-               ctlr_hose = hose->ctlr->uclass_priv;
-               max_bus = pciauto_config_device(ctlr_hose, pci_get_bdf(dev));
+               max_bus = pciauto_config_device(hose, pci_get_bdf(dev));
                sub_bus = max(sub_bus, max_bus);
        }
        debug("%s: done\n", __func__);
@@ -328,7 +322,7 @@ int dm_pci_hose_probe_bus(struct pci_controller *hose, pci_dev_t bdf)
        parent = hose->bus;
 
        /* Find the bus within the parent */
-       ret = pci_bus_find_devfn(parent, bdf, &bus);
+       ret = pci_bus_find_devfn(parent, PCI_MASK_BUS(bdf), &bus);
        if (ret) {
                debug("%s: Cannot find device %x on bus %s: %d\n", __func__,
                      bdf, parent->name, ret);
@@ -383,7 +377,7 @@ static bool pci_match_one_id(const struct pci_device_id *id,
  * This only looks at certain fields in the descriptor.
  */
 static int pci_find_and_bind_driver(struct udevice *parent,
-                                   struct pci_device_id *find_id, int devfn,
+                                   struct pci_device_id *find_id, pci_dev_t bdf,
                                    struct udevice **devp)
 {
        struct pci_driver_entry *start, *entry;
@@ -430,8 +424,8 @@ static int pci_find_and_bind_driver(struct udevice *parent,
        }
 
        /* Bind a generic driver so that the device can be used */
-       sprintf(name, "pci_%x:%x.%x", parent->seq, PCI_DEV(devfn),
-               PCI_FUNC(devfn));
+       sprintf(name, "pci_%x:%x.%x", parent->seq, PCI_DEV(bdf),
+               PCI_FUNC(bdf));
        str = strdup(name);
        if (!str)
                return -ENOMEM;
@@ -455,42 +449,44 @@ int pci_bind_bus_devices(struct udevice *bus)
 {
        ulong vendor, device;
        ulong header_type;
-       pci_dev_t devfn, end;
+       pci_dev_t bdf, end;
        bool found_multi;
        int ret;
 
        found_multi = false;
-       end = PCI_DEVFN(PCI_MAX_PCI_DEVICES - 1, PCI_MAX_PCI_FUNCTIONS - 1);
-       for (devfn = PCI_DEVFN(0, 0); devfn < end; devfn += PCI_DEVFN(0, 1)) {
+       end = PCI_BDF(bus->seq, PCI_MAX_PCI_DEVICES - 1,
+                     PCI_MAX_PCI_FUNCTIONS - 1);
+       for (bdf = PCI_BDF(bus->seq, 0, 0); bdf < end;
+            bdf += PCI_BDF(0, 0, 1)) {
                struct pci_child_platdata *pplat;
                struct udevice *dev;
                ulong class;
 
-               if (PCI_FUNC(devfn) && !found_multi)
+               if (PCI_FUNC(bdf) && !found_multi)
                        continue;
                /* Check only the first access, we don't expect problems */
-               ret = pci_bus_read_config(bus, devfn, PCI_HEADER_TYPE,
+               ret = pci_bus_read_config(bus, bdf, PCI_HEADER_TYPE,
                                          &header_type, PCI_SIZE_8);
                if (ret)
                        goto error;
-               pci_bus_read_config(bus, devfn, PCI_VENDOR_ID, &vendor,
+               pci_bus_read_config(bus, bdf, PCI_VENDOR_ID, &vendor,
                                    PCI_SIZE_16);
                if (vendor == 0xffff || vendor == 0x0000)
                        continue;
 
-               if (!PCI_FUNC(devfn))
+               if (!PCI_FUNC(bdf))
                        found_multi = header_type & 0x80;
 
                debug("%s: bus %d/%s: found device %x, function %d\n", __func__,
-                     bus->seq, bus->name, PCI_DEV(devfn), PCI_FUNC(devfn));
-               pci_bus_read_config(bus, devfn, PCI_DEVICE_ID, &device,
+                     bus->seq, bus->name, PCI_DEV(bdf), PCI_FUNC(bdf));
+               pci_bus_read_config(bus, bdf, PCI_DEVICE_ID, &device,
                                    PCI_SIZE_16);
-               pci_bus_read_config(bus, devfn, PCI_CLASS_REVISION, &class,
+               pci_bus_read_config(bus, bdf, PCI_CLASS_REVISION, &class,
                                    PCI_SIZE_32);
                class >>= 8;
 
                /* Find this device in the device tree */
-               ret = pci_bus_find_devfn(bus, devfn, &dev);
+               ret = pci_bus_find_devfn(bus, PCI_MASK_BUS(bdf), &dev);
 
                /* Search for a driver */
 
@@ -504,13 +500,13 @@ int pci_bind_bus_devices(struct udevice *bus)
                        find_id.device = device;
                        find_id.class = class;
                        if ((header_type & 0x7f) == PCI_HEADER_TYPE_NORMAL) {
-                               pci_bus_read_config(bus, devfn,
+                               pci_bus_read_config(bus, bdf,
                                                    PCI_SUBSYSTEM_VENDOR_ID,
                                                    &val, PCI_SIZE_32);
                                find_id.subvendor = val & 0xffff;
                                find_id.subdevice = val >> 16;
                        }
-                       ret = pci_find_and_bind_driver(bus, &find_id, devfn,
+                       ret = pci_find_and_bind_driver(bus, &find_id, bdf,
                                                       &dev);
                }
                if (ret)
@@ -518,7 +514,7 @@ int pci_bind_bus_devices(struct udevice *bus)
 
                /* Update the platform data */
                pplat = dev_get_parent_platdata(dev);
-               pplat->devfn = devfn;
+               pplat->devfn = PCI_MASK_BUS(bdf);
                pplat->vendor = vendor;
                pplat->device = device;
                pplat->class = class;
@@ -689,20 +685,20 @@ static int pci_uclass_child_post_bind(struct udevice *dev)
        return 0;
 }
 
-int pci_bridge_read_config(struct udevice *bus, pci_dev_t devfn, uint offset,
-                          ulong *valuep, enum pci_size_t size)
+static int pci_bridge_read_config(struct udevice *bus, pci_dev_t bdf,
+                                 uint offset, ulong *valuep,
+                                 enum pci_size_t size)
 {
        struct pci_controller *hose = bus->uclass_priv;
-       pci_dev_t bdf = PCI_ADD_BUS(bus->seq, devfn);
 
        return pci_bus_read_config(hose->ctlr, bdf, offset, valuep, size);
 }
 
-int pci_bridge_write_config(struct udevice *bus, pci_dev_t devfn, uint offset,
-                           ulong value, enum pci_size_t size)
+static int pci_bridge_write_config(struct udevice *bus, pci_dev_t bdf,
+                                  uint offset, ulong value,
+                                  enum pci_size_t size)
 {
        struct pci_controller *hose = bus->uclass_priv;
-       pci_dev_t bdf = PCI_ADD_BUS(bus->seq, devfn);
 
        return pci_bus_write_config(hose->ctlr, bdf, offset, value, size);
 }
index e034ed1715cfcda988312bbb2dcce6cbea3177e2..a7af8cb5f1751c418715486627ae597c77d77668 100644 (file)
@@ -213,21 +213,39 @@ void pciauto_setup_device(struct pci_controller *hose,
 void pciauto_prescan_setup_bridge(struct pci_controller *hose,
                                         pci_dev_t dev, int sub_bus)
 {
-       struct pci_region *pci_mem = hose->pci_mem;
-       struct pci_region *pci_prefetch = hose->pci_prefetch;
-       struct pci_region *pci_io = hose->pci_io;
+       struct pci_region *pci_mem;
+       struct pci_region *pci_prefetch;
+       struct pci_region *pci_io;
        u16 cmdstat, prefechable_64;
 
+#ifdef CONFIG_DM_PCI
+       /* The root controller has the region information */
+       struct pci_controller *ctlr_hose = pci_bus_to_hose(0);
+
+       pci_mem = ctlr_hose->pci_mem;
+       pci_prefetch = ctlr_hose->pci_prefetch;
+       pci_io = ctlr_hose->pci_io;
+#else
+       pci_mem = hose->pci_mem;
+       pci_prefetch = hose->pci_prefetch;
+       pci_io = hose->pci_io;
+#endif
+
        pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
        pci_hose_read_config_word(hose, dev, PCI_PREF_MEMORY_BASE,
                                &prefechable_64);
        prefechable_64 &= PCI_PREF_RANGE_TYPE_MASK;
 
        /* Configure bus number registers */
+#ifdef CONFIG_DM_PCI
+       pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS, PCI_BUS(dev));
+       pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS, sub_bus);
+#else
        pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS,
                                   PCI_BUS(dev) - hose->first_busno);
        pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS,
                                   sub_bus - hose->first_busno);
+#endif
        pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, 0xff);
 
        if (pci_mem) {
@@ -290,13 +308,30 @@ void pciauto_prescan_setup_bridge(struct pci_controller *hose,
 void pciauto_postscan_setup_bridge(struct pci_controller *hose,
                                          pci_dev_t dev, int sub_bus)
 {
-       struct pci_region *pci_mem = hose->pci_mem;
-       struct pci_region *pci_prefetch = hose->pci_prefetch;
-       struct pci_region *pci_io = hose->pci_io;
+       struct pci_region *pci_mem;
+       struct pci_region *pci_prefetch;
+       struct pci_region *pci_io;
+
+#ifdef CONFIG_DM_PCI
+       /* The root controller has the region information */
+       struct pci_controller *ctlr_hose = pci_bus_to_hose(0);
+
+       pci_mem = ctlr_hose->pci_mem;
+       pci_prefetch = ctlr_hose->pci_prefetch;
+       pci_io = ctlr_hose->pci_io;
+#else
+       pci_mem = hose->pci_mem;
+       pci_prefetch = hose->pci_prefetch;
+       pci_io = hose->pci_io;
+#endif
 
        /* Configure bus number registers */
+#ifdef CONFIG_DM_PCI
+       pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, sub_bus);
+#else
        pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS,
                                   sub_bus - hose->first_busno);
+#endif
 
        if (pci_mem) {
                /* Round memory allocator to 1MB boundary */
@@ -416,10 +451,26 @@ void pciauto_config_init(struct pci_controller *hose)
  */
 int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
 {
+       struct pci_region *pci_mem;
+       struct pci_region *pci_prefetch;
+       struct pci_region *pci_io;
        unsigned int sub_bus = PCI_BUS(dev);
        unsigned short class;
        int n;
 
+#ifdef CONFIG_DM_PCI
+       /* The root controller has the region information */
+       struct pci_controller *ctlr_hose = pci_bus_to_hose(0);
+
+       pci_mem = ctlr_hose->pci_mem;
+       pci_prefetch = ctlr_hose->pci_prefetch;
+       pci_io = ctlr_hose->pci_io;
+#else
+       pci_mem = hose->pci_mem;
+       pci_prefetch = hose->pci_prefetch;
+       pci_io = hose->pci_io;
+#endif
+
        pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
 
        switch (class) {
@@ -427,8 +478,8 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
                DEBUGF("PCI Autoconfig: Found P2P bridge, device %d\n",
                       PCI_DEV(dev));
 
-               pciauto_setup_device(hose, dev, 2, hose->pci_mem,
-                       hose->pci_prefetch, hose->pci_io);
+               pciauto_setup_device(hose, dev, 2, pci_mem,
+                                    pci_prefetch, pci_io);
 
 #ifdef CONFIG_DM_PCI
                n = dm_pci_hose_probe_bus(hose, dev);
@@ -458,8 +509,8 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
                 * just do a minimal setup of the bridge,
                 * let the OS take care of the rest
                 */
-               pciauto_setup_device(hose, dev, 0, hose->pci_mem,
-                       hose->pci_prefetch, hose->pci_io);
+               pciauto_setup_device(hose, dev, 0, pci_mem,
+                                    pci_prefetch, pci_io);
 
                DEBUGF("PCI Autoconfig: Found P2CardBus bridge, device %d\n",
                        PCI_DEV(dev));
@@ -493,8 +544,8 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
                DEBUGF("PCI AutoConfig: Found PowerPC device\n");
 
        default:
-               pciauto_setup_device(hose, dev, 6, hose->pci_mem,
-                       hose->pci_prefetch, hose->pci_io);
+               pciauto_setup_device(hose, dev, 6, pci_mem,
+                                    pci_prefetch, pci_io);
                break;
        }
 
index f67c9c7b2fbf57a680f989f50312788e6ff89016..07f1726748a2f2b45eb83746729e30a4c2edab2c 100644 (file)
@@ -224,7 +224,7 @@ phys_addr_t pci_hose_bus_to_phys(struct pci_controller *hose,
 
 #ifdef CONFIG_DM_PCI
        /* The root controller has the region information */
-       hose = hose->ctlr->uclass_priv;
+       hose = pci_bus_to_hose(0);
 #endif
 
        /*
@@ -289,6 +289,11 @@ pci_addr_t pci_hose_phys_to_bus(struct pci_controller *hose,
                return bus_addr;
        }
 
+#ifdef CONFIG_DM_PCI
+       /* The root controller has the region information */
+       hose = pci_bus_to_hose(0);
+#endif
+
        /*
         * if PCI_REGION_MEM is set we do a two pass search with preference
         * on matches that don't have PCI_REGION_SYS_MEMORY set
index c5c3e1044fdace057384868e221405e4470d7005..7ae1f0ec9aeade68a873356dcecdebf28e0cf604 100644 (file)
@@ -79,7 +79,7 @@ static int zynq_spi_ofdata_to_platdata(struct udevice *bus)
                                        250000000);
        plat->speed_hz = plat->frequency / 2;
 
-       debug("zynq_spi_ofdata_to_platdata: regs=%p max-frequency=%d\n",
+       debug("%s: regs=%p max-frequency=%d\n", __func__,
              plat->regs, plat->frequency);
 
        return 0;
@@ -309,7 +309,7 @@ static const struct dm_spi_ops zynq_spi_ops = {
 };
 
 static const struct udevice_id zynq_spi_ids[] = {
-       { .compatible = "xlnx,zynq-spi" },
+       { .compatible = "xlnx,zynq-spi-r1p6" },
        { }
 };
 
index 4d52ba1dcda87b1b533802e5e456a1e770139ba4..141fc99ceae5eb35addfbe322dd0fb1df19e0fff 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/ag101.h>
+#include <asm/arch-ag101/ag101.h>
 
 /*
  * CPU and Board Configuration Options
index 06860b545e7b65dbda879beca6d960f460becfea..4296c6b4770503a229408e91ec163dc925fc0eb3 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/ag101.h>
+#include <asm/arch-ag101/ag101.h>
 
 /*
  * CPU and Board Configuration Options
index 026696ca398020eeeee8cd2e086d40dc6434ec56..0c7573a452479846a0aee521d7ecb60c58d3a78f 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <asm/arch/ag102.h>
+#include <asm/arch-ag102/ag102.h>
 
 /*
  * CPU and Board Configuration Options
index b90a60db0fec8b454d80a0fa498250482b4e4203..e9808a7473a18f84ee8b88b75b422ceea2ae45db 100644 (file)
@@ -42,6 +42,8 @@
 
 #define CONFIG_MISC_INIT_R
 
+#define CONFIG_OF_LIBFDT
+
 #define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_INITRD_TAG              1
index b43489d3f80de3f994027b1528368e0e9e9752d9..d148169959f2341c9daac4654ac078815114fa1b 100644 (file)
@@ -80,7 +80,7 @@
 #endif
 
 /* Now bring in the rest of the common code. */
-#include <configs/ti_armv7_common.h>
+#include <configs/ti_armv7_omap.h>
 
 /* Always 64 KiB env size */
 #define CONFIG_ENV_SIZE                        (64 << 10)
index a28ceb7064a71c3789e97d61253bb9e7432a6031..4f4ebf53ec5932f424a5947b277ae661a2ec6707 100644 (file)
 #define CONFIG_K2E_EVM
 
 /* U-Boot general configuration */
-#define CONFIG_SYS_PROMPT               "K2E EVM # "
-
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
        "addr_mon=0x0c140000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0"       \
-       "name_fdt=uImage-k2e-evm.dtb\0"                                 \
-       "name_mon=skern-k2e-evm.bin\0"                                  \
+       "name_fdt=k2e-evm.dtb\0"                                        \
+       "name_mon=skern-k2e.bin\0"                                      \
        "name_ubi=k2e-evm-ubifs.ubi\0"                                  \
        "name_uboot=u-boot-spi-k2e-evm.gph\0"                           \
        "name_fs=arago-console-image-k2e-evm.cpio.gz\0"
 
-#include <configs/ks2_evm.h>
+#include <configs/ti_armv7_keystone2.h>
 
 /* SPL SPI Loader Configuration */
 #define CONFIG_SPL_TEXT_BASE           0x0c100000
index eae77217833873c4fe6a4ef3ab07684d804f84ef..6c6dcb1e5ed3165200681bb1f775ee0b3d5ef407 100644 (file)
 #define CONFIG_K2HK_EVM
 
 /* U-Boot general configuration */
-#define CONFIG_SYS_PROMPT               "K2HK EVM # "
-
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
        "addr_mon=0x0c5f0000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0"       \
-       "name_fdt=uImage-k2hk-evm.dtb\0"                                \
-       "name_mon=skern-k2hk-evm.bin\0"                                 \
+       "name_fdt=k2hk-evm.dtb\0"                               \
+       "name_mon=skern-k2hk.bin\0"                                     \
        "name_ubi=k2hk-evm-ubifs.ubi\0"                                 \
        "name_uboot=u-boot-spi-k2hk-evm.gph\0"                          \
        "name_fs=arago-console-image-k2hk-evm.cpio.gz\0"
 
-#include <configs/ks2_evm.h>
+#include <configs/ti_armv7_keystone2.h>
 
 /* SPL SPI Loader Configuration */
 #define CONFIG_SPL_TEXT_BASE           0x0c200000
index 57da0579255a17adcf2294f59a86a92729876c00..9bacfa49c430b3f3550e4a27f33770a19b005add 100644 (file)
 #define CONFIG_K2L_EVM
 
 /* U-Boot general configuration */
-#define CONFIG_SYS_PROMPT              "K2L EVM # "
-
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
        "addr_mon=0x0c140000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,4096\0"       \
-       "name_fdt=uImage-k2l-evm.dtb\0"                                 \
-       "name_mon=skern-k2l-evm.bin\0"                                  \
+       "name_fdt=k2l-evm.dtb\0"                                        \
+       "name_mon=skern-k2l.bin\0"                                      \
        "name_ubi=k2l-evm-ubifs.ubi\0"                                  \
        "name_uboot=u-boot-spi-k2l-evm.gph\0"                           \
        "name_fs=arago-console-image-k2l-evm.cpio.gz\0"
 
-#include <configs/ks2_evm.h>
+#include <configs/ti_armv7_keystone2.h>
 
 /* SPL SPI Loader Configuration */
 #define CONFIG_SPL_TEXT_BASE           0x0c100000
diff --git a/include/configs/ks2_evm.h b/include/configs/ks2_evm.h
deleted file mode 100644 (file)
index eb4bcaf..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Common configuration header file for all Keystone II EVM platforms
- *
- * (C) Copyright 2012-2014
- *     Texas Instruments Incorporated, <www.ti.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef __CONFIG_KS2_EVM_H
-#define __CONFIG_KS2_EVM_H
-
-#define CONFIG_SOC_KEYSTONE
-
-/* U-Boot Build Configuration */
-#define CONFIG_SKIP_LOWLEVEL_INIT      /* U-Boot is a 2nd stage loader */
-#define CONFIG_SYS_NO_FLASH            /* that is, no *NOR* flash */
-#define CONFIG_SYS_CONSOLE_INFO_QUIET
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_SYS_THUMB_BUILD
-
-/* SoC Configuration */
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_SYS_ARCH_TIMER
-#define CONFIG_SYS_TEXT_BASE           0x0c001000
-#define CONFIG_SPL_TARGET              "u-boot-spi.gph"
-#define CONFIG_SYS_DCACHE_OFF
-
-/* Memory Configuration */
-#define CONFIG_NR_DRAM_BANKS           2
-#define CONFIG_SYS_SDRAM_BASE          0x80000000
-#define CONFIG_SYS_LPAE_SDRAM_BASE     0x800000000
-#define CONFIG_MAX_RAM_BANK_SIZE       (2 << 30)       /* 2GB */
-#define CONFIG_STACKSIZE               (512 << 10)     /* 512 KiB */
-#define CONFIG_SYS_MALLOC_LEN          (4 << 20)       /* 4 MiB */
-#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_TEXT_BASE - \
-                                       GENERATED_GBL_DATA_SIZE)
-
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_PAD_TO              65536
-#define CONFIG_SPL_MAX_SIZE            (CONFIG_SPL_PAD_TO - 8)
-#define CONFIG_SPL_BSS_START_ADDR      (CONFIG_SPL_TEXT_BASE + \
-                                       CONFIG_SPL_MAX_SIZE)
-#define CONFIG_SPL_BSS_MAX_SIZE                (32 * 1024)
-#define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SPL_BSS_START_ADDR + \
-                                       CONFIG_SPL_BSS_MAX_SIZE)
-#define CONFIG_SYS_SPL_MALLOC_SIZE     (32 * 1024)
-#define CONFIG_SPL_STACK_SIZE          (8 * 1024)
-#define CONFIG_SPL_STACK               (CONFIG_SYS_SPL_MALLOC_START + \
-                                       CONFIG_SYS_SPL_MALLOC_SIZE + \
-                                       CONFIG_SPL_STACK_SIZE - 4)
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_SPI_FLASH_SUPPORT
-#define CONFIG_SPL_SPI_SUPPORT
-#define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SYS_SPI_U_BOOT_OFFS     CONFIG_SPL_PAD_TO
-#define CONFIG_SPL_FRAMEWORK
-
-/* UART Configuration */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_MEM32
-#define CONFIG_SYS_NS16550_REG_SIZE    -4
-#define CONFIG_SYS_NS16550_COM1                KS2_UART0_BASE
-#define CONFIG_SYS_NS16550_COM2                KS2_UART1_BASE
-#define CONFIG_SYS_NS16550_CLK         clk_get_rate(KS2_CLK1_6)
-#define CONFIG_CONS_INDEX              1
-#define CONFIG_BAUDRATE                        115200
-
-/* SPI Configuration */
-#define CONFIG_SPI
-#define CONFIG_SPI_FLASH_STMICRO
-#define CONFIG_DAVINCI_SPI
-#define CONFIG_CMD_SPI
-#define CONFIG_SYS_SPI_CLK             clk_get_rate(KS2_CLK1_6)
-#define CONFIG_SF_DEFAULT_SPEED                30000000
-#define CONFIG_ENV_SPI_MAX_HZ          CONFIG_SF_DEFAULT_SPEED
-#define CONFIG_SYS_SPI0
-#define CONFIG_SYS_SPI_BASE            KS2_SPI0_BASE
-#define CONFIG_SYS_SPI0_NUM_CS         4
-#define CONFIG_SYS_SPI1
-#define CONFIG_SYS_SPI1_BASE           KS2_SPI1_BASE
-#define CONFIG_SYS_SPI1_NUM_CS         4
-#define CONFIG_SYS_SPI2
-#define CONFIG_SYS_SPI2_BASE           KS2_SPI2_BASE
-#define CONFIG_SYS_SPI2_NUM_CS         4
-
-/* Network Configuration */
-#define CONFIG_PHYLIB
-#define CONFIG_PHY_MARVELL
-#define CONFIG_MII
-#define CONFIG_BOOTP_DEFAULT
-#define CONFIG_BOOTP_DNS
-#define CONFIG_BOOTP_DNS2
-#define CONFIG_BOOTP_SEND_HOSTNAME
-#define CONFIG_NET_RETRY_COUNT         32
-#define CONFIG_SYS_SGMII_REFCLK_MHZ    312
-#define CONFIG_SYS_SGMII_LINERATE_MHZ  1250
-#define CONFIG_SYS_SGMII_RATESCALE     2
-
-/* Keyston Navigator Configuration */
-#define CONFIG_TI_KSNAV
-#define CONFIG_KSNAV_QM_BASE_ADDRESS           KS2_QM_BASE_ADDRESS
-#define CONFIG_KSNAV_QM_CONF_BASE              KS2_QM_CONF_BASE
-#define CONFIG_KSNAV_QM_DESC_SETUP_BASE                KS2_QM_DESC_SETUP_BASE
-#define CONFIG_KSNAV_QM_STATUS_RAM_BASE                KS2_QM_STATUS_RAM_BASE
-#define CONFIG_KSNAV_QM_INTD_CONF_BASE         KS2_QM_INTD_CONF_BASE
-#define CONFIG_KSNAV_QM_PDSP1_CMD_BASE         KS2_QM_PDSP1_CMD_BASE
-#define CONFIG_KSNAV_QM_PDSP1_CTRL_BASE                KS2_QM_PDSP1_CTRL_BASE
-#define CONFIG_KSNAV_QM_PDSP1_IRAM_BASE                KS2_QM_PDSP1_IRAM_BASE
-#define CONFIG_KSNAV_QM_MANAGER_QUEUES_BASE    KS2_QM_MANAGER_QUEUES_BASE
-#define CONFIG_KSNAV_QM_MANAGER_Q_PROXY_BASE   KS2_QM_MANAGER_Q_PROXY_BASE
-#define CONFIG_KSNAV_QM_QUEUE_STATUS_BASE      KS2_QM_QUEUE_STATUS_BASE
-#define CONFIG_KSNAV_QM_LINK_RAM_BASE          KS2_QM_LINK_RAM_BASE
-#define CONFIG_KSNAV_QM_REGION_NUM             KS2_QM_REGION_NUM
-#define CONFIG_KSNAV_QM_QPOOL_NUM              KS2_QM_QPOOL_NUM
-
-/* NETCP pktdma */
-#define CONFIG_KSNAV_PKTDMA_NETCP
-#define CONFIG_KSNAV_NETCP_PDMA_CTRL_BASE      KS2_NETCP_PDMA_CTRL_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_BASE                KS2_NETCP_PDMA_TX_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_CH_NUM      KS2_NETCP_PDMA_TX_CH_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_RX_BASE                KS2_NETCP_PDMA_RX_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_CH_NUM      KS2_NETCP_PDMA_RX_CH_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_SCHED_BASE     KS2_NETCP_PDMA_SCHED_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_BASE   KS2_NETCP_PDMA_RX_FLOW_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_NUM    KS2_NETCP_PDMA_RX_FLOW_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FREE_QUEUE  KS2_NETCP_PDMA_RX_FREE_QUEUE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_RCV_QUEUE   KS2_NETCP_PDMA_RX_RCV_QUEUE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_SND_QUEUE   KS2_NETCP_PDMA_TX_SND_QUEUE
-
-/* Keystone net */
-#define CONFIG_DRIVER_TI_KEYSTONE_NET
-#define CONFIG_KSNET_MAC_ID_BASE               KS2_MAC_ID_BASE_ADDR
-#define CONFIG_KSNET_NETCP_BASE                        KS2_NETCP_BASE
-#define CONFIG_KSNET_SERDES_SGMII_BASE         KS2_SGMII_SERDES_BASE
-#define CONFIG_KSNET_SERDES_SGMII2_BASE                KS2_SGMII_SERDES2_BASE
-#define CONFIG_KSNET_SERDES_LANES_PER_SGMII    KS2_LANES_PER_SGMII_SERDES
-
-/* SerDes */
-#define CONFIG_TI_KEYSTONE_SERDES
-
-/* AEMIF */
-#define CONFIG_TI_AEMIF
-#define CONFIG_AEMIF_CNTRL_BASE                KS2_AEMIF_CNTRL_BASE
-
-/* I2C Configuration */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_DAVINCI
-#define CONFIG_SYS_DAVINCI_I2C_SPEED   100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE   0x10 /* SMBus host address */
-#define CONFIG_SYS_DAVINCI_I2C_SPEED1  100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE1  0x10 /* SMBus host address */
-#define CONFIG_SYS_DAVINCI_I2C_SPEED2  100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE2  0x10 /* SMBus host address */
-#define I2C_BUS_MAX                    3
-
-/* EEPROM definitions */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      6
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
-#define CONFIG_ENV_EEPROM_IS_ON_I2C
-
-/* NAND Configuration */
-#define CONFIG_NAND_DAVINCI
-#define CONFIG_KEYSTONE_RBL_NAND
-#define CONFIG_KEYSTONE_NAND_MAX_RBL_SIZE      CONFIG_ENV_OFFSET
-#define CONFIG_SYS_NAND_MASK_CLE               0x4000
-#define CONFIG_SYS_NAND_MASK_ALE               0x2000
-#define CONFIG_SYS_NAND_CS                     2
-#define CONFIG_SYS_NAND_USE_FLASH_BBT
-#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
-
-#define CONFIG_SYS_NAND_LARGEPAGE
-#define CONFIG_SYS_NAND_BASE_LIST              { 0x30000000, }
-#define CONFIG_SYS_MAX_NAND_DEVICE             1
-#define CONFIG_SYS_NAND_MAX_CHIPS              1
-#define CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
-#define CONFIG_ENV_SIZE                                (256 << 10)  /* 256 KiB */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET                      0x100000
-#define CONFIG_MTD_PARTITIONS
-#define CONFIG_MTD_DEVICE
-#define CONFIG_RBTREE
-#define CONFIG_LZO
-#define MTDIDS_DEFAULT                 "nand0=davinci_nand.0"
-#define MTDPARTS_DEFAULT               "mtdparts=davinci_nand.0:" \
-                                       "1024k(bootloader)ro,512k(params)ro," \
-                                       "-(ubifs)"
-
-/* USB Configuration */
-#define CONFIG_USB_XHCI
-#define CONFIG_USB_XHCI_DWC3
-#define CONFIG_USB_XHCI_KEYSTONE
-#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS     2
-#define CONFIG_USB_STORAGE
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_FS_FAT
-#define CONFIG_SYS_CACHELINE_SIZE              64
-#define CONFIG_USB_SS_BASE                     KS2_USB_SS_BASE
-#define CONFIG_USB_HOST_XHCI_BASE              KS2_USB_HOST_XHCI_BASE
-#define CONFIG_DEV_USB_PHY_BASE                        KS2_DEV_USB_PHY_BASE
-#define CONFIG_USB_PHY_CFG_BASE                        KS2_USB_PHY_CFG_BASE
-
-/* U-Boot command configuration */
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_SAVES
-#define CONFIG_CMD_MTDPARTS
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_UBI
-#define CONFIG_CMD_UBIFS
-#define CONFIG_CMD_SF
-#define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_USB
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-
-/* U-Boot general configuration */
-#define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_MISC_INIT_R
-#define CONFIG_SYS_CBSIZE              1024
-#define CONFIG_SYS_PBSIZE              2048
-#define CONFIG_SYS_MAXARGS             16
-#define CONFIG_SYS_HUSH_PARSER
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_CRC32_VERIFY
-#define CONFIG_MX_CYCLIC
-#define CONFIG_CMDLINE_EDITING
-#define CONFIG_VERSION_VARIABLE
-#define CONFIG_TIMESTAMP
-
-/* EDMA3 */
-#define CONFIG_TI_EDMA3
-
-#define CONFIG_BOOTDELAY               3
-#define CONFIG_BOOTFILE                        "uImage"
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                             \
-       "boot=ubi\0"                                                    \
-       "tftp_root=/\0"                                                 \
-       "nfs_root=/export\0"                                            \
-       "mem_lpae=1\0"                                                  \
-       "mem_reserve=512M\0"                                            \
-       "addr_fdt=0x87000000\0"                                         \
-       "addr_kern=0x88000000\0"                                        \
-       "addr_uboot=0x87000000\0"                                       \
-       "addr_fs=0x82000000\0"                                          \
-       "addr_ubi=0x82000000\0"                                         \
-       "addr_secdb_key=0xc000000\0"                                    \
-       "fdt_high=0xffffffff\0"                                         \
-       "name_kern=uImage-keystone-evm.bin\0"                           \
-       "run_mon=mon_install ${addr_mon}\0"                             \
-       "run_kern=bootm ${addr_kern} - ${addr_fdt}\0"                   \
-       "init_net=run args_all args_net\0"                              \
-       "init_ubi=run args_all args_ubi; "                              \
-               "ubi part ubifs; ubifsmount ubi:boot;"                  \
-               "ubifsload ${addr_secdb_key} securedb.key.bin;\0"       \
-       "get_fdt_net=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}\0"       \
-       "get_fdt_ubi=ubifsload ${addr_fdt} ${name_fdt}\0"               \
-       "get_kern_net=dhcp ${addr_kern} ${tftp_root}/${name_kern}\0"    \
-       "get_kern_ubi=ubifsload ${addr_kern} ${name_kern}\0"            \
-       "get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"       \
-       "get_mon_ubi=ubifsload ${addr_mon} ${name_mon}\0"               \
-       "get_uboot_net=dhcp ${addr_uboot} ${tftp_root}/${name_uboot}\0" \
-       "burn_uboot_spi=sf probe; sf erase 0 0x100000; "                \
-               "sf write ${addr_uboot} 0 ${filesize}\0"                \
-       "burn_uboot_nand=nand erase 0 0x100000; "                       \
-               "nand write ${addr_uboot} 0 ${filesize}\0"              \
-       "args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1\0"  \
-       "args_net=setenv bootargs ${bootargs} rootfstype=nfs "          \
-               "root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},"     \
-               "${nfs_options} ip=dhcp\0"                              \
-       "nfs_options=v3,tcp,rsize=4096,wsize=4096\0"                    \
-       "get_fdt_ramfs=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}\0"     \
-       "get_kern_ramfs=dhcp ${addr_kern} ${tftp_root}/${name_kern}\0"  \
-       "get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"     \
-       "get_fs_ramfs=dhcp ${addr_fs} ${tftp_root}/${name_fs}\0"        \
-       "get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0"       \
-       "burn_ubi=nand erase.part ubifs; "                              \
-               "nand write ${addr_ubi} ubifs ${filesize}\0"            \
-       "init_ramfs=run args_all args_ramfs get_fs_ramfs\0"             \
-       "args_ramfs=setenv bootargs ${bootargs} "                       \
-               "rdinit=/sbin/init rw root=/dev/ram0 "                  \
-               "initrd=0x802000000,9M\0"                               \
-       "no_post=1\0"                                                   \
-       "mtdparts=mtdparts=davinci_nand.0:"                             \
-               "1024k(bootloader)ro,512k(params)ro,-(ubifs)\0"
-
-#define CONFIG_BOOTCOMMAND                                             \
-       "run init_${boot} get_fdt_${boot} get_mon_${boot} "             \
-               "get_kern_${boot} run_mon run_kern"
-
-#define CONFIG_BOOTARGS                                                        \
-
-/* Linux interfacing */
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_OF_LIBFDT               1
-#define CONFIG_OF_BOARD_SETUP
-#define CONFIG_SYS_BARGSIZE            1024
-#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x08000000)
-#define CONFIG_LINUX_BOOT_PARAM_ADDR   (CONFIG_SYS_SDRAM_BASE + 0x100)
-
-#define CONFIG_SUPPORT_RAW_INITRD
-
-/* we may include files below only after all above definitions */
-#include <asm/arch/hardware.h>
-#include <asm/arch/clock.h>
-#define CONFIG_SYS_HZ_CLOCK            clk_get_rate(KS2_CLK1_6)
-
-#endif /* __CONFIG_KS2_EVM_H */
index efc583f91eb3b76c02d7d498ff1a5c6cf046a3f1..6e3ce4d3c7f0c0fd086f1980b135da6e6d52a74e 100644 (file)
 
 /* USB */
 #define CONFIG_MUSB_UDC
-#define CONFIG_MUSB_HDC
+#define CONFIG_MUSB_HCD
 #define CONFIG_USB_OMAP3
 #define CONFIG_TWL4030_USB
 
index 76bf3b621650fa818651bffa624af60f6f4943fe..a1a90ec313ec782a3834dd35b3dcbdea31981020 100644 (file)
        "defaultdisplay=dvi\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 rw\0" \
-       "mmcrootfstype=ext3 rootwait\0" \
+       "mmcrootfstype=ext4 rootwait\0" \
        "nandroot=ubi0:rootfs ubi.mtd=4\0" \
        "nandrootfstype=ubifs\0" \
        "mtdparts=" MTDPARTS_DEFAULT "\0" \
index 16149f69d52c80ff1e44676d344b6c0c0fae5fcf..0bdcf22dc0d685ad507029b71b7b84a22afe6881 100644 (file)
@@ -41,7 +41,7 @@
        "optargs=\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 rw\0" \
-       "mmcrootfstype=ext3 rootwait\0" \
+       "mmcrootfstype=ext4 rootwait\0" \
        "mmcargs=setenv bootargs console=${console} " \
                "${optargs} " \
                "root=${mmcroot} " \
index f33f9b413dc2f7303c738328b77bf7d5386d1d83..f7bef706eb6d338a090123eeae2f66424b9020f5 100644 (file)
 #define CONFIG_I2C
 #define CONFIG_CMD_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_OMAP24_I2C_SPEED    OMAP_I2C_STANDARD
+#define CONFIG_SYS_OMAP24_I2C_SPEED    100000
 #define CONFIG_SYS_OMAP24_I2C_SLAVE    1
 #define CONFIG_SYS_I2C_OMAP24XX
 
index 1b4fd213cf43f0c558d28fd74c8af7d7b139e203..1ac3db69b1702ddae32bd41853b2b49e5d80cbda 100644 (file)
@@ -15,6 +15,7 @@
 #define CONFIG_OF_LIBFDT
 
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_MISC_INIT_R
 
 #define CONFIG_SYS_FLASH_BASE          0x08000000
 
@@ -61,6 +62,8 @@
 
 #define CONFIG_STM32_HSE_HZ            8000000
 
+#define CONFIG_SYS_CLK_FREQ            180000000 /* 180 MHz */
+
 #define CONFIG_SYS_HZ_CLOCK            1000000 /* Timer is clocked at 1MHz */
 
 #define CONFIG_CMDLINE_TAG
@@ -80,7 +83,7 @@
 
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_BOOTARGS                                                        \
-       "console=ttystm0,115200 earlyprintk consoleblank=0 ignore_loglevel"
+       "console=ttyS0,115200 earlyprintk consoleblank=0 ignore_loglevel"
 #define CONFIG_BOOTCOMMAND                                             \
        "run bootcmd_romfs"
 
index 4d2ae280e7f1433dae02581696224b2ba26ebff7..9697431b449638e0a88124be96d686a711211d0e 100644 (file)
@@ -94,6 +94,6 @@
 #endif
 
 /* Now bring in the rest of the common code. */
-#include <configs/ti_armv7_common.h>
+#include <configs/ti_armv7_omap.h>
 
 #endif /* __CONFIG_TI_AM335X_COMMON_H__ */
index 0aea7d12ec16c73ad7f4a3c4d1ae055c1a9cf5d9..6dc5ebdd3497d3296d456754eb211b9c0d3f791b 100644 (file)
@@ -18,8 +18,6 @@
 #define __CONFIG_TI_ARMV7_COMMON_H__
 
 /* Common define for many platforms. */
-#define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 #define CONFIG_SYS_GENERIC_BOARD
 
 /*
 #define CONFIG_NR_DRAM_BANKS           1
 #endif
 #define CONFIG_SYS_SDRAM_BASE          0x80000000
+
+#ifndef CONFIG_SYS_INIT_SP_ADDR
 #define CONFIG_SYS_INIT_SP_ADDR         (NON_SECURE_SRAM_END - \
                                                GENERATED_GBL_DATA_SIZE)
+#endif
 
 /* Timer information. */
 #define CONFIG_SYS_PTV                 2       /* Divisor: 2^(PTV+1) => 8 */
 #define CONFIG_I2C
 #define CONFIG_CMD_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_OMAP24_I2C_SPEED    100000
-#define CONFIG_SYS_OMAP24_I2C_SLAVE    1
-#define CONFIG_SYS_I2C_OMAP24XX
 
 /* MMC/SD IP block */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_OMAP_HSMMC
 #define CONFIG_CMD_MMC
 
 /* McSPI IP block */
 #define CONFIG_SPI
-#define CONFIG_OMAP3_SPI
 #define CONFIG_CMD_SPI
 
 /* GPIO block */
-#define CONFIG_OMAP_GPIO
 #define CONFIG_CMD_GPIO
 
-/*
- * GPMC NAND block.  We support 1 device and the physical address to
- * access CS0 at is 0x8000000.
- */
-#ifdef CONFIG_NAND
-#define CONFIG_NAND_OMAP_GPMC
-#ifndef CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_NAND_BASE           0x8000000
-#endif
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_CMD_NAND
-#endif
-
 /*
  * The following are general good-enough settings for U-Boot.  We set a
  * large malloc pool as we generally have a lot of DDR, and we opt for
  * mtdparts, both for ease of use in U-Boot and for passing information
  * on to the Linux kernel.
  */
-#if defined(CONFIG_SPI_BOOT) || defined(CONFIG_NOR) || defined(CONFIG_NAND)
+#if defined(CONFIG_SPI_BOOT) || defined(CONFIG_NOR) || defined(CONFIG_NAND) || defined(CONFIG_NAND_DAVINCI)
 #define CONFIG_MTD_DEVICE              /* Required for mtdparts */
 #define CONFIG_CMD_MTDPARTS
 #endif
 #define CONFIG_SPL_EXT_SUPPORT
 #endif
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_THUMB_BUILD /* Thumbs mode to save space in SPL */
-#endif
+#define CONFIG_SYS_THUMB_BUILD
 
 /* General parts of the framework, required. */
 #define CONFIG_SPL_I2C_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_SPL_BOARD_INIT
 
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
new file mode 100644 (file)
index 0000000..2b6a229
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+ * Common configuration header file for all Keystone II EVM platforms
+ *
+ * (C) Copyright 2012-2014
+ *     Texas Instruments Incorporated, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_KS2_EVM_H
+#define __CONFIG_KS2_EVM_H
+
+#define CONFIG_SOC_KEYSTONE
+
+/* U-Boot Build Configuration */
+#define CONFIG_SKIP_LOWLEVEL_INIT      /* U-Boot is a 2nd stage loader */
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* SoC Configuration */
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_SYS_ARCH_TIMER
+#define CONFIG_SYS_TEXT_BASE           0x0c001000
+#define CONFIG_SPL_TARGET              "u-boot-spi.gph"
+#define CONFIG_SYS_DCACHE_OFF
+
+/* Memory Configuration */
+#define CONFIG_NR_DRAM_BANKS           2
+#define CONFIG_SYS_LPAE_SDRAM_BASE     0x800000000
+#define CONFIG_MAX_RAM_BANK_SIZE       (2 << 30)       /* 2GB */
+#define CONFIG_STACKSIZE               (512 << 10)     /* 512 KiB */
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_TEXT_BASE - \
+                                       GENERATED_GBL_DATA_SIZE)
+
+/* SPL SPI Loader Configuration */
+#define CONFIG_SPL_PAD_TO              65536
+#define CONFIG_SPL_MAX_SIZE            (CONFIG_SPL_PAD_TO - 8)
+#define CONFIG_SPL_BSS_START_ADDR      (CONFIG_SPL_TEXT_BASE + \
+                                       CONFIG_SPL_MAX_SIZE)
+#define CONFIG_SPL_BSS_MAX_SIZE                (32 * 1024)
+#define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SPL_BSS_START_ADDR + \
+                                       CONFIG_SPL_BSS_MAX_SIZE)
+#define CONFIG_SYS_SPL_MALLOC_SIZE     (32 * 1024)
+#define CONFIG_SPL_STACK_SIZE          (8 * 1024)
+#define CONFIG_SPL_STACK               (CONFIG_SYS_SPL_MALLOC_START + \
+                                       CONFIG_SYS_SPL_MALLOC_SIZE + \
+                                       CONFIG_SPL_STACK_SIZE - 4)
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     CONFIG_SPL_PAD_TO
+
+/* UART Configuration */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_MEM32
+#define CONFIG_SYS_NS16550_REG_SIZE    -4
+#define CONFIG_SYS_NS16550_COM1                KS2_UART0_BASE
+#define CONFIG_SYS_NS16550_COM2                KS2_UART1_BASE
+#define CONFIG_SYS_NS16550_CLK         clk_get_rate(KS2_CLK1_6)
+#define CONFIG_CONS_INDEX              1
+
+/* SPI Configuration */
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_DAVINCI_SPI
+#define CONFIG_SYS_SPI_CLK             clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SF_DEFAULT_SPEED                30000000
+#define CONFIG_ENV_SPI_MAX_HZ          CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_SYS_SPI0
+#define CONFIG_SYS_SPI_BASE            KS2_SPI0_BASE
+#define CONFIG_SYS_SPI0_NUM_CS         4
+#define CONFIG_SYS_SPI1
+#define CONFIG_SYS_SPI1_BASE           KS2_SPI1_BASE
+#define CONFIG_SYS_SPI1_NUM_CS         4
+#define CONFIG_SYS_SPI2
+#define CONFIG_SYS_SPI2_BASE           KS2_SPI2_BASE
+#define CONFIG_SYS_SPI2_NUM_CS         4
+
+/* Network Configuration */
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_MARVELL
+#define CONFIG_MII
+#define CONFIG_BOOTP_DEFAULT
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_NET_RETRY_COUNT         32
+#define CONFIG_SYS_SGMII_REFCLK_MHZ    312
+#define CONFIG_SYS_SGMII_LINERATE_MHZ  1250
+#define CONFIG_SYS_SGMII_RATESCALE     2
+
+/* Keyston Navigator Configuration */
+#define CONFIG_TI_KSNAV
+#define CONFIG_KSNAV_QM_BASE_ADDRESS           KS2_QM_BASE_ADDRESS
+#define CONFIG_KSNAV_QM_CONF_BASE              KS2_QM_CONF_BASE
+#define CONFIG_KSNAV_QM_DESC_SETUP_BASE                KS2_QM_DESC_SETUP_BASE
+#define CONFIG_KSNAV_QM_STATUS_RAM_BASE                KS2_QM_STATUS_RAM_BASE
+#define CONFIG_KSNAV_QM_INTD_CONF_BASE         KS2_QM_INTD_CONF_BASE
+#define CONFIG_KSNAV_QM_PDSP1_CMD_BASE         KS2_QM_PDSP1_CMD_BASE
+#define CONFIG_KSNAV_QM_PDSP1_CTRL_BASE                KS2_QM_PDSP1_CTRL_BASE
+#define CONFIG_KSNAV_QM_PDSP1_IRAM_BASE                KS2_QM_PDSP1_IRAM_BASE
+#define CONFIG_KSNAV_QM_MANAGER_QUEUES_BASE    KS2_QM_MANAGER_QUEUES_BASE
+#define CONFIG_KSNAV_QM_MANAGER_Q_PROXY_BASE   KS2_QM_MANAGER_Q_PROXY_BASE
+#define CONFIG_KSNAV_QM_QUEUE_STATUS_BASE      KS2_QM_QUEUE_STATUS_BASE
+#define CONFIG_KSNAV_QM_LINK_RAM_BASE          KS2_QM_LINK_RAM_BASE
+#define CONFIG_KSNAV_QM_REGION_NUM             KS2_QM_REGION_NUM
+#define CONFIG_KSNAV_QM_QPOOL_NUM              KS2_QM_QPOOL_NUM
+
+/* NETCP pktdma */
+#define CONFIG_KSNAV_PKTDMA_NETCP
+#define CONFIG_KSNAV_NETCP_PDMA_CTRL_BASE      KS2_NETCP_PDMA_CTRL_BASE
+#define CONFIG_KSNAV_NETCP_PDMA_TX_BASE                KS2_NETCP_PDMA_TX_BASE
+#define CONFIG_KSNAV_NETCP_PDMA_TX_CH_NUM      KS2_NETCP_PDMA_TX_CH_NUM
+#define CONFIG_KSNAV_NETCP_PDMA_RX_BASE                KS2_NETCP_PDMA_RX_BASE
+#define CONFIG_KSNAV_NETCP_PDMA_RX_CH_NUM      KS2_NETCP_PDMA_RX_CH_NUM
+#define CONFIG_KSNAV_NETCP_PDMA_SCHED_BASE     KS2_NETCP_PDMA_SCHED_BASE
+#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_BASE   KS2_NETCP_PDMA_RX_FLOW_BASE
+#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_NUM    KS2_NETCP_PDMA_RX_FLOW_NUM
+#define CONFIG_KSNAV_NETCP_PDMA_RX_FREE_QUEUE  KS2_NETCP_PDMA_RX_FREE_QUEUE
+#define CONFIG_KSNAV_NETCP_PDMA_RX_RCV_QUEUE   KS2_NETCP_PDMA_RX_RCV_QUEUE
+#define CONFIG_KSNAV_NETCP_PDMA_TX_SND_QUEUE   KS2_NETCP_PDMA_TX_SND_QUEUE
+
+/* Keystone net */
+#define CONFIG_DRIVER_TI_KEYSTONE_NET
+#define CONFIG_KSNET_MAC_ID_BASE               KS2_MAC_ID_BASE_ADDR
+#define CONFIG_KSNET_NETCP_BASE                        KS2_NETCP_BASE
+#define CONFIG_KSNET_SERDES_SGMII_BASE         KS2_SGMII_SERDES_BASE
+#define CONFIG_KSNET_SERDES_SGMII2_BASE                KS2_SGMII_SERDES2_BASE
+#define CONFIG_KSNET_SERDES_LANES_PER_SGMII    KS2_LANES_PER_SGMII_SERDES
+
+/* SerDes */
+#define CONFIG_TI_KEYSTONE_SERDES
+
+/* AEMIF */
+#define CONFIG_TI_AEMIF
+#define CONFIG_AEMIF_CNTRL_BASE                KS2_AEMIF_CNTRL_BASE
+
+/* I2C Configuration */
+#define CONFIG_SYS_I2C_DAVINCI
+#define CONFIG_SYS_DAVINCI_I2C_SPEED   100000
+#define CONFIG_SYS_DAVINCI_I2C_SLAVE   0x10 /* SMBus host address */
+#define CONFIG_SYS_DAVINCI_I2C_SPEED1  100000
+#define CONFIG_SYS_DAVINCI_I2C_SLAVE1  0x10 /* SMBus host address */
+#define CONFIG_SYS_DAVINCI_I2C_SPEED2  100000
+#define CONFIG_SYS_DAVINCI_I2C_SLAVE2  0x10 /* SMBus host address */
+#define I2C_BUS_MAX                    3
+
+/* EEPROM definitions */
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
+#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      6
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
+#define CONFIG_ENV_EEPROM_IS_ON_I2C
+
+/* NAND Configuration */
+#define CONFIG_NAND_DAVINCI
+#define CONFIG_KEYSTONE_RBL_NAND
+#define CONFIG_KEYSTONE_NAND_MAX_RBL_SIZE      CONFIG_ENV_OFFSET
+#define CONFIG_SYS_NAND_MASK_CLE               0x4000
+#define CONFIG_SYS_NAND_MASK_ALE               0x2000
+#define CONFIG_SYS_NAND_CS                     2
+#define CONFIG_SYS_NAND_USE_FLASH_BBT
+#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
+
+#define CONFIG_SYS_NAND_LARGEPAGE
+#define CONFIG_SYS_NAND_BASE_LIST              { 0x30000000, }
+#define CONFIG_SYS_MAX_NAND_DEVICE             1
+#define CONFIG_SYS_NAND_MAX_CHIPS              1
+#define CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+#define CONFIG_ENV_SIZE                                (256 << 10)  /* 256 KiB */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET                      0x100000
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_RBTREE
+#define CONFIG_LZO
+#define MTDIDS_DEFAULT                 "nand0=davinci_nand.0"
+#define MTDPARTS_DEFAULT               "mtdparts=davinci_nand.0:" \
+                                       "1024k(bootloader)ro,512k(params)ro," \
+                                       "-(ubifs)"
+
+/* USB Configuration */
+#define CONFIG_USB_XHCI
+#define CONFIG_USB_XHCI_DWC3
+#define CONFIG_USB_XHCI_KEYSTONE
+#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS     2
+#define CONFIG_EFI_PARTITION
+#define CONFIG_FS_FAT
+#define CONFIG_SYS_CACHELINE_SIZE              64
+#define CONFIG_USB_SS_BASE                     KS2_USB_SS_BASE
+#define CONFIG_USB_HOST_XHCI_BASE              KS2_USB_HOST_XHCI_BASE
+#define CONFIG_DEV_USB_PHY_BASE                        KS2_DEV_USB_PHY_BASE
+#define CONFIG_USB_PHY_CFG_BASE                        KS2_USB_PHY_CFG_BASE
+
+/* U-Boot command configuration */
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_USB
+
+/* U-Boot general configuration */
+#define CONFIG_MISC_INIT_R
+#define CONFIG_CRC32_VERIFY
+#define CONFIG_MX_CYCLIC
+#define CONFIG_TIMESTAMP
+
+/* EDMA3 */
+#define CONFIG_TI_EDMA3
+
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       DEFAULT_LINUX_BOOT_ENV                                          \
+       CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                             \
+       "boot=ubi\0"                                                    \
+       "tftp_root=/\0"                                                 \
+       "nfs_root=/export\0"                                            \
+       "mem_lpae=1\0"                                                  \
+       "mem_reserve=512M\0"                                            \
+       "addr_ubi=0x82000000\0"                                         \
+       "addr_secdb_key=0xc000000\0"                                    \
+       "name_kern=zImage\0"                                            \
+       "run_mon=mon_install ${addr_mon}\0"                             \
+       "run_kern=bootz ${loadaddr} - ${fdtaddr}\0"                     \
+       "init_net=run args_all args_net\0"                              \
+       "init_ubi=run args_all args_ubi; "                              \
+               "ubi part ubifs; ubifsmount ubi:boot;"                  \
+               "ubifsload ${addr_secdb_key} securedb.key.bin;\0"       \
+       "get_fdt_net=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}\0"        \
+       "get_fdt_ubi=ubifsload ${fdtaddr} ${name_fdt}\0"                \
+       "get_kern_net=dhcp ${loadaddr} ${tftp_root}/${name_kern}\0"     \
+       "get_kern_ubi=ubifsload ${loadaddr} ${name_kern}\0"             \
+       "get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"       \
+       "get_mon_ubi=ubifsload ${addr_mon} ${name_mon}\0"               \
+       "get_uboot_net=dhcp ${addr_uboot} ${tftp_root}/${name_uboot}\0" \
+       "burn_uboot_spi=sf probe; sf erase 0 0x100000; "                \
+               "sf write ${addr_uboot} 0 ${filesize}\0"                \
+       "burn_uboot_nand=nand erase 0 0x100000; "                       \
+               "nand write ${addr_uboot} 0 ${filesize}\0"              \
+       "args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1\0"  \
+       "args_net=setenv bootargs ${bootargs} rootfstype=nfs "          \
+               "root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},"     \
+               "${nfs_options} ip=dhcp\0"                              \
+       "nfs_options=v3,tcp,rsize=4096,wsize=4096\0"                    \
+       "get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}\0"      \
+       "get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}\0"   \
+       "get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"     \
+       "get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}\0" \
+       "get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0"       \
+       "burn_ubi=nand erase.part ubifs; "                              \
+               "nand write ${addr_ubi} ubifs ${filesize}\0"            \
+       "init_ramfs=run args_all args_ramfs get_fs_ramfs\0"             \
+       "args_ramfs=setenv bootargs ${bootargs} "                       \
+               "rdinit=/sbin/init rw root=/dev/ram0 "                  \
+               "initrd=0x802000000,9M\0"                               \
+       "no_post=1\0"                                                   \
+       "mtdparts=mtdparts=davinci_nand.0:"                             \
+               "1024k(bootloader)ro,512k(params)ro,-(ubifs)\0"
+
+#define CONFIG_BOOTCOMMAND                                             \
+       "run init_${boot} get_fdt_${boot} get_mon_${boot} "             \
+               "get_kern_${boot} run_mon run_kern"
+
+#define CONFIG_BOOTARGS                                                        \
+
+/* Linux interfacing */
+#define CONFIG_OF_BOARD_SETUP
+
+/* Now for the remaining common defines */
+#include <configs/ti_armv7_common.h>
+
+/* We wont be loading up OS from SPL for now.. */
+#undef CONFIG_SPL_OS_BOOT
+
+/* We do not have MMC support.. yet.. */
+#undef CONFIG_SPL_LIBDISK_SUPPORT
+#undef CONFIG_SPL_MMC_SUPPORT
+#undef CONFIG_SPL_FAT_SUPPORT
+#undef CONFIG_SPL_EXT_SUPPORT
+#undef CONFIG_MMC
+#undef CONFIG_GENERIC_MMC
+#undef CONFIG_CMD_MMC
+
+/* And no support for GPIO, yet.. */
+#undef CONFIG_SPL_GPIO_SUPPORT
+#undef CONFIG_CMD_GPIO
+
+/* we may include files below only after all above definitions */
+#include <asm/arch/hardware.h>
+#include <asm/arch/clock.h>
+#define CONFIG_SYS_HZ_CLOCK            clk_get_rate(KS2_CLK1_6)
+
+#endif /* __CONFIG_KS2_EVM_H */
diff --git a/include/configs/ti_armv7_omap.h b/include/configs/ti_armv7_omap.h
new file mode 100644 (file)
index 0000000..7548170
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * ti_armv7_omap.h
+ *
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ *
+ * The various ARMv7 SoCs from TI all share a number of IP blocks when
+ * implementing a given feature. This is meant to isolate the features
+ * that are based on OMAP architecture.
+ */
+#ifndef __CONFIG_TI_ARMV7_OMAP_H__
+#define __CONFIG_TI_ARMV7_OMAP_H__
+
+/* Common defines for all OMAP architecture based SoCs */
+#define CONFIG_OMAP
+#define CONFIG_OMAP_COMMON
+
+/* I2C IP block */
+#define CONFIG_SYS_OMAP24_I2C_SPEED    100000
+#define CONFIG_SYS_OMAP24_I2C_SLAVE    1
+#define CONFIG_SYS_I2C_OMAP24XX
+
+/* MMC/SD IP block */
+#define CONFIG_OMAP_HSMMC
+
+/* SPI IP Block */
+#define CONFIG_OMAP3_SPI
+
+/* GPIO block */
+#define CONFIG_OMAP_GPIO
+
+/*
+ * GPMC NAND block.  We support 1 device and the physical address to
+ * access CS0 at is 0x8000000.
+ */
+#ifdef CONFIG_NAND
+#define CONFIG_NAND_OMAP_GPMC
+#ifndef CONFIG_SYS_NAND_BASE
+#define CONFIG_SYS_NAND_BASE           0x8000000
+#endif
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_CMD_NAND
+#endif
+
+/* Now for the remaining common defines */
+#include <configs/ti_armv7_common.h>
+
+#endif /* __CONFIG_TI_ARMV7_OMAP_H__ */
index 429b109afa23e0e87e87d19446546b7c5800abb7..be231a551361dc6392d10f7f203471367f255336 100644 (file)
@@ -84,6 +84,6 @@
 #endif
 
 /* Now bring in the rest of the common code. */
-#include <configs/ti_armv7_common.h>
+#include <configs/ti_armv7_omap.h>
 
 #endif /* __CONFIG_TI_OMAP3_COMMON_H__ */
index e96613406b3b4e1d9b4eab1e0e730c00cea62420..b299aedb2e7d538e35b736e41732e51f70b3a235 100644 (file)
@@ -52,7 +52,7 @@
 #define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
 #endif
 
-#include <configs/ti_armv7_common.h>
+#include <configs/ti_armv7_omap.h>
 
 /*
  * Hardware drivers
 /* No need for i2c in SPL mode as we will use SRI2C for PMIC access on OMAP4 */
 #undef CONFIG_SYS_I2C
 #undef CONFIG_SYS_I2C_OMAP24XX
+#undef CONFIG_SPL_I2C_SUPPORT
 #endif
 
 #endif /* __CONFIG_TI_OMAP4_COMMON_H */
index 4179a574a9752b003adc1b6fe0a70eb46a4b69f2..fe04692368b59a78f4621527587f9ef73f5edc94 100644 (file)
 #define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
 #endif
 
-#ifndef CONFIG_SPL_BUILD
 #define CONFIG_PALMAS_POWER
-#endif
 
 #include <asm/arch/cpu.h>
 #include <asm/arch/omap.h>
 
-#include <configs/ti_armv7_common.h>
+#include <configs/ti_armv7_omap.h>
 
 /*
  * Hardware drivers
index ad82ed62890c35bb9af09c11eca177ce72176633..68853b64de539a9591f950684f98533c8bcc72ca 100644 (file)
@@ -40,7 +40,6 @@
 
 #define CONFIG_IDENT_STRING            " Xilinx ZynqMP"
 
-#define CONFIG_SYS_TEXT_BASE           0x8000000
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 
 /* Flat Device Tree Definitions */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 0x400000)
 
 /* Serial setup */
-#define CONFIG_ZYNQ_SERIAL_UART0
-#define CONFIG_ZYNQ_SERIAL
+#if defined(CONFIG_ZYNQMP_DCC)
+# define CONFIG_ARM_DCC
+# define CONFIG_CPU_ARMV8
+#else
+# if defined(CONFIG_ZYNQ_SERIAL_UART0) || defined(CONFIG_ZYNQ_SERIAL_UART1)
+#  define CONFIG_ZYNQ_SERIAL
+# endif
+#endif
 
 #define CONFIG_CONS_INDEX              0
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE \
        { 4800, 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_ZYNQ_SDHCI0
-
 /* Command line configuration */
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_ELF
 #define CONFIG_MP
 
+#define CONFIG_CMD_MII
+
+/* BOOTP options */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_MAY_FAIL
+#define CONFIG_BOOTP_SERVERIP
+
 /* SPI */
 #ifdef CONFIG_ZYNQ_SPI
 # define CONFIG_SPI_FLASH_SST
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_SYS_MAXARGS             64
 
-#define CONFIG_ZYNQ_I2C0
-#define CONFIG_SYS_I2C_ZYNQ
+/* Ethernet driver */
+#if defined(CONFIG_ZYNQ_GEM0) || defined(CONFIG_ZYNQ_GEM1) || \
+       defined(CONFIG_ZYNQ_GEM2) || defined(CONFIG_ZYNQ_GEM3)
+# define CONFIG_NET_MULTI
+# define CONFIG_ZYNQ_GEM
+# define CONFIG_MII
+# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
+# define CONFIG_PHYLIB
+# define CONFIG_PHY_MARVELL
+#endif
 
 /* I2C */
 #if defined(CONFIG_SYS_I2C_ZYNQ)
 # define CONFIG_SYS_I2C_ZYNQ_SLAVE             0
 #endif
 
-#define CONFIG_ZYNQMP_EEPROM
-
 /* EEPROM */
 #ifdef CONFIG_ZYNQMP_EEPROM
 # define CONFIG_CMD_EEPROM
 # define CONFIG_SYS_EEPROM_SIZE                        (64 * 1024)
 #endif
 
+#ifdef CONFIG_AHCI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
+#define CONFIG_SYS_SCSI_MAX_LUN                1
+#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+                                        CONFIG_SYS_SCSI_MAX_LUN)
+#define CONFIG_CMD_SCSI
+#endif
+
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE       /* enable fit_format_{error,warning}() */
 
diff --git a/include/configs/xilinx_zynqmp_ep.h b/include/configs/xilinx_zynqmp_ep.h
new file mode 100644 (file)
index 0000000..c872f7c
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Configuration for Xilinx ZynqMP emulation
+ * platforms. See zynqmp-common.h for ZynqMP
+ * common configs
+ *
+ * (C) Copyright 2014 - 2015 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ * Siva Durga Prasad Paladugu <sivadur@xilinx.com>
+ *
+ * Based on Configuration for Versatile Express
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_ZYNQMP_EP_H
+#define __CONFIG_ZYNQMP_EP_H
+
+#define CONFIG_ZYNQ_SERIAL_UART0
+#define CONFIG_ZYNQ_SDHCI0
+#define CONFIG_ZYNQ_I2C0
+#define CONFIG_SYS_I2C_ZYNQ
+#define CONFIG_ZYNQ_EEPROM
+#define CONFIG_AHCI
+
+#include <configs/xilinx_zynqmp.h>
+
+#endif /* __CONFIG_ZYNQMP_EP_H */
index 16b904743f1e97f5487f850f81f6c0383a40c724..7a1b8729e5b17a83c8526ca553af2e54cddaacf9 100644 (file)
@@ -21,6 +21,9 @@
 # define CONFIG_ZYNQ_SDHCI0
 # define CONFIG_ZYNQ_SPI
 
+#elif defined(CONFIG_ZC770_XM011)
+# define CONFIG_ZYNQ_SERIAL_UART1
+
 #elif defined(CONFIG_ZC770_XM012)
 # define CONFIG_ZYNQ_SERIAL_UART1
 # undef CONFIG_SYS_NO_FLASH
index b22d169d97966766122dd41a6e0c3aa573c0ec04..76898ab70262dc8e033c0c74d6ce63708d236902 100644 (file)
@@ -83,7 +83,7 @@
  * global list name ("outer"); iterators for only a sub-list should use
  * the full sub-list name ("outer_2_inner").
  *
- *  Here is an example of the sections generated from a global list
+ * Here is an example of the sections generated from a global list
  * named "drivers", two sub-lists named "i2c" and "pci", and iterators
  * defined for the whole list and each sub-list:
  *
  */
 
 /**
- * ll_sym() - Access a linker-generated array entry
+ * llsym() - Access a linker-generated array entry
  * @_type:     Data type of the entry
  * @_name:     Name of the entry
  * @_list:     name of the list. Should contain only characters allowed
  *    the inner sections are present in the array.
  *
  * Example:
- * ll_entry_declare(struct my_sub_cmd, my_sub_cmd, cmd_sub, cmd.sub) = {
+ * ll_entry_declare(struct my_sub_cmd, my_sub_cmd, cmd_sub) = {
  *         .x = 3,
  *         .y = 4,
  * };
  * This is like ll_entry_declare() but creates multiple entries. It should
  * be assigned to an array.
  *
- * ll_entry_declare_list(struct my_sub_cmd, my_sub_cmd, cmd_sub, cmd.sub) = {
+ * ll_entry_declare_list(struct my_sub_cmd, my_sub_cmd, cmd_sub) = {
  *     { .x = 3, .y = 4 },
  *     { .x = 8, .y = 2 },
  *     { .x = 1, .y = 7 }
  */
 #define ll_entry_end(_type, _list)                                     \
 ({                                                                     \
-       static char end[0] __aligned(4) __attribute__((unused,  \
+       static char end[0] __aligned(4) __attribute__((unused,          \
                section(".u_boot_list_2_"#_list"_3")));                 \
        (_type *)&end;                                                  \
 })
  * @_name:     Name of the entry
  * @_list:     Name of the list in which this entry is placed
  *
- * This function returns a pointer to a particular entry in LG-array
- * identified by the subsection of u_boot_list where the entry resides
+ * This function returns a pointer to a particular entry in linker-generated
+ * array identified by the subsection of u_boot_list where the entry resides
  * and it's name.
  *
  * Example:
        ({                                                              \
                extern _type _u_boot_list_2_##_list##_2_##_name;        \
                _type *_ll_result =                                     \
-                       &_u_boot_list_2_##_list##_2_##_name;    \
+                       &_u_boot_list_2_##_list##_2_##_name;            \
                _ll_result;                                             \
        })
 
 })
 
 /**
- * ll_entry_end() - Point after last entry of last linker-generated array
+ * ll_end() - Point after last entry of last linker-generated array
  * @_type:     Data type of the entry
  *
  * This function returns (_type *) pointer after the very last entry of
  */
 #define ll_end(_type)                                                  \
 ({                                                                     \
-       static char end[0] __aligned(4) __attribute__((unused,  \
+       static char end[0] __aligned(4) __attribute__((unused,          \
                section(".u_boot_list_3")));                            \
        (_type *)&end;                                                  \
 })
index d20f20ae32c9ce34405bc2a244461d972aef4df8..f02eb37f75818916ca2e2cbcb1c8694d6daad0d2 100644 (file)
@@ -131,17 +131,15 @@ cc-disable-warning = $(call try-run,\
        $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
 # cc-version
-# Usage gcc-ver := $(call cc-version)
 cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
 
 # cc-fullversion
-# Usage gcc-ver := $(call cc-fullversion)
 cc-fullversion = $(shell $(CONFIG_SHELL) \
        $(srctree)/scripts/gcc-version.sh -p $(CC))
 
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
-cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3))
+cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4))
 
 # added for U-Boot
 binutils-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/binutils-version.sh $(AS))
@@ -163,13 +161,12 @@ ld-option = $(call try-run,\
 ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
 
 # ld-version
-# Usage: $(call ld-version)
 # Note this is mainly for HJ Lu's 3 number binutil versions
 ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
 
 # ld-ifversion
 # Usage:  $(call ld-ifversion, -ge, 22252, y)
-ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
+ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
 
 ######
 
@@ -185,6 +182,24 @@ build := -f $(srctree)/scripts/Makefile.build obj
 # $(Q)$(MAKE) $(modbuiltin)=dir
 modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
 
+###
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=
+# Usage:
+# $(Q)$(MAKE) $(dtbinst)=dir
+dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj
+
+###
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
+# Usage:
+# $(Q)$(MAKE) $(clean)=dir
+clean := -f $(srctree)/scripts/Makefile.clean obj
+
+###
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=
+# Usage:
+# $(Q)$(MAKE) $(hdr-inst)=dir
+hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
+
 # Prefix -I with $(srctree) if it is not an absolute path.
 # skip if -I has no parameter
 addtree = $(if $(patsubst -I%,%,$(1)), \
index 36bfa17b47e66a15a26f08dfd8e3997a89cba53a..d668982cc1dd22b7965fa10d595183ea153a1df6 100644 (file)
@@ -107,6 +107,7 @@ include/config.h: scripts/Makefile.autoconf create_symlink FORCE
 # Otherwise, create a symbolic link to arch/$(ARCH)/include/asm/arch-$(SOC).
 PHONY += create_symlink
 create_symlink:
+ifdef CONFIG_CREATE_ARCH_SYMLINK
 ifneq ($(KBUILD_SRC),)
        $(Q)mkdir -p include/asm
        $(Q)if [ -d $(KBUILD_SRC)/arch/$(ARCH)/mach-$(SOC)/include/mach ]; then \
@@ -123,6 +124,7 @@ else
        fi;                                                             \
        ln -fsn $$dest arch/$(ARCH)/include/asm/arch
 endif
+endif
 
 PHONY += FORCE
 FORCE:
index ac0554eeae170bd78ff9187ea54ad0f66ec88e52..de818aec8c50ee5ef45db3f501049e09d07a0751 100644 (file)
@@ -253,8 +253,9 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH
        "$(if $(part-of-module),1,0)" "$(@)";
 recordmcount_source := $(srctree)/scripts/recordmcount.pl
 endif
-cmd_record_mcount =                                            \
-       if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then    \
+cmd_record_mcount =                                            \
+       if [ "$(findstring $(CC_FLAGS_FTRACE),$(_c_flags))" =   \
+            "$(CC_FLAGS_FTRACE)" ]; then                       \
                $(sub_cmd_record_mcount)                        \
        fi;
 endif
index 21e1f21531fd5b9a496f830ff21fefd2baf2f62b..4853631b1c8d0b1e03d16a06ea99d54287d87b33 100644 (file)
@@ -7,10 +7,7 @@ src := $(obj)
 PHONY := __clean
 __clean:
 
-# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
-# Usage:
-# $(Q)$(MAKE) $(clean)=dir
-clean := -f $(srctree)/scripts/Makefile.clean obj
+include scripts/Kbuild.include
 
 # The filename Kbuild has precedence over Makefile
 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
@@ -50,19 +47,19 @@ __clean-files       := $(extra-y) $(extra-m) $(extra-)       \
 
 __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
 
-# as clean-files is given relative to the current directory, this adds
-# a $(obj) prefix, except for absolute paths
+# clean-files is given relative to the current directory, unless it
+# starts with $(objtree)/ (which means "./", so do not add "./" unless
+# you want to delete a file from the toplevel object directory).
 
 __clean-files   := $(wildcard                                               \
-                   $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \
-                  $(filter /%, $(__clean-files)))
+                  $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \
+                  $(filter $(objtree)/%, $(__clean-files)))
 
-# as clean-dirs is given relative to the current directory, this adds
-# a $(obj) prefix, except for absolute paths
+# same as clean-files
 
 __clean-dirs    := $(wildcard                                               \
-                   $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs)))    \
-                  $(filter /%, $(clean-dirs)))
+                  $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs)))    \
+                  $(filter $(objtree)/%, $(clean-dirs)))
 
 # ==========================================================================
 
@@ -78,9 +75,6 @@ ifneq ($(strip $(__clean-files)),)
 endif
 ifneq ($(strip $(__clean-dirs)),)
        +$(call cmd,cleandir)
-endif
-ifneq ($(strip $(clean-rule)),)
-       +$(clean-rule)
 endif
        @:
 
@@ -96,11 +90,6 @@ PHONY += $(subdir-ymn)
 $(subdir-ymn):
        $(Q)$(MAKE) $(clean)=$@
 
-# If quiet is set, only print short version of command
-
-cmd = @$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
-
-
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.
 
index 8731fc64b4e0319d6d8c69c8b12fe8dff8079978..84915d7e51dc6dfe1c77ef9e8484beb26c7a4c8f 100644 (file)
@@ -119,6 +119,16 @@ _c_flags += $(if $(patsubst n%,, \
                $(CFLAGS_GCOV))
 endif
 
+#
+# Enable address sanitizer flags for kernel except some files or directories
+# we don't want to check (depends on variables KASAN_SANITIZE_obj.o, KASAN_SANITIZE)
+#
+ifeq ($(CONFIG_KASAN),y)
+_c_flags += $(if $(patsubst n%,, \
+               $(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \
+               $(CFLAGS_KASAN))
+endif
+
 # If building the kernel in a separate objtree expand all occurrences
 # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
 
@@ -274,7 +284,8 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 
 quiet_cmd_dtc = DTC     $@
 # Modified for U-Boot
-cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
+       $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
        $(DTC) -O dtb -o $@ -b 0 \
                -i $(dir $<) $(DTC_FLAGS) \
                -d $(depfile).dtc.tmp $(dtc-tmp) ; \
@@ -285,18 +296,6 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
 
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
 
-# Helper targets for Installing DTBs into the boot directory
-quiet_cmd_dtb_install =        INSTALL $<
-      cmd_dtb_install =        cp $< $(2)
-
-_dtbinst_pre_:
-       $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
-       $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
-       $(Q)mkdir -p $(INSTALL_DTBS_PATH)
-
-%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_
-       $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
-
 # Bzip2
 # ---------------------------------------------------------------------------
 
index ff4ce6e92cb4aa7003117f2e759b1ba8eeb68911..46ddf2d6bd37bc2dbbe9a08be8d8222af468d1d0 100644 (file)
@@ -2,7 +2,7 @@
 # Kernel configuration targets
 # These targets are used from top-level makefile
 
-PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
+PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \
        localmodconfig localyesconfig
 
 # Added for U-Boot
@@ -17,30 +17,31 @@ else
 Kconfig := Kconfig
 endif
 
+ifeq ($(quiet),silent_)
+silent := -s
+endif
+
 # We need this, in case the user has it in its environment
 unexport CONFIG_
 
 xconfig: $(obj)/qconf
-       $< $(Kconfig)
+       $< $(silent) $(Kconfig)
 
 gconfig: $(obj)/gconf
-       $< $(Kconfig)
+       $< $(silent) $(Kconfig)
 
 menuconfig: $(obj)/mconf
-       $< $(Kconfig)
+       $< $(silent) $(Kconfig)
 
 config: $(obj)/conf
-       $< --oldaskconfig $(Kconfig)
+       $< $(silent) --oldaskconfig $(Kconfig)
 
 nconfig: $(obj)/nconf
-       $< $(Kconfig)
-
-oldconfig: $(obj)/conf
-       $< --$@ $(Kconfig)
+       $< $(silent) $(Kconfig)
 
 silentoldconfig: $(obj)/conf
        $(Q)mkdir -p include/config include/generated
-       $< --$@ $(Kconfig)
+       $< $(silent) --$@ $(Kconfig)
 
 localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
        $(Q)mkdir -p include/config include/generated
@@ -49,18 +50,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
                        cmp -s .tmp.config .config ||                   \
                        (mv -f .config .config.old.1;                   \
                         mv -f .tmp.config .config;                     \
-                        $(obj)/conf --silentoldconfig $(Kconfig);      \
+                        $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
                         mv -f .config.old.1 .config.old)               \
        else                                                            \
                        mv -f .tmp.config .config;                      \
-                       $(obj)/conf --silentoldconfig $(Kconfig);       \
+                       $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
        fi
        $(Q)rm -f .tmp.config
 
 # Create new linux.pot file
 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
 update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
-       $(Q)echo "  GEN     config.pot"
+       $(Q)$(kecho) "  GEN     config.pot"
        $(Q)xgettext --default-domain=linux                         \
            --add-comments --keyword=_ --keyword=N_                 \
            --from-code=UTF-8                                       \
@@ -71,65 +72,62 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
        $(Q)(for i in `ls $(srctree)/arch/*/Kconfig      \
            $(srctree)/arch/*/um/Kconfig`;               \
            do                                           \
-               echo "  GEN     $$i";                    \
+               $(kecho) "  GEN     $$i";                    \
                $(obj)/kxgettext $$i                     \
                     >> $(obj)/config.pot;               \
            done )
-       $(Q)echo "  GEN     linux.pot"
+       $(Q)$(kecho) "  GEN     linux.pot"
        $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
            --output $(obj)/linux.pot
        $(Q)rm -f $(obj)/config.pot
 
-PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
+# These targets map 1:1 to the commandline options of 'conf'
+simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
+       alldefconfig randconfig listnewconfig olddefconfig
+PHONY += $(simple-targets)
 
-allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
-       $< --$@ $(Kconfig)
+$(simple-targets): $(obj)/conf
+       $< $(silent) --$@ $(Kconfig)
 
-PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
-
-listnewconfig olddefconfig: $(obj)/conf
-       $< --$@ $(Kconfig)
+PHONY += oldnoconfig savedefconfig defconfig
 
 # oldnoconfig is an alias of olddefconfig, because people already are dependent
 # on its behavior(sets new symbols to their default value but not 'n') with the
 # counter-intuitive name.
-oldnoconfig: $(obj)/conf
-       $< --olddefconfig $(Kconfig)
+oldnoconfig: olddefconfig
 
 savedefconfig: $(obj)/conf
-       $< --$@=defconfig $(Kconfig)
+       $< $(silent) --$@=defconfig $(Kconfig)
 
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
-       $< --defconfig $(Kconfig)
+       $< $(silent) --defconfig $(Kconfig)
 else
-       @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
-       $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+       @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+       $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
 endif
 
 %_defconfig: $(obj)/conf
-       $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
+       $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Added for U-Boot (backward compatibility)
 %_config: %_defconfig
        @:
 
-configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
+configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
 
-define mergeconfig
-$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
-$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
-$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
-$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
-endef
+%.config: $(obj)/conf
+       $(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
+       +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
 
 PHONY += kvmconfig
-kvmconfig:
-       $(call mergeconfig,kvm_guest)
+kvmconfig: kvm_guest.config
+       @:
 
 PHONY += tinyconfig
-tinyconfig: allnoconfig
-       $(call mergeconfig,tiny)
+tinyconfig:
+       $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
 
 # Help text used by make help
 help:
@@ -231,7 +229,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
 
 # QT needs some extra effort...
 $(obj)/.tmp_qtcheck:
-       @set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
+       @set -e; $(kecho) "  CHECK   qt"; dir=""; pkg=""; \
        if ! pkg-config --exists QtCore 2> /dev/null; then \
            echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
            pkg-config --exists qt 2> /dev/null && pkg=qt; \
index fef75fc756f40bfa5ae89c942e49f80719204bb9..6c204318bc942dca084224ffa1b9c913b58b5e3a 100644 (file)
@@ -471,7 +471,7 @@ static struct option long_opts[] = {
 static void conf_usage(const char *progname)
 {
 
-       printf("Usage: %s [option] <kconfig-file>\n", progname);
+       printf("Usage: %s [-s] [option] <kconfig-file>\n", progname);
        printf("[option] is _one_ of the following:\n");
        printf("  --listnewconfig         List new options\n");
        printf("  --oldaskconfig          Start a new configuration using a line-oriented program\n");
@@ -501,7 +501,11 @@ int main(int ac, char **av)
 
        tty_stdio = isatty(0) && isatty(1) && isatty(2);
 
-       while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
+       while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
+               if (opt == 's') {
+                       conf_set_message_callback(NULL);
+                       continue;
+               }
                input_mode = (enum input_mode)opt;
                switch (opt) {
                case silentoldconfig:
index 2f778df206f5b4e19b959c9044ab78afd5de40a6..9847ae6c894633ca824fdab144ee9d7a4da8d2bb 100644 (file)
 
 #include "lkc.h"
 
+struct conf_printer {
+       void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
+       void (*print_comment)(FILE *, const char *, void *);
+};
+
 static void conf_warning(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
 
@@ -59,6 +64,7 @@ static void conf_message(const char *fmt, ...)
        va_start(ap, fmt);
        if (conf_message_callback)
                conf_message_callback(fmt, ap);
+       va_end(ap);
 }
 
 const char *conf_get_configname(void)
index d6626521f9b9ab9d166fcb9e916a6ea5bc8a7eba..fb0a2a286dca6a8b0cc0c74deb5d23096be096c3 100644 (file)
 
 #define DEBUG_EXPR     0
 
+static int expr_eq(struct expr *e1, struct expr *e2);
+static struct expr *expr_eliminate_yn(struct expr *e);
+static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
+static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
+static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
+
 struct expr *expr_alloc_symbol(struct symbol *sym)
 {
        struct expr *e = xcalloc(1, sizeof(*e));
@@ -186,7 +192,7 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
 #undef e1
 #undef e2
 
-int expr_eq(struct expr *e1, struct expr *e2)
+static int expr_eq(struct expr *e1, struct expr *e2)
 {
        int res, old_count;
 
@@ -228,7 +234,7 @@ int expr_eq(struct expr *e1, struct expr *e2)
        return 0;
 }
 
-struct expr *expr_eliminate_yn(struct expr *e)
+static struct expr *expr_eliminate_yn(struct expr *e)
 {
        struct expr *tmp;
 
@@ -823,7 +829,7 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
        return false;
 }
 
-struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
+static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
 {
        struct expr *tmp = NULL;
        expr_extract_eq(E_AND, &tmp, ep1, ep2);
@@ -834,7 +840,7 @@ struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
        return tmp;
 }
 
-struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
+static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
 {
        struct expr *tmp = NULL;
        expr_extract_eq(E_OR, &tmp, ep1, ep2);
@@ -845,7 +851,7 @@ struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
        return tmp;
 }
 
-void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
+static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
 {
 #define e1 (*ep1)
 #define e2 (*ep2)
@@ -976,11 +982,8 @@ tristate expr_calc_value(struct expr *e)
        }
 }
 
-int expr_compare_type(enum expr_type t1, enum expr_type t2)
+static int expr_compare_type(enum expr_type t1, enum expr_type t2)
 {
-#if 0
-       return 1;
-#else
        if (t1 == t2)
                return 0;
        switch (t1) {
@@ -1005,7 +1008,6 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2)
        }
        printf("[%dgt%d?]", t1, t2);
        return 0;
-#endif
 }
 
 static inline struct expr *
index 412ea8a2abb8b80c6f0a889e2fb9d7b55bf0bafa..a2fc96a2bd2cf84115b8009b097ea772ab53dcdf 100644 (file)
@@ -205,18 +205,13 @@ struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
 struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
 struct expr *expr_copy(const struct expr *org);
 void expr_free(struct expr *e);
-int expr_eq(struct expr *e1, struct expr *e2);
 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);
 tristate expr_calc_value(struct expr *e);
-struct expr *expr_eliminate_yn(struct expr *e);
 struct expr *expr_trans_bool(struct expr *e);
 struct expr *expr_eliminate_dups(struct expr *e);
 struct expr *expr_transform(struct expr *e);
 int expr_contains_symbol(struct expr *dep, struct symbol *sym);
 bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
-struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
-struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
-void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
 struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2);
 
index d0a35b21f3087283c286885c26caa58630925231..26d208b435a0d347b8f11df13bcb79cf3618770c 100644 (file)
@@ -169,14 +169,6 @@ void init_main_window(const gchar * glade_file)
        style = gtk_widget_get_style(main_wnd);
        widget = glade_xml_get_widget(xml, "toolbar1");
 
-#if 0  /* Use stock Gtk icons instead */
-       replace_button_icon(xml, main_wnd->window, style,
-                           "button1", (gchar **) xpm_back);
-       replace_button_icon(xml, main_wnd->window, style,
-                           "button2", (gchar **) xpm_load);
-       replace_button_icon(xml, main_wnd->window, style,
-                           "button3", (gchar **) xpm_save);
-#endif
        replace_button_icon(xml, main_wnd->window, style,
                            "button4", (gchar **) xpm_single_view);
        replace_button_icon(xml, main_wnd->window, style,
@@ -184,22 +176,6 @@ void init_main_window(const gchar * glade_file)
        replace_button_icon(xml, main_wnd->window, style,
                            "button6", (gchar **) xpm_tree_view);
 
-#if 0
-       switch (view_mode) {
-       case SINGLE_VIEW:
-               widget = glade_xml_get_widget(xml, "button4");
-               g_signal_emit_by_name(widget, "clicked");
-               break;
-       case SPLIT_VIEW:
-               widget = glade_xml_get_widget(xml, "button5");
-               g_signal_emit_by_name(widget, "clicked");
-               break;
-       case FULL_VIEW:
-               widget = glade_xml_get_widget(xml, "button6");
-               g_signal_emit_by_name(widget, "clicked");
-               break;
-       }
-#endif
        txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
        tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
                                          "foreground", "red",
@@ -1498,9 +1474,12 @@ int main(int ac, char *av[])
                case 'a':
                        //showAll = 1;
                        break;
+               case 's':
+                       conf_set_message_callback(NULL);
+                       break;
                case 'h':
                case '?':
-                       printf("%s <config>\n", av[0]);
+                       printf("%s [-s] <config>\n", av[0]);
                        exit(0);
                }
                name = av[2];
index 685d80e1bb0e77de75a97a2ada22991131597b58..2cf23f002d3f48f6b51ac9898fde7681ea39cf53 100644 (file)
@@ -34,7 +34,7 @@ struct list_head {
  * list_entry - get the struct for this entry
  * @ptr:       the &struct list_head pointer.
  * @type:      the type of the struct this is embedded in.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_entry(ptr, type, member) \
        container_of(ptr, type, member)
@@ -43,7 +43,7 @@ struct list_head {
  * list_for_each_entry -       iterate over list of given type
  * @pos:       the type * to use as a loop cursor.
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_for_each_entry(pos, head, member)                         \
        for (pos = list_entry((head)->next, typeof(*pos), member);      \
@@ -55,7 +55,7 @@ struct list_head {
  * @pos:       the type * to use as a loop cursor.
  * @n:         another type * to use as temporary storage
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_for_each_entry_safe(pos, n, head, member)                 \
        for (pos = list_entry((head)->next, typeof(*pos), member),      \
index d5daa7af8b496e89143b3fd222fc3c35e7eeb748..91ca126ea0802e40278bbbf09b3413ce59c1bc15 100644 (file)
@@ -21,9 +21,7 @@ static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c;
 extern "C" {
 #endif
 
-#define P(name,type,arg)       extern type name arg
 #include "lkc_proto.h"
-#undef P
 
 #define SRCTREE "srctree"
 
@@ -70,9 +68,6 @@ struct kconf_id {
        enum symbol_type stype;
 };
 
-extern int zconfdebug;
-
-int zconfparse(void);
 void zconfdump(FILE *out);
 void zconf_starthelp(void);
 FILE *zconf_fopen(const char *name);
@@ -90,11 +85,6 @@ void sym_add_change_count(int count);
 bool conf_set_all_new_symbols(enum conf_def_mode mode);
 void set_all_choice_values(struct symbol *csym);
 
-struct conf_printer {
-       void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
-       void (*print_comment)(FILE *, const char *, void *);
-};
-
 /* confdata.c and expr.c */
 static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
 {
@@ -113,7 +103,6 @@ void menu_add_entry(struct symbol *sym);
 void menu_end_entry(void);
 void menu_add_dep(struct expr *dep);
 void menu_add_visibility(struct expr *dep);
-struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
@@ -137,7 +126,6 @@ struct gstr {
        int max_width;
 };
 struct gstr str_new(void);
-struct gstr str_assign(const char *s);
 void str_free(struct gstr *gs);
 void str_append(struct gstr *gs, const char *s);
 void str_printf(struct gstr *gs, const char *fmt, ...);
@@ -148,8 +136,6 @@ extern struct expr *sym_env_list;
 
 void sym_init(void);
 void sym_clear_all_valid(void);
-void sym_set_all_changed(void);
-void sym_set_changed(struct symbol *sym);
 struct symbol *sym_choice_default(struct symbol *sym);
 const char *sym_get_string_default(struct symbol *sym);
 struct symbol *sym_check_deps(struct symbol *sym);
index ecdb9659b67d245da75eb60c82d3f4c070d1d68b..d5398718ec2ae3337dac3cb3d19654c8508c3007 100644 (file)
@@ -1,57 +1,52 @@
 #include <stdarg.h>
 
 /* confdata.c */
-P(conf_parse,void,(const char *name));
-P(conf_read,int,(const char *name));
-P(conf_read_simple,int,(const char *name, int));
-P(conf_write_defconfig,int,(const char *name));
-P(conf_write,int,(const char *name));
-P(conf_write_autoconf,int,(void));
-P(conf_get_changed,bool,(void));
-P(conf_set_changed_callback, void,(void (*fn)(void)));
-P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap)));
+void conf_parse(const char *name);
+int conf_read(const char *name);
+int conf_read_simple(const char *name, int);
+int conf_write_defconfig(const char *name);
+int conf_write(const char *name);
+int conf_write_autoconf(void);
+bool conf_get_changed(void);
+void conf_set_changed_callback(void (*fn)(void));
+void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap));
 
 /* menu.c */
-P(rootmenu,struct menu,);
+extern struct menu rootmenu;
 
-P(menu_is_empty, bool, (struct menu *menu));
-P(menu_is_visible, bool, (struct menu *menu));
-P(menu_has_prompt, bool, (struct menu *menu));
-P(menu_get_prompt,const char *,(struct menu *menu));
-P(menu_get_root_menu,struct menu *,(struct menu *menu));
-P(menu_get_parent_menu,struct menu *,(struct menu *menu));
-P(menu_has_help,bool,(struct menu *menu));
-P(menu_get_help,const char *,(struct menu *menu));
-P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head
-                        *head));
-P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head
-                                  *head));
-P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
+bool menu_is_empty(struct menu *menu);
+bool menu_is_visible(struct menu *menu);
+bool menu_has_prompt(struct menu *menu);
+const char * menu_get_prompt(struct menu *menu);
+struct menu * menu_get_root_menu(struct menu *menu);
+struct menu * menu_get_parent_menu(struct menu *menu);
+bool menu_has_help(struct menu *menu);
+const char * menu_get_help(struct menu *menu);
+struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
+void menu_get_ext_help(struct menu *menu, struct gstr *help);
 
 /* symbol.c */
-P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
+extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
 
-P(sym_lookup,struct symbol *,(const char *name, int flags));
-P(sym_find,struct symbol *,(const char *name));
-P(sym_expand_string_value,const char *,(const char *in));
-P(sym_escape_string_value, const char *,(const char *in));
-P(sym_re_search,struct symbol **,(const char *pattern));
-P(sym_type_name,const char *,(enum symbol_type type));
-P(sym_calc_value,void,(struct symbol *sym));
-P(sym_get_type,enum symbol_type,(struct symbol *sym));
-P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri));
-P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri));
-P(sym_toggle_tristate_value,tristate,(struct symbol *sym));
-P(sym_string_valid,bool,(struct symbol *sym, const char *newval));
-P(sym_string_within_range,bool,(struct symbol *sym, const char *str));
-P(sym_set_string_value,bool,(struct symbol *sym, const char *newval));
-P(sym_is_changable,bool,(struct symbol *sym));
-P(sym_get_choice_prop,struct property *,(struct symbol *sym));
-P(sym_get_default_prop,struct property *,(struct symbol *sym));
-P(sym_get_string_value,const char *,(struct symbol *sym));
+struct symbol * sym_lookup(const char *name, int flags);
+struct symbol * sym_find(const char *name);
+const char * sym_expand_string_value(const char *in);
+const char * sym_escape_string_value(const char *in);
+struct symbol ** sym_re_search(const char *pattern);
+const char * sym_type_name(enum symbol_type type);
+void sym_calc_value(struct symbol *sym);
+enum symbol_type sym_get_type(struct symbol *sym);
+bool sym_tristate_within_range(struct symbol *sym,tristate tri);
+bool sym_set_tristate_value(struct symbol *sym,tristate tri);
+tristate sym_toggle_tristate_value(struct symbol *sym);
+bool sym_string_valid(struct symbol *sym, const char *newval);
+bool sym_string_within_range(struct symbol *sym, const char *str);
+bool sym_set_string_value(struct symbol *sym, const char *newval);
+bool sym_is_changable(struct symbol *sym);
+struct property * sym_get_choice_prop(struct symbol *sym);
+const char * sym_get_string_value(struct symbol *sym);
 
-P(prop_get_type_name,const char *,(enum prop_type type));
+const char * prop_get_type_name(enum prop_type type);
 
 /* expr.c */
-P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2));
-P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken));
+void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
index 9d2a4c585ee18526f4f141988f965852c2765e73..5075ebf2d3b995bee04c146d942abce4515b4559 100755 (executable)
@@ -21,7 +21,11 @@ ldflags()
 # Where is ncurses.h?
 ccflags()
 {
-       if [ -f /usr/include/ncursesw/curses.h ]; then
+       if pkg-config --cflags ncursesw 2>/dev/null; then
+               echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
+       elif pkg-config --cflags ncurses 2>/dev/null; then
+               echo '-DCURSES_LOC="<ncurses.h>"'
+       elif [ -f /usr/include/ncursesw/curses.h ]; then
                echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
                echo ' -DNCURSES_WIDECHAR=1'
        elif [ -f /usr/include/ncurses/ncurses.h ]; then
index 14cea7463a621b33c6c0b8487781db107d764841..315ce2c7cb9dbc48b545329ee144c27e569d5c81 100644 (file)
@@ -279,6 +279,7 @@ static int child_count;
 static int single_menu_mode;
 static int show_all_options;
 static int save_and_exit;
+static int silent;
 
 static void conf(struct menu *menu, struct menu *active_menu);
 static void conf_choice(struct menu *menu);
@@ -330,10 +331,10 @@ static void set_subtitle(void)
        list_for_each_entry(sp, &trail, entries) {
                if (sp->text) {
                        if (pos) {
-                               pos->next = xcalloc(sizeof(*pos), 1);
+                               pos->next = xcalloc(1, sizeof(*pos));
                                pos = pos->next;
                        } else {
-                               subtitles = pos = xcalloc(sizeof(*pos), 1);
+                               subtitles = pos = xcalloc(1, sizeof(*pos));
                        }
                        pos->text = sp->text;
                }
@@ -777,10 +778,12 @@ static void conf_message_callback(const char *fmt, va_list ap)
        char buf[PATH_MAX+1];
 
        vsnprintf(buf, sizeof(buf), fmt, ap);
-       if (save_and_exit)
-               printf("%s", buf);
-       else
+       if (save_and_exit) {
+               if (!silent)
+                       printf("%s", buf);
+       } else {
                show_textbox(NULL, buf, 6, 60);
+       }
 }
 
 static void show_help(struct menu *menu)
@@ -977,16 +980,18 @@ static int handle_exit(void)
                }
                /* fall through */
        case -1:
-               printf(_("\n\n"
-                        "*** End of the configuration.\n"
-                        "*** Execute 'make' to start the build or try 'make help'."
-                        "\n\n"));
+               if (!silent)
+                       printf(_("\n\n"
+                                "*** End of the configuration.\n"
+                                "*** Execute 'make' to start the build or try 'make help'."
+                                "\n\n"));
                res = 0;
                break;
        default:
-               fprintf(stderr, _("\n\n"
-                                 "Your configuration changes were NOT saved."
-                                 "\n\n"));
+               if (!silent)
+                       fprintf(stderr, _("\n\n"
+                                         "Your configuration changes were NOT saved."
+                                         "\n\n"));
                if (res != KEY_ESC)
                        res = 0;
        }
@@ -1010,6 +1015,12 @@ int main(int ac, char **av)
 
        signal(SIGINT, sig_handler);
 
+       if (ac > 1 && strcmp(av[1], "-s") == 0) {
+               silent = 1;
+               /* Silence conf_read() until the real callback is set up */
+               conf_set_message_callback(NULL);
+               av++;
+       }
        conf_parse(av[1]);
        conf_read(NULL);
 
index 72c9dba84c5dbd46cb8ae2824a85d54603dbaafe..b05cc3d4a9bea0fff7e4902e848372bb587be5cb 100644 (file)
@@ -125,7 +125,7 @@ void menu_set_type(int type)
                sym_type_name(sym->type), sym_type_name(type));
 }
 
-struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
+static struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
 {
        struct property *prop = prop_alloc(type, current_entry->sym);
 
@@ -615,7 +615,7 @@ static struct property *get_symbol_prop(struct symbol *sym)
 /*
  * head is optional and may be NULL
  */
-void get_symbol_str(struct gstr *r, struct symbol *sym,
+static void get_symbol_str(struct gstr *r, struct symbol *sym,
                    struct list_head *head)
 {
        bool hit;
index efa4733461981131ef385244ca30ed48a35f303f..ec8e20350a648ca0f47f152f9650f6fa6e421a0b 100755 (executable)
@@ -35,7 +35,7 @@ usage() {
        echo "  -O    dir to put generated output files"
 }
 
-MAKE=true
+RUNMAKE=true
 ALLTARGET=alldefconfig
 WARNREDUN=false
 OUTPUT=.
@@ -48,7 +48,7 @@ while true; do
                continue
                ;;
        "-m")
-               MAKE=false
+               RUNMAKE=false
                shift
                continue
                ;;
@@ -77,9 +77,19 @@ while true; do
        esac
 done
 
+if [ "$#" -lt 2 ] ; then
+       usage
+       exit
+fi
+
 INITFILE=$1
 shift;
 
+if [ ! -r "$INITFILE" ]; then
+       echo "The base file '$INITFILE' does not exist.  Exit." >&2
+       exit 1
+fi
+
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
@@ -93,25 +103,23 @@ for MERGE_FILE in $MERGE_LIST ; do
        CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
 
        for CFG in $CFG_LIST ; do
-               grep -q -w $CFG $TMP_FILE
-               if [ $? -eq 0 ] ; then
-                       PREV_VAL=$(grep -w $CFG $TMP_FILE)
-                       NEW_VAL=$(grep -w $CFG $MERGE_FILE)
-                       if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
+               grep -q -w $CFG $TMP_FILE || continue
+               PREV_VAL=$(grep -w $CFG $TMP_FILE)
+               NEW_VAL=$(grep -w $CFG $MERGE_FILE)
+               if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
                        echo Value of $CFG is redefined by fragment $MERGE_FILE:
                        echo Previous  value: $PREV_VAL
                        echo New value:       $NEW_VAL
                        echo
-                       elif [ "$WARNREDUN" = "true" ]; then
+               elif [ "$WARNREDUN" = "true" ]; then
                        echo Value of $CFG is redundant by fragment $MERGE_FILE:
-                       fi
-                       sed -i "/$CFG[ =]/d" $TMP_FILE
                fi
+               sed -i "/$CFG[ =]/d" $TMP_FILE
        done
        cat $MERGE_FILE >> $TMP_FILE
 done
 
-if [ "$MAKE" = "false" ]; then
+if [ "$RUNMAKE" = "false" ]; then
        cp $TMP_FILE $OUTPUT/.config
        echo "#"
        echo "# merged configuration written to $OUTPUT/.config (needs make)"
index 984489ef2b46e12549eedd74a2d8691ba0589489..d42d534a66cd7006a38e113b4b5b8e30359e7a76 100644 (file)
@@ -1482,6 +1482,11 @@ int main(int ac, char **av)
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
 
+       if (ac > 1 && strcmp(av[1], "-s") == 0) {
+               /* Silence conf_read() until the real callback is set up */
+               conf_set_message_callback(NULL);
+               av++;
+       }
        conf_parse(av[1]);
        conf_read(NULL);
 
index 9d3b04b0769cbef51bfdcfcc75ac60cc2e1b67d1..c3bb7fe8dfa68322bff34481b3de72b9ad2b2b3f 100644 (file)
@@ -1746,7 +1746,7 @@ static const char *progname;
 
 static void usage(void)
 {
-       printf(_("%s <config>\n"), progname);
+       printf(_("%s [-s] <config>\n"), progname);
        exit(0);
 }
 
@@ -1762,6 +1762,9 @@ int main(int ac, char** av)
        configApp = new QApplication(ac, av);
        if (ac > 1 && av[1][0] == '-') {
                switch (av[1][1]) {
+               case 's':
+                       conf_set_message_callback(NULL);
+                       break;
                case 'h':
                case '?':
                        usage();
index ab339ebbe30b72ff02d6603598501d8f3cad1c8d..550e1d743140f2a325730ee8cb1ed48d79569713 100644 (file)
@@ -112,7 +112,7 @@ struct property *sym_get_env_prop(struct symbol *sym)
        return NULL;
 }
 
-struct property *sym_get_default_prop(struct symbol *sym)
+static struct property *sym_get_default_prop(struct symbol *sym)
 {
        struct property *prop;
 
@@ -186,6 +186,26 @@ static void sym_validate_range(struct symbol *sym)
        sym->curr.val = strdup(str);
 }
 
+static void sym_set_changed(struct symbol *sym)
+{
+       struct property *prop;
+
+       sym->flags |= SYMBOL_CHANGED;
+       for (prop = sym->prop; prop; prop = prop->next) {
+               if (prop->menu)
+                       prop->menu->flags |= MENU_CHANGED;
+       }
+}
+
+static void sym_set_all_changed(void)
+{
+       struct symbol *sym;
+       int i;
+
+       for_all_symbols(i, sym)
+               sym_set_changed(sym);
+}
+
 static void sym_calc_visibility(struct symbol *sym)
 {
        struct property *prop;
@@ -451,26 +471,6 @@ void sym_clear_all_valid(void)
                sym_calc_value(modules_sym);
 }
 
-void sym_set_changed(struct symbol *sym)
-{
-       struct property *prop;
-
-       sym->flags |= SYMBOL_CHANGED;
-       for (prop = sym->prop; prop; prop = prop->next) {
-               if (prop->menu)
-                       prop->menu->flags |= MENU_CHANGED;
-       }
-}
-
-void sym_set_all_changed(void)
-{
-       struct symbol *sym;
-       int i;
-
-       for_all_symbols(i, sym)
-               sym_set_changed(sym);
-}
-
 bool sym_tristate_within_range(struct symbol *sym, tristate val)
 {
        int type = sym_get_type(sym);
index 94f9c83e324f4a72b79b6fbf8ca6b3999d046702..0e76042473ccd3633aa0870da3cce23e0b1788c6 100644 (file)
@@ -88,16 +88,6 @@ struct gstr str_new(void)
        return gs;
 }
 
-/* Allocate and assign growable string */
-struct gstr str_assign(const char *s)
-{
-       struct gstr gs;
-       gs.s = strdup(s);
-       gs.len = strlen(s) + 1;
-       gs.max_width = 0;
-       return gs;
-}
-
 /* Free storage for growable string */
 void str_free(struct gstr *gs)
 {
index 9bc9fecf7b52cf5b67dd7b51c20dd34e5f62da4f..eb1a27e36d4b7bd319ebdada7e4c467e76601d55 100644 (file)
@@ -11,7 +11,6 @@
 /mkenvimage
 /mkimage
 /mkexynosspl
-/mpc86x_clk
 /mxsboot
 /mksunxiboot
 /ncb
index db55bcfab1919f614859e1b06de52382bd7ed8f3..f673258bad5730adda711ec330439d3783d4cb33 100644 (file)
@@ -167,10 +167,6 @@ HOSTCFLAGS_md5.o := -pedantic
 HOSTCFLAGS_sha1.o := -pedantic
 HOSTCFLAGS_sha256.o := -pedantic
 
-# Don't build by default
-#hostprogs-$(CONFIG_PPC) += mpc86x_clk
-#HOSTCFLAGS_mpc86x_clk.o := -pedantic
-
 quiet_cmd_wrap = WRAP    $@
 cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@
 
index 8ecdd8f8541928d06b68784a4017ed028737c64e..10c7135b5f257f69cd7498a41d000b2450311ff2 100644 (file)
@@ -318,7 +318,7 @@ settings file to find them.
 To make this easier, buildman can automatically download and install
 toolchains from kernel.org. First list the available architectures:
 
-$ ./tools/buildman/buildman sandbox --fetch-arch list
+$ ./tools/buildman/buildman --fetch-arch list
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.2/
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.1/
@@ -329,7 +329,7 @@ sparc sparc64 tilegx x86_64 xtensa
 
 Then pick one and download it:
 
-$ ./tools/buildman/buildman sandbox --fetch-arch or32
+$ ./tools/buildman/buildman --fetch-arch or32
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.3/
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.2/
 Checking: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.1/
index cf5c0d4393b0937b55bb684023a43a2c0d62f9cd..18940af5b532a1a0e3c6e6d28dc027e48f05b836 100644 (file)
@@ -88,6 +88,9 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
                                struct image_tool_params *params)
 {
        uint32_t checksum;
+       char *source_date_epoch;
+       struct tm *time_universal;
+       time_t time;
 
        image_header_t * hdr = (image_header_t *)ptr;
 
@@ -96,9 +99,25 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
                                sizeof(image_header_t)),
                        sbuf->st_size - sizeof(image_header_t));
 
+       source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+       if (source_date_epoch != NULL) {
+               time = (time_t) strtol(source_date_epoch, NULL, 10);
+
+               time_universal = gmtime(&time);
+               if (time_universal == NULL) {
+                       fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
+                               __func__);
+                       time = 0;
+               } else {
+                       time = mktime(time_universal);
+               }
+       } else {
+               time = sbuf->st_mtime;
+       }
+
        /* Build new header */
        image_set_magic(hdr, IH_MAGIC);
-       image_set_time(hdr, sbuf->st_mtime);
+       image_set_time(hdr, time);
        image_set_size(hdr, sbuf->st_size - sizeof(image_header_t));
        image_set_load(hdr, params->addr);
        image_set_ep(hdr, params->ep);
diff --git a/tools/mpc86x_clk.c b/tools/mpc86x_clk.c
deleted file mode 100644 (file)
index 9f662f7..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * (C) Copyright 2003 Intracom S.A.
- * Pantelis Antoniou <panto@intracom.gr>
- *
- * This little program makes an exhaustive search for the
- * correct terms of pdf, mfi, mfn, mfd, s, dbrmo, in PLPRCR.
- * The goal is to produce a gclk2 from a xin input, while respecting
- * all the restrictions on their combination.
- *
- * Generaly you select the first row of the produced table.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define DPREF_MIN       10000000
-#define DPREF_MAX       32000000
-
-#define DPGDCK_MAX     320000000
-#define DPGDCK_MIN     160000000
-
-#define S_MIN          0
-#define S_MAX          2
-
-#define MFI_MIN                5
-#define MFI_MAX                15
-
-#define MFN_MIN                0
-#define MFN_MAX                15
-
-#define MFD_MIN                0
-#define MFD_MAX                31
-
-#define MF_MIN         5
-#define MF_MAX         15
-
-#define PDF_MIN                0
-#define PDF_MAX                15
-
-#define GCLK2_MAX      150000000
-
-static int calculate (int xin, int target_clock,
-                     int ppm, int pdf, int mfi, int mfn, int mfd, int s,
-                     int *dprefp, int *dpgdckp, int *jdbckp,
-                     int *gclk2p, int *dbrmop)
-{
-       unsigned int dpref, dpgdck, jdbck, gclk2, t1, t2, dbrmo;
-
-       /* valid MFI? */
-       if (mfi < MFI_MIN)
-               return -1;
-
-       /* valid num, denum? */
-       if (mfn > 0 && mfn >= mfd)
-               return -1;
-
-       dpref = xin / (pdf + 1);
-
-       /* valid dpef? */
-       if (dpref < DPREF_MIN || dpref > DPREF_MAX)
-               return -1;
-
-       if (mfn == 0) {
-               dpgdck  = (2 * mfi * xin) / (pdf + 1) ;
-               dbrmo = 0;
-       } else {
-               /* 5 <= mfi + (mfn / mfd + 1) <= 15 */
-               t1 = mfd + 1;
-               t2 = mfi * t1 + mfn;
-               if ( MF_MIN * t1 > t2 || MF_MAX * t1 < t2)
-                       return -1;
-
-               dpgdck  = (unsigned int)(2 * (mfi * mfd + mfi + mfn) *
-                               (unsigned int)xin) /
-                               ((mfd + 1) * (pdf + 1));
-
-               dbrmo = 10 * mfn < (mfd + 1);
-       }
-
-       /* valid dpgclk? */
-       if (dpgdck < DPGDCK_MIN || dpgdck > DPGDCK_MAX)
-               return -1;
-
-       jdbck = dpgdck >> s;
-       gclk2 = jdbck / 2;
-
-       /* valid gclk2 */
-       if (gclk2 > GCLK2_MAX)
-               return -1;
-
-       t1 = abs(gclk2 - target_clock);
-
-       /* XXX max 1MHz dev. in clock */
-       if (t1 > 1000000)
-               return -1;
-
-       /* dev within range (XXX gclk2 scaled to avoid overflow) */
-       if (t1 * 1000 > (unsigned int)ppm * (gclk2 / 1000))
-               return -1;
-
-       *dprefp = dpref;
-       *dpgdckp = dpgdck;
-       *jdbckp = jdbck;
-       *gclk2p = gclk2;
-       *dbrmop = dbrmo;
-
-       return gclk2;
-}
-
-int conf_clock(int xin, int target_clock, int ppm)
-{
-       int pdf, s, mfn, mfd, mfi;
-       int dpref, dpgdck, jdbck, gclk2, xout, dbrmo;
-       int found = 0;
-
-       /* integer multipliers */
-       for (pdf = PDF_MIN; pdf <= PDF_MAX; pdf++) {
-               for (mfi = MFI_MIN; mfi <= MFI_MAX; mfi++) {
-                       for (s = 0; s <= S_MAX; s++) {
-                               xout = calculate(xin, target_clock,
-                                                ppm, pdf, mfi, 0, 0, s,
-                                                &dpref, &dpgdck, &jdbck,
-                                                &gclk2, &dbrmo);
-                               if (xout < 0)
-                                       continue;
-
-                               if (found == 0) {
-                                       printf("pdf mfi mfn mfd s dbrmo     dpref    dpgdck     jdbck     gclk2 exact?\n");
-                                       printf("--- --- --- --- - -----     -----    ------     -----     ----- ------\n");
-                               }
-
-                               printf("%3d %3d --- --- %1d %5d %9d %9d %9d %9d%s\n",
-                                       pdf, mfi, s, dbrmo,
-                                       dpref, dpgdck, jdbck, gclk2,
-                                       gclk2 == target_clock ? "    YES" : "");
-
-                               found++;
-                       }
-               }
-       }
-
-       /* fractional multipliers */
-       for (pdf = PDF_MIN; pdf <= PDF_MAX; pdf++) {
-               for (mfi = MFI_MIN; mfi <= MFI_MAX; mfi++) {
-                       for (mfn = 1; mfn <= MFN_MAX; mfn++) {
-                               for (mfd = 1; mfd <= MFD_MAX; mfd++) {
-                                       for (s = 0; s <= S_MAX; s++) {
-                                               xout = calculate(xin, target_clock,
-                                                           ppm, pdf, mfi, mfn, mfd, s,
-                                                           &dpref, &dpgdck, &jdbck,
-                                                           &gclk2, &dbrmo);
-                                               if (xout < 0)
-                                                       continue;
-
-                                               if (found == 0) {
-                                                       printf("pdf mfi mfn mfd s dbrmo     dpref    dpgdck     jdbck     gclk2 exact?\n");
-                                                       printf("--- --- --- --- - -----     -----    ------     -----     ----- ------\n");
-                                               }
-
-                                               printf("%3d %3d %3d %3d %1d %5d %9d %9d %9d %9d%s\n",
-                                                       pdf, mfi, mfn, mfd, s,
-                                                       dbrmo, dpref, dpgdck, jdbck, gclk2,
-                                                       gclk2 == target_clock ? "    YES" : "");
-
-                                               found++;
-                                       }
-                               }
-                       }
-
-               }
-       }
-
-       return found;
-}
-
-int main(int argc, char *argv[])
-{
-       int xin, want_gclk2, found, ppm = 100;
-
-       if (argc < 3) {
-               fprintf(stderr, "usage: mpc86x_clk <xin> <want_gclk2> [ppm]\n");
-               fprintf(stderr, "       default ppm is 100\n");
-               return 10;
-       }
-
-       xin  = atoi(argv[1]);
-       want_gclk2 = atoi(argv[2]);
-       if (argc >= 4)
-               ppm = atoi(argv[3]);
-
-       found = conf_clock(xin, want_gclk2, ppm);
-       if (found <= 0) {
-               fprintf(stderr, "cannot produce gclk2 %d from xin %d\n",
-                       want_gclk2, xin);
-               return EXIT_FAILURE;
-       }
-
-       return EXIT_SUCCESS;
-}
index 27ec90acc80f08bbd0c514a9dccd4cb4fea40d6a..5bd74c4f8338fd4d7edcd8b16dbe61ec03ea6f4f 100644 (file)
@@ -135,6 +135,17 @@ Similar to the above, but skip the first commit and take the next 5. This
 is useful if your top commit is for setting up testing.
 
 
+How to install it
+=================
+
+The most up to date version of patman can be found in the U-boot sources.
+However to use it on other projects it may be more convenient to install it as
+a standalone application. A distutils installer is included, this can be used
+to install patman:
+
+$ cd tools/patman && python setup.py install
+
+
 How to add tags
 ===============
 
diff --git a/tools/patman/__init__.py b/tools/patman/__init__.py
new file mode 100644 (file)
index 0000000..7cbe5fa
--- /dev/null
@@ -0,0 +1,3 @@
+__all__ = ['checkpatch', 'command', 'commit', 'cros_subprocess',
+           'get_maintainer', 'gitutil', 'patchstream', 'project',
+           'series', 'settings', 'terminal', 'test']
index 6c6473e462f044983d6616927c86c87170bd4ea6..e76fc42dd1973108809b9c35f4bb04cc7b793f4d 100755 (executable)
@@ -14,14 +14,18 @@ import sys
 import unittest
 
 # Our modules
-import checkpatch
-import command
-import gitutil
-import patchstream
-import project
-import settings
-import terminal
-import test
+try:
+    from patman import checkpatch, command, gitutil, patchstream, \
+        project, settings, terminal, test
+except ImportError:
+    import checkpatch
+    import command
+    import gitutil
+    import patchstream
+    import project
+    import settings
+    import terminal
+    import test
 
 
 parser = OptionParser()
diff --git a/tools/patman/setup.py b/tools/patman/setup.py
new file mode 100644 (file)
index 0000000..e61804f
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+from distutils.core import setup
+setup(name='patman',
+      version='1.0',
+      license='GPL-2.0+',
+      scripts=['patman'],
+      packages=['patman'],
+      package_dir={'patman': ''},
+      package_data={'patman': ['README']},
+      classifiers=['Environment :: Console',
+                   'Topic :: Software Development'])