Merge git://git.denx.de/u-boot-dm
authorTom Rini <trini@konsulko.com>
Fri, 12 Jun 2015 01:18:52 +0000 (21:18 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jun 2015 01:18:52 +0000 (21:18 -0400)
50 files changed:
arch/arm/Kconfig
arch/arm/cpu/armv7/cpu.c
arch/arm/cpu/armv7/exynos/Kconfig
arch/arm/cpu/armv7/s5pc1xx/Kconfig
arch/arm/dts/Makefile
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/board2.c
arch/sandbox/cpu/cpu.c
common/cmd_bmp.c
common/lcd.c
common/malloc_simple.c
configs/am335x_boneblack_vboot_defconfig
configs/arches_defconfig
configs/canyonlands_defconfig
configs/galileo_defconfig
configs/microblaze-generic_defconfig
configs/odroid_defconfig
configs/origen_defconfig
configs/s5pc210_universal_defconfig
configs/sandbox_defconfig
configs/socfpga_socrates_defconfig
configs/trats2_defconfig
configs/trats_defconfig
configs/zynq_microzed_defconfig
configs/zynq_zc70x_defconfig
configs/zynq_zc770_xm010_defconfig
configs/zynq_zc770_xm012_defconfig
configs/zynq_zc770_xm013_defconfig
configs/zynq_zed_defconfig
configs/zynq_zybo_defconfig
drivers/core/Makefile
drivers/i2c/i2c-uclass-compat.c
drivers/serial/Kconfig
drivers/serial/ns16550.c
drivers/serial/serial-uclass.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/usb-uclass.c
drivers/video/atmel_lcdfb.c
drivers/video/bus_vcxk.c
drivers/video/cfb_console.c
include/bmp_layout.h
include/common.h
include/config_uncmd_spl.h
include/configs/sandbox.h
include/fdtdec.h
include/i2c.h
include/ns16550.h
include/spl.h
lib/fdtdec.c
scripts/Makefile.uncmd_spl

index 2985e6e065975876f3a3c6d984745da5756b4d32..fd47e60a909a7450f391ec1ae78e0ff5cc37770a 100644 (file)
@@ -668,6 +668,7 @@ config TEGRA
        select SUPPORT_SPL
        select SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
        select CPU_V7
        select DM
        select DM_SPI_FLASH
@@ -794,6 +795,7 @@ config ARCH_UNIPHIER
        select DM
        select DM_SERIAL
        select DM_I2C
+       select SPL_DISABLE_OF_CONTROL
        help
          Support for UniPhier SoC family developed by Socionext Inc.
          (formerly, System LSI Business Division of Panasonic Corporation)
index c56417dd2f1ec81d8fa1088d8c12fc0aaf6c3848..0b0e5003cc3c390e9cb86fe13d8426e5840ae731 100644 (file)
@@ -24,7 +24,7 @@
 
 void __weak cpu_cache_initialization(void){}
 
-int cleanup_before_linux(void)
+int cleanup_before_linux_select(int flags)
 {
        /*
         * this function is called just before we call linux
@@ -42,24 +42,30 @@ int cleanup_before_linux(void)
        icache_disable();
        invalidate_icache_all();
 
-       /*
-        * turn off D-cache
-        * dcache_disable() in turn flushes the d-cache and disables MMU
-        */
-       dcache_disable();
-       v7_outer_cache_disable();
+       if (flags & CBL_DISABLE_CACHES) {
+               /*
+               * turn off D-cache
+               * dcache_disable() in turn flushes the d-cache and disables MMU
+               */
+               dcache_disable();
+               v7_outer_cache_disable();
 
-       /*
-        * After D-cache is flushed and before it is disabled there may
-        * be some new valid entries brought into the cache. We are sure
-        * that these lines are not dirty and will not affect our execution.
-        * (because unwinding the call-stack and setting a bit in CP15 SCTLR
-        * is all we did during this. We have not pushed anything on to the
-        * stack. Neither have we affected any static data)
-        * So just invalidate the entire d-cache again to avoid coherency
-        * problems for kernel
-        */
-       invalidate_dcache_all();
+               /*
+               * After D-cache is flushed and before it is disabled there may
+               * be some new valid entries brought into the cache. We are
+               * sure that these lines are not dirty and will not affect our
+               * execution. (because unwinding the call-stack and setting a
+               * bit in CP15 SCTRL is all we did during this. We have not
+               * pushed anything on to the stack. Neither have we affected
+               * any static data) So just invalidate the entire d-cache again
+               * to avoid coherency problems for kernel
+               */
+               invalidate_dcache_all();
+       } else {
+               flush_dcache_all();
+               invalidate_icache_all();
+               icache_enable();
+       }
 
        /*
         * Some CPU need more cache attention before starting the kernel.
@@ -68,3 +74,8 @@ int cleanup_before_linux(void)
 
        return 0;
 }
+
+int cleanup_before_linux(void)
+{
+       return cleanup_before_linux_select(CBL_ALL);
+}
index c61442578d565e7e5f67b9b6a08532778c26bc8d..3ca7128ed79dbdd39043f33767e83dbd25eda6ea 100644 (file)
@@ -8,6 +8,7 @@ config TARGET_SMDKV310
        select SUPPORT_SPL
        bool "Exynos4210 SMDKV310 board"
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_TRATS
        bool "Exynos4210 Trats board"
@@ -28,6 +29,7 @@ config TARGET_ODROID
 config TARGET_ODROID_XU3
        bool "Exynos5422 Odroid board"
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_ARNDALE
        bool "Exynos5250 Arndale board"
@@ -35,31 +37,37 @@ config TARGET_ARNDALE
        select CPU_V7_HAS_VIRT
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_SMDK5250
        bool "SMDK5250 board"
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_SNOW
        bool "Snow board"
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_SMDK5420
        bool "SMDK5420 board"
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_PEACH_PI
        bool "Peach Pi board"
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_PEACH_PIT
        bool "Peach Pit board"
        select SUPPORT_SPL
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 endchoice
 
index 04acdaad79ce4d4320e8f757f0a3cee89815b8c0..792ef595e4919570590c06d5c5bb89c52d4d6b2a 100644 (file)
@@ -7,10 +7,12 @@ choice
 config TARGET_S5P_GONI
        bool "S5P Goni board"
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 config TARGET_SMDKC100
        bool "Support smdkc100 board"
        select OF_CONTROL
+       select SPL_DISABLE_OF_CONTROL
 
 endchoice
 
index bc1421e1c3aa36ad626f8bcdde1f44cc5c3275d7..9c735c672abce4087c7db6052590e6a75529ef5f 100644 (file)
@@ -138,7 +138,8 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
 
 targets += $(dtb-y)
 
-DTC_FLAGS += -R 4 -p 0x1000
+# Add any required device tree compiler flags here
+DTC_FLAGS +=
 
 PHONY += dtbs
 dtbs: $(addprefix $(obj)/, $(dtb-y))
index 9b4287193523cd400dc4cd3ff176ad9ca442625c..f5b5ee9cb73fdb7d1b00677f3f6e36ba3c68e115 100644 (file)
@@ -24,9 +24,15 @@ config SYS_MALLOC_F_LEN
 config USE_PRIVATE_LIBGCC
        default y
 
+config DM_USB
+       default y
+
 config SPL_DM
        default y
 
+config SPL_DISABLE_OF_CONTROL
+       default y
+
 source "arch/arm/mach-tegra/tegra20/Kconfig"
 source "arch/arm/mach-tegra/tegra30/Kconfig"
 source "arch/arm/mach-tegra/tegra114/Kconfig"
index ebcee4ed9a516529f1c04e79ea471316bf93f871..ce9b6959efb13a31be8c757f6f3b4bee5c83fcf3 100644 (file)
@@ -161,7 +161,6 @@ int board_init(void)
 
 #ifdef CONFIG_USB_EHCI_TEGRA
        pin_mux_usb();
-       usb_process_devicetree(gd->fdt_blob);
 #endif
 
 #ifdef CONFIG_LCD
index 02c4cd366d13c0444eb28f11c35074a06d608413..e6ddb17a140381b59abd7d8b0c597eff8a18a57e 100644 (file)
@@ -52,6 +52,11 @@ int cleanup_before_linux(void)
        return 0;
 }
 
+int cleanup_before_linux_select(int flags)
+{
+       return 0;
+}
+
 void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 {
 #ifdef CONFIG_PCI
index cc904c253560f4e0e4743e2eeba162c63d5021ad..cb1f07119b4f6c7963590c394a779f4339a2934e 100644 (file)
@@ -34,12 +34,12 @@ static int bmp_info (ulong addr);
  * didn't contain a valid BMP signature.
  */
 #ifdef CONFIG_VIDEO_BMP_GZIP
-bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp,
-                       void **alloc_addr)
+struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
+                            void **alloc_addr)
 {
        void *dst;
        unsigned long len;
-       bmp_image_t *bmp;
+       struct bmp_image *bmp;
 
        /*
         * Decompress bmp image
@@ -55,7 +55,7 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp,
        bmp = dst;
 
        /* align to 32-bit-aligned-address + 2 */
-       bmp = (bmp_image_t *)((((unsigned int)dst + 1) & ~3) + 2);
+       bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2);
 
        if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, (uchar *)addr, &len) != 0) {
                free(dst);
@@ -80,8 +80,8 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp,
        return bmp;
 }
 #else
-bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp,
-                       void **alloc_addr)
+struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
+                            void **alloc_addr)
 {
        return NULL;
 }
@@ -187,7 +187,7 @@ U_BOOT_CMD(
  */
 static int bmp_info(ulong addr)
 {
-       bmp_image_t *bmp=(bmp_image_t *)addr;
+       struct bmp_image *bmp = (struct bmp_image *)addr;
        void *bmp_alloc_addr = NULL;
        unsigned long len;
 
@@ -224,7 +224,7 @@ static int bmp_info(ulong addr)
 int bmp_display(ulong addr, int x, int y)
 {
        int ret;
-       bmp_image_t *bmp = (bmp_image_t *)addr;
+       struct bmp_image *bmp = (struct bmp_image *)addr;
        void *bmp_alloc_addr = NULL;
        unsigned long len;
 
index 055c366b191e32469c100c2d010fa9ba401526ef..5a52fe4287fa7383e8849348bff794f43d6b1138 100644 (file)
@@ -448,8 +448,8 @@ static void draw_encoded_bitmap(ushort **fbp, ushort c, int cnt)
 /*
  * Do not call this function directly, must be called from lcd_display_bitmap.
  */
-static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
-                                   int x_off, int y_off)
+static void lcd_display_rle8_bitmap(struct bmp_image *bmp, ushort *cmap,
+                                   uchar *fb, int x_off, int y_off)
 {
        uchar *bmap;
        ulong width, height;
@@ -548,10 +548,10 @@ __weak void fb_put_word(uchar **fb, uchar **from)
 }
 #endif /* CONFIG_BMP_16BPP */
 
-__weak void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
+__weak void lcd_set_cmap(struct bmp_image *bmp, unsigned colors)
 {
        int i;
-       bmp_color_table_entry_t cte;
+       struct bmp_color_table_entry cte;
        ushort *cmap = configuration_get_cmap();
 
        for (i = 0; i < colors; ++i) {
@@ -572,12 +572,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
        ushort *cmap_base = NULL;
        ushort i, j;
        uchar *fb;
-       bmp_image_t *bmp = (bmp_image_t *)map_sysmem(bmp_image, 0);
+       struct bmp_image *bmp = (struct bmp_image *)map_sysmem(bmp_image, 0);
        uchar *bmap;
        ushort padded_width;
        unsigned long width, height, byte_width;
        unsigned long pwidth = panel_info.vl_col;
        unsigned colors, bpix, bmp_bpix;
+       int hdr_size;
+       struct bmp_color_table_entry *palette = bmp->color_table;
 
        if (!bmp || !(bmp->header.signature[0] == 'B' &&
                bmp->header.signature[1] == 'M')) {
@@ -589,6 +591,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
        width = get_unaligned_le32(&bmp->header.width);
        height = get_unaligned_le32(&bmp->header.height);
        bmp_bpix = get_unaligned_le16(&bmp->header.bit_count);
+       hdr_size = get_unaligned_le16(&bmp->header.size);
+       debug("hdr_size=%d, bmp_bpix=%d\n", hdr_size, bmp_bpix);
 
        colors = 1 << bmp_bpix;
 
@@ -613,8 +617,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                return 1;
        }
 
-       debug("Display-bmp: %d x %d  with %d colors\n",
-               (int)width, (int)height, (int)colors);
+       debug("Display-bmp: %d x %d  with %d colors, display %d\n",
+             (int)width, (int)height, (int)colors, 1 << bpix);
 
        if (bmp_bpix == 8)
                lcd_set_cmap(bmp, colors);
@@ -641,6 +645,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                cmap_base = configuration_get_cmap();
 #ifdef CONFIG_LCD_BMP_RLE8
                u32 compression = get_unaligned_le32(&bmp->header.compression);
+               debug("compressed %d %d\n", compression, BMP_BI_RLE8);
                if (compression == BMP_BI_RLE8) {
                        if (bpix != 16) {
                                /* TODO implement render code for bpix != 16 */
@@ -663,7 +668,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                                if (bpix != 16) {
                                        fb_put_byte(&fb, &bmap);
                                } else {
-                                       *(uint16_t *)fb = cmap_base[*(bmap++)];
+                                       struct bmp_color_table_entry *entry;
+                                       uint val;
+
+                                       if (cmap_base) {
+                                               val = cmap_base[*bmap];
+                                       } else {
+                                               entry = &palette[*bmap];
+                                               val = entry->blue >> 3 |
+                                                       entry->green >> 2 << 5 |
+                                                       entry->red >> 3 << 11;
+                                       }
+                                       *(uint16_t *)fb = val;
+                                       bmap++;
                                        fb += sizeof(uint16_t) / sizeof(*fb);
                                }
                        }
index d445199c58aaa3a6b06c3b102b06f23b61193855..9811ab60f6d174a35c9b4e68d39321bca4beb8be 100644 (file)
@@ -26,6 +26,20 @@ void *malloc_simple(size_t bytes)
        return ptr;
 }
 
+void *memalign_simple(size_t align, size_t bytes)
+{
+       ulong addr, new_ptr;
+       void *ptr;
+
+       addr = ALIGN(gd->malloc_base + gd->malloc_ptr, bytes);
+       new_ptr = addr + bytes;
+       if (new_ptr > gd->malloc_limit)
+               return NULL;
+       ptr = map_sysmem(addr, bytes);
+       gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+       return ptr;
+}
+
 #ifdef CONFIG_SYS_MALLOC_SIMPLE
 void *calloc(size_t nmemb, size_t elem_size)
 {
index a8584e9b844d3ffac200b303d9c77062cecc0c8f..67ad959eef8e0a05c8a73c6a5648bf6454633804 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_AM335X_EVM=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack"
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
index 469dace8b1231c75064bc500af3f8b4c90ea2e96..c55357b3756534705837ca454896646e997a0072 100644 (file)
@@ -6,3 +6,4 @@ CONFIG_DEFAULT_DEVICE_TREE="arches"
 CONFIG_CMD_SETEXPR=y
 CONFIG_CMD_NET=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
index 12d335233d78a2b282aea3c480e71172206f3ed1..e838a6c56a68ab9cff99e9e21b3097d8beff186a 100644 (file)
@@ -6,4 +6,5 @@ CONFIG_DEFAULT_DEVICE_TREE="canyonlands"
 CONFIG_CMD_SETEXPR=y
 CONFIG_CMD_NET=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_OF_EMBED=y
index a3b564ec54fb6e418829e8926d7e8e5079f1258d..50455104336abe2c62c0d4308a5b234a4449e1b7 100644 (file)
@@ -5,5 +5,6 @@ CONFIG_DEFAULT_DEVICE_TREE="galileo"
 CONFIG_TARGET_GALILEO=y
 CONFIG_CMD_NET=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GENERATE_PIRQ_TABLE=y
index 5740359d20f3f1a7bff903f837d3fb434e328521..1e4cf7b63198242258bfb86d9e9101746fedd35d 100644 (file)
@@ -4,4 +4,5 @@ CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic"
 CONFIG_SPL=y
 CONFIG_CMD_NET=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_OF_EMBED=y
index 5efcdf592eb3da826a7cc4bf29c678dc69761708..41005c78caf43df0836400a847f7167f2095ca56 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_TARGET_ODROID=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="exynos4412-odroid"
 CONFIG_CMD_SETEXPR=y
 CONFIG_CMD_NET=y
index 3c59b9b07af6050d591be960f52ea6b0aeebd736..657ef7e7da6dc12980f14b8d6902255032343581 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_TARGET_ORIGEN=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-origen"
 CONFIG_SPL=y
 CONFIG_CMD_SETEXPR=y
index 633698edca09b6c1a0c16695d429c466b4048717..32ac86ad827ae575f1ad93ff0675cd65bf421f25 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_TARGET_S5PC210_UNIVERSAL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-universal_c210"
 CONFIG_CMD_SETEXPR=y
 CONFIG_OF_CONTROL=y
index 345b701f146e01b476dbaa370d8ea3bbe03b0ab3..31fe2f9f451fdf1a7bb929e222b66bd4d040c72a 100644 (file)
@@ -41,3 +41,4 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_SANDBOX_SERIAL=y
index bbe4e806fff9a77e6581e25069e1b6fd57487dfe..c9fcb74eec87ba4bbfb451533755fec00d8c582a 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_TARGET_SOCFPGA_CYCLONE5=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_NETDEVICES=y
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
 CONFIG_SPL=y
index 75a8aec1039dc75cba3d6ad036d43d37235364d6..52e87a131a591f7ebae360a0eb46c6e32ad87d24 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_TARGET_TRATS2=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_DEFAULT_DEVICE_TREE="exynos4412-trats2"
 CONFIG_CMD_SETEXPR=y
index a1aa892b29e671bd727435ea24cd54658dca0ed4..25315b341420c6906afc131e80c1ff0f6300e513 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_TARGET_TRATS=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-trats"
 CONFIG_CMD_SETEXPR=y
 CONFIG_OF_CONTROL=y
index 9215ac55a63163ec2d10c1f15415d3b407a494d6..03f4bf732a93e4cde465766486a5b80b9ab15222 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_ZYNQ_MICROZED=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_SIGNATURE=y
index a018b6e89e3a67cfa927d9f25f461737a5447f91..7377619da7b6ab02c0c8cc2e8a6f28c97c80fd31 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZC70X=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index 7c83e8ba21da6c18517d17df2bbd2e09c664d859..c948ad76e7a9fde1f07e4be8f3cd251d872a2ff0 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZC770=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm010"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index 2659d0ae2477f9fee52cfb8ce86eb4bd335118c8..3429bf9b6c0ede6b3e9a066688b6ff48f0f5fda0 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZC770=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm012"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index 64624ea01272051276d33d837452d670075cbbf0..a435229d6e9cbd254d072e3223a7450184f8639c 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZC770=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm013"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index 55d58a70b0187f69d23cc04532cbf216080b9ff4..8f94d211743c56b9270cac62e6161f0df3201bad 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZED=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zed"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index f119532fad0b9b8ad5079053fa94287d50d3d63c..1849c74b8d2ee6dfb1e36b3187f3ea298cfb83f8 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_TARGET_ZYNQ_ZYBO=y
+CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo"
 # CONFIG_SYS_MALLOC_F is not set
 CONFIG_SPL=y
index f14695b2d6eae985d366827d69bcedda1ce1e2ce..a3fec3850395512d3fdb177feb49ebb1381ca224 100644 (file)
@@ -5,5 +5,7 @@
 #
 
 obj-$(CONFIG_DM)       += device.o lists.o root.o uclass.o util.o
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_OF_CONTROL) += simple-bus.o
+endif
 obj-$(CONFIG_DM_DEVICE_REMOVE) += device-remove.o
index 223f238f4bed0cc475743c94931ed25fd2a2427b..5606d1f807f64dead14b8ba65a66cfc4f3852b08 100644 (file)
@@ -106,3 +106,24 @@ void board_i2c_init(const void *blob)
 {
        /* Nothing to do here - the init happens through driver model */
 }
+
+uint8_t i2c_reg_read(uint8_t chip_addr, uint8_t offset)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_compat_get_device(chip_addr, 1, &dev);
+       if (ret)
+               return 0xff;
+       return dm_i2c_reg_read(dev, offset);
+}
+
+void i2c_reg_write(uint8_t chip_addr, uint8_t offset, uint8_t val)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_compat_get_device(chip_addr, 1, &dev);
+       if (!ret)
+               dm_i2c_reg_write(dev, offset, val);
+}
index 5611fac0dc46793bfc23f08573eddb89a7ce2a91..4829284216c2fcb6eb5b280ce62163b496008da4 100644 (file)
@@ -76,6 +76,26 @@ config DEBUG_UART_SHIFT
          value. Use this value to specify the shift to use, where 0=byte
          registers, 2=32-bit word registers, etc.
 
+config SANDBOX_SERIAL
+       bool "Sandbox UART support"
+       depends on SANDBOX && DM
+       help
+         Select this to enable a seral UART for sandbox. This is required to
+         operate correctly, otherwise you will see no serial output from
+         sandbox. The emulated UART will display to the console and console
+         input will be fed into the UART. This allows you to interact with
+         U-Boot.
+
+         The operation of the console is controlled by the -t command-line
+         flag. In raw mode, U-Boot sees all characters from the terminal
+         before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
+         is processed by the terminal, and terminates U-Boot. Valid options
+         are:
+
+            -t raw-with-sigs   Raw mode, Ctrl-C will terminate U-Boot
+            -t raw             Raw mode, Ctrl-C is processed by U-Boot
+            -t cooked          Cooked mode, Ctrl-C terminates
+
 config UNIPHIER_SERIAL
        bool "Support for UniPhier on-chip UART"
        depends on ARCH_UNIPHIER && DM_SERIAL
index 3d376d758085b4389a15b888638449311c5f9391..9b044a37da500f3deabfde65d1b9684e2f03957c 100644 (file)
@@ -65,6 +65,8 @@ static inline void serial_out_shift(void *addr, int shift, int value)
        out_le32(addr, value);
 #elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN)
        out_be32(addr, value);
+#elif defined(CONFIG_SYS_NS16550_MEM32)
+       writel(value, addr);
 #elif defined(CONFIG_SYS_BIG_ENDIAN)
        writeb(value, addr + (1 << shift) - 1);
 #else
@@ -80,6 +82,8 @@ static inline int serial_in_shift(void *addr, int shift)
        return in_le32(addr);
 #elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN)
        return in_be32(addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32)
+       return readl(addr);
 #elif defined(CONFIG_SYS_BIG_ENDIAN)
        return readb(addr + (1 << shift) - 1);
 #else
index b8c2f482288913475af367869b0ab086e6fd5943..815fec32646924c2c8000cbb25798cd6b227460a 100644 (file)
@@ -30,49 +30,55 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 static void serial_find_console_or_panic(void)
 {
        struct udevice *dev;
-
-#ifdef CONFIG_OF_CONTROL
        int node;
 
-       /* Check for a chosen console */
-       node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
-       if (node < 0)
-               node = fdt_path_offset(gd->fdt_blob, "console");
-       if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &dev)) {
-               gd->cur_serial_dev = dev;
-               return;
-       }
-
-       /*
-        * If the console is not marked to be bound before relocation, bind
-        * it anyway.
-        */
-       if (node > 0 &&
-           !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &dev)) {
-               if (!device_probe(dev)) {
+       if (OF_CONTROL && gd->fdt_blob) {
+               /* Check for a chosen console */
+               node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
+               if (node < 0)
+                       node = fdt_path_offset(gd->fdt_blob, "console");
+               if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node,
+                                                   &dev)) {
                        gd->cur_serial_dev = dev;
                        return;
                }
+
+               /*
+               * If the console is not marked to be bound before relocation,
+               * bind it anyway.
+               */
+               if (node > 0 &&
+                   !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &dev)) {
+                       if (!device_probe(dev)) {
+                               gd->cur_serial_dev = dev;
+                               return;
+                       }
+               }
        }
