blob: 6ad4c76dc48b91beb6a2c688d9ae8bd929b6169a [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 Yamada107b3fb2016-01-09 01:51:13 +09009
10#include "sg-regs.h"
Masahiro Yamada5894ca02014-10-03 19:21:06 +090011
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;
Masahiro Yamada8101b982015-06-30 18:43:45 +090038 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;
Masahiro Yamada6f45a972015-12-17 17:47:45 +090047 case 0x31:
Masahiro Yamada667dbcd2016-05-24 21:14:01 +090048 puts("PH1-LD11 (SC1405AP1)");
Masahiro Yamada6f45a972015-12-17 17:47:45 +090049 break;
50 case 0x32:
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090051 puts("PH1-LD20 (SC1401AJ1)");
Masahiro Yamada6f45a972015-12-17 17:47:45 +090052 break;
Masahiro Yamada5894ca02014-10-03 19:21:06 +090053 default:
54 printf("Unknown Processor ID (0x%x)\n", revision);
55 return -1;
56 }
57
Masahiro Yamada6e1550f2015-12-17 17:47:46 +090058 printf(" model %d", model);
Masahiro Yamada5894ca02014-10-03 19:21:06 +090059
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}