- Feb 10, 2025
-
-
Jonas Karlman authored
RK3528 and RK3576 use different tap and delay num for cmdout and strbin. Move tap and delay num for cmdout and strbin to driver data to prepare for adding new SoCs. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se>
-
- Oct 11, 2024
-
-
Simon Glass authored
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Oct 03, 2024
-
-
Simon Glass authored
Add a missing colon and newline in rk3399_emmc_get_phy(). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Allow MMC init when clock support is not enabled in a particular phase. Refactor the setting of priv->emmc_clk so it is a bit clearer. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 20, 2024
-
-
Tom Rini authored
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by:
Jonas Karlman <jonas@kwiboo.se> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- May 19, 2024
-
-
Tom Rini authored
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd135, reversing changes made to 2ee6f3a5. Reported-by:
Jonas Karlman <jonas@kwiboo.se> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- May 07, 2024
-
-
Tom Rini authored
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by:
Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by:
Peter Robinson <pbrobinson@gmail.com> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Apr 26, 2024
-
-
Jonas Karlman authored
The commit 2cc6cde6 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command") introduced a limit of number of blocks to read to fix a Data End Bit Error on RK3568 and RK3588. This had a side affect of significant slowing down reading FIT from eMMC. After the commit 6de9d7b2 ("rockchip: rk35xx: Enable eMMC HS200 mode by default") the limit of number of blocks to read workaround is no longer necessary and at HS200+ a Data End Bit Error is no longer happening using PIO mode. Change this limitation to allow reading more than 4 blocks with a single CMD18 command in PIO mode at HS200+ speed, keep using the 4 blocks limitation when loadig FIT from eMMC at lower speed than HS200. Fixes: 2cc6cde6 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command") Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Dragan Simic <dsimic@manjaro.org> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Feb 05, 2024
-
-
Jonas Karlman authored
Testing has shown that writing to eMMC using HS400 modes on RK3568 result in an ERROR. Change the tap number for transmit clock to fix this. Also stop DLL when config_dll() is called to disable DLL. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- May 18, 2023
-
-
Jonas Karlman authored
Loading part of TF-A into SRAM from eMMC using DMA fails on RK3399 similar to other Rockchip SoCs. Checksum validation fails with: ## Checking hash(es) for Image atf-2 ... sha256 error! Bad hash value for 'hash' hash node in 'atf-2' image node spl_load_simple_fit: can't load image loadables index 1 (ret = -1) mmc_load_image_raw_sector: mmc block read error SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### Add a device tree property, u-boot,spl-fifo-mode, to control when the rockchip_sdhci driver should disable the use of DMA and fallback on PIO mode. Same device tree property is used by the rockchip_dw_mmc driver. In commit 2cc6cde6 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command") the DMA mode was disabled using a CONFIG option on RK3588. Revert that and instead disable DMA using the device tree property for all RK3588 boards, also apply similar workaround for all RK3399 boards. Fixes: 2cc6cde6 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command") Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com> Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
-
Jonas Karlman authored
The workaround to limit number of blocks to read in a single command should only be applied to RK3568 and RK3588. Change to be more strict when to apply the workaround. Fixes: 2cc6cde6 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command") Suggested-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com> Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
-
- Apr 21, 2023
-
-
Jonas Karlman authored
Using DMA to load TF-A into SRAM fails when booting from eMMC on RK3588. ## Checking hash(es) for Image atf-3 ... sha256 error! Bad hash value for 'hash' hash node in 'atf-3' image node spl_load_simple_fit: can't load image loadables index 2 (ret = -1) mmc_load_image_raw_sector: mmc block read error Fix this by using PIO mode in SPL and limit the number of blocks used in a single read command to avoid triggering Data End Bit Error interrupt. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Add support for RK3588 to the rockchip sdhci driver. Use driver data to handle differences between RK3568 and RK3588: - Set "Receive original clock source is auto gating" for RK3588. - Set "Receive clock source is no-inverted" only on RK3568 and "Transmit clock source is invertion of original clock input" for RK3588. - Use different txclk_tapnum for HS400 modes on RK3588. - Configure the CMDOUT reg for HS400 modes for RK3588. This is based on the mainline linux and vendor kernel driver and have successfully been tested with rock5b-rk3588_defconfig and CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_HS400_SUPPORT=y CONFIG_MMC_HS400_ES_SUPPORT=y CONFIG_MMC_SPEED_MODE_SET=y using the following command to switch mode and then read 512 MiB of data from eMMC into memory, => mmc dev 0 0 <mode> && mmc info && mmc read 10000000 2000 10000 for each of the modes below. 0 = MMC legacy 1 = MMC High Speed (26MHz) 3 = MMC High Speed (52MHz) 4 = MMC DDR52 (52MHz) 10 = HS200 (200MHz) 11 = HS400 (200MHz) 12 = HS400ES (200MHz) Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Shawn Lin <shawn.lin@rock-chips.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Adjust tap number for transmit clock, tap number and delay number for strobe input to fix HS400 modes on RK3568. New values have been picked from vendor kernel and u-boot and have successfully been tested with rock-3a-rk3568_defconfig and CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_HS400_SUPPORT=y CONFIG_MMC_HS400_ES_SUPPORT=y CONFIG_MMC_SPEED_MODE_SET=y using the following command to switch mode and then read 512 MiB of data from eMMC into memory, => mmc dev 0 0 <mode> && mmc info && mmc read 10000000 2000 10000 for each of the modes below. 0 = MMC legacy 1 = MMC High Speed (26MHz) 3 = MMC High Speed (52MHz) 4 = MMC DDR52 (52MHz) 10 = HS200 (200MHz) 11 = HS400 (200MHz) 12 = HS400ES (200MHz) Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
This rearrange and remove duplicate defines to make the code cleaner. There is no need to read vendor area1 and use an offset each time, it is easier and clearer to just use the reg offset defined in TRM, same as the other vendor regs. This also removes use of the misspelled const for the RK3588 CMDOUT reg, it will be re-added when support for RK3588 is introduced. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Remove empty implementations of get_phy and set_enhanced_strobe ops. Change driver set_enhanced_strobe to return 0 in order to allow missing implementation of the ops. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Refactor set_ios_post ops to correctly set UHS Speed Select field values according to TRM. Also set or unset Enhanced Strobe Enable bit and eMMC Card present bit in set_ios_post, the Enhanced Strobe Enable bit was never unset after switching to HS400ES mode. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Check return value from mmc_send_cmd and clear HOST_CONTROL2 when there is an error. Also skip enable of interrupt signaling and remove a delay, a delay is already happening in sdhci_send_command. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Change to configure clock and DLL in set_clock and config_dll ops instead of in the set_ios_post ops. With this change the output clock is turned off while configuring DLL parameters, according to the design recommendations. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Add support for the set_clock and config_dll sdhci_ops. Use of these ops will allow configuration of DLL while the output clock is disabled. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
Remove the unneeded emmc_phy_init now that the no-inverter flag is handled correctly after commit 2321a991 ("rockchip: sdhci: rk3568: bypass DLL when clk <= 52 MHz"). Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Jonas Karlman authored
The device private data is misused in rockchip_sdhci_of_to_plat and rockchip_sdhci_execute_tuning. In these functions dev_get_priv is assigned to struct sdhci_host: struct sdhci_host *host = dev_get_priv(dev); Instead, the sdhci host should refer to host in struct rockchip_sdhc: struct rockchip_sdhc *priv = dev_get_priv(dev); struct sdhci_host *host = &priv->host; Because host is the first member in struct rockchip_sdhc this is not a real problem, lets fix it anyway and also use priv name consistently. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Vasily Khoruzhick authored
mmc->tran_speed is max clock, but currently rk3568_sdhci_set_ios_post uses it if its != 0, regardless of mmc->clock value, and it breaks eMMC controller. Without this patch 'mmc dev 0; mmc dev 1; mmc dev 0' is enough for breaking eMMC, since first initialization sets mmc->mmc_tran speed to non-zero value (26MHz in my case), and on subsequent re-init when mmc layer asks for 400KHz it sets 26MHz instead. Fix it by using MAX(mmc->tran_speed, mmc->clock) Signed-off-by:
Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Mar 19, 2023
-
-
Vasily Khoruzhick authored
For Rockchip platform, DLL bypass bit and start bit need to be set if DLL is not locked. With this change applied eMMC in my NanoPi R5S can run at 52 MHz. Based on linux commit b75a52b0dda3 ("mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for rockchip platform") Signed-off-by:
Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Apr 18, 2022
-
-
Haolin Li authored
A pointer can not be negative. Use macro IS_ERR_OR_NULL() for checking. Signed-off-by:
Haolin Li <li.haolin@qq.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com> Reviewed-by:
Jaehoon Chung <jh80.chung@samsung.com>
-
- Apr 12, 2022
-
-
Ariel D'Alessandro authored
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>
-
- Mar 16, 2022
-
-
Alper Nebi Yasak authored
On RK3568, a register bit must be set to enable Enhanced Strobe. However, it appears that the address of this register may differ from vendor to vendor and should be read from the underlying MMC IP. Let the Rockchip SDHCI driver read this address and set the relevant bit when Enhanced Strobe configuration is requested. The IP uses a custom mode select value (0x7) for HS400, use that instead of the common but non-standard SDHCI_CTRL_HS400 value (0x5). Also add some necessary DLL_STRBIN and DLL_TXCLK configuration for HS400. Additionally, a bit signifying that the connected hardware is an eMMC chip must be set to enable Data Strobe for HS400 and HS400ES modes. Also make the driver set this bit as appropriate. This is partly ported from Linux's Synopsys DWC MSHC driver which happens to be the underlying IP. (drivers/mmc/host/sdhci-of-dwcmshc.c in Linux tree). Co-developed-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Signed-off-by:
Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Alper Nebi Yasak authored
On RK3399, a register bit must be set to enable Enhanced Strobe. Let the Rockchip SDHCI driver set it when Enhanced Strobe configuration is requested. However, having it set makes the lower-speed modes stop working and makes reinitialization fail, so let it be unset as needed in set_control_reg(). This is mostly ported from Linux's Arasan SDHCI driver which happens to be the underlying IP. (drivers/mmc/host/sdhci-of-arasan.c in Linux tree). Signed-off-by:
Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by:
Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Mar 14, 2022
-
-
Alper Nebi Yasak authored
The Rockchip RK3399 eMMC PHY has to be power-cycled while changing its clock speed to some higher speeds. This is dependent on the desired SDHCI clock speed, and it looks like the PHY should be powered off while setting the SDHCI clock in these cases. Commit ac804143 ("mmc: rockchip_sdhci: add phy and clock config for rk3399") attempts to do this in the set_ios_post() hook by setting the SDHCI clock once more while the PHY is turned off/on as necessary, as the SDHCI framework does not provide a way to override how it sets its clock. However, the commit breaks reinitializing the eMMC on a few boards including chromebook_kevin and reportedly ROCKPro64. This patch reworks the power cycling to utilize the SDHCI framework slightly better (using the set_control_reg() hook to power off the PHY and set_ios_post() hook to power it back on) which happens to fix the issue, at least on a chromebook_kevin. Signed-off-by:
Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Oct 15, 2021
-
-
Yifeng Zhao authored
The default configuration of rk3399 EMMC PHY does not enable the strobe line, and EMMC controller will got data transmission error at HS400 mode. Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Aug 11, 2021
-
-
Yifeng Zhao authored
This patch adds support for the RK3568 platform to this driver. Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Reviewed-by:
Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
Yifeng Zhao authored
Add clock, phy and other configuration, it is convenient to support new controller. Here a short summary of the changes: - Add mmc_of_parse to parse dts config. - Remove OF_PLATDATA related code. - Reorder header inclusion. - Add phy ops. - add ops set_ios_post to modify the parameters of phy when the clock changes. - Add execute tuning api for hs200 tuning. Signed-off-by:
Yifeng Zhao <yifeng.zhao@rock-chips.com> Reviewed-by:
Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Dec 13, 2020
-
-
Simon Glass authored
This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Rename this to be consistent with the change from 'platdata'. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jul 10, 2020
-
-
Walter Lozano authored
In the current implementation, when dtoc parses a dtb to generate a struct platdata it converts the information related to linked nodes as pointers to struct platdata of destination nodes. By doing this, it makes difficult to get pointer to udevices created based on these information. This patch extends dtoc to use struct driver_info when populating information about linked nodes, which makes it easier to later get the devices created. In this context, reimplement functions like clk_get_by_index_platdata() which made use of the previous approach. Signed-off-by:
Walter Lozano <walter.lozano@collabora.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Feb 06, 2020
-
-
Simon Glass authored
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Anatolij Gustschin <agust@denx.de>
-
- Jul 20, 2019
-
-
Kever Yang authored
This patch fix mmc driver abort caused by below patch: 3d296365 mmc: sdhci: Add support for sdhci-caps-mask After the patch sdhci_setup_cfg() access to host->mmc->dev, so we have to do init before make the call to the function() Signed-off-by:
Kever Yang <kever.yang@rock-chips.com>
-
- May 07, 2018
-
-
Tom Rini authored
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by:
Tom Rini <trini@konsulko.com>
-