]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/mach-uniphier/cpu_info.c
ARM: uniphier: add PH1-LD20 SoC support
[people/ms/u-boot.git] / arch / arm / mach-uniphier / cpu_info.c
CommitLineData
5894ca00 1/*
f6e7f07c 2 * Copyright (C) 2013-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
5894ca00
MY
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
f6e7f07c 8#include <linux/io.h>
107b3fb4
MY
9
10#include "sg-regs.h"
5894ca00
MY
11
12int print_cpuinfo(void)
13{
14 u32 revision, type, model, rev, required_model = 1, required_rev = 1;
15
16 revision = readl(SG_REVISION);
17 type = (revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT;
18 model = (revision & SG_REVISION_MODEL_MASK) >> SG_REVISION_MODEL_SHIFT;
19 rev = (revision & SG_REVISION_REV_MASK) >> SG_REVISION_REV_SHIFT;
20
21 puts("CPU: ");
22
23 switch (type) {
24 case 0x25:
25 puts("PH1-sLD3 (MN2WS0220)");
26 required_model = 2;
27 break;
28 case 0x26:
29 puts("PH1-LD4 (MN2WS0250)");
30 required_rev = 2;
31 break;
32 case 0x28:
33 puts("PH1-Pro4 (MN2WS0230)");
34 break;
35 case 0x29:
36 puts("PH1-sLD8 (MN2WS0270)");
37 break;
8101b982
MY
38 case 0x2A:
39 puts("PH1-Pro5 (MN2WS0300)");
40 break;
41 case 0x2E:
42 puts("ProXstream2 (MN2WS0310)");
43 break;
44 case 0x2F:
45 puts("PH1-LD6b (MN2WS0320)");
46 break;
6f45a975 47 case 0x31:
2247c332 48 puts("PH1-LD11 ()");
6f45a975
MY
49 break;
50 case 0x32:
9d0c2ceb 51 puts("PH1-LD20 (SC1401AJ1)");
6f45a975 52 break;
5894ca00
MY
53 default:
54 printf("Unknown Processor ID (0x%x)\n", revision);
55 return -1;
56 }
57
6e1550fa 58 printf(" model %d", model);
5894ca00
MY
59
60 printf(" (rev. %d)\n", rev);
61
62 if (model < required_model) {
63 printf("Sorry, this model is not supported.\n");
64 printf("Required model is %d.", required_model);
65 return -1;
66 } else if (rev < required_rev) {
67 printf("Sorry, this revision is not supported.\n");
68 printf("Required revision is %d.", required_rev);
69 return -1;
70 }
71
72 return 0;
73}