summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2020-02-182-0/+322
|\
| * fs: jffs2: add initial support for reading jffs2Steffen Trumtrar2020-02-102-0/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import the jffs2 filesystem code from Linux v5.5-rc1 and convert it to work with barebox. Writing is *not* supported. Testing was done with a n25q256a-compatible QuadSPI chip on a SoCFPGA-based Socrates board. Testing was done with a combination of: user@somelinuxhost: mkfs.jffs2 --eraseblock=4 -d fs/jffs2/ -o jffs2.img root@target:~ flash_erase -j /dev/mtd5 0 0 root@target:~ dd if=jffs2.img of=/dev/mtd5 barebox@EBV SOCrates:/ mount /dev/mtd0.data (...) mounted /dev/mtd0.data on /mnt/mtd0.data Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk-conf.h: Add static inline wrapper for of_clk_set_defaults()Sascha Hauer2020-02-131-0/+8
| | | | | | | | | | | | Will be needed once we call of_clk_set_defaults() from the driver core. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk-conf.h: Add missing re-inclusion protectionSascha Hauer2020-02-131-2/+5
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include/linux/amba/bus.h: drop unused declarationsAntony Pavlov2020-01-081-6/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-12-101-1/+0
|\
| * remoteproc: register a device for new remoteproc instancesAhmad Fatoum2019-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct rproc has a device_d dev field, but so far it was unregistered. The implementation had a few downsides: - dev_printf prints NULL, because the unique_name of the device is NULL - The name used by firmwareload is the device tree node's name, which might be unnecessarily verbose, e.g. mlahb:m4@10000000.of - All remoteproc devices are given the same (unused) name and index Fix these by registering a device for the remoteproc and using it where appropriate. While at it, allow the remoteproc name to come from a device tree alias as well. This breaks user behavior in that firmwareload now uses the alias or remoteprocN to reference the remoteproc instance. This is probably acceptable as the driver is a very recent addition. Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/pci'Sascha Hauer2019-12-102-0/+35
|\ \
| * | PCI: copy over some Linux PCI helpersAhmad Fatoum2019-12-091-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | Linux PCI drivers, like the incoming 8250_pci, make use of these helpers. Port them over from Linux v5.4. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | PCI: add driver_data member to struct pci_device_idAhmad Fatoum2019-12-091-0/+1
| |/ | | | | | | | | | | | | | | | | Linux drivers have a driver data member in the struct to associate variant specific driver data with each device id. Do likewise in barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mtd: spi-nor: fix wrong value for CR_QUAD_EN_SPANClement Leger2019-12-091-1/+1
|/ | | | | | | Durign a previous patch, 0x2 was mistakenly converted to BIT(2) whereas it should be BIT(1). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* regulator: add driver for stpmic1-regulatorsAhmad Fatoum2019-11-061-0/+199
| | | | | | | | | | | This commit imports the Linux v5.3 state of the driver. This allows us to regulate at least the v3v3 voltage rail used by the DK1 and DK2 Ethernet PHY and SD-Card. Eventually, this driver should be used by the USB host driver to supply the vbus voltage as well. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* regulator: port Linux of_regulator_matchAhmad Fatoum2019-11-062-0/+255
| | | | | | | | | | | | | | Linux regulator drivers like the pfuze and the incoming stpmic make use of of_regulator_match to parse regulator init data from the device tree. Port the function over from Linux v5.3, so drivers depending on it can follow. As we have no use in barebox for power saving and suspend states, these parts are omitted. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/remoteproc'Sascha Hauer2019-10-171-0/+51
|\
| * port reduced version of remoteproc framework from linuxOleksij Rempel2019-09-261-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tested it on phytec imx7 board with remoteproc ELF image previously used on Linux. Linux would load this image, create appropriate resource (if defined in image) and boot it. The barebox version is only loading image and boot it. Currently barebox version do not extract resources defined by rproc ELF image. On this early stage it is hard to say, if it is needed. Previously there was an attempt to port bootaux command from u-boot. Porting of remoteproc framework is my attempt to lead this topic in to the (IMO) right direction. To start remoteproc image, firmwareload command should be used: firmwareload /mnt/tftp/rproc-imx-rproc-fw Since firmwareload already support multiple targets, it is possible to specify which exact cortex m4 CPU should be started (if multiple CPU are present). This example shows the list of available firmware targets: barebox@Phytec i.MX7 phyBOARD-Zeta:/ firmwareload -l firmware programming handlers: name: model: soc:imx7d-rp0@0.of Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | 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>
* 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/qemu'Sascha Hauer2019-09-122-0/+27
|\ \
| * | Compile libfdt for bareboxSascha Hauer2019-08-192-0/+27
| |/ | | | | | | | | | | | | | | | | 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-121-1/+1
|\ \
| * | 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>
* | 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-121-0/+1
|\ \
| * | 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>
* / 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>
* 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/pstore'Sascha Hauer2019-07-121-2/+4
|\ \
| * | pstore: remove unused codeSascha Hauer2019-07-091-2/+0
| | | | | | | | | | | | | | | | | | pstore_info->write() is unused, remove the code implementing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pstore: Only capture log messagesSascha Hauer2019-07-091-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | With this pstore only captures barebox log messages printed with pr_* and dev_*, but no longer anything printed with printf and friends. When capturing the barebox output with pstore only the log messages are of interest, but not the ones printed with printf and certainly not the things typed interactively on the command line. These are logged currently because we register pstore as a barebox console. Instead, hook into pr_puts which only outputs the barebox log messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-07-121-1/+1
|\ \
| * | treewide: remove stale mentions of CONFIG_OF in commentsAhmad Fatoum2019-06-131-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | barebox doesn't define a CONFIG_OF kconfig option, but CONFIG_OFTREE for the device tree handling and CONFIG_OFDEVICE for probing devices out of the device tree. Replace comment mentions of CONFIG_OF with mentions of either as appropriate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: divider: export clk_div_mask() helperMarcin Niestroj2019-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e6d3cc7b1fac3d7f1313faf8ac9b23830113e3ec Linux upstream. clk: divider: export clk_div_mask() helper Export clk_div_mask() in clk-provider header so every clock providers derived from the generic clock divider may share the definition instead of redefining it. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Michael Turquette <mturquette@baylibre.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: divider: Make generic for usage elsewhereMarcin Niestroj2019-07-021-0/+8
|/ | | | | | | | | | | | | | | | | | commit bca9690b942654f668ffb5124b2bbd0ba0f007bb Linux upstream adjusted to current Barebox codebase. clk: divider: Make generic for usage elsewhere Some devices don't use mmio to interact with dividers. Split out the logic from the register read/write parts so that we can reuse the division logic elsewhere. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Michael Turquette <mturquette@linaro.org> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: provide default erase_sector implementationSteffen Trumtrar2019-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Based on the Linux v4.4 patch commit c67cbb839da9cc2757eabfa128556db6a2baf160 Author: Brian Norris <computersforpeace@gmail.com> AuthorDate: Tue Nov 10 12:15:27 2015 -0800 Commit: Brian Norris <computersforpeace@gmail.com> CommitDate: Thu Nov 19 13:34:44 2015 -0800 mtd: spi-nor: provide default erase_sector implementation Some spi-nor drivers perform sector erase by duplicating their write_reg() command. Let's not require that the driver fill this out, and provide a default instead. Tested on m25p80.c and Medatek's MT8173 SPI NOR flash driver. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocolsSteffen Trumtrar2019-05-081-26/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync the driver with Linux v4.12 and apply the patch commit cfc5604c488ccd17936b69008af0c9ae050f4a08 Author: Cyrille Pitchen <cyrille.pitchen@atmel.com> AuthorDate: Tue Apr 25 22:08:46 2017 +0200 Commit: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> CommitDate: Mon May 15 21:56:17 2017 +0200 mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols This patch changes the prototype of spi_nor_scan(): its 3rd parameter is replaced by a 'struct spi_nor_hwcaps' pointer, which tells the spi-nor framework about the actual hardware capabilities supported by the SPI controller and its driver. Besides, this patch also introduces a new 'struct spi_nor_flash_parameter' telling the spi-nor framework about the hardware capabilities supported by the SPI flash memory and the associated settings required to use those hardware caps. Then, to improve the readability of spi_nor_scan(), the discovery of the memory settings and the memory initialization are now split into two dedicated functions. 1 - spi_nor_init_params() The spi_nor_init_params() function is responsible for initializing the 'struct spi_nor_flash_parameter'. Currently this structure is filled with legacy values but further patches will allow to override some parameter values dynamically, for instance by reading the JESD216 Serial Flash Discoverable Parameter (SFDP) tables from the SPI memory. The spi_nor_init_params() function only deals with the hardware capabilities of the SPI flash memory: especially it doesn't care about the hardware capabilities supported by the SPI controller. 2 - spi_nor_setup() The second function is called once the 'struct spi_nor_flash_parameter' has been initialized by spi_nor_init_params(). With both 'struct spi_nor_flash_parameter' and 'struct spi_nor_hwcaps', the new argument of spi_nor_scan(), spi_nor_setup() computes the best match between hardware caps supported by both the (Q)SPI memory and controller hence selecting the relevant settings for (Fast) Read and Page Program operations. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: remove unused read_xfer/write_xfer hooksSteffen Trumtrar2019-05-081-32/+0
| | | | | | | | | | | | | | | | | | | | | | Based on the Linux v4.3 patch: commit 79c452adb159dc9abc507ea13faec8d115a78758 Author: Cyrille Pitchen <cyrille.pitchen@atmel.com> AuthorDate: Fri Sep 18 17:49:25 2015 +0200 Commit: Brian Norris <computersforpeace@gmail.com> CommitDate: Mon Sep 21 16:49:52 2015 -0700 mtd: spi-nor: remove unused read_xfer/write_xfer hooks struct spi_nor_xfer_cfg and read_xfer/write_xfer hooks were never used by any driver. Do some cleanup by removing them. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: remove unused write_enable from write_regSteffen Trumtrar2019-05-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Based on the Linux v4.2 commit: commit f9f3ce835ddce3c669eee869253105f88819888b Author: Jagan Teki <jteki@openedev.com> AuthorDate: Wed Aug 19 15:26:44 2015 +0530 Commit: Brian Norris <computersforpeace@gmail.com> CommitDate: Fri Sep 11 16:04:55 2015 -0700 mtd: spi-nor: Zap unneeded write_enable from write_reg The 'write_enable' argument is unused and unneeded, so remove it from the API. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Han Xu <han.xu@freescale.com> [Brian: fixed for nxp-spifi.c] Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Extend the core to ease integration of SPI memory controllersSteffen Trumtrar2019-05-081-0/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync with Linux v5.1-rc1. This is the barebox adoption of the commit commit c36ff266dc82f4ae797a6f3513c6ffa344f7f1c7 Author: Boris Brezillon <boris.brezillon@bootlin.com> Date: Thu Apr 26 18:18:14 2018 +0200 spi: Extend the core to ease integration of SPI memory controllers Some controllers are exposing high-level interfaces to access various kind of SPI memories. Unfortunately they do not fit in the current spi_controller model and usually have drivers placed in drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI memories in general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-04-091-14/+27
|\
| * clk: mux: Support CLK_SET_RATE_NO_REPARENT flagSascha Hauer2019-03-111-0/+1
| | | | | | | | | | | | | | Since barebox doesn't do reparenting on rate changes we only have to define the flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: mux: Support CLK_MUX_READ_ONLY flagSascha Hauer2019-03-111-0/+1
| | | | | | | | | | | | Support readonly dividers using the CLK_MUX_READ_ONLY flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: mux: Support mux specific flagsSascha Hauer2019-03-111-6/+8
| | | | | | | | | | | | | | We'll need mux specific flags in the future, so add a parameter to the mux initialization functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: divider: Support CLK_DIVIDER_READ_ONLY flagSascha Hauer2019-03-111-0/+1
| | | | | | | | | | | | To support a readonly divider add the CLK_DIVIDER_READ_ONLY flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: divider: pass divider flagsSascha Hauer2019-03-111-6/+10
| | | | | | | | | | | | | | The generic clk divider needs clock flags and divider flags. Fix prototypes to take both as separate arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>