-#endif
-       /*
-        * Try to use CONFIG_CONS_INDEX if available (it is numbered from 1!).
-        *
-        * Failing that, get the device with sequence number 0, or in extremis
-        * just the first serial device we can find. But we insist on having
-        * a console (even if it is silent).
-        */
+       if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) {
+               /*
+               * Try to use CONFIG_CONS_INDEX if available (it is numbered
+               * from 1!).
+               *
+               * Failing that, get the device with sequence number 0, or in
+               * extremis just the first serial device we can find. But we
+               * insist on having a console (even if it is silent).
+               */
 #ifdef CONFIG_CONS_INDEX
 #define INDEX (CONFIG_CONS_INDEX - 1)
 #else
 #define INDEX 0
 #endif
-       if (uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) &&
-           uclass_get_device(UCLASS_SERIAL, INDEX, &dev) &&
-           (uclass_first_device(UCLASS_SERIAL, &dev) || !dev))
-               panic_str("No serial driver found");
+               if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) ||
+                   !uclass_get_device(UCLASS_SERIAL, INDEX, &dev) ||
+                   (!uclass_first_device(UCLASS_SERIAL, &dev) || dev)) {
+                       gd->cur_serial_dev = dev;
+                       return;
+               }
 #undef INDEX
-       gd->cur_serial_dev = dev;
+       }
+
+       panic_str("No serial driver found");
 }
 
 /* Called prior to relocation */
