Unverified Commit 9593bdfa authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'samsung-drivers-5.17' of...

Merge tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers

Samsung SoC drivers changes for v5.17

1. Exynos ChipID: add Exynos7885 support.
2. Exynos PMU: add Exynos850 support.
3. Minor bindings cleanup.
4. Add Exynos USIv2 (Universal Serial Interface) driver. The USI block is
   a shared IP block between I2C, UART/serial and SPI. Basically one has
   to choose which feature the USI block will support and later the
   regular I2C/serial/SPI driver will bind and work.
   This merges also one commit with dt-binding headers from my dts64
   pull request.

   Together with a future serial driver change, this will break the ABI.

   Affected: Serial on ExynosAutov9 SADK and out-of-tree ExynosAutov9 boards

   Why: To properly and efficiently support the USI with new hierarchy
   of USI-{serial,SPI,I2C} devicetree nodes.

   Rationale:
   Recently added serial and USI support was short-sighted and did not
   allow to smooth support of other features (SPI and I2C). Adding
   support for USI-SPI and USI-I2C would effect in code duplication.
   Adding support for different USI versions (currently supported is
   USIv2 but support for v1 is planned) would cause even more code
   duplication and create a solution difficult to maintain.
   Since USI-serial and ExynosAutov9 have been added recently, are
   considered fresh development features and there are no supported
   products using them, the code/solution is being refactored in
   non-backwards compatible way.  The compatibility is not broken yet.
   It will be when serial driver changes are accepted.
   The ABI break was discussed with only known users of ExynosAutov9 and
   received their permission.

* tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  dt-bindings: soc: samsung: keep SoC driver bindings together
  soc: samsung: Add USI driver
  dt-bindings: soc: samsung: Add Exynos USI bindings
  soc: samsung: exynos-pmu: Add Exynos850 support
  dt-bindings: samsung: pmu: Document Exynos850
  soc: samsung: exynos-chipid: add Exynos7885 SoC support
  soc: samsung: exynos-chipid: describe which SoCs go with compatibles

Link: https://lore.kernel.org/r/20211220115405.30434-2-krzysztof.kozlowski@canonical.com


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 87e12876 96c8bddb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/samsung/exynos-chipid.yaml#
$id: http://devicetree.org/schemas/soc/samsung/exynos-chipid.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung Exynos SoC series Chipid driver
+3 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/samsung/pmu.yaml#
$id: http://devicetree.org/schemas/soc/samsung/exynos-pmu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung Exynos SoC series Power Management Unit (PMU)
@@ -24,6 +24,7 @@ select:
          - samsung,exynos5420-pmu
          - samsung,exynos5433-pmu
          - samsung,exynos7-pmu
          - samsung,exynos850-pmu
          - samsung-s5pv210-pmu
  required:
    - compatible
@@ -41,6 +42,7 @@ properties:
          - samsung,exynos5420-pmu
          - samsung,exynos5433-pmu
          - samsung,exynos7-pmu
          - samsung,exynos850-pmu
          - samsung-s5pv210-pmu
      - const: syscon

+159 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/samsung/exynos-usi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung's Exynos USI (Universal Serial Interface) binding

maintainers:
  - Sam Protsenko <semen.protsenko@linaro.org>
  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

description: |
  USI IP-core provides selectable serial protocol (UART, SPI or High-Speed I2C).
  USI shares almost all internal circuits within each protocol, so only one
  protocol can be chosen at a time. USI is modeled as a node with zero or more
  child nodes, each representing a serial sub-node device. The mode setting
  selects which particular function will be used.

  Refer to next bindings documentation for information on protocol subnodes that
  can exist under USI node:

  [1] Documentation/devicetree/bindings/serial/samsung_uart.yaml
  [2] Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
  [3] Documentation/devicetree/bindings/spi/spi-samsung.txt

