Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp534379rdb; Wed, 17 Jan 2024 09:16:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQ1/nS3xHbmR0BkJMy/WyURp05/3kLLxUUQxKl+Lv3HNn70zVz9Bim9gOBWdloLlrK/vyM X-Received: by 2002:a54:4388:0:b0:3bd:62f2:4efc with SMTP id u8-20020a544388000000b003bd62f24efcmr8596236oiv.4.1705511768804; Wed, 17 Jan 2024 09:16:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705511768; cv=pass; d=google.com; s=arc-20160816; b=MbBTCnrFfrIYfHVsUzFWcTOwQeWydVWisjxsSWsCenLOzw8H0HsmRHtmg+KL1TwSsd IIxa3TGiSXmxtkMlJkQdkuP6yZzhDGs6HDc7jvWK/ReEQkqQkzYEB1P/W7eQith15gch yY1u6EDbeOK7Tqt0k0XUJMA4m0IlbfLxAStsYs+6yCn0MpCUmAklK3a6chxzdkYqrUgF 9kN2+/P+afH/eKuAll+i6CRZ1lWssJLKMH/F1eeZYln72haxdQ1MDBaebqhLwdn/A0zp hZt0Y52c9zz8U4dewllky0vvrkgGyp2Tf/QcVt4NO4ZuEgkfG+NdfZrXO1q8d3iS2hF1 Ui0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=zVT3PU0cW+s0avKE1jP7V15SsbgqFqqu1SCavUYDkpg=; fh=Wxu4BIUpMdhG1idBspizgRyVd1B11o+LlSyUumLnNzg=; b=FC0PaIVPc0nc+CH3xgFOtS2lkna10uvouh1ndZp4KNN44TDPJK7ABqPMO5s99tqQJu pD2klOQTjk4IZ2EFM17INUSt9lwzM/cEsNfi/KFY/jktdpAYso9GB1trqhMWFHvDq2Fv fCjAjxJgK19MXTiyWHM9WoAwOxSas9aLNcb6OODVnFD52mT10bEOESE2J2WziYds7V1y yuMDCCX74LFZX6oJO6nQu2s7bdh4pF6CI5YB7ljeO4vZ2Z7bs55Y2h69VBObrntWPZjm CXPuaw5R/UIHqYgp02iBZ1Im3CoGm/cvJQ/ghifIMokzbytmD52DSG0SDPh40+zLNYJD cKeQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jd8j/BYi"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-29263-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z10-20020ae9e60a000000b0078310e6af89si8448916qkf.53.2024.01.17.09.16.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:16:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29263-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=@linaro.org header.s=google header.b="jd8j/BYi"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-29263-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 7BC331C21A7C for ; Wed, 17 Jan 2024 17:16:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56C5E22609; Wed, 17 Jan 2024 17:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jd8j/BYi" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 9895C225A6 for ; Wed, 17 Jan 2024 17:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511758; cv=none; b=qbAoZ0KZHsfej0uj8/Rp5rtFn6C+kf9pmwO9Hdr+aPii+9+yomWeui+PKdK//Wf2cWDhbfxCN71LG8fyaOvRfJGh1VwhYd+jRn2Ra/zCO5us8n4G7sVeQye1ESMy4qRjOSve9MtU64ysjm2e5jfroME4eUK0FR84DFAM9yfnyqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511758; c=relaxed/simple; bh=uoW4HUk29kpHj68SF+hGOItA0f/Gp6jWrZH8lGth7lA=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:Autocrypt:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=WM3L++vOOLtn46uGsBd58LzRSdAak2n6Ta8NmIIpoaqB70i9dcOeORkdw5co+wEjJUSX8Y5LH0uekN1kVWq8U/U5hhL11r/KLuN6WCHCuo2og5algOPBKilWmN0lzOUDodeWs/x5jPQzQJXBYMo7CAACNG9uV+GVvt01+4HXkaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jd8j/BYi; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50e9e5c97e1so14312456e87.0 for ; Wed, 17 Jan 2024 09:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705511755; x=1706116555; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zVT3PU0cW+s0avKE1jP7V15SsbgqFqqu1SCavUYDkpg=; b=jd8j/BYieIlPWzg7JmauE5LwpiuFwPC5Rk4fAzgUuPlZtkAPWUZxEXtQds/45HntDG JoVq6QJduHfYpD6F0oyhllf9uKUehmiNbC37eMEvuXY7xXvXqp6Q5lB538qH/NnOs5N1 qfLnZG2BMquOCaRbWlcxJEyOaN60P823K5DYhTQ+CV0uff5Tve83UJA+s9n/iGchBtRq TBoL8vxRW8ouFUTKnDzpVfmiDyw3z01ypTEP0hhW4pDTPBbDE5Z4BwUWmTsYrHIwYM40 eBuBAgpNbPb75yS9AxZSN4aJi+tm/8b+aLJ3buS2+qYk/GTPB4GoUMqXFJTN9aSvdsRw MB6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705511755; x=1706116555; h=content-transfer-encoding:in-reply-to:autocrypt: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=zVT3PU0cW+s0avKE1jP7V15SsbgqFqqu1SCavUYDkpg=; b=IH7DAOgnSv29vpGHM7IZkqeVLJvyQXThV9c0pYwo34hxcN1EKLa3hmyEjXFoF3uHjR auVo5AiVLz62ODugACN2jJ+c6WRh0FWYbWf+4apg7kDmMIQGUb2s+ylls3gisF3Bk+Vq GHXaCy7OD9QsfA0D/huMqlaoaJBVBafJT84I8c89VXhQwfsr5WYsI2MxKOl80/Qtaz3D WVBIw8Yx71DpT5c+0dxUkNMa1NpzGCtCot7mfHYnmkq/pmOXKYFzbQSJbhmm7+hw/sAD 7TDpZQeOKgm7BNUK341bYpGtaVdF1IQNs+wcxZOZ/5ulbiF9Z8Qoaygd710hXst2Kqya kI1w== X-Gm-Message-State: AOJu0Yy4W2JxPhkgUWV2wIlZ0WLD5IbCElIx+Y++geIlocohRRSrzjJE /Lx/3q9ferNVIii8G8nvzQso9g6MBvvf+l5UAXcQUQAUQac= X-Received: by 2002:a05:6512:15a9:b0:50e:b3ae:dd67 with SMTP id bp41-20020a05651215a900b0050eb3aedd67mr4915092lfb.2.1705511754673; Wed, 17 Jan 2024 09:15:54 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id l18-20020a17090612d200b00a28fd9607a8sm7958704ejb.81.2024.01.17.09.15.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 09:15:54 -0800 (PST) Message-ID: Date: Wed, 17 Jan 2024 18:15:51 +0100 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 v2 2/7] dt-bindings: i3c: svc: add compatible string i3c: silvaco,i3c-target-v1 Content-Language: en-US To: Frank Li Cc: Conor Dooley , Conor Dooley , robh@kernel.org, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, gregkh@linuxfoundation.org, imx@lists.linux.dev, jirislaby@kernel.org, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, miquel.raynal@bootlin.com, zbigniew.lukwinski@linux.intel.com, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org References: <20240116-achiness-thievish-10a12b3c08cd@wendy> <20240116-retract-conclude-c47a7fc8cb21@spud> <4a9ed1ca-cd13-4b61-af06-a3d7935aeeee@linaro.org> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b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+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17/01/2024 17:19, Frank Li wrote: >> >> Not really, because compatible describes hardware and it is the same >> hardware here. We do not have two different compatibles for GPIOs being >> input or output. Or two different compatibles for serial engines (ones >> providing UART, SPI or I2C). > > GPIO and UART is simple. Actuall SPI and I2C have two mode, slave and I talked about serial engines which can be multiple: UART, SPI and I2C. > master. Many SPI/I2C is dual mode controller. Just seldom use slave mode > at linux side. So you just see master mode SPI/I2C controller in dt-binding > and dts file. So few people upstream slave part to linux kernel community. > They have the exact same problems if support slave mode. > > PCI is typical example: > EP mode: Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml > RC mode: Documentation/devicetree/bindings/pci/qcom,pcie.yaml > > Which is the same hardware for two difference compatible string. That's the only case, I recall. >> >>> >>> I can write git commit message like: >>> >>> dt-bindings: i3c: svc: add compatible string nxp,imx93-svc-i3c-target >>> >>> silvaco i3c controller is dual mode controller, which can work as master >>> and target mode. All clock, reg, irq are the same for both mode. Add >>> compatible string "nxp,imx93-svc-i3c-target" to let silivaco i3c >>> controller work as target mode. >>> >>> Of course, alternate method to added a property "mode" to distingiush >>> master and target mode. but old "silvaco,i3c-master-v1" will actually work >>> as dual mode support. Driver structure will become complex. >> >> Please send full DTS of user for this, which works for 100%, so we can >> see how it differs from controller mode. If your code snippet from other >> thread is correct, then it would suggest "mode" property or lack of >> children. Maybe lack of children is not enough, if user-space could >> control I3C bus. > > According to current implment, only need change imx93.dtsi's @i3c1's > compatible string to "silvaco,i3c-target-v1". I attached imx93 dts node for > your reference. > > i3c1: i3c-master@44330000 { > compatible = "silvaco,i3c-master-v1"; > ^^^^ only need change here! Nope, don't change compatibles of existing nodes. Unreadable and unmanageable code. > > reg = <0x44330000 0x10000>; > interrupts = ; > #address-cells = <3>; > #size-cells = <0>; > clocks = <&clk IMX93_CLK_BUS_AON>, > <&clk IMX93_CLK_I3C1_GATE>, > <&clk IMX93_CLK_I3C1_SLOW>; > clock-names = "pclk", "fast_clk", "slow_clk"; > dmas = <&edma1 6 0 1>, <&edma1 5 0 0>; > dma-names = "rx", "tx"; > status = "disabled"; > }; That's not a patch for existing file. I did not claim you cannot write such DTS. I claimed you don't have such DTS for upstream... > > For master mode: > Unlike i2c. Genenally I3C can auto probe children node like USB can auto > detect attached devices. So I3C master can work without children nodes. > Such as auto load i3c sensor driver according to i3c standard vendor id and > production id. Then presence of children cannot be used. > > For target mode: using configfs to controller I3C. > > mkdir /sys/kernel/config/i3c_target/functions/tty/t > echo 0x011b > /sys/kernel/config/i3c_target/functions/tty/t/vendor_id > echo 0x1000 > /sys/kernel/config/i3c_target/functions/tty/t/part_id > echo 0x6 > /sys/kernel/config/i3c_target/functions/tty/t/bcr > > ln -s /sys/kernel/config/i3c_target/functions/tty/t /sys/kernel/config/i3c_target/controllers/44330000.i3c-master/ > > Then you echo test >/dev/ttySI3C0. > > Unlike USB, user can switch host and gadget mode dymatically. Suppose I3C > only work on one of master or slave mode only, which is static. I don't understand this. So it can switch dynamically or not? > > Although it is one hardware, I think it is exculsive multi function device. Just like serial engines. Do you see there replacing compatibles? No. > > Summary: basice two option to distingiush controller and target mode. > 1. by "compatible" string > 2. by "mode" > > I think 1 is relatively simple and easy to understand. Eh, if you only saw my comments on people replacing compatibles... Anyway, I stated my reasons, so to reiterate: NAK. Best regards, Krzysztof