index 27705d66271d9103d34c8df225b9583e0a54b8bb..e2574d7958e731e63fb7bee27c214c5997077984 100644 (file)
@@ -35,12 +35,6 @@ DECLARE_GLOBAL_DATA_PTR;
        #endif
 #endif
 
-#ifndef CONFIG_DM_USB
-enum {
-       USB_PORTS_MAX   = 3,            /* Maximum ports we allow */
-};
-#endif
-
 /* Parameters we need for USB */
 enum {
        PARAM_DIVN,                     /* PLL FEEDBACK DIVIDer */
@@ -82,9 +76,6 @@ struct fdt_usb {
        unsigned ulpi:1;        /* 1 if port has external ULPI transceiver */
        unsigned enabled:1;     /* 1 to enable, 0 to disable */
        unsigned has_legacy_mode:1; /* 1 if this port has legacy mode */
-#ifndef CONFIG_DM_USB
-       unsigned initialized:1; /* has this port already been initialized? */
-#endif
        enum usb_ctlr_type type;
        enum usb_init_type init_type;
        enum dr_mode dr_mode;   /* dual role mode */
@@ -93,11 +84,6 @@ struct fdt_usb {
        struct gpio_desc phy_reset_gpio; /* GPIO to reset ULPI phy */
 };
 
-#ifndef CONFIG_DM_USB
-static struct fdt_usb port[USB_PORTS_MAX];     /* List of valid USB ports */
-static unsigned port_count;                    /* Number of available ports */
-#endif
-
 /*
  * This table has USB timing parameters for each Oscillator frequency we
  * support. There are four sets of values:
@@ -173,8 +159,6 @@ static const u8 utmip_elastic_limit = 16;
 static const u8 utmip_hs_sync_start_delay = 9;
 
 struct fdt_usb_controller {
-       /* TODO(sjg@chromium.org): Remove when we only use driver model */
-       int compat;
        /* flag to determine whether controller supports hostpc register */
        u32 has_hostpc:1;
        const unsigned *pll_parameter;
@@ -182,17 +166,14 @@ struct fdt_usb_controller {
 
 static struct fdt_usb_controller fdt_usb_controllers[USB_CTRL_COUNT] = {
        {
-               .compat         = COMPAT_NVIDIA_TEGRA20_USB,
                .has_hostpc     = 0,
                .pll_parameter  = (const unsigned *)T20_usb_pll,
        },
        {
-               .compat         = COMPAT_NVIDIA_TEGRA30_USB,
                .has_hostpc     = 1,
                .pll_parameter  = (const unsigned *)T30_usb_pll,
        },
        {
-               .compat         = COMPAT_NVIDIA_TEGRA114_USB,
                .has_hostpc     = 1,
                .pll_parameter  = (const unsigned *)T114_usb_pll,
        },
@@ -754,12 +735,6 @@ int usb_common_init(struct fdt_usb *config, enum usb_init_type init)
                return -1;
        }
 
-#ifndef CONFIG_DM_USB
-       /* skip init, if the port is already initialized */
-       if (config->initialized && config->init_type == init)
-               return 0;
-#endif
-
        debug("%d, %d\n", config->utmi, config->ulpi);
        if (config->utmi)
                ret = init_utmi_usb_controller(config, init);
@@ -796,130 +771,6 @@ static const struct ehci_ops tegra_ehci_ops = {
        .powerup_fixup          = tegra_ehci_powerup_fixup,
 };
 
-#ifndef CONFIG_DM_USB
-/*
- * process_usb_nodes() - Process a list of USB nodes, adding them to our list
- *                     of USB ports.
- * @blob:      fdt blob
- * @node_list: list of nodes to process (any <=0 are ignored)
- * @count:     number of nodes to process
- * @id:                controller type (enum usb_ctlr_type)
- *
- * Return:     0 - ok, -1 - error
- */
-static int process_usb_nodes(const void *blob, int node_list[], int count,
-                            enum usb_ctlr_type id)
-{
-       struct fdt_usb config;
-       int node, i;
-       int clk_done = 0;
-
-       port_count = 0;
-       for (i = 0; i < count; i++) {
-               if (port_count == USB_PORTS_MAX) {
-                       printf("tegrausb: Cannot register more than %d ports\n",
-                               USB_PORTS_MAX);
-                       return -1;
-               }
-
-               debug("USB %d: ", i);
-               node = node_list[i];
-               if (!node)
-                       continue;
-               if (fdt_decode_usb(blob, node, &config)) {
-                       debug("Cannot decode USB node %s\n",
-                             fdt_get_name(blob, node, NULL));
-                       return -1;
-               }
-               if (!clk_done) {
-                       config_clock(get_pll_timing(
-                                       &fdt_usb_controllers[id]));
-                       clk_done = 1;
-               }
-               config.type = id;
-               config.initialized = 0;
-
-               /* add new USB port to the list of available ports */
-               port[port_count++] = config;
-       }
-
-       return 0;
-}
-
-int usb_process_devicetree(const void *blob)
-{
-       int node_list[USB_PORTS_MAX];
-       int count, err = 0;
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(fdt_usb_controllers); i++) {
-               count = fdtdec_find_aliases_for_id(blob, "usb",
-                       fdt_usb_controllers[i].compat, node_list,
-                       USB_PORTS_MAX);
-               if (count) {
-                       err = process_usb_nodes(blob, node_list, count, i);
-                       if (err)
-                               printf("%s: Error processing USB node!\n",
-                                      __func__);
-                       return err;
-               }
-       }
-
-       return err;
-}
-
-/**
- * Start up the given port number (ports are numbered from 0 on each board).
- * This returns values for the appropriate hccr and hcor addresses to use for
- * USB EHCI operations.
- *
- * @param index        port number to start
- * @param hccr         returns start address of EHCI HCCR registers
- * @param hcor         returns start address of EHCI HCOR registers
- * @return 0 if ok, -1 on error (generally invalid port number)
- */
-int ehci_hcd_init(int index, enum usb_init_type init,
-               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-       struct fdt_usb *config;
-       struct usb_ctlr *usbctlr;
-       int ret;
-
-       if (index >= port_count)
-               return -1;
-
-       config = &port[index];
-       ehci_set_controller_priv(index, config, &tegra_ehci_ops);
-
-       ret = usb_common_init(config, init);
-       if (ret) {
-               printf("tegrausb: Cannot init port %d\n", index);
-               return ret;
-       }
-
-       config->initialized = 1;
-
-       usbctlr = config->reg;
-       *hccr = (struct ehci_hccr *)&usbctlr->cap_length;
-       *hcor = (struct ehci_hcor *)&usbctlr->usb_cmd;
-
-       return 0;
-}
-
-/*
- * Bring down the specified USB controller
- */
-int ehci_hcd_stop(int index)
-{
-       usb_common_uninit(&port[index]);
-
-       port[index].initialized = 0;
-
-       return 0;
-}
-#endif /* !CONFIG_DM_USB */
-
-#ifdef CONFIG_DM_USB
 static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 {
        struct fdt_usb *priv = dev_get_priv(dev);
@@ -987,4 +838,3 @@ U_BOOT_DRIVER(usb_ehci) = {
        .priv_auto_alloc_size = sizeof(struct fdt_usb),
        .flags  = DM_FLAG_ALLOC_PRIV_DMA,
 };
-#endif
index 963464cff94d0b7cc57daad0d86d0765f89c82fd..6e86f4a24a48ff26e19013ed7746d60212a66705 100644 (file)
@@ -628,6 +628,49 @@ int usb_scan_device(struct udevice *parent, int port,
        return 0;
 }
 
+/*
+ * Detect if a USB device has been plugged or unplugged.
+ */
+int usb_detect_change(void)
+{
+       struct udevice *hub;
+       struct uclass *uc;
+       int change = 0;
+       int ret;
+
+       ret = uclass_get(UCLASS_USB_HUB, &uc);
+       if (ret)
+               return ret;
+
+       uclass_foreach_dev(hub, uc) {
+               struct usb_device *udev;
+               struct udevice *dev;
+
+               if (!device_active(hub))
+                       continue;
+               for (device_find_first_child(hub, &dev);
+                    dev;
+                    device_find_next_child(&dev)) {
+                       struct usb_port_status status;
+
+                       if (!device_active(dev))
+                               continue;
+
+                       udev = dev_get_parentdata(dev);
+                       if (usb_get_port_status(udev, udev->portnr, &status)
+                                       < 0)
+                               /* USB request failed */
+                               continue;
+
+                       if (le16_to_cpu(status.wPortChange) &
+                           USB_PORT_STAT_C_CONNECTION)
+                               change++;
+               }
+       }
+
+       return change;
+}
+
 int usb_child_post_bind(struct udevice *dev)
 {
        struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
index 4ed3a49beca894ec797b71196702555478b838af..d43d8a59d3b78606ea242b0334dac690d511e0b4 100644 (file)
@@ -81,12 +81,12 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 #endif
 }
 
-void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
+void lcd_set_cmap(struct bmp_image *bmp, unsigned colors)
 {
        int i;
 
        for (i = 0; i < colors; ++i) {
-               bmp_color_table_entry_t cte = bmp->color_table[i];
+               struct bmp_color_table_entry cte = bmp->color_table[i];
                lcd_setcolreg(i, cte.red, cte.green, cte.blue);
        }
 }
index 60a5cc5b719f1f39a04cbb2e29db29c9b68ffb70..2f54d3d14743f7fa939e740280a07f180ff3958e 100644 (file)
@@ -358,7 +358,7 @@ void vcxk_draw_mono(unsigned char *dataptr, unsigned long linewidth,
 
 int vcxk_display_bitmap(ulong addr, int x, int y)
 {
-       bmp_image_t *bmp;
+       struct bmp_image *bmp;
        unsigned long width;
        unsigned long height;
        unsigned long bpp;
@@ -369,7 +369,7 @@ int vcxk_display_bitmap(ulong addr, int x, int y)
        unsigned long c_height;
        unsigned char *dataptr;
 
-       bmp = (bmp_image_t *) addr;
+       bmp = (struct bmp_image *)addr;
        if ((bmp->header.signature[0] == 'B') &&
            (bmp->header.signature[1] == 'M')) {
                width        = le32_to_cpu(bmp->header.width);
index f4231b8e62a5e337c1f8232ede7a59e706fabe17..7f2ddc10c62b88e519c29fb14627c1e237db3c85 100644 (file)
@@ -1295,7 +1295,7 @@ static void draw_bitmap(uchar **fb, uchar *bm, struct palette *p,
        *fb = (uchar *) addr;   /* return modified address */
 }
 
-static int display_rle8_bitmap(bmp_image_t *img, int xoff, int yoff,
+static int display_rle8_bitmap(struct bmp_image *img, int xoff, int yoff,
                               int width, int height)
 {
        unsigned char *bm;
@@ -1304,7 +1304,7 @@ static int display_rle8_bitmap(bmp_image_t *img, int xoff, int yoff,
        int decode = 1;
        int x, y, bpp, i, ncolors;
        struct palette p[256];
-       bmp_color_table_entry_t cte;
+       struct bmp_color_table_entry cte;
        int green_shift, red_off;
        int limit = VIDEO_COLS * VIDEO_ROWS;
        int pixels = 0;
@@ -1447,13 +1447,13 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 {
        ushort xcount, ycount;
        uchar *fb;
-       bmp_image_t *bmp = (bmp_image_t *) bmp_image;
+       struct bmp_image *bmp = (struct bmp_image *)bmp_image;
        uchar *bmap;
        ushort padded_line;
        unsigned long width, height, bpp;
        unsigned colors;
        unsigned long compression;
-       bmp_color_table_entry_t cte;
+       struct bmp_color_table_entry cte;
 
 #ifdef CONFIG_VIDEO_BMP_GZIP
        unsigned char *dst = NULL;
@@ -1495,7 +1495,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                /*
                 * Set addr to decompressed image
                 */
-               bmp = (bmp_image_t *)(dst+2);
+               bmp = (struct bmp_image *)(dst+2);
 
                if (!((bmp->header.signature[0] == 'B') &&
                      (bmp->header.signature[1] == 'M'))) {
index 22b1fbc943519435644d638c713b0b73e9502219..55db8b86eab413b613f8b1d3951ec935860519ea 100644 (file)
 #ifndef _BMP_H_
 #define _BMP_H_
 
-typedef struct bmp_color_table_entry {
+struct __packed bmp_color_table_entry {
        __u8    blue;
        __u8    green;
        __u8    red;
        __u8    reserved;
-} __attribute__ ((packed)) bmp_color_table_entry_t;
+};
 
 /* When accessing these fields, remember that they are stored in little
    endian format, so use linux macros, e.g. le32_to_cpu(width)          */
 
-typedef struct bmp_header {
+struct __packed bmp_header {
        /* Header */
        char signature[2];
        __u32   file_size;
@@ -40,15 +40,14 @@ typedef struct bmp_header {
        __u32   colors_used;
        __u32   colors_important;
        /* ColorTable */
+};
 
-} __attribute__ ((packed)) bmp_header_t;
-
-typedef struct bmp_image {
-       bmp_header_t header;
+struct bmp_image {
+       struct bmp_header header;
        /* We use a zero sized array just as a placeholder for variable
           sized array */
-       bmp_color_table_entry_t color_table[0];
-} bmp_image_t;
+       struct bmp_color_table_entry color_table[0];
+};
 
 /* Data in the bmp_image is aligned to this length */
 #define BMP_DATA_ALIGN 4
index ea5aeb0014aca7c58402424eab61cb09e11b103d..8f4b2ec21277d82977f59f4e50749eaa578cdfa7 100644 (file)
@@ -714,6 +714,21 @@ void       invalidate_dcache_range(unsigned long start, unsigned long stop);
 void   invalidate_dcache_all(void);
 void   invalidate_icache_all(void);
 
+enum {
+       /* Disable caches (else flush caches but leave them active) */
+       CBL_DISABLE_CACHES              = 1 << 0,
+       CBL_SHOW_BOOTSTAGE_REPORT       = 1 << 1,
+
+       CBL_ALL                         = 3,
+};
+
+/**
+ * Clean up ready for linux
+ *
+ * @param flags                Flags to control what is done
+ */
+int cleanup_before_linux_select(int flags);
+
 /* arch/$(ARCH)/lib/ticks.S */
 uint64_t get_ticks(void);
 void   wait_ticks    (unsigned long);
index 38cb0e8abac9378c375cb4162454b6cc6923b2c8..c191f5634e24888606d64638ced17c3a6218fc0a 100644 (file)
@@ -20,7 +20,9 @@
 #undef CONFIG_CMD_SNTP
 #undef CONFIG_CMD_TFTPPUT
 #undef CONFIG_CMD_TFTPSRV
+#ifdef CONFIG_SPL_DISABLE_OF_CONTROL
 #undef CONFIG_OF_CONTROL
+#endif
 
 #ifndef CONFIG_SPL_DM
 #undef CONFIG_DM_SERIAL
index 3a857e2a3dd6c12c4c2ecdedfed961717fb449a9..3caa83ce098733cde2bc24a94c63e0d6a1b585a3 100644 (file)
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
                                        115200}
-#define CONFIG_SANDBOX_SERIAL
 
 #define CONFIG_SYS_NO_FLASH
 
index 4fb8a2a1ba52faf11913812955d69966ee1aecdc..232360341a5c5e85120e87983019a45ca3b34891 100644 (file)
@@ -41,6 +41,12 @@ struct fdt_memory {
        fdt_addr_t end;
 };
 
+#ifdef CONFIG_SPL_BUILD
+#define SPL_BUILD      1
+#else
+#define SPL_BUILD      0
+#endif
+
 #ifdef CONFIG_OF_CONTROL
 # if defined(CONFIG_SPL_BUILD) && defined(SPL_DISABLE_OF_CONTROL)
 #  define OF_CONTROL 0
@@ -122,9 +128,6 @@ static inline fdt_size_t fdt_resource_size(const struct fdt_resource *res)
  */
 enum fdt_compat_id {
        COMPAT_UNKNOWN,
-       COMPAT_NVIDIA_TEGRA20_USB,      /* Tegra20 USB port */
-       COMPAT_NVIDIA_TEGRA30_USB,      /* Tegra30 USB port */
-       COMPAT_NVIDIA_TEGRA114_USB,     /* Tegra114 USB port */
        COMPAT_NVIDIA_TEGRA20_EMC,      /* Tegra20 memory controller */
        COMPAT_NVIDIA_TEGRA20_EMC_TABLE, /* Tegra20 memory timing table */
        COMPAT_NVIDIA_TEGRA20_KBC,      /* Tegra20 Keyboard */
index ddfebc4107f638d68f0d0296d335fd67c9f6120d..9300d97e146b03f406b1b5ea505be2d5886d9325 100644 (file)
@@ -284,6 +284,12 @@ void i2c_init(int speed, int slaveaddr);
  */
 void board_i2c_init(const void *blob);
 
+/*
+ * Compatibility functions for driver model.
+ */
+uint8_t i2c_reg_read(uint8_t addr, uint8_t reg);
+void i2c_reg_write(uint8_t addr, uint8_t reg, uint8_t val);
+
 #endif
 
 /*
index 0607379537d7ccf1038a0d322fdf29d95fbc0df4..4e620676c453c6a4e0df04332befc0a1b34da592 100644 (file)
@@ -33,7 +33,7 @@
 
 #if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
 #error "Please define NS16550 registers size."
-#elif defined(CONFIG_SYS_NS16550_MEM32)
+#elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_DM_SERIAL)
 #define UART_REG(x) u32 x
 #elif (CONFIG_SYS_NS16550_REG_SIZE > 0)
 #define UART_REG(x)                                               \
index b2e5bf726f2b60d7d81d8bafb5a9ec8357749ff4..d19940f2a33a4ec52079873dbacbfe62ecdd34be 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/compiler.h>
 #include <asm/spl.h>
 
+/* Value in r0 indicates we booted from U-Boot */
+#define UBOOT_NOT_LOADED_FROM_SPL      0x13578642
 
 /* Boot type */
 #define MMCSD_MODE_UNDEFINED   0
@@ -82,4 +84,15 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
 #ifdef CONFIG_SPL_BOARD_INIT
 void spl_board_init(void);
 #endif
+
+/**
+ * spl_was_boot_source() - check if U-Boot booted from SPL
+ *
+ * This will normally be true, but if U-Boot jumps to second U-Boot, it will
+ * be false. This should be implemented by board-specific code.
+ *
+ * @return true if U-Boot booted from SPL, else false
+ */
+bool spl_was_boot_source(void);
+
 #endif
index 46dfcb675ccc54c454fe9661425c970bf2c7892d..9877849f99b490607d8ffc0d33048290f19a1058 100644 (file)
@@ -22,9 +22,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(UNKNOWN, "<none>"),
-       COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
-       COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
-       COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
        COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
        COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
        COMPAT(NVIDIA_TEGRA20_KBC, "nvidia,tegra20-kbc"),
index 343c3fc199329ff5146dbc424253537cf3cf2c9f..4f056525bb0692b78577ac35dfa2c96f221c6540 100644 (file)
@@ -3,7 +3,9 @@
 # TODO: Invent a better way
 
 ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_DISABLE_OF_CONTROL
 CONFIG_OF_CONTROL=
+endif
 
 ifndef CONFIG_SPL_DM
 CONFIG_DM_SERIAL=