summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/mtd-nand'Sascha Hauer2020-11-1010-816/+2632
|\
| * nand command: Print OOB informationSascha Hauer2020-11-101-0/+2
| | | | | | | | | | | | | | | | NAND mtd devices carry information how the OOB area is used. So far there is no way to visualize it, so print it along with other NAND informations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: Update to Linux-5.9Sascha Hauer2020-11-109-766/+2592
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the barebox NAND layer and parts of the mtd layer to Linux-5.9. This patch is huge, but the barebox NAND layer is so far away from the Linux NAND layer that a step by step update would have taken ages. Unlike Linux barebox has functions to mark a block as good. This feature has been preserved. Also barebox used to make NAND write support optional, this feature is lost during the update for the sake of better compatibility to the Linux NAND layer. This patch has been tested: - GPMI aka nand_mxs on i.MX6 - nand_imx on i.MX25 - nand_omap_gpmc on AM335x - atmel_nand on Atmel sama5d3 - nand_denali on SoCFPGA Currently untested: - nand_orion - nand_mrvl_nfc - nand_s3c24xx The nand_denali driver is tested with the update of that driver to Linux-5.9 following in the next patch. I could only test the drivers with the NAND chips found on my boards, so there's still enough room for regressions, especially given that the NAND drivers themselves are mostly not updated. With the NAND layer being up-to-date with Linux it should hopefully be easy to update drivers to their Linux counterpart as well if necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Add ecc_step_sizeSascha Hauer2020-11-091-0/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: move function hooks to struct nand_legacySascha Hauer2020-11-091-43/+53
| | | | | | | | | | | | | | Linux had moved the traditional nand function hooks to an extra struct nand_legacy. Do the same in barebox for compatibility. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: Add match_string()Sascha Hauer2020-11-091-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: rename master to parentSascha Hauer2020-11-091-1/+7
| | | | | | | | | | | | | | In Linux mtd->parent is what in barebox is mtd->master. Rename this to get closer to the Linux mtd layer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: rename class_dev to devSascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | | | The mtds own device is named 'dev' in the Kernel whereas it's named 'class_dev' in barebox. Rename it to 'dev' for better compatilibility to the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Use classdev->parentSascha Hauer2020-11-091-1/+0
| | | | | | | | | | | | | | | | | | | | Instead of mtd->parent we can use mtd->classdev.parent which points to the same device. With this we can remove the 'parent' member of struct mtd_info. This member exists in the Linux kernel as well, but is of type struct mtd_info, so this is done as preparation to re-add mtd->parent with the same type as in Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Add underscore prefix to mtd hooksSascha Hauer2020-11-061-23/+23
| | | | | | | | | | | | | | In the Kernel the mtd function hooks begin with an underscore. Do the same in barebox to be better comparable to the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: Pass struct nand_chip aroundSascha Hauer2020-11-063-58/+59
| | | | | | | | | | | | | | | | | | Traditionally Linux passed a struct mtd_info * around as context between the different functions. This has been changed to a struct nand_chip *. Do the same for barebox as well as another step towards updating the NAND layer to current Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: drop unused errstat hookSascha Hauer2020-11-061-5/+0
| | | | | | | | | | | | chip->errstat is never set by any driver, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: drop unused erase_cmd hookSascha Hauer2020-11-061-3/+0
| | | | | | | | | | | | chip->erase_cmd is never used, so remove this hook. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: Drop asynchronous erase supportSascha Hauer2020-11-061-25/+0
| | | | | | | | | | | | | | asynchronous erase support is unused and also dropped from the Kernel, so remove it from barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/reboot-mode' into masterSascha Hauer2020-10-141-0/+38
|\ \
| * | power: reset: reboot-mode: support multi-word magicAhmad Fatoum2020-09-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream binding and driver implementation only supports reboot modes of 32-bit length. This is insufficient for cases where multiple registers need to be written for the reboot mode to become active. The i.MX6 is an example for this, the BootROM expects a second 32-bit register to indicate whether the reboot mode in the first is valid. In preparation for adding support for this to the syscon-reboot-mode driver. Migrate the reboot-mode core to support this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | power: reset: reboot-mode: fix up node into boot device treeAhmad Fatoum2020-09-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying that the kernel and barebox device trees are in sync, just enforce it by having barebox fix up the device tree node it probed into the kernel device tree. We usually want that, but some reboot mode drivers might want to inhibit the fixup, e.g. because they implement a non-upstream binding or because they communicate with the BootROM, while the kernel shouldn't. For those the fixup is made optional via a struct reboot_mode_driver::no_fixup member. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers: add reboot-mode infrastructureAhmad Fatoum2020-09-291-0/+36
| |/ | | | | | | | | | | | | | | | | | | | | Reboot modes provide a well-defined way to exchange information between different stage of the boot process. When configured, users can type `reboot bootloader` in the OS and barebox can read it out a device parameter. Likewise barebox can write a reboot mode for the BootROM to evaluate and then reset to fall into a serial recovery mode for example. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc' into masterSascha Hauer2020-10-141-1/+0
|\ \
| * | include: string: migrate barebox function from <linux/string.h>Ahmad Fatoum2020-10-021-1/+0
| |/ | | | | | | | | | | | | | | | | <linux/string.h> was imported from Linux. In order to keep changes to a minimum, add prototypes for new barebox functions to <string.h> instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: phy: Add and use driver register macroSascha Hauer2020-10-011-0/+20
|/ | | | | | | | | | Add driver registration macros for phy drivers similar to the existing platform device macros. This also changes the initcall level from fs_initcall to device_initcall for the phy drivers. It is not clear why the phy driver have been at fs_initcall in the first place, changing it shouldn't be a problem. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net' into masterSascha Hauer2020-09-251-23/+15
|\
| * net: mdiobus: Add sliceSascha Hauer2020-08-191-23/+15
| | | | | | | | | | | | | | By adding a slice to the mdio bus we make the mdio code safe for being called in a poller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc' into masterSascha Hauer2020-09-253-3/+49
|\ \
| * | clk: Add clk_bulk_[get|put]_all()Sascha Hauer2020-09-241-0/+46
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk_dump command: Allow printing a single clockSascha Hauer2020-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | So far the clk_dump command can only print all clocks. With this patch we can limit the output to ancestors and children of a given clock. This makes it easier to find the desired information in big clock trees. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib: string: retire deprecated strtok() in favor of reentrant strsep()Ahmad Fatoum2020-09-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent changes to ARCH=sandbox, there are no remaining in-tree users for strtok() anymore. Out-of-tree users are better served by using the reentrant strsep(), which has existed in-tree for as long. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | sandbox: support escaping commas in --image filenamesAhmad Fatoum2020-09-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some tools like afl-fuzz generate file names containing commas. Allow escaping the commas in the file names, so they can be passed to barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: s/filed/field/Sascha Hauer2020-08-241-1/+1
| |/ | | | | | | | | | | Fix typos. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add KASan supportSascha Hauer2020-09-221-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KernelAddressSANitizer (KASAN) is a dynamic memory error detector. It provides a fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. This adds support for KASan to barebox. It is basically a stripped down version taken from the Linux Kernel as of v5.9-rc1. Quoting the initial Linux commit 0b24becc810d ("kasan: add kernel address sanitizer infrastructure") describes what KASan does: | KASAN uses compile-time instrumentation for checking every memory access, | therefore GCC > v4.9.2 required. v4.9.2 almost works, but has issues with | putting symbol aliases into the wrong section, which breaks kasan | instrumentation of globals. | | Basic idea: | | The main idea of KASAN is to use shadow memory to record whether each byte | of memory is safe to access or not, and use compiler's instrumentation to | check the shadow memory on each memory access. | | Address sanitizer uses 1/8 of the memory addressable in kernel for shadow | memory and uses direct mapping with a scale and offset to translate a | memory address to its corresponding shadow address. | | For every 8 bytes there is one corresponding byte of shadow memory. | The following encoding used for each shadow byte: 0 means that all 8 bytes | of the corresponding memory region are valid for access; k (1 <= k <= 7) | means that the first k bytes are valid for access, and other (8 - k) bytes | are not; Any negative value indicates that the entire 8-bytes are | inaccessible. Different negative values used to distinguish between | different kinds of inaccessible memory (redzones, freed memory) (see | mm/kasan/kasan.h). | | To be able to detect accesses to bad memory we need a special compiler. | Such compiler inserts a specific function calls (__asan_load*(addr), | __asan_store*(addr)) before each memory access of size 1, 2, 4, 8 or 16. | | These functions check whether memory region is valid to access or not by | checking corresponding shadow memory. If access is not valid an error | printed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add _RET_IP_ macroSascha Hauer2020-09-181-0/+2
|/ | | | | | Use in KAsan code, so added for barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ramfs'Sascha Hauer2020-07-274-158/+581
|\
| * update list.h from Linux-5.7Sascha Hauer2020-06-174-158/+581
| | | | | | | | | | | | This updates include/linux/list.h from Linux-5.7. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-07-274-19/+357
|\ \
| * | treewide: Convert files covered by ARM copyright to SPDXUwe Kleine-König2020-07-142-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | net: phy: add uapi/linux/mdio.h from kernel for MDIO MMD accessMichael Grzeschik2020-07-051-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The headerfile is used in the kernel for access of MDIO Managed Devices (MMD) indirect access. Some drivers already use those device addresses. We add the headerfile from the kernel and change the current users to use the defines instead Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: port phy_interface_is_rgmii() from kernelOleksij Rempel2020-06-171-0/+21
| |/ | | | | | | | | | | | | and remove duplicates from other drivers Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dts'Sascha Hauer2020-07-271-0/+319
|\ \
| * | include: import upstream header <linux/overflow.h>Ahmad Fatoum2020-06-231-0/+319
| |/ | | | | | | | | | | | | | | Incoming code makes use of struct_size, which is defined upstream in <linux/overflow.h>. Import the Linux v5.8-rc1 header as is. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / clk: sync of_clk_get_parent_name with upstreamAhmad Fatoum2020-06-231-1/+1
|/ | | | | | | | | | | | | Upstream of_clk_get_parent_name only resorts to node name as a fallback. Instead, it uses the name supplied for registered clocks whenever possible. On the sama5d2, this results in sckc@f8048050 and slowck, respectively. So far, sckc@f8048050 in the parents array couldn't be matched with any existing clock, leading to an inaccurate clock tree. Port over the v5.8-rc1 state of the function to fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/powerpc'Sascha Hauer2020-05-141-5/+24
|\
| * iopoll: Introduce read_poll_timeoutSascha Hauer2020-04-271-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox adoption of Linux commit: | commit 5f5323a14cad19323060a8cbf9d96f2280a462dd | Author: Dejin Zheng <zhengdejin5@gmail.com> | Date: Mon Mar 23 23:05:51 2020 +0800 | | iopoll: introduce read_poll_timeout macro | | this macro is an extension of readx_poll_timeout macro. the accessor | function op just supports only one parameter in the readx_poll_timeout | macro, but this macro can supports multiple variable parameters for | it. so functions like phy_read(struct phy_device *phydev, u32 regnum) | and phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum) can | also use this poll timeout core. and also expand it can sleep some time | before read operation. | | Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> | Signed-off-by: David S. Miller <davem@davemloft.net> Also, implement readx_poll_timeout using read_poll_timeout. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | phy: drop of_phy_simple_xlate() stubAntony Pavlov2020-05-131-8/+0
| | | | | | | | | | | | | | The function of_phy_simple_xlate() is not used. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | module.h: split out the EXPORT_SYMBOL into export.hMasahiro Yamada2020-05-121-0/+39
|/ | | | | | | Do as Linux commit f50169324df4ad942e544386d136216c8617636a Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pwm'Sascha Hauer2020-04-161-0/+97
|\
| * PWM: add support for STM32Ahmad Fatoum2020-03-311-0/+97
| | | | | | | | | | | | | | | | This driver adds support for PWM driver on STM32 platform based on the Linux v5.4 support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-04-162-4/+5
|\ \
| * | libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1Masahiro Yamada2020-04-152-4/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | Fix the relative include path in <linux/libfdt.h> Including <linux/kernel.h> is too much. <linux/limits.h> is enough for INT_MAX. Define INT32_MAX and UINT32_MAX in the same way as Linux does. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: port Linux v5.6 SAM9X60 (new ARM926EJ-S) clock supportAhmad Fatoum2020-04-151-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | During a bug hunt that ultimately turned out unrelated to the state of the barebox at91 clk driver, I synchronized its state with Linux v5.6. Bug fixes and clean up to minimize the diff were split out in separate prior commits. This last commit imports the rest, which is basically support for Microchip's new ARM926EJ-S SoC, the SAM9x60. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: at91: add sama5d2 audio PLL supportAhmad Fatoum2020-04-151-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7310b976 ("clk: at91: fix compilation errors in sama5d2.c") and follow-up commit ca3077068c ("clk: at91: delete dead i2s/audio code") had deleted the i2s/audio clock related parts of the upstream driver. This was mostly due to unwillingness on my part to understand the code enough for porting them and because I deemed them unnecessary to support in barebox. The former has changed and the latter is not totally true as audio PLL derived clocks may be muxed as inputs for programmable and generated clocks. Port them over and mimize the diff to upstream. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>