Merge branch 'master' of git://git.denx.de/u-boot-sh
authorTom Rini <trini@konsulko.com>
Sun, 4 Nov 2018 13:12:21 +0000 (08:12 -0500)
committerTom Rini <trini@konsulko.com>
Sun, 4 Nov 2018 13:12:21 +0000 (08:12 -0500)
24 files changed:
arch/arc/Kconfig
arch/arc/dts/Makefile
arch/arc/dts/emsdp.dts [moved from arch/arc/dts/emdk.dts with 96% similarity]
arch/mips/Kconfig
arch/mips/config.mk
arch/mips/cpu/u-boot.lds
board/synopsys/emsdp/Kconfig [moved from board/synopsys/emdk/Kconfig with 63% similarity]
board/synopsys/emsdp/MAINTAINERS [moved from board/synopsys/emdk/MAINTAINERS with 50% similarity]
board/synopsys/emsdp/Makefile [moved from board/synopsys/emdk/Makefile with 85% similarity]
board/synopsys/emsdp/README [moved from board/synopsys/emdk/README with 90% similarity]
board/synopsys/emsdp/emsdp.c [moved from board/synopsys/emdk/emdk.c with 77% similarity]
board/synopsys/iot_devkit/README [new file with mode: 0644]
cmd/Makefile
cmd/remoteproc.c
configs/emsdp_defconfig [moved from configs/emdk_defconfig with 88% similarity]
configs/sama5d2_ptc_ek_mmc_defconfig
drivers/power/regulator/Kconfig
drivers/w1-eeprom/ds24xxx.c
drivers/w1/w1-uclass.c
include/configs/at91sam9x5ek.h
include/configs/emsdp.h [moved from include/configs/emdk.h with 85% similarity]
include/environment/ti/boot.h
test/dm/tee.c
tools/mips-relocs.c

index b24593e..fa6b344 100644 (file)
@@ -150,8 +150,8 @@ config TARGET_AXS101
 config TARGET_AXS103
        bool "Support Synopsys Designware SDP board AXS103"
 
-config TARGET_EMDK
-       bool "Synopsys EM Development kit"
+config TARGET_EMSDP
+       bool "Synopsys EM Software Development Platform"
        select CPU_ARCEM6
 
 config TARGET_HSDK
@@ -166,7 +166,7 @@ endchoice
 source "board/abilis/tb100/Kconfig"
 source "board/synopsys/Kconfig"
 source "board/synopsys/axs10x/Kconfig"
-source "board/synopsys/emdk/Kconfig"
+source "board/synopsys/emsdp/Kconfig"
 source "board/synopsys/hsdk/Kconfig"
 source "board/synopsys/iot_devkit/Kconfig"
 
index 17e1405..4f1e463 100644 (file)
@@ -4,7 +4,7 @@ dtb-$(CONFIG_TARGET_AXS101) +=  axs101.dtb
 dtb-$(CONFIG_TARGET_AXS103) +=  axs103.dtb
 dtb-$(CONFIG_TARGET_NSIM) +=  nsim.dtb
 dtb-$(CONFIG_TARGET_TB100) +=  abilis_tb100.dtb
-dtb-$(CONFIG_TARGET_EMDK) +=  emdk.dtb
+dtb-$(CONFIG_TARGET_EMSDP) +=  emsdp.dtb
 dtb-$(CONFIG_TARGET_HSDK) +=  hsdk.dtb
 dtb-$(CONFIG_TARGET_IOT_DEVKIT) +=  iot_devkit.dtb
 
