From f3a7b9535bc2bdf9fa50da6af2093b445516c111 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Mon, 25 Oct 2010 02:58:21 +0900 Subject: sh: Add support SH7706 Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/include/asm/cpu_sh3.h | 6 +++-- arch/sh/include/asm/cpu_sh7706.h | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 arch/sh/include/asm/cpu_sh7706.h (limited to 'arch') diff --git a/arch/sh/include/asm/cpu_sh3.h b/arch/sh/include/asm/cpu_sh3.h index 6db38a2..385f5dc 100644 --- a/arch/sh/include/asm/cpu_sh3.h +++ b/arch/sh/include/asm/cpu_sh3.h @@ -1,5 +1,5 @@ /* - * (C) Copyright 2007 Nobuhiro Iwamatsu + * (C) Copyright 2007-2009 Nobuhiro Iwamatsu * (C) Copyright 2007 Yoshihiro Shimoda * * This program is free software; you can redistribute it and/or @@ -31,7 +31,9 @@ #define CACHE_OC_NUM_ENTRIES 256 #define CACHE_OC_ENTRY_SHIFT 4 -#if defined(CONFIG_CPU_SH7710) +#if defined(CONFIG_CPU_SH7706) +#include +#elif defined(CONFIG_CPU_SH7710) #include #elif defined(CONFIG_CPU_SH7720) #include diff --git a/arch/sh/include/asm/cpu_sh7706.h b/arch/sh/include/asm/cpu_sh7706.h new file mode 100644 index 0000000..d093f88 --- /dev/null +++ b/arch/sh/include/asm/cpu_sh7706.h @@ -0,0 +1,53 @@ +#ifndef _ASM_CPU_SH7706_H_ +#define _ASM_CPU_SH7706_H_ + +#define CACHE_OC_NUM_WAYS 4 +#define CCR_CACHE_INIT 0x0000000D + +/* MMU and Cache control */ +#define MMUCR 0xFFFFFFE0 +#define CCR 0xFFFFFFEC + +/* PFC */ +#define PACR 0xA4050100 +#define PBCR 0xA4050102 +#define PCCR 0xA4050104 +#define PETCR 0xA4050106 + +/* Port Data Registers */ +#define PADR 0xA4050120 +#define PBDR 0xA4050122 +#define PCDR 0xA4050124 + +/* BSC */ +#define FRQCR 0xffffff80 +#define BCR1 0xffffff60 +#define BCR2 0xffffff62 +#define WCR1 0xffffff64 +#define WCR2 0xffffff66 +#define MCR 0xffffff68 + +/* SDRAM controller */ +#define DCR 0xffffff6a +#define RTCSR 0xffffff6e +#define RTCNT 0xffffff70 +#define RTCOR 0xffffff72 +#define RFCR 0xffffff74 +#define SDMR 0xFFFFD000 +#define CS3_R 0xFFFFE460 + +/* SCIF */ +#define SCSMR_2 0xA4000150 +#define SCIF0_BASE SCSMR_2 + +/* Timer */ +#define TSTR0 0xFFFFFE92 +#define TSTR TSTR0 +#define TCNT0 0xFFFFFE98 +#define TCR0 0xFFFFFE9C + +/* On chip oscillator circuits */ +#define WTCNT 0xFFFFFF84 +#define WTCSR 0xFFFFFF86 + +#endif /* _ASM_CPU_SH7706_H_ */ -- cgit v1.1 From c4176c43a1699096039b745f110413790aa635b1 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Tue, 26 Oct 2010 20:23:53 +0900 Subject: sh: Add support showing KByte of flash memory size Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/lib/board.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 3d201b2..cdac382 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007,2008 + * Copyright (C) 2007, 2008, 2010 * Nobuhiro Iwamatsu * * This program is free software; you can redistribute it and/or @@ -46,7 +46,11 @@ unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN; static int sh_flash_init(void) { gd->bd->bi_flashsize = flash_init(); - printf("FLASH: %ldMB\n", gd->bd->bi_flashsize / (1024*1024)); + + if (gd->bd->bi_flashsize >= (1024 * 1024)) + printf("FLASH: %ldMB\n", gd->bd->bi_flashsize / (1024*1024)); + else + printf("FLASH: %ldKB\n", gd->bd->bi_flashsize / 1024); return 0; } -- cgit v1.1 From efc0ba4395b1ce8341adbb302729b7a035663dd9 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Mon, 22 Nov 2010 15:56:43 +0900 Subject: sh: Remove SCIF/SCI register infomation The register information of SCIF/SCI was compiled by drivers/serial/serial_sh.h. Therefore, these are not necessary. Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/include/asm/cpu_sh7722.h | 38 -------------------------------------- arch/sh/include/asm/cpu_sh7750.h | 16 ---------------- arch/sh/include/asm/cpu_sh7780.h | 21 +-------------------- 3 files changed, 1 insertion(+), 74 deletions(-) (limited to 'arch') diff --git a/arch/sh/include/asm/cpu_sh7722.h b/arch/sh/include/asm/cpu_sh7722.h index 0975b78..3157dcb 100644 --- a/arch/sh/include/asm/cpu_sh7722.h +++ b/arch/sh/include/asm/cpu_sh7722.h @@ -325,44 +325,6 @@ #define SPICR1 0xA4420030 /* SCIF */ -/* -#define SCSMR 0xFFE00000 -#define SCBRR 0xFFE00004 -#define SCSCR 0xFFE00008 -#define SCFTDR 0xFFE0000C -#define SCFSR 0xFFE00010 -#define SCFRDR 0xFFE00014 -#define SCFCR 0xFFE00018 -#define SCFDR 0xFFE0001C -#define SCLSR 0xFFE00024 -#define SCSMR1 0xFFE10000 -#define SCBRR1 0xFFE10004 -#define SCSCR1 0xFFE10008 -#define SCFTDR1 0xFFE1000C -#define SCFSR1 0xFFE10010 -#define SCFRDR1 0xFFE10014 -#define SCFCR1 0xFFE10018 -#define SCFDR1 0xFFE1001C -#define SCLSR1 0xFFE10024 -#define SCSMR2 0xFFE20000 -#define SCBRR2 0xFFE20004 -#define SCSCR2 0xFFE20008 -#define SCFTDR2 0xFFE2000C -#define SCFSR2 0xFFE20010 -#define SCFRDR2 0xFFE20014 -#define SCFCR2 0xFFE20018 -#define SCFDR2 0xFFE2001C -#define SCLSR2 0xFFE20024 -#define SCSMR3 0xFFE30000 -#define SCBRR3 0xFFE30004 -#define SCSCR3 0xFFE30008 -#define SCFTDR3 0xFFE3000C -#define SCFSR3 0xFFE30010 -#define SCFRDR3 0xFFE30014 -#define SCFCR3 0xFFE30018 -#define SCFDR3 0xFFE3001C -#define SCLSR3 0xFFE30024 -*/ #define SCIF0_BASE 0xFFE00000 /* SIM */ diff --git a/arch/sh/include/asm/cpu_sh7750.h b/arch/sh/include/asm/cpu_sh7750.h index 4e43a46..b3e8424 100644 --- a/arch/sh/include/asm/cpu_sh7750.h +++ b/arch/sh/include/asm/cpu_sh7750.h @@ -166,26 +166,10 @@ /* SCI */ #define SCSMR1 0xFFE00000 -#define SCBRR1 0xFFE00004 -#define SCSCR1 0xFFE00008 -#define SCTDR1 0xFFE0000C -#define SCSSR1 0xFFE00010 -#define SCRDR1 0xFFE00014 -#define SCSCMR1 0xFFE00018 -#define SCSPTR1 0xFFE0001C #define SCF0_BASE SCSMR1 /* SCIF */ #define SCSMR2 0xFFE80000 -#define SCBRR2 0xFFE80004 -#define SCSCR2 0xFFE80008 -#define SCFTDR2 0xFFE8000C -#define SCFSR2 0xFFE80010 -#define SCFRDR2 0xFFE80014 -#define SCFCR2 0xFFE80018 -#define SCFDR2 0xFFE8001C -#define SCSPTR2 0xFFE80020 -#define SCLSR2 0xFFE80024 #define SCIF1_BASE SCSMR2 /* H-UDI */ diff --git a/arch/sh/include/asm/cpu_sh7780.h b/arch/sh/include/asm/cpu_sh7780.h index d4f824e..e9c59fe 100644 --- a/arch/sh/include/asm/cpu_sh7780.h +++ b/arch/sh/include/asm/cpu_sh7780.h @@ -333,27 +333,8 @@ #define RYRAR 0xFFE80054 /* Serial Communication Interface with FIFO */ -#define SCIF0_BASE SCSMR0 #define SCSMR0 0xFFE00000 -#define SCBRR0 0xFFE00004 -#define SCSCR0 0xFFE00008 -#define SCFSR0 0xFFE00010 -#define SCFCR0 0xFFE00018 -#define SCTFDR0 0xFFE0001C -#define SCRFDR0 0xFFE00020 -#define SCSPTR0 0xFFE00024 -#define SCLSR0 0xFFE00028 -#define SCRER0 0xFFE0002C -#define SCSMR1 0xFFE10000 -#define SCBRR1 0xFFE10004 -#define SCSCR1 0xFFE10008 -#define SCFSR1 0xFFE10010 -#define SCFCR1 0xFFE10018 -#define SCTFDR1 0xFFE1001C -#define SCRFDR1 0xFFE10020 -#define SCSPTR1 0xFFE10024 -#define SCLSR1 0xFFE10028 -#define SCRER1 0xFFE1002C +#define SCIF0_BASE SCSMR0 /* Serial I/O with FIFO */ #define SIMDR 0xFFE20000 -- cgit v1.1 From 858e8977eb30d7d314a6c5783adab5398d18bfd3 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Wed, 8 Dec 2010 13:42:18 +0900 Subject: sh: Delete the function that was not necessary Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/lib/bootm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch') diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c index 19b3a94..fe23b58 100644 --- a/arch/sh/lib/bootm.c +++ b/arch/sh/lib/bootm.c @@ -100,7 +100,6 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima /* Set commandline */ strcpy(cmdline, bootargs); - sh_check_cmd_arg(bootargs, CMD_ARG_RD_DOLOAD, 10); /* Initrd */ if (images->rd_start || images->rd_end) { unsigned long ramdisk_flags = 0; -- cgit v1.1 From 9980df5616a1561460ea079451db1b57c96131f5 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Wed, 8 Dec 2010 13:46:36 +0900 Subject: sh: Divided macro for zImage and add asm/zimage.h Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/include/asm/zimage.h | 41 +++++++++++++++++++++++++++++++++++++++++ arch/sh/lib/bootm.c | 20 ++++---------------- 2 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 arch/sh/include/asm/zimage.h (limited to 'arch') diff --git a/arch/sh/include/asm/zimage.h b/arch/sh/include/asm/zimage.h new file mode 100644 index 0000000..33a680b --- /dev/null +++ b/arch/sh/include/asm/zimage.h @@ -0,0 +1,41 @@ +/* + * (C) Copyright 2010 + * Renesas Solutions Corp. + * Nobuhiro Iwamatsu + * + * 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 + */ + +#ifndef _ASM_ZIMAGE_H_ +#define _ASM_ZIMAGE_H_ + +#define MOUNT_ROOT_RDONLY 0x000 +#define RAMDISK_FLAGS 0x004 +#define ORIG_ROOT_DEV 0x008 +#define LOADER_TYPE 0x00c +#define INITRD_START 0x010 +#define INITRD_SIZE 0x014 +#define COMMAND_LINE 0x100 + +#define RD_PROMPT (1<<15) +#define RD_DOLOAD (1<<14) +#define CMD_ARG_RD_PROMPT "prompt_ramdisk=" +#define CMD_ARG_RD_DOLOAD "load_ramdisk=" + +#endif diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c index fe23b58..57273fa 100644 --- a/arch/sh/lib/bootm.c +++ b/arch/sh/lib/bootm.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef CONFIG_SYS_DEBUG static void hexdump(unsigned char *buf, int len) @@ -43,19 +44,6 @@ static void hexdump(unsigned char *buf, int len) } #endif -#define MOUNT_ROOT_RDONLY 0x000 -#define RAMDISK_FLAGS 0x004 -#define ORIG_ROOT_DEV 0x008 -#define LOADER_TYPE 0x00c -#define INITRD_START 0x010 -#define INITRD_SIZE 0x014 -#define COMMAND_LINE 0x100 - -#define RD_PROMPT (1<<15) -#define RD_DOLOAD (1<<14) -#define CMD_ARG_RD_PROMPT "prompt_ramdisk=" -#define CMD_ARG_RD_DOLOAD "load_ramdisk=" - #ifdef CONFIG_SH_SDRAM_OFFSET #define GET_INITRD_START(initrd, linux) (initrd - linux + CONFIG_SH_SDRAM_OFFSET) #else @@ -94,8 +82,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; - /* Setup parameters */ - memset(param, 0, size); /* Clear zero page */ + /* Clear zero page */ + memset(param, 0, size); /* Set commandline */ strcpy(cmdline, bootargs); @@ -127,7 +115,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima /* Boot kernel */ kernel(); - /* does not return */ + /* does not return */ return 1; } -- cgit v1.1 From 45ce6f9e35663ea69fcb268e18e9e7f9fda4881d Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Wed, 8 Dec 2010 13:49:12 +0900 Subject: sh: Add support zimageboot command for Renesas SH Curent U-Boot can boot zImage by use the "go" command. But this is not right method. And this method can not set command-line to linux kernel. zimageboot sets command-line in environment of u-boot in linux kernel, and provides function to boot it. Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/lib/Makefile | 3 ++ arch/sh/lib/zimageboot.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 arch/sh/lib/zimageboot.c (limited to 'arch') diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 7f60396..c0670cb 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -31,6 +31,9 @@ COBJS-y += time_sh2.o else COBJS-y += time.o endif +ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y) +COBJS-y += zimageboot.o +endif SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) diff --git a/arch/sh/lib/zimageboot.c b/arch/sh/lib/zimageboot.c new file mode 100644 index 0000000..dd413c0 --- /dev/null +++ b/arch/sh/lib/zimageboot.c @@ -0,0 +1,80 @@ +/* + * (C) Copyright 2010 + * Renesas Solutions Corp. + * Nobuhiro Iwamatsu + * + * 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 + */ + +/* + * Linux SuperH zImage loading and boot + */ + +#include +#include +#include + +int do_sh_zimageboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + ulong (*zboot_entry)(int, char * const []) = NULL; + char *s0, *s1; + unsigned char *param = NULL; + char *cmdline; + char *bootargs; + + disable_interrupts(); + + if (argc >= 3) { + /* argv[1] holds the address of the zImage */ + s0 = argv[1]; + /* argv[2] holds the address of zero page */ + s1 = argv[2]; + } else { + goto exit; + } + + if (s0) + zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16); + + /* empty_zero_page */ + if (s1) + param = (unsigned char*)simple_strtoul(s1, NULL, 16); + + /* Linux kernel command line */ + cmdline = (char *)param + COMMAND_LINE; + bootargs = getenv("bootargs"); + + /* Clear zero page */ + memset(param, 0, 0x1000); + + /* Set commandline */ + strcpy(cmdline, bootargs); + + /* Boot */ + zboot_entry(0, NULL); + +exit: + return -1; +} + +U_BOOT_CMD( + zimageboot, 3, 0, do_sh_zimageboot, + "Boot zImage for Renesas SH", + "" +); -- cgit v1.1