summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2022-04-14serial: smh: Implement puts for DMSean Anderson
This adds an implementation of puts for DM. The implementation is not as clean as for the non-DM puts because we have to handle non-nul-terminated string. We also handle short writes (though these are probably very unusual). Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-04-14test: serial: Add test for putc/putsSean Anderson
This adds a test to ensure that puts is equivalent to putc called in a loop. We don't verify the contents of the message to avoid having to record console output a second time (though that could be added in the future). The globals are initialized to non-zero values to avoid a warning; in particular, the character count is off-by-one (but we always make relative measurements). Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-14serial: sandbox: Implement putsSean Anderson
This implements puts for sandbox. It is fairly straightforward, except that we break out the shared color printing functionality into its own function. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-14serial: Fix _serial_puts using \n\r instead of \r\nSean Anderson
A string like "test\n" would be broken up into the following sequence of prints by _serial_puts: puts("test\n") putc('\r') Although functionally this is the same as \r\n, it is not the standard sequence and caused tests to fail. Fix this by excluding the '\n' from the initial print. The above string will now be broken up like puts("test") puts("\r\n") Since we may now need to call ops->puts twice (with the associated retry logic), break that part of the function off into a helper. Fixes: 7a76347189 ("serial: dm: Add support for puts") Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-04-14led: Configure LED default-state on bootMarek Vasut
In case the DT LED subnode contains "default-state" property set to either "on" or "off", probe the LED driver and configure the LED state automatically. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> [trini: Update the relevant test now that we have support] Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-14led: gpio: Drop duplicate OF "label" property parsingMarek Vasut
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14led: pwm: Drop duplicate OF "label" property parsingTom Rini
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-14led: bcm6753: Drop duplicate OF "label" property parsingTom Rini
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-14led: cortina: Drop duplicate OF "label" property parsingMarek Vasut
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14led: bcm6858: Drop duplicate OF "label" property parsingMarek Vasut
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14led: bcm6358: Drop duplicate OF "label" property parsingMarek Vasut
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14led: bcm6328: Drop duplicate OF "label" property parsingMarek Vasut
The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14led: Move OF "label" property parsing to coreMarek Vasut
Every driver in drivers/led/ currently does some form of "label" OF property parsing in its bind() callback. Move this label parsing to LED core, since this "label" OF property is a generic property. This permits code deduplication in subseuqent patches. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-14misc: atsha204a: Fix big endian supportPali Rohár
Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2022-04-14power: domain: ti: Extend use of PTCMD and PTSTAT registers for high PDsDave Gerlach
It is possible for power domain IDs to be great than 31. If this happens, the PTCMD and PTSTAT registers must overflow into adjacent corresponding PTCMD_H and PTSTAT_H registers for each. Update the driver to account for this. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2022-04-13net: dm9000: Add Kconfig entryMarek Vasut
Add Kconfig entry for the DM9000 MAC. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Add DM supportMarek Vasut
Add support for U-Boot DM and DT probing. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Receive one packet per recv callMarek Vasut
Instead of reading out the entire FIFO and possibly overwriting U-Boot memory, read out one packet per recv call, pass it to U-Boot network stack, and repeat. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Split non-DM specific bits from common codeMarek Vasut
Split network handling functions into non-DM specific parts and common code in preparation for conversion to DM. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Pass private data around for IOMarek Vasut
Pass private data into IO accessors and use the base addresses of IO and DATA window from the private data instead of using the hard coded macros DM9000_IO/DM9000_DATA. Currently both the DM9000_IO and DM9000_DATA are assigned to the respecive private data fields for the non-DM case backward compatibility. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Drop dm9000.h and staticize SROM accessMarek Vasut
Dispose of dm9000.h because none of the function prototypes declared in it are called anywhere in the codebase. Staticize dm9000_read_srom_word() because it is now called only from within the dm9000 driver. Drop dm9000_write_srom_word() because it is no longer used. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Drop static device private dataMarek Vasut
Allocate driver private data dynamically in its init function and drop the static driver private data variable. Pass the dynamic private data throughout the driver. This is done in preparation for DM conversion. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Rename board_info to dm9000_privMarek Vasut
Rename board_info structure to dm9000_priv to make it clear what this structure really contains, the driver private data. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Reorder and staticizeMarek Vasut
Reorder the driver functions to get rid of forward declarations. Staticize whatever is possible. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Checkpatch cleanupMarek Vasut
Fix checkpatch errors and warnings. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Drop volatilesMarek Vasut
Remove volatile keyword usage from arrays, they are not really volatile in any way, so this keyword is misused here. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Turn DM9000_DMP_PACKET() into a functionMarek Vasut
Rework DM9000_DMP_PACKET() into dm9000_dump_packet() function, this brings better type checking. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Drop unused dump_regs()Marek Vasut
Drop unused function dump_regs() because it is unused. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Make RxLen and RxStatus lowercaseMarek Vasut
Rename variables to lowercase to be consistent with coding style. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Replace DM9000_DBG() with debug()Marek Vasut
Use standard debug() macro to print debug messages instead of reinventing driver-specific macro again. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Make accessor names lowercaseMarek Vasut
Make accessor names lowercase to be consistent with coding style. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Change priv member typeMarek Behún
Change type of private struct member mdio_base from void * to phys_addr_t. This allows us to drop 2 casts. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Convert to ofnode functionsMarek Behún
Convert fdt parsing functions to ofnode parsing functions. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Deduplicate codeMarek Behún
Deduplicate common code in ks2_eth_bind_slaves(). Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-13Merge tag 'u-boot-imx-20220413' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20220413 i.MX patches for 2022.07 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/11710
2022-04-13clk: imx8mp: Fix 24M and 32k clockMarek Vasut
Fix registration of 24M and 32k clock, those got applied or rebased incorrectly, so fill in the correct code. Fixes: 7a2c3be95a5 ("clk: imx8mp: Fill in DWC3 USB, USB PHY, HSIOMIX clock") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Ye Li <ye.li@nxp.com>
2022-04-12clk: imx8mp: Add ECSPI clocksElmar Albert
Add clock tables required for bing up ECSPI interfaces Signed-off-by: Elmar Albert <ealbert@data-modul.com> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: uboot-imx <uboot-imx@nxp.com> Signed-off-by: Elmar Albert <ealbert@data-modul.com> Reviewed-by: Fabio Estevam <festevam@denx.de>
2022-04-12clk: imxrt: Use dts for anatop base addressJesse Taube
In Linux IMX and IMXRT use the device tree to hold the anatop address. The anatop is used in clock drivers as it controls the internal PLLs This will move the macro from asm/arch-imxrt to the device tree. This presumably should also be done with the other IMX boards as well. Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2022-04-12mmc: fsl_esdhc_imx: Add i.MX8MP compatible stringMarek Vasut
Add compatible string for i.MX8MP, which permits i.MX8MP to use HS400ES mode, just like all the other i.MX8M. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Haibo Chen <haibo.chen@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2022-04-12spi: nxp_fspi: Add i.MX8MP compatible stringMarek Vasut
The i.MX8M Mini and i.MX8M Plus flexspi IPs are compatible with one another, however the linux kernel DT uses separate compatible string for each SoC. Add the missing i.MX8MP compatible into this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2022-04-12net: phy: nxp-tja11xx: Add NXP TJA11xx PHY driverMichael Trimarchi
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-12net: phy: Add phy_modify() accessorAriel D'Alessandro
Add read-modify-write unlocked accessor for accessing a PHY register. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-12iopoll: Extend read_poll_timeout macro to support variable parametersAriel D'Alessandro
This macro currently supports only one parameter. Based on Linux iopoll, let's extend read_poll_timeout common API to allow multiple variable parameters. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2022-04-12phy: nxp-c45-tja11xx: Rename functions to be c45 tja11xx specificAriel D'Alessandro
This driver supports NXP C45 TJA11XX PHYs, but there're also other NXP TJA11XX PHYs. Let's rename functions in this driver to be c45 variant specific, so further drivers can be introduced adding support for NXP TJA11XX PHYs. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2022-04-12driver: pwm: pwm-imx: separe dm from non dm implementationTommaso Merciai
Separe dm implementation from non dm implementation of pwm-imx driver using CONFIG_DM_PWM Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
2022-04-12drivers: pwm: pwm-imx: move pwm-imx-util into pwm-imxTommaso Merciai
Move pwm_imx_get_parms, pwm_id_to_reg functions into pwm-imx.c and drop off pwm-imx-util.c Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
2022-04-12regulator: fixed: add possibility to enable by clockPhilippe Schenker
This commit adds the possibility to choose the compatible "regulator-fixed-clock" in devicetree. This is a special case of regulator-fixed where a clock has to be used to switch the regulator on and off. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2022-04-12misc: imx8ulp: Update fuse driverPeng Fan
- According to S400 API, the fuse bank 25 (Testconfig2) is able to access. Add it into driver's mapping table. - According to FSB words list, the reserved 48 words are ahead of the bank 5 and bank 6. Fix the wrong position. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12misc: S400_API: Update S400 API for buffer dumpYe Li
Add ahab_dump_buffer API to dump AHAB buffer for debug purpose Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12misc: S400_API: add ahab_release_caamClement Faure
Add ahab_release_caam() function to the S400 API. Signed-off-by: Clement Faure <clement.faure@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>