OSDN Git Service

debug microblaze
authorryuz <ryuz@users.sourceforge.jp>
Wed, 22 Jun 2011 14:11:50 +0000 (23:11 +0900)
committerryuz <ryuz@users.sourceforge.jp>
Wed, 22 Jun 2011 14:11:50 +0000 (23:11 +0900)
aplfw/build/mb/mb_v8_axi/gcc/Makefile
aplfw/sample/mb/mb_v8_axi/boot.c
aplfw/sample/mb/mb_v8_axi/gcc/crt0.S
aplfw/sample/mb/mb_v8_axi/gcc/link.lds
aplfw/sample/mb/mb_v8_axi/gcc/vectors.S
aplfw/sample/mb/mb_v8_axi/uart.c [deleted file]
aplfw/sample/mb/mb_v8_axi/uart.h [deleted file]
kernel/source/arch/proc/mb/mb_v8/gcc/kint_hdr.S
sample/mb/mb_v8_axi/gcc/link.lds
sample/mb/mb_v8_axi/gcc/vectors.S

index 8122d81..e1a2c9a 100644 (file)
@@ -65,8 +65,7 @@ CSRCS +=
 
 
 # %jp{リンク制御対象制御}
-LINK_JELLYUART = Yes
-LINK_JELLYI2C  = Yes
+LINK_XILINXUARTDRV = Yes
 
 
 # %jp{共通ソース}
index 468aca2..00830e9 100644 (file)
@@ -19,7 +19,7 @@
 #include "system/file/console.h"
 #include "system/process/process.h"
 #include "system/command/command.h"
-#include "driver/serial/jelly/jellyuartdrv.h"
+#include "driver/serial/xilinxuartdrv/xilinxuartdrv.h"
 #include "driver/console/vt100/vt100drv.h"
 #include "application//syscmd/shell/shell.h"
 #include "application//syscmd/commandlist/commandlist.h"
 #include "ostimer.h"
 
 
-#if 0
-
-long   g_SystemHeap[128 * 1024 / sizeof(long)];
+long   g_SystemHeap[16 * 1024 / sizeof(long)];
 #define SYSTEM_HEAP_ADDR       ((void *)g_SystemHeap)
 #define SYSTEM_HEAP_SIZE       sizeof(g_SystemHeap)
 
-#else
-
-#define SYSTEM_HEAP_ADDR       ((void *)0x00200000)
-#define SYSTEM_HEAP_SIZE       0x00100000
-
-#endif
-
-
-extern SYSTIM_CPUTIME          SysTim_TimeCounter;             /* デフォルトのタイマカウンタ */
 
 
 
@@ -96,7 +85,7 @@ int Boot_Process(VPARAM Param)
        OsTimer_Initialize();
        
        /* Jelly UART デバドラ生成 (/dev/com0 に登録) */
-       hDriver = JellyUartDrv_Create((void *)0xf2000000, 1, 2, 64);
+       hDriver = XilinxUartDrv_Create((void *)0x40600000, 1, 64);
        File_AddDevice("com0", hDriver);
        
        /* シリアルを開く */
index e97caf3..24b52f8 100644 (file)
 ************************************************/
                                .align          2
 _reset_handler:        
+                               /* キャッシュON */
+                               addik   r3, r0, 0x000000a0
+                               mts     rmsr, r3
+                               
+                               /* BIPクリア(念の為) */
+                               addik   r3, r0, bip_clear
+                               rtbd    r3, 0
+bip_clear:             
+                               
                                /* スタック設定 */
                                lwi             r1, r0, _kernel_int_isp
                                
