aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2022-04-10treewide: Rename PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NAMarek Behún52-90/+90
Rename constant PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NA to make it compatible with Linux' naming. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10treewide: Rename PHY_INTERFACE_MODE_COUNT to PHY_INTERFACE_MODE_MAXMarek Behún2-2/+2
Rename constant PHY_INTERFACE_MODE_COUNT to PHY_INTERFACE_MODE_MAX to make it compatible with Linux' naming. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10net: introduce helpers to get PHY interface mode from a device/ofnodeMarek Behún34-339/+125
Add helpers ofnode_read_phy_mode() and dev_read_phy_mode() to parse the "phy-mode" / "phy-connection-type" property. Add corresponding UT test. Use them treewide. This allows us to inline the phy_get_interface_by_name() into ofnode_read_phy_mode(), since the former is not used anymore. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-10net: phy: fix parsing wrong propertyMarek Behún1-1/+1
The "phy-interface-type" property should be "phy-connection-type". Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10treewide: use dm_mdio_read/write/reset() wrappersMarek Behún1-4/+2
Use the new dm_mdio_read/write/reset() wrappers treewide, instead of always getting and dereferencing MDIO operations structure pointer. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10net: introduce helpers to get PHY ofnode from MACMarek Behún2-0/+26
Add helpers ofnode_get_phy_node() and dev_get_phy_node() and use it in net/mdio-uclass.c function dm_eth_connect_phy_handle(). Also add corresponding UT test. This is useful because other part's of U-Boot may want to get PHY ofnode without connecting a PHY. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-10net: phy: dp83867: Fix a never true comparisonHaolin Li1-2/+5
The type of the return value of phy_read() and phy_read_mmd() is int. Change the variable to not be unsigned so that we not get into an unsigned compared against 0. Signed-off-by: Haolin Li <li.haolin@qq.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: atheros: avoid error in ar803x_of_init() when PHY has no OF nodeVladimir Oltean1-1/+1
A DM_ETH driver may use phy_connect() towards a PHY address on an MDIO bus which is not specified in the device tree, as evidenced by: pfe_eth_probe -> pfe_phy_configure -> phy_connect When this happens, the PHY will have an invalid OF node. When ar803x_config() runs, it silently fails at ar803x_of_init(), and therefore, fails to run the rest of the initialization. This makes MII_BMCR contain what it had after BMCR_RESET (0x8000) has been written into it by phy_reset(). Since BMCR_RESET is volatile and self-clearing, the MII_BMCR ends up having a value of 0x0. The further configuration of this register, which is supposed to be handled by genphy_config_aneg() lower in ar803x_config(), never gets a chance to run due to this early error from ar803x_of_init(). As a result of having MII_BMCR as 0, the following symptom appears: => setenv ethact pfe_eth0 => setenv ipaddr 10.0.0.1 => ping 10.0.0.2 pfe_eth0 Waiting for PHY auto negotiation to complete......... TIMEOUT ! Could not initialize PHY pfe_eth0 Manually writing 0x1140 into register 0 of the PHY makes the connection work, but it is rather desirable that the port works without any manual intervention. Fixes: fe6293a80959 ("phy: atheros: add device tree bindings and config") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: dp83867: avoid error in dp83867_of_init() when PHY has no OF nodeVladimir Oltean1-1/+1
A DM_ETH driver may use phy_connect() towards a PHY address on an MDIO bus which is not specified in the device tree, as evidenced by: pfe_eth_probe -> pfe_phy_configure -> phy_connect When this happens, the PHY will have an invalid OF node. The dp83867_config() method has extra initialization steps which are bypassed when the PHY lacks an OF node, which is undesirable because it will lead to broken networking. Allow the rest of the code to run. Fixes: 085445ca4104 ("net: phy: ti: Allow the driver to be more configurable") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-04Merge tag 'u-boot-at91-2022.07-a' of ↵WIP/04Apr2022-nextTom Rini3-0/+170
https://source.denx.de/u-boot/custodians/u-boot-at91 into next First set of u-boot-at91 features for the 2022.07 cycle: This feature set includes the new driver for the Atmel TCB timer, alignment in DT for sama7g5 and sama7g5ek board, one Kconfig conversion for external reset, and the usage of Galois tables from ROM for sama5d2 device.
2022-04-01serial: dm: Add support for putsSean Anderson2-2/+37
Some serial drivers can be vastly more efficient when printing multiple characters at once. Non-DM serial has had a puts option for these sorts of drivers; implement it for DM serial as well. Because we have to add carriage returns, we can't just pass the whole string directly to the serial driver. Instead, we print up to the newline, then print a carriage return, and then continue on. This is less efficient, but it is better than printing each character individually. It also avoids having to allocate memory just to add a few characters. Drivers may perform short writes (such as filling a FIFO) and return the number of characters written in len. We loop over them in the same way that _serial_putc loops over putc. This results in around sizeof(void *) growth for all boards with DM_SERIAL. The full implementation takes around 140 bytes. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-01serial: smh: Initialize serial only if semihosting is enabledSean Anderson1-1/+10
If semihosting is disabled, then the user has no debugger attached, and will not see any messages. Don't create a serial device in this instance, to (hopefully) fall back on another working serial device. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-04-01serial: Add semihosting driverSean Anderson4-0/+172
This adds a serial driver which uses semihosting calls to read and write to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled, we will instantiate a serial driver. This allows users to enable this driver (which has no physical device) without modifying their device trees or board files. We also implement a non-DM driver for SPL, or for much faster output in U-Boot proper. There are three ways to print to the console: Method Baud ================== ===== smh_putc in a loop 170 smh_puts 1600 smh_write with :tt 20000 ================== ===== These speeds were measured using a 175 character message with a J-Link adapter. For reference, U-Boot typically prints around 2700 characters during boot on this board. There are two major factors affecting the speed of these functions. First, each breakpoint incurs a delay. Second, each debugger memory transaction incurs a delay. smh_putc has a breakpoint and memory transaction for every character. smh_puts has one breakpoint, but still has to use a transaction for every character. This is because we don't know the length up front, so OpenOCD has to check if each character is nul. smh_write has only one breakpoint and one memory transfer. DM serial drivers can only implement a putc interface, so we are stuck with the slowest API. Non-DM drivers can implement puts, which is vastly more efficient. When the driver starts up, we try to open :tt. Since this is an extension, this may fail. If it does, we fall back to smh_puts. We don't check :semihosting-features, since there are nonconforming implementations (OpenOCD) which don't implement it (but *do* implement :tt). Some semihosting implementations (QEMU) don't handle READC properly. To work around this, we try to use open/read (much like for stdin) if possible. There is no non-blocking I/O available, so we don't implement pending. This will cause __serial_tstc to always return true. If CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read characters forever. To avoid this, we depend on this config being disabled. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-01db-mv784mp-gp: Rename CONFIG_DB_784MP_GP to CONFIG_TARGET_DB_MV784MP_GPTom Rini2-2/+2
The value CONFIG_DB_784MP_GP is only used in the DDR code to refer to CONFIG_TARGET_DB_MV784MP_GP so just use that second value directly. Cc: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-01Convert CONFIG_LPUART et al to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_LPUART CONFIG_LPUART_32B_REG And note that CONFIG_LPUART_32B_REG is unused in code. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-01Convert CONFIG_MCFRTC et al to KconfigTom Rini2-4/+8
This converts the following to Kconfig: CONFIG_MCFRTC CONFIG_SYS_MCFRTC_BASE While at it, remove '#undef RTC_DEBUG' from these config files. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-01Convert CONFIG_BITBANGMII_MULTI to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_BITBANGMII_MULTI Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-01Convert CONFIG_BCM2835_GPIO to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_BCM2835_GPIO Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-01timer: atmel_tcb_timer: add atmel_tcb driverClément Léger3-0/+170
Add a driver for the timer counter block that can be found on sama5d2. This driver will be used when booting under OP-TEE since the pit timer which is part of the SYSC is secured. Channel 1 & 2 are configured to be chained together which allows to have a 64bits counter. Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
2022-03-30clk: Use generic CCF ops where possibleSean Anderson8-591/+22
This converts most CCF drivers to use generic ops. imx6q is the only outlier, where we retain the existing functionality by moving the check to request(). Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20220320203446.740178-2-seanga2@gmail.com [ fixed missing include for at91 ] Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-03-30clk: ccf: Add some helper functions for clock opsSean Anderson1-0/+65
Most CCF drivers follow a common pattern where their clock ops defer the actual operation to the backing CCF clock. Add some generic implementations of these functions to reduce duplication of code. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20220320203446.740178-1-seanga2@gmail.com
2022-03-30clk: Consolidate some clock functionsSean Anderson1-20/+2
These functions are exactly the same as their "nodev" varients, except they accept a device and not an ofnode. Rewrite them to just call the other function. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220227190113.1617498-1-seanga2@gmail.com
2022-03-30clk: Make clk_free return voidSean Anderson2-12/+7
Most callers of this function do not check the return value, and it is unclear what action they should take if it fails. If a function is freeing multiple clocks, it should not stop just because the first one failed. Since the callbacks can no longer fail, just convert the return type to void. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-8-seanga2@gmail.com
2022-03-30spi: dw: Don't check clk_freeSean Anderson1-1/+1
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-7-seanga2@gmail.com
2022-03-30spi: bcm63xx: Don't check clk_freeSean Anderson2-9/+3
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-6-seanga2@gmail.com
2022-03-30phy: bcm63xx: Don't check clk_freeSean Anderson3-12/+4
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-5-seanga2@gmail.com
2022-03-30net: bcm63xx: Don't check clk_freeSean Anderson2-10/+2
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-4-seanga2@gmail.com
2022-03-30dma: bcm6348: Don't check clk_freeSean Anderson1-5/+1
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-3-seanga2@gmail.com
2022-03-30clk: Make rfree return voidSean Anderson2-7/+6
When freeing a clock there is not much we can do if there is an error, and most callers do not actually check the return value. Even e.g. checking to make sure that clk->id is valid should have been done in request() in the first place (unless someone is messing with the driver behind our back). Just return void and don't bother returning an error. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20220115222504.617013-2-seanga2@gmail.com
2022-03-28video: Drop formike driverSimon Glass2-514/+0
This is not used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: Convert CONFIG_VIDEO_BCM2835 to KconfigSimon Glass1-0/+8
This converts the following to Kconfig: CONFIG_VIDEO_BCM2835 This is the final ad-hoc CONFIG_VIDEO_... to convert. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Matthias Brugger <mbrugger@suse.com>
2022-03-28video: mxs: Drop old video codeSimon Glass1-89/+0
This is no-longer used and is the last reference to video_hw_init(). Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: Drop FSL DIU driverSimon Glass2-416/+0
This does not use driver model and is more than two years past the migration date. Drop it. It can be added back later if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: fsl: colibri_vf: Drop FSL DCU driverSimon Glass3-564/+0
This does not use driver model and is more than two years past the migration date. Drop it. It can be added back later if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: Drop da8xx-fbSimon Glass3-1163/+0
This is not used in U-Boot anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: Drop references to CONFIG_VIDEO et alSimon Glass2-61/+3
Drop the Kconfigs which are not used and all references to them. In particular, this drops CONFIG_VIDEO to avoid confusion and allow us to eventually rename CONFIG_DM_VIDEO to CONFIG_VIDEO. Also drop the prototype for video_get_info_str() which is no-longer used. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2022-03-28video: Drop video_fb headerSimon Glass9-9/+0
This is not used now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: nexell: Drop unused and invalid codeSimon Glass1-11/+3
Unfortunately this driver uses the old video structure to store things. This is not supported with driver model. Drop the old code and comment out the other pieces, so the maintainer can take a look. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28video: Drop cfg_consoleSimon Glass4-1944/+0
The non-driver model video support was removed two years ago. Drop this driver, which is only used by nokia_rx51. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-28Merge tag 'v2022.04-rc5' into nextTom Rini25-72/+382
Prepare v2022.04-rc5
2022-03-28mtd: gpmi: fix the bch setting backward compatible issueWIP/2022-03-28-critical-fixesHan Xu2-11/+62
Previous u-boot code changed the default bch setting behavior and caused backward compatible issue. This fix choose the legacy bch geometry back again as the default option. If the minimum ecc strength that NAND chips required need to be chosen, it can be enabled by either adding DT flag "fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The unused flag "fsl,legacy-bch-geometry" get removed. Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry) Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND) Tested-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Han Xu <han.xu@nxp.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2022-03-28Fix URLs to old freescale git reposPali Rohár1-1/+1
Freescale git repos are now on source.codeaurora.org. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-03-25bootcount: Add pmic pfuze100 bootcount driverPhilip Oberfichtner3-0/+169
Use the MEMA - MEMD registers on the PFUZE100 as bootcount registers. Based on work from Heiko Schocher <hs@denx.de>. Signed-off-by: Philip Oberfichtner <pro@denx.de>
2022-03-25disk: Add an option for partitions in SPLSimon Glass1-1/+1
In some cases we do not want to enable partition support in SPL. Add an option to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-25pinctrl: Add the pinctrl setting for PWM.Billy Tsai1-0/+120
This patchs add the signal description array for PWM pinctrl settings. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2022-03-25pwm: Add Aspeed ast2600 PWM supportBilly Tsai3-0/+260
This patch add the support of PWM controller which can be found at aspeed ast2600 soc. The pwm supoorts up to 16 channels and it's part function of multi-function device "pwm-tach controller". Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2022-03-25pci: Add defines for normal and subtractive PCI bridgesPali Rohár9-12/+12
Add following two new PCI class codes defines into pci_ids.h include file: PCI_CLASS_BRIDGE_PCI_NORMAL PCI_CLASS_BRIDGE_PCI_SUBTRACTIVE And use these defines in all U-Boot code for describing PCI class codes for normal and subtractive PCI bridges. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-25Convert CONFIG_LCD_INFO et al to KconfigTom Rini1-0/+12
This converts the following to Kconfig: CONFIG_LCD_INFO CONFIG_LCD_LOGO CONFIG_LCD_INFO_BELOW_LOGO CONFIG_LCD_IN_PSRAM Cc: Anatolij Gustschin <agust@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_ATMEL_LCD et al to KconfigTom Rini1-0/+9
This converts the following to Kconfig: CONFIG_ATMEL_LCD CONFIG_ATMEL_LCD_BGR555 CONFIG_ATMEL_LCD_RGB565 CONFIG_GURNARD_SPLASH Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_MII_INIT to KconfigTom Rini1-3/+1
This converts the following to Kconfig: CONFIG_MII_INIT Signed-off-by: Tom Rini <trini@konsulko.com>