summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/warnings'Sascha Hauer2019-04-091-1/+1
|\
| * treewide: Make locally used functions staticSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-04-091-2/+2
|\ \
| * | treewide: surround Kconfig file paths with double quotesMasahiro Yamada2019-03-211-2/+2
| |/ | | | | | | | | | | | | | | | | Based on Linux commit 8636a1f9677db4f883f29a072f401303acfc2edd This will be needed when you sync Kconfig with Linux 5.0 or later. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/lseek'Sascha Hauer2019-04-084-39/+34
|\ \
| * | state: Fix lseek error check in state_mtd_peb_write()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Fix lseek error check in state_mtd_peb_read()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Fix lseek error check in state_backend_bucket_direct_write()Andrey Smirnov2019-03-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: Fix lseek error check in state_backend_bucket_direct_read()Andrey Smirnov2019-03-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | uimage: Fix lseek error check in uimage_load_to_buf()Andrey Smirnov2019-03-111-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | uimage: Fix lseek error check in uimage_load()Andrey Smirnov2019-03-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | uimage: Fix lseek error check in uimage_verify()Andrey Smirnov2019-03-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use 'int' to store lseek()'s return value to avoid problems with large seek offsets. While at it, make sure to populate return error code from 'errno'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: Always return enum filetype in file_name_detect_type_offset()Andrey Smirnov2019-03-111-2/+2
| |/ | | | | | | | | | | | | | | | | None of the callers of file_name_detect_type_offset() are prepared to deal with negative error code. Change the code to return filetype_unknown if open_and_lseek() fails. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/layerscape'Sascha Hauer2019-04-081-0/+8
|\ \
| * | ARM: Add basic Layerscape supportSascha Hauer2019-03-131-0/+8
| |/ | | | | | | | | | | | | | | | | | | This adds basic Layerscape support: - Makefile/Kconfig - Register maps - errata workarounds Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / common: extend BOOTM_FITIMAGE_SIGNATURE help textBastian Krause2019-03-181-1/+3
|/ | | | | | | This points out how to actually use BOOTM_FITIMAGE_SIGNATURE. Signed-off-by: Bastian Krause <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spd'Sascha Hauer2019-03-074-27/+183
|\
| * ddr_spd: Enable in PBLSascha Hauer2019-03-041-1/+1
| | | | | | | | | | | | | | SPD EEPROMs are typically needed in PBL when the SDRAM is not yet initialized. Enable compilation of the SPD support in PBL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: Add function to read eepromSascha Hauer2019-03-041-0/+82
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: Update from U-BootSascha Hauer2019-03-041-24/+98
| | | | | | | | | | | | | | | | | | | | | | This updates the ddr_spd.h header file from U-Boot-2019.01 with some small changes: - typedefs are removed - "_s" suffix from struct types removed - remove unnecessary "extern" from function declarations Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * crc: import crc_itu_t() from kernelSascha Hauer2019-03-043-3/+3
| | | | | | | | | | | | | | | | Our cyc_crc16() function is the same function as crc_itu_t() in the Linux kernel. Import and use crc_itu_t() from the Kernel for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rpi'Sascha Hauer2019-03-071-0/+19
|\ \
| * | ARM: rpi: Clarify debug uart namesSascha Hauer2019-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Now that we support the miniuart as lowlevel debug UART clarify that the other UARTs are PL011. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fixup! ARM: rpi: Add mini UART debug_ll supportSascha Hauer2019-03-071-1/+1
| | |
| * | fixup! ARM: rpi: move debug UART Kconfig settingsSascha Hauer2019-03-071-1/+1
| | |
| * | ARM: rpi: Add mini UART debug_ll supportSascha Hauer2019-03-061-0/+6
| | | | | | | | | | | | | | | | | | | | | The raspberry pi 3 comes up with the mini UART as default, so allow to use it for debug_ll output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: rpi: move debug UART Kconfig settingsSascha Hauer2019-03-061-0/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | In contrast to other architectures, R.Pi debug UART config was placed under the "System Type" menu, not under the "Debugging -> low-level debugging port". This made this setting easy to miss when enabling low level debug mesages. While at it use the existing base address defines rather than defining them again in Kconfig. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-03-072-31/+38
|\ \
| * | common: Kconfig: improve help text for DEBUG_LLTomaz Solc2019-03-071-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | This adopts the help text used in Linux for the same setting. It clarifies that a build with DEBUG_LL enabled will only work on the system you chose the debug UART for. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | images: pbl: verify CONFIG_BAREBOX_MAX_IMAGE_SIZE is not exceededAhmad Fatoum2019-03-071-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For platforms such as the at91, the boot ROM imposes an upper limit on barebox file size. Prior to 5a1a5ed253 ("ARM: images: use piggydata"), BAREBOX_MAX_PBLX_SIZE seems to have been the way to go for limiting the size of the final barebox binary when using the PBL. With pblx removed, this variable is of no use, so have the existing BAREBOX_MAX_IMAGE_SIZE replace its functionality. Currently BAREBOX_MAX_IMAGE_SIZE is only checked against in the non-PBL case, so add a check in the PBL case as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: console_common: do not store color additions to the log bufferOleksij Rempel2019-02-271-17/+18
| | | | | | | | | | | | | | | | | | | | | it is needed for raw dmesg output Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: dmesg: add -l option to restrict output levelOleksij Rempel2019-02-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Same as linux dmesg, barebox dmesg will be able to restrict output level by using -l option. For example "dmesg -l err,warn" This functionality can be used for test automation. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: dmesg: add print raw parameterOleksij Rempel2019-02-271-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add -r option to mimic functionality of linux dmesg. It will prefix log level and timestamp to each buffer: <6>[ 460us] barebox 2019.02.0-00266-g6aea757067-dirty #355 Thu Feb 21 11:51:43 CET 2019 <6>[ 6279us] Board: DPTechnics DPT-Module <6>[ 209281us] mdio_bus: miibus0: probed <6>[ 210184us] ag71xx-gmac 18070000.mac@19000000.of: network device registered <6>[ 216051us] m25p80 w25q128@00: w25q128 (16384 Kbytes) <6>[ 219913us] netconsole: registered as netconsole-1 <6>[ 223312us] malloc space: 0x80c00000 -> 0x80ffffff (size 4 MiB) <6>[ 228255us] eth0: got preset MAC address: c4:93:00:00:ae:89 <6>[ 246363us] running /env/bin/init... Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | watchdog: add (U)EFI driverOleksij Rempel2019-02-181-1/+8
| | | | | | | | | | | | | | | | This driver is using SetWatchdogTimer() UEFI interface and was tested on iBASE MI991AF Mini-ITX motherboard. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | efi: cleanupsOleksij Rempel2019-02-182-222/+2
|/ | | | | | | make local functions static and remove unused code Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-02-1311-104/+163
|\
| * memory: of_fixup: adapt to new memory layoutMarco Felsch2019-02-121-18/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since kernel 4.16 the memory nodes got a @<reg> suffix so the fixup won't work correctly anymore, because instead of adapting the extisting one the fixup creates a new node and keeps the old (maybe incorrect) node. To be compatible with the old and new layout delete the found memory node and create a new one. The new node follows the new @<reg> style. The patch also renames the node parameter to make it clearer. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Insert a helpful size check that is an outcome of the following dt-utils commits: | commit a6eb5350be0f7a5673162d20f2dd72569d5a4d0c | Author: Markus Pargmann <mpa@pengutronix.de> | Date: Fri May 27 13:53:40 2016 +0200 | | barebox-state: Import updated state code | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> | commit 583acea6669550ffa7ffb465301ddb3529206afc | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 23 11:29:50 2017 +0100 | | state: backend-direct: Fix max_size | | The max_size in the direct backend includes the meta data, so | substract its size when determing the max data size we can store. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | commit dcf781f1b3d15aff5f5ff0b604bff447dee2040c | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 23 12:59:48 2017 +0100 | | state: backend_bucket_direct: max_size is always given | | max_size is always != 0, so if(direct->max_size) can be skipped. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux userspace with recent glibc versions lets barebox-state suffer from linux/stat.h redefining 'struct statx' and because of that switched to the inclusion of sys/stat.h instead, see dt-utils commit 1c80e31872ae ("src: fix compilation for glibc version 2.27.9000-36.fc29 and newer"). We can follow this switch in barebox without any problems, too, as in barebox sys/stat.h includes linux/stat.h (and adds some more definitions on top that don't hurt us here). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-0/+4
| | | | | | | | | | | | | | Linux userspace needs sys/param.h to have the definition of roundup(). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: harmonize code with dt-utilsUlrich Ölmann2019-02-111-2/+8
| | | | | | | | | | | | | | | | | | Other than in barebox the offset and size of a state's backend device do not necessarily equal zero in Linux userspace (EEPROMs & block devices), so barebox' and dt-utils' state code differ here. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: fix formatting of "uint32_t" variablesUlrich Ölmann2019-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the following dt-utils commit: | commit 5588a6c32d54bc4a1ef0b9f72807c46dd00bc20e | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Sun Feb 3 22:48:07 2019 +0100 | | state: fix formatting of "uint32_t" variables | | The format specifier "%zd" is for "size_t" typed variables and produces a | warning with gcc, so use "%u" instead. | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: fix formatting of "off_t" variablesUlrich Ölmann2019-02-112-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the following dt-utils commit: | commit 89d033284cb69f834c1f2195c9e99a3d7f585cf1 | Author: Ulrich Ölmann <u.oelmann@pengutronix.de> | Date: Sun Feb 3 22:48:06 2019 +0100 | | state: fix formatting of "off_t" variables | | Explicitely casting an "off_t" variable to "long long" and formatting it via | "%lld" or "%llx" respectively makes 32- as well as 64-bit compilers | happy (tested with gcc-8.2.1 and clang-7.0.1). | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: fix compiler warnings about wrong type conversion in messagesUlrich Ölmann2019-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To harmonize the common codebase this ports the remaining hunks of the following dt-utils commit, as the residual hunks have independently already been done before in barebox commit 1afbf6b5680e ("state: fix compile warnings for dev_err expansion"): | commit 9f1db73234b40f4ea071421e8179065df16211ec | Author: Philipp Rosenberger <p.rosenberger@linutronix.de> | Date: Thu Oct 18 09:17:23 2018 +0200 | | Fix compiler warnings about wrong type conversion in messages. | | These warning were observed with gcc-6.3 on x86-64. | | Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: state: fix typoUlrich Ölmann2019-02-073-4/+4
| | | | | | | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: fastboot: ubiformat: Fix bad block handlingSascha Hauer2019-01-281-12/+28
| | | | | | | | | | | | | | When fastboot handles UBI images in sparse file format then bad blocks of the underlying mtd device are not skipped. This patch fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * block: Move shared code in get_chunk() out of if statementAndrey Smirnov2019-01-221-3/+2
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * block: Do not write past block device boundary during a flushAndrey Smirnov2019-01-221-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | When calling I/O functions of underlying block device driver we always need to make sure that its size is small enough to not go past device's boundary. Not only in get_chunk() and block_cache(), but in writebuffer_flush() as well. Since the same code is used in three different places, move it into a subroutine and adjust all of the calls to ->write()/->read() accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * boot: make it a little bit less verboseVivien Didelot2019-01-211-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current boot code prints too much error messages without much value in them. This patch prints the error string when it makes sense and simplifies the return path of bootscript_boot(). Make use of pr_err() in boot_entry() which is the shared code responsible for calling the boot_entry->boot callback. Remove the unnecessary print statement from bootsource_action() as well. This removes a single print statement ATM, allowing us to go from this: booting 'sd' Cannot set parameter mci0.probe: No such device running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed could not open /mnt/sd/zImage: No such device ERROR: Booting 'sd' failed: No such device booting 'sd' failed: No such device boot: No such device to this: Booting entry 'sd' Cannot set parameter mci0.probe: No such device running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed could not open /mnt/sd/zImage: No such device ERROR: Booting entry 'sd' failed boot: No such device Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: Remove trailing whitespaces and tabsAlexander Shiyan2019-01-211-1/+1
| | | | | | | | | | | | | | Just a cleanup over barebox tree Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>