From 7a3620b24649663857d99e8ab73ec0b3bd60e50e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 6 Dec 2014 00:03:26 +0900 Subject: ARM: UniPhier: detect the number of flash banks at run-time Some UniPhier boards are equipped with an expansion slot that some optional SRAM/NOR-flash cards can be attached to. So, run-time detection of the number of flash banks would be more user-friendly. Until this commit, UniPhier boards have achieved this by (ab)using board_flash_wp_on() because the boot failed if flash_size got zero. Fortunately, this problem was solved by commit 70879a92561a (flash: do not fail even if flash_size is zero). Now it is possible to throw away such a tricky workaround. This commit also enables CONFIG_SYS_MAX_FLASH_BANKS_DETECT for further refactoring. Signed-off-by: Masahiro Yamada --- arch/arm/cpu/armv7/uniphier/board_early_init_r.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 arch/arm/cpu/armv7/uniphier/board_early_init_r.c (limited to 'arch/arm/cpu/armv7/uniphier/board_early_init_r.c') diff --git a/arch/arm/cpu/armv7/uniphier/board_early_init_r.c b/arch/arm/cpu/armv7/uniphier/board_early_init_r.c new file mode 100644 index 0000000..cb7e04f --- /dev/null +++ b/arch/arm/cpu/armv7/uniphier/board_early_init_r.c @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +int board_early_init_r(void) +{ + uniphier_board_late_init(); + return 0; +} -- cgit v1.1