diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-10 20:07:37 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-10 22:41:57 +0900 |
commit | f7f390576d063f9fc6c2a00792acd835a75c88aa (patch) | |
tree | 6ca10d44183b3348eb2ed52f5f27b207c06492d7 /arch/arm/mach-uniphier/sbc/sbc.c | |
parent | 92d6524b4f19cac08dd47f656bce59a7db6d3c47 (diff) |
ARM: uniphier: check DT to determine whether to initialize SBC
If CONFIG_MICRO_SUPPORT_CARD is enabled, U-Boot initialize SBC
(System Bus Controller), which may not be really necessary.
Check the "socionext,uniphier-system-bus" node in DT run-time.
If and only if it is found and its "status" property is okay,
initialize the SBC block.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/sbc/sbc.c')
-rw-r--r-- | arch/arm/mach-uniphier/sbc/sbc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/sbc/sbc.c b/arch/arm/mach-uniphier/sbc/sbc.c index df01e5c01d..6cf8cf2af8 100644 --- a/arch/arm/mach-uniphier/sbc/sbc.c +++ b/arch/arm/mach-uniphier/sbc/sbc.c @@ -5,7 +5,9 @@ * Author: Masahiro Yamada <yamada.masahiro@socionext.com> */ +#include <common.h> #include <linux/io.h> +#include <asm/global_data.h> #include "../init.h" #include "sbc-regs.h" @@ -31,6 +33,20 @@ #define SBCTRL2_SAVEPIN_MEM_VALUE 0x34000009 #define SBCTRL4_SAVEPIN_MEM_VALUE 0x02110210 +int uniphier_sbc_is_enabled(void) +{ + DECLARE_GLOBAL_DATA_PTR; + const void *fdt = gd->fdt_blob; + int offset; + + offset = fdt_node_offset_by_compatible(fdt, 0, + "socionext,uniphier-system-bus"); + if (offset < 0) + return 0; + + return fdtdec_get_is_enabled(fdt, offset); +} + static void __uniphier_sbc_init(int savepin) { /* |