11 Feb, 2015

11 commits

  • Some PHY of imx usb need power supply from vbus to make it work, if there
    is no vbus, USB PHY will not in correct state when the controller starts to
    work, for host, this requires vbus should be turned on before setting port
    power(PP) of ehci, to work with this kind of USB PHY design, this patch adds
    a flag CI_HDRC_IMX_VBUS_EARLY_ON, can be checked by host driver to turn on
    vbus while start host.

    Signed-off-by: Li Jun
    (cherry picked from commit 1d4c054323817b49897fd7a59bc57b4d36f09491)

    Li Jun
     
  • To maintain scalability let's add common methods to attach and detach
    a PM domain for a device, dev_pm_domain_attach|detach().

    Typically dev_pm_domain_attach() shall be invoked from subsystem level
    code at the probe phase to try to attach a device to its PM domain.
    The reversed actions may be done a the remove phase and then by
    invoking dev_pm_domain_detach().

    When attachment succeeds, the attach function should assign its
    corresponding detach function to a new ->detach() callback added in the
    struct dev_pm_domain.

    Signed-off-by: Ulf Hansson
    Tested-by: Philipp Zabel
    Reviewed-by: Kevin Hilman
    Reviewed-by: Dmitry Torokhov
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit 46420dd73b800f87a19af13af5883855cf38cb08)
    (cherry picked from commit 451a5b00e51410adc16f8349ed753f7eced46bc5)

    Ulf Hansson
     
  • The intent of this callback is to simplify detachment of devices from
    their PM domains. Further patches will show the benefit.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Dmitry Torokhov
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit c3099a5294f2c7266234e8ea35cbffc20a41aa9a)
    (cherry picked from commit 96257e7b72821bbaa5681b1d2042050c6aab0ea1)

    Ulf Hansson
     
  • This patch introduces generic code to perform PM domain look-up using
    device tree and automatically bind devices to their PM domains.

    Generic device tree bindings are introduced to specify PM domains of
    devices in their device tree nodes.

    Backwards compatibility with legacy Samsung-specific PM domain bindings
    is provided, but for now the new code is not compiled when
    CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code.
    This will change as soon as the Exynos PM domain code gets converted to
    use the generic framework in further patch.

    This patch was originally submitted by Tomasz Figa when he was employed
    by Samsung.

    Link: http://marc.info/?l=linux-pm&m=139955349702152&w=2
    Signed-off-by: Ulf Hansson
    Acked-by: Rob Herring
    Tested-by: Philipp Zabel
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit aa42240ab2544a8bcb2efb400193826f57f3175e)
    (cherry picked from commit 4a2d7a846761e3b86e08b903e5a1a088686e2181)

    Tomasz Figa
     
  • There are no active users of this API. Let's remove it and if future
    needs shows up we could consider to have a get/put API instead.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit d971f0b0eaaf3f2086bf21bbd64f7ea7e2f28459)
    (cherry picked from commit 835729a13d0061f55d6bd714811a16ebaecb9b0e)

    Ulf Hansson
     
  • The pm_genpd_syscore_poweroff() API and pm_genpd_syscore_poweron() API
    makes the pm_genpd_syscore_switch() API redundant.

    Moreover, since there are no active users, let's just remove it.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit d47e6464ae6c96735d4706f5cb0537fe717b6b00)
    (cherry picked from commit 9b68cd944341e5a613e9858e65e3432bd5691f92)

    Ulf Hansson
     
  • The genpd dev_irq_safe configuration somewhat overlaps with the runtime
    PM pm_runtime_irq_safe() option. Also, currently genpd don't have a
    good way to deal with these device. So, until we figured out if and how
    to support this in genpd, let's remove the option to configure it.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit c5d79ec2a5715489cff16a0d1cf4fa9108a5509e)
    (cherry picked from commit 4cffcdb2c92cabbba3e55a0f2d9c7d86d8a756ed)

    Ulf Hansson
     
  • There no users of these callbacks, let's simplify the generic power
    domain by removing them.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit 1e0407ca54d28db8e5f02e437ff21cc6416c0be8)
    (cherry picked from commit 0f19454e606c6fbc7ce980ca128a703ebc8990fb)

    Ulf Hansson
     
  • In a step of simplifying the generic power domain let's move away from
    using these callbacks.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit 67da6d4bf43c4208433ef8f3ee487401b4dc9c74)
    (cherry picked from commit b16a428836529af31f23b807065cc6e643c409da)

    Ulf Hansson
     
  • There are no users of these APIs. To simplify the generic power domain
    let's remove them.

    Signed-off-by: Ulf Hansson
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki
    (cherry picked from commit 55e15c949fd05d247a889df0ed0177a676fec665)
    (cherry picked from commit da452fc0f1a1a75993a6c989a600dd2de309026c)

    Ulf Hansson
     
  • This reverts commit 4aa055cb0634bc8d0389070104fe6aa7cfa99b8c.
    Signed-off-by: Robin Gong

    (cherry picked from commit e599f64de890a60a3b9884dd5838c43472f145e2)

    Robin Gong
     

