OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/rtos/ecos-2.0/packages/hal/h8300/aki3068net
    from Rev 27 to Rev 174
    Reverse comparison

Rev 27 → Rev 174

/v2_0/cdl/hal_h8300_h8300h_aki3068net.cdl
0,0 → 1,245
# ====================================================================
#
# hal_h8300_h8300h_sim.cdl
#
# AKI3068NET board HAL package configuration data
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): jskov
# Original data: bartv
# Contributors:
# Date: 1999-11-02
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_HAL_H8300_H8300H_AKI3068NET {
display "AKI3068NET"
parent CYGPKG_HAL_H8300
requires CYGPKG_HAL_H8300_H8300H
implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
implements CYGINT_HAL_DEBUG_GDB_STUBS
implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
define_header hal_h8300_h8300h_aki3068net.h
include_dir cyg/hal
description "
The aki HAL package provides the support needed to run
eCos on a Akizuki H8/3068 Network micom board."
 
compile hal_diag.c plf_misc.c delay_us.S
 
define_proc {
puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_h8300_h8300h.h>"
puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_h8300_h8300h_aki3068net.h>"
 
puts $::cdl_header "#define CYG_HAL_H8300"
puts $::cdl_header "#define CYGNUM_HAL_H8300_SCI_PORTS 1"
puts $::cdl_header "#define CYGHWR_HAL_VECTOR_TABLE 0xfffe20"
puts $::cdl_header "#define HAL_PLATFORM_CPU \"H8/300H\""
puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Akizuki H8/3068 Network micom\""
puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
}
 
cdl_component CYG_HAL_STARTUP {
display "Startup type"
flavor data
legal_values {"ROM" "RAM"}
default_value {"ROM"}
no_define
define -file system.h CYG_HAL_STARTUP
description "
When targetting the AKI3068NET board it is possible to
build the system for either RAM bootstrap or ROM bootstrap.
RAM bootstrap generally requires that the board
is equipped with ROMs containing a suitable ROM monitor or
equivalent software that allows GDB to download the eCos
application and extend Memory on to the board.
The ROM bootstrap typically
requires that the eCos application be blown into EPROMs or
equivalent technology."
}
 
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
display "Number of communication channels on the board"
flavor data
calculated 1
}
 
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
display "Debug serial port"
flavor data
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
default_value 0
description "
The AKI3068NET board has only one serial port. This option
chooses which port will be used to connect to a host
running GDB."
}
 
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
display "Diagnostic serial port"
flavor data
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
default_value 0
description "
The CQ/7708 board has only one serial port. This option
chooses which port will be used for diagnostic output."
}
 
# Real-time clock/counter specifics
cdl_component CYGNUM_HAL_RTC_CONSTANTS {
display "Real-time clock constants."
flavor none
cdl_option CYGNUM_HAL_RTC_NUMERATOR {
display "Real-time clock numerator"
flavor data
calculated 1000000000
}
cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
display "Real-time clock denominator"
flavor data
calculated 100
}
cdl_option CYGNUM_HAL_H8300_RTC_PRESCALE {
display "Real-time clock base prescale"
flavor data
calculated 8192
}
# Isn't a nice way to handle freq requirement!
cdl_option CYGNUM_HAL_RTC_PERIOD {
display "Real-time clock period"
flavor data
calculated 10
}
}
 
cdl_option CYGHWR_HAL_H8300_CPG_INPUT {
display "OSC/Clock Freqency"
flavor data
default_value 20000000
}
 
cdl_option CYGHWR_HAL_AKI3068NET_EXTRAM {
display "Extend DRAM Using"
flavor bool
default_value 1
}
 
cdl_component CYGBLD_GLOBAL_OPTIONS {
display "Global build options"
flavor none
parent CYGPKG_NONE
description "
Global build options including control over
compiler flags, linker flags and choice of toolchain."
 
 
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
display "Global command prefix"
flavor data
no_define
default_value { "h8300-elf" }
description "
This option specifies the command prefix used when
invoking the build tools."
}
 
cdl_option CYGBLD_GLOBAL_CFLAGS {
display "Global compiler flags"
flavor data
no_define
default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -mh -mint32 -fsigned-char -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
description "
This option controls the global compiler flags which
are used to compile all packages by
default. Individual packages may define
options which override these global flags."
}
 
