From patchwork Sun Mar 17 19:37:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13594826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD381C54E60 for ; Sun, 17 Mar 2024 19:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/9TOzX5hJI33u8eB/6Ch87kDa6hIdZG/jWQFRSuCOtc=; b=n50qmHUfSuPVCN WCcKFymnyvhAHjjXkfoHV/qGFokiBRQO5hgwT1aouDr7YEVAjhfKkWUxS6mUcC8GR7UDAMV3KS3Wn Ot9kSjWPcf/IBo5huHBMfPrcWhxUAfgVzB9FFIEOcXzFV1u5euixGqSHLqPpDNRgQnNtb4Q34/rmd +6cvqhNy6lxfw/pPXAlphnNVNvBxk9fyqB01qy4MHiOqsrNF6UPeajL3hpeLBQA0I1SxQr6z8Q9Kj zkNKWg9mrFrO7sALIgBQEGuJWW08E5zl4+JQpFRbT+0u6zog8yYmIkKoK/W8BdTGY3Kb5gUtTEi4W 3qn1omILAyc4aD63n4Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlwKl-00000006Dzo-2vUO; Sun, 17 Mar 2024 19:38:15 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlwKh-00000006DyO-3uc8 for linux-arm-kernel@lists.infradead.org; Sun, 17 Mar 2024 19:38:14 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-29c5f8bc830so2415219a91.2 for ; Sun, 17 Mar 2024 12:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710704291; x=1711309091; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XAFdZ643wkelI8hZPnf28UKtzzWxeqJSxohoYBvzlpg=; b=gKVRCR5/NU0pTQZjwJEpFvc2bytuAoio06E/QXMpQKdms2HL/qDg2Nl9+DUmQaWJ0t dViIMs6qq9t8uDJg9SdwvmR/bw9iovYcGvX7eWNNc/wsnipN1rSQ4wIqJwzSMOHt8rMq Ldvn/z0Gc3r7f8zsYS/AbxTeZTGTqvO2YuRFZNHfsFDkvE1+En41HjyzctikGCZvWLig l7PUVFjw3kPeqUuuCHeFE/grUbL9PgMFrnsKUsPr1iat39KxTXfbA8UEIJv/tJc4NUTr +5uREcrxIcgPUM4w88S0BJtWjYPPQ6li1sBazNEN9J+sswJ3piy3zoU76pRtBwDkNMQI g1Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710704291; x=1711309091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XAFdZ643wkelI8hZPnf28UKtzzWxeqJSxohoYBvzlpg=; b=rmmCJtnSfNyk93/gh4QAJSbe9++RdX8PCqLBbhYAzcZyihsRJxDlcRXnVUfVzNiaYE Mjqi7OvIap5s2C4Ztl6yGG2sARTIt5EYv9sZ7lXaMRQw4pHwBfUTEouec7R4ZmNDn2JT IBu9OwrCEMtDEc2J0P6Gtt4fRla7fsAAHi6qsHZfPW6oe3U3hV2655+G452Iia7X6nx7 ZaolQHbCLTAdk0sjl33ItDs1Y1EIuYTQfGLOgVrMdrtx6GddpVkR5rvGXI5wfk1Y7R9o WmXHRUV6I3H22+Gy2CkhT7GS2bYujRTWRze3e4/NImpX4REiidZTah8A4EFMKLzcGLMW 8V3A== X-Forwarded-Encrypted: i=1; AJvYcCV1oAAKJRtvdCt5rzqi3WB5uuVOdScz2381o4RTcfZZ7nwWhQuayBTmjVT1g10wftAG6NPz/2d8MYWz0Kt5RaHLOxNbzUhE7plmqtkHePptD6Kphqo= X-Gm-Message-State: AOJu0YwHszNNwIuGWJyygTxK/UVtyTl87XAv+AkoyjrdJxIklwkewWAE DfQZwljbAJ8oLLxOGZm671QEAlFRGZVytLqmpe1wQsubaMTdhwKN X-Google-Smtp-Source: AGHT+IGIMfDbF9VDPxpzPhgHWGmVrvu7kV7iVi2cPqw22K30WUzkmMxnJYuAGqmR7ul921En552HNg== X-Received: by 2002:a17:90a:88d:b0:29d:e70f:7240 with SMTP id v13-20020a17090a088d00b0029de70f7240mr6358733pjc.11.1710704290554; Sun, 17 Mar 2024 12:38:10 -0700 (PDT) Received: from toolbox.iitism.net ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id st6-20020a17090b1fc600b0029bbdc920besm6125995pjb.44.2024.03.17.12.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 12:38:10 -0700 (PDT) From: Ayush Singh To: linux-kernel@vger.kernel.org (open list) Cc: Ayush Singh , jkridner@beagleboard.org, robertcnelson@beagleboard.org, lorforlinux@beagleboard.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Vaishnav M A , Mark Brown , Johan Hovold , Alex Elder , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE), linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), greybus-dev@lists.linaro.org (moderated list:GREYBUS SUBSYSTEM), Vaishnav M A Subject: [PATCH v4 1/5] dt-bindings: misc: Add mikrobus-connector Date: Mon, 18 Mar 2024 01:07:09 +0530 Message-ID: <20240317193714.403132-2-ayushdevel1325@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240317193714.403132-1-ayushdevel1325@gmail.com> References: <20240317193714.403132-1-ayushdevel1325@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_123812_315401_A606471D X-CRM114-Status: GOOD ( 19.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add DT bindings for mikroBUS interface. MikroBUS is an open standard developed by MikroElektronika for connecting add-on boards to microcontrollers or microprocessors. mikroBUS is a connector and does not have a controller. Instead the software is responsible for identification of board and setting up / registering uart, spi, i2c, pwm and other buses. Thus it needs a way to get uart, spi, i2c, pwm and gpio controllers / adapters. A mikroBUS addon board is free to leave some of the pins unused which are marked as NC or Not Connected. Some of the pins might need to be configured as GPIOs deviating from their reserved purposes Eg: SHT15 Click where the SCL and SDA Pins need to be configured as GPIOs for the driver (drivers/hwmon/sht15.c) to work. For some add-on boards the driver may not take care of some additional signals like reset/wake-up/other. Eg: ENC28J60 click where the reset line (RST pin on the mikrobus port) needs to be pulled high. Here's the list of pins in mikroBUS connector: Analog - AN Reset - RST SPI Chip Select - CS SPI Clock - SCK SPI Master Input Slave Output - MISO SPI Master Output Slave Input - MOSI VCC-3.3V power - +3.3V Reference Ground - GND PWM - PWM output INT - Hardware Interrupt RX - UART Receive TX - UART Transmit SCL - I2C Clock SDA - I2C Data +5V - VCC-5V power GND - Reference Ground Additionally, some new mikroBUS boards contain 1-wire EEPROM that contains a manifest to describe the addon board to provide plug and play capabilities. Link: https://www.mikroe.com/mikrobus Link: https://download.mikroe.com/documents/standards/mikrobus/mikrobus-standard-specification-v200.pdf mikroBUS specification Link: https://www.mikroe.com/sht1x-click SHT15 Click Link: https://www.mikroe.com/eth-click ENC28J60 Click Link: https://www.mikroe.com/clickid ClickID Co-developed-by: Vaishnav M A Signed-off-by: Vaishnav M A Signed-off-by: Ayush Singh --- .../connector/mikrobus-connector.yaml | 113 ++++++++++++++++++ MAINTAINERS | 6 + 2 files changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/connector/mikrobus-connector.yaml diff --git a/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml new file mode 100644 index 000000000000..ee3736add41c --- /dev/null +++ b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml @@ -0,0 +1,113 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/connector/mikrobus-connector.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: mikroBUS add-on board socket + +maintainers: + - Ayush Singh + +properties: + compatible: + const: mikrobus-connector + + pinctrl-0: true + pinctrl-1: true + pinctrl-2: true + pinctrl-3: true + pinctrl-4: true + pinctrl-5: true + pinctrl-6: true + pinctrl-7: true + pinctrl-8: true + + pinctrl-names: + items: + - const: default + - const: pwm_default + - const: pwm_gpio + - const: uart_default + - const: uart_gpio + - const: i2c_default + - const: i2c_gpio + - const: spi_default + - const: spi_gpio + + mikrobus-gpios: + minItems: 11 + maxItems: 12 + + i2c-adapter: + description: i2c adapter attached to the mikrobus socket. + $ref: /schemas/types.yaml#/definitions/phandle + + spi-controller: + description: spi bus number of the spi-master attached to the mikrobus socket. + $ref: /schemas/types.yaml#/definitions/phandle + + uart: + description: uart port attached to the mikrobus socket + $ref: /schemas/types.yaml#/definitions/phandle + + pwms: + description: the pwm-controller corresponding to the mikroBUS PWM pin. + maxItems: 1 + + spi-cs: + description: spi chip-select numbers corresponding to the chip-selects on the mikrobus socket. + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - description: chip select corresponding to CS pin + - description: chip select corresponding to RST pin + +required: + - compatible + - pinctrl-0 + - pinctrl-1 + - pinctrl-2 + - pinctrl-3 + - pinctrl-4 + - pinctrl-5 + - pinctrl-6 + - pinctrl-7 + - pinctrl-8 + - i2c-adapter + - spi-controller + - spi-cs + - uart + - pwms + - mikrobus-gpios + +additionalProperties: false + +examples: + - | + #include + + mikrobus { + compatible = "mikrobus-connector"; + pinctrl-names = "default", "pwm_default", "pwm_gpio","uart_default", "uart_gpio", "i2c_default", + "i2c_gpio", "spi_default", "spi_gpio"; + pinctrl-0 = <&P2_03_gpio_input_pin &P1_04_gpio_pin &P1_02_gpio_pin>; + pinctrl-1 = <&P2_01_pwm_pin>; + pinctrl-2 = <&P2_01_gpio_pin>; + pinctrl-3 = <&P2_05_uart_pin &P2_07_uart_pin>; + pinctrl-4 = <&P2_05_gpio_pin &P2_07_gpio_pin>; + pinctrl-5 = <&P2_09_i2c_pin &P2_11_i2c_pin>; + pinctrl-6 = <&P2_09_gpio_pin &P2_11_gpio_pin>; + pinctrl-7 = <&P1_12_spi_pin &P1_10_spi_pin &P1_08_spi_sclk_pin &P1_06_spi_cs_pin>; + pinctrl-8 = <&P1_12_gpio_pin &P1_10_gpio_pin &P1_08_gpio_pin &P1_06_gpio_pin>; + pwms = <&ehrpwm1 0 500000 0>; + i2c-adapter = <&i2c1>; + spi-controller = <&spi1>; + spi-cs = <0 1>; + uart = <&uart1>; + mikrobus-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>, <&gpio0 23 GPIO_ACTIVE_HIGH>, + <&gpio0 30 GPIO_ACTIVE_HIGH>, <&gpio0 31 GPIO_ACTIVE_HIGH>, + <&gpio0 15 GPIO_ACTIVE_HIGH>, <&gpio0 14 GPIO_ACTIVE_HIGH>, + <&gpio0 4 GPIO_ACTIVE_HIGH>, <&gpio0 3 GPIO_ACTIVE_HIGH>, + <&gpio0 2 GPIO_ACTIVE_HIGH>, <&gpio0 5 GPIO_ACTIVE_HIGH>, + <&gpio2 25 GPIO_ACTIVE_HIGH>, <&gpio2 3 GPIO_ACTIVE_HIGH>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 375d34363777..69418a058c6b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14767,6 +14767,12 @@ M: Oliver Neukum S: Maintained F: drivers/usb/image/microtek.* +MIKROBUS +M: Ayush Singh +M: Vaishnav M A +S: Maintained +F: Documentation/devicetree/bindings/misc/mikrobus-connector.yaml + MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT M: Luka Kovacic M: Luka Perkov