Re: [PATCH 18/18] ARM: boards: mx6-sabrelite: add deep-probe support

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

 




On 9/28/20 5:50 PM, Marco Felsch wrote:
> Explicit request the required gpio resources instead of relying on their
> existence based on the initcall level.
> 
> Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
> ---
>  .../boards/freescale-mx6-sabrelite/board.c    | 24 ++++++++++++-------
>  1 file changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c
> index 1b39ef82c6..7fc3d4dc3f 100644
> --- a/arch/arm/boards/freescale-mx6-sabrelite/board.c
> +++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c
> @@ -13,7 +13,9 @@
>  #include <mach/bbu.h>
>  #include <asm/armlinux.h>
>  #include <generated/mach-types.h>
> +#include <of.h>
>  #include <partition.h>
> +#include <deep-probe.h>
>  #include <linux/phy.h>
>  #include <asm/io.h>
>  #include <asm/mmu.h>
> @@ -98,10 +100,6 @@ static int sabrelite_ksz9021rn_setup(void)
>  {
>  	int ret;
>  
> -	if (!of_machine_is_compatible("fsl,imx6q-sabrelite") &&
> -	    !of_machine_is_compatible("fsl,imx6dl-sabrelite"))
> -		return 0;
> -
>  	mxc_iomux_v3_setup_multiple_pads(sabrelite_enet_gpio_pads,
>  			ARRAY_SIZE(sabrelite_enet_gpio_pads));
>  
> @@ -118,11 +116,6 @@ static int sabrelite_ksz9021rn_setup(void)
>  
>  	return 0;
>  }
> -/*
> - * Do this before the fec initializes but after our
> - * gpios are available.
> - */
> -fs_initcall(sabrelite_ksz9021rn_setup);
>  
>  static void sabrelite_ehci_init(void)
>  {
> @@ -134,10 +127,20 @@ static void sabrelite_ehci_init(void)
>  
>  static int sabrelite_devices_init(void)
>  {
> +	int ret;
> +
>  	if (!of_machine_is_compatible("fsl,imx6q-sabrelite") &&
>  	    !of_machine_is_compatible("fsl,imx6dl-sabrelite"))
>  		return 0;
>  
> +	ret = of_devices_create_on_demand_by_property("gpio-controller");
> +	if (ret)
> +		return ret;
> +
> +	ret = sabrelite_ksz9021rn_setup();
> +	if (ret)
> +		return ret;
> +
>  	sabrelite_ehci_init();
>  
>  	armlinux_set_architecture(3769);
> @@ -163,3 +166,6 @@ static int sabrelite_coredevices_init(void)
>  	return 0;
>  }
>  coredevice_initcall(sabrelite_coredevices_init);
> +
> +deep_probe_enable(imx6q_sabrelite, "fsl,imx6q-sabrelite");
> +deep_probe_enable(imx6dl_sabrelite, "fsl,imx6dl-sabrelite");

You can use __UNIQUE_ID and drop the first argument

> 

-- 
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