OSDN Git Service

ADSP-BF527依存部。ビルドには成功したがテストしてない。
authorsuikan <suikan@users.sourceforge.jp>
Thu, 14 Feb 2013 13:56:40 +0000 (22:56 +0900)
committersuikan <suikan@users.sourceforge.jp>
Thu, 14 Feb 2013 13:56:40 +0000 (22:56 +0900)
17 files changed:
jsp/config/blackfin/_common_bf527/bf527elf.ld [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/chip_config.c [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/chip_config.h [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/chip_debugboot.c [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/chip_defs.h [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/chip_dump.c [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/hw_serial.cfg [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/hw_serial.h [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/hw_timer.h [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/sys_rename.def [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/sys_rename.h [new file with mode: 0644]
jsp/config/blackfin/_common_bf527/sys_unrename.h [new file with mode: 0644]
jsp/config/blackfin/evb_aud6/Makefile.config [new file with mode: 0644]
jsp/config/blackfin/evb_aud6/jsp_ezkit_bf518.dpj [new file with mode: 0755]
jsp/config/blackfin/evb_aud6/readme.txt [new file with mode: 0644]
jsp/config/blackfin/evb_aud6/sys_config.h [new file with mode: 0644]
jsp/config/blackfin/evb_aud6/sys_defs.h [new file with mode: 0644]

diff --git a/jsp/config/blackfin/_common_bf527/bf527elf.ld b/jsp/config/blackfin/_common_bf527/bf527elf.ld
new file mode 100644 (file)
index 0000000..2b493ea
--- /dev/null
@@ -0,0 +1,409 @@
+/*
+ADSP-BF527用 LD ファイル
+*/
+OUTPUT_FORMAT("elf32-bfin","elf32-bfin","elf32-bfin")
+OUTPUT_ARCH(bfin)
+
+PROVIDE (ldf_stack_end = 0xffb00FFC ) ;
+PROVIDE (hardware_init_hook = 0) ;
+PROVIDE (software_init_hook = 0) ;
+PROVIDE (software_term_hook = 0) ;
+PROVIDE (__kernel_boot_for_gdb = 0);
+
+ENTRY (start);
+
+MEMORY
+  {
+    MEM_SDRAM (XW)    : ORIGIN = 0x00000000, LENGTH = 128M
+    MEM_ASYNC_0 (XW)  : ORIGIN = 0x20000000, LENGTH = 1M
+    MEM_ASYNC_1 (XW)  : ORIGIN = 0x20100000, LENGTH = 1M
+    MEM_ASYNC_2 (XW)  : ORIGIN = 0x20200000, LENGTH = 1M
+    MEM_ASYNC_3 (XW)  : ORIGIN = 0x20300000, LENGTH = 1M
+
+    MEM_L1_DATA_A (W!X)  : ORIGIN = 0xff800000, LENGTH = 32K
+    MEM_L1_DATA_B (W!X)  : ORIGIN = 0xff900000, LENGTH = 16K    /* BF518のバンクBは32kBだが、キャッシュ用に16kBあけておく */
+    MEM_L1_CODE (XR)   : ORIGIN = 0xffa00000, LENGTH = 48K
+/*  MEM_L1_INST_C (XR)   : ORIGIN = 0xffa10000, LENGTH = 16K    BF518のバンクCは16kBだが、キャッシュ用にあけておく */
+    MEM_L1_SCRATCH (W!X) : ORIGIN = 0xffb00000, LENGTH = 4K
+
+    MEM_L2              : ORIGIN = 0xffe00000, LENGTH = 0   /* DUMMY */
+    
+    MEM_SYSMMR (W!X)  : ORIGIN = 0xffc00000, LENGTH = 2M
+    MEM_COREMMR (W!X) : ORIGIN = 0xffe00000, LENGTH = 2M
+  }
+
+SECTIONS
+{
+
+/* Read-only sections, merged into text segment: */
+  .interp         : { *(.interp) }
+  .hash           : { *(.hash) }
+  .dynsym         : { *(.dynsym) }
+  .dynstr         : { *(.dynstr) }
+  .gnu.version    : { *(.gnu.version) }
+  .gnu.version_d  : { *(.gnu.version_d) }
+  .gnu.version_r  : { *(.gnu.version_r) }
+  .rel.init       : { *(.rel.init) }
+  .rela.init      : { *(.rela.init) }
+  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+  .rel.fini       : { *(.rel.fini) }
+  .rela.fini      : { *(.rela.fini) }
+  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+  .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+  .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+  .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+  .rela.tdata     : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+  .rel.tbss   : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+  .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+  .rel.ctors      : { *(.rel.ctors) }
+  .rela.ctors     : { *(.rela.ctors) }
+  .rel.dtors      : { *(.rel.dtors) }
+  .rela.dtors     : { *(.rela.dtors) }
+  .rel.got        : { *(.rel.got) }
+  .rela.got       : { *(.rela.got) }
+  .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+  .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+  .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+  .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+  .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+  .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+  .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+  .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+  .rel.plt        : { *(.rel.plt) }
+  .rela.plt       : { *(.rela.plt) }
+  .l2             :
+  {
+    *(.l2 .l2.*)
+  } >MEM_SDRAM
+  .start           :
+  {
+    KEEP (*(.start))
+  } >MEM_L1_CODE =0
+  .text           :
+  {
+    *(.text .stub .text.* .gnu.linkonce.t.*)
+    KEEP (*(.text.*personality*))
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+  } >MEM_L1_CODE =0
+  
+  .init           :
+  {
+    KEEP (*(.init))
+  } >MEM_L1_CODE =0
+  .plt            : { *(.plt) } >MEM_L1_CODE
+  .fini           :
+  {
+    KEEP (*(.fini))
+  } >MEM_L1_CODE =0
+  
+  PROVIDE (__etext = .);
+  PROVIDE (_etext = .);
+  PROVIDE (etext = .);
+  
+  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >MEM_L1_DATA_A
+  .rodata1        : { *(.rodata1) } >MEM_L1_DATA_A
+  
+  .sdata2         :
+  {
+    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+  } >MEM_L1_DATA_A
+  
+  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } >MEM_L1_DATA_A
+  .eh_frame_hdr : { *(.eh_frame_hdr) } >MEM_L1_DATA_A
+  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) } >MEM_L1_DATA_A
+  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } >MEM_L1_DATA_A
+  
+  /* Adjust the address for the data segment.  We want to adjust up to
+     the same address within the page on the next page up.  */
+  . = ALIGN(0x1000) + (. & (0x1000 - 1));
+  /* Exception handling  */
+  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) } >MEM_L1_DATA_A
+  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } >MEM_L1_DATA_A
+  /* Thread Local Storage sections  */
+  .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >MEM_L1_DATA_A
+  .tbss       : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >MEM_L1_DATA_A
+  .preinit_array     :
+  {
+    PROVIDE_HIDDEN (___preinit_array_start = .);
+    KEEP (*(.preinit_array))
+    PROVIDE_HIDDEN (___preinit_array_end = .);
+  } >MEM_L1_DATA_A
+  .init_array     :
+  {
+     PROVIDE_HIDDEN (___init_array_start = .);
+     KEEP (*(SORT(.init_array.*)))
+     KEEP (*(.init_array))
+     PROVIDE_HIDDEN (___init_array_end = .);
+  } >MEM_L1_DATA_A
+  .fini_array     :
+  {
+    PROVIDE_HIDDEN (___fini_array_start = .);
+    KEEP (*(.fini_array))
+    KEEP (*(SORT(.fini_array.*)))
+    PROVIDE_HIDDEN (___fini_array_end = .);
+  } >MEM_L1_DATA_A
+
+  .ctors          :
+  {
+    /* gcc uses crtbegin.o to find the start of
+       the constructors, so we make sure it is
+       first.  Because this is a wildcard, it
+       doesn't matter if the user does not
+       actually link against crtbegin.o; the
+       linker won't look for a file to match a
+       wildcard.  The wildcard also means that it
+       doesn't matter which directory crtbegin.o
+       is in.  */
+    KEEP (*crtbegin*.o(.ctors))
+    /* We don't want to include the .ctor section from
+       the crtend.o file until after the sorted ctors.
+       The .ctor section from the crtend file contains the
+       end of ctors marker and it must be last */
+    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
+    KEEP (*(SORT(.ctors.*)))
+    KEEP (*crtend*.o(.ctors))
+  } >MEM_L1_DATA_A
+  .dtors          :
+  {
+    KEEP (*crtbegin*.o(.dtors))
+    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
+    KEEP (*(SORT(.dtors.*)))
+    KEEP (*crtend*.o(.dtors))
+  } >MEM_L1_DATA_A
+  .jcr            : { KEEP (*(.jcr)) } >MEM_L1_DATA_A
+  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } >MEM_L1_DATA_A
+  .dynamic        : { *(.dynamic) } >MEM_L1_DATA_A
+  .data           :
+  {
+    *(.data .data.* .gnu.linkonce.d.*)
+    KEEP (*(.gnu.linkonce.d.*personality*))
+    SORT(CONSTRUCTORS)
+  } >MEM_L1_DATA_A
+  .data1          : { *(.data1) } >MEM_L1_DATA_A
+  .got            : { *(.got.plt) *(.got) } >MEM_L1_DATA_A
+  /* We want the small data sections together, so single-instruction offsets
+     can access them all, and initialized data all before uninitialized, so
+     we can shorten the on-disk segment size.  */
+  .sdata          :
+  {
+    *(.sdata .sdata.* .gnu.linkonce.s.*)
+  } >MEM_L1_DATA_A
+  __edata = .; PROVIDE (_edata = .);
+  .sbss           :
+  {
+    __bss_start = .;
+    *(.dynsbss)
+    *(.sbss .sbss.* .gnu.linkonce.sb.*)
+    *(.scommon)
+  } >MEM_L1_DATA_A
+  .bss            :
+  {
+    *(.dynbss)
+    *(.bss .bss.* .gnu.linkonce.b.*)
+    *(COMMON)
+    /* Align here to ensure that the .bss section occupies space up to
+       _end.  Align after .bss to ensure correct alignment even if the
+       .bss section disappears because there are no input sections.
+       FIXME: Why do we need it? When there is no .bss section, we don't
+       pad the .data section.  */
+    . = ALIGN(. != 0 ? 32 / 8 : 1);
+    __bss_end = .;
+  } >MEM_L1_DATA_A
+  . = ALIGN(32 / 8);
+  . = ALIGN(32 / 8);
+  __end = .; PROVIDE (_end = .);
+  /* Stabs debugging sections.  */
+  .stab          0 : { *(.stab) }
+  .stabstr       0 : { *(.stabstr) }
+  .stab.excl     0 : { *(.stab.excl) }
+  .stab.exclstr  0 : { *(.stab.exclstr) }
+  .stab.index    0 : { *(.stab.index) }
+  .stab.indexstr 0 : { *(.stab.indexstr) }
+  .comment       0 : { *(.comment) }
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+
+  __stack_end = ORIGIN(MEM_L1_SCRATCH) + LENGTH(MEM_L1_SCRATCH);
+
+  __heap_start = ORIGIN(MEM_L1_DATA_B);
+  __heap_end = ORIGIN(MEM_L1_DATA_B) + LENGTH(MEM_L1_DATA_B);
+
+
+    PROVIDE (end = .) ;
+
+/* ADSP-BF518依存のSYSTEM MMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0000; chip_mmr.o(SYSMMR0)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0100; chip_mmr.o(SYSMMR1)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x010C; chip_mmr.o(SYSMMR2)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x014C; chip_mmr.o(SYSMMR3)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0200; chip_mmr.o(SYSMMR4)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0300; chip_mmr.o(SYSMMR5)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0400; chip_mmr.o(SYSMMR6)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x041C; chip_mmr.o(SYSMMR7)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0424; chip_mmr.o(SYSMMR8)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0500; chip_mmr.o(SYSMMR9)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0600; chip_mmr.o(SYSMMR10)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0700; chip_mmr.o(SYSMMR11)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0800; chip_mmr.o(SYSMMR12)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0818; chip_mmr.o(SYSMMR13)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0820; chip_mmr.o(SYSMMR14)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0900; chip_mmr.o(SYSMMR15)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0918; chip_mmr.o(SYSMMR16)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0920; chip_mmr.o(SYSMMR17)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0A00; chip_mmr.o(SYSMMR18)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0A10; chip_mmr.o(SYSMMR19)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0B0C; chip_mmr.o(SYSMMR20)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C00; chip_mmr.o(SYSMMR21)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C10; chip_mmr.o(SYSMMR22)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C38; chip_mmr.o(SYSMMR23)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C40; chip_mmr.o(SYSMMR24)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C50; chip_mmr.o(SYSMMR25)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C78; chip_mmr.o(SYSMMR26)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C80; chip_mmr.o(SYSMMR27)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0C90; chip_mmr.o(SYSMMR28)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0CB8; chip_mmr.o(SYSMMR29)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0CC0; chip_mmr.o(SYSMMR30)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0CD0; chip_mmr.o(SYSMMR31)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0CF8; chip_mmr.o(SYSMMR32)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D00; chip_mmr.o(SYSMMR33)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D10; chip_mmr.o(SYSMMR34)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D38; chip_mmr.o(SYSMMR35)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D40; chip_mmr.o(SYSMMR36)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D50; chip_mmr.o(SYSMMR37)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D78; chip_mmr.o(SYSMMR38)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D80; chip_mmr.o(SYSMMR39)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0D90; chip_mmr.o(SYSMMR40)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0DB8; chip_mmr.o(SYSMMR41)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0DC0; chip_mmr.o(SYSMMR42)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0DD0; chip_mmr.o(SYSMMR43)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0DF8; chip_mmr.o(SYSMMR44)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E00; chip_mmr.o(SYSMMR45)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E10; chip_mmr.o(SYSMMR46)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E38; chip_mmr.o(SYSMMR47)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E40; chip_mmr.o(SYSMMR48)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E50; chip_mmr.o(SYSMMR49)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E78; chip_mmr.o(SYSMMR50)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E80; chip_mmr.o(SYSMMR51)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0E90; chip_mmr.o(SYSMMR52)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0EB8; chip_mmr.o(SYSMMR53)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0EC0; chip_mmr.o(SYSMMR54)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0ED0; chip_mmr.o(SYSMMR55)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0EF8; chip_mmr.o(SYSMMR56)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F00; chip_mmr.o(SYSMMR57)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F10; chip_mmr.o(SYSMMR58)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F38; chip_mmr.o(SYSMMR59)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F40; chip_mmr.o(SYSMMR60)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F50; chip_mmr.o(SYSMMR61)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F78; chip_mmr.o(SYSMMR62)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F80; chip_mmr.o(SYSMMR63)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0F90; chip_mmr.o(SYSMMR64)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0FB8; chip_mmr.o(SYSMMR65)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0FC0; chip_mmr.o(SYSMMR66)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0FD0; chip_mmr.o(SYSMMR67)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x0FF8; chip_mmr.o(SYSMMR68)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x1000; chip_mmr.o(SYSMMR69)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x1400; chip_mmr.o(SYSMMR70)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x1480; chip_mmr.o(SYSMMR71)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x1500; chip_mmr.o(SYSMMR72)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x1700; chip_mmr.o(SYSMMR73)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x2000; chip_mmr.o(SYSMMR74)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x201C; chip_mmr.o(SYSMMR75)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x2024; chip_mmr.o(SYSMMR76)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3000; chip_mmr.o(SYSMMR77)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x302C; chip_mmr.o(SYSMMR78)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3060; chip_mmr.o(SYSMMR79)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x30A0; chip_mmr.o(SYSMMR80)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3100; chip_mmr.o(SYSMMR81)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3180; chip_mmr.o(SYSMMR82)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3200; chip_mmr.o(SYSMMR83)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3210; chip_mmr.o(SYSMMR84)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3220; chip_mmr.o(SYSMMR85)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3240; chip_mmr.o(SYSMMR86)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3280; chip_mmr.o(SYSMMR87)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3288; chip_mmr.o(SYSMMR88)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3300; chip_mmr.o(SYSMMR89)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3340; chip_mmr.o(SYSMMR90)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3400; chip_mmr.o(SYSMMR91)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3500; chip_mmr.o(SYSMMR92)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3620; chip_mmr.o(SYSMMR93)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3680; chip_mmr.o(SYSMMR94)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3700; chip_mmr.o(SYSMMR95)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3800; chip_mmr.o(SYSMMR96)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3848; chip_mmr.o(SYSMMR97)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x3880; chip_mmr.o(SYSMMR98)}>MEM_SYSMMR
+    .bss.sysmmr (NOLOAD) : { . = 0x38C0; chip_mmr.o(SYSMMR99)}>MEM_SYSMMR
+*/
+
+
+
+
+/* Blackfin 共有のCORE MMR 
+    .bss.coremmr (NOLOAD) : {                    cpu_mmr.o(DMEMCTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(DCPLBA)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(DCPLBD)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(DTESTC)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(DTESTD)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(IMEMCTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(ICPLBA)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(ICPLBD)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(ITESTC)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(ITESTD)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(EVT)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(CEC)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(CTMR)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000)+0x1000; cpu_mmr.o(DBG)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(TBCTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(TBUF)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(WPICTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0040); cpu_mmr.o(WPIADDR)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0040); cpu_mmr.o(WPICNT)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(WPDCTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0040); cpu_mmr.o(WPDADDR)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0040); cpu_mmr.o(WPDCNT)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(WPSTAT)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x1000); cpu_mmr.o(PFCTL)}> MEM_COREMMR
+    .bss.coremmr (NOLOAD) : { . = ALIGN(0x0100); cpu_mmr.o(PFCNT)}> MEM_COREMMR
+
+*/
+    .comment        0 : { *(.comment) }
+    .debug          0 : { *(.debug) }
+    .line           0 : { *(.line) }
+    .debug_srcinfo  0 : { *(.debug_srcinfo) }
+    .debug_sfnames  0 : { *(.debug_sfnames) }
+    .debug_aranges  0 : { *(.debug_aranges) }
+    .debug_pubnames 0 : { *(.debug_pubnames) }
+}
diff --git a/jsp/config/blackfin/_common_bf527/chip_config.c b/jsp/config/blackfin/_common_bf527/chip_config.c
new file mode 100644 (file)
index 0000000..9ab01b3
--- /dev/null
@@ -0,0 +1,398 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2006 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)縲鰀(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+/*
+ *  ターゲットシステム依存モジュール(ADSP-BF518用)
+ */
+
+#include "jsp_kernel.h"
+#include <sil.h>
+
+#ifdef __GNUC__
+#include <cdefBF518.h>      /* gnu tool chain */
+#elif defined(__ECC__)
+#include <cdefbf518.h>              /* VisualDSP++ */
+#include <ccblkfn.h>
+#include <sysreg.h>
+#else
+#error "Compiler is not supported"
+#endif
+
+
+
+/*
+ *  ターゲットシステム依存の初期化
+ */
+void
+sys_initialize()
+{
+    /*
+     * チップのシリコンリビジョンに応じたPLL_CTLのデフォルト値.
+     * Silicon RevによるPLL_CTLの変化については anomaly および
+     * http://ez.analog.com/thread/14209 を参照。
+     */
+    int plldefault;
+
+    if (( *pDSPID & 0xFF ) < 2 )
+        plldefault = 0x0A00;
+    else
+        plldefault = 0x0b00;
+
+    /*
+     * スプリアス割り込みハンドラの設定
+     *
+     * cpu_initialize()が行うダミーの割り込みハンドラの設定を上書きする。
+     * アプリケーションが割り込みハンドラを設定すると、以下の設定も上書き
+     * される。
+     */
+    int i;
+
+    for ( i=0; i<DEVICE_INTERRUPT_COUNT+3; i++ )
+        dev_vector[i] = &spurious_int_handler;
+
+    exc_vector = &spurious_exc_handler;
+
+    /*
+     *  PLLの設定
+     *
+     */
+    /*
+     *  SSELVAL, CSELVALはboard_config.hにて定義。FORCE_PLL_INITIALIZEはsys_config.hで
+     *  必要に応じて宣言する。
+     */
+#ifndef FORCE_PLL_INITIALIZE
+        // PLLが初期値のままであり、かつ、SDRAMが利用中でなければPLLを初期化する
+     if ( ( *pPLL_CTL == plldefault ) && ( !(*pEBIU_SDBCTL & EBE ) ) )
+#endif
+     {
+
+        *pSIC_IWR = IWR_ENABLE(0);              // PLLのみIWRを許す
+#if CSELVAL == 1
+        *pPLL_DIV = CSEL_DIV1 | SET_SSEL(SSELVAL);
+#elif CSELVAL == 2
+        *pPLL_DIV = CSEL_DIV2 | SET_SSEL(SSELVAL);
+#elif CSELVAL == 4
+        *pPLL_DIV = CSEL_DIV4 | SET_SSEL(SSELVAL);
+#elif CSELVAL == 8
+        *pPLL_DIV = CSEL_DIV8 | SET_SSEL(SSELVAL);
+#else
+#error Wrong CSELVAL. Must be one of 1,2,4,8.
+#endif
+                // PLLの分周器に値を設定する
+        *pPLL_CTL = MSELVAL << 9;
+
+                // PLLを起動する。
+        asm("cli r0; csync; idle; sti r0;": : :"R0");
+        *pSIC_IWR = IWR_ENABLE_ALL;
+    }
+
+    /*
+     *  UART分周比の設定
+     *
+     *  Logtaskが動作する前にsys_putc()を使うための設定を行う。以下の設定は
+     *  serial関連のタスクが起動したときに上書きされる。
+     */
+#define DLAB 0x80
+
+        /* Blackfin 固有の設定。UARTイネーブル */
+    *pUART0_GCTL = 1;
+
+        /* クロックの設定 */
+    *pUART0_LCR |= DLAB;
+    *pUART0_DLL = UART0_DIVISOR & 0xFF ;
+    *pUART0_DLH = UART0_DIVISOR >> 8;
+    *pUART0_LCR &= ~DLAB;
+
+        /* モード設定, パリティ無し 8bit data, 1 stop bit */
+    *pUART0_LCR = 0x03;
+
+        /* 割込み禁止 */
+    *pUART0_IER = 0;
+
+    *pPORTG_MUX &= ~(0x0C00);   // bit11:10 だけを0にする
+    *pPORTG_MUX |= 0x01<<10;    // bit11:10 だけを01にする
+    *pPORTG_FER |= 0x0600;      // PG9,PG10をUART0に割り振る
+}
+
+/*
+ * priority_maskは、event順位0..15に応じた割り込み要求のビットマップを保持する。
+ * priority_mask[]のインデックスはevent順位と同じである。割り込み要因は BF51xでは
+ * 64要因あるので、unsigned long longによる64bit型としている。
+ *
+ * device_dispatch()はpriority_mask[]を参照して、現在起きたイベントがどの割り込み
+ * 要因であるか決定する助けとする。
+ *
+ * この変数はmake_priority_mask()を呼ぶ度に、実際のIARxの値に応じて上書きされる。
+ *
+ */
+unsigned long long int priority_mask[16]={
+    0x0000000000000000ull,  /* EMU */
+    0x0000000000000000ull,  /* RST */
+    0x0000000000000000ull,  /* NMI */
+    0x0000000000000000ull,  /* EVX */
+    0x0000000000000000ull,
+    0x0000000000000000ull,  /* IVHW */
+    0x0000000000000000ull,  /* IVTMR */
+    0x0007800000003FFFull,  /* IVG7 */
+    0x000000000000C000ull,  /* IVG8 */
+    0x00000000000F0000ull,  /* IVG9 */
+    0x00F8000003F00000ull,  /* IVG10 */
+    0x00000000FC000000ull,  /* IVG11 */
+    0x000003FF00000000ull,  /* IVG12 */
+    0x00007C0000000000ull,  /* IVG13 */
+    0x0000000000000000ull,  /* IVG14 */
+    0x0000000000000000ull   /* IVG15 */
+};
+
+
+/*
+* SIC_IARxを解析して、イベント順位ごとに割り当てられている割り込み
+* のビットマップを作る。SIC_IARxのフィールド値は優先順位-7なので
+* その分補正する。
+*/
+#define INSTALL_PRIORITY    \
+    for ( i=0; i<8; i++ ){ \
+        priority = iar & 0xf;                         /* IARから優先順位を取り出す */ \
+        priority_mask[priority + 7] |= device;        /* 取り出した優先順位に基づきデバイスを登録 */ \
+        device <<= 1;                                 /* 次のデバイス */ \
+        iar >>= 4;                                    /* 次のIARフィールド */ \
+    }
+
+/*
+*  割り込み順位ごとのISRビットマップの作成SIC_IARxの設定はこの部分より前に済ませること。
+*  この関数はuITRONのイニシャライザで使用することを想定しており、特に割り込みから保護していない。
+*/
+void make_priority_mask( void )
+{
+    unsigned int i, priority, iar;
+    unsigned long long int device;
+
+
+
+        // priority_maskは、event順位0..15に応じた割り込み要求のビットマップを保持する。
+        // 最初にクリアする
+    for ( i=0; i<16; i++ ){
+        priority_mask[i] = 0;
+    }
+
+    device = 1;
+    iar = *pSIC_IAR0;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR1;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR2;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR3;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR4;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR5;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR6;
+    INSTALL_PRIORITY
+
+    iar = *pSIC_IAR7;
+    INSTALL_PRIORITY
+
+}
+
+
+/*
+ * 割り込みの許可。ADSP-BF51xは効率的な割り込み処理と安全な割り込み禁止を両立する
+ * 手段を持たないため、禁止関数は置いていない。
+ *
+ * 不便ではあるが、プログラマに注意を促すためにそうしている。
+ */
+ER ena_int( INTNO intno )
+{
+    unsigned int mask;
+    SIL_PRE_LOC;
+
+    if ( intno >= DEVICE_INTERRUPT_COUNT )
+        return ( E_PAR );
+    else {
+        if ( intno < 32 ){
+            mask = 1 << intno;
+            SIL_LOC_INT();
+            *pSIC_IMASK0 |= mask;
+            asm volatile( "ssync;" );
+            SIL_UNL_INT();
+        }
+        else{
+            mask = 1 << (intno-32);
+            SIL_LOC_INT();
+            *pSIC_IMASK1 |= mask;
+            asm volatile( "ssync;" );
+            SIL_UNL_INT();
+        }
+        return (0);
+    }
+}
+
+
+/*
+ * 割り込みマスクの取得。ADSP-BF51xは効率的な割り込み処理と安全な割り込み禁止を両立する
+ * 手段を持たないため、禁止関数は置いていない。
+ *
+ * 不便ではあるが、プログラマに注意を促すためにそうしている。
+ */
+
+
+extern ER get_ims( IMS * p_ims )
+{
+    SIL_PRE_LOC;
+
+    SIL_LOC_INT();
+    *p_ims = (((IMS)*pSIC_IMASK1)<<32 ) | (IMS)*pSIC_IMASK0;
+    SIL_UNL_INT();
+    return( 0 );
+}
+
+
+/*
+ *  割り込みをデバイスに割り当てる。
+ *
+ *  この間数は割り込み発生時に共通割り込みハンドラの一部としてアセンブリ言語から割り込み禁止状態で
+ *  呼ばれる。実割り込みハンドラを割り込み可能にするため、asm文を使って途中で割り込み可能にしている。
+ *  割り込み禁止状態で呼ぶのは割り込み源の特定を安全におこなうためである。
+ *
+ */
+void device_dispatcher( unsigned int priority, unsigned int imask )
+{
+    unsigned int device, candidates;
+    unsigned long long int longcandidates, sic_isr, sic_imask;
+
+        // 以下では SIC_IMASK0,1をまとめて64bitレジスタとして扱っている。SIC_ISRも同じである。
+    get_ims(&sic_imask);
+    sic_isr = (((IMS)*pSIC_ISR1)<<32 ) | (IMS)*pSIC_ISR0;
+
+        // 現在のプライオリティに相当する割込み源を特定する。
+    longcandidates = priority_mask[priority] & sic_isr & sic_imask;
+
+    asm volatile("sti %0;": : "d"(imask) );
+
+    if ( ! longcandidates ) // 割り込み源が特定できないなら、コア由来である
+    {
+        if ( priority == ik_hardware_err)
+            dev_vector[INHNO_HW_ERROR]();
+        else
+            if ( priority == ik_timer)
+            dev_vector[INHNO_TIMER]();
+        else
+            dev_vector[INHNO_RAISE]();      // ソフトウェア割り込み
+
+    }
+    else if ( longcandidates & 0xFFFFFFFF00000000ull )
+    {
+        candidates = longcandidates >> 32;
+        if ( candidates & 0x80000000 )
+            device = 31;
+        else
+        {
+#ifdef __GNUC__
+    asm ( "r1.L = signbits %1; %0 = r1.L(z);":"=d"(device) :"d"(candidates): "R1"  );
+#elif defined(__ECC__)
+    asm( "%0 = signbits %1;" : "=l"( device ) : "d"( candidates ) );
+#else
+#error "Compiler is not supported"
+#endif
+            device = 30 - device;       // bit mask is converted to bit number
+        }
+        dev_vector[device+32]();
+    }
+    else
+    {
+        candidates = (unsigned int)longcandidates;
+        if ( candidates & 0x80000000 )
+            device = 31;
+        else
+        {
+#ifdef __GNUC__
+    asm ( "r1.L = signbits %1; %0 = r1.L(z);":"=d"(device) :"d"(candidates): "R1"  );
+#elif defined(__ECC__)
+    asm( "%0 = signbits %1;" : "=l"( device ) : "d"( candidates ) );
+#else
+#error "Compiler is not supported"
+#endif
+            device = 30 - device;       // bit mask is converted to bit number
+        }
+        dev_vector[device]();
+    }
+}
+
+
+
+/*
+ *  ターゲットシステムの終了。TOPPERS/JSPは対話型ROMモニタに戻ることを想定しているが、
+ *  このボードにROMはない。
+ */
+void
+sys_exit()
+{
+    while(1)
+        ;
+}
+
+/*
+ *  ターゲットシステムの文字出力。割り込みが無効な状態でポーリングによる出力を行う。
+ */
+void
+sys_putc(char c)
+{
+    if ( c== 0x0A )         /* もし LF ならば */
+        sys_putc( 0x0D );   /* CRを一文字送信 */
+
+    while( !( *pUART0_LSR & (1<<5)) )
+        ;       /* UART0 LSRのTHREが1になるまで待つ。1ならば送信レジスタ空き。*/
+
+    *pUART0_THR = c;    /* 一文字送信 */
+}
+
+
+
diff --git a/jsp/config/blackfin/_common_bf527/chip_config.h b/jsp/config/blackfin/_common_bf527/chip_config.h
new file mode 100644 (file)
index 0000000..f909276
--- /dev/null
@@ -0,0 +1,350 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2009 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+
+#ifndef _CHIP_CONFIG_H_
+#define _CHIP_CONFIG_H_
+
+
+/*
+ *  ターゲットシステム依存モジュール(EZKIT-BF527用)
+ *
+ *  このインクルードファイルは,t_config.h のみからインクルードされる.
+ *  他のファイルから直接インクルードしてはならない.
+*/
+
+/*
+ *  ターゲットシステムのハードウェア資源の定義
+ *
+ *  DEVICE_INTERRUPT_COUNTはSIC_IMASKのビット数
+ *  を与える。
+ *  ADSP-BF527のビット数は56なので、値は56である。(データシート参照)
+ */
+
+#define DEVICE_INTERRUPT_COUNT 56
+
+
+
+/*
+ *  PLLクロック周波数
+ */
+#define PLLCLOCK (CLKIN*MSELVAL)
+#define SYSCLOCK  (PLLCLOCK / SSELVAL)
+#define CORECLOCK (PLLCLOCK / CSELVAL)
+
+
+
+/*
+ *  TICの割込みハンドラのベクタ番号
+ */
+#ifdef USE_TIC_CORE
+#define INHNO_TIMER INHNO_CORE_TIMER
+#else
+#define INHNO_TIMER INHNO_TIMER7
+#endif
+
+
+/*
+ *  微少時間待ちのための定義
+ *  sil_dly_nseの呼び出しオーバーヘッドとループボディーサイクルを
+ *  nSで表す。関数はcpu_support.asmに定義してある。
+ *  SIL_DLY_TIM1は24サイクル。32nS( 750MHz ), 40nS( 600MHz )
+ *  SIL_DLY_TIM2は12サイクル。16nS( 750MHz ), 20nS( 600MHz )
+ */
+
+
+#define SIL_DLY_TIM1    (24*1000000000/CORECLOCK)
+#define SIL_DLY_TIM2    (12*1000000000/CORECLOCK)
+
+/*************************************************************************
+ * uart.c用構成マクロ
+ */
+
+/*  シリアルの割込みハンドラのベクタ番号 */
+#define INHNO_SIO0_TX   INHNO_UART0_TX
+#define INHNO_SIO0_RX   INHNO_UART0_RX
+#define INHNO_SIO1_TX   INHNO_UART1_TX
+#define INHNO_SIO1_RX   INHNO_UART1_RX
+
+/*
+ *  UARTレジスタの配置境界。ADSP-BF527の内蔵UARTは4バイト周期でレジスタが
+ *  並んでいるので、ここには4を指定する。
+ */
+#define UART_BOUNDARY 4
+
+/*  UARTレジスタにsil_xxb_iop()を使ってアクセスするときにはUART_IOP_ACCESSを 宣言する。*/
+#define UART_IOP_ACCESS
+
+/*  シリアルポートのアドレス。 */
+#define UART0_ADDRESS 0xFFC00400    // 内蔵UART0 THRのアドレス。
+#define UART1_ADDRESS 0xFFC02000    // 内蔵UART0 THRのアドレス。
+
+/*  UARTのボーレートジェネレータに設定すべき値. */
+#define UART0_DIVISOR   SYSCLOCK/16/UART0_BAUD_RATE
+#define UART1_DIVISOR   SYSCLOCK/16/UART1_BAUD_RATE
+
+/*  内蔵UARTを使う場合は、UARTx_BLACKFIN_UCENを宣言してUCENを初期化しなければならない。*/
+#define UART0_BLACKFIN_UCEN
+#define UART1_BLACKFIN_UCEN
+
+
+/*
+ * uart.c用構成マクロ終わり
+ *************************************************************************/
+
+
+
+/*
+ *  割り込みベクトル番号
+ *
+ *  この定義はコンフィグレーションファイルでDEF_INHの引数として使う
+ *  SIC_ISRにおけるビット番号である。
+ *
+ */
+
+/* Peripheral Masks For SIC_ISR0, SIC_IWR0, SIC_IMASK0 */
+#define INHNO_PLL_WAKEUP        0   /* PLL Wakeup Interrupt                             */
+#define INHNO_DMA_ERR0          1  /* Error Interrupt (DMA error 0 interrupt (generic))             */
+#define INHNO_DMAR0             2  /* DMAR0 Block (DMAR0 block interrupt)                   */
+#define INHNO_DMAR1             3  /* DMAR1 Block  (DMAR1 block interrupt)                  */
+#define INHNO_DMAR0_ERR         4  /* Error Interrupt (DMAR0 overflow error interrupt)              */
+#define INHNO_DMAR1_ERR         5  /* Error Interrupt (DMAR1 overflow error interrupt)              */
+#define INHNO_PPI_ERR           6  /* Error Interrupt (PPI error interrupt)                     */
+#define INHNO_MAC_ERR           7  /* Error Interrupt (MAC status interrupt)                */
+#define INHNO_SPORT0_ERR        8  /* Error Interrupt (SPORT0 status interrupt)                 */
+#define INHNO_SPORT1_ERR        9  /* Error Interrupt (SPORT1 status interrupt)                 */
+/* reserved */
+/* reserved */
+#define INHNO_UART0_ERR         12  /* Error Interrupt (UART0 status interrupt)                 */
+#define INHNO_UART1_ERR         13  /* Error Interrupt (UART1 status interrupt)                 */
+#define INHNO_RTC               14  /* Real Time Clock Interrupt                            */
+#define INHNO_PPI               15  /* DMA channel 0 (PPI/NFC) Interrupt                    */
+#define INHNO_SPORT0_RX     16  /* DMA Channel 3 (SPORT0 RX) Interrupt                  */
+#define INHNO_SPORT0_TX     17  /* DMA Channel 4 (SPORT0 TX) Interrupt                  */
+#define INHNO_SPORT1_RX     18  /* DMA Channel 5 (SPORT1 RX) Interrupt                  */
+#define INHNO_SPORT1_TX     19  /* DMA Channel 6 (SPORT1 TX) Interrupt                  */
+#define INHNO_TWI               20  /* TWI Interrupt                                    */
+#define INHNO_SPI               21  /* DMA Channel 7 (SPI) Interrupt                        */
+#define INHNO_UART0_RX          22  /* DMA Channel 8 (UART0 RX) Interrupt                   */
+#define INHNO_UART0_TX          23  /* DMA Channel 9 (UART0 TX) Interrupt                   */
+#define INHNO_UART1_RX          24  /* DMA Channel 10 (UART1 RX) Interrupt                  */
+#define INHNO_UART1_TX          25  /* DMA Channel 11 (UART1 TX) Interrupt                  */
+#define INHNO_OTP               26  /* OTP Interrupt                                    */
+#define INHNO_CNT           27  /* GP Counter Interrupt                             */
+#define INHNO_ETHERNET_RX       28  /* DMA Channel 1 (EthernetRX/HOSTDP) Interrupt              */
+#define INHNO_PFA_PORTH         29  /* PF Port H Interrupt A                            */
+#define INHNO_ETHERNET_TX       30  /* DMA Channel 2 (Ethernet TX/NFC) Interrupt                */
+#define INHNO_PFB_PORTH         31  /* PF Port H  Interrupt B                           */
+
+/* Peripheral Masks For SIC_ISR1, SIC_IWR1, SIC_IMASK1 */
+#define INHNO_TIMER0            32  /* Timer 0 Interrupt                                */
+#define INHNO_TIMER1            33  /* Timer 1 Interrupt                                */
+#define INHNO_TIMER2            34  /* Timer 2 Interrupt                                */
+#define INHNO_TIMER3            35  /* Timer 3 Interrupt                                */
+#define INHNO_TIMER4            36  /* Timer 4 Interrupt                                */
+#define INHNO_TIMER5            37  /* Timer 5 Interrupt                                */
+#define INHNO_TIMER6            38  /* Timer 6 Interrupt                                */
+#define INHNO_TIMER7            39  /* Timer 7 Interrupt                                */
+#define INHNO_PFA_PORTG     40  /* PF Port G Interrupt A                            */
+#define INHNO_PFB_PORTG     41  /* PF Port G Interrupt B                            */
+#define INHNO_MDMA0_DST     42  /* DMA Channels 12 (MDMA0 Destination) TX Interrupt         */
+#define INHNO_MDMA0_SRC     42  /* DMA Channels 13 (MDMA0 Source) RX Interrupt              */
+#define INHNO_MDMA1_DST     43  /* DMA Channels 14 (MDMA1 Destination) TX Interrupt         */
+#define INHNO_MDMA1_SRC     43  /* DMA Channels 15 (MDMA1 Source) RX Interrupt              */
+#define INHNO_WDOG              44  /* Software Watchdog Timer Interrupt                    */
+#define INHNO_PFA_PORTF     45  /* PF Port F Interrupt A                            */
+#define INHNO_PFB_PORTF     46  /* PF Port F Interrupt B                            */
+#define INHNO_SPI_ERR      47  /* Error Interrupt (SPI status interrupt)              */
+#define INHNO_NFC_ERR          48  /* Error Interrupt (NFC status interrupt)              */
+#define INHNO_HOSTDP_ERR      49  /* Error Interrupt (HOSTDP status interrupt)              */
+#define INHNO_HOST_READ           50  /* Host Read Interrupt               */
+/* reserved */
+#define INHNO_USB_INT0       52  /* USB INT0 interrupt                               */
+#define INHNO_USB_INT1       53  /* USB INT1 interrupt                               */
+#define INHNO_USB_INT2       54  /* USB INT1 interrupt                               */
+#define INHNO_USB_DMA        55  /* USB DMAINT interrupt                             */
+
+
+// SIC_ISRにない特殊な割り込み
+
+#define INHNO_HW_ERROR      56
+#define INHNO_CORE_TIMER    57
+#define INHNO_RAISE         58
+
+
+/*
+ *  SIC_ISRの割り込みのベクタ番号
+ *
+ *  この定義はena_int, dis_intの引数として使う。
+ */
+
+/* Peripheral Masks For SIC_ISR0, SIC_IWR0, SIC_IMASK0 */
+#define INTNO_PLL_WAKEUP        0   /* PLL Wakeup Interrupt                             */
+#define INTNO_DMA_ERR0          1  /* Error Interrupt (DMA error 0 interrupt (generic))             */
+#define INTNO_DMAR0             2  /* DMAR0 Block (DMAR0 block interrupt)                   */
+#define INTNO_DMAR1             3  /* DMAR1 Block  (DMAR1 block interrupt)                  */
+#define INTNO_DMAR0_ERR         4  /* Error Interrupt (DMAR0 overflow error interrupt)              */
+#define INTNO_DMAR1_ERR         5  /* Error Interrupt (DMAR1 overflow error interrupt)              */
+#define INTNO_PPI_ERR           6  /* Error Interrupt (PPI error interrupt)                     */
+#define INTNO_MAC_ERR           7  /* Error Interrupt (MAC status interrupt)                */
+#define INTNO_SPORT0_ERR        8  /* Error Interrupt (SPORT0 status interrupt)                 */
+#define INTNO_SPORT1_ERR        9  /* Error Interrupt (SPORT1 status interrupt)                 */
+/* reserved */
+/* reserved */
+#define INTNO_UART0_ERR         12  /* Error Interrupt (UART0 status interrupt)                 */
+#define INTNO_UART1_ERR         13  /* Error Interrupt (UART1 status interrupt)                 */
+#define INTNO_RTC               14  /* Real Time Clock Interrupt                            */
+#define INTNO_PPI               15  /* DMA channel 0 (PPI/NFC) Interrupt                    */
+#define INTNO_SPORT0_RX     16  /* DMA Channel 3 (SPORT0 RX) Interrupt                  */
+#define INTNO_SPORT0_TX     17  /* DMA Channel 4 (SPORT0 TX) Interrupt                  */
+#define INTNO_SPORT1_RX     18  /* DMA Channel 5 (SPORT1 RX) Interrupt                  */
+#define INTNO_SPORT1_TX     19  /* DMA Channel 6 (SPORT1 TX) Interrupt                  */
+#define INTNO_TWI               20  /* TWI Interrupt                                    */
+#define INTNO_SPI               21  /* DMA Channel 7 (SPI) Interrupt                        */
+#define INTNO_UART0_RX          22  /* DMA Channel 8 (UART0 RX) Interrupt                   */
+#define INTNO_UART0_TX          23  /* DMA Channel 9 (UART0 TX) Interrupt                   */
+#define INTNO_UART1_RX          24  /* DMA Channel 10 (UART1 RX) Interrupt                  */
+#define INTNO_UART1_TX          25  /* DMA Channel 11 (UART1 TX) Interrupt                  */
+#define INTNO_OTP               26  /* OTP Interrupt                                    */
+#define INTNO_CNT           27  /* GP Counter Interrupt                             */
+#define INTNO_ETHERNET_RX       28  /* DMA Channel 1 (EthernetRX/HOSTDP) Interrupt              */
+#define INTNO_PFA_PORTH         29  /* PF Port H Interrupt A                            */
+#define INTNO_ETHERNET_TX       30  /* DMA Channel 2 (Ethernet TX/NFC) Interrupt                */
+#define INTNO_PFB_PORTH         31  /* PF Port H  Interrupt B                           */
+
+/* Peripheral Masks For SIC_ISR1, SIC_IWR1, SIC_IMASK1 */
+#define INTNO_TIMER0            32  /* Timer 0 Interrupt                                */
+#define INTNO_TIMER1            33  /* Timer 1 Interrupt                                */
+#define INTNO_TIMER2            34  /* Timer 2 Interrupt                                */
+#define INTNO_TIMER3            35  /* Timer 3 Interrupt                                */
+#define INTNO_TIMER4            36  /* Timer 4 Interrupt                                */
+#define INTNO_TIMER5            37  /* Timer 5 Interrupt                                */
+#define INTNO_TIMER6            38  /* Timer 6 Interrupt                                */
+#define INTNO_TIMER7            39  /* Timer 7 Interrupt                                */
+#define INTNO_PFA_PORTG     40  /* PF Port G Interrupt A                            */
+#define INTNO_PFB_PORTG     41  /* PF Port G Interrupt B                            */
+#define INTNO_MDMA0_DST     42  /* DMA Channels 12 (MDMA0 Destination) TX Interrupt         */
+#define INTNO_MDMA0_SRC     42  /* DMA Channels 13 (MDMA0 Source) RX Interrupt              */
+#define INTNO_MDMA1_DST     43  /* DMA Channels 14 (MDMA1 Destination) TX Interrupt         */
+#define INTNO_MDMA1_SRC     43  /* DMA Channels 15 (MDMA1 Source) RX Interrupt              */
+#define INTNO_WDOG              44  /* Software Watchdog Timer Interrupt                    */
+#define INTNO_PFA_PORTF     45  /* PF Port F Interrupt A                            */
+#define INTNO_PFB_PORTF     46  /* PF Port F Interrupt B                            */
+#define INTNO_SPI_ERR      47  /* Error Interrupt (SPI status interrupt)              */
+#define INTNO_NFC_ERR          48  /* Error Interrupt (NFC status interrupt)              */
+#define INTNO_HOSTDP_ERR      49  /* Error Interrupt (HOSTDP status interrupt)              */
+#define INTNO_HOST_READ           50  /* Host Read Interrupt               */
+/* reserved */
+#define INTNO_USB_INT0       52  /* USB INT0 interrupt                               */
+#define INTNO_USB_INT1       53  /* USB INT1 interrupt                               */
+#define INTNO_USB_INT2       54  /* USB INT1 interrupt                               */
+#define INTNO_USB_DMA        55  /* USB DMAINT interrupt                             */
+
+
+
+#ifndef _MACRO_ONLY
+
+/*
+* SIC_IARxを解析して、イベント順位ごとに割り当てられている割り込み
+* のビットマップを作る。SIC_IARxのフィールド値は優先順位-7なので
+* その分補正する。
+*/
+void make_priority_mask( void );
+
+/*
+ *  ターゲットシステム依存の初期化
+ */
+extern void sys_initialize(void);
+
+/*
+ *  ターゲットシステムの終了
+ *
+ *  システムを終了する時に使う.ROMモニタ/GDB STUB呼出しで実現する.
+ */
+extern void sys_exit(void);
+
+/*
+ *  ターゲットシステムの文字出力
+ *
+ *  システムの低レベルの文字出力ルーチン.ROMモニタ/GDB STUB呼出しで実
+ *  現する.
+ */
+extern void sys_putc(char c);
+
+/*
+* SIC_IARxを解析して、イベント順位ごとに割り当てられている割り込み
+* のビットマップを作る。SIC_IARxのフィールド値は優先順位-7なので
+* その分補正する。
+*/
+void make_priority_mask( void );
+
+/*
+ * 割り込みの許可、禁止
+ *
+ */
+typedef unsigned int INTNO;
+extern ER ena_int( INTNO intno );
+extern ER dis_int( INTNO intno );
+
+/*
+ * 割り込みマスクの操作
+ *
+ *
+ */
+typedef unsigned long long int IMS;
+extern ER chg_ims( IMS ims );
+extern ER get_ims( IMS * p_ims );
+
+/*
+ *  割り込みをデバイスに割り当てる
+ */
+extern void device_dispatcher( unsigned int priority, unsigned int imask );
+
+/**
+ * スプリアス・イベント・ハンドラ
+ */
+void spurious_exc_handler(VP p_excinf);
+void spurious_int_handler();
+
+#endif /* _MACRO_ONLY */
+#endif /* _SYS_CONFIG_H_ */
diff --git a/jsp/config/blackfin/_common_bf527/chip_debugboot.c b/jsp/config/blackfin/_common_bf527/chip_debugboot.c
new file mode 100644 (file)
index 0000000..3688622
--- /dev/null
@@ -0,0 +1,35 @@
+#include "jsp_kernel.h"
+
+#ifdef __GNUC__
+#include "cdefBF527.h"       /* gnu tool chain */
+#elif defined(__ECC__)
+#error "Don't use sys_debugboot.c for VDSP "
+#else
+#error "Compiler is not supported"
+#endif
+
+
+/*
+* gdbserverがターゲットのリセット機能を提供しないため、gdb経由でターゲット
+* にアプリッケーションをダウンロードすると正しく動作しないことがある。
+* このルーチンはターゲットを一度だけリセットする。
+*/
+void boot_for_gdb( void )
+{
+    if ( enable_boot_for_gdb ){   /* ソフトウェアリセットが起きていないなら以下実行 */
+        enable_boot_for_gdb = 0;            /* リブートは一回だけ */
+        *pSWRST = 0x07;                     /* 内蔵ペリフェラルのリセット */
+        asm volatile( "ssync;" );
+        *pSWRST = 0x00;                     /* 内蔵ペリフェラルのリセット解除。 */
+        asm volatile( "ssync;" );
+        *pSYSCR |= 0x10;                    /* no boot on core reset */
+        asm volatile( "ssync;" );
+        asm volatile( "raise 1;" );         /* コアリセット */
+        while( 1 )
+            ;                               /*リセットが発生するまでループ*/
+    }
+    else
+    {
+        *pPLL_LOCKCNT = 0x200;          /* Fix the anormaly 05000430 */
+    }
+}
diff --git a/jsp/config/blackfin/_common_bf527/chip_defs.h b/jsp/config/blackfin/_common_bf527/chip_defs.h
new file mode 100644 (file)
index 0000000..9b9b894
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2009 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+
+/*
+ *  ターゲットシステムに依存する定義(ADSP-BF527用)
+ *
+ *  このインクルードファイルは,kernel.h と sil.h でインクルードされる.
+ *  他のファイルから直接インクルードすることはない.このファイルをイン
+ *  クルードする前に,t_stddef.h と itron.h がインクルードされるので,
+ *  それらに依存してもよい.
+ */
+
+#ifndef _CHIP_DEFS_H_
+#define _CHIP_DEFS_H_
+
+ /* チップ共通部略称  jsp/doc/config.txtの 2.(8)を参照 */
+#define _COMMON_BF527
+
+/*
+ *  タイムティックの定義
+ */
+#define TIC_NUME    1u  /* タイムティックの周期の分子 */
+#define TIC_DENO    1u  /* タイムティックの周期の分母 */
+
+/*
+ *  破壊性読み出しレジスタの判別式
+ *  与えられたアドレス iop が破壊性読み出しレジスタの
+ *  場合には真を返す。
+ */
+#ifndef DESTRUCTIVE_READ
+#define DESTRUCTIVE_READ( iop ) (iop<(VP)0xF0000000)
+#endif
+
+#ifndef _MACRO_ONLY
+
+/*
+ *  システムの停止処理
+ */
+
+Inline void
+kernel_abort()
+{
+}
+
+#endif /* _MACRO_ONLY */
+#endif /* _SYS_DEFS_H_ */
diff --git a/jsp/config/blackfin/_common_bf527/chip_dump.c b/jsp/config/blackfin/_common_bf527/chip_dump.c
new file mode 100644 (file)
index 0000000..c1f056b
--- /dev/null
@@ -0,0 +1,334 @@
+/**
+ * \file postmotem533.c
+ * \brief ADSP-BF533用のポストモーテムダンプルーチン群
+ *
+ * ハードウェアエラー用のハンドラと、例外用のハンドラからなる。いずれも呼び出されるとUARTから
+ * ポストモーテム出力を表示する。
+ */
+#include "jsp_kernel.h"
+#include <cdefBF518.h>
+
+/**
+ * \brief UARTおよび付随するDMAの動作を停止し、すべての割り込みを禁止する。
+ *
+ * 最後にUART_IERをクリアするのは、UART割り込みを禁止すると同時にDMAも禁止するため。
+ * UART DMAは、UARTの割り込み線で駆動されているので、割り込みを禁止すればDMAリクエスト
+ * も停止する。
+ *
+ * UARTの初期化をどうするか悩ましいが、ここではそのまま以前の設定を利用することにする。
+ *
+ * ポストモーテム・ダンプを目的としているので、この状態からの回復は考えない。
+ */
+static void pm_occupy_uart()
+{
+        /* すべてのコア割り込みを禁止する */
+    asm( "cli r0;" : : : "R0" );
+
+        /* すべてのシステム割り込みソースを禁止する */
+    *pSIC_IMASK0 = 0;
+    *pSIC_IMASK1 = 0;
+
+        /* UART_IERをディセーブルにすることで、DMAを殺せる */
+    *pUART0_IER = 0;
+}
+
+/**
+ * \brief 一文字出力
+ *
+ * UARTの送信レジスタが空になるのを待って一文字出力する。
+ */
+static void pm_putc( unsigned char c )
+{
+
+        /* THRが空になるまで待つ */
+    while ( ! ( *pUART0_LSR & THRE ) )
+        ;
+
+        /*  THRが空になったら1文字送信 */
+    *pUART0_THR = c;
+}
+
+/**
+ * \brief コンソール入力監視
+ *
+ * UARTの受信レジスタにデータがあれば、読み込む。データが"!"なら真、
+ * それ以外なら偽を返す。
+ */
+static BOOL is_ready()
+{
+        /* 受信データはあるか。 */
+    if ( *pUART0_LSR & DR )
+
+    {
+        char c;
+
+        c= *pUART0_RBR;
+        if ( c == '!' )
+            return TRUE;
+    }
+    return FALSE;
+}
+
+
+/**
+ * \brief 文字列出力
+ *
+ * 受け取った文字列をUARTに出力する。
+ */
+static void pm_putstr( char * s )
+{
+    int i;
+
+    i=0;
+    while( s[i] )   /* 末端のNULLが現れるまで出力 */
+        pm_putc(s[i++]);
+}
+
+/**
+ * \brief 1バイトをヘキサデシマルで出力する。
+ */
+static void pm_puthex1byte( unsigned int data )
+{
+    int i;
+    int nibble;
+
+        /* 8bit内のすべてのニブルを処理 */
+    for ( i=0; i<2; i++ )
+    {
+            /* 最上位ニブルを抽出 */
+        nibble = ( data >> 4 ) & 0xF;
+            /* 抽出したニブルを出力 */
+        if ( nibble < 10 )
+            pm_putc( nibble + '0' );
+        else
+            pm_putc( nibble - 10 + 'A' );
+            /* 次のニブル */
+        data <<= 4;
+    }
+}
+
+/*
+ * \brief 改行記号を出力する
+ */
+static void pm_putrtn()
+{
+    pm_putstr("\r\n");
+}
+
+/**
+ * \brief 4バイトをヘキサデシマルで出力する。
+ */
+static void pm_puthex4byte( unsigned int data )
+{
+    int i;
+    int nibble;
+
+        /* 32bit内のすべてのニブルを処理 */
+    for ( i=0; i<8; i++ )
+    {
+            /* 最上位ニブルを抽出 */
+        nibble = ( data >> 28 ) & 0xF;
+            /* 抽出したニブルを出力 */
+        if ( nibble < 10 )
+            pm_putc( nibble + '0' );
+        else
+            pm_putc( nibble - 10 + 'A' );
+            /* 次のニブル */
+        data <<= 4;
+    }
+
+}
+
+/**
+ * \brief 例外フラグ
+ *
+ * 例外が発生したときには真、そうでなければ偽。hwei_handler()に例外か否かを伝える。
+ *
+ * GCCが張り切ってlink/unlink命令の位置を最適化するため、hwei_hanlder()の
+ * 中で性格にfpを手繰れない。そのため、dummyをアクセスすることでlink/unlinkの位置
+ * 最適化の抑止を図る役目もある。効果があるかどうかは不明。
+ */
+static volatile int expFlag =0;
+/**
+ * \brief ハードウェア・エラー・ハンドラ
+ *
+ * ハードウェア・エラー時に呼び出されて、ハードウェア・エラー・割り込みのポストモーテム処理を行う。
+ * 最初にFPを手繰って、割り込みのスタックフレームを探す。次にすべての割り込みを禁止し、
+ * UART0を占有したあと、ポーリングを使ってスタックに保存された各レジスタのダンプを行う。
+ * DEF_INH(INHNO_HW_ERROR, { TA_HLNG, hwei_handler });
+ *
+ */
+void spurious_int_handler()
+{
+    unsigned int * fp, *ptr ;   /* フレーム・ポインタを手繰っていくための変数 */
+    unsigned int reg;   /* システムレジスタを受け取るための変数 */
+    unsigned int imask, sic_imask0, sic_imask1; /*マスク記録レジスタ*/
+
+            /* あとで使う */
+    imask = *pIMASK;
+    sic_imask0 = *pSIC_IMASK0;
+    sic_imask1 = *pSIC_IMASK1;
+            /* UART0を初期化し、DMAと割り込みを禁止する */
+    pm_occupy_uart();
+
+    while (1)
+    {
+        int count = 0;
+
+        pm_putstr( "Type '!' to display post mortem dump" ); pm_putrtn();
+
+        while ( ! is_ready() )
+        {
+            int i;
+            for ( i=0; i<100000000; i++)
+                asm volatile ("nop;");
+            if ( count > 30 )
+            {
+                pm_putstr( "Type '!' to display post mortem dump" ); pm_putrtn();
+                count = 0;
+            }
+            else
+                count ++;
+        }
+        pm_putrtn();
+
+
+        /* 現在の関数のFPを取得する */
+        asm ( "%0=fp;" : "=d"((unsigned int)fp) );
+
+        /*
+         * この関数を呼び出した関数 ( interrupt_dispatcher ) のFPを取得する。
+         * FPは呼び出し関数のFPの格納番地を指していることを利用する
+         */
+        fp = (void *)*fp;
+        /*
+         * interrupt_dispatcher を呼び出した関数のFPを取得する。
+         * その関数は割り込みハンドラの入り口処理部に他ならない。
+         */
+        fp = (void *)*fp;
+
+        /* いまや、FPは割り込み受付時の保存されたレジスタ群を指している */
+
+        /* プッシュされた P0を指す */
+        ptr = fp + 2;
+        /*
+         * 上位
+         *      0   1   2   3   4   5   6   7   8   9
+         * -----------------------------------------------
+         *  00  P0  RTS FP  R0  R1  R2  R3  R4  R5  R6
+         *  10  R7  P1  P2  P3  P4  P5  I3  I2  I1  I0
+         *  20  M3  M2  M1  M0  B3  B2  B1  B0  L3  L2
+         *  30  L1  L0  A0x A0w A1x A1w LC1 LC0 LT1 LT0
+         *  40  LB1 LB0 AST RETI
+         * 下位
+         *
+        */
+        if ( expFlag )
+            pm_putstr( "Spurious Exception  !!" );
+        else
+            pm_putstr( "Spurious Interrupt  !!" );
+        pm_putrtn();
+
+        pm_putstr( "Registers On Stack :" );    pm_putrtn();
+        pm_putstr( "P0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "RETS " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "FP   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R4   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R5   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R6   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "R7   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "P1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "P2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "P3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "P4   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "P5   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "I3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "I2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "I1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "I0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "M3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "M2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "M1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "M0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "B3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "B2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "B1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "B0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "L3   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "L2   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "L1   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "L0   " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "A0   " );   pm_puthex1byte( *(ptr--) ); pm_putstr( ":" );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "A1   " );   pm_puthex1byte( *(ptr--) ); pm_putstr( ":" );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LC1  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LC0  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LT1  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LT0  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LB1  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "LB0  " );   pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "ASTAT " );  pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putstr( "RETI  " );  pm_puthex4byte( *(ptr--) ); pm_putrtn();
+        pm_putrtn();
+        pm_putstr( "System Registers :" );  pm_putrtn();
+        pm_putstr( "SIC_IMASK1:0 " );   pm_puthex4byte( sic_imask1 );pm_putstr( " : " );pm_puthex4byte( sic_imask0 ); pm_putrtn();
+        pm_putstr( "SIC_ISR1:0   " );   pm_puthex4byte( *pSIC_ISR1 );pm_putstr( " : " );pm_puthex4byte( *pSIC_ISR0 );  pm_putrtn();
+        pm_putstr( "IMASK        " );   pm_puthex4byte( imask ); pm_putrtn();
+        pm_putstr( "ILAT         " );   pm_puthex4byte( *pILAT ); pm_putrtn();
+        pm_putstr( "IPEND        " );   pm_puthex4byte( *pIPEND ); pm_putrtn();
+        asm( "%0=SEQSTAT;" : "=d"(reg) );
+        pm_putstr( "SEQSTAT      " );   pm_puthex4byte( reg ); pm_putrtn();
+        pm_putstr( "  EXCAUSE    " );   pm_puthex1byte( reg & 0x3F ); pm_putrtn();
+        pm_putstr( "  HWERRCAUSE " );   pm_puthex1byte( (reg>>14)&0x1F ); pm_putrtn();
+        pm_putstr( "DMA0_IRQ_STATUS    " ); pm_puthex4byte( *pDMA0_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA1_IRQ_STATUS    " ); pm_puthex4byte( *pDMA1_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA2_IRQ_STATUS    " ); pm_puthex4byte( *pDMA2_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA3_IRQ_STATUS    " ); pm_puthex4byte( *pDMA3_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA4_IRQ_STATUS    " ); pm_puthex4byte( *pDMA4_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA5_IRQ_STATUS    " ); pm_puthex4byte( *pDMA5_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA6_IRQ_STATUS    " ); pm_puthex4byte( *pDMA6_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA7_IRQ_STATUS    " ); pm_puthex4byte( *pDMA7_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA8_IRQ_STATUS    " ); pm_puthex4byte( *pDMA8_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA9_IRQ_STATUS    " ); pm_puthex4byte( *pDMA9_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA10_IRQ_STATUS    " );    pm_puthex4byte( *pDMA10_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "DMA11_IRQ_STATUS    " );    pm_puthex4byte( *pDMA11_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "MDMA_D0_IRQ_STATUS " ); pm_puthex4byte( *pMDMA_D0_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "MDMA_S0_IRQ_STATUS " ); pm_puthex4byte( *pMDMA_S0_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "MDMA_D1_IRQ_STATUS " ); pm_puthex4byte( *pMDMA_D1_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "MDMA_S1_IRQ_STATUS " ); pm_puthex4byte( *pMDMA_S1_IRQ_STATUS ); pm_putrtn();
+        pm_putstr( "SPI_STAT           " ); pm_puthex4byte( *pSPI_STAT ); pm_putrtn();
+        pm_putstr( "PPI_STATUS         " ); pm_puthex4byte( *pPPI_STATUS ); pm_putrtn();
+        pm_putstr( "SPORT0_STAT        " ); pm_puthex4byte( *pSPORT0_STAT ); pm_putrtn();
+        pm_putstr( "SPORT1_STAT        " ); pm_puthex4byte( *pSPORT1_STAT ); pm_putrtn();
+        pm_putstr( "TIMER_STATUS       " ); pm_puthex4byte( *pTIMER_STATUS ); pm_putrtn();
+        pm_putstr( "EBIU_SDSTAT        " ); pm_puthex4byte( *pEBIU_SDSTAT ); pm_putrtn();
+        pm_putrtn();
+        pm_putstr( "Calling Stack :" ); pm_putrtn();
+
+        while( fp )
+        {
+            pm_putstr( "Called from " );    pm_puthex4byte( *(fp+1) ); pm_putrtn();
+            fp = *fp;
+        }
+    }
+}
+
+/**
+ * \brief CPU例外ハンドラ
+ *
+ * CPU例外ハンドラとしてcfgファイルに登録する。 hwei_handler()は呼ばれたら戻ってこないが、
+ * そのあとにもexpFlagに値を代入しているのは、最適化によってunlink命令の値がルーチン呼び出しの
+ * 前に移動することを防ぐためである。
+ *
+ * DEF_EXC(CPUEXC1, { TA_HLNG, excp_handler} );
+ *
+ */
+void spurious_exc_handler(VP p_excinf)
+{
+    expFlag = TRUE;
+    spurious_int_handler();
+}
+
diff --git a/jsp/config/blackfin/_common_bf527/hw_serial.cfg b/jsp/config/blackfin/_common_bf527/hw_serial.cfg
new file mode 100644 (file)
index 0000000..c55da13
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ *  SIOドライバ(ADSP-BF537用)のコンフィギュレーションファイル
+ */
+INCLUDE("\"hw_serial.h\"");
+DEF_INH(INHNO_SIO0_RX, { TA_HLNG, sio0_rx_handler });
+DEF_INH(INHNO_SIO0_TX, { TA_HLNG, sio0_tx_handler });
diff --git a/jsp/config/blackfin/_common_bf527/hw_serial.h b/jsp/config/blackfin/_common_bf527/hw_serial.h
new file mode 100644 (file)
index 0000000..7756528
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ */
+
+/*
+ *  シリアルI/Oデバイス(SIO)ドライバ(Blackfin UART用)
+ *
+ *   このファイルは、TOPPERS/JSP 1.4.2の config/sh3/ms7727cp01/hw_serial.hを
+ *   リネームし、内部の識別子を変更したものである。
+ *
+ *   このファイルは下位のデバイス・アクセス・ルーチンを束ねて上位の層に渡す
+ *   ためのものである。Blackfinの外部にあるシリアルをTOPPERS/JSPで管理しない
+ *   のなら、変更する必要はない。
+ */
+
+#ifndef _HW_SERIAL_H_
+#define _HW_SERIAL_H_
+
+#include <s_services.h>
+
+#include "uart.h"
+
+#ifdef __GNUC__         // gcc
+#include "cdefBF527.h"
+#elif defined(__ECC__)  // visualdsp
+#include <cdefbf527.h>
+#else
+#error "Compiler is not supported"
+#endif
+
+
+/*
+ *  SIOドライバの初期化ルーチン
+ */
+#define sio_initialize  uart_initialize
+
+#ifndef _MACRO_ONLY
+/*
+ *  シリアルI/Oポートのオープン
+ */
+Inline SIOPCB *
+sio_opn_por(ID siopid, VP_INT exinf)
+{
+    SIOPCB  *siopcb;
+    UW regBase;
+
+    /*
+     *  デバイス依存のオープン処理.
+     */
+    siopcb = uart_opn_por(siopid, exinf);
+
+    /*
+    * Enable Corrensponding Interrupt at IMASK
+    */
+    regBase = siopcb->siopinib->reg_base;
+    if ( regBase == UART0_ADDRESS ) {        // UART0の場合
+        ena_int( INTNO_UART0_TX );
+        ena_int( INTNO_UART0_RX );
+        *pPORTG_MUX &= ~(0x0C00);   // bit11:10 だけを0にする
+        *pPORTG_MUX |= 0x01<<10;    // bit11:10 だけを01にする
+        *pPORTG_FER |= 0x0600;      // PG9,PG10をUART0に割り振る
+    }
+    else if ( regBase == UART1_ADDRESS ){       // uart1の場合
+        ena_int( INTNO_UART1_TX );
+        ena_int( INTNO_UART1_RX );
+        *pPORTH_MUX &= ~(0x00F0);               // bit7:6, bit5:4 だけを0にする
+        *pPORTH_MUX |= (0x01<<6) | (0x01<<4);   //  bit7:6, bit5:4 を01にする
+        *pPORTH_FER |= 0x00C0;                  // PH7,6をUART1に割り振る
+    }
+
+    return(siopcb);
+}
+
+/*
+ *  シリアルI/Oポートのクローズ
+ */
+Inline void
+sio_cls_por(SIOPCB *siopcb)
+{
+
+    /*
+     *  デバイス依存のクローズ処理.
+     */
+    uart_cls_por(siopcb);
+}
+
+
+/*
+ *  SIOの割込みハンドラ
+ */
+#define sio0_rx_handler uart0_rx_isr
+#define sio0_tx_handler uart0_tx_isr
+#define sio1_rx_handler uart1_rx_isr
+#define sio1_tx_handler uart1_tx_isr
+
+/*
+ *  シリアルI/Oポートへの文字送信
+ */
+#define sio_snd_chr uart_snd_chr
+
+/*
+ *  シリアルI/Oポートからの文字受信
+ */
+#define sio_rcv_chr uart_rcv_chr
+
+/*
+ *  シリアルI/Oポートからのコールバックの許可
+ */
+#define sio_ena_cbr uart_ena_cbr
+
+/*
+ *  シリアルI/Oポートからのコールバックの禁止
+ */
+#define sio_dis_cbr uart_dis_cbr
+
+/*
+ *  シリアルI/Oポートからの送信可能コールバック
+ */
+#define sio_ierdy_snd   uart_ierdy_snd
+
+/*
+ *  シリアルI/Oポートからの受信通知コールバック
+ */
+#define sio_ierdy_rcv   uart_ierdy_rcv
+
+#endif /* _MACRO_ONLY */
+#endif /* _HW_SERIAL_H_ */
diff --git a/jsp/config/blackfin/_common_bf527/hw_timer.h b/jsp/config/blackfin/_common_bf527/hw_timer.h
new file mode 100644 (file)
index 0000000..a5f6f8f
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2009 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)縲鰀(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+/*
+ *  タイマドライバ(ADSP-BF527用)
+ *
+ */
+
+#ifndef _HW_TIMER_H_
+#define _HW_TIMER_H_
+
+#include <s_services.h>
+
+
+#ifndef _MACRO_ONLY
+
+#ifdef __GNUC__         // gcc
+#include "cdefBF527.h"
+#elif defined(__ECC__)  // visualdsp
+#include <cdefbf527.h>
+#else
+#error "Compiler is not supported"
+#endif
+
+//#include <ccblkfn.h>
+
+
+
+
+/**************************************************************
+ *  タイマの起動処理
+ *
+ *  タイマを初期化し,周期的なタイマ割込み要求を発生させる.
+ *
+ **************************************************************/
+Inline void
+hw_timer_initialize()
+{
+
+#ifdef USE_TIC_CORE
+    // Core timer
+    *pTCNTL = TMPWR;                    // power up timer;
+    *pTPERIOD = CORECLOCK/1000;         // CORE CLOCK is defined in sys_config.h
+    *pTCNTL = TMPWR | TMREN | TAUTORLD;
+#else
+    // GPT7(General-purpose timer7)
+
+    *pTIMER7_CONFIG = PERIOD_CNT | OUT_DIS |IRQ_ENA | PWM_OUT;  // PWM_OUT, Output Pad disable
+    *pTIMER7_PERIOD = SYSCLOCK/1000;    // SYS CLOCK is defined in sys_config.h
+    *pTIMER7_WIDTH = 1;                 // 0 < width < period
+    *pTIMER_ENABLE = TIMEN7;            // timer7 start
+
+    ena_int( INHNO_TIMER );             // enable Timer Interrupt
+
+#endif
+    asm("ssync;");
+
+}
+
+/**************************************************************
+ *  タイマ割込み要求のクリア
+ **************************************************************/
+Inline void
+hw_timer_int_clear()
+{
+#ifdef USE_TIC_CORE
+    // Core timer
+    /* TINTはW1Cではないので、TINTのTINTビットは0を書き込む */
+    *pTCNTL = TMPWR | TMREN | TAUTORLD;
+#else
+    // GPT7(General-purpose timer7)
+    *pTIMER_STATUS = TIMIL7;
+#endif
+    asm("ssync;");
+}
+
+/**************************************************************
+ *  タイマの停止処理
+ *
+ *  タイマの動作を停止させる.
+ **************************************************************/
+Inline void
+hw_timer_terminate()
+{
+    /*
+     *  タイマの動作を停止する.
+     */
+#ifdef USE_TIC_CORE
+    // Core timer
+    *pTCNTL = TMPWR | TAUTORLD;             // 停止
+    *pTCNTL = 0;                            // パワーダウンモード
+#else
+    // GPT2(General-purpose timer7)
+    *pTIMER_DISABLE = TIMDIS7;          // timer7 disable
+#endif
+    asm("ssync;");
+}
+
+
+#endif /* _MACRO_ONLY */
+#endif /* _HW_TIMER_H_ */
diff --git a/jsp/config/blackfin/_common_bf527/sys_rename.def b/jsp/config/blackfin/_common_bf527/sys_rename.def
new file mode 100644 (file)
index 0000000..6b882a6
--- /dev/null
@@ -0,0 +1,6 @@
+make_priority_mask
+device_dispatcher
+boot_for_gdb
+siopinib_table
+sprious_int_handler
+sprious_exp_handler
diff --git a/jsp/config/blackfin/_common_bf527/sys_rename.h b/jsp/config/blackfin/_common_bf527/sys_rename.h
new file mode 100644 (file)
index 0000000..5c47631
--- /dev/null
@@ -0,0 +1,27 @@
+/* This file is generated from sys_rename.def by genrename. */
+
+#ifndef _SYS_RENAME_H_
+#define _SYS_RENAME_H_
+
+#define make_priority_mask      _kernel_make_priority_mask
+#define device_dispatcher       _kernel_device_dispatcher
+#define boot_for_gdb            _kernel_boot_for_gdb
+#define siopinib_table          _kernel_siopinib_table
+#define sprious_int_handler _kernel_sprious_int_handler
+#define sprious_exp_handler _kernel_sprious_exp_handler
+
+
+
+
+
+#ifdef LABEL_ASM
+
+#define _make_priority_mask __kernel_make_priority_mask
+#define _device_dispatcher      __kernel_device_dispatcher
+#define _boot_for_gdb           __kernel_boot_for_gdb
+#define _siopinib_table     __kernel_siopinib_table
+#define _sprious_int_handler    __kernel_sprious_int_handler
+#define _sprious_exp_handler    __kernel_sprious_exp_handler
+
+#endif /* LABEL_ASM */
+#endif /* _SYS_RENAME_H_ */
diff --git a/jsp/config/blackfin/_common_bf527/sys_unrename.h b/jsp/config/blackfin/_common_bf527/sys_unrename.h
new file mode 100644 (file)
index 0000000..ee9dd28
--- /dev/null
@@ -0,0 +1,23 @@
+/* This file is generated from sys_rename.def by genrename. */
+
+#ifdef _SYS_UNRENAME_H_
+#undef _SYS_UNRENAME_H_
+
+#undef make_priority_mask
+#undef device_dispatcher
+#undef boot_for_gdb
+#undef siopinib_table
+#undef sprious_int_handler
+#undef sprious_exp_handler
+
+#ifdef LABEL_ASM
+
+#undef _make_priority_mask
+#undef _device_dispatcher
+#undef _boot_for_gdb
+#undef _siopinib_table
+#undef _sprious_int_handler
+#undef _sprious_exp_handler
+
+#endif /* LABEL_ASM */
+#endif /* _SYS_UNRENAME_H_ */
diff --git a/jsp/config/blackfin/evb_aud6/Makefile.config b/jsp/config/blackfin/evb_aud6/Makefile.config
new file mode 100644 (file)
index 0000000..e71e612
--- /dev/null
@@ -0,0 +1,25 @@
+#
+#      Makefile のターゲットシステム依存部(EVB-AUD6用)
+#
+
+#
+#  コンパイルオプション
+#
+INCLUDES := $(INCLUDES) -I$(SRCDIR)/config/$(CPU)/$(SYS)  -I$(SRCDIR)/config/$(CPU)/_common_bf527 \
+                       -I$(SRCDIR)/pdic/simple_sio
+COPTS := $(COPTS)
+LDFLAGS := $(LDFLAGS)
+
+#
+#  カーネルに関する定義
+#
+KERNEL_DIR := $(KERNEL_DIR):$(SRCDIR)/config/$(CPU)/$(SYS):$(SRCDIR)/config/$(CPU)/_common_bf527 \
+                               :$(SRCDIR)/pdic/simple_sio
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
+KERNEL_COBJS := $(KERNEL_COBJS) chip_config.o uart.o chip_debugboot.o chip_dump.o
+
+#
+#  リンカスクリプトの定義
+#
+LDSCRIPT = $(CPU)/_common_bf527/bf527elf.ld
+
diff --git a/jsp/config/blackfin/evb_aud6/jsp_ezkit_bf518.dpj b/jsp/config/blackfin/evb_aud6/jsp_ezkit_bf518.dpj
new file mode 100755 (executable)
index 0000000..07e9283
--- /dev/null
@@ -0,0 +1,617 @@
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<visualdsp-project schema="17" name="libkernel" file="jsp_ezkit_bf518.dpj" version="1">
+    <!-- Project build target -->
+    <target>
+        <processor revision="Automatic">ADSP-BF518</processor>
+        <extension>.dlb</extension>
+        <type>Library file</type>
+    </target>
+    <!-- Configurations -->
+    <configurations active="Release">
+        <configuration name="Debug">
+            <intermediate-dir>.\Debug</intermediate-dir>
+            <output-dir>.</output-dir>
+            <changed-property-page-flags>0</changed-property-page-flags>
+            <tools>
+                <tool type="Compiler">
+                    <option><![CDATA[|-Version>5.0|-O>0|-O1>0|-Ov>100|-ipa>0|-g>1|-no-annotate>0|-save-temps -path-output>0|-ED>0|-no-auto-attrs>0|-no-builtin>0|-no-extra-keywords>0|-enum-is-int>0|-no-fp-associative>0|-structs-do-not-overlap>0|-implicit-pointers>0|-eh >0|-rtti>1|-check-init-order>0|-ignore-std>1|-const-read-write>0|-const-strings>0|-no-multiline>1|-misra>0|-misra-strict>0|-misra-no-cross-module>0|-misra-no-runtime>0|-misra-testing>0|-misra-suppress-advisory>0|-I>.;..;..\_common_bf518;..\..\..\kernel;..\..\..\include;..\..\..\pdic\simple_sio;..\..\..\utils\blackfin-vdsp|-no-std-inc>0|-double-size-32>1|-double-size-any>0|-Ofp>0|-full-io>0|-guard-vol-loads>0|-decls-strong>1|-no-saturation>0|-cplbs>0|-sdram>0|-multicore>0|-pguide>0|NOSWITCH>0|-flags-compiler --diag_warning,implicit_func_decl>1|-warn-protos>1|-flags-compiler --diag_warning,call_not_inlined>0|-Wremarks>0|-w>0]]></option>
+                </tool>
+                <tool type="Assembler">
+                    <option><![CDATA[|-Version>4.5|-v>0|-g>1|-l>1|-save-temps>0|-sp>0|AdditionalOptions>-W1056|-i>.;..;..\_common_bf518;..\..\..\kernel;..\..\..\include;..\..\..\pdic\simple_sio;..\..\..\utils\blackfin-vdsp|-D>LABEL_ASM __ECC__]]></option>
+                </tool>
+                <tool type="Linker">
+                    <option><![CDATA[|-Version>5.0|-flags-link -t>1|-flags-link -S>0|-flags-link -s>0|-mem>0|-flags-link -warnonce>0|-map>1|-flags-link -xref>0|-flags-link -save-temps>0|-flags-link -ip>0|-flags-link -e>1|-flags-link -ev>0|-add-debug-libpaths>0|-flags-link -MD__ADI_LIBEH__>0|-multicore>0|NOSWITCH>1]]></option>
+                </tool>
+                <tool type="Archiver">
+                    <option><![CDATA[]]></option>
+                </tool>
+                <tool type="Loader">
+                    <option><![CDATA[|-Version>4.5|-b Flash>1|-f HEX>1|-Width 8>1|-p>0x0|DefaultStart>0|-v>0|-waits >15|-BaudRate 500k>1|-HoldTime >3|-pFlag >0|-zinit>0|-No2Kernel>0|-o2>0|-kb Flash>1|-kf HEX>1|-kWidth 8>1|DefaultKernelStart>1|UserKernel>1|-romsplitter>0|split HEX>1|-maskaddr>0]]></option>
+                </tool>
+                <tool type="VdkGen">
+                    <option><![CDATA[]]></option>
+                </tool>
+            </tools>
+        </configuration>
+        <configuration name="Release">
+            <intermediate-dir>.\Release</intermediate-dir>
+            <output-dir>.</output-dir>
+            <changed-property-page-flags>0</changed-property-page-flags>
+            <tools>
+                <tool type="Compiler">
+                    <option><![CDATA[|-Version>5.0|-O>1|-O1>1|-Ov>100|-ipa>1|-g>1|-no-annotate>0|-Oa>1|-save-temps -path-output>0|-ED>0|-no-auto-attrs>0|-no-builtin>0|-no-extra-keywords>0|-enum-is-int>0|-no-fp-associative>0|-structs-do-not-overlap>0|-implicit-pointers>0|-eh >0|-rtti>1|-check-init-order>0|-ignore-std>1|-const-read-write>0|-const-strings>0|-no-multiline>1|-misra>0|-misra-strict>0|-misra-no-cross-module>0|-misra-no-runtime>1|-misra-testing>1|-misra-suppress-advisory>0|-I>.;..;..\_common_bf518;..\..\..\kernel;..\..\..\include;..\..\..\pdic\simple_sio;..\..\..\utils\blackfin-vdsp|-no-std-inc>0|-double-size-32>1|-double-size-any>0|-Ofp>0|-guard-vol-loads>0|-decls-strong>1|-no-saturation>0|-cplbs>0|-sdram>0|-multicore>0|-stack-detect>0|-pguide>0|NOSWITCH>0|-flags-compiler --diag_warning,implicit_func_decl>1|-warn-protos>1|-flags-compiler --diag_warning,call_not_inlined>0|-Wremarks>0|-w>0]]></option>
+                </tool>
+                <tool type="Assembler">
+                    <option><![CDATA[|-Version>4.5|-v>0|-g>1|-l>0|-save-temps>0|-sp>0|AdditionalOptions>-flags-pp -tokenize-dot|-i>.;..;..\_common_bf518;..\..\..\kernel;..\..\..\include;..\..\..\pdic\simple_sio;..\..\..\utils\blackfin-vdsp|-D>LABEL_ASM __ECC__]]></option>
+                </tool>
+                <tool type="Linker">
+                    <option><![CDATA[|-Version>5.0|-flags-link -t>0|-flags-link -S>0|-flags-link -s>0|-mem>0|-flags-link -warnonce>0|-map>0|-flags-link -xref>0|-flags-link -save-temps>0|-flags-link -ip>0|-flags-link -e>0|-flags-link -ev>0|-add-debug-libpaths>0|-flags-link -MD__ADI_LIBEH__>0|-multicore>0|NOSWITCH>1]]></option>
+                </tool>
+                <tool type="Archiver">
+                    <option><![CDATA[]]></option>
+                </tool>
+                <tool type="Loader">
+                    <option><![CDATA[|-Version>4.5|-b Flash>1|-f HEX>1|-Width 8>1|-p>0x0|DefaultStart>0|-v>0|-waits >-1|-BaudRate 500k>1|-HoldTime >-1|-pFlag >0|-zinit>0|-No2Kernel>1|-o2>0|-kb Flash>1|-kf HEX>1|-kWidth 8>1|-kp>0x0|DefaultKernelStart>1|UserKernel>1|-romsplitter>0|split HEX>1|-maskaddr>29]]></option>
+                </tool>
+                <tool type="VdkGen">
+                    <option><![CDATA[]]></option>
+                </tool>
+            </tools>
+        </configuration>
+    </configurations>
+    <!-- Project folders -->
+    <folders>
+        <folder name="Header Files" ext=".h,.hpp,.hxx">
+        </folder>
+        <folder name="Linker Files" ext=".ldf,.dlb">
+        </folder>
+        <folder name="Source Files" ext=".c,.cpp,.cxx,.asm,.dsp,.s">
+            <folders>
+                <folder name="_common">
+                    <files>
+                        <file name="..\_common_bf518\chip_config.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.\Debug</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.\Release</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\_common_bf518\chip_config.h">
+                        </file>
+                        <file name="..\_common_bf518\chip_defs.h">
+                        </file>
+                        <file name="..\_common_bf518\hw_serial.h">
+                        </file>
+                        <file name="..\_common_bf518\hw_timer.h">
+                        </file>
+                        <file name="..\_common_bf518\sys_rename.h">
+                        </file>
+                        <file name="..\_common_bf518\sys_unrename.h">
+                        </file>
+                    </files>
+                </folder>
+                <folder name="_cpu">
+                    <files>
+                        <file name="..\api.h">
+                        </file>
+                        <file name="..\cpu_config.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\cpu_config.h">
+                        </file>
+                        <file name="..\cpu_context.h">
+                        </file>
+                        <file name="..\cpu_defs.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.\Debug</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.\Release</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\cpu_defs.h">
+                        </file>
+                        <file name="..\cpu_rename.h">
+                        </file>
+                        <file name="..\cpu_support.S">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.\Debug</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.\Release</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\cpu_unrename.h">
+                        </file>
+                        <file name="..\saverestore.h">
+                        </file>
+                        <file name="..\start.S">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.\Debug</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.\Release</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\tool_config.h">
+                        </file>
+                        <file name="..\tool_defs.h">
+                        </file>
+                    </files>
+                </folder>
+                <folder name="_sys">
+                    <files>
+                        <file name=".\sys_config.h">
+                        </file>
+                        <file name=".\sys_defs.h">
+                        </file>
+                    </files>
+                </folder>
+                <folder name="kernel">
+                    <files>
+                        <file name="..\..\..\kernel\banner.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\cyclic.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\dataqueue.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\eventflag.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\exception.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\interrupt.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\mailbox.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\mempfix.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\semaphore.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\startup.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\sys_manage.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\task.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\task_except.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\task_manage.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\task_sync.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\time_event.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\time_manage.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\wait.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                    </files>
+                </folder>
+                <folder name="library">
+                    <files>
+                        <file name="..\..\..\library\log_output.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\library\strerror.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\kernel\syslog.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\library\t_perror.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                        <file name="..\..\..\library\vasyslog.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                    </files>
+                </folder>
+                <folder name="pidc">
+                    <files>
+                        <file name="..\..\..\pdic\simple_sio\uart.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.\Debug</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.\Release</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                    </files>
+                </folder>
+                <folder name="systask">
+                    <files>
+                        <file name="..\..\..\systask\timer.c">
+                            <file-configurations>
+                                <file-configuration name="Debug">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Debug</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                                <file-configuration name="Release">
+                                    <excluded-flag value="no"/>
+                                    <build-with-flag value="project"/>
+                                    <intermediate-dir>.\Release</intermediate-dir>
+                                    <output-dir>.</output-dir>
+                                </file-configuration>
+                            </file-configurations>
+                        </file>
+                    </files>
+                </folder>
+                <folder name="usr">
+                </folder>
+            </folders>
+        </folder>
+    </folders>
+</visualdsp-project>
diff --git a/jsp/config/blackfin/evb_aud6/readme.txt b/jsp/config/blackfin/evb_aud6/readme.txt
new file mode 100644 (file)
index 0000000..9e559f0
--- /dev/null
@@ -0,0 +1,13 @@
+金子システム製 EVB-AUD6対応システム依存部。
+
+sys_config.hとsys_defs.hは、#include_nextを使って、それぞれblackfin/_common_bf527/sys_config.h
+とblackfin/_common_bf527/sys_defs.hを読み込んでいる。
+
+Makefile.configは、インクルード・パスおよびソースファイルへのパスとしてblackfin/_common_bf527も
+指定している。
+
+- Makefile.config : gnu環境のためのシステム依存部定義ファイル
+- readme.txt : このファイル
+- sys_config.h : システム依存部のうち、アプリケーションから見えない宣言
+- sys_defs.h : システム依存部のうち、アプリケーションから見える宣言
+
diff --git a/jsp/config/blackfin/evb_aud6/sys_config.h b/jsp/config/blackfin/evb_aud6/sys_config.h
new file mode 100644 (file)
index 0000000..e5d6b48
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2006 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+
+#ifndef _SYS_CONFIG_H_
+#define _SYS_CONFIG_H_
+
+
+/*
+ *  カーネルの内部識別名のリネーム
+ */
+#include <sys_rename.h>
+
+#include <chip_config.h>
+
+/*
+ *  ターゲットシステム依存モジュール(EVB-AUD6用)
+ *
+ *  このインクルードファイルは,t_config.h のみからインクルードされる.
+ *  他のファイルから直接インクルードしてはならない.
+*/
+
+/*
+ * ADSP-BF518に依存せず、ボードへの実装によって決まるパラメータを
+ * ここで定義する。
+ */
+
+
+/*
+ * どのようなクロック入力にも対応できるよう、以下でCSEL, SSEL, MSELの値
+ * とクロック入力周波数(Hz)を指定する。PLLのプログラムはsys_config.cの
+ * sys_initialize()関数で行われる。
+ *
+ * CSELVALは1,2,4,8の中から選ぶ。CLKINの単位はHz
+ */
+
+#define CSELVAL 1
+#define SSELVAL 5
+#define MSELVAL 16
+#define CLKIN 25000000
+
+/*
+ * TIC用タイマーの選択
+ * USE_TIC_COREをdefineすると、COREタイマーが使用される
+ * コメントアウトすると、GP_TIMER_2を使用する
+ *
+ * COREタイマーはwakeup信号を生成しないため、ディスパッチャ
+ * はidle命令を使ってCOREタイマーイベントを待つことができない。
+ * そのため、USE_TIC_COREを使うとディスパッチャはidle命令を
+ * 使わずに割り込み発生をポーリングで待つ。これは消費電力の
+ * 点で不利である。
+ *
+ */
+//#define USE_TIC_CORE
+
+/*
+ * ハードウェア・エラー割り込みの許可
+ * QUICK_HW_ERRORをdefineすると、ハードウェア・エラー・イベント
+ * が即座に受理される。defineしない場合には、割り込み待ち状態で
+ * ハードウェア・エラー・割り込みが発生した場合、次の割り込みまで
+ * 待たされることになる。
+ *
+ */
+//#define QUICK_HW_ERROR
+
+
+/*
+ * 実行時初期化関数の使用
+ *
+ * マクロ USE_RUNTIME_INIT を定義すると、start.asmのなかで _mi_initialize
+ * を呼び出す。この関数はノーブートモードで起動するときにのみ必要になるので
+ * 通常は USE_RUNTIME_INITを使う必要はない。
+ * 詳細はADIのEE239に詳しい。http://tinyurl.com/2hpbk (tinyURL)
+ *
+*/
+//#define USE_RUNTIME_INIT
+
+/*
+ * カーネル管理外割り込みの宣言
+ *
+ * マクロUNMANAGED_INTはカーネル管理外割り込みを宣言する。この
+ * マクロは16ビットのビットマップになっており、以下にあるパターン
+ * のうちひとつを使う。なお、どのようなパターンを選んでもNMIは管理外
+ * 割込みとして扱われる。
+ * UNMANAGED_INTを宣言しない場合、NMIだけが管理外割込みとして扱われる。
+ *
+*/
+//#define UNMANAGED_INT 0x0020          // IVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x0060          // IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x00E0          // IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x01E0          // IVG8 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x03E0          // IVG9 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x07E0          // IVG10 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x0FE0          // IVG11 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x1FE0          // IVG12 ... IVG7, IVTMRとIVHWがカーネル管理外.
+//#define UNMANAGED_INT 0x3FE0          // IVG13 ... IVG7, IVTMRとIVHWがカーネル管理外.
+
+/*
+ * C++関連資源を用意する
+ *
+ * マクロINIT_C_PLUS_PLUSを定義すると、C++言語用のテーブルを
+ * 初期化コードを実行する。また、C++言語用のテーブルを宣言する
+ *
+*/
+//#define INIT_C_PLUS_PLUS
+
+/*
+ *  起動メッセージのターゲットシステム名
+ */
+#define TARGET_NAME "EVB-AUD6"
+
+
+/*
+ *  シリアルポート数の定義
+ *  TNUM_SIOP_XXXは、UARTの種別ごとに宣言する。
+ *  TNUM_SIOP_UARTはBF518内蔵UARTのうち、PDICが使用するもの。
+ *  BF518はUARTをふたつもっているので、2,1か0を宣言する。
+ *  TNUM_PORTは、TNUM_SIOP_XXXのうち、GDICが使用するものの総和。
+ *  uart.cで使う。
+ */
+#define TNUM_PORT   1       /* GDICがサポートするシリアルポートの数 */
+#define TNUM_SIOP_UART  1   /* PIDCがサポートするシリアルポートの数 */
+
+/*
+ *  シリアルポート番号に関する定義
+ *  ログタスクがシリアルポートを使わない場合は無視していい。
+ */
+#define LOGTASK_PORTID  1   /* システムログに用いるシリアルポート番号 */
+
+/*  UART0のボーレート. */
+#define UART0_BAUD_RATE 57600       /* 57600 bps*/
+#define UART1_BAUD_RATE 57600       /* 57600 bps*/
+
+/*
+ * PLLの初期化の強制
+ * PLLは、PLL_CTLレジスタがデフォルト値で、かつ、SDRAMコントローラが
+ * ディセーブルのときに限り初期化を行うようになっている。これは、ブート
+ * ローダーなどの初期化ソフトがSDRAMを初期化したときにそれを保護するため
+ * である。一方でVisualDSP++のデバッガはSDRAMを自分で初期化するため、
+ * この機能とうまく折り合いがつかない場合がある。
+ * 上京に関わらず常に初期化したい時には FORCE_PLL_INITIALIZE マクロを
+ * 宣言する。
+ */
+// #deinfe FORCE_PLL_INITIALIZE
+
+#endif /* _SYS_CONFIG_H_ */
diff --git a/jsp/config/blackfin/evb_aud6/sys_defs.h b/jsp/config/blackfin/evb_aud6/sys_defs.h
new file mode 100644 (file)
index 0000000..1cb53a1
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ *  TOPPERS/JSP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Just Standard Profile Kernel
+ *
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *
+ *  TOPPERS/JSP for Blackfin
+ *
+ *  Copyright (C) 2004,2006,2006 by Takemasa Nakamura
+ *  Copyright (C) 2004 by Ujinosuke
+ *
+ *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
+ *  によって公表されている GNU General Public License の Version 2 に記
+ *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
+ *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
+ *  利用と呼ぶ)することを無償で許諾する.
+ *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
+ *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
+ *      スコード中に含まれていること.
+ *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
+ *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
+ *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
+ *      の無保証規定を掲載すること.
+ *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
+ *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
+ *      と.
+ *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
+ *        作権表示,この利用条件および下記の無保証規定を掲載すること.
+ *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
+ *        報告すること.
+ *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+ *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
+ *
+ *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
+ *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
+ *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
+ *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
+ *
+ *
+ */
+
+
+/*
+ *  ターゲットシステムに依存する定義(EVB-AUD6用)
+ *
+ *  このインクルードファイルは,kernel.h と sil.h でインクルードされる.
+ *  他のファイルから直接インクルードすることはない.このファイルをイン
+ *  クルードする前に,t_stddef.h と itron.h がインクルードされるので,
+ *  それらに依存してもよい.
+ */
+
+#ifndef _SYS_DEFS_H_
+#define _SYS_DEFS_H_
+
+#include <chip_defs.h>
+
+ /* システム略称 */
+#define EVB_AUD6
+
+
+/*
+ *  破壊性読み出しレジスタの判別式
+ *  与えられたアドレス iop が破壊性読み出しレジスタの
+ *  場合には真を返す。
+ *
+ *  EVB-AUD6の内蔵ペリフェラルについて考慮する必要はない
+ *  宣言しない場合は、デフォルトで外部ペリフェラルはすべて
+ *  破壊性読み出しとして扱われる
+ */
+// #define DESTRUCTIVE_READ( iop ) (iop<(VP)0xF0000000)
+
+
+#endif /* _SYS_DEFS_H_ */