properties:
  $nodename:
    pattern: "^usi@[0-9a-f]+$"

  compatible:
    enum:
      - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)

  reg: true

  clocks: true

  clock-names: true

  ranges: true

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  samsung,sysreg:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    description:
      Should be phandle/offset pair. The phandle to System Register syscon node
      (for the same domain where this USI controller resides) and the offset
      of SW_CONF register for this USI controller.

  samsung,mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Selects USI function (which serial protocol to use). Refer to
      <include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values.

  samsung,clkreq-on:
    type: boolean
    description:
      Enable this property if underlying protocol requires the clock to be
      continuously provided without automatic gating. As suggested by SoC
      manual, it should be set in case of SPI/I2C slave, UART Rx and I2C
      multi-master mode. Usually this property is needed if USI mode is set
      to "UART".

      This property is optional.

patternProperties:
  # All other properties should be child nodes
  "^(serial|spi|i2c)@[0-9a-f]+$":
    type: object
    description: Child node describing underlying USI serial protocol

required:
  - compatible
  - ranges
  - "#address-cells"
  - "#size-cells"
  - samsung,sysreg
  - samsung,mode

if:
  properties:
    compatible:
      contains:
        enum:
          - samsung,exynos850-usi

then:
  properties:
    reg:
      maxItems: 1

    clocks:
      items:
        - description: Bus (APB) clock
        - description: Operating clock for UART/SPI/I2C protocol

    clock-names:
      items:
        - const: pclk
        - const: ipclk

  required:
    - reg
    - clocks
    - clock-names

else:
  properties:
    reg: false
    clocks: false
    clock-names: false
    samsung,clkreq-on: false

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/soc/samsung,exynos-usi.h>

    usi0: usi@138200c0 {
        compatible = "samsung,exynos850-usi";
        reg = <0x138200c0 0x20>;
        samsung,sysreg = <&sysreg_peri 0x1010>;
        samsung,mode = <USI_V2_UART>;
        samsung,clkreq-on; /* needed for UART mode */
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
        clocks = <&cmu_peri 32>, <&cmu_peri 31>;
        clock-names = "pclk", "ipclk";

        serial_0: serial@13820000 {
            compatible = "samsung,exynos850-uart";
            reg = <0x13820000 0xc0>;
            interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&cmu_peri 32>, <&cmu_peri 31>;
            clock-names = "uart", "clk_uart_baud0";
            status = "disabled";
        };

        hsi2c_0: i2c@13820000 {
            compatible = "samsung,exynosautov9-hsi2c";
            reg = <0x13820000 0xc0>;
            interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
            #address-cells = <1>;
            #size-cells = <0>;
            clocks = <&cmu_peri 32>, <&cmu_peri 31>;
            clock-names = "hsi2c_pclk", "hsi2c";
            status = "disabled";
        };
    };
+1 −0
Original line number Diff line number Diff line
@@ -2542,6 +2542,7 @@ Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
F:	Documentation/arm/samsung/
F:	Documentation/devicetree/bindings/arm/samsung/
F:	Documentation/devicetree/bindings/power/pd-samsung.yaml
F:	Documentation/devicetree/bindings/soc/samsung/
F:	arch/arm/boot/dts/exynos*
F:	arch/arm/boot/dts/s3c*
F:	arch/arm/boot/dts/s5p*
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,20 @@ config EXYNOS_CHIPID
	  Support for Samsung Exynos SoC ChipID and Adaptive Supply Voltage.
	  This driver can also be built as module (exynos_chipid).

config EXYNOS_USI
	tristate "Exynos USI (Universal Serial Interface) driver"
	default ARCH_EXYNOS && ARM64
	depends on ARCH_EXYNOS || COMPILE_TEST
	select MFD_SYSCON
	help
	  Enable support for USI block. USI (Universal Serial Interface) is an
	  IP-core found in modern Samsung Exynos SoCs, like Exynos850 and
	  ExynosAutoV0. USI block can be configured to provide one of the
	  following serial protocols: UART, SPI or High Speed I2C.

	  This driver allows one to configure USI for desired protocol, which
	  is usually done in USI node in Device Tree.

config EXYNOS_PMU
	bool "Exynos PMU controller driver" if COMPILE_TEST
	depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST)
Loading