summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* startup: Add missing newline to notice messageHEADmasterJules Maselbas5 days1-1/+1
| | | | | Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: get function returns masked register valueRenaud Barbier5 days1-1/+1
| | | | | | | | | | Unlike Linux the generic driver get function returns the masked register content and not the 0 or 1 value. The consequence is that gpio_get_value returns for instance 0x10 for bit 4 instead of 1. Use the Linux normalized form instead. Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c: stm32: support new st,stm32mp15-i2c compatibleAhmad Fatoum5 days1-0/+1
| | | | | | | | | | | | | | Linux v5.8-rc1 has gained support for the FastMode+ registers on the stm32mp15, but those are incompatible between the stm32mp15 and the stm32f7, so a new compatible was introduced. The old compatible was replaced for the MP15 SoC, breaking I2C in barebox. Add the new compatible to fix this. Unlike Linux, we just use the same setup parameters as for the stm32f7. This is ok as long we don't want to support FastMode+. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts/rsatoc: fix printing of error message, if environment variable ↵Marc Kleine-Budde5 days1-2/+4
| | | | | | | | doen't contain a path Fixes: 128ad3cbe043 ("scripts: Add rsatoc tool") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation/sandbox: fix code blockYegor Yefremov5 days1-1/+1
| | | | | | | Remove unneeded colon. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/watchdog'Sascha Hauer12 days3-0/+40
|\
| * startup: inhibit watchdogs on non-interactive autoboot abortAhmad Fatoum2020-06-233-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | nv.autoboot=abort has been added as development aid to have barebox stop at the shell prompt automatically. It makes sense to inhibit all watchdogs in this mode, so the user can later use the shell in peace. This also applies to fastboot aborting the shell prompt. If this happens, watchdog will be automatically inhibited as well. Behavior on user aborting the shell prompt via keypad or uart input remains unchanged for backwards-compatibility. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * watchdog: permit `wd 0` for non-stoppable, but inactive, watchdogsAhmad Fatoum2020-06-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A watchdog that can't be stopped returns -ENOSYS on set_timeout(0). If the watchdog supports communicating whether it's running, we could still allow `wd 0`, if it hasn't been started yet. Setting device parameter .priority=0 disables a watchdog. One would expect this to always succeed for a not-running watchdog, but currently it doesn't, if the driver's set_timeout(0) returns -ENOSYS. With this fix, this is supported making the user API less surprising. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/tlsf'Sascha Hauer12 days4-178/+327
|\ \
| * | tlsf: Update to v3.1Sascha Hauer2020-06-164-178/+327
| | | | | | | | | | | | | | | | | | | | | | | | This updates the tlsf implementation to v3.1. This is taken from commit deff9ab509341f264addbd3c8ada533678591905 in https://github.com/mattconte/tlsf.git. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/ratp'Sascha Hauer12 days2-49/+51
|\ \ \
| * | | ratp: Straighten ratp deregistrationSascha Hauer2020-06-161-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some bugs in the error path when ratp initialization fails half way through. Reusing the global ratp context which might be half initialized makes the code hard to follow and hard to fix, so the strategy is changed to always allocating a fresh ratp context and returning -EBUSY when one exists already. We store in the context what has been done in the initialization path and add a ratp_unregister() which uses this information to tear down everything that has been initialized. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ratp: Fix closing connectionsSascha Hauer2020-06-161-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | When entering the LAST_ACK state we have to set the saved SN to the received SN of the current packet. With this we properly accept the final incoming packet and close the connection. Without this we interpret the final incoming packet as a duplicate of the previous packet and close the connection only after a timeout. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/ramfs'Sascha Hauer12 days14-360/+826
|\ \ \
| * | | libfile: copy_file: explicitly truncate to final sizeSascha Hauer2020-07-051-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When possible truncate the destination file to the final size explicitly. This allows for example ramfs to put the resulting file contiguously into memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | libfile: copy_file: Fix calling discard_rangeSascha Hauer2020-07-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | discard range is called with unitialized size argument. Call it after stat() on the source filedescriptor. Also there's no point in continuing when stat() on the source filedescriptor fails, so bail out in this case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ramfs: Implement memmapSascha Hauer2020-07-051-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When an inode only has a single chunk then we can support memmap for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ramfs: Use dynamically sized chunksSascha Hauer2020-07-051-148/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the way ramfs stores its data. So far we used equally sized chunks, this patch changes it to use chunks in a size that fits our needs. The chunks are always allocated in the size they are needed for the current truncation. Only if we fail to allocate all desired memory at once we fall back to allocating smaller chunks. Together with using the generic list implementation this results in smaller code and has the advantage that many image files end up being contiguously in memory and thus we can provide a memmap for them. Files will end up contiguously in memory when they are first created, then truncated to the final size and then filled up with data. This is something which is normally easily achievable when desired. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ramfs: Drop dead codeSascha Hauer2020-07-051-14/+0
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ramfs: Return -ENOSPCSascha Hauer2020-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ramfs fails to allocate more memory then returning -ENOSPC is more appropriate then -ENOMEM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | digest: Drop usage of memmapSascha Hauer2020-07-051-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | digest_file_window() first tries to memmap the file before it falls back to reading it. This is quite unnecessary, we can just always read. Moreover, memmapping a file has problems with the current code. A "md5sum foo" result in the filesize argument being MAX_LFS_FILESIZE. This is fine for files where the file is just read up to the end in this case, but for memmapped buffers this results in digesting MAX_LFS_FILESIZE bytes which is wrong. This problem is not apparent at the moment as there are only a few files which are memmappable, and on these (/dev/mem, /dev/ram0) digest commands are normally called with an explicit size argument. This changes once ramfs starts supporting memmap, so better drop memmapping in the digest code now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: free inodes we no longer needSascha Hauer2020-07-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we freed the no longer needed inodes only at unmount time. Let's trust our reference counting a bit more and free them once the reference counter hits zero. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: Make iput() accept NULL pointersSascha Hauer2020-07-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let iput() accept NULL pointers so that users do not have to test for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: Add destroy_inode callbacks to filesystemsSascha Hauer2020-07-055-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several filesystems rely on the default function which frees the struct inode * rather than the filesystem specific inode which the inode is embedded in. This works because the inode is the first element in the filesystem specific inode. Let's not depend on this behaviour and for clarity add the destroy_inode callbacks to all filesystems. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | update list.h from Linux-5.7Sascha Hauer2020-06-176-161/+581
| |/ / | | | | | | | | | | | | | | | This updates include/linux/list.h from Linux-5.7. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/module'Sascha Hauer12 days15-41/+505
|\ \ \
| * | | arm: module: Allow modules outside of bl rangeDavid Dgien2020-07-018-6/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the Linux kernel, barebox does not have a dedicated heap for storing modules. Therefore, if the system memory configuration places the general heap further away than can be reached by a 'bl' instruction (24 bits of address, or 16 MiB), then the module relocations will fail due to being out of range. Allocate PLTs when loading modules so that jumps and calls whose targets are too far away for their relative offsets to be encoded in the instructions themselves can be bounced via veneers in the module's PLT. The modules will use slightly more memory, but after rounding up to page size, the actual memory footprint is usually the same. Adoption of Linux commits: 66e94ba3c8ea ARM: kernel: avoid brute force search on PLT generation 1031a7e674d1 ARM: kernel: sort relocation sections before allocating PLTs 05123fef0982 ARM: kernel: allocate PLT entries only for external symbols 35fa91eed817 ARM: kernel: merge core and init PLTs 7d485f647c1f ARM: 8220/1: allow modules outside of bl range Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | arm: elf: Add THM relocation typesDavid Dgien2020-07-011-0/+3
| | | | | | | | | | | | | | | | | | | | Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | arm: makefile: Fix compiler flag variableDavid Dgien2020-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for ARM modules to compile with the correct relocation types, they must be built without -fPIE. Move -fPIE from KBUILD_CPPFLAGS to KBUILD_CFLAGS_KERNEL so that the flag is only included when compiling files being built into the barebox image. Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | module: Implement HAVE_MOD_ARCH_SPECIFICDavid Dgien2020-07-014-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement HAVE_MOD_ARCH_SPECIFIC Kconfig and module_frob_arch_sections() function prototype from Linux module subsystem. module_frob_arch_sections() should be implemented by any architecture that selects HAVE_MOD_ARCH_SPECIFIC, and is called from load_module() Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | module: Fix module command registrationDavid Dgien2020-07-011-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 1e4a948673d7 ("command: Use array of pointers to commands") updated the command linker sections to contain an array of pointers to the command structs, rather than the command structs themselves. However, the load_module function was not updated to account for the change to the linker section, so fix that here. Additionally, commit 22bdecc9c591 ("lds: Move start/end address variables into defines") moved the _start and _end symbols out of the linker script and into the section macro defines, causing them to show up in the module symbol table as well, so we take can advantage of those to find the array of pointers. Fixes: 1e4a948673d7 ("command: Use array of pointers to commands") Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | module: Fix adding module to list after layoutDavid Dgien2020-07-011-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During load_module(), the 'this_module' section is relocated, but the pointer to the module struct isn't updated to account account for the move. Do so before adding the module to the module_list. As a side effect of properly pointing to the relocated module struct, we no longer need to manually search for and fixup the init_module symbol, so remove that code. Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | module: Add init macros to module.hDavid Dgien2020-07-012-9/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port module initialization macros and initcall redefinition macros from Linux Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Makefile: Initialize and export KBUILD variablesDavid Dgien2020-07-011-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize and export KBUILD KERNEL and MODULE variables. Otherwise, appending to them elsewhere in the srctree will not be seen by the build commands in Makefile.lib Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/misc'Sascha Hauer12 days110-1816/+969
|\ \ \ \
| * | | | arch/arm/lib64: Convert to SPDX-License and -Copyright specifiersUwe Kleine-König2020-07-145-56/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the files that licensecheck can determine the license for. Also convert to obvious right Copyright statements. Additionally some minor code reformatting is done. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | treewide: Convert files covered by ARM copyright to SPDXUwe Kleine-König2020-07-1412-137/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Marc Zyngier, former employee at ARM, the company owns the copyright for code created by its employees. Convert accordingly to SPDX with the usual rearrangements. Also dropped Marc's email address which doesn't work any more. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | arch/arm/include: Convert to SPDX-License and -Copyright specifiersUwe Kleine-König2020-07-1417-182/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the files that licensecheck can determine the license for. Also convert to obvious right Copyright statements. Additionally some minor code reformatting is done. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: reinstate cooked terminal mode on sanitizer-induced deathAhmad Fatoum2020-07-142-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we exit due to AddressSanitizer error, we remain in raw mode, which is not best user experience. Currently every exit is an AddressSanitizer death due to leaks. We want to encourage users to always have ASan enabled, to catch more errors, thus call cookmode() on exit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: add libc memory allocatorAhmad Fatoum2020-07-144-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we typically want to reuse as much barebox functionality as possible in sandbox, using system malloc(3) instead can be very useful when using external memory integrity tools. This is even useful for AddressSanitizer, because the reports resulting from the memory poisoning API are less detailed than the built-in support for the libc malloc(3). Note that a barebox "heap" is still allocated upfront. It's only used for request_sdram_region now though. Whatever is allocated by means of malloc and memalign will be ina disjunct heap. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: os: common: fix compiler warning in add_image()Ahmad Fatoum2020-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC reports: ./arch/sandbox/os/common.c: In function ‘add_image’: ./arch/sandbox/os/common.c:271:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] This is because hf->base is an unsigned long long, with the upper 32 bit all-zeroes on 32-bit systems. The compiler doesn't see that though. Change the cast, so we no longer warn. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: include: <asm/types.h>: don't define INTERNAL_SIZE_TAhmad Fatoum2020-07-141-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The INTERNAL_SIZE_T default is size_t, which already is 64-bit on 64-bit platforms and 32-bit on 32-bit ones. We can thus drop the #define and go back to the minimal <asm/types.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | commands: dhrystone: remove unneeded and out-of-place <stdbool.h>Ahmad Fatoum2020-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our bool definitions come out of <linux/types.h>. <stdbool.h> shouldn't be used for normal barebox code. We already include <linux/types.h> by means of <common.h> above. So drop the <stdbool.h> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | lib: list_sort: delete dead codeAhmad Fatoum2020-07-141-149/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list_sort.c's core code should only change on sync with Linux, so we don't really need separate testing code. The code doesn't compile as we neither have a CONFIG_TEST_LIST_SORT symbol nor do we have a <linux/random.h> header. Remove it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | include: delete unreferenced u-boot part.h headerAhmad Fatoum2020-07-141-104/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's unused, the functions that it declares aren't defined in barebox and the <ide.h> header it references doesn't exist. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | ppc: mpc5xxx: delete dead codeAhmad Fatoum2020-07-144-670/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files had never been built since being added. At least the C file doesn't compile due to missing headers. Remove them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | ARM: layerscape: ppa: fix error propagation in ppa_init()Ahmad Fatoum2020-07-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On fit_open_image, we returned PTR_ERR(fit) instead of the correct ret. We also didn't call fit_close as we should. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | i2c: designware: use proper type for writel argumentAhmad Fatoum2020-07-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to write DW_IC_ENABLE_ENABLE (1 << 0) to the register to enable, but instead we were writing true. This happens to work, but is quite unusual. Make the code more readable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mfd: superio: depend on X86 || COMPILE_TESTAhmad Fatoum2020-07-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super I/O chips are usually found x86 PCs. Make them depend on it, so users of other arches aren't prompted for it, when they oldconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mfd: superio: smsc: fix C99ism initial declaration in for loopAhmad Fatoum2020-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Codebase is meant to be gnu89, but was only enforced starting with bc4840e98b94 ("kbuild: add -Wmissing-prototypes and -std=gnu89 to KBUILD_HOSTCFLAGS"). Since then, this driver no longer compiles. Fix this. Fixes: eaf020f1bb52 ("mfd: superio: add base SMSC MFD driver") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>