From patchwork Thu Jun 27 16:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13714797 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 684EBC3064D for ; Thu, 27 Jun 2024 16:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yhIZRHpA4qOumuO4k7pvHL8zVi+S/SE7cZamMyu7G80=; b=f9hkXdYTWqwF5W9CEpfHWybJ0F NFg3qA2NClU4jC1f1IRUMhG6YLvmyBwlkdPiN1Ep49Icy2bccEIOv+QMgAE9JJ1DgBmq1hmN+V43h i6fT2311AAWICXqTmfkPVkGtNKTlo77KvTD/irSdg98hva4xi90jQ2zKFqTqV4066EiNQrWEMaUyY 46JXmXRDogbwYNFae9nfVGverNxzjuFYRXssA7XoQMNK98X0sZlxOFfgu/JIxrM/E9R844Npm+8Rx O5+dffTcw3smtrMQcpWr/OAtZ/YIF13C1Yml9dPuFY+Jr7mveEOtmIUJewcAuKwbdY6TmmfrSspRP +01edlaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMrza-0000000B2gt-48Hx; Thu, 27 Jun 2024 16:29:02 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMrzS-0000000B2db-0fNg for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 16:28:55 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7068ca5a807so238697b3a.3 for ; Thu, 27 Jun 2024 09:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1719505733; x=1720110533; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yhIZRHpA4qOumuO4k7pvHL8zVi+S/SE7cZamMyu7G80=; b=Wh7Y7KxgIe0W9TSMW4PrumkNK4s7s9WClcXseYsZmKgbP0ResuPckyzRlLFuczAcaq B4T69WAlamkMHiEsTVhFpUG0zjH/Mhv5k4oF9/tUiH3SjLfxh0SgzA39blhVdez2fVWv BnCHUAaUnOdaBo0EugkDw08WjgA0ARiKvm0VSh39GFvrZFcFdO5+ul7YYLCrsrfBLVa6 HnmBAUpGAW/E/iARQnfhhaCwfPn75oxOEhLnBuUsKAvBgszVWahTzv9hY23ZEsRO7Uhv LMCGbz7jYCbJnr7WD49jfoEO2TwrNphtanoDKJLKmLVDFiJh0d3SULm/o41h4TDP1gtY sZqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719505733; x=1720110533; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yhIZRHpA4qOumuO4k7pvHL8zVi+S/SE7cZamMyu7G80=; b=ruQa5eXMR3i25NVyxpM1X2L6fE96L30FtK7YmIX+DqA95I55tGUXD4wqNxdYeQ/P+a htzPVLHgLTwa7/ifwvJvAhrgdWIz7wq/hEcT4lsi6wcRWNKCkHoF3Ml35eo+y3gFoZV5 CyeAXmoVW0aQXjb6CHu7ZnUfCXMJWKxY5Nko65U1HrLkC/Ps0S85p3Msk5G31yvTAkDS FEaCDU/gniAJ9qMrBfA6vUCkAPboOJMMnms/GmgrbsyVWkNc4Pf4nPY1JOo8yztRVGki qiCgWukX+yvbGvQAwciVQ0TdELcGd8IFLt1jyxVurNgdqP9xslm+1EJACQlgLpHmhoDV 9Spg== X-Forwarded-Encrypted: i=1; AJvYcCXfhRic7UZyPa7mj7OdwRemuyOf1HqeYdOzFohqxgGGsRBW7tOt1MyaIpCJWPW+3ps4lP2/FffKYKxYQl7T1KExvgW+c2vXtAXN3R7rx8YEQXHQW/k= X-Gm-Message-State: AOJu0Ywc5XTioMXDj9i5SxK492dmmVA2PBK8MYdZWZdynbA+FkDOV1ap INqdazfGKx844ID6CcvMZY2WJVjLgbiv0BnZXDirIaKxmjjjk73H3A06jmJvcBIHiOpbRsylarw V3Orw X-Google-Smtp-Source: AGHT+IGu7nfAht951dRK0GykxN4pyx/LO6pNHCPGWyCGEdRxWhNATyHi0HUE8qiqBodGwFGg0p2swQ== X-Received: by 2002:a05:6a00:408b:b0:706:5c2c:e202 with SMTP id d2e1a72fcca58-70667bd82ccmr16038261b3a.0.1719505733221; Thu, 27 Jun 2024 09:28:53 -0700 (PDT) Received: from [127.0.0.1] ([2401:4900:1f3e:18b0:e4e6:ed1:4c03:dcec]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-706b4a58dbdsm1560739b3a.198.2024.06.27.09.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 09:28:53 -0700 (PDT) From: Ayush Singh Date: Thu, 27 Jun 2024 21:56:11 +0530 Subject: [PATCH v5 1/7] dt-bindings: connector: Add mikrobus-connector MIME-Version: 1.0 Message-Id: <20240627-mikrobus-scratch-spi-v5-1-9e6c148bf5f0@beagleboard.org> References: <20240627-mikrobus-scratch-spi-v5-0-9e6c148bf5f0@beagleboard.org> In-Reply-To: <20240627-mikrobus-scratch-spi-v5-0-9e6c148bf5f0@beagleboard.org> To: Mark Brown , Vaishnav M A , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Michael Walle , Andrew Lunn , jkridner@beagleboard.org, robertcnelson@beagleboard.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6830; i=ayush@beagleboard.org; h=from:subject:message-id; bh=9/rpedcTTyGMwyn6LHb+RIA+j2zaGfGSP/fqzhrUXJo=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBmfZM3CjLemMfmgtRjyAG+QFAnKzW5YgCMcFF4n thEWPBvvdCJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZn2TNwAKCRAFzvXHieVa dMDYD/4qz46wFWZWzewi7xIKhBYFSdUuNPu3Z/RnnoAeeEPwArGJMiHZAgbjUWU+Ss7Cizf8eyR Ghzs5yQcnk7cZ0bYK1EBrmvgQW2mAAvni1UHQrUo+4QmgKdt5r8h8F1btWDqxXDBBnAWsSFK9dp eYEe631gu90oesxwkH8j2bqEYw5p1AIAzjbsB6D+d35TOuaQsTasS/CNRmD978KM9+2usW9bu34 82hFjsGAaRdvWAZqKoD5lgFjyajIZXUOxdCguTssgsnTqUU8KtKNJew+0h3iKaOqtKS30fXPdSg cGLrTs2vWrnZh5TCoCv5XjOp//vicjb3aoyQlKMIIweGS+AjgieyrMyRkPakGchUStJmsAxGkDs eo2RBvog3OT9WtWy41N5rMiYIfrW3YA+fBsQylUGKM9/AGDMHwJG+aB08E8yHoqHoPcseHbspUy CmjNihxQt3+nGfq6KC36pCJ7EnInom62np4vafwCvqRvW6aIupMw46jBu+YMKHXD3Xf2kXwoto/ qGfPDTQeco5wFTt1AtEJb/cfESmGI7XLJtLFFahpRq62X+KScegeTDRCQi9nsI8XLB9HYFUAsVf yMbONuFSltU+KjMk/PzoMcJ4iVt+AZswu6UPVplECqGyrbA4352882O7JqRQrWoB2pDzKL3OIBN 4TT4yCa5LCVqZ7A== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_092854_241722_08AFEFDA X-CRM114-Status: GOOD ( 18.44 ) 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 uart, spi, i2c, pwm and other buses. Additionally, some new mikroBUS boards contain 1-wire EEPROM that contains a manifest to describe the addon board to provide plug and play capabilities. 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. Some SPI addon boards use other pins like RST, AN etc as chipselect (eg. SPI Extend Click). Thus, `spi-cs` and `spi-cs-names` property is added to allow mikroBUS addon board to specify chipselect by name. Here's the list of pins in mikroBUS connector: AN - Analog RST - Reset CS - SPI Chip Select SCK - SPI Clock MISO - SPI Master Input Slave Output MOSI - SPI Master Output Slave Input +3.3V - VCC-3.3V power GND - Reference Ground 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 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/spi-extend-click SPI Extend Click Co-developed-by: Vaishnav M A Signed-off-by: Vaishnav M A Signed-off-by: Ayush Singh --- .../bindings/connector/mikrobus-connector.yaml | 107 +++++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 113 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml new file mode 100644 index 000000000000..033479f8604f --- /dev/null +++ b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml @@ -0,0 +1,107 @@ +# 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 connector + +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: + minItems: 1 + maxItems: 9 + items: + enum: [default, pwm_default, pwm_gpio, uart_default, uart_gpio, i2c_default, i2c_gpio, spi_default, + spi_gpio] + + spi-controller: + description: spi-controller of mikroBUS SPI pins along with cs pins. + $ref: /schemas/types.yaml#/definitions/phandle + + spi-cs: + description: spi chip-select corresponding to the chip-selects on the mikrobus socket. + $ref: /schemas/types.yaml#/definitions/uint32-array + + spi-cs-names: + minItems: 1 + maxItems: 12 + items: + enum: [default, pwm, int, rx, tx, scl, sda, an, rst, sck, cipo, copi] + + i2c-controller: + description: i2c controller attached to the mikrobus socket. + $ref: /schemas/types.yaml#/definitions/phandle + + uart-controller: + description: uart controller attached to the mikrobus socket + $ref: /schemas/types.yaml#/definitions/phandle + + pwms: + description: the pwm-controller corresponding to the mikroBUS PWM pin. + maxItems: 1 + + mikrobus-gpios: + minItems: 1 + maxItems: 12 + + mikrobus-gpio-names: + minItems: 1 + maxItems: 12 + items: + enum: [pwm, int, rx, tx, scl, sda, an, rst, cs, sck, cipo, copi] + + board: + description: board attached to mikrobus connector + $ref: /schemas/types.yaml#/definitions/phandle-array + +required: + - compatible + - pinctrl-0 + +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-controller = <&i2c1>; + uart-controller = <&uart1>; + spi-controller = <&spi1>; + spi-cs = <0 1>; + spi-cs-names = "default", "rst"; + 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 807feae089c4..8e4115e93aeb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15108,6 +15108,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/connector/mikrobus-connector.yaml + MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT M: Luka Kovacic M: Luka Perkov