Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp532964pxa; Thu, 27 Aug 2020 08:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1q0Nu/n1ytWkiV0sJWInBryNBmxUcSPHtd/JAnluhH4qf9y/qXfygdpwy/4Mt44Hgdenh X-Received: by 2002:a17:906:af51:: with SMTP id ly17mr20123988ejb.193.1598543344096; Thu, 27 Aug 2020 08:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598543344; cv=none; d=google.com; s=arc-20160816; b=WQ/krSpbPHO1XMLfbP4jCScsruugY6L+C8UIvSGrSvv/GpIX2FwvldMJDBDh9hC6Ch xjmwM0avzQZrrQsmEGMvKe0uTkvBkClogHpwYZx4vyImeb3HJdJRxKEtBZJzwPyFqVlC 1Rh29m1ZT+BYZagzQwuqhA5Y3Pee3e1IK4PoR41CPsGQ/jEA9G5HfgV4JszE2sHMXfBb HO0BhzUCLLkws/maCssNoq3XT3PtIEeVhVR49o7z3/BQLK7wmwnkDe+4Vh9yotswP5Jb ceOiJSE1IY6M2aab71+nwUWkT/sfhfvMYdeKiN21sJljL2+IMMKvXqNOw3AZruT/PpZA 2pkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8gwEtLfsaquBBEyTUJexqC+QaILgv972sYnvpm7TrNM=; b=AXVpO1UWPYXce4GnnqDQHMzwnUCk+KSORhXYTSsuUvZ7pRPUzkgkeFs7zcjEsat10b PHKAwhe/RjT2pn99rhMLb4SpCxjkE5+PUpY/z9eLoXZi0xN/I0hdSfLuQANzI4baHer/ 0lLVRMeHe6NoPLWWxT2n5Bhw9SlQv70zUF/k+iy/tLl9huReyBD/KzOQutYky49boO8l REW3mZq1rsrwObHD9dxB6/MTrP5sekRmNkzS481OOQ19RqI4uT149Y2HigNDvOePOiKb 4EvVBgNg/e979KWXkIASnaZYiIQdVGz5au+zdXhVORqy0dXB8i7oRZKcfGvu1NRvITgw 9QUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ifRzaft0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si1627154ejj.253.2020.08.27.08.48.40; Thu, 27 Aug 2020 08:49:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ifRzaft0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727821AbgH0Ppi (ORCPT + 99 others); Thu, 27 Aug 2020 11:45:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:47906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbgH0Pph (ORCPT ); Thu, 27 Aug 2020 11:45:37 -0400 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3547C22BEA for ; Thu, 27 Aug 2020 15:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598543136; bh=eqyMLLIE6kyA51bhC2FJ8DP5oiJHdLVYqUGcsum4sX4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ifRzaft039UAuM3khcciusxkwpXhFv/X7on+pB+TJdRBBN9pKAtYcHEkx3VgdQ9Rg xVNPgdJoXr59hjr48cT5j9EbfDy1yfro0MTlQT4JLck0VzSUA36Ob1x6VD4d6PggpC PVy7yzeKTy54rJgUqaRqLxlAW7CVBenVQU/VyPRo= Received: by mail-ot1-f48.google.com with SMTP id 5so4732300otp.12 for ; Thu, 27 Aug 2020 08:45:36 -0700 (PDT) X-Gm-Message-State: AOAM531GDXoch0KBRga69mHZsoaCfOwijYutYWz7uPhTtqmXEJE8ogzB iJFgCkFH8Rm3oGsJEb5kE0ipsKAGF/F9u8wcBQ== X-Received: by 2002:a05:6830:1d94:: with SMTP id y20mr6834595oti.129.1598543135457; Thu, 27 Aug 2020 08:45:35 -0700 (PDT) MIME-Version: 1.0 References: <20200818124815.11029-1-vaishnav@beagleboard.org> <20200818124815.11029-4-vaishnav@beagleboard.org> In-Reply-To: <20200818124815.11029-4-vaishnav@beagleboard.org> From: Rob Herring Date: Thu, 27 Aug 2020 09:45:23 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 3/3] Add Device Tree Bindings for mikroBUS port To: Vaishnav M A Cc: greybus-dev@lists.linaro.org, "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Arnd Bergmann , Johan Hovold , elder@kernel.org, Mauro Carvalho Chehab , David Miller , Jason Kridner , Drew Fustini , robertcnelson@beagleboard.org, rajkovic@mikroe.com, chrisfriedt@gmail.com, zoran.stojsavljevic@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 6:48 AM Vaishnav M A wrote: > > This patch adds device tree bindings for the mikroBUS port, > device tree overlays for the mikrobus Port on the BeagleBoard.org > PocketBeagle is available here : > github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-MIKROBUS-0.dts > > Signed-off-by: Vaishnav M A > --- > .../bindings/misc/linux,mikrobus.txt | 81 +++++++++++++++++++ > 1 file changed, 81 insertions(+) > create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt > > diff --git a/Documentation/devicetree/bindings/misc/linux,mikrobus.txt b/Documentation/devicetree/bindings/misc/linux,mikrobus.txt > new file mode 100644 > index 000000000000..99f75caf5f35 > --- /dev/null > +++ b/Documentation/devicetree/bindings/misc/linux,mikrobus.txt > @@ -0,0 +1,81 @@ > +mikroBUS add-on board socket > + > +Required properties: > +- compatible: Must be "linux,mikrobus" mikrobus is only a Linux thing? Just 'mikrobus-connector' is fine. Are there versions of mikrobus spec/connectors? If so, then should probably include that into > +- i2c-adapter: phandle to the i2c adapter attached to the mikrobus socket. > +- spi-master: spi bus number of the spi-master attached to the mikrobus socket. > +- spi-cs: spi chip-select numbers corresponding to the chip-selects > + on the mikrobus socket(0 -> chip select corresponding to CS pin > + 1 -> chip select corresponding to RST pin). SPI and I2C need a common way to remap from host bus/cs to connector bus/cs including how to define the child devices and multiple instances. > +- serdev-controller: phandle to the uart port attached to the mikrobus socket. 'serdev' is a Linuxism. This also needs to be defined how child devices and multiple instances. There's also a problem with the current serdev implementation that assigning a serial port to serdev or tty is a one time decision as probe time. So I don't think hotplug of a serial device will work today. But that's a Linux problem independent of the binding. > +- pwms: phandle to the pwm-controller corresponding to the mikroBUS PWM pin. The PWM binding has a provider specific number of cells, so some translation is needed. Probably can define a 'pwm-map' property like gpio-map on this. More below. > +- mikrobus-gpios: gpios array corresponding to GPIOs on the mikroBUS port, > + for targets not supporting the AN pin on the mikroBUS port as > + GPIO, the length of the gpios array can be 11, otherwise it > + should be 12. We have 'gpio-map' binding already (it's in the DT spec) created for this purpose of remapping connector GPIO numbers to host GPIO numbers. > +- pinctrl-names: pinctrl state names to support additional pin usage/deviations > + from mikroBUS socket standard usage, must be "default", > + "pwm_default", "pwm_gpio", "uart_default", "uart_gpio", > + "i2c_default", "i2c_gpio", "spi_default", "spi_gpio", these > + pinctrl names should have corresponding pinctrl-N entries which > + corresponds to the pinmux state for the pingroup, for example, > + i2c_default corresponds to the state where the I2C pin group > + (SCL,SDA) are configured in I2C mode and i2c_gpio mode corresponds > + to the pinmux state where these pins are configured as GPIO. > +- pinctrl-N : pinctrl-(0-8) corresponds to the pinctrl states for the states described > + above. > + > +Example: > + mikrobus-0 { > + compatible = "linux,mikrobus"; > + status = "okay"; > + 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 > + >; > + i2c-adapter = <&i2c1>; > + spi-master = <0>; > + spi-cs = <0 1>; > + serdev-controller = <&uart4>; > + pwms = <&ehrpwm1 0 500000 0>; > + mikrobus-gpios = <&gpio1 18 0> , <&gpio0 23 0>, > + <&gpio0 30 0> , <&gpio0 31 0>, > + <&gpio0 15 0> , <&gpio0 14 0>, > + <&gpio0 4 0> , <&gpio0 3 0>, > + <&gpio0 2 0> , <&gpio0 5 0>, > + <&gpio2 25 0> , <&gpio2 3 0>; > + }; > \ No newline at end of file > -- > 2.25.1 >