28 Feb, 2013
2 commits
-
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Chris Ball
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
For better code reuse use the newly added page iterator to iterate
through the pages. The offset, length within the page is still
calculated by the mapping iterator as well as the actual mapping. Idea
from Tejun Heo.Signed-off-by: Imre Deak
Cc: Maxim Levitsky
Cc: Tejun Heo
Cc: Daniel Vetter
Cc: James Hogan
Cc: Stephen Warren
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
27 Feb, 2013
1 commit
-
Pull MMC update from Chris Ball:
"MMC highlights for 3.9:Core:
- Support for packed commands in eMMC 4.5. (This requires a host
capability to be turned on. It increases write throughput by 20%+,
but may also increase average write latency; more testing needed.)
- Add DT bindings for capability flags.
- Add mmc_of_parse() for shared DT parsing between drivers.Drivers:
- android-goldfish: New MMC driver for the Android Goldfish emulator.
- mvsdio: Add DT bindings, pinctrl, use slot-gpio for card detection.
- omap_hsmmc: Fix boot hangs with RPMB partitions.
- sdhci-bcm2835: New driver for controller used by Raspberry Pi.
- sdhci-esdhc-imx: Add 8-bit data, auto CMD23 support, use slot-gpio.
- sh_mmcif: Add support for eMMC DDR, bundled MMCIF IRQs.
- tmio_mmc: Add DT bindings, support for vccq regulator"* tag 'mmc-updates-for-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (92 commits)
mmc: tegra: assume CONFIG_OF, remove platform data
mmc: add DT bindings for more MMC capability flags
mmc: tmio: add support for the VccQ regulator
mmc: tmio: remove unused and deprecated symbols
mmc: sh_mobile_sdhi: use managed resource allocations
mmc: sh_mobile_sdhi: remove unused .pdata field
mmc: tmio-mmc: parse device-tree bindings
mmc: tmio-mmc: define device-tree bindings
mmc: sh_mmcif: use mmc_of_parse() to parse standard MMC DT bindings
mmc: (cosmetic) remove "extern" from function declarations
mmc: provide a standard MMC device-tree binding parser centrally
mmc: detailed definition of CD and WP MMC line polarities in DT
mmc: sdhi, tmio: only check flags in tmio-mmc driver proper
mmc: sdhci: Fix parameter of sdhci_do_start_signal_voltage_switch()
mmc: sdhci: check voltage range only on regulators aware of voltage value
mmc: bcm2835: set SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
mmc: support packed write command for eMMC4.5 devices
mmc: add packed command feature of eMMC4.5
mmc: rtsx: remove driving adjustment
mmc: use regulator_can_change_voltage() instead of regulator_count_voltages
...
25 Feb, 2013
37 commits
-
Pull MFS updates from Samuel Ortiz:
"This is the MFD pull request for the 3.9 merge window.No new drivers this time, but a bunch of fairly big cleanups:
- Roger Quadros worked on a OMAP USBHS and TLL platform data
consolidation, OMAP5 support and clock management code cleanup.- The first step of a major sync for the ab8500 driver from Lee
Jones. In particular, the debugfs and the sysct interfaces got
extended and improved.- Peter Ujfalusi sent a nice patchset for cleaning and fixing the
twl-core driver, with a much needed module id lookup code
improvement.- The regular wm5102 and arizona cleanups and fixes from Mark Brown.
- Laxman Dewangan extended the palmas APIs in order to implement the
palmas GPIO and rt drivers.- Laxman also added DT support for the tps65090 driver.
- The Intel SCH and ICH drivers got a couple fixes from Aaron Sierra
and Darren Hart.- Linus Walleij patchset for the ab8500 driver allowed ab8500 and
ab9540 based devices to switch to the new abx500 pin-ctrl driver.- The max8925 now has device tree and irqdomain support thanks to
Qing Xu.- The recently added rtsx driver got a few cleanups and fixes for a
better card detection code path and now also supports the RTS5227
chipset, thanks to Wei Wang and Roger Tseng."* tag 'mfd-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (109 commits)
mfd: lpc_ich: Use devres API to allocate private data
mfd: lpc_ich: Add Device IDs for Intel Wellsburg PCH
mfd: lpc_sch: Accomodate partial population of the MFD devices
mfd: da9052-i2c: Staticize da9052_i2c_fix()
mfd: syscon: Fix sparse warning
mfd: twl-core: Fix kernel panic on boot
mfd: rtsx: Fix issue that booting OS with SD card inserted
mfd: ab8500: Fix compile error
mfd: Add missing GENERIC_HARDIRQS dependecies
Documentation: Add docs for max8925 dt
mfd: max8925: Add dts
mfd: max8925: Support dt for backlight
mfd: max8925: Fix onkey driver irq base
mfd: max8925: Fix mfd device register failure
mfd: max8925: Add irqdomain for dt
mfd: vexpress: Allow vexpress-sysreg to self-initialise
mfd: rtsx: Support RTS5227
mfd: rtsx: Implement driving adjustment to device-dependent callbacks
mfd: vexpress: Add pseudo-GPIO based LEDs
mfd: ab8500: Rename ab8500 to abx500 for hwmon driver
... -
Tegra only supports, and always enables, device tree. Remove all ifdefs
and runtime checks for DT support from the driver. Platform data is
therefore no longer required. Rework the driver to parse the device tree
directly into struct sdhci_tegra.Signed-off-by: Stephen Warren
Signed-off-by: Chris Ball -
Many MMC capability flags are platform-dependent and are traditionally set
in platform data. With DT often each such capability requires a special
binding. Add bindings for MMC_CAP_SD_HIGHSPEED, MMC_CAP_MMC_HIGHSPEED,
MMC_CAP_POWER_OFF_CARD and MMC_CAP_SDIO_IRQ capabilities. Also add code to
DT parser to look up "keep-power-in-suspend" and "enable-sdio-wakeup"
bindings and set MMC_PM_KEEP_POWER and MMC_PM_WAKE_SDIO_IRQ respectively,
if found.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
Some SD/MMC interfaces use 2 power regulators: one to power the card itself
(Vcc) and another one to pull signal lines up (VccQ). In case of eMMC and
UHS SD cards the regulators also have to be configured to supply different
voltages. The preferred order of turning supply power on and off is to
turn Vcc first on and last off.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
Use managed allocations to get memory, clock and interrupts . This
significantly simplifies clean up paths.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
The struct sh_mobile_sdhi_info::pdata field was only used for platform-
based card detection and isn't used anymore since the migration to GPIO-
based MMC slot functions. Remove it.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
Add parsing of common and driver-specific DT bindings to the tmio-mmc
MMC host driver and the sh_mobile_sdhi interface layer.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
Use mmc_of_parse() to get interface capability flags and used GPIOs from
device-tree bindings.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
MMC defines a number of standard DT bindings. Having each driver parse
them individually adds code redundancy and is error prone. Provide a
standard function to unify the parsing. After all drivers are converted
to using it instead of their own parsers, this function can be integrated
into mmc_alloc_host().Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
tmio-mmc platform flags can be set by various means, including caller
drivers and device-tree bindings, therefore it is better to only check
them in the tmio-mmc driver proper, not in caller drivers themselves.Signed-off-by: Guennadi Liakhovetski
Signed-off-by: Chris Ball -
3714f4315354 ("mmc: sdhci: update signal voltage switch code") changed the
type of the second parameter of sdhci_do_start_signal_voltage_switch(),
from "struct mmc_ios *ios" to "int signal_voltage" which causes the
following build warning:drivers/mmc/host/sdhci.c:2044:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/mmc/host/sdhci.c:2044:2: warning: (near initialization for 'sdhci_ops.start_signal_voltage_switch') [enabled by default]Use the previous type so that it matches the start_signal_voltage_switch()
definition from host.h.Signed-off-by: Fabio Estevam
Reviewed-by: Johan Rudholm
Signed-off-by: Chris Ball -
Some regulators don't report any voltage values, so checking supported
voltage range results in disabling all SDHCI_CAN_VDD_* flags and
registration failure. This patch finally provides a correct fix for the
registration of SDHCI driver with all possible voltage regulators:
dummy, fixed and regulated without using regulator_count_voltages()
hacks.Signed-off-by: Marek Szyprowski
Signed-off-by: Chris Ball -
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK does basically the same as
implementing struct sdhci_ops .get_timeout_clock, so simply set that
quirk and remove the custom code to simplify the driver.Reported-by: Lars-Peter Clausen
Signed-off-by: Stephen Warren
Signed-off-by: Chris Ball -
This patch supports packed write command of eMMC4.5 devices. Several
writes can be grouped in packed command and all data of the individual
commands can be sent in a single transfer on the bus. Large amounts of
data in one transfer rather than several data of small size are
effective for eMMC write internally. As a result, packed command help
write throughput be improved. The following tables show the results
of packed write.Type A:
test none | packed
iozone 25.8 | 31
tiotest 27.6 | 31.2
lmdd 31.2 | 35.4Type B:
test none | packed
iozone 44.1 | 51.1
tiotest 47.9 | 52.5
lmdd 51.6 | 59.2Type C:
test none | packed
iozone 19.5 | 32
tiotest 19.9 | 34.5
lmdd 22.8 | 40.7Signed-off-by: Seungwon Jeon
Reviewed-by: Maya Erez
Reviewed-by: Namjae Jeon
Signed-off-by: Chris Ball -
This patch adds packed command feature of eMMC4.5. The maximum number
for packing read (or write) is offered and exception event relevant to
packed command which is used for error handling is enabled. If host
wants to use this feature, MMC_CAP2_PACKED_CMD should be set.Signed-off-by: Seungwon Jeon
Reviewed-by: Maya Erez
Reviewed-by: Subhash Jadavani
Reviewed-by: Namjae Jeon
Signed-off-by: Chris Ball -
Several new models of readers use different way to select driving
capability (a necessary adjustment along with voltage change). Removing
this from device-independent rtsx_pci_sdmmc module. It will be implemented
in device-depend calls encapsulated by rtsx_pci_switch_output_voltage().Signed-off-by: Roger Tseng
Reviewed-by: Wei WANG
Signed-off-by: Chris Ball -
mmc_regulator_set_ocr() depends on the ability of regulator to change the
voltage value. When regulator cannot change its voltage output, some code
is skipped to avoid reporting false errors on some boards, which use MMC
hosts with fixed regulators (e.g. Samsung Goni and UniversalC210 boards).This patch replaces a hacky workaround based on regulator_count_voltages()
value with the correct call to recently introduced
regulator_can_change_voltage() function in regulators core.Signed-off-by: Marek Szyprowski
Signed-off-by: Chris Ball -
Signed-off-by: Kevin Liu
Signed-off-by: Jialing Fu
Signed-off-by: Chris Ball -
This patch fixes incorrect indentation. (Just code cleanup)
Signed-off-by: Jaehoon Chung
Signed-off-by: Chris Ball -
It's not necessary to start a new request while error handling if
the card was removed.Signed-off-by: Seungwon Jeon
Acked-by: Jaehoon Chung
Tested-by: Konstantin Dorfman
Signed-off-by: Chris Ball -
This patch is derived from:
"mmc: fix async request mechanism for sequential read scenarios".According as async transfer, a request is handled with twice mmc_start_req.
When the card is removed, the request is actually not issued in the first
mmc_start_req [__mmc_start_data_req]. And then mmc_wait_for_data_req_done
will come in the next mmc_start_req. But there is no event for completions.
wake_up_interruptible is needed in __mmc_start_data_req for the case of
removed card.Signed-off-by: Seungwon Jeon
Acked-by: Jaehoon Chung
Tested-by: Konstantin Dorfman
Signed-off-by: Chris Ball -
4d55c5a1 ("mmc: sdhci: enable preset value after uhs initialization")
added preset value support and enabled it by default during sd card init.Below are the enhancements introduced by this patch:
1. In current code, preset value is enabled after setting clock finished,
which means the clock is manually set by driver firstly and then suddenly
switched to preset value at this point. So the first setting is useless
and unnecessary. What's more, the first clock setting may differ from the
preset one. The better way is enable preset value just after switch to
UHS mode so the preset value can take effect immediately. So move preset
value enable from mmc_sd_init_card to sdhci_set_ios which will be called
during set timing.2. In current code, preset value is disabled at the beginning of
mmc_attach_sd. It's too late since low freq (400khz) should be set in
mmc_power_up. So move preset value disable to sdhci_set_ios which will
be called during power up.3. host->clock and ios->drv_type should also be updated according to the
preset value if it's enabled. Current code missed this.4. This patch also introduce a quirk to disable preset value in case
preset value doesn't work.This patch has been verified on sdhci-pxav3 platform with both preset
enabled and disabled.Signed-off-by: Kevin Liu
Reviewed-by: Ulf Hansson
Signed-off-by: Chris Ball -
When irq_of_parse_and_map() returns an error, it does as zero. But in
mmc_spi_get_pdata(), the error return case is compared against NO_IRQ.
This might work where NO_IRQ is zero (defaults to zero when undefined,
as on MIPS) but not where NO_IRQ is different, e.g. on ARM where it's -1.This patch changes to comparison with 0 which is the error return value
of irq_of_parse_and_map().Tested on ARM that mmc_spi is working now.
Signed-off-by: Roland Stigge
Signed-off-by: Chris Ball -
Quite a few drivers have a implementation of the get_timeout_clock
callback which simply returns the result of clk_get_rate on the device's
clock. This patch adds a common implementation of this to the sdhci-pltfm
module and replaces all custom implementations with the common one.Signed-off-by: Lars-Peter Clausen
Tested-by: Stephen Warren
Acked-by: Shawn Guo
Tested-by: Kevin Liu
Signed-off-by: Chris Ball -
The protocol related code is moved to core stack. So update the host
driver accordingly.Signed-off-by: Kevin Liu
Tested-by: Tim Wang
Signed-off-by: Chris Ball -
When switching SD and SDIO cards from 3.3V to 1.8V signal levels, the
clock should be gated for 5 ms during the step. After enabling the
clock, the host should wait for at least 1 ms before checking for
failure. Failure by the card to switch is indicated by dat[0:3] being
pulled low. The host should check for this condition and power-cycle
the card if failure is indicated.Add a retry mechanism for the SDIO case.
If the voltage switch fails repeatedly, give up and continue the
initialization using the original voltage.This patch places a couple of requirements on the host driver:
1) mmc_set_ios with ios.clock = 0 must gate the clock
2) mmc_power_off must actually cut the power to the card
3) The card_busy host_ops member must be implementedif these requirements are not fulfilled, the 1.8V signal voltage switch
will still be attempted but may not be successful.Signed-off-by: Johan Rudholm
Signed-off-by: Kevin Liu
Acked-by: Ulf Hansson
Tested-by: Wei WANG
Signed-off-by: Chris Ball -
Allow callers to access the start_signal_voltage_switch host_ops
member without going through any cmd11 logic. This is mostly a
preparation for the following signal voltage switch patch.Also, reset ios.signal_voltage to its original value if
start_signal_voltage_switch fails.Signed-off-by: Johan Rudholm
Acked-by: Ulf Hansson
Tested-by: Wei WANG
Signed-off-by: Chris Ball -
Add mmc_power_cycle which can be used to power cycle for instance
SD-cards.Signed-off-by: Johan Rudholm
Acked-by: Ulf Hansson
Tested-by: Wei WANG
Signed-off-by: Chris Ball -
Signed-off-by: Johan Rudholm
Acked-by: Ulf Hansson
Signed-off-by: Chris Ball -
SET_BLOCK_COUNT CMD23 is needed for all access to RPMB partition. If
block count is not set by CMD23, all subsequent read/write commands fail
as per eMMC specification. So, If the host does not support CMD23, do not
expose RPMB partition.Accessing RPMB partition can cause hang / huge delay for hosts which do
not support CMD23.Signed-off-by: Balaji T K
Reported-and-Tested-by: Peter Ujfalusi
Cc: stable
Signed-off-by: Chris Ball -
This driver handles the virtual MMC device present in the Goldfish emulator.
The patch folds together initial work from Mike Lockwood and patches by
San Mehat, Jun Nakajima and Tom Keel plus cleanups
by Alan Cox to get it all into 3.6 shape.Signed-off-by: Mike A. Chan
[cleaned up and x86 support added]
Signed-off-by: Sheng Yang
Signed-off-by: Yunhong Jiang
Signed-off-by: Xiaohui Xin
Signed-off-by: Jun Nakajima
Signed-off-by: Bruce Beare
[Moved to 3.4]
Signed-off-by: Tom Keel
[Moved to 3.7]
Signed-off-by: Alan Cox
Signed-off-by: Chris Ball -
The i.MX esdhc has a nonstandard bit layout for the SDHCI_HOST_CONTROL
register. To support 8bit bus width on i.MX populate the platform_bus_width
callback. This is tested on an i.MX25, but should according to the datasheets
work on the other i.MX using this hardware aswell. The i.MX6, while having
a SDHCI_SPEC_300 controller, still uses the same nonstandard register layout.Signed-off-by: Sascha Hauer
Signed-off-by: Shawn Guo
Tested-by: Dirk Behme
Signed-off-by: Chris Ball -
The 8bit in the function name is misleading. When set, it will be
used to set the bus width, regardless of whether 8bit or another
bus width is requested, so change the function name to
platform_bus_width.Signed-off-by: Sascha Hauer
Signed-off-by: Shawn Guo
Tested-by: Dirk Behme
Signed-off-by: Chris Ball -
SDHCI core will try to use Auto CMD23 for mmc card. Currently, we will
see the following message with mmc card on usdhc due to the lacking of
Auto CMD23 support in the driver.$ mmc0: new high speed MMC card at address 0001
mmcblk1: mmc0:0001 MMC02G 1.87 GiB
mmcblk1: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00
mmcblk1: retrying using single block read
mmcblk1:Enable Auto CMD23 support for usdhc so that mmc card can work in
multiple block mode.Signed-off-by: Shawn Guo
Tested-by: Dirk Behme
Signed-off-by: Chris Ball -
It's another violation to SDHC spec that software reset on usdhc
does not reset MIX_CTRL register. Have to do it manually, otherwise
the preserving of the register bits (e.g. AC23EN) may cause mmc card
fail to be initialized.Signed-off-by: Shawn Guo
Tested-by: Dirk Behme
Signed-off-by: Chris Ball -
The combining of SDHCI_TRANSFER_MODE and SDHCI_COMMAND writes is only
required for esdhc, but not necessarily for usdhc. Different from
esdhc where the bits for transfer mode and command are all in the same
register CMD_XFR_TYP, usdhc has a newly introduced register MIX_CTRL
to hold transfer mode bits. So it makes more sense to separate transfer
mode from command write for usdhc.Signed-off-by: Shawn Guo
Tested-by: Dirk Behme
Signed-off-by: Chris Ball -
Cache control is an eMMC feature and in therefore should be
part of MMC's bus resume operations, performed in mmc_suspend,
rather than in the generic mmc_suspend_host().Signed-off-by: Maya Erez
Acked-by: Ulf Hansson
Signed-off-by: Chris Ball