Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp703344lqt; Tue, 19 Mar 2024 00:37:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaKEZHrElWcWv4lRHxM2f8gRxVpRO0ALnxJrV/g/xXoHf823cjU5tXoUL9sVG7b60X91RA3/UWjyOa3FzAtrjkMP2o6pAPqIy5/pvUuA== X-Google-Smtp-Source: AGHT+IGJRE/1N8nbUePJz9DR/AiiE0uW1eFdK23H4enT2LFBjf5D6JT0HJIn4mp2cRb6AWkw55Xw X-Received: by 2002:a05:620a:b0c:b0:788:773f:6f4c with SMTP id t12-20020a05620a0b0c00b00788773f6f4cmr15882798qkg.12.1710833826019; Tue, 19 Mar 2024 00:37:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710833826; cv=pass; d=google.com; s=arc-20160816; b=aG5wcZtLJQq7rCbAFkN038vCOm7UKrmRtY1/5HMj/+bK1wgQPJNaHg2GtYmHM0gM3G ezMEIRqtEn/PvRZ4h8DvIMRCgQq2yDWg2CLvwpuF1sSAyk7ZzaCpbqrbA838ShcjVqYs MhLjNvKiJCfxQIHuq3CfUyWSfALV2VYz7uZ3wPx07f/Pkj61fPELQmNK0KfsckuIvyKb q8Qw8Jz44Q8hrilrxDfff2ilRJDh+cGdRw4KhUwfKaIQmOOTfHRE/2IJfwyhYBjyBG/N +JnjKbPs6l6U8GnvNlEx/jvpvUHJnly/lmBN4vPyL9uDVcc/an2NNobK+qiYal2aqoLT zkfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YHCJlZjtshIG0jJom0kvx9m2BM/FXwZE6cIGEiQKBVE=; fh=RO9c0cliQy/QEYZpYA6Eg8+jBRJD6kjKMyPy/VQFKf4=; b=Nls5R45WcQyfjldJ8dZq/9h3Ni9v71aIjqE+t+DLTKE95tZNJG6xeFxrcRg/pCzMbz GwKFIl1zTW+F7hZeWk4wkdYBVnceg3OQMFwJizxXZYTgLYY3Q9Gb/HHoi2yPn1iwqduW QxVxd8gI6KcQtQhkvyJ6W1o3UmbuO3Xb06Yoqr4CDjJVNo8/4+34tZ58JTx+e1Dgmgip I7OsveP4A0RFmrCJv8O+inwwm1umFFiBtB0d4yPD5Hwx1OiUzWZmXp6vl7GzCjxLdx2M 7Lg4c8gFWGb6A2JAsaEMJyVyM83lhEFkToP/vCLr01jscQMXtKkRwuUTD7l8ZuWF8UN3 6UKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZfG5B1PL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107177-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p9-20020ae9f309000000b00789d0eb9a0dsi10570448qkg.142.2024.03.19.00.37.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 00:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107177-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZfG5B1PL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107177-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B02D61C21A88 for ; Tue, 19 Mar 2024 07:37:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78665535BA; Tue, 19 Mar 2024 07:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZfG5B1PL" Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB4E7535C2; Tue, 19 Mar 2024 07:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710833820; cv=none; b=F+GC7/WODCsr1abN9TbQOd0bd/OnzK91OrWa56MMqBN5G8QbZvP1cLnscWWEYd5lyLMtHEse7oagPoym6W6PFURKD2vm4OK5G2Hx2b5kLcjY/DB67yKRb7pNMzUrmGpu6SQMF3uyj3J0ybISqS39lJajWbqnYCM0gC67ke6v5bI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710833820; c=relaxed/simple; bh=aYKF8fYK6GaqBm60AFe1ecR/BiZetgHAp/vvF6kUymI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ixNKueJste0b1mmQ/ssfG1BpPI+4mBmFvPEWqp6fCY5Gl4owdboDdn7X6U8srNFdAVrpTe4H2lbyhue8mDlZ3S40iiCIgBMWwtHSHyvG8jvwcVYBBVIM/QqRcGL1ZMYHptjwtUdYOepHTskyYTAOFirdWzWTmVgjv+okgxmibyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZfG5B1PL; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5a47abe2ff7so2037603eaf.0; Tue, 19 Mar 2024 00:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710833818; x=1711438618; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YHCJlZjtshIG0jJom0kvx9m2BM/FXwZE6cIGEiQKBVE=; b=ZfG5B1PL4StmrktOo8YojQGwRetO0eVwjmZvwo2IH250g1VVli4QfP84bsGNIwY6Cw pAYsym+mVZZDamX6W++oNNIej7Ay8JfXfiI6N2bXOuG898QPofL8/Zhju1Pei2uTBoup ym8elF3acUdzD+e80plXy+xFGs8MYPNleIkMO2qE0DfxUWhclYcLhRl8U3xL6t0S+XoB KgdrGdBlxbqoxDlyr5vQT9ezDV3vUiMl5YndfRmNXi9TW6qhZtqObp9r3byU5oBneK/0 VpJY2ltedVNHzQiEFVrm8fZhkIta3TeS8NZ3MYUNPDu4C5p/d10lo2m6m6L9ALlRIZkI FADQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710833818; x=1711438618; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YHCJlZjtshIG0jJom0kvx9m2BM/FXwZE6cIGEiQKBVE=; b=djBq2SIyDUDDexBY0mTTH8gSTg7ZQX8qXmxmPExj9K8p2C1boLnMyIFrZsXh6ohn/x U9GH62TkyRaMvz3Vjd49mgHQgj2SAe3SD1fKIF7wPHgRgB+9+eonBcvmOJAACvKgCIyd 5l4bncdays9tCjiK0SdxLzD+3kO8deJ4Uhrv6jCI1xTdj3sPgOw86ZL9X3RsLajEixg4 03NJkZlnERERk3g1TjZ1GLhIV2s/LgOQY76KJpGNK+Spljk1kOiyL+I5vI+dH47QTmHc vM55JGThYjRI52G4Z0CWukS6hNfsMVa62K72qaeVqODalL3rUu7YX4NBt0Sj5B84xaW6 fpkw== X-Forwarded-Encrypted: i=1; AJvYcCVFGEaxH13tYFHjZrKZKYV1U+q17Fs95WjlPxejviWoPd+JeY+urLqk5EMH7fZbmb/ENfXVbIA5AJFYU7FCovmlon4Z77Xa0jzE7LDuodMBLp7Cs6ocn+KYvBwAS5ZaRjM5YIcejBGtM5rQVeuODQ+o9p1FOhboFcEyLFd0rHoEYAdPIw== X-Gm-Message-State: AOJu0YxtRYy7kp3eMrIOz4AiG5sPUV0FpmrViBC3wobo7fuFtLEPNyiU uAzbgiu+Y6ZaAu2MJr75eXl8lvpCFK9x8H3pSUmwb2jNrIgcQWpK X-Received: by 2002:a05:6358:4319:b0:17e:69fd:e8cc with SMTP id r25-20020a056358431900b0017e69fde8ccmr8283727rwc.21.1710833817767; Tue, 19 Mar 2024 00:36:57 -0700 (PDT) Received: from [172.16.116.58] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id e15-20020aa7980f000000b006e6988c64a5sm9100478pfl.208.2024.03.19.00.36.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Mar 2024 00:36:57 -0700 (PDT) Message-ID: Date: Tue, 19 Mar 2024 13:06:39 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/5] dt-bindings: misc: Add mikrobus-connector Content-Language: en-US To: Krzysztof Kozlowski , Michael Walle , open list Cc: 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 , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE" , "open list:SPI SUBSYSTEM" , "moderated list:GREYBUS SUBSYSTEM" , Vaishnav M A References: <20240317193714.403132-1-ayushdevel1325@gmail.com> <20240317193714.403132-2-ayushdevel1325@gmail.com> <0f3f56d4-3381-44f1-91bc-c126f3ced085@linaro.org> From: Ayush Singh In-Reply-To: <0f3f56d4-3381-44f1-91bc-c126f3ced085@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/19/24 11:28, Krzysztof Kozlowski wrote: > On 18/03/2024 18:20, Ayush Singh wrote: >> On 3/18/24 17:52, Michael Walle wrote: >> >>> On Sun Mar 17, 2024 at 8:37 PM CET, Ayush Singh wrote: >>>> 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 ++++++++++++++++++ >>> See also >>> https://lore.kernel.org/r/YmFo+EntwxIsco%2Ft@robh.at.kernel.org/ >>> >>> Looks like this proposal doesn't have the subnodes. How do you >>> attach a kernel driver to it's spi port for example? Only through >>> the manifest files? >>> >>> -michael >> >> So I looked at the Patch, and it seems the approach of fundamentally >> different than this PR. So, let me try to explain what this patch set >> does for an add-on board using SPI. >> >> The device tree defines the SPI controller associated with mikroBUS SPI >> pins. The driver on match queries and takes a reference to the SPI >> controller but does nothing with it. Once a mikroBUS add-on board is >> detected (by passing manifest using sysfs or reading from 1-wire >> EEPROM), the driver parses the manifest, and if it detects an SPI device > As I understood Mikrobus does not have EEPROM. mikroBUS add-on boards do not need to have EEPROM, but they can have it. Simply put, EEPROM is not part of mikroBUS specification, but you will find a lot (especially newer) addon boards with support for EEPROM manifest. Regardless, this patch actually does not contain any code for EEPROM support I have just mentioned it to give more context on why mikroBUS manifest is the focus of this patch instead of DT overlay or something else. >> in manifest, it registers SPI device along with setting properties such >> as `chip_select`, `max_speed_hz`, `mode`, etc., which are defined in the >> manifest. On board removal, it unregisters the SPI device and waits for >> a new mikroBUS board to be detected again. > You explained drivers, not hardware for DT. Yes, I was replying to the question posed by Michael. Since this happens in the driver and not in the devicetree, I needed to explain the working of the driver: > How do you attach a kernel driver to it's spi port for example? For more hardware side, the bindings are for mikrobus connector rather than for any addon board. Thus, while an addon board might not use some of the pins, the connector still needs to have all the pins and associated controllers. >> It is also possible for SPI not to be used by a device, in which case, >> no SPI device is registered to the controller. It is also possible that >> the SPI pins will be used as normal GPIOs. Everything is identified from >> the manifest. > > Best regards, > Krzysztof > Ayush Singh