URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/ecos-2.0/packages/hal/arm/cma230
- from Rev 1254 to Rev 1765
- ↔ Reverse comparison
Rev 1254 → Rev 1765
/v2_0/cdl/hal_arm_cma230.cdl
0,0 → 1,334
# ==================================================================== |
# |
# hal_arm_cma230.cdl |
# |
# Cogent CMA230 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: gthomas |
# Contributors: |
# Date: 1999-07-01 |
# |
#####DESCRIPTIONEND#### |
# |
# ==================================================================== |
|
cdl_package CYGPKG_HAL_ARM_CMA230 { |
display "Cogent Computer Systems CMA2xx boards" |
parent CYGPKG_HAL_ARM |
hardware |
include_dir cyg/hal |
define_header hal_arm_cma230.h |
description " |
The cma230 HAL package provides the support needed to run |
eCos on Cogent Computer Systems CMA2xx (CMA230, CMA222) boards." |
|
compile hal_diag.c cma230_misc.c |
|
implements CYGINT_HAL_DEBUG_GDB_STUBS |
implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK |
implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT |
implements CYGINT_HAL_ARM_ARCH_ARM7 |
implements CYGINT_HAL_ARM_THUMB_ARCH |
implements CYGINT_HAL_TESTS_NO_CACHES |
|
define_proc { |
puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>" |
puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_cma230.h>" |
|
puts $::cdl_header "#define CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES 100000" |
} |
|
cdl_option CYGHWR_HAL_ARM_CMA2XX_VARIANT { |
display "Cogent CMA2xxx processor variant" |
flavor data |
legal_values { "CMA230" "CMA222" } |
default_value { "CMA230" } |
description " |
The processor variant used by the Cogent board." |
} |
|
cdl_component CYG_HAL_STARTUP { |
display "Startup type" |
flavor data |
legal_values {"RAM" "ROM"} |
default_value {"RAM"} |
no_define |
define -file system.h CYG_HAL_STARTUP |
description " |
When targetting the CMA230 board it is possible to build |
the system for either RAM bootstrap or ROM bootstrap(s). Select |
'ram' when building programs to load into RAM using onboard |
debug software such as Angel or eCos GDB stubs. Select 'rom' |
when building a stand-alone application which will be put |
into ROM." |
} |
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD { |
display "Diagnostic serial port baud rate" |
flavor data |
legal_values 9600 19200 38400 115200 |
default_value 38400 |
description " |
This option selects the baud rate used for the diagnostic port. |
Note: this should match the value chosen for the GDB port if the |
diagnostic and GDB port are the same." |
} |
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD { |
display "GDB serial port baud rate" |
flavor data |
legal_values 9600 19200 38400 115200 |
default_value 38400 |
description " |
This option controls the baud rate used for the GDB connection." |
} |
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { |
display "Number of communication channels on the board" |
flavor data |
calculated 2 |
} |
|
cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL { |
display "Debug serial port" |
active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE |
flavor data |
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 |
default_value 0 |
description " |
The CMA230 board has two serial ports. 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" |
active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE |
flavor data |
legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 |
default_value 0 |
description " |
The CMA230 board has two serial ports. 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_RTC_PERIOD { |
display "Real-time clock period" |
flavor data |
calculated 5000 ;# 2us clock |
} |
} |
|
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 { "arm-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 { (CYGHWR_THUMB ? "-mthumb " : "-mcpu=arm7tdmi ") . |
(CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . |
"-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -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 CYGPKG_HAL_ARM_CMA2XX_CFLAGS_ADD { |
display "Additional compiler flags" |
flavor data |
no_define |
default_value { CYGHWR_HAL_ARM_CMA2XX_VARIANT == "CMA222" ? "-D__CMA222" : "" } |
description " |
This option modifies the set of compiler flags for |
building the Cogent board HAL. These flags are used in addition |
to the set of global flags." |
} |
|
cdl_option CYGPKG_HAL_ARM_CMA2XX_CFLAGS_REMOVE { |
display "Suppressed compiler flags" |
flavor data |
no_define |
default_value { "" } |
description " |
This option modifies the set of compiler flags for |
building the Cogent board HAL. These flags are removed from |
the set of global flags if present." |
} |
|
cdl_option CYGBLD_GLOBAL_LDFLAGS { |
display "Global linker flags" |
flavor data |
no_define |
default_value { (CYGHWR_THUMB ? "-mthumb " : "-mcpu=arm7tdmi ") . |
(CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . |
"-g -nostdlib -Wl,--gc-sections -Wl,-static" } |
description " |
This option controls the global linker flags. Individual |
packages may define options which override these global flags." |
} |
|
cdl_option CYGBLD_BUILD_GDB_STUBS { |
display "Build GDB stub ROM image" |
default_value 0 |
requires CYGBLD_BUILD_COMMON_GDB_STUBS |
requires { CYG_HAL_STARTUP == "ROM" } |
requires CYGSEM_HAL_ROM_MONITOR |
requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT |
requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT |
requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT |
requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM |
no_define |
description " |
This option enables the building of the GDB stubs for the |
board." |
|
make -priority 320 { |
<PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img |
@mv $< $(<:.img=.elf) |
$(OBJCOPY) --strip-debug --change-addresses=0x10038000 $(<:.img=.elf) $< |
$(OBJCOPY) -O binary $(<:.img=.elf) $@ |
} |
} |
} |
|
cdl_component CYGHWR_MEMORY_LAYOUT { |
display "Memory layout" |
flavor data |
no_define |
calculated { CYGHWR_HAL_ARM_CMA2XX_VARIANT == "CMA230" ? \ |
(CYG_HAL_STARTUP == "RAM" ? "arm_cma230_ram" : \ |
"arm_cma230_rom"): \ |
(CYG_HAL_STARTUP == "RAM" ? "arm_cma222_ram" : \ |
"arm_cma222_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 { CYGHWR_HAL_ARM_CMA2XX_VARIANT == "CMA230" ? \ |
(CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_cma230_ram.ldi>" : \ |
"<pkgconf/mlt_arm_cma230_rom.ldi>") : \ |
(CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_cma222_ram.ldi>" : \ |
"<pkgconf/mlt_arm_cma222_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 { CYGHWR_HAL_ARM_CMA2XX_VARIANT == "CMA230" ? \ |
(CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_cma230_ram.h>" : \ |
"<pkgconf/mlt_arm_cma230_rom.h>") : \ |
(CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_cma222_ram.h>" : \ |
"<pkgconf/mlt_arm_cma222_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." |
} |
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR { |
display "Work with a ROM monitor" |
flavor booldata |
legal_values { "Generic" "GDB_stubs" } |
default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 } |
parent CYGPKG_HAL_ROM_MONITOR |
requires { CYG_HAL_STARTUP == "RAM" } |
description " |
Support can be enabled for different varieties of ROM monitor. |
This support changes various eCos semantics such as the encoding |
of diagnostic output, or the overriding of hardware interrupt |
vectors. |
Firstly there is \"Generic\" support which prevents the HAL |
from overriding the hardware vectors that it does not use, to |
instead allow an installed ROM monitor to handle them. This is |
the most basic support which is likely to be common to most |
implementations of ROM monitor. |
\"GDB_stubs\" provides support when GDB stubs are included in |
the ROM monitor or boot ROM." |
} |
} |
/v2_0/include/hal_cma230.h
0,0 → 1,106
#ifndef CYGONCE_HAL_CMA230_H |
#define CYGONCE_HAL_CMA230_H |
|
/*============================================================================= |
// |
// hal_cma230.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): gthomas |
// Contributors: gthomas |
// Date: 1999-04-19 |
// Purpose: Cogent CMA230 hardware description |
// Description: |
// Usage: #include <cyg/hal/hal_cma230.h> |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
// Note: these defintions match the documentation, thus no attempt is made |
// to sanitise (mangle) the names. Also, care should be taken to keep this |
// clean for use in assembly code (no "C" constructs). |
|
#define CMA230_ISR 0x0F600000 // Interrupt source register - Read only |
#define CMA230_CLR 0x0F600008 // Clear interrupt source - Write only |
#define CMA230_IMRr 0x0F600010 // Interrupt mask register - Read only |
#define CMA230_IMRw 0x0F600018 // Interrupt mask register - Write only |
#define CMA230_ACK1 0x0F600020 // Interrupt acknowledge slot 1 - Read only |
#define CMA230_ACK2 0x0F600028 // Interrupt acknowledge slot 2 - Read only |
#define CMA230_ACK3 0x0F600030 // Interrupt acknowledge slot 3 - Read only |
|
#define CMA230_TC_COUNT 0x0F700020 // Timer value - 16 bits - Read only |
#define CMA230_TC_PRELOAD 0x0F700028 // Timer preload - 16 bits - Write only |
#define CMA230_TC_CLEAR 0x0F700030 // Timer clear - Write only |
#define CMA230_TC_ENABLE 0x0F700038 // Timer enable/start - Write only |
|
// Motherboard definitions |
|
#define CMA101_DUARTB 0x0E900000 // Base address |
#define CMA101_DUARTB_RHR 0x0E900000 // Receive holding register |
#define CMA101_DUARTB_THR 0x0E900000 // Transmit holding register |
#define CMA101_DUARTB_LBR 0x0E900000 // Low byte of baud rate |
#define CMA101_DUARTB_IER 0x0E900008 // Interrupt enable |
#define CMA101_DUARTB_HBR 0x0E900008 // High byte of baud rate |
#define CMA101_DUARTB_ISR 0x0E900010 // Interrupt status |
#define CMA101_DUARTB_FCTL 0x0E900010 // FIFO control |
#define CMA101_DUARTB_LCTL 0x0E900018 // Line control |
#define CMA101_DUARTB_MCTL 0x0E900020 // Modem control |
#define CMA101_DUARTB_LSR 0x0E900028 // Line status |
#define CMA101_DUARTB_MSR 0x0E900030 // Modem status |
#define CMA101_DUARTB_SCR 0x0E900038 // Scratch |
|
#define CMA101_DUARTA 0x0E900040 // Base address |
#define CMA101_DUARTA_RHR 0x0E900040 // Receive holding register |
#define CMA101_DUARTA_THR 0x0E900040 // Transmit holding register |
#define CMA101_DUARTA_LBR 0x0E900040 // Low byte of baud rate |
#define CMA101_DUARTA_IER 0x0E900048 // Interrupt enable |
#define CMA101_DUARTA_HBR 0x0E900048 // High byte of baud rate |
#define CMA101_DUARTA_ISR 0x0E900050 // Interrupt status |
#define CMA101_DUARTA_FCTL 0x0E900050 // FIFO control |
#define CMA101_DUARTA_LCTL 0x0E900058 // Line control |
#define CMA101_DUARTA_MCTL 0x0E900060 // Modem control |
#define CMA101_DUARTA_LSR 0x0E900068 // Line status |
#define CMA101_DUARTA_MSR 0x0E900070 // Modem status |
#define CMA101_DUARTA_SCR 0x0E900078 // Scratch |
|
/*---------------------------------------------------------------------------*/ |
/* end of hal_cma230.h */ |
#endif /* CYGONCE_HAL_CMA230_H */ |
/v2_0/include/hal_platform_extras.h
0,0 → 1,165
#ifndef CYGONCE_HAL_PLATFORM_EXTRAS_H |
#define CYGONCE_HAL_PLATFORM_EXTRAS_H |
|
/*============================================================================= |
// |
// hal_platform_extras.h |
// |
// Platform specific support for HAL (assembly 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): gthomas |
// Contributors: gthomas, msalter |
// Date: 1999-12-02 |
// Purpose: Cogent CMA222 platform extras, in particular MMU tables |
// Description: |
// Usage: #include <cyg/hal/hal_platform_extras.h> |
// |
//####DESCRIPTIONEND#### |
// |
//===========================================================================*/ |
|
.section ".mmu_tables","aw" |
|
#define NEXT_PAGE \ |
.long PTE ; \ |
.set PTE,PTE+MMU_PAGE_SIZE |
|
_PT_0x0: |
.set PTE,DRAM_PA_START|MMU_L2_TYPE_Small\ |
|MMU_AP_Any|MMU_Bufferable|MMU_Cacheable |
.rept (0x2000000)/0x1000 |
NEXT_PAGE |
.endr |
.balign 0x0400 |
|
// Too bad these macros don't work ['as' bug?] :-( |
|
#define NEXT_SECTION \ |
.long PTE+OFF ;\ |
.set OFF,OFF+(MMU_SECTION_SIZE/MMU_PAGE_SIZE)*4 |
|
#define FILL_SEGMENT_(base) \ |
.set PTE,base \ |
.set OFF,0x00000000 \ |
.rept 0x10000000/MMU_SECTION_SIZE \ |
NEXT_SECTION \ |
.endr |
|
#define OFF ((MMU_SECTION_SIZE/MMU_PAGE_SIZE)*4) |
|
#define FILL_8M_SEGMENT(base,seg) \ |
.long base+(OFF*(seg+0x00)); \ |
.long base+(OFF*(seg+0x01)); \ |
.long base+(OFF*(seg+0x02)); \ |
.long base+(OFF*(seg+0x03)); \ |
.long base+(OFF*(seg+0x04)); \ |
.long base+(OFF*(seg+0x05)); \ |
.long base+(OFF*(seg+0x06)); \ |
.long base+(OFF*(seg+0x07)); \ |
.long base+(OFF*(seg+0x08)); |
|
#define FILL_16M_SEGMENT(base,seg) \ |
.long base+(OFF*(seg+0x00)); \ |
.long base+(OFF*(seg+0x01)); \ |
.long base+(OFF*(seg+0x02)); \ |
.long base+(OFF*(seg+0x03)); \ |
.long base+(OFF*(seg+0x04)); \ |
.long base+(OFF*(seg+0x05)); \ |
.long base+(OFF*(seg+0x06)); \ |
.long base+(OFF*(seg+0x07)); \ |
.long base+(OFF*(seg+0x08)); \ |
.long base+(OFF*(seg+0x09)); \ |
.long base+(OFF*(seg+0x0A)); \ |
.long base+(OFF*(seg+0x0B)); \ |
.long base+(OFF*(seg+0x0C)); \ |
.long base+(OFF*(seg+0x0D)); \ |
.long base+(OFF*(seg+0x0E)); \ |
.long base+(OFF*(seg+0x0F)); |
|
#define FILL_32M_SEGMENT(base,seg) \ |
FILL_16M_SEGMENT(base,0x00); \ |
FILL_16M_SEGMENT(base,0x10); |
|
#define FILL_256M_SEGMENT(base) \ |
FILL_16M_SEGMENT(base,0x00); \ |
FILL_16M_SEGMENT(base,0x10); \ |
FILL_16M_SEGMENT(base,0x20); \ |
FILL_16M_SEGMENT(base,0x30); \ |
FILL_16M_SEGMENT(base,0x40); \ |
FILL_16M_SEGMENT(base,0x50); \ |
FILL_16M_SEGMENT(base,0x60); \ |
FILL_16M_SEGMENT(base,0x70); \ |
FILL_16M_SEGMENT(base,0x80); \ |
FILL_16M_SEGMENT(base,0x90); \ |
FILL_16M_SEGMENT(base,0xA0); \ |
FILL_16M_SEGMENT(base,0xB0); \ |
FILL_16M_SEGMENT(base,0xC0); \ |
FILL_16M_SEGMENT(base,0xD0); \ |
FILL_16M_SEGMENT(base,0xE0); \ |
FILL_16M_SEGMENT(base,0xF0); |
|
.balign 0x4000 |
_MMU_table: |
FILL_32M_SEGMENT(_PT_0x0+MMU_L1_TYPE_Page,0x00) |
FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00) |
FILL_32M_SEGMENT(PCIMEM_PA|MMU_L1_TYPE_Section|MMU_AP_Any) |
FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00) |
FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00) |
FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00) |
FILL_32M_SEGMENT(MMU_L1_TYPE_Fault,0x00) |
FILL_8M_SEGMENT(ROM_PA|MMU_L1_TYPE_Section|MMU_AP_Any) |
FILL_16M_SEGMENT(MBIO_PA|MMU_L1_TYPE_Section|MMU_AP_Any) |
FILL_8M_SEGMENT(FLASH_PA|MMU_L1_TYPE_Section|MMU_AP_Any) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
FILL_256M_SEGMENT(MMU_L1_TYPE_Fault) |
|
#endif // CYGONCE_HAL_PLATFORM_EXTRAS_H |
/v2_0/include/plf_stub.h
0,0 → 1,85
#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, gthomas |
// Date: 1999-04-21 |
// Purpose: Platform HAL stub support for Cogent CMA230 boards. |
// Usage: #include <cyg/hal/plf_stub.h> |
// |
//####DESCRIPTIONEND#### |
// |
//============================================================================= |
|
#include <pkgconf/hal.h> |
#include <pkgconf/hal_arm_cma230.h> |
|
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
|
#include <cyg/infra/cyg_type.h> // CYG_UNUSED_PARAM |
|
#include <cyg/hal/arm_stub.h> // architecture stub support |
|
//---------------------------------------------------------------------------- |
// 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 |
#define HAL_STUB_PLATFORM_INIT_BREAK_IRQ() CYG_EMPTY_STATEMENT |
|
//---------------------------------------------------------------------------- |
// Stub initializer. |
#define HAL_STUB_PLATFORM_INIT() CYG_EMPTY_STATEMENT |
|
#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
//----------------------------------------------------------------------------- |
#endif // CYGONCE_HAL_PLF_STUB_H |
// End of plf_stub.h |
/v2_0/include/pkgconf/mlt_arm_cma230_rom.h
0,0 → 1,20
// eCos memory layout - Fri Oct 20 05:34:02 2000 |
|
// This is a generated file - do not edit |
|
#ifndef __ASSEMBLER__ |
#include <cyg/infra/cyg_type.h> |
#include <stddef.h> |
|
#endif |
#define CYGMEM_REGION_ram (0) |
#define CYGMEM_REGION_ram_SIZE (0x200000) |
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) |
#define CYGMEM_REGION_rom (0xe000000) |
#define CYGMEM_REGION_rom_SIZE (0x40000) |
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R) |
#ifndef __ASSEMBLER__ |
extern char CYG_LABEL_NAME (__heap1) []; |
#endif |
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) |
#define CYGMEM_SECTION_heap1_SIZE (0x200000 - (size_t) CYG_LABEL_NAME (__heap1)) |
v2_0/include/pkgconf/mlt_arm_cma230_rom.h
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: v2_0/include/pkgconf/mlt_arm_cma222_rom.h
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_rom.h (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_rom.h (revision 1765)
@@ -0,0 +1,20 @@
+// eCos memory layout - Fri Oct 20 05:34:42 2000
+
+// This is a generated file - do not edit
+
+#ifndef __ASSEMBLER__
+#include
+#include
+
+#endif
+#define CYGMEM_REGION_ram (0)
+#define CYGMEM_REGION_ram_SIZE (0x200000)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+#define CYGMEM_REGION_rom (0xe000000)
+#define CYGMEM_REGION_rom_SIZE (0x40000)
+#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
+#ifndef __ASSEMBLER__
+extern char CYG_LABEL_NAME (__heap1) [];
+#endif
+#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x200000 - (size_t) CYG_LABEL_NAME (__heap1))
v2_0/include/pkgconf/mlt_arm_cma222_rom.h
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: v2_0/include/pkgconf/mlt_arm_cma230_rom.ldi
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma230_rom.ldi (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma230_rom.ldi (revision 1765)
@@ -0,0 +1,28 @@
+// eCos memory layout - Fri Oct 20 05:34:02 2000
+
+// This is a generated file - do not edit
+
+#include
+
+MEMORY
+{
+ ram : ORIGIN = 0, LENGTH = 0x200000
+ rom : ORIGIN = 0xe000000, LENGTH = 0x40000
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (rom, 0xe000000, LMA_EQ_VMA)
+ SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
+ SECTION_data (ram, 0x1000, FOLLOWING (.gcc_except_table))
+ SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x4);
+ SECTIONS_END
+}
Index: v2_0/include/pkgconf/mlt_arm_cma222_rom.ldi
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_rom.ldi (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_rom.ldi (revision 1765)
@@ -0,0 +1,28 @@
+// eCos memory layout - Fri Oct 20 05:34:42 2000
+
+// This is a generated file - do not edit
+
+#include
+
+MEMORY
+{
+ ram : ORIGIN = 0, LENGTH = 0x200000
+ rom : ORIGIN = 0xe000000, LENGTH = 0x40000
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_rom_vectors (rom, 0xe000000, LMA_EQ_VMA)
+ SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
+ SECTION_data (ram, 0x1000, FOLLOWING (.gcc_except_table))
+ SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x4);
+ SECTIONS_END
+}
Index: v2_0/include/pkgconf/mlt_arm_cma230_ram.h
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma230_ram.h (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma230_ram.h (revision 1765)
@@ -0,0 +1,17 @@
+// eCos memory layout - Fri Oct 20 05:33:25 2000
+
+// This is a generated file - do not edit
+
+#ifndef __ASSEMBLER__
+#include
+#include
+
+#endif
+#define CYGMEM_REGION_ram (0)
+#define CYGMEM_REGION_ram_SIZE (0x200000)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+#ifndef __ASSEMBLER__
+extern char CYG_LABEL_NAME (__heap1) [];
+#endif
+#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x200000 - (size_t) CYG_LABEL_NAME (__heap1))
v2_0/include/pkgconf/mlt_arm_cma230_ram.h
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: v2_0/include/pkgconf/mlt_arm_cma222_ram.h
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_ram.h (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_ram.h (revision 1765)
@@ -0,0 +1,17 @@
+// eCos memory layout - Fri Oct 20 05:35:09 2000
+
+// This is a generated file - do not edit
+
+#ifndef __ASSEMBLER__
+#include
+#include
+
+#endif
+#define CYGMEM_REGION_ram (0)
+#define CYGMEM_REGION_ram_SIZE (0x200000)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+#ifndef __ASSEMBLER__
+extern char CYG_LABEL_NAME (__heap1) [];
+#endif
+#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x200000 - (size_t) CYG_LABEL_NAME (__heap1))
Index: v2_0/include/pkgconf/mlt_arm_cma230_ram.ldi
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma230_ram.ldi (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma230_ram.ldi (revision 1765)
@@ -0,0 +1,27 @@
+// eCos memory layout - Fri Oct 20 05:33:25 2000
+
+// This is a generated file - do not edit
+
+#include
+
+MEMORY
+{
+ ram : ORIGIN = 0, LENGTH = 0x200000
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
+ SECTION_rom_vectors (ram, 0x8000, LMA_EQ_VMA)
+ SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x4);
+ SECTIONS_END
+}
Index: v2_0/include/pkgconf/mlt_arm_cma222_ram.ldi
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_ram.ldi (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_ram.ldi (revision 1765)
@@ -0,0 +1,27 @@
+// eCos memory layout - Fri Oct 20 05:35:09 2000
+
+// This is a generated file - do not edit
+
+#include
+
+MEMORY
+{
+ ram : ORIGIN = 0, LENGTH = 0x200000
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+ SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
+ SECTION_rom_vectors (ram, 0x8000, LMA_EQ_VMA)
+ SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+ CYG_LABEL_DEFN(__heap1) = ALIGN (0x4);
+ SECTIONS_END
+}
Index: v2_0/include/pkgconf/mlt_arm_cma230_rom.mlt
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma230_rom.mlt (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma230_rom.mlt (revision 1765)
@@ -0,0 +1,14 @@
+version 0
+region ram 0 200000 0 !
+region rom e000000 40000 1 !
+section fixed_vectors 0 1 0 1 1 0 1 0 20 20 !
+section data 0 1 1 1 1 1 0 0 1000 bss !
+section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
+section heap1 0 4 0 0 0 0 0 0 !
+section rom_vectors 0 1 0 1 1 1 1 1 e000000 e000000 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
+section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 0 1 0 0 0 1 data !
Index: v2_0/include/pkgconf/mlt_arm_cma222_rom.mlt
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_rom.mlt (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_rom.mlt (revision 1765)
@@ -0,0 +1,14 @@
+version 0
+region ram 0 200000 0 !
+region rom e000000 40000 1 !
+section fixed_vectors 0 1 0 1 1 0 1 0 20 20 !
+section data 0 1 1 1 1 1 0 0 1000 bss !
+section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
+section heap1 0 4 0 0 0 0 0 0 !
+section rom_vectors 0 1 0 1 1 1 1 1 e000000 e000000 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
+section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 0 1 0 0 0 1 data !
Index: v2_0/include/pkgconf/mlt_arm_cma230_ram.mlt
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma230_ram.mlt (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma230_ram.mlt (revision 1765)
@@ -0,0 +1,13 @@
+version 0
+region ram 0 200000 0 !
+section fixed_vectors 0 1 0 1 1 0 1 0 20 20 !
+section rom_vectors 0 1 0 1 1 1 1 1 8000 8000 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
+section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 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 4 0 0 0 0 0 0 !
Index: v2_0/include/pkgconf/mlt_arm_cma222_ram.mlt
===================================================================
--- v2_0/include/pkgconf/mlt_arm_cma222_ram.mlt (nonexistent)
+++ v2_0/include/pkgconf/mlt_arm_cma222_ram.mlt (revision 1765)
@@ -0,0 +1,13 @@
+version 0
+region ram 0 200000 0 !
+section fixed_vectors 0 1 0 1 1 0 1 0 20 20 !
+section rom_vectors 0 1 0 1 1 1 1 1 8000 8000 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
+section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 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 4 0 0 0 0 0 0 !
Index: v2_0/include/hal_platform_ints.h
===================================================================
--- v2_0/include/hal_platform_ints.h (nonexistent)
+++ v2_0/include/hal_platform_ints.h (revision 1765)
@@ -0,0 +1,83 @@
+#ifndef CYGONCE_HAL_PLATFORM_INTS_H
+#define CYGONCE_HAL_PLATFORM_INTS_H
+//==========================================================================
+//
+// hal_platform_ints.h
+//
+// HAL 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): gthomas
+// Contributors: gthomas
+// Date: 1999-04-21
+// Purpose: Define Interrupt support
+// Description: The interrupt details for the CMA230 are defined here.
+// Usage:
+// #include
+// ...
+//
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#define CYGNUM_HAL_INTERRUPT_unused 0
+#define CYGNUM_HAL_INTERRUPT_ABORT 1
+#define CYGNUM_HAL_INTERRUPT_SERIAL_B 2
+#define CYGNUM_HAL_INTERRUPT_SERIAL_A 3
+#define CYGNUM_HAL_INTERRUPT_TIMER 4
+#define CYGNUM_HAL_INTERRUPT_ETHER_PP 5 // Ethernet or Parallel port
+#define CYGNUM_HAL_INTERRUPT_SLOT1 6
+#define CYGNUM_HAL_INTERRUPT_SLOT2 7
+#define CYGNUM_HAL_INTERRUPT_SLOT3 8
+
+#define CYGNUM_HAL_ISR_MIN 0
+#define CYGNUM_HAL_ISR_MAX 8
+#define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX+1)
+
+// The vector used by the Real time clock
+#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_TIMER
+
+
+//----------------------------------------------------------------------------
+// Reset.
+#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
+
+#define HAL_PLATFORM_RESET_ENTRY 0xe000000
+
+#endif // CYGONCE_HAL_PLATFORM_INTS_H
Index: v2_0/include/hal_cache.h
===================================================================
--- v2_0/include/hal_cache.h (nonexistent)
+++ v2_0/include/hal_cache.h (revision 1765)
@@ -0,0 +1,351 @@
+#ifndef CYGONCE_HAL_CACHE_H
+#define CYGONCE_HAL_CACHE_H
+
+//=============================================================================
+//
+// hal_cache.h
+//
+// HAL cache control API
+//
+//=============================================================================
+//####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, gthomas
+// Contributors: nickg, gthomas, msalter
+// Date: 1998-09-28
+// Purpose: Cache control API
+// Description: The macros defined here provide the HAL APIs for handling
+// cache control operations.
+// Usage:
+// #include
+// ...
+//
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+#include
+
+#ifdef __CMA222
+//-----------------------------------------------------------------------------
+// Cache dimensions
+
+#define HAL_UCACHE_SIZE 0x2000 // Size of data cache in bytes
+#define HAL_UCACHE_LINE_SIZE 16 // Size of a data cache line
+#define HAL_UCACHE_WAYS 4 // Associativity of the cache
+#define HAL_UCACHE_SETS (HAL_UCACHE_SIZE/(HAL_UCACHE_LINE_SIZE*HAL_UCACHE_WAYS))
+
+#define HAL_CACHE_UNIFIED // Let programs know the caches are combined
+
+//-----------------------------------------------------------------------------
+// Global control of caches
+
+// Note: the 'mrc' doesn't seem to work.
+#if 0
+// Enable the data cache
+// mrc MMU_CP,0,r1,MMU_Control,c0
+// orr r1,r1,#MMU_Control_C|MMU_Control_B
+// mcr MMU_CP,0,r1,MMU_Control,c0
+
+#define HAL_UCACHE_ENABLE() \
+{ \
+ asm volatile ("mrc p15,0,r1,c1,c0;" \
+ "orr r1,r1,#0x000C;" \
+ "mcr p15,0,r1,c1,c0;" \
+ : \
+ : \
+ : "r1" /* Clobber list */ \
+ ); \
+ \
+}
+
+// Disable the data cache
+#define HAL_UCACHE_DISABLE() \
+{ \
+ asm volatile ("mrc p15,0,r1,c1,c0;" \
+ "bic r1,r1,#0x000C;" \
+ "mcr p15,0,r1,c1,c0;" \
+ : \
+ : \
+ : "r1" /* Clobber list */ \
+ ); \
+ \
+}
+#else
+#define HAL_UCACHE_ENABLE() \
+{ \
+ asm volatile ("mov r1,#0x7D;" \
+ "mcr p15,0,r1,c1,c0;" \
+ : \
+ : \
+ : "r1" /* Clobber list */ \
+ ); \
+ \
+}
+
+// Disable the data cache
+#define HAL_UCACHE_DISABLE() \
+{ \
+ asm volatile ("mov r1,#0x71;" \
+ "mcr p15,0,r1,c1,c0;" \
+ : \
+ : \
+ : "r1" /* Clobber list */ \
+ ); \
+ \
+}
+#endif
+
+// Is the cache turned on?
+#define HAL_UCACHE_IS_ENABLED(_state_) _state_ = 1;
+
+// Invalidate the entire cache
+// mcr MMU_CP,0,r1,MMU_InvalidateCache,c0
+#define HAL_UCACHE_INVALIDATE_ALL() \
+{ \
+ asm volatile ( \
+ "mov r1,#0;" \
+ "mcr p15,0,r1,c7,c0,0;" \
+ : \
+ : \
+ : "r1","memory" /* Clobber list */ \
+ ); \
+}
+
+// Synchronize the contents of the cache with memory.
+#define HAL_UCACHE_SYNC() \
+{ \
+ cyg_uint32 *ROM = (cyg_uint32 *)0xE0000000; \
+ int i; \
+ volatile cyg_uint32 val; \
+ for (i = 0; i < HAL_UCACHE_SETS; i++) { \
+ val = *ROM; \
+ ROM += HAL_UCACHE_LINE_SIZE; \
+ } \
+}
+
+// Purge contents of data cache
+#define HAL_UCACHE_PURGE_ALL() HAL_UCACHE_INVALIDATE_ALL()
+
+//-----------------------------------------------------------------------------
+// Data cache line control
+
+// Write dirty cache lines to memory and invalidate the cache entries
+// for the given address range.
+#define HAL_UCACHE_FLUSH( _base_ , _size_ ) HAL_UCACHE_SYNC()
+
+// Write dirty cache lines to memory for the given address range.
+#define HAL_UCACHE_STORE( _base_ , _size_ ) HAL_UCACHE_SYNC()
+
+#endif // ifdef __CMA222
+
+#ifdef HAL_CACHE_UNIFIED
+//-----------------------------------------------------------------------------
+// Global control of data cache
+
+#define HAL_DCACHE_SIZE HAL_UCACHE_SIZE
+#define HAL_DCACHE_LINE_SIZE HAL_UCACHE_LINE_SIZE
+#define HAL_DCACHE_WAYS HAL_UCACHE_WAYS
+#define HAL_DCACHE_SETS HAL_UCACHE_SETS
+
+// Enable the data cache
+#define HAL_DCACHE_ENABLE() HAL_UCACHE_ENABLE()
+
+// Disable the data cache
+#define HAL_DCACHE_DISABLE() HAL_UCACHE_DISABLE()
+
+// Invalidate the entire cache
+#define HAL_DCACHE_INVALIDATE_ALL() HAL_UCACHE_INVALIDATE_ALL()
+
+// Synchronize the contents of the cache with memory.
+#define HAL_DCACHE_SYNC() HAL_UCACHE_SYNC()
+
+// Query the state of the data cache
+#define HAL_DCACHE_IS_ENABLED(_state_) HAL_UCACHE_IS_ENABLED(_state_)
+
+//-----------------------------------------------------------------------------
+// Data cache line control
+
+// Write dirty cache lines to memory and invalidate the cache entries
+// for the given address range.
+#define HAL_DCACHE_FLUSH( _base_ , _size_ ) HAL_UCACHE_FLUSH( _base_ , _size_ )
+
+// Write dirty cache lines to memory for the given address range.
+#define HAL_DCACHE_STORE( _base_ , _size_ ) HAL_UCACHE_STORE( _base_ , _size_ )
+
+//-----------------------------------------------------------------------------
+// Global control of Instruction cache - use Data cache controls since they
+// are not separatable.
+
+#define HAL_ICACHE_SIZE HAL_UCACHE_SIZE
+#define HAL_ICACHE_LINE_SIZE HAL_UCACHE_LINE_SIZE
+#define HAL_ICACHE_WAYS HAL_UCACHE_WAYS
+#define HAL_ICACHE_SETS HAL_UCACHE_SETS
+
+// Enable the instruction cache
+#define HAL_ICACHE_ENABLE() HAL_UCACHE_ENABLE()
+
+// Disable the instruction cache
+#define HAL_ICACHE_DISABLE() HAL_UCACHE_DISABLE()
+
+// Invalidate the entire cache
+#define HAL_ICACHE_INVALIDATE_ALL() HAL_UCACHE_INVALIDATE_ALL()
+
+// Synchronize the contents of the cache with memory.
+#define HAL_ICACHE_SYNC() HAL_UCACHE_SYNC()
+
+#else
+//-----------------------------------------------------------------------------
+// Cache dimensions
+
+// Data cache
+//#define HAL_DCACHE_SIZE 0 // Size of data cache in bytes
+//#define HAL_DCACHE_LINE_SIZE 0 // Size of a data cache line
+//#define HAL_DCACHE_WAYS 0 // Associativity of the cache
+
+// Instruction cache
+//#define HAL_ICACHE_SIZE 0 // Size of cache in bytes
+//#define HAL_ICACHE_LINE_SIZE 0 // Size of a cache line
+//#define HAL_ICACHE_WAYS 0 // Associativity of the cache
+
+//#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS))
+//#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS))
+
+
+//-----------------------------------------------------------------------------
+// Global control of data cache
+
+// Enable the data cache
+#define HAL_DCACHE_ENABLE()
+
+// Disable the data cache
+#define HAL_DCACHE_DISABLE()
+
+// Invalidate the entire cache
+#define HAL_DCACHE_INVALIDATE_ALL()
+
+// Synchronize the contents of the cache with memory.
+#define HAL_DCACHE_SYNC()
+
+// Purge contents of data cache
+#define HAL_DCACHE_PURGE_ALL()
+
+// Set the data cache refill burst size
+//#define HAL_DCACHE_BURST_SIZE(_size_)
+
+// Set the data cache write mode
+//#define HAL_DCACHE_WRITE_MODE( _mode_ )
+
+//#define HAL_DCACHE_WRITETHRU_MODE 0
+//#define HAL_DCACHE_WRITEBACK_MODE 1
+
+// Load the contents of the given address range into the data cache
+// and then lock the cache so that it stays there.
+//#define HAL_DCACHE_LOCK(_base_, _size_)
+
+// Undo a previous lock operation
+//#define HAL_DCACHE_UNLOCK(_base_, _size_)
+
+// Unlock entire cache
+//#define HAL_DCACHE_UNLOCK_ALL()
+
+//-----------------------------------------------------------------------------
+// Data cache line control
+
+// Allocate cache lines for the given address range without reading its
+// contents from memory.
+//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ )
+
+// Write dirty cache lines to memory and invalidate the cache entries
+// for the given address range.
+//#define HAL_DCACHE_FLUSH( _base_ , _size_ )
+
+// Invalidate cache lines in the given range without writing to memory.
+//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ )
+
+// Write dirty cache lines to memory for the given address range.
+//#define HAL_DCACHE_STORE( _base_ , _size_ )
+
+// Preread the given range into the cache with the intention of reading
+// from it later.
+//#define HAL_DCACHE_READ_HINT( _base_ , _size_ )
+
+// Preread the given range into the cache with the intention of writing
+// to it later.
+//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ )
+
+// Allocate and zero the cache lines associated with the given range.
+//#define HAL_DCACHE_ZERO( _base_ , _size_ )
+
+//-----------------------------------------------------------------------------
+// Global control of Instruction cache
+
+// Enable the instruction cache
+#define HAL_ICACHE_ENABLE()
+
+// Disable the instruction cache
+#define HAL_ICACHE_DISABLE()
+
+// Invalidate the entire cache
+#define HAL_ICACHE_INVALIDATE_ALL()
+
+// Synchronize the contents of the cache with memory.
+#define HAL_ICACHE_SYNC()
+
+// Set the instruction cache refill burst size
+//#define HAL_ICACHE_BURST_SIZE(_size_)
+
+// Load the contents of the given address range into the instruction cache
+// and then lock the cache so that it stays there.
+//#define HAL_ICACHE_LOCK(_base_, _size_)
+
+// Undo a previous lock operation
+//#define HAL_ICACHE_UNLOCK(_base_, _size_)
+
+// Unlock entire cache
+//#define HAL_ICACHE_UNLOCK_ALL()
+
+//-----------------------------------------------------------------------------
+// Instruction cache line control
+
+// Invalidate cache lines in the given range without writing to memory.
+//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ )
+
+//-----------------------------------------------------------------------------
+#endif // ifndef HAL_CACHE_UNIFIED
+#endif // ifndef CYGONCE_HAL_CACHE_H
+// End of hal_cache.h
Index: v2_0/include/hal_diag.h
===================================================================
--- v2_0/include/hal_diag.h (nonexistent)
+++ v2_0/include/hal_diag.h (revision 1765)
@@ -0,0 +1,90 @@
+#ifndef CYGONCE_HAL_DIAG_H
+#define CYGONCE_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): nickg, gthomas
+// Contributors: nickg, gthomas
+// Date: 1998-09-11
+// Purpose: HAL Support for Kernel Diagnostic Routines
+// Description: Diagnostic routines for use during kernel development.
+// Usage: #include
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================*/
+
+#include
+
+#include
+
+#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
+
+#include
+
+#define HAL_DIAG_INIT() hal_if_diag_init()
+#define HAL_DIAG_WRITE_CHAR(_c_) hal_if_diag_write_char(_c_)
+#define HAL_DIAG_READ_CHAR(_c_) hal_if_diag_read_char(&_c_)
+
+#else // everything by steam
+
+/*---------------------------------------------------------------------------*/
+/* functions implemented in hal_diag.c */
+
+externC void hal_diag_init(void);
+externC void hal_diag_write_char(char c);
+externC void hal_diag_read_char(char *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_)
+
+#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
+
+/*---------------------------------------------------------------------------*/
+/* end of hal_diag.h */
+#endif /* CYGONCE_HAL_DIAG_H */
Index: v2_0/include/hal_platform_setup.h
===================================================================
--- v2_0/include/hal_platform_setup.h (nonexistent)
+++ v2_0/include/hal_platform_setup.h (revision 1765)
@@ -0,0 +1,64 @@
+#ifndef CYGONCE_HAL_PLATFORM_SETUP_H
+#define CYGONCE_HAL_PLATFORM_SETUP_H
+
+/*=============================================================================
+//
+// hal_platform_setup.h
+//
+// Platform specific support for HAL (assembly 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): gthomas
+// Contributors: gthomas
+// Date: 1999-04-21
+// Purpose: Cogent CMA230 platform specific support routines
+// Description:
+// Usage: #include
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================*/
+
+#include // Platform specific hardware definitions
+
+#define PLATFORM_SETUP1 // Nothing special needed
+
+
+/*---------------------------------------------------------------------------*/
+/* end of hal_platform_setup.h */
+#endif /* CYGONCE_HAL_PLATFORM_SETUP_H */
Index: v2_0/include/plf_io.h
===================================================================
--- v2_0/include/plf_io.h (nonexistent)
+++ v2_0/include/plf_io.h (revision 1765)
@@ -0,0 +1,60 @@
+#ifndef CYGONCE_HAL_ARM_CMA230_PLF_IO_H
+#define CYGONCE_HAL_ARM_CMA230_PLF_IO_H
+
+/*=============================================================================
+//
+// plf_io.h
+//
+// Platform specific support (register layout, etc)
+//
+//=============================================================================
+//####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: 2002-01-28
+// Purpose: Platform specific support routines
+// Description:
+// Usage: #include
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================*/
+
+#include
+
+#endif // CYGONCE_HAL_ARM_CMA230_PLF_IO_H
+// EOF plf_io.h
Index: v2_0/src/cma230_misc.c
===================================================================
--- v2_0/src/cma230_misc.c (nonexistent)
+++ v2_0/src/cma230_misc.c (revision 1765)
@@ -0,0 +1,214 @@
+//==========================================================================
+//
+// cma230_misc.c
+//
+// HAL misc board support code for ARM CMA230-1
+//
+//==========================================================================
+//####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): gthomas
+// Contributors: gthomas
+// Date: 1999-02-20
+// Purpose: HAL board support
+// Description: Implementations of HAL board interfaces
+//
+//####DESCRIPTIONEND####
+//
+//========================================================================*/
+
+#include
+
+#include // base types
+#include // tracing macros
+#include // assertion macros
+
+#include // calling interface API
+#include // IO macros
+#include // Register state info
+#include
+#include // Interrupt names
+#include
+#include // Hardware definitions
+
+static cyg_uint32 _period;
+
+// Use Timer/Counter #2 for system clock
+
+void hal_clock_initialize(cyg_uint32 period)
+{
+ // Initialize counter
+ *(volatile cyg_uint16 *)CMA230_TC_ENABLE = 0; // Disable timer
+ *(volatile cyg_uint16 *)CMA230_TC_CLEAR = 0; // Resets counter
+ *(volatile cyg_uint16 *)CMA230_TC_PRELOAD = period;
+ *(volatile cyg_uint16 *)CMA230_TC_ENABLE = 1; // Starts timer
+ _period = period;
+}
+
+// This routine is called during a clock interrupt.
+
+void hal_clock_reset(cyg_uint32 vector, cyg_uint32 period)
+{
+ if (period != _period) {
+ *(volatile cyg_uint16 *)CMA230_TC_PRELOAD = period;
+ _period = period;
+ }
+}
+
+// Read the current value of the clock, returning the number of hardware "ticks"
+// that have occurred (i.e. how far away the current value is from the start)
+
+void hal_clock_read(cyg_uint32 *pvalue)
+{
+ volatile cyg_int16 *tcct = (volatile cyg_int16 *)CMA230_TC_COUNT;
+ static cyg_int32 clock_val;
+ clock_val = *tcct; // Register has only 16 bits
+ *pvalue = (cyg_uint32)(_period - clock_val); // 'clock_val' counts down and wraps
+}
+
+//
+// Early stage hardware initialization
+// Some initialization has already been done before we get here. For now
+// just set up the interrupt environment.
+
+// Note: The hardware interrupt mask (read) doesn't seem to give reliable results.
+static cyg_uint8 _imrr;
+#undef CMA230_IMRr
+#define CMA230_IMRr (&_imrr)
+
+void hal_hardware_init(void)
+{
+#if 0
+ // Clear and initialize instruction cache
+ HAL_ICACHE_INVALIDATE_ALL();
+ HAL_ICACHE_ENABLE();
+#endif
+ // Any hardware/platform initialization that needs to be done.
+ // Reset all interrupt masks (disable all interrupt sources)
+ *(volatile cyg_uint8 *)CMA230_IMRw = 0;
+ *(volatile cyg_uint8 *)CMA230_CLR = 0xFF; // Clear all current interrupts
+
+ // Set up eCos/ROM interfaces
+ hal_if_init();
+}
+
+//
+// This routine is called to respond to a hardware interrupt (IRQ). It
+// should interrogate the hardware and return the IRQ vector number.
+
+#if 0
+// TEMP
+int tot_ints;
+cyg_uint32 int_PC[2048];
+// TEMP
+#endif
+
+int hal_IRQ_handler(HAL_SavedRegisters *regs)
+{
+ volatile cyg_uint8 isr = *(volatile cyg_uint8 *)CMA230_ISR;
+ volatile cyg_uint8 *imrr = (volatile cyg_uint8 *)CMA230_IMRr;
+ int vector;
+ isr &= *imrr; // The Interrupt Source Register shows _all_ current
+ // interrupt sources, not just the enabled ones
+#if 0
+// TEMP
+ int_PC[tot_ints++] = 0xFFFFFFFF;
+ int_PC[tot_ints++] = isr;
+ int_PC[tot_ints++] = regs->cpsr;
+ int_PC[tot_ints++] = regs->pc;
+ if (tot_ints == 2048) tot_ints = 0;
+// TEMP
+#endif
+
+ for (vector = 0; vector < 8; vector++) {
+ if (isr & (1<
+#include // board specifics
+
+#include // base types
+#include // tracing macros
+#include // assertion macros
+
+#include // basic machine info
+#include // interrupt macros
+#include // IO macros
+#include
+#include // Hardware definitions
+#include // Calling-if API
+#include // driver API
+#include // Helper functions
+
+static void cyg_hal_plf_serial_init(void);
+
+// FIXME: Copy LCD driver from powerpc/cogent
+//static void cyg_hal_plf_lcd_init(void);
+
+void
+cyg_hal_plf_comms_init(void)
+{
+ static int initialized = 0;
+
+ if (initialized)
+ return;
+
+ initialized = 1;
+
+ cyg_hal_plf_serial_init();
+// cyg_hal_plf_lcd_init();
+}
+
+//=============================================================================
+// Serial driver
+//=============================================================================
+
+//-----------------------------------------------------------------------------
+// There are two serial ports.
+#define CYG_DEV_SERIAL_BASE_A 0xe900047 // port A
+#define CYG_DEV_SERIAL_BASE_B 0xe900007 // port B
+
+//-----------------------------------------------------------------------------
+// Default baud rate is 38400
+// Based on 3.6864 MHz xtal
+#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==9600
+#define CYG_DEV_SERIAL_BAUD_MSB 0x00
+#define CYG_DEV_SERIAL_BAUD_LSB 0x18
+#endif
+#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==19200
+#define CYG_DEV_SERIAL_BAUD_MSB 0x00
+#define CYG_DEV_SERIAL_BAUD_LSB 0x0C
+#endif
+#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==38400
+#define CYG_DEV_SERIAL_BAUD_MSB 0x00
+#define CYG_DEV_SERIAL_BAUD_LSB 0x06
+#endif
+#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==115200
+#define CYG_DEV_SERIAL_BAUD_MSB 0x00
+#define CYG_DEV_SERIAL_BAUD_LSB 0x02
+#endif
+
+#ifndef CYG_DEV_SERIAL_BAUD_MSB
+#error Missing/incorrect serial baud rate defined - CDL error?
+#endif
+
+//-----------------------------------------------------------------------------
+// Define the serial registers. The Cogent board is equipped with a 16552
+// serial chip.
+#define CYG_DEV_SERIAL_RBR 0x00 // receiver buffer register, read, dlab = 0
+#define CYG_DEV_SERIAL_THR 0x00 // transmitter holding register, write, dlab = 0
+#define CYG_DEV_SERIAL_DLL 0x00 // divisor latch (LS), read/write, dlab = 1
+#define CYG_DEV_SERIAL_IER 0x08 // interrupt enable register, read/write, dlab = 0
+#define CYG_DEV_SERIAL_DLM 0x08 // divisor latch (MS), read/write, dlab = 1
+#define CYG_DEV_SERIAL_IIR 0x10 // interrupt identification register, read, dlab = 0
+#define CYG_DEV_SERIAL_FCR 0x10 // fifo control register, write, dlab = 0
+#define CYG_DEV_SERIAL_AFR 0x10 // alternate function register, read/write, dlab = 1
+#define CYG_DEV_SERIAL_LCR 0x18 // line control register, read/write
+#define CYG_DEV_SERIAL_MCR 0x20
+#define CYG_DEV_SERIAL_MCR_A 0x20
+#define CYG_DEV_SERIAL_MCR_B 0x20
+#define CYG_DEV_SERIAL_LSR 0x28 // line status register, read
+#define CYG_DEV_SERIAL_MSR 0x30 // modem status register, read
+#define CYG_DEV_SERIAL_SCR 0x38 // scratch pad register
+
+// The interrupt enable register bits.
+#define SIO_IER_ERDAI 0x01 // enable received data available irq
+#define SIO_IER_ETHREI 0x02 // enable THR empty interrupt
+#define SIO_IER_ELSI 0x04 // enable receiver line status irq
+#define SIO_IER_EMSI 0x08 // enable modem status interrupt
+
+// The interrupt identification register bits.
+#define SIO_IIR_IP 0x01 // 0 if interrupt pending
+#define SIO_IIR_ID_MASK 0x0e // mask for interrupt ID bits
+#define ISR_Tx 0x02
+#define ISR_Rx 0x04
+
+// The line status register bits.
+#define SIO_LSR_DR 0x01 // data ready
+#define SIO_LSR_OE 0x02 // overrun error
+#define SIO_LSR_PE 0x04 // parity error
+#define SIO_LSR_FE 0x08 // framing error
+#define SIO_LSR_BI 0x10 // break interrupt
+#define SIO_LSR_THRE 0x20 // transmitter holding register empty
+#define SIO_LSR_TEMT 0x40 // transmitter register empty
+#define SIO_LSR_ERR 0x80 // any error condition
+
+// The modem status register bits.
+#define SIO_MSR_DCTS 0x01 // delta clear to send
+#define SIO_MSR_DDSR 0x02 // delta data set ready
+#define SIO_MSR_TERI 0x04 // trailing edge ring indicator
+#define SIO_MSR_DDCD 0x08 // delta data carrier detect
+#define SIO_MSR_CTS 0x10 // clear to send
+#define SIO_MSR_DSR 0x20 // data set ready
+#define SIO_MSR_RI 0x40 // ring indicator
+#define SIO_MSR_DCD 0x80 // data carrier detect
+
+// The line control register bits.
+#define SIO_LCR_WLS0 0x01 // word length select bit 0
+#define SIO_LCR_WLS1 0x02 // word length select bit 1
+#define SIO_LCR_STB 0x04 // number of stop bits
+#define SIO_LCR_PEN 0x08 // parity enable
+#define SIO_LCR_EPS 0x10 // even parity select
+#define SIO_LCR_SP 0x20 // stick parity
+#define SIO_LCR_SB 0x40 // set break
+#define SIO_LCR_DLAB 0x80 // divisor latch access bit
+
+// The FIFO control register
+#define SIO_FCR_FCR0 0x01 // enable xmit and rcvr fifos
+#define SIO_FCR_FCR1 0x02 // clear RCVR FIFO
+#define SIO_FCR_FCR2 0x04 // clear XMIT FIFO
+
+
+//-----------------------------------------------------------------------------
+typedef struct {
+ cyg_uint8* base;
+ cyg_int32 msec_timeout;
+ int isr_vector;
+} channel_data_t;
+
+//-----------------------------------------------------------------------------
+static void
+init_serial_channel(channel_data_t* __ch_data)
+{
+ cyg_uint8* base = __ch_data->base;
+ cyg_uint8 lcr;
+
+ // 8-1-no parity.
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_LCR,
+ SIO_LCR_WLS0 | SIO_LCR_WLS1);
+
+ HAL_READ_UINT8(base+CYG_DEV_SERIAL_LCR, lcr);
+ lcr |= SIO_LCR_DLAB;
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_LCR, lcr);
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_DLL, CYG_DEV_SERIAL_BAUD_LSB);
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_DLM, CYG_DEV_SERIAL_BAUD_MSB);
+ lcr &= ~SIO_LCR_DLAB;
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_LCR, lcr);
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_FCR, 0x07); // Enable & clear FIFO
+}
+
+static cyg_bool
+cyg_hal_plf_serial_getc_nonblock(void* __ch_data, cyg_uint8* ch)
+{
+ cyg_uint8* base = ((channel_data_t*)__ch_data)->base;
+ cyg_uint8 lsr;
+
+ HAL_READ_UINT8(base+CYG_DEV_SERIAL_LSR, lsr);
+ if ((lsr & SIO_LSR_DR) == 0)
+ return false;
+
+ HAL_READ_UINT8(base+CYG_DEV_SERIAL_RBR, *ch);
+
+ return true;
+}
+
+
+cyg_uint8
+cyg_hal_plf_serial_getc(void* __ch_data)
+{
+ cyg_uint8 ch;
+ CYGARC_HAL_SAVE_GP();
+
+ while(!cyg_hal_plf_serial_getc_nonblock(__ch_data, &ch));
+
+ CYGARC_HAL_RESTORE_GP();
+ return ch;
+}
+
+void
+cyg_hal_plf_serial_putc(void* __ch_data, cyg_uint8 c)
+{
+ cyg_uint8* base = ((channel_data_t*)__ch_data)->base;
+ cyg_uint8 lsr;
+ CYGARC_HAL_SAVE_GP();
+
+ do {
+ HAL_READ_UINT8(base+CYG_DEV_SERIAL_LSR, lsr);
+ } while ((lsr & SIO_LSR_THRE) == 0);
+
+ HAL_WRITE_UINT8(base+CYG_DEV_SERIAL_THR, c);
+
+ // Hang around until the character has been safely sent.
+ do {
+ HAL_READ_UINT8(base+CYG_DEV_SERIAL_LSR, lsr);
+ } while ((lsr & SIO_LSR_THRE) == 0);
+
+ CYGARC_HAL_RESTORE_GP();
+}
+
+static channel_data_t channels[2] = {
+ { (cyg_uint8*)CMA101_DUARTA, 1000, CYGNUM_HAL_INTERRUPT_SERIAL_A},
+ { (cyg_uint8*)CMA101_DUARTB, 1000, CYGNUM_HAL_INTERRUPT_SERIAL_B}
+};
+
+static void
+cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf,
+ cyg_uint32 __len)
+{
+ CYGARC_HAL_SAVE_GP();
+
+ while(__len-- > 0)
+ cyg_hal_plf_serial_putc(__ch_data, *__buf++);
+
+ CYGARC_HAL_RESTORE_GP();
+}
+
+static void
+cyg_hal_plf_serial_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len)
+{
+ CYGARC_HAL_SAVE_GP();
+
+ while(__len-- > 0)
+ *__buf++ = cyg_hal_plf_serial_getc(__ch_data);
+
+ CYGARC_HAL_RESTORE_GP();
+}
+
+cyg_bool
+cyg_hal_plf_serial_getc_timeout(void* __ch_data, cyg_uint8* ch)
+{
+ int delay_count;
+ channel_data_t* chan = (channel_data_t*)__ch_data;
+ cyg_bool res;
+ CYGARC_HAL_SAVE_GP();
+
+ delay_count = chan->msec_timeout * 10; // delay in .1 ms steps
+ for(;;) {
+ res = cyg_hal_plf_serial_getc_nonblock(__ch_data, ch);
+ if (res || 0 == delay_count--)
+ break;
+
+ CYGACC_CALL_IF_DELAY_US(100);
+ }
+
+ CYGARC_HAL_RESTORE_GP();
+ return res;
+}
+
+static int
+cyg_hal_plf_serial_control(void *__ch_data, __comm_control_cmd_t __func, ...)
+{
+ static int irq_state = 0;
+ channel_data_t* chan = (channel_data_t*)__ch_data;
+ cyg_uint8 ier;
+ int ret = 0;
+ CYGARC_HAL_SAVE_GP();
+
+ switch (__func) {
+ case __COMMCTL_IRQ_ENABLE:
+ HAL_INTERRUPT_UNMASK(chan->isr_vector);
+ HAL_INTERRUPT_SET_LEVEL(chan->isr_vector, 1);
+ HAL_READ_UINT8(chan->base+CYG_DEV_SERIAL_IER, ier);
+ ier |= SIO_IER_ERDAI;
+ HAL_WRITE_UINT8(chan->base+CYG_DEV_SERIAL_IER, ier);
+ irq_state = 1;
+ break;
+ case __COMMCTL_IRQ_DISABLE:
+ ret = irq_state;
+ irq_state = 0;
+ HAL_INTERRUPT_MASK(chan->isr_vector);
+ HAL_READ_UINT8(chan->base+CYG_DEV_SERIAL_IER, ier);
+ ier &= ~SIO_IER_ERDAI;
+ HAL_WRITE_UINT8(chan->base+CYG_DEV_SERIAL_IER, ier);
+ break;
+ case __COMMCTL_DBG_ISR_VECTOR:
+ ret = chan->isr_vector;
+ break;
+ case __COMMCTL_SET_TIMEOUT:
+ {
+ va_list ap;
+
+ va_start(ap, __func);
+
+ ret = chan->msec_timeout;
+ chan->msec_timeout = va_arg(ap, cyg_uint32);
+
+ va_end(ap);
+ }
+ default:
+ break;
+ }
+ CYGARC_HAL_RESTORE_GP();
+ return ret;
+}
+
+static int
+cyg_hal_plf_serial_isr(void *__ch_data, int* __ctrlc,
+ CYG_ADDRWORD __vector, CYG_ADDRWORD __data)
+{
+ channel_data_t* chan = (channel_data_t*)__ch_data;
+ cyg_uint8 _iir;
+ int res = 0;
+ CYGARC_HAL_SAVE_GP();
+
+ HAL_READ_UINT8(chan->base+CYG_DEV_SERIAL_IIR, _iir);
+ _iir &= SIO_IIR_ID_MASK;
+
+ *__ctrlc = 0;
+ if ( ISR_Rx == _iir ) {
+ cyg_uint8 c, lsr;
+ HAL_READ_UINT8(chan->base+CYG_DEV_SERIAL_LSR, lsr);
+ if (lsr & SIO_LSR_DR) {
+
+ HAL_READ_UINT8(chan->base+CYG_DEV_SERIAL_RBR, c);
+
+ if( cyg_hal_is_break( &c , 1 ) )
+ *__ctrlc = 1;
+ }
+
+ // Acknowledge the interrupt
+ HAL_INTERRUPT_ACKNOWLEDGE(chan->isr_vector);
+ res = CYG_ISR_HANDLED;
+ }
+
+ CYGARC_HAL_RESTORE_GP();
+ return res;
+}
+
+static void
+cyg_hal_plf_serial_init(void)
+{
+ hal_virtual_comm_table_t* comm;
+ int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
+
+ // Disable interrupts.
+ HAL_INTERRUPT_MASK(channels[0].isr_vector);
+ HAL_INTERRUPT_MASK(channels[1].isr_vector);
+
+ // Init channels
+ init_serial_channel(&channels[0]);
+ init_serial_channel(&channels[1]);
+
+ // Setup procs in the vector table
+
+ // Set channel 0
+ CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
+ comm = CYGACC_CALL_IF_CONSOLE_PROCS();
+ CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[0]);
+ CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);
+ CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
+ CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
+ CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
+ CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
+ CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
+ CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
+
+ // Set channel 1
+ CYGACC_CALL_IF_SET_CONSOLE_COMM(1);
+ comm = CYGACC_CALL_IF_CONSOLE_PROCS();
+ CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[1]);
+ CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);
+ CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
+ CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
+ CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
+ CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
+ CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
+ CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
+
+ // Restore original console
+ CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
+}
+
+//=============================================================================
+// Compatibility with older stubs
+//=============================================================================
+
+#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
+
+
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+#include
+#include // cyg_hal_gdb_interrupt
+#endif
+
+// Assumption: all diagnostic output must be GDB packetized unless this is a ROM (i.e.
+// totally stand-alone) system.
+
+#if defined(CYG_HAL_STARTUP_ROM) || !defined(CYGDBG_HAL_DIAG_TO_DEBUG_CHAN)
+#define HAL_DIAG_USES_HARDWARE
+#endif
+
+/*---------------------------------------------------------------------------*/
+#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL==0
+// This is the base address of the A-channel
+#define CYG_DEV_SERIAL_BASE CMA101_DUARTA
+#define CYG_DEV_SERIAL_INT CYGNUM_HAL_INTERRUPT_SERIAL_A
+#else
+// This is the base address of the B-channel
+#define CYG_DEV_SERIAL_BASE CMA101_DUARTB
+#define CYG_DEV_SERIAL_INT CYGNUM_HAL_INTERRUPT_SERIAL_B
+#endif
+
+static channel_data_t ser_channel = { (cyg_uint8*)CYG_DEV_SERIAL_BASE, 0, 0};
+
+#ifdef HAL_DIAG_USES_HARDWARE
+
+void hal_diag_init(void)
+{
+ static int init = 0;
+ char *msg = "\n\rARM eCos\n\r";
+ cyg_uint8 lcr;
+
+ if (init++) return;
+
+ init_serial_channel(&ser_channel);
+
+ while (*msg) hal_diag_write_char(*msg++);
+}
+
+#ifdef DEBUG_DIAG
+#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
+#define DIAG_BUFSIZE 32
+#else
+#define DIAG_BUFSIZE 2048
+#endif
+static char diag_buffer[DIAG_BUFSIZE];
+static int diag_bp = 0;
+#endif
+
+void hal_diag_write_char(char c)
+{
+ cyg_uint8 lsr;
+
+ hal_diag_init();
+
+ cyg_hal_plf_serial_putc(&ser_channel, c)
+
+#ifdef DEBUG_DIAG
+ diag_buffer[diag_bp++] = c;
+ if (diag_bp == DIAG_BUFSIZE) {
+ while (1) ;
+ diag_bp = 0;
+ }
+#endif
+}
+
+void hal_diag_read_char(char *c)
+{
+ *c = cyg_hal_plf_serial_getc(&ser_channel);
+}
+
+#else // HAL_DIAG relies on GDB
+
+// Initialize diag port - assume GDB channel is already set up
+void hal_diag_init(void)
+{
+ if (0) init_serial_channel(&ser_channel); // avoid warning
+}
+
+// Actually send character down the wire
+static void
+hal_diag_write_char_serial(char c)
+{
+ cyg_hal_plf_serial_putc(&ser_channel, c);
+}
+
+static bool
+hal_diag_read_serial(char *c)
+{
+ long timeout = 1000000000; // A long time...
+ while (!cyg_hal_plf_serial_getc_nonblock(&ser_channel, c))
+ if (0 == --timeout) return false;
+
+ return true;
+}
+
+void
+hal_diag_read_char(char *c)
+{
+ while (!hal_diag_read_serial(c)) ;
+}
+
+void
+hal_diag_write_char(char c)
+{
+ 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.
+
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+ CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old);
+#else
+ HAL_DISABLE_INTERRUPTS(old);
+#endif
+
+ while(1)
+ {
+ static char hex[] = "0123456789ABCDEF";
+ cyg_uint8 csum = 0;
+ int i;
+ char c1;
+
+ hal_diag_write_char_serial('$');
+ hal_diag_write_char_serial('O');
+ csum += 'O';
+ for( i = 0; i < pos; i++ )
+ {
+ char ch = line[i];
+ char h = hex[(ch>>4)&0xF];
+ char l = hex[ch&0xF];
+ hal_diag_write_char_serial(h);
+ hal_diag_write_char_serial(l);
+ csum += h;
+ csum += l;
+ }
+ hal_diag_write_char_serial('#');
+ hal_diag_write_char_serial(hex[(csum>>4)&0xF]);
+ hal_diag_write_char_serial(hex[csum&0xF]);
+
+ // Wait for the ACK character '+' from GDB here and handle
+ // receiving a ^C instead. This is the reason for this clause
+ // being a loop.
+ if (!hal_diag_read_serial(&c1))
+ continue; // No response - try sending packet again
+
+ if( c1 == '+' )
+ break; // a good acknowledge
+
+#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
+ cyg_drv_interrupt_acknowledge(CYG_DEV_SERIAL_INT);
+ if( c1 == 3 ) {
+ // Ctrl-C: breakpoint.
+ cyg_hal_gdb_interrupt (__builtin_return_address(0));
+ break;
+ }
+#endif
+ // otherwise, loop round again
+ }
+
+ pos = 0;
+
+ // And re-enable interrupts
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+ CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old);
+#else
+ HAL_RESTORE_INTERRUPTS(old);
+#endif
+
+ }
+}
+#endif
+
+#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
+
+/*---------------------------------------------------------------------------*/
+/* End of hal_diag.c */
Index: v2_0/ChangeLog
===================================================================
--- v2_0/ChangeLog (nonexistent)
+++ v2_0/ChangeLog (revision 1765)
@@ -0,0 +1,386 @@
+2003-04-11 Bart Veer
+
+ * cdl/hal_arm_cma230.cdl: building for thumb now involves
+ arm-elf-gcc -mthumb, not thumb-elf-gcc
+
+2002-08-06 Gary Thomas
+2002-08-06 Motoya Kurotsu
+
+ * src/hal_diag.c: I/O channel data can't be constant - contains
+ timeout information which can be changed.
+
+2002-05-23 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Don't run cache tests.
+
+2002-05-13 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Removed implemntation of
+ CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_NOT_GUARANTEED.
+
+2002-04-24 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES
+ defined.
+
+2002-01-28 Jesper Skov
+
+ * include/plf_io.h: Added.
+
+2001-06-08 Jonathan Larmour
+
+ * include/hal_cache.h: Correctly indicate absence of cache in CMA230
+ variant.
+
+2001-04-16 Gary Thomas
+
+ * cdl/hal_arm_cma230.cdl: Add CDL to describe CPU family.
+
+2001-03-08 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Does not guarantee virtual vector
+ support.
+
+2001-02-20 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Also enable -mthumb-interwork when
+ building ROM monitors (or calls from Thumb code would die on
+ return).
+ Reworked a bit.
+
+2001-02-13 Gary Thomas
+
+ * src/cma230_misc.c (hal_IRQ_handler):
+ Return CYGNUM_HAL_INTERRUPT_NONE for spurious interrupts.
+
+2001-02-08 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Respect channel configuration
+ constraints.
+
+ * src/hal_diag.c: Replace CYGSEM_HAL_DIAG_MANGLER_None with
+ CYGDBG_HAL_DIAG_TO_DEBUG_CHAN.
+
+2001-01-31 Jesper Skov
+
+ * src/hal_diag.c: Replaced CYGDBG_HAL_DIAG_DISABLE_GDB_PROTOCOL
+ with CYGSEM_HAL_DIAG_MANGLER_None
+
+2001-01-26 Jesper Skov
+
+ * src/hal_diag.c: Removed CYGSEM_HAL_VIRTUAL_VECTOR_DIAG check.
+ * include/plf_stub.h: Moved reset macro to
+ * include/hal_platform_ints.h: this file.
+
+2000-12-04 Hugo Tyson
+
+ * include/hal_cache.h: Consistently ensure that ARM registers used
+ in MCR ops to cache-control coprocessors, where the data doesn't
+ matter, all actually have data zero ("SBZ") as in the Jaggar book.
+ This may well not be necessary, but for the sake of making sure...
+
+2000-10-20 Jonathan Larmour
+
+ * include/pkgconf/mlt_arm_cma222_ram.mlt:
+ * include/pkgconf/mlt_arm_cma222_rom.mlt:
+ * include/pkgconf/mlt_arm_cma230_ram.mlt:
+ * include/pkgconf/mlt_arm_cma230_rom.mlt:
+ Add heap1 section
+
+ * include/pkgconf/mlt_arm_cma222_ram.h:
+ * include/pkgconf/mlt_arm_cma222_rom.h:
+ * include/pkgconf/mlt_arm_cma230_ram.h:
+ * include/pkgconf/mlt_arm_cma230_rom.h:
+ * include/pkgconf/mlt_arm_cma222_ram.ldi:
+ * include/pkgconf/mlt_arm_cma222_rom.ldi:
+ * include/pkgconf/mlt_arm_cma230_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230_rom.ldi:
+ Regenerate
+
+2000-07-05 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl:
+ * include/hal_diag.h:
+ * include/plf_stub.h:
+ * src/cma230_misc.c:
+ * src/hal_diag.c:
+ * src/plf_stub.c: [deleted]
+ Changed to support virtual vectors.
+
+2000-06-18 Gary Thomas
+
+ * include/pkgconf/mlt_arm_cma222_ram.ldi:
+ * include/pkgconf/mlt_arm_cma222_ram.mlt:
+ * include/pkgconf/mlt_arm_cma222_rom.ldi:
+ * include/pkgconf/mlt_arm_cma222_rom.mlt:
+ * include/pkgconf/mlt_arm_cma230T_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230T_ram.mlt:
+ * include/pkgconf/mlt_arm_cma230T_rom.ldi:
+ * include/pkgconf/mlt_arm_cma230T_rom.mlt:
+ * include/pkgconf/mlt_arm_cma230_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230_ram.mlt:
+ * include/pkgconf/mlt_arm_cma230_rom.ldi:
+ * include/pkgconf/mlt_arm_cma230_rom.mlt:
+ Incorporate new fixed vectors (used on all ARM platforms).
+
+2000-02-29 Jonathan Larmour
+
+ * include/pkgconf/mlt_arm_cma222_ram.h:
+ * include/pkgconf/mlt_arm_cma222_ram.ldi:
+ * include/pkgconf/mlt_arm_cma222_ram.mlt:
+ * include/pkgconf/mlt_arm_cma222_rom.h:
+ * include/pkgconf/mlt_arm_cma222_rom.ldi:
+ * include/pkgconf/mlt_arm_cma222_rom.mlt:
+ * include/pkgconf/mlt_arm_cma230_ram.h:
+ * include/pkgconf/mlt_arm_cma230_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230_ram.mlt:
+ * include/pkgconf/mlt_arm_cma230_rom.h:
+ * include/pkgconf/mlt_arm_cma230_rom.ldi:
+ * include/pkgconf/mlt_arm_cma230_rom.mlt:
+ Align all sections on word boundaries
+
+2000-02-18 Jonathan Larmour
+
+ * cdl/hal_arm_cma230.cdl (CYGBLD_BUILD_GDB_STUBS): When
+ building stubs, define every dependency required here rather than
+ in the template
+
+2000-02-10 Jesper Skov
+
+ * include/plf_stub.h:
+ HAL_STUB_PLATFORM_STUBS_INIT->HAL_STUB_PLATFORM_INIT
+
+ * misc/STUBS_config:
+ * include/pkgconf/hal_arm_cma230.h:
+ Removed stubs as a legal startup type.
+
+2000-02-07 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Use cpu options when linking.
+
+2000-02-03 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Implements stubs.
+
+2000-02-02 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Use common stub code and build rule.
+
+2000-01-28 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Changed description.
+
+2000-01-26 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Fix CDL display.
+
+2000-01-24 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Add stubs build rule.
+
+2000-01-24 John Dallaway
+
+ * cdl/*.cdl:
+
+ Remove obsolete option CYGTST_TESTING_IDENTIFIER.
+
+2000-01-19 Hugo Tyson
+
+ * cdl/*.cdl: Add descriptions to a number of options &c which were
+ lacking same, also tidied up other typos as noticed en passant.
+
+1999-12-20 Gary Thomas
+
+ * cdl/hal_arm_cma230.cdl: Add -Wl for linker options.
+
+1999-12-16 Jonathan Larmour
+
+ * cdl/hal_arm_cma230.cdl: Add support for cma230T
+
+1999-12-08 Gary Thomas
+
+ * cdl/hal_arm_cma230.cdl: Update for CMA222 support.
+
+1999-12-02 Mark Salter
+
+ * include/hal_platform_setup.h: Add support for CMA222 (ARM710T).
+ * include/hal_cache.h: Add support for unified CMA222 caches.
+ * include/hal_platform_extras.h: New file with static MMU tables.
+
+1999-11-25 Jonathan Larmour
+
+ * include/pkgconf/mlt_arm_cma230T_stubs.ldi,
+ include/pkgconf/mlt_arm_cma230T_stubs.mlt:
+ Delete - we don't have stubs startup for thumb mode
+
+ * src/hal_diag.c: Conditionalize def of diag_buffer for only when it's
+ explicitly wanted and someone hacks the code
+ (hal_diag_write_char): Likewise
+
+1999-11-25 Gary Thomas
+
+ * include/pkgconf/mlt_arm_cma230_stubs.h: New file.
+
+ * include/pkgconf/mlt_arm_cma230T_rom.h:
+ * include/pkgconf/mlt_arm_cma230T_ram.h:
+ * include/pkgconf/mlt_arm_cma230_rom.h:
+ * include/pkgconf/mlt_arm_cma230_ram.h: Update "do not edit" strings.
+
+1999-11-09 Gary Thomas
+
+ * include/pkgconf/mlt_arm_cma230T_ram.h:
+ * include/pkgconf/mlt_arm_cma230T_rom.h:
+ * include/pkgconf/mlt_arm_cma230_ram.h:
+ * include/pkgconf/mlt_arm_cma230_rom.h: New files.
+
+ * include/pkgconf/mlt_arm_cma230T_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230T_ram.ldi:
+ * include/pkgconf/mlt_arm_cma230_rom.ldi:
+ * include/pkgconf/mlt_arm_cma230_rom.mlt: Update with correct memory layout.
+
+1999-11-09 John Dallaway
+
+ * include/pkgconf/hal_arm_cma230.h:
+
+ Add platform attribute to CYGPKG_HAL_ARM_CMA230.
+
+1999-11-09 Gary Thomas
+
+ * src/hal_diag.c: Honor GDB_DISABLE option.
+
+1999-11-01 Jesper Skov
+
+ * cdl/hal_arm_cma230.cdl: Remove define_proc comments.
+
+1999-10-28 Jesper Skov
+
+ * misc/PKGconf.mak: Don't strip symbols when making .img.
+
+1999-10-27 Jesper Skov
+
+ * src/hal_diag.c: Fixed conditional include.
+
+1999-10-26 Hugo Tyson
+
+ * src/hal_diag.c (hal_diag_write_char): Use new macro
+ CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION and its mate to control
+ stepping through gdb $O packet output.
+
+1999-10-26 John Dallaway
+
+ * cdl/hal_arm_cma230.cdl:
+
+ Rename CYGBLD_GLOBAL_PREFIX to
+ CYGBLD_GLOBAL_COMMAND_PREFIX
+
+1999-10-20 Simon FitzMaurice
+ * cdl/hal_arm_aeb.cdl:
+
+ Remove -Wl options from compiler flags
+
+1999-10-20 John Dallaway
+
+ * cdl/hal_arm_cma230.cdl:
+ Define memory layout-related CDL options.
+
+
+1999-10-19 Jonathan Larmour
+
+ * include/hal_cma230.h: Fix ifdefs and comments to be for
+ the cma230, not any other board
+ * misc/gdb_module.c: Likewise
+ * src/PKGconf.mak: Likewise
+
+1999-10-18 John Dallaway
+
+ * cdl/hal_arm_cma230.cdl:
+
+ Define CYGTST_TESTING_IDENTIFIER and
+ CYGBLD_GLOBAL_PREFIX as a functions of CYGHWR_THUMB.
+
+ Define CYGBLD_GLOBAL_CFLAGS and CYGBLD_GLOBAL_LDFLAGS.
+
+1999-10-14 Jesper Skov
+
+ * misc/STUBS_config: Updated.
+
+1999-10-06 John Dallaway
+
+ * cdl/hal_arm_cma230.cdl:
+ Define CYGTST_TESTING_IDENTIFIER.
+
+1999-09-16 Jesper Skov
+
+ * include/pkgconf/hal_arm_cma230.h:
+ * cdl/hal_arm_cma230.cdl:
+ Removed arm/thumb options [defined by platform template].
+
+1999-08-16 John Dallaway
+
+ * include/pkgconf/hal_arm_cma230.h:
+
+ Proper case various display strings.
+
+1999-08-12 John Dallaway
+
+ * cdl/hal_arm_cma230.cdl:
+ Define CYG_HAL_STARTUP and CYGHWR_MEMORY_LAYOUT.
+
+1999-06-09 John Dallaway
+
+ * include/pkgconf/hal_arm_cma320.h: Remove the platform attribute
+ from cdl_package CYGPKG_HAL_ARM_CMA230 since the platform
+ is now specified by cdl_option CYGHWR_HAL_ARM_CMA230_*.
+
+1999-06-07 Gary Thomas
+
+ * images/:
+ * images/gdb_module.rom: New files - prebuilt ROM image.
+
+ * misc/STUBS_config: Was using wrong platform.
+
+1999-06-04 Gary Thomas
+
+ * src/cma230_misc.c: Fix problems with interrupts. First the
+ interrupt source register (ISR) contains all pending interrupts
+ and thus needs to be manually masked against those that are
+ enabled. Second, the interrupt mask register does not read
+ back properly, so a memory shadow is necessary.
+
+ * include/pkgconf/hal_arm_cma230.h: Add 'cma230T' (Thumb mode)
+ as a platform.
+
+//===========================================================================
+//####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####
+//===========================================================================