cdl_option CYGBLD_GLOBAL_LDFLAGS {
display "Global linker flags"
flavor data
no_define
default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static -mh" }
description "
This option controls the global linker flags. Individual
packages may define options which override these global flags."
}
}
 
cdl_component CYGHWR_MEMORY_LAYOUT {
display "Memory layout"
flavor data
no_define
calculated { CYG_HAL_STARTUP == "RAM" ? "h8300_h8300h_aki3068net_ram" : \
"h8300_h8300h_aki3068net_rom" }
 
cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
display "Memory layout linker script fragment"
flavor data
no_define
define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi>" : \
"<pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi>" }
}
 
cdl_option CYGHWR_MEMORY_LAYOUT_H {
display "Memory layout header file"
flavor data
no_define
define -file system.h CYGHWR_MEMORY_LAYOUT_H
calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_h8300_h8300h_aki3068net_ram.h>" : \
"<pkgconf/mlt_h8300_h8300h_aki3068net_rom.h>" }
}
}
cdl_option CYGSEM_HAL_ROM_MONITOR {
display "Behave as a ROM monitor"
flavor bool
default_value 0
parent CYGPKG_HAL_ROM_MONITOR
requires { CYG_HAL_STARTUP == "ROM" }
description "
Enable this option if this program is to be used as a ROM monitor,
i.e. applications will be loaded into RAM on the board, and this
ROM monitor may process exceptions or interrupts generated from the
application. This enables features such as utilizing a separate
interrupt stack when exceptions are generated."
}
}
/v2_0/include/plf_intr.h
0,0 → 1,76
#ifndef CYGONCE_HAL_PLF_INTR_H
#define CYGONCE_HAL_PLF_INTR_H
 
//==========================================================================
//
// plf_intr.h
//
// AKI3068NET board interrupt and clock support
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jlarmour
// Contributors: jlarmour
// Date: 1999-09-09
// Purpose: Define Interrupt support
// Description: The macros defined here provide the HAL APIs for handling
// interrupts and the clock for the simulator. This file
// is empty since none are required!
//
// Usage:
// #include <cyg/hal/plf_intr.h>
// ...
//
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
 
//--------------------------------------------------------------------------
 
externC void h8300h_reset (void);
externC void hal_delay_us(int usecs);
 
#define HAL_PLATFORM_RESET(x)
#define HAL_PLATFORM_RESET_ENTRY &h8300h_reset
 
#define HAL_DELAY_US(n) hal_delay_us((n) / 16)
 
//--------------------------------------------------------------------------
#endif // ifndef CYGONCE_HAL_PLF_INTR_H
// End of plf_intr.h
/v2_0/include/plf_stub.h
0,0 → 1,90
#ifndef CYGONCE_HAL_PLF_STUB_H
#define CYGONCE_HAL_PLF_STUB_H
 
//=============================================================================
//
// plf_stub.h
//
// Platform header for GDB stub support.
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jskov
// Contributors:jskov
// Date: 1999-05-18
// Purpose: Platform HAL stub support for H8/300H simulator
// Usage: #include <cyg/hal/plf_stub.h>
//
//####DESCRIPTIONEND####
//
//=============================================================================
 
#include <pkgconf/system.h>
#include <pkgconf/hal.h>
 
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
 
#include <cyg/infra/cyg_type.h> // CYG_UNUSED_PARAM, externC
 
#include <cyg/hal/h8300_stub.h> // architecture stub support
 
#include <cyg/hal/hal_diag.h> // hal_diag_led_on
 
//----------------------------------------------------------------------------
// Define some platform specific communication details. This is mostly
// handled by hal_if now, but we need to make sure the comms tables are
// properly initialized.
 
externC void cyg_hal_plf_comms_init(void);
 
#define HAL_STUB_PLATFORM_INIT_SERIAL() cyg_hal_plf_comms_init()
 
#define HAL_STUB_PLATFORM_SET_BAUD_RATE(baud) CYG_UNUSED_PARAM(int, (baud))
#define HAL_STUB_PLATFORM_INTERRUPTIBLE 0
 
//----------------------------------------------------------------------------
// Stub initializer.
#ifdef CYGSEM_HAL_ROM_MONITOR
# define HAL_STUB_PLATFORM_INIT() hal_diag_led_on()
#else
# define HAL_STUB_PLATFORM_INIT() CYG_EMPTY_STATEMENT
#endif
 
