mbox series

[v6,00/16] Qualcomm platform USB support

Message ID 20240403-b4-qcom-livetree-v6-0-130f8f50b538@linaro.org
Headers show
Series Qualcomm platform USB support | expand

Message

Caleb Connolly April 3, 2024, 12:07 p.m. UTC
This series enables USB on Qualcomm SDM845 platforms and lays the
foundation for future SoCs as well.

It introduces two new high-speed PHY drivers, one for SDM845 and one for
an upcoming platform. The SDM845 clock driver gains support for
configuring the USB clocks, and the GPIO driver is updated to use .set_flags
which fixes a strange bug where GPIOs would also be configured as input.

Support for super-speed USB modes is not currently available, however
configuring the device to be high-speed only requires modifications to
DT.

To improve compatibility with upstream DT, we switch Qualcomm platforms
over to OF_LIVE and apply fixups to the tree to remove references to the
super-speed phy, as well as configure the Qualcomm glue for high-speed
only mode.

The db845c requires a vbus-supply to be hooked up for its usb type-A
port. A U-Boot dtsi file is added to configure this.

With these patches, it is now also possible to run U-Boot on some SDM845
phones like the OnePlus 6 using a dtb from Linux, and access the U-Boot
shell via the CDC ACM USB serial gadget.

This series depends on the ("Qualcomm DWC3 USB support") series [1], as
well as Volodymyrs patches enabling power domain support [2].
A feature branch based on qcom-next with the necessary dependencies
for testing the Dragonboard845c can be found at [3].

[1]: https://lore.kernel.org/u-boot/20240320-b4-qcom-usb-v4-0-41be480172e1@linaro.org
[2]: https://lore.kernel.org/u-boot/20240311213334.3567389-1-volodymyr_babchuk@epam.com
[3]: https://git.codelinaro.org/linaro/qcomlt/u-boot/-/tree/b4/qcom-livetree

---
Changes in v6:
- Add a comment explaining the non-standard clrsetbits_le32()
  implementation in the femto-v2 phy.
- Link to v5: https://lore.kernel.org/r/20240328-b4-qcom-livetree-v5-0-4e98228b3d03@linaro.org

Changes in v5:
- Call regulators_enable_boot_on() during board_init() and don't use
  the vbus-supply property anymore. This is slightly more aligned with
  upstream.
- Minor checkpatch fixes
- Link to v4: https://lore.kernel.org/r/20240320-b4-qcom-livetree-v4-0-d867ab1f06c2@linaro.org

Changes in v4:
- Fix defconfig.
- Mark db845c vbus regulator always-on to fix a bug in Linux.
- Add a timer in qcom_of_fixup_nodes() so the boot time impact can
  be easily measured.
- Drop unused macros from femto v2 phy, general cleanup, remove custom
  set/clrbits impl.
- Rename "7nm" phy driver to "femto-v2" to match Linux, also fix
  copyright.
- Use set/clrbits() in qusb2 phy driver.
- Link to v3: https://lore.kernel.org/r/20240319-b4-qcom-livetree-v3-0-e1b38d9b4fa4@linaro.org

Changes in v3:
- Add back missing gadget options to qcom_defconfig (thanks Neil)
- Link to v2: https://lore.kernel.org/r/20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org

Changes in v2:
- Fix incorrect order of NULL/0 parameters to of_write_prob() in
  fixup_qcom_dwc3()
- Move fixup_usb_nodes() to a separate file in preparation for future
  additions.
- Add missing break to switch case in sdm845_clk_enable()
- Remove rogue return statement in msm_gpio_set_flags()
- Rebase on Volodymyrs power domain patches.
- Link to v1: https://lore.kernel.org/r/20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org

---
Bhupesh Sharma (2):
      phy: qcom: add Qualcomm QUSB2 USB PHY driver
      phy: qcom: Add SNPS femto v2 USB HS phy