similarity index 96%
rename from arch/arc/dts/emdk.dts
rename to arch/arc/dts/emsdp.dts
index ebe538d..d307b95 100644 (file)
@@ -7,7 +7,7 @@
 #include "skeleton.dtsi"
 
 / {
-       model = "snps,emdk";
+       model = "snps,emsdp";
 
        #address-cells = <1>;
        #size-cells = <1>;
index 071dea0..6d646ef 100644 (file)
@@ -248,6 +248,24 @@ config MIPS_CACHE_INDEX_BASE
          Normally this is CKSEG0. If the MIPS system needs to move this block
          to some SRAM or ScratchPad RAM, adapt this option accordingly.
 
+config MIPS_RELOCATION_TABLE_SIZE
+       hex "Relocation table size"
+       range 0x100 0x10000
+       default "0x8000"
+       ---help---
+         A table of relocation data will be appended to the U-Boot binary
+         and parsed in relocate_code() to fix up all offsets in the relocated
+         U-Boot.
+
+         This option allows the amount of space reserved for the table to be
+         adjusted in a range from 256 up to 64k. The default is 32k and should
+         be ok in most cases. Reduce this value to shrink the size of U-Boot
+         binary.
+
+         The build will fail and a valid size suggested if this is too small.
+
+         If unsure, leave at the default value.
+
 endmenu
 
 menu "OS boot interface"
index 8aa45fc..22223a0 100644 (file)
@@ -55,7 +55,7 @@ PLATFORM_ELFFLAGS += -B mips $(OBJCOPYFLAGS)
 # MODFLAGS                     += -mlong-calls
 #
 ifndef CONFIG_SPL_BUILD
-OBJCOPYFLAGS                   += -j .got -j .rel -j .padding -j .dtb.init.rodata
+OBJCOPYFLAGS                   += -j .data.reloc -j .dtb.init.rodata
 LDFLAGS_FINAL                  += --emit-relocs
 endif
 
index f2c9f94..fd0f1b5 100644 (file)
@@ -41,16 +41,22 @@ SECTIONS
        __image_copy_end = .;
        __init_end = .;
 
-       /*
-        * .rel must come last so that the mips-relocs tool can shrink
-        * the section size & the PT_LOAD program header filesz.
-        */
-       .rel : {
+       .data.reloc : {
                __rel_start = .;
-               BYTE(0x0)
-               . += (32 * 1024) - 1;
+               /*
+                * Space for relocation table
+                * This needs to be filled so that the
+                * mips-reloc tool can overwrite the content.
+                * An invalid value is left at the start of the
+                * section to abort relocation if the table
+                * has not been filled in.
+                */
+               LONG(0xFFFFFFFF);
+               FILL(0);
+               . += CONFIG_MIPS_RELOCATION_TABLE_SIZE - 4;
        }
 
+       . = ALIGN(4);
        _end = .;
 
        .bss __rel_start (OVERLAY) : {
similarity index 63%
rename from board/synopsys/emdk/Kconfig
rename to board/synopsys/emsdp/Kconfig
index a9b834d..8228bb5 100644 (file)
@@ -1,12 +1,12 @@
-if TARGET_EMDK
+if TARGET_EMSDP
 
 config SYS_BOARD
-       default "emdk"
+       default "emsdp"
 
 config SYS_VENDOR
        default "synopsys"
 
 config SYS_CONFIG_NAME
-       default "emdk"
+       default "emsdp"
 
 endif
similarity index 50%
rename from board/synopsys/emdk/MAINTAINERS
rename to board/synopsys/emsdp/MAINTAINERS
index 605e338..6404013 100644 (file)
@@ -1,5 +1,6 @@
 EM DEVELOPMENT KIT BOARD
 M:     Alexey Brodkin <abrodkin@synopsys.com>
 S:     Maintained
-F:     board/synopsys/emdk/
-F:     configs/emdk_defconfig
+F:     arch/arc/dts/emsdp.dts
+F:     board/synopsys/emsdp/
+F:     configs/emsdp_defconfig
similarity index 85%
rename from board/synopsys/emdk/Makefile
rename to board/synopsys/emsdp/Makefile
index 4926c4e..733a48c 100644 (file)
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  += emdk.o
+obj-y  += emsdp.o
similarity index 90%
rename from board/synopsys/emdk/README
rename to board/synopsys/emsdp/README
index 706b547..034062e 100644 (file)
@@ -1,11 +1,12 @@
 ================================================================================
-Useful notes on bulding and using of U-Boot on ARC EM Development Kit (AKA EMDK)
+Useful notes on bulding and using of U-Boot on
+ARC EM Software Development Platform (AKA EMSDP)
 ================================================================================
 
    BOARD OVERVIEW
 
-   The DesignWare ARC EM Development Kit is FPGA-bases platform for rapid
-   software development on the ARC EM family of processors.
+   The DesignWare ARC EM Software Development Platform is FPGA-bases platform
+   for rapid software development on the ARC EM family of processors.
 
    Since this board is based on FPGA it's possible to load and use different
    versions of ARC EM CPUs. U-Boot is built to be run on the simplest
@@ -50,7 +51,7 @@ Useful notes on bulding and using of U-Boot on ARC EM Development Kit (AKA EMDK)
 
    1. Configure U-Boot:
       ------------------------->8----------------------
-      make emdk_defconfig
+      make emsdp_defconfig
       ------------------------->8----------------------
 
    2. To build Elf file (for example to be used with host debugger via JTAG
@@ -69,7 +70,7 @@ Useful notes on bulding and using of U-Boot on ARC EM Development Kit (AKA EMDK)
 
    EXECUTING U-BOOT
 
-   1. The EMDK board is supposed to auto-start U-Boot image stored in ROM on
+   1. The EMSDP board is supposed to auto-start U-Boot image stored in ROM on
       power-on. For that make sure VCCIO DIP-switches are all in "off" state.
 
    2. Though it is possible to load U-Boot as a simple Elf file via JTAG right
similarity index 77%
rename from board/synopsys/emdk/emdk.c
rename to board/synopsys/emsdp/emsdp.c
index 79cafef..b5ec7f1 100644 (file)
@@ -55,7 +55,7 @@ void reset_cpu(ulong addr)
                ; /* loop forever till reset */
 }
 
-static int do_emdk_rom(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_emsdp_rom(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
        u32 creg_boot = readl((u32 *)(CREG_BASE + CREG_BOOT_OFFSET));
 
@@ -71,17 +71,17 @@ static int do_emdk_rom(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
        return CMD_RET_SUCCESS;
 }
 
-cmd_tbl_t cmd_emdk[] = {
-       U_BOOT_CMD_MKENT(rom, 2, 0, do_emdk_rom, "", ""),
+cmd_tbl_t cmd_emsdp[] = {
+       U_BOOT_CMD_MKENT(rom, 2, 0, do_emsdp_rom, "", ""),
 };
 
-static int do_emdk(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_emsdp(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
        cmd_tbl_t *c;
 
-       c = find_cmd_tbl(argv[1], cmd_emdk, ARRAY_SIZE(cmd_emdk));
+       c = find_cmd_tbl(argv[1], cmd_emsdp, ARRAY_SIZE(cmd_emsdp));
 
-       /* Strip off leading 'emdk' command */
+       /* Strip off leading 'emsdp' command */
        argc--;
        argv++;
 
@@ -92,8 +92,8 @@ static int do_emdk(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 }
 
 U_BOOT_CMD(
-       emdk, CONFIG_SYS_MAXARGS, 0, do_emdk,
-       "Synopsys EMDK specific commands",
+       emsdp, CONFIG_SYS_MAXARGS, 0, do_emsdp,
+       "Synopsys EMSDP specific commands",
        "rom unlock - Unlock non-volatile memory for writing\n"
-       "emdk rom lock - Lock non-volatile memory to prevent writing\n"
+       "emsdp rom lock - Lock non-volatile memory to prevent writing\n"
 );
diff --git a/board/synopsys/iot_devkit/README b/board/synopsys/iot_devkit/README
new file mode 100644 (file)
index 0000000..20c140d
--- /dev/null
@@ -0,0 +1,145 @@
+================================================================================
+Useful notes on bulding and using of U-Boot on
+ARC IoT Development Kit (AKA IoTDK)
+================================================================================
+
+   BOARD OVERVIEW
+
+   The DesignWare ARC IoT Development Kit is a versatile platform that includes
+   the necessary hardware and software to accelerate software development and
+   debugging of sensor fusion, voice recognition and face detection designs.
+
+   The ARC IoT Development Kit includes a silicon implementation of the
+   ARC Data Fusion IP Subsystem running at 144 MHz on SMIC's
+   55-nm ultra-low power process, and a rich set of peripherals commonly used
+   in IoT designs such as USB, UART, SPI, I2C, PWM, SDIO and ADCs.
+
+   The board is shipped with pre-installed U-Boot in non-volatile memory
+   (eFlash) so on power-on user sees U-Boot start header and command line
+   prompt which might be used for U-Boot environment fine-tuning, manual
+   loading and execution of user application binaries etc.
+
+   The board has the following features useful for U-Boot:
+    * On-board 2-channel FTDI TTL-to-USB converter
+      - The first channel is used for serial debug port (which makes it possible
+        to use a serial connection on pretty much any host machine be it
+        Windows, Linux or Mac).
+        On Linux machine typucally FTDI serial port would be /dev/ttyUSB0.
+        There's no HW flow-control and baud-rate is 115200.
+
+      - The second channel is used for built-in Digilent USB JTAG probe.
+        That means no extra hardware is required to access ARC core from a
+        debugger on development host. Both proprietary MetaWare debugger and
+        open source OpenOCD + GDB client are supported.
+
+      - Also with help of this FTDI chip it is possible to reset entire
+        board with help of a special `rff-ftdi-reset` utility, see:
+        https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset
+
+    * Micro SD-card slot
+      - U-Boot expects to see the very first partition on the card formatted as
+        FAT file-system and uses it for keeping its environment in `uboot.env`
+        file. Note uboot.env is not just a text file but it is auto-generated
+        file created by U-Boot on invocation of `saveenv` command.
+        It contains a checksum which makes this saved environment invalid in
+        case of maual modification.
+
+      - There might be more useful files on that first FAT partition like
+        user applications, data files etc.
+
+    * USB OTG connector
+      - U-Boot may access USB mass-storage devices attached to this connector.
+        Note only FAT file-system is supported. It might be used for storing
+        user application binaries as well as micro SD-card mentioned above.
+
+    * The following memories are avaialble on the board:
+      - eFlash:        256 KiB @ 0x0000_0000
+        A non-volatile memory from which ARC core may execute code directly.
+        Still is is not direcly writable, thus this is not an ordinary RAM.
+
+      - ICCM:  256 KiB @ 0x2000_0000
+        Instruction Closely Coupled Memory - fast on-chip memory primary used
+        for code being executed, still data could be placed in this memory too.
+        In that sense it's just a general purpose RAM.
+
+      - SRAM:  128 KiB @ 0x3000_0000
+        On-chip SRAM. From user perspective is the same as ICCM above.
+
+      - DCCM:  128 KiB @ 0x8000_0000
+        Data Closely Coupled Memory is similar to ICCM with a major difference -
+        ARC core cannot execute code from DCCM. So this is very special RAM
+        only suitable for data.
+
+   BUILDING U-BOOT
+
+   1. Configure U-Boot:
+      ------------------------->8----------------------
+      make iot_devkit_defconfig
+      ------------------------->8----------------------
+
+   2. To build Elf file (for example to be used with host debugger via JTAG
+      connection to the target board):
+      ------------------------->8----------------------
+      make mdbtrick
+      ------------------------->8----------------------
+
+      This will produce `u-boot` Elf file.
+
+   3. To build binary image to be put in "ROM":
+      ------------------------->8----------------------
+      make u-boot.bin
+      ------------------------->8----------------------
+
+
+   EXECUTING U-BOOT
+
+   1. The IoTDK board is supposed to auto-start U-Boot image stored in eFlash on
+      power-on. Note it's possible to update that image - follow instructions in
+      user's manual.
+
+   2. Though it is possible to load and start U-Boot as a simple Elf file
+      via JTAG right in ICCM. For that it's required to re-configure U-Boot
+      so it gets linked to ICCM address 0x2000_0000 (remember eFlash is not
+      direcly writable).
+      Run U-Boot's configuration utility with "make menuconfig", go to
+      "Boot images" and change "Text Base" from default 0x00000000 to
+      0x20000000. Exit & save new configuration. Now run "make mdbtrick" to
+      build new Elf.
+
+      2.1. In case of proprietary MetaWare debugger run:
+      ------------------------->8----------------------
+      mdb -digilent u-boot
+      ------------------------->8----------------------
+
+   USING U-BOOT
+
+   Note due to limited memory size it's supposed that user will run binary
+   images of their applications instead of loading Elf files.
+
+   1. To load and start application binary from micro SD-card execute
+      the following commands in U-Boot's shell:
+      ------------------------->8----------------------
+      fatload mmc 0 0x20000000 yourapp.bin
+      go 0x20000000
+      ------------------------->8----------------------
+
+   2. To load and start application binary from USB mass-storage device execute
+      the following commands in U-Boot's shell:
+      ------------------------->8----------------------
+      usb start
+      fatload usb 0x20000000 yourapp.bin
+      go 0x20000000
+      ------------------------->8----------------------
+
+   3. To have a sequence of commands executed on U-Boot start put those
+      commands in "bootcmd" with semicolon between them.
+      For example to get (1) done automatically:
+      ------------------------->8----------------------
+      setenv bootcmd fatload mmc 0 0x20000000 yourapp.bin\; go 0x20000000
+      saveenv
+      ------------------------->8----------------------
+
+   4. To reboot the board just run:
+      ------------------------->8----------------------
+      reset
+      ------------------------->8----------------------
index d9cdaf6..ac4830a 100644 (file)
@@ -15,7 +15,6 @@ obj-$(CONFIG_CMD_AES) += aes.o
 obj-$(CONFIG_CMD_ADC) += adc.o
 obj-$(CONFIG_CMD_ARMFLASH) += armflash.o
 obj-y += blk_common.o
-obj-$(CONFIG_SOURCE) += source.o
 obj-$(CONFIG_CMD_SOURCE) += source.o
 obj-$(CONFIG_CMD_BDI) += bdinfo.o
 obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
index 9aebfc2..81463f3 100644 (file)
@@ -120,7 +120,7 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
        if (argc != 4)
                return CMD_RET_USAGE;
 
-       id = (int)simple_strtoul(argv[1], NULL, 3);
+       id = (int)simple_strtoul(argv[1], NULL, 10);
        addr = simple_strtoul(argv[2], NULL, 16);
 
        size = simple_strtoul(argv[3], NULL, 16);
@@ -163,7 +163,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
        if (argc != 2)
                return CMD_RET_USAGE;
 
-       id = (int)simple_strtoul(argv[1], NULL, 3);
+       id = (int)simple_strtoul(argv[1], NULL, 10);
 
        if (!rproc_is_initialized()) {
                printf("\tRemote Processors are not initialized\n");
similarity index 88%
rename from configs/emdk_defconfig
rename to configs/emsdp_defconfig
index c839d6f..273334b 100644 (file)
@@ -1,13 +1,13 @@
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
 CONFIG_CPU_ARCEM6=y
-CONFIG_TARGET_EMDK=y
+CONFIG_TARGET_EMSDP=y
 CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SYS_CLK_FREQ=40000000
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
-CONFIG_SYS_PROMPT="emdk# "
+CONFIG_SYS_PROMPT="emsdp# "
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MMC=y
@@ -15,7 +15,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
-CONFIG_DEFAULT_DEVICE_TREE="emdk"
+CONFIG_DEFAULT_DEVICE_TREE="emsdp"
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
index e40ee00..4a78b2d 100644 (file)
@@ -32,7 +32,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_ptc_ek"
-CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_FAT=y
 CONFIG_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_CLK=y
index 414f4a5..2561a8a 100644 (file)
@@ -86,12 +86,19 @@ config SPL_DM_REGULATOR_FIXED
 
 config DM_REGULATOR_GPIO
        bool "Enable Driver Model for GPIO REGULATOR"
-       depends on DM_REGULATOR
+       depends on DM_REGULATOR && DM_GPIO
        ---help---
        This config enables implementation of driver-model regulator uclass
        features for gpio regulators. The driver implements get/set for
        voltage value.
 
+config SPL_DM_REGULATOR_GPIO
+       bool "Enable Driver Model for GPIO REGULATOR in SPL"
+       depends on DM_REGULATOR_GPIO && SPL_GPIO_SUPPORT
+       ---help---
+       This config enables implementation of driver-model regulator uclass
+       features for gpio regulators in SPL.
+
 config REGULATOR_RK8XX
        bool "Enable driver for RK8XX regulators"
        depends on DM_REGULATOR && PMIC_RK8XX
index 56186e5..0967acc 100644 (file)
@@ -31,7 +31,7 @@ static int ds24xxx_probe(struct udevice *dev)
 {
        struct w1_device *w1;
 
-       w1 = dev_get_platdata(dev);
+       w1 = dev_get_parent_platdata(dev);
        w1->id = 0;
        return 0;
 }
index aecf7fe..cb41b68 100644 (file)
@@ -115,17 +115,19 @@ int w1_get_bus(int busnum, struct udevice **busp)
        struct udevice *dev;
 
        for (ret = uclass_first_device(UCLASS_W1, &dev);
-            !ret;
-            uclass_next_device(&dev), i++) {
-               if (ret) {
-                       debug("Cannot find w1 bus %d\n", busnum);
-                       return ret;
-               }
+            dev && !ret;
+            ret = uclass_next_device(&dev), i++) {
                if (i == busnum) {
                        *busp = dev;
                        return 0;
                }
        }
+
+       if (!ret) {
+               debug("Cannot find w1 bus %d\n", busnum);
+               ret = -ENODEV;
+       }
+
        return ret;
 }
 
index d48b7d0..63305a7 100644 (file)
@@ -85,8 +85,9 @@
 #define CONFIG_ENV_OFFSET_REDUND       0x100000
 #define CONFIG_ENV_SIZE                0x20000         /* 1 sector = 128 kB */
 #define CONFIG_BOOTCOMMAND     "nand read " \
-                               "0x22000000 0x200000 0x300000; " \
-                               "bootm 0x22000000"
+                               "0x22000000 0x200000 0x600000; " \
+                               "nand read 0x21000000 0x180000 0x20000; " \
+                               "bootz 0x22000000 - 0x21000000"
 #elif defined(CONFIG_SPI_BOOT)
 /* bootstrap + u-boot + env + linux in spi flash */
 #define CONFIG_ENV_OFFSET      0x5000
similarity index 85%
rename from include/configs/emdk.h
rename to include/configs/emsdp.h
index dca13e2..385d59e 100644 (file)
@@ -3,8 +3,8 @@
  * Copyright (C) 2018 Synopsys, Inc. All rights reserved.
  */
 
-#ifndef _CONFIG_EMDK_H_
-#define _CONFIG_EMDK_H_
+#ifndef _CONFIG_EMSDP_H_
+#define _CONFIG_EMSDP_H_
 
 #include <linux/sizes.h>
 
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "upgrade_image=u-boot.bin\0" \
-       "upgrade=emdk rom unlock && " \
+       "upgrade=emsdp rom unlock && " \
                "fatload mmc 0 ${loadaddr} ${upgrade_image} && " \
                "cp.b ${loadaddr} 0 ${filesize} && " \
                "dcache flush && " \
-               "emdk rom lock\0"
+               "emsdp rom lock\0"
 
-#endif /* _CONFIG_EMDK_H_ */
+#endif /* _CONFIG_EMSDP_H_ */
 
index 560753a..3c9c87f 100644 (file)
@@ -93,7 +93,6 @@
                AVB_VERIFY_CHECK \
                "part start mmc ${mmcdev} boot boot_start; " \
                "part size mmc ${mmcdev} boot boot_size; " \
-               "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
                "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
                "bootm ${loadaddr}#${fdtfile};\0 "
 
index 13e3f40..22f05a4 100644 (file)
@@ -49,7 +49,12 @@ static int match(struct tee_version_data *vers, const void *data)
        return vers->gen_caps & TEE_GEN_CAP_GP;
 }
 
-static int dm_test_tee(struct unit_test_state *uts)
+struct test_tee_vars {
+       struct tee_shm *reg_shm;
+       struct tee_shm *alloc_shm;
+};
+
+static int test_tee(struct unit_test_state *uts, struct test_tee_vars *vars)
 {
        struct tee_version_data vers;
        struct udevice *dev;
@@ -57,8 +62,6 @@ static int dm_test_tee(struct unit_test_state *uts)
        u32 session = 0;
        int rc;
        u8 data[128];
-       struct tee_shm *reg_shm;
-       struct tee_shm *alloc_shm;
 
        dev = tee_find_device(NULL, match, NULL, &vers);
        ut_assert(dev);
@@ -77,22 +80,36 @@ static int dm_test_tee(struct unit_test_state *uts)
        ut_assert(!state->session);
 
        ut_assert(!state->num_shms);
-       rc = tee_shm_register(dev, data, sizeof(data), 0, &reg_shm);
+       rc = tee_shm_register(dev, data, sizeof(data), 0, &vars->reg_shm);
        ut_assert(!rc);
        ut_assert(state->num_shms == 1);
 
-       rc = tee_shm_alloc(dev, 256, 0, &alloc_shm);
+       rc = tee_shm_alloc(dev, 256, 0, &vars->alloc_shm);
        ut_assert(!rc);
        ut_assert(state->num_shms == 2);
 
-       ut_assert(tee_shm_is_registered(reg_shm, dev));
-       ut_assert(tee_shm_is_registered(alloc_shm, dev));
+       ut_assert(tee_shm_is_registered(vars->reg_shm, dev));
+       ut_assert(tee_shm_is_registered(vars->alloc_shm, dev));
 
-       tee_shm_free(reg_shm);
-       tee_shm_free(alloc_shm);
+       tee_shm_free(vars->reg_shm);
+       vars->reg_shm = NULL;
+       tee_shm_free(vars->alloc_shm);
+       vars->alloc_shm = NULL;
        ut_assert(!state->num_shms);
 
        return 0;
 }
 
+static int dm_test_tee(struct unit_test_state *uts)
+{
+       struct test_tee_vars vars = { NULL, NULL };
+       int rc = test_tee(uts, &vars);
+
+       /* In case test_tee() asserts these may still remain allocated */
+       tee_shm_free(vars.reg_shm);
+       tee_shm_free(vars.alloc_shm);
+
+       return rc;
+}
+
 DM_TEST(dm_test_tee, DM_TESTF_SCAN_FDT);
index 442cc8f..6252580 100644 (file)
@@ -195,15 +195,13 @@ static int compare_relocs(const void *a, const void *b)
 int main(int argc, char *argv[])
 {
        unsigned int i, j, i_rel_shdr, sh_type, sh_entsize, sh_entries;
-       size_t rel_size, rel_actual_size, load_sz;
+       size_t rel_size, rel_actual_size;
        const char *shstrtab, *sh_name, *rel_pfx;
        int (*parse_fn)(const void *rel);
        uint8_t *buf_start, *buf;
        const Elf32_Ehdr *ehdr32;
        const Elf64_Ehdr *ehdr64;
        uintptr_t sh_offset;
-       Elf32_Phdr *phdr32;
-       Elf64_Phdr *phdr64;
        Elf32_Shdr *shdr32;
        Elf64_Shdr *shdr64;
        struct stat st;
@@ -285,8 +283,6 @@ int main(int argc, char *argv[])
                goto out_free_relocs;
        }
 
-       phdr32 = elf + ehdr_field(e_phoff);
-       phdr64 = elf + ehdr_field(e_phoff);
        shdr32 = elf + ehdr_field(e_shoff);
        shdr64 = elf + ehdr_field(e_shoff);
        shstrtab = elf + shdr_field(ehdr_field(e_shstrndx), sh_offset);
@@ -295,7 +291,7 @@ int main(int argc, char *argv[])
        for (i = 0; i < ehdr_field(e_shnum); i++) {
                sh_name = shstr(shdr_field(i, sh_name));
 
-               if (!strcmp(sh_name, ".rel")) {
+               if (!strcmp(sh_name, ".data.reloc")) {
                        i_rel_shdr = i;
                        continue;
                }
@@ -397,22 +393,12 @@ int main(int argc, char *argv[])
        rel_size = shdr_field(i_rel_shdr, sh_size);
        rel_actual_size = buf - buf_start;
        if (rel_actual_size > rel_size) {
-               fprintf(stderr, "Relocs overflowed .rel section\n");
-               return -ENOMEM;
-       }
-
-       /* Update the .rel section's size */
-       set_shdr_field(i_rel_shdr, sh_size, rel_actual_size);
-
-       /* Shrink the PT_LOAD program header filesz (ie. shrink u-boot.bin) */
-       for (i = 0; i < ehdr_field(e_phnum); i++) {
-               if (phdr_field(i, p_type) != PT_LOAD)
-                       continue;
-
-               load_sz = phdr_field(i, p_filesz);
-               load_sz -= rel_size - rel_actual_size;
-               set_phdr_field(i, p_filesz, load_sz);
-               break;
+               fprintf(stderr, "Relocations overflow available space of 0x%lx (required 0x%lx)!\n",
+                       rel_size, rel_actual_size);
+               fprintf(stderr, "Please adjust CONFIG_MIPS_RELOCATION_TABLE_SIZE to at least 0x%lx\n",
+                       (rel_actual_size + 0x100) & ~0xFF);
+               err = -ENOMEM;
+               goto out_free_relocs;
        }
 
        /* Make sure data is written back to the file */