arm: rmobile: Add support Renesas SH73A0
Subsystems (2)
PATCH v5 1/1 arm: rmobile: Add support Renesas SH73A0
From: Nobuhiro Iwamatsu <[email protected]>
Renesas SH73A0 is CPU with Cortex-A9.
This supports the basic register definition and GPIO.
---
V5: Remove dead code.
V4: Revert ICCICR.
V3: Set COBJS one object per line, and sort the list.
Remove ICCICR and ICCPMR.
Remove white space.
v2: Remove white space.
Code which can be communalized was moved to lowlevel_init.
arch/arm/cpu/armv7/rmobile/Makefile | 14 +- arch/arm/cpu/armv7/rmobile/board.c | 33 ++ arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c | 50 ++ arch/arm/cpu/armv7/rmobile/cpu_info.c | 36 +- arch/arm/cpu/armv7/rmobile/lowlevel_init.S | 95 ++++ arch/arm/include/asm/arch-rmobile/rmobile.h | 4 + arch/arm/include/asm/arch-rmobile/sh73a0-gpio.h | 553 +++++++++++++++++++++++ arch/arm/include/asm/arch-rmobile/sh73a0.h | 281 ++++++++++++ arch/arm/include/asm/arch-rmobile/sys_proto.h | 29 ++ 9 files changed, 1071 insertions(+), 24 deletions(-) create mode 100644 arch/arm/cpu/armv7/rmobile/board.c create mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c create mode 100644 arch/arm/cpu/armv7/rmobile/lowlevel_init.S create mode 100644 arch/arm/include/asm/arch-rmobile/sh73a0-gpio.h create mode 100644 arch/arm/include/asm/arch-rmobile/sh73a0.h create mode 100644 arch/arm/include/asm/arch-rmobile/sys_proto.h
arch/arm/cpu/armv7/rmobile/Makefile +10 -4
@@ -25,11 +25,17 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS += cpu_info.o -COBJS += timer.o +SOBJS = lowlevel_init.o +COBJS-y += board.o +COBJS-y += cpu_info.o +COBJS-y += timer.o -SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(COBJS) $(COBJS-y)) +COBJS-$(CONFIG_SH73A0) += cpu_info-sh73a0.o + +COBJS := $(COBJS-y) +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) START := $(addprefix $(obj),$(START)) all: $(obj).depend $(LIB)
arch/arm/cpu/armv7/rmobile/board.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* (C) Copyright 2012 Nobuhiro Iwamatsu <[email protected]> +* (C) Copyright 2012 Renesas Solutions Corp. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ +#include <common.h> +#include <asm/io.h> +#include <asm/arch/sys_proto.h> + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +printf ("Board: %s\n" , sysinfo.board_string); +return 0 ; +} +#endif /* CONFIG_DISPLAY_BOARDINFO */
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c new file +50 -0
50 lines not on this page · raw message
arch/arm/cpu/armv7/rmobile/cpu_info.c +16 -20
@@ -22,7 +22,6 @@*/ #include <common.h> #include <asm/io.h> -#include <asm/arch/rmobile.h> #ifdef CONFIG_ARCH_CPU_INIT int arch_cpu_init (void )
@@ -40,35 +39,32 @@ void enable_caches(void)#endif #ifdef CONFIG_DISPLAY_CPUINFO -static u32 get_cpu_type (void ) +static u32 __rmobile_get_cpu_type (void ) { -u32 id; -u32 type; - - id =readl (CCCR ); - type = (id >>8 ) &0xFF ; - -return type; +return 0x0 ; } +u32 rmobile_get_cpu_type (void ) + __attribute__((weak,alias ("__rmobile_get_cpu_type" ))); -static u32 get_cpu_rev (void ) +static u32 __rmobile_get_cpu_rev (void ) { -u32 id; -u32 rev; - - id =readl (CCCR ); - rev = (id >>4 ) &0xF ; - -return rev; +return 0 ; } +u32 rmobile_get_cpu_rev (void ) + __attribute__((weak,alias ("__rmobile_get_cpu_rev" )));int print_cpuinfo (void ) { -switch (get_cpu_type ()) { +switch (rmobile_get_cpu_type ()) { +case 0x37 : +printf ("CPU: Renesas Electronics SH73A0 rev %d\n" , +rmobile_get_cpu_rev ()); +break ;default : -printf ("CPU: Renesas Electronics CPU rev %d\n" ,get_cpu_rev ()); +printf ("CPU: Renesas Electronics CPU rev %d\n" , +get_cpu_rev ());break ; }return 0 ; } -#endif +#endif /* CONFIG_DISPLAY_CPUINFO */
arch/arm/cpu/armv7/rmobile/lowlevel_init.S new file +95 -0
95 lines not on this page · raw message
arch/arm/include/asm/arch-rmobile/rmobile.h +4 -0
@@ -2,7 +2,11 @@#define __ASM_ARCH_RMOBILE_H#if defined(CONFIG_RMOBILE ) +#if defined(CONFIG_SH73A0 ) +#include <asm/arch/sh73a0.h> +#else #error "SOC Name not defined" +#endif #endif /* CONFIG_RMOBILE */ #endif /* __ASM_ARCH_RMOBILE_H */
arch/arm/include/asm/arch-rmobile/sh73a0-gpio.h new file +553 -0
553 lines not on this page · raw message
arch/arm/include/asm/arch-rmobile/sh73a0.h new file +281 -0
281 lines not on this page · raw message
arch/arm/include/asm/arch-rmobile/sys_proto.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* (C) Copyright 2010 +* Texas Instruments, <www.ti.com> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef _SYS_PROTO_H_ +#define _SYS_PROTO_H_ + +struct rmobile_sysinfo { +char *board_string; +}; +extern const struct rmobile_sysinfo sysinfo; + +#endif
Signature · 1 line
1.7.10.4
PATCH v5 1/1 arm: rmobile: Add support Renesas SH73A0
arch/arm/cpu/armv7/rmobile/board.c line 33
Quoted 10 lines · On Sunday 19 August 2012 10:40:05 Nobuhiro Iwamatsu wrote:
arch/arm/cpu/armv7/rmobile/board.c new file +7
-0+#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +printf ("Board: %s\n" , sysinfo.board_string); +return 0 ; +} +#endif /* CONFIG_DISPLAY_BOARDINFO */
seems like you could have the makefile do:
COBJS-$(CONFIG_DISPLAY_BOARDINFO) += board.o
then you wouldn't need these ifdefs in this file
Quoted 18 lines
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c new file +15
-0+#ifdef CONFIG_DISPLAY_CPUINFO +u32 rmobile_get_cpu_type (void ) +{ +u32 id; +u32 type; +struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE ; + + id =readl (hpb->cccr); + type = (id >>8 ) &0xFF ; + +return type; +} + +u32 get_cpu_rev (void ) +{
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c line 50
Quoted 10 lines
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c new file +10
-0+u32 id; +u32 rev; +struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE ; + + id =readl (hpb->cccr); + rev = (id >>4 ) &0xF ; + + return rev; +} +#endif /* CONFIG_DISPLAY_CPUINFO */
seems like you could have the makefile do:
COBJS-$(CONFIG_DISPLAY_CPUINFO) += board.o
then you wouldn't need these ifdefs in this file
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120819/64b3aae3/attachment.pgp>
PATCH v5 1/1 arm: rmobile: Add support Renesas SH73A0
Hi,
Thanks for your review.
Quoted 49 lines · Mike Frysinger
arch/arm/cpu/armv7/rmobile/board.c line 33
Quoted 10 lines · On Sunday 19 August 2012 10:40:05 Nobuhiro Iwamatsu wrote:
arch/arm/cpu/armv7/rmobile/board.c new file +7
-0+#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +printf ("Board: %s\n" , sysinfo.board_string); +return 0 ; +} +#endif /* CONFIG_DISPLAY_BOARDINFO */ seems like you could have the makefile do:
COBJS-$(CONFIG_DISPLAY_BOARDINFO) += board.othen you wouldn't need these ifdefs in this file
Quoted 18 lines
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c new file +15
-0+#ifdef CONFIG_DISPLAY_CPUINFO +u32 rmobile_get_cpu_type (void ) +{ +u32 id; +u32 type; +struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE ; + + id =readl (hpb->cccr); + type = (id >>8 ) &0xFF ; + +return type; +} + +u32 get_cpu_rev (void ) +{arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c line 50
Quoted 10 lines
arch/arm/cpu/armv7/rmobile/cpu_info-sh73a0.c new file +10
-0+u32 id; +u32 rev; +struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE ; + + id =readl (hpb->cccr); + rev = (id >>4 ) &0xF ; + + return rev; +} +#endif /* CONFIG_DISPLAY_CPUINFO */ seems like you could have the makefile do:
COBJS-$(CONFIG_DISPLAY_CPUINFO) += board.o
Quoted 2 lines
then you wouldn't need these ifdefs in this file
-mike
Thanks, I will fix these.
Nobuhiro
Signature · 3 lines
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6