0088-soc-qcom-Add-device-tree-binding-for-GSBI.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. From 5a58dbf4d82c29f7e6d89abc3520bed1aa2af05c Mon Sep 17 00:00:00 2001
  2. From: Andy Gross <[email protected]>
  3. Date: Thu, 24 Apr 2014 11:31:20 -0500
  4. Subject: [PATCH 088/182] soc: qcom: Add device tree binding for GSBI
  5. Add device tree binding support for the QCOM GSBI driver.
  6. Signed-off-by: Andy Gross <[email protected]>
  7. Signed-off-by: Kumar Gala <[email protected]>
  8. ---
  9. .../devicetree/bindings/soc/qcom/qcom,gsbi.txt | 78 ++++++++++++++++++++
  10. include/dt-bindings/soc/qcom,gsbi.h | 26 +++++++
  11. 2 files changed, 104 insertions(+)
  12. create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,gsbi.txt
  13. create mode 100644 include/dt-bindings/soc/qcom,gsbi.h
  14. --- /dev/null
  15. +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,gsbi.txt
  16. @@ -0,0 +1,78 @@
  17. +QCOM GSBI (General Serial Bus Interface) Driver
  18. +
  19. +The GSBI controller is modeled as a node with zero or more child nodes, each
  20. +representing a serial sub-node device that is mux'd as part of the GSBI
  21. +configuration settings. The mode setting will govern the input/output mode of
  22. +the 4 GSBI IOs.
  23. +
  24. +Required properties:
  25. +- compatible: must contain "qcom,gsbi-v1.0.0" for APQ8064/IPQ8064
  26. +- reg: Address range for GSBI registers
  27. +- clocks: required clock
  28. +- clock-names: must contain "iface" entry
  29. +- qcom,mode : indicates MUX value for configuration of the serial interface.
  30. + Please reference dt-bindings/soc/qcom,gsbi.h for valid mux values.
  31. +
  32. +Optional properties:
  33. +- qcom,crci : indicates CRCI MUX value for QUP CRCI ports. Please reference
  34. + dt-bindings/soc/qcom,gsbi.h for valid CRCI mux values.
  35. +
  36. +Required properties if child node exists:
  37. +- #address-cells: Must be 1
  38. +- #size-cells: Must be 1
  39. +- ranges: Must be present
  40. +
  41. +Properties for children:
  42. +
  43. +A GSBI controller node can contain 0 or more child nodes representing serial
  44. +devices. These serial devices can be a QCOM UART, I2C controller, spi
  45. +controller, or some combination of aforementioned devices.
  46. +
  47. +See the following for child node definitions:
  48. +Documentation/devicetree/bindings/i2c/qcom,i2c-qup.txt
  49. +Documentation/devicetree/bindings/spi/qcom,spi-qup.txt
  50. +Documentation/devicetree/bindings/serial/qcom,msm-uartdm.txt
  51. +
  52. +Example for APQ8064:
  53. +
  54. +#include <dt-bindings/soc/qcom,gsbi.h>
  55. +
  56. + gsbi4@16300000 {
  57. + compatible = "qcom,gsbi-v1.0.0";
  58. + reg = <0x16300000 0x100>;
  59. + clocks = <&gcc GSBI4_H_CLK>;
  60. + clock-names = "iface";
  61. + #address-cells = <1>;
  62. + #size-cells = <1>;
  63. + ranges;
  64. + qcom,mode = <GSBI_PROT_I2C_UART>;
  65. + qcom,crci = <GSBI_CRCI_QUP>;
  66. +
  67. + /* child nodes go under here */
  68. +
  69. + i2c_qup4: i2c@16380000 {
  70. + compatible = "qcom,i2c-qup-v1.1.1";
  71. + reg = <0x16380000 0x1000>;
  72. + interrupts = <0 153 0>;
  73. +
  74. + clocks = <&gcc GSBI4_QUP_CLK>, <&gcc GSBI4_H_CLK>;
  75. + clock-names = "core", "iface";
  76. +
  77. + clock-frequency = <200000>;
  78. +
  79. + #address-cells = <1>;
  80. + #size-cells = <0>;
  81. +
  82. + };
  83. +
  84. + uart4: serial@16340000 {
  85. + compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
  86. + reg = <0x16340000 0x1000>,
  87. + <0x16300000 0x1000>;
  88. + interrupts = <0 152 0x0>;
  89. + clocks = <&gcc GSBI4_UART_CLK>, <&gcc GSBI4_H_CLK>;
  90. + clock-names = "core", "iface";
  91. + status = "ok";
  92. + };
  93. + };
  94. +
  95. --- /dev/null
  96. +++ b/include/dt-bindings/soc/qcom,gsbi.h
  97. @@ -0,0 +1,26 @@
  98. +/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
  99. + *
  100. + * This program is free software; you can redistribute it and/or modify
  101. + * it under the terms of the GNU General Public License version 2 and
  102. + * only version 2 as published by the Free Software Foundation.
  103. + *
  104. + * This program is distributed in the hope that it will be useful,
  105. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  106. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  107. + * GNU General Public License for more details.
  108. + */
  109. +#ifndef __DT_BINDINGS_QCOM_GSBI_H
  110. +#define __DT_BINDINGS_QCOM_GSBI_H
  111. +
  112. +#define GSBI_PROT_IDLE 0
  113. +#define GSBI_PROT_I2C_UIM 1
  114. +#define GSBI_PROT_I2C 2
  115. +#define GSBI_PROT_SPI 3
  116. +#define GSBI_PROT_UART_W_FC 4
  117. +#define GSBI_PROT_UIM 5
  118. +#define GSBI_PROT_I2C_UART 6
  119. +
  120. +#define GSBI_CRCI_QUP 0
  121. +#define GSBI_CRCI_UART 1
  122. +
  123. +#endif