diff -Ncwr utkernel_source.prev/etc/sysdepend/app_h8s2212/makerules.sysdepend utkernel_source.curr/etc/sysdepend/app_h8s2212/makerules.sysdepend *** utkernel_source.prev/etc/sysdepend/app_h8s2212/makerules.sysdepend 2007-09-29 15:03:23.000000000 +0900 --- utkernel_source.curr/etc/sysdepend/app_h8s2212/makerules.sysdepend 2007-10-08 10:14:55.000000000 +0900 *************** *** 58,71 **** ASFLAGS += LDFLAGS += ! ### TRAP ### ! ifeq ($(trap), on) CFLAGS += -DUSE_TRAP ASFLAGS += -DUSE_TRAP - else - CFLAGS += - ASFLAGS += - endif ### C ### CC := $(GNUh8300)/bin/gcc --- 58,66 ---- ASFLAGS += LDFLAGS += ! ### TRAP (always on) ### CFLAGS += -DUSE_TRAP ASFLAGS += -DUSE_TRAP ### C ### CC := $(GNUh8300)/bin/gcc diff -Ncwr utkernel_source.prev/include/tk/sysdepend/app_h8s2212/sysdef_depend.h utkernel_source.curr/include/tk/sysdepend/app_h8s2212/sysdef_depend.h *** utkernel_source.prev/include/tk/sysdepend/app_h8s2212/sysdef_depend.h 2007-03-12 20:25:53.000000000 +0900 --- utkernel_source.curr/include/tk/sysdepend/app_h8s2212/sysdef_depend.h 2007-10-11 18:20:24.000000000 +0900 *************** *** 13,21 **** */ /* ! * @(#)sysdef_depend.h (tk/H8S2212) * ! * Definition about H8S * * Included also from assembler program. */ --- 13,21 ---- */ /* ! * @(#)sysdef_depend.h (tk/h83664) * ! * Definition about H8/3664 * * Included also from assembler program. */ *************** *** 42,70 **** /*----------------------------------------------------------*/ - #define MSTP_CRA (0x00fffde8UL) - #define MSTP_CRB (0x00fffde8UL + 1UL) - #define EXMDLSTP (0x00ffff40UL) - - #define PB_DDR (0x00fffe3aUL) - #define PB_PCR (0x00fffe41UL) - #define PB_DR (0x00ffff0aUL) - - #define SCI2_SMR (0x00ffff88UL) - #define SCI2_BRR (0x00ffff89UL) - #define SCI2_SCR (0x00ffff8aUL) - #define SCI2_TDR (0x00ffff8bUL) - #define SCI2_SSR (0x00ffff8cUL) - #define SCI2_RDR (0x00ffff8dUL) - #define SCI2_SCMR (0x00ffff8eUL) - - #define TPU0_TCR (0x00ffff10UL) - #define TPU0_TIER (0x00ffff14UL) - #define TPU0_TSR (0x00ffff15UL) - #define TPU0_TCNT (0x00ffff16UL) - #define TPU0_TGRA (0x00ffff18UL) ! #define TPU_TSTR (0x00fffeb0UL) #endif /* __TK_SYSDEF_DEPEND_H__ */ --- 42,62 ---- /*----------------------------------------------------------*/ ! #define MSTCR1 ((_UB *)0xfff9) + #define TMA ((_UB *)0xffa6) + #define TCA ((_UB *)0xffa7) + + #define IENR1 ((_UB *)0xfff4) + #define IRR1 ((_UB *)0xfff6) + + #define MSTTA (1 << 0) + + #define TMA_START 0x7a // 32.768kHz, 0.25s + #define TMA_STOP (TMA_START | 0x04) + + #define IENTA (1 << 6) + #define IRRTA (1 << 6) #endif /* __TK_SYSDEF_DEPEND_H__ */ diff -Ncwr utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_conf.h utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_conf.h *** utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_conf.h 2007-03-12 20:25:56.000000000 +0900 --- utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_conf.h 2007-10-11 18:22:29.000000000 +0900 *************** *** 13,19 **** */ /* ! * tkdev_conf.h (H8S2212) * Target System Configuration */ --- 13,19 ---- */ /* ! * tkdev_conf.h (H8/3664) * Target System Configuration */ *************** *** 21,58 **** #define _TKDEV_CONF_ /* Also included from assembler source */ - /* System clock*/ - #define SYSTEM_CLOCK (UW)(4000000UL) /* 4MHz */ - - /* Timer0 counter */ - #define TM0_COUNT (UH)(SYSTEM_CLOCK/16/1000) - - /* TCR */ - #define TCNT_NOCLR (UB)(0x00) - #define TCNT_TGRA (UB)(0x20) - #define TCNT_TGRB (UB)(0x40) - #define TCNT_MAX (UH)(0xFFFF) - - #define CLK_EDGE_H (UB)(0x00) - #define CLK_EDGE_L (UB)(0x08) - #define CLK_EDGE_HL (UB)(0x10) - #define TM0_CKS_64 (UB)(0x03) - #define TM0_CKS_16 (UB)(0x02) - #define TM0_CKS_4 (UB)(0x01) - #define TM0_CKS_1 (UB)(0x00) - - #define TCR_CCLR_MASK (UB)~(0x60U) - #define TM0_TPSC_MSK (UB)~(0x07U) - - /* TIER */ - #define TMR0_TCIEV (UB)(0x10) - #define TMR0_TGIEA (UB)(0x01) - - /* TSR */ - #define TMR0_TCFD (UB)(0x80) - #define TMR0_TCFV (UB)(0x10) - #define TMR0_TGFA (UB)(0x01) - #define TMP_STACK_SZ (128) #endif /* _TKDEV_CONF_ */ --- 21,26 ---- diff -Ncwr utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_init.c utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_init.c *** utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_init.c 2007-03-12 20:25:56.000000000 +0900 --- utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_init.c 2007-10-11 18:26:34.000000000 +0900 *************** *** 13,19 **** */ /* ! * tkdev_init.c (H8S2212) * micro T-Kernel Device-Dependent Initialization/Finalization */ --- 13,19 ---- */ /* ! * tkdev_init.c (H8/3664) * micro T-Kernel Device-Dependent Initialization/Finalization */ *************** *** 22,43 **** #include #include - EXPORT UW knl_TimerClkDiv; /* Dividing rate of timer clock */ - - /* * Target system-dependent initialization */ EXPORT ER knl_tkdev_initialize( void ) { ! /* port settings */ ! *((UB*)PB_PCR) = 0x00U; ! *((UB*)PB_DR) = 0x85U; ! *((UB*)PB_DDR) = 0xFBU; ! ! *((UB*)MSTP_CRA) |= (1U << 6); /* DMA controller */ ! *((UB*)EXMDLSTP) |= (1U << 1); /* RTC */ ! *((UB*)EXMDLSTP) |= (1U << 0); /* USB */ return E_OK; } --- 22,35 ---- #include #include /* * Target system-dependent initialization */ EXPORT ER knl_tkdev_initialize( void ) { ! /* system clock must be default setting, same as CPU clock */ ! ! // do nothing now, but do something what you need... return E_OK; } diff -Ncwr utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_timer.h utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_timer.h *** utkernel_source.prev/kernel/sysdepend/device/app_h8s2212/tkdev_timer.h 2007-03-12 20:25:57.000000000 +0900 --- utkernel_source.curr/kernel/sysdepend/device/app_h8s2212/tkdev_timer.h 2007-10-11 18:33:37.000000000 +0900 *************** *** 13,19 **** */ /* ! * tkdev_timer.h (H8S2212) * Hardware-Dependent Timer Processing */ --- 13,19 ---- */ /* ! * tkdev_timer.h (H8/3664) * Hardware-Dependent Timer Processing */ *************** *** 23,35 **** #include #include #include - #include "tkdev_conf.h" /* * Settable interval range (millisecond) */ ! #define MIN_TIMER_PERIOD 1 ! #define MAX_TIMER_PERIOD 50 /* --- 23,34 ---- #include #include #include /* * Settable interval range (millisecond) */ ! #define MIN_TIMER_PERIOD 31 ! #define MAX_TIMER_PERIOD 1000 /* *************** *** 37,57 **** */ Inline void knl_init_hw_timer( void ) { ! /* module power on */ ! *((UB*)MSTP_CRA) &= ~(1U << 5); ! ! *((UB*)TPU0_TIER) &= ~(1U << 0); ! ! /* Stop timer */ ! *((UB*)TPU_TSTR) &= ~(1U << 0); ! *((UB*)TPU0_TSR) &= ~(TMR0_TGFA); ! /* Set timer mode */ ! *((UB*)TPU0_TCR) = ( TCNT_TGRA | CLK_EDGE_L | TM0_CKS_16 ); ! /* Set counter */ ! *((INT*)TPU0_TGRA) = CFN_TIMER_PERIOD * (SYSTEM_CLOCK / 1000 / 16) - 1; } /* --- 36,52 ---- */ Inline void knl_init_hw_timer( void ) { ! /* disable timer interrupt */ ! *IENR1 &= ~IENTA; ! /* module power on */ ! *MSTCR1 &= ~MSTTA; ! /* reset timer */ ! *TMA = TMA_STOP; ! /* clear interrupt */ ! *IRR1 &= ~IRRTA; } /* *************** *** 63,73 **** /* Set timer */ knl_init_hw_timer(); ! /* Timer interrupt enable */ ! *((UB*)TPU0_TIER) |= (1U << 0); ! /* Start timer count */ ! *((UB*)TPU_TSTR) |= (1U << 0); } /* --- 58,68 ---- /* Set timer */ knl_init_hw_timer(); ! /* start timer */ ! *TMA = TMA_START; ! /* enable interrupt */ ! *IENR1 |= IENTA; } /* *************** *** 83,89 **** */ Inline void knl_clear_hw_timer_interrupt( void ) { ! *((UB*)TPU0_TSR) &= ~(TMR0_TGFA); } Inline void knl_end_of_hw_timer_interrupt( void ) { --- 78,84 ---- */ Inline void knl_clear_hw_timer_interrupt( void ) { ! *IRR1 &= ~IRRTA; } Inline void knl_end_of_hw_timer_interrupt( void ) { *************** *** 97,111 **** */ Inline void knl_terminate_hw_timer( void ) { ! *((UB*)TPU0_TIER) &= ~(TMR0_TGIEA); ! *((UB*)TPU0_TSR) &= ~(TMR0_TGFA); ! /* Stop timer */ ! *((UB*)TPU_TSTR) &= ~(1U << 0); /* module power off */ ! *((UB*)MSTP_CRA) |= (1U << 5); } /* --- 92,108 ---- */ Inline void knl_terminate_hw_timer( void ) { ! /* disable timer interrupt */ ! *IENR1 &= ~IENTA; ! /* reset timer */ ! *TMA = TMA_STOP; ! /* clear interrupt */ ! *IRR1 &= ~IRRTA; /* module power off */ ! *MSTCR1 |= MSTTA; } /* *************** *** 118,144 **** */ Inline UW knl_get_hw_timer_nsec( void ) { ! ! UW ofs, max; ! UH unf; ! ! UINT imask; ! ! DI(imask); ! ! max = *((INT*)TPU0_TGRA) + 1; ! do { ! unf = *((UB*)TPU0_TSR) & TMR0_TGFA; ! ofs = max - *((INT*)TPU0_TCNT); ! } while ( unf != (*((UB*)TPU0_TSR) & TMR0_TGFA) ); ! if ( unf != 0 ) { ! ofs += max; ! } ! ! EI(imask); ! ! return ofs * (1000 * 16) / SYSTEM_CLOCK; ! } #endif /* _TKDEV_TIMER_ */ --- 115,122 ---- */ Inline UW knl_get_hw_timer_nsec( void ) { ! // XXX not supported ! return 0; } #endif /* _TKDEV_TIMER_ */