- 02 5月, 2018 4 次提交
-
-
由 Maxime Ripard 提交于
In order to improve readibility and reusability, let's move the clock setup to a small function called by our .set_ios hook. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
In order to improve readibility and reusability, let's move the bus width setup to a small function called by our .set_ios hook. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
All the other functions in the driver take a struct sunxi_mmc_host pointer. Let's make it consistent. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
Our headers sort algorithm has had pretty chaotic results. Let's fix that. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 15 3月, 2018 3 次提交
-
-
由 Maxime Ripard 提交于
As soon as the pm_runtime_enable hook is called, our runtime_suspend and runtime_resume hooks can be called as well. However, we only set the device drvdata that we will use after we have registered into the MMC core. Move that earlier so that we don't have a race that could lead to a crash. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
As per Allwinner guidelines, the reset line should be deasserted before turning the clocks on. Implement it in our driver as well. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Maxime Ripard 提交于
We've had all our resources management, and especially the clocks and reset sequence, done directly as part of the probe. As we want to implement runtime_pm, we'll obviously want to have that moved outside of the probe so that we can call do it in our runtime suspend and resume hooks without too much duplication. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 15 12月, 2017 1 次提交
-
-
由 Arvind Yadav 提交于
platform_get_irq() can fail here and we must check its return value. Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 11 12月, 2017 1 次提交
-
-
由 Adam Borowski 提交于
It had an U+FFFD: not a corrupted character but a literal well-formed replacement marker. Signed-off-by: NAdam Borowski <kilobyte@angband.pl> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 30 10月, 2017 1 次提交
-
-
由 Wolfram Sang 提交于
This error message can go because a) currently nothing else than EPROBE_DEFER is returned and b) if this is going to change a much more detailed error message should come from mmc_regulator_get_supply() anyhow. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 30 8月, 2017 9 次提交
-
-
由 Maxime Ripard 提交于
We might be into some troubles if the bootloader misconfigured the MMC controller. We currently only de-assert the reset line at probe time, which means that if the device was already out of reset, we're going to keep whatever state was set already. Switch to a reset instead of the deassert to have a device in a pristine state when we start operating. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
sunxi_mmc_clk_set_phase expects the actual card clock rate to be passed to it. When the internal divider code was reworked in change ("mmc: sunxi: Support MMC DDR52 transfer mode with new timing mode"), this requirement was missed, and the module clock rate was passed in instead. This broke 8 bit DDR MMC on old controllers, as the module clock rate is double the card clock rate, for which we have no valid delay settings. Fix this by applying the internal divider to the clock rate right after we configure it in hardware. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Icenowy Zheng 提交于
The A83T MMC support code introduces the timings mode switch, however such a switch doesn't exist on new SoCs with only new timings mode. Only execute the switch if the SoC really have the timings mode switch, to fix the regression shown on new timings mode only SoCs (A64, H5, etc). Signed-off-by: NIcenowy Zheng <icenowy@aosc.io> Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
Some SoCs do not support clk delays for MMC in the clock control unit. These include the old controllers in A10/A10s/A13/R8, and the new eMMC controller in A64. The config structure for these controllers do not specify clk_delays, but the check for this was replaced in change "mmc: sunxi: Support controllers that can use both old and new timings". This patch adds back the check for clk_delays, and also adds comments for both checks in sunxi_mmc_clk_set_phase(). Signed-off-by: NChen-Yu Tsai <wens@csie.org> Tested-by: NIcenowy Zheng <icenowy@aosc.io> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Chen-Yu Tsai 提交于
The third MMC controller (MMC2) on the Allwinner A83T SoC is slightly different. It supports a wider 8-bit bus, has a dedicated controllable reset pin for eMMC, and a "new timing mode" which is supposed to deliver better signals and thus better performance. Add a compatible for this one to use the new timing mode not found in the other controllers. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 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>
-