mbox series

[v5,0/3] Add support for the Purism Librem5 devkit

Message ID 20190417165514.18689-1-angus@akkea.ca
Headers show
Series Add support for the Purism Librem5 devkit | expand

Message

Angus Ainslie April 17, 2019, 4:55 p.m. UTC
The Librem5 devkit is based on the imx8mq from NXP. This is a default
devicetree to boot the board to a command prompt.

Changes since v4:

Compiled against linux-next next-20190415.
Added imx8mq to the arm yaml file.
Re-arrange regulator nodes to dropp undefined supplies.
Additional ordering for aesthetics.
Split some long lines.
Added lots of blank lines.
Moved pinctl muxes to where they are used.
Cleaned out reg defintions from regulator nodes.

Changes since v3:

Freshly sorted and pressed nodes.
Change the backlight to an interpolated scale.
Dropped i2c2.
Dropped devkit version number to match debian MR.

Changes since v2:

Fixed incorrect phy-supply for the fsl-fec.
Dropped unused regulator property.
Fixup Makefile for linux-next.

Changes since v1:

Dropped config file.
Updated the board compatible label.
Changed node names to follow naming conventions.
Added a more complete regulator hierachy.
Removed unused nodes.
Removed unknown devices.
Fixed comment style.
Dropped undocumented properties.


Angus Ainslie (Purism) (3):
  arm64: dts: fsl: librem5: Add a device tree for the Librem5 devkit
  dt-bindings: Add an entry for Purism SPC
  dt-bindings: arm: fsl: Add the imx8mq boards

 .../devicetree/bindings/arm/fsl.yaml          |   7 +
 .../devicetree/bindings/vendor-prefixes.txt   |   1 +
 arch/arm64/boot/dts/freescale/Makefile        |   1 +
 .../dts/freescale/imx8mq-librem5-devkit.dts   | 833 ++++++++++++++++++
 4 files changed, 842 insertions(+)
 create mode 100644 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts

Comments

Rob Herring April 18, 2019, 3:13 p.m. UTC | #1
On Wed, Apr 17, 2019 at 09:55:12AM -0700, Angus Ainslie (Purism) wrote:
> This is the development kit board for the Librem 5. The current level of
> support yields a working console and is able to boot userspace from the
> Network or eMMC.
> 
> Additional subsystems that are active :
> 
> - Both USB ports
> - SD card socket
> - WiFi usdhc
> - WWAN modem
> - GNSS
> - GPIO keys
> - LEDs
> - gyro
> - magnetometer
> - touchscreen
> - pwm
> - backlight
> - haptic motor
> 
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> ---
>  arch/arm64/boot/dts/freescale/Makefile        |   1 +
>  .../dts/freescale/imx8mq-librem5-devkit.dts   | 833 ++++++++++++++++++
>  2 files changed, 834 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> 
> diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
> index 0bd122f60549..c043aca66572 100644
> --- a/arch/arm64/boot/dts/freescale/Makefile
> +++ b/arch/arm64/boot/dts/freescale/Makefile
> @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-rdb.dtb
>  
>  dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb
>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-evk.dtb
> +dtb-$(CONFIG_ARCH_MXC) += imx8mq-librem5-devkit.dtb
>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-rmb3.dtb
>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-zest.dtb
>  dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> new file mode 100644
> index 000000000000..846a72dc7640
> --- /dev/null
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts

> +&usb3_phy0 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	status = "okay";
> +
> +	port@0 {
> +		reg = <0>;
> +
> +		typec_hs: endpoint {
> +			remote-endpoint = <&usb_con_hs>;
> +		};
> +	};
> +
> +	port@1 {
> +		reg = <1>;
> +
> +		typec_ss: endpoint {
> +			remote-endpoint = <&usb_con_ss>;
> +		};
> +	};

This is wrong. The graph should be between the USB controller and the 
connector. The phy is not involved.

