[RFC, PATCH] i.MX6: phytec: Do not hardcode default environment

Sascha Hauer s.hauer at pengutronix.de
Mon Jan 5 01:06:52 PST 2015


Hi Andrey,

On Wed, Dec 31, 2014 at 08:49:50AM -0800, Andrey Smirnov wrote:
> By default i.MX6 phytec image hardcodes its default environment in
> initialization code. Define phytec specific defonfig and use
> CONFIG_DEFAULT_ENVIRONMENT_PATH instead.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
> ---
> 
> Not sure how much of a faux pas adding a new defconfig file is, but I
> couldn't think of a better alternative. What I was trying to achive is
> being able to build an image for a custom Phytec SoM based platform
> that would have a completely custom envirnoment and would not pull in
> default phytec stuff.
> 
> Let me know if this is a right approach.
> 
> Thank you.
> 
>  arch/arm/boards/phytec-phyflex-imx6/Makefile   |   1 -
>  arch/arm/boards/phytec-phyflex-imx6/board.c    |   2 -
>  arch/arm/configs/phytec_phyflex_imx6_defconfig | 705 +++++++++++++++++++++++++
>  3 files changed, 705 insertions(+), 3 deletions(-)
>  create mode 100644 arch/arm/configs/phytec_phyflex_imx6_defconfig
> 
> diff --git a/arch/arm/boards/phytec-phyflex-imx6/Makefile b/arch/arm/boards/phytec-phyflex-imx6/Makefile
> index 11e1c7d..01c7a25 100644
> --- a/arch/arm/boards/phytec-phyflex-imx6/Makefile
> +++ b/arch/arm/boards/phytec-phyflex-imx6/Makefile
> @@ -1,3 +1,2 @@
>  obj-y += board.o
>  lwl-y += lowlevel.o
> -bbenv-y += defaultenv-phyflex-imx6
> diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
> index 1551460..3f52680 100644
> --- a/arch/arm/boards/phytec-phyflex-imx6/board.c
> +++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
> @@ -87,8 +87,6 @@ static int phytec_pfla02_init(void)
>  		break;
>  	}
>  
> -	defaultenv_append_directory(defaultenv_phyflex_imx6);
> -

Looking at it you should rather replace the compatible checks in
phytec_pfla02_init with their baseboards, so instead of:

	if (!of_machine_is_compatible("phytec,imx6q-pfla02") &&
                        !of_machine_is_compatible("phytec,imx6dl-pfla02") &&
                        !of_machine_is_compatible("phytec,imx6s-pfla02"))
                return 0;

do a:

	if (!of_machine_is_compatible("phytec,imx6x-pbab01") &&
                        !of_machine_is_compatible("phytec,imx6dl-pbab05") &&
                        !of_machine_is_compatible("phytec,imx6q-pbab02"))
                return 0;

Then the phytec default env will only be added for the phytec baseboards
and not for your custom one. Note phyflex_err006282_workaround() won't
be called either then, you may need your own version of this then.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list