summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | ARM: i.MX23 olinuxino: Check machine type in initcallsSascha Hauer2019-10-022-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for the right machine type in initcalls before executing them to make the board multi image safe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: Freescale mx28evk: Check machine type in initcallsSascha Hauer2019-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for the right machine type in initcalls before executing them to make the board multi image safe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: duckbill: Check machine type in initcallsSascha Hauer2019-10-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for the right machine type in initcalls before executing them to make the board multi image safe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: tx28: Make locally used function staticSascha Hauer2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: tx28: Pass and check machine typeSascha Hauer2019-10-023-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass MACH_TYPE_TX28 to barebox_arm_entry() and check for it in initcalls to make the board multi image safe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: start: Allow to pass machine type as boarddataSascha Hauer2019-10-021-1/+13
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to pass a machine type number as directly as boarddata. This makes it easy for non device tree boards to pass a machine type and to identify themselves during runtime. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/mmc'Sascha Hauer2019-10-177-9/+252
|\ \ \ \ \
| * | | | | mci: implement command to switch a mmc device to enhanced modeUwe Kleine-König2019-09-124-0/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command structure allows adding more subcommands and is designed to match the Linux program mmc from the mmc-utils. So later more commands can easily be added if need be. Compared to mmc-utils' mmc enh_area set <-y|-n|-c> <start KiB> <length KiB> <device> the command that is implemented here ( mmc enh_area [-c] <device> ) is easier to use (because you don't have to check the maximal allowed size by reading some registers and calculate the available size from them (which then must be calculated back to register values by the mmc command)) but less flexible as it doesn't allow all the crazy possibilities specified in the eMMC standard (yet?) but just creates an enhanced area with maximal size. In the future something like mmc enh_area -s 30k <device> could be used to not use the maximal but an explicit size. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mci: provide wrapper for mci_get_device_by_name ∘ devpath_to_nameUwe Kleine-König2019-09-122-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also convert the only user of mci_get_device_by_name to this new wrapper. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mci: imx-esdhc: fix error handling during probeMarco Felsch2019-09-121-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the the driver don't handle any error and return immediately. Handling the errors correctly is a must to support defered probing. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mci: core: make mci_register -EPROBE_DEFER sensitiveMarco Felsch2019-09-121-0/+4
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the current regulator can't be requested because of -EPROBE_DEFER we shouldn't print a error and ignore it. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/misc'Sascha Hauer2019-10-1755-518/+1664
|\ \ \ \ \
| * | | | | Documentation: boards: stm32mp: document environment partitionAhmad Fatoum2019-10-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have barebox get its environment out of a "barebox-environment" partition. The BootROM and first stage bootloader both select partitions on name not UUID, so we're following suit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: stm32mp: dk2: rename function according to init levelAhmad Fatoum2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dk2_postcore_init is not at postcore init level like the name would suggest, but at mem init level. Rename it accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | ARM: dts: stm32mp: add barebox-enviroment on DK boardsOleksij Rempel2019-10-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | fs: devfs-core: have device_find_partition search symlinksAhmad Fatoum2019-10-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The barebox,environment binding documentation notes following for the device-path property's second string: > <partname> can be the label for MTD partitions, the number for DOS > partitions (beginning with 0) or the name for GPT partitions. This doesn't work currently because the named partitions are realized as symlinks and those aren't searched by device_find_partition. Fix this by having symlinks feature an appropriate partname if the cdev they link at has one and then have device_find_partition search those as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | Merge branch 'imx_gpt_file_header_fix' of ↵Sascha Hauer2019-10-141-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | https://github.com/KLSMartin/barebox into for-next/misc
| | * | | | | common/partitions/efi: fix gpt detectionLeif Middelschulte2019-10-141-1/+1
| | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some boards (such as i.MX) the buffer might contain both: A barebox image *and* a GPT partition table. Thus, irrelevant filetypes should be ignored.
| * | | | | mfd: superio: add base SMSC MFD driverAhmad Fatoum2019-10-143-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SMSC FDC37C93xAPM is the Super I/O chip on the Dell Latitude 7490. This adds device detection for it and its siblings, so device drivers can be written against it or init scripts can use its regmap interface. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | watchdog: add support for Fintek F718xx and, F818xx Super I/OAhmad Fatoum2019-10-143-0/+389
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an adaptation of the Linux v5.3 f71808e_wdt driver for the watchdog component of the Fintek Super I/O chips. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mfd: superio: add Fintek MFD driverAhmad Fatoum2019-10-143-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super I/O chips require a password to unlock access to the I/O ports. Add a driver that pokes the password and registers the appropriate GPIO and Watchdog devices as well as a regmap reflecting the Super I/O chip. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mfd: add basic Super I/O chip helpersAhmad Fatoum2019-10-144-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super I/O chips are ICs common to x86 that are used for interfacing to low-bandwidth peripherals. They often contain serial ports, watchdog timers and hardware monitoring units. They are usually addressable via one of two I/O port pairs, either 0x2e-0x2f or 0x4e-0x4f, but they don't typically respond to reads from their range unless a device-specific 'password' has been poked in. After this is done, they are read and written in the same manner however. On Linux, these devices aren't subject to any device/driver model. Each driver for some function (e.g. watchdog or GPIO) duplicates the device probe in the module_init and board-specific configuration is handled via module parameters. Lets do it a bit fancier in barebox and add a helper to register chips and a regmap for the control and configuration registers as well as a helper to register child devices for each function contained within the Super I/O chip. Board-specific configuration, e.g. which pin to use as a watchdog reset, can then be realized using barebox device-specific parameters. The regmap will be more of a debugging aid, however. For ease of porting from Linux, it's expected that access to the I/O ports won't happen via the regmap. For this reason, the new <superio.h> header offers functions to read/write these chips' registers as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | regulator: pfuze: add device_id of pfuze3001Ahmad Fatoum2019-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables easy access to the pfuze3001's registers via regmap. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | regulator: pfuze: remove unused driver_dataAhmad Fatoum2019-10-141-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We pass along driver_data that goes unused. Drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | gpio: add DA9062 MFD gpio supportMarco Felsch2019-10-141-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DA9062 PMIC is a mfd device which have 5 gpios. These can be configured to work as input/output or to have an alternate function. This commit adds the support to configure the gpios as input or output. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mfd: da9063: add support to populate subdevsMarco Felsch2019-10-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream dt-bindings abstracts the DA9063/2 PMIC MFD by multiple of-subnodes and the linux-mfd core creates platform-devices for each node. Due to the lack of a mfd fw we need to add the platform-devices by our own to reuse the upstream bindings. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | MIPS: net: ag71xx/ar9331: partially sync network support with upstreamOleksij Rempel2019-10-144-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ethernet support for ar9331 is upstream now. So, drop every thing what is provided by upstream devicetree and rename compatible in the driver. barebox network driver will need more work to be upstream compliant. For example we should not request or touch the gmac register directly. Since currently it is not clear how this should be implemented, patch the upstream dts with reg-names = "ge0", "gmac". Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | common: state: fix backward compatibilityUlrich Ölmann2019-10-141-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts [1] as it annihilated its counterpart of commit [2]. [1] 5033b4f58f71 ("common: state: harmonize code with dt-utils") [2] 480cde1b2283 ("state: keep backward compatibility") Fixes: 5033b4f58f71 ("common: state: harmonize code with dt-utils") Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | state: backend_bucket_circular: fix double free()Ulrich Ölmann2019-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the following dt-utils commit (as the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync): | commit 634317cc91202304c1477a6d738d7c7691b80419 | Author: Kim Christensen <kch@skov.dk> | Date: Wed Sep 18 16:48:23 2019 +0200 | | state: backend_bucket_circular: fix double free() | | The function state_mtd_peb_read() is only a user of buf and not its owner, | hence it may not deallocate it. | | Signed-off-by: Kim Christensen <kch@skov.dk> | Reviewed-by: Ulrich Ölmann <u.oelmann@pengutronix.de> | Reviewed-by: Uwe Kleine-König <u.kleine-koenig@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>
| * | | | | state: backend_bucket_circular: harmonize code with dt-utilsUlrich Ölmann2019-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comparing barebox' commit [1] with dt-utils' commit [2] it is obvious that adjusting the return value has been forgotten in barebox - fix that. (As the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync). [1] 9d6d91931afb ("state: Remove -EUCLEAN check from userspace tool") [2] 791a2404116d ("state: Remove -EUCLEAN check from userspace tool") Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | nvmem: Fix read/write access to partition devicesStefan Riedmueller2019-10-141-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partition devices are not directly associated with the nvmem instance but via their master cdev. Thus reading and writing needs to be handled via the master. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | commands: ubsan: remove redundant dependsAhmad Fatoum2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the config is already in an if COMMAND_SUPPORT clause, so no need to depend on it as well. Remove the redundancy. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | kbuild, LLVMLinux: Add -Werror to cc-option to support clangMark Charlebois2019-10-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang will warn about unknown warnings but will not return false unless -Werror is set. GCC will return false if an unknown warning is passed. Adding -Werror make both compiler behave the same. [arnd: it turns out we need the same patch for testing whether -ffunction-sections works right with gcc. I've build tested extensively with this patch applied, so let's just merge this one now.] Signed-off-by: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [afa: ported to barebox from upstream c3f0d0bc5b01ad9] Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | net: dsa: mv88e6xxx: Wait for EEPROM done after HW resetAndrey Smirnov2019-10-145-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a unpublished patch from Andrew Lunn: When the switch is hardware reset, it reads the contents of the EEPROM. This can contain instructions for programming values into registers and to perform waits between such programming. Reading the EEPROM can take longer than the 100ms mv88e6xxx_hardware_reset() waits after deasserting the reset GPIO. So poll the EEPROM done bit to ensure it is complete. Signed-off-by: Andrew Lunn <andrew@lunn.ch> orignal patch augmented to have necessary Global 1 plubming, ported to Barebox and slightly changed. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | net: dsa: mv88e6xxx: Fix error message typoAndrey Smirnov2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s/MIDO/MDIO Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | USB: gadget: ACM: don't announce V.25ter supportAhmad Fatoum2019-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox currently announces support for ITU V.25ter AT commands, but doesn't handle them specially when they arrive. Instead they are passed as is to the sole barebox input console, where it may interfere with valid user input. This is especially annoying as ModemManager probes ttyACM devices that announce their AT command support. So even when not using the ttyACM device at all, the other UART ports are affected. Fix this by ceasing to announce USB_CDC_ACM_PROTO_AT_V25TER as function protocol. After applying this patch, I can't see any spurious AT or ~x~ symbols on the console anymore. Cc: <bst@pengutronix.de> Cc: <jlu@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | common: ubsan: ignore shifting one into sign bitAhmad Fatoum2019-10-141-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __ubsan_handle_shift_out_of_bounds handler would be called for code shifting a one into the sign bit like (1 << 31), which is all too common in barebox. It's technically UB, but it's so prevalent that it's highly unlikely to be treated by a compiler as anything else than the standard-compliant (1U << 31). Check for this case here and ignore it selectively. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | input: set console input name as inputAhmad Fatoum2019-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input console is usually called /dev/cs0 and devinfo doesn't yield any extra information what this device is about. Rename it for clarity. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | console: disallow opening for writing when no write method definedAhmad Fatoum2019-10-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some consoles, like the input console (usually /dev/cs0), don't feature a puts or putc callback. Trying to echo out of them would thus crash: barebox@Embest MarS Board i.MX6Dual:/ echo -a /dev/cs0 prefetch abort pc : [<00000004>] lr : [<4fd05071>] WARNING: [<...>] (fops_write+0xd/0x10) WARNING: [<...>] (devfs_write+0x21/0x2a) WARNING: [<...>] (__write+0xcb/0xf0) WARNING: [<...>] (write+0x2d/0x68) WARNING: [<...>] (dputc+0x31/0x34) WARNING: [<...>] (do_echo+0xcb/0x144) Fix this by only allowing open(.., O_WRONLY) or open(..., O_RDWR) when puts is defined. Consoles defining putc are covered by this as well as those have putc-calling __console_puts assigned as their puts when they are registered. Now echo -a /dev/cs0 would yield: open: Operation not permitted Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | mtd: ubi: Max out wear-leveling thresholdStefan Riedmueller2019-10-144-26/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the recursive ubi_thread implementation in the barebox, a large amount of wear-leveling can lead to a stack overflow. This was observed during extensive ubi stress tests with the linux kernel and periodic power cycles. We found that if the wear-leveling threshold is exceeded and a large amount of erase blocks need wear-leveling the stack can overflow. The hardware used to observe this was a phyCORE-i.MX 6 with 1GB NAND flash. As the kernel is perfectly capable of handling wear-leveling we can disable wear-leveling in the barebox by maxing out the threshold and removing its Kconfig option. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | regmap: align documentation in comment with codeAhmad Fatoum2019-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_get_regmap has some copy-paste left-over in the comment. Rectify this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | blspec: skip entries that are not blspec entriesMichael Tretter2019-10-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of boot entries can contain items that are not blspec entries. For example, the bootchooser also adds an item to this list. Therefore, blspec cannot unconditionally interpret entries as blspec entries. The error is reproduced by listing the boot entries with the bootchooser and a rootfs with blspec entries, e.g.: boot -l bootchooser /mnt/nfs Check if a bootentry is a blspec entry by testing if the boot function is blspec_boot. Reported-by: Thomas Hämmerle <Thomas.Haemmerle@wolfvision.net> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | chdir(): add LOOKUP_DIRECTORY flag to filename_lookup()Robert Karszniewicz2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure that automount points get handled even if the path doesn't end with a '/'. Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | trivial: fix typo lenght -> lengthUwe Kleine-König2019-10-145-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated by perl -p -i -e 's/lenghte?/length/' arch/arm/boards/chumby_falconwing/falconwing.c arch/arm/mach-samsung/mem-s3c64xx.c fs/ext4/ext_common.h lib/gui/lodepng.c include/jtag.h There is another instance in dts/Bindings/usb/s3c2410-usb.txt, this is fixed in Linux v5.3-rc1 so supposed to be fixed soon in barebox, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | Documentation: make gen_commands helper python3 compatibleUwe Kleine-König2019-10-141-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some machines the python command is provided by Python 3 while on most (at least in my bubble) it is still Python 2. Modify the code to make it usable by both Python versions. print_function is available in __future__ since Python 2.6.0a2, which shouldn't be a relevant restriction. The modified script generates the same documentation as the old one; independent if the script is called using Python 2 (here: 2.7.16) or Python 3 (here: 3.7.3). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
| * | | | | Convert latin1 files to utf-8Uwe Kleine-König2019-10-144-385/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The source files are parsed by $(make docs). Currently this is done using python2 (actually 'python' which is still python2 on most machines). When using python3 however (which has a stricter encoding handling) it is easier if all input is in utf-8 encoding. So convert the few remaining latin1 encoded files to utf-8. This only affects code comments. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
| * | | | | libfile: Document that read_file() returns a terminated bufferSascha Hauer2019-10-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_file() and read_file_2() return a '\0' terminated buffer to make sure the buffer is usable as a string. Other code like read_file_line() depends on this behaviour, so document it explicitly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | imd: fix memory leakUlrich Ölmann2019-10-141-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each invocation of 'imd' ate up to 1MB of RAM. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | state: provide dummy implementations for some functions when STATE is disabledUwe Kleine-König2019-10-142-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to simplify some callers as can be seen from the phytec-som-am335x/board.c change. (The check for state != NULL could be dropped already before.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | | state: drop unused code and declarations for non-existing functionsUwe Kleine-König2019-10-142-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state_get_name() is not used and so can be removed. state_backend_dtb_file() and state_backend_raw_file() were dropped in c999b507da98 ("state: Refactor state framework"). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>