2015-09-21 15:27:39 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/types.h>
|
2016-01-08 16:51:13 +00:00
|
|
|
|
|
|
|
#include "sg-regs.h"
|
|
|
|
#include "soc-info.h"
|
2015-09-21 15:27:39 +00:00
|
|
|
|
|
|
|
#if UNIPHIER_MULTI_SOC
|
|
|
|
enum uniphier_soc_id uniphier_get_soc_type(void)
|
|
|
|
{
|
|
|
|
u32 revision = readl(SG_REVISION);
|
|
|
|
enum uniphier_soc_id ret;
|
|
|
|
|
|
|
|
switch ((revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT) {
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_SLD3
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x25:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_SLD3;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_LD4
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x26:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_LD4;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_PRO4
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x28:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_PRO4;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_SLD8
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x29:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_SLD8;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_PRO5
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x2A:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_PRO5;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_PXS2
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x2E:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_PXS2;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_LD6B
|
2015-09-21 15:27:39 +00:00
|
|
|
case 0x2F:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_LD6B;
|
2015-09-21 15:27:39 +00:00
|
|
|
break;
|
2015-12-17 08:47:45 +00:00
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_LD11
|
2015-12-17 08:47:45 +00:00
|
|
|
case 0x31:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_LD11;
|
2015-12-17 08:47:45 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-18 07:41:43 +00:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_LD20
|
2015-12-17 08:47:45 +00:00
|
|
|
case 0x32:
|
2016-03-18 07:41:43 +00:00
|
|
|
ret = SOC_UNIPHIER_LD20;
|
2015-12-17 08:47:45 +00:00
|
|
|
break;
|
2015-09-21 15:27:39 +00:00
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
ret = SOC_UNIPHIER_UNKNOWN;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif
|
2015-12-17 08:47:41 +00:00
|
|
|
|
|
|
|
int uniphier_get_soc_model(void)
|
|
|
|
{
|
|
|
|
return (readl(SG_REVISION) & SG_REVISION_MODEL_MASK) >>
|
|
|
|
SG_REVISION_MODEL_SHIFT;
|
|
|
|
}
|
|
|
|
|
|
|
|
int uniphier_get_soc_revision(void)
|
|
|
|
{
|
|
|
|
return (readl(SG_REVISION) & SG_REVISION_REV_MASK) >>
|
|
|
|
SG_REVISION_REV_SHIFT;
|
|
|
|
}
|