2017-01-21 09:05:26 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013-2014 Panasonic Corporation
|
|
|
|
* Copyright (C) 2015-2017 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
|
|
#include "soc-info.h"
|
|
|
|
|
|
|
|
int print_cpuinfo(void)
|
|
|
|
{
|
|
|
|
unsigned int id, model, rev, required_model = 1, required_rev = 1;
|
|
|
|
|
|
|
|
id = uniphier_get_soc_id();
|
|
|
|
model = uniphier_get_soc_model();
|
|
|
|
rev = uniphier_get_soc_revision();
|
|
|
|
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("SoC: ");
|
2017-01-21 09:05:26 +00:00
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
case UNIPHIER_LD4_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("LD4");
|
2017-01-21 09:05:26 +00:00
|
|
|
required_rev = 2;
|
|
|
|
break;
|
|
|
|
case UNIPHIER_PRO4_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("Pro4");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_SLD8_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("sLD8");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_PRO5_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("Pro5");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_PXS2_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("PXs2");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_LD6B_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("LD6b");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_LD11_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("LD11");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
|
|
|
case UNIPHIER_LD20_ID:
|
2017-07-13 11:32:17 +00:00
|
|
|
puts("LD20");
|
2017-01-21 09:05:26 +00:00
|
|
|
break;
|
2017-01-21 09:05:31 +00:00
|
|
|
case UNIPHIER_PXS3_ID:
|
|
|
|
puts("PXs3");
|
|
|
|
break;
|
2017-01-21 09:05:26 +00:00
|
|
|
default:
|
|
|
|
printf("Unknown Processor ID (0x%x)\n", id);
|
|
|
|
return -ENOTSUPP;
|
|
|
|
}
|
|
|
|
|
2017-07-13 11:32:17 +00:00
|
|
|
printf(" (model %d, revision %d)\n", model, rev);
|
2017-01-21 09:05:26 +00:00
|
|
|
|
|
|
|
if (model < required_model) {
|
|
|
|
printf("Only model %d or newer is supported.\n",
|
|
|
|
required_model);
|
|
|
|
return -ENOTSUPP;
|
|
|
|
} else if (rev < required_rev) {
|
|
|
|
printf("Only revision %d or newer is supported.\n",
|
|
|
|
required_rev);
|
|
|
|
return -ENOTSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|