summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* / Revert "startup: Load default environment earlier"Sascha Hauer2018-03-191-3/+3
|/ | | | | | | | | | | | | | | | Several boards use defaultenv_append_directory() to append a board specific envfs snippet during runtime. This only works when defaultenv_append_directory() is called before defaultenv_load() is exectuted. Since that was executed at the end of the start process every initcall level could be used to append a env directory. With this patch only initcall levels earlier than fsdevice_initcall work and most boards do not cope with this. Revert this patch until a better solution is found. Reported-by: Alexander Kurz <akurz@blala.de> This reverts commit 5b92cfceff38f3a6462a21cf6b69159ad0ae9744.
* Merge branch 'for-next/ratp'Sascha Hauer2018-03-0511-98/+617
|\
| * ratp: new reset commandAleksander Morgado2018-03-012-0/+56
| | | | | | | | | | | | | | | | E.g.: $ ./bbremote -v --port /dev/ttyUSB2 reset Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: new md and mw commandsAleksander Morgado2018-03-013-0/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces support for running the md and mw commands using the binary interface provided by RATP. This allows clients to read and write memory files without needing to do custom string parsing on the data returned by the console 'md' and 'mw' operations. The request and response messages used for these new operations are structured in the same way: * An initial fixed-sized section includes the fixed-sized variables (e.g. integers), as well as the size and offset of the variable-length variables. * After the initial fixed-sized section, the buffer is given, which contains the variable-length variables in the offsets previously defined and with the size previously defined. The message also defines separately the offset of the buffer w.r.t. the start of the message. The endpoint reading the message will use this information to decide where the buffer starts. This allows to extend the message format in the future without needing to break the message API, as new fields can be appended to the fixed-sized section as long as the buffer offset is also updated to report the new position of the buffer. E.g.: $ ./bbremote --port /dev/ttyUSB2 md /dev/pic_eeprom_rdu 0x107 5 0000000000 $ ./bbremote --port /dev/ttyUSB2 mw /dev/pic_eeprom_rdu 0x107 0102030405 5 bytes written $ ./bbremote --port /dev/ttyUSB2 md /dev/pic_eeprom_rdu 0x107 5 0102030405 $ ./bbremote --port /dev/ttyUSB2 mw /dev/pic_eeprom_rdu 0x107 0000000000 5 bytes written $ ./bbremote --port /dev/ttyUSB2 md /dev/pic_eeprom_rdu 0x107 5 0000000000 Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: use xstrndup() instead of a custom xmemdup_add_zero()Aleksander Morgado2018-03-011-12/+1
| | | | | | | | | | | | | | | | The console operations done via RATP expect strings, so just use xstrndup() instead of defining a custom method. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: implement getenv as a standard ratp commandAleksander Morgado2018-03-013-30/+52
| | | | | | | | | | | | | | | | Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're working with strings anyway. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: implement ping as a standard ratp commandAleksander Morgado2018-03-013-24/+41
| | | | | | | | | | Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: allow building without full console supportAleksander Morgado2018-03-012-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Make CONFIG_RATP a selectable config option, so that the user can enable RATP support without explicitly needing to enable the full console support over RATP (e.g. only for RATP FS or built-in command support). The full console can still be explicitly enabled with CONFIG_CONSOLE_RATP. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: moved logic to its own subdirectoryAleksander Morgado2018-03-015-14/+18
| | | | | | | | | | | | | | | | We are going to add new RATP command implementations in separate files within this subdirectory. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: implement generic command supportAleksander Morgado2018-03-012-16/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RATP implementation now allows executing generic commands with a binary interface: binary requests are received and binary responses are returned. Each command can define its own RATP request contents (e.g. to specify command-specific options) as well as its own RATP response contents (if any data is to be returned). Each command is associated with a pair of numeric unique request and response IDs, and for easy reference these IDs are maintained in the common ratp_bb header. Modules may override generic implemented commands or include their own new ones (as long as the numeric IDs introduced are unique). Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-03-053-20/+63
|\ \
| * | Use globalvar_add_simple_string for model and hostnameSascha Hauer2018-02-261-18/+8
| | | | | | | | | | | | | | | | | | | | | Simplify the code by using globalvar_add_simple_string(), no functional change intended. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: added colored print out of log levelsEugen Wiens2018-02-221-0/+25
| | | | | | | | | | | | | | | | | | | | | When the system is booting the warnings and errors are not be quickly discovered. With this improvement the errors are colored red, the warnings yellow and the notices blue. Signed-off-by: Eugen Wiens <eugen.wiens@jumo.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: move global.allow_color handling to C codeSascha Hauer2018-02-222-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have global.allow_color, but this is limited to the environment only. Move creation and handling of this variable to C code so that we can add support for colored output to commands/console controlled by the same variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: fit: add option to add DT snipped that contains fit public keyMarc Kleine-Budde2018-02-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier for build systems to include a configurable dts snippet which holds the public keys for FIT images. Usage: Add to your dts: #ifdef CONFIG_BOOTM_FITIMAGE_PUBKEY #include CONFIG_BOOTM_FITIMAGE_PUBKEY #endif Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/fastboot'Sascha Hauer2018-03-051-19/+36
|\ \ \ | |_|/ |/| |
| * | ubiformat: Allow to ubiformat with a buffer givenSascha Hauer2018-02-091-19/+36
| |/ | | | | | | | | | | | | So far ubiformat can only handle files. Make it possible to pass a buffer into ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: find backend node with its reproducible nameSascha Hauer2018-02-222-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | When fixing up the kernels state nodes we depended on the full node path of the input device tree. This does not work when the kernel device tree has different names. This has happened lately when the i.MX6 device trees got their leading zeroes removed from the node names. Use of_find_node_by_reproducible_name() to find the node corresponding to the storage backend node in the kernel device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: remove unused arguments from state_new_from_node()Sascha Hauer2018-02-222-29/+17
|/ | | | | | | | state_new_from_node() has arguments describing the backend path. These are never used in barebox, the backend path is always derived from the device nodes backend description. Remove these arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* FIT: Use const dtb unflatten variantSascha Hauer2018-02-081-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tftp-workaround'Sascha Hauer2018-02-082-25/+25
|\