summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | usb: gadget: add usb_gadget_udc_reset functionSteffen Trumtrar2019-09-171-0/+4
| |/ / | | | | | | | | | | | | | | | | | | Add a function to notify the udc core, that a bus reset occured. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/dtc'Sascha Hauer2019-10-171-0/+2
|\ \ \
| * | | lib: fdt: define INT32_MAX for in-barebox useAhmad Fatoum2019-10-021-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upcoming v1.5.1 version of libfdt adds a dependency on the C99 INT32_MAX symbol. This is ok for use in the host tool, but libfdt can also be embedded into barebox, where it would fail as we don't define this anywhere. Fix this by providing an appropriate definition. Reported-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/bfin'Sascha Hauer2019-10-171-8/+0
|\ \ \ | |/ / |/| |
| * | USB: remove blackfin supportSascha Hauer2019-09-121-8/+0
| |/ | | | | | | | | | | | | The blackfin architecture has been removed from barebox. Remove the blackfin specifics in the USB drivers as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mtd: nand: Fix retrieving nand_chip from mtd_infoSascha Hauer2019-09-121-1/+1
|/ | | | | | | | With 76b6f74c53 we begin embedding a struct mtd_info into struct nand_chip. With this mtd_to_nand() must be changed accordingly. Fixes: 76b6f74c53 ("mtd: nand: Embed struct mtd_info into struct nand_chip") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tftp'Sascha Hauer2019-09-121-0/+2
|\
| * fs: provide no_revalidate_d_ops for network file systemsAhmad Fatoum2019-08-231-0/+2
| | | | | | | | | | | | | | | | | | Networked file systems may wish to forego dentry caching altogether, so every lookup goes over the network and stale data is avoided. Provide a no_revalidate_d_ops helper object that does this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer2019-09-121-0/+20
|\ \
| * | i2c: port Linux i2c_parse_fw_timingsAhmad Fatoum2019-09-091-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Linux has a generic function for extracting i2c timings parameters from device-associated firmware nodes. Port this function to barebox, but have it only work on device tree nodes for now. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/reset-source'Sascha Hauer2019-09-121-14/+32
|\ \ \
| * | | oftree: expose reset_source device in device treeUwe Kleine-König2019-09-091-0/+5
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | reset_source: implement helper to set a device as reset sourceUwe Kleine-König2019-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to remove some boilerplate from drivers. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | reset_source: drop reset_source_set_instance()Uwe Kleine-König2019-08-281-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantic of reset_source_set_instance() required a separate call to reset_source_set() (or reset_source_set_priority()) and checked right usage only using the type. Make the set of functions a bit easier to use by dropping reset_source_set_instance() and instead introduce a function that can set all relevant parameters (source, priority and instance) in one go. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | reset_source: fix ordering of exported functionsUwe Kleine-König2019-08-281-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare and implement getters first, then setters. This syncs the order of functions in reset_source.c and reset_source.h. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | reset_source: use instance = -1 as defaultUwe Kleine-König2019-08-281-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with platform device id (does someone still remember?) 0 might be a valid id. So use -1 for "unknown" or "doesn't apply" instead of 0. Also don't pass the instance to the device tree if negative. (This ends up as 0xffffffff otherwise.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/qemu'Sascha Hauer2019-09-123-68/+28
|\ \ \
| * | | Compile libfdt for bareboxSascha Hauer2019-08-193-68/+28
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | libfdt can be useful for very early device tree parsing, so compile it for barobox aswell. This is done the same way as done in the Kernel: we put C files with the same name as in libfdt into lib/ and just include the libfdt files from there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/omap'Sascha Hauer2019-09-123-1/+56
|\ \ \
| * | | mtd: peb: Add function to write fileSascha Hauer2019-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a function to the mtd peb API to write a file spanning multiple blocks to a mtd device. Bad blocks are automatically skipped and before anything is done we check if the image will fit into the remaining space (honouring bad blocks). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: gpmc: Add BCH16 supportSascha Hauer2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for BCH16 ECC encoding. The support is mostly taken from Linux-5.3-rc6. One major change is the different wrap mode used. The Kernel uses wrapmode 1, which means "pass all data through the BCH engine". Still the Kernel has to skip the OOB marker which is done by reading all user data, then use NAND_CMD_RNDOUT to position right behind the OOB marker and then read the ECC data. Instead of doing this we use wrap mode 4 which allows us to bypass the OOB marker from the BCH engine automatically. This explains bch_wrapmode = 1, eccsize0 = 0, eccsize1 = 52 vs. bch_wrapmode = 4, eccsize0 = 4, eccsize1 = 52 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: gpmc: Add support for ELMSascha Hauer2019-08-281-0/+53
| | |/ | |/| | | | | | | | | | | | | | | | | | | This adds support for the ELM (Error Location Module) found on not-too-old OMAP SoCs. The driver has been taken from Linux-5.3-rc6 with interrupt support removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2019-09-121-0/+7
|\ \ \
| * | | mtd: nand: Embed struct mtd_info into struct nand_chipSascha Hauer2019-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to what is done in the Kernel. In the Kernel we have a struct nand_device embedded into struct nand_chip and the nand_device has an mtd_info embedded into it. Until we have struct nand_device we embed mtd_info directly into the nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: Add and use static inline wrapper for getting nand_chip from mtdSascha Hauer2019-08-261-0/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | All drivers in tree use mtd->priv for the nand_chip. Add and use a static inline wrapper mtd_to_nand() which we already have in the kernel for getting the nand_chip from the mtd_info struct. Next step would be to embed a struct mtd_info into struct nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2019-09-127-5/+52
|\ \ \
| * | | param: make dev_add_param_string_fixed value parameter constAhmad Fatoum2019-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is so far unused and the parameter's only use is to be passed as argument to dev_add_param_fixed which is const as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | gpio: iopoll: implement gpio_poll_timeout_usAhmad Fatoum2019-09-091-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we need to wait for state change on a GPIO, provide a helper for future code to do this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mfd: rave-sp: Emulate firmware/bootloader mode reporting on RDU2Andrey Smirnov2019-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | elf: add 64 bits elf loading supportClement Leger2019-09-061-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | console: fix out-of-bounds read in dputc(/dev/*, ...)Ahmad Fatoum2019-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | commands: mmc_extcsd: describe missing bitAhmad Fatoum2019-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | 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>
* | | Merge branch 'for-next/fsanitize'Sascha Hauer2019-09-122-6/+2
|\ \ \
| * | | Kconfig: retire empty <asm/barebox.h>Ahmad Fatoum2019-08-302-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the latest changes, this file is empty on all archs. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Kconfig: create Kconfig symbol for ARCH_HAS_DATA_ABORT_MASKAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other arch-specific features are exposed in Kconfig too, so do here likewise. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Kconfig: create Kconfig symbol for ARCH_HAS_STACK_DUMPAhmad Fatoum2019-08-301-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | Other arch-specific features are exposed in Kconfig too, so do here likewise. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/arm'Sascha Hauer2019-09-121-0/+1
|\ \ \ | |/ / |/| |
| * | mtd: spi-nor: add UNLOCK_GLOBAL_BLOCK supportOleksij Rempel2019-08-211-0/+1
| |/ | | | | | | | | | | | | | | Ported from linux-4.19-at91 linux4sam_6.1 and needed for SAMA5D27 SOM1 EK. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / pbl: Move piggy verification into pbl_barebox_uncompress()Sascha Hauer2019-08-231-2/+0
|/ | | | | | | | piggy verification is a direct prerequisite of uncompressing the piggydata, so move the verification there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-08-152-0/+5
|\
| * filetype: add STM32 image typeAhmad Fatoum2019-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * 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-152-6/+3
|\ \
| * | mtd: nand: Add function to parse device tree propertiesSascha Hauer2019-08-061-0/+2
| | | | | | | | | | | | | | | | | | | | | 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: change API between NAND driver and fcb codeSascha Hauer2019-08-061-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-next/imx8-hab'Sascha Hauer2019-08-154-6/+30
|\ \ \
| * | | stdio: puts and putchar static inline wrappersRouven Czerwinski2019-08-071-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add static inline wrappers for puts and putchar. This allows the usage of puts and putchar within the PBL even if the PBL_CONSOLE is disabled. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pbl: add sha256 and piggy verification to PBLRouven Czerwinski2019-08-072-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the necessary functions from sha256 into a PBL headder and add a verification function to the PBL. The function will be called before the individual architectures decompress functions is run. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | sections: fix macro for barebox_pbl_sizeRouven Czerwinski2019-08-071-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | On ARM64 this did not contain the expected barebox_pbl size. Rework this to be a substraction between __piggydata_start and __image_start, which should cover the whole PBL. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>