Caleb Connolly (14):
      mailmap: update Bhupesh's email address
      mach-snapdragon: disable power-domains for pre-reloc drivers
      clk/qcom: use offsets for RCG registers
      clk/qcom: sdm845: add gdscs
      clk/qcom: sdm845: add USB clocks
      gpio: msm_gpio: add .set_flags op
      serial: msm-geni: support livetree
      mach-snapdragon: fixup USB nodes
      mach-snapdragon: fixup power-domains
      mach-snapdragon: call regulators_enable_boot_on()
      dts: sdm845-db845c: add u-boot fixups
      qcom_defconfig: enable livetree
      qcom_defconfig: enable USB
      usb: gadget: UMS: fix 64-bit division on ARM32

 .mailmap                                  |   1 +
 arch/arm/dts/sdm845-db845c-u-boot.dtsi    |   9 +
 arch/arm/mach-snapdragon/Makefile         |   1 +
 arch/arm/mach-snapdragon/board.c          |   5 +
 arch/arm/mach-snapdragon/of_fixup.c       | 155 +++++++++++
 arch/arm/mach-snapdragon/qcom-priv.h      |  20 ++
 configs/qcom_defconfig                    |  53 ++--
 drivers/clk/qcom/clock-apq8016.c          |  39 +--
 drivers/clk/qcom/clock-apq8096.c          |  28 +-
 drivers/clk/qcom/clock-qcom.c             |  24 +-
 drivers/clk/qcom/clock-qcom.h             |  16 +-
 drivers/clk/qcom/clock-qcs404.c           | 122 ++-------
 drivers/clk/qcom/clock-sdm845.c           |  61 +++--
 drivers/gpio/msm_gpio.c                   |  27 +-
 drivers/phy/qcom/Kconfig                  |  15 ++
 drivers/phy/qcom/Makefile                 |   2 +
 drivers/phy/qcom/phy-qcom-qusb2.c         | 429 ++++++++++++++++++++++++++++++
 drivers/phy/qcom/phy-qcom-snps-femto-v2.c | 216 +++++++++++++++
 drivers/serial/serial_msm_geni.c          |  15 +-
 drivers/usb/gadget/f_mass_storage.c       |  13 +-
 20 files changed, 1010 insertions(+), 241 deletions(-)
---
base-commit: 0d08018d01afaddcee8dd1f1929a48577684110c

Caleb Connolly <caleb.connolly@linaro.org>

Comments

Caleb Connolly April 3, 2024, 12:28 p.m. UTC | #1
On Wed, 03 Apr 2024 14:07:35 +0200, Caleb Connolly wrote:
> This series enables USB on Qualcomm SDM845 platforms and lays the
> foundation for future SoCs as well.
> 
> It introduces two new high-speed PHY drivers, one for SDM845 and one for
> an upcoming platform. The SDM845 clock driver gains support for
> configuring the USB clocks, and the GPIO driver is updated to use .set_flags
> which fixes a strange bug where GPIOs would also be configured as input.
> 
> [...]

Applied, thanks!

[01/16] mailmap: update Bhupesh's email address
        commit: d78fd873e777be4dd5f3beec164bb60ced53a750
[02/16] phy: qcom: add Qualcomm QUSB2 USB PHY driver
        commit: 62a3eba5bfc89d292c774f88cc2afd8cad1b380b
[03/16] phy: qcom: Add SNPS femto v2 USB HS phy
        commit: 49cd93e882a3b6f6fa33dd343558b656ee29d881
[04/16] mach-snapdragon: disable power-domains for pre-reloc drivers
        commit: 1bfff467273804b7e47ec0ada189ba4312a5091d
[05/16] clk/qcom: use offsets for RCG registers
        commit: d057ada9c163cd4562528a0bfd19a647125a145f
[06/16] clk/qcom: sdm845: add gdscs
        commit: ce08f08cb11455729897d2bfe5d10e8d3e781f2a
[07/16] clk/qcom: sdm845: add USB clocks
        commit: 3d8546ed7ed27d0c0fd551cbf2c80e3dcdba589b
[08/16] gpio: msm_gpio: add .set_flags op
        commit: 4ef1c0566a581f368077fda69b24ce90756f368e
[09/16] serial: msm-geni: support livetree
        commit: def7e0f3ce16cba9f7bbead11d1256189b513a80
[10/16] mach-snapdragon: fixup USB nodes
        commit: de25b47241cc6bf83dc4db421f8eecc311e9424b
[11/16] mach-snapdragon: fixup power-domains
        commit: 2446ad0d1da8a82469186398ee63da7cb4439842
[12/16] mach-snapdragon: call regulators_enable_boot_on()
        commit: 57e4ccbd8c1ac7a415f8bff9d24dc2fc384cf583
[13/16] dts: sdm845-db845c: add u-boot fixups
        commit: f1ead8665ec10b6a972117a0842e294c48aca3e7
[14/16] qcom_defconfig: enable livetree
        commit: 9980bcbd3a0e874d7abbaafed373f1238c1f962f

Best regards,