02 Feb, 2015

1 commit


29 Jan, 2015

1 commit


28 Jan, 2015

6 commits

  • As spdif driver will register SPDIF clock to regmap, regmap will do
    clk_prepare in init function, so SPDIF clock is prepared in probe, then its
    root clock (pll clock) is prepared also, which cause the arm can't enter
    low power mode.
    Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
    Its root clock is ipg clock, and register it to regmap, then the issue can be
    fixed.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • As spdif driver will register SPDIF clock to regmap, regmap will do
    clk_prepare in init function, so SPDIF clock is prepared in probe, then its
    root clock (pll clock) is prepared also, which cause the arm can't enter
    low power mode.
    Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
    Its root clock is ipg clock, and register it to regmap, then the issue can be
    fixed.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • As spdif driver will register SPDIF clock to regmap, regmap will do
    clk_prepare in init function, so SPDIF clock is prepared in probe, then its
    root clock (pll clock) is prepared also, which cause the arm can't enter
    low power mode.
    Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
    Its root clock is ipg clock, and register it to regmap, then the issue can be
    fixed.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • Add otg_fsm pointer in struct of usb_bus for access otg_fsm via bus.
    Original way was to put it in usb_otg, then usb host can access otg_fsm via
    hcd->usb_phy->otg->fsm, since usb_phy will not be the future direction, instead
    phy is prefered, so this way may not work. It's more direct and simple to put
    it in usb_bus.

    Signed-off-by: Li Jun

    Li Jun
     
  • Add one field bcdOTG for OTG and EH supplement release number in OTG
    descriptor according to On-The-Go and Embedded Host Supplement to the
    USB Revision 2.0 Specification Revision 2.0 version 1.1a.

    Acked-by: Peter Chen
    Signed-off-by: Li Jun
    (cherry picked from commit 1bf5e829100a2922826818bd8cbb18ee81452cfc)

    Li Jun
     
  • The glue layer may need to know current available role, add
    ci_hdrc_query_available_role for that.

    Signed-off-by: Peter Chen
    (cherry picked from commit 5c340402131ca6eacaeb122deb1ee59bcea2778c)

    Peter Chen
     

27 Jan, 2015

