aboutsummaryrefslogtreecommitdiffstats
path: root/env
diff options
context:
space:
mode:
authorYork Sun2018-06-26 12:03:22 -0500
committerTom Rini2018-07-21 11:24:31 -0500
commit474ecd2c84d97314b8145fbe3a57887f41b2edb3 (patch)
treeaf23d2f9097bfaef92c69a4ed3177f85454c2907 /env
parent646f1ab4bcfedf2db7df47a46ac2353366b7b2b7 (diff)
downloadu-boot-474ecd2c84d97314b8145fbe3a57887f41b2edb3.tar.gz
u-boot-474ecd2c84d97314b8145fbe3a57887f41b2edb3.tar.xz
u-boot-474ecd2c84d97314b8145fbe3a57887f41b2edb3.zip
env: Simplify Makefile using $(SPL_TPL_)
Add Kconfig options SPL_ENV_* and TPL_ENV_* and simplify Makefile. This allows SPL/TPL image has different environment setting from full feature U-Boot. Signed-off-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'env')
-rw-r--r--env/Kconfig115
-rw-r--r--env/Makefile40
2 files changed, 126 insertions, 29 deletions
diff --git a/env/Kconfig b/env/Kconfig
index 787b487bb2..be99efb937 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -533,4 +533,119 @@ config ENV_VARS_UBOOT_RUNTIME_CONFIG
533 run-time determined information about the hardware to the 533 run-time determined information about the hardware to the
534 environment. These will be named board_name, board_rev. 534 environment. These will be named board_name, board_rev.
535 535
536if SPL_ENV_SUPPORT
537config SPL_ENV_IS_NOWHERE
538 bool "SPL Environment is not stored"
539 default y if ENV_IS_NOWHERE
540 help
541 Similar to ENV_IS_NOWHERE, used for SPL environment.
542
543config SPL_ENV_IS_IN_MMC
544 bool "SPL Environment in an MMC device"
545 depends on !SPL_ENV_IS_NOWHERE
546 depends on ENV_IS_IN_MMC
547 default y
548 help
549 Similar to ENV_IS_IN_MMC, used for SPL environment.
550
551config SPL_ENV_IS_IN_FAT
552 bool "SPL Environment is in a FAT filesystem"
553 depends on !SPL_ENV_IS_NOWHERE
554 depends on ENV_IS_IN_FAT
555 default y
556 help
557 Similar to ENV_IS_IN_FAT, used for SPL environment.
558
559config SPL_ENV_IS_IN_EXT4
560 bool "SPL Environment is in a EXT4 filesystem"
561 depends on !SPL_ENV_IS_NOWHERE
562 depends on ENV_IS_IN_EXT4
563 default y
564 help
565 Similar to ENV_IS_IN_EXT4, used for SPL environment.
566
567config SPL_ENV_IS_IN_NAND
568 bool "SPL Environment in a NAND device"
569 depends on !SPL_ENV_IS_NOWHERE
570 depends on ENV_IS_IN_NAND
571 default y
572 help
573 Similar to ENV_IS_IN_NAND, used for SPL environment.
574
575config SPL_ENV_IS_IN_SPI_FLASH
576 bool "SPL Environment is in SPI flash"
577 depends on !SPL_ENV_IS_NOWHERE
578 depends on ENV_IS_IN_SPI_FLASH
579 default y
580 help
581 Similar to ENV_IS_IN_SPI_FLASH, used for SPL environment.
582
583config SPL_ENV_IS_IN_FLASH
584 bool "SPL Environment in flash memory"
585 depends on !SPL_ENV_IS_NOWHERE
586 depends on ENV_IS_IN_FLASH
587 default y
588 help
589 Similar to ENV_IS_IN_FLASH, used for SPL environment.
590
591endif
592
593if TPL_ENV_SUPPORT
594
595config TPL_ENV_IS_NOWHERE
596 bool "TPL Environment is not stored"
597 default y if ENV_IS_NOWHERE
598 help
599 Similar to ENV_IS_NOWHERE, used for TPL environment.
600
601config TPL_ENV_IS_IN_MMC
602 bool "TPL Environment in an MMC device"
603 depends on !TPL_ENV_IS_NOWHERE
604 depends on ENV_IS_IN_MMC
605 default y
606 help
607 Similar to ENV_IS_IN_MMC, used for TPL environment.
608
609config TPL_ENV_IS_IN_FAT
610 bool "TPL Environment is in a FAT filesystem"
611 depends on !TPL_ENV_IS_NOWHERE
612 depends on ENV_IS_IN_FAT
613 default y
614 help
615 Similar to ENV_IS_IN_FAT, used for TPL environment.
616
617config TPL_ENV_IS_IN_EXT4
618 bool "TPL Environment is in a EXT4 filesystem"
619 depends on !TPL_ENV_IS_NOWHERE
620 depends on ENV_IS_IN_EXT4
621 default y
622 help
623 Similar to ENV_IS_IN_EXT4, used for TPL environment.
624
625config TPL_ENV_IS_IN_NAND
626 bool "TPL Environment in a NAND device"
627 depends on !TPL_ENV_IS_NOWHERE
628 depends on ENV_IS_IN_NAND
629 default y
630 help
631 Similar to ENV_IS_IN_NAND, used for TPL environment.
632
633config TPL_ENV_IS_IN_SPI_FLASH
634 bool "TPL Environment is in SPI flash"
635 depends on !TPL_ENV_IS_NOWHERE
636 depends on ENV_IS_IN_SPI_FLASH
637 default y
638 help
639 Similar to ENV_IS_IN_SPI_FLASH, used for TPL environment.
640
641config TPL_ENV_IS_IN_FLASH
642 bool "TPL Environment in flash memory"
643 depends on !TPL_ENV_IS_NOWHERE
644 depends on ENV_IS_IN_FLASH
645 default y
646 help
647 Similar to ENV_IS_IN_FLASH, used for TPL environment.
648
649endif
650
536endmenu 651endmenu
diff --git a/env/Makefile b/env/Makefile
index fa635c8082..90144d6caf 100644
--- a/env/Makefile
+++ b/env/Makefile
@@ -14,41 +14,23 @@ extra-$(CONFIG_ENV_IS_EMBEDDED) += embedded.o
14obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o 14obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o
15extra-$(CONFIG_ENV_IS_IN_FLASH) += embedded.o 15extra-$(CONFIG_ENV_IS_IN_FLASH) += embedded.o
16obj-$(CONFIG_ENV_IS_IN_NVRAM) += embedded.o 16obj-$(CONFIG_ENV_IS_IN_NVRAM) += embedded.o
17obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
18obj-$(CONFIG_ENV_IS_IN_MMC) += mmc.o
19obj-$(CONFIG_ENV_IS_IN_FAT) += fat.o
20obj-$(CONFIG_ENV_IS_IN_EXT4) += ext4.o
21obj-$(CONFIG_ENV_IS_IN_NAND) += nand.o
22obj-$(CONFIG_ENV_IS_IN_NVRAM) += nvram.o 17obj-$(CONFIG_ENV_IS_IN_NVRAM) += nvram.o
23obj-$(CONFIG_ENV_IS_IN_ONENAND) += onenand.o 18obj-$(CONFIG_ENV_IS_IN_ONENAND) += onenand.o
24obj-$(CONFIG_ENV_IS_IN_SATA) += sata.o 19obj-$(CONFIG_ENV_IS_IN_SATA) += sata.o
25obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += sf.o
26obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o 20obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o
27obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o 21obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o
28obj-$(CONFIG_ENV_IS_NOWHERE) += nowhere.o
29endif
30
31ifdef CONFIG_SPL_BUILD
32obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
33# environment
34ifdef CONFIG_TPL_BUILD
35obj-$(CONFIG_TPL_ENV_SUPPORT) += attr.o
36obj-$(CONFIG_TPL_ENV_SUPPORT) += flags.o
37obj-$(CONFIG_TPL_ENV_SUPPORT) += callback.o
38else 22else
39obj-$(CONFIG_SPL_ENV_SUPPORT) += attr.o 23obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o
40obj-$(CONFIG_SPL_ENV_SUPPORT) += flags.o 24obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o
41obj-$(CONFIG_SPL_ENV_SUPPORT) += callback.o 25obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += callback.o
42endif
43ifneq ($(CONFIG_TPL_ENV_SUPPORT)$(CONFIG_SPL_ENV_SUPPORT),)
44obj-$(CONFIG_ENV_IS_NOWHERE) += nowhere.o
45obj-$(CONFIG_ENV_IS_IN_MMC) += mmc.o
46obj-$(CONFIG_ENV_IS_IN_FAT) += fat.o
47obj-$(CONFIG_ENV_IS_IN_EXT4) += ext4.o
48obj-$(CONFIG_ENV_IS_IN_NAND) += nand.o
49obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += sf.o
50obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
51endif
52endif 26endif
53 27
28obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE) += nowhere.o
29obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_MMC) += mmc.o
30obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) += fat.o
31obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_EXT4) += ext4.o
32obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_NAND) += nand.o
33obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_SPI_FLASH) += sf.o
34obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FLASH) += flash.o
35
54CFLAGS_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) 36CFLAGS_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null)