index 1351bc3..4132ee7 100644 (file)
@@ -2,20 +2,29 @@ ENTRY(_reset_handler)
 
 MEMORY
 {
-       vector : o = 0x00000000, l = 0x00000050
-       ro     : o = 0x00000100, l = 0x000fff00
-       rw     : o = 0x00100000, l = 0x00100000
+       ro     : o = 0x00000100, l = 0x0001ff00
+       rw     : o = 0x00020000, l = 0x00020000
 }
 
 SECTIONS
 {
-       .vector :
+       .vectors.reset 0x00000000 :
        {
-               ___vector = . ; 
-               */vectors.o(.text)
-               FILL(0xff)
-               ___vector_end = . ; 
-       } > vector
+               *(.vectors.reset)
+       }
+       .vectors.sw_exception 0x00000008 :
+       {
+               *(.vectors.sw_exception)
+       }
+       .vectors.interrupt 0x00000010 :
+       {
+               *(.vectors.interrupt)
+       }
+       .vectors.hw_exception 0x00000020 :
+       {
+               *(.vectors.hw_exception)
+       }
+       
        .text :
        {
                 ___text = . ; 
index a370c2e..bc6bdb9 100644 (file)
                                .global _kernel_hwe_hdr
 
 
-                               .text
                                .align  2
 
 /* --------------------------------------- */
 /*            ベクタ定義                   */
 /* --------------------------------------- */
-                               bri             _reset_handler
-                               nop
+
+                               .section        .vectors.reset, "ax"
+                               brai    _reset_handler
+
+                               .section        .vectors.sw_exception, "ax"
                                bri             _kernel_exc_hdr
-                               nop
+
+                               .section        .vectors.interrupt, "ax"
                                bri             _kernel_int_hdr
-                               nop
-                               bri             _kernel_brk_hdr
-                               nop
+
+                               .section        .vectors.hw_exception, "ax"
                                bri             _kernel_hwe_hdr
 
 
diff --git a/aplfw/sample/mb/mb_v8_axi/uart.c b/aplfw/sample/mb/mb_v8_axi/uart.c
deleted file mode 100644 (file)
index a6d534a..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/** 
- *  Sample program for Hyper Operating System V4 Advance
- *
- * @file  uart.c
- * @brief %jp{UARTへの出力}%en{UART device driver}
- *
- * Copyright (C) 1998-2006 by Project HOS
- * http://sourceforge.jp/projects/hos/
- */
-
-
-#include "kernel.h"
-
-
-#define REG_UART_BASE          0x40600000
-#define REG_UART_RX                    ((volatile unsigned long *)(REG_UART_BASE + 0x0))
-#define REG_UART_TX                    ((volatile unsigned long *)(REG_UART_BASE + 0x4))
-#define REG_UART_STAT          ((volatile unsigned long *)(REG_UART_BASE + 0x8))
-#define REG_UART_CTRL          ((volatile unsigned long *)(REG_UART_BASE + 0xc))
-
-
-/* %jp{UARTの初期化} */
-void Uart_Initialize(void)
-{
-}
-
-
-/* %jp{1文字入力} */
-char Uart_GetChar(void)
-{
-       return 0;
-}
-
-
-/* %jp{1文字出力} */
-void Uart_PutChar(int c)
-{
-       while ( *REG_UART_STAT & 0x08 )
-               ;
-       
-       *REG_UART_TX = c;
-}
-
-
-/* %jp{文字列出力} */
-void Uart_PutString(const char *text)
-{
-       while ( *text != '\0' )
-       {
-               if ( *text == '\n' )
-               {
-                       Uart_PutChar('\r');
-                       Uart_PutChar('\n');
-               }
-               else
-               {
-                       Uart_PutChar(*text);
-               }
-               
-               text++;
-       }
-}
-
-
-char Uart_hex2asc(int a)
-{
-       if ( a < 10 )
-       {
-               return '0' + a;
-       }
-       return 'a' + a - 10;
-}
-
-
-void Uart_PutHexByte(char c)
-{
-       Uart_PutChar(Uart_hex2asc((c >> 4) & 0xf));
-       Uart_PutChar(Uart_hex2asc((c >> 0) & 0xf));
-}
-
-
-void Uart_PutHexHalfWord(unsigned short h)
-{
-       Uart_PutHexByte((h >> 8) & 0xff);
-       Uart_PutHexByte((h >> 0) & 0xff);
-}
-
-void Uart_PutHexWord(unsigned long w)
-{
-       Uart_PutHexHalfWord((w >> 16) & 0xffff);
-       Uart_PutHexHalfWord((w >>  0) & 0xffff);
-}
-
-
-
-/* end of file */
diff --git a/aplfw/sample/mb/mb_v8_axi/uart.h b/aplfw/sample/mb/mb_v8_axi/uart.h
deleted file mode 100644 (file)
index 84b56f9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/** 
- *  Sample program for Hyper Operating System V4 Advance
- *
- * @file  uart.h
- * @brief %jp{UARTへの出力}%en{UART device driver}
- *
- * Copyright (C) 1998-2006 by Project HOS
- * http://sourceforge.jp/projects/hos/
- */
-
-
-#ifndef __ostimer_h__
-#define __ostimer_h__
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void Uart_Initialize(void);                                    /* %jp{UART の初期化} */
-void Uart_PutChar(int c);                                      /* %jp{1文字出力} */
-void Uart_PutString(const char *text);         /* %jp{文字列出力} */
-
-void Uart_PutHexByte(char c);
-void Uart_PutHexHalfWord(unsigned short h);
-void Uart_PutHexWord(unsigned long w);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __ostimer_h__ */
-
-
-/* end of file */
index 16c9a26..8abff91 100644 (file)
@@ -16,8 +16,6 @@
 
 
 #define ICTXCB_ISP             0
-#define ICTXCB_INTCNT  4
-#define ICTXCB_IMSK            6
 
 
 /************************************************
@@ -26,7 +24,7 @@
                                .align  2
 _kernel_int_hdr:
                /* ---- レジスタ保存 */
-                               addik   r1, r1, -76
+                               addik   r1, r1, -80
                                swi             r14, r1, 0
                                swi             r3, r1, 28
                                swi             r4, r1, 32
@@ -39,8 +37,9 @@ _kernel_int_hdr:
                                swi             r11, r1, 60
                                swi             r12, r1, 64
                                swi             r15, r1, 68
+                               swi             r18, r1, 72
                                mfs             r3, rmsr
-                               swi             r3, r1, 72
+                               swi             r3, r1, 76
                                
                /* ---- スタック入れ替え */
                                addik   r3, r1, 0
@@ -62,7 +61,7 @@ _kernel_int_hdr:
                                lwi             r1, r1, 28                                      /* スタックの復帰 */
                                
                /* ---- レジスタ復帰 */
-                               lwi             r3, r1, 72
+                               lwi             r3, r1, 76
                                mts             rmsr, r3
                                lwi             r14, r1, 0
                                lwi             r3, r1, 28
@@ -76,8 +75,9 @@ _kernel_int_hdr:
                                lwi             r11, r1, 60
                                lwi             r12, r1, 64
                                lwi             r15, r1, 68
+                               lwi             r18, r1, 72
                                rtid    r14, 0
-                               addik   r1, r1, 76
+                               addik   r1, r1, 80
 
 
 /* end of file */
index edd126e..d26966b 100644 (file)
@@ -2,20 +2,29 @@ ENTRY(_reset_handler)
 
 MEMORY
 {
-       vector : o = 0x00000000, l = 0x00000050
        ro     : o = 0x00000100, l = 0x00007f00
        rw     : o = 0x00008000, l = 0x00008000
 }
 
 SECTIONS
 {
-       .vector :
+       .vectors.reset 0x00000000 :
        {
-               ___vector = . ; 
-               */vectors.o(.text)
-               FILL(0xff)
-               ___vector_end = . ; 
-       } > vector
+               *(.vectors.reset)
+       }
+       .vectors.sw_exception 0x00000008 :
+       {
+               *(.vectors.sw_exception)
+       }
+       .vectors.interrupt 0x00000010 :
+       {
+               *(.vectors.interrupt)
+       }
+       .vectors.hw_exception 0x00000020 :
+       {
+               *(.vectors.hw_exception)
+       }
+       
        .text :
        {
                 ___text = . ; 
index a370c2e..bc6bdb9 100644 (file)
                                .global _kernel_hwe_hdr
 
 
-                               .text
                                .align  2
 
 /* --------------------------------------- */
 /*            ベクタ定義                   */
 /* --------------------------------------- */
-                               bri             _reset_handler
-                               nop
+
+                               .section        .vectors.reset, "ax"
+                               brai    _reset_handler
+
+                               .section        .vectors.sw_exception, "ax"
                                bri             _kernel_exc_hdr
-                               nop
+
+                               .section        .vectors.interrupt, "ax"
                                bri             _kernel_int_hdr
-                               nop
-                               bri             _kernel_brk_hdr
-                               nop
+
+                               .section        .vectors.hw_exception, "ax"
                                bri             _kernel_hwe_hdr