summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-22tools: Fix return code of fit_image_process_sig()mario.six@gdsys.cc
When signing images, we repeatedly call fit_add_file_data() with successively increasing size values to include the keys in the DTB. Unfortunately, if large keys are used (such as 4096 bit RSA keys), this process fails sometimes, and mkimage needs to be called repeatedly to integrate the keys into the DTB. This is because fit_add_file_data actually returns the wrong error code, and the loop terminates prematurely, instead of trying again with a larger size value. This patch corrects the return value and also removes a error message, which is misleading, since we actually allow the function to fail. A (hopefully helpful) comment is also added to explain the lack of error message. This is probably related to 1152a05 ("tools: Correct error handling in fit_image_process_hash()") and the corresponding error reported here: https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html Signed-off-by: Mario Six <mario.six@gdsys.cc>
2016-07-22test/py: use absolute dts path in vboot testStephen Warren
Without this, the test fails if the test is run with a cwd other than the root of the U-Boot source tree. Fixes: 8729d582595d ("test: Convert the vboot test to test/py") Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-07-22armv8: spl: Call board_init_r from crt0_64 in SPLJeremy Hunt
As part of the startup process for boards using the SPL, the meaning of board_init_f changed such that it should return normally rather than calling board_init_r directly. (see db910353a126d84fe8dff7a694ea792f50fcfb6a ) This was fixed in 32-bit arm, but broke when SPL was added to 64 bit arm. This fixes crt0_64 so that it calls board_init_r during the SPL and removes the direct call from board_init_f from the arm SPL example. Signed-off-by: Jeremy Hunt <Jeremy.Hunt@DEShawResearch.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-07-22efi_loader: Add debug output for efi_add_memory_map()Andreas Färber
Tracing the arguments has been helpful for pinpointing overflows. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Alexander Graf <agraf@suse.de>
2016-07-22tools/env: reuse fw_getenv in fw_printenv functionAndreas Fenkart
Try to avoid adhoc iteration of the environment. Reuse fw_getenv to find the variables that should be printed. Only use open-coded iteration when printing all variables. For backwards compatibility, keep emitting a newline when printing with value_only. Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-07-22tools/env: move envmatch further up in file to avoid forward declarationsAndreas Fenkart
forward declaration not needed when re-ordered Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-07-22tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_scriptAndreas Fenkart
there are two groups of functions: - application ready tools: fw_setenv/fw_getenv/fw_parse_script these are used, when creating a single binary containing multiple tools (busybox like) - file access like: open/read/write/close above functions are implemented on top of these. applications can use those to modify several variables without creating a temporary batch script file tested with "./scripts/kernel-doc -html -v tools/env/fw_env.h" Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-07-22gdsys: Drop print_fpga_state functionTom Rini
On most platforms the print_fpga_state function is never called. Only on dlvision-10g do we, so in that case inline it. Drop it from everywhere else to avoid extra strings. Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Reinhard Pfau <reinhard.pfau@gdsys.cc> Acked-by: Dirk Eibach <dirk.eibach@gdsys.cc>
2016-07-22tools/env: allow negative offsetsStefan Agner
A negative value for the offset is treated as a backwards offset for from the end of the device/partition for block devices. This aligns the behavior of the config file with the syntax of CONFIG_ENV_OFFSET where the functionality has been introduced with commit 5c088ee841f9 ("env_mmc: allow negative CONFIG_ENV_OFFSET"). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-07-22tools/env: complete environment device config earlyStefan Agner
Currently flash_read completes a crucial part of the environment device configuration, the device type (mtd_type). This is rather confusing as flash_io calls flash_read conditionally, and one might think flash_write, which also makes use of mtd_type, gets called before flash_read. But since flash_io is always called with O_RDONLY first, this is not actually the case in reality. However, it is much cleaner to complete and verify the config early in parse_config. This also prepares the code for further extension. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Andreas Fenkart
2016-07-22iso: Fix part info commandAlexander Graf
Partitions on the iso el torito partition table interpreter only start from partition 1. So when printing out the tables, let's also start counting at 1. Signed-off-by: Alexander Graf <agraf@suse.de>
2016-07-22igep00x0: Falcon modeLadislav Michl
Implement spl_start_uboot to let Falcon mode work. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2016-07-22igep00x0: generate default mtdparts according NAND chip usedLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22igep00x0: UBIizeLadislav Michl
Convert IGEP board to use UBI volumes for U-Boot, its environment and kernel. With exception of first four sectors read by SoC boot ROM whole (One)NAND is UBI managed. Also merge NAND and OneNAND defconfigs as now one binary can serve both flashes. As code is too big now, drop CONFIG_SPL_EXT_SUPPORT to make it fit. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22igep00x0: runtime flash detectionLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22igep00x0: remove unused empty function omap_rev_string()Ladislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22igep00x0: remove useless setup_net_chip declarationLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22igep00x0: reorder lan9221 code to remove ifdefsLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22igep00x0: move sysinfo into C fileLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22cmd: mtdparts: support runtime generated mtdpartsLadislav Michl
Some CPUs contains boot ROM code capable reading first few blocks (where SPL resides) of NAND flash and executing it. It is wise to create separate partition here for SPL. As block size depends on NAND chip used, we could either use worst case (biggest) partition size or base its size on actual block size. This patch adds support for the latter option. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22cmd: mtdparts: use defaults by defaultLadislav Michl
Boards which are defining default mtdparts often need them early in boot process (to load environment from UBI volume, for example). This is currently solved by adding mtdparts and mtdids variable definitions also to default environment. With this change, default partitions are used by default unless explicitely deleted or redefined. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22cmd: mtdparts: consolidate mtdparts reading from envLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22cmd: mtdparts: fix null pointer dereference in parse_mtdpartsLadislav Michl
In case there is no mtdparts variable in relocated environment, NULL is assigned to p, which is later fed to strncpy. Also function parameter mtdparts is completely ignored, so use it in case mtdparts variable is not found in environment. This parameter is checked not to be NULL in caller. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22cmd: mtdparts: fix mtdparts variable presence confusion in mtdparts_initLadislav Michl
A private buffer is used to read mtdparts variable from non-relocated environment. A pointer to that buffer is returned unconditionally, confusing later test for variable presence in the environment. Fix it by returning NULL when getenv_f fails. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22mtd: OneNAND: initialize mtd->writebufsize to let UBI workLadislav Michl
io_init checks this value and fails with "bad write buffer size 0 for 2048 min. I/O unit" Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22mtd: OneNAND: allow board init function failLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22mtd: OneNAND: add timeout to wait ready loopsLadislav Michl
Add timeout to onenand_wait ready loop as it hangs here indefinitely when chip not present. Once there, do the same for onenand_bbt_wait as well (note: recent Linux driver code does the same) Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22armv7: simplify identify_nand_chipLadislav Michl
Use newly introduced function Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22armv7: armv7: introduce set_gpmc_cs0Ladislav Michl
Allow boards to runtime detect flash type. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22armv7: make gpmc_cfg constLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> [trini: Adapt am33xx, duovero, omap_zoom1] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-07-22armv7: add reset timeout to identify_nand_chipLadislav Michl
identify_nand_chip hangs forever in loop when NAND is not present. As IGEPv2 comes either with NAND or OneNAND flash, add reset timeout to let function fail gracefully allowing caller to know NAND is not present. On NAND equipped board, reset succeeds on first read, so 1000 loops seems to be safe timeout. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22spl: zImage support in Falcon modeLadislav Michl
Other payload than uImage is currently considered to be raw U-Boot image. Check also for zImage in Falcon mode. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22spl: support loading from UBI volumesLadislav Michl
Add support for loading from UBI volumes on the top of NAND and OneNAND. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22spl: Lightweight UBI and UBI fastmap supportThomas Gleixner
Booting a payload out of NAND FLASH from the SPL is a crux today, as it requires hard partioned FLASH. Not a brilliant idea with the reliability of todays NAND FLASH chips. The upstream UBI + UBI fastmap implementation which is about to brought to u-boot is too heavy weight for SPLs as it provides way more functionality than needed for a SPL and does not even fit into the restricted SPL areas which are loaded from the SoC boot ROM. So this provides a fast and lightweight implementation of UBI scanning and UBI fastmap attach. The scan and logical to physical block mapping code is developed from scratch, while the fastmap implementation is lifted from the linux kernel source and stripped down to fit the SPL needs. The text foot print on the board which I used for development is: 6854 0 0 6854 1abd drivers/mtd/ubispl/built-in.o Attaching a NAND chip with 4096 physical eraseblocks (4 blocks are reserved for the SPL) takes: In full scan mode: 1172ms In fastmap mode: 95ms The code requires quite some storage. The largest and unknown part of it is the number of fastmap blocks to read. Therefor the data structure is not put into the BSS. The code requires a pointer to free memory handed in which is initialized by the UBI attach code itself. See doc/README.ubispl for further information on how to use it. This shares the ubi-media.h and crc32 implementation of drivers/mtd/ubi There is no way to share the fastmap code, as UBISPL only utilizes the slightly modified functions ubi_attach_fastmap() and ubi_scan_fastmap() from the original kernel ubi fastmap implementation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Heiko Schocher <hs@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-07-22onenand_spl_simple: Add a simple OneNAND read functionLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2016-07-22nand_spl_simple: Add a simple NAND read functionThomas Gleixner
To support UBI in SPL we need a simple NAND read function. Add one to nand_spl_simple and keep it as simple as it goes. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Scott Wood <oss@buserror.net> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22mtd: Sort subsystem directories aplhabeticaly in MakefileLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22i2c_eeprom: Add reading supportmario.six@gdsys.cc
This patch implements the reading functionality for the generic I2C EEPROM driver, which was just a non-functional stub until now. Since the page size will be of importance for the writing support, we add suitable members to the private data structure to keep track of it. Compatibility strings for a range of at24c* chips are added. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-22Merge branch 'master' of git://www.denx.de/git/u-boot-microblazeTom Rini
2016-07-22zynq: defconfig: Remove unnecessary board specific config filesSiva Durga Prasad Paladugu
Remove unnecessary board specifc config files for zynq boards(microzed, picozed, ZC770(all), zed) and point to zynq common config file. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22zynq: config: Enable CONFIG_SYS_NO_FLASH through defconfigSiva Durga Prasad Paladugu
Enable config CONFIG_SYS_NO_FLASH through defconfig for all zynq boards. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22Kconfig: Move option CONFIG_SYS_NO_FLASH to KconfigSiva Durga Prasad Paladugu
Move config option CONFIG_SYS_NO_FLASH as Kconfig option. All the boards which needs to enable this option can be done through defconfigs Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22usb: zynq: Define config USB_STORAGE through defconfigSiva Durga Prasad Paladugu
Define config USB_STORAGE through defconfig for all respective zynq boards Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22usb: Kconfig: Add Kconfigs entry USB_EHCI_ZYNQSiva Durga Prasad Paladugu
Add Kconfig entry config option for USB_EHCI_ZYNQ and update the same to enable for all zynq boards which supports USB Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22ARM64: zynqmp: Enable AHCI on EP platformAlexander Graf
The EP platform also has working AHCI emulation, so I see little reason not to implement the plumbing for it that enables us to boot from AHCI. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22microblaze: Remove empty ifdef around cachesMichal Simek
Code around was removed because of move to Kconfig. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22dm: clk: Remove simple version of clk_get_by_index/name()Michal Simek
Simple version of clk_get_by_index() added by: "dm: clk: Add a simple version of clk_get_by_index()" (sha1: a4b10c088c4f6ef2e2bba33e8cfea369bcbbce44) is only working for #clock-cells=<1> but not for any other values. Fixed clocks is using #clock-cells=<0> which requires full implementation. Remove simplified versions of clk_get_by_index() and use full version. Also remove empty clk_get_by_name() which is failing when it is called which is useless. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2016-07-22ARM64: zynqmp: Remove get_uart_clk()Michal Simek
ZynqMP will use reading clock freq directly from DT. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-07-22serial: zynq: Read information about clock from DTMichal Simek
Read information about clock frequency from DT. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2016-07-22ARM64: zynqmp: Enable SPL for all zynqmp boardsMichal Simek
Compile SPL for all boards even psu_init.c/h files are not in the tree yet. But this change enables covering SPL issues in mainline. Signed-off-by: Michal Simek <michal.simek@xilinx.com>