#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
//-----------------------------------------------------------------------------
#endif // CYGONCE_HAL_PLF_STUB_H
// End of plf_stub.h
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.h
0,0 → 1,18
// eCos memory layout - Wed Nov 24 13:10:23 1999
 
// This is a generated file - changes will be lost if ConfigTool(MLT) is run
 
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
 
#endif
 
#define CYGMEM_REGION_ram (0x400000)
#if !defined(CYGPKG_IO_ETH_DRIVERS)
#define CYGMEM_REGION_ram_SIZE (0x200000)
#else
#define CYGMEM_REGION_ram_SIZE (0x200000-0xC000)
#endif
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
 
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.ldi
0,0 → 1,41
// eCos memory layout - Fri Oct 20 08:25:16 2000
 
// This is a generated file - do not edit
 
#include <cyg/infra/cyg_type.inc>
 
OUTPUT_FORMAT("elf32-h8300")
OUTPUT_ARCH(h8300h)
 
MEMORY
{
rom : ORIGIN = 0x000000, LENGTH = 0x60000
#if !defined(CYGPKG_IO_ETH_DRIVERS)
ram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100
#else
ram : ORIGIN = 0x5F4000, LENGTH = 0xC000
iram : ORIGIN = 0xffbf20, LENGTH = 0x4000-0x100
#endif
}
 
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (rom, 0x000000, LMA_EQ_VMA)
SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
#if !defined(CYGPKG_IO_ETH_DRIVERS)
SECTION_int_fook_table (ram, 0xffbf20,FOLLOWING (.gcc_except_table))
SECTION_data (ram, ALIGN (0x4),FOLLOWING (.int_fook_table))
SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
#else
SECTION_data (ram, 0x5F4000,FOLLOWING (.gcc_except_table))
SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
SECTION_int_fook_table (iram, 0xffbf20,FOLLOWING (.data))
#endif
SECTIONS_END
}
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.h
0,0 → 1,14
// eCos memory layout - Wed Nov 24 13:10:23 1999
 
// This is a generated file - changes will be lost if ConfigTool(MLT) is run
 
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
 
#endif
 
#define CYGMEM_REGION_ram (0x420000)
#define CYGMEM_REGION_ram_SIZE (0x1E0000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
 
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.ldi
0,0 → 1,30
// eCos memory layout - Fri Oct 20 08:25:16 2000
 
// This is a generated file - do not edit
 
#include <cyg/infra/cyg_type.inc>
 
OUTPUT_FORMAT("elf32-h8300")
OUTPUT_ARCH(h8300h)
 
MEMORY
{
ram : ORIGIN = 0x400000, LENGTH = 0x20000
}
 
SECTIONS
{
SECTIONS_BEGIN
SECTION_text (ram, 0x400000, LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
SECTION_int_fook_table (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4),LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4),LMA_EQ_VMA)
SECTIONS_END
}
 
fook_table_address = 0xffbf20;
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_rom.mlt
0,0 → 1,12
version 0
region ram ffbf20 ffff20 0 !
section rom_vectors 0 1 0 1 1 1 1 1 0 60000 text text !
section text 0 1 0 1 0 1 0 1 fini fini !
section fini 0 1 0 1 0 1 0 1 rodata rodata !
section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 1 0 1 0 1 0 1 data data !
section data 0 4 0 1 0 1 0 1 bss bss !
section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
section heap1 0 8 0 0 0 0 0 0 !
/v2_0/include/pkgconf/mlt_h8300_h8300h_aki3068net_ram.mlt
0,0 → 1,12
version 0
region ram 400000 10000 0 !
section text 0 1 0 1 0 1 0 1 400000 400000 fini fini !
section fini 0 1 0 1 0 1 0 1 rodata rodata !
section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 1 0 1 0 1 0 1 int_fook_table int_fook_table !
section int_fook_table 0 1 0 1 0 1 0 1 data data !
section data 0 4 0 1 0 1 0 1 bss bss !
section bss 0 4 0 1 0 1 0 0 !
 
