summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Documentation: Provide default values for version/releaseAndrey Smirnov2019-09-091-2/+2
| | | | | | | | | Provide default values for version/release so it would be possible to run Sphinx outside of the build system. Useful for rst-sphinx backend of flycheck in Emacs, for example. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c/pca954x: Initialize the mux to disconnected stateAndrey Smirnov2019-09-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of a Linux kernel commit cd823db8b1161ef0d756514d280715a576d65cc3 pca954x power-on default is channel 0 connected. If multiple pca954x muxes are connected to the same physical I2C bus, the parent bus will see channel 0 devices behind both muxes by default. This is bad. Scenario: -- pca954x @ 0x70 -- ch 0 (I2C-bus-101) -- EEPROM @ 0x50 | I2C-bus-1 --- | -- pca954x @ 0x71 -- ch 0 (I2C-bus-111) -- EEPROM @ 0x50 1. Load I2C bus driver: creates I2C-bus-1 2. Load pca954x driver: creates virtual I2C-bus-101 and I2C-bus-111 3. Load eeprom driver 4. Try to read EEPROM @ 0x50 on I2C-bus-101. The transaction will also bleed onto I2C-bus-111 because pca954x @ 0x71 channel 0 is connected by default. Fix: Initialize pca954x to disconnected state in pca954x_probe() Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: rave-sp: Emulate firmware/bootloader mode reporting on RDU2Andrey Smirnov2019-09-092-2/+17
| | | | | | | | | Add code to emulate firmware/bootloader mode reporting via "general_status" field on RDU2. This is needed to correctly report if RAVE SP is in bootloader of application mode during startup. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mips: bootm: Cast elf entry into unsigned longClement Leger2019-09-061-1/+1
| | | | | | | | | Since elf entry type is now a u64 to accomodate both type of elf files (64 and 32 bits), we need to cast it to the pointer length before casting it to the pointer type. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* elf: add 64 bits elf loading supportClement Leger2019-09-062-23/+51
| | | | | | | | | | | | | | | | This patch add elf64 loading support to the elf loader. Since elf32 and elf64 uses completely different types, to avoid copying all the code and simply replace elf32 with elf64, use a macro which will return the appropriate field for each type of header. This macro generates getter for elf structures according to the class of the loaded elf. All direct elf struct dereference are then replaced by call to generated functions. This allows to keep a common loader code even if types are different. Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* libfile: fix typosMichael Tretter2019-09-061-2/+2
| | | | | Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/stm: fix return value handling for of_get_display_timings()Uwe Kleine-König2019-09-061-2/+2
| | | | | | | | of_get_display_timings() returns NULL on failure, not an error pointer. Fixes: 16fd24847d7a ("video: stmfb: Add device tree support") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: efi: fix typosAhmad Fatoum2019-09-021-3/+3
| | | | | Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: zii-imx7d-dev: Fix errors with openocd configuration scriptCory Tusar2019-09-021-0/+6
| | | | | | | | | | | | | | | When attempting to use the existing configuration file to bootstrap an RMU2 board, openocd would consistently fail in the 'safe_reset' function with a number of errors. Disabling the internal reset handling (similar to what's done on the i.MX7 Sabre boards) allowed barebox to download and run successfully. Tested with openocd-0.10.0+dev-00924-g16496488 on a Zodiac RMU2. Signed-off-by: Cory Tusar <cory.tusar@zii.aero> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: zii-vf610-dev: Use CTRL-C as autoboot abortCory Tusar2019-09-021-0/+1
| | | | | | | | This brings the various VF610-based units in line with other ZII platforms. Signed-off-by: Cory Tusar <cory.tusar@zii.aero> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: dts: vf610-zii-cfu1: Fix indentationCory Tusar2019-09-021-4/+4
| | | | | | | Whitespace only - no functional changes. Signed-off-by: Cory Tusar <cory.tusar@zii.aero> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: fix out-of-bounds read in dputc(/dev/*, ...)Ahmad Fatoum2019-09-026-22/+50
| | | | | | | | | | | | | | | | | | Trying to output a single character via echo -a /dev/serial0-1 currently results in garbage output after the newline, because console.c's fops_write discards the buffer length and passes the buffer to (struct cdev)::puts which only handles NUL-terminated strings. Fix this by amending (struct cdev)::puts with a new nbytes parameter, which is correctly propagated. All this functions now return at most the nbytes parameter they were passed in. This fixes __console_puts, which used to count new lines twice in its return value. Fixes: b4f55fcf35 ("console: expose consoles in devfs") Cc: Bastian Krause <bst@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* startup: allow ctrl+c abort during boot sequenceAhmad Fatoum2019-08-301-2/+2
| | | | | | | | | | At the moment e.g. a wait for an ARP response during net boot can only aborted if the auto boot countdown was aborted. Otherwise ctrl+c is without effect. For better user experience allow code querying for ctrl+c to see it even if barebox had not dropped into a shell. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: omap4_usbbootfs: remove commented out codeAhmad Fatoum2019-08-301-41/+0
| | | | | | | | The code has been sitting commented out in version control for close to 7 years now, drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX: bbu: early exit when partition too smallAhmad Fatoum2019-08-301-0/+10
| | | | | | | | | | | | | | | | | | | | So far, writing a barebox image exceeding the partition size aborts with EPERM as truncate isn't implemented: ERROR: writing to /dev/flash-boot.barebox failed with Operation not permitted update failed ERROR: fastboot: update barebox: Operation not permitted This is unfortunate because by the time the truncation fails, erasing the partition had already occurred. Avoid this by checking prior to the pwrite_all whether the file to be written is big enough. This is valid here because barebox update wouldn't be called on a regular file. While at it, present callers with a more helpful ENOSPC error. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* libfile: have write_full return a descriptive error codeAhmad Fatoum2019-08-301-2/+3
| | | | | | | | | | | | | | So far (p|)write_full has been returning -1 on error. Some callers of write_full like imx_bbu_write_device print out the function's return value on error, effectively rendering every printed error message to be due to EPERM. On the other hand, some callers like do_memcpy, use it correctly and use errno. Sidestep the issue by having the function return -errno on errors as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fat: fix use of wrong enumeration typeAhmad Fatoum2019-08-301-1/+1
| | | | | | | | disk_read returns a DRESULT, not enum filetype. Change the return value appropriately. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: png_lode: fix freeing of uninitialized pointerAhmad Fatoum2019-08-301-6/+7
| | | | | | | | | If either calloc or png_uncompress_init fails, free(png) will free the uninitialized png pointer. Avoid this and while at it postpone the img allocation till after the early exit. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: mmc_extcsd: describe missing bitAhmad Fatoum2019-08-302-2/+10
| | | | | | | | | | The EXT_CSD_EXCEPTION_EVENTS_STATUS array entry is wrongly duplicated. Replace the index by the correct field at byte offset 58[1]. [1]: See http://webshop.atlantiksysteme.de/temp/FLEXXONeMMC4.5pSLCSPECV1.2.pdf Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: fsl_udc: remove always-true null pointer checksAhmad Fatoum2019-08-301-8/+1
| | | | | | | | struct fsl_ep's name member can never be NULL because it is a character array. Remove these superfluous null pointer checks. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvme: use 64 bit types for timeouts even on 32 bit systemsAhmad Fatoum2019-08-301-2/+2
| | | | | | | | | The SHUTDOWN_TIMEOUT value of 5e9 would already exceed the range of unsigned long on a 32-bit system. Fix this by using uint64_t for all time-holding variables. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: fix inverted poll-for-readyAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | | | The ! operator is applied wrongly to only smc91xx_reg_read's return value, when probably the intention was for it to apply to the whole expression. However, wait_on_timeout keeps looping while the condition is false, so dropping the ! is the right thing to do. Do the right thing. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: mv88e6xxx: remove duplicate member in struct initializerAhmad Fatoum2019-08-301-1/+0
| | | | | | | There's already an .ops member two lines later. Remove one. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c-mux-pca954x: remove use of uninitialized variableAhmad Fatoum2019-08-301-3/+3
| | | | | | | | force isn't used except to print its uninitialized value in an error path. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ata: fix mismatched header guardsAhmad Fatoum2019-08-301-2/+2
| | | | | | | | | The header checks for ATA_DISK_H, but defines a different ATA_DISK, which would lead to compilation errors when included multiple times. Fix this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: remove unused variableAhmad Fatoum2019-08-301-2/+0
| | | | | | | instr_param serves no purpose in the function. Thus remove it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ratp: fix use of %hu for printing intAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | While each of path_size and data_size is 16 bit in size, their sum may exceed this. Also the type of the resulting expression is an int, thus change the format specifier accordingly. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* startup: Fix typo in commentLadislav Michl2019-08-231-1/+1
| | | | | | Fixes: 35266d7e583f ("startup: Factor out the autoboot counter...") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* startup: Register autoboot variables earlierLadislav Michl2019-08-231-7/+11
| | | | | | | | | | | Autoboot is controlled by autoboot_timeout and autoboot_abort_key variables which might be altered by init scripts, so we need to register them before those scripts are run. Otherwise they are set back to defaultenv values upon registration. Fixes: 35266d7e583f ("startup: Factor out the autoboot counter...") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Makefile: we are on 2019.08Sascha Hauer2019-08-211-1/+1
| | | | | | | I forgot to increase the version in the Makefile for the last release. Increase the version now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-08-1514-6/+506
|\
| * Documentation: boards: add initial STM32MP documentationAhmad Fatoum2019-08-051-0/+71
| | | | | | | | | | | | | | | | Support for the SoC is still in progress, but lets document what we have now. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: generate STM32 imagesAhmad Fatoum2019-07-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific STM32 file header. Generate this image type by default. If for some reason, the image without stm32 header is required, the start_stm32mp157c_dk2.pblb can be used. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * filetype: add STM32 image typeAhmad Fatoum2019-07-152-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific 256-byte long STM32 file header. Add detection of the header to file_detect_type(). While there's only one version of the header so far, identify the new header as v1 anyway, so new versions can be unambiguously added. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * images: add support for generating STM32MP imagesMarco Felsch2019-07-154-0/+293
| | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific STM32 file header. Add a stm32image utility to address this. Signed-off-by: Marco Felsch <marco.felsch@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: fix some misnomers/typosAhmad Fatoum2019-07-153-4/+4
| | | | | | | | | | | | | | | | | | The arch was renamed to stm32mp, so it doesn't look out of place when the stm32mp2 is released. Fix spotted comments/labels with the old name. While at it, fix a typo about the SoC name on the DK2 board. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset: add reset controller driver for STM32 RCCAhmad Fatoum2019-07-153-0/+115
| | | | | | | | | | | | | | | | | | On the STM32MP, reset of the I2C, SPI and USB IPs occurs over the RCC. This driver adds support for the controller, so it may be reused by other drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: dts: stm32mp157c: correct gpioz idAhmad Fatoum2019-07-151-1/+1
| | | | | | | | | | | | | | | | | | The pinctrl-stm32 driver uses the alias id to infer the index of the first GPIO supported by a controller. Because gpioz' identifiers start at ('Z' - 'A') * 0x10, change the id to 25. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: set CONFIG_ARCH_NR_GPIO = (26 * 16)Ahmad Fatoum2019-07-151-0/+4
| | | | | | | | | | | | | | | | | | The STM32MP1 GPIO bindings uses the range [400; 415] for the gpioz controller, which exceeds the barebox-wide ARCH_NR_GPIOS of 256. Therefore have the stm32mp define a subarch-specific max of 416. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: allow for arch-specific ARCH_NR_GPIOS > 256Ahmad Fatoum2019-07-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some architectures have non-contiguous GPIO ranges where some GPIOs can have identifiers exceeding the hardcoded ARCH_NR_GPIOs of 256. One such example is the STM32MP, whose gpioz controller has identifiers that go up to ('Z' - 'A' + 1) * 0x10 - 1 = 415. Instead of increasing the array size for all architectures or doing some sort of packing, allow architecture to define their own overriding CONFIG_ARCH_NR_GPIO like the kernel does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd-gpmi-nand'Sascha Hauer2019-08-155-128/+196
|\ \
| * | mtd: nand-mxs: Make ecc strength configurable via device treeSascha Hauer2019-08-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the binding doc the mxs NAND driver supports the "nand-ecc-strength" and "nand-ecc-step-size" options. This adds support for these options to the driver. The "nand-ecc-step-size" is not really configurable, the only accepted value is 512 so this is merely to sanity check that there's nothing specified that we can't yet support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Add function to parse device tree propertiesSascha Hauer2019-08-062-0/+29
| | | | | | | | | | | | | | | | | | | | | This adds nand_of_parse_node() which can be used to parse generic NAND device properties. Not very complete yet, but it's a start. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: inline only once used functionSascha Hauer2019-08-061-6/+1
| | | | | | | | | | | | | | | | | | | | | mxs_nand_ecc_size_in_bits() is used only once and is simple enough to be inlined. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: pass mtd_info to mxs_nand_get_mark_offset()Sascha Hauer2019-08-061-6/+5
| | | | | | | | | | | | | | | | | | | | | struct mtd_info * contains everything mxs_nand_get_mark_offset() needs, so pass this pointer rather than several integer arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: change API between NAND driver and fcb codeSascha Hauer2019-08-063-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The imx-bbu-nand-fcb update handler code calls into the NAND driver to get the ecc strength and bad block marker position. Change the API so that only a single function is necessary and not three functions. Also in future the ecc strength will be configurable via device tree. This means static parameters like page size / oob size are no longer enough to calculate the ecc strength and so we store a pointer to our mtd_info struct in a static global variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: Make locally used variable staticSascha Hauer2019-08-061-3/+1
| | | | | | | | | | | | | | | | | | | | | fake_ecc_layout is only used in the mxs nand driver, so make it static. Also it's not necessary to zero the structure. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: calculate ecc_strength only onceSascha Hauer2019-08-061-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calculating the ecc strength multiple times with each page read just do it once and store the result in chip->ecc.strength. While at it also store the correct value in chip->ecc.bytes instead of writing a bogus value into it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: consistently rename struct nand_chip * to "chip"Sascha Hauer2019-08-061-74/+74
| | | | | | | | | | | | | | | | | | | | | The struct nand_chip * is sometimes named "nand" and sometimes "chip". For consistency name it "chip" throughout the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2019-08-1511-30/+91
|\ \ \