diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-01-21 18:05:26 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-01-22 16:49:27 +0900 |
commit | e27d6c7d328caf75bd7680109bc6610bc681f46e (patch) | |
tree | 0e199c982bc274b223123ce027e2f9263c961356 /arch/arm/mach-uniphier/soc-info.h | |
parent | d9a70368dbe4a9b0e81b60ffbe3fda4a09e0ad5a (diff) | |
download | u-boot-imx-e27d6c7d328caf75bd7680109bc6610bc681f46e.zip u-boot-imx-e27d6c7d328caf75bd7680109bc6610bc681f46e.tar.gz u-boot-imx-e27d6c7d328caf75bd7680109bc6610bc681f46e.tar.bz2 |
ARM: uniphier: simplify SoC ID get function
Currently, uniphier_get_soc_type() converts the SoC ID (this is
read from the revision register) to an enum symbol to use it for SoC
identification. Come to think of it, there is no need for the
conversion in the first place. Using the SoC ID from the register
as-is a straightforward way.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/soc-info.h')
-rw-r--r-- | arch/arm/mach-uniphier/soc-info.h | 85 |
1 files changed, 17 insertions, 68 deletions
diff --git a/arch/arm/mach-uniphier/soc-info.h b/arch/arm/mach-uniphier/soc-info.h index d9b38b3..b528fa9 100644 --- a/arch/arm/mach-uniphier/soc-info.h +++ b/arch/arm/mach-uniphier/soc-info.h @@ -1,76 +1,25 @@ /* - * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ -#ifndef __MACH_SOC_INFO_H__ -#define __MACH_SOC_INFO_H__ +#ifndef __UNIPHIER_SOC_INFO_H__ +#define __UNIPHIER_SOC_INFO_H__ -enum uniphier_soc_id { - SOC_UNIPHIER_SLD3, - SOC_UNIPHIER_LD4, - SOC_UNIPHIER_PRO4, - SOC_UNIPHIER_SLD8, - SOC_UNIPHIER_PRO5, - SOC_UNIPHIER_PXS2, - SOC_UNIPHIER_LD6B, - SOC_UNIPHIER_LD11, - SOC_UNIPHIER_LD20, - SOC_UNIPHIER_UNKNOWN, -}; +#define UNIPHIER_SLD3_ID 0x25 +#define UNIPHIER_LD4_ID 0x26 +#define UNIPHIER_PRO4_ID 0x28 +#define UNIPHIER_SLD8_ID 0x29 +#define UNIPHIER_PRO5_ID 0x2a +#define UNIPHIER_PXS2_ID 0x2e +#define UNIPHIER_LD6B_ID 0x2f +#define UNIPHIER_LD11_ID 0x31 +#define UNIPHIER_LD20_ID 0x32 -#define UNIPHIER_NR_ENABLED_SOCS \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_SLD3) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD4) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_PRO4) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_SLD8) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_PRO5) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_PXS2) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD6B) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD11) + \ - IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD20) +unsigned int uniphier_get_soc_id(void); +unsigned int uniphier_get_soc_model(void); +unsigned int uniphier_get_soc_revision(void); -#define UNIPHIER_MULTI_SOC ((UNIPHIER_NR_ENABLED_SOCS) > 1) - -#if UNIPHIER_MULTI_SOC -enum uniphier_soc_id uniphier_get_soc_type(void); -#else -static inline enum uniphier_soc_id uniphier_get_soc_type(void) -{ -#if defined(CONFIG_ARCH_UNIPHIER_SLD3) - return SOC_UNIPHIER_SLD3; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD4) - return SOC_UNIPHIER_LD4; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PRO4) - return SOC_UNIPHIER_PRO4; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_SLD8) - return SOC_UNIPHIER_SLD8; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PRO5) - return SOC_UNIPHIER_PRO5; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PXS2) - return SOC_UNIPHIER_PXS2; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD6B) - return SOC_UNIPHIER_LD6B; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD11) - return SOC_UNIPHIER_LD11; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD20) - return SOC_UNIPHIER_LD20; -#endif - - return SOC_UNIPHIER_UNKNOWN; -} -#endif - -int uniphier_get_soc_model(void); -int uniphier_get_soc_revision(void); - -#endif /* __MACH_SOC_INFO_H__ */ +#endif /* __UNIPHIER_SOC_INFO_H__ */ |