/v2_0/include/platform.inc
0,0 → 1,127
#ifndef CYGONCE_HAL_PLATFORM_INC
#define CYGONCE_HAL_PLATFORM_INC
##=============================================================================
##
## platform.inc
##
## AKI3068NET "board" assembler header file
##
##=============================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
##=============================================================================
#######DESCRIPTIONBEGIN####
##
## Author(s): jlarmour
## Contributors: Yoshinori Sato
## Date: 1999-09-09
## Purpose: AKI3068NET "board" definitions.
## Description: This file contains various definitions and macros that are
## required for writing assembly code for the AKI3068NET board
## Currently there are none
## Usage:
## #include <cyg/hal/platform.inc>
## ...
##
##
######DESCRIPTIONEND####
##
##=============================================================================
 
#include <pkgconf/hal.h>
 
#include <cyg/hal/mod_regs_bsc.h>
#include <cyg/hal/mod_regs_pio.h>
 
##-----------------------------------------------------------------------------
 
#define CYGPKG_HAL_H8300_MEMC_DEFINED
.macro hal_memc_init
#if defined(CYG_HAL_STARTUP_ROM)
mov.l #init_regs,er0
mov.w #8,e1
1:
mov.l @er0+,er2
mov.w @er0+,r1
mov.b r1l,@er2
dec.w #1,e1
bne 1b
bra 2f
 
init_regs:
.long CYGARC_RTCOR
.word 5 ; 1.5[ms] reflesh cycle
.long CYGARC_RTMCSR
.word 0x30 ; clk x 2048
.long CYGARC_DRCRB
.word 0x90
.long CYGARC_DRCRA
.word 0x22
.long CYGARC_P1DDR
.word 0xff
.long CYGARC_P2DDR
.word 0xff
.long CYGARC_P5DDR
.word 0x01
.long CYGARC_P8DDR
.word 0x0c
init_regs_end:
 
2:
#endif
.endm
 
#define CYGPKG_HAL_H8300_DIAG_DEFINED
 
.macro hal_diag_init
mov.b #0x83,r0l
mov.b r0l,@CYGARC_PADDR
mov.b #0,r0l
mov.b r0l,@CYGARC_PADR
.endm
 
.macro hal_diag_excpt_start
.endm
 
.macro hal_diag_intr_start
.endm
 
.macro hal_diag_restore
.endm
 
.macro hal_diag_data
.endm
 
#------------------------------------------------------------------------------
#endif // ifndef CYGONCE_HAL_PLATFORM_INC
# end of platform.inc
/v2_0/include/hal_diag.h
0,0 → 1,80
#ifndef CYGONCE_HAL_HAL_DIAG_H
#define CYGONCE_HAL_HAL_DIAG_H
 
/*=============================================================================
//
// hal_diag.h
//
// HAL Support for Kernel Diagnostic Routines
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): yoshinori sato
// Contributors: yoshinori sato
// Date: 2002-04-06
// Purpose: HAL Support for Kernel Diagnostic Routines
// Description: Diagnostic routines for use during kernel development.
// Usage: #include <cyg/hal/hal_diag.h>
//
//####DESCRIPTIONEND####
//
//===========================================================================*/
 
#include <pkgconf/hal.h>
 
#include <cyg/infra/cyg_type.h>
 
externC void hal_diag_init(void);
externC void hal_diag_write_char(cyg_uint8 c);
externC void hal_diag_read_char(cyg_uint8 *c);
 
/*---------------------------------------------------------------------------*/
 
#define HAL_DIAG_INIT() hal_diag_init()
 
#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_)
 
#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_)
 
//-----------------------------------------------------------------------------
// Simple LED control.
externC void hal_diag_led_on( void );
externC void hal_diag_led_off( void );
 
/*---------------------------------------------------------------------------*/
/* end of hal_diag.h */
#endif /* CYGONCE_HAL_HAL_DIAG_H */
/v2_0/doc/README
0,0 → 1,2
Please visit http://homepage2.nifty.com/ysato/eCos/index.en.html for up to date
information, particularly on which GNU tools to use and patches.
/v2_0/src/delay_us.S
0,0 → 1,39
;;delay_us
 
#include <pkgconf/hal.h>
 
#include <cyg/hal/arch.inc>
#include <cyg/hal/basetype.h>
#include <cyg/hal/mod_regs_tmr.h>
#define DELAY_COUNT (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)*16/8
// .file "delay_us.S"
.h8300h
.text
 