3 commits

  • This patch adds the imx6qdl.dtsi DTS support for crypto/caam. CAAM
    clocking support is also included.

    Signed-off-by: Victoria Milhoan

    Victoria Milhoan
     
  • The AHBBRST at SBUSCFG and RX/TX burst size at BURSTSIZE are implementation
    dependent, each platform may have different values, and some values may not be
    optimized.

    The glue layer can override ahb burst configuration value by setting flag
    CI_HDRC_OVERRIDE_AHB_BURST and ahbburst_config.

    The glue layer can override RX/TX burst size by setting flag
    CI_HDRC_OVERRIDE_BURST_LENGTH and burst_length.

    Signed-off-by: Peter Chen
    (cherry picked from commit a6bf7a97a83a58b9fe6de91975e4203c235036be)

    Peter Chen
     
  • The chipidea IP has different limitations for host and device mode,
    see below errata, we may need to enable SDIS(Stream Disable Mode)
    at host mode, but we don't want it at device mode at some situations.

    TAR 9000378958
    Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry
    Impacted Configuration: Host mode, all transfer types
    Description:
    The host core operating in streaming mode may under run while sending the data packet of an OUT transaction. This under run can occur if there are unexpected system delays in fetching the remaining packet data from memory. The host forces a bad CRC on the packet, the device detects the error and discards the packet. The host then retries a Bulk, Interrupt, or Control transfer if an under run occurs according to the USB specification.
    During simulations, it was found that the host does not issue the retry of the failed bulk OUT. It does not issue any other transactions except SOF packets that have incorrect frame numbers.
    The second failure mode occurs if the under run occurs on an ISO OUT transaction and the next ISO transaction is a zero byte packet. The host does not issue any transactions (including SOFs). The device detects a Suspend condition, reverts to full speed, and waits for resume signaling.
    A third failure mode occurs when the host under runs on an ISO OUT and the next ISO in the schedule is an ISO OUT with two max packets of 1024 bytes each.
    The host should issue MDATA for the first OUT followed by DATA1 for the second. However, it drops the MDATA transaction, and issues the DATA1 transaction.
    The system impact of this bug is the same regardless of the failure mode observed. The host core hangs, the ehci_ctrl state machine waits for the protocol engine to send the completion status for the corrupted transaction, which never occurs. No indication is sent to the host controller driver, no register bits change and no interrupts occur. Eventually the requesting application times out.
    Detailed internal behavior:
    The EHCI control state machine (ehci_ctrl) in the DMA block is responsible for parsing the schedules and initiating all transactions. The ehci_ctrl state machine passes the transaction details to the protocol block by writing the transaction information in to the TxFIFO. It then asserts the pe_hst_run_pkt signal to inform the host protocol state machine (pe_hst_state) that there is a packet in the TxFIFO.
    A tag of 0x0 indicates a start of packet with the data providing the following information:

    35:32 Tag
    31:30 Reserved
    29:23 Endpoint (lowest 4 bits)
    22:16 Address
    15:10 Reserved
    9:8 Endpoint speed
    7:6 Endpoint type
    5:6 Data Toggle
    3:0 PID
    The pe_hst_state reads the packet information and constructs the packet and issues it to the PHY interface.
    The ehci_ctrl state machine writes the start transaction information in to the TxFIFO as 0x03002910c for the OUT packet that had the under run error. However, it writes 0xC3002910C for the retry of the Out transaction, which is incorrect.
    The pe_hst_state enters a bus timeout state after sending the bad CRC for the packet that under ran. It then purges any data that was back filled in to the TxFIFO for the packet that under ran. The pe_hst_state machine stops purging the TxFIFO when it is empty or if it reads a location that has a tag of 0x0, indicating a start of packet command.
    The pe_hst_state reads 0xC3002910C and discards it as it does not decode to a start of packet command. It continues to purge the OUT data that has been pre-buffered for the OUT retry . The pe_hst_state detects the hst_packet_run signal and attempts to read the PID and address information from the TxFIFO. This location has packet data and so does not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD state where the frame_num_counter is updated. The frame_num_counter is updated with the data in the TxFIFO. In this case, the data is incorrect as the ehci_ctrl state machine did not initiate the load. The hst_pe_state machine detects the SOF request signal and sends an SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine waits indefinitely in the run_pkt state waiting for the completion status from pe_hst_state machine, which will never happen.
    The ISO failure case is similar except that there is no retry for ISO. The ehci_ctrl state machine moves to the next transfer in the periodic schedule. If the under run occurs on the last entry of the periodic list then it moves to the Async schedule.
    In the case of ISO OUT simulations, the next ISO is a zero byte OUT and again the start of packet command gets corrupted. The TxFIFO is empty when the hst_pe_state attempts to read the Address and PID information as the transaction is a zero byte packet. This results in the hst_pe_state machine staying in the GET_PID state, which means that it does not issue any transactions (including SOFs). The device detects a Suspend condition and reverts to full speed mode and waits for a Resume or Reset signal.
    The EHCI specification allows a Non-DoubleWord (32 bits) offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. In Non-DoubleWord aligned cases, the core reads the packet data from the AHB memory, performs the alignment operation before writing it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP) is written to the TxFIFO after all the packet data has been written in to the TxFIFO. The alignment function is reset to Idle by the EOP tag. The corruption of the start of packet command arises because the packet buffer for the OUT transaction that under ran is not aligned to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The alignment function is still active when the start packet information is written in to the TxFIFO for the retry of the bulk packet or for the next transaction in the case of an under run on an ISO. This results in the corruption of the start tag and the transaction information.
    Click for waveform showing the command 0x 0000300291 being written in to the TX FIFO for the Out that under ran.
    Click for waveform showing the command 0xC3002910C written to the TxFIFO instead of 0x 0000300291
    Versions affected: Versions 2.10a and previous versions
    How discovered: Customer simulation
    Workaround:
    1- The EHCI specification allows a non-DoubleWord offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. However, if a DoubleWord offset is used then this issue does not arise.
    2- Use non streaming mode to eliminate under runs.
    Resolution:
    The fix involves changes to the traffic state machine in the vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context information by encoding the transaction results on the hst_op_context_update signals at the end of a transaction. The signal hst_op_context_update is added to the traffic state machine, and the tx_fifo_under_ran_r signal is generated if the transaction results in an under run error. Click for waveform
    The traffic state machine then traverses to the do_eop states if the tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to the TxFIFO as shown in this waveform .
    The EOP tag resets the align state machine to the Idle state ensuring that the next command written by the echi_ctrl state machine does not get corrupted.
    File(s) modified:
    RTL code fixed: …..
    Method of reproducing: This failure cannot be reproduced in the current test bench.
    Date Found: March 2010
    Date Fixed: June 2010
    Update information:
    Added the RTL code fix

    Signed-off-by: Peter Chen
    (cherry picked from commit 9bbed86327e015a28f7e680784bb00dd7c83533d)

    Peter Chen
     

