[PATCH 08/11] ARM: i.MX6 realq7: prepare multiboard support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Jun 27 03:03:26 EDT 2013


On 10:00 Wed 26 Jun     , Sascha Hauer wrote:
> Protect initcalls with the corrent of compatible.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
>  arch/arm/boards/dmo-mx6-realq7/board.c | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/boards/dmo-mx6-realq7/board.c b/arch/arm/boards/dmo-mx6-realq7/board.c
> index 7983b88..9cf6c31 100644
> --- a/arch/arm/boards/dmo-mx6-realq7/board.c
> +++ b/arch/arm/boards/dmo-mx6-realq7/board.c
> @@ -81,6 +81,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
>  
>  static int realq7_enet_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	mxc_iomux_v3_setup_multiple_pads(realq7_pads_gpio, ARRAY_SIZE(realq7_pads_gpio));
>  	gpio_direction_output(RQ7_GPIO_ENET_PHYADD2, 0);
>  	gpio_direction_output(RQ7_GPIO_ENET_MODE0, 1);
> @@ -102,19 +105,16 @@ static int realq7_enet_init(void)
>  }
>  fs_initcall(realq7_enet_init);
>  
> -static int realq7_devices_init(void)
> +static int realq7_env_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox",
>  		BBU_HANDLER_FLAG_DEFAULT, NULL, 0, 0x00907000);
>  	imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc3.barebox",
>  		0, NULL, 0, 0x00907000);
>  
> -	return 0;
> -}
> -device_initcall(realq7_devices_init);
> -
> -static int realq7_env_init(void)
> -{
>  	switch (bootsource_get()) {
>  	case BOOTSOURCE_MMC:
>  		device_detect_by_name("mmc3");
> @@ -136,8 +136,11 @@ late_initcall(realq7_env_init);
>  
>  static int realq7_console_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	imx6_init_lowlevel();
>  
>  	return 0;
>  }
> -core_initcall(realq7_console_init);
> +postcore_initcall(realq7_console_init);

I really don't like those if (!of_mac......

can we have a struct os is the kernel?

It will help me on at91 to cleanup the at91 to move to empty board.h
and will allow to not be of only

Best Regards,
J.
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list