.global CYG_LABEL_DEFN(hal_delay_us)
CYG_LABEL_DEFN(hal_delay_us):
mov.b #0,r1l
mov.b r1l,@CYGARC_8TCNT2:8
mov.b r1l,@CYGARC_8TCSR2:8
mov.b #DELAY_COUNT+1,r1l
mov.b r1l,@CYGARC_TCORA2:8
mov.b #0x09,r1l
mov.b r1l,@CYGARC_8TCR2:8
mov.b #0,r2h
sub.w e1,e1
1:
mov.l er0,er0
ble 3f
2:
btst #6,@CYGARC_8TCSR2:8
beq 2b
bclr #6,@CYGARC_8TCSR2:8
dec.l #1,er0
bra 1b
3:
mov.b #0,r0l
mov.b r0l,@CYGARC_8TCR2
rts
 
/v2_0/src/hal_diag.c
0,0 → 1,187
/*=============================================================================
//
// hal_diag.c
//
// HAL diagnostic output code
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): dsm
// Contributors: dsm
// Date: 1998-03-13
// Purpose: HAL diagnostic output
// Description: Implementations of HAL diagnostic output support.
//
//####DESCRIPTIONEND####
//
//===========================================================================*/
 
#include <pkgconf/hal.h>
 
#include <cyg/hal/hal_diag.h>
#include <cyg/hal/h8_sci.h>
#include <cyg/hal/var_intr.h>
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/hal_misc.h>
 
#define SCI_BASE ((cyg_uint8*)0xffffb8)
 
static channel_data_t channel = { (cyg_uint8*)SCI_BASE, 0, 0};
 
void
cyg_hal_plf_comms_init(void)
{
static int initialized = 0;
 
if (initialized)
return;
 
initialized = 1;
 
cyg_hal_plf_sci_init(0, 0, CYGNUM_HAL_INTERRUPT_RXI1, SCI_BASE);
}
 
//=============================================================================
// Led control
//=============================================================================
#define LED CYGARC_PADR
 
void
hal_diag_led_on( void )
{
HAL_WRITE_UINT8(LED, 0x01);
}
 
void
hal_diag_led_off( void )
{
HAL_WRITE_UINT8(LED, 0);
}
 
//=============================================================================
// Compatibility with older stubs
//=============================================================================
 
#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
#include <cyg/hal/hal_stub.h> // hal_output_gdb_string
#endif
 
void hal_diag_init(void)
{
cyg_hal_plf_sci_init_channel(&channel);
}
 
void
hal_diag_write_char( cyg_uint8 c )
{
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
static char line[100];
static int pos = 0;
 
// No need to send CRs
if( c == '\r' ) return;
 
line[pos++] = c;
 
if( c == '\n' || pos == sizeof(line) )
{
CYG_INTERRUPT_STATE old;
 
// Disable interrupts. This prevents GDB trying to interrupt us
// while we are in the middle of sending a packet. The serial
// receive interrupt will be seen when we re-enable interrupts
// later.
CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old);
while(1)
{
char c1;
static char hex[] = "0123456789ABCDEF";
cyg_uint8 csum = 0;
int i;
cyg_hal_plf_sci_putc(&channel, '$');
cyg_hal_plf_sci_putc(&channel, 'O');
csum += 'O';
for( i = 0; i < pos; i++ )
{
char ch = line[i];
char h = hex[(ch>>4)&0xF];
char l = hex[ch&0xF];
cyg_hal_plf_sci_putc(&channel, h);
cyg_hal_plf_sci_putc(&channel, l);
csum += h;
csum += l;
}
cyg_hal_plf_sci_putc(&channel, '#');
cyg_hal_plf_sci_putc(&channel, hex[(csum>>4)&0xF]);
cyg_hal_plf_sci_putc(&channel, hex[csum&0xF]);
 
// Wait for the ACK character '+' from GDB here and handle
// receiving a ^C instead.
c1 = (char) cyg_hal_plf_sci_getc(&channel);
 
if( c1 == '+' )
break; // a good acknowledge
 
// Check for user break.
if( cyg_hal_is_break( &c1, 1 ) )
cyg_hal_user_break( NULL );
 
// otherwise, loop round again
}
pos = 0;
 
// And re-enable interrupts
CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old);
}
#else // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
cyg_hal_plf_sci_putc(&channel, c);
#endif
}
 
