- 30 8月, 2017 4 次提交
-
-
由 Chen-Yu Tsai 提交于
The MMC controller can support DDR52 transfers under the new timing mode. According to the BSP kernel, the module clock has to be double the card clock, regardless of the bus width. The default timings in the hardware can be used. This also reworks the code setting the internal divider, getting rid of a extra conditional. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
On the SoCs that introduced the new timing mode for MMC controllers, both the old (where the clock delays are set in the CCU) and new (where the clock delays are set in the MMC controller) timing modes are available, and we have to support them both. However there are two bits that control which mode is active. One is in the CCU, the other is in the MMC controller. The settings on both sides must be the same, or nothing will work. The sunxi-ng clock driver provides an API to query and set the active timing mode. At probe time, we try to set the active mode to the "new timing mode". If it succeeds, we can then use the MMC controller in the new mode. If not, we fall back to the old mode. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Julia Lawall 提交于
The mmc_host_ops structure is only stored in the ops field of an mmc_host structure, which is declared as const. Thus the mmc_host_ops structure itself can be const. Done with the help of Coccinelle. // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct mmc_host_ops i@p = { ... }; @ok1@ struct mmc_host *mmc; identifier r.i; position p; @@ mmc->ops = &i@p @bad@ position p != {r.p,ok1.p}; identifier r.i; struct mmc_host_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct mmc_host_ops i = { ... }; // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Philipp Zabel 提交于
Commit a53e35db ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed. No functional changes. Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 17 7月, 2017 1 次提交
-
-
由 Chen-Yu Tsai 提交于
The register for the "new timing mode" also has bit fields for setting output and sample timing phases. According to comments in Allwinner's BSP kernel, the default values are good enough. Keep the default values already in the hardware when setting new timing mode, instead of overwriting the whole register. Fixes: 9a37e53e ("mmc: sunxi: Enable the new timings for the A64 MMC controllers") Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Cc: <stable@vger.kernel.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 25 4月, 2017 2 次提交
-
-
由 Heiner Kallweit 提交于
Use new core function mmc_get_dma_dir(). Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Icenowy Zheng 提交于
The controller's errors are usually normal (for example, for MMC or SDIO cards, some errors are expected to happen; and for boards without a dedicated card detect pin the error info will even flood console and hide other normal messages) and hard to understand. Change their print level to debug, thus it won't be shown to generic users. Signed-off-by: NIcenowy Zheng <icenowy@aosc.xyz> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 13 2月, 2017 7 次提交
-
-
由 Maxime Ripard 提交于
Add a bit more debug messages that can be helpful when debugging the clock setup. Also fill the actual_clock field in struct mmc_host to report properly the current frequency in debugfs. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
The MMC2 controller on the A64 is kind of a special beast. While the general controller design is the same than the other MMC controllers in the SoC, it also has a bunch of features and changes that prevent it to be driven in the same way. It has for example a different bus width limit, a different maximum frequency, and, for some reason, the maximum buffer size of a DMA descriptor. Add a new compatible specifically for this controller. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
The A64 MMC controllers need DATA0 to be masked while updating the clock, otherwise any subsequent command will result in a timeout. It's not really clear at this point what DATA0 is exactly, but this behaviour is present in Allwinner's tree, and has been suggested by Allwinner engineers as fixes for the timeout. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
The A64 MMC controllers need to set a "new timings" bit when a new rate is set. The actual meaning of that bit is not clear yet, but not setting it leads to some corner-case issues, like the CMD53 failing, which is used to implement SDIO packet aggregation. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
Experience have shown that the using the autocalibration could severely degrade the performances of the MMC bus. Allwinner is using in its BSP a delay set to 0 for all the modes but HS400. Remove the calibration code for now, and add comments to document our findings. Reviewed-by: NAndre Przywara <andre.przywara@arm.com> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
The MMC core assumes that the code will gate the clock when the bus frequency is set to 0, which we've been ignoring so far. Handle that. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
The SD specification documents that the clock frequency should only be changed once gated (Section 3.2.3 - SD Clock Frequency Change Sequence). The current code first modifies the parent clock, gates it and then modifies the internal divider. This means that since the parent clock rate might be changed, the bus clock might be changed as well before it is gated, which breaks the specification. Move the gating before the parent rate modification. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NFlorian Vaussard <florian.vaussard@heig-vd.ch> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 29 11月, 2016 1 次提交
-
-
由 Maxime Ripard 提交于
VMMC is an optional regulator, which means that mmc_regulator_get_supply will only return an error in case of a deferred probe, but not when the regulator is not set in the DT. However, the sunxi driver assumes that VMMC is always there, and doesn't check the value of the regulator pointer before using it, which obviously leads to a (close to) null pointer dereference. Add proper checks to prevent that. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 27 9月, 2016 7 次提交
-
-
由 Icenowy Zheng 提交于
A64 SoC features a MMC controller which need only the mod clock, and can calibrate delay by itself. This patch adds support for the new MMC controller IP core. Signed-off-by: NIcenowy Zheng <icenowy@aosc.xyz> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Michael Weiser 提交于
The sunxi-mmc driver does not take into account the processor may be big endian when writing the DMA descriptors. This causes cards not to be detected when running a big-endian kernel. Change the descriptors for IDMA to use __le32 and ensure they are suitably swapped before writing. Tested successfully on the Cubieboard2. Signed-off-by: NMichael Weiser <michael.weiser@gmx.de> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Chen-Yu Tsai <wens@csie.org> Cc: linux-mmc@vger.kernel.org Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Jean-Francois Moine 提交于
clk_round_rate() may return an error. Check it. Signed-off-by: NJean-Francois Moine <moinejf@free.fr> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Hans de Goede 提交于
It turns out that sun4i (A10) and sun5i (A13 & co) do not have sample clocks, so add a new sun7i-a20-mmc compatible and do not try to use sample clocks on sun4i / sun5i. Since sun4i / sun5i do not have sample clocks, they cannot (reliably) do DDR rates, so only set MMC_CAP_1_8V_DDR when we do have sample clks. Note this patch leaves the clk_prepare_enable() / clk_disable_unprepare() calls to the sample clks as-is, without adding checks for them being NULL. All the clk_foo calls accept a NULL clk and will return success when called with a NULL clk. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Hans de Goede 提交于
Add a sunxi_mmc_clk_set_phase() helper function. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Hans de Goede 提交于
Create a struct to hold the various model / compatible string dependend settings. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Hans de Goede 提交于
When support for the sample clks was added calls to prepare_enable were added to the probe path, but matching calls to disable_unprepare were forgotten in the remove path, this fixes this. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 02 6月, 2016 2 次提交
-
-
由 Chen-Yu Tsai 提交于
Now the the HS-DDR mode clock timings have been corrected, we can re-enable these modes on the A80. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
The MMC clock timings were incorrectly calculated, when the conversion from delay value to delay phase was done. The 50M DDR and 50M DDR 8bit timings are off, and make eMMC DDR unusable. Unfortunately it seems different controllers on the same SoC have different timings. The new settings are taken from mmc2, which is commonly used with eMMC. The settings for the slower timing modes seem to work despite being wrong, so leave them be. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 28 4月, 2016 1 次提交
-
-
由 Chen-Yu Tsai 提交于
eMMC HS-DDR no longer works on the A80, despite it working when support for this developed. Disable it for now. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 29 2月, 2016 7 次提交
-
-
由 Jaehoon Chung 提交于
Remove the MMC_DATA_STREAM flag because it isn't used anymore. Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
Now that clock delay settings for 8 bit DDR are correct, and vqmmc support is available, we can enable MMC_CAP_1_8V_DDR support. This enables MMC HS-DDR at up to 52 MHz, even if signal voltage switching is not available. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
Allwinner's MMC controller needs to run at double the card clock rate for 8 bit DDR transfer modes. Interestingly, this is not needed for 4 bit DDR transfers. Different clock delays are needed for 8 bit eMMC DDR, due to the increased module clock rate. For the A80 though, the same values for 4 bit and 8 bit are shared. The new values for the other SoCs were from A83T user manual's "new timing mode" default values, which describes them in clock phase, rather than delay periods. These values were used without any modification. They may not be correct, but they work. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
DDR transfer modes include UHS-1 DDR50 and MMC HS-DDR (or MMC_DDR52). Consider MMC_DDR52 when setting clock delays. Since MMC high speed mode goes up to 52 MHz instead of 50 MHz for SD, and this number is visible in the capability macro, increase the clock rate upper limit to 52 MHz. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
eMMC chips require 2 power supplies, vmmc for internal logic, and vqmmc for driving output buffers. vqmmc also controls signaling voltage. Most boards we've seen use the same regulator for both, nevertheless the 2 have different usages, and should be set separately. This patch adds support for vqmmc regulator supply, including voltage switching. The MMC core can use this to try different signaling voltages for eMMC. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
Let .set_ios() fail if mmc_regulator_set_ocr() fails to enable and set a proper voltage for vmmc. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
sunxi_mmc_init_host() originated from Allwinner kernel sources. The magic numbers written to various registers was never documented. Add comments for values found in Allwinner user manuals. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 26 10月, 2015 1 次提交
-
-
由 Hans de Goede 提交于
Some sdio wifi modules have not been working reliable with the sunxi-mmc host code. This turns out to be caused by starting new io-rw commands while the card signals that it is still busy processing a previous command. This commit adds card-busy detection to the sunxi-mmc driver which together with recent core changes to check card-busy before starting io-rw commands fixes the wifi reliability issues on the Cubietruck and other sunxi boards using sdio wifi. Reported-by: NEugene K <sigintmailru@gmail.com> Suggested-by: NEugene K <sigintmailru@gmail.com> Cc: Eugene K <sigintmailru@gmail.com> Cc: Arend van Spriel <arend@broadcom.com> Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 29 9月, 2015 1 次提交
-
-
由 Hans de Goede 提交于
In recent allwinner kernel sources the mmc clk-delay settings have been slightly tweaked, and for sun9i they are completely different then what we are using. This commit brings us in sync with what allwinner does, fixing problems accessing sdcards on some A33 devices (and likely others). For pre sun9i hardware this makes the following changes: -At 400Khz change the sample delay from 7 to 0 (introduced in A31 sdk) -At 50 Mhz change the sample delay from 5 to 4 (introduced in A23 sdk) This also drops the clk-delay calculation for clocks > 50 MHz, we do not need this as we've: mmc->f_max = 50000000, and the delays in the old code were not correct (at 100 MHz the delay must be a multiple of 60, at 200 MHz a multiple of 120). Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 27 8月, 2015 1 次提交
-
-
由 Michal Suchanek 提交于
The 250ms timeout is too short. On my system enabling the oclk takes under 50ms and disabling slightly over 100ms when idle. Under load disabling the clock can take over 350ms. This does not make mmc clock gating look like good option to have on sunxi but the system should not crash with mmc clock gating enabled nonetheless. This patch sets the timeout to 750ms. Signed-off-by: NMichal Suchanek <hramrach@gmail.com> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 23 3月, 2015 3 次提交
-
-
由 Hans de Goede 提交于
When the sunxi mmc-controller code was initially merged MMC_CAP_SDIO_IRQ was not added to the host caps because of issues with some sdio wifi modules. It turns out that these issues have nothing to do with using sdio-irq support, they also happen with oob interrupts. Since the hardware supports sdio-irq everywhere, and since the one reason to not claim the capability is gone, add MMC_CAP_SDIO_IRQ to the default host caps. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Arnd Bergmann 提交于
The sunxi mmc driver tries to calculate a dma address by using pointer arithmetic, which causes a warning when dma_addr_t is wider than a pointer: drivers/mmc/host/sunxi-mmc.c: In function 'sunxi_mmc_init_idma_des': drivers/mmc/host/sunxi-mmc.c:296:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] struct sunxi_idma_des *pdes_pa = (struct sunxi_idma_des *)host->sg_dma; ^ To avoid this warning and to simplify the logic, this changes the code to avoid the cast and calculate the correct address manually. The behavior should be unchanged. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NDavid Lanzendörfer <david.lanzendoerfer@o2s.ch> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
The reset control for the sunxi mmc controller is optional. Some newer platforms (sun6i, sun8i, sun9i) have it, while older ones (sun4i, sun5i, sun7i) don't. Use the properly stubbed _optional version so the driver does not fail to compile when RESET_CONTROLLER=n. This patch also adds a check for deferred probing on the reset control. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Cc: <stable@vger.kernel.org> # 3.16+ Acked-by: NDavid Lanzendörfer <david.lanzendoerfer@o2s.ch> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 19 1月, 2015 2 次提交
-
-
由 David Lanzendörfer 提交于
Removing a relict from reverse engineering of the Android driver code in sunxi_mmc_clk_set_rate. Signed-off-by: NDavid Lanzendörfer <david.lanzendoerfer@o2s.ch> Reported-by: <lixiang@allwinnertech.com> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 David Lanzendörfer 提交于
Fixing the register name in sunxi_mmc_reset_host since the SDXC_HARDWARE_RESET bit is actually located within REG_GCTRL and not REG_CMDR as it was pointed out by Allwinner. Signed-off-by: NDavid Lanzendörfer <david.lanzendoerfer@o2s.ch> Reported-by: <lixiang@allwinnertech.com> Acked-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-