summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | partition: include partuuid string in debug stringAhmad Fatoum2019-10-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging partitions detected by barebox, knowing the partuuid can be useful. Include it in the dev_dbg output. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | sandbox: add_image: output errno string on mmap failureRobert Karszniewicz2019-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | commands: passwd: suggest sandbox for offline password generationAhmad Fatoum2019-10-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users might want to generate the password while the target is offline. We don't provide a dedicated host tool for that, but barebox sandbox can be used. Document this possibility. While at it, remove a misplaced single quite and slash in the help text. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hwrng: dev-random: always use /dev/urandomAhmad Fatoum2019-10-233-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /dev/random can block long after boot time. It seems there's a consensus that /dev/urandom is safe to use except for very early boot, which isn't when barebox sandbox is usually run. To make the HWRNG more useful, always use /dev/urandom. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | edit: add vi alias with vi-style bindingsAhmad Fatoum2019-10-181-8/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The edit command already supports a few key bindings for code navigation. To improve user experience for vi-impaired users, add a vi alias that maps traditional vi key bindings to the barebox edit ones. This is done by adding a mode-aware read_modal_key that maps vi normal-mode keys to barebox edit. For operations that requires more than one barebox edit key, a backlog of two characters is additionally used. In interest of code size reduction, a command mode (and the associated readline overhead) are not implemented, the effect of the most common commands :q and :wq commands can be realized with vim-like ZQ and ZZ bindings instead. This increases the size of my LZO-compressed THUMB2 barebox by 843 bytes. Acked-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | edit: replace %c for literal with literal directlyAhmad Fatoum2019-10-181-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to use %c for ESC, when we can use the appropriate escape sequence directly. Do this and shave off 60~ bytes on my compressed THUMB-2 barebox. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | readline: make ctrl-u to work like linux consoleDU HUANPENG2019-10-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currtly, the ctrl-u discards the whole line, in most linux boxes, ctrl-u just erase characters before cursor to the begginning of the line. this patch make ctrl-u to do this. Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | cp: complete command helpRobert Karszniewicz2019-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | kbuild: remove ar-optionMasahiro Yamada2019-10-181-5/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 13dc8c029cab ("kbuild: remove ar-option and KBUILD_ARFLAGS") removed this already. Barebox has never used this macro. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mips'Sascha Hauer2019-11-0711-26/+314
|\ \ \
| * | | MIPS: loongsonl: pull headers from linux kernelDu Huanpeng2019-11-067-15/+305
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | MIPS: reloc: init bss and cpuOleksij Rempel2019-10-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We need it to make flush_cache_all() work properly. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | MIPS: move r4k_cache_init in to cpu_probe functionOleksij Rempel2019-10-233-6/+6
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | MIPS: reloc: remove init of relocated bssOleksij Rempel2019-10-231-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It will be done in main_entry() any way. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/imx'Sascha Hauer2019-11-071-1/+2
|\ \ \ \
| * | | | ARM: zii-common: setup Linux cmdline network config on RDU3Lucas Stach2019-11-041-1/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Works the same way as with the older units. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/ext4'Sascha Hauer2019-11-072-70/+23
|\ \ \ \
| * | | | fs: ext4: return NULL instead of 0Sascha Hauer2019-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ext4fs_get_extent_block() returns a pointer, so return NULL instead of integer 0. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | fs: ext4: Fix handling of sparse filesSascha Hauer2019-10-291-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adoption of U-Boot commit: | commit f81db56f2fd6dc16efeaec2961121244765a1f11 | Author: Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de> | Date: Sat Nov 5 22:17:14 2016 +0100 | | ext4: Fix handling of sparse files | | A sparse file may have regions not mapped by any extents, at the start | or at the end of the file, or anywhere between, thus not finding a | matching extent region is never an error. | | Found by python filesystem tests. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | fs: ext4: remove unnecessarily clever file readSascha Hauer2019-10-291-53/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ext4fs_read_file() tries to tries to bundle contiguous block reads into longer reads from the device. In barebox we cache in the block layer already, so this is unnecessary. Simplify the code by removing the bundled reads. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | fs: ext4: Fix out of bounds memsetSascha Hauer2019-10-291-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a block we read is a sparse block, we memset the corresponding output buffer to zero. If that block is the last block we read, we may not memset the whole block, but only up to the length of the output buffer, which may be shorter than a full block. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/efi'Sascha Hauer2019-11-0712-25/+162
|\ \ \ \
| * | | | efi: populate boot source instanceAhmad Fatoum2019-10-283-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already determine the boot source variable at core init level, but so far we didn't populate the instance because the numbering of the block devices isn't known that early. Introduce a helper to check if a block device is the boot source and if it is, have the block device driver populate the missing boot source instance. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | serial: efi-stdio: Add simple_text_input_ex_protocol backendAhmad Fatoum2019-10-232-10/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFI implementations differ in how simple_text_input_protocol treats ctrl+alpha combinations. OVMF (used with QEMU) returns a Unicode control character, the UEFI on the Dell Latitude 7490 on the other hand ignores the ctrl completely and returns just the letter rendering utilities like barebox edit unusable. To fix this, the simple_text_input_ex_protocol can be leveraged as it additionally provides the state of modifier keys. Extend efi-stdio to use it where possible. Cc: Michael Olbrich <mol@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | serial: efi-stdio: replace globals with handles in priv structAhmad Fatoum2019-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite assigning efi_sys_table->{con_in,con_out} to priv->{in,out}, some functions still use the global efi_sys_table->{con_in,con_out}. Let's restrict globals access to the probe function and have the priv struct completely describe input and output used in the callbacks. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: silence warning about un-prototyped assembly-called functionsAhmad Fatoum2019-10-182-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both _relocate and efi_main are only called from assembly, but -Wmissing-prototypes doesn't know that and warns about them. Pre-declare prototypes to silence the warnings. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | x86: include: add asmlinkage 'storage class'Ahmad Fatoum2019-10-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've a number of C functions with external linkage that are only called from assembly. -Wmissing-prototypes warns about these unless they have a prototype that goes unused. Let's standardize on using the asmlinkage 'storage class' to mark such declarations. As <linux/linkage.h> defines asmlinkage to naught unless <asm/linkage.h> does, it's sufficient to add an empty header to make this usable on x86 as well. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: use efi_guidcmp helper where appropriateAhmad Fatoum2019-10-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a helper for it. Let's use it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: retire efi_compare_guid in favor of efi_guidcmpAhmad Fatoum2019-10-182-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both functions wrap the same memcmp except that one uses pointers to GUIDs and the other passes the GUIDs by value. The function is static inline, so it doesn't really matter which one we keep. We'll drop efi_compare_guid because it's been used once only in the code base so far. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: Fix typo in description stringAhmad Fatoum2019-10-181-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | s/Conosle/Console/ Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/dts'Sascha Hauer2019-11-0740-158/+202
|\ \ \ \
| * | | | dts: update to v5.4-rc6Sascha Hauer2019-11-071-0/+23
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | dts: update to v5.4-rc5Sascha Hauer2019-10-2934-152/+160
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | dts: update to v5.4-rc4Sascha Hauer2019-10-295-6/+19
| | |/ / | |/| | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Release v2019.11.0v2019.11.0Sascha Hauer2019-11-071-1/+1
| |_|/ |/| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | serial: cadence: fix serial_flushLucas Stach2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The TXEMPTY bit gets set as soon as the transmit FIFO gets empty, so flushing must wait until the bit is set instead of being unset. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | ARM: pbl: keep __image_end sectionLucas Stach2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all architectures are referencing the image_end section from code, in which case the linker is free to drop the section, which then messes up the calculation of the _barebox_image_size linker variable. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | ARM: zii-commmon: Fix NULL pointer dereference in do_rdu1_switch_reset()Andrey Smirnov2019-11-041-1/+1
|/ / | | | | | | | | | | | | | | | | | | We need to go to parent's private data to get a pointer to struct rave_sp. Fix that. Fixes: 493e2ee38f ("ARM: zii-common: add support for switch reset on RDU1") Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console_simple: fix linking error when ARCH_HAS_CTRLC enabledDU HUANPENG2019-10-181-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this error happens in sandbox with simple console, sandbox has ARCH_HAS_CTRLC enabled by default $ make sandbox_defconfig $ make menuconfig (select CONFIG_SHELL_SIMPLE) $ make LD barebox common/built-in.o: In function `__pr_memory_display': /home/du/source/barebox/common/memory_display.c:117: undefined reference to `ctrlc' common/built-in.o: In function `run_init': /home/du/source/barebox/common/startup.c:317: undefined reference to `console_ctrlc_allow' common/built-in.o: In function `parse_stream_outer': /home/du/source/barebox/common/hush.c:1742: undefined reference to `ctrlc' common/built-in.o: In function `run_list_real': /home/du/source/barebox/common/hush.c:895: undefined reference to `ctrlc' common/built-in.o: In function `run_shell': /home/du/source/barebox/common/hush.c:1940: undefined reference to `ctrlc_handled' Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: build for all SoCs when AT91_MULTI_BOARDS is selectedAhmad Fatoum2019-10-181-3/+3
|/ | | | | | | | | This reverts a hunk I missed after a rebase: A previous commit restricts ARCH_BAREBOX_MAX_BARE_INIT to only non-multi-image boards, so no need to touch it to be compatible with the new multi-image changes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2019-10-172-25/+162
|\
| * usb: Change power-on / scanning timeout handlingPrimoz Fiser2019-10-022-19/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change USB port scanning procedure and timeout handling in the following ways: 1) The power-on delay in usb_hub_power_on() is now reduced to a value of max(100ms, "hub->desc.bPwrOn2PwrGood * 2"). The code does not wait using mdelay, instead usb_hub_power_on() will wait before querying the device in the scanning loop later. The total connection timeout for this hub, which is (1 second + hub->desc.bPwrOn2PwrGood * 2) is calculated and will be used in the following per-port scanning loop as the timeout to detect active USB devices on this hub. 2) Don't delay the minimum delay (for power to stabilize) in usb_hub_power_on(). Instead skip querying these devices in the scanning loop usb_scan_port() until the delay time is reached. 3) The ports are now scanned in a quasi parallel way. The current code did wait for each (unconnected) port to reach its timeout and only then continue with the next port. This patch now changes this to scan all ports of all USB hubs quasi simultaneously. For this, all ports are added to a scanning list in usb_hub_configure_ports(). The list is later scanned in usb_device_list_scan() until all ports are ready by either a) reaching the connection timeout (calculated earlier), or by b) detecting a USB device. This results in a faster USB scan time as the recursive scanning of USB hubs connected to the hub that's currently being scanned will start earlier. 4) Ports with overcurrent detection will get scanned multiple times if OC condition is detected (PORT_OVERCURRENT_MAX_SCAN_COUNT). Without patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 10344ms With patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 4529ms Delta: ~6 seconds Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: usb_hub_port_connect_change(): Remove unnecessary delaysPrimoz Fiser2019-10-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove two mdelay(200) calls from usb_hub_port_connect_change() before and after calling hub_port_reset(). These delays don't seem to be necessary since hub_port_reset() already incorporates delays on its own. Without patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 16355ms With patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 10344ms Delta: ~6 seconds Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: hub_port_reset(): Speedup hub reset handlingPrimoz Fiser2019-10-021-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start with a short USB hub reset delay of 20ms. This can be enough for some configurations. Switch to longer reset delay only if the short delay hasn't been long enough. This USB hub reset handling strategy is also used in the Linux kernel USB hub driver, function hub_port_reset(). Without patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 21750ms With patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 16355ms Delta: ~5.5 seconds Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rsa'Sascha Hauer2019-10-1726-416/+773
|\ \
| * | fit-image: Use compiled-in keysSascha Hauer2019-10-151-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | The compiled-in keys can be retrieved with rsa_get_key(). Try to use them first before falling back to looking up the keys in the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | rsa: Allow to directly compile in rsa public keysSascha Hauer2019-10-157-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we relied on the U-Boot mkimage tool to generate us device tree snippets containing rsa public keys which we then compiled into barebox. Make this easier and allow to directly specify a filename or PKCS#11 URI in Kconfig. With this we no longer need the U-Boot mkimage tool here and no more external steps to prepare device tree snippets. With this rsa public keys can be directly compiled as C structs into barebox which is much more direct than putting it into the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | rsa: let rsa_of_read_key() return a fully allocated keySascha Hauer2019-10-153-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now rsa_of_read_key() took a pointer to a key and filled the struct rsa_public_key members with allocated values. So far we have never freed these values. Change rsa_of_read_key() to always return a fully allocated key and provide rsa_key_free() to free it. Let the FIT image code free the key after usage. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: Add rsatoc toolSascha Hauer2019-10-153-0/+490
| | | | | | | | | | | | | | | | | | | | | | | | The rsatoc tool converts rsa public keys into C structs suitable to compile with barebox. Most of the openssl rsa related stuff has been taken from the U-Boot mkimage tool. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Kbuild: Add config_filename macro from kernelSascha Hauer2019-10-151-0/+49
| | | | | | | | | | | | | | | | | | | | | The config_filename allows to extract a filename from a Kconfig string option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>