Skip to content

Commit bd51e2f

Browse files
Nicolas PitreRussell King
authored andcommitted
ARM: 7506/1: allow for ATAGS to be configured out when DT support is selected
Now that ATAGS support is well contained, we can easily remove it from the kernel build if so desired. It has to explicitly be disabled, and only when DT support is selected. Note: disabling kernel ATAGS support does not prevent the usage of CONFIG_ARM_ATAG_DTB_COMPAT. Signed-off-by: Nicolas Pitre <nico@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent aa783b6 commit bd51e2f

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,12 +1891,6 @@ config CC_STACKPROTECTOR
18911891
neutralized via a kernel panic.
18921892
This feature requires gcc version 4.2 or above.
18931893

1894-
config DEPRECATED_PARAM_STRUCT
1895-
bool "Provide old way to pass kernel parameters"
1896-
help
1897-
This was deprecated in 2001 and announced to live on for 5 years.
1898-
Some old boot loaders still use this way.
1899-
19001894
endmenu
19011895

19021896
menu "Boot options"
@@ -1909,6 +1903,23 @@ config USE_OF
19091903
help
19101904
Include support for flattened device tree machine descriptions.
19111905

1906+
config ATAGS
1907+
bool "Support for the traditional ATAGS boot data passing" if USE_OF
1908+
default y
1909+
help
1910+
This is the traditional way of passing data to the kernel at boot
1911+
time. If you are solely relying on the flattened device tree (or
1912+
the ARM_ATAG_DTB_COMPAT option) then you may unselect this option
1913+
to remove ATAGS support from your kernel binary. If unsure,
1914+
leave this to y.
1915+
1916+
config DEPRECATED_PARAM_STRUCT
1917+
bool "Provide old way to pass kernel parameters"
1918+
depends on ATAGS
1919+
help
1920+
This was deprecated in 2001 and announced to live on for 5 years.
1921+
Some old boot loaders still use this way.
1922+
19121923
# Compressed boot loader in ROM. Yes, we really want to ask about
19131924
# TEXT and BSS so we preserve their values in the config files.
19141925
config ZBOOT_ROM_TEXT
@@ -2035,6 +2046,7 @@ config CMDLINE
20352046
choice
20362047
prompt "Kernel command line type" if CMDLINE != ""
20372048
default CMDLINE_FROM_BOOTLOADER
2049+
depends on ATAGS
20382050

20392051
config CMDLINE_FROM_BOOTLOADER
20402052
bool "Use bootloader kernel arguments if available"
@@ -2104,7 +2116,7 @@ config KEXEC
21042116

21052117
config ATAGS_PROC
21062118
bool "Export atags in procfs"
2107-
depends on KEXEC
2119+
depends on ATAGS && KEXEC
21082120
default y
21092121
help
21102122
Should the atags used to boot the kernel be exported in an "atags"

‎arch/arm/kernel/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ CFLAGS_REMOVE_return_address.o = -pg
1515

1616
# Object file lists.
1717

18-
obj-y := atags_parse.o elf.o entry-armv.o entry-common.o irq.o opcodes.o \
18+
obj-y := elf.o entry-armv.o entry-common.o irq.o opcodes.o \
1919
process.o ptrace.o return_address.o sched_clock.o \
2020
setup.o signal.o stacktrace.o sys_arm.o time.o traps.o
2121

22+
obj-$(CONFIG_ATAGS) += atags_parse.o
23+
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
2224
obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
2325

2426
obj-$(CONFIG_LEDS) += leds.o
@@ -52,7 +54,6 @@ test-kprobes-objs += kprobes-test-thumb.o
5254
else
5355
test-kprobes-objs += kprobes-test-arm.o
5456
endif
55-
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
5657
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
5758
obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
5859
obj-$(CONFIG_KGDB) += kgdb.o

‎arch/arm/kernel/atags.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,15 @@ static inline void save_atags(struct tag *tags) { }
55
#endif
66

77
void convert_to_tag_list(struct tag *tags);
8+
9+
#ifdef CONFIG_ATAGS
810
struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr);
11+
#else
12+
static inline struct machine_desc *
13+
setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
14+
{
15+
early_print("no ATAGS support: can't continue\n");
16+
while (true);
17+
unreachable();
18+
}
19+
#endif

0 commit comments

Comments
 (0)