linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Alistair Francis <alistair@alistair23.me>
Cc: devicetree@vger.kernel.org, arnd@arndb.de,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de,
	olof@lixom.net, alistair23@gmail.com, festevam@gmail.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/3] imx7d-remarkable2.dts: Initial device tree for reMarkable2
Date: Fri, 29 Jan 2021 16:07:56 +0800	[thread overview]
Message-ID: <20210129080755.GI4356@dragon> (raw)
In-Reply-To: <20210117180301.1956-1-alistair@alistair23.me>

On Sun, Jan 17, 2021 at 10:02:59AM -0800, Alistair Francis wrote:
> The reMarkable2 (https://remarkable.com) is an e-ink tablet based on
> the imx7d SoC.
> 
> This commit is based on the DTS provide by reMarkable but ported to the
> latest kernel (instead of 4.14). I have removed references to
> non-upstream devices and have changed the UART so that the console can
> be accessed without having to open up the device via the OTG pogo pins.
> 
> Currently the kernel boots, but there is no support for the dispaly,
> WiFi or the power controller chips.
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> ---
> v2:
>  - No change to this patch, use the existing defconfig
> 
>  arch/arm/boot/dts/Makefile              |   1 +
>  arch/arm/boot/dts/imx7d-remarkable2.dts | 375 ++++++++++++++++++++++++
>  2 files changed, 376 insertions(+)
>  create mode 100644 arch/arm/boot/dts/imx7d-remarkable2.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 3d1ea0b25168..5fca2612ef58 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -664,6 +664,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
>  	imx7d-sdb-sht11.dtb \
>  	imx7d-zii-rmu2.dtb \
>  	imx7d-zii-rpu2.dtb \
> +	imx7d-remarkable2.dtb \

Please keep the list alphabetically sorted.

>  	imx7s-colibri-aster.dtb \
>  	imx7s-colibri-eval-v3.dtb \
>  	imx7s-mba7.dtb \
> diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts
> new file mode 100644
> index 000000000000..fba55a0e028a
> --- /dev/null
> +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
> @@ -0,0 +1,375 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This file is distributed in the hope that it will be useful,
> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *     GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use,
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.

With the SPDX-License-Identifier tag on the first line, we can save the
license text here.

> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d.dtsi"
> +
> +/ {
> +	model = "reMarkable 2.0";
> +	compatible = "fsl,imx7d-sdb", "fsl,imx7d";

We should have a reMarkable specific compatible.

> +
> +	chosen {
> +		stdout-path = &uart6;
> +	};
> +
> +	memory {
> +		reg = <0x80000000 0x40000000>;
> +	};
> +
> +	reg_vref_1v8: regulator-vref-1v8 {

Drop unused fixed regulator.  You should only add it when there is an
user for it.

> +		compatible = "regulator-fixed";
> +		regulator-name = "vref-1v8";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	reg_brcm: regulator-brcm {
> +		compatible = "regulator-fixed";
> +		regulator-name = "brcm_reg";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_brcm_reg>;
> +		pinctrl-1 = <&pinctrl_brcm_reg>;

Please double check if corresponding upstream driver actually supports
"sleep" pinctrl state, before you add it into the device node.

> +		gpio = <&gpio6 13 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		startup-delay-us = <150>;
> +	};
> +
> +	reg_digitizer: regulator-digitizer {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VDD_3V3_DIGITIZER";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_digitizer_reg>;
> +		pinctrl-1 = <&pinctrl_digitizer_reg>;
> +		gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		startup-delay-us = <100000>; /* 100 ms */
> +	};
> +
> +	reg_touch: regulator-touch {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VDD_3V3_TOUCH";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_touch_reg>;
> +		pinctrl-1 = <&pinctrl_touch_reg>;
> +		gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
> +	reg_sdoe: regulator-sdoe {
> +		compatible = "regulator-fixed";
> +		regulator-name = "SDOE";
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_sdoe_reg>;
> +		pinctrl-1 = <&pinctrl_sdoe_reg>;
> +		gpio = <&gpio3 27 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
> +	reg_gdoe: regulator-gdoe {
> +		compatible = "regulator-fixed";
> +		regulator-name = "GDOE";
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_gdoe_reg>;
> +		pinctrl-1 = <&pinctrl_gdoe_reg>;
> +		gpio = <&gpio3 21 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		regulator-always-on;
> +	};
> +
> +	wifi_pwrseq: wifi_pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		pinctrl-names = "default", "sleep";
> +		pinctrl-0 = <&pinctrl_wifi>;
> +		pinctrl-1 = <&pinctrl_wifi>;
> +		reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
> +		clocks = <&clks IMX7D_CLKO2_ROOT_DIV>;
> +		clock-names = "ext_clock";
> +	};
> +};
> +
> +&clks {
> +	assigned-clocks = <&clks IMX7D_CLKO2_ROOT_SRC>,
> +			  <&clks IMX7D_CLKO2_ROOT_DIV>;
> +	assigned-clock-parents = <&clks IMX7D_CKIL>;
> +	assigned-clock-rates = <0>, <32768>;
> +};
> +
> +&crypto {
> +	status = "disabled";
> +};
> +
> +&dma_apbh {
> +	status = "disabled";
> +};
> +
> +&sdma {
> +	status = "okay";
> +};
> +
> +&uart1 {
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&pinctrl_uart1>;
> +	pinctrl-1 = <&pinctrl_uart1>;
> +	assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>;
> +	assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
> +	status = "okay";
> +};
> +
> +&uart6 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_uart6>;
> +	assigned-clocks = <&clks IMX7D_UART6_ROOT_SRC>;
> +	assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
> +	status = "okay";
> +};
> +
> +&usbotg2 {
> +	srp-disable;
> +	hnp-disable;
> +	asp-disable;

Unsupported property.

> +	phy-charger-detection;

Ditto

> +	status = "okay";
> +};
> +
> +&usdhc2 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	pinctrl-names = "default", "state_100mhz", "sleep";
> +	pinctrl-0 = <&pinctrl_usdhc2>;
> +	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
> +	pinctrl-2 = <&pinctrl_usdhc2>;
> +	mmc-pwrseq = <&wifi_pwrseq>;
> +	vmmc-supply = <&reg_brcm>;
> +	bus-width = <4>;
> +	non-removable;
> +	keep-power-in-suspend;
> +	cap-power-off-card;
> +	status = "okay";
> +
> +	brcmf: bcrmf@1 {
> +		reg = <1>;
> +		compatible = "brcm,bcm4329-fmac";
> +	};
> +};
> +
> +&usdhc3 {
> +	pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
> +	pinctrl-0 = <&pinctrl_usdhc3>;
> +	pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
> +	pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
> +	pinctrl-3 = <&pinctrl_usdhc3>;
> +	assigned-clocks = <&clks IMX7D_USDHC3_ROOT_CLK>;
> +	assigned-clock-rates = <400000000>;
> +	bus-width = <8>;
> +	non-removable;
> +	status = "okay";
> +};
> +
> +&wdog1 {
> +	pinctrl-names = "default", "sleep";
> +	pinctrl-0 = <&pinctrl_wdog>;
> +	pinctrl-1 = <&pinctrl_wdog>;
> +	fsl,ext-reset-output;
> +};
> +
> +&iomuxc_lpsr {
> +	pinctrl_digitizer_reg: digitizerreggrp {
> +		fsl,pins = <
> +			/* DIGITIZER_PWR_EN */
> +			MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x14
> +		>;
> +	};
> +};
> +
> +&iomuxc {
> +	pinctrl_bd71815: bd71815grp {
> +		fsl,pins = <
> +			MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16	0x59
> +		>;
> +	};

Add pinctrl entry only when there is actually an user of it.

> +
> +	pinctrl_uart1: uart1grp {
> +		fsl,pins = <
> +			MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX	0x79
> +			MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX	0x79
> +		>;
> +	};
> +
> +	pinctrl_uart6: uart6grp {
> +		fsl,pins = <
> +			MX7D_PAD_EPDC_DATA09__UART6_DCE_TX		0x79
> +			MX7D_PAD_EPDC_DATA08__UART6_DCE_RX		0x79
> +		>;
> +	};
> +
> +	pinctrl_usdhc2: usdhc2grp {
> +		fsl,pins = <
> +			MX7D_PAD_SD2_CMD__SD2_CMD		0x59
> +			MX7D_PAD_SD2_CLK__SD2_CLK		0x19
> +			MX7D_PAD_SD2_DATA0__SD2_DATA0		0x59
> +			MX7D_PAD_SD2_DATA1__SD2_DATA1		0x59
> +			MX7D_PAD_SD2_DATA2__SD2_DATA2		0x59
> +			MX7D_PAD_SD2_DATA3__SD2_DATA3		0x59
> +		>;
> +	};
> +
> +	pinctrl_usdhc2_100mhz: usdhc2grp_100mhz {
> +		fsl,pins = <
> +			MX7D_PAD_SD2_CMD__SD2_CMD		0x5a
> +			MX7D_PAD_SD2_CLK__SD2_CLK		0x1a
> +			MX7D_PAD_SD2_DATA0__SD2_DATA0		0x5a
> +			MX7D_PAD_SD2_DATA1__SD2_DATA1		0x5a
> +			MX7D_PAD_SD2_DATA2__SD2_DATA2		0x5a
> +			MX7D_PAD_SD2_DATA3__SD2_DATA3		0x5a
> +		>;
> +	};
> +
> +	pinctrl_usdhc2_200mhz: usdhc2grp_200mhz {

No user of it.

> +		fsl,pins = <
> +			MX7D_PAD_SD2_CMD__SD2_CMD		0x5b
> +			MX7D_PAD_SD2_CLK__SD2_CLK		0x1b
> +			MX7D_PAD_SD2_DATA0__SD2_DATA0		0x5b
> +			MX7D_PAD_SD2_DATA1__SD2_DATA1		0x5b
> +			MX7D_PAD_SD2_DATA2__SD2_DATA2		0x5b
> +			MX7D_PAD_SD2_DATA3__SD2_DATA3		0x5b
> +		>;
> +	};
> +
> +

One newline is good enough.

> +	pinctrl_usdhc3: usdhc3grp {
> +		fsl,pins = <
> +			MX7D_PAD_SD3_CMD__SD3_CMD		0x59
> +			MX7D_PAD_SD3_CLK__SD3_CLK		0x19
> +			MX7D_PAD_SD3_DATA0__SD3_DATA0		0x59
> +			MX7D_PAD_SD3_DATA1__SD3_DATA1		0x59
> +			MX7D_PAD_SD3_DATA2__SD3_DATA2		0x59
> +			MX7D_PAD_SD3_DATA3__SD3_DATA3		0x59
> +			MX7D_PAD_SD3_DATA4__SD3_DATA4		0x59
> +			MX7D_PAD_SD3_DATA5__SD3_DATA5		0x59
> +			MX7D_PAD_SD3_DATA6__SD3_DATA6		0x59
> +			MX7D_PAD_SD3_DATA7__SD3_DATA7		0x59
> +			MX7D_PAD_SD3_STROBE__SD3_STROBE		0x19
> +		>;
> +	};
> +
> +	pinctrl_usdhc3_100mhz: usdhc3grp_100mhz {
> +		fsl,pins = <
> +			MX7D_PAD_SD3_CMD__SD3_CMD		0x5a
> +			MX7D_PAD_SD3_CLK__SD3_CLK		0x1a
> +			MX7D_PAD_SD3_DATA0__SD3_DATA0		0x5a
> +			MX7D_PAD_SD3_DATA1__SD3_DATA1		0x5a
> +			MX7D_PAD_SD3_DATA2__SD3_DATA2		0x5a
> +			MX7D_PAD_SD3_DATA3__SD3_DATA3		0x5a
> +			MX7D_PAD_SD3_DATA4__SD3_DATA4		0x5a
> +			MX7D_PAD_SD3_DATA5__SD3_DATA5		0x5a
> +			MX7D_PAD_SD3_DATA6__SD3_DATA6		0x5a
> +			MX7D_PAD_SD3_DATA7__SD3_DATA7		0x5a
> +			MX7D_PAD_SD3_STROBE__SD3_STROBE		0x1a
> +		>;
> +	};
> +
> +	pinctrl_usdhc3_200mhz: usdhc3grp_200mhz {
> +		fsl,pins = <
> +			MX7D_PAD_SD3_CMD__SD3_CMD		0x5b
> +			MX7D_PAD_SD3_CLK__SD3_CLK		0x1b
> +			MX7D_PAD_SD3_DATA0__SD3_DATA0		0x5b
> +			MX7D_PAD_SD3_DATA1__SD3_DATA1		0x5b
> +			MX7D_PAD_SD3_DATA2__SD3_DATA2		0x5b
> +			MX7D_PAD_SD3_DATA3__SD3_DATA3		0x5b
> +			MX7D_PAD_SD3_DATA4__SD3_DATA4		0x5b
> +			MX7D_PAD_SD3_DATA5__SD3_DATA5		0x5b
> +			MX7D_PAD_SD3_DATA6__SD3_DATA6		0x5b
> +			MX7D_PAD_SD3_DATA7__SD3_DATA7		0x5b
> +			MX7D_PAD_SD3_STROBE__SD3_STROBE		0x1b
> +		>;
> +	};
> +
> +	pinctrl_brcm_reg: brcmreggrp {

Please sort pinctrl nodes alphabetically.

Shawn

> +		fsl,pins = <
> +			/* WIFI_PWR_EN */
> +			MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13	0x14
> +		>;
> +	};
> +
> +	pinctrl_wifi: wifigrp {
> +		fsl,pins = <
> +			/* WiFi Reg On */
> +			MX7D_PAD_SD2_CD_B__GPIO5_IO9		0x00000014
> +			/* WiFi Sleep 32k */
> +			MX7D_PAD_SD1_WP__CCM_CLKO2		0x00000014
> +		>;
> +	};
> +
> +	pinctrl_wdog: wdoggrp {
> +		fsl,pins = <
> +			MX7D_PAD_ENET1_COL__WDOG1_WDOG_ANY	0x74
> +		>;
> +	};
> +
> +	pinctrl_touch_reg: touchreggrp {
> +		fsl,pins = <
> +			/* TOUCH_PWR_EN */
> +			MX7D_PAD_GPIO1_IO11__GPIO1_IO11		0x14
> +		>;
> +	};
> +
> +	pinctrl_sdoe_reg: sdoereggrp {
> +		fsl,pins = <
> +			MX7D_PAD_LCD_DATA22__GPIO3_IO27		0x74
> +		>;
> +	};
> +
> +	pinctrl_gdoe_reg: gdoereggrp {
> +		fsl,pins = <
> +			MX7D_PAD_LCD_DATA16__GPIO3_IO21		0x74
> +		>;
> +	};
> +};
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2021-01-29  8:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 18:02 [PATCH v2 1/3] imx7d-remarkable2.dts: Initial device tree for reMarkable2 Alistair Francis
2021-01-17 18:03 ` [PATCH v2 2/3] arch/arm/configs: Regenerate imx_v6_v7_defconfig Alistair Francis
2021-01-17 18:03 ` [PATCH v2 3/3] arch/arm/configs: Enable VMSPLIT_2G in imx_v6_v7_defconfig Alistair Francis
2021-01-29  7:13   ` Shawn Guo
2021-02-03  2:37     ` Alistair Francis
2021-02-03  7:50       ` Arnd Bergmann
2021-02-04  6:55         ` Alistair Francis
2021-01-29  8:07 ` Shawn Guo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210129080755.GI4356@dragon \
    --to=shawnguo@kernel.org \
    --cc=alistair23@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).