Age | Commit message (Collapse) | Author | Files | Lines |
|
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: Maxime Ripard <[email protected]>
Tested-by: Florian Vaussard <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
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: Maxime Ripard <[email protected]>
Tested-by: Florian Vaussard <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Properly reverse everything if mmc_gpio_alloc(host) fails.
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
ida handling can be simplified by switching to the ida_simple_
functions.
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This removes CDC init sequence comments which are
not useful anyway.
Signed-off-by: Ritesh Harjani <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
platform_execute_tuning should not really exist as it does not
do anything useful.
So remove this ops and directly plug sdhci_msm_execute_tuning
with mmc_host_ops.
Also in case of HS400 tuning clear SDHCI_HS400_TUNING flag once
HS400 related mode selection is done.
Signed-off-by: Ritesh Harjani <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
When mmc_of_parse() finds the binding, it sets the mmc cap,
MMC_CAP_3_3V_DDR, which informs the core whether eMMC DDR at 3.3V I/O is
supported by the mmc host.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
|
|
Cc: <[email protected]>
Cc: Rob Herring <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
Acked-by: Rob Herring <[email protected]>
|
|
According the JEDEC specification an eMMC card supporting 1.8V vccq in DDR
mode should also be capable of 3.3V. However, it's been reported that some
mmc hosts supports 3.3V, but not 1.8V.
Currently the mmc core implements an error handling when the host fails to
set 1.8V for vccq, by falling back to 3.3V. Unfortunate, this seems to be
insufficient for some mmc hosts. To enable these to use eMMC DDR mode let's
invent a new mmc cap, MMC_CAP_3_3V_DDR, which tells whether they support
the eMMC 3.3V DDR mode.
In case MMC_CAP_3_3V_DDR is set, but not MMC_CAP_1_8V_DDR, let's change to
remain on the 3.3V, as it's the default voltage level for vccq, set by the
earlier power up sequence.
As this change introduces MMC_CAP_3_3V_DDR, let's take the opportunity to
do some re-formatting of the related defines in the header file.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
|
|
Earlier the mmc_set_signal_voltage() existed, but since it has been renamed
to mmc_set_uhs_voltage(), we can now use that name instead.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
|
|
The mmc_set_signal_voltage() function is used for SD/SDIO when switching to
1.8V for UHS mode. To clarify this let's do the following changes.
- We are always providing MMC_SIGNAL_VOLTAGE_180 as the signal_voltage
parameter to the function. Then, let's just remove the parameter as it
serves no purpose.
- Rename the function to mmc_set_uhs_voltage().
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
|
|
The mmc_set_signal_voltage() function is used for SD/SDIO when switching to
1.8V for UHS mode. Therefore let's remove the redundant code dealing with
MMC_SIGNAL_VOLTAGE_330.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Tested-by: Stefan Wahren <[email protected]>
|
|
In the case of a single clock source, you don't need names. However,
if the controller has 2 clock sources, you need to name them correctly
so the driver can find the 2nd one. The 2nd clock is for the internal
card detect logic.
Signed-off-by: Chris Brandt <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Acked-by: Rob Herring <[email protected]>
|
|
Some controllers have 2 clock sources instead of 1. The 2nd clock
is for the internal card detect logic and must be enabled/disabled
along with the main core clock for proper operation.
Signed-off-by: Chris Brandt <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
|
|
Cleanup some debug prints that cause needless noise
during normal usage.
Signed-off-by: Kevin Hilman <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The mmc_blk_issue_rq() function is called in exactly one place
in queue.c and there the return value is ignored. So the
functions called from that function that also meticulously
return 0/1 do so for no good reason.
Error reporting on the asynchronous requests are done upward to
the block layer when the requests are eventually completed or
fail, which may happen during the flow of the mmc_blk_issue_*
functions directly (for "special commands") or later, when an
asynchronous read/write request is completed.
The issuing functions do not give rise to errors on their own,
and there is nothing to return back to the caller in queue.c.
Drop all return values and make the function return void.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Recycling the same variable in an x=x+1 fashion may seem
clever here but it makes the code terse and hard to follow
for humans. Introduce a new_areq and old_areq variable so
we see what is going on.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Setting rqc to NULL followed by a goto to cmd_abort is just a way
to do unconditional abort without starting any new command.
Inline the calls to mmc_blk_rw_cmd_abort() and return immediately
in those cases.
Add some comments to the code flow so it is clear that this is
where the asynchronous requests come back in and the result of
them gets handled.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The code in mmc_blk_issue_rq_rq() aborts a command if the request
is not properly aligned on large sectors. As part of the path
jumping out, it assigns the local variable mq_rq reflecting
a MMC queue request to the current MMC queue request, which is
confusing since the variable is not used after this jump.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
As a step toward breaking apart the very complex function
mmc_blk_issue_rw_rq() we break out the code to start a new
request.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
As a first step toward breaking apart the very complex function
mmc_blk_issue_rw_rq() we break out the command abort code.
This code assumes "ret" is != 0 and then repeatedly hammers
blk_end_request() until the request to the block layer to end
the request succeeds.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Use the bitops API instead of shifting directly.
Signed-off-by: Jaehoon Chung <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Remove the sdhci-s3c-regs.h file.
Instead, it located those defined values into sdhci-s3c.c.
Signed-off-by: Jaehoon Chung <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Before enabling SDIO irqs, clear the status bit, so we discard old and
stale interrupts. Needed to get two wireless cards working. Use the
newly introduced macro in all places.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
QUIRK sounds like there is something wrong, but actually there are just
some bits which need to be 1. Rename it to be more clear.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
tmio_mmc_sdio_irq() is not used as a seperate irq handler anymore, so we
can make it similar to the other irq helper functions, namely:
* only give the host as argument function which is what it really needs
* prefix function name with __
Signed-off-by: Wolfram Sang <[email protected]>
Acked-by: Simon Horman <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Allow power sequencing for the Marvell SD8787 Wifi/BT chip.
This can be abstracted to other chipsets if needed in the future.
Cc: Tony Lindgren <[email protected]>
Cc: Ulf Hansson <[email protected]>
Signed-off-by: Matt Ranostay <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Signed-off-by: Matt Ranostay <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
Acked-by: Rob Herring <[email protected]>
|
|
Create a helper function to disable clocks and use it in remove(), too.
Now, clk_summary in debugfs reports the clocks as disabled and
unprepared after unbinding.
Signed-off-by: Wolfram Sang <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This provides enhanced_strobe mode feature support in sdhci-msm
driver.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
During tuning execution for HS400 mode, HW sequence recommends
to select MCLK_SEL/2(0x3) in VENDOR_SPEC & sdhc msm clock at GCC
to be 400MHZ (nearest supported clk). Add this change in tuning
sequence during HS400 tuning.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Clear SDHCI_HS400_TUNING flag after platform_execute_tuning
so that platform_execute_tuning may use it if needed.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Program CORE_CSR_CDC_DELAY_CFG for hardware recommended 1.25ns delay.
We may see data CRC errors if it's programmed for any other delay
value.
Signed-off-by: Subhash Jadavani <[email protected]>
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The vendor specific func register doesn't get reset when using the
software reset register. The various bootloader's could leave this
in an unknown state, hence reset this register to it's power on reset
value during probe.
Signed-off-by: Venkat Gopalakrishnan <[email protected]>
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Factor out sdhci_msm_hs400 used for DLL calibration in HS400
modes. This function will be needed for enhanced_strobe as well.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Factor out msm_set/get_clock_rate_for_bus_mode for it's later
use in changing the tuning sequence for selecting HS400
bus speed mode.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This factors out sdhci_msm_hc_select_mode to later use
it during enhanced_strobe mode select.
It also further breaks sdhci_msm_hc_select_mode
into separate functions for configuring HS400 mode
or other modes.
Signed-off-by: Ritesh Harjani <[email protected]>
Tested-by: Jeremy McNicoll <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This patch implements support for multiblock transfers bounded
by SET_BLOCK_COUNT (CMD23) on the MXS MMC host driver.
Signed-off-by: Stefan Wahren <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
host->dma_addr can store a value that is not returned by the DMA API,
so it is safer to check if is a valid DMA address indirectly.
Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
With commit 67bf5156edc4 ("gpio / ACPI: fix returned error from
acpi_dev_gpio_irq_get()"), mmc_gpiod_request_cd() returns -EPROBE_DEFER if
GPIO is not ready when sdhci-acpi driver is probed, and sdhci-acpi driver
should be probed again later in this case.
This fixes an order issue when both GPIO and sdhci-acpi drivers are built
as modules.
CC: [email protected] # v4.9
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=177101
Tested-by: Jonas Aaberg <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Using extern when declaring functions in the public header, core.h, is
redundant. Let's just remove the use of it.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
A significant amount of functions are available through the public mmc
host.h header file. Let's slim down this public mmc interface, as to
prevent users from abusing it, by moving some of the functions to private
mmc host.h header file.
This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
A significant amount of functions and other definitions are available
through the public mmc card.h header file. Let's slim down this public mmc
interface, as to prevent users from abusing it, by moving some of the
functions/definitions to private mmc header files.
This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
The mmc_card_present() function helps the mmc core to track an internal
state of the card device. More importantly, it's not intended to be used by
mmc host drivers to check for an inserted card. Therefore, let's stop using
it and instead rely on checking for a valid pointer to a struct mmc_card,
as it should be good enough.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
|
|
The mmc_card_present() function helps the mmc core to track an internal
state of the card device. More importantly, it's not intended to be used by
mmc host drivers to check for an inserted card. Therefore, let's stop using
it and instead rely on checking for a valid pointer to a struct mmc_card,
as it should be good enough.
Cc: [email protected]
Cc: Tony Lindgren <[email protected]>
Cc: Jarkko Nikula <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
|
|
The struct _mmc_csd isn't being used and has been lurking around for a
while. Let's kill it.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
As the public mmc.h header already contains similar defines for other mmc
commands and arguments, let's move those for erase/trim/discard into here
as well.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
Ideally the public mmc header file, core.h, shouldn't contain interfaces
particularly intended to be used by host drivers. Instead those should
remain in the host.h header file. Therefore, let's move a couple functions
from core.h to host.h.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
A significant amount of functions are available through the public mmc
core.h header file. Let's slim down this public mmc interface, as to
prevent users from abusing it, by moving some of the functions to private
mmc header files.
This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups, as an example
some functions can be turned into static.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|
|
This is the first step in cleaning up the private mmc header files. In this
change we makes sure each header file builds standalone, as that helps to
resolve dependencies.
While changing this, it also seems reasonable to stop including other
headers from inside a header itself which it don't depend upon.
Additionally, in some cases such dependencies are better resolved by
forward declaring the needed struct.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
|