void
hal_diag_read_char(cyg_uint8 *c)
{
*c = (char) cyg_hal_plf_sci_getc(&channel);
}
 
/*===========================================================================*/
/* EOF hal_diag.c */
 
/v2_0/src/plf_misc.c
0,0 → 1,161
//==========================================================================
//
// plf_misc.c
//
// HAL platform miscellaneous functions
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): nickg
// Contributors: nickg, jlarmour
// Date: 1999-09-09
// Purpose: HAL miscellaneous functions
// Description: This file contains miscellaneous functions provided by the
// HAL.
//
//####DESCRIPTIONEND####
//
//========================================================================*/
 
#include <pkgconf/hal.h>
 
#include <cyg/infra/cyg_type.h> // Base types
 
#include <cyg/hal/hal_arch.h> // architectural definitions
#include <cyg/hal/hal_io.h>
#include <cyg/hal/hal_if.h>
#include <cyg/hal/plf_intr.h>
#include <cyg/hal/var_arch.h>
 
/*------------------------------------------------------------------------*/
 
void hal_platform_init(void)
{
hal_if_init();
}
 
void h8300h_reset(void)
{
__asm__ ("ldc #0x80,ccr\n"
"jmp @@0\n\t");
}
 
/*------------------------------------------------------------------------*/
/* Control C ISR support */
 
#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT)
 
struct Hal_SavedRegisters *hal_saved_interrupt_state;
 
#endif
 
/*------------------------------------------------------------------------*/
/* clock support */
 
void hal_clock_initialize(cyg_uint32 period)
{
CYG_BYTE prescale;
#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8
prescale = 0x01;
#else
#if CYGNUM_HAL_H8300_RTC_PRESCALE == 64
prescale = 0x02;
#else
#if CYGNUM_HAL_H8300_RTC_PRESCALE == 8192
prescale = 0x03;
#else
#error illigal RTC prescale setting
#endif
#endif
#endif
HAL_WRITE_UINT8(CYGARC_TCORA3,period);
HAL_WRITE_UINT8(CYGARC_8TCNT3,0x00);
HAL_WRITE_UINT8(CYGARC_8TCR3,0x48 | prescale);
HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00);
}
 
void hal_clock_reset(cyg_uint32 vector, cyg_uint32 period)
{
HAL_WRITE_UINT8(CYGARC_8TCR3,0x00);
HAL_WRITE_UINT8(CYGARC_8TCSR3,0x00);
hal_clock_initialize(period);
}
 
void hal_clock_read(cyg_uint32 *pvalue)
{
CYG_BYTE val;
HAL_READ_UINT8(CYGARC_8TCNT3,val);
*pvalue = val;
}
 
//---------------------------------------------------------------------------
// Low-level delay (in microseconds)
 
#if 0
void hal_delay_us(int usecs)
{
volatile CYG_BYTE *tcr = (CYG_BYTE *)CYGARC_8TCR2;
volatile CYG_BYTE *tcnt = (CYG_BYTE *)CYGARC_8TCNT2;
short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/8*25;
//short clocks_per_us = (CYGHWR_HAL_H8300_PROCESSOR_SPEED/1000000)/20;
unsigned char val1,val2;
short diff;
 
usecs /= 25;
 
*tcnt = 0x00;
*tcr = 0x01;
diff = 0;
while (usecs > 0) {
while (diff < clocks_per_us) {
val1 = *tcnt;
while ((val2 = *tcnt) == val1);
if (val2 < val1)
diff += val2 + 0x100 - val1;
else
diff += val2 - val1;
}
usecs -= diff / clocks_per_us;
diff -= clocks_per_us;
}
*tcr = 0x00;
}
#endif
 
/*------------------------------------------------------------------------*/
/* End of plf_misc.c */
/v2_0/ChangeLog
0,0 → 1,45
2002-04-29 Jonathan Larmour <jlarmour@redhat.com>
 
* src/delay_us.S:
Don't use .file as it can confuse debugging since the .file
doesn't contain the path and therefore the debugger will never
know where it lives! This conflicts with using -Wa,--gstabs.
 
2002-04-24 Yoshinori Sato <qzb04471@nifty.ne.jp>
 
* New package.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.