Re: [PATCH v3 1/3] ARM: imx7d-remarkable2.dts: Initial device tree for reMarkable2

2021-03-09 Thread Alistair Francis
On Wed, Mar 3, 2021 at 8:44 AM Shawn Guo  wrote:
>
> On Wed, Feb 03, 2021 at 07:03:14PM -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.
>
> Just out of curiosity, this is a DIY cable or something generally
> available from vendor?

It's a DIY cable, it's a bit of a pain to put together. You can see
what it looks like here: https://github.com/ddvk/remarkable2-recovery

>
> >
> > Currently the kernel boots, but there is no support for the dispaly,
> > WiFi or the power controller chips.
>
> There are still some WiFi related devices.  Can we drop all those
> untested stuff?

I have WiFi working on the 5.4 NXP branch. I was actually thinking
that WiFi should just work if the rootFS and FW all match. The main
problem is that the kernel expects a firmware version that isn't in
linux-firmware.

I have removed it for now though.

>
> >
> > Signed-off-by: Alistair Francis 
> > ---
> >  arch/arm/boot/dts/Makefile  |   1 +
> >  arch/arm/boot/dts/imx7d-remarkable2.dts | 253 
> >  2 files changed, 254 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..9608c363b25f 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -658,6 +658,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
> >   imx7d-pico-hobbit.dtb \
> >   imx7d-pico-nymph.dtb \
> >   imx7d-pico-pi.dtb \
> > + imx7d-remarkable2.dtb \
> >   imx7d-sbc-imx7.dtb \
> >   imx7d-sdb.dtb \
> >   imx7d-sdb-reva.dtb \
> > diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts 
> > b/arch/arm/boot/dts/imx7d-remarkable2.dts
> > new file mode 100644
> > index ..0aae13f5eed6
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
> > @@ -0,0 +1,253 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/
> > + *
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "imx7d.dtsi"
> > +
> > +/ {
> > + model = "reMarkable 2.0";
> > + compatible = "fsl,imx7d-remarkable2", "fsl,imx7d";
>
> The new compatible needs to be documented.  Also the compatible doesn't
> look right, as this is a device from reMarkable rather than FSL.

Done and done.

Alistair

>
> Shawn
>
> > +
> > + chosen {
> > + stdout-path = 
> > + };
> > +
> > + memory {
> > + reg = <0x8000 0x4000>;
> > + };
> > +
> > + reg_brcm: regulator-brcm {
> > + compatible = "regulator-fixed";
> > + regulator-name = "brcm_reg";
> > + regulator-min-microvolt = <330>;
> > + regulator-max-microvolt = <330>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <_brcm_reg>;
> > + gpio = < 13 GPIO_ACTIVE_HIGH>;
> > + enable-active-high;
> > + startup-delay-us = <150>;
> > + };
> > +
> > + wifi_pwrseq: wifi_pwrseq {
> > + compatible = "mmc-pwrseq-simple";
> > + pinctrl-names = "default";
> > + pinctrl-0 = <_wifi>;
> > + reset-gpios = < 9 GPIO_ACTIVE_LOW>;
> > + clocks = < IMX7D_CLKO2_ROOT_DIV>;
> > + clock-names = "ext_clock";
> > + };
> > +};
> > +
> > + {
> > + assigned-clocks = < IMX7D_CLKO2_ROOT_SRC>,
> > +   < IMX7D_CLKO2_ROOT_DIV>;
> > + assigned-clock-parents = < IMX7D_CKIL>;
> > + assigned-clock-rates = <0>, <32768>;
> > +};
> > +
> > + {
> > + status = "disabled";
> > +};
> > +
> > +_apbh {
> > + status = "disabled";
> > +};
> > +
> > + {
> > + status = "okay";
> > +};
> > +
> > + {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <_uart1>;
> > + assigned-clocks = < IMX7D_UART1_ROOT_SRC>;
> > + assigned-clock-parents = < IMX7D_OSC_24M_CLK>;
> > + status = "okay";
> > +};
> > +
> > + {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <_uart6>;
> > + assigned-clocks = < IMX7D_UART6_ROOT_SRC>;
> > + assigned-clock-parents = < IMX7D_OSC_24M_CLK>;
> > + status = "okay";
> > +};
> > +
> > + {
> > + srp-disable;
> > + hnp-disable;
> > + status = "okay";
> > +};
> > +
> > + {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + pinctrl-names = "default", "state_100mhz", "sleep";
> > + pinctrl-0 = <_usdhc2>;
> > + pinctrl-1 = <_usdhc2_100mhz>;
> > + pinctrl-2 = <_usdhc2>;
> > + mmc-pwrseq = <_pwrseq>;
> > + vmmc-supply = 

Re: [PATCH v3 1/3] ARM: imx7d-remarkable2.dts: Initial device tree for reMarkable2

2021-03-03 Thread Shawn Guo
On Wed, Feb 03, 2021 at 07:03:14PM -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.

Just out of curiosity, this is a DIY cable or something generally
available from vendor?

> 
> Currently the kernel boots, but there is no support for the dispaly,
> WiFi or the power controller chips.

There are still some WiFi related devices.  Can we drop all those
untested stuff?

> 
> Signed-off-by: Alistair Francis 
> ---
>  arch/arm/boot/dts/Makefile  |   1 +
>  arch/arm/boot/dts/imx7d-remarkable2.dts | 253 
>  2 files changed, 254 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..9608c363b25f 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -658,6 +658,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
>   imx7d-pico-hobbit.dtb \
>   imx7d-pico-nymph.dtb \
>   imx7d-pico-pi.dtb \
> + imx7d-remarkable2.dtb \
>   imx7d-sbc-imx7.dtb \
>   imx7d-sdb.dtb \
>   imx7d-sdb-reva.dtb \
> diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts 
> b/arch/arm/boot/dts/imx7d-remarkable2.dts
> new file mode 100644
> index ..0aae13f5eed6
> --- /dev/null
> +++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
> @@ -0,0 +1,253 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> + * Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/
> + *
> + */
> +
> +/dts-v1/;
> +
> +#include "imx7d.dtsi"
> +
> +/ {
> + model = "reMarkable 2.0";
> + compatible = "fsl,imx7d-remarkable2", "fsl,imx7d";

The new compatible needs to be documented.  Also the compatible doesn't
look right, as this is a device from reMarkable rather than FSL.

Shawn

> +
> + chosen {
> + stdout-path = 
> + };
> +
> + memory {
> + reg = <0x8000 0x4000>;
> + };
> +
> + reg_brcm: regulator-brcm {
> + compatible = "regulator-fixed";
> + regulator-name = "brcm_reg";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + pinctrl-names = "default";
> + pinctrl-0 = <_brcm_reg>;
> + gpio = < 13 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + startup-delay-us = <150>;
> + };
> +
> + wifi_pwrseq: wifi_pwrseq {
> + compatible = "mmc-pwrseq-simple";
> + pinctrl-names = "default";
> + pinctrl-0 = <_wifi>;
> + reset-gpios = < 9 GPIO_ACTIVE_LOW>;
> + clocks = < IMX7D_CLKO2_ROOT_DIV>;
> + clock-names = "ext_clock";
> + };
> +};
> +
> + {
> + assigned-clocks = < IMX7D_CLKO2_ROOT_SRC>,
> +   < IMX7D_CLKO2_ROOT_DIV>;
> + assigned-clock-parents = < IMX7D_CKIL>;
> + assigned-clock-rates = <0>, <32768>;
> +};
> +
> + {
> + status = "disabled";
> +};
> +
> +_apbh {
> + status = "disabled";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_uart1>;
> + assigned-clocks = < IMX7D_UART1_ROOT_SRC>;
> + assigned-clock-parents = < IMX7D_OSC_24M_CLK>;
> + status = "okay";
> +};
> +
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_uart6>;
> + assigned-clocks = < IMX7D_UART6_ROOT_SRC>;
> + assigned-clock-parents = < IMX7D_OSC_24M_CLK>;
> + status = "okay";
> +};
> +
> + {
> + srp-disable;
> + hnp-disable;
> + status = "okay";
> +};
> +
> + {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + pinctrl-names = "default", "state_100mhz", "sleep";
> + pinctrl-0 = <_usdhc2>;
> + pinctrl-1 = <_usdhc2_100mhz>;
> + pinctrl-2 = <_usdhc2>;
> + mmc-pwrseq = <_pwrseq>;
> + vmmc-supply = <_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";
> + };
> +};
> +
> + {
> + pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
> + pinctrl-0 = <_usdhc3>;
> + pinctrl-1 = <_usdhc3_100mhz>;
> + pinctrl-2 = <_usdhc3_200mhz>;
> + pinctrl-3 = <_usdhc3>;
> + assigned-clocks = < IMX7D_USDHC3_ROOT_CLK>;
> + assigned-clock-rates = <4>;
> + bus-width = <8>;
> + non-removable;
> + status = "okay";
> +};
> +
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_wdog>;
> +