Re: [PATCH 1/3] ARM: protonic: add initial support for the Protonic PRT8MM family of boards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lucas,

On Tue, May 25, 2021 at 09:36:22PM +0200, Lucas Stach wrote:
> From: David Jander <david@xxxxxxxxxxx>
> 
> 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@xxxxxxxxxxx>
> +
> +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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux