9
0
Fork 0

defaultenv: add defaultenv-1 in boards via defaultenv_append_directory()

Currently it's hardcoded for each board which defaultenv version is
used. This is unfortunate since some people like the other defaultenv
version better and may want to select it.

This patch removes the board specific environment path
CONFIG_DEFAULT_ENVIRONMENT_PATH and instead adds it via:

	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
		defaultenv_append_directory(defaultenv_<board>);

This way we can make sure that the defaultenv-1 board specific bits are
only compiled in when defaultenv-1 is actually in use.

The next step is to make the defaultenv version selection a user visible
choice.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-09-26 09:50:08 +02:00
parent 7791ad2d59
commit 4d9734c8a2
209 changed files with 183 additions and 52 deletions

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-animeo_ip

View File

@ -14,6 +14,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <envfs.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/sizes.h>
@ -321,6 +322,9 @@ static int animeo_ip_devices_init(void)
animeo_ip_add_device_eth();
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_animeo_ip);
return 0;
}

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91rm9200ek

View File

@ -25,6 +25,7 @@
#include <gpio.h>
#include <fcntl.h>
#include <io.h>
#include <envfs.h>
#include <linux/sizes.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
@ -177,6 +178,9 @@ static int at91rm9200ek_devices_init(void)
armlinux_set_architecture(MACH_TYPE_AT91RM9200EK);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91rm9200ek);
return 0;
}
device_initcall(at91rm9200ek_devices_init);

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9260ek

View File

@ -14,6 +14,7 @@
#include <common.h>
#include <init.h>
#include <envfs.h>
#include <environment.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
@ -261,6 +262,9 @@ static int at91sam9260ek_devices_init(void)
devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
dev_add_bb_dev("env_raw1", "env1");
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9260ek);
return 0;
}
device_initcall(at91sam9260ek_devices_init);

View File

@ -1,3 +1,4 @@
obj-y += init.o
lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek

View File

@ -17,6 +17,7 @@
#include <common.h>
#include <net.h>
#include <init.h>
#include <envfs.h>
#include <environment.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
@ -396,6 +397,9 @@ static int at91sam9261ek_devices_init(void)
else
armlinux_set_architecture(MACH_TYPE_AT91SAM9261EK);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9261ek);
return 0;
}

View File

@ -1,3 +1,4 @@
obj-y += init.o
lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9263ek

View File

@ -19,6 +19,7 @@
#include <common.h>
#include <net.h>
#include <init.h>
#include <envfs.h>
#include <environment.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
@ -273,6 +274,9 @@ static int at91sam9263ek_devices_init(void)
armlinux_set_architecture(MACH_TYPE_AT91SAM9263EK);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9263ek);
return 0;
}

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9m10g45ek

View File

@ -21,6 +21,7 @@
#include <mci.h>
#include <init.h>
#include <gpio.h>
#include <envfs.h>
#include <environment.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
@ -321,6 +322,9 @@ static int at91sam9m10g45ek_devices_init(void)
armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
ek_set_board_revision();
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9m10g45ek);
return 0;
}
device_initcall(at91sam9m10g45ek_devices_init);

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9n12ek

View File

@ -24,6 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <envfs.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/sizes.h>
@ -327,6 +328,9 @@ static int at91sam9n12ek_devices_init(void)
devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
dev_add_bb_dev("env_raw1", "env1");
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9n12ek);
return 0;
}
device_initcall(at91sam9n12ek_devices_init);

View File

@ -1,2 +1,3 @@
obj-y += init.o
obj-y += hw_version.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9x5ek

View File

@ -24,6 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <envfs.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/sizes.h>
@ -320,6 +321,9 @@ static int at91sam9x5ek_devices_init(void)
devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
dev_add_bb_dev("env_raw1", "env1");
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_at91sam9x5ek);
return 0;
}
device_initcall(at91sam9x5ek_devices_init);

View File

@ -18,3 +18,4 @@
obj-y += eukrea_cpuimx25.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx25

View File

@ -30,6 +30,7 @@
#include <io.h>
#include <asm/mmu.h>
#include <led.h>
#include <envfs.h>
#include <partition.h>
#include <generated/mach-types.h>
@ -216,6 +217,9 @@ static int eukrea_cpuimx25_devices_init(void)
armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX25SD);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_eukrea_cpuimx25);
return 0;
}

View File

@ -18,3 +18,4 @@
obj-y += eukrea_cpuimx35.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx35

View File

@ -34,6 +34,7 @@
#include <net.h>
#include <partition.h>
#include <gpio.h>
#include <envfs.h>
#include <asm/armlinux.h>
#include <io.h>
@ -212,6 +213,9 @@ static int eukrea_cpuimx35_devices_init(void)
#endif
armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX35SD);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_eukrea_cpuimx35);
return 0;
}

View File

@ -1,2 +1,3 @@
obj-y += eukrea_cpuimx51.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx51

View File

@ -26,6 +26,7 @@
#include <generated/mach-types.h>
#include <partition.h>
#include <fs.h>
#include <envfs.h>
#include <fcntl.h>
#include <nand.h>
#include <spi/spi.h>
@ -122,6 +123,9 @@ static int eukrea_cpuimx51_devices_init(void)
armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX51SD);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_eukrea_cpuimx51);
return 0;
}

View File

@ -27,6 +27,7 @@
#include <asm/sections.h>
#include <asm/barebox-arm.h>
#include <io.h>
#include <envfs.h>
#include <partition.h>
#include <generated/mach-types.h>
#include <mach/imx-nand.h>
@ -156,6 +157,9 @@ static int imx25_3ds_devices_init(void)
armlinux_set_architecture(MACH_TYPE_MX25_3DS);
armlinux_set_serial(imx_uid());
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_freescale_mx25_3ds);
return 0;
}

View File

@ -18,3 +18,4 @@
lwl-y += lowlevel_init.o
obj-y += 3stack.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx25-3ds

View File

@ -30,6 +30,7 @@
#include <init.h>
#include <nand.h>
#include <net.h>
#include <envfs.h>
#include <linux/sizes.h>
#include <partition.h>
#include <gpio.h>
@ -208,6 +209,9 @@ static int f3s_devices_init(void)
armlinux_set_architecture(MACH_TYPE_MX35_3DS);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_freescale_mx35_3ds);
return 0;
}

View File

@ -1,2 +1,3 @@
obj-y += 3stack.o
lwl-y += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx35-3ds

View File

@ -1,2 +1,3 @@
obj-y += board.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx53-smd

View File

@ -26,6 +26,7 @@
#include <linux/sizes.h>
#include <gpio.h>
#include <mci.h>
#include <envfs.h>
#include <generated/mach-types.h>
@ -135,6 +136,9 @@ static int smd_devices_init(void)
armlinux_set_architecture(MACH_TYPE_MX53_SMD);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_freescale_mx53_smd);
return 0;
}
device_initcall(smd_devices_init);

View File

@ -1,2 +1,3 @@
obj-y += mini6410.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-friendlyarm-mini6410

View File

@ -16,6 +16,7 @@
#include <init.h>
#include <platform_data/eth-dm9000.h>
#include <gpio.h>
#include <envfs.h>
#include <generated/mach-types.h>
#include <asm/armlinux.h>
#include <mach/s3c-iomap.h>
@ -285,6 +286,9 @@ static int mini6410_devices_init(void)
armlinux_set_architecture(MACH_TYPE_MINI6410);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_friendlyarm_mini6410);
return 0;
}

View File

@ -1,3 +1,4 @@
obj-y += tiny6410.o
lwl-y += lowlevel.o
lwl-$(CONFIG_MACH_TINY6410_FA) += development-board.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-friendlyarm-tiny6410

View File

@ -18,3 +18,4 @@
lwl-y += lowlevel.o
obj-y += board.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-guf-cupid

View File

@ -25,6 +25,7 @@
#include <driver.h>
#include <environment.h>
#include <fs.h>
#include <envfs.h>
#include <mach/imx35-regs.h>
#include <asm/armlinux.h>
#include <io.h>
@ -128,6 +129,9 @@ static int cupid_devices_init(void)
armlinux_set_architecture(MACH_TYPE_GUF_CUPID);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_guf_cupid);
return 0;
}

View File

@ -1,3 +1,4 @@
lwl-y += lowlevel.o
obj-y += board.o
obj-y += pll_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-guf-neso

View File

@ -23,6 +23,7 @@
#include <partition.h>
#include <gpio.h>
#include <fs.h>
#include <envfs.h>
#include <fcntl.h>
#include <nand.h>
#include <command.h>
@ -282,6 +283,9 @@ static int neso_devices_init(void)
armlinux_set_architecture(MACH_TYPE_NESO);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_guf_neso);
return 0;
}

View File

@ -1 +1,2 @@
obj-y += init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-haba-knx

View File

@ -25,6 +25,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <envfs.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/sizes.h>
@ -323,6 +324,9 @@ static int haba_knx_devices_init(void)
devfs_create_partitions("nand0", haba_knx_nand0_partitions);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_haba_knx);
return 0;
}
device_initcall(haba_knx_devices_init);

View File

@ -1,3 +1,4 @@
obj-y += init.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-highbank

View File

@ -17,6 +17,7 @@
#include <linux/sizes.h>
#include <io.h>
#include <of.h>
#include <envfs.h>
#define FIRMWARE_DTB_BASE 0x1000
@ -126,6 +127,9 @@ static int highbank_devices_init(void)
devfs_add_partition("nvram", 0x00000, SZ_16K, DEVFS_PARTITION_FIXED, "env0");
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_highbank);
return 0;
}
device_initcall(highbank_devices_init);

View File

@ -1,2 +1,3 @@
obj-y += setup.o
lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-nhk8815

View File

@ -23,6 +23,7 @@
#include <asm/armlinux.h>
#include <generated/mach-types.h>
#include <io.h>
#include <envfs.h>
#include <mach/hardware.h>
#include <mach/board.h>
@ -106,6 +107,9 @@ static int nhk8815_devices_init(void)
devfs_add_partition("nand0", 0x7FE0000, 0x020000, DEVFS_PARTITION_FIXED, "env_raw");
dev_add_bb_dev("env_raw", "env0");
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_nhk8815);
return 0;
}
device_initcall(nhk8815_devices_init);

View File

@ -15,3 +15,4 @@
#
obj-y += pca-a-xl2.o
lwl-y += mux.o lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-phytec-phycard-omap4

View File

@ -1,2 +1,3 @@
obj-y += board.o
lwl-y += lowlevel.o mux.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-phytec-phycore-omap4460

Some files were not shown because too many files have changed in this diff Show More