• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンc18612e557af64e6c3a027af9b10feb9c2bba93e (tree)
日時2016-05-22 15:07:28
作者Yoshinori Sato <ysato@user...>
コミッターYoshinori Sato

ログメッセージ

sh: Add I-O DATA HDL-U (a.k.a LANDISK) support.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

変更サマリ

差分

--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -115,6 +115,14 @@ config TARGET_SH7785LCR
115115 bool "SH7785LCR"
116116 select CPU_SH4A
117117
118+config TARGET_LANDISK
119+ bool "I/O DATA LANDISK"
120+ select CPU_SH4
121+ select SPL
122+ select HAVE_GENERIC_BOARD
123+ select SYS_GENERIC_BOARD
124+ select SUPPORT_OF_CONTROL
125+
118126 endchoice
119127
120128 config SYS_ARCH
@@ -146,5 +154,6 @@ source "board/renesas/sh7757lcr/Kconfig"
146154 source "board/renesas/sh7763rdp/Kconfig"
147155 source "board/renesas/sh7785lcr/Kconfig"
148156 source "board/shmin/Kconfig"
157+source "board/landisk/Kconfig"
149158
150159 endmenu
--- a/arch/sh/cpu/sh4/start.S
+++ b/arch/sh/cpu/sh4/start.S
@@ -13,6 +13,7 @@
1313
1414 .global _start
1515 _sh_start:
16+#ifndef CONFIG_LANDISK
1617 mov.l ._lowlevel_init, r0
1718 100: bsrf r0
1819 nop
@@ -29,7 +30,7 @@ _sh_start:
2930 add #4, r4
3031 cmp/hs r6, r4
3132 bf 2b
32-
33+#endif
3334 mov.l ._bss_start, r4
3435 mov.l ._bss_end, r5
3536 mov #0, r1
@@ -63,7 +64,9 @@ loop:
6364 bra loop
6465 .align 2
6566
67+#ifndef CONFIG_LANDISK
6668 ._lowlevel_init: .long (lowlevel_init - (100b + 4))
69+#endif
6770 ._reloc_dst: .long reloc_dst
6871 ._reloc_dst_end: .long reloc_dst_end
6972 ._bss_start: .long bss_start
--- a/arch/sh/include/asm/spl.h
+++ b/arch/sh/include/asm/spl.h
@@ -7,6 +7,6 @@
77 #ifndef _ASM_SPL_H_
88 #define _ASM_SPL_H_
99
10-#define BOOT_DEVICE_IDE 0
10+#define BOOT_DEVICE_IDE 0x0001
1111
1212 #endif
--- /dev/null
+++ b/board/landisk/Kconfig
@@ -0,0 +1,9 @@
1+if TARGET_LANDISK
2+
3+config SYS_BOARD
4+ default "landisk"
5+
6+config SYS_CONFIG_NAME
7+ default "landisk"
8+
9+endif
--- /dev/null
+++ b/board/landisk/Makefile
@@ -0,0 +1,9 @@
1+#
2+# Copyright (C) 2007
3+# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4+#
5+# SPDX-License-Identifier: GPL-2.0+
6+#
7+
8+extra-y := start_landisk.o
9+obj-y := landisk.o
--- /dev/null
+++ b/board/landisk/landisk.c
@@ -0,0 +1,96 @@
1+/*
2+ * Copyright (C) 2007
3+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4+ *
5+ * SPDX-License-Identifier: GPL-2.0+
6+ */
7+
8+#include <common.h>
9+#include <asm/processor.h>
10+#include <asm/io.h>
11+#include <version.h>
12+#ifndef CONFIG_SPL_BUILD
13+#include <asm/pci.h>
14+#endif
15+#ifndef CONFIG_DM_ETH
16+#include <netdev.h>
17+#endif
18+
19+DECLARE_GLOBAL_DATA_PTR;
20+
21+int checkboard(void)
22+{
23+ puts("BOARD: LANDISK\n");
24+ return 0;
25+}
26+
27+int board_init(void)
28+{
29+ return 0;
30+}
31+
32+int dram_init (void)
33+{
34+ gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
35+ gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
36+#ifndef CONFIG_SPL_BUILD
37+ printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
38+#endif
39+ return 0;
40+}
41+#if !defined(CONFIG_DM_PCI) && defined(CONFIG_PCI)
42+static struct pci_controller hose;
43+void pci_init_board(void)
44+{
45+ pci_sh7751_init(&hose);
46+ __raw_writel(0xfe240000, 0xfe2001c8);
47+}
48+#endif
49+
50+#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_DM_ETH)
51+int board_eth_init(bd_t *bis)
52+{
53+ return pci_eth_init(bis);
54+}
55+#endif
56+
57+#ifdef CONFIG_SPL_BUILD
58+#include <spl.h>
59+u32 spl_boot_device(void)
60+{
61+ return BOOT_DEVICE_IDE;
62+}
63+
64+const char version_string[] = U_BOOT_VERSION_STRING;
65+
66+#endif
67+
68+void __raw_readsw(unsigned int addr, void *data, int wordlen)
69+{
70+ unsigned short *ptr = (unsigned short *)data;
71+
72+ while( wordlen-- ){
73+ *ptr++ = __raw_readw(addr);
74+ }
75+}
76+
77+void __raw_writesw(unsigned int addr, const void *data, int wordlen)
78+{
79+ unsigned short *ptr = (unsigned short *)data;
80+
81+ while( wordlen-- ){
82+ __raw_writew(*ptr++, addr);
83+ }
84+}
85+
86+static int do_power_off(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
87+{
88+ __raw_writeb(0x01, 0xb0000003);
89+ return 0;
90+}
91+
92+U_BOOT_CMD(
93+ poff, 1, 1, do_power_off,
94+ "power off",
95+ ""
96+);
--- /dev/null
+++ b/board/landisk/start_landisk.S
@@ -0,0 +1,65 @@
1+/*
2+ * (C) Copyright 2007, 2010
3+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4+ *
5+ * SPDX-License-Identifier: GPL-2.0+
6+ */
7+
8+#include <asm-offsets.h>
9+#include <config.h>
10+#include <version.h>
11+
12+ .text
13+ .align 2
14+
15+ .global _start
16+_sh_start:
17+ /* cache off */
18+ mov #1,r4
19+ mov #6,r0
20+ trapa #0x3f
21+
22+ /* load SPL body via sh-ipl-g */
23+ mov.l ._load,r15
24+ mov #2,r0
25+ mov #127,r7
26+ mov.l ._load,r6
27+ mov #1,r5
28+ mov #0x80,r4
29+ extu.b r4,r4
30+ trapa #0x3f
31+
32+ mov.l ._bss_start, r4
33+ mov.l ._bss_end, r5
34+ mov #0, r1
35+
36+3: mov.l r1, @r4 /* bss clear */
37+ add #4, r4
38+ cmp/hs r5, r4
39+ bf 3b
40+
41+ mov.l ._stack_init, r15
42+ mov.l ._board_init_f_init_reserve, r0
43+ jsr @r0
44+ mov r15, r4
45+
46+ mov.l ._board_init_r, r0
47+ jsr @r0
48+ mov r13,r4
49+loop:
50+ bra loop
51+
52+ .align 2
53+
54+._sh_start: .long _sh_start
55+._bss_start: .long bss_start
56+._bss_end: .long bss_end
57+._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
58+._board_init_r: .long board_init_r
59+._board_init_f_init_reserve: .long board_init_f_init_reserve
60+._load: .long 2f
61+/* MBR signature */
62+ .space _sh_start + 510 - .
63+ .word 0xaa55
64+2:
65+ .end
--- /dev/null
+++ b/board/landisk/u-boot-spl.lds
@@ -0,0 +1,70 @@
1+/*
2+ * Copyright (C) 2007
3+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4+ *
5+ * Copyright (C) 2008-2009
6+ * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
7+ *
8+ * SPDX-License-Identifier: GPL-2.0+
9+ */
10+
11+OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
12+OUTPUT_ARCH(sh)
13+ENTRY(_start)
14+
15+SECTIONS
16+{
17+ /*
18+ * entry and reloct_dst will be provided via ldflags
19+ */
20+ . = .;
21+
22+ PROVIDE (_ftext = .);
23+ PROVIDE (_fcode = .);
24+ PROVIDE (_start = .);
25+
26+ .text :
27+ {
28+ KEEP(board/landisk/start_landisk.o (.text))
29+ *(.text*)
30+ . = ALIGN(4);
31+ } =0xFF
32+ PROVIDE (_ecode = .);
33+ .rodata :
34+ {
35+ *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
36+ . = ALIGN(4);
37+ }
38+ PROVIDE (_etext = .);
39+
40+
41+ PROVIDE (_fdata = .);
42+ .data :
43+ {
44+ *(.data*)
45+ . = ALIGN(4);
46+ }
47+ PROVIDE (_edata = .);
48+
49+ PROVIDE (_fgot = .);
50+ PROVIDE (_egot = .);
51+
52+
53+ .u_boot_list : {
54+ KEEP(*(SORT(.u_boot_list*)));
55+ }
56+
57+ PROVIDE (reloc_dst_end = .);
58+ /* _reloc_dst_end = .; */
59+
60+ PROVIDE (bss_start = .);
61+ PROVIDE (__bss_start = .);
62+ .bss (NOLOAD) :
63+ {
64+ *(.bss*)
65+ . = ALIGN(4);
66+ }
67+ PROVIDE (bss_end = .);
68+
69+ PROVIDE (__bss_end = .);
70+}
--- /dev/null
+++ b/board/landisk/u-boot.lds
@@ -0,0 +1,82 @@
1+/*
2+ * Copyright (C) 2007
3+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4+ *
5+ * Copyright (C) 2008-2009
6+ * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
7+ *
8+ * SPDX-License-Identifier: GPL-2.0+
9+ */
10+
11+OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
12+OUTPUT_ARCH(sh)
13+ENTRY(_start)
14+
15+SECTIONS
16+{
17+ /*
18+ * entry and reloct_dst will be provided via ldflags
19+ */
20+ . = .;
21+
22+ PROVIDE (_ftext = .);
23+ PROVIDE (_fcode = .);
24+ PROVIDE (_start = .);
25+
26+ .text :
27+ {
28+ KEEP(arch/sh/cpu/sh4/start.o (.text))
29+ *(.text*)
30+ . = ALIGN(4);
31+ } =0xFF
32+ PROVIDE (_ecode = .);
33+ .rodata :
34+ {
35+ *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
36+ . = ALIGN(4);
37+ }
38+ PROVIDE (_etext = .);
39+
40+
41+ PROVIDE (_fdata = .);
42+ .data :
43+ {
44+ *(.data)
45+ . = ALIGN(4);
46+ }
47+ PROVIDE (_edata = .);
48+
49+ PROVIDE (_fgot = .);
50+ .got :
51+ {
52+ *(.got)
53+ . = ALIGN(4);
54+ }
55+ PROVIDE (_egot = .);
56+
57+
58+ .u_boot_list : {
59+ KEEP(*(SORT(.u_boot_list*)));
60+ }
61+
62+ . = ALIGN(256);
63+ __init_begin = .;
64+ .text.init : { *(.text.init) }
65+ .data.init : { *(.data.init) }
66+ . = ALIGN(256);
67+ __init_end = .;
68+ PROVIDE (reloc_dst_end = .);
69+ /* _reloc_dst_end = .; */
70+
71+ PROVIDE (bss_start = .);
72+ PROVIDE (__bss_start = .);
73+ .bss (NOLOAD) :
74+ {
75+ *(.bss)
76+ . = ALIGN(4);
77+ }
78+ PROVIDE (bss_end = .);
79+
80+ PROVIDE (__bss_end = .);
81+ PROVIDE (_end = .);
82+}
--- /dev/null
+++ b/include/configs/landisk.h
@@ -0,0 +1,128 @@
1+/*
2+ * Configuation settings for the Hitachi Solution Engine 7750
3+ *
4+ * Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5+ *
6+ * SPDX-License-Identifier: GPL-2.0+
7+ */
8+
9+#ifndef __LANDISK_H
10+#define __LANDISK_H
11+
12+#define CONFIG_CPU_SH7751 1
13+#define CONFIG_CPU_TYPE_R 1
14+#define CONFIG_LANDISK 1
15+#define __LITTLE_ENDIAN__ 1
16+
17+#define CONFIG_SYS_LDSCRIPT "board/landisk/u-boot.lds"
18+
19+/*
20+ * Command line configuration.
21+ */
22+#define CONFIG_CMD_IDE
23+#define CONFIG_CMD_EXT4
24+#define CONFIG_CMD_PCI
25+
26+#define CONFIG_SCIF_CONSOLE 1
27+#define CONFIG_BAUDRATE 115200
28+#define CONFIG_CONS_SCIF1 1
29+
30+#define CONFIG_BOOTDELAY -1
31+#define CONFIG_BOOTARGS "console=ttySC1,115200"
32+#define CONFIG_ENV_OVERWRITE 1
33+
34+/* SDRAM */
35+#define CONFIG_SYS_SDRAM_BASE (0x8C000000)
36+#define CONFIG_SYS_SDRAM_SIZE (64 * 1024 * 1024)
37+#define CONFIG_SYS_NO_FLASH
38+
39+/* PCI BUS */
40+#ifndef CONFIG_SPL_BUILD
41+#define CONFIG_PCI
42+#define CONFIG_SH4_PCI
43+#define CONFIG_SH7751_PCI
44+#define CONFIG_PCI_PNP
45+#define CONFIG_PCI_SCAN_SHOW
46+#define __io
47+#define __mem_pci
48+#endif
49+
50+#define CONFIG_PCI_MEM_BUS 0xFD000000 /* Memory space base addr */
51+#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
52+#define CONFIG_PCI_MEM_SIZE 0x01000000 /* Size of Memory window */
53+#define CONFIG_PCI_IO_BUS 0xfe240000 /* IO space base address */
54+#define CONFIG_PCI_IO_PHYS 0xfe240000
55+#define CONFIG_PCI_IO_SIZE 0x00040000 /* Size of IO window */
56+#define CONFIG_PCI_SYS_BUS (CONFIG_SYS_SDRAM_BASE & 0x1fffffff)
57+#define CONFIG_PCI_SYS_PHYS (CONFIG_SYS_SDRAM_BASE & 0x1fffffff)
58+#define CONFIG_PCI_SYS_SIZE CONFIG_SYS_SDRAM_SIZE
59+
60+#define CONFIG_SYS_LONGHELP
61+#define CONFIG_SYS_CBSIZE 256
62+#define CONFIG_SYS_PBSIZE 256
63+#define CONFIG_SYS_MAXARGS 16
64+#define CONFIG_SYS_BARGSIZE 512
65+
66+#define CONFIG_SYS_TEXT_BASE 0x8F800000
67+#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
68+#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE)
69+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_TEXT_BASE - 0x100000)
70+#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 4 * 1024 * 1024)
71+#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE) /* Address of u-boot image in Flash */
72+#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
73+#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Size of DRAM reserved for malloc() use */
74+#define CONFIG_FS_EXT4
75+
76+#define CONFIG_ENV_IS_IN_EXT4
77+#define EXT4_ENV_INTERFACE "ide"
78+#define EXT4_ENV_DEVICE_AND_PART "0:1"
79+#define EXT4_ENV_FILE "/u-boot.env"
80+#define CONFIG_ENV_SIZE 4096
81+#ifndef CONFIG_SPL_BUILD
82+#define CONFIG_EXT4_WRITE
83+#endif
84+#define CONFIG_EXTRA_ENV_SETTINGS \
85+ "preboot=ext4load ide 0:1 8c000000 u-boot.env; env import -b 8c000004"
86+#define CONFIG_PREBOOT
87+
88+#define CONFIG_LMB
89+
90+/* Board Clock */
91+#define CONFIG_SYS_CLK_FREQ 33333333
92+#define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ
93+#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
94+#define CONFIG_SYS_TMU_CLK_DIV 4
95+
96+#define CONFIG_LIBATA
97+#define CONFIG_DOS_PARTITION
98+
99+#define CONFIG_SYS_PIO_MODE 1
100+#define CONFIG_SYS_IDE_MAXBUS 1 /* IDE bus */
101+#define CONFIG_SYS_IDE_MAXDEVICE 2
102+#define CONFIG_SYS_ATA_BASE_ADDR 0xfe240000
103+#define CONFIG_SYS_ATA_STRIDE 1 /* 0bit shift */
104+#ifdef CONFIG_SPL_BUILD
105+#define CONFIG_SYS_ATA_DATA_OFFSET 0x4400 /* data reg offset */
106+#define CONFIG_SYS_ATA_REG_OFFSET 0x4400 /* reg offset */
107+#else
108+#define CONFIG_SYS_ATA_DATA_OFFSET 0x00000100 /* data reg offset */
109+#define CONFIG_SYS_ATA_REG_OFFSET 0x00000100 /* reg offset */
110+#endif
111+#define CONFIG_SYS_ATA_ALT_OFFSET 0x0a /* alternate register offset */
112+
113+#define CONFIG_NET_MULTI
114+#define CONFIG_RTL8139
115+
116+#define CONFIG_SPL_LDSCRIPT "board/landisk/u-boot-spl.lds"
117+#define CONFIG_SPL_FRAMEWORK
118+#define CONFIG_SPL_LIBGENERIC_SUPPORT
119+#define CONFIG_SPL_IDE_SUPPORT
120+#define CONFIG_SPL_LIBDISK_SUPPORT
121+#define CONFIG_SPL_EXT_SUPPORT
122+#define CONFIG_SPL_TARGET
123+#define CONFIG_SPL_LIBCOMMON_SUPPORT
124+#define CONFIG_SPL_PCI_SUPPORT
125+#define CONFIG_SYS_IDE_EXT4_BOOT_PARTITION 1
126+#define CONFIG_SPL_EXT4_LOAD_PAYLOAD_NAME "u-boot.img"
127+#define CONFIG_SPL_TEXT_BASE 0x8FF00000
128+#endif /* __LANDISK_H */