> +};
> +
> +&usb3_phy1 {
> +	status = "okay";
> +};
> +
> +&usb_dwc3_0 {
> +	extcon = <&typec_ptn5100>;

extcon is deprecated and you should only have the usb-connector binding. 
>From the controller, you can walk the graph to the connector.

> +	dr_mode = "otg";
> +	status = "okay";
> +};
Rob Herring April 22, 2019, 1:39 p.m. UTC | #2
On Thu, Apr 18, 2019 at 12:44 PM Angus Ainslie <angus@akkea.ca> wrote:
>
> Hi Rob,
>
>
> On 2019-04-18 08:13, Rob Herring wrote:
> > On Wed, Apr 17, 2019 at 09:55:12AM -0700, Angus Ainslie (Purism) wrote:
> >> This is the development kit board for the Librem 5. The current level
> >> of
> >> support yields a working console and is able to boot userspace from
> >> the
> >> Network or eMMC.
> >>
> >> Additional subsystems that are active :
> >>
> >> - Both USB ports
> >> - SD card socket
> >> - WiFi usdhc
> >> - WWAN modem
> >> - GNSS
> >> - GPIO keys
> >> - LEDs
> >> - gyro
> >> - magnetometer
> >> - touchscreen
> >> - pwm
> >> - backlight
> >> - haptic motor
> >>
> >> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> >> ---
> >>  arch/arm64/boot/dts/freescale/Makefile        |   1 +
> >>  .../dts/freescale/imx8mq-librem5-devkit.dts   | 833
> >> ++++++++++++++++++
> >>  2 files changed, 834 insertions(+)
> >>  create mode 100644
> >> arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> >>
> >> diff --git a/arch/arm64/boot/dts/freescale/Makefile
> >> b/arch/arm64/boot/dts/freescale/Makefile
> >> index 0bd122f60549..c043aca66572 100644
> >> --- a/arch/arm64/boot/dts/freescale/Makefile
> >> +++ b/arch/arm64/boot/dts/freescale/Makefile
> >> @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-rdb.dtb
> >>
> >>  dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb
> >>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-evk.dtb
> >> +dtb-$(CONFIG_ARCH_MXC) += imx8mq-librem5-devkit.dtb
> >>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-rmb3.dtb
> >>  dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-zest.dtb
> >>  dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
> >> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> >> b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> >> new file mode 100644
> >> index 000000000000..846a72dc7640
> >> --- /dev/null
> >> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> >
> >> +&usb3_phy0 {
> >> +    #address-cells = <1>;
> >> +    #size-cells = <0>;
> >> +    status = "okay";
> >> +
> >> +    port@0 {
> >> +            reg = <0>;
> >> +
> >> +            typec_hs: endpoint {
> >> +                    remote-endpoint = <&usb_con_hs>;
> >> +            };
> >> +    };
> >> +
> >> +    port@1 {
> >> +            reg = <1>;
> >> +
> >> +            typec_ss: endpoint {
> >> +                    remote-endpoint = <&usb_con_ss>;
> >> +            };
> >> +    };
> >
> > This is wrong. The graph should be between the USB controller and the
> > connector. The phy is not involved.
> >
> >> +};
> >> +
> >> +&usb3_phy1 {
> >> +    status = "okay";
> >> +};
> >> +
> >> +&usb_dwc3_0 {
> >> +    extcon = <&typec_ptn5100>;
> >
> > extcon is deprecated and you should only have the usb-connector
> > binding.
> > From the controller, you can walk the graph to the connector.
> >
>
> I not sure that I'm clear on what you mean. Here's what I think you want
> it changed to.

Yes, this looks correct.

>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> index 846a72dc7640..7b8770fdc5fb 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> @@ -755,51 +755,50 @@
>   };
>
>   &uart4 { /* BT */
>          pinctrl-names = "default";
>          pinctrl-0 = <&pinctrl_uart4>, <&pinctrl_bt>;
>          uart-has-rtscts;
>          status = "okay";
>   };
>
>   &usb3_phy0 {
> +       status = "okay";
> +};
> +
> +&usb3_phy1 {
> +       status = "okay";
> +};
> +
> +&usb_dwc3_0 {
>          #address-cells = <1>;
>          #size-cells = <0>;
> +       dr_mode = "otg";
>          status = "okay";
>
>          port@0 {
>                  reg = <0>;
>
>                  typec_hs: endpoint {
>                          remote-endpoint = <&usb_con_hs>;
>                  };
>          };
>
>          port@1 {
>                  reg = <1>;
>
>                  typec_ss: endpoint {
>                          remote-endpoint = <&usb_con_ss>;
>                  };
>          };
>   };
>
> -&usb3_phy1 {
> -       status = "okay";
> -};
> -
> -&usb_dwc3_0 {
> -       extcon = <&typec_ptn5100>;
> -       dr_mode = "otg";
> -       status = "okay";
> -};
> -
>   &usb_dwc3_1 {
>          dr_mode = "host";
>          status = "okay";
>   };
>
>
>
> Thanks
> Angus
>
> >> +    dr_mode = "otg";
> >> +    status = "okay";
> >> +};
>