summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* pci: efi: skip driver model fixup for non-EFI PCI bussesAhmad Fatoum2021-11-151-1/+8
| | | | | | | | | | The EFI driver registers a PCI fixup to associate PCI devices probed via EFI with their parent. Restrict the fixup to EFI PCI busses only, so other PCI drivers can be used in the same build. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211115090023.4192546-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: dw_mmc: make reset control optional againAhmad Fatoum2021-11-081-1/+1
| | | | | | | | | | | | | | | | As documented in 90bdf1e5d1e4 ("mci: dw_mmc: match against StarFive MMC compatibles"), it was intended for the reset to remain optional as to not break existing users. Unfortunately, my later a3cf324593ea ("mci: dw_mmc: add optional reset line") didn't heed that and made it required, breaking SoCFPGA DW-MMC use as a result. Revert that line to fix the regression. Fixes: a3cf324593ea ("mci: dw_mmc: add optional reset line") Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211101175207.2160779-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: fix MDIO regression for STM32MP1 boardsAhmad Fatoum2021-11-051-1/+5
| | | | | | | | | | | | | | The STM32MP1 boards call their mdio subnode mdio0, which is now skipped since ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node"). Fix networking for them by only falling back to the mdio node name when a child node with the correct compatible could not be found. Fixes: ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://lore.barebox.org/20210831153214.31047-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynqmp'Sascha Hauer2021-10-071-28/+27
|\
| * firmware: zynqmp-fpga: do not use DMA coherent memory for bitstreamMichael Tretter2021-08-231-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Trying to do unaligned access of coherent memory on AArch64 will lead to an abort. This can happen when the FPGA loader copies the bitstream to the temporary buffer for the transfer to the FPGA. Convert the driver to use regular memory for the temporary buffer to prevent the issue. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210819081251.726840-4-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware: zynqmp-fpga: avoid additional buffer for size argumentMichael Tretter2021-08-231-21/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two different APIs for loading an FPGA via the pmu-fw as indicated by the ZYNQMP_PM_FEATURE_SIZE_NOT_NEEDED feature flag. The pmu-fw expects as second argument either the size of the bitstream or a pointer to the size of the bitstream. The driver allocates a separate buffer for the size, which results in the allocation of a 4k page for storing a 32 bit value. Allocate some more memory for the bitstream and append the size of the bitstream at the end of the bitstream to avoid the additional memory allocation. Add a comment to explain the surprising size of the allocation. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210819081251.726840-3-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware: zynqmp-fpga: initialize flags at function startMichael Tretter2021-08-231-4/+1
| | | | | | | | | | | | | | | | | | | | The ZYNQMP_FPGA_BIT_ONLY_BIN flag is always set when programming the FPGA. Simplify the code by initializing the flags with ZYNQMP_FPGA_BIT_ONLY_BIN already set. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210819081251.726840-2-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/riscv'Sascha Hauer2021-10-0712-12/+919
|\ \
| * | net: add LiteEth driverAntony Pavlov2021-10-073-0/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LiteEth provides a small footprint and configurable Ethernet core. LiteEth is part of LiteX libraries whose aims are to lower entry level of complex FPGA cores by providing simple, elegant and efficient implementations of components used in today's SoC such as Ethernet, SATA, PCIe, SDRAM Controller... Using Migen to describe the HDL allows the core to be highly and easily configurable. LiteEth can be used as LiteX library or can be integrated with your standard design flow by generating the verilog rtl that you will use as a standard core. See https://github.com/enjoy-digital/liteeth for details. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Marek Czerski <m.czerski@ap-tech.pl> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-7-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | spi: add litex spiflash driverAntony Pavlov2021-10-073-0/+245
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-6-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | gpio: add driver for 74xx-ICs with MMIO accessAntony Pavlov2021-10-043-0/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds driver to support GPIO functionality for 74xx-compatible ICs with MMIO access. Compatible models include: 1 bit: 741G125 (Input), 741G74 (Output) 2 bits: 742G125 (Input), 7474 (Output) 4 bits: 74125 (Input), 74175 (Output) 6 bits: 74365 (Input), 74174 (Output) 8 bits: 74244 (Input), 74273 (Output) 16 bits: 741624 (Input), 7416374 (Output) Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Cc: Alexander Shiyan <shc_work@mail.ru> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-5-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serial: add litex UART driverAntony Pavlov2021-10-042-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-3-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: timer-riscv: select CSR from device treeAntony Pavlov2021-10-041-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox timer-riscv driver supports one of user counters: * 'cycle', counter for RDCYCLE instruction (CSR 0xc00); * 'time', timer for RDTIME instruction (CSR 0xc01). At the moment in M-mode timer-riscv uses the 'cycle' counter, and in S-mode timer-riscv uses the 'time' timer. Alas picorv32 CPU core supports only the 'cycle' counter. VexRiscV CPU core in M-mode supports only the 'time' timer. This patch makes it possible to use the 'time' timer for VexRiscV CPU in M-mode. See also http://lists.infradead.org/pipermail/barebox/2021-May/036067.html Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-2-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2021-10-0720-1753/+1226
|\ \ \
| * | | video: simplefb-client: make probe less verboseAhmad Fatoum2021-10-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Printing the framebuffer base is unnecessary because it's already contained in the dev_printf prefix. Make the message shorter and only print it on success. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210824095119.15907-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | video: simplefb-client: populate video mode fieldAhmad Fatoum2021-10-051-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Video drivers should initialize fb_info->mode, so device parameters for mode and enable/disable can function as expected. This wasn't done in the simplefb driver so far, fix this. This also lets us drop some initialization of the fb_info, because it can be calculated from the mode. The very verbose mode info print can be dropped as well, because it's now available in devinfo. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210824095119.15907-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: eqos: let phy_resume handle fixed link physRouven Czerwinski2021-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently barebox will try to talk to the phy over mdio, even if the parent is a fixed-link. This will result in the following stacktrace: barebox@Linux Automation Test Automation Controller (TAC):/ dhcp unable to handle NULL pointer dereference at address 0x00000130 pc : [<dfc01800>] lr : [<dfc0f963>] sp : dffefd40 ip : 004c4b40 fp : d00286e0 r10: cf25cc4e r9 : 00000000 r8 : 05f5e100 r7 : 00000130 r6 : 00000000 r5 : 00000000 r4 : 00000130 r3 : 00000109 r2 : 00000000 r1 : 00000000 r0 : 00000130 Flags: nZCv IRQs off FIQs off Mode SVC_32 WARNING: [<dfc01800>] (slice_acquire+0xc/0x28) from [<dfc0f963>] (mdiobus_read+0x13/0x28) WARNING: [<dfc0f963>] (mdiobus_read+0x13/0x28) from [<dfc10685>] (eqos_start+0x85/0x32c) WARNING: [<dfc10685>] (eqos_start+0x85/0x32c) from [<dfc3cdf1>] (eth_open+0xd/0x24) WARNING: [<dfc3cdf1>] (eth_open+0xd/0x24) from [<dfc3e391>] (dhcp+0xb/0x3a) WARNING: [<dfc3e391>] (dhcp+0xb/0x3a) from [<dfc30fab>] (do_dhcp+0xfb/0x114) WARNING: [<dfc30fab>] (do_dhcp+0xfb/0x114) from [<dfc0490f>] (execute_command+0x23/0x4c) WARNING: [<dfc0490f>] (execute_command+0x23/0x4c) from [<dfc0a127>] (run_list_real+0x5bf/0x638) WARNING: [<dfc0a127>] (run_list_real+0x5bf/0x638) from [<dfc09a2b>] (parse_stream_outer+0xc7/0x154) WARNING: [<dfc09a2b>] (parse_stream_outer+0xc7/0x154) from [<dfc0a383>] (run_shell+0x3f/0x6c) WARNING: [<dfc0a383>] (run_shell+0x3f/0x6c) from [<dfc010b9>] (run_init+0x191/0x200) WARNING: [<dfc010b9>] (run_init+0x191/0x200) from [<dfc01153>] (start_barebox+0x2b/0x6c) WARNING: [<dfc01153>] (start_barebox+0x2b/0x6c) from [<dfc4be6d>] (barebox_non_pbl_start+0x121/0x164) WARNING: [<dfc4be6d>] (barebox_non_pbl_start+0x121/0x164) from [<dfc00005>] (__bare_init_start+0x1/0xc) WARNING: [<dfc4da7d>] (unwind_backtrace+0x1/0x78) from [<dfc01461>] (panic+0x1d/0x34) WARNING: [<dfc01461>] (panic+0x1d/0x34) from [<dfc4b6a3>] (do_exception+0xf/0x14) WARNING: [<dfc4b6a3>] (do_exception+0xf/0x14) from [<dfc4b711>] (do_data_abort+0x21/0x34) WARNING: [<dfc4b711>] (do_data_abort+0x21/0x34) from [<dfc4b454>] (do_abort_6+0x48/0x54) Simply return with 0 if bus is NULL which indicates that the phy is connected to a fixed link. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://lore.barebox.org/20210825065554.23283-1-r.czerwinski@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: gadget: dfu: Rework dfu command to use usbgadgetJules Maselbas2021-10-051-161/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dfu command now uses the composite multi gadget to register the usb functionality. This allows the removal of the usb composite driver from dfu.c As the dfu command is blocking the command slice must be released while the dfu gadget is running in order to do operations on the file system. The usb_dfu_register() function is replaced with usb_dfu_detached() for the dfu command to return a different value depending on if it has been interrupted with CTRL-C or if the gadget has been detached. Tested-by: Anže Lešnik <anze.lesnik@norik.com> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20210910102931.26078-1-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: core: fix whitespacesAntony Pavlov2021-10-051-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20211004091550.42289-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: cpsw: fix ethernet bringup in case of a fixed-link phyKarfich, Oleg2021-10-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of a fixed-link phy the cpsw_adjust_link() function is called directly in phy_device_attach() and configures the MACCONTROL register. Right after this configuration cpsw_init() is called and resets the MACCONTROL register. Fix this by initializing the slave before connecting the phy device in cpsw_open(). Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Link: https://lore.barebox.org/1630414594-10601-1-git-send-email-oleg.karfich@wago.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci: sdhci: fix big-endian write for blockcount/sizeSteffen Trumtrar2021-10-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch 0a47bce1b03fd236384e904dca005c0870ce8684 mci: imx-esdhc: Use common DMA helpers converted the imx-esdhc driver to use the DMA helpers introduced with 60b608b2714472aa22862a20d04f267cbbac0863 mci: sdhci: Add DMA transfer helpers The common DMA helpers however break support for BE-variants (e.g. Layerscape) as the BLKATTR register seems to be a 32-bit register which internally switches bytes when used with two 16-bit write accesses. As the alignment should also work for LE-SDHCI-variants convert the two 16-bit accesses to one 32-bit access. Signed-off-by: Steffen Trumtrar <str@pengutronix.de> Link: https://lore.barebox.org/20210831064715.8392-1-s.trumtrar@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: add virtio network driverAhmad Fatoum2021-10-053-0/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives virtio-enabled boards an easy route to network connectivity: qemu-system-aarch64 -M virt -serial mon:stdio -trace file=/dev/null \ -kernel images/barebox-dt-2nd.img -cpu cortex-a57 -nographic \ -device virtio-net-device,netdev=network0 -netdev tap,id=network0,ifname=tap0 The tap0 interface created by QEMU can then be bridged/listened on. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci: Improve error message for non-existent vmmc regulatorUwe Kleine-König2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three improvements: a) Use a already initialized device as first parameter to dev_err() and b) indicate that the error will be ignored, and c) downgrade to a warning. This changes the error message from ERROR: <NULL>: Failed to get 'vmmc' regulator. to WARNING: bcm2835_mci fe340000.mmc@7e340000.of: Failed to get 'vmmc' regulator (ignored). on a Raspberry Pi 4. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://lore.barebox.org/20210914090017.39627-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci-bcm2835: Fix return type handling of bcm2835_mci_wait_command_done()Uwe Kleine-König2021-10-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function returns a negative value in a code path and the return value is used as a return value for another functions returning int, too. So change the value to int (and the variable holding the return value, too). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20210916093627.173566-2-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci-bcm2835: Don't block infinitely while waiting for a command completionUwe Kleine-König2021-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead abort with a timeout error. This prevents getting a hung barebox when a command doesn't complete. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20210916093627.173566-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pinctrl: bcm2835: Add support for bcm2711Ahmad Fatoum2021-10-051-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bcm2711-rpi-4-b.dts lists 58 gpio names and the linux driver also uses 58 GPIOs for bcm2711. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210917094152.210494-2-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pinctrl: bcm2835: Probe driver earlierAhmad Fatoum2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | coredevice is too late for the console driver and all other pinctrl drivers are using "core", too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210917094152.210494-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | serial: implement riscv SBI console supportMarcelo Politzer2021-10-053-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a console over legacy SBI (version 0.1.0). There is a tiny ringbuffer to simplify checking for presence and reading characters as separate steps. Link: https://lore.barebox.org/20210927200521.7996-1-marcelo.politzer@cartesi.io Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: e1000: split EEPROM and barebox MTD wrapper into separate filesAhmad Fatoum2021-08-234-815/+839
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the addition of the EFI PCI bus driver, e1000 can now be built for x86 as well. This only works when CONFIG_MTD=y, because otherwise add_mtd_device is not defined leading to a link error. This doesn't happen with other platforms, because linker garbage collection, which is not used for the EFI platform. Fix this issue by separating the generic EEPROM parts from the barebox-specific MTD parts and compiling the MTD parts conditionally. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | asm-generic: include bitio.h from io.hAhmad Fatoum2021-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is currently used on ARM and sandbox, but it's relevant for other platforms like x86 as well if driver code wants to make use of the functions defined within. MIPS and PowerPC already defines the symbols, but that's ok because <bitio.h> doesn't override existing macros. This works for MIPS, but not PowerPC, where those aren't macros. Fix that up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: make ARC MAC driver 32-bit onlyAhmad Fatoum2021-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver assumes 32-bit pointers and only matches against 32-bit rockchip device trees. Make this official in the kconfig, so it's not selectable on 64 bit, where it would issue build warnings and probably not work anyway. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: drop Calxeda Highbank xgmac driver supportAhmad Fatoum2021-08-233-739/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for MACH_HIGHBANK was removed in f0f96c3322d5 ("ARM: remove Calxeda Highbank support"). There are no device trees either barebox or upstream using this network controller, so remove the driver as well. Fixes: f0f96c3322d5 ("ARM: remove Calxeda Highbank support") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/layerscape'Sascha Hauer2021-10-074-0/+1162
|\ \ \ \
| * | | | nand: add NXP IFC nand driverRenaud Barbier2021-08-234-0/+1162
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the NXP IFC nand driver support. This driver can be used with the NXP QorIQ cores. Originally, derived from U-boot commit cce573e (2015-10) Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Link: https://lore.barebox.org/1628842608-17031-3-git-send-email-renaud.barbier@abaco.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/imx'Sascha Hauer2021-10-0714-198/+837
|\ \ \ \ | |_|_|/ |/| | |
| * | | ddr: imx8m: ddrphy_train: add DDR4 supportAhmad Fatoum2021-10-051-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are DDR3L, DDR4 and LPDDR4 variants of the i.MX8M* SoMs used with the NXP EVKs. So far, we only supported LPDDR4. For DDR4, we just need different PHY training code. Encode the DRAM variant information into a new dram_timing_info::dram_type and adjust the driver to make use of it. The new CONFIG_FIRMWARE_IMX_DDR4_PMU_TRAIN Kconfig symbol can co-exist with CONFIG_FIRMWARE_IMX_LPDDR4_PMU_TRAIN, allowing the same barebox binary to target different memory types, provided board code can determine what kind of DRAM is fitted. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ddr: imx8m: add i.MX8MN (Nano) supportAhmad Fatoum2021-10-053-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRAM setup on i.MX8MP is the same as on the i.MX8MP, except for DDRC_DDR_SS_GPR0, which the vendor's U-Boot port explicitly skips on the nano, irrespective of the configured DRAM type. Do likewise. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: i.MX: extend drivers for i.MX8MN (Nano) supportAhmad Fatoum2021-10-055-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend match tables and function definitions for i.MX USB, ATF, MCI, NVMEM, pinctrl and serial drivers for the i.MX8M Nano. There is no special handling required for those, compared with the mini. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: imx: add i.MX8MN (Nano) supportAhmad Fatoum2021-10-052-0/+560
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import the Linux v5.14-rc2 state of the clock driver. Some abstractions used there were not yet added to barebox, so previous equivalent versions were taken instead. This makes the code more in-line with the i.MX8MM. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: i.MX: add i.MX8MN (Nano) SoC support boilerplateAhmad Fatoum2021-10-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nano is basically a downsized mini. Add the necessary bits, so driver and board support can be added. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci: imx-esdhc-pbl: support eMMC boot partitions on i.MX8MPAhmad Fatoum2021-10-051-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX header for SD/MMC starts at an offset to allow for a partition table at offset 0. i.MX8MN/P bootrom did away with the offset for eMMC boot partitions, which usually lack on-disk partition tables, but kept a 32-byte offset for SD and eMMC user partitions. The i.MX8MN/P also introduced a ROM API that allows chainloading from boot medium by calling back into ROM. This likely handles that difference for us, but as we don't support it yet and we already have the PBL eSDHC driver, teach it to detect whether boot is from eMMC boot partition or not and use the appropriate offset. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210830115156.21907-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mci: imx-esdhc-pbl: Fix two typos in a commentUwe Kleine-König2021-10-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20210813140352.13233-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: imx-us-phy: add vbus_valid ro parameterMarco Felsch2021-10-041-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter can be used by init scripts to detect a plugged usb cable. Upon a plugged usb cable the barebox behaviour can be changed which can be useful e.g. during production to apply a special production environment. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20210824121208.31988-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ddr: imx8m: Rework ddrphy code and fix DDR-1067 on iMX8MMTrent Piepho2021-10-011-185/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code could not decide if it was using speeds in Hz, or MHz, or just constants that identify specific speeds. Rework it to use symbolic constants for all speeds. Use arrays for configurations values for all cases. The DDR DRAM speed constants will be the array index, so the linear search for the configuration is eliminated. For iMX8MM type SoCs using the integr PLL the speed DDR-1067 with a 266⅔ MHz clock will now work. The iM8MQ type SSCG PLL SoCs would previously silently program the PLL will zero values if a non-supported DDR rate was used. Now they will generate an error. Note that some PLL tables have entries for speeds that the main entry point for the code does not support, so they can't actually ever be used. This is not fixed. Signed-off-by: Trent Piepho <tpiepho@gmail.com> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210924031446.1515172-1-tpiepho@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | watchdog: imxwd: register explicit warm reset handlerAhmad Fatoum2021-08-091-0/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With fsl,ext-reset-output and WDOG_B muxed correctly, the i.MX watchdog will toggle an external signal to effect a PMIC reset. That's good for normal use, but when exchanging information with the BootROM over GPRs, a warm reset is required. This is needed e.g. to set the reboot mode. Support this by defining a second, lower priority, reset that will never toggle external lines. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210803165937.31608-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | of: overlay: don't do fixups on empty global.of.overlay.dirAhmad Fatoum2021-10-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $global.of.overlay.dir is dynamically prepended with the root of the device currently being booted. This allows use of relative paths. Because $global.of.overlay.filepattern is * by default, this means that all files in the root of the device will be considered overlays and barebox will try to unflatten them leading to an error message on boot: ERROR: of_overlay: Failed to unflatten /mnt/mmc0.4//.root_is_rw: Invalid argument Fix this by not doing any fixups at all on empty global.of.overlay.dir. If for whatever reason, a user wants overlays at /, they can global.of.overlay.dir=. Fixes: 124c64af0982 ("overlay: Add filters to choose which overlays to apply") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210831161139.2988-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | video: Fix broken bcm2835 fb driverDaniel Brát2021-10-041-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bcm2835 framebuffer driver was broken, because the address of video buffer allocated for us by the GPU and returned through mailbox was used without converting it back to ARM address space. That unconverted address was also in the range of peripheral addresses, which caused other issues later on due to it being filled with garbage data. The offset by which to convert the address back can vary by device, so the value is read from devicetree 'dma-ranges' for somewhat portable operation. This fix was tested on Raspberry PI B+ and Raspberry PI 3B+. Signed-off-by: Daniel Brát <danek.brat@gmail.com> Link: https://lore.barebox.org/20210907072915.18451-1-danek.brat@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | base: driver: fix double removal of child devicesAhmad Fatoum2021-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Child devices like an ext4 file system on a partition may be removed twice: Once because they're in the active devices list and then once more, because unregister_device is called for the children of its parent. As struct bus_type::remove clears association of a driver with its device, we can set struct device_d::driver to NULL. unregister_device will then skip the second dev->bus->remove. Fixes: 29f1c211d86c ("fs: don't free device in remove callback") Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210913101753.465831-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | virtio: implement remove callbacksAhmad Fatoum2021-10-025-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio parent device drivers (e.g. PCI and MMIO) create child devices and free them on remove. The virtio drivers for the child devices (e.g. block and console) however don't unregister with their respective subsystems in the remove callbacks. So these subsystems may have stale pointers pointing at removed devices. This is especially problematic for the console driver, because the virtio console device_d will be removed, but the console itself remains registered leading to a use-after-free as soon as printf is invoked for the previously active console. This leads to a crash when typing reset in https://www.barebox.org/jsbarebox/?graphic=0 Fix this for all virtio drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210916093458.21102-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | power: reset: nvmem-reboot-mode: disable device tree fixupAhmad Fatoum2021-10-011-0/+8
|/ / | | | | | | | | | | | | | | | | | | | | Fixing up the nvmem reboot device tree node is problematic, because it contains a phandle to another node. Take the easy way out for now and expect user to provide matching reboot-mode nodes in both kernel and barebox device tree manually. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210922090940.18002-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>