26 Jan, 2015

1 commit


21 Jan, 2015

3 commits


19 Jan, 2015

1 commit


16 Jan, 2015

13 commits

  • When the port goes to suspend or finishes resme, it needs to
    notify PHY, it is not a standard EHCI operation, so we add a
    quirk for it.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • They are used to notify PHY that the controller enters suspend
    or finishes resume.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • This patch adds support of power lost during system sleep in otg fsm mode.

    Signed-off-by: Li Jun

    Li Jun
     
  • - Change .notify's return value from void to int, update msm notify_event
    return value accordingly.
    - Add CI_HDRC_CONTROLLER_VBUS_EVENT and
    CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
    detection flow.

    Signed-off-by: Peter Chen
    Signed-off-by: Li Jun

    Li Jun
     
  • Add imx6 USB charger detection, the vbus supplier will create and
    remove struct usb_charger, and notify vbus connect and disconnect
    event. The detail USB charger detection flow is at: "i.MX6 RM,
    Chapter Universal Serial Bus 2.0 Integrated PHY (USB-PHY),
    Charger detection, Charger detection software flow".

    Since imx6 only has charger detection function, and no charging
    current function is existed. It the user wants the detection abilities
    from SoC, it can use this detection method
    (add imx6-usb-charger-detection at dts). If the charger IC
    already has USB charger detection function, and the user wants
    to use the detection method from charger IC, please do not add
    imx6-usb-charger-detection property at dts.

    Signed-off-by: Peter Chen

    Li Jun
     
  • Add runtime power management support.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • Now, USB PHY is mandatory for chipidea core, the flag
    CI_HDRC_REQUIRE_TRANSCEIVER is useless.

    Signed-off-by: Peter Chen
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit 947c88592f17bd299ff677049c3cda36cc6f93dd)

    Peter Chen
     
  • The current EHCI implementation is prepared to toggle the
    PORT_POWER bit to enable or disable a USB-Port. In some
    cases this port power can not be just toggled by the PORT_POWER
    bit, and the gpio-regulator is needed to be toggled too.

    This patch defines a port power control interface ehci_port_power for
    ehci core use, it toggles PORT_POWER bit as well as calls platform
    defined .port_power if it is defined.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: Peter Chen
    Acked-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit 11a7e59405148c855e0a9d13588930ccec02c150)

    Michael Grzeschik
     
  • This patch adds support of the PHY framework for ChipIdea drivers.
    Changes are done in both the ChipIdea common code and in the drivers
    accessing the PHY. This is done by adding a new PHY member in
    ChipIdea's structures and by taking care of it in the code.

    Signed-off-by: Antoine Tenart
    Acked-by: Peter Chen
    Signed-off-by: Felipe Balbi
    (cherry picked from commit 1e5e2d3d055436c114e2f16145b83339aed024ff)

    Antoine Tenart
     
  • This patch modify the generic code handling PHYs to allow them to be
    supplied from the drivers. This adds checks to ensure no PHY was already
    there when looking for one in the generic code. This also makes sure we
    do not modify its state in the generic HCD functions, it was provided by
    the driver.

    Signed-off-by: Antoine Tenart
    Acked-by: Alan Stern
    Signed-off-by: Felipe Balbi
    (cherry picked from commit ef44cb4226d132146e44f8ea562a16b27ff61126)

    Antoine Tenart
     
  • This patch adds support of the PHY framework in OTG and keeps the USB
    PHY compatibility. Here the only modification is to add PHY member in
    the OTG structure, along with the USB PHY one.

    Signed-off-by: Antoine Tenart
    Signed-off-by: Felipe Balbi
    (cherry picked from commit 48bcc18076df4e07ef86226ac6ce795f64c84f7f)

    Antoine Tenart
     
  • This patch prepares the introduction of the generic PHY support in the
    USB OTG common functions. The USB PHY member of the OTG structure is
    renamed to 'usb_phy' and modifications are done in all drivers accessing
    it. Renaming this pointer will allow to keep the compatibility for USB
    PHY drivers.

    Signed-off-by: Antoine Tenart
    Signed-off-by: Felipe Balbi
    (cherry picked from commit 19c1eac2685b62640ca2386a0a885ac2152668c8)

    Conflicts:

    drivers/phy/phy-omap-usb2.c
    drivers/usb/phy/phy-msm-usb.c

    Antoine Tenart
     
  • Before using the PHY framework instead of the USB PHY one, we need to
    move the OTG state into another place, since it won't be available when
    USB PHY isn't used. This patch moves the OTG state into the OTG
    structure, and makes all the needed modifications in the drivers
    using the OTG state.

    [ balbi@ti.com : fix build regressions with phy-tahvo.c, musb_dsps.c,
    phy-isp1301-omap, and chipidea's debug.c ]

    Acked-by: Kishon Vijay Abraham I
    Acked-by: Peter Chen
    Signed-off-by: Antoine Tenart
    Signed-off-by: Felipe Balbi
    (cherry picked from commit e47d92545c2972bcf3711e7db80f481e402163c7)

    Conflicts:

    drivers/usb/musb/musb_gadget.c
    drivers/usb/phy/phy-msm-usb.c

    Antoine Tenart