Download 1 The Kernel
Transcript
defined this macro in variant.inc – it initializes the interrupt controller there (interrupt control mode 2). In macro hal_memc_init we initialise MCU2357 bus- and memory controller and general purpose I/O. We can keep a lot of this macro but we have to change the registers and their values in init_regs. For MCU2357 board the register initialisation values look like this (we use the symbolic register names von module register include files of H8S/2357 variant): ... init_regs: INIT_REGS_DATA(CYGARC_ABWCR, 0xFF) INIT_REGS_DATA(CYGARC_ASTCR, 0xFF) INIT_REGS_DATA(CYGARC_BCRH, 0x00) INIT_REGS_DATA(CYGARC_BCRL, 0x1C) INIT_REGS_DATA(CYGARC_WCRH, 0xFF) INIT_REGS_DATA(CYGARC_WCRL, 0xFF) INIT_REGS_DATA(CYGARC_MCR, 0x00) INIT_REGS_DATA(CYGARC_DRAMCR, 0x00) INIT_REGS_DATA(CYGARC_RTCOR, 0x00) INIT_REGS_DATA(CYGARC_P6DDR, 0x00) INIT_REGS_DATA(CYGARC_PADDR, 0x00) INIT_REGS_DATA(CYGARC_PBDDR, 0xFF) INIT_REGS_DATA(CYGARC_PCDDR, 0xFF) INIT_REGS_DATA(CYGARC_PFDDR, 0x80) INIT_REGS_DATA(CYGARC_MSTPCRL,0x00) .word 0 ... 5.5.4 Platform source files 5.5.4.1 plf_misc.c This file contains miscellaneous platform specific functions provided by HAL. The first function we need to modify a little bit is hal_clock_initialize. We use TPU channel 5 like EDOSK-2674 board but we need a clock divider of 4 (EDOSK-2674 uses a clock divider of 16) in order to get a 100 Hz frequency for eCos real-time clock. We have to change only one single line within this function: ... // initialize 16 bit timer - first we select timer counter clock and // counter clearing source TGR // Clock prescaler is 4 (clock/4) and TCNT is clear at compare match A // HAL_WRITE_UINT8(CYGARC_TCR5, CYGARC_TCR_CLR_CMA | CYGARC_TCR_TPSC_4); ... Now we only need to remove the function cyg_plf_memory_segment, because the MCU2357 board contains only one memory segment, and we are finished with this file. Porting Guide 51