All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 5/5] Add target edosk2674
@ 2011-03-02  7:40 Yoshinori Sato
  0 siblings, 0 replies; only message in thread
From: Yoshinori Sato @ 2011-03-02  7:40 UTC (permalink / raw)
  To: u-boot

This part EDOSK2674 support
more infomation is 
http://www.renesas.eu/products/tools/introductory_evaluation_tools/evaluation_development_os_kits/edosk2674r/edosk2674r_software_tools_root.jsp

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 board/edosk2674/Makefile        |   48 ++++++++++++++++++
 board/edosk2674/config.mk       |   25 +++++++++
 board/edosk2674/edosk2674.c     |   63 +++++++++++++++++++++++
 board/edosk2674/lowlevel_init.S |   84 +++++++++++++++++++++++++++++++
 board/edosk2674/u-boot.lds      |   84 +++++++++++++++++++++++++++++++
 boards.cfg                      |    1 +
 drivers/net/lan91c96.h          |   21 ++++++++
 include/configs/edosk2674.h     |  104 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 430 insertions(+), 0 deletions(-)
 create mode 100644 board/edosk2674/Makefile
 create mode 100644 board/edosk2674/config.mk
 create mode 100644 board/edosk2674/edosk2674.c
 create mode 100644 board/edosk2674/lowlevel_init.S
 create mode 100644 board/edosk2674/u-boot.lds
 create mode 100644 include/configs/edosk2674.h

