linux/arch/arc
Eugeniy Paltsev 4404926390 ARC: U-boot: check arguments paranoidly
commit a66f2e57bd upstream.

Handle U-boot arguments paranoidly:
 * don't allow to pass unknown tag.
 * try to use external device tree blob only if corresponding tag
   (TAG_DTB) is set.
 * don't check uboot_tag if kernel build with no ARC_UBOOT_SUPPORT.

NOTE:
If U-boot args are invalid we skip them and try to use embedded device
tree blob. We can't panic on invalid U-boot args as we really pass
invalid args due to bug in U-boot code.
This happens if we don't provide external DTB to U-boot and
don't set 'bootargs' U-boot environment variable (which is default
case at least for HSDK board) In that case we will pass
{r0 = 1 (bootargs in r2); r1 = 0; r2 = 0;} to linux which is invalid.

While I'm at it refactor U-boot arguments handling code.

Tested-by: Corentin LABBE <clabbe@baylibre.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-05-02 21:41:57 +01:00
..
boot ARC: [nsimosci] move peripherals to match model to FPGA 2015-01-15 10:44:08 +00:00
configs ARC: [nsimosci] Unbork console 2014-04-05 18:36:51 +05:30
include ARC: mm: allow mprotect to make stack mappings executable 2018-11-20 18:05:39 +00:00
kernel ARC: U-boot: check arguments paranoidly 2019-05-02 21:41:57 +01:00
lib ARC: switch to generic ENTRY/END assembler annotations 2014-03-26 14:31:28 +05:30
mm ARC: mm: do_page_fault fixes #1: relinquish mmap_sem if signal arrives while handle_mm_fault 2019-05-02 21:41:24 +01:00
oprofile ARC: OProfile support 2013-02-15 23:16:00 +05:30
plat-arcfpga ARC: [arcfpga] Early ARC UART to be only activated by cmdline 2014-06-03 14:20:09 +05:30
plat-tb10x ARC: [TB10x] Updates for GPIO and pinctrl 2013-11-11 09:57:44 +05:30
Kbuild ARC: Build system: Makefiles, Kconfig, Linker script 2013-02-11 20:00:25 +05:30
Kconfig Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP 2014-04-07 16:36:11 -07:00
Kconfig.debug consolidate per-arch stack overflow debugging options 2013-07-04 11:25:39 -07:00
Makefile ARC: unwind: ensure that .debug_frame is generated (vs. .eh_frame) 2016-08-22 22:38:22 +01:00