mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] ARM: protonic: add initial support for the Protonic PRT8MM family of boards
Date: Thu, 27 May 2021 09:35:27 +0200	[thread overview]
Message-ID: <20210527073527.GF19819@pengutronix.de> (raw)
In-Reply-To: <20210525193624.3348572-1-l.stach@pengutronix.de>

Hi Lucas,

On Tue, May 25, 2021 at 09:36:22PM +0200, Lucas Stach wrote:
> From: David Jander <david@protonic.nl>
> 
> This board is a low-cost 7" touchscreen virtual terminal for
> agricultural applications.
> 
> There is no upstream Linux DT yet, so we add a minimal DT for use with the
> bootloader in this patch.
> 
> Signed-off-by: David Jander <david@protonic.nl>
> +
> +static const struct of_device_id prt_imx8mm_of_match[] = {
> +	{ .compatible = "prt,prt8mm", },
> +	{ /* sentinel */ },
> +};
> +
> +static struct driver_d prt_prt8mm_board_driver = {
> +	.name = "board-protonic-imx8mm",
> +	.probe = prt_prt8mm_probe,
> +	.of_compatible = DRV_OF_COMPAT(prt_imx8mm_of_match),
> +};
> +device_platform_driver(prt_prt8mm_board_driver);
> +
> +static int prt_prt8mm_late_init(void)
> +{
> +	setenv("global.boot.default", bootsource_get_alias_name());
> +
> +	return 0;
> +}
> +late_initcall(prt_prt8mm_late_init);

This not protected by any of_machine_is_compatible(). Can't this be done
as part of the driver above?

> +		environment-sd {
> +			compatible = "barebox,environment";
> +			device-path = &usdhc2, "partname:barebox-environment";
> +			status = "disabled";
> +		};
> +		environment-emmc {
> +			compatible = "barebox,environment";
> +			device-path = &usdhc3, "partname:barebox-environment";
> +			status = "disabled";
> +		};

I prefer using a phandle to the partition directly rather than using the
"partname:" syntax

> +&usdhc2 {
> +	assigned-clocks = <&clk IMX8MM_CLK_USDHC2>;
> +	assigned-clock-rates = <100000000>;
> +	pinctrl-names = "default", "state_100mhz", "state_200mhz";
> +	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
> +	pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
> +	pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
> +	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
> +	bus-width = <4>;
> +	status = "okay";
> +
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +
> +	partition@0 {
> +		label = "barebox";
> +		reg = <0x0 0xe0000>;
> +	};
> +
> +	partition@10000 {
> +		label = "barebox-environment";
> +		reg = <0x10000 0x10000>;
> +	};

Let's hope you never do a 'saveenv' when starting barebox from this card ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      parent reply	other threads:[~2021-05-27  7:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 19:36 Lucas Stach
2021-05-25 19:36 ` [PATCH 2/3] ARM: imx_v8_defconfig: enable PRT8MM board Lucas Stach
2021-05-25 19:36 ` [PATCH 3/3] ARM: imx_v8_defconfig: enable EHCI Lucas Stach
2021-05-27  7:35 ` Sascha Hauer [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=20210527073527.GF19819@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    --subject='Re: [PATCH 1/3] ARM: protonic: add initial support for the Protonic PRT8MM family of boards' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox