summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2018-08-131-2/+3
|\
| * FIT: be more verbose when RSA signature check failsRoland Hieber2018-08-101-2/+3
| | | | | | | | | | | | | | Tell the user what device tree node we're looking for. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | block: Adjust cache sizesSascha Hauer2018-07-131-2/+2
|/ | | | | | | | Use four times more cache entries and divide the memory for each entry by four. This lowers the linear read throughput somewhat but increases the access speed for filesystems. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx8mq'Sascha Hauer2018-07-091-3/+1
|\
| * clock: Use udelay() to implement mdelay()Andrey Smirnov2018-06-151-3/+1
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2018-07-091-1/+3
|\ \
| * | common: clock: Sample time before poller_call()Andrey Smirnov2018-07-021-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change is_timeout() to sample current time before invoking poller infrascructure to avoid occasional false timeout conditions. Consider the following timeout loop (can be found in wait_on_timeout): while (!(condition)) { if (is_timeout(...)) { return -ETIMEDOUT; } } ... in the original logic of is_timeout() it was possible to end up in the following situation: 1. Immediate check of of "condition" yeilds false (not enough time for it to become true has passed yet) 2. is_timeout is called which, in turn, calls poller_call() 3. All registerd pollers take more than specified timeout time to execute. 4. Sometime during poller_call() "contition" becomes true 5. As a result of #3 is_timeout() returns "true" 6. Code bails out with -ETIMEDOUT early even though timeout condition didn't really occur. One concrete example of this problem was discovered on ZII RDU1 board (poller_call() is long due to a serdev) when doing large data transfers over SPI to attached DataFlash chip. This commit changes is_timeout() to sample the value of time before calling poller_call(). This way first call to is_timeout() will almost always return false thus checking the condition at least twice before declaring a timeout. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dts-warnings'Sascha Hauer2018-07-091-1/+1
|\ \
| * | console: Update description for global.linux.bootargs.consoleSascha Hauer2018-06-191-1/+1
| |/ | | | | | | | | | | Replace linux,stdout-path with stdout-path as the former is deprecated. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/console'Sascha Hauer2018-07-093-7/+10
|\ \
| * | console_simple: add newline conversion for putc_ll caseSascha Hauer2018-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | When console_putc uses putc_ll for early printing then it must do a newline conversion as putc_ll doesn't do it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console_simple: Fix newline conversionSascha Hauer2018-06-191-1/+2
| | | | | | | | | | | | | | | | | | Newline should be "\r\n" rather than "\n\r" Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console_simple: Remove duplicated newline conversionSascha Hauer2018-06-191-2/+0
| | | | | | | | | | | | | | | | | | | | | console_puts uses console_putc for printing which already does newline conversion, so do not do it again in console_puts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: remove duplicate newline conversionSascha Hauer2018-06-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | When the console is not yet fully initialized then console_puts falls back to print characters using console_putc. console_putc already does newline conversion, so do not repeat it in console_puts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: add missing newline conversion for putc_llSascha Hauer2018-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | putc_ll doesn't do newline conversion (and it shouldn't do, as it's a static inline function for early debugging, adding more code there is not nice), so add newline conversion to the console code when it uses putc_ll for printing early messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Fix console_get_first_active()Andrey Smirnov2018-06-191-1/+2
| |/ | | | | | | | | | | | | | | Fix if condition in console_get_first_active() to actually check that both bit are set. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/bootm'Sascha Hauer2018-07-095-32/+198
|\ \ | |/ |/|
| * add basic ELF parserOleksij Rempel2018-06-183-0/+150
| | | | | | | | | | | | | | | | This parser is needed for kernel boot support on MIPS and can potentially reused on other platforms. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * filetype: add ELF typeAntony Pavlov2018-06-151-0/+5
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bootm: Split bootm_load_devicetree into two functionsSascha Hauer2018-06-151-26/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | It is not always desired to get the devicetree from image data and load it to a SDRAM region at the same time. Sometimes it's enough to just load it to an allocated address (in case the user has no constraints where the devicetree should be placed. This patch splits bootm_load_devicetree into bootm_get_devicetree which returns a pointer to the allocated devicetree and bootm_load_devicetree which loads the devicetree to a specified region. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bootm: Drop data->oftreeSascha Hauer2018-06-151-6/+0
| | | | | | | | | | | | | | It's no longer necessary to store the devicetree pointer in struct image_data, it can be replaced with a local variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-bootsource'Sascha Hauer2018-06-112-1/+100
|\ \
| * | common: oftree: Pass reset source and reset source instance to kernelAndrey Smirnov2018-05-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detecting reset reason is, in some cases, a destructive operation and in such cases it is impossible to obtain that information in the kernel without some help from barebox. Pass reset source and reset source instance to kernel to Linux to make it availible to Linux userspace. This info is placeed under /chosen/bootsource and it can be read under Linux in /sys/firmware/devicetree/base/chosen/reset-source. and /sys/firmware/devicetree/base/chosen/reset-source-instance. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: oftree: Pass bootsource and bootsource instance to kernelAndrey Smirnov2018-05-181-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass barebox-detected bootsource to Linux to make it availible to Linux userspace. That information is passed as full path to the node corresponding to the bootsource and is placed under /chosen/bootsource and it can be read under Linux in /sys/firmware/devicetree/base/chosen/bootsource Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootsource: Add bootsource alias name APIAndrey Smirnov2018-05-181-0/+68
| |/ | | | | | | | | | | | | | | Add API allowing to query and override the name of the alias pointing at DTB node representing current bootsource. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mvebu'Sascha Hauer2018-06-111-5/+17
|\ \
| * | kwbimage_v0: add support to detect and boot a mvebu v0 imageUwe Kleine-König2018-06-041-5/+17
| |/ | | | | | | | | | | | | | | | | The differences between v0 and v1 of the mvebu kwbimage are small enough that the function to boot such an image can be shared between both variants. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2018-06-111-1/+1
|\ \
| * | resource: fix iomem_resource.end for 64 bit systemsPeter Mamonov2018-05-231-1/+1
| |/ | | | | | | | | | | | | | | Fix iomem_resource.end to cover the whole address space addressable by a variable of type resource_size_t. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / aarch64: Add i.MX8 debug UART supportSascha Hauer2018-06-111-0/+8
|/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [andrew.smirnov@gmail.com: Added imx8_uart_setup_ll()] Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2018-05-094-4/+27
|\
| * common: state: Add property to protect existing dataDaniel Schultz2018-04-164-4/+27
| | | | | | | | | | | | | | | | | | | | | | After an update to a newer barebox version with an enabled state framework, existing data in storage memories could be overwritten. Add a new property to check in front of every write task, if the meta magic field only contains the magic number, zeros or ones. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/serdev'Sascha Hauer2018-05-093-3/+230
|\ \
| * | serdev: Allow polling interval to be adjusted at runtimeAndrey Smirnov2018-04-171-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to blocking, synchronous, polling driven nature of Barebox's serial communication handling trying to use two or more serial ports at high (1Mbaud+) baudrates results in data loss and noticeable perofmance degradation. This happens as soon as individual message being sent around start exceeding HW Rx FIFO in size. A good example of such a usecase would be using a system that has a serdev driver (operating @ 1Mbaud+) and trying to do a X/YMODEM transfer via serial console at comparable baudrates. To at least partially ameliorate the problem, add code that will expose "polling_interval" as a parameter, so that the user would have an option of temporarily disabling (or significatly decreasing the rate) of a given serdev's polling. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serdev: Add trivial blocking read functionAndrey Smirnov2018-04-171-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add example implementation of a trivial blocking read function as a part of Barebox's serdev API. NOTE: This code has not been tested against real devices, so use it at your own risk. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Add simplified 'serdev' framework from Linux kernelAndrey Smirnov2018-04-173-3/+111
| |/ | | | | | | | | | | | | | | | | Port 'serdev' UART-slave deivce framework found in recent Linux kernels (post 4.13) in order to be able to port 'serdev' slave drivers from Linux. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-05-091-1/+30
|\ \
| * | blspec: add checking of optional key machine-idAndreas Schmidt2018-05-081-1/+30
| |/ | | | | | | | | | | | | | | | | | | | | | | | | For filtering of Bootloader Spec entries, Bootloader Spec specify an optional key machine-id. By set the global.boot.machine-id variable the checking of machine-id key in Bootloader Spec entries will be activate. If the variable and key match, appropriate boot entry will be booting. If it not match boot entry will be ignore and barebox check the next boot entry. Signed-off-by: Andreas Schmidt <mail@schmidt-andreas.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx-reset-reason'Sascha Hauer2018-05-091-0/+23
|\ \
| * | common: reset_source: Introduce reset_source_name()Andrey Smirnov2018-05-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Introduce reset_source_name() to get string representation of current reset source. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: reset_source: Add the notion of "reset source instance"Andrey Smirnov2018-04-261-0/+17
| |/ | | | | | | | | | | | | | | | | In order to accomodate SoCs that come with multiple watchdogs (or any other reset sources of the same kind) add a notion of "reset source instance", similar to what we already have for bootsource API. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / bootsource: Add BOOTSOURCE_CANAndrey Smirnov2018-04-171-0/+1
|/ | | | | | | Add BOOTSOURCE_CAN for SoCs that can boot from CAN interface. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-04-063-1/+4
|\
| * of: Pass barebox version to kernelSascha Hauer2018-03-223-1/+4
| | | | | | | | | | | | | | | | Pass the barebox version to Linux in case somebody is interested in it under Linux. We use put the version under /chosen/barebox-version and it can be read under Linux in /sys/firmware/devicetree/base/chosen/barebox-version. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fs'Sascha Hauer2018-04-062-2/+2
|\ \
| * | rename file_operations -> cdev_operationsSascha Hauer2018-04-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | bootm: provide handlers the start of the OS imageSascha Hauer2018-04-041-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | The bootm code needs to read the beginning of the OS image in order to determine the filetype. If it does so already, then we can provide the handlers the buffer. This can help the handlers to find some image metadata before loading the full image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | common: Add functions to find free RAMSascha Hauer2018-04-041-0/+51
| | | | | | | | | | | | | | | | | | | | | The bootm code needs to put the Kernel image and initrd into free RAM. Add some functions to find free RAM chunks to help this code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | filetype: Detect ARM aarch64 Linux imagesSascha Hauer2018-04-041-0/+3
| | | | | | | | | | | | | | | | | | ARM aarch64 Linux image have a special type. Allow to detect them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | ARM: aarch64: Add relocation supportSascha Hauer2018-03-231-1/+1
|/ / | | | | | | | | | | | | | | | | | | This adds aarch64 support for relocating binaries linked with -pie. Support is integrated into the already exisiting relocate_to_current_adr() function which is now used for both arm32 and aarch64. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>