diff options
-rw-r--r-- | arch/arc/Kconfig | 6 | ||||
-rw-r--r-- | arch/arc/dts/Makefile | 2 | ||||
-rw-r--r-- | arch/arc/dts/emsdp.dts (renamed from arch/arc/dts/emdk.dts) | 2 | ||||
-rw-r--r-- | arch/mips/Kconfig | 18 | ||||
-rw-r--r-- | arch/mips/config.mk | 2 | ||||
-rw-r--r-- | arch/mips/cpu/u-boot.lds | 20 | ||||
-rw-r--r-- | board/synopsys/emsdp/Kconfig (renamed from board/synopsys/emdk/Kconfig) | 6 | ||||
-rw-r--r-- | board/synopsys/emsdp/MAINTAINERS (renamed from board/synopsys/emdk/MAINTAINERS) | 5 | ||||
-rw-r--r-- | board/synopsys/emsdp/Makefile (renamed from board/synopsys/emdk/Makefile) | 2 | ||||
-rw-r--r-- | board/synopsys/emsdp/README (renamed from board/synopsys/emdk/README) | 11 | ||||
-rw-r--r-- | board/synopsys/emsdp/emsdp.c (renamed from board/synopsys/emdk/emdk.c) | 18 | ||||
-rw-r--r-- | board/synopsys/iot_devkit/README | 145 | ||||
-rw-r--r-- | cmd/Makefile | 1 | ||||
-rw-r--r-- | cmd/remoteproc.c | 4 | ||||
-rw-r--r-- | configs/emsdp_defconfig (renamed from configs/emdk_defconfig) | 6 | ||||
-rw-r--r-- | configs/sama5d2_ptc_ek_mmc_defconfig | 2 | ||||
-rw-r--r-- | drivers/power/regulator/Kconfig | 9 | ||||
-rw-r--r-- | drivers/w1-eeprom/ds24xxx.c | 2 | ||||
-rw-r--r-- | drivers/w1/w1-uclass.c | 14 | ||||
-rw-r--r-- | include/configs/at91sam9x5ek.h | 5 | ||||
-rw-r--r-- | include/configs/emsdp.h (renamed from include/configs/emdk.h) | 10 | ||||
-rw-r--r-- | include/environment/ti/boot.h | 1 | ||||
-rw-r--r-- | test/dm/tee.c | 35 | ||||
-rw-r--r-- | tools/mips-relocs.c | 30 |
24 files changed, 269 insertions, 87 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index b24593e137..fa6b3447c9 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -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" diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile index 17e1405c0c..4f1e4637ce 100644 --- a/arch/arc/dts/Makefile +++ b/arch/arc/dts/Makefile @@ -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 diff --git a/arch/arc/dts/emdk.dts b/arch/arc/dts/emsdp.dts index ebe538d06f..d307b95d8e 100644 --- a/arch/arc/dts/emdk.dts +++ b/arch/arc/dts/emsdp.dts @@ -7,7 +7,7 @@ #include "skeleton.dtsi" / { - model = "snps,emdk"; + model = "snps,emsdp"; #address-cells = <1>; #size-cells = <1>; diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 071dea04ec..6d646ef999 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -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" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 8aa45fc45c..22223a0f3e 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -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 diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds index f2c9f94f74..fd0f1b5d4f 100644 --- a/arch/mips/cpu/u-boot.lds +++ b/arch/mips/cpu/u-boot.lds @@ -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) : { diff --git a/board/synopsys/emdk/Kconfig b/board/synopsys/emsdp/Kconfig index a9b834dbfd..8228bb5c74 100644 --- a/board/synopsys/emdk/Kconfig +++ b/board/synopsys/emsdp/Kconfig @@ -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 diff --git a/board/synopsys/emdk/MAINTAINERS b/board/synopsys/emsdp/MAINTAINERS index 605e338445..6404013957 100644 --- a/board/synopsys/emdk/MAINTAINERS +++ b/board/synopsys/emsdp/MAINTAINERS @@ -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 diff --git a/board/synopsys/emdk/Makefile b/board/synopsys/emsdp/Makefile index 4926c4e307..733a48c46a 100644 --- a/board/synopsys/emdk/Makefile +++ b/board/synopsys/emsdp/Makefile @@ -4,4 +4,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y += emdk.o +obj-y += emsdp.o diff --git a/board/synopsys/emdk/README b/board/synopsys/emsdp/README index 706b547a9e..034062e397 100644 --- a/board/synopsys/emdk/README +++ b/board/synopsys/emsdp/README @@ -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 diff --git a/board/synopsys/emdk/emdk.c b/board/synopsys/emsdp/emsdp.c index 79cafefb8b..b5ec7f17ec 100644 --- a/board/synopsys/emdk/emdk.c +++ b/board/synopsys/emsdp/emsdp.c @@ -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 index 0000000000..20c140d93c --- /dev/null +++ b/board/synopsys/iot_devkit/README @@ -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---------------------- diff --git a/cmd/Makefile b/cmd/Makefile index d9cdaf6064..ac4830a692 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -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 diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c index 9aebfc2f6e..81463f36b6 100644 --- a/cmd/remoteproc.c +++ b/cmd/remoteproc.c @@ -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"); diff --git a/configs/emdk_defconfig b/configs/emsdp_defconfig index c839d6f3f6..273334b05d 100644 --- a/configs/emdk_defconfig +++ b/configs/emsdp_defconfig @@ -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" diff --git a/configs/sama5d2_ptc_ek_mmc_defconfig b/configs/sama5d2_ptc_ek_mmc_defconfig index e40ee00312..4a78b2da3d 100644 --- a/configs/sama5d2_ptc_ek_mmc_defconfig +++ b/configs/sama5d2_ptc_ek_mmc_defconfig @@ -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 diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig index 414f4a53f7..2561a8a856 100644 --- a/drivers/power/regulator/Kconfig +++ b/drivers/power/regulator/Kconfig @@ -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 diff --git a/drivers/w1-eeprom/ds24xxx.c b/drivers/w1-eeprom/ds24xxx.c index 56186e587c..0967accdf0 100644 --- a/drivers/w1-eeprom/ds24xxx.c +++ b/drivers/w1-eeprom/ds24xxx.c @@ -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; } diff --git a/drivers/w1/w1-uclass.c b/drivers/w1/w1-uclass.c index aecf7fec77..cb41b68eff 100644 --- a/drivers/w1/w1-uclass.c +++ b/drivers/w1/w1-uclass.c @@ -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; } diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h index d48b7d0785..63305a7cdd 100644 --- a/include/configs/at91sam9x5ek.h +++ b/include/configs/at91sam9x5ek.h @@ -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 diff --git a/include/configs/emdk.h b/include/configs/emsdp.h index dca13e2fff..385d59e338 100644 --- a/include/configs/emdk.h +++ b/include/configs/emsdp.h @@ -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> @@ -30,11 +30,11 @@ #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_ */ diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h index 560753ae4c..3c9c87f21b 100644 --- a/include/environment/ti/boot.h +++ b/include/environment/ti/boot.h @@ -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 " diff --git a/test/dm/tee.c b/test/dm/tee.c index 13e3f4003a..22f05a4219 100644 --- a/test/dm/tee.c +++ b/test/dm/tee.c @@ -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, ®_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); diff --git a/tools/mips-relocs.c b/tools/mips-relocs.c index 442cc8f6d2..625258085b 100644 --- a/tools/mips-relocs.c +++ b/tools/mips-relocs.c @@ -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 */ |