16 Jan, 2015

40 commits

  • Add the generic PHY support, analogous to the USB PHY support. Intended it to be
    used with the PCI EHCI/OHCI drivers and the xHCI platform driver.

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit 0043325495222139daa0696db736f67658dc7770)

    Sergei Shtylyov
     
  • The USB PHY member of the HCD structure is renamed to 'usb_phy' and
    modifications are done in all drivers accessing it.
    This is in preparation to adding the generic PHY support.

    Signed-off-by: Antoine Tenart
    [Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects,
    updated changelog.]
    Signed-off-by: Sergei Shtylyov
    Acked-by: Alan Stern
    Acked-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit 3d46e73dfdb840f460e5b06416965d132570ec33)

    Conflicts:

    drivers/usb/core/hub.c
    drivers/usb/misc/lvstest.c

    Antoine Tenart
     
  • If devices don't provide latency data, this warning can be quite noisy until
    the pm domain was enabled and disabled a few times. Turn this warning into
    a debug message.

    Signed-off-by: Philipp Zabel
    Reviewed-by: Ulf Hansson
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit 7d1af287320b41909c070f68ffe1591060a32769)

    Philipp Zabel
     
  • Silex UART BT is using GPIO1_2 as the reset, which is in conflict with
    the one used by charging LEDS.

    Signed-off-by: Shenwei Wang

    Shenwei Wang
     
  • When running an userspace program that does a 'tcflush(fd, TCIOFLUSH)' call
    we still see the last received character in the URXD register afterwards.

    Clear UCR2_SRST bit so that the FIFO is flushed properly.

    Since UCR2_SRST also resets some UART registers, we need to save and restore
    some of them.

    Signed-off-by: Fabio Estevam

    Fabio Estevam
     
  • based on imx_3.14 kernel, add mcc pingpong and tty tests
    on imx6sx sdb and ai boards.

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • add mcc tests and tty api on imx_3.14.
    note:
    the device type of the tty device should be
    TTY_DRIVER_TYPE_CONSOLE, otherwise the TTY_DRIVER_TYPE_PTY.
    link layer stuffs are mandatory requried by
    TTY_DRIVER_TYPE_PTY type devices.

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • The platform related codes changes when enable mcc2.0
    on imx_3.14 kernel, and tested on imx6sx sdb board.
    - keep imx6sx soc related apis in mcc_imx6sx.c/h
    - keep linux os related apis in mcc_linux.c/h
    - add some new mcc callback in mu driver, since the
    gie3 of mu is used as cpu2cpu interrupter in the mcc
    implementation on imx6sx.

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • The platform related header changes when enable mcc2.0
    on imx_3.14 kernel, and tested on imx6sx sdb board.
    - keep imx6sx soc related apis in mcc_imx6sx.c/h
    - keep linux os related apis in mcc_linux.c/h
    - add some new mcc callback in mu driver, since the
    gie3 of mu is used as cpu2cpu interrupter in the mcc
    implementation on imx6sx.

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • set the dual bsd/gpl copyright of the mcc common codes
    implemented in linux bsp release.
    add 2015

    Signed-off-by: Richard Zhu
    (cherry picked from commit 2df3613c8a2635c55b4a4e7b98b74df49ff16299)

    Richard Zhu
     
  • set the dual bsd/gpl copyright of the mcc common codes
    implemented in linux bsp release.
    add 2015.

    Signed-off-by: Richard Zhu
    (cherry picked from commit d7f8c4eff50ba78b82484597bd301c4a87dfe082)

    Richard Zhu
     
  • Common codes changes in the mcc 2.0 updates
    - common definitions are moved from mcc_config.h to mcc_common.h
    because that these definitions are common for the standalone mcc
    stack, and shared by different platforms, such as Linux, MQX.
    - re-define the common api _psp_core_num(), and _psp_node_num().
    Let them to be no platform dependency.
    - move the definition of the MCC_OS_USED in mcc_config.h
    - new add on mcc_config_linux.h file, contained the platform
    related macro definitions contained in mcc_config.h before.
    - add the related linux modifications into mcc_api.c/mcc_common.c
    when implement the mcc2.0 into linux BSP.
    - fix one potential bug that all the share memory operations should
    be protected by sema4.

    Acked-by: Shawn Guo
    Signed-off-by: Richard Zhu
    (cherry picked from commit 541325a16b6db73a86a5a86049145b0060805c7c)

    Richard Zhu
     
  • This is the base line of the mcc version 2.0.

    Acked-by: Shawn Guo
    Signed-off-by: Richard Zhu
    (cherry picked from commit cfd44c266e3b8a833ac624b86be627efbda6aaa9)

    Richard Zhu
     
  • This patch is based on the patches by Per Forlin, Tony Lin and Ryan QIAN.

    This patch complete the API 'post_req' and 'pre_req' in sdhci host side,

    Test Env:
    1. i.MX6Q-SABREAUTO board, CPU @ 996MHz, use ADMA in uSDHC controller.
    2. Test command:
    $ echo 1 > /proc/sys/vm/drop_caches
    write to sd card:
    $ dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=2000 conv=fsync
    read the sd card:
    $ dd if=/dev/mmcblk0 of=/dev/null bs=1M count=2000

    3. TOSHIBA 16GB SD3.0 card, running at 4 bit, SDR104 @ 198MHZ
    Performance with and without this patch:
    -------------------------------------------------
    | | read speed | write speed |
    |------------------------------------------------
    | with this patch | ~76.7 MB/s | ~23.3 MB/s |
    |------------------------------------------------
    |without this patch | ~60.5 MB/s | ~22.5 MB/s |
    -------------------------------------------------

    4. SanDisk 8GB SD3.0 card, running at 4 bit, DDR50 @ 50MHZ
    Performance with and without this patch:
    -------------------------------------------------
    | | read speed | write speed |
    |------------------------------------------------
    | with this patch | ~40.5 MB/s | ~15.6 MB/s |
    |------------------------------------------------
    |without this patch | ~36.1 MB/s | ~14.1 MB/s |
    -------------------------------------------------

    5. Kingston 8GB SD2.0 card, running at 4 bit, High-speed @ 50MHZ
    Performance with and without this patch:
    -------------------------------------------------
    | | read speed | write speed |
    |------------------------------------------------
    | with this patch | ~22.7 MB/s | ~8.2 MB/s |
    |------------------------------------------------
    |without this patch | ~21.3 MB/s | ~8.0 MB/s |
    -------------------------------------------------

    6. About eMMC, Sandisk 8GB eMMC on i.MX6DL-sabresd board, CPU @ 792MHZ,
    eMMC running at 8 bit, DDR52 @ 52MHZ.
    Performance with and without this patch:
    -------------------------------------------------
    | | read speed | write speed |
    |------------------------------------------------
    | with this patch | ~37.3 MB/s | ~10.5 MB/s |
    |------------------------------------------------
    |without this patch | ~33.4 MB/s | ~10.5 MB/s |
    -------------------------------------------------

    Signed-off-by: Haibo Chen
    Signed-off-by: Ulf Hansson
    (cherry picked from commit a0a60bf36806be9528d4011563e9367bddeff762)

    Haibo Chen
     
  • Current ecspi rom script didn't take care of rxfifo overflow risk. Add new
    ecspi tx script to check the rxfifo status, if it is near to full(>=48 bytes),
    do not copy data to txfifo which will trigger data push into rxfifo. Because
    rx script may not read rxfifo in time, we have to consider it.

    Signed-off-by: Robin Gong
    (cherry picked from commit 17f472aa698aba0af5da4566df447e23306f4289)
    (cherry picked from commit 90c929d7d1a3f8e196641b5ed7a33d2ee03bd63c)

    Robin Gong
     
  • We can only use page_address on memory that has been mapped using kmap,
    when the buffer passed to the SPI has been allocated by vmalloc the page
    has not necessarily been mapped through kmap. This means sometimes
    page_address will return NULL causing the pointer we pass to sg_set_buf
    to be invalid.

    As we only call page_address so that we can pass a virtual address to
    sg_set_buf which will then immediately call virt_to_page on it, fix this
    by calling sg_set_page directly rather then relying on the sg_set_buf
    helper.

    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    (cherry picked from commit c1aefbdd050e1fb15e92bcaf34d95b17ea952097)

    Charles Keepax
     
  • We set both wartermark of txfifo and rxfifo 32 as half of fifo length 64.
    That will cause easy rxfifo overflow:
    If there is 31 bytes in rxfifo, rx script will wait the next dma request
    (the 32th data come into the rxfifo) and schedule out to tx script. Once
    tx script start to run, the rx script need to wait tx script finish even
    if its priority higher than tx. Meanwhile, spi slave device may input
    data continous, plus the rx data which triggered by new tx script(32 bytes).
    That will quickly consume whole 64 bytes fifo, so we keep 16bytes availbale
    even in the worst case new tx script triggered during two rx transfer. That
    may slow down tx slightly, but better than overflow and RX DMA timeout.

    Signed-off-by: Robin Gong
    (cherry picked from commit 16043ad0ad96aa04a90614e473aa17980af4b8af)
    (cherry picked from commit 819efee83b7b1f47685dca6fad6bbe17f1c42092)

    Robin Gong
     
  • Add new ecspi tx sdma script in the head file.

    Signed-off-by: Robin Gong
    (cherry picked from commit 9ca3cf4f301dc6d4130624814e689b676125fd36)
    (cherry picked from commit 4241bfb6920410de9a05c420e6abd9c98b6bf388)

    Robin Gong
     
  • Sometimes the tail data can't trigger SDMA to read from rxfifo, or
    SDMA miss the last dma request, in this case, DMA report RX timeout
    and the rest tail data kept in rxfifo. Whatever, use pio read for the
    tail rx data.

    Signed-off-by: Robin Gong
    (cherry picked from commit 61fec9e4511e7626a2c5299f37c12cca95d12e88)
    (cherry picked from commit c7ecc24637babcb76edf20600f0535ab118e0101)

    Robin Gong
     
  • Change dma timeout value with the transfer length if the length bigger than
    1 MB.

    Signed-off-by: Robin Gong
    (cherry picked from commit fb12a91a9ce6cd99d4c08483627ea0c94363ee08)
    (cherry picked from commit d0fa9b74641285ef62bad2e8e39ee13467549967)

    Robin Gong
     
  • There is one BUG(TKT238285) in ecspi module in DMA mode,but
    it only found on i.mx6dl now, so enable dma support on all
    i.mx6 chips except i.mx6dl

    Signed-off-by: Robin Gong
    (cherry picked from commit fa9ef1796819aadbb1ea184613d4fdd3de1b46c6)

    Robin Gong
     
  • Enable DMA support on i.mx6. The read speed can increase from 600KB/s
    to 1.2MB/s on i.mx6q. You can disable or enable dma function in dts.
    If not set "dma-names" in dts, spi will use PIO mode. This patch only
    validate on i.mx6, not i.mx5, but encourage ones to apply this patch
    on i.mx5 since they share the same IP.

    Note:
    Sometime, there is a weid data in rxfifo after one full tx/rx
    transfer finish by DMA on i.mx6dl, so we disable dma functhion on
    i.mx6dl.

    Signed-off-by: Frank Li
    Signed-off-by: Robin Gong
    Acked-by: Marek Vasut
    Signed-off-by: Mark Brown
    (cherry picked from commit f62caccd12c17e4cb516d43a6e4dd8a3abc1f7e0)
    (cherry picked from commit b87c98a8944c76840ed1375ed4792ef608de5c01)

    Robin Gong
     
  • Signed-off-by: Alexander Shiyan
    Signed-off-by: Mark Brown
    (cherry picked from commit 8fc39b516623f3beed18be701d2acfe0e50b8d86)
    (cherry picked from commit fac24d90c8b851179d46aee6f9229f4665c14395)

    Alexander Shiyan
     
  • No need to return a 'fake' return value on platform_get_irq() failure.

    Just return the error code itself instead.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Mark Brown
    (cherry picked from commit 82106e0e39c455957888dd44d43790306b30f73e)
    (cherry picked from commit a4c564cb1206158a91678af2029dac7a3fbeb945)

    Fabio Estevam
     
  • Calling init_completion() once is enough.
    For the rest of the iterations, call reinit_completion() instead.

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown
    (cherry picked from commit aa0fe82629f19efba5c870bc9be089a4f8056a75)
    (cherry picked from commit fd20fe148977afbdda2f3d90eb6226b436ab9e09)

    Axel Lin
     
  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Mark Brown
    (cherry picked from commit 3a44623d5e1404b29786f1afd225d1aa04a4ae90)
    (cherry picked from commit 324b6d43b9199eca4723c161be8b842397b58a9c)

    Paul Gortmaker
     
  • According to Documentation/dmaengine.txt, scatterlists must be mapped
    using the DMA struct device.

    However, "dma_chan.dev->device" is the sysfs class device's device.
    Use "dma_chan.device->dev" instead, which is the real DMA device's device.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown
    (cherry picked from commit 3fc25421f55e36426f5e5cc227cacc840493a943)
    (cherry picked from commit ff593afabbe51959293cf8434bbe72a3db24dda5)

    Geert Uytterhoeven
     
  • According to Documentation/DMA-API.txt, dma_map_sg() returns 0 on failure.
    As spi_map_buf() returns an error code, convert zero into -ENOMEM.
    Keep the existing check for negative numbers just in case.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown
    (cherry picked from commit 89e4b66a2e34744615c79349aa936df1b4204faf)
    (cherry picked from commit d176f970196ecc2c0f0c30116061fdeba3461556)

    Geert Uytterhoeven
     
  • Reported-by: kbuild test robot
    Signed-off-by: Mark Brown
    (cherry picked from commit 840e9c354f3492259a65ae235351cde1089a409e)
    (cherry picked from commit df473b0daee67eae1ebc1b76c1f5c3a1358ac7c6)

    Mark Brown
     
  • Let memory subsystem handle the error logging.

    Signed-off-by: Sachin Kamat
    Reviewed-by: Naveen Krishna Chatradhi
    Signed-off-by: Mark Brown
    (cherry picked from commit 8331acb3a5515c01a1b73424a56f44c50ad7f1b4)
    (cherry picked from commit 6cd6a0353c0f8e294f1372d436faba5d229a3aa0)

    Sachin Kamat
     
  • Rejecting unsupported values of spi-tx-bus-width and spi-rx-bus-width
    may break compatibility with future DTs. Just ignore them, falling back
    to Single SPI Transfers.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown
    (cherry picked from commit 80874d8c9e9cbfa195572dfea46f2314098b3869)
    (cherry picked from commit 391db8d1218fa531d6769dc69c89af48b0c4b60d)

    Geert Uytterhoeven
     
  • If we fail to create the master queue for some reason we should not attempt
    to clean it up since attempting to stop a kthread that was not created will
    hang and it's just generally bad practice. Unfortunately at present we call
    spi_destroy_queue() even in cases where the creation fails.

    Fix this by fixing the error handling in spi_master_initialize_queue() so
    that we only flag the master as queued or destroy the queue if creation
    succeeded. The change to the flag is done since the general master
    cleanup uses this to destroy the queue.

    Reported-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown
    Acked-by: Geert Uytterhoeven
    (cherry picked from commit c3676d5ceff213cba35af5ee5f320d2e8dc48cdf)
    (cherry picked from commit 849521899b7906b6c4e2894b82a730d08e9bbbe8)

    Mark Brown
     
  • If NO_DMA=y:

    drivers/built-in.o: In function `spi_map_buf':
    spi.c:(.text+0x21bc60): undefined reference to `dma_map_sg'
    drivers/built-in.o: In function `spi_unmap_buf.isra.33':
    spi.c:(.text+0x21c32e): undefined reference to `dma_unmap_sg'
    make[3]: *** [vmlinux] Error 1

    Protect the DMA code by #ifdef CONFIG_HAS_DMA to fix this:
    - Extract __spi_map_msg() from spi_map_msg(),
    - Provide dummy definitions of __spi_map_msg() and spi_unmap_msg() if
    !CONFIG_HAS_DMA.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown
    (cherry picked from commit 2de440f59ca9615c92820d165d5e59756e54026b)
    (cherry picked from commit 61d339b48df0672b2f1a7ac4edaf5013d0f445cc)

    Geert Uytterhoeven
     
  • add optional property devicetree for SPI slave nodes
    into devicetree so that LSB mode can be enabled by devicetree.

    Signed-off-by: Zhao Qiang
    Signed-off-by: Mark Brown
    (cherry picked from commit cd6339e6ced387ad67b5551dd2931cfd7e8b970b)
    (cherry picked from commit 09623c20b3e6b11a914343d4b0f15b63e683f0d8)

    Zhao Qiang
     
  • The existing timeout value in wait_for_completion_timeout is
    calculated from the transfer length and speed with tolerance of 10msec.
    This is too low because this is used for error conditions such as
    hardware hang etc.
    The xfer->speed_hz considered may not be the actual speed set
    because the best clock divisor is chosen from a limited set such that
    the actual speed
    Signed-off-by: Mark Brown
    (cherry picked from commit eee668a92bc775030178c8a7f0d0abe9cce441d7)
    (cherry picked from commit e123573ecd0b16f52998e731a0659fdc89d841e4)

    Harini Katakam
     
  • The core implementation of cs_change didn't follow the documentation
    which says that cs_change in the middle of the transfer means to briefly
    deassert chip select, instead it followed buggy drivers which change the
    polarity of chip select. Use a delay of 10us between deassert and
    reassert simply from pulling numbers out of a hat.

    Reported-by: Gerhard Sittig
    Signed-off-by: Mark Brown
    (cherry picked from commit 0b73aa63c193006c3d503d4903dd4792a26e1d50)
    (cherry picked from commit f5ec8bd357c3f3fddb46a9bf17293cc6f77d2563)

    Mark Brown
     
  • There is no real reason why we require transfers to have a completion and
    the only user of the completion now checks to see if one has been provided
    before using it so stop enforcing this. This makes it more convenient for
    drivers to chain multiple asynchronous transfers together.

    Signed-off-by: Mark Brown
    (cherry picked from commit 1e25cd4729bd76662d02b142a6a7f8504bb6aea7)
    (cherry picked from commit 3d780e874e52daf0a976460a62f520cb438b6743)

    Mark Brown
     
  • When xfer->speed_hz is greater than master->max_speed_hz, it's generally safe
    to use master->max_speed_hz as transfer speed.
    Thus use master->max_speed_hz as transfer speed rather than return error when
    xfer->speed_hz > master->max_speed_hz.

    Signed-off-by: Axel Lin
    Tested-by: Guenter Roeck
    Reviewed-by: Guenter Roeck
    Signed-off-by: Mark Brown
    (cherry picked from commit a6f87fad7b5132f026592729ccf65b995cdec35d)
    (cherry picked from commit fe70982ad2c56031804d56ca8ed5e4f884c50c5b)

    Axel Lin
     
  • Zero length transfer becomes invalid since
    "spi: core: Validate length of the transfers in message" commit,
    but it should be valid to support an odd device, for example, which
    requires long delay between chipselect and the first transfer, etc.

    Signed-off-by: Atsushi Nemoto
    Tested-by: Thierry Reding
    Signed-off-by: Mark Brown
    (cherry picked from commit 6ea312936d68b557766dafa9a3c4617e14ffa076)
    (cherry picked from commit 2e6324d5d3d41454776a6be0b369c758448242ea)

    Atsushi Nemoto
     
  • Fixes below checkpatch warning:
    WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
    + msleep(10);

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown
    (cherry picked from commit f97b26b05b1dcd307b2f79d1f9e9d99551987dbb)
    (cherry picked from commit 658bc13e4a2d204479ee1978f32eb0e8f06ef643)

    Axel Lin