diff options
author | Tetsuyuki Kobayashi <koba@kmckk.co.jp> | 2012-07-25 18:24:21 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-10-03 02:04:24 +0200 |
commit | 4f007b8334b9ed7170254cc784ad4f23f10192d0 (patch) | |
tree | 5946d3924cc837eb2e3cc8049e9c44ab21b961b7 /arch | |
parent | 170cc96f6c0e7357f8516b61d44341c53866d208 (diff) | |
download | u-boot-4f007b8334b9ed7170254cc784ad4f23f10192d0.zip u-boot-4f007b8334b9ed7170254cc784ad4f23f10192d0.tar.gz u-boot-4f007b8334b9ed7170254cc784ad4f23f10192d0.tar.bz2 |
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: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c | 16 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/rmobile/cpu_info.c | 23 |
2 files changed, 30 insertions, 9 deletions
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c b/arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c index 13ad742..2e7ed49 100644 --- a/arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c +++ b/arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c @@ -35,14 +35,26 @@ u32 rmobile_get_cpu_type(void) return type; } -u32 rmobile_get_cpu_rev(void) +u32 rmobile_get_cpu_rev_integer(void) { u32 id; u32 rev; struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE; 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; } diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info.c b/arch/arm/cpu/armv7/rmobile/cpu_info.c index 957a4fc..87287ce 100644 --- a/arch/arm/cpu/armv7/rmobile/cpu_info.c +++ b/arch/arm/cpu/armv7/rmobile/cpu_info.c @@ -46,23 +46,32 @@ static u32 __rmobile_get_cpu_type(void) u32 rmobile_get_cpu_type(void) __attribute__((weak, alias("__rmobile_get_cpu_type"))); -static u32 __rmobile_get_cpu_rev(void) +static u32 __rmobile_get_cpu_rev_integer(void) { return 0; } -u32 rmobile_get_cpu_rev(void) - __attribute__((weak, alias("__rmobile_get_cpu_rev"))); +u32 rmobile_get_cpu_rev_integer(void) + __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) { switch (rmobile_get_cpu_type()) { case 0x37: - printf("CPU: Renesas Electronics SH73A0 rev %d\n", - rmobile_get_cpu_rev()); + printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n", + rmobile_get_cpu_rev_integer(), + rmobile_get_cpu_rev_fraction()); break; default: - printf("CPU: Renesas Electronics CPU rev %d\n", - rmobile_get_cpu_rev()); + printf("CPU: Renesas Electronics CPU rev %d.%d\n", + rmobile_get_cpu_rev_integer(), + rmobile_get_cpu_rev_fraction()); break; } return 0; |