diff --git a/board/edosk2674/Makefile b/board/edosk2674/Makefile
new file mode 100644
index 0000000..5f74665
--- /dev/null
+++ b/board/edosk2674/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2010 Yoshinori Sato <ysato@users.sourceforge.jp>
+#
+# u-boot/board/edosk2674/Makefile
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB	= lib$(BOARD).o
+
+OBJS	:= edosk2674.o
+SOBJS	:= lowlevel_init.o
+
+LIB	:= $(addprefix $(obj),$(LIB))
+OBJS	:= $(addprefix $(obj),$(OBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/edosk2674/config.mk b/board/edosk2674/config.mk
new file mode 100644
index 0000000..966f893
--- /dev/null
+++ b/board/edosk2674/config.mk
@@ -0,0 +1,25 @@
+#
+# Copyright 2010 Yoshinori Sato <ysato@users.sourceforge.jp>
+#
+# 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
+
+#
+# TEXT_BASE refers to image _after_ relocation.
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+
+TEXT_BASE = 0xBC0000
diff --git a/board/edosk2674/edosk2674.c b/board/edosk2674/edosk2674.c
new file mode 100644
index 0000000..1e8ab00
--- /dev/null
+++ b/board/edosk2674/edosk2674.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2010 (C) Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ * 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 <net.h>
+#include <netdev.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+
+int checkboard(void)
+{
+	puts("BOARD: Renesas EDOSK2674R\n");
+	return 0;
+}
+
+int board_init(void)
+{
+	/* timer and SCI enable */
+	__raw_writeb(__raw_readb(0xffff41) & 0xf0, 0xffff41);
+	return 0;
+}
+
+int dram_init(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+	gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
+	gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
+	
+	printf("SDRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
+	return 0;
+}
+
+void led_set_state(unsigned short value)
+{
+}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_LAN91C96
+	rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+	return rc;
+}
+#endif
+
diff --git a/board/edosk2674/lowlevel_init.S b/board/edosk2674/lowlevel_init.S
new file mode 100644
index 0000000..21c4a42
--- /dev/null
+++ b/board/edosk2674/lowlevel_init.S
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2010 Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ * 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 <config.h>
+
+	.h8300s
+	.global	_lowlevel_init
+
+	.text
+	.align	2
+
+/*
+This function call to before relocate
+So not refer to absolute address
+*/
+_lowlevel_init:
+	bsr	1f
+1:	mov.l	@sp+,er4
+	mov.l	#init_table,er5
+	sub.l	#1b,er5
+	add.l	er5,er4
+	mov.w	#0xffff,e5
+2:	mov.w	@er4+,r5
+	beq	3f
+	mov.w	@er4+,r0
+	mov.b	r0l, at er5
+	bra	2b
+3:
+	sub.w	r0,r0
+	mov.w	r0, at 0xfed2:16
+	mov.w	#0x188,r0
+	mov.w	r0, at 0xfed4:16
+	mov.w	#0x85b4,r0
+	mov.w	r0, at 0xfed0:16
+	mov.b	#0,r1l
+	mov.b	r1l, at 0x400040
+	mov.w	#0x84b4,r0
+	mov.w	r0, at 0xfed0:16
+	rts
+
+	.align	2
+init_table:
+	.word	0xfec1,0x00fb
+	.word	0xfec6,0x0000
+	.word	0xfec0,0x0080
+	.word	0xfec2,0x0027
+	.word	0xfec3,0x0077
+	.word	0xfec4,0x0071
+	.word	0xfec5,0x0022
+	.word	0xfec8,0x0080
+	.word	0xfec9,0x0080
+	.word	0xfeca,0x00a0
+	.word	0xfecb,0x00a0
+	.word	0xfe22,0x003a
+	.word	0xfe3c,0x0006
+	.word	0xfe29,0x00ff
+	.word	0xfe2e,0x00fe
+	.word	0xfe2f,0x000f
+	.word	0xff74,0x000f
+	.word	0xfe32,0x00ff
+	.word	0xfe34,0x000d
+	.word	0xfe31,0x0028
+	.word	0xfe16,0x00ff
+	.word	0xfe17,0x00ff
+	.word	0xfe1c,0x0055
+	.word	0xfe1d,0x0055
+	.word	0
+
+	.end
diff --git a/board/edosk2674/u-boot.lds b/board/edosk2674/u-boot.lds
new file mode 100644
index 0000000..7ed1ded
--- /dev/null
+++ b/board/edosk2674/u-boot.lds
@@ -0,0 +1,84 @@
+/*
+ * (C) Copyright 2000, 2001
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * 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 <config.h>
+
+OUTPUT_ARCH(h8300s)
+ENTRY(_start)
+
+SECTIONS
+{
+	. = CONFIG_SYS_TEXT_BASE - 0x200;
+	.vector :
+	{
+		*(.vector)
+	}
+
+	PROVIDE (__start = .);
+	PROVIDE (__ftext = .);
+
+	.text :
+	{
+		arch/h8300/cpu/h8300s/start.o		(.text)
+		. = ALIGN(4);
+		*(.text)
+		. = ALIGN(4);
+	}
+	PROVIDE (__ecode = .);
+	.rodata :
+	{
+		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+		. = ALIGN(4);
+	}
+	PROVIDE (__etext = .);
+
+	PROVIDE (___u_boot_cmd_start = .);
+	.u_boot_cmd :
+	{
+		*(.u_boot_cmd)
+		. = ALIGN(4);
+	}
+	PROVIDE (___u_boot_cmd_end = .);
+
+	.data :
+	{
+		PROVIDE (__ram_data = .);
+	
+		*(.data)
+		. = ALIGN(4);
+	}
+	PROVIDE (__edata = .);
+
+	PROVIDE (_bss_start = .);
+	PROVIDE (___bss_start = .);
+	.bss :
+	{
+		*(.bss)
+		. = ALIGN(4);
+	}
+	PROVIDE (_bss_end = .);
+
+	PROVIDE (__end = .);
+	PROVIDE (__ram_vec =    0xffbe00);
+	PROVIDE (__init_stack = 0xffc000);
+}
diff --git a/boards.cfg b/boards.cfg
index 45c3102..f64c88e 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -202,6 +202,7 @@ ibf-dsp561                   blackfin    blackfin
 ip04                         blackfin    blackfin
 tcm-bf518                    blackfin    blackfin
 tcm-bf537                    blackfin    blackfin
+edosk2674		     h8300       h8300s      edosk2674          -              -
 eNET                         i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x38040000
 eNET_SRAM                    i386        i386        eNET                -              sc520       eNET:SYS_TEXT_BASE=0x19000000
 idmr                         m68k        mcf52x2
diff --git a/drivers/net/lan91c96.h b/drivers/net/lan91c96.h
index 6fbb0e3..ea2a7ef 100644
--- a/drivers/net/lan91c96.h
+++ b/drivers/net/lan91c96.h
@@ -146,6 +146,27 @@ typedef unsigned long int		dword;
 					};  \
 				})
 
+#elif defined(CONFIG_EDOSK2674)
+/* 8bit bus */
+#define SMC_inb(edev, r) (*(volatile byte *)((edev)->iobase+(r)))
+#define SMC_outb(edev, d, r) (*(volatile byte *)((edev)->iobase+(r)) = d)
+#define SMC_inw(edev, r) (*(volatile byte *)((edev)->iobase+(r)) | *(volatile byte *)((edev)->iobase+(r)+1) << 8)
+#define SMC_outw(edev, d, r) ({ *(volatile byte *)((edev)->iobase+(r)) = (d) & 0xff; \
+				*(volatile byte *)((edev)->iobase+(r)+1) = (d) >> 8; })
+#define SMC_insw(edev, r, b, l) ({ int __i; \
+			char *__b = (char *)b;	\
+			for (__i = 0; __i < l; __i++) { \
+				*__b++ = SMC_inb(edev, r);	\
+				*__b++ = SMC_inb(edev, r+1);	\
+			}					\
+		})
+#define SMC_outsw(edev, r, b, l) ({ int __i; \
+			char *__b = (char *)b;	\
+			for (__i = 0; __i < l; __i++) { \
+				SMC_outb(edev, *__b, r); __b++;	\
+				SMC_outb(edev, *__b, r+1); __b++;	\
+			}					\
+		})
 #else /* if not CONFIG_PXA250 */
 
 /*
diff --git a/include/configs/edosk2674.h b/include/configs/edosk2674.h
new file mode 100644
index 0000000..786592e
--- /dev/null
+++ b/include/configs/edosk2674.h
@@ -0,0 +1,104 @@
+/*
+ * Configuation settings for the Renesas EDOSK2674R
+ *
+ * Copyright (C) 2010 Yoshinori Sato
+ *
+ * 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 __EDOSK2674_H
+#define __EDOSK2674_H
+
+#undef DEBUG
+#define CONFIG_H8300		1
+#define CONFIG_H8300S		1
+#define CONFIG_CPU_H8S2678	1
+#define CONFIG_EDOSK2674	1
+
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+
+#define CONFIG_BAUDRATE		38400
+#define CONFIG_BOOTARGS		"console=ttySC0,115200"
+
+#define CONFIG_VERSION_VARIABLE
+#undef	CONFIG_SHOW_BOOT_PROGRESS
+
+/* MEMORY */
+#define EDOSK2674_FLASH_BASE	0x000000
+#define EDOSK2674_SDRAM_BASE	0x400000
+
+#define CONFIG_SYS_MONITOR_BASE	EDOSK2674_FLASH_BASE
+#define CONFIG_SYS_LONGHELP		/* undef to save memory	*/
+#define CONFIG_SYS_PROMPT	"=> "	/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE	256	/* Buffer size for input from the Console */
+#define CONFIG_SYS_PBSIZE	256	/* Buffer size for Console output */
+#define CONFIG_SYS_MAXARGS	16	/* max args accepted for monitor commands */
+
+/* Buffer size for Boot Arguments passed to kernel */
+#define CONFIG_SYS_BARGSIZE	512
+/* List of legal baudrate settings for this board */
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400 }
+
+/* SCI */
+#define CONFIG_SCI		1
+#define CONFIG_SCIF_CONSOLE	1
+#define CONFIG_CONS_SCIF2	1
+
+/* TIMER */
+#define CONFIG_TIMER_BASE	0xffffb0	/* CH0-1 */
+
+/* SDRAM */
+#define CONFIG_SYS_MEMTEST_START	EDOSK2674_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + (7 * 1024 * 1024))
+
+#define CONFIG_SYS_SDRAM_BASE	        EDOSK2674_SDRAM_BASE
+#define CONFIG_SYS_SDRAM_SIZE		(8 * 1024 * 1024)
+
+#define CONFIG_SYS_LOAD_ADDR		EDOSK2674_SDRAM_BASE
+#define CONFIG_SYS_TEXT_BASE		0xbc0000
+
+#define CONFIG_SYS_MALLOC_LEN		(256 * 1024)
+#define CONFIG_SYS_GBL_DATA_SIZE	256
+
+#define CONFIG_ENV_SIZE			(128 * 1024)
+#define CONFIG_ENV_IS_IN_FLASH		1
+#define CONFIG_ENV_ADDR			0x3e0000
+
+/* Board Clock */
+#define CONFIG_SYS_CLK_FREQ		33333333
+#define CONFIG_SYS_HZ			CONFIG_SYS_CLK_FREQ
+
+/* Ether */
+#define CONFIG_LAN91C96		1
+#define CONFIG_LAN91C96_BASE	0xf80000
+#define CONFIG_NET_MULTI	1
+
+/* Flash */
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#define CONFIG_SYS_MAX_FLASH_SECT	32
+#define CONFIG_SYS_FLASH_BASE		EDOSK2674_FLASH_BASE
+#define CONFIG_SYS_FLASH_CFI		1
+#define CONFIG_FLASH_CFI_DRIVER		1
+#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
+
+#endif	/* __EDOSK2674_H */
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-02  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02  7:40 [U-Boot] [PATCH 5/5] Add target edosk2674 Yoshinori Sato

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.