summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net: fsl-fman: Disable unused network interfacesSascha Hauer2019-11-281-0/+38
| | | | | | | The Linux dts files have all network interfaces enabled. We have to disable the ones that are unused. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Layerscape: TQMLS1046a: Fix partition nameSascha Hauer2019-11-281-1/+1
| | | | | | | The barebox partition on the SD card starts at offset 0x1000, so the partition node should be named partition@1000. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: read nxid eepromSascha Hauer2019-11-281-0/+117
| | | | | | | | | | | | This adds support for reading the EEPROM which has a "NXID" data structure on it. The MAC addresses for the ethernet devices are found here which are registered with this patch. The NXID data structure is also found on other NXP Layerscape boards, so once we support other boards the code should be moved somewhere where it can be shared between boards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: Fix EEPROM nodesSascha Hauer2019-11-271-0/+15
| | | | | | | The ls1046ardb only has one EEPROM instead of two and this is a 24c04 (which spans two addresses on the I2C bus) and not a 24c512. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: Enable PCIe supportSascha Hauer2019-11-271-0/+14
| | | | | | | | Enable the PCIe nodes on the ls1046ardb board. U-Boot registers the PCIe devices based on the SERDES configuration, but for us it's easier to just enable them in the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: Fix SPI NOR flash compatiblesSascha Hauer2019-11-271-0/+8
| | | | | | | | | The upstream dts file has a "spansion,m25p80" as compatible string for the SPI NOR flashes. This doesn't match the real chip which identifies itself as "s25fl512s". The driver warns about this. Change the compatible to "jedec,spi-nor" to avoid such issues. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: Add barebox update handlerSascha Hauer2019-11-271-0/+5
| | | | | | Add a barebox update handler for easy barebox update. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM Layerscape: ls1046ardb: Fix SD partitionsSascha Hauer2019-11-271-2/+7
| | | | | | | | barebox and its environment should be in the first MiB of the SD card. With this we won't overwrite any partitions from the partition table. While at it add a barebox partition for a future update handler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: da9053: fix typo in variable nameLucas Stach2019-11-251-1/+1
| | | | | | Fixes: 06928c7d1758 (mfd: da9053: use new reset_source_set_device) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: add zynqimg to gitignoreLucas Stach2019-11-181-0/+1
| | | | | | | | Those are results of the Zynq image build, don't clobber the git status output. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: fix NULL pointer use in dev_printfAhmad Fatoum2019-11-151-4/+4
| | | | | | | | | | | Inside mdio_register, a read of the PHY's id register is attempted. If it fails, we print an error message with eqos_err, which uses the ethernet device's unique name, but at this time there has been none set, because eth_register was not yet called. Fix this by using the MDIO bus device instead. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: enable clocks before mdio_registerAhmad Fatoum2019-11-154-78/+14
| | | | | | | | | | | | | | | | | We can't be using the MAC including the MDIO controller while the clocks are off, but this is exactly the case when mdio_register is called and the interface is not yet up. To allow reading the PHY id to succeed before the interface is up, turn on the clocks as part of the initialization in the probe. This fixes following error at probe time: ERROR: <NULL>: MDIO not idle at entry The NULL is fixed in a follow-up commit. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: properly stop DMA on haltAhmad Fatoum2019-11-151-0/+2
| | | | | | | | | Specifying ->halt only means that it's called along with eth_unregister. If we want to halt the DMA, we will have to call it ourselves in the remove callback. Do this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* filetype: mvebu: Fix kwbimage v1 detectionSascha Hauer2019-11-151-10/+12
| | | | | | | | | | | The kwbimage detection calculates a checksum over the first 31 bytes of the image. This is correct for the v0 image format, but for the v1 image format the checksum in the image also covers the extenstion headers. These might not be completely present in the initial buffer provided to file_detect_type(), so just drop the checksum calculation for v1 images. Fixes: bf8b6d46db ("kwbimage_v0: add support to detect and boot a mvebu v0 image") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: dwc3: Remove wrong error messagesSascha Hauer2019-11-141-2/+0
| | | | | | | When phy_get() returns -ENOSYS or -ENODEV it means we can go without phy. Do not print an error message in this case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: stop DMA on haltAhmad Fatoum2019-11-122-0/+4
| | | | | | | | | designware_eqos.c contains an eqos_stop implementation to stop the NIC when halting the interface. Unfortunately it wasn't used leading to memory corruption on boot, possibly due to DMA. Fix this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: am335x: Fix am335x_sdram_size() not running at link addressSascha Hauer2019-11-121-0/+2
| | | | | | | | | | am335x_sdram_size() may be called when we are not running at the address we are linked at. This means tree switch conversions and jump tables will not work. Disable these in the CFLAGS for this file. This fixes a crash in am335x_sdram_size() with newer gcc versions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: am335x: Enable MMC2 clockSascha Hauer2019-11-111-1/+3
| | | | | | | | | | | Since Kernel commit 5b63fb90adb9 ("ARM: dts: Fix incomplete dts data for am3 and am4 mmc") (barebox commit 419db1f984 ("dts: update to v5.3-rc7")) the AM33xx MMC2 controller is unconditionally enabled in the dts. This has the effect that the driver probes for this device and then can't access the registers as the clock is disabled. Enable the clock to let the driver probe successfully. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mmu-early: On i.MX6 with HAB map ROM is mapped without XNSascha Hauer2019-11-081-0/+7
| | | | | | | | | On i.MX6 with HAB enabled we call into the ROM later in imx6_hab_get_status(). This only works when the XN bit is not set for this area, so remap the first MiB as cached which doesn't have the XN bit set. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynqmp'Sascha Hauer2019-11-076-13/+488
|\
| * firmware: zynqmp-fpga: print Xilinx bitstream headerMichael Tretter2019-10-281-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | The bitstream header has 5 fields, that start with a char for the type. Four fields have a big-ending length and a null-terminated string for the design name, the part number, and the date and time of creation. The last field is a big-endian 32 bit unsigned int for the size of the bitstream. Print this info when loading the bitstream. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware: zynqmp-fpga: introduce driver to load bitstream to FPGAThomas Haemmerle2019-10-284-0/+368
| | | | | | | | | | | | | | | | | | The driver provides functionalities to check and load a bitstream to FPGA. A boolean parameter to check if FPGA is already programmed is added. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware-zynqmp: extend driver with fpga relavant functionsThomas Haemmerle2019-10-282-2/+60
| | | | | | | | | | | | | | | | Port functions from xlnx-linux to get FPGA status and invoke bitstream loading. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware-zynqmp: add macros for PMU and trustzone firmware versionsThomas Haemmerle2019-10-281-12/+10
| | | | | | | | | | Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/watchdog'Sascha Hauer2019-11-0712-40/+202
|\ \
| * | mfd: da9063: fix watchdog ping executionMarco Felsch2019-11-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | The watchdog resets the system if the watchdog gets pinged to fast. Between each watchdog ping must be a pause of at least 200ms. This commit fixes that by rejecting two fast requests. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mfd: da9063: fix TWDSCALE debug messageMarco Felsch2019-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The TWDSCALE is the found scale + 1 as described in the datasheets for the DA9062/3 devices. The driver logic is correct just the debug message is wrong. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: add timeout_cur parameter only when poller is enabledAhmad Fatoum2019-10-291-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timeout_curr is the timeout programmed into the watchdog hardware every 500 milliseconds. If watchdog poller support is disabled, it still shows up as a configurable device parameter, but has no effect. Improve user experience by having it show up only if watchdog poller support was compiled in. This is already the case for the autoping parameter. The timeout_max parameter is a generic parameter and will remain unchanged. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: rename timeout_curr to poller_timeout_curr internallyAhmad Fatoum2019-10-292-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timeout_curr is the timeout programmed into the watchdog hardware every 500 milliseconds. If watchdog poller support is disabled, it serves no purpose, prefix it with poller_ to better communicate this fact. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: remove wrong uses of timeout_curAhmad Fatoum2019-10-292-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The barebox watchdog poller uses the struct watchdog.timeout_cur as the timeout value to configure the watchdog with. There's no need for the device driver to set this. I didn't know that when I wrote the drivers, but I do now, hence this commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | doc: watchdog: add note about danger of autopingOleksij Rempel2019-10-291-0/+6
| | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Documentation: add watchdog documentationOleksij Rempel2019-10-292-0/+86
| | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: wd: support configuring watchdog by nameAhmad Fatoum2019-10-291-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, wd has always configured the highest-priority watchdog when multiple are available. Add an optional -d parameter to support configuring the other watchdogs as well. The name passed can be either the watchdog device name (e.g. wdog0) or the hardware device name (e.g. efi-wdt). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: export API to configure watchdogs by nameAhmad Fatoum2019-10-294-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far watchdog users could only configure the watchdog with the highest priority. In preparation for having the wd command configure a watchdog by name, extend watchdog_set_timeout with a struct watchdog *parameter and export functions to query default watchdog and to find watchdog by name. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: export priority as device parameterAhmad Fatoum2019-10-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8f4cf30903 ("watchdog: Allow multiple watchdogs") introduced the ability to set a per-watchdog priority from within drivers, which is usually populated with of_get_watchdog_priority. For debugging, it can be useful to query and override this priority on the fly. Provide a device parameter to do so. As watchdog_get_default only considers priorities > 0, it makes sense to have a newly set priority of 0 disable the watchdog. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: efi: bump down priority below defaultAhmad Fatoum2019-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The barebox EFI documentation notes: > Current linux kernel (v5.0) will execute ExitBootServices() during the > early boot stage and thus will automatically disable the (U)EFI watchdog. > Since it is the proper behavior according to the (U)EFI specification, it > is impossible to protect full boot chain by using this watchdog only. > It is recommended to use an alternative hardware watchdog Heed the advice and bump down the EFI watchdog priority below the watchdog priority default. This ensures the EFI watchdog isn't inadvertently used if other watchdogs are registered. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: efi-image: don't mask x86 interrupts on bootAhmad Fatoum2019-10-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 55da0cf1 ("efi: add support for initrd loading") introduced support for the Linux v3.6+ handover protocol[1]. As part of this change a x86 cli (Clear Interrupt Flag) instruction was introduced just prior to the jump into the kernel's EFI handover protocol entry point. While the normal Linux x86 boot protocols require that interrupts are masked on entry, this doesn't apply to the EFI stub, because the EFI stub itself is the one implementing the boot protocol and as such masks the interrupts itself[2]. EFI watchdogs may, and often are, implemented using a timer interrupt. Dropping the cli will allow monitoring the boot of the kernel up to it calling ExitBootServices. In absence of a hardware watchdog, this is the only watchdog available to users with EFI 1.0+, so it seems prudent to not make it even more useless. [1]: https://www.kernel.org/doc/Documentation/x86/boot.txt [2]: Linux v5.4-rc4, arch/x86/boot/compressed/eboot.c Cc: Michael Olbrich <mol@pengutronix.de> Fixes: 55da0cf1 ("efi: add support for initrd loading") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Documentation: efi: emphasize watchdog deactivation on ExitBootServicesAhmad Fatoum2019-10-241-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | The UEFI specification paragraph quoted above notes: > The watchdog timer is only used during boot services. On successful > completion of ExitBootServices() the watchdog timer is disabled. Thus disabling the watchdog is _the_ only proper behavior. Adjust the wording accordingly. Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer2019-11-0744-125/+4740
|\ \
| * | ARM: dts: stm32mp: report psci v0.2 at leastAhmad Fatoum2019-11-072-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARM TF-A reports compatibility with PSCI v1.1 since v1.5. Upstream ARM TF-A support for STM32MP was introduced with v1.6. It's thus safe to assume that the STM32MP barebox will never have to interact with a secure monitor implementing PSCI v0.1. Overwrite the psci device tree compatible to specify v0.2. This is the first version that implements PSCI_VERSION, which allows the barebox psci client driver selected in this commit to query the actual PSCI version and fix it up into the device tree. This fixes an issue where resetting via PSCI fails in Linux because the upstream device tree compatible: reboot: Restarting system Reboot failed -- System halted Reported-by: Michael Olbrich <mol@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: stm32mp: select ARM_USE_COMPRESSED_DTB for the whole archAhmad Fatoum2019-11-072-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We'll probably be using compressed DTBs for all new boards as well, thus move the ARM_USE_COMPRESSED_DTB, so it's always selected for STM32MP. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: psci: implement PSCI client driverAhmad Fatoum2019-11-074-2/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System reset on the STM32MP may be done via PSCI when running TF-A as first-stage boot loader. Provide a PSCI driver to simplify using it: - A psci_invoke function is exported, so other code can use it - A fixup for the PSCI device tree node is registered - A reset and poweroff handler via PSCI is registered for PSCI >= v0.2 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: psci: wire in smc command helpAhmad Fatoum2019-11-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The smc command has a help defined, but unused. Wire it in, so help smc and smc -invalidoption work as expected. While at it, remove the unimplemented -z option. It's unneeded, because -c turns off the CPU after starting it again already. Also it seems it's not implementable without interprocessor communication, which is probably overkill here. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: psci: use CONFIG_ARM_PSCI_DEBUG for smc commandAhmad Fatoum2019-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's already an option to use when debugging PSCI. Instead of requiring users to #define DEBUG 1 as well, have the smc command be usable when CONFIG_ARM_PSCI_DEBUG, not DEBUG is defined. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: psci: translate PSCI error codes in smc commandAhmad Fatoum2019-11-071-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For more usability, translate CPU_ON error codes into the error descriptions found in the PSCI Platform Design Document[1]. [1]: http://infocenter.arm.com/help/topic/com.arm.doc.den0022d/Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: stm32mp: enable STPMIC1 MFD and cell driversAhmad Fatoum2019-11-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The STPMIC1 is the ST Microelectronics PMIC designed for use with STM32MP. Enable it and its cell drivers by default in the defconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: dts: stm32mp157a-dk1: remove unnecessary sram nodeAhmad Fatoum2019-11-061-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | This node has so far been unused and is a remnant from when the stm32mp device drivers weren't completely upstream yet. Drop the node. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | regulator: add driver for stpmic1-regulatorsAhmad Fatoum2019-11-064-1/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mfd: stpmic1: use dev_get_regmap instead of priv memberAhmad Fatoum2019-11-062-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we call regmap_init, the regmap is associated with the device supplied and can be queried with dev_get_regmap. This is more natural than expecting cell drivers to cast dev->parent->priv. Do it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | regulator: import linear voltage range helpersAhmad Fatoum2019-11-062-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | The incoming stpmic1 regulator driver makes use of these helpers internally. Thus port them out of Linux v5.3. 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>