diff options
author | Tom Rini <trini@konsulko.com> | 2017-01-22 17:07:48 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-01-22 17:07:48 -0500 |
commit | 0c9e85f67cd86d2d7a3424ea3ebff0e6db7a3915 (patch) | |
tree | 1ac6999d2934173b7575540b310fda3147aaf67a /arch/arm/mach-uniphier/soc-info.c | |
parent | afdf09ac260f7ec245c85b94a5de5f92af06bc25 (diff) | |
parent | 2c2ab3d495a1a9fbfcec58f469255595a86e3aad (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-uniphier
- Allow to disable SPL (mainly for ATF)
- Refactor SoC init code
- Update DRAM settings
- Add PXs3 SoC support (DT, pinctrl driver, SoC code)
Diffstat (limited to 'arch/arm/mach-uniphier/soc-info.c')
-rw-r--r-- | arch/arm/mach-uniphier/soc-info.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/soc-info.c b/arch/arm/mach-uniphier/soc-info.c new file mode 100644 index 00000000000..baf1be6a01b --- /dev/null +++ b/arch/arm/mach-uniphier/soc-info.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <linux/io.h> +#include <linux/types.h> + +#include "sg-regs.h" +#include "soc-info.h" + +static unsigned int __uniphier_get_revision_field(unsigned int mask, + unsigned int shift) +{ + u32 revision = readl(SG_REVISION); + + return (revision >> shift) & mask; +} + +unsigned int uniphier_get_soc_id(void) +{ + return __uniphier_get_revision_field(0xff, 16); +} + +unsigned int uniphier_get_soc_model(void) +{ + return __uniphier_get_revision_field(0x3, 8); +} + +unsigned int uniphier_get_soc_revision(void) +{ + return __uniphier_get_revision_field(0x1f, 0); +} |