diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-01-21 09:05:26 (GMT) |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-01-22 07:49:27 (GMT) |
commit | e27d6c7d328caf75bd7680109bc6610bc681f46e (patch) | |
tree | 0e199c982bc274b223123ce027e2f9263c961356 /arch/arm/mach-uniphier/cpu_info.c | |
parent | d9a70368dbe4a9b0e81b60ffbe3fda4a09e0ad5a (diff) | |
download | u-boot-fsl-qoriq-e27d6c7d328caf75bd7680109bc6610bc681f46e.tar.xz |
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/cpu_info.c')
-rw-r--r-- | arch/arm/mach-uniphier/cpu_info.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/arch/arm/mach-uniphier/cpu_info.c b/arch/arm/mach-uniphier/cpu_info.c deleted file mode 100644 index 6ad4c76..0000000 --- a/arch/arm/mach-uniphier/cpu_info.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2013-2015 Masahiro Yamada <yamada.masahiro@socionext.com> - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <common.h> -#include <linux/io.h> - -#include "sg-regs.h" - -int print_cpuinfo(void) -{ - u32 revision, type, model, rev, required_model = 1, required_rev = 1; - - revision = readl(SG_REVISION); - type = (revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT; - model = (revision & SG_REVISION_MODEL_MASK) >> SG_REVISION_MODEL_SHIFT; - rev = (revision & SG_REVISION_REV_MASK) >> SG_REVISION_REV_SHIFT; - - puts("CPU: "); - - switch (type) { - case 0x25: - puts("PH1-sLD3 (MN2WS0220)"); - required_model = 2; - break; - case 0x26: - puts("PH1-LD4 (MN2WS0250)"); - required_rev = 2; - break; - case 0x28: - puts("PH1-Pro4 (MN2WS0230)"); - break; - case 0x29: - puts("PH1-sLD8 (MN2WS0270)"); - break; - case 0x2A: - puts("PH1-Pro5 (MN2WS0300)"); - break; - case 0x2E: - puts("ProXstream2 (MN2WS0310)"); - break; - case 0x2F: - puts("PH1-LD6b (MN2WS0320)"); - break; - case 0x31: - puts("PH1-LD11 (SC1405AP1)"); - break; - case 0x32: - puts("PH1-LD20 (SC1401AJ1)"); - break; - default: - printf("Unknown Processor ID (0x%x)\n", revision); - return -1; - } - - printf(" model %d", model); - - printf(" (rev. %d)\n", rev); - - if (model < required_model) { - printf("Sorry, this model is not supported.\n"); - printf("Required model is %d.", required_model); - return -1; - } else if (rev < required_rev) { - printf("Sorry, this revision is not supported.\n"); - printf("Required revision is %d.", required_rev); - return -1; - } - - return 0; -} |