blob: 5d9ed84be4ece3e24c7601467f7485eb2f4dc43a [file] [log] [blame]
Masahiro Yamada5894ca02014-10-03 19:21:06 +09001/*
Masahiro Yamadaf6e7f072015-05-29 17:30:00 +09002 * Copyright (C) 2013-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada5894ca02014-10-03 19:21:06 +09003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Masahiro Yamadaf6e7f072015-05-29 17:30:00 +09008#include <linux/io.h>
Masahiro Yamadaa86ac952015-02-27 02:26:44 +09009#include <mach/sg-regs.h>
Masahiro Yamada5894ca02014-10-03 19:21:06 +090010
11int print_cpuinfo(void)
12{
13 u32 revision, type, model, rev, required_model = 1, required_rev = 1;
14
15 revision = readl(SG_REVISION);
16 type = (revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT;
17 model = (revision & SG_REVISION_MODEL_MASK) >> SG_REVISION_MODEL_SHIFT;
18 rev = (revision & SG_REVISION_REV_MASK) >> SG_REVISION_REV_SHIFT;
19
20 puts("CPU: ");
21
22 switch (type) {
23 case 0x25:
24 puts("PH1-sLD3 (MN2WS0220)");
25 required_model = 2;
26 break;
27 case 0x26:
28 puts("PH1-LD4 (MN2WS0250)");
29 required_rev = 2;
30 break;
31 case 0x28:
32 puts("PH1-Pro4 (MN2WS0230)");
33 break;
34 case 0x29:
35 puts("PH1-sLD8 (MN2WS0270)");
36 break;
Masahiro Yamada8101b982015-06-30 18:43:45 +090037 case 0x2A:
38 puts("PH1-Pro5 (MN2WS0300)");
39 break;
40 case 0x2E:
41 puts("ProXstream2 (MN2WS0310)");
42 break;
43 case 0x2F:
44 puts("PH1-LD6b (MN2WS0320)");
45 break;
Masahiro Yamada5894ca02014-10-03 19:21:06 +090046 default:
47 printf("Unknown Processor ID (0x%x)\n", revision);
48 return -1;
49 }
50
51 if (model > 1)
52 printf(" model %d", model);
53
54 printf(" (rev. %d)\n", rev);
55
56 if (model < required_model) {
57 printf("Sorry, this model is not supported.\n");
58 printf("Required model is %d.", required_model);
59 return -1;
60 } else if (rev < required_rev) {
61 printf("Sorry, this revision is not supported.\n");
62 printf("Required revision is %d.", required_rev);
63 return -1;
64 }
65
66 return 0;
67}