summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2024-08-19mmc: dw_mmc: Improve coding styleSam Protsenko
Fix most of checkpatch warnings and other obvious style issues. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Replace fifoth_val property with fifo-depthSam Protsenko
Replace fifoth_val property with its fifo-depth counterpart in all DW MMC drivers. fifo-depth is a common property used in upstream Linux kernel. The FIFOTH register value will be calculated using fifo-depth value in DW MMC core (dw_mmc.c). This change reduces code duplication in platform drivers, and pulls common FIFOTH register value calculation into core dw_mmc driver where it belongs. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Add support for 64-bit IDMACSam Protsenko
Some DW MMC blocks (e.g. those on modern Exynos chips) support 64-bit DMA addressing mode. 64-bit DW MMC variants differ from their 32-bit counterparts: - the register layout is a bit different (because there are additional IDMAC registers present for storing upper part of 64-bit addresses) - DMA descriptor structure is bigger and different from 32-bit one Introduce all necessary changes to enable support for 64-bit DMA capable DW MMC blocks. Next changes were made: 1. Check which DMA address mode is supported in current IP-core version. HCON register (bit 27) indicates whether it's 32-bit or 64-bit addressing. Add boolean .dma_64bit_address field to struct dwmci_host and store the result there. dwmci_init_dma() function is introduced for doing so, which is called on driver's init. 2. Add 64-bit DMA descriptor (struct dwmci_idmac64) and use it in dwmci_prepare_desc() in case if .dma_64bit_address field is true. A new dwmci_set_idma_desc64() function was added for populating that descriptor. 3. Add registers for 64-bit DMA capable blocks. To make the access to IDMAC registers universal between 32-bit / 64-bit cases, a new struct dwmci_idmac_regs (and corresponding host->regs field) was introduced, which abstracts the hardware by being set to appropriate offset constants on init. All direct calls to IDMAC registers were correspondingly replaced by accessing host->regs. 4. Allocate and use 64-bit DMA descriptors buffer in case when IDMAC is 64-bit capable. Extract all the code (except for the IDMAC descriptors buffer allocation) from dwmci_send_cmd() to dwmci_send_cmd_common(), so that it's possible to keep IDMAC buffer (either 32-bit or 64-bit) on stack during send_cmd routine. The insights for this implementation were taken from Linux kernel DW MMC driver. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Improve 32-bit IDMAC descriptor namingsSam Protsenko
Prepare for adding 64-bit IDMAC descriptors by renaming current 32-bit descriptor and its fields accordingly. While at it, make use of virt_to_phys() to make it more obvious in which places the physical addresses have to be used. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract setting the DMA descriptor into a separate routineSam Protsenko
Make dwmci_prepare_data() function easier to read by extracting the preparation of IDMAC descriptor into a dedicated function. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract DMA transfer handling code into a separate routineSam Protsenko
Make dwmci_send_cmd() easier to read by moving the DMA transfer handling code into a dedicated function. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract FIFO data transfer into a separate routineSam Protsenko
FIFO data transfer is implemented as quite a massive chunk of code. Extract it into a dedicated function to make dwmci_data_transfer() easier to read and reduce the indentation level of the code. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract divider update to a separate functionSam Protsenko
Extract the clock divider update into dwmci_update_div() function. It's a procedure recommended in TRM, so it's better to keep it in a dedicated function to make the code clearer. While at it also extract the clock control code into a separate routine to avoid code duplication in dwmci_setup_bus(). No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract FIFO init into a separate routineSam Protsenko
Move FIFO threshold initialization into a separate function to make dwmci_init() more readable. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Extract waiting for data busy into a separate routineSam Protsenko
Waiting for data busy is a logically separate operation and should be implemented as a separate routine. Follow Linux kernel example and extract it from dwmci_send_cmd(). This way it doesn't clutter dwmci_send_cmd() function, and can be reused later in other cases. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-19mmc: dw_mmc: Move struct idmac to dw_mmc.cSam Protsenko
struct idmac is only used in dw_mmc.c, so move it there from dwmmc.h to avoid cluttering the interface in the header. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-08-12Merge tag 'u-boot-rockchip-20240812' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-rockchip Please pull the updates for rockchip platform: - Add board support: RK3566: Radxa ROCK 3 Model C Radxa ZERO 3W/3E Xunlong Orange Pi 3B RK3568J: Radxa ROCK 3B RK3308B: Radxa ROCK S0 RK3588: Radxa ROCK 5 ITX FriendlyElec CM3588 NAS board - dw-mmc: allow 4-bit mode; - dts and config updates; CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/21997
2024-08-11usb: dwc3: support USB 3.1 controllersCaleb Connolly
The revision is different for these, add the additional check as in xhci-dwc3 core_init code. Equivalent upstream Linux patch: 690fb3718a70 ("usb: dwc3: Support Synopsys USB 3.1 IP") Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550 Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: Marek Vasut <marex@denx.de>
2024-08-09Merge tag 'tpm-master-09082024' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-tpm.git Back when the TPM subsystem was refactored tpm_tis_wait_init() ended up being called after tpm_tis_init() which initializes values the former needs. Since we added more TPM chipsets since then sitting on an i2c bus, this patch folds in tpm_tis_wait_init into tpm_tis_init and makes sure it's called in the right order regardless of the bus the TPM sits on.
2024-08-09i2c: imx_lpi2c: Support read transfers longer than 256 bytesFedor Ross
The TXFIFO register of LPI2C only has one byte length, and if the length of the data that needs to be read exceeds 256 bytes, it needs to be written to TXFIFO multiple times. Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
2024-08-09i2c: imx_lpi2c: Replace hard-coded bus speed value with bus->speed_hzFedor Ross
Instead of using the hard-coded bus speed value I2C_SPEED_STANDARD_RATE, use the actual configured bus speed. This way the bus speed doesn't change suddenly after calling the imx_lpi2c_probe_chip() function for example. Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
2024-08-09i2c: imx_lpi2c: Fix a typo in bus_i2c_receiveFedor Ross
Fix a typo in a debug message. It should be 'for' not 'fot' . Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
2024-08-09i2c: samsung: Support platforms other than EXYNOS4 and EXYNOS5David Virag
Newer Samsung SoCs (including newer Exynos, ExynosAuto, Google Tensor) still use these IPs, or slightly newer versions of it. Make these drivers available on these platforms by guarding EXYNOS4/EXYNOS5 specific code behind their configs, and using CCF for clocks on other platforms. Tested S3C I2C driver on Exynos7885. This along with extended clock driver should enable S3C I2C on Exynos850. Signed-off-by: David Virag <virag.david003@gmail.com> Tested-by: Henrik Grimler <henrik@grimler.se> Reviewed-by: Heiko Schocher <hs@denx.de>
2024-08-09i2c: samsung: Drop s3c24x0 specific code.David Virag
This has been dead code for many years now. Remove it. Signed-off-by: David Virag <virag.david003@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2024-08-09i2c: mux: Fix error path in i2c-arb-gpioMichal Simek
There is no reason to use goto and just call return. Better is to call return directly which is done for some if/else parts. Also make no sense to setup ret to -ETIMEDOUT and then to 0. Return timeout directly. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2024-08-09i2c: pca954x: Remove pointer to GDMichal Simek
There is no reason to have any pointer to GD that's why remove it. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2024-08-09dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPLJonas Karlman
What model of Radxa ZERO 3W/3E board can be identified using ADC at runtime, add a Kconfig symbol to allow use of ADC in SPL. This will be used to identify board model in SPL to allow loading correct FIT configuration and FDT for U-Boot proper at SPL phase. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-08-09rockchip: io-domain: Add support for RK3308Jonas Karlman
Port the RK3308 part of the Rockchip IO Domain driver from linux. This differs from linux version in that vccio3 iodomain bit is enabled in the write ops instead of in an init ops as in linux, this way we can avoid keeping a full state of all supply that have been configured. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-08-09mmc: rockchip_dw_mmc: Allow 4-bit mode when 8-bit mode is supportedJonas Karlman
Hosts capable of 8-bit can also do 4 bits, fix use of 4-bit mode when 8-bit mode is supported. This fixes use of 1-bit mode with SD NAND on ROCK Pi S using the DT in v6.11-rc1 that chage to use 8-bit bus to also support eMMC. With this 4-bit mode is used with SD NAND and 8-bit mode with eMMC, same as in Linux kernel. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-08-09phy: rockchip: naneng-combphy: Introduce PHY-IDs to fix RK3588 muxingSebastian Kropatsch
Fix multiplex configuration for PCIe1L0 and PCIe1L1 in PCIESEL_CON for RK3588 to correctly select between Combo PHYs and PCIe3 PHY. Currently, the code incorrectly muxes both ports to Combo PHYs, interfering with PCIe3 PHY settings. Introduce PHY identifiers to identify the correct Combo PHY and set the necessary bits accordingly. This fix is adapted from the upstream Linux commit by Sebastian Reichel: d16d4002fea6 ("phy: rockchip: naneng-combphy: Fix mux on rk3588") Fixes: b37260bca1aa ("phy: rockchip: naneng-combphy: Use signal from comb PHY on RK3588") Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Sebastian Kropatsch <seb-dev@mail.de>
2024-08-08Merge tag 'u-boot-nand-20240808' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-nand-flash This series adds support for the UBI block device, which allows to read/write data block by block. The series was tested by Alexey Romanov on SPI NAND. The patches pass the pipeline CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/21933
2024-08-08spinand: bind UBI blockAlexey Romanov
UBI block is virtual block device, which is an abstraction over MTD layer. Therefore it is logical to use it in combination with MTD drivers. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-08disk: support UBI partitionsAlexey Romanov
UBI partition is abstraction over UBI volumes. Can be used by UBI block device. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-08drivers: introduce UBI block abstractionAlexey Romanov
UBI block is an virtual device, that runs on top of the MTD layer. The blocks are UBI volumes. Intended to be used in combination with other MTD drivers. Despite the fact that it, like mtdblock abstraction, it used with UCLASS_MTD, they can be used together on the system without conflicting. For example, using bcb command: # Trying to load bcb via mtdblock: $ bcb load mtd 0 mtd_partition_name # Trying to load bcb via UBI block: $ bcb load ubi 1 ubi_volume_name User always must attach UBI layer (for example, using ubi_part()) before using UBI block device. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-08spinand: bind mtdblockAlexey Romanov
Bind SPI-NAND driver to MTD block driver. Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-08drivers: introduce mtdblock abstractionAlexey Romanov
MTD block - abstraction over MTD subsystem, allowing to read and write in blocks using BLK UCLASS. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-08disk: support MTD partitionsAlexey Romanov
Add new MTD partition driver, which can be useful with mtdblock driver combination. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-06Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini
This updates the "old style" DTs to that of Linux v6.10, matching what OF_UPSTREAM is at now. Hopefully we won't need to do this (manually) anymore. Since this brings in the DT for a new board (Tanix TX1), also add the defconfig for that, which has just been waiting for that sync. There are three more fixes: two for the SPI clock setup, which avoids too high frequencies in some cases, and one fix to avoid a build warning with GCC 14 for the sunxi TOC0 part of the mkimage tool. The gitlab CI passed, and I tested the SPI flash on the OrangePi Zero 3 and also booted that into Linux.
2024-08-06Merge tag 'xilinx-for-v2024.10-rc2' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze AMD/Xilinx changes for v2024.10-rc2 amd/xilinx: - Enable CONFIG_MMC_SPEED_MODE_SET env: - support overriding spi dev from board code clk: - Add set_rate support for display clocks spi: - Describe is25lp01gg flash zynq: - Add support for 7z010_lr and 7z020_lr zynqmp: - Add support for zu1eg_lr - Enable NFS for Kria - DT changes - Cleanup firmware handling in board_init() versal-net: - Setup spi seq number based on boot device - dt-schema update for mini configurations versal2: - Disable uartlite driver - Add support for mini configurations - Enable NFS
2024-08-06tpm: call tpm_tis_wait_init() after tpm_tis_init()Lukas Funke
tpm_tis_wait_init() is using the 'chip->timeout_b' field which is initialized in tpm_tis_init(). However, the init-function is called *after* tpm_tis_wait_init() introducing an uninitalized field access. This commit switches both routines. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> [Ilias removed unusged 'chip' definition in tpm_tis_spi_probe()] Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Fixes: a5c30c26b28 ("tpm: Use the new API on tpm2 spi driver") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-08-06spi: sunxi: fix clock divider calculation for max frequency settingMichael Walle
If the maximum frequency is requested, we still fall into the CDR2 handling. But there the minimal divider is 2. For the sun6i and sun8i we can do better with the CDR1 setting where the minimal divider is 1: SPI_CLK = MOD_CLK / 2 ^ cdr with cdr = 0 Thus, handle the div = 1 case specially. While at it, correct the comment above the calculation. Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2024-08-06spi: sunxi: fix CDR2 calculationMichael Walle
The CDR2 divider calculation always yield a frequency greater than the requested one. Use DIV_ROUND_UP() to keep the frequency equal or below the requested one. This way, we can also drop the "if div > 0" check because we know for a fact that div cannot be zero. FWIW, this aligns the CDR2 calculation with the linux driver. Suggested-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2024-08-05Merge patch series "Bug-fixes for a few boards"Tom Rini
Simon Glass <sjg@chromium.org> says: This series includes fixes to get some rockchip and nvidia boards working again. It also drops the broken Beaglebone Black config and provides a devicetree fix for coral (x86).
2024-08-05rockchip: Avoid #ifdefs in RK3399 SPLSimon Glass
The code here is confusing due to large blocks which are #ifdefed out. Add a function phase_sdram_init() which returns whether SDRAM init should happen in the current phase, using that as needed to control the code flow. This increases code size by about 500 bytes in SPL when the cache is on, since it must call the rather large rockchip_sdram_size() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-05rockchip: Ensure memory size is available in RK3399 SPLSimon Glass
At present gd->ram_size is 0 in SPL, meaning that it is not possible to enable the cache. Correct this by always populating the RAM size correctly. This increases code size by about 500 bytes in SPL, since it must call the rather large rockchip_sdram_size() function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-05soc: zynqmp: Add support for zu1eg_lr deviceMichal Simek
There is new chip coming which is using new _lr suffix that's why record it in the list to enable bitstream in bit format loading. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/12a939e2c88e82a9828852a8f7f33dfa14a6a4b8.1722351201.git.michal.simek@amd.com
2024-08-05mtd: spi-nor: ids: Add IS25LP01GG flash supportPrasad Kummari
Add support for ISSI 128MB flash IS25LP01GG. This part supports 4byte opcodes. It also supports dual and quad read. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Link: https://lore.kernel.org/r/20240617041841.1336632-1-prasad.kummari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-08-05clk: zynqmp: Add set_rate support for display clocksVenkatesh Yadav Abbarapu
If "assigned-clock-rates" property is included in the device tree, display driver probe is getting failed, as dp_video_ref till dp_stc_ref clocks are missing from set rate function, adding them to fix the probe failure. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20240711082939.29260-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-08-02cpu: imx: implement release_core callbackHou Zhiqiang
Release the secondary cores through the PSCI request. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-08-02cpu: imx: Add i.MX 8M series SoCsHou Zhiqiang
Add i.MX 8M Mini, Nano and Plus SoCs support. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-08-02cpu: imx: removed the tail '\n' of the CPU descriptionHou Zhiqiang
Return CPU description string without newline character in the end. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-08-02cpu: imx: fix the CPU type field widthHou Zhiqiang
Increase one more bit to cover all CPU types. Otherwise it shows wrong CPU info on some platforms, such as i.MX8M Plus: U-Boot 2024.04+g674440bc73e+p0 (Jun 06 2024 - 10:05:34 +0000) CPU: NXP i.MX8MM Rev1.1 A53 at 4154504685 MHz at 30C Model: NXP i.MX8MPlus LPDDR4 EVK board Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-08-02cpu: imx: fix the CPU frequency in cpu_imx_get_info()Hou Zhiqiang
The cpu_freq stores the current CPU frequency in Hz. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-02cpu: sandbox: implement release_core callbackHou Zhiqiang
Add empty release CPU core function for testing. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-08-02cpu: add release_core callbackHou Zhiqiang
Add a new callback release_core to the cpu_ops, which is used to release a CPU core to run baremetal or RTOS application on a SoC with multiple CPU cores. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>