提交 4f007b83 编写于 作者: T Tetsuyuki Kobayashi 提交者: Albert ARIBAUD

arm: rmobile: kzm9g: separate cpu_rev to integer and fraction

According to SoC document, revision info is separated to integer part and
fracton part.
So I separete rmobile_get_cpu_rev() to rmobile_get_cpu_rev_integer() and
rmobile_get_cpu_rev_fraction().
Signed-off-by: NTetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: NNobuhiro Iwamatsu <iwamatsu@nigauri.org>
上级 170cc96f
...@@ -35,14 +35,26 @@ u32 rmobile_get_cpu_type(void) ...@@ -35,14 +35,26 @@ u32 rmobile_get_cpu_type(void)
return type; return type;
} }
u32 rmobile_get_cpu_rev(void) u32 rmobile_get_cpu_rev_integer(void)
{ {
u32 id; u32 id;
u32 rev; u32 rev;
struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE; struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
id = readl(&hpb->cccr); id = readl(&hpb->cccr);
rev = (id >> 4) & 0xF; rev = ((id >> 4) & 0xF) + 1;
return rev;
}
u32 rmobile_get_cpu_rev_fraction(void)
{
u32 id;
u32 rev;
struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
id = readl(&hpb->cccr);
rev = id & 0xF;
return rev; return rev;
} }
...@@ -46,23 +46,32 @@ static u32 __rmobile_get_cpu_type(void) ...@@ -46,23 +46,32 @@ static u32 __rmobile_get_cpu_type(void)
u32 rmobile_get_cpu_type(void) u32 rmobile_get_cpu_type(void)
__attribute__((weak, alias("__rmobile_get_cpu_type"))); __attribute__((weak, alias("__rmobile_get_cpu_type")));
static u32 __rmobile_get_cpu_rev(void) static u32 __rmobile_get_cpu_rev_integer(void)
{ {
return 0; return 0;
} }
u32 rmobile_get_cpu_rev(void) u32 rmobile_get_cpu_rev_integer(void)
__attribute__((weak, alias("__rmobile_get_cpu_rev"))); __attribute__((weak, alias("__rmobile_get_cpu_rev_integer")));
static u32 __rmobile_get_cpu_rev_fraction(void)
{
return 0;
}
u32 rmobile_get_cpu_rev_fraction(void)
__attribute__((weak, alias("__rmobile_get_cpu_rev_fraction")));
int print_cpuinfo(void) int print_cpuinfo(void)
{ {
switch (rmobile_get_cpu_type()) { switch (rmobile_get_cpu_type()) {
case 0x37: case 0x37:
printf("CPU: Renesas Electronics SH73A0 rev %d\n", printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n",
rmobile_get_cpu_rev()); rmobile_get_cpu_rev_integer(),
rmobile_get_cpu_rev_fraction());
break; break;
default: default:
printf("CPU: Renesas Electronics CPU rev %d\n", printf("CPU: Renesas Electronics CPU rev %d.%d\n",
rmobile_get_cpu_rev()); rmobile_get_cpu_rev_integer(),
rmobile_get_cpu_